Package Pmv :: Module selectionCommands :: Class MVSelectCommand
[hide private]
[frames] | no frames]

Class MVSelectCommand

source code

 ViewerFramework.VFCommand.Command --+    
                                     |    
                   mvCommand.MVCommand --+
                                         |
ViewerFramework.VFCommand.ICOM --+       |
                                 |       |
                  mvCommand.MVICOM --+   |
                                     |   |
                  mvCommand.MVAtomICOM --+
                                         |
                                        MVSelectCommand
Known Subclasses:
MVAddSelectCommand, MVDeSelectCommand, MVXorSelectCommand

Class for modfying the current selection in a molecule Viewer.
       
selection --- a TreeNodeSet holding the current selection. Modfied by SubClasses implementing a specific selection operation
       
level --- level at which selection occurs
    
Package : Pmv
    
Module  : selectionCommands
    
Class   : MVSelectCommand
    
Command : select
    
Synopsis:

    currentSelection <- select(nodes, negate=False, only=False, klass=None)
    
Required Arguments:

        nodes --- can be a string, a TreeNode or a treeNodeSet
    
Optional Arguments:
    
        negate --- is 1 nodes are removed from current selection
        
only  --- is  1 the current selection is replaced by the nodes
        
klass ----is omitted class of objects in nodes is used, else
                  nodes is converted to a set of objects of type Klass and
                  current selection level is set to klass
    



Instance Methods [hide private]
  __init__(self, func=None)
  setupUndoBefore(self, nodes, negate=False, only=False, klass=None, xor=False, intersect=False)
This method builds the self.undoCmds string.
  __call__(self, nodes, negate=False, only=False, klass=None, xor=False, intersect=False, **kw)
currentSelection <- select(nodes, negate=False, only=False, ...
  doit(self, nodes, negate=False, only=False, xor=False, intersect=False)
add/remove nodes to the current selection at this point it is assumed that nodes is of the same type as the current selection
  startICOM(self)
gets called every time this command is about to be run becuase of a picking event.
  setLevel(self, Klass, KlassSet=None)
  updateSelectionFeedback(self)
  updateInfoBar(self)
  updateSelectionIcons(self)
update selection icons
  clear(self)
  dump(self)

Inherited from mvCommand.MVCommand: guiCallback, 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, showForm, tkCb, updateGeom, warningMsg

Inherited from mvCommand.MVAtomICOM: getObjects

Inherited from ViewerFramework.VFCommand.ICOM: initICOM, stopICOM


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__

setupUndoBefore(self, nodes, negate=False, only=False, klass=None, xor=False, intersect=False)

source code 
This method builds the self.undoCmds string. This method should have the same signature than the __call__. When this string is executed it should undo the actions of this command. This string will be appended to the undoCmdStack list if the command is successfuly carried out. This method handles only commands with the negateKw. Other commands have to overwrite it.
Overrides: ViewerFramework.VFCommand.Command.setupUndoBefore
(inherited documentation)

__call__(self, nodes, negate=False, only=False, klass=None, xor=False, intersect=False, **kw)
(Call operator)

source code 
currentSelection <- select(nodes, negate=False, only=False, 
                                klass=None, xor=False, intersect=False )
        
Required Arguments:

            nodes --- can be a string, a TreeNode or a treeNodeSet
        
Optional Arguments:

            negate --- is 1 nodes are removed from current selection
            
only  --- is  1 the current selection is replaced by the nodes
            
klass ----is omitted class of objects in nodes is used, else
                  nodes is converted to a set of objects of type Klass and
                  current selection level is set to klass   
        

Overrides: ViewerFramework.VFCommand.Command.__call__

doit(self, nodes, negate=False, only=False, xor=False, intersect=False)

source code 
add/remove nodes to the current selection at this point it is assumed that nodes is of the same type as the current selection
Overrides: ViewerFramework.VFCommand.Command.doit

startICOM(self)

source code 
gets called every time this command is about to be run becuase of a picking event. It is called just before the Pick is converted into objects.
Overrides: ViewerFramework.VFCommand.ICOM.startICOM
(inherited documentation)

setLevel(self, Klass, KlassSet=None)

source code 
None

updateSelectionFeedback(self)

source code 
None

updateInfoBar(self)

source code 
None

updateSelectionIcons(self)

source code 
update selection icons

clear(self)

source code 
None

dump(self)

source code 
None