Exemple #1
0
	def __init__(self, parent=None,enable_timer=False, application_control=True,winid=None):
		if parent==None : 
			self.qt_parent = EMParentWin(enable_timer)
			self.myparent=True			# we allocated the parent, responsible for cleaning it up
		else: 
			self.qt_parent=parent
			self.myparent=False			# we did not allocate our parent, so we should not get rid of it
		
		QtOpenGL.QGLWidget.__init__(self,self.qt_parent)
		if self.myparent : self.qt_parent.setup(self)
		
		self.inspector = None # a Qt Widget for changing display parameters, setting the data, accessing metadata, etc.
		self.winid=winid # a 'unique' identifier for the window used to restore locations on the screen
		
		self.image_change_count =  0# this is important when the user has more than one display instance of the same image, for instance in e2.py if 
		app = get_application()
		if app != None and application_control:
			app.attach_child(self)
		
		self.application_control = application_control
		self.file_name = ""
		self.disable_inspector = False
		
		self.makeCurrent()
		self.font_renderer = get_3d_font_renderer()
		if self.font_renderer == None : 
			print("FTGL not initialized. Please make sure you have FTGL installed, and configured for compilation in CMake. If using a binary, please report a problem to [email protected].")
			sys.exit(1)
		self.font_renderer.set_face_size(16)
		self.font_renderer.set_font_mode(FTGLFontMode.TEXTURE)
			
		self.busy = False #updateGL() does nothing when self.busy == True