next up previous contents
Next: Molecule Up: Molecule objects Previous: BaseMolecule   Contents

Subsections


DrawMolecule

Files: DrawMolecule.h, DrawMolecule.C
Derived from: \bf BaseMolecule, \bf Displayable
Global instance (if any): none
Used in optional component: Part of main VMD code

Description

DrawMolecule is derived from BaseMolecule, and is the next level in the Molecule class hierarchy. It embodies the level of control and functionality responsible for creating a graphical image of the molecule. It is derived from Displayable (actually, from Displayable3D), and so will be part of the Scene that will be drawn by a DisplayDevice.

Each DrawMolecule keeps a list of DrawMolItem objects; each DrawMolItem is also a Displayable, and is responsible for a single representation of the molecule. Each representation contains a display list used to draw a single view of the molecule. To define a single representation, each DrawMolItem contains one instance each of the following objects:

When a new DrawMolecule is created (i.e. when a new Molecule is created), it is added as a child Displayable to a global MoleculeList object. Thus, you can rotate just the MoleculeList, and this will rotate all the molecules at the same time. When a molecule is first displayed, it is scaled and translated to fit within a -1 ... 1 size box centered around the origin. In order to have all the molecules be the proper size in relation to each other, and to preserve the spatial position of the molecules, only one molecule is used to determine the scaling and translation positions, and the others then use those same scaling and translation values.

Each DrawMolItem added to this object are added as child Displayable objects of DrawMolecule, and so scaling and rotating the molecule will do so to all the DrawMolItem objects at the same time.

Constructors

Internal data structures

Nonvirtual member functions

Virtual member functions

Method of use

The user should never create a DrawMolecule directly; it should instead be used as a base class for Molecule.


next up previous contents
Next: Molecule Up: Molecule objects Previous: BaseMolecule   Contents
vmd@ks.uiuc.edu