#include "oechem.h" #include using namespace OEChem; using namespace OESystem; using namespace std; float GetMaxX(const OEMolBase &mol) { OEIter atom; float xyz[3]; float maxX = 0.0f; bool first = true; for(atom = mol.GetAtoms();atom;++atom) { mol.GetCoords(atom,xyz); if(first) { maxX = xyz[0]; first = false; } else if(xyz[0] > maxX) maxX = xyz[0]; } return maxX; } int main() { OEIter mol; OEIter conf; oemolistream ims; for (mol=ims.GetMCMolBases(); mol; ++mol) { for(conf = mol->GetConfs(); conf; ++conf) { mol->SetActive(conf); cerr << "maxX = " << GetMaxX(*mol) << endl; } } return 0; }