#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(int, char ** argv) { OEIter mol; OEIter conf; oemolistream ims(argv[1]); std::string maxconf; float tmpx = 0.0f, maxX = 0.0f; for (mol=ims.GetMCMolBases(); mol; ++mol) { for(conf = mol->GetConfs(); conf; ++conf) { tmpx = GetMaxX(*conf); if(tmpx > maxX) { if(!maxconf.empty()) { cerr << conf->GetTitle() << " has a larger value of x than " << maxconf << endl; } maxconf = conf->GetTitle(); maxX = tmpx; } } } return 0; }