|
From: <mig...@us...> - 2006-03-27 21:34:44
|
Revision: 4791 Author: migueljmol Date: 2006-03-27 13:34:39 -0800 (Mon, 27 Mar 2006) ViewCVS: http://svn.sourceforge.net/jmol/?rev=4791&view=rev Log Message: ----------- patch r4594 to Strands + did not introduce bug Modified Paths: -------------- branches/r4453rollback/Jmol/src/org/jmol/viewer/Eval.java branches/r4453rollback/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java branches/r4453rollback/Jmol/src/org/jmol/viewer/Strands.java branches/r4453rollback/Jmol/src/org/jmol/viewer/StrandsRenderer.java branches/r4453rollback/Jmol/src/org/jmol/viewer/Viewer.java Modified: branches/r4453rollback/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- branches/r4453rollback/Jmol/src/org/jmol/viewer/Eval.java 2006-03-27 21:23:17 UTC (rev 4790) +++ branches/r4453rollback/Jmol/src/org/jmol/viewer/Eval.java 2006-03-27 21:34:39 UTC (rev 4791) @@ -3,9 +3,9 @@ * $Date$ * $Revision$ * - * Copyright (C) 2003-2005 The Jmol Development Team + * Copyright (C) 2003-2006 Miguel, Jmol Development, www.jmol.org * - * Contact: jmo...@li... + * Contact: mi...@jm... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2902,7 +2902,8 @@ if (strandCount < 0 || strandCount > 20) numberOutOfRange(); } - viewer.setStrandsCount(strandCount); + viewer.setShapeProperty(JmolConstants.SHAPE_STRANDS, + "strandCount", new Integer(strandCount)); } void setSpecular() throws ScriptException { Modified: branches/r4453rollback/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java =================================================================== --- branches/r4453rollback/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java 2006-03-27 21:23:17 UTC (rev 4790) +++ branches/r4453rollback/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java 2006-03-27 21:34:39 UTC (rev 4791) @@ -63,7 +63,9 @@ void renderMpspolymer( Mps.Mpspolymer mpspolymer) { MeshRibbon.Schain strandsChain = (MeshRibbon.Schain)mpspolymer; - strandCount = viewer.getStrandsCount(); + // no way to do this now that strandCount is part of the strands object + // strandCount = viewer.getStrandsCount(); + strandCount = 7; strandSeparation = (strandCount <= 1 ) ? 0 : 1f / (strandCount - 1); baseOffset = ((strandCount & 1) == 0) ? strandSeparation / 2 : strandSeparation; Modified: branches/r4453rollback/Jmol/src/org/jmol/viewer/Strands.java =================================================================== --- branches/r4453rollback/Jmol/src/org/jmol/viewer/Strands.java 2006-03-27 21:23:17 UTC (rev 4790) +++ branches/r4453rollback/Jmol/src/org/jmol/viewer/Strands.java 2006-03-27 21:34:39 UTC (rev 4791) @@ -3,9 +3,9 @@ * $Date$ * $Revision$ * - * Copyright (C) 2003-2005 The Jmol Development Team + * Copyright (C) 2003-2006 Miguel, Jmol Development, www.jmol.org * - * Contact: jmo...@li... + * Contact: mi...@jm... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +23,7 @@ */ package org.jmol.viewer; +import java.util.BitSet; class Strands extends Mps { @@ -32,10 +33,28 @@ * http://sgce.cbse.uab.edu/carson/papers/ribbons86/ribbons86.html *==============================================================*/ + int strandCount = 5; + Mps.Mpspolymer allocateMpspolymer(Polymer polymer) { return new Schain(polymer); } + void setProperty(String propertyName, Object value, BitSet bs) { + initialize(); + if ("strandCount" == propertyName) { + if (value instanceof Integer) { + int count = ((Integer)value).intValue(); + if (count < 0) + count = 0; + else if (count > 20) + count = 20; + strandCount = count; + return; + } + } + super.setProperty(propertyName, value, bs); + } + class Schain extends Mps.Mpspolymer { Schain(Polymer polymer) { Modified: branches/r4453rollback/Jmol/src/org/jmol/viewer/StrandsRenderer.java =================================================================== --- branches/r4453rollback/Jmol/src/org/jmol/viewer/StrandsRenderer.java 2006-03-27 21:23:17 UTC (rev 4790) +++ branches/r4453rollback/Jmol/src/org/jmol/viewer/StrandsRenderer.java 2006-03-27 21:34:39 UTC (rev 4791) @@ -3,9 +3,9 @@ * $Date$ * $Revision$ * - * Copyright (C) 2003-2005 The Jmol Development Team + * Copyright (C) 2003-2006 Miguel, Jmol Development, www.jmol.org * - * Contact: jmo...@li... + * Contact: mi...@jm... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,6 @@ class StrandsRenderer extends MpsRenderer { - Strands strands; Point3f pointT = new Point3f(); Point3i[] calcScreens(Point3f[] centers, Vector3f[] vectors, @@ -60,8 +59,9 @@ void renderMpspolymer(Mps.Mpspolymer mpspolymer) { Strands.Schain schain = (Strands.Schain)mpspolymer; + Strands strands = (Strands)shape; - strandCount = viewer.getStrandsCount(); + strandCount = strands.strandCount; strandSeparation = (strandCount <= 1 ) ? 0 : 1f / (strandCount - 1); baseOffset = ((strandCount & 1) == 0) ? strandSeparation / 2 : strandSeparation; Modified: branches/r4453rollback/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/r4453rollback/Jmol/src/org/jmol/viewer/Viewer.java 2006-03-27 21:23:17 UTC (rev 4790) +++ branches/r4453rollback/Jmol/src/org/jmol/viewer/Viewer.java 2006-03-27 21:34:39 UTC (rev 4791) @@ -1745,20 +1745,6 @@ return Graphics3D.getColix(object); } - int strandsCount = 5; - - void setStrandsCount(int strandsCount) { - if (strandsCount < 0) - strandsCount = 0; - if (strandsCount > 20) - strandsCount = 20; - this.strandsCount = strandsCount; - } - - int getStrandsCount() { - return strandsCount; - } - boolean rasmolHydrogenSetting = true; void setRasmolHydrogenSetting(boolean b) { rasmolHydrogenSetting = b; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |