From: <ha...@us...> - 2007-10-22 17:42:50
|
Revision: 8494 http://jmol.svn.sourceforge.net/jmol/?rev=8494&view=rev Author: hansonr Date: 2007-10-22 10:42:48 -0700 (Mon, 22 Oct 2007) Log Message: ----------- version=11.3.37_dev # new feature: helixes as barrels in cartoons or rockets using rocketBarrels = true Modified Paths: -------------- trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/StateManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java 2007-10-22 15:55:51 UTC (rev 8493) +++ trunk/Jmol/src/org/jmol/shapebio/CartoonRenderer.java 2007-10-22 17:42:48 UTC (rev 8494) @@ -33,8 +33,8 @@ public class CartoonRenderer extends RocketsRenderer { - boolean newRockets = true; - boolean renderAsRockets; + private boolean newRockets = true; + private boolean renderAsRockets; protected void renderBioShape(BioShape bioShape) { if (bioShape.wingVectors == null || isCarbohydrate) @@ -50,9 +50,19 @@ bioShape.falsifyMesh(i, false); renderAsRockets = val; } + val = viewer.getRocketBarrelFlag(); + if (renderAsBarrels != val) { + for (int i = 0; i < monomerCount; i++) + bioShape.falsifyMesh(i, false); + renderAsBarrels = val; + } ribbonTopScreens = calcScreens(0.5f); ribbonBottomScreens = calcScreens(-0.5f); calcRopeMidPoints(newRockets); + if (renderAsBarrels) { + calcScreenControlPoints(cordMidPoints); + controlPoints = cordMidPoints; + } render1(); viewer.freeTempPoints(cordMidPoints); viewer.freeTempScreens(ribbonTopScreens); @@ -101,7 +111,7 @@ previousStructure = thisStructure; boolean isHelix = isHelix(i); boolean isSheet = isSheet(i); - boolean isHelixRocket = (renderAsRockets ? isHelix : false); + boolean isHelixRocket = (renderAsRockets || renderAsBarrels ? isHelix : false); if (bsVisible.get(i)) { if (isHelixRocket) { //next pass @@ -119,7 +129,7 @@ lastWasHelix = isHelix; } - if (renderAsRockets) + if (renderAsRockets || renderAsBarrels) renderRockets(); } @@ -134,8 +144,7 @@ tPending = false; for (int i = 0; i < monomerCount; ++i) if (bsVisible.get(i) && isHelix(i)) { - colix = getLeadColix(i); - renderSpecialSegment(monomers[i],colix, mads[i]); + renderSpecialSegment(monomers[i], getLeadColix(i), mads[i]); } renderPending(); } Modified: trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java 2007-10-22 15:55:51 UTC (rev 8493) +++ trunk/Jmol/src/org/jmol/shapebio/RocketsRenderer.java 2007-10-22 17:42:48 UTC (rev 8494) @@ -38,9 +38,17 @@ private final static float MIN_CONE_HEIGHT = 0.05f; + protected boolean renderAsBarrels; + protected void renderBioShape(BioShape bioShape) { if (!(bioShape.bioPolymer instanceof AminoPolymer)) return; + boolean val = viewer.getRocketBarrelFlag(); + if (renderAsBarrels != val) { + for (int i = 0; i < monomerCount; i++) + bioShape.falsifyMesh(i, false); + renderAsBarrels = val; + } calcRopeMidPoints(false); calcScreenControlPoints(cordMidPoints); controlPoints = cordMidPoints; @@ -58,9 +66,9 @@ for (int i = 0; i < monomerCount; ++i) { point = cordMidPoints[i]; Monomer residue = monomers[i]; - if (isNewStyle) { - point.set(controlPoints[i]); - } else if (isHelix(i) || isSheet(i)) { + if (isNewStyle && !renderAsBarrels) { + point.set(controlPoints[i]); + } else if (isHelix(i) || !isNewStyle && isSheet(i)) { ProteinStructure proteinstructure = residue.getProteinStructure(); point.set(i - 1 != proteinstructure.getMonomerIndex() ? proteinstructure.getAxisStartPoint() : @@ -150,11 +158,11 @@ if (tEnd) { viewer.transformPoint(pointBeforeEnd, screenC); if (g3d.setColix(colix)) { - if (pointBeforeEnd.distance(pointEnd) > MIN_CONE_HEIGHT) - renderCone(i, pointBeforeEnd, pointEnd, screenC, screenB); - else + if (renderAsBarrels || pointBeforeEnd.distance(pointEnd) <= MIN_CONE_HEIGHT) g3d.fillCylinderBits(Graphics3D.ENDCAPS_FLAT, diameter, screenB, screenC); + else + renderCone(i, pointBeforeEnd, pointEnd, screenC, screenB); } if (startIndexPending == endIndexPending) return; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2007-10-22 15:55:51 UTC (rev 8493) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2007-10-22 17:42:48 UTC (rev 8494) @@ -2,6 +2,9 @@ # bug fix: 0-diameter atoms displayed as single pixels when perspectiveDepth = false +# new feature: helixes as barrels in cartoons or rockets using +# rocketBarrels = true + # ----------------------------------------------------------------------------- #version=11.3.36 Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2007-10-22 15:55:51 UTC (rev 8493) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2007-10-22 17:42:48 UTC (rev 8494) @@ -532,6 +532,7 @@ boolean rasmolHydrogenSetting = true; boolean rasmolHeteroSetting = true; boolean cartoonRockets = false; + boolean rocketBarrels = false; boolean ribbonBorder = false; boolean chainCaseSensitive = false; boolean rangeSelected = false; @@ -1011,6 +1012,7 @@ setParameterValue("refreshing",true); setParameterValue("ribbonAspectRatio",ribbonAspectRatio); setParameterValue("ribbonBorder",ribbonBorder); + setParameterValue("rocketBarrels",rocketBarrels); setParameterValue("scriptDelay",scriptDelay); setParameterValue("selectHetero",rasmolHeteroSetting); setParameterValue("selectHydrogen",rasmolHydrogenSetting); Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2007-10-22 15:55:51 UTC (rev 8493) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2007-10-22 17:42:48 UTC (rev 8494) @@ -4521,6 +4521,10 @@ setCartoonRocketFlag(value); break; } + if (key.equalsIgnoreCase("rocketBarrels")) { + setRocketBarrelFlag(value); + break; + } if (key.equalsIgnoreCase("greyscaleRendering")) { setGreyscaleRendering(value); break; @@ -4895,10 +4899,18 @@ return global.cartoonRockets; } + public boolean getRocketBarrelFlag() { + return global.rocketBarrels; + } + private void setCartoonRocketFlag(boolean TF) { global.cartoonRockets = TF; } + private void setRocketBarrelFlag(boolean TF) { + global.rocketBarrels = TF; + } + boolean getHideNameInPopup() { return global.hideNameInPopup; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |