OBRing Class Reference

Stores information on rings in a molecule from SSSR perception. More...

#include <ring.h>

List of all members.

Public Member Functions

bool findCenterAndNormal (vector3 &center, vector3 &norm1, vector3 &norm2)
 OBRing ()
 OBRing (std::vector< int > &, int)
 OBRing (const OBRing &src)
 OBRing copy constructor.
OBRingoperator= (const OBRing &src)
 OBRing assignment operator.
int Size () const
int PathSize () const
bool IsMember (OBAtom *a)
bool IsMember (OBBond *b)
bool IsAromatic ()
bool IsInRing (int i)
void SetParent (OBMol *m)
OBMolGetParent ()

Public Attributes

std::vector< int > _path
OBBitVec _pathset


Detailed Description

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:

OBMol mol;

vector<OBRing*> vr;
vr = mol.GetSSSR();
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:
vector<OBRing*>::iterator i;
vector<int>::iterator j;
vector<OBRing*> *rlist = (vector<OBRing*>*)mol.GetData("RingList");
for (i = rlist->begin();i != rlist->end();i++)
{
for(j = (*i)->_path.begin();j != (*i)->_path.end();j++)
    cout << *j << ` `;
cout << endl;
}
will produce something like the following output for benzene:
1 2 3 4 5 6
Ring information is automatically deleted from an OBMol when it goes out of scope or the Clear() member function is called.

Implements blue-obelisk:findSmallestSetOfSmallestRings.


Constructor & Destructor Documentation

OBRing (  )  [inline]

OBRing ( std::vector< int > &  ,
int   
)

OBRing ( const OBRing src  ) 

OBRing copy constructor.

Parameters:
src reference to original OBRing object (rhs)


Member Function Documentation

bool findCenterAndNormal ( vector3 center,
vector3 norm1,
vector3 norm2 
)

OBRing & operator= ( const OBRing src  ) 

OBRing assignment operator.

Parameters:
src reference to original OBRing object (rhs)
Returns:
reference to modified OBRing object (lhs)

int Size (  )  const [inline]

int PathSize (  )  const [inline]

bool IsMember ( OBAtom a  ) 

bool IsMember ( OBBond b  ) 

bool IsAromatic (  ) 

bool IsInRing ( int  i  )  [inline]

void SetParent ( OBMol m  )  [inline]

OBMol* GetParent (  )  [inline]


Member Data Documentation

std::vector<int> _path

OBBitVec _pathset


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