OEMCMolBase¶
class OEMCMolBase : public OEMolBase
The OEMCMolBase class provides the basic
multi-conformer molecule in OEChem. It is an abstract base class
which defines the interface for multi-conformer molecule
implementations. Coordinates can be stored in
OEHalfFloat (16-bit), float
(32-bit),
double
(64-bit), or long double
(>= 64-bit). The precision
is determined by the constructor argument given to
OEMol, taken from the
OEMCMolType
namespace. OEMCMolBase have an interface which
allow access to conformers in a modal
(OEMCMolBase::GetActive
) or a non-modal manner
(OEMCMolBase::GetConfs
).
The following methods are publicly inherited from OEMolBase:
The following methods are publicly inherited from OEBase:
operator=¶
OEMCMolBase &operator=(const OEMolBase &rhs)
OEMCMolBase &operator=(const OEConfBase &rhs)
OEMCMolBase &operator=(const OEMCMolBase &rhs)
Assignment operator of multi-conformer molecules via this abstract base class.
ClearBase¶
void ClearBase()=0
Clear the generic data from the OEBase base
class of this object. Equivalent to just calling
OEBase::Clear
without actually clearing away
molecule data like atoms, bonds, and conformers.
ClearMCMol¶
void ClearMCMol()=0
Clears molecule data like atoms, bonds, and conformers without clearing away the OEBase generic data.
DeleteConf¶
bool DeleteConf(OEConfBase *)=0
Deletes the conformer which is passed in from the OEMCMolBase object.
DeleteConfs¶
void DeleteConfs()=0
Warning
OEMCMolBase::DeleteConfs
leaves the
OEMCMolBase object in an unstable state.
It should be used with care and followed shortly with a call
to OEMCMolBase::NewConf
.
Deletes all of the conformers from the OEMCMolBase object. This is a very useful function for creating a new transformed OEMCMolBase from an untransformed molecule.
See also
Listing 3
code example in the
Conformer Creation section
GetActive¶
OEConfBase *GetActive() const =0
Returns the currently active conformer of the OEMCMolBase object.
Note
The OEMCMolBase::GetActive
and
OEMCMolBase::SetActive
methods are often
sufficient for accessing conformations in multi-conformer molecules.
See also
OEMCMolBase::PopActive
methodOEMCMolBase::PushActive
methodsOEMCMolBase::SetActive
method
GetConf¶
OEConfBase * GetConf(
const OESystem::OEUnaryPredicate<OEChem::OEConfBase > &) const =0
Returns the first conformer in the molecule for which the predicate passed
in returns true
.
GetConfs¶
OESystem::OEIterBase<OEConfBase > *GetConfs() const =0
OESystem::OEIterBase<OEConfBase > *GetConfs(
const OESystem::OEUnaryPredicate<OEChem::OEConfBase > &) const =0
Returns an iterator over the conformers in the multi-conformer molecule.
The return value of this function should always be assigned to an
OEIter object.
The function which takes no arguments returns an iterator over all of the
conformers. The function which takes a predicate returns an iterator which
only contains conformers for which the predicate returns true
.
GetMaxConfIdx¶
unsigned int GetMaxConfIdx() const =0
Returns the maximum conformer index of the OEMCMolBase
object.
Similar to OEMolBase::GetMaxAtomIdx
and
OEMolBase::GetMaxBondIdx
this method
is useful for creating temporary external data structures which can hold
information that can be referenced via the OEConfBase::GetIdx
method.
GetMCMolTitle¶
const char *GetMCMolTitle() const =0
Return the title for the parent molecule, don’t fall back to a
conformer title like OEConfBase::GetTitle
.
IsDeleted¶
bool IsDeleted(OEConfBase *) const =0
Returns whether the passed in conformer has already been deleted.
See also
OEMolBase::IsDeleted
methods inherited from the OEMolBase class
NewConf¶
OEConfBase *NewConf()=0
OEConfBase *NewConf(const OEPlatform::OEHalfFloat *)=0
OEConfBase *NewConf(const float *)=0
OEConfBase *NewConf(const double *)=0
OEConfBase *NewConf(const long double *)=0
OEConfBase *NewConf(const OEMolBase *)=0
OEConfBase *NewConf(const OEConfBase *)=0
OEConfBase *NewConf(const OEConfBase *, const OETrans &)=0
OEConfBase *NewConf(const OEConfBase *,
OETYPENAME std::vector<OETorsion> &t)=0
These methods generate a new conformer that is owned by the
current OEMCMolBase. Each of the methods will
return a pointer to the newly created conformer. The
OEMCMolBase::NewConf
methods act as virtual
constructors of the OEConfBase
objects. OEMCMolBase::NewConf
constructs a
conformer with its default constructor. NewConf(const
OEMolBase *)
and NewConf(const OEConfBase *)
copy
construct a new conformer with the coordinates from the object
passed into the function. The objects passed in must have the
same graph as the current OEMCMolBase.
NewConf
that takes a OEHalfFloat,
float
, double
, or long double
pointer constructs a
new conformer with the coordinates passed in as coords. The
array must be of length
GetMaxAtomIdx()
*
3
, and the coordinates for each atom in the new conformer
should be the dimension values in the array starting at
coords[atom->GetIdx() * 3]
.
Passing a NULL
to any of these methods will effectively do
nothing and just return a NULL
OEConfBase
pointer.
Warning
The dimension of the conformer will be set to 0
for the
NewConf default constructor. The NewConf methods that create
conformers from coordinates will set the dimension of the
conformer to 3
. The NewConf methods that copy construct
will copy the dimension from the source.
NumConfs¶
unsigned int NumConfs() const =0
Returns the number of conformers contained in the OEMCMolBase object.
OrderConfs¶
bool OrderConfs(const OETYPENAME std::vector<OEConfBase *> &)=0
Reorders the conformers in the molecule to the order specified
in the vector argument. If the vector contains an incomplete
list, the remaining conformers will come at the end. This
function call changes the order in which the conformers are
returned by OEMCMolBase::GetConfs
, but does
not change the conformer indices.
PopActive¶
void PopActive()=0
The OEMCMolBase::PopActive
method along with the
OEMCMolBase::PushActive
method allow to maintain
a stack of active conformers.
The OEMCMolBase::PopActive
method removes the top active
conformer from the active stack and makes the next highest conformer
in the stack active.
See also
OEMCMolBase::GetActive
methodOEMCMolBase::SetActive
methodOEMCMolBase::PushActive
method
PushActive¶
bool PushActive(OEConfBase *)=0
The OEMCMolBase::PushActive
method along with the
OEMCMolBase::PopActive
method allow to maintain
a stack of active conformers.
The OEMCMolBase::PushActive
method makes the new conformer
the active one and pushes the previous active conformer down the stack.
See also
OEMCMolBase::GetActive
methodOEMCMolBase::SetActive
methodOEMCMolBase::PopActive
method
SetActive¶
bool SetActive(OEConfBase *)=0
Makes the conformer passed in become the active conformer. The conformer passed in must already be a member of the OEMCMolBase object.
Note
The OEMCMolBase::GetActive
and
OEMCMolBase::SetActive
methods are often
sufficient for accessing conformations in multi-conformer molecules.
See also
OEMCMolBase::GetActive
methodOEMCMolBase::PopActive
methodOEMCMolBase::PushActive
method
SweepConfs¶
bool SweepConfs()=0
Cleans up unused memory and objects which may be associated with
the conformers of the OEMCMolBase. Renumber
the conformer indices sequentially. This function invalidates
the conformer indices of all conformers in a molecule. Note that
this function doesn’t guarantee that all conformer indices are
sequential upon completion (some molecule implementations may
treat OEMolBase::Sweep
as a no-op).