private void writeCrystal ( ICrystal crystal ) { String sg = crystal . getSpaceGroup ( ) ; if ( "P 2_1 2_1 2_1" . equals ( sg ) ) { writeln ( "P 21 21 21 (1)" ) ; } else { writeln ( "P 1 (1)" ) ; } // output unit cell axes writeVector3d ( crystal . getA ( ) ) ; writeVector3d ( crystal . getB ( ) ) ; writeVector3d ( crystal . getC ( ) ) ; // output number of atoms int noatoms = crystal . getAtomCount ( ) ; write ( Integer . toString ( noatoms ) ) ; writeln ( "" ) ; // output number of asym. units (Z) if ( sg . equals ( "P1" ) ) { writeln ( "1" ) ; } else { // duno writeln ( "1" ) ; } // output atoms for ( int i = 0 ; i < noatoms ; i ++ ) { // output atom sumbol IAtom atom = crystal . getAtom ( i ) ; write ( atom . getSymbol ( ) ) ; write ( ":" ) ; // output atom charge writeln ( Double . toString ( atom . getCharge ( ) ) ) ; // output coordinates writeln ( Double . toString ( atom . getPoint3d ( ) . x ) ) ; writeln ( Double . toString ( atom . getPoint3d ( ) . y ) ) ; writeln ( Double . toString ( atom . getPoint3d ( ) . z ) ) ; } }
Writes a single frame to the Writer .