Revision: 5155
Author:   hansonr
Date:     2006-05-21 21:31:05 -0700 (Sun, 21 May 2006)
ViewCVS:  http://svn.sourceforge.net/jmol/?rev=5155&view=rev

Log Message:
-----------
bob200603 10.x.05 isosurface data dump to System.out --  preliminary only

Modified Paths:
--------------
    branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java
Modified: branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java
===================================================================
--- branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java 2006-05-21 
16:42:36 UTC (rev 5154)
+++ branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java 2006-05-22 
04:31:05 UTC (rev 5155)
@@ -286,10 +286,16 @@
       return (negativeAtomCount ? parseInt(br.readLine()) : 1);
   }
 
+  boolean collectData = true;
   void readVoxelData(BufferedReader br) throws Exception {
     System.out.println("entering readVoxelData for fileIndex = " + fileIndex);
     String line = "";
     ichNextParse = 0;
+    boolean inside = false;
+    int dataCount = 0;
+    String data = "";
+    int nBytes = 0;
+    int nDataPoints = 1;
     int voxelCountX = voxelCounts[0];
     int voxelCountY = voxelCounts[1];
     int voxelCountZ = voxelCounts[2];
@@ -309,14 +315,31 @@
               System.out.println("end of file in CubeReader?");
               throw new NullPointerException();
             }
+            nBytes += line.length() + 1;
           }
           strip[z] = voxelValue;
+          if (collectData) {
+            boolean isInside = ((cutoff > 0 && voxelValue >= cutoff) || 
+                (cutoff < 0 && voxelValue <= cutoff));
+            if (inside == isInside) {
+              dataCount++;
+            } else {
+              data += " " + dataCount;
+              ++nDataPoints;
+              dataCount = 1;
+              inside = !inside;
+            }
+          }
         }
       }
     }
-    System.out.println("Successfully read " + voxelCountX +
-                       " x " + voxelCountY +
-                       " x " + voxelCountZ + " voxels");
+    if (collectData) {
+      data += " " + dataCount;
+      System.out.println("cutoff " + cutoff + " bytes " + data.length() 
+          + " compressionRatio " + (nBytes * 1f / data.length()) + "\n" + 
nDataPoints + data);
+    }
+    System.out.println("Successfully read " + voxelCountX + " x " + voxelCountY
+        + " x " + voxelCountZ + " voxels");
   }
 
   void skipData(BufferedReader br, int n) throws Exception {


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



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to