public static Rectangle2D calculateBounds ( IAtomContainerSet moleculeSet ) { Rectangle2D totalBounds = new Rectangle2D . Double ( ) ; for ( int i = 0 ; i < moleculeSet . getAtomContainerCount ( ) ; i ++ ) { IAtomContainer container = moleculeSet . getAtomContainer ( i ) ; Rectangle2D acBounds = calculateBounds ( container ) ; if ( totalBounds . isEmpty ( ) ) { totalBounds = acBounds ; } else { Rectangle2D . union ( totalBounds , acBounds , totalBounds ) ; } } return totalBounds ; }
Calculate the bounding rectangle for a molecule set .