Package Pmv :: Module editCommands :: Class TypeBondsCommand
[hide private]
[frames] | no frames]

Class TypeBondsCommand

source code

ViewerFramework.VFCommand.Command --+    
                                    |    
                  mvCommand.MVCommand --+
                                        |
                                       TypeBondsCommand

This class uses the BondOrder class to compute bond order.
    
Package:Pmv
    
Module :editCommands
    
Class:TypeBondsCommand
    
Command:typeBonds
    
Synopsis:

        None<---typeBonds(nodes, withRings=0, **kw)
    
Required Arguments:

        nodes --- TreeNodeSet holding the current selection
        withRings: default is 0
Before a BondOrder object can be used, atoms must have been assigned
a type see (AtomHybridization in types.py).

Bond order can be calculated using 2 different methods depending on whether
rings have been identified previously or not. Babel decides to use the first
method for molecules with more than 200 atoms and the second one else.

example:


      >>> atype = AtomHybridization()

      >>> atype.assignHybridization(atoms)

      >>> bo = BondOrder()

      >>> bo.assignBondOrder( atoms, bonds )


      or


      >>> atype = AtomHybridization()

      >>> atype.assignHybridization(atoms)

      >>> rings = RingFinder()

      >>> rings.findRings(allAtoms, bonds)

      >>> bo = BondOrder()

      >>> bo.assignBondOrder( atoms, bonds, rings )


      atoms has to be a list of atom objects

      Atom:

      a .coords : 3-sequence of floats

      a .bonds : list of Bond objects

      babel_type: string

      babel_atomic_number: int


      Bond:

      b .atom1 : instance of Atom

      b .atom2 : instance of Atom


      after completion each bond has a 'bondOrder' attribute (integer)


reimplementation of Babel1.6 in Python by Michel Sanner April 2000
Original code by W. Patrick Walters and Matthew T. Stahl


    



Instance Methods [hide private]
  __init__(self, func=None)
  doit(self, nodes, withRings=False)
virtual method.
  __call__(self, nodes, withRings=False, **kw)
None<---typeBonds(nodes, withRings=0, **kw)
  guiCallback(self)

Inherited from mvCommand.MVCommand: strArg

Inherited from mvCommand.MVCommand (private): _strArg

Inherited from ViewerFramework.VFCommand.Command: __repr__, addCallbackAfter, addCallbackBefore, addUndoCall, afterDoit, beforeDoit, buildFormDescr, buildLogArgList, checkDependencies, cleanup, customizeGUI, doitWrapper, getArguments, getHelp, getLastUsedValues, getLogArgs, getValNamedArgs, log, logString, onAddCmdToViewer, onAddNewCmd, onCmdRun, setLastUsedValues, setupUndoAfter, setupUndoBefore, showForm, tkCb, updateGeom, warningMsg


Class Variables [hide private]

Inherited from ViewerFramework.VFCommand.Command: negateKw, objArgOnly


Method Details [hide private]

__init__(self, func=None)
(Constructor)

source code 
None
Overrides: mvCommand.MVCommand.__init__

doit(self, nodes, withRings=False)

source code 
virtual method. Has to be implemented by the sub classes
Overrides: ViewerFramework.VFCommand.Command.doit
(inherited documentation)

__call__(self, nodes, withRings=False, **kw)
(Call operator)

source code 

None<---typeBonds(nodes, withRings=0, **kw)

nodes --- TreeNodeSet holding the current selection

withRings --- default is 0
Overrides: ViewerFramework.VFCommand.Command.__call__

guiCallback(self)

source code 
None
Overrides: mvCommand.MVCommand.guiCallback