public static int getAtomCount(IChemModel chemModel) { int count = 0; ICrystal crystal = chemModel.Crystal; if (crystal != null) { count += crystal.AtomCount; } ISetOfMolecules moleculeSet = chemModel.SetOfMolecules; if (moleculeSet != null) { count += SetOfMoleculesManipulator.getAtomCount(moleculeSet); } ISetOfReactions reactionSet = chemModel.SetOfReactions; if (reactionSet != null) { count += SetOfReactionsManipulator.getAtomCount(reactionSet); } return(count); }