Revision: 20475
          http://sourceforge.net/p/jmol/code/20475
Author:   hansonr
Date:     2015-05-02 17:47:14 +0000 (Sat, 02 May 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.13_2015.05.02"

bug fix: color atoms property vxyz crashes Jmol if no vibrations
bug fix: with msCIF, select subsystem=1 does not select anything
bug fix: vibrations in trajectories not animating (14.3.6_2014.08.14)

Modified Paths:
--------------
    branches/v14_2/Jmol/src/org/jmol/adapter/readers/cif/MSCifRdr.java
    branches/v14_2/Jmol/src/org/jmol/modelset/JmolBioModelSet.java
    branches/v14_2/Jmol/src/org/jmol/modelset/Model.java
    branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java
    branches/v14_2/Jmol/src/org/jmol/modelsetbio/BioModel.java
    branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java
    branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: branches/v14_2/Jmol/src/org/jmol/adapter/readers/cif/MSCifRdr.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/adapter/readers/cif/MSCifRdr.java  
2015-05-02 17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/adapter/readers/cif/MSCifRdr.java  
2015-05-02 17:47:14 UTC (rev 20475)
@@ -345,15 +345,19 @@
             type_id = "J_O";
           pt[0] = pt[2] = 1;
           //$FALL-THROUGH$
+        case DISP_SPEC_LABEL:
+          if (type_id == null)
+            type_id = "D_S";
+          //$FALL-THROUGH$
+        case SPIN_SPEC_LABEL:
+          if (type_id == null)
+            type_id = "M_T";
+          //$FALL-THROUGH$
         case OCC_SPECIAL_LABEL:
           if (type_id == null)
             type_id = "O_0";
           axis = "0";
           //$FALL-THROUGH$
-        case DISP_SPEC_LABEL:
-          if (type_id == null)
-            type_id = "D_S";
-          //$FALL-THROUGH$
         case LEG_DISP_LABEL:
           if (type_id == null)
             type_id = "D_L";
@@ -366,10 +370,6 @@
           if (type_id == null)
             type_id = "O_L";
           //$FALL-THROUGH$
-        case SPIN_SPEC_LABEL:
-          if (type_id == null)
-            type_id = "M_T";
-          //$FALL-THROUGH$
         case FWV_DISP_LABEL:
         case FWV_OCC_LABEL:
         case FWV_SPIN_LABEL:

Modified: branches/v14_2/Jmol/src/org/jmol/modelset/JmolBioModelSet.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/modelset/JmolBioModelSet.java      
2015-05-02 17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/modelset/JmolBioModelSet.java      
2015-05-02 17:47:14 UTC (rev 20475)
@@ -54,9 +54,6 @@
 
   int getBioPolymerCountInModel(int modelIndex);
 
-  void getConformations(int modelIndex, int conformationIndex,
-                               boolean doSet, BS bsAtoms, BS bsRet);
-
   String getFullProteinStructureState(BS bsAtoms, int mode);
 
   BS getIdentifierOrNull(String identifier);

Modified: branches/v14_2/Jmol/src/org/jmol/modelset/Model.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/modelset/Model.java        2015-05-02 
17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/modelset/Model.java        2015-05-02 
17:47:14 UTC (rev 20475)
@@ -227,6 +227,15 @@
     return null;
   }
 
+  protected BS getConformationBS(int conformationIndex, BS bsSelected) {
+    if (conformationIndex > 0 && conformationIndex >= altLocCount)
+      return null;
+    BS bsConformation = ms.vwr.getModelUndeletedAtomsBitSet(modelIndex);
+    if (bsSelected != null)
+      bsConformation.and(bsSelected);
+    return (bsConformation.nextSetBit(0) < 0 ? null : bsConformation);
+  }
+
   public void fixIndices(int modelIndex, int nAtomsDeleted, BS bsDeleted) {
     // also in BioModel
     fixIndicesM(modelIndex, nAtomsDeleted, bsDeleted);

Modified: branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java     2015-05-02 
17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java     2015-05-02 
17:47:14 UTC (rev 20475)
@@ -1446,10 +1446,6 @@
     return file * 1000000 + model;
   }
 
