Revision: 20852
          http://sourceforge.net/p/jmol/code/20852
Author:   hansonr
Date:     2015-10-30 12:08:02 +0000 (Fri, 30 Oct 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.4.0_2015.10.30"

bug fix: polyhedron volume will be incorrect if there is a 
         face triangle that has no edges visible (requires a six or more sided 
face)  

bug fix: nested if...{...if... } else {...} gives compiler syntax error:

  if (i=1) {
    print "i=1"
    if (j=1)
      print "j != 1" 
  } else {                // } closes if (j=1) instead of if (i=1) {
    print "i != 1"
  }

bug fix: empty format crashes Jmol --  print "testing".format("")
bug fix: after CALCULATE HYDROGENS TRUE and then deleting hydrogens, hydrogens 
are not added to aromatic rings in PDB models
bug fix: reading saved state after adding hydrogen atoms results in infinite 
loop

Modified Paths:
--------------
    branches/v14_4/Jmol/src/org/jmol/modelset/BondCollection.java
    branches/v14_4/Jmol/src/org/jmol/modelsetbio/BioModel.java
    branches/v14_4/Jmol/src/org/jmol/script/SV.java
    branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java
    branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java
    branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedron.java
    branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: branches/v14_4/Jmol/src/org/jmol/modelset/BondCollection.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/modelset/BondCollection.java       
2015-10-30 12:07:20 UTC (rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/modelset/BondCollection.java       
2015-10-30 12:08:02 UTC (rev 20852)
@@ -493,17 +493,17 @@
         }
       }
     // now test non-O atoms
-    for (int i = bsTest.nextSetBit(0); i >= 0; i = bsTest.nextSetBit(i + 1)) {
-      bond = bo[i];
-      if (!assignAromaticDouble(bond))
+    for (int i = bsTest.nextSetBit(0); i >= 0; i = bsTest.nextSetBit(i + 1))
+      if (!assignAromaticDouble(bond = bo[i]))
         assignAromaticSingle(bond);
-    }
     // all done: do the actual assignments and clear arrays.
+    BS bsModels = new BS();
     for (int i = i0; i >= 0; i = (isAll ? i - 1 : bsBonds.nextSetBit(i + 1))) {
         bond = bo[i];
         if (bsAromaticDouble.get(i)) {
           if (!bond.is(Edge.BOND_AROMATIC_DOUBLE)) {
             bsAromatic.set(i);
+            bsModels.set(bond.atom1.mi);
             bond.setOrder(Edge.BOND_AROMATIC_DOUBLE);
           }
         } else if (bsAromaticSingle.get(i) || bond.isAromatic()) {
@@ -513,6 +513,10 @@
           }
         }
       }
+    Model[] models = ((ModelSet) this).am;
+    for (int i = bsModels.nextSetBit(0); i >= 0; i = bsModels.nextSetBit(i + 
1))
+      if (models[i].isBioModel)
+        models[i].isPdbWithMultipleBonds = true;
 
     assignAromaticNandO(bsBonds);
 

Modified: branches/v14_4/Jmol/src/org/jmol/modelsetbio/BioModel.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/modelsetbio/BioModel.java  2015-10-30 
12:07:20 UTC (rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/modelsetbio/BioModel.java  2015-10-30 
12:08:02 UTC (rev 20852)
@@ -121,10 +121,10 @@
     Atom[] at = ms.at;
     Model[] am = ms.am;
     for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
-      if (iLast != i - 1)
-        monomerIndexCurrent = -1;
+      if (at[i].group.isAdded(i))
+        continue;
       monomerIndexCurrent = at[i].group.setProteinStructureType(type,
-          monomerIndexCurrent);
+          iLast == i - 1 ? -1 : monomerIndexCurrent);
       int modelIndex = at[i].mi;
       ms.proteinStructureTainted = am[modelIndex].structureTainted = true;
       iLast = i = at[i].group.lastAtomIndex;
@@ -136,10 +136,14 @@
         i = am[modelIndex].firstAtomIndex + am[modelIndex].act;
         continue;
       }
