コード例 #1
0
	def __init__(self,object):
		self.object = weakref.ref(object)
		self.color_flag = EMBorderDecoration.DEFAULT_COLOR
		self.display_list = None
		self.unprojected_points = [] # for determing mouse-border collision detection
		self.pressed = -1
		self.current_frame = ""
		self.moving = [-1,-1]
		self.init_frame_unproject_order()
		self.corner_sets = []
		self.bottom_border_height = 7
		self.top_border_height = 14
		self.border_width = 7
		self.border_depth = 6
		
		self.draw_x_enabled = True
		
		try:
			from EMAN2 import get_3d_font_renderer,FTGLFontMode
			self.font_renderer = get_3d_font_renderer()
			self.font_renderer.set_face_size(self.top_border_height-2)
			self.font_renderer.set_font_mode(FTGLFontMode.TEXTURE)
		except:
			self.font_renderer = None
			
		self.window_title = ""
		
		self.init_x_texture()
		
		self.do_clip = False
コード例 #2
0
ファイル: emapplication.py プロジェクト: jianglab/eman2
	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
コード例 #3
0
ファイル: emapplication.py プロジェクト: cpsemmens/eman2
	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
コード例 #4
0
	def __init__(self, string, fontSize, fontMode=FTGLFontMode.TEXTURE, depth=10, transform=None):
		EMShapeBase.__init__(self, parent=None, children=set(), transform=transform)
		#size
		self.setRenderString(string, fontSize)
		self.setFontMode(fontMode)
		self.setFontDepth(depth)
		
		self.font_renderer = get_3d_font_renderer()