/// <summary> /// Iterates over the rings in the ring set, and marks the ring /// aromatic if all atoms and all bonds are aromatic. /// </summary> /// <remarks> /// This method assumes that aromaticity perception has been done before hand. /// </remarks> /// <param name="ringset">The collection of rings</param> public static void MarkAromaticRings(IRingSet ringset) { foreach (var atomContainer in ringset) { RingManipulator.MarkAromaticRings((IRing)atomContainer); } }
public void TestMarkAromaticRings() { IRing ring = new Ring(3, "C"); Assert.IsNotNull(ring); RingManipulator.MarkAromaticRings(ring); Assert.IsFalse(ring.IsAromatic); foreach (var atom in ring.Atoms) { atom.IsAromatic = true; } RingManipulator.MarkAromaticRings(ring); Assert.IsFalse(ring.IsAromatic); foreach (var bond in ring.Bonds) { bond.IsAromatic = true; } RingManipulator.MarkAromaticRings(ring); Assert.IsTrue(ring.IsAromatic); }