Up: Molecule objects
This is the class used generally throughout VMD to represent and access
a molecule. It is derived from several base classes which provide the
storage and control over the molecule's structure (BaseMolecule),
animation list (Animation), and graphical display (DrawMolecule).
It still does not contain the abilities to read in new molecular data from
different sources, instead these are in classes derived from Molecule.
This class is used as the basic class that all other parts of VMD are aware of, since once a molecule is read in from some source, it acts
just like any other molecule.
|Global instance (if any):
|Used in optional component:
||Part of main VMD code
The one level of extra functionality which is provided directly by the
Molecule class is the ability to read in new coordinate frames from
an external coordinate file, either a PDB or a DCD file.
- Molecule::Molecule(char *, Scene *)
The first argument is the source of the data, it is a string
indicating either a file, or some remote computer, or perhaps some other
source. The second argument is the Scene to which this molecule
should be added. This version of the constructor should only be used if
no MoleculeList is being used.
- Molecule::Molecule(char *, Displayable *)
Same as above, except a parent Displayable is specified instead of
a Scene. This is the version that should be used mainly in VMD,
with the global MoleculeList object specified as the parent
Displayable for the molecule.
- char *source - the source of the molecule structure data.
- ResizeArray<CoorFileData *> coorIOFiles - data on which files
containing atomic coordinates are to be read in by this object. Each
CoorFileData instance contains data on which file to read, what type
of file it is, and which frames to read from the file. The same data
is stored in the case where a file is to be written instead of read.
- int read_coor_file(char *, int, int=(-1), int=(-1), int=(-1))
- request to read in the specified file. The second argument is the type,
and the remaining are the beginning frame, ending frame, and frame skip
values. If any are not specified or are < 0, default values are used.
- write_coor_file(char *, int, int=(-1), int=(-1), int=(-1))
- same as above, but requests to write out a file.
- virtual void prepare(DisplayDevice *) - does any preparation
necessary before redrawing. If data files are being read, this will read
the next frame from them.
New molecules are created in VMD in the CmdMolNew object, which is
a particular Command-derived object. When a new molecule is to be
created, the type of molecule source and necessary data are specified (such
as filenames, remote computer names, etc) and given to the constructor of
a specialized subclass of Molecule. The resulting (empty) molecule
is assigned to a Molecule * pointer variable, and then the virtual
create routine is called. After this, the molecule is added to
the MoleculeList, and any extra actions are taken such as requesting
for more coordinate files to be read, etc.
Up: Molecule objects