#include "oechem.h"
#include <iostream>
using namespace OESystem;
using namespace OEChem;
using namespace std;
unsigned int MyGetExplicitDegree(OEAtomBase *atm)
{
OEIter<OEBondBase> bond;
unsigned int result = 0;
for (bond = atm->GetBonds(); bond; ++bond)
++result;
return result;
}
int main()
{
int degree;
OEMol mol;
OEParseSmiles(mol, "c1ccccc1");
OEIter<OEAtomBase> atom;
for (atom=mol.GetAtoms();atom;++atom)
{
degree = MyGetExplicitDegree(atom);
cout << "Atom " << atom->GetIdx() << " has degree " << degree << endl;
}
return 0;
}