Revision: 20395
          http://sourceforge.net/p/jmol/code/20395
Author:   hansonr
Date:     2015-03-21 02:11:19 +0000 (Sat, 21 Mar 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.13_2015.03.20b"

bug fix: popup menu Symmetry broken
bug fix: PDB reader does not save unit cell on simple load

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java
    trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java
    trunk/Jmol/src/org/jmol/modelset/ModelLoader.java
    trunk/Jmol/src/org/jmol/modelset/ModelSet.java
    trunk/Jmol/src/org/jmol/popup/JmolGenericPopup.java
    trunk/Jmol/src/org/jmol/script/ScriptEval.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java  2015-03-19 
23:42:09 UTC (rev 20394)
+++ trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java  2015-03-21 
02:11:19 UTC (rev 20395)
@@ -422,6 +422,7 @@
   
   protected void finalizeReaderPDB() throws Exception {
     checkNotPDB();
+    checkUnitCellParams();
     if (!isCourseGrained)
       connectAll(maxSerial, isConnectStateBug);
     SymmetryInterface symmetry;
@@ -474,6 +475,14 @@
     }
   }
 
+  private void checkUnitCellParams() {
+    if (iHaveUnitCell) {
+      asc.setCurrentModelInfo("unitCellParams", unitCellParams);
+      if (sgName != null)
+        asc.setCurrentModelInfo("spaceGroup", sgName);
+    }
+  }
+
   private void checkForResidualBFactors(SymmetryInterface symmetry) {
     Atom[] atoms = asc.atoms;
     boolean isResidual = false;
@@ -1317,6 +1326,7 @@
     haveMappedSerials = false;
     sbConect = null;
     asc.newAtomSet();
+    checkUnitCellParams();
     if (!isCourseGrained)
       setModelPDB(true);
     asc.setCurrentAtomSetNumber(modelNumber);
@@ -1343,7 +1353,7 @@
       a = Float.NaN; // 1 for a means no unit cell
     setUnitCell(a, getFloat(15, 9), getFloat(24, 9), getFloat(33,
         7), getFloat(40, 7), getFloat(47, 7));
-    if (sgName == null)
+    if (sgName == null || sgName.equals("unspecified!"))
       setSpaceGroupName(PT.parseTrimmedRange(line, 55, 66));
   }
 

Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java        
2015-03-19 23:42:09 UTC (rev 20394)
+++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java        
2015-03-21 02:11:19 UTC (rev 20395)
@@ -1112,12 +1112,10 @@
     v.set(x3, y3, z3);
     v.normalize();
     matRot.setColumnV(2, v);
-    asc.setInfo(
-        "defaultOrientationMatrix", M3.newM3(matRot));
+    asc.setInfo("defaultOrientationMatrix", M3.newM3(matRot));
     // first two matrix column vectors define quaternion X and XY plane
     Quat q = Quat.newM(matRot);
-    asc.setInfo(
-        "defaultOrientationQuaternion", q);
+    asc.setInfo("defaultOrientationQuaternion", q);
     Logger.info("defaultOrientationMatrix = " + matRot);
 
   }
@@ -1182,12 +1180,10 @@
       for (int i = name.length(); --i >= 0;)
         if (!PT.isLetterOrDigit(ch = name.charAt(i)) && ch != '\'')
           name = name.substring(0, i) + "_" + name.substring(i + 1);
-      //String seqNum = (String) htSite.get("seqNum");
       String groups = (String) htSite.get("groups");
       if (groups.length() == 0)
         continue;
       addSiteScript("@site_" + name + " " + groups);
-      //addJmolScript("@" + seqNum + " " + groups);
       addSiteScript("site_" + name + " = [\"" + PT.rep(groups, ",", "\",\"") + 
"\"]");
       sites += ",\"site_" + name + "\"";
     }
@@ -1216,9 +1212,8 @@
       moreUnitCellInfo = null;
     }
     finalizeSubclassSymmetry(sym != null);
-    if (sym != null && ptSupercell != null) {
+    if (sym != null && ptSupercell != null)
       asc.getXSymmetry().finalizeUnitCell(ptSupercell);
-    }
     initializeSymmetry();
     return sym;
   }

Modified: trunk/Jmol/src/org/jmol/modelset/ModelLoader.java
===================================================================
--- trunk/Jmol/src/org/jmol/modelset/ModelLoader.java   2015-03-19 23:42:09 UTC 
(rev 20394)
+++ trunk/Jmol/src/org/jmol/modelset/ModelLoader.java   2015-03-21 02:11:19 UTC 
(rev 20395)
@@ -1122,8 +1122,6 @@
         if (modelBondCount < 0) {
           modelBondCount = ms.bondCount;
         }
-        boolean modelHasSymmetry = ms.getInfoB(i,
-            "hasSymmetry");
         // check for PDB file with fewer than one bond per every two atoms
         // this is in case the PDB format is being usurped for non-RCSB uses
         // In other words, say someone uses the PDB format to indicate atoms 
and
@@ -1135,12 +1133,8 @@
         // automatic bonding, and additional bonds might be made.
         boolean doBond = (forceAutoBond || doAutoBond
             && (modelBondCount == 0
-                || modelIsPDB
-                && jmolData == null
-                && (ms
-                    .getMSInfoB("havePDBHeaderName") || modelBondCount < 
modelAtomCount / 2) || modelHasSymmetry
-                && !symmetryAlreadyAppliedToBonds
-                && !ms.getInfoB(i, "hasBonds")));
+                || modelIsPDB && jmolData == null && 
(ms.getMSInfoB("havePDBHeaderName") || modelBondCount < modelAtomCount / 2) 
+                || ms.getInfoB(i, "hasSymmetry") && 
!symmetryAlreadyAppliedToBonds && !ms.getInfoB(i, "hasBonds")));
         if (!doBond)
           continue;
         autoBonding = true;

