AvogadroLibs 2.1.0-20261111
Loading...
Searching...
No Matches
BondTemplate< Molecule_T > Class Template Reference

Public Types

using MoleculeType = Molecule_T
using AtomType = typename Molecule_T::AtomType

Public Member Functions

 BondTemplate ()=default
 BondTemplate (MoleculeType *m, Index i)
bool operator== (const BondTemplate< MoleculeType > &other) const
bool operator!= (const BondTemplate< MoleculeType > &other) const
BondTemplate< MoleculeType > & operator++ ()
BondTemplate< MoleculeType > operator++ (int)
BondTemplate< MoleculeType > & operator-- ()
BondTemplate< MoleculeType > operator-- (int)
bool isValid () const
MoleculeType * molecule () const
Index index () const
AtomType getOtherAtom (Index index) const
AtomType getOtherAtom (AtomType atom) const
Real length () const
std::string label () const
AtomType atom1 () const
AtomType atom2 () const
void setOrder (unsigned char o)
unsigned char order () const
void setProperty (const std::string &name, double value)
void setProperty (const std::string &name, int value)
void setProperty (const std::string &name, const std::string &value)
void setProperty (const std::string &name, const MatrixX &value)
template<typename T>
std::optional< T > property (const std::string &name) const

Constructor & Destructor Documentation

◆ BondTemplate() [1/2]

template<class Molecule_T>
BondTemplate ( )
default

Creates a new, invalid bond object.

◆ BondTemplate() [2/2]

template<class Molecule_T>
BondTemplate ( MoleculeType * m,
Index i )

Creates a bond object representing a bond at index i in molecule m.

Member Function Documentation

◆ operator==()

template<class Molecule_T>
bool operator== ( const BondTemplate< MoleculeType > & other) const
Returns
True if this and other share the same index and molecule.

◆ operator!=()

template<class Molecule_T>
bool operator!= ( const BondTemplate< MoleculeType > & other) const
Returns
True if this and other do not share the same index or molecule.

◆ operator++() [1/2]

template<class Molecule_T>
BondTemplate< Molecule_T > & operator++ ( )

Prefix increment operator. Increment this Bond's index by 1 and return a self-reference. Check isValid() before calling any other methods.

◆ operator++() [2/2]

template<class Molecule_T>
BondTemplate< Molecule_T > operator++ ( int )

Postfix increment operator. Increment this Bond's index by 1 and return a copy of the current Atom. Check isValid() before calling any other methods.

◆ operator--() [1/2]

template<class Molecule_T>
BondTemplate< Molecule_T > & operator-- ( )

Prefix decrement operator. Decrement this Bond's index by 1 and return a self-reference. Check isValid() before calling any other methods.

◆ operator--() [2/2]

template<class Molecule_T>
BondTemplate< Molecule_T > operator-- ( int )

Postfix decrement operator. Decrement this Bond's index by 1 and return a copy of the current Atom. Check isValid() before calling any other methods.

◆ isValid()

template<class Molecule_T>
bool isValid ( ) const
Returns
True if the molecule is set and the index is less than the number of bonds.

◆ molecule()

template<class Molecule_T>
BondTemplate< Molecule_T >::MoleculeType * molecule ( ) const
Returns
The molecule that contains this Bond.

◆ index()

template<class Molecule_T>
Index index ( ) const
Returns
The index of this bond in molecule().

◆ atom1()

template<class Molecule_T>
BondTemplate< Molecule_T >::AtomType atom1 ( ) const

An atom in the bond, such that atom1().index() < atom2.index().

◆ atom2()

template<class Molecule_T>
BondTemplate< Molecule_T >::AtomType atom2 ( ) const

An atom in the bond, such that atom1().index() < atom2.index().

◆ getOtherAtom() [1/2]

template<class Molecule_T>
BondTemplate< Molecule_T >::AtomType getOtherAtom ( Index index) const
Returns
The atom in the bond such that returned.index() != index.

◆ getOtherAtom() [2/2]

template<class Molecule_T>
AtomType getOtherAtom ( AtomType atom) const
Returns
The atom in the bond such that returned.index() != atom.index().

◆ setOrder()

template<class Molecule_T>
void setOrder ( unsigned char o)

The bond's order (single = 1, double = 2, etc.)

◆ order()

template<class Molecule_T>
unsigned char order ( ) const

The bond's order (single = 1, double = 2, etc.)

◆ length()

template<class Molecule_T>
Real length ( ) const

The length of the bond or 0.0 if the bond is invalid.

◆ label()

template<class Molecule_T>
std::string label ( ) const

A label for the bond (if any)

◆ setProperty() [1/4]

template<class Molecule_T>
void setProperty ( const std::string & name,
double value )

Custom property access. Setters are overloaded by value type. The template getter returns std::nullopt if the property is missing or if the requested type does not match the stored type. int and double values convert to string automatically.

◆ setProperty() [2/4]

template<class Molecule_T>
void setProperty ( const std::string & name,
int value )

Custom property access. Setters are overloaded by value type. The template getter returns std::nullopt if the property is missing or if the requested type does not match the stored type. int and double values convert to string automatically.

◆ setProperty() [3/4]

template<class Molecule_T>
void setProperty ( const std::string & name,
const std::string & value )

Custom property access. Setters are overloaded by value type. The template getter returns std::nullopt if the property is missing or if the requested type does not match the stored type. int and double values convert to string automatically.

◆ setProperty() [4/4]

template<class Molecule_T>
void setProperty ( const std::string & name,
const MatrixX & value )

Custom property access. Setters are overloaded by value type. The template getter returns std::nullopt if the property is missing or if the requested type does not match the stored type. int and double values convert to string automatically.

◆ property()

template<class Molecule_T>
template<typename T>
std::optional< T > property ( const std::string & name) const

Custom property access. Setters are overloaded by value type. The template getter returns std::nullopt if the property is missing or if the requested type does not match the stored type. int and double values convert to string automatically.


The documentation for this class was generated from the following file: