VTK
|
class describing a molecule More...
#include <vtkMolecule.h>
class describing a molecule
vtkMolecule and the convenience classes vtkAtom and vtkBond describe the geometry and connectivity of a molecule. The molecule can be constructed using the AppendAtom() and AppendBond() methods in one of two ways; either by fully specifying the atom/bond in a single call, or by incrementally setting the various attributes using the convience vtkAtom and vtkBond classes:
Single call:
vtkMolecule *mol = vtkMolecule::New(); vtkAtom h1 = mol->AppendAtom(1, 0.0, 0.0, -0.5); vtkAtom h2 = mol->AppendAtom(1, 0.0, 0.0, 0.5); vtkBond b = mol->AppendBond(h1, h2, 1);
Incremental:
vtkMolecule *mol = vtkMolecule::New(); vtkAtom h1 = mol->AppendAtom(); h1.SetAtomicNumber(1); h1.SetPosition(0.0, 0.0, -0.5); vtkAtom h2 = mol->AppendAtom(); h2.SetAtomicNumber(1); vtkVector3d displacement (0.0, 0.0, 1.0); h2.SetPosition(h1.GetPositionAsVector3d() + displacement); vtkBond b = mol->AppendBond(h1, h2, 1);
Both of the above methods will produce the same molecule, two hydrogens connected with a 1.0 Angstrom single bond, aligned to the z-axis. The second example also demostrates the use of VTK's vtkVector class, which is fully supported by the Chemistry kit.
The vtkMolecule object is intended to be used with the vtkMoleculeMapper class for visualizing molecular structure using common rendering techniques.
Definition at line 88 of file vtkMolecule.h.
Reimplemented from vtkUndirectedGraph.
Definition at line 92 of file vtkMolecule.h.
vtkMolecule::vtkMolecule | ( | ) | [protected] |
vtkMolecule::~vtkMolecule | ( | ) | [protected] |
static vtkMolecule* vtkMolecule::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkUndirectedGraph.
static int vtkMolecule::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkUndirectedGraph.
virtual int vtkMolecule::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkUndirectedGraph.
static vtkMolecule* vtkMolecule::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkUndirectedGraph.
virtual vtkObjectBase* vtkMolecule::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkUndirectedGraph.
vtkMolecule* vtkMolecule::NewInstance | ( | ) | const |
Reimplemented from vtkUndirectedGraph.
void vtkMolecule::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkUndirectedGraph.
virtual void vtkMolecule::Initialize | ( | ) | [virtual] |
Initialize to an empty graph.
Reimplemented from vtkGraph.
virtual int vtkMolecule::GetDataObjectType | ( | ) | [inline, virtual] |
Return what type of dataset this is.
Reimplemented from vtkUndirectedGraph.
Definition at line 97 of file vtkMolecule.h.
vtkAtom vtkMolecule::AppendAtom | ( | ) | [inline] |
Add new atom with atomic number 0 (dummy atom) at origin. Return a vtkAtom that refers to the new atom.
Definition at line 103 of file vtkMolecule.h.
vtkAtom vtkMolecule::AppendAtom | ( | unsigned short | atomicNumber, |
const vtkVector3f & | pos | ||
) |
Add new atom with the specified atomic number and position. Return a vtkAtom that refers to the new atom.
vtkAtom vtkMolecule::AppendAtom | ( | unsigned short | atomicNumber, |
double | x, | ||
double | y, | ||
double | z | ||
) | [inline] |
Convenience methods to append a new atom with the specified atomic number and position.
Definition at line 116 of file vtkMolecule.h.
vtkAtom vtkMolecule::GetAtom | ( | vtkIdType | atomId | ) |
Return a vtkAtom that refers to the atom with the specified id.
Return the number of atoms in the molecule.
vtkBond vtkMolecule::AppendBond | ( | vtkIdType | atom1, |
vtkIdType | atom2, | ||
unsigned short | order = 1 |
||
) |
Add a bond between the specified atoms, optionally setting the bond order (default: 1). Return a vtkBond object referring to the new bond.
vtkBond vtkMolecule::AppendBond | ( | const vtkAtom & | atom1, |
const vtkAtom & | atom2, | ||
unsigned short | order = 1 |
||
) | [inline] |
Add a bond between the specified atoms, optionally setting the bond order (default: 1). Return a vtkBond object referring to the new bond.
Definition at line 134 of file vtkMolecule.h.
vtkBond vtkMolecule::GetBond | ( | vtkIdType | bondId | ) |
Return a vtkAtom that refers to the bond with the specified id.
Return the number of bonds in the molecule.
unsigned short vtkMolecule::GetAtomAtomicNumber | ( | vtkIdType | atomId | ) |
Return the atomic number of the atom with the specified id.
void vtkMolecule::SetAtomAtomicNumber | ( | vtkIdType | atomId, |
unsigned short | atomicNum | ||
) |
Set the atomic number of the atom with the specified id.
void vtkMolecule::SetAtomPosition | ( | vtkIdType | atomId, |
const vtkVector3f & | pos | ||
) |
Set the position of the atom with the specified id.
void vtkMolecule::SetAtomPosition | ( | vtkIdType | atomId, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Set the position of the atom with the specified id.
vtkVector3f vtkMolecule::GetAtomPosition | ( | vtkIdType | atomId | ) |
Get the position of the atom with the specified id.
void vtkMolecule::GetAtomPosition | ( | vtkIdType | atomId, |
float | pos[3] | ||
) |
Get the position of the atom with the specified id.
void vtkMolecule::SetBondOrder | ( | vtkIdType | bondId, |
unsigned short | order | ||
) |
Get/Set the bond order of the bond with the specified id
unsigned short vtkMolecule::GetBondOrder | ( | vtkIdType | bondId | ) |
Get/Set the bond order of the bond with the specified id
double vtkMolecule::GetBondLength | ( | vtkIdType | bondId | ) |
Get the bond length of the bond with the specified id
Access the raw arrays used in this vtkMolecule instance
Access the raw arrays used in this vtkMolecule instance
virtual vtkAbstractElectronicData* vtkMolecule::GetElectronicData | ( | ) | [virtual] |
Set/Get the AbstractElectronicData-subclassed object for this molecule.
virtual void vtkMolecule::SetElectronicData | ( | vtkAbstractElectronicData * | ) | [virtual] |
Set/Get the AbstractElectronicData-subclassed object for this molecule.
virtual void vtkMolecule::ShallowCopy | ( | vtkDataObject * | obj | ) | [virtual] |
Shallow copies the data object into this molecule.
Reimplemented from vtkGraph.
virtual void vtkMolecule::DeepCopy | ( | vtkDataObject * | obj | ) | [virtual] |
Deep copies the data object into this molecule.
Reimplemented from vtkGraph.
virtual void vtkMolecule::ShallowCopyStructure | ( | vtkMolecule * | m | ) | [virtual] |
Shallow copies the atoms and bonds from m into this.
virtual void vtkMolecule::DeepCopyStructure | ( | vtkMolecule * | m | ) | [virtual] |
Deep copies the atoms and bonds from m into this.
virtual void vtkMolecule::ShallowCopyAttributes | ( | vtkMolecule * | m | ) | [virtual] |
Shallow copies attributes (i.e. everything besides atoms and bonds) from m into this.
virtual void vtkMolecule::DeepCopyAttributes | ( | vtkMolecule * | m | ) | [virtual] |
Deep copies attributes (i.e. everything besides atoms and bonds) from m into this.
static bool vtkMolecule::GetPlaneFromBond | ( | const vtkBond & | bond, |
const vtkVector3f & | normal, | ||
vtkPlane * | plane | ||
) | [static] |
Obtain the plane that passes through the indicated bond with the given normal. If the plane is set successfully, the function returns true. If the normal is not orthogonal to the bond, a new normal will be constructed in such a way that the plane will be orthogonal to the plane spanned by the bond vector and the input normal vector. This ensures that the plane passes through the bond, and the normal is more of a "hint" indicating the orientation of the plane. The new normal (n) is defined as the input normal vector (n_i) minus the projection of itself (proj[n_i]_v) onto the bond vector (v):
v ^ | n = (n_i - proj[n_j]_v) proj[n_i]_v ^ |----x | | / | | / n_i | | / | |/
If n_i is parallel to v, a warning will be printed and no plane will be added. Obviously, n_i must not be parallel to v.
static bool vtkMolecule::GetPlaneFromBond | ( | const vtkAtom & | atom1, |
const vtkAtom & | atom2, | ||
const vtkVector3f & | normal, | ||
vtkPlane * | plane | ||
) | [static] |
Obtain the plane that passes through the indicated bond with the given normal. If the plane is set successfully, the function returns true. If the normal is not orthogonal to the bond, a new normal will be constructed in such a way that the plane will be orthogonal to the plane spanned by the bond vector and the input normal vector. This ensures that the plane passes through the bond, and the normal is more of a "hint" indicating the orientation of the plane. The new normal (n) is defined as the input normal vector (n_i) minus the projection of itself (proj[n_i]_v) onto the bond vector (v):
v ^ | n = (n_i - proj[n_j]_v) proj[n_i]_v ^ |----x | | / | | / n_i | | / | |/
If n_i is parallel to v, a warning will be printed and no plane will be added. Obviously, n_i must not be parallel to v.
virtual void vtkMolecule::CopyStructureInternal | ( | vtkMolecule * | m, |
bool | deep | ||
) | [protected, virtual] |
Copy bonds and atoms.
virtual void vtkMolecule::CopyAttributesInternal | ( | vtkMolecule * | m, |
bool | deep | ||
) | [protected, virtual] |
Copy everything but bonds and atoms.
void vtkMolecule::SetBondListDirty | ( | ) | [inline, protected] |
The graph superclass does not provide fast random access to the edge (bond) data. All random access is performed using a lookup table that must be rebuilt periodically. These allow for lazy building of the lookup table
Definition at line 255 of file vtkMolecule.h.
void vtkMolecule::UpdateBondList | ( | ) | [protected] |
The graph superclass does not provide fast random access to the edge (bond) data. All random access is performed using a lookup table that must be rebuilt periodically. These allow for lazy building of the lookup table
friend class vtkAtom [friend] |
Definition at line 259 of file vtkMolecule.h.
friend class vtkBond [friend] |
Definition at line 260 of file vtkMolecule.h.
bool vtkMolecule::BondListIsDirty [protected] |
The graph superclass does not provide fast random access to the edge (bond) data. All random access is performed using a lookup table that must be rebuilt periodically. These allow for lazy building of the lookup table
Definition at line 254 of file vtkMolecule.h.
vtkAbstractElectronicData* vtkMolecule::ElectronicData [protected] |
Definition at line 262 of file vtkMolecule.h.