def __init__(self, pdb_file, parent=None, children = set(), transform=None, radius=1.75): """ @param parent: should be an EMPDBItem3D instance for proper functionality. """ if not transform: transform = Transform() # Object initialization should not be put in the constructor. Causes issues EMPDBItem3D.__init__(self, pdb_file=pdb_file, parent=parent, children=children, transform=transform) 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.gq = None # will be a glu quadric self.dl = None # self.spheredl = 0 # this will be a low resolution sphere self.highresspheredl = 0 # high resolution sphere self.radius = radius self.colors = get_default_gl_colors() self.vwr = [self.get_vanderwaals_radius(an) for an in self.atom_names] self.coords = self.data - np.mean(self.data,axis=0)
def __init__(self, pdb_file, parent=None, children = set(), transform=None): """ @param parent: should be an EMPDBItem3D instance for proper functionality. """ if not transform: transform = Transform() # Object initialization should not be put in the constructor. Causes issues EMPDBItem3D.__init__(self, pdb_file=pdb_file, parent=parent, children=children, transform=transform) 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.gq = None # will be a glu quadric self.dl = None 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.radius = 100 self.colors = get_default_gl_colors() amino_acids_list = ["ALA","ARG","ASN","ASP","CYS","GLU","GLN","GLY","HIS","ILE","LEU","LYS","MET","PHE","PRO","SER","THR","TYR","TRP","VAL"] self.side_chains = {aa:[] for aa in amino_acids_list}
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,application=None,ensure_gl_context=True,application_control=True): EMImage3DGUIModule.__init__(self,application,ensure_gl_context=ensure_gl_context,application_control=application_control) #EMLightsDrawer.__init__(self) self.cam = Camera2(self) self.vdtools = EMViewportDepthTools(self) self.perspective = False self.colors = get_default_gl_colors() self.perspective = True # 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, i.e. an instance of an EM3DInspector self.radius = 100 self.font_renderer = None # will be a 3D fonts renderer
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 __init__(self): self.gl_lights = get_gl_lights_vector() # [GL_LIGHTS0, GL_LIGHTS1, ... GL_LIGHTS<MAX>] self.colors = get_default_gl_colors() # a dictionary of dictionaries self.gq=gluNewQuadric() gluQuadricDrawStyle(self.gq,GLU_FILL) gluQuadricNormals(self.gq,GLU_SMOOTH) gluQuadricOrientation(self.gq,GLU_OUTSIDE) gluQuadricTexture(self.gq,GL_FALSE) self.mouse_modes = [None, "directional", "point source"] self.current_mouse_mode = None self.current_light = GL_LIGHT0 # change this to change which light is drawn self.display_lights = False self.ball_dl = 0 # makes a funny kind of ball self.light_dl = 0 self.cylinderdl = 0 self.arc_t = 16 self.radius = 10 # This is an important variable. Set this value to adapt the way the lights appear in your scene. self.inspector = None self.mpressx = None self.mpressy = None
def load_colors(self): self.colors = get_default_gl_colors() self.isocolor = "bluewhite"
def load_colors(self): self.colors = get_default_gl_colors() self.currentcolor = "ruby"