vtkMolecule

Struct vtkMolecule 

Source
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

Source

pub fn new() -> Self

Creates a new vtkMolecule wrapped inside vtkNew

Trait Implementations§

Source§

impl Default for vtkMolecule

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for vtkMolecule

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.