From: Michael T H. <mic...@us...> - 2003-07-07 23:49:24
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/render In directory sc8-pr-cvs1:/tmp/cvs-serv31742/src/org/openscience/jmol/render Modified Files: AtomRenderer.java AtomShape.java Log Message: added dots display plus cylinder work Index: AtomRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/AtomRenderer.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- AtomRenderer.java 7 Jun 2003 17:10:11 -0000 1.26 +++ AtomRenderer.java 7 Jul 2003 23:49:21 -0000 1.27 @@ -61,11 +61,13 @@ fastRendering = control.getFastRendering(); useGraphics2D = control.getUseGraphics2D(); colorSelection = control.getColorSelection(); + g25dEnabled = control.getGraphics25DEnabled(); } boolean fastRendering; boolean useGraphics2D; Color colorSelection; + boolean g25dEnabled; Atom atom; int x; @@ -94,6 +96,8 @@ colorOutline = control.getColorAtomOutline(styleAtom, color); if (control.hasSelectionHalo(atom)) renderHalo(); + if (atomShape.marDots > 0) + renderDots(atomShape.colorDots, atomShape.diameterDots); if (styleAtom != DisplayControl.NONE && styleAtom != DisplayControl.INVISIBLE) renderAtom(); @@ -106,6 +110,10 @@ int halodiameter = diameter + 2 * halowidth; int haloradius = (halodiameter + 1) / 2; g25d.fillCircleCentered(colorSelection, x, y, z+1, halodiameter); + } + + private void renderDots(Color colorDots, int diameterDots) { + g25d.drawDotsCentered(colorDots, x, y, z, diameterDots); } private void renderAtom() { Index: AtomShape.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/AtomShape.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- AtomShape.java 5 Jun 2003 15:09:45 -0000 1.60 +++ AtomShape.java 7 Jul 2003 23:49:21 -0000 1.61 @@ -42,7 +42,10 @@ public short marAtom; public Color colorAtom; public int diameter; - public int numBonds; + public short marDots = 0; + public Color colorDots; + public int diameterDots = 0; + public int numBonds; public int[] bondWidths; // after a delete operation, these arrays public byte[] styleBonds; // will be longer than numBonds public short[] marBonds; @@ -102,7 +105,7 @@ * represents a percentage of the vdw radius of that atom. * This is converted to a normal MAR as soon as possible * - * (I know everyone hates bytes & shorts, but I like them ... + * (I know almost everyone hates bytes & shorts, but I like them ... * gives me some tiny level of type-checking ... * a rudimentary form of enumerations/user-defined primitive types) */ @@ -116,17 +119,21 @@ marAtom = (short)((-10 * marAtom) * atom.getVanderwaalsRadius()); this.marAtom = marAtom; } - + public void setStyleMarAtom(byte styleAtom, short marAtom) { this.styleAtom = styleAtom; - if (marAtom < 0) { - // a percentage of the atom vdw - // radius * 2 * 1000 * -marAtom / 100 + if (marAtom < 0) marAtom = (short)((-10 * marAtom) * atom.getVanderwaalsRadius()); - } this.marAtom = marAtom; } + public void setColorMarDots(Color colorDots, short marDots) { + this.colorDots = colorDots; + if (marDots < 0) + marDots = (short)((-10 * marDots) * atom.getVanderwaalsRadius()); + this.marDots = marDots; + } + public int getRasMolRadius() { if (styleAtom == DisplayControl.NONE) return 0; @@ -187,29 +194,27 @@ y = screen.y; z = screen.z; diameter = control.scaleToScreen(z, marAtom * 2); + if (marDots > 0) + diameterDots = control.scaleToScreen(z, marDots * 2); for (int i = numBonds; --i >= 0; ) bondWidths[i] = control.scaleToScreen(z, marBonds[i] * 2); } public void render(Graphics25D g25d, DisplayControl control) { - if (!control.getShowHydrogens() && atom.isHydrogen()) { + if (!control.getShowHydrogens() && atom.isHydrogen()) return; - } - if (control.getShowBonds()) { + if (control.getShowBonds()) renderBonds(control); - } - if (control.getShowAtoms() && isClipVisible(control.atomRenderer.clip)) { + if (control.getShowAtoms() && isClipVisible(control.atomRenderer.clip)) control.atomRenderer.render(this); - } if (strLabel != null) control.labelRenderer.render(this); } public void renderBonds(DisplayControl control) { Atom[] bondedAtoms = atom.getBondedAtoms(); - if (bondedAtoms == null) { + if (bondedAtoms == null) return; - } for (int i = numBonds; --i >= 0 ; ) { Atom atomOther = bondedAtoms[i]; AtomShape atomShapeOther = atomOther.getAtomShape(); |