Package Pmv :: Module colorCommands :: Class ColorByProperties
[hide private]
[frames] | no frames]

Class ColorByProperties

source code

ViewerFramework.VFCommand.Command --+        
                                    |        
                  mvCommand.MVCommand --+    
                                        |    
                             ColorCommand --+
                                            |
                                           ColorByProperties
Known Subclasses:
ColorByExpression


    Command to color the current selection according to the integer
    or float properties, or by defining a function.
    
Package : Pmv
    
Module  : colorCommands
    
Class   : ColorByProperties
    
Command : colorByProperties
    
Synopsis:

      None <- colorByProperties(nodes, geomsToColor, property,colormap='rgb256', **kw)

      nodes --- any set of MolKit nodes describing molecular components

      geomsToColor --- list of the name of geometries to color default is 'all'

      property ---  property name of type integer or float or property defined by a function returning a list of float or int.

      colormap ---  either a string representing a colormap or a DejaVu.ColorMap instance.

    



Instance Methods [hide private]
  __init__(self, func=None)
  onAddCmdToViewer(self)
method called when an instance of this command is added to the viewer.
  updateLevel_cb(self, tag)
  getPropValues(self, nodes, prop, propertyLevel=None)
  loadCM_cb(self, event=None)
Callback to load a new color map file.
  updateCM(self, event=None)
  updateMiniMaxi(self, cmName, event=None)
  updateValMinMax(self, event=None)
  entryValidate(self, text)
  buildFormDescr(self, formName)
descr <- buildFormDescr(self, formName): this virtual method is implemented in the classes derived from Command.
  updateChooser(self, selection)
  guiCallback(self)
  cmGUI_cb(self, geomsToColor, property, colormap, propertyLevel=None)
  setupUndoBefore(self, nodes, geomsToColor, property, propertyLevel=None, colormap='RGBARamp', mini=None, maxi=None)
This method builds the self.undoCmds string.
  doit(self, nodes, geomsToColor, property, propertyLevel=None, colormap=None, mini='not passed', maxi='not passed')
virtual method.
  colorProp(self, nodes, geomsToColor, selectioncol, propertyLevel=None)
  __call__(self, nodes, geomsToColor, property, propertyLevel=None, colormap='rgb256', mini=None, maxi=None, **kw)
None <- colorByProperty(nodes, geomsToColor, property,colormap='rgb256', **kw)

Inherited from ColorCommand: addNewEntries, cleanup, color_cb, deselectall_cb, dismiss_cb, getAvailableGeoms, getChildrenGeomsName, getNodes, selectall_cb, showForm, showUndisplayed_cb

Inherited from mvCommand.MVCommand: strArg

Inherited from mvCommand.MVCommand (private): _strArg

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


Class Variables [hide private]
  levelOrder = {'Residue': 1, 'Molecule': 3, 'Chain': 2, 'Atom': 0}

Inherited from ViewerFramework.VFCommand.Command: negateKw, objArgOnly


Method Details [hide private]

__init__(self, func=None)
(Constructor)

source code 
None
Overrides: ColorCommand.__init__

onAddCmdToViewer(self)

source code 
method called when an instance of this command is added to the viewer. This enable viewer-addition time initializations
Overrides: ColorCommand.onAddCmdToViewer

updateLevel_cb(self, tag)

source code 
None

getPropValues(self, nodes, prop, propertyLevel=None)

source code 
None

loadCM_cb(self, event=None)

source code 
Callback to load a new color map file.

updateCM(self, event=None)

source code 
None

updateMiniMaxi(self, cmName, event=None)

source code 
None

updateValMinMax(self, event=None)

source code 
None

entryValidate(self, text)

source code 
None

buildFormDescr(self, formName)

source code 
descr <- buildFormDescr(self, formName): this virtual method is implemented in the classes derived from Command. This is where the inputFormDescr is created and the description of the widgets appended. If a command has several inputForm buildFormDescr should build all the inputFormDescr and you do a if / elif check to know which one to create. formName : string name of the form corresponding to this descr.
Overrides: ColorCommand.buildFormDescr

updateChooser(self, selection)

source code 
None

guiCallback(self)

source code 
None
Overrides: ColorCommand.guiCallback

cmGUI_cb(self, geomsToColor, property, colormap, propertyLevel=None)

source code 
None

setupUndoBefore(self, nodes, geomsToColor, property, propertyLevel=None, colormap='RGBARamp', mini=None, maxi=None)

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: ColorCommand.setupUndoBefore

doit(self, nodes, geomsToColor, property, propertyLevel=None, colormap=None, mini='not passed', maxi='not passed')

source code 
virtual method. Has to be implemented by the sub classes
Overrides: ColorCommand.doit

colorProp(self, nodes, geomsToColor, selectioncol, propertyLevel=None)

source code 
None

__call__(self, nodes, geomsToColor, property, propertyLevel=None, colormap='rgb256', mini=None, maxi=None, **kw)
(Call operator)

source code 

None <- colorByProperty(nodes, geomsToColor, property,colormap='rgb256', **kw)

node --- TreeNodeSet holding the current selection

geomsToColor --- the list of the name geometries to be colored

property --- property name of type integer or float or property defined by a function returning a list of float or int.

colormap--- either a string representing a colormap or a DejaVu.ColorMap instance.
Overrides: ColorCommand.__call__

Class Variable Details [hide private]

levelOrder

None
Value:
{'Residue': 1, 'Molecule': 3, 'Chain': 2, 'Atom': 0}