#include "oechem.h" #include #include using namespace OESystem; using namespace OEChem; using namespace std; int main() { OEMol mol; OEParseSmiles(mol, "C/C=C/C"); OEIter bond; for (bond = mol.GetBonds();bond;++bond) { if (bond->HasStereoSpecified(OEBondStereo::CisTrans)) { OEIter atom1,atom2; for (atom1 = bond->GetBgn()->GetAtoms();atom1;++atom1) if (atom1 != bond->GetEnd()) { for (atom2 = bond->GetEnd()->GetAtoms();atom2;++atom2) if (atom2 != bond->GetBgn()) { std::vector v; v.push_back(atom1); v.push_back(atom2); unsigned int stereovalue = bond->GetStereo(v,OEBondStereo::CisTrans); cerr << "Atoms: " << atom1->GetIdx() << " and "; cerr << atom2->GetIdx() << " are "; if (stereovalue == OEBondStereo::Cis) cerr << "cis" << endl; else if (stereovalue == OEBondStereo::Trans) cerr << "trans" << endl; else cerr << "neither cis nor trans" << endl; } } } } return 0; }