Open Babel
3.0
|
#include <openbabel/ring.h>
Public Member Functions | |
size_t | Size () const |
size_t | PathSize () const |
bool | IsAromatic () |
void | SetType (char *type) |
void | SetType (std::string &type) |
char * | GetType () |
unsigned int | GetRootAtom () |
bool | IsMember (OBAtom *a) |
bool | IsMember (OBBond *b) |
bool | IsInRing (int i) |
void | SetParent (OBMol *m) |
OBMol * | GetParent () |
bool | findCenterAndNormal (vector3 ¢er, vector3 &norm1, vector3 &norm2) |
Constructors | |
OBRing () | |
OBRing (std::vector< int > &path, int size) | |
OBRing (std::vector< int > &path, OBBitVec set) | |
OBRing (const OBRing &src) | |
OBRing & | operator= (const OBRing &src) |
Public Attributes | |
int | ring_id |
std::vector< int > | _path |
OBBitVec | _pathset |
Stores information on rings in a molecule from SSSR perception.
Ring information beyond atom and bond membership is usually not necessary, but more information can be had about the rings in a molecule. The OBRing class is used to store the information from a Smallest Set of Smallest Rings (SSSR) perception of a molecule. The OBMol member function OBMol::GetSSSR() stores the information it perceives in a vector<OBRing*> inside the molecule. Perception is only done once for a molecule unless the connection table is modified. The following code demonstrates how to extract the SSSR information:
OBRings store the atom numbers of the atoms in each of the smallest set of smallest rings in both a vector<int> and an OBBitVec. An example of how to print out the atom numbers present in all SSSR rings is show below:
will produce something like the following output for benzene:
Ring information is automatically deleted from an OBMol when it goes out of scope or the OBMol::Clear() member function is called.
Implements blue-obelisk:findSmallestSetOfSmallestRings.
|
inline |
OBRing | ( | std::vector< int > & | path, |
int | size | ||
) |
Initialize a ring from a set of atom indexes path
and with size
.
|
inline |
Referenced by OpenBabel::CompareRingSize(), OBBond::FindSmallestRing(), and OBBond::IsRotor().
|
inline |
bool IsAromatic | ( | ) |
Referenced by OBDepict::DrawMolecule().
void SetType | ( | char * | type | ) |
Set the ring type (see OBRingTyper for more)
void SetType | ( | std::string & | type | ) |
Set the ring type (see OBRingTyper for more)
char * GetType | ( | ) |
unsigned int GetRootAtom | ( | ) |
bool IsMember | ( | OBAtom * | a | ) |
a
is a member of this ring bool IsMember | ( | OBBond * | b | ) |
|
inline |
i
as an atom index is in this ring Referenced by OBAromaticTyper::AssignAromaticFlags().
|
inline |
Set the parent of this ring to m
.
Referenced by OBMol::FindLSSR(), and OBMol::FindSSSR().
|
inline |
Set the supplied vectors to the center
of this ring, along with the normal
(in both directions).
center | The center of the ring |
norm1 | The normal of the best-fit plane for this ring |
norm2 | -1 * norm1 (i.e., the opposite direction of norm1) |
int ring_id |
a unique id to ensure a stable sort in SSSR determination
Referenced by OpenBabel::CompareRingSize().
std::vector<int> _path |
the path of this ring (i.e., the atom indexes)
Referenced by OBDepict::AddAtomLabels(), OBAromaticTyper::AssignAromaticFlags(), OBDepict::DrawMolecule(), OBRing::findCenterAndNormal(), OBRing::OBRing(), OBRing::operator=(), and OpenBabel::visitRing().
OBBitVec _pathset |
the path of this ring as a redundant bit vector
Referenced by OpenBabel::ComparePairSecond(), OBRing::OBRing(), OBRing::operator=(), and OpenBabel::visitRing().