Package Pmv :: Module moleculeViewer :: Class MoleculeViewer
[hide private]
[frames] | no frames]

Class MoleculeViewer

source code

ViewerFramework.VF.ViewerFramework --+
                                     |
                                    MoleculeViewer


package    : Pmv
module     : moleculeViewer
class      : MoleculeViewer
description:
   Class derived from the ViewerFramework base class. It provides a 3D
   molecular viewer.



Instance Methods [hide private]
  getSelLev(self)
  setSelLev(self, value)
  __init__(self, title="Molecule Viewer", logMode='no', libraries=[], gui=1, resourceFile='_pmvrc', customizer=None, master=None, guiVisible=1, withShell=1, verbose=True, trapExceptions=True)
* title: string used as a title.
  drop_cb(self, files)
  getMolFromName(self, name)
  setRaiseException(self, name, oldval, val)
  unsolicitedPick(self, pick)
treat an unsollicited picking event
  loadMoleculeIfNeeded(self, filename)
load a molecule only if it doesn't exist yet in Pmv, else it aborts silent
  addMolecule(self, newmol, ask=1)
Add a molecule to this viewer
  addVolume(self, name, grid)
  getSelection(self)
  getItems(self, selString="")
Takes a string and returns a TreeNodeSet The string can contain a series of set descriptors with operators separated by / characters.
  expandNodes(self, nodes)
Takes nodes as string or TreeNode or TreeNodeSet and returns a TreeNodeSet If nodes is a string it can contain a series of set descriptors with operators separated by / characters.
  getNodesByMolecule(self, nodes, nodeType=None)
moleculeSet, [nodeSet, nodeSet] <- getNodesByMolecule(nodes, nodeType=None) nodes can be either: a string, a TreeNode or a TreeNodeSet.
  addMVBasicMenus(self)
  findPickedAtoms(self, pick)
given a PickObject this function finds all corresponding atoms.
  findPickedBonds(self, pick)
do a pick operation and return a 2-tuple holding (the picked bond, the picked geometry)
  transformedCoordinatesWithInstances(self, nodes)
for a nodeset, this function returns transformed coordinates.
  Add_ADT(self)
Adds AutoToolsBar

Inherited from ViewerFramework.VF.ViewerFramework: DoPick, SetIconSize, SetVisualPickingFeedBack, addBasicCommands, addColorMap, addCommand, addObject, addOnAddObjectCmd, after, askFileOpen, askFileSave, askOkCancelMsg, clients_cb, customize, dispatchEvent, drawSelectionRectangle, endSelectionRectangle, errorMsg, fillDelayValidate, fillSelectionBoxDelayPref_cb, fillSelectionBoxPref_cb, getOnAddObjectCmd, getUserInput, initSelectionRectangle, log, message, registerListener, removeObject, removeOnAddObjectCmd, server_cb, setWarningMsgFormat, startupDirPref_cb, startupDirValidate, tryOpenFileInWrite, tryto, updateGeomContainers, validInstance, warningMsg


Properties [hide private]
  selectionLevel

Method Details [hide private]

getSelLev(self)

source code 
None

setSelLev(self, value)

source code 
None

__init__(self, title="Molecule Viewer", logMode='no', libraries=[], gui=1, resourceFile='_pmvrc', customizer=None, master=None, guiVisible=1, withShell=1, verbose=True, trapExceptions=True)
(Constructor)

source code 

* title:
  string used as a title. 
* logMode:
  string specifying the mode of logging of mv.
    'no': for no loging of commands at all
    'overwrite': the log files overwrite the one from the previous
                 session the log files = mvAll.log.py
    'unique': the log file name include the date and time

* libraries:
  list of the Python packages containing modules and commands
  that can be loaded in the application. Such a package needs the
  following files : cmdlib.py and modlib.py
* gui :
  Flag specifying whether or not to run the application with a gui.
* resourceFile:
  file sourced at startup and where userpreference  made as default
  are saved (default: '.pmvrc')
* customizer :
  file when specified is sourced at startup instead of the resourceFile
* master:
  can be specified to run PMV withing another GUI application.
* guiVisible:
  Flag to specify whether or not to show the GUI.
- trapExceptions should be set to False when creating a ViewerFramework
  for testing, such that exception are seen by the testing framework

Overrides: ViewerFramework.VF.ViewerFramework.__init__

drop_cb(self, files)

source code 
None

getMolFromName(self, name)

source code 
None

setRaiseException(self, name, oldval, val)

source code 
None

unsolicitedPick(self, pick)

source code 
treat an unsollicited picking event
Overrides: ViewerFramework.VF.ViewerFramework.unsolicitedPick

loadMoleculeIfNeeded(self, filename)

source code 
load a molecule only if it doesn't exist yet in Pmv, else it aborts silent

addMolecule(self, newmol, ask=1)

source code 
Add a molecule to this viewer

addVolume(self, name, grid)

source code 
None

getSelection(self)

source code 
None

getItems(self, selString="")

source code 
Takes a string and returns a TreeNodeSet
The string  can contain a series of set descriptors with operators
separated by / characters.  There is always a first set, followed by pairs of
operators and sets.  All sets have to describe nodes of the same level.
example:
    '1crn:::CA*/+/1crn:::O*' describes the union of all CA ans all O in 1crn
    '1crn:::CA*/+/1crn:::O*/-/1crn::TYR29:' 

expandNodes(self, nodes)

source code 
Takes nodes as string or TreeNode or TreeNodeSet and returns
a TreeNodeSet
If nodes is a string it can contain a series of set descriptors with operators
separated by / characters.  There is always a first set, followed by pairs of
operators and sets.  All sets ahve to describe nodes of the same level.

example:
    '1crn:::CA*/+/1crn:::O*' describes the union of all CA ans all O in 1crn
    '1crn:::CA*/+/1crn:::O*/-/1crn::TYR29:' 

getNodesByMolecule(self, nodes, nodeType=None)

source code 
moleculeSet, [nodeSet, nodeSet] <- getNodesByMolecule(nodes, nodeType=None) nodes can be either: a string, a TreeNode or a TreeNodeSet. This method returns a molecule set and for each molecule a TreeNodeSet of the nodes belonging to this molecule. 'nodeType' enables a desired type of nodes to be returned for each molecule

addMVBasicMenus(self)

source code 
None

findPickedAtoms(self, pick)

source code 
given a PickObject this function finds all corresponding atoms. Each atom in the returned set has its attribute pickedInstances set to a list of 2-tuples [(geom, instance),...].

findPickedBonds(self, pick)

source code 
do a pick operation and return a 2-tuple holding (the picked bond, the picked geometry)

transformedCoordinatesWithInstances(self, nodes)

source code 
for a nodeset, this function returns transformed coordinates. This function will use the pickedInstance attribute if found.
Overrides: ViewerFramework.VF.ViewerFramework.transformedCoordinatesWithInstances

Add_ADT(self)

source code 
Adds AutoToolsBar

Property Details [hide private]

selectionLevel

None
Get Method:
Pmv.moleculeViewer.MoleculeViewer.getSelLev(self)
Set Method:
Pmv.moleculeViewer.MoleculeViewer.setSelLev(self, value)
Delete Method:
None