pub struct vtkMolecule(/* private fields */);Expand description
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 convenience vtkAtom and vtkBond classes:
Single call: \code 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); \endcode
Incremental: \code 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); \endcode
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 demonstrates 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.
\warning While direct use of the underlying vtkUndirectedGraph structure is possible due to vtkMolecule’s public inheritance, this should not be relied upon and may change in the future.
@sa vtkAtom vtkBond vtkMoleculeMapper vtkPeriodicTable
Implementations§
Source§impl vtkMolecule
impl vtkMolecule
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new vtkMolecule wrapped inside vtkNew