Class Avogadro::Core::AtomTyper#

template<typename OutputType>
class Avogadro::Core::AtomTyper#

The AtomTyper class provides a base interface for generating a list of type identifiers describing the atoms in a molecule.

Public Types

typedef OutputType ValueType#

Public Functions

explicit AtomTyper(const Molecule *mol = nullptr)#
virtual ~AtomTyper()#
void setMolecule(const Molecule *mol)#
Parameters

mol – The molecule with atoms to type.

virtual void run()#

Iterate through the molecule and generate type descriptions for each atom. The results can be obtained by calling types().

virtual OutputType atomType(const Atom &atom)#

Perform a type lookup on the specified atom. If run() has been called previously, a cached result is returned.

Returns

The type of atom.

Array<OutputType> types() const#
Returns

An Array of OutputType objects. There will be one object for each atom of the input Molecule, and they are ordered by the corresponding atom’s index.

virtual void reset()#

Reset the typer’s internal state. This is called when the molecule is changed. The base implementation clears the m_types Array.

Protected Functions

virtual void initialize()#

Perform any setup needed that needs to be done prior to calling type(). The base implementation of this function reserves enough room in the m_types Array for the current Molecule.

virtual OutputType type(const Atom &atom) = 0#

Determines the type of the atom.

Parameters

atom – The atom to type.

Returns

The type of atom.

Protected Attributes

const Molecule *m_molecule#

The molecule on which to operate.

Array<OutputType> m_types#

The array of types to be populated.