Modified: trunk/Jmol/src/org/jmol/modelset/ModelSet.java
===================================================================
--- trunk/Jmol/src/org/jmol/modelset/ModelSet.java      2015-03-19 23:42:09 UTC 
(rev 20394)
+++ trunk/Jmol/src/org/jmol/modelset/ModelSet.java      2015-03-21 02:11:19 UTC 
(rev 20395)
@@ -904,11 +904,23 @@
   }
 
   public SymmetryInterface getUnitCell(int modelIndex) {
-    return (!haveUnitCells || modelIndex < 0 || modelIndex >= mc ? null
-        : am[modelIndex].simpleCage != null ? am[modelIndex].simpleCage
-            : unitCells == null || modelIndex >= unitCells.length
-                || !unitCells[modelIndex].haveUnitCell() ? null
-                : unitCells[modelIndex]);
+    if (modelIndex < 0 || modelIndex >= mc)
+      return null;
+    if (am[modelIndex].simpleCage != null)
+      return am[modelIndex].simpleCage;
+    if (unitCells != null && modelIndex < unitCells.length
+                && unitCells[modelIndex].haveUnitCell())
+      return unitCells[modelIndex];
+    if (getInfo(modelIndex, "unitCellParams") != null) {
+      if (unitCells == null)
+        unitCells = new SymmetryInterface[mc];
+      getSymTemp(true).setSymmetryInfo(modelIndex, 
am[modelIndex].auxiliaryInfo, null);
+      SymmetryInterface unitCell = symTemp;
+      symTemp = null;
+      haveUnitCells = true;
+      return unitCells[modelIndex] = unitCell;              
+    }
+    return null;
   }
 
   public void setModelCage(int modelIndex, SymmetryInterface simpleCage) {

Modified: trunk/Jmol/src/org/jmol/popup/JmolGenericPopup.java
===================================================================
--- trunk/Jmol/src/org/jmol/popup/JmolGenericPopup.java 2015-03-19 23:42:09 UTC 
(rev 20394)
+++ trunk/Jmol/src/org/jmol/popup/JmolGenericPopup.java 2015-03-21 02:11:19 UTC 
(rev 20395)
@@ -105,7 +105,7 @@
   private boolean isMultiConfiguration;
   private boolean isMultiFrame;
   private boolean isPDB;
-  private boolean isSymmetry;
+  private boolean hasSymmetry;
   private boolean isUnitCell;
   private boolean isVibration;
   private boolean isZapped;
@@ -377,7 +377,7 @@
       modelInfo = new Hashtable<String, Object>();
     isPDB = checkBoolean("isPDB");
     isMultiFrame = (modelCount > 1);
-    isSymmetry = checkBoolean("hasSymmetry");
+    hasSymmetry = modelInfo.containsKey("hasSymmetry");
     isUnitCell = modelInfo.containsKey("unitCellParams");
     fileHasUnitCell = (isPDB && isUnitCell || checkBoolean("fileHasUnitCell"));
     isLastFrame = (modelIndex == modelCount - 1);
@@ -604,7 +604,7 @@
     for (int i = VibrationOnly.size(); --i >= 0;)
       menuEnable(VibrationOnly.get(i), isVibration);
     for (int i = SymmetryOnly.size(); --i >= 0;)
-      menuEnable(SymmetryOnly.get(i), isSymmetry && isUnitCell);
+      menuEnable(SymmetryOnly.get(i), hasSymmetry && isUnitCell);
     for (int i = ChargesOnly.size(); --i >= 0;)
       menuEnable(ChargesOnly.get(i), haveCharges);
     for (int i = TemperatureOnly.size(); --i >= 0;)
@@ -722,7 +722,7 @@
       return;
     menuRemoveAll(menu, 0);
     menuEnable(menu, false);
-    if (!isSymmetry || modelIndex < 0)
+    if (!hasSymmetry || modelIndex < 0)
       return;
     Map<String, Object> info = (Map<String, Object>) vwr.getProperty(
         "DATA_API", "spaceGroupInfo", null);
@@ -763,7 +763,7 @@
       return;
     menuRemoveAll(menu, 0);
     menuEnable(menu, false);
-    if (!isSymmetry || modelIndex < 0)
+    if (!hasSymmetry || modelIndex < 0)
       return;
     String[] list = (String[]) modelInfo.get("symmetryOperations");
     if (list == null)

Modified: trunk/Jmol/src/org/jmol/script/ScriptEval.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptEval.java      2015-03-19 23:42:09 UTC 
(rev 20394)
+++ trunk/Jmol/src/org/jmol/script/ScriptEval.java      2015-03-21 02:11:19 UTC 
(rev 20395)
@@ -5381,7 +5381,7 @@
         q = Quat.new4(0, 0, 0, 1);
         break;
       default:
-         // a b c x y z
+         // a b c
         SymmetryInterface uc;
         uc = vwr.getCurrentUnitCell();
         if (uc == null) {

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-03-19 23:42:09 UTC 
(rev 20394)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-03-21 02:11:19 UTC 
(rev 20395)
@@ -14,8 +14,13 @@
 
 TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT 
command for problems)
 
-Jmol.___JmolVersion="14.3.13_2015.03.20"
+Jmol.___JmolVersion="14.3.13_2015.03.20b"
 
+bug fix: popup menu Symmetry broken
+bug fix: PDB reader does not save unit cell on simple load
+
+JmolVersion="14.3.13_2015.03.20"
+
 bug fix: use of {*}.xxxx = for(i;{*};....) fails
 
 JmolVersion="14.3.13_2015.03.19"

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