From: Michael T H. <mic...@us...> - 2003-12-25 01:22:20
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel In directory sc8-pr-cvs1:/tmp/cvs-serv24056/src/org/openscience/jmol/viewer/datamodel Modified Files: Atom.java Log Message: converted atom.x,y,z into shorts Index: Atom.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Atom.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Atom.java 15 Dec 2003 22:50:34 -0000 1.14 +++ Atom.java 25 Dec 2003 01:22:16 -0000 1.15 @@ -41,7 +41,7 @@ public PdbAtom pdbAtom; Frame frame; public Point3f point3f; - int x, y, z; + short x, y, z; short diameter; public byte atomicNumber; byte styleAtom; @@ -239,9 +239,29 @@ public void transform(JmolViewer viewer) { Point3i screen = viewer.transformPoint(point3f); - x = screen.x; - y = screen.y; - z = screen.z; + int t; + + t = screen.x; + x = ((t < Short.MIN_VALUE) + ? Short.MIN_VALUE + : ((t > Short.MAX_VALUE) + ? Short.MAX_VALUE + : (short)t)); + + t = screen.y; + y = ((t < Short.MIN_VALUE) + ? Short.MIN_VALUE + : ((t > Short.MAX_VALUE) + ? Short.MAX_VALUE + : (short)t)); + + t = screen.z; + z = ((t < Short.MIN_VALUE) + ? Short.MIN_VALUE + : ((t > Short.MAX_VALUE) + ? Short.MAX_VALUE + : (short)t)); + diameter = viewer.scaleToScreen(z, marAtom * 2); } |