Revision: 20301
          http://sourceforge.net/p/jmol/code/20301
Author:   hansonr
Date:     2015-02-18 00:44:51 +0000 (Wed, 18 Feb 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.2.12_2015.02.17b"

bug fix: writing to PNGJ data to .ZIP file should create a standard ZIP file.
  -- especially useful now that some zip readers will not open PNGJ files as 
zip files
     (with newer 7zip you can right-click file, then select 7zip...open 
archive...zip)
  
  var x = load("t.png", true)
  write var x "t.zip"
   
 
bug fix: VASP POSCAR fix for atom symbols in header line

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/adapter/readers/xtal/VaspPoscarReader.java
    trunk/Jmol/src/org/jmol/script/ScriptEval.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
    trunk/Jmol/src/org/jmol/viewer/OutputManager.java

Modified: trunk/Jmol/src/org/jmol/adapter/readers/xtal/VaspPoscarReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/readers/xtal/VaspPoscarReader.java  
2015-02-17 12:02:59 UTC (rev 20300)
+++ trunk/Jmol/src/org/jmol/adapter/readers/xtal/VaspPoscarReader.java  
2015-02-18 00:44:51 UTC (rev 20301)
@@ -11,15 +11,16 @@
  * http://cms.mpi.univie.ac.at/vasp/
  * 
  * @author Pieremanuele Canepa, Wake Forest University, Department of Physics
- *         Winston Salem, NC 27106, cane...@wfu.edu
+ *         Winston Salem, NC 27106, cane...@wfu.edu (pcan...@mit.edu)
  * 
  * @version 1.0
  */
 
 public class VaspPoscarReader extends AtomSetCollectionReader {
 
-  private Lst<String> atomLabels = new Lst<String>();
+  private Lst<String> atomLabels;
   private int ac;
+  private String title;
 
   @Override
   protected void initializeReader() throws Exception {
@@ -31,7 +32,7 @@
   }
 
   private void readJobTitle() throws Exception {
-    asc.setAtomSetName(rd().trim());
+    asc.setAtomSetName(title = rd().trim());
   }
 
   private void readUnitCellVectors() throws Exception {
@@ -51,10 +52,21 @@
 
   private void readMolecularFormula() throws Exception {
     //   H    C    O    Be   C    H
-    String elementLabel[] = PT.getTokens(discardLinesUntilNonBlank());
+    String[] elementLabel = PT.getTokens(discardLinesUntilNonBlank());
+    String[] elementCounts;
+    if (PT.parseInt(elementLabel[0]) == Integer.MIN_VALUE) {
+      elementCounts = PT.getTokens(rd());
     //   6    24    18     6     6    24
-    String elementCounts[] = PT.getTokens(rd());
+    } else {
+      elementCounts = elementLabel;
+      elementLabel = PT.split(title, " ");
+      if (elementLabel.length != elementCounts.length) {
+        elementLabel = PT.split("Al B C Db Eu F Ga Hf I K Li Mn N O P Ru S Te 
U V W Xe Yb Zn", " ");
+        appendLoadNote("using pseudo atoms Al B C Db...");
+      }
+    }
     SB mf = new SB();
+    atomLabels = new Lst<String>();
     for (int i = 0; i < elementCounts.length; i++) { 
       int n = Integer.parseInt(elementCounts[i]);
       ac += n;
@@ -64,7 +76,7 @@
         atomLabels.addLast(label);
     }
     String s = mf.toString();
-    Logger.info("VaspPoscar reader: " + ac + " atoms identified for" + s);
+    appendLoadNote(ac + " atoms identified for" + s);
     appendLoadNote(s);
     asc.newAtomSet();
     asc.setAtomSetName(s);

Modified: trunk/Jmol/src/org/jmol/script/ScriptEval.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptEval.java      2015-02-17 12:02:59 UTC 
(rev 20300)
+++ trunk/Jmol/src/org/jmol/script/ScriptEval.java      2015-02-18 00:44:51 UTC 
(rev 20301)
@@ -4129,22 +4129,22 @@
         isData = true;
         loadScript.append(" /*data*/ data");
         String key = stringParameter(++i).toLowerCase();
+        int ptVar = key.indexOf("@");
+        if (ptVar >= 0)
+          key = key.replace('@', '_');
         loadScript.append(" ").append(PT.esc(key));
         isAppend = key.startsWith("append");
         doOrient = (key.indexOf("orientation") >= 0);
-        String strModel = (key.indexOf("@") >= 0 ? ""
-            + getParameter(key.substring(key.indexOf("@") + 1), T.string, true)
+        String strModel = (ptVar >= 0 ? ""
+            + getParameter(key.substring(ptVar + 1), T.string, true)
             : paramAsStr(++i));
         strModel = Viewer.fixInlineString(strModel, vwr.getInlineChar());
         htParams.put("fileData", strModel);
         htParams.put("isData", Boolean.TRUE);
         //note: ScriptCompiler will remove an initial \n if present
-        loadScript.appendC('\n');
-        loadScript.append(strModel);
-        if (key.indexOf("@") < 0) {
-          loadScript.append(" end ").append(PT.esc(key));
+        loadScript.appendC('\n').append(strModel).append(" end 
").append(PT.esc(key));
+        if (ptVar < 0)
           i += 2; // skip END "key"
-        }
         break;
       case T.mutate:
         isMutate = isAppend = true;

Modified: trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-02-17 12:02:59 UTC 
(rev 20300)
+++ trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-02-18 00:44:51 UTC 
(rev 20301)
@@ -3411,7 +3411,8 @@
                     break;
                   } else if (key.equals("_IMAGE_")) {
                     v.add(0, key);
-                    v.add(1, bytes);
+                    v.add(1, null);
+                    v.add(2, bytes);
                   } else {
                     v.addLast(key);
                     v.addLast(null);

Modified: trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-02-17 12:02:59 UTC 
(rev 20300)
+++ trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-02-18 00:44:51 UTC 
(rev 20301)
@@ -1936,12 +1936,12 @@
         if (!isIsosurface)
           invArg();
         isCavity = true;
-        if (chk)
-          continue;
         float cavityRadius = (isFloatParameter(i + 1) ? floatParameter(++i)
             : 1.2f);
         float envelopeRadius = (isFloatParameter(i + 1) ? floatParameter(++i)
             : 10f);
+        if (chk)
+          continue;
         if (envelopeRadius > 10f) {
           eval.integerOutOfRange(0, 10);
           return;

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-17 12:02:59 UTC 
(rev 20300)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-18 00:44:51 UTC 
(rev 20301)
@@ -3,7 +3,7 @@
        
 # THIS IS THE DEVELOPMENT TRUNK
 
-# see also http://chemapps.stolaf.edu/jmol/zip for daily updates
+# see also http://chemapps.stolaf.edu/jmol/zip for daily updates       
 
 # Developers: to add a description of changes you have made,
 #  add it on a line below the "Jmol.___JmolVersion=..." line.
@@ -15,11 +15,31 @@
 TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT 
command for problems)
 TODO: add 2D graphics panel for Ramachandran and NBO-style 2D graphics -- send 
to browser as data uri?
 
-Jmol.___JmolVersion="14.2.12_2015.02.17"
+Jmol.___JmolVersion="14.2.12_2015.02.17b"
 
+bug fix: writing to PNGJ data to .ZIP file should create a standard ZIP file.
+  -- especially useful now that some zip readers will not open PNGJ files as 
zip files
+     (with newer 7zip you can right-click file, then select 7zip...open 
archive...zip)
+  
+  var x = load("t.png", true)
+  write var x "t.zip"
+   
+ 
+bug fix: VASP POSCAR fix for atom symbols in header line
+
+JmolVersion="14.2.12_2015.02.17"
+
 new feature: set zshadePower 0
  -- allows examination of depth buffer and writing to image for external 
processing
  
+               set zShadePower 0
+               set zSlab 100
+               set zDepth 0
+               set zShade true
+               write z.jpg
+               set zShade false
+               write rgb.jpg
+
 JmolVersion="14.2.12_2015.02.16"
 
 new feature:  x.dot(y) for planes and points -- was present but undocumented 
and not working correctly

Modified: trunk/Jmol/src/org/jmol/viewer/OutputManager.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/OutputManager.java   2015-02-17 12:02:59 UTC 
(rev 20300)
+++ trunk/Jmol/src/org/jmol/viewer/OutputManager.java   2015-02-18 00:44:51 UTC 
(rev 20301)
@@ -259,12 +259,18 @@
   private boolean createTheImage(Object objImage, String type, OC out,
                                  Map<String, Object> params, String[] errRet) {
     type = type.substring(0, 1) + type.substring(1).toLowerCase();
-    if (type.equals("Zipdata") || type.equals("Binary")) {
+    boolean isZipData = type.equals("Zipdata");
+    if (isZipData || type.equals("Binary")) {
       @SuppressWarnings("unchecked")
       Lst<Object> v = (Lst<Object>) params.get("imageData");
       if (v.size() >= 2 && v.get(0).equals("_IMAGE_")) {
+        if (isZipData) {
+          errRet[0] = writeZipFile(out, v, "OK JMOL", null);
+          return true;          
+        }
         objImage = null;
         v.remove(0);
+        v.remove(0); // also "_IMAGE_"
         params.put("pngImgData", v.remove(0));
         OC oz = getOutputChannel(null, null);
         errRet[0] = writeZipFile(oz, v, "OK JMOL", null);

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


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&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