Revision: 20274
          http://sourceforge.net/p/jmol/code/20274
Author:   hansonr
Date:     2015-02-08 18:38:27 +0000 (Sun, 08 Feb 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.12_2015.02.07"

bug fix: set meshScale is not being applied to isosurface contours

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java
    trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
    trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java
===================================================================
--- trunk/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java       
2015-02-08 18:37:51 UTC (rev 20273)
+++ trunk/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java       
2015-02-08 18:38:27 UTC (rev 20274)
@@ -87,6 +87,7 @@
 
   private void setGlobals() {
     needTranslucent = false;
+    antialias = g3d.isAntialiased(); 
     iShowNormals = vwr.getTestFlag(4);
     showNumbers = vwr.getTestFlag(3);
     isosurface = (Isosurface) shape;
@@ -130,7 +131,7 @@
     }
     if (n < 2)
       return;
-    int factor = (g3d.isAntialiased() ? 2 : 1);
+    int factor = (antialias ? 2 : 1);
     int height = vwr.getScreenHeight() * factor;
     int dy = height / 2 / (n - 1);
     int y = height / 4 * 3 - dy;
@@ -252,9 +253,6 @@
         hasColorRange = true;
       return;
     }
-    
-    //if (imesh.jvxlData.vertexDataOnly)
-      //return;
     hasColorRange = (mesh.meshColix == 0);
     for (int i = vContours.length; --i >= 0;) {
       Lst<Object> v = vContours[i];
@@ -265,6 +263,7 @@
       if (!g3d.setC(colix))
         return;
       int n = v.size() - 1;
+      int diam = getDiameter();
       for (int j = JvxlCoder.CONTOUR_POINTS; j < n; j++) {
         T3 pt1 = (T3) v.get(j);
         T3 pt2 = (T3) v.get(++j);
@@ -274,7 +273,12 @@
           break;
         pt1i.z -= 2;
         pt2i.z -= 2;
-        g3d.drawLineAB(pt1i, pt2i);
+        if (!antialias && diam == 1) {
+          g3d.drawLineAB(pt1i, pt2i);
+        } else {
+          g3d.fillCylinderXYZ(colix, colix, GData.ENDCAPS_OPEN, diam, pt1i.x,
+              pt1i.y, pt1i.z, pt2i.x, pt2i.y, pt2i.z);
+        }
       }
     }
   }
@@ -399,17 +403,7 @@
     // two-sided means like a plane, with no front/back distinction
 
     hasColorRange = !colorSolid && !isBicolorMap;
-    int diam;
-    if (mesh.diameter <= 0) {
-      diam = (meshScale < 0 ? meshScale = vwr.getInt(T.meshscale)
-          : meshScale);
-      if (g3d.isAntialiased())
-        diam *= 2;
-    } else {
-      diam = vwr.getScreenDim() / 100;
-    }
-    if (diam < 1)
-      diam = 1;
+    int diam = getDiameter();
     int i0 = 0;
     for (int i = mesh.pc; --i >= i0;) {
       int[] polygon = polygonIndexes[i];
@@ -516,6 +510,21 @@
       exportSurface(colorSolid ? colix : 0);
   }
 
+  private int getDiameter() {
+    int diam;
+    if (mesh.diameter <= 0) {
+      diam = (meshScale < 0 ? meshScale = vwr.getInt(T.meshscale)
+          : meshScale);
+      if (antialias)
+        diam *= 2;
+    } else {
+      diam = vwr.getScreenDim() / 100;
+    }
+    if (diam < 1)
+      diam = 1;
+    return diam;
+  }
+
   private void renderNormals() {
     if (!g3d.setC(C.copyColixTranslucency(mesh.colix, C.WHITE)))
       return;

Modified: trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-02-08 18:37:51 UTC 
(rev 20273)
+++ trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-02-08 18:38:27 UTC 
(rev 20274)
@@ -4380,10 +4380,8 @@
   }
 
   private String getIsosurfaceJvxl(boolean asMesh, int iShape) {
-    if (chk)
-      return "";
-    return (String) getShapeProperty(iShape, asMesh ? "jvxlMeshX"
-        : "jvxlDataXml");
+    return (chk ? "" : (String) getShapeProperty(iShape, asMesh ? "jvxlMeshX"
+        : "jvxlDataXml"));
   }
 
   @SuppressWarnings("unchecked")
@@ -4534,14 +4532,6 @@
     return nmax == 1 && !isExplicitlyAll ? sout[0] : (Object) sout;
   }
 
-  boolean listIsosurface(int iShape) throws ScriptException {
-    String s = (slen > 3 ? "0" : tokAt(2) == T.nada ? "" : " "
-        + getToken(2).value);
-    if (!chk)
-      showString((String) getShapeProperty(iShape, "list" + s));
-    return true;
-  }
-
   protected String setShapeId(int iShape, int i, boolean idSeen)
       throws ScriptException {
       if (idSeen)

Modified: trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-02-08 18:37:51 UTC 
(rev 20273)
+++ trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-02-08 18:38:27 UTC 
(rev 20274)
@@ -3649,5 +3649,13 @@
     return null;
   }
 
+  private boolean listIsosurface(int iShape) throws ScriptException {
+    String s = (slen > 3 ? "0" : tokAt(2) == T.nada ? "" : " "
+        + getToken(2).value);
+    if (!chk)
+      showString((String) getShapeProperty(iShape, "list" + s));
+    return true;
+  }
 
+
 }

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-08 18:37:51 UTC 
(rev 20273)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-08 18:38:27 UTC 
(rev 20274)
@@ -17,6 +17,7 @@
 
 Jmol.___JmolVersion="14.3.12_2015.02.07"
 
+bug fix: set meshScale is not being applied to isosurface contours
 bug fix: zoomTo{xxx} 0  does not center (broken in 13.1.16_dev_2013.05.23)
 bug fix: appending a model to a model with data can fail
 bug fix: 02.04 select conformation=1 broken

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to