#include <openbabel/obiter.h>
Public Member Functions | |
OBMolTorsionIter () | |
OBMolTorsionIter (OBMol *mol) | |
OBMolTorsionIter (OBMol &mol) | |
OBMolTorsionIter (const OBMolTorsionIter &ai) | |
~OBMolTorsionIter () | |
OBMolTorsionIter & | operator= (const OBMolTorsionIter &ai) |
operator bool () const | |
OBMolTorsionIter & | operator++ () |
std::vector< unsigned int > | operator * () const |
This has been made significantly easier by a series of macros in the obiter.h header file:
\#define FOR_TORSIONS_OF_MOL(t,m) for( OBMolTorsionIter t(m); t; t++ )
Here is an example:
#include <openbabel/obiter.h> #include <openbabel/mol.h> OBMol mol; OBAtom *a, *b, *c, *d; double tor; FOR_TORSIONS_OF_MOL(t, mol) { // The variable a behaves like OBTorsion* when used with -> and * but // but needs to be explicitly converted when appearing as a parameter // in a function call - use &*t a = _mol.GetAtom((*t)[0] + 1); // indices in vector start from 0!!! b = _mol.GetAtom((*t)[1] + 1); c = _mol.GetAtom((*t)[2] + 1); d = _mol.GetAtom((*t)[3] + 1); tor = mol.GetTorsion(a->GetIdx(), b->GetIdx(), c->GetIdx(), d->GetIdx()); }
OBMolTorsionIter | ( | ) | [inline] |
OBMolTorsionIter | ( | OBMol * | mol | ) |
OBMolTorsionIter | ( | OBMol & | mol | ) |
OBMolTorsionIter | ( | const OBMolTorsionIter & | ai | ) |
~OBMolTorsionIter | ( | ) | [inline] |
OBMolTorsionIter & operator= | ( | const OBMolTorsionIter & | ai | ) |
operator bool | ( | ) | const [inline] |
OBMolTorsionIter & operator++ | ( | ) |
Preincrement -- advance to the next torsion and return.
std::vector<unsigned int> operator * | ( | ) | const [inline] |