Iterate over all angles in an OBMol.
More...
#include <openbabel/obiter.h>
List of all members.
Detailed Description
Iterate over all angles in an OBMol.
- Since:
- version 2.1
To facilitate iteration through all angles in a molecule, without resorting to atom indexes (which will change in the future), a variety of iterator methods are provided.
This has been made significantly easier by a series of macros in the obiter.h header file:
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)
{
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());
}
Constructor & Destructor Documentation
Member Function Documentation
operator bool |
( |
) |
const [inline] |
- Returns:
- Whether the iterator can still advance (i.e., visit more angles)
Preincrement -- advance to the next angle and return.
std::vector<unsigned int> operator* |
( |
) |
const [inline] |
- Returns:
- A vector of three atom indexes specifying the angle
- See also:
- OBAtom::GetIdx()
The documentation for this class was generated from the following files: