Open Babel
3.0
|
#include <openbabel/stereo/tetranonplanar.h>
Public Member Functions | |
OBTetraNonPlanarStereo (OBMol *mol) | |
virtual | ~OBTetraNonPlanarStereo () |
virtual OBGenericData * | Clone (OBBase *) const |
void | SetAttribute (const std::string &v) |
void | SetOrigin (const DataOrigin s) |
virtual const std::string & | GetAttribute () const |
unsigned int | GetDataType () const |
virtual const std::string & | GetValue () const |
virtual DataOrigin | GetOrigin () const |
Geniric (for all OBStereo::Type) stereochemistry | |
OBMol * | GetMolecule () const |
virtual OBStereo::Type | GetType () const =0 |
void | SetSpecified (bool specified) |
bool | IsSpecified () const |
Static Public Member Functions | |
template<typename ConfigType > | |
static ConfigType | ToConfig (const ConfigType &cfg, unsigned long from_or_towards, OBStereo::Winding winding=OBStereo::Clockwise, OBStereo::View view=OBStereo::ViewFrom) |
template<typename ConfigType > | |
static void | ChangeWinding (ConfigType &cfg) |
template<typename ConfigType > | |
static void | ChangeView (ConfigType &cfg) |
template<typename ConfigType > | |
static void | Invert (ConfigType &cfg) |
Protected Attributes | |
std::string | _attr |
unsigned int | _type |
DataOrigin | _source |
Base class for handling and storing non-planar stereochemistry with 4 reference atom ids.
The four reference ids can be treated like a sequence of 4 numbers. Each element can only occur once. This means there are 4! = 24 combinations.
These are the 24 possible combinations or permutations.
However, when dealing with tetrahedral stereochemistry, it is often easier to visualize by viewing from/towards one of the reference atoms to/from the center atom. This reduces the 24 possible combinations to 3! = 6.
These can be devided in 2 groups: clockwise or anti-clockwise
Since subclass ConfigType structs accept refs viewing from/towards any atom, it is needed to have some rules for converting.
A single permutation of two consecutive elements in a sequence of 3 changes the winding. All permutations can be expressed as a combination of consecutive permutations. The number of consecutive permutations can be calculated from the difference in inversions (NumInversions()).
If we exchange the from atom with another atom in the sequence, the oddness of the difference in inversions between the 2 sequences is calculated. If this is even, no extra permutation is needed. If this is odd, an extra permutation is needed.
Switching between viewing from and viewing towards reverses the winding.
Like all stereo classes, errors, warnings or info is reported using OBMessageHandler.
OBTetraNonPlanarStereo | ( | OBMol * | mol | ) |
Constructor
mol | The molecule. |
|
virtual |
Destructor.
|
inlinestatic |
Convert a ConfigType
struct from any View/Winding to the desired representation.
This is a template method which works on ConfigType structs from OBTetraNonPlanar subclasses. The subclasses can decide what data member are needed to store the stereogenic unit (i.e. 1 atom for tetrahedral, 3 for allene like, ...) and still use this generic method to handle the real stereochemistry.
A ConfigType struct should at least have the following data members:
cfg | A ConfigType struct from a OBTetraNonPlanar subclass. |
from_or_towards | The desired from/towards reference id (see view ) |
winding | The desired winding. |
view | The desired viewing direction. |
Referenced by OBTetrahedralConfig::operator==().
|
inlinestatic |
Change the winding of the ConfigType struct while maintaining the stereochemistry.
|
inlinestatic |
Change the view of the ConfigType struct while maintaining the stereochemistry.
|
inlinestatic |
Invert the stereochemistry of the ConfigType struct.
|
inlineinherited |
Get the molecule. This can be used by subclasses when more information is needed (e.g. OBCisTransStereo::GetCisRef, ...).
|
pure virtualinherited |
Reimplemented by subclasses to return the type defined in OBStereo::Type.
Implemented in OBCisTransStereo, OBTetrahedralStereo, and OBSquarePlanarStereo.
|
inlineinherited |
Set whether the stereochemistry is specified. Comparing a specified OBStereoBase derived class (or it's Config struct) with an unspecified one, always returns true.
|
inlineinherited |
|
inlinevirtualinherited |
Reimplemented in OBMatrixData, OBVectorData, OBRotationData, OBElectronicTransitionData, OBOrbitalData, OBDOSData, OBVibrationData, OBSerialNums, OBAngleData, OBTorsionData, OBSymmetryData, OBConformerData, OBUnitCell, OBCisTransStereo, OBRingData, OBVirtualBond, OBTetrahedralStereo, OBSquarePlanarStereo, OBSetData, OBNasaThermoData, OBPairTemplate< ValueT >, OBPairData, OBExternalBondData, AliasData, OBRotamerList, OBCommentData, and OBRateData.
Referenced by OBBase::CloneData(), OBAtom::Duplicate(), OBMoleculeFormat::MakeCombinedMolecule(), and OBMol::operator=().
|
inlineinherited |
Set the attribute (key), which can be used to retrieve this data.
Referenced by OBGastChrg::AssignPartialCharges(), OpenBabel::ComparePairSecond(), OBMol::DoTransformations(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBForceField::GetAtomTypes(), OBMol::GetFormula(), OBMol::GetLSSR(), OBForceField::GetPartialCharges(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().
|
inlineinherited |
Set the origin of this data, which can be used to filter the data.
Referenced by OBGastChrg::AssignPartialCharges(), OpenBabel::ComparePairSecond(), OBMol::DoTransformations(), OBMol::FindAngles(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBMol::FindTorsions(), OBMol::GetFormula(), OBMol::GetLSSR(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().
|
inlinevirtualinherited |
Referenced by OpenBabel::extract_thermochemistry(), and OBMoleculeFormat::MakeCombinedMolecule().
|
inlineinherited |
|
inlinevirtualinherited |
Base class returns a default value (the attribute type) but should never be called.
Reimplemented in OBPairData, and OBCommentData.
Referenced by OBDepict::AddAtomLabels(), OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().
|
inlinevirtualinherited |
|
protectedinherited |
attribute tag (e.g., "UnitCell", "Comment" or "Author")
Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().
|
protectedinherited |
attribute type – declared for each subclass
Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().
|
protectedinherited |
source of data for accounting
Referenced by OBConformerData::operator=(), OBSymmetryData::operator=(), OBTorsionData::operator=(), and OBAngleData::operator=().