From: <ha...@us...> - 2007-10-08 11:19:44
|
Revision: 8387 http://jmol.svn.sourceforge.net/jmol/?rev=8387&view=rev Author: hansonr Date: 2007-10-08 04:19:41 -0700 (Mon, 08 Oct 2007) Log Message: ----------- major reorganization of exporters Modified Paths: -------------- trunk/Jmol/src/org/jmol/export/CartoonGenerator.java trunk/Jmol/src/org/jmol/export/RocketsGenerator.java trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java Modified: trunk/Jmol/src/org/jmol/export/CartoonGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/CartoonGenerator.java 2007-10-08 11:01:42 UTC (rev 8386) +++ trunk/Jmol/src/org/jmol/export/CartoonGenerator.java 2007-10-08 11:19:41 UTC (rev 8387) @@ -42,26 +42,26 @@ } protected void fillSphereCentered(int diameter, Point3i pt) { - exporter.fillSphereCentered(colixPending, diameter, pt); + exporter.fillSphereCentered(colix, diameter, pt); } protected void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, Point3f screenB) { - exporter.renderBond(screenA, screenB, colixPending, colixPending, endcaps, madPending, 1); + exporter.renderBond(screenA, screenB, colix, colix, endcaps, madBond, 1); } protected void fillTriangle(Point3f ptA, Point3f ptB, Point3f ptC) { - exporter.fillTriangle(colixPending, ptA, ptB, ptC); + exporter.fillTriangle(colix, ptA, ptB, ptC); } protected void fillQuadrilateral(Point3f ptA, Point3f ptB, Point3f ptC, Point3f ptD) { - exporter.fillQuadrilateral(colixPending, ptA, ptB, ptC, ptD); + exporter.fillQuadrilateral(colix, ptA, ptB, ptC, ptD); } protected void fillCone(byte endcap, int diameter, Point3f screenBase, Point3f screenTip) { - exporter.fillCone(colixPending, endcap, madPending, screenBase, screenTip); + exporter.fillCone(colix, endcap, madBond, screenBase, screenTip); } public void fillHermite(int tension, int diameterBeg, int diameterMid, Modified: trunk/Jmol/src/org/jmol/export/RocketsGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/export/RocketsGenerator.java 2007-10-08 11:01:42 UTC (rev 8386) +++ trunk/Jmol/src/org/jmol/export/RocketsGenerator.java 2007-10-08 11:19:41 UTC (rev 8387) @@ -41,26 +41,26 @@ } protected void fillSphereCentered(int diameter, Point3i pt) { - exporter.fillSphereCentered(colixPending, diameter, pt); + exporter.fillSphereCentered(colix, diameter, pt); } protected void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, Point3f screenB) { - exporter.renderBond(screenA, screenB, colixPending, colixPending, endcaps, madPending, 1); + exporter.renderBond(screenA, screenB, colix, colix, endcaps, madBond, 1); } protected void fillTriangle(Point3f ptA, Point3f ptB, Point3f ptC) { - exporter.fillTriangle(colixPending, ptA, ptB, ptC); + exporter.fillTriangle(colix, ptA, ptB, ptC); } protected void fillQuadrilateral(Point3f ptA, Point3f ptB, Point3f ptC, Point3f ptD) { - exporter.fillQuadrilateral(colixPending, ptA, ptB, ptC, ptD); + exporter.fillQuadrilateral(colix, ptA, ptB, ptC, ptD); } protected void fillCone(byte endcap, int diameter, Point3f screenBase, Point3f screenTip) { - exporter.fillCone(colixPending, endcap, madPending, screenBase, screenTip); + exporter.fillCone(colix, endcap, madBond, screenBase, screenTip); } public void fillHermite(int tension, int diameterBeg, int diameterMid, Modified: trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java 2007-10-08 11:01:42 UTC (rev 8386) +++ trunk/Jmol/src/org/jmol/shapebio/BioShapeRenderer.java 2007-10-08 11:19:41 UTC (rev 8387) @@ -77,8 +77,6 @@ byte[] structureTypes; protected int madBond; - protected short madPending; - protected short colixPending; protected void render() { if (shape == null) @@ -414,7 +412,7 @@ void renderCone(int i, Point3f pointBegin, Point3f pointEnd, Point3f screenPtBegin, Point3f screenPtEnd) { int coneDiameter = viewer.scaleToScreen((int) Math.floor(screenPtBegin.z), - madPending + (madPending >> 2)); + madBond + (madBond >> 2)); /* if (false && aspectRatio > 0 && checkDiameter(coneDiameter)) { try { Modified: trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java 2007-10-08 11:01:42 UTC (rev 8386) +++ trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java 2007-10-08 11:19:41 UTC (rev 8387) @@ -97,11 +97,11 @@ renderPending(); } - protected void renderSpecialSegment(Monomer monomer, short colix, short mad) { + protected void renderSpecialSegment(Monomer monomer, short thisColix, short mad) { ProteinStructure proteinstructure = monomer.getProteinStructure(); if (tPending) { - if (proteinstructure == proteinstructurePending && mad == madPending - && colix == colixPending + if (proteinstructure == proteinstructurePending && mad == madBond + && thisColix == colix && proteinstructure.getIndex(monomer) == endIndexPending + 1) { ++endIndexPending; return; @@ -110,8 +110,8 @@ } proteinstructurePending = proteinstructure; startIndexPending = endIndexPending = proteinstructure.getIndex(monomer); - colixPending = colix; - madPending = mad; + colix = thisColix; + madBond = mad; tPending = true; } @@ -145,10 +145,10 @@ viewer.transformPoint(pointStart, screenA); viewer.transformPoint(pointEnd, screenB); int zMid = (int) Math.floor((screenA.z + screenB.z) / 2f); - int diameter = viewer.scaleToScreen(zMid, madPending); + int diameter = viewer.scaleToScreen(zMid, madBond); if (tEnd) { viewer.transformPoint(pointBeforeEnd, screenC); - if (isGenerator || g3d.setColix(colixPending)) { + if (isGenerator || g3d.setColix(colix)) { if (pointBeforeEnd.distance(pointEnd) > MIN_CONE_HEIGHT) renderCone(i, pointBeforeEnd, pointEnd, screenC, screenB); else @@ -161,13 +161,13 @@ screenB = screenC; screenC = t; } - if (isGenerator || g3d.setColix(colixPending)) + if (isGenerator || g3d.setColix(colix)) fillCylinderBits(Graphics3D.ENDCAPS_FLAT, diameter, screenA, screenB); } private void renderPendingSheet(Point3f pointStart, Point3f pointBeforeEnd, Point3f pointEnd, boolean tEnd) { - if (!isGenerator && !g3d.setColix(colixPending)) + if (!isGenerator && !g3d.setColix(colix)) return; if (tEnd) { drawArrowHeadBox(pointBeforeEnd, pointEnd); @@ -242,7 +242,7 @@ void drawBox(Point3f pointA, Point3f pointB) { Sheet sheet = (Sheet)proteinstructurePending; - float scale = madPending / 1000f; + float scale = madBond / 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 = madPending / 1000f; + float scale = madBond / 1000f; scaledWidthVector.set(sheet.getWidthUnitVector()); scaledWidthVector.scale(scale * 1.25f); scaledHeightVector.set(sheet.getHeightUnitVector()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |