template<class C,unsigned int dim> class OEConfBaseT : public OEMolBase
OEConfBaseT is the generic conformer base class in OEChem. It is an
abstract base class which defined the interface for conformer
implementations. OEConfBaseT has two template arguments. The first,
class C, is the coordinate representation type. The second,
unsigned int dim, is the dimensionality of the representation.
typedef C coord_type;
This typedef allows generic declaration of the coord_type for a given
conformer type via OEConfBase::coord_type.
virtual bool Copy(const OEConfBaseT<C,dim> &) = 0
Copy is a pure virtual protected helper function which allows operator= to act like it is virtual even though virtual operators are not possible.
OEConfBaseT() OEConfBaseT(const OEConfBaseT<C,dim> &rhs) OEConfBaseT(const OESystem::OEBase &rhs) OEConfBaseT(const OEConfBaseT<C,dim> &rhc, const C *rht)
OEConfBaseT has four constructors including the default constructor. All of the constructors are empty functions which simply pass the appropriate initialization parameter up the inheritance tree to the OEMolBase constructor.
OEConfBaseT& operator= (const OEConfBaseT<C,dim> &rhs)
Appropriate assignment of conformers via this abstract base class is possible using the virtual Copy function.
virtual void AddAtom(OEAtomBase *atom) = 0 virtual void AddAtom(const OEAtomBase *rhs, OEAtomBase *atom) = 0
AddAtom is a helper function which the MCMolBase can call as an
adjunct to NewAtom on the molecule which contains the conformers. This
should not be called by a primary user.
virtual void AddBond(OEBondBase *bond) = 0
AddBond is a helper function which the MCMolBase can call as an
adjunct to NewBond on the molecule which contains the conformers. This
should not be called by a primary user.
virtual bool RemoveAtom(OEAtomBase *atom) = 0
RemoveAtom is a helper function which the MCMolBase can call as an
adjunct to DeleteAtom on the molecule which contains the conformers. This
should not be called by a primary user.
virtual bool RemoveBond(OEBondBase *bond) = 0
RemoveBond is a helper function which the MCMolBase can call as an
adjunct to DeleteBond on the molecule which contains the conformers. This
should not be called by a primary user.
virtual void SetMCMol(OEMCMolBaseT<C,dim> &) = 0 virtual OEMCMolBaseT<C,dim> &GetMCMol() const = 0
These functions set and get the associated MCMol which are serving as the container for the OEConfBaseT.
virtual void SetIdx(unsigned int) = 0 virtual unsigned int GetIdx() const = 0
These functions allow access to the unique conformer index. It is not
recommended that a user call the OEConfBaseT::SetIdx() function.
This value is assigned by OEChem
when a conformer is created. The conformer index is unique for the
conformers of a
given molecule, and is stable (not reused) for the lifetime of that
OEMCMolBase. These values may not be assigned sequentially, and may
contain gaps. Conformer indices are guaranteed to be less than
OEMCMolBase::GetMaxConfIdx. Conformer indices are typically only used for
efficiently storing data in arrays (or vectors) externally to the
OEMCMolBase. They arrays can be conveniently indexed via
OEConfBaseT::GetIdx(). For iterating across the conformers of a molecule,
use OEMCMolBase::GetConfs() and for keeping track of a particular conformer
use an OEConfBase*.
virtual bool SetCoords(const float*) = 0 virtual bool SetCoords(const double*) = 0
Sets the coordinates of a conformer. The coords parameter is expected to
be an array of size OEConfBase::GetMaxAtomIdx()*dim. This array should
contain N=dim coordinates for each atom, and they should be located in the
array passed in at coords[atom->GetIdx()*dim+i], where i ranges from
0 to dim. An internal copy of the coordinates is stored in the OEConfBaseT
which is independent of the array passed.
virtual bool SetCoords(const OEAtomBase* atom, const float *coords) = 0 virtual bool SetCoords(const OEAtomBase* atom, const double *coords) = 0
Sets to coordinates of a single atom in the OEConfBaseT. The array passed in should be of length dim and should contain the new coordinates of the atom. An internal copy of the coordinates is stored in the OEConfBaseT which is independent of the coords array.
virtual bool GetCoords(float *coords) const = 0 virtual bool GetCoords(double *coords) const = 0
Fills the array passed into the function with a copy of the coordinates of
the conformer. The array passed in should be at least of length
OEConfBaseT::GetMaxAtomIdx()*dim. The coordinates of each atom
in the conformer will begin at coords[atom->GetIdx()*dim] in the
array.
Changes made to the array after this function call will have no effect on
the conformer.
virtual bool GetCoords(const OEAtomBase *atom, float *coords) const = 0 virtual bool GetCoords(const OEAtomBase *atom, double *coords) const = 0
Fills the coords array with the coordinates of the OEAtomBase atom. The
coords array should be at least of length dim. Changes made to the
coord array after this function call will have no effect on the conformer.
virtual void Delete() = 0 virtual bool IsDeleted() const = 0
The Delete function is equivalent to call OEMCMolBaseT::DeleteConf from the parent molecule. It removes the current conformer from the OEMCMolBaseT containing it. These functions do not invalidate current OEIters, and all calls to OEMCMolBaseT::GetConfs called after the call to Delete will not contain the deleted conformer.
IsDeleted is a helper function which assists other classes in maintaining functionality after an OEConfBaseT has been deleted.
These functions remain beta.
virtual double GetTorsion(OETorsion &) const = 0
virtual double GetTorsion(const OEAtomBase *a, const OEAtomBase *b,
const OEAtomBase *c, const OEAtomBase *d) const = 0
virtual void SetTorsion(OETorsion &) = 0
virtual void SetTorsion(OEAtomBase *a, OEAtomBase *b,
OEAtomBase *c, OEAtomBase *d, double radians) = 0
These functions can be used to check or set the torsion values on a torsion in the conformer. The torsion can be defined by either in OETorsion object, or by four OEAtomBase* objects.
GetTransform is a beta function
virtual const OETrans &GetTransform() const = 0
Returns an OETrans, which is a container of all the transformations which have been applied to the OEConfBaseT. This function is particularly useful when the internal representation of coordinates may not be Cartesian.
virtual void Transform(const OETransBase *) = 0 virtual void Transform(const OETrans &) = 0
Applies the geometric transformation specified in the OETransBase* object or the series of geometric transformations specified in the OETran container to the OEConfBaseT. These functions permanently change the coordinates of the OEConfBaseT.
virtual bool HasTitle() const = 0 virtual const char *GetTitle() const = 0
OEConfBaseT objects can have their own title. However, if they do not, they will report the title of their parent OEMCMolBase when the OEConfBaseT::GetTitle() function is called.
OEConfBaseT derives publicly from OEMolBase. It supports
the full API of an OEMolBase, and any function which takes an
OEMolBase as an argument (e.g. OECreateSmiString),
can be passed an OEConfBaseT. See the section on OEMolBases
for details on this API.
OEConfBaseT derives publicly from OEBase via OEMolBase.
The OEConfBaseT objects fully support the OEBase API,
including all generic data functions (e.g. OEBase::GetData<>
and OEBase::SetData<>).