当前位置: 首页>>代码示例>>Python>>正文


Python jigs.Jig类代码示例

本文整理汇总了Python中model.jigs.Jig的典型用法代码示例。如果您正苦于以下问题:Python Jig类的具体用法?Python Jig怎么用?Python Jig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Jig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setAtoms

 def setAtoms(self, atomlist): #bruce 080208 split this out of __init__ so copy is simpler
     Jig.setAtoms(self, atomlist)
     if len(atomlist) == _NUMBER_OF_MARKER_ATOMS:
         marked_atom, next_atom = atomlist
         self.marked_atom = marked_atom
         self.next_atom = next_atom
         assert not self._length_1_chain
     elif len(atomlist) == 1 and self._length_1_chain:
         #bruce 080216, for 1-atom wholechains
         # (the flag test is to make sure it's only used then)
         self.marked_atom = self.next_atom = atomlist[0]
     else:
         # We are probably being called by _copy_fixup_at_end
         # with fewer or no atoms, or by __init__ in first stage of copy
         # (Jig.copy_full_in_mapping) with no atoms.
         # todo: would be better to make those callers tell us for sure.
         # for now: print bug warning if fewer atoms but not none
         # (i don't know if that can happen), and assert not too many atoms.
         assert len(atomlist) <= _NUMBER_OF_MARKER_ATOMS
         if atomlist:
             print "bug? %r.setAtoms(%r), len != _NUMBER_OF_MARKER_ATOMS or 0" % \
                   (self, atomlist)
         self.marked_atom = self.next_atom = None #bruce 080216
     self._check_atom_order() #bruce 080216 do in all cases, was just main one
     return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:25,代码来源:ChainAtomMarker.py

示例2: __init__

 def __init__(self, assy, atomlist):
     Jig.__init__(self, assy, atomlist)        
     self.font_name = "Helvetica"
     self.font_size = 10.0 # pt size
     self.color = black # This is the "draw" color.  When selected, this will become highlighted red.
     self.normcolor = black # This is the normal (unselected) color.
     self.cancelled = True # We will assume the user will cancel
     self.handle_offset = V(0.0, 0.0, 0.0)
开发者ID:,项目名称:,代码行数:8,代码来源:

示例3: edit

 def edit(self): # in class ESPImage
     """
     Force into 'Build' mode before opening the dialog
     """
     #bruce 060403 changes: force Build, not Select Atoms as before; only do this if current mode is not Build.
     # (But why do we need to force it into any particular mode? I don't know. [bruce 070608])
     commandSequencer = self.assy.w.commandSequencer #bruce 071008
     if commandSequencer.currentCommand.commandName != 'DEPOSIT':
         commandSequencer.userEnterCommand('DEPOSIT')
     Jig.edit(self)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:10,代码来源:ESPImage.py

示例4: __init__

    def __init__(self, assy, atomlist = []): #bruce 050526 added optional atomlist arg
        assert atomlist == [] # whether from default arg value or from caller -- for now
        Jig.__init__(self, assy, atomlist)

        self.quat = Q(1, 0, 0, 0)
            # is self.quat ever set to other values? if not, remove it; if so, add it to mutable_attrs. [bruce 060228 comment]
        
        #The motor is usually drawn as an opaque object. However when it is
        #being previewed, it is drawn as a transparent object - Ninad 2007-10-09
        self.previewOpacity = 0.4
        self.defaultOpacity = 1.0
        self.opacity = self.defaultOpacity
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:12,代码来源:jigs_motors.py

示例5: __init__

    def __init__(self, assy, list, READ_FROM_MMP):
        Jig.__init__(self, assy, list)
        
        self.width = 20
        self.height = 20
        
        self.assy = assy
        self.cancelled = True # We will assume the user will cancel

        self.atomPos = []
        if not READ_FROM_MMP:
            self.__init_quat_center(list)        
开发者ID:pmetzger,项目名称:nanoengineer,代码行数:12,代码来源:jigs_planes.py

示例6: __init__

 def __init__(self, assy, list):
     Jig.__init__(self, assy, list)
     self.cancelled = False
     # set default color of new gamess jig to magenta
     self.color = magenta # This is the "draw" color.  When selected, this will become highlighted red.
     self.normcolor = magenta # This is the normal (unselected) color.
     #bruce 050913 thinks self.history is no longer needed:
     ## self.history = env.history
     #self.psets = [] # list of parms set objects [as of circa 050704, only the first of these is ever defined (thinks bruce)]
     self.pset = gamessParms('Parameter Set 1')
     self.gmsjob = GamessJob(Gamess.job_parms, jig=self)
     ## bruce 050701 removing this: self.gmsjob.edit()
     self.outputfile = '' # Name of jig's most recent output file. [this attr is intentionally not copied -- bruce 050704]
开发者ID:elfion,项目名称:nanoengineer,代码行数:13,代码来源:jig_Gamess.py

