예제 #1
0
        public void TestGetAllAtomContainers_IRingSet()
        {
            IRingSet rs = builder.NewRingSet();

            rs.Add(builder.NewRing());
            rs.Add(builder.NewRing());
            var list = RingSetManipulator.GetAllAtomContainers(rs);

            Assert.AreEqual(2, list.Count());
        }
예제 #2
0
        /// <summary>
        /// Puts all rings of a ringSet in a single atomContainer
        /// </summary>
        /// <param name="ringSet">The ringSet to use</param>
        /// <returns>The produced atomContainer</returns>
        public static IAtomContainer GetAllInOneContainer(IRingSet ringSet)
        {
            IAtomContainer resultContainer          = ringSet.Builder.NewAtomContainer();
            IEnumerator <IAtomContainer> containers = RingSetManipulator.GetAllAtomContainers(ringSet).GetEnumerator();

            while (containers.MoveNext())
            {
                resultContainer.Add(containers.Current);
            }
            return(resultContainer);
        }