Revision: 20140
          http://sourceforge.net/p/jmol/code/20140
Author:   hansonr
Date:     2014-11-27 00:09:02 +0000 (Thu, 27 Nov 2014)
Log Message:
-----------
Jmol.___JmolVersion="14.3.10_2014.11.27"

bug fix: SPIN BRANCH {atomno=2} {atomno=1}   does not work

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/thread/SpinThread.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties
    trunk/Jmol/src/org/jmol/viewer/TransformManager.java

Modified: trunk/Jmol/src/org/jmol/thread/SpinThread.java
===================================================================
--- trunk/Jmol/src/org/jmol/thread/SpinThread.java      2014-11-26 21:02:53 UTC 
(rev 20139)
+++ trunk/Jmol/src/org/jmol/thread/SpinThread.java      2014-11-27 00:09:02 UTC 
(rev 20140)
@@ -179,7 +179,8 @@
             vwr.requestRepaintAndWait("spin thread");
         else
           vwr.refresh(1, "SpinThread");
-        if (endDegrees >= 1e10f ? nDegrees/endDegrees > 0.99 : !isNav && 
endDegrees >= 0 ? nDegrees >= endDegrees - 0.001
+        if (endDegrees >= 1e10f ? nDegrees/endDegrees > 0.99 
+            : !isNav && endDegrees >= 0 ? nDegrees >= endDegrees - 0.001
             : -nDegrees <= endDegrees + 0.001) {
           isDone = true;
           transformManager.setSpinOff();

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-11-26 21:02:53 UTC 
(rev 20139)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-11-27 00:09:02 UTC 
(rev 20140)
@@ -17,6 +17,8 @@
 
 Jmol.___JmolVersion="14.3.10_2014.11.27"
 
+bug fix: SPIN BRANCH {atomno=2} {atomno=1}   does not work
+
 code: scriptExt.IsoExt splits CmdExt into two parts 
  -- (note this will require changes to build_03_tojs_stable)
 code: simplification of SurfaceGenerator

Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/TransformManager.java        2014-11-26 
21:02:53 UTC (rev 20139)
+++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java        2014-11-27 
00:09:02 UTC (rev 20140)
@@ -434,8 +434,9 @@
 
     if (dihedralList == null
         && (translation == null || translation.length() < 0.001)
-        && (!isSpin || endDegrees == 0 || Float.isNaN(degreesPerSecond) || 
degreesPerSecond == 0)
-        && (isSpin || endDegrees == 0))
+        && (isSpin ? Float.isNaN(degreesPerSecond) || degreesPerSecond == 0
+          : endDegrees == 0)
+        )
       return false;
 
     V3 axis = null;
@@ -455,14 +456,16 @@
     if (isSpin) {
       // we need to adjust the degreesPerSecond to match a multiple of the 
frame rate
       if (dihedralList == null) {
-        int nFrames = (int) (Math.abs(endDegrees) / Math.abs(degreesPerSecond)
-            * spinFps + 0.5);
+        if (endDegrees == 0)
+          endDegrees = Float.NaN;
         if (Float.isNaN(endDegrees)) {
           rotationRate = degreesPerSecond;
         } else {
+          int nFrames = (int) (Math.abs(endDegrees) / 
Math.abs(degreesPerSecond)
+              * spinFps + 0.5);
           rotationRate = degreesPerSecond = endDegrees / nFrames * spinFps;
           if (translation != null)
-            internalTranslation.scale(1f / (nFrames));
+            internalTranslation.scale(1f / nFrames);
         }
         internalRotationAxis.setVA(axis,
             (Float.isNaN(rotationRate) ? 0 : rotationRate)
@@ -475,7 +478,7 @@
       }
       setSpin(eval, true, endDegrees, finalPoints, dihedralList, bsAtoms,
           isGesture);
-      return (dihedralList != null || bsAtoms != null);
+      return !Float.isNaN(endDegrees);
     }
     float radians = endDegrees * JC.radiansPerDegree;
     internalRotationAxis.setVA(axis, radians);
@@ -2084,8 +2087,7 @@
             Float.valueOf(endDegrees), endPositions, dihedralList,
             bsAtoms, isGesture ? Boolean.TRUE : null } );
         spinIsGesture = isGesture;
-        if (bsAtoms == null && dihedralList == null && 
-            (endDegrees == Float.MAX_VALUE || !vwr.g.waitForMoveTo)) {
+        if ((Float.isNaN(endDegrees) || endDegrees == Float.MAX_VALUE || 
!vwr.g.waitForMoveTo)) {
           spinThread.start();
         } else {
           spinThread.setEval(eval);

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=157005751&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