Revision: 18451
          http://sourceforge.net/p/jmol/code/18451
Author:   hansonr
Date:     2013-07-18 08:23:36 +0000 (Thu, 18 Jul 2013)
Log Message:
-----------
___JmolVersion="13.1.19_dev_2013.07.18"

bug fix: JSmol menu not disappearing upon touch outside menu

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/jvxl/readers/PyMOLMeshReader.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/jvxl/readers/PyMOLMeshReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/jvxl/readers/PyMOLMeshReader.java   2013-07-17 
03:53:50 UTC (rev 18450)
+++ trunk/Jmol/src/org/jmol/jvxl/readers/PyMOLMeshReader.java   2013-07-18 
08:23:36 UTC (rev 18451)
@@ -32,8 +32,26 @@
 import org.jmol.util.SB;
 
 
+/**
+ * A reader for PyMOL PSE file ObjectMap data
+ * 
+ * From PyMOL/layer2/ObjectMap.h: in order to achieve better backwards 
compatibility
+ * with session files, future map source should be either:
+ * cMapSourceCrystallographic or cMapSourceGeneralPurpose
+ */
 class PyMOLMeshReader extends MapFileReader {
 
+  final static int cMapSourceCrystallographic = 1;
+  final static int cMapSourceCCP4 = 2;
+  final static int cMapSourceGeneralPurpose = 3;
+  final static int cMapSourceDesc = 4;
+  final static int cMapSourceFLD = 5;
+  final static int cMapSourceBRIX = 6;
+  final static int cMapSourceGRD = 7;
+  final static int cMapSourceChempyBrick = 8;
+  final static int cMapSourceVMDPlugin = 9;
+  final static int cMapSourceObsolete = 10;
+  
   private Hashtable<String, JmolList<Object>> map;
   private JmolList<Object> data;
   private JmolList<Object> surfaceList;
@@ -42,6 +60,7 @@
   private int pymolType;
   private boolean isMesh;
   //private float cutoff = Float.NaN;
+  private int pymolState; // not nec. 0, but assuming that here.
 
   /*
    * PyMOL surface/mesh reader. 
@@ -87,64 +106,81 @@
 
   @Override
   protected void readParameters() throws Exception {
-    
+
     JmolList<Object> t;
 
     jvxlFileHeaderBuffer = new SB();
     jvxlFileHeaderBuffer.append("PyMOL surface reader\n");
-    jvxlFileHeaderBuffer.append(surfaceName + " (" + params.calculationType + 
")\n");
+    jvxlFileHeaderBuffer.append(surfaceName + " (" + params.calculationType
+        + ")\n");
 
+    // extentMin
+    t = getList(surfaceList, 7);
+    origin.set(getFloat(t, 0), getFloat(t, 1), getFloat(t, 2));
+
+    
+    // extentMax
+    t = getList(surfaceList, 8);
+    a = getFloat(t, 0) - origin.x;
+    b = getFloat(t, 1) - origin.y;
+    c = getFloat(t, 2) - origin.z;
+
     // cell parameters
     JmolList<Object> s = getList(surfaceList, 1);
     t = getList(s, 0);
     // change in format between PyMOL versions
-    if (t.size() < 3)
-      t = getList(s = getList(s, 0), 0);
-    a = getFloat(t, 0);
-    b = getFloat(t, 1);
-    c = getFloat(t, 2);
-    t = getList(s, 1);
-    alpha = getFloat(t, 0);
-    beta = getFloat(t, 1);
-    gamma = getFloat(t, 2);
+    // with PyMOL 1.6 allowing multiple crystal defs??
+
+    if (t == null) {
+      alpha = 1;
+    } else {
+      try {
+        getFloat(t, 0);
+      } catch (Exception e) {
+        // just pick up first crystal data
+        t = getList(s = getList(s, 0), 0);
+      }
+      // these seem to be irrelevant
+      //a = getFloat(t, 0);
+      //b = getFloat(t, 1);
+      //c = getFloat(t, 2);
+      t = getList(s, 1);
+      alpha = getFloat(t, 0);
+      beta = getFloat(t, 1);
+      gamma = getFloat(t, 2);
+    }
+    if (alpha == 1)
+      alpha = beta = gamma = 90;
+
+
+    // ignoring I->Div for now
     
-    // origin
-    t = getList(surfaceList, 7);    
-    origin.set(getFloat(t, 0), getFloat(t, 1), getFloat(t, 2));
-      
-    // unit cell vectors in grid counts
-    t = getList(surfaceList, 10);
-    na = (int) getFloat(t, 0);
-    nb = (int) getFloat(t, 1);
-    nc = (int) getFloat(t, 2);
+//    t = getList(surfaceList, 10); // I->Div
+//    ?? = (int) getFloat(t, 0);
+//    ?? = (int) getFloat(t, 1);
+//    ?? = (int) getFloat(t, 2);
+    
     // data block start and extents in grid units
-    t = getList(surfaceList, 11);
+    t = getList(surfaceList, 11); // I->Min
     nxyzStart[0] = (int) getFloat(t, 0);
     nxyzStart[1] = (int) getFloat(t, 1);
     nxyzStart[2] = (int) getFloat(t, 2);
-    
+
     // number of grid points
     // will end up with xyz, but we use zyx because of the storage
-    t = getList(surfaceList, 13);
+    t = getList(surfaceList, 13); // I->FDim
     nz = (int) getFloat(t, 0);
     ny = (int) getFloat(t, 1);
     nx = (int) getFloat(t, 2);
 
-    if (na < 0 || nb < 0 || nc < 0) {
-      na = nz - 1;
-      nb = ny - 1;
-      nc = nx - 1;
-      t = getList(surfaceList, 8);
-      a = getFloat(t, 0) - origin.x;
-      b = getFloat(t, 1) - origin.y;
-      c = getFloat(t, 2) - origin.z;
-    }
-    
-    
+    na = nz - 1;
+    nb = ny - 1;
+    nc = nx - 1;
+
     mapc = 3; // fastest
     mapr = 2;
     maps = 1; // slowest
-    
+
     getVectorsAndOrigin();
     setCutoffAutomatic();
 

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2013-07-17 03:53:50 UTC 
(rev 18450)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2013-07-18 08:23:36 UTC 
(rev 18451)
@@ -9,8 +9,11 @@
 #  The quotes above look odd for a parameter file, but they are 
 #  important for the JavaScript version of Jmol.
 
-___JmolVersion="13.1.19_dev_2013.07.16"
+___JmolVersion="13.1.19_dev_2013.07.18"
 
+bug fix: JSmol menu not disappearing upon touch outside menu
+bug fix: PyMOL surface map reading error
+
 new feature: set exportScale x.x
  -- adjusts export scale 
  -- only implemented for VRML and X3D exporters

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


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to