public static int getAtomCount ( IChemModel chemModel ) { int count = 0 ; ICrystal crystal = chemModel . getCrystal ( ) ; if ( crystal != null ) { count += crystal . getAtomCount ( ) ; } IAtomContainerSet moleculeSet = chemModel . getMoleculeSet ( ) ; if ( moleculeSet != null ) { count += MoleculeSetManipulator . getAtomCount ( moleculeSet ) ; } IReactionSet reactionSet = chemModel . getReactionSet ( ) ; if ( reactionSet != null ) { count += ReactionSetManipulator . getAtomCount ( reactionSet ) ; } return count ; }
Get the total number of atoms inside an IChemModel .