From: <ha...@us...> - 2007-10-08 12:39:55
|
Revision: 8389 http://jmol.svn.sourceforge.net/jmol/?rev=8389&view=rev Author: hansonr Date: 2007-10-08 05:39:53 -0700 (Mon, 08 Oct 2007) Log Message: ----------- major reorganization of exporters Modified Paths: -------------- trunk/Jmol/src/org/jmol/api/JmolExportInterface.java trunk/Jmol/src/org/jmol/export/BackboneGenerator.java trunk/Jmol/src/org/jmol/export/CartoonGenerator.java trunk/Jmol/src/org/jmol/export/RibbonsGenerator.java trunk/Jmol/src/org/jmol/export/RocketsGenerator.java trunk/Jmol/src/org/jmol/export/SticksGenerator.java trunk/Jmol/src/org/jmol/export/TraceGenerator.java trunk/Jmol/src/org/jmol/shape/MeshRenderer.java trunk/Jmol/src/org/jmol/shape/ShapeRenderer.java trunk/Jmol/src/org/jmol/shape/SticksRenderer.java trunk/Jmol/src/org/jmol/shapebio/BackboneRenderer.java trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java trunk/Jmol/src/org/jmol/shapespecial/DipolesRenderer.java Added Paths: ----------- trunk/Jmol/src/org/jmol/export/DipolesGenerator.java Modified: trunk/Jmol/src/org/jmol/api/JmolExportInterface.java =================================================================== --- trunk/Jmol/src/org/jmol/api/JmolExportInterface.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/api/JmolExportInterface.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -72,6 +72,8 @@ //rockets: abstract void fillQuadrilateral(short colix, Point3f ptA, Point3f ptB, Point3f ptC, Point3f ptD); + + //rockets and dipoles abstract void fillCone(short colix, byte endcap, int diameter, Point3f screenBase, Point3f screenTip); Modified: trunk/Jmol/src/org/jmol/export/BackboneGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/BackboneGenerator.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/export/BackboneGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -56,6 +56,6 @@ */ ptA.set(xA, yA, zA); ptB.set(xB, yB, zB); - exporter.renderBond(ptA, ptB, colixA, colixB, endcaps, madBond, 1); + exporter.renderBond(ptA, ptB, colixA, colixB, endcaps, mad, 1); } } Modified: trunk/Jmol/src/org/jmol/export/CartoonGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/CartoonGenerator.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/export/CartoonGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -47,7 +47,7 @@ protected void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, Point3f screenB) { - exporter.renderBond(screenA, screenB, colix, colix, endcaps, madBond, 1); + exporter.renderBond(screenA, screenB, colix, colix, endcaps, mad, 1); } protected void fillTriangle(Point3f ptA, Point3f ptB, Point3f ptC) { @@ -61,13 +61,13 @@ protected void fillCone(byte endcap, int diameter, Point3f screenBase, Point3f screenTip) { - exporter.fillCone(colix, endcap, madBond, screenBase, screenTip); + exporter.fillCone(colix, endcap, mad, screenBase, screenTip); } public void fillHermite(int tension, int diameterBeg, int diameterMid, int diameterEnd, Point3i s0, Point3i s1, Point3i s2, Point3i s3) { - exporter.fillHermite(colix, tension, diameterBeg, diameterMid, diameterEnd, + exporter.fillHermite(colix, tension, madBeg, madMid, madEnd, s0, s1, s2, s3); } @@ -76,11 +76,11 @@ protected void fillCylinder(byte endcaps, int diameter, Point3i screenA, Point3i screenB) { - exporter.fillCylinder(colix, endcaps, diameter, screenA, screenB); + exporter.fillCylinder(colix, endcaps, mad, screenA, screenB); } - Point3f ptA = new Point3f(); - Point3f ptB = new Point3f(); + private Point3f ptA = new Point3f(); + private Point3f ptB = new Point3f(); protected void fillCylinder(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB) { @@ -95,9 +95,9 @@ exporter.renderBond(ptA, ptB, colixA, colixB, endcaps, diameter, 1); } - Point3f pt1 = new Point3f(); - Point3f pt2 = new Point3f(); - Point3f pt3 = new Point3f(); + private Point3f pt1 = new Point3f(); + private Point3f pt2 = new Point3f(); + private Point3f pt3 = new Point3f(); protected void fillTriangle(Point3i ptA, Point3i ptB, Point3i ptC) { pt1.set(ptA.x, ptA.y, ptA.z); Added: trunk/Jmol/src/org/jmol/export/DipolesGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/DipolesGenerator.java (rev 0) +++ trunk/Jmol/src/org/jmol/export/DipolesGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -0,0 +1,63 @@ +/* $RCSfile$ + * $Author: hansonr $ + * $Date: 2007-05-18 15:41:42 -0500 (Fri, 18 May 2007) $ + * $Revision: 7752 $ + + * + * Copyright (C) 2003-2005 The Jmol Development Team + * + * Contact: jmo...@li... + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jmol.export; + +import javax.vecmath.Point3f; +import javax.vecmath.Point3i; + +import org.jmol.shapespecial.*; + +public class DipolesGenerator extends DipolesRenderer { + + private _Exporter exporter; + + public void initializeGenerator(Object exporter, String type, StringBuffer output) { + super.initializeGenerator(exporter, type, output); + isGenerator = true; + this.exporter = (_Exporter)exporter; + } + + protected void fillCylinder(byte endcaps, int diameter, Point3i screenA, + Point3i screenB) { + exporter.fillCylinder(colix, endcaps, mad, screenA, screenB); + } + + protected void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, + Point3f screenB) { + exporter.renderBond(screenA, screenB, colix, colix, endcaps, mad, 1); + } + + private Point3f ptA = new Point3f(); + private Point3f ptB = new Point3f(); + + protected void fillCone(byte endcap, int diameter, + Point3i screenBase, Point3i screenTip) { + ptA.set(screenBase.x, screenBase.y, screenBase.z); + ptB.set(screenTip.x, screenTip.y, screenTip.z); + exporter.fillCone(colix, endcap, mad, ptA, ptB); + } + +} Modified: trunk/Jmol/src/org/jmol/export/RibbonsGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/RibbonsGenerator.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/export/RibbonsGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -25,6 +25,7 @@ package org.jmol.export; +import javax.vecmath.Point3f; import javax.vecmath.Point3i; import org.jmol.shapebio.RibbonsRenderer; @@ -52,4 +53,21 @@ s6, s7, aspectRatio); } + private Point3f ptA = new Point3f(); + private Point3f ptB = new Point3f(); + + protected void fillCylinder(short colixA, short colixB, byte endcaps, + int diameter, int xA, int yA, int zA, int xB, int yB, int zB) { + /* + * Use the screen points Jmol determines + * + * this also uses the diameter -- fixed at 3 pixels, but will be 0.003 angstroms here. + * + */ + ptA.set(xA, yA, zA); + ptB.set(xB, yB, zB); + exporter.renderBond(ptA, ptB, colixA, colixB, endcaps, diameter, 1); + } + + } Modified: trunk/Jmol/src/org/jmol/export/RocketsGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/RocketsGenerator.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/export/RocketsGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -46,7 +46,7 @@ protected void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, Point3f screenB) { - exporter.renderBond(screenA, screenB, colix, colix, endcaps, madBond, 1); + exporter.renderBond(screenA, screenB, colix, colix, endcaps, mad, 1); } protected void fillTriangle(Point3f ptA, Point3f ptB, Point3f ptC) { @@ -60,13 +60,14 @@ protected void fillCone(byte endcap, int diameter, Point3f screenBase, Point3f screenTip) { - exporter.fillCone(colix, endcap, madBond, screenBase, screenTip); + exporter.fillCone(colix, endcap, mad, screenBase, screenTip); } protected void fillHermite(int tension, int diameterBeg, int diameterMid, int diameterEnd, Point3i s0, Point3i s1, Point3i s2, Point3i s3) { - exporter.fillHermite(colix, tension, diameterBeg, diameterMid, diameterEnd, + //could be a problem. These diameters are screen coordinates. + exporter.fillHermite(colix, tension, madBeg, madMid, madEnd, s0, s1, s2, s3); } Modified: trunk/Jmol/src/org/jmol/export/SticksGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/SticksGenerator.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/export/SticksGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -48,7 +48,7 @@ super.renderBond(dottedMask); //use fillCylinder return; } - exporter.renderBond(atomA, atomB, colixA, colixB, endcaps, madBond, bondOrder); + exporter.renderBond(atomA, atomB, colixA, colixB, endcaps, mad, bondOrder); } @@ -60,6 +60,6 @@ */ ptA.set(xA, yA, zA); ptB.set(xB, yB, zB); - exporter.renderBond(ptA, ptB, colixA, colixB, endcaps, madBond, 1); + exporter.renderBond(ptA, ptB, colixA, colixB, endcaps, mad, 1); } } Modified: trunk/Jmol/src/org/jmol/export/TraceGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/TraceGenerator.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/export/TraceGenerator.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -42,7 +42,7 @@ protected void fillHermite(int tension, int diameterBeg, int diameterMid, int diameterEnd, Point3i s0, Point3i s1, Point3i s2, Point3i s3) { - exporter.fillHermite(colix, tension, diameterBeg, diameterMid, diameterEnd, + exporter.fillHermite(colix, tension, madBeg, madMid, madEnd, s0, s1, s2, s3); } } Modified: trunk/Jmol/src/org/jmol/shape/MeshRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shape/MeshRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shape/MeshRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -37,7 +37,6 @@ protected int vertexCount; protected int lighting; protected boolean frontOnly; - protected short colix; protected Mesh mesh; @@ -89,7 +88,7 @@ return true; } - //draw, isosurface,meshRenderer::render1 + //draw, isosurface,meshRenderer::render1 (just about everything) protected void render2() { if (mesh.showPoints) renderPoints(); Modified: trunk/Jmol/src/org/jmol/shape/ShapeRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shape/ShapeRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shape/ShapeRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -63,6 +63,10 @@ protected ModelSet modelSet; protected Shape shape; + //working values, for export generators + protected short colix; + protected short mad; + public void render(Graphics3D g3d, ModelSet modelSet, Shape shape) { //, Rectangle rectClip this.g3d = g3d; //this.rectClip = rectClip; //not implemented -- could be a place for optimization Modified: trunk/Jmol/src/org/jmol/shape/SticksRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shape/SticksRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shape/SticksRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -51,7 +51,6 @@ protected short colixA, colixB; protected int width; protected int bondOrder; - protected short madBond; protected void render() { endcaps = Graphics3D.ENDCAPS_SPHERICAL; @@ -71,7 +70,7 @@ } protected void renderBond() { - madBond = bond.getMad(); + mad = bond.getMad(); int order = bond.getOrder(); atomA = bond.getAtom1(); atomB = bond.getAtom2(); @@ -113,7 +112,7 @@ return; dx = xB - xA; dy = yB - yA; - width = viewer.scaleToScreen((zA + zB) / 2, madBond); + width = viewer.scaleToScreen((zA + zB) / 2, mad); bondOrder = getRenderBondOrder(order); switch (bondOrder) { case 1: @@ -162,7 +161,7 @@ !showMultipleBonds || modeMultipleBond == JmolConstants.MULTIBOND_NEVER || (modeMultipleBond == JmolConstants.MULTIBOND_NOTSMALL && - madBond > JmolConstants.madMultipleBondSmallMaximum)) { + mad > JmolConstants.madMultipleBondSmallMaximum)) { return 1; } } @@ -284,6 +283,9 @@ private void renderTriangle(Bond bond) { // for now, always solid, always opaque + if (isGenerator) + return; // actually, not implemented + if (!g3d.checkTranslucent(false)) return; int mag2d = (int)Math.sqrt(dx*dx + dy*dy); @@ -319,27 +321,8 @@ xWideUp, yWideUp, zB, xWideDn, yWideDn, zB); } } -/* - void drawDottedCylinder(short colixA, short colixB, int width, - int x1, int y1, int z1, int x2, int y2, int z2) { - int dx = x2 - x1; - int dy = y2 - y1; - int dz = z2 - z1; - boolean ok = g3d.setColix(colixB); - for (int i = 8; --i >= 0; ) { - int x = x1 + (dx * i) / 7; - int y = y1 + (dy * i) / 7; - int z = z1 + (dz * i) / 7; - if (i == 3 && !(ok = g3d.setColix(colixA))) - return; - if (ok) - g3d.fillSphereCentered(width, x, y, z); - } - } -*/ + - //not suitable for multiple rings - private int getAromaticDottedBondMask() { Atom atomC = atomB.findAromaticNeighbor(atomA.getAtomIndex()); if (atomC == null) @@ -390,6 +373,8 @@ } } + //////////////////////// + protected void fillCylinder(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB) { Modified: trunk/Jmol/src/org/jmol/shapebio/BackboneRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/BackboneRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shapebio/BackboneRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -45,11 +45,11 @@ .screenZ; short colixA = Graphics3D.getColixInherited(colixes[i], atomA.getColix()); short colixB = Graphics3D.getColixInherited(colixes[i + 1], atomB.getColix()); - madBond = mads[i]; - if (madBond < 0) { + mad = mads[i]; + if (mad < 0) { drawLine(colixA, colixB, xA, yA, zA, xB, yB, zB); } else { - int width = viewer.scaleToScreen((zA + zB) / 2, madBond); + int width = viewer.scaleToScreen((zA + zB) / 2, mad); fillCylinder(colixA, colixB, Graphics3D.ENDCAPS_SPHERICAL, width, xA, yA, zA, xB, yB, zB); } Modified: trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -76,7 +76,7 @@ int[] leadAtomIndices; byte[] structureTypes; - protected int madBond; + protected int mad; protected void render() { if (shape == null) @@ -249,7 +249,9 @@ //// cardinal hermite constant cylinder (meshRibbon, strands) int iPrev, iNext, iNext2, iNext3; - int madMid, madBeg, madEnd; + protected int madBeg; + protected int madMid; + protected int madEnd; int diameterBeg, diameterMid, diameterEnd; boolean doCap0, doCap1; @@ -398,21 +400,23 @@ screenArrowTopPrev); calc1Screen(controlPoints[i], wingVectors[i], (short) madBeg, -0.001f, screenArrowBotPrev); - if (ribbonBorder && aspectRatio == 0) - fillCylinder(colix, colix, Graphics3D.ENDCAPS_SPHERICAL, 3, - screenArrowTop.x, screenArrowTop.y, screenArrowTop.z, - screenArrowBot.x, screenArrowBot.y, screenArrowBot.z); drawHermite(true, ribbonBorder, isNucleic ? 4 : 7, screenArrowTopPrev, screenArrowTop, controlPointScreens[iNext], controlPointScreens[iNext2], screenArrowBotPrev, screenArrowBot, controlPointScreens[iNext], controlPointScreens[iNext2], aspectRatio); + if (ribbonBorder && aspectRatio == 0) { + mad = 3; + fillCylinder(colix, colix, Graphics3D.ENDCAPS_SPHERICAL, 3, + screenArrowTop.x, screenArrowTop.y, screenArrowTop.z, + screenArrowBot.x, screenArrowBot.y, screenArrowBot.z); + } } // rockets --not satisfactory yet void renderCone(int i, Point3f pointBegin, Point3f pointEnd, Point3f screenPtBegin, Point3f screenPtEnd) { int coneDiameter = viewer.scaleToScreen((int) Math.floor(screenPtBegin.z), - madBond + (madBond >> 2)); + mad + (mad >> 2)); /* if (false && aspectRatio > 0 && checkDiameter(coneDiameter)) { try { Modified: trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -156,7 +156,7 @@ } private void renderNucleicBaseStep(NucleicMonomer nucleotide, - short mad, Point3i backboneScreen) { + short thisMad, Point3i backboneScreen) { nucleotide.getBaseRing6Points(ring6Points); viewer.transformPoints(ring6Points, ring6Screens); renderRing6(); @@ -169,10 +169,10 @@ } else { stepScreen = ring6Screens[2];//was 1 } - madBond = mad > 1 ? mad / 2 : mad; + mad = thisMad > 1 ? thisMad / 2 : thisMad; fillCylinder(Graphics3D.ENDCAPS_SPHERICAL, viewer.scaleToScreen(backboneScreen.z, - madBond), + mad), backboneScreen, stepScreen); --ring6Screens[5].z; for (int i = 5; --i > 0; ) { Modified: trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -97,10 +97,10 @@ renderPending(); } - protected void renderSpecialSegment(Monomer monomer, short thisColix, short mad) { + protected void renderSpecialSegment(Monomer monomer, short thisColix, short thisMad) { ProteinStructure proteinstructure = monomer.getProteinStructure(); if (tPending) { - if (proteinstructure == proteinstructurePending && mad == madBond + if (proteinstructure == proteinstructurePending && thisMad == mad && thisColix == colix && proteinstructure.getIndex(monomer) == endIndexPending + 1) { ++endIndexPending; @@ -111,7 +111,7 @@ proteinstructurePending = proteinstructure; startIndexPending = endIndexPending = proteinstructure.getIndex(monomer); colix = thisColix; - madBond = mad; + mad = thisMad; tPending = true; } @@ -145,7 +145,7 @@ viewer.transformPoint(pointStart, screenA); viewer.transformPoint(pointEnd, screenB); int zMid = (int) Math.floor((screenA.z + screenB.z) / 2f); - int diameter = viewer.scaleToScreen(zMid, madBond); + int diameter = viewer.scaleToScreen(zMid, mad); if (tEnd) { viewer.transformPoint(pointBeforeEnd, screenC); if (isGenerator || g3d.setColix(colix)) { @@ -242,7 +242,7 @@ void drawBox(Point3f pointA, Point3f pointB) { Sheet sheet = (Sheet)proteinstructurePending; - float scale = madBond / 1000f; + float scale = mad / 1000f; scaledWidthVector.set(sheet.getWidthUnitVector()); scaledWidthVector.scale(scale); scaledHeightVector.set(sheet.getHeightUnitVector()); @@ -266,7 +266,7 @@ void drawArrowHeadBox(Point3f base, Point3f tip) { Sheet sheet = (Sheet)proteinstructurePending; - float scale = madBond / 1000f; + float scale = mad / 1000f; scaledWidthVector.set(sheet.getWidthUnitVector()); scaledWidthVector.scale(scale * 1.25f); scaledHeightVector.set(sheet.getHeightUnitVector()); Modified: trunk/Jmol/src/org/jmol/shapespecial/DipolesRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/DipolesRenderer.java 2007-10-08 11:36:48 UTC (rev 8388) +++ trunk/Jmol/src/org/jmol/shapespecial/DipolesRenderer.java 2007-10-08 12:39:53 UTC (rev 8389) @@ -121,7 +121,7 @@ viewer.transformPoint(points[i], screens[i]); viewer.transformPoint(points[cross], cross0); viewer.transformPoint(points[crossEnd], cross1); - short mad = dipole.mad; + mad = dipole.mad; diameter = viewer.scaleToScreen(screens[center].z, mad); headWidthPixels = (int) (diameter * arrowHeadWidthFactor); if (headWidthPixels < diameter + 10) @@ -147,18 +147,38 @@ colixA = colixB; colixB = c; } - if (g3d.setColix(colixA)) { - g3d.fillCylinder(Graphics3D.ENDCAPS_OPEN, diameter, + colix = colixA; + if (isGenerator || g3d.setColix(colix)) { + fillCylinder(Graphics3D.ENDCAPS_OPEN, diameter, screens[cylinderBase], screens[center]); if (!dipole.noCross) - g3d.fillCylinderBits(Graphics3D.ENDCAPS_FLAT, crossWidthPixels, cross0, + fillCylinderBits(Graphics3D.ENDCAPS_FLAT, crossWidthPixels, cross0, cross1); } - if (g3d.setColix(colixB)) { - g3d.fillCylinder(Graphics3D.ENDCAPS_OPEN, diameter, + colix = colixB; + if (isGenerator || g3d.setColix(colix)) { + fillCylinder(Graphics3D.ENDCAPS_OPEN, diameter, screens[center], screens[arrowHeadBase]); g3d.fillCone(Graphics3D.ENDCAPS_FLAT, headWidthPixels, screens[arrowHeadBase], screens[arrowHeadTip]); } } + + /////////////////// + + protected void fillCylinder(byte endcaps, int diameter, Point3i screenA, + Point3i screenB) { + g3d.fillCylinder(endcaps, diameter, screenA, screenB); + } + + protected void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, + Point3f screenB) { + g3d.fillCylinderBits(endcaps, diameter, screenA, screenB); + } + + protected void fillCone(byte endcap, int diameter, + Point3i screenBase, Point3i screenTip) { + g3d.fillCone(endcap, diameter, screenBase, + screenTip); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |