#include <openbabel/obiter.h>
Public Member Functions | |
OBMolAngleIter () | |
OBMolAngleIter (OBMol *mol) | |
OBMolAngleIter (OBMol &mol) | |
OBMolAngleIter (const OBMolAngleIter &ai) | |
~OBMolAngleIter () | |
OBMolAngleIter & | operator= (const OBMolAngleIter &ai) |
operator bool () const | |
OBMolAngleIter & | 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_ANGLES_OF_MOL(a,m) for( OBMolAngleIter a(m); a; a++ )
Here is an example:
#include <openbabel/obiter.h> #include <openbabel/mol.h> OBMol mol; OBAtom *a, *b, *c; double ang; FOR_ANGLES_OF_MOL(angle, mol) { // The variable a behaves like OBAngle* when used with -> and * but // but needs to be explicitly converted when appearing as a parameter // in a function call - use &*a b = _mol.GetAtom((*angle)[0] + 1); a = _mol.GetAtom((*angle)[1] + 1); c = _mol.GetAtom((*angle)[2] + 1); ang = a->GetAngle(b->GetIdx(), c->GetIdx()); }
OBMolAngleIter | ( | ) | [inline] |
OBMolAngleIter | ( | OBMol * | mol | ) |
OBMolAngleIter | ( | OBMol & | mol | ) |
OBMolAngleIter | ( | const OBMolAngleIter & | ai | ) |
~OBMolAngleIter | ( | ) | [inline] |
OBMolAngleIter & operator= | ( | const OBMolAngleIter & | ai | ) |
operator bool | ( | ) | const [inline] |
OBMolAngleIter & operator++ | ( | ) |
Preincrement -- advance to the next angle and return.
std::vector<unsigned int> operator * | ( | ) | const [inline] |