#include "oechem.h" #include using namespace OESystem; using namespace OEChem; using namespace std; void PrintAtoms(OEIter &atom,const char *title) { cerr << title << ":" << endl; for (atom.ToFirst();atom;++atom) { cerr << atom->GetIdx() << " "; } cerr << endl; } int main() { OEMol mol; OEParseSmiles(mol, "c1c(O)c(O)c(Cl)cc1CCCBr"); OEIter atom; atom = mol.GetAtoms(OEAtomIsInRing()); PrintAtoms(atom,"Ring Atoms"); atom = mol.GetAtoms(OEHasAtomicNum(8)); PrintAtoms(atom,"Oxygens"); atom = mol.GetAtoms(OEIsHalogen()); PrintAtoms(atom,"Halogens"); return 0; }