13.3 Clearing Aromaticity

The aromatic property of all atoms and bonds in a molecule, can conveniently be reset by calling the OEChem function OEClearAromaticFlags. This is useful, for example, for writing the Kekulé form of a SMILES string, by calling OEClearAromaticFlags before calling OECreateAbsSmiString.

The OEClearAromaticFlags function is equivalent to the following code.

void MyClearAromaticFlags(OEMolBase &mol)
{
  OEIter<OEAtomBase> atom;
  for (atom = mol.GetAtoms();atom;++atom)
    atom->SetAromatic(false);

  OEIter<OEBondBase> bond;
  for (bond = mol.GetBonds();bond;++bond)
    bond->SetAromatic(false);
}