-  public int getAltLocCountInModel(int modelIndex) {
-    return am[modelIndex].altLocCount;
-  }
-
   public int getChainCountInModelWater(int modelIndex, boolean countWater) {
     if (modelIndex < 0) {
       int chainCount = 0;
@@ -1572,6 +1568,10 @@
 
   //////////////  individual models ////////////////
 
+  public int getAltLocCountInModel(int modelIndex) {
+    return am[modelIndex].altLocCount;
+  }
+
   public int getAltLocIndexInModel(int modelIndex, char alternateLocationID) {
     if (alternateLocationID == '\0') {
       return 0;
@@ -1616,7 +1616,7 @@
   public int getLastVibrationVector(int modelIndex, int tok) {
     if (vibrations != null) {
       Vibration v;
-      int a1 = (modelIndex < 0 || modelIndex >= mc - 1 ? ac : am[modelIndex + 
1].firstAtomIndex);
+      int a1 = (modelIndex < 0 || isTrajectory(modelIndex) || modelIndex >= mc 
- 1 ? ac : am[modelIndex + 1].firstAtomIndex);
       int a0 = (modelIndex <= 0 ? 0 : am[modelIndex].firstAtomIndex);
       for (int i = a1; --i >= a0;) {
         if ((modelIndex < 0 || at[i].mi == modelIndex)
@@ -3759,6 +3759,39 @@
     return v.toArray(new Quat[v.size()]);
   }
 
+  public BS getConformation(int modelIndex, int conformationIndex,
+                            boolean doSet, BS bsAtoms) {
+    BS bs = new BS();
+    for (int i = mc; --i >= 0;)
+      if (i == modelIndex || modelIndex < 0) {
+        if (am[i].isBioModel)
+          ((BioModel) am[i]).getConformation(conformationIndex, doSet, bsAtoms,
+              bs);
+        else if (!doSet)
+          getSubsystem(i, conformationIndex, bsAtoms, bs);
+      }
+    return bs;
+  }
+
+  private void getSubsystem(int modelIndex, int conformationIndex, BS bsAtoms,
+                           BS bs) {
+    BS bsConformation = am[modelIndex].getConformationBS(conformationIndex,
+        bsAtoms);
+    if (bsConformation == null)
+      return;
+    if (conformationIndex >= 0) {
+      int nAltLocs = getAltLocCountInModel(modelIndex);
+      String altLocs = getAltLocListInModel(modelIndex);
+      BS bsTemp = new BS();
+      for (int c = nAltLocs; --c >= 0;)
+        if (c != conformationIndex)
+          bsConformation.andNot(getAtomBitsMDa(T.spec_alternate,
+              altLocs.substring(c, c + 1), bsTemp));
+    }
+    if (bsConformation.nextSetBit(0) >= 0)
+      bs.or(bsConformation);
+  }
+
   ///// bio-only methods /////
   
   public BS getSequenceBits(String specInfo, BS bs) {
@@ -3783,13 +3816,6 @@
       bioModelset.recalculatePoints(modelIndex); 
   }
 
-  public BS getConformation(int modelIndex, int conformationIndex, boolean 
doSet, BS bsAtoms) {
-    BS bs = new BS();
-    if (haveBioModels)
-      bioModelset.getConformations(modelIndex, conformationIndex, doSet, 
bsAtoms, bs); 
-    return bs;
-  }
-
   /**
    * These are not actual hydrogen bonds. They are N-O bonds in proteins and
    * nucleic acids The method is called by AminoPolymer and NucleicPolymer

Modified: branches/v14_2/Jmol/src/org/jmol/modelsetbio/BioModel.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/modelsetbio/BioModel.java  2015-05-02 
17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/modelsetbio/BioModel.java  2015-05-02 
17:47:14 UTC (rev 20475)
@@ -786,15 +786,6 @@
     return s;
   }
 
-  @Override
-  public void getConformations(int modelIndex, int conformationIndex,
-                              boolean doSet, BS bsAtoms, BS bsRet) {
-    for (int i = ms.mc; --i >= 0;)
-      if (i == modelIndex || modelIndex < 0)
-        if (ms.am[i].isBioModel)
-        ((BioModel) ms.am[i]).getConformation(conformationIndex, doSet, 
bsAtoms, bsRet);
-  }
-
   /**
    * @param conformationIndex
    * @param doSet 
@@ -802,21 +793,17 @@
    * @param bsSelected
    */
   public void getConformation(int conformationIndex, boolean doSet, BS 
bsSelected, BS bsRet) {
-    String altLocs = ms.getAltLocListInModel(modelIndex);
-    int nAltLocs = ms.getAltLocCountInModel(modelIndex);
-    if (conformationIndex > 0 && conformationIndex >= nAltLocs)
+    int nAltLocs = altLocCount;
+    BS bsConformation = getConformationBS(conformationIndex, bsSelected);
+    if (bsConformation == null)
       return;
-    BS bsConformation = vwr.getModelUndeletedAtomsBitSet(modelIndex);
-    if (bsSelected != null)
-      bsConformation.and(bsSelected);
-    if (bsConformation.nextSetBit(0) < 0)
-      return;
     if (conformationIndex >= 0) {
       if (nAltLocs > 0)
         for (int i = bioPolymerCount; --i >= 0;)
           bioPolymers[i].getConformation(bsConformation, conformationIndex);
       BS bs = new BS();
-      for (int c = nAltLocs; --c >= 0;)
+      String altLocs = ms.getAltLocListInModel(modelIndex);
+      for (int c = altLocCount; --c >= 0;)
         if (c != conformationIndex)
           bsConformation.andNot(ms.getAtomBitsMDa(T.spec_alternate,
               altLocs.substring(c, c + 1), bs));

Modified: branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java     2015-05-02 
17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/script/ScriptExpr.java     2015-05-02 
17:47:14 UTC (rev 20475)
@@ -1767,7 +1767,7 @@
           T3 t = atom.atomPropertyTuple(vwr, tok, ptTemp);
           switch (minmaxtype) {
           case T.allfloat:
-            fout[i] = (pt == null ? -1 : t.length());
+            fout[i] = (pt == null ? -1 : t == null ? 0 : t.length());
             break;
           case T.all:
             vout.addLast(t == null ? Integer.valueOf(-1) : P3.newP(t));

Modified: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-05-02 
17:46:35 UTC (rev 20474)
+++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-05-02 
17:47:14 UTC (rev 20475)
@@ -4,8 +4,14 @@
 # THIS IS THE RELEASE BRANCH 
 # BUG FIXES ONLY, PLEASE
 
-Jmol.___JmolVersion="14.2.13_2015.04.30d"
+Jmol.___JmolVersion="14.2.13_2015.05.02"
 
+bug fix: color atoms property vxyz crashes Jmol if no vibrations
+bug fix: with msCIF, select subsystem=1 does not select anything 
(14.2/3.12_2015.02.06)
+bug fix: vibrations in trajectories not animating (14.2/3.6_2014.08.14) 
+
+JmolVersion="14.2.13_2015.04.30d"
+
 bug fix: reading Molden file with no MOs crashes Jmol
 
 JmolVersion="14.2.13_2015.04.27"

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


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to