def __init__(self, gl_widget): EM3DModel.__init__(self, gl_widget) DynamicFonts.__init__(self) self.init() self.initialized = True self.load_colors() self.cam = Camera2(self) self.cam.basicmapping = True #Ross's experiment... fixes translation self.brightness = 0 self.contrast = 10 self.glcontrast = 1.0 self.glbrightness = 0.0 self.rank = 1 self.inspector = None self.bgR = .85 self.bgG = .85 self.bgB = 1.0 self.bg_a = 1 self.lspacing = 75 # self.get_gl_widget().cam.default_z = -25 # this is me hacking # self.get_gl_widget().cam.cam_z = -25 # this is me hacking self.vdtools = EMViewportDepthTools(self) self.font_renderer = get_3d_font_renderer() self.font_renderer.set_font_mode(FTGLFontMode.EXTRUDE) self.font_renderer.set_depth(75) self.render_string = "hello world" EMLightsDrawer.__init__(self) self.setInit()
def __init__(self, gl_widget): EM3DModel.__init__(self, gl_widget) DynamicFonts.__init__(self) self.init() self.initialized = True self.load_colors() self.cam=Camera2(self) self.cam.basicmapping = True #Ross's experiment... fixes translation self.brightness = 0 self.contrast = 10 self.glcontrast = 1.0 self.glbrightness = 0.0 self.rank = 1 self.inspector=None self.bgR = .85 self.bgG = .85 self.bgB = 1.0 self.bg_a = 1 self.lspacing = 75 # self.get_gl_widget().cam.default_z = -25 # this is me hacking # self.get_gl_widget().cam.cam_z = -25 # this is me hacking self.vdtools = EMViewportDepthTools(self) self.font_renderer = get_3d_font_renderer() self.font_renderer.set_font_mode(FTGLFontMode.EXTRUDE) self.font_renderer.set_depth(75) self.render_string = "hello world" EMLightsDrawer.__init__(self) self.setInit()
def mouseReleaseEvent(self,event): if self.events_mode == "inspect": if self.current_hit != None: self.updateGL() # there needs to be a clear or something in order for the picking to work. This is bit of hack but our rendering function doesn't take long anyhow hit = self.get_hit(event) if hit == self.current_hit: self.emit(QtCore.SIGNAL("point_selected"),self.current_hit,event) else: #EM3DSymModel.mouseReleaseEvent(self,event) EM3DModel.mouseReleaseEvent(self, event) #behavior in EM3DSymModel is not what we want (needed in sibling classes?) self.current_hit = None else: #EM3DSymModel.mouseReleaseEvent(self,event) EM3DModel.mouseReleaseEvent(self, event) #behavior in EM3DSymModel is not what we want (needed in sibling classes?)
def __init__(self, gl_widget): self.fName = "" self.text = self.fName self.dl = None EM3DModel.__init__(self, gl_widget) # basic shapes will be stored in these lists self.gq = None # will be a glu quadric self.cylinderdl = 0 # will be a cylinder with no caps self.diskdl = 0 # this will be a flat disk self.spheredl = 0 # this will be a low resolution sphere self.highresspheredl = 0 # high resolution sphere self.cappedcylinderdl = 0 # a capped cylinder self.first_render_flag = True # this is used to catch the first call to the render function - so you can do an GL context sensitive initialization when you know there is a valid context self.inspector = None # will be the inspector self.radius = 100 self.perspective = False self.colors = get_default_gl_colors() self.vdtools = EMViewportDepthTools(self) self.cam = Camera2(self) self.cam.basicmapping = True #new by Ross self.side_chain_renderer = {} self.side_chain_renderer["ALA"] = AlaRenderer() self.side_chain_renderer["ARG"] = ArgRenderer() self.side_chain_renderer["ASP"] = AspRenderer() self.side_chain_renderer["ASN"] = AsnRenderer() self.side_chain_renderer["CYS"] = CysRenderer() self.side_chain_renderer["GLY"] = GlyRenderer() self.side_chain_renderer["GLN"] = GlnRenderer() self.side_chain_renderer["GLU"] = GluRenderer() self.side_chain_renderer["HIS"] = HisRenderer() self.side_chain_renderer["ILE"] = IleRenderer() self.side_chain_renderer["LEU"] = LeuRenderer() self.side_chain_renderer["LYS"] = LysRenderer() self.side_chain_renderer["MET"] = MetRenderer() self.side_chain_renderer["PHE"] = PheRenderer() self.side_chain_renderer["PRO"] = ProRenderer() self.side_chain_renderer["SER"] = SerRenderer() self.side_chain_renderer["THR"] = ThrRenderer() self.side_chain_renderer["TRP"] = TrpRenderer() self.side_chain_renderer["TYR"] = TyrRenderer() self.side_chain_renderer["VAL"] = ValRenderer()
def __init__(self, gl_widget, image=None): self.data = None EM3DModel.__init__(self, gl_widget) self.init() self.initialized = True self.inspector=None self.axes = [] self.axes.append( Vec3f(1,0,0) ) self.axes.append( Vec3f(0,1,0) ) self.axes.append( Vec3f(0,0,1) ) self.axes_idx = 2 self.track = False self.bright = 0 self.contrast = 1.0 self.busy = True if image : self.set_data(image)
def __init__(self, gl_widget, image=None): self.data = None EM3DModel.__init__(self, gl_widget) self.init() self.initialized = True self.inspector = None self.axes = [] self.axes.append(Vec3f(1, 0, 0)) self.axes.append(Vec3f(0, 1, 0)) self.axes.append(Vec3f(0, 0, 1)) self.axes_idx = 2 self.track = False self.bright = 0 self.contrast = 1.0 self.busy = True if image: self.set_data(image)
def __init__(self, gl_widget): EM3DModel.__init__(self, gl_widget) EMLightsDrawer.__init__(self) self.display_lights = True self.set_gl_widget(gl_widget) self.init() self.initialized = True self.cam=Camera2(self) self.brightness = 0 self.contrast = 10 self.glcontrast = 1.0 self.glbrightness = 0.0 self.rank = 1 self.inspector=None self.currentcolor = "emerald" self.vdtools = None self.highresspheredl = 0 # display list id self.draw_dl = 0
def __init__(self, gl_widget, image=None, enable_file_browse=False): self.data = None EM3DModel.__init__(self, gl_widget) self.init() self.initialized = True self.cam = Camera2(self) self.tex_name = 0 self.texture = False self.brightness = 0 self.contrast = 10 self.glcontrast = 1.0 self.glbrightness = 0.0 self.rank = 1 self.inspector = None self.data_copy = None self.vdtools = EMViewportDepthTools(self) self.enable_file_browse = enable_file_browse self.force_update = False if image: self.set_data(image)
def __init__(self,gl_widget, image=None,enable_file_browse=False): self.data = None EM3DModel.__init__(self, gl_widget) self.init() self.initialized = True self.cam=Camera2(self) self.tex_name = 0 self.texture = False self.brightness = 0 self.contrast = 10 self.glcontrast = 1.0 self.glbrightness = 0.0 self.rank = 1 self.inspector=None self.data_copy = None self.vdtools = EMViewportDepthTools(self) self.enable_file_browse = enable_file_browse self.force_update = False if image : self.set_data(image)
def __init__(self, gl_widget, image=None): self.data = None EM3DModel.__init__(self, gl_widget) self.init() self.initialized = True self.initializedGL= False self.inspector=None self.tex_names_list = [] # A storage object, used to remember and later delete texture names self.axes_idx = -1 self.axes = [] self.axes.append(Vec3f(1,0,0)) self.axes.append(Vec3f(0,1,0)) self.axes.append(Vec3f(0,0,1)) #self.axes.append( Vec3f(-1,0,0) ) #self.axes.append( Vec3f(0,-1,0) ) #self.add_render_axis(1,1,1) #self.add_render_axis(-1,1,1) #self.add_render_axis(-1,-1,1) #self.add_render_axis(1,-1,1) #self.add_render_axis(1,1,0) #self.add_render_axis(-1,1,0) #self.add_render_axis(-1,-1,0) #self.add_render_axis(1,-1,0) #self.add_render_axis(0,1,1) #self.add_render_axis(0,-1,1) #self.add_render_axis(1,0,1) #self.add_render_axis(-1,0,1) if image : self.set_data(image)
def __init__(self, gl_widget): EM3DModel.__init__(self, gl_widget) self.init() self.initialized = True self.cam=Camera2(self) self.brightness = 0 self.contrast = 10 self.glcontrast = 1.0 self.glbrightness = 0.0 self.rank = 1 self.inspector=None self.colors = get_default_gl_colors() self.currentcolor = "bluewhite" self.vdtools = EMViewportDepthTools2(self.get_gl_widget()) self.get_gl_widget().cam.default_z = -1.25*50 # this is me hacking self.get_gl_widget().cam.cam_z = -1.25*50 # this is me hacking self.dl = None # display list id
def mouseDoubleClickEvent(self, event): if self.current_mouse_mode: EMLightsDrawer.mouseDoubleClickEvent(self, event) else: EM3DModel.mouseDoubleClickEvent(self, event)
def mouseReleaseEvent(self, event): if self.current_mouse_mode: EMLightsDrawer.mouseReleaseEvent(self, event) else: EM3DModel.mouseReleaseEvent(self, event)