rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
z = slow_cpk_with_title('Titles_22_Sep_2006/1SmallBearingPage-17.gif', 8, start=0) z = slow_cpk_with_title('Titles_22_Sep_2006/2SmallBearingPage-17.gif', 15, start=z)
z = slow_cpk_with_title('Titles_22_Sep_2006/1SmallBearingPages-17.gif', 8, start=0) z = slow_cpk_with_title('Titles_22_Sep_2006/2SmallBearingPages-17.gif', 15, start=z)
def cross_fade(real_seconds, from_filespec, to_filespec, start=0, avg=10): # We only do cross-fades at 6 ps/sec return m.motionBlur(from_filespec, start=start, incr=10, frames=real_seconds*m.SECOND, avg=avg, textlist=textlist_6ps, fadeTo=to_filespec)
z = fast_tubes_with_title('Titles_22_Sep_2006/3SmallBearingPage-17.gif', 8, start=0)
z = fast_tubes_with_title('Titles_22_Sep_2006/3SmallBearingPages-17.gif', 8, start=0)
def cross_fade(real_seconds, from_filespec, to_filespec, start=0, avg=10): # We only do cross-fades at 6 ps/sec return m.motionBlur(from_filespec, start=start, incr=10, frames=real_seconds*m.SECOND, avg=avg, textlist=textlist_6ps, fadeTo=to_filespec)
z = medium_tubes_with_title('Titles_22_Sep_2006/4SmallBearingPage-17.gif', 8, start=0)
z = medium_tubes_with_title('Titles_22_Sep_2006/4SmallBearingPages-17.gif', 8, start=0)
def cross_fade(real_seconds, from_filespec, to_filespec, start=0, avg=10): # We only do cross-fades at 6 ps/sec return m.motionBlur(from_filespec, start=start, incr=10, frames=real_seconds*m.SECOND, avg=avg, textlist=textlist_6ps, fadeTo=to_filespec)
z = slow_tubes_with_title('Titles_22_Sep_2006/5SmallBearingPage-17.gif', 8, start=0)
z = slow_tubes_with_title('Titles_22_Sep_2006/5SmallBearingPages-17.gif', 8, start=0)
def cross_fade(real_seconds, from_filespec, to_filespec, start=0, avg=10): # We only do cross-fades at 6 ps/sec return m.motionBlur(from_filespec, start=start, incr=10, frames=real_seconds*m.SECOND, avg=avg, textlist=textlist_6ps, fadeTo=to_filespec)
z = slow_tubes_with_title('Titles_22_Sep_2006/6SmallBearingPage-17.gif', 15, start=0, avg=1) z = slow_tubes_with_title('Titles_22_Sep_2006/7SmallBearingPage-17.gif', 5, start=z, avg=1) z = slow_tubes_with_title('Titles_22_Sep_2006/8SmallBearingPage-17.gif', 5, start=z, avg=1)
z = slow_tubes_with_title('Titles_22_Sep_2006/6SmallBearingPages-17.gif', 15, start=0, avg=1) z = slow_tubes_with_title('Titles_22_Sep_2006/7SmallBearingPages-17.gif', 5, start=z, avg=1) z = slow_tubes_with_title('Titles_22_Sep_2006/8SmallBearingPages-17.gif', 5, start=z, avg=1)
def cross_fade(real_seconds, from_filespec, to_filespec, start=0, avg=10): # We only do cross-fades at 6 ps/sec return m.motionBlur(from_filespec, start=start, incr=10, frames=real_seconds*m.SECOND, avg=avg, textlist=textlist_6ps, fadeTo=to_filespec)
z = slow_cpk_with_title('Titles_22_Sep_2006/9SmallBearingPage-17.gif', 12, start=0) z = slow_cpk_with_title('Titles_22_Sep_2006/10SmallBearingPage-17.gif', 15, start=z)
z = slow_cpk_with_title('Titles_22_Sep_2006/9SmallBearingPages-17.gif', 12, start=0) z = slow_cpk_with_title('Titles_22_Sep_2006/10SmallBearingPages-17.gif', 15, start=z)
def cross_fade(real_seconds, from_filespec, to_filespec, start=0, avg=10): # We only do cross-fades at 6 ps/sec return m.motionBlur(from_filespec, start=start, incr=10, frames=real_seconds*m.SECOND, avg=avg, textlist=textlist_6ps, fadeTo=to_filespec)
return self.alist[0].molecule.part
part = self.alist[0].molecule.part
def __getattr__(self, attr): # temporary kluge ###@@@ if attr == 'part': if self.alist: return self.alist[0].molecule.part # not checked for consistency, but correct if anything is; could be None, I think, # especially for killed atoms (guess; see bug 497) [bruce 050411] #bruce 050411: the following does happen, see co...
if not part and platform.atom_debug: print_compact_stack( "part false (%r) here; alist[0].molecule is %r: " % (part, self.alist[0].molecule) ) return part
def __getattr__(self, attr): # temporary kluge ###@@@ if attr == 'part': if self.alist: return self.alist[0].molecule.part # not checked for consistency, but correct if anything is; could be None, I think, # especially for killed atoms (guess; see bug 497) [bruce 050411] #bruce 050411: the following does happen, see co...
if DEBUG1: print "movie._close() called. self.isOpen =", self.isOpen
if DEBUG1: print_compact_stack( "movie._close() called. self.isOpen = %r" % self.isOpen)
def _close(self): """Close movie file and adjust atom positions. """ if DEBUG1: print "movie._close() called. self.isOpen =", self.isOpen if not self.isOpen: return self._pause(0) self.fileobj.close() # Close the movie file. self.movend() # Unfreeze atoms. if self.startFrame != self.currentFrame: self.assy.changed() #...
self.resize(QSize(1115,976).expandedTo(self.minimumSizeHint()))
self.resize(QSize(1115,979).expandedTo(self.minimumSizeHint()))
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
self.connect(self.fileExitAction,SIGNAL("activated()"),self.fileExit)
self.connect(self.fileExitAction,SIGNAL("activated()"),self,SLOT("close()"))
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
os.chdir(tmpFilePath) args = [filePath + '/../bin/simulator', '-m ', "minimize.mmp"] r = os.spawnv(os.P_WAIT, filePath + '/../bin/simulator', args) os.chdir(oldWorkingDir)
program = os.path.normpath(filePath + '/../bin/simulator') args = [program, '-m ', "minimize.mmp"] if os.path.exists(program): try: os.chdir(tmpFilePath) r = os.spawnv(os.P_WAIT, program, args) finally: os.chdir(oldWorkingDir) else: r = 'program not found' s = "simulator not found at %r; installation error?" % program
def minimize(self): from debug import print_compact_traceback ## bruce 041101 removed this since it's immediately overwritten below: ## self.win.msgbarLabel.setText( "Minimizing...") QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) ) # hourglass try: self.win.msgbarLabel.setText("Calculating...") import os, sys f...
self.win.msgbarLabel.setText("Minimization Failed!")
print "Minimization Failed:", s print "note: spawnv args were %r" % (args,) print " in the temporary working directory %r" % (tmpFilePath,) self.win.msgbarLabel.setText("Minimization Failed! (%s)" % (s,))
def minimize(self): from debug import print_compact_traceback ## bruce 041101 removed this since it's immediately overwritten below: ## self.win.msgbarLabel.setText( "Minimizing...") QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) ) # hourglass try: self.win.msgbarLabel.setText("Calculating...") import os, sys f...
if (at1.molecule.assy is not None) or (at2.molecule.assy is not None):
if (at1.molecule.assy is None) or (at2.molecule.assy is None):
def changed_atoms(self): """Private method to call when the atoms assigned to this bond are changed. WARNING: does not call setup_invalidate(), though that would often also be needed, as would invalidate_bonded_mols() both before and after the change. """ at1 = self.atom1 at2 = self.atom2 assert at1 is not at2 self.key...
elif (at1.molecule.part is not None) or (at2.molecule.part is not None):
elif (at1.molecule.part is None) or (at2.molecule.part is None):
def changed_atoms(self): """Private method to call when the atoms assigned to this bond are changed. WARNING: does not call setup_invalidate(), though that would often also be needed, as would invalidate_bonded_mols() both before and after the change. """ at1 = self.atom1 at2 = self.atom2 assert at1 is not at2 self.key...
mapping = writemmp_mapping(assy, leave_out_sim_disabled_nodes = True)
mapping = writemmp_mapping(assy, leave_out_sim_disabled_nodes = True, sim = True)
def writemmpfile_part(part, filename): ##e should merge with writemmpfile_assy "write an mmp file for a single Part" part.assy.o.saveLastView() ###e should change to part.glpane? not sure... [bruce 050419 comment] # this updates assy.part csys records, but we don't currently write them out below node = part.topnode ass...
Here's the code that writes the trace file during minimize:
Here\'s the code that writes the trace file during minimize:
def print_sim_warnings(self): #bruce 050407; revised 060109, used whether or not we're not printing warnings continuously """Print warnings and errors from tracefile (if this was not already done); then print summary/finishing info related to tracefile. Note: this might change self.said_we_are_done to False or True, or...
elif "
elif highForces or ("
def step(self, line): #k should this also be called by __call__ ? no, that would slow down its use as a callback. """do whatever should be done immediately with this line, and save things to do later; this bound method might be used directly as a trace_callback [but isn't, for clarity, as of 060109] """ if not line.sta...
self.oldNormColor = self.grid_plane.normcolor self.oldGridColor = self.grid_plane.grid_color
self.oldNormColor = self.grid_plane.normcolor self.border_color = RGBf_to_QColor(self.grid_plane.normcolor) self.border_color_pixmap.setPaletteBackgroundColor(self.border_color) self.oldGridColor = self.grid_plane.grid_color self.grid_color = RGBf_to_QColor(self.grid_plane.grid_color) self.grid_color_pixmap.setPalett...
def setup(self): self.oldNormColor = self.grid_plane.normcolor # Border color self.oldGridColor = self.grid_plane.grid_color # Grid color self.x_spacing = 2 self.name_linedit.setText(self.grid_plane.name) self.grid_color = RGBf_to_QColor(self.grid_plane.grid_color) self.border_color = RGBf_to_QColor(self.grid_plane...
self.grid_color = RGBf_to_QColor(self.grid_plane.grid_color) self.border_color = RGBf_to_QColor(self.grid_plane.normcolor)
def setup(self): self.oldNormColor = self.grid_plane.normcolor # Border color self.oldGridColor = self.grid_plane.grid_color # Grid color self.x_spacing = 2 self.name_linedit.setText(self.grid_plane.name) self.grid_color = RGBf_to_QColor(self.grid_plane.grid_color) self.border_color = RGBf_to_QColor(self.grid_plane...
self.border_color_pixmap.setPaletteBackgroundColor(self.border_color) self.grid_color_pixmap.setPaletteBackgroundColor(self.grid_color)
def setup(self): self.oldNormColor = self.grid_plane.normcolor # Border color self.oldGridColor = self.grid_plane.grid_color # Grid color self.x_spacing = 2 self.name_linedit.setText(self.grid_plane.name) self.grid_color = RGBf_to_QColor(self.grid_plane.grid_color) self.border_color = RGBf_to_QColor(self.grid_plane...
env.history.message(greenmsg(cmd) + "Selection Inverted")
env.history.message("Selection Inverted")
def selectInvert(self): """If some parts are selected, select the other parts instead. If some atoms are selected, select the other atoms instead (even in chunks with no atoms selected, which end up with all atoms selected). (And unselect all currently selected parts or atoms.) """ cmd = "Invert Selection: " # revised...
msg = greenmsg(cmd) + fix_plurals(str(num_picked) + " atom(s) selected.")
msg = fix_plurals(str(num_picked) + " atom(s) selected.")
def selectExpand(self): """Select any atom that is bonded to any currently selected atom. """ # Eric really needed this. Added by Mark 050923. cmd = "Expand Selection: " if not self.selatoms: env.history.message(greenmsg(cmd) + redmsg("No atoms selected.")) return num_picked = 0 # Number of atoms picked in the expa...
"""Unselect any atom which has a bond to an unselected atom.
"""Unselects any atom which has a bond to an unselected atom, or which has any open bonds.
def selectContract(self): """Unselect any atom which has a bond to an unselected atom. """ # Added by Mark 050923. cmd = "Contract Selection: " if not self.selatoms: env.history.message(greenmsg(cmd) + redmsg("No atoms selected.")) return contract_list = [] # Contains list of atoms to be unselected. assert self.sel...
msg = greenmsg(cmd) + fix_plurals(str(len(contract_list)) + " atom(s) unselected.")
msg = fix_plurals(str(len(contract_list)) + " atom(s) unselected.")
def selectContract(self): """Unselect any atom which has a bond to an unselected atom. """ # Added by Mark 050923. cmd = "Contract Selection: " if not self.selatoms: env.history.message(greenmsg(cmd) + redmsg("No atoms selected.")) return contract_list = [] # Contains list of atoms to be unselected. assert self.sel...
if self.assy.filename: odir, fil, ext = fileparse(self.assy.filename) else: odir = globalParms['WorkingDirectory']
if os.path.exists(self.assy.filename): odir,fil,ext = fileparse(self.assy.filename) else: odir = globalParms['WorkingDirectory']
def fileInsert(self): env.history.message(greenmsg("Insert File:")) if self.assy.filename: odir, fil, ext = fileparse(self.assy.filename) else: odir = globalParms['WorkingDirectory'] #mitigated bug 291. at least handles one case. this is a temporary fix and probably live until a parmanent fix is committed ninad060724...
"Unselects any atom that has a bondpoint."\
"Deselects any atom that is a neighbor of a non-picked atom or has a bondpoint."\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
self.win.msgbarLabel.setText( "Minimizing...") QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) )
QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) )
def minimize(self): from debug import print_compact_traceback self.win.msgbarLabel.setText( "Minimizing...") # Initial message [mark 040924 via bruce] QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) ) # Put up the hourglass cursor. [mark 040924 via bruce] try: self.win.msgbarLabel.setText("Calculating...") write...
assert not s.startswith("Minimize") QApplication.restoreOverrideCursor()
r = -1 QApplication.restoreOverrideCursor()
def minimize(self): from debug import print_compact_traceback self.win.msgbarLabel.setText( "Minimizing...") # Initial message [mark 040924 via bruce] QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) ) # Put up the hourglass cursor. [mark 040924 via bruce] try: self.win.msgbarLabel.setText("Calculating...") write...
self.win.msgbarLabel.setText("Minimization Failed!")
if not s: s = "exit code %r" % r self.win.msgbarLabel.setText("Minimization Failed!")
def minimize(self): from debug import print_compact_traceback self.win.msgbarLabel.setText( "Minimizing...") # Initial message [mark 040924 via bruce] QApplication.setOverrideCursor( QCursor(Qt.WaitCursor) ) # Put up the hourglass cursor. [mark 040924 via bruce] try: self.win.msgbarLabel.setText("Calculating...") write...
glFlush()
if self.debug_gl_timing: self._print_gl_timing(1) else: glFlush()
def paintGL(self): #bruce 050127 revised docstring to deprecate direct calls """[PRIVATE METHOD -- call gl_update instead!] The main screen-drawing function, called internally by Qt when our superclass needs to repaint. THIS SHOULD NO LONGER BE CALLED DIRECTLY BY EXTERNAL CODE -- CALL gl_update INSTEAD. Sets up point o...
del viewdata, shelf
del viewdata
def insertmmp(assy, filename): #bruce 050405 revised to fix one or more assembly/part bugs, I hope """Read an mmp file and insert its main part into the existing model.""" grouplist = _readmmp(assy, filename, isInsert = True) # isInsert = True prevents most side effects on assy; # a better design would be to let the c...
file.write("line(" + povpoint(self.atom1.posn()) + "," + povpoint(self.atom2.posn()) + ")\n")
file.write("line(" + povpoint(a1pos) + "," + povpoint(a2pos) + ")\n")
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + ...
file.write("bond(" + povpoint(self.atom1.posn()) + "," + povpoint(self.atom2.posn()) + ")\n")
file.write("bond(" + povpoint(a1pos) + "," + povpoint(a2pos) + ")\n")
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + ...
if self.center: file.write("tube2(" + povpoint(self.atom1.posn()) +
if center: file.write("tube2(" + povpoint(a1pos) +
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + ...
"," + povpoint(self.center) + "," + povpoint(self.atom2.posn()) + "," +
"," + povpoint(center) + "," + povpoint(a2pos) + "," +
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + ...
file.write("tube1(" + povpoint(self.atom1.posn()) +
file.write("tube1(" + povpoint(a1pos) +
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + ...
"," + povpoint(self.c1) + "," + povpoint(self.c2) + "," + povpoint(self.atom2.posn()) + "," +
"," + povpoint(c1) + "," + povpoint(c2) + "," + povpoint(a2pos) + "," +
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + ...
atoms_pm = imagename_to_pixmap("atoms.png") self.mmkit_tab.setTabIconSet ( self.atomsPage, QIconSet(atoms_pm)) clipboard_pm = imagename_to_pixmap("clipboard-empty.png") self.mmkit_tab.setTabIconSet ( self.clipboardPage, QIconSet(clipboard_pm)) library_pm = imagename_to_pixmap("library.png") self.mmkit_tab.setTabIconS...
self.icon_tabs = debug_pref("use icons in MMKit tabs?", Choice_boolean_True, prefs_key = "A7/mmkit tab icons") if not self.icon_tabs: self.mmkit_tab.setMargin ( 0 ) self.mmkit_tab.setTabLabel (self.atomsPage, 'Atoms') self.mmkit_tab.setTabLabel (self.clipboardPage, 'Clipbd') self.mmkit_tab.setTabLabel (self.library...
def __init__(self, win): MMKitDialog.__init__(self, win, fl=Qt.WType_Dialog)# Qt.WStyle_Customize | Qt.WStyle_Tool | Qt.WStyle_Title | Qt.WStyle_NoBorder) self.w = win self.elemTable = PeriodicTable self.displayMode = diTUBES self.elm = None self.newModel = None ## used to save the selected lib part self.flayout = N...
try:
if self.topnode:
def delete_sel(self, use_selatoms = True): #bruce 050505 added use_selatoms = True option, so MT ops can pass False (bugfix) "delete all selected nodes or atoms in this Part [except the top node, if we're an immortal Part]" #bruce 050419 renamed this from kill, to distinguish it # from standard meaning of obj.kill() ==...
except: pass
def delete_sel(self, use_selatoms = True): #bruce 050505 added use_selatoms = True option, so MT ops can pass False (bugfix) "delete all selected nodes or atoms in this Part [except the top node, if we're an immortal Part]" #bruce 050419 renamed this from kill, to distinguish it # from standard meaning of obj.kill() ==...
def resetAssy_and_clear(self): """This method should be called from the end of MWsemantics.__clear to prevent a crash on (at least) Windows during File->Close when the mtree is editing an item's text, using a fix developed by Huaicai 050201, which is to run the QListView method self.clear(). Neither Huaicai nor Bruce y...
def __init__(self, parent, win, name = "modelTreeView", size = (200, 560)): """#doc""" ###@@@ review all init args & instvars, here vs subclasses TreeWidget.__init__(self, parent, win, name, columns = ["Model Tree"], size = size) # stores self.win
p = self.center + glpane.out * 0.6
try: glpane_out = glpane.out except AttributeError: glpane_out = V(0.0, 0.0, 1.0) p = self.center + glpane_out * 0.6
via dispdef from the calling molecule -- this might cause bugs if some
objStr = self.getHighlightedObjectInfo()
objStr = self.getHighlightedObjectInfo(self.atomDistPrecision)
def getToolTipText(self): # Mark 060818, Ninad 060818 """Return the tooltip text to display, which depends on what is selected and what is highlighted. Fetures implemented -- If nothing is selected, return the name of the highlighted object. If one atom is selected, return the distance between it and the highlighted at...
def getHighlightedObjectInfo(self):
def getHighlightedObjectInfo(self, atomDistPrecision):
def getHighlightedObjectInfo(self): "Returns the info such as name, id, xyz coordinates etc of the highlighed object" from bond_constants import describe_atom_and_atomtype #from chem import Atom glpane = self.glpane atomposn = None atomChunkInfo = None # ---- Atom Info ---- if isinstance(glpane.selobj, atom): at...
atomposn = self.getAtomPositions(self.isAtomPosition)
atomposn = self.getAtomPositions(self.isAtomPosition, atomDistPrecision)
def getHighlightedObjectInfo(self): "Returns the info such as name, id, xyz coordinates etc of the highlighed object" from bond_constants import describe_atom_and_atomtype #from chem import Atom glpane = self.glpane atomposn = None atomChunkInfo = None # ---- Atom Info ---- if isinstance(glpane.selobj, atom): at...
bondLength = self.getBondLength(self.isBondLength)
bondLength = self.getBondLength(self.isBondLength, atomDistPrecision)
def getHighlightedObjectInfo(self): "Returns the info such as name, id, xyz coordinates etc of the highlighed object" from bond_constants import describe_atom_and_atomtype #from chem import Atom glpane = self.glpane atomposn = None atomChunkInfo = None # ---- Atom Info ---- if isinstance(glpane.selobj, atom): at...
def getAtomPositions(self, isAtomPosition):
def getAtomPositions(self, isAtomPosition,atomDistPrecision):
def getAtomPositions(self, isAtomPosition): ''' returns X, Y, Z position string if the 'show atom position in dynamic toooltip is checked from the user prefs otherwise returns None ''' glpane = self.glpane if isAtomPosition: xyz = glpane.selobj.posn() atomposn = ("X: %.3f\nY: %.3f\nZ: %.3f" %(xyz[0], xyz[1], xyz[2])) ...
atomposn = ("X: %.3f\nY: %.3f\nZ: %.3f" %(xyz[0], xyz[1], xyz[2]))
xPosn = str(round(xyz[0], atomDistPrecision)) yPosn = str(round(xyz[1], atomDistPrecision)) zPosn = str(round(xyz[2], atomDistPrecision)) atomposn = ("X: %s\nY: %s\nZ: %s" %(xPosn, yPosn, zPosn))
def getAtomPositions(self, isAtomPosition): ''' returns X, Y, Z position string if the 'show atom position in dynamic toooltip is checked from the user prefs otherwise returns None ''' glpane = self.glpane if isAtomPosition: xyz = glpane.selobj.posn() atomposn = ("X: %.3f\nY: %.3f\nZ: %.3f" %(xyz[0], xyz[1], xyz[2])) ...
def getBondLength(self, isBondLength):
def getBondLength(self, isBondLength, atomDistPrecision):
def getBondLength(self, isBondLength): '''returns the atom center distance between the atoms connected by the highlighted bond. Note that this does *not* return the covalent bondlength''' from VQT import vlen glpane = self.glpane if isBondLength: a1 = glpane.selobj.atom1 a2 = glpane.selobj.atom2
nuclearDist = str(vlen(a1.posn() - a2.posn())) bondLength = "Distance " + str(a1) + "-" + str(a2) + ":" + nuclearDist + " A"
nuclearDist = str(round(vlen(a1.posn() - a2.posn()), atomDistPrecision)) bondLength = "Distance " + str(a1) + "-" + str(a2) + ": " + nuclearDist + " A"
def getBondLength(self, isBondLength): '''returns the atom center distance between the atoms connected by the highlighted bond. Note that this does *not* return the covalent bondlength''' from VQT import vlen glpane = self.glpane if isBondLength: a1 = glpane.selobj.atom1 a2 = glpane.selobj.atom2
def writemdl(self, alist, f, dispdef): pass
# def writemdl(self, alist, f, dispdef):
return None, "no open bonds in %r (only pasteable in empty space)" % m.name
return None, "no open bonds in %r (only pastable in empty space)" % m.name
def pasteBond(self, sing): """If self.pastable has an unambiguous hotspot, paste a copy of it onto the given singlet; return (the copy, description) or (None, whynot) """ # bruce 041123 added return values (and guessed docstring). m = self.pastable if len(m.singlets)==0: return None, "no open bonds in %r (only pasteabl...
numol = self.pastable.copy(None, pos)
numol = self.pastable.copy(None) if numol.hotspot: cursor_spot = numol.hotspot.posn() elif len(numol.singlets): cursor_spot = numol.singlets[0].posn() else: cursor_spot = numol.center numol.move(pos - cursor_spot)
def pasteFree(self, pos): numol = self.pastable.copy(None, pos) self.o.assy.addmol(numol) return numol, "copy of %r" % self.pastable.name
for attr in attrs:
opts = {} for attr in attrs: if attr.endswith("__options"): boundmethod = getattr( node, attr) try: lis = boundmethod() assert type(lis) == type([]) or lis == 'remove' opts[attr] = lis except: print_compact_traceback("exception ignored in %r.%s(): " % (node, attr)) pass for attr in attrs: if attr.endswith("__options"):...
def make_cmenuspec_for_set(self, nodeset): # [see also the term Menu_spec] "#doc... see superclass docstring"
submenu.append(( menutext.replace('_',' '), boundmethod ))
lis = opts.get(attr + "__options") or [] if lis != 'remove': mitem = tuple([menutext.replace('_',' '), boundmethod] + lis) submenu.append(mitem)
def make_cmenuspec_for_set(self, nodeset): # [see also the term Menu_spec] "#doc... see superclass docstring"
self.quat += q
self.axis = q.rot(self.axis)
def rot(self, q): self.quat += q
box { p1 + w, p2 - w
box { c1, c2 rotate rot translate trans
def povpoint(p): # note z reversal -- povray is left-handed return "<" + str(p[0]) + "," + str(p[1]) + "," + str(-p[2]) + ">"
def _raise_exc_on_add(self): raise ValueError, "Tried to add a shape to a petrified shape list"
def add_cylinder(self, color4, pos1, pos2, radius, name = 0, capped=0): """\ Add a cylinder to this shape list.
self.add_sphere = self._raise_exc_on_add self.add_cylinder = self._raise_exc_on_add
def petrify(self): """\ Make this object
lcolor = color + [1.0]
lcolor = (color[0], color[1], color[2], 1.0) else: lcolor = color
def schedule_sphere(color, pos, radius, detailLevel): """\ Schedule a sphere for rendering whenever ColorSorter thinks is appropriate. """ if TEST_PYREX_OPENGL and ColorSorter.sorting: if len(color) == 3: lcolor = color + [1.0] ColorSorter._cur_shapelist.add_sphere(lcolor, pos, radius, ColorSorter._gl_name_stack[-1]) #...
raise ValueError, "different sphere LOD levels"
raise ValueError, "unexpected different sphere LOD levels within same frame"
def schedule_sphere(color, pos, radius, detailLevel): """\ Schedule a sphere for rendering whenever ColorSorter thinks is appropriate. """ if TEST_PYREX_OPENGL and ColorSorter.sorting: if len(color) == 3: lcolor = color + [1.0] ColorSorter._cur_shapelist.add_sphere(lcolor, pos, radius, ColorSorter._gl_name_stack[-1]) #...
lcolor = [color[0], color[1], color[2], 1.0]
lcolor = (color[0], color[1], color[2], 1.0) else: lcolor = color
def schedule_cylinder(color, pos1, pos2, radius, capped=0): """\ Schedule a cylinder for rendering whenever ColorSorter thinks is appropriate. """ if TEST_PYREX_OPENGL and ColorSorter.sorting: if len(color) == 3: lcolor = [color[0], color[1], color[2], 1.0] ColorSorter._cur_shapelist.add_cylinder(lcolor, pos1, pos2, ra...
ColorSorter._cur_shapelist.petrify() return ColorSorter._cur_shapelist
def finish(): """\ Finish sorting - objects recorded since "start" will be sorted and invoked now. """ if TEST_PYREX_OPENGL: quux.shapeRendererInit() # print "VBO %s enabled" % (('is not', 'is')[quux.shapeRendererGetInteger(quux.IS_VBO_ENABLED)]) quux.shapeRendererSetUseDynamicLOD(0) if ColorSorter.sphereLevel != -1: q...
elem("He", "Helium", 6.646, 1.4, [1.0, 0.27, 0.67],
elem("He", "Helium", 6.646, 1.4, [0.42, 0.45, 0.55],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("B", "Boron", 17.949, 2.0, [0.3, 0.3, 1.0],
elem("B", "Boron", 17.949, 2.0, [0.25, 0.25, 0.7],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("C", "Carbon", 19.925, 1.84, [0.3, 0.5, 0.0],
elem("C", "Carbon", 19.925, 1.84, [0.25, 0.4, 0.0],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Ne", "Neon", 33.49, 1.82, [0.92, 0.25, 0.62],
elem("Ne", "Neon", 33.49, 1.82, [0.42, 0.45, 0.55],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Al", "Aluminum", 44.7997, 2.5, [0.5, 0.5, 0.9],
elem("Al", "Aluminum", 44.7997, 2.5, [0.4, 0.4, 0.75],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("P", "Phosphorus", 51.429, 2.11, [0.73, 0.32, 0.87],
elem("P", "Phosphorus", 51.429, 2.11, [0.4, 0.1, 0.5],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Cl", "Chlorine", 58.867, 2.03, [0.25, 0.35, 0.0],
elem("Cl", "Chlorine", 58.867, 2.03, [0.3, 0.5, 0.0],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Ar", "Argon", 66.33, 1.88, [0.85, 0.24, 0.57],
elem("Ar", "Argon", 66.33, 1.88, [0.42, 0.45, 0.55],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Ge", "Germanium", 120.53, 2.5, [0.447, 0.49, 0.416],
elem("Ge", "Germanium", 120.53, 2.5, [0.4, 0.45, 0.1],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Kr", "Krypton", 134.429, 1.9, [0.78, 0.21, 0.53],
elem("Kr", "Krypton", 134.429, 1.9, [0.42, 0.45, 0.55],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
elem("Xe", "Xenon", 134.429, 1.9, [0.78, 0.21, 0.53],
elem("Xe", "Xenon", 134.429, 1.9, [0.4, 0.45, 0.55],
def __repr__(self): return "<Element: " + self.symbol + "(" + self.name + ")>"
setViewNormalToActionText = "<u><b>Normal To</b></u><br>"\
setViewNormalToActionText = "<u><b>Set View Normal To</b></u><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
setViewParallelToActionText = "<u><b>Parallel To</b></u><br>"\
setViewParallelToActionText = "<u><b>Set View Parallel To</b></u><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
setViewOppositeActionText = "<u><b>Opposite View</b></u><br>"\
setViewOppositeActionText = "<u><b>Rotate View 180</b></u><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
setViewPlus90ActionText = "<u><b>Rotate +90</b></u><br>"\
setViewPlus90ActionText = "<u><b>Rotate View +90</b></u><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
setViewMinus90ActionText = "<u><b>Rotate -90</b></u><br>"\
setViewMinus90ActionText = "<u><b>Rotate View -90</b></u><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"Adds a new layer of diamond lattice to the existing layer.</p>"
"Adds a new layer of diamond lattice to the existing layer."\ "</p>"
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"constrains its motion during a minimization or simulation.</p>"\
"constrains its motion during a minimization or simulation."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"Anchors are drawn as a black wireframe box around each selected atom.</p>"
"Anchors are drawn as a black wireframe box around each selected atom."\ "</p>"
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor.</p>"\
"specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"select the atoms you want to attach the motor to and then select this action.</p>"
"select the atoms you want to attach the motor to and then select this action."\ "</p>"
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor.</p>"\
"specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"specifies the temperature (in Kelvin).</p>"\
"specifies the temperature (in Kelvin)."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"of a molecule during a simulation run.</p>"\
"of a molecule during a simulation run."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"blue wireframe box around the selected atom.</p>"
"blue wireframe box around the selected atom."\ "</p>"
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"during a simulation run.</p>"\
"during a simulation run."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"dark red wireframe box around the selected atom.</p>"
"dark red wireframe box around the selected atom."\ "</p>"
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"is used to calculate the electrostatic potential.</p>"\
"is used to calculate the electrostatic potential."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"selection which can be reselected later.</p>"\
"selection which can be reselected later."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"drawn as a set of wireframe boxes around each atom in the selection.</p>"\
"drawn as a set of wireframe boxes around each atom in the selection."\ "</p>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
jigsDistanceActionText = "<u><b>Measure Distance</b></u></b></p><br>"\
jigsDistanceActionText = "<u><b>Measure Distance Jig</b></u></b></p><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"A <b>Measure Distance</b> jig functions as a dimension to display the "\ "distance between two atoms.</p>"\ "<p>To create the Measure Distance jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance jig is "\
"A <b>Measure Distance Jig</b> functions as a dimension to display the "\ "distance between two atoms."\ "</p>"\ "<p>To create the Measure Distance Jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance Jig is "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"The second number is the distance between the nuclei.</p>"\ "<p>The Measure Distance jig will write the two distance values to the trace file "\
"The second number is the distance between the nuclei."\ "</p>"\ "<p>The Measure Distance Jig will write the two distance values to the trace file "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
jigsAngleActionText = "<u><b>Measure Angle</b></u></b></p><br>"\
jigsAngleActionText = "<u><b>Measure Angle Jig</b></u></b></p><br>"\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"A <b>Measure Angle</b> jig functions as a dimension to display the "\
"A <b>Measure Angle Jig</b> functions as a dimension to display the "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"<p>To create the Measure Angle jig, enter <b>Select Atoms</b> mode, "\ "select three atoms and then select this jig. The Measure Angle jig is "\
"<p>To create the Measure Angle Jig, enter <b>Select Atoms</b> mode, "\ "select three atoms and then select this jig. The Measure Angle Jig is "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...