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

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

Modified Paths:
--------------
    branches/v14_2/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java
    branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: branches/v14_2/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java      
2015-02-08 03:22:38 UTC (rev 20272)
+++ branches/v14_2/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java      
2015-02-08 18:37:51 UTC (rev 20273)
@@ -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: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-02-08 
03:22:38 UTC (rev 20272)
+++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-02-08 
18:37:51 UTC (rev 20273)
@@ -7,6 +7,7 @@
 
 Jmol.___JmolVersion="14.2.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: hydrogen addition should not follow component file

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