-      iLast = at[i].group.getStrucNo();
-      if (iLast < 1000 && iLast > lastStrucNo[modelIndex])
-        lastStrucNo[modelIndex] = iLast;
-      i = at[i].group.lastAtomIndex + 1;
+      Group g = at[i].group;
+      if (!g.isAdded(i)) {
+        iLast = g.getStrucNo();
+        if (iLast < 1000 && iLast > lastStrucNo[modelIndex])
+          lastStrucNo[modelIndex] = iLast;
+        i = g.lastAtomIndex;
+      }
+      i++;
     }
     for (int i = 0; i < ms.ac;) {
       int modelIndex = at[i].mi;
@@ -147,9 +151,13 @@
         i = am[modelIndex].firstAtomIndex + am[modelIndex].act;
         continue;
       }
-      if (at[i].group.getStrucNo() > 1000)
-        at[i].group.setStrucNo(++lastStrucNo[modelIndex]);
-      i = at[i].group.lastAtomIndex + 1;
+      Group g = at[i].group;
+      if (!g.isAdded(i)) {
+        i = g.lastAtomIndex;
+        if (g.getStrucNo() > 1000)
+          g.setStrucNo(++lastStrucNo[modelIndex]);
+      }
+      i++;
     }
   }
 

Modified: branches/v14_4/Jmol/src/org/jmol/script/SV.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/SV.java     2015-10-30 12:07:20 UTC 
(rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/script/SV.java     2015-10-30 12:08:02 UTC 
(rev 20852)
@@ -1284,8 +1284,10 @@
       }
     }
     // use values to replace codes in format string
+    String[] format = PT.split(PT.rep(sValue(args[0]), "%%", "\1"), "%");
+    if (format.length == 0)
+      return "";
     SB sb = new SB();
-    String[] format = PT.split(PT.rep(sValue(args[0]), "%%", "\1"), "%");
     sb.append(format[0]);
     for (int i = 1; i < format.length; i++) {
       Object ret = sprintf(PT.formatCheck("%" + format[i]),

Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-10-30 
12:07:20 UTC (rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-10-30 
12:08:02 UTC (rev 20852)
@@ -143,7 +143,7 @@
   private String ident, identLC;
   private Lst<T> vPush = new Lst<T>();
   private int pushCount;
-  private ScriptFlowContext lastFlowContext;
+  private ScriptFlowContext forceFlowContext;
 
   synchronized ScriptContext compile(String filename, String script,
                                      boolean isPredefining, boolean isSilent,
@@ -333,7 +333,7 @@
       isEndOfCommand = false;
       needRightParen = false;
       lastFlowCommand = null;
-      lastFlowContext = null;
+      forceFlowContext = null;
 
       theTok = T.nada;
       short iLine = 1;
@@ -731,7 +731,7 @@
           if (lastFlowCommand.tok != T.process && (tokAt(0) == T.leftbrace))
             ltoken.remove(0);
           lastFlowCommand = null;
-          lastFlowContext = flowContext;
+          forceFlowContext = flowContext;
 //          lastFlowImplicitEnd = flowContext.nextFlowImplicitEnd;
         }
       }
@@ -823,7 +823,7 @@
         } else if (n > 0 && !haveENDIF || isOneLine) {
           forceFlowEnd(flowContext.token);
           if (!isOneLine) {
-            lastFlowContext.forceEndIf = true;
+            forceFlowContext.forceEndIf = true;
           }
         }
         isEndOfCommand = true;
@@ -1542,12 +1542,12 @@
         // specifically for else {  but not elseIf ( ) {
         isEndOfCommand = true;
         ScriptFlowContext f = (flowContext != null && flowContext.addLine == 0 
-            || lastFlowContext == null ? flowContext : lastFlowContext);
+            || forceFlowContext == null ? flowContext : forceFlowContext);
         if (f != null) {
           f.addLine = 0;
           f.forceEndIf = false;
           lastToken = T.tokenLeftBrace;
-          lastFlowContext = f;
+          forceFlowContext = f;
        }
         return CONTINUE;
       }
