rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
print "draw: bond a1---c1: ", self.a1pos, self.c1 | via dispdef from the calling molecule -- this might cause bugs if some | |
print "draw: bond a2---c2: ", self.a2pos, self.c2 | via dispdef from the calling molecule -- this might cause bugs if some | |
def _C_debugfactor(self): "make dx wiggle back and forth as we redraw, but only for use in computing our externally seen layout box" import env c = env.redraw_counter where = c % 20 if where > 10: where = 20 - where res = weighted_ave(where / 10.0, 1.0, -1.0) print "computing df in %r, ipath %r, c = %r, res = %r" % ... | dx = vec[0] * -1 dy = vec[1] * -1 | def _C_debugfactor(self): "make dx wiggle back and forth as we redraw, but only for use in computing our externally seen layout box" # only for debugging -- remove when works except as eg code ##e usage tracking to inval this as needed is nim -- shouldn't matter yet, # since we make new instances every frame anyway [06... |
print "start drawing in %r, ipath %r" % (self, self.ipath,) | def draw(self): print "start drawing in %r, ipath %r" % (self, self.ipath,) assert self._e_is_instance self.move(None, 0) self.thing.draw() # draw kid number 0 -- ##k but how did we at some point tell that kid that it's number 0, so it knows its ipath?? ##k is it worth adding index or ipath as a draw-arg? (I doubt it, ... | |
print "done drawing in %r, ipath %r" % (self, self.ipath,) | def draw(self): print "start drawing in %r, ipath %r" % (self, self.ipath,) assert self._e_is_instance self.move(None, 0) self.thing.draw() # draw kid number 0 -- ##k but how did we at some point tell that kid that it's number 0, so it knows its ipath?? ##k is it worth adding index or ipath as a draw-arg? (I doubt it, ... | |
self.nframes = 300 | self.nframes = 900 | def __init__(self, assy): SimSetupDialog.__init__(self) self.assy = assy self.nframes = 300 self.temp = 300 self.stepsper = 10 self.timestep = 10 self.filename = '' self.fileform = '' self.mext = '.dpb' |
self.invalidate_attrs( self.invalidatable_attrs() ) | attrs = self.invalidatable_attrs() if debug_1855: print "debug_1855: part %r _undo_update_always will inval %r" % (self, attrs,) self.invalidate_attrs( attrs) | def _undo_update_always(self): #bruce 060224 "This is run on every Part still around after an Undo or Redo op, whether or not it was modified by that op." # (though to be honest, that's due to a kluge, as of 060224 -- it won't yet run this on any other class!) self.invalidate_attrs( self.invalidatable_attrs() ) # espec... |
if self.selwhat != SELWHAT_ATOMS: return {} | if debug_1855: print "debug_1855: part %r _recompute_selatoms, self.selwhat is %r, so we %s assume result is {} without checking" % \ ( self, self.selwhat, {False:"WON'T",True:"WILL (not anymore)"}[self.selwhat != SELWHAT_ATOMS] ) | def _recompute_selatoms(self): if self.selwhat != SELWHAT_ATOMS: # optimize, by trusting selwhat to be correct. # This is slightly dangerous until changes to assy's current selgroup/part # also fix up selatoms, and perhaps even verify no atoms selected in new part. # But it's likely that there are no such bugs, so we c... |
if len(atm.realNeighbors()) == 1: | if atm.element.symbol == 'C' and len(atm.realNeighbors()) == 1: | def insert_output(self, outfiles, params, name): ## return self.create_methane_test(params, name) if debug_run(): print "inserting output from",outfiles ###@@@ # modified from dna generator's local function insertmmp(filename, tfm) assert len(outfiles) == 1 # for now filename = outfiles[0] assert filename.endswith('.mm... |
if len(atm.realNeighbors()) == 2: | if atm.element.symbol == 'C' and len(atm.realNeighbors()) == 2: | def insert_output(self, outfiles, params, name): ## return self.create_methane_test(params, name) if debug_run(): print "inserting output from",outfiles ###@@@ # modified from dna generator's local function insertmmp(filename, tfm) assert len(outfiles) == 1 # for now filename = outfiles[0] assert filename.endswith('.mm... |
self.point2 = None self.point3 = None | self.firstDraw = True | def leftDown(self, event): """Compute the rubber band window starting point, which lies on the near clipping plane, projecting into the same point that current cursor points at on the screen plane""" self.pWxy = (event.pos().x(), self.o.height - event.pos().y()) p1 = A(gluUnProject(self.pWxy[0], self.pWxy[1], 0.005)) ... |
def computePoints(self): """Compute the left bottom(point2) and right top (point3) """ rt = self.o.right up = self.o.up self.point2 = self.pStart + up*dot(up, self.pPrev - self.pStart) self.point3 = self.pStart + rt*dot(rt, self.pPrev - self.pStart) | def computePoints(self): """Compute the left bottom(point2) and right top (point3) """ rt = self.o.right up = self.o.up self.point2 = self.pStart + up*dot(up, self.pPrev - self.pStart) self.point3 = self.pStart + rt*dot(rt, self.pPrev - self.pStart) | |
if self.point2 and self.point3: drawer.drawRubberBand(self.pStart, self.pPrev, self.point2, self.point3, self.rbwcolor) | if not self.firstDraw: drawer.drawrectangle(self.pStart, self.pPrev, self.o.up, self.o.right, self.rbwcolor) self.firstDraw = False | def leftDrag(self, event): """Compute the changing rubber band window ending point. Erase the previous window, draw the new window """ cWxy = (event.pos().x(), self.o.height - event.pos().y()) if self.point2 and self.point3: #Erase the previous rubber window drawer.drawRubberBand(self.pStart, self.pPrev, self.point... |
self.computePoints() drawer.drawRubberBand(self.pStart, self.pPrev, self.point2, self.point3, self.rbwcolor) | drawer.drawrectangle(self.pStart, self.pPrev, self.o.up, self.o.right, self.rbwcolor) | def leftDrag(self, event): """Compute the changing rubber band window ending point. Erase the previous window, draw the new window """ cWxy = (event.pos().x(), self.o.height - event.pos().y()) if self.point2 and self.point3: #Erase the previous rubber window drawer.drawRubberBand(self.pStart, self.pPrev, self.point... |
drawer.drawRubberBand(self.pStart, self.pPrev, self.point2, self.point3, self.rbwcolor) | drawer.drawrectangle(self.pStart, self.pPrev, self.o.up, self.o.right, self.rbwcolor) | def leftUp(self, event): """"Erase the final rubber band window and do zoom if user indeed draws a rubber band window""" cWxy = (event.pos().x(), self.o.height - event.pos().y()) zoomX = (abs(cWxy[0] - self.pWxy[0]) + 0.0) / (self.o.width + 0.0) zoomY = (abs(cWxy[1] - self.pWxy[1]) + 0.0) / (self.o.height + 0.0) |
b = self.get_neighbor_bond(a1, a2) | b = a1.get_neighbor_bond(a2) | def Backup(self): if self.bondable_pairs_atoms: for a1, a2 in self.bondable_pairs_atoms: b = self.get_neighbor_bond(a1, a2) if b: b.bust() # Then I need to separate and rename the new chunk back to it's original name. for chunk in self.merged_chunks: print "Restore chunk: ", chunk.name self.find_bondable_pairs() # Fin... |
self.find_bondable_pairs() self.o.gl_update() def get_neighbor_bond(self, a1, a2): '''Return the bond between atoms a1 and a2, or None if none exist. ''' for b in a1.bonds[:]: if b.other(a1) == a2: return b return None | self.find_bondable_pairs() self.o.gl_update() else: msg = "Fuse Chunks: No bonds have been made yet. Undo ignored." self.w.history.message(redmsg(msg)) | def Backup(self): if self.bondable_pairs_atoms: for a1, a2 in self.bondable_pairs_atoms: b = self.get_neighbor_bond(a1, a2) if b: b.bust() # Then I need to separate and rename the new chunk back to it's original name. for chunk in self.merged_chunks: print "Restore chunk: ", chunk.name self.find_bondable_pairs() # Fin... |
if selSense == 0: | self.bondable_pairs = [] self.ways_of_bonding = {} if selSense == 0: | def EndPick(self, event, selSense): """Pick if click. Only one chunk can be selected . """ if not self.picking: return self.picking = False |
self.bondable_pairs = [] self.ways_of_bonding = {} | def EndPick(self, event, selSense): """Pick if click. Only one chunk can be selected . """ if not self.picking: return self.picking = False | |
self.done_btn = QToolButton(self.body_frame,"done_btn") | self.done_btn = QPushButton(self.body_frame,"done_btn") self.done_btn.setMaximumSize(QSize(40,32767)) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.abort_btn = QToolButton(self.body_frame,"abort_btn") | self.abort_btn = QPushButton(self.body_frame,"abort_btn") self.abort_btn.setMaximumSize(QSize(40,32767)) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.preview_btn = QToolButton(self.body_frame,"preview_btn") | self.preview_btn = QPushButton(self.body_frame,"preview_btn") self.preview_btn.setMaximumSize(QSize(40,32767)) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.whatsthis_btn = QToolButton(self.body_frame,"whatsthis_btn") | self.whatsthis_btn = QPushButton(self.body_frame,"whatsthis_btn") self.whatsthis_btn.setMaximumSize(QSize(40,32767)) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.resize(QSize(206,464).expandedTo(self.minimumSizeHint())) | self.resize(QSize(236,464).expandedTo(self.minimumSizeHint())) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.o.assy.checkpicked(always_print = 0) | if platform.atom_debug: self.o.assy.checkpicked(always_print = 0) | def Draw(self): """Generic Draw method, with drawing code common to all modes. Specific modes should call this within their own Draw method, unless they have a good reason not to. """ if self.o.cSysToggleButton: drawer.drawaxes(5, -self.o.pov) # bruce 040929 debug code -- always check for bugs in atom.picked and # mol.... |
traceFile = open(self.traceFile) traceLines = traceFile.readlines() header = traceLines[2] hlist = string.split(header, ": ") self.date = hlist[1][:-1] header = traceLines[4] hlist = string.split(header, ": ") self.dpbname = hlist[1][:-1] hloc = 12 header = traceLines[hloc-1] hlist = string.split(header, " ") ... | traceFile = open(self.traceFile, 'rU') traceLines = traceFile.readlines() traceFile.close() headerLines = [] field_to_content = {} columns_lineno = -1 number_of_columns = 0 for line in traceLines: if not line.startswith(" break headerLines.append(line) if ":" in line and columns_lineno == -1: field, content = line.s... | def setup(self): """Setup the Plot Tool dialog, including populating the combobox with plotting options. """ # To setup the Plot Tool, we need to do the following: # 1. Make sure there is a valid DPB file. This is temporary since the Plot Tool will # soon allow the user to open and plot any trace file. # 2. From th... |
gname = traceLines[hloc + i] self.plot_combox.insertItem(gname[2:-1]) | self.plot_combox.insertItem( column_header[i] ) | def setup(self): """Setup the Plot Tool dialog, including populating the combobox with plotting options. """ # To setup the Plot Tool, we need to do the following: # 1. Make sure there is a valid DPB file. This is temporary since the Plot Tool will # soon allow the user to open and plot any trace file. # 2. From th... |
traceFile.close() | return | def setup(self): """Setup the Plot Tool dialog, including populating the combobox with plotting options. """ # To setup the Plot Tool, we need to do the following: # 1. Make sure there is a valid DPB file. This is temporary since the Plot Tool will # soon allow the user to open and plot any trace file. # 2. From th... |
from prefs_constants import watchRealtimeMinimization_prefs_key prefer_dylib_sim = env.prefs[watchRealtimeMinimization_prefs_key] if prefer_dylib_sim: use_dylib_sim = True | prefer_standalone_sim = debug_pref("force use of standalone sim", Choice_boolean_False, prefs_key = 'use-standalone-sim', non_debug = True) if prefer_standalone_sim: use_dylib_sim = False | def __init__(self, part, mflag, simaspect = None, use_dylib_sim = use_pyrex_sim, cmdname = "Simulator"): # [bruce 051230 added use_dylib_sim; revised 060102; 060106 added cmdname] "set up external relations from the part we'll operate on; take mflag since someday it'll specify the subclass to use" from debug_prefs impo... |
if use_dylib_sim: env.history.message(greenmsg("this simulator run will use experimental pyrex interface if it can be imported properly")) | if not use_dylib_sim: env.history.message(greenmsg("Using the standalone simulator (not the pyrex simulator)")) | def __init__(self, part, mflag, simaspect = None, use_dylib_sim = use_pyrex_sim, cmdname = "Simulator"): # [bruce 051230 added use_dylib_sim; revised 060102; 060106 added cmdname] "set up external relations from the part we'll operate on; take mflag since someday it'll specify the subclass to use" from debug_prefs impo... |
def setup_invalidate(self): """Semi-private method for bonds. Invalidates cached geometric values related to drawing the bond. This must be called whenever the position or element of either bonded | def setup_invalidate(self): """Semi-private method for bonds -- used by code in Bond, atom and chunk classes. Invalidates cached geometric values related to drawing the bond. This must be called whenever the position or element of either bonded | def setup_invalidate(self): """Semi-private method for bonds. Invalidates cached geometric values related to drawing the bond. This must be called whenever the position or element of either bonded atom is changed, or when either atom's molecule changes if this affects whether it's an external bond (since the coordinate... |
is different in each case). | is different in each case), UNLESS either bonded chunk's invalidate_all_bonds() methods is called (which increment a counter checked by our __getattr__). | def setup_invalidate(self): """Semi-private method for bonds. Invalidates cached geometric values related to drawing the bond. This must be called whenever the position or element of either bonded atom is changed, or when either atom's molecule changes if this affects whether it's an external bond (since the coordinate... |
try: del self.c1 except AttributeError: pass else: del self.c2, self.center, self.a1pos, self.a2pos, self.toolong | self._valid_data = None | def setup_invalidate(self): """Semi-private method for bonds. Invalidates cached geometric values related to drawing the bond. This must be called whenever the position or element of either bonded atom is changed, or when either atom's molecule changes if this affects whether it's an external bond (since the coordinate... |
def __setup_update(self): """Private method. Before bruce 041104 this was called self.setup() and was called more widely; now the method of that name just invalidates the same attrs we recompute, by deleting them. This method is only called by __getattr__ when we need to recompute one or more of certain attributes, to ... | def _recompute_geom(self, abs_coords = False): """[private method meant for our __getattr__ method, and for writepov] Recompute and return (but don't store) the 6-tuple (a1pos, c1, center, c2, a2pos, toolong), which describes this bond's geometry, useful for drawing (OpenGL or writepov) and for self.ubp(). If abs_coord... | def __setup_update(self): """Private method. Before bruce 041104 this was called self.setup() and was called more widely; now the method of that name just invalidates the same attrs we recompute, by deleting them. This method is only called by __getattr__ when we need to recompute one or more of certain attributes, to ... |
self.a1pos = self.atom1.posn() self.a2pos = self.atom2.posn() | a1pos = atom1.posn() a2pos = atom2.posn() | def __setup_update(self): """Private method. Before bruce 041104 this was called self.setup() and was called more widely; now the method of that name just invalidates the same attrs we recompute, by deleting them. This method is only called by __getattr__ when we need to recompute one or more of certain attributes, to ... |
self.a1pos = self.atom1.baseposn() self.a2pos = self.atom2.baseposn() vec = self.a2pos - self.a1pos leng = 0.98 * vlen(vec) | a1pos = atom1.baseposn() a2pos = atom2.baseposn() vec = a2pos - a1pos leng = 0.98 * vlen(vec) | def __setup_update(self): """Private method. Before bruce 041104 this was called self.setup() and was called more widely; now the method of that name just invalidates the same attrs we recompute, by deleting them. This method is only called by __getattr__ when we need to recompute one or more of certain attributes, to ... |
rcov1 = self.atom1.atomtype.rcovalent rcov2 = self.atom2.atomtype.rcovalent self.c1 = self.a1pos + vec*rcov1 self.c2 = self.a2pos - vec*rcov2 self.toolong = (leng > rcov1 + rcov2) self.center = (self.c1 + self.c2) / 2.0 return def __getattr__(self, attr): """Called when one of the attrs computed by self.__setup_update... | rcov1 = atom1.atomtype.rcovalent rcov2 = atom2.atomtype.rcovalent c1 = a1pos + vec*rcov1 c2 = a2pos - vec*rcov2 toolong = (leng > rcov1 + rcov2) center = (c1 + c2) / 2.0 return a1pos, c1, center, c2, a2pos, toolong atom1 = atom2 = _valid_data = None _saved_geom = None def __getattr__(self, attr): """Return attributes... | def __setup_update(self): """Private method. Before bruce 041104 this was called self.setup() and was called more widely; now the method of that name just invalidates the same attrs we recompute, by deleting them. This method is only called by __getattr__ when we need to recompute one or more of certain attributes, to ... |
if attr not in ('a1pos','a2pos','c1','c2','center','toolong'): | current_data = (self.atom1.molecule.bond_inval_count, self.atom2.molecule.bond_inval_count) if self._valid_data != current_data: self._valid_data = current_data self._saved_geom = geom = self._recompute_geom() else: geom = self._saved_geom if attr == 'geom': return geom elif attr == 'a1pos': return geom[0] elif att... | def __getattr__(self, attr): # bond.__getattr__ #bruce 041104 """Called when one of the attrs computed by self.__setup_update() is needed, but was not yet computed or was deleted since last computed (as our way of invalidating it). Also might be called for an arbitrary missing attr due to a bug in the calling code. Now... |
self.__setup_update() return self.__dict__[attr] | pass | def __getattr__(self, attr): # bond.__getattr__ #bruce 041104 """Called when one of the attrs computed by self.__setup_update() is needed, but was not yet computed or was deleted since last computed (as our way of invalidating it). Also might be called for an arbitrary missing attr due to a bug in the calling code. Now... |
if not self.toolong: drawline(color1, self.a1pos, self.center) drawline(color2, self.a2pos, self.center) | a1pos, c1, center, c2, a2pos, toolong = self.geom if not toolong: drawline(color1, a1pos, center) drawline(color2, a2pos, center) | via dispdef from the calling molecule -- this might cause bugs if some |
drawline(color1, self.a1pos, self.c1) drawline(color2, self.a2pos, self.c2) drawline(red, self.c1, self.c2) if disp == diCPK: drawcylinder(col or bondColor, self.a1pos, self.a2pos, 0.1) if disp == diTUBES: | drawline(color1, a1pos, c1) drawline(color2, a2pos, c2) drawline(red, c1, c2) elif disp == diCPK: a1pos, c1, center, c2, a2pos, toolong = self.geom drawcylinder(col or bondColor, a1pos, a2pos, 0.1) elif disp == diTUBES: a1pos, c1, center, c2, a2pos, toolong = self.geom | via dispdef from the calling molecule -- this might cause bugs if some |
if not self.toolong: | if not toolong: if v1 and v2 and (not color1 != color2): drawcylinder(color1, a1pos, a2pos, TubeRadius) else: if v1: drawcylinder(color1, a1pos, center, TubeRadius) if v2: drawcylinder(color2, a2pos, center, TubeRadius) if not (v1 and v2): drawsphere(black, center, TubeRadius, level) else: drawcylinder(red, c1, c2, Tu... | via dispdef from the calling molecule -- this might cause bugs if some |
drawcylinder(color1, self.a1pos, self.center, TubeRadius) | drawcylinder(color1, a1pos, c1, TubeRadius) else: drawsphere(black, c1, TubeRadius, level) | via dispdef from the calling molecule -- this might cause bugs if some |
drawcylinder(color2, self.a2pos, self.center, TubeRadius) if not (v1 and v2): drawsphere(black, self.center, TubeRadius, level) else: drawcylinder(red, self.c1, self.c2, TubeRadius) if v1: drawcylinder(color1, self.a1pos, self.c1, TubeRadius) | drawcylinder(color2, a2pos, c2, TubeRadius) | via dispdef from the calling molecule -- this might cause bugs if some |
drawsphere(black, self.c1, TubeRadius, level) if v2: drawcylinder(color2, self.a2pos, self.c2, TubeRadius) else: drawsphere(black, self.c2, TubeRadius, level) | drawsphere(black, c2, TubeRadius, level) | via dispdef from the calling molecule -- this might cause bugs if some |
disp=max(self.atom1.display, self.atom2.display) | "Write this bond to a povray file (always using absolute coords, even for internal bonds)." disp = max(self.atom1.display, self.atom2.display) | def writepov(self, file, dispdef, col): ##Huaicai 1/15/05: It seems the attributes from __setup__update() is not correct, ## at least for pov file writing, so compute it here locally. To fix bug 346,347 disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp = dispdef color1 = col or self.atom1.elem... |
else: if not self.toolong: file.write("tube2(" + povpoint(a1pos) + "," + stringVec(color1) + "," + povpoint(center) + "," + povpoint(a2pos) + "," + stringVec(color2) + ")\n") | else: if not toolong: file.write("tube2(" + povpoint(a1pos) + "," + stringVec(color1) + "," + povpoint(center) + "," + povpoint(a2pos) + "," + stringVec(color2) + ")\n") | def writepov(self, file, dispdef, col): ##Huaicai 1/15/05: It seems the attributes from __setup__update() is not correct, ## at least for pov file writing, so compute it here locally. To fix bug 346,347 disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp = dispdef color1 = col or self.atom1.elem... |
file.write("tube1(" + povpoint(a1pos) + "," + stringVec(color1) + "," + povpoint(c1) + "," + povpoint(c2) + "," + povpoint(a2pos) + "," + stringVec(color2) + ")\n") | file.write("tube1(" + povpoint(a1pos) + "," + stringVec(color1) + "," + povpoint(c1) + "," + povpoint(c2) + "," + povpoint(a2pos) + "," + stringVec(color2) + ")\n") return | def writepov(self, file, dispdef, col): ##Huaicai 1/15/05: It seems the attributes from __setup__update() is not correct, ## at least for pov file writing, so compute it here locally. To fix bug 346,347 disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp = dispdef color1 = col or self.atom1.elem... |
if not debug_events: return 0 | def debug_event(self, event, funcname, permit_debug_menu_popup = 0): """Debugging method -- no effect on normal users. Does two things -- if a global flag is set, prints info about the event; if a certain modifier key combination is pressed, and if caller passed permit_debug_menu_popup = 1, puts up an undocumented debu... | |
if permit_debug_menu_popup and ((event.state() & debugButtons) == debugButtons): | if debug_menu_enabled and permit_debug_menu_popup and ((event.state() & debugButtons) == debugButtons): | def debug_event(self, event, funcname, permit_debug_menu_popup = 0): """Debugging method -- no effect on normal users. Does two things -- if a global flag is set, prints info about the event; if a certain modifier key combination is pressed, and if caller passed permit_debug_menu_popup = 1, puts up an undocumented debu... |
try: after = event.stateAfter() except: after = "<no stateAfter>" print "%s: event; state = %r, stateAfter = %r; time = %r" % (funcname, event.state(), after, time.asctime()) | if debug_events: try: after = event.stateAfter() except: after = "<no stateAfter>" print "%s: event; state = %r, stateAfter = %r; time = %r" % (funcname, event.state(), after, time.asctime()) | def debug_event(self, event, funcname, permit_debug_menu_popup = 0): """Debugging method -- no effect on normal users. Does two things -- if a global flag is set, prints info about the event; if a certain modifier key combination is pressed, and if caller passed permit_debug_menu_popup = 1, puts up an undocumented debu... |
self.debug_menu = self.makemenu( self.debug_menu_items() ) | def __init__(self, assem, master=None, name=None, win=None): QGLWidget.__init__(self,master,name) global paneno self.name = str(paneno) paneno += 1 self.initialised = 0 | |
elif name in 'out': | elif name == 'out': | def __getattr__(self, name): if name == 'lineOfSight': return self.quat.unrot(V(0,0,-1)) elif name == 'right': return self.quat.unrot(V(1,0,0)) elif name == 'left': return self.quat.unrot(V(-1,0,0)) elif name == 'up': return self.quat.unrot(V(0,1,0)) elif name == 'down': return self.quat.unrot(V(0,-1,0)) elif name in '... |
def setViewNormalToOrig(self): | def setViewNormalTo(self): | def setViewNormalToOrig(self): '''Set view to the normal vector of the plane defined by 3 or more selected atoms or a jig's (Motor or RectGadget) axis. ''' cmd = greenmsg("Set View Normal To: ") chunks = self.assy.selmols jigs = self.assy.getSelectedJigs() atoms = self.assy.selatoms_list() if len(chunks) == 1 and len... |
elif len(atoms) < 2: msg = redmsg("Please select some atoms, jigs, and/or chunks, covering at least 2 atoms") | elif len(atoms) < 3: msg = redmsg("Please select some atoms, jigs, and/or chunks, covering at least 3 atoms") | def setViewNormalToOrig(self): '''Set view to the normal vector of the plane defined by 3 or more selected atoms or a jig's (Motor or RectGadget) axis. ''' cmd = greenmsg("Set View Normal To: ") chunks = self.assy.selmols jigs = self.assy.getSelectedJigs() atoms = self.assy.selatoms_list() if len(chunks) == 1 and len... |
def setViewNormalTo(self): | def setViewNormalTo_NEW(self): | def setViewNormalTo(self): '''Set view to the normal vector of the plane defined by 3 or more selected atoms or a jig's (Motor or RectGadget) axis. ''' cmd = greenmsg("Set View Normal To: ") # This implementation has two serious problems: # 1. it selects a normal based on the atoms and not the axis of a jig (e.g. a ... |
cmd = greenmsg("Set View Normal To: ") | def setViewNormalTo(self): '''Set view to the normal vector of the plane defined by 3 or more selected atoms or a jig's (Motor or RectGadget) axis. ''' cmd = greenmsg("Set View Normal To: ") # This implementation has two serious problems: # 1. it selects a normal based on the atoms and not the axis of a jig (e.g. a ... | |
cmd = greenmsg("Set View Normal To: ") | def setViewNormalTo(self): '''Set view to the normal vector of the plane defined by 3 or more selected atoms or a jig's (Motor or RectGadget) axis. ''' cmd = greenmsg("Set View Normal To: ") # This implementation has two serious problems: # 1. it selects a normal based on the atoms and not the axis of a jig (e.g. a ... | |
if len(atoms) < 2: msg = redmsg("Please select some atoms, jigs, and/or chunks, covering at least 2 atoms") | if len(atoms) < 3: msg = redmsg("Please select some atoms, jigs, and/or chunks, covering at least 3 atoms") | def setViewNormalTo(self): '''Set view to the normal vector of the plane defined by 3 or more selected atoms or a jig's (Motor or RectGadget) axis. ''' cmd = greenmsg("Set View Normal To: ") # This implementation has two serious problems: # 1. it selects a normal based on the atoms and not the axis of a jig (e.g. a ... |
if self.lastSelectedItem: modelItem = self.treeItems[self.lastSelectedItem] if isinstance(modelItem, molecule): modelItem.setSelectionState(self, modelItem, False) | if self.lastSelectedItem and self.treeItems.has_key(self.lastSelectedItem): model = self.treeItems[self.lastSelectedItem] if isinstance(model, molecule): model.setSelectionState(self, model, False) | def treeItemChanged(self, listItem): if self.lastSelectedItem: modelItem = self.treeItems[self.lastSelectedItem] if isinstance(modelItem, molecule): modelItem.setSelectionState(self, modelItem, False) |
modelItem = self.treeItems[listItem] if isinstance(modelItem, molecule): modelItem.setSelectionState(self, modelItem, True) | model = self.treeItems[listItem] if isinstance(model, molecule): model.setSelectionState(self, model, True) | def treeItemChanged(self, listItem): if self.lastSelectedItem: modelItem = self.treeItems[self.lastSelectedItem] if isinstance(modelItem, molecule): modelItem.setSelectionState(self, modelItem, False) |
global use_c_renderer | global use_c_renderer, allow_color_sorting | def update(self): #bruce 051126 added this method """Update attributes from current drawing-related prefs stored in prefs db cache. This should be called at the start of each complete redraw, or whenever the user changes these global prefs values (whichever is more convenient). (Note: When this is called during redraw,... |
if quux_module_import_succeeded: try: use_c_renderer = env.prefs[use_c_renderer_key] except KeyError: use_c_renderer = False else: use_c_renderer = False | allow_color_sorting = env.prefs.get(allow_color_sorting_prefs_key, allow_color_sorting_default) use_c_renderer = quux_module_import_succeeded and \ env.prefs.get(use_c_renderer_prefs_key, use_c_renderer_default) | def update(self): #bruce 051126 added this method """Update attributes from current drawing-related prefs stored in prefs db cache. This should be called at the start of each complete redraw, or whenever the user changes these global prefs values (whichever is more convenient). (Note: When this is called during redraw,... |
try: res += (env.prefs[use_c_renderer_key],) except KeyError: pass | res += (quux_module_import_succeeded and env.prefs.get(use_c_renderer_prefs_key, use_c_renderer_default),) res += (env.prefs.get(allow_color_sorting_prefs_key, allow_color_sorting_default),) | def materialprefs_summary(self): #bruce 051126 """Return a Python data object summarizing our prefs which affect chunk display lists, so that memoized display lists should become invalid (due to changes in this object) if and only if this value becomes different. """ res = (self.enable_specular_highlights,) if self.ena... |
deferment. Right now this is only ColorSorter.schedule (see above)""" | deferment. Right now this is only ColorSorter.schedule (see below)""" | def drawsphere_worker(params): """Draw a sphere. Receive parameters through a sequence so that this function and its parameters can be passed to another function for deferment. Right now this is only ColorSorter.schedule (see above)""" (pos, radius, detailLevel) = params glPushMatrix() glTranslatef(pos[0], pos[1], p... |
deferment. Right now this is only ColorSorter.schedule (see above)""" | deferment. Right now this is only ColorSorter.schedule (see below)""" | def drawcylinder_worker(params): """Draw a cylinder. Receive parameters through a sequence so that this function and its parameters can be passed to another function for deferment. Right now this is only ColorSorter.schedule (see above)""" global CylList, CapList (pos1, pos2, radius, capped) = params glPushMatrix()... |
def _invoke_immediately(color, func, params): """\ Internal function that invokes 'scheduled' operations right now, outside a start/finish. """ ColorSorter._immediate += 1 name = ColorSorter._gl_name_stack[-1] if name: glPushName(name) apply_material(color) func(params) if name: glPopName() | def schedule(color, func, params): if ColorSorter.sorting and allow_color_sorting: ColorSorter._add_to_sorter(color, func, params) else: ColorSorter._immediate += 1 name = ColorSorter._gl_name_stack[-1] if name: glPushName(name) apply_material(color) func(params) if name: glPopName() | def _invoke_immediately(color, func, params): """\ Internal function that invokes 'scheduled' operations right now, outside a start/finish. """ ColorSorter._immediate += 1 # 20060216 We know we can do this here because the stack is # only ever one element deep. |
_invoke_immediately = staticmethod(_invoke_immediately) schedule = _invoke_immediately | schedule = staticmethod(schedule) | def _invoke_immediately(color, func, params): """\ Internal function that invokes 'scheduled' operations right now, outside a start/finish. """ ColorSorter._immediate += 1 # 20060216 We know we can do this here because the stack is # only ever one element deep. |
ColorSorter.schedule = staticmethod(ColorSorter._add_to_sorter) | def start(): """\ Start sorting - objects provided to "schedule", "schedule_sphere", and "schedule_cylinder" will be stored for a sort at the time "finish" is called. """ assert not ColorSorter.sorting, "Called ColorSorter.start but already sorting?!" ColorSorter.sorting = True if use_c_renderer and ColorSorter.sorting... | |
ColorSorter.schedule = staticmethod(ColorSorter._invoke_immediately) | def finish(): """\ Finish sorting - objects recorded since "start" will be sorted and invoked now. """ from debug_prefs import debug_pref, Choice_boolean_False debug_which_renderer = debug_pref("debug print which renderer", Choice_boolean_False) #bruce 060314, imperfect but tolerable if use_c_renderer: quux.shapeRender... | |
from debug_prefs import debug_pref, Choice_boolean_True from debug_prefs import Choice_boolean_False choices = [Choice_boolean_False, Choice_boolean_True] initial_choice = choices[use_c_renderer_initial_state] | initial_choice = choices[use_c_renderer_default] | def setup(): global CylList, diamondGridList, CapList, CubeList, solidCubeList global sphereList, rotSignList, linearLineList, linearArrowList global circleList, lonsGridList, lonsEdges, lineCubeList, SiCGridList global use_c_renderer_pref listbase = glGenLists(numSphereSizes + 21) for i in range(numSphereSizes): sph... |
initial_choice, non_debug = True, prefs_key = use_c_renderer_key) | initial_choice, non_debug = True, prefs_key = use_c_renderer_prefs_key) | def setup(): global CylList, diamondGridList, CapList, CubeList, solidCubeList global sphereList, rotSignList, linearLineList, linearArrowList global circleList, lonsGridList, lonsEdges, lineCubeList, SiCGridList global use_c_renderer_pref listbase = glGenLists(numSphereSizes + 21) for i in range(numSphereSizes): sph... |
m.highlightAtomChunks() | grp.highlightAtomChunks() | def _highlightAtoms(self, grp): '''High light atoms or chunks inside ESPWindow jigs. ''' from jigs_planes import ESPWindow if isinstance(grp, ESPWindow): m.highlightAtomChunks() elif isinstance(grp, Group): for m in grp.members: if isinstance(m, ESPWindow): m.highlightAtomChunks() elif isinstance(m, Group): self._high... |
disp = default_display_mode | prefs = preferences.prefs_context() disp = prefs.get(defaultDisplayMode_prefs_key, default_display_mode) | def setDisplay(self, disp): if disp == diDEFAULT: disp = default_display_mode #bruce 041129 to fix bug 21 #e someday: if self.display == disp, no actual change needed?? # not sure if that holds for all init code, so being safe for now. self.display = disp ##Huaicai 3/29/05: Add the condition to fix bug 477 if self.mode... |
normalPoint = (float(npnt[0]), float(abs(npnt[1])), float(npnt[2])) | normalPoint = (float(npnt[0]), 0.5, float(npnt[2])) | def write_nh_mpqc_esp_plane_rec(f, esp_window, output_dir): nh_home = get_nh_home() cpnt = esp_window.center * 1e-10 centerPoint = (float(cpnt[0]), float(cpnt[1]), float(cpnt[2])) #print "ESP Window CenterPoint =", centerPoint npnt = esp_window.getaxis() * 1e-10 normalPoint = (float(npnt[0]), float(abs(npnt[1])), fl... |
if 0: f.write(' <parameter name="centerPoint" value="%.1e %.1e %.1e" />\n' % centerPoint) f.write(' <parameter name="normalPoint" value="%1.1e %1.1e %1.1e" />\n' % normalPoint) f.write(' <parameter name="cutoffHeight" value="%1.1e" />\n' % cutoffHeight) f.write(' <parameter name="cutoffWidth" value=... | f.write(' <parameter name="centerPoint" value="%.1e %.1e %.1e" />\n' % centerPoint) f.write(' <parameter name="normalPoint" value="%1.1e %1.1e %1.1e" />\n' % normalPoint) f.write(' <parameter name="cutoffHeight" value="%1.1e" />\n' % cutoffHeight) f.write(' <parameter name="cutoffWidth" value="%1.1e... | def write_nh_mpqc_esp_plane_rec(f, esp_window, output_dir): nh_home = get_nh_home() cpnt = esp_window.center * 1e-10 centerPoint = (float(cpnt[0]), float(cpnt[1]), float(cpnt[2])) #print "ESP Window CenterPoint =", centerPoint npnt = esp_window.getaxis() * 1e-10 normalPoint = (float(npnt[0]), float(abs(npnt[1])), fl... |
f.write(' <parameter name="outputFilename" value="%s\\result.png" />\n' % output_dir) | f.write(' <parameter name="outputFilename" value="%s\\%s.png" />\n' % (output_dir, esp_window.name)) | def write_nh_mpqc_esp_plane_rec(f, esp_window, output_dir): nh_home = get_nh_home() cpnt = esp_window.center * 1e-10 centerPoint = (float(cpnt[0]), float(cpnt[1]), float(cpnt[2])) #print "ESP Window CenterPoint =", centerPoint npnt = esp_window.getaxis() * 1e-10 normalPoint = (float(npnt[0]), float(abs(npnt[1])), fl... |
def write_nh_measurements_to_file_rec(f, output_dir): | def write_nh_measurements_to_file_results_rec(f, output_dir): | def write_nh_measurements_to_file_rec(f, output_dir): f.write('\n') f.write(' <result name="MeasurementSetToFile" plugin="MeasurementSetToFile">\n') f.write(' <parameter name="outputInterval" value="1" />\n') f.write(' <parameter name="outputFile"\n') f.write(' value="%s/data.txt" />\n' % output_di... |
stats = staticmethod(stats) | _printstats = staticmethod(_printstats) | def _printstats(): """Internal function for developers to call to print stats on number of sorted and immediately-called objects""" print "Since previous 'stats', %d sorted, %d immediate: " % (ColorSorter._sorted, ColorSorter._immediate) ColorSorter._sorted = 0 ColorSorter._immediate = 0 |
for p in drum1: | for p in drum2: | def doline(v1,v2): if shoulddoline(v1,v2): glVertex3fv(v1) glVertex3fv(v2) return |
def param_names_and_valstrings(self): | def param_names_and_valstrings(self, canonical = False): | def param_names_and_valstrings(self): #bruce 050701; extended by Mark 050704 to return the proper set of params """Return a list of pairs of (<param name>, <param value printable by %s>) for all gamess params we want to write to an mmp file from this set. These names and value-strings need to be recognized and decoded ... |
gamess params we want to write to an mmp file from this set. | gamess params we want to write to an mmp file from this set, sorted by <param name>. | def param_names_and_valstrings(self): #bruce 050701; extended by Mark 050704 to return the proper set of params """Return a list of pairs of (<param name>, <param value printable by %s>) for all gamess params we want to write to an mmp file from this set. These names and value-strings need to be recognized and decoded ... |
Note: If we implement a "duplicate" context menu command for gamess jigs, it should work by generating this same set of items, and feeding them to that same info_gamess_setitem method (or an appropriate subroutine it calls) of the new jig being made as a copy. | def param_names_and_valstrings(self): #bruce 050701; extended by Mark 050704 to return the proper set of params """Return a list of pairs of (<param name>, <param value printable by %s>) for all gamess params we want to write to an mmp file from this set. These names and value-strings need to be recognized and decoded ... | |
items = [] items = self.ui.get_mmp_parms() return items | return self.ui.get_mmp_parms(canonical = canonical) | def param_names_and_valstrings(self): #bruce 050701; extended by Mark 050704 to return the proper set of params """Return a list of pairs of (<param name>, <param value printable by %s>) for all gamess params we want to write to an mmp file from this set. These names and value-strings need to be recognized and decoded ... |
return self.param_names_and_valstrings() == other.param_names_and_valstrings() def _s_printed_diff(self, other): "Assuming __eq__ returns False, explain why, at least enough to prove it was right." if other.__class__ is not self.__class__: return "classes differ: %r is not %r" % (other.__class__, self.__class__) s1 = ... | return self.param_names_and_valstrings(canonical = True) == other.param_names_and_valstrings(canonical = True) boolparms = ('damp', 'diis', 'dirscf', 'extrap', 'ncore', 'rstrct', 'shift', 'soscf' ) | def __eq__(self, other): #bruce 060306 for Undo bug 1616; doesn't fix it, not sure why -- need to find out why _s_deepcopy is # being called in the first place! Undo's archive copy - ok. And the difference? see below. ####@@@@ # note: defining __eq__ is sufficient, but only because we inherit from state_utils.DataMixin... |
def get_mmp_parms(self): '''Return a list of all the Gamess jig parms (and their values) to be stored in the MMP file. | def get_mmp_parms(self, canonical = False): '''Return a list of pairs (parmname, str(parmvalue)) of all the Gamess jig parms (and str() of their values) to be stored in the MMP file, sorted by parm name. If option canonical = True, canonicalize the values for comparison (i.e. use "False" and "True" rather than "0" and ... | def get_mmp_parms(self): '''Return a list of all the Gamess jig parms (and their values) to be stored in the MMP file. ''' items = [] for p in self.parms: |
for p in self.parms: items.append((p, str(self.__dict__[p]))) | for p in self.parms: val = self.__dict__[p] if canonical and p in _boolparms: val = not not val items.append((p, str(val))) | def get_mmp_parms(self): '''Return a list of all the Gamess jig parms (and their values) to be stored in the MMP file. ''' items = [] for p in self.parms: |
self.selectMenu = QPopupMenu(self) self.selectAllAction.addTo(self.selectMenu) self.selectNoneAction.addTo(self.selectMenu) self.selectInvertAction.addTo(self.selectMenu) self.selectConnectedAction.addTo(self.selectMenu) self.selectDoublyAction.addTo(self.selectMenu) self.selectExpandAction.addTo(self.selectMenu) self.... | self.Select = QPopupMenu(self) self.selectAllAction.addTo(self.Select) self.selectNoneAction.addTo(self.Select) self.selectInvertAction.addTo(self.Select) self.selectConnectedAction.addTo(self.Select) self.selectDoublyAction.addTo(self.Select) self.selectExpandAction.addTo(self.Select) self.selectContractAction.addTo(s... | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() |
self.editPrefsAction.setText(self.__tr("Preferences...")) self.editPrefsAction.setMenuText(self.__tr("P&references...")) | self.editPrefsAction.setText(self.__tr("Preferences")) self.editPrefsAction.setMenuText(self.__tr("Pre&ferences...")) self.editPrefsAction.setToolTip(self.__tr("Preferences")) | def languageChange(self): self.setCaption(self.__tr("nanoENGINEER-1")) self.fileOpenAction.setText(self.__tr("Open")) self.fileOpenAction.setMenuText(self.__tr("&Open...")) self.fileOpenAction.setAccel(self.__tr("Ctrl+O")) self.fileSaveAction.setText(self.__tr("Save")) self.fileSaveAction.setMenuText(self.__tr("&Save")... |
self.MenuBar.findItem(7).setText(self.__tr("Insert")) | self.MenuBar.findItem(7).setText(self.__tr("&Insert")) | def languageChange(self): self.setCaption(self.__tr("nanoENGINEER-1")) self.fileOpenAction.setText(self.__tr("Open")) self.fileOpenAction.setMenuText(self.__tr("&Open...")) self.fileOpenAction.setAccel(self.__tr("Ctrl+O")) self.fileSaveAction.setText(self.__tr("Save")) self.fileSaveAction.setMenuText(self.__tr("&Save")... |
self.MenuBar.findItem(9).setText(self.__tr("Select")) | self.MenuBar.findItem(9).setText(self.__tr("&Select")) | def languageChange(self): self.setCaption(self.__tr("nanoENGINEER-1")) self.fileOpenAction.setText(self.__tr("Open")) self.fileOpenAction.setMenuText(self.__tr("&Open...")) self.fileOpenAction.setAccel(self.__tr("Ctrl+O")) self.fileSaveAction.setText(self.__tr("Save")) self.fileSaveAction.setMenuText(self.__tr("&Save")... |
if self.molecule.assy.w.elemFilterComboBox.currentItem() > 0 and \ self.element.name != self.molecule.assy.w.elemFilterComboBox.currentText(): return | if self.filtered(): return | def pick(self): """make the atom selected """ if self.element is Singlet: return # It would be better to pass the following condition as argument, so it can be reused.--Huaicai [9/1/05] # If select atoms filter is on, only pick element type in the filter combobox if self.molecule.assy.w.elemFilterComboBox.currentItem(... |
f.write("plot '%s' using 1:%d title \"Data Points\" with lines lt 2,\\\n"%(self.traceFile,col)) f.write(" '%s' using 1:%d:(0.5) smooth acsplines title \"Average\" lt 3\n"%(self.traceFile,col)) | f.write('plot "%s" using 1:%d title \"Data Points\" with lines lt 2,\\\n'%(self.traceFile,col)) f.write(' "%s" using 1:%d:(0.5) smooth acsplines title \"Average\" lt 3\n'%(self.traceFile,col)) | def genPlot(self): """Generates GNUplot plotfile, then calls self.runGNUplot. """ col = self.plot_combox.currentItem() + 2 # Column number to plot # If this plot was the same as the last plot, just run GNUplot on the plotfile. # This allows us to edit the current plotfile in a text editor via "Open GNUplot File" # and... |
self.ambLight1LCD.setSmallDecimalPoint(1) | self.ambLight1LCD.setSmallDecimalPoint(0) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.diffuseLight1LCD.setSmallDecimalPoint(1) | self.diffuseLight1LCD.setSmallDecimalPoint(0) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.diffuseLight2LCD.setSmallDecimalPoint(1) | self.diffuseLight2LCD.setSmallDecimalPoint(0) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.ambLight2LCD.setSmallDecimalPoint(1) | self.ambLight2LCD.setSmallDecimalPoint(0) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.diffuseLight3LCD.setSmallDecimalPoint(1) | self.diffuseLight3LCD.setSmallDecimalPoint(0) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.ambLight3LCD.setSmallDecimalPoint(1) | self.ambLight3LCD.setSmallDecimalPoint(0) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.assy.modified = 1 | def changename(self, listItem, col, text): if col != 0: return self.assy.modified = 1 # Huaicai: the following line to make sure file name is not just space text = text.stripWhiteSpace() # Check if there is text for the listitem's name. If not, we must force an MT update. # Otherwise, the name will remain blank unti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.