示例7: __init__

 def __init__(self, win):
     self.win = win
     #Node.__init__(self, win.assy, gensym("%s" % self.sym, win.assy))
     Jig.__init__(self, win.assy, self.atoms) # note: that sets self.glname
     self.glpane = self.assy.o
     #@@Geometry object with a visible direction arrow
     #(at present used in Plane only) This saves the last geometry object
     #for which the Direction arrow was drawn
     #(that decides the direction of a plane offset to the object)
     #The program needs to skip the arrow drawing (which is done inside the
     # objects _draw_geometry method) when prop manager is closed or when the
     #Offset option is no more requested.  -- ninad 20070612
     self.offsetParentGeometry = None
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:13,代码来源:ReferenceGeometry.py

示例8: is_disabled

 def is_disabled(self):
     """
     Which is called when model tree is updated?
     """
     val = Jig.is_disabled(self)
     self.gmsjob.edit_cntl.run_job_btn.setEnabled(not val)
     return val
开发者ID:elfion,项目名称:nanoengineer,代码行数:7,代码来源:jig_Gamess.py

示例9: __init__

 def __init__(self, assy, atomlist):
     """
     """
     if len(atomlist) == 2 and atomlist[0] is atomlist[1]:
         # let caller pass two atoms the same, but reduce it to one copy
         # (compensating in setAtoms)
         # (this is to make length-1 wholechains easier) [bruce 080216]
         atomlist = atomlist[:1]
         self._length_1_chain = True
     elif len(atomlist) == 1:
         # [bruce 080227 to support mmp read of 1-atom case]
         # TODO: print warning unless this is called from mmp read
         # (which is the only time it's not an error, AFAIK)
         # and mark self invalid unless we verify that marked_atom
         # is indeed on a length-1 chain (this might need to be
         # done later by dna updater).
         self._length_1_chain = True
     Jig.__init__(self, assy, atomlist) # calls self.setAtoms
     return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:19,代码来源:ChainAtomMarker.py

示例10: make_selobj_cmenu_items

    def make_selobj_cmenu_items(self, menu_spec):
        """
        Add Motor-specific context menu items to <menu_spec> list when self is the selobj.
        """
        Jig.make_selobj_cmenu_items(self, menu_spec)
            #bruce 060313 share this code (it is identical to the following commented out code)
##        item = ('Hide', self.Hide)
##        menu_spec.append(item)
##        if self.disabled_by_user_choice:
##            item = ('Disabled', self.toggleJigDisabled, 'checked')
##        else:
##            item = ('Disable', self.toggleJigDisabled, 'unchecked')
##        menu_spec.append(item)
##        menu_spec.append(None) # Separator
##        item = ('Properties...', self.edit)
##        menu_spec.append(item)
        item = ('Align to Chunk', self.__CM_Align_to_chunk)
        menu_spec.append(item)
        item = ('Recenter on Atoms', self.__CM_Recenter_on_atoms)
        menu_spec.append(item)
        item = ('Reverse Direction', self.__CM_Reverse_direction)
        menu_spec.append(item)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:22,代码来源:jigs_motors.py

示例11: writemmp

 def writemmp(self, mapping):
     """
     [extends superclass method]
     """
     # check a few things, then call superclass method
     try:
         assert not self.is_homeless() # redundant as of 080111, that's ok
         assert len(self.atoms) in (1, _NUMBER_OF_MARKER_ATOMS)
         self._check_atom_order()
     except:
         #bruce 080317, for debugging the save file traceback in
         # "assert not self.is_homeless()" (above) in bug 2673,
         # happens when saving after region select + delete of any
         # duplex; fixed now
         msg = "\n*** BUG: exception in checks before DnaMarker.writemmp; " \
               "continuing, but beware of errors when reopening the file"
         print_compact_traceback( msg + ": ")
         pass
     
     return Jig.writemmp(self, mapping)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:20,代码来源:ChainAtomMarker.py

示例12: remove_atom

 def remove_atom(self, *args, **opts):
     self._initial_posns = None #bruce 050518; needed in RotaryMotor, harmless in others
     return Jig.remove_atom(self, *args, **opts)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:3,代码来源:jigs_motors.py

示例13: __CM_Calculate_Energy__options

 def __CM_Calculate_Energy__options(self):
     if Jig.is_disabled(self):
         return ['disabled']
     else:
         return []
     pass
开发者ID:elfion,项目名称:nanoengineer,代码行数:6,代码来源:jig_Gamess.py

示例14: __CM_Optimize_Geometry__options

 def __CM_Optimize_Geometry__options(self):
     if Jig.is_disabled(self):
         return ['disabled']
     else:
         return []
开发者ID:elfion,项目名称:nanoengineer,代码行数:5,代码来源:jig_Gamess.py

示例15: readmmp_info_leaf_setitem

 def readmmp_info_leaf_setitem(self, key, val, interp):
     import string, numpy.oldnumeric
     if key == ['handle']:
         self.handle_offset = Numeric.array(map(string.atof, val.split())) - self.center()
     else:
         Jig.readmmp_info_leaf_setitem(self, key, val, interp)
开发者ID:,项目名称:,代码行数:6,代码来源:


注:本文中的model.jigs.Jig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。