@@ -1684,10 +1684,10 @@
         // unexpectedly allows if (x) { print x else print y}
         fixFlowAddLine(flowContext);
         if (lltoken.get(iCommand - 1)[0].tok == T.end
-            && lastFlowContext != null && lastFlowContext.forceEndIf
-            && lastFlowContext.addLine > 0
-            && isFlowIfContextOK(lastFlowContext)) {
-          flowContext = lastFlowContext;
+            && forceFlowContext != null && forceFlowContext.forceEndIf
+            && forceFlowContext.addLine > 0
+            && isFlowIfContextOK(forceFlowContext)) {
+          flowContext = forceFlowContext;
           flowContext.forceEndIf = true;
           lltoken.remove(--iCommand);
         } else if (flowContext != null && flowContext.addLine > 0) {
@@ -2152,7 +2152,7 @@
   }
   private int forceFlowEnd(T token) {
     T t0 = tokenCommand;
-    lastFlowContext = flowContext;
+    forceFlowContext = flowContext;
     token = flowStart(token);
     if (!checkFlowEnd(token.tok, (String) token.value, ichBrace, false))
       return ERROR;

Modified: branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java        
2015-10-30 12:07:20 UTC (rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java        
2015-10-30 12:08:02 UTC (rev 20852)
@@ -735,7 +735,7 @@
    * 
    * @param points
    * @param nPoints
-   * @param planes
+   * @param triangles
    * @param normals
    * @param index
    * @param pTemp
@@ -747,12 +747,12 @@
    * @param bsTemp
    * @return true if valid
    */
-  private boolean checkFace(P3[] points, int nPoints, int[][] planes,
+  private boolean checkFace(P3[] points, int nPoints, int[][] triangles,
                             V3[] normals, int index, P4 pTemp, V3 vNorm,
                             V3 vAC, Map<Integer, Object[]> htNormMap,
                             Map<String, Object> htEdgeMap, float planarParam,
                             BS bsTemp) {
-    int[] p1 = planes[index];
+    int[] p1 = triangles[index];
 
     // Check here for a 3D convex hull:
     int i0 = p1[0];

Modified: branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedron.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedron.java       
2015-10-30 12:07:20 UTC (rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedron.java       
2015-10-30 12:08:02 UTC (rev 20852)
@@ -243,10 +243,7 @@
     if (bsFlat.cardinality() < triangles.length)
       for (int i = triangles.length; --i >= 0;) {
         int[] face = triangles[i];
-        for (int j = face.length - 2; --j >= 0;)
-          if (face[j + 2] >= 0)
-            v += triangleVolume(face[j], face[j + 1], face[j + 2], vAB, vAC,
-                vTemp);
+        v += triangleVolume(face[0], face[1], face[2], vAB, vAC, vTemp);
       }
     return Float.valueOf(v / 6);
   }

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties     2015-10-30 
12:07:20 UTC (rev 20851)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties     2015-10-30 
12:08:02 UTC (rev 20852)
@@ -7,8 +7,28 @@
 
 # see also http://chemapps.stolaf.edu/jmol/zip for daily updates
        
-Jmol.___JmolVersion="14.4.0_2015.10.28"
+Jmol.___JmolVersion="14.4.0_2015.10.30"
 
+bug fix: polyhedron volume will be incorrect if there is a 
+         face triangle that has no edges visible (requires a six or more sided 
face)  
+
+bug fix: nested if...{...if... } else {...} gives compiler syntax error:
+
+  if (i=1) {
+    print "i=1"
+    if (j=1)
+      print "j != 1" 
+  } else {                // } closes if (j=1) instead of if (i=1) {
+    print "i != 1"
+  }
+
+bug fix: empty format crashes Jmol --  print "testing".format("")
+bug fix: after CALCULATE HYDROGENS TRUE and then deleting hydrogens, hydrogens 
are not added to aromatic rings in PDB models
+bug fix: reading saved state after adding hydrogen atoms results in infinite 
loop
+
+
+JmolVersion="14.4.0_2015.10.28"
+
 bug fix: XODYDATA file reader does not read bond info or formal charge // 
changes in 14.4.0_2015.10.28
 
 JmolVersion="14.4.0_2015.10.24"

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


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to