/// <summary> /// Returns all the AtomContainer's of a ChemModel. /// </summary> public static IEnumerable <IAtomContainer> GetAllAtomContainers(IChemModel chemModel) { var moleculeSet = chemModel.Builder.NewAtomContainerSet(); if (chemModel.MoleculeSet != null) { moleculeSet.AddRange(chemModel.MoleculeSet); } if (chemModel.ReactionSet != null) { moleculeSet.AddRange(ReactionSetManipulator.GetAllMolecules(chemModel.ReactionSet)); } return(MoleculeSetManipulator.GetAllAtomContainers(moleculeSet)); }
public void TestGetAllAtomContainers_IAtomContainerSet() { var list = MoleculeSetManipulator.GetAllAtomContainers(som); Assert.AreEqual(2, list.Count()); }
/// <summary> /// Returns all the AtomContainer's of a Reaction. /// </summary> /// <param name="set">the reaction set to get the molecules from</param> /// <returns>a List containing the IAtomContainer objects in the IReactionSet</returns> public static IEnumerable <IAtomContainer> GetAllAtomContainers(IReactionSet set) { return(MoleculeSetManipulator.GetAllAtomContainers(GetAllMolecules(set))); }