AvogadroLibs  1.96.0
Public Types | Public Member Functions | List of all members
PersistentAtom< Molecule_T > Class Template Reference

The PersistentAtom object provides a container for a persistent atom reference that can be held onto. The atom() method gets the underlying atom using the unique ID mechanism of the molecule.

#include <avogadro/qtcore/persistentatom.h>

Public Types

typedef Molecule_T MoleculeType
 
typedef Molecule_T::AtomType AtomType
 

Public Member Functions

 PersistentAtom (MoleculeType *m=nullptr, Index uniqueId=MaxIndex)
 Create a persistent atom, with the specified unique id. More...
 
 PersistentAtom (const AtomType &a)
 Create a persistent atom from a standard atom object. More...
 
void set (MoleculeType *m, Index uniqueId)
 Set the molecule and unique ID for the persistent object. More...
 
void set (const AtomType &a)
 Set the persistent atom from a standard atom object. More...
 
void reset ()
 Reset the object to an invalid state.
 
bool isValid () const
 
MoleculeType * molecule () const
 
Index uniqueIdentifier () const
 The persistent unique ID of the atom. More...
 
AtomType atom () const
 Obtain the atom being held by the persistent object. More...
 

Constructor & Destructor Documentation

◆ PersistentAtom() [1/2]

PersistentAtom ( MoleculeType *  m = nullptr,
Index  uniqueId = MaxIndex 
)
explicit
Parameters
mThe molecule the persistent atom belongs to.
uniqueIdThe unique identifier for the atom.

◆ PersistentAtom() [2/2]

PersistentAtom ( const AtomType &  a)
explicit
Parameters
aThe atom that a persistent reference should be created for.

Member Function Documentation

◆ set() [1/2]

void set ( MoleculeType *  m,
Index  uniqueId 
)
Parameters
mThe molecule that contains the atom.
uniqueIdThe unique ID of the atom.

◆ set() [2/2]

void set ( const AtomType &  a)
Parameters
aThe atom that a persistent reference should be created for.

◆ isValid()

bool isValid
Returns
True if the persistent atom is valid.

◆ molecule()

MoleculeType* molecule ( ) const
Returns
The molecule the atom is a part of.

◆ uniqueIdentifier()

Index uniqueIdentifier ( ) const
Returns
The unique ID of the atom.

◆ atom()

Molecule_T::AtomType atom
Returns
A reference to the atom held by the object.

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