From: Michael T H. <mic...@us...> - 2003-09-25 18:05:28
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel In directory sc8-pr-cvs1:/tmp/cvs-serv18081/src/org/openscience/jmol/viewer/datamodel Modified Files: AtomRenderer.java Log Message: random cleanup of low-level graphics Index: AtomRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/AtomRenderer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- AtomRenderer.java 12 Sep 2003 12:02:07 -0000 1.8 +++ AtomRenderer.java 25 Sep 2003 18:05:24 -0000 1.9 @@ -58,50 +58,34 @@ showHydrogens = viewer.getShowHydrogens(); } - byte styleAtom; - int x, y, z, diameter; - short colix; - public void render(AtomShape atomShape) { if (!showHydrogens && atomShape.atomicNumber == 1) return; - styleAtom = atomShape.styleAtom; + byte styleAtom = atomShape.styleAtom; if (styleAtom <= JmolViewer.NONE) return; - x = atomShape.x; - y = atomShape.y; - z = atomShape.z; - diameter = atomShape.diameter; + int x = atomShape.x; + int y = atomShape.y; + int z = atomShape.z; + int diameter = atomShape.diameter; int radius = (diameter + 1) / 2; if (x + radius < minX || x - radius >= maxX || y + radius < minY || y - radius >= maxY) return; - colix = atomShape.colixAtom; - renderAtom(); - if (viewer.hasSelectionHalo(atomShape)) - renderHalo(); - } - - private void renderHalo() { - int halowidth = diameter / 4; - if (halowidth < 4) halowidth = 4; - if (halowidth > 10) halowidth = 10; - int halodiameter = diameter + 2 * halowidth; - g3d.fillCircleCentered(colixSelection, x, y, z, halodiameter); - } - private void renderDots(short colixDots, int diameterDots) { - // g3d.drawDotsCentered(colixDots, x, y, z, diameterDots); - } + if (styleAtom == JmolViewer.SHADED && !wireframeRotating) + g3d.fillSphereCentered(atomShape.colixAtom, diameter, x, y, z); + else + g3d.drawCircleCentered(atomShape.colixAtom, diameter, x, y, z); - private void renderAtom() { - if (diameter > 0) { - if (styleAtom == JmolViewer.SHADED && !wireframeRotating) - g3d.fillSphereCentered(colix, diameter, x, y, z); - else - g3d.drawCircleCentered(colix, diameter, x, y, z); + if (viewer.hasSelectionHalo(atomShape)) { + int halowidth = diameter / 4; + if (halowidth < 4) halowidth = 4; + if (halowidth > 10) halowidth = 10; + int halodiameter = diameter + 2 * halowidth; + g3d.fillScreenedCircleCentered(colixSelection, x, y, z, halodiameter); } } } |