From: <ha...@us...> - 2012-11-20 02:33:16
|
Revision: 17729 http://jmol.svn.sourceforge.net/jmol/?rev=17729&view=rev Author: hansonr Date: 2012-11-20 02:33:08 +0000 (Tue, 20 Nov 2012) Log Message: ----------- ___version=13.1.9_dev bug fix: ellipsoid rendering fails bug fix: translucent echo oddities in Jmol 13.1.8 bug fix: lost volume rendering in 13.1.8 bug fix: CASTEP density reader fails to reset origin to 0 0 0 in mapping bug fix: UTF files with BOM (byte order marker) present not read correctly bug fix: UTF files within GZIP or ZIP files not read correctly bug fix: set picking draw no longer works in Jmol 13.0 or 13.1 bug fix: translucent echo backgrounds lost in 13.1.8 bug fix: select resno=@{n+3} fails in 12.2, 13.0, and 13.1 bug fix: isosurface AtomicOrbital broken in 13.1.8 JavaScript: delay, hover, animation, vibration, moveto, spin, timeout JavaScript: full binary loading for JavaScript -- tested only in Firefox, but specifically designed for Chrome's insistence that synchronized AJAX processes must not be binary JavaScript: base64 translation of encoded binary strings from JS file reading prefix: ";base64," initiates decoding. JavaScript: com.json JSON package removed due to licensing issues JavaScript: JSmol -- all references to InputStream.read(byte[]) --> InputStream.read(byte[], 0, len) to speed file reading processing JavaScript: JSmol -- float[].clone(), int[].clone() not supported in Java2Script JavaScript: java.text.DateFormat not supported in Java2Script JavaScript: Note -- org.jmol.adapter.smarter.Atom is not fully cloned (anisoBorU and ellipsoid are not copied and their values must be considered "final") code: refactoring org.jmol.util into org.jmol.io and org.jmol.io2 Modified Paths: -------------- trunk/Jmol/src/org/jmol/export/_IdtfExporter.java trunk/Jmol/src/org/jmol/export/_ObjExporter.java trunk/Jmol/src/org/jmol/export/__CartesianExporter.java trunk/Jmol/src/org/jmol/modelset/ModelSet.java trunk/Jmol/src/org/jmol/renderspecial/EllipsoidsRenderer.java trunk/Jmol/src/org/jmol/script/ScriptVariable.java trunk/Jmol/src/org/jmol/symmetry/UnitCell.java trunk/Jmol/src/org/jmol/thread/AnimationThread.java trunk/Jmol/src/org/jmol/thread/CommandWatcherThread.java trunk/Jmol/src/org/jmol/thread/HoverWatcherThread.java trunk/Jmol/src/org/jmol/thread/JmolThread.java trunk/Jmol/src/org/jmol/thread/MinimizationThread.java trunk/Jmol/src/org/jmol/thread/MoveToThread.java trunk/Jmol/src/org/jmol/thread/ScriptDelayThread.java trunk/Jmol/src/org/jmol/thread/ScriptQueueThread.java trunk/Jmol/src/org/jmol/thread/SpinThread.java trunk/Jmol/src/org/jmol/thread/TimeoutThread.java trunk/Jmol/src/org/jmol/thread/VibrationThread.java trunk/Jmol/src/org/jmol/util/Matrix3f.java trunk/Jmol/src/org/jmol/util/Matrix4f.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/ScriptManager.java trunk/Jmol/src/org/jmol/viewer/StateManager.java trunk/Jmol/src/org/jmol/viewer/TransformManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/export/_IdtfExporter.java =================================================================== --- trunk/Jmol/src/org/jmol/export/_IdtfExporter.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/export/_IdtfExporter.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -281,7 +281,7 @@ m.setIdentity(); Quaternion q = viewer.getRotationQuaternion(); - m.set(q.getMatrix()); + m.setM3(q.getMatrix()); q.transformP2(referenceCenter, tempP1); m.m03 = -tempP1.x; m.m13 = -tempP1.y; @@ -659,9 +659,9 @@ addShader(key, colix); } if (ptX == null) - cylinderMatrix.set(getRotationMatrix(pt1, pt2, radius)); + cylinderMatrix.setM3(getRotationMatrix(pt1, pt2, radius)); else - cylinderMatrix.set(getRotationMatrix(ptCenter, pt2, radius, ptX, ptY)); + cylinderMatrix.setM3(getRotationMatrix(ptCenter, pt2, radius, ptX, ptY)); cylinderMatrix.m03 = pt1.x; cylinderMatrix.m13 = pt1.y; cylinderMatrix.m23 = pt1.z; @@ -712,7 +712,7 @@ addShader(key, colix); } checkPoint(ptCenter); - cylinderMatrix.set(getRotationMatrix(ptCenter, ptZ, 1, ptX, ptY)); + cylinderMatrix.setM3(getRotationMatrix(ptCenter, ptZ, 1, ptX, ptY)); cylinderMatrix.m03 = ptZ.x; cylinderMatrix.m13 = ptZ.y; cylinderMatrix.m23 = ptZ.z; @@ -736,7 +736,7 @@ addShader(key, colix); } checkPoint(ptCenter); - cylinderMatrix.set(getRotationMatrix(ptCenter, ptPerp, radius)); + cylinderMatrix.setM3(getRotationMatrix(ptCenter, ptPerp, radius)); cylinderMatrix.m03 = ptCenter.x; cylinderMatrix.m13 = ptCenter.y; cylinderMatrix.m23 = ptCenter.z; @@ -940,7 +940,7 @@ htNodes.put(key, v); addShader(key, colix); } - cylinderMatrix.set(getRotationMatrix(ptBase, ptTip, radius)); + cylinderMatrix.setM3(getRotationMatrix(ptBase, ptTip, radius)); cylinderMatrix.m03 = ptBase.x; cylinderMatrix.m13 = ptBase.y; cylinderMatrix.m23 = ptBase.z; Modified: trunk/Jmol/src/org/jmol/export/_ObjExporter.java =================================================================== --- trunk/Jmol/src/org/jmol/export/_ObjExporter.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/export/_ObjExporter.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -551,7 +551,7 @@ Matrix4f matrix = new Matrix4f(); addTexture(colix, null); String name = "Circle" + circleNum++; - matrix.set(getRotationMatrix(ptCenter, ptPerp, radius)); + matrix.setM3(getRotationMatrix(ptCenter, ptPerp, radius)); matrix.m03 = ptCenter.x; matrix.m13 = ptCenter.y; matrix.m23 = ptCenter.z; @@ -573,7 +573,7 @@ Matrix4f matrix = new Matrix4f(); addTexture(colix, null); String name = "Cone" + coneNum++; - matrix.set(getRotationMatrix(ptBase, ptTip, radius)); + matrix.setM3(getRotationMatrix(ptBase, ptTip, radius)); matrix.m03 = ptBase.x; matrix.m13 = ptBase.y; matrix.m23 = ptBase.z; @@ -597,7 +597,7 @@ Matrix4f matrix = new Matrix4f(); addTexture(colix, null); String name = "Ellipse" + ellipseNum++; - matrix.set(getRotationMatrix(ptCenter, ptZ, 1, ptX, ptY)); + matrix.setM3(getRotationMatrix(ptCenter, ptZ, 1, ptX, ptY)); matrix.m03 = ptZ.x; matrix.m13 = ptZ.y; matrix.m23 = ptZ.z; @@ -816,9 +816,9 @@ int n = (ptX != null && endcaps == GData.ENDCAPS_NONE ? 2 : 1); for (int i = 0; i < n; i++) { if (ptX == null) - matrix.set(getRotationMatrix(pt1, pt2, radius)); + matrix.setM3(getRotationMatrix(pt1, pt2, radius)); else - matrix.set(getRotationMatrix(ptCenter, pt2, radius, ptX, ptY)); + matrix.setM3(getRotationMatrix(ptCenter, pt2, radius, ptX, ptY)); matrix.m03 = pt1.x; matrix.m13 = pt1.y; matrix.m23 = pt1.z; Modified: trunk/Jmol/src/org/jmol/export/__CartesianExporter.java =================================================================== --- trunk/Jmol/src/org/jmol/export/__CartesianExporter.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/export/__CartesianExporter.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -341,7 +341,7 @@ m.m22 = rz; mq.setAA(a); mq.mul(m); - sphereMatrix.set(mq); + sphereMatrix.setM3(mq); } else { sphereMatrix.setIdentity(); sphereMatrix.m00 = rx; Modified: trunk/Jmol/src/org/jmol/modelset/ModelSet.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelSet.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/modelset/ModelSet.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -970,9 +970,9 @@ Vector3f translation, BitSet bs, Point3f center, boolean isInternal) { if (mNew == null) { - matTemp.set(matrixRotate); + matTemp.setM(matrixRotate); } else { - matInv.set(matrixRotate); + matInv.setM(matrixRotate); matInv.invert(); ptTemp.set(0, 0, 0); matTemp.mul2(mNew, matrixRotate); @@ -982,14 +982,14 @@ vTemp.setT(center); mat4.setIdentity(); mat4.setTranslation(vTemp); - mat4t.set(matTemp); + mat4t.setM3(matTemp); mat4.mul(mat4t); mat4t.setIdentity(); vTemp.scale(-1); mat4t.setTranslation(vTemp); mat4.mul(mat4t); } else { - mat4.set(matTemp); + mat4.setM3(matTemp); } for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) { if (isInternal) { Modified: trunk/Jmol/src/org/jmol/renderspecial/EllipsoidsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/renderspecial/EllipsoidsRenderer.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/renderspecial/EllipsoidsRenderer.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -86,12 +86,53 @@ } } + private boolean isSet; @Override protected boolean render() { + isSet = false; ellipsoids = (Ellipsoids) shape; if (ellipsoids.madset == null && !ellipsoids.haveEllipsoids) return false; + boolean needTranslucent = false; + Atom[] atoms = modelSet.atoms; + for (int i = modelSet.getAtomCount(); --i >= 0;) { + Atom atom = atoms[i]; + if (!atom.isVisible(myVisibilityFlag)) + continue; + if (atom.screenZ <= 1) + continue; + Quadric[] ellipsoid2 = atom.getEllipsoid(); + if (ellipsoid2 == null) + continue; + for (int j = 0; j < ellipsoid2.length; j++) { + if (ellipsoid2[j] == null || ellipsoids.madset[j] == null || ellipsoids.madset[j][i] == 0) + continue; + colix = Shape.getColix(ellipsoids.colixset[j], i, atom); + if (g3d.setColix(colix)) + render1(atom, ellipsoid2[j]); + else + needTranslucent = true; + } + } + + if (ellipsoids.haveEllipsoids) { + Iterator<Ellipsoid> e = ellipsoids.htEllipsoids.values().iterator(); + while (e.hasNext()) { + Ellipsoid ellipsoid = e.next(); + if (ellipsoid.visible && ellipsoid.isValid) { + if (g3d.setColix(colix = ellipsoid.colix)) + renderEllipsoid(ellipsoid); + else + needTranslucent = true; + } + } + } + coords = null; + return needTranslucent; + } + + private boolean setGlobals() { wireframeOnly = (viewer.getWireframeRotation() && viewer.getInMotion()); drawAxes = viewer.getBooleanProperty("ellipsoidAxes"); drawArcs = viewer.getBooleanProperty("ellipsoidArcs"); @@ -131,45 +172,11 @@ } Matrix4f m4 = viewer.getMatrixtransform(); - m4.setRotationScale(mat); + mat.setRow(0, m4.m00, m4.m01, m4.m02); + mat.setRow(1, m4.m10, m4.m11, m4.m12); + mat.setRow(2, m4.m20, m4.m21, m4.m22); matScreenToCartesian.invertM(mat); - boolean needTranslucent = false; - Atom[] atoms = modelSet.atoms; - for (int i = modelSet.getAtomCount(); --i >= 0;) { - Atom atom = atoms[i]; - if (!atom.isVisible(myVisibilityFlag)) - continue; - if (atom.screenZ <= 1) - continue; - Quadric[] ellipsoid2 = atom.getEllipsoid(); - if (ellipsoid2 == null) - continue; - - for (int j = 0; j < ellipsoid2.length; j++) { - if (ellipsoid2[j] == null || ellipsoids.madset[j] == null || ellipsoids.madset[j][i] == 0) - continue; - colix = Shape.getColix(ellipsoids.colixset[j], i, atom); - if (g3d.setColix(colix)) - render1(atom, ellipsoid2[j]); - else - needTranslucent = true; - } - } - - if (ellipsoids.haveEllipsoids) { - Iterator<Ellipsoid> e = ellipsoids.htEllipsoids.values().iterator(); - while (e.hasNext()) { - Ellipsoid ellipsoid = e.next(); - if (ellipsoid.visible && ellipsoid.isValid) { - if (g3d.setColix(colix = ellipsoid.colix)) - renderEllipsoid(ellipsoid); - else - needTranslucent = true; - } - } - } - coords = null; - return needTranslucent; + return true; } private final Point3i[] screens = new Point3i[32]; @@ -203,15 +210,16 @@ private Point3f center; private void render1(Atom atom, Quadric ellipsoid) { + if (!isSet) + isSet = setGlobals(); s0.set(atom.screenX, atom.screenY, atom.screenZ); boolean isOK = true; for (int i = 3; --i >= 0;) { factoredLengths[i] = ellipsoid.lengths[i] * ellipsoid.scale; if (Float.isNaN(factoredLengths[i])) isOK = false; - else if (factoredLengths[i] < 0.2f) - factoredLengths[i] = 0.2f; // for extremely flat ellipsoids, we need at least some length - + else if (factoredLengths[i] < 0.02f) + factoredLengths[i] = 0.02f; // for extremely flat ellipsoids, we need at least some length } axes = ellipsoid.vectors; if (axes == null) { //isotropic @@ -220,7 +228,7 @@ setMatrices(); //[0] is shortest; [2] is longest center = atom; - setAxes(1.0f); + setAxes(); if (g3d.isClippedXY(dx + dx, atom.screenX, atom.screenY)) return; diameter = viewer.scaleToScreen(atom.screenZ, wireframeOnly ? 1 : diameter0); @@ -252,7 +260,6 @@ // make this screen coordinates to ellisoidal coordinates matScreenToEllipsoid.mul2(mat, matScreenToCartesian); matEllipsoidToScreen.invertM(matScreenToEllipsoid); - //matEllipsoidToScreen.mul(viewer.scaleToScreen(s0.z, 1000)); perspectiveFactor = viewer.scaleToPerspective(s0.z, 1.0f); matScreenToEllipsoid.mulf(1f/perspectiveFactor); } @@ -266,21 +273,21 @@ JmolConstants.axisNZ, JmolConstants.axisZ }; - private void setAxes(float f) { + private void setAxes() { for (int i = 0; i < 6; i++) { int iAxis = axisPoints[i]; int i012 = Math.abs(iAxis) - 1; - points[i].scaleAdd2(f * factoredLengths[i012] * (iAxis < 0 ? -1 : 1), + points[i].scaleAdd2(factoredLengths[i012] * (iAxis < 0 ? -1 : 1), axes[i012], center); pt1.setT(unitAxisVectors[i]); - pt1.scale(f); + //pt1.scale(f); matEllipsoidToScreen.transform(pt1); screens[i].set(Math.round (s0.x + pt1.x * perspectiveFactor), Math.round (s0.y + pt1.y * perspectiveFactor), Math.round(pt1.z + s0.z)); } dx = 2 + viewer.scaleToScreen(s0.z, - Math.round(f * (Float.isNaN(factoredLengths[2]) ? 1.0f : factoredLengths[2]) * 1000)); + Math.round((Float.isNaN(factoredLengths[2]) ? 1.0f : factoredLengths[2]) * 1000)); } private void renderAxes() { @@ -401,7 +408,7 @@ viewer.transformPtScr(ellipsoid.center, s0); setMatrices(); center = ellipsoid.center; - setAxes(1); + setAxes(); renderBall(); } Modified: trunk/Jmol/src/org/jmol/script/ScriptVariable.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptVariable.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/script/ScriptVariable.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -956,12 +956,12 @@ data[i] = fValue(sv.get(i)); if (selector > 0) { if (tok == matrix3f) - ((Matrix3f) value).setRow(selector - 1, data); + ((Matrix3f) value).setRowA(selector - 1, data); else ((Matrix4f) value).setRow(selector - 1, data); } else { if (tok == matrix3f) - ((Matrix3f) value).setColumn(-1 - selector, data); + ((Matrix3f) value).setColumnA(-1 - selector, data); else ((Matrix4f) value).setColumn(-1 - selector, data); } Modified: trunk/Jmol/src/org/jmol/symmetry/UnitCell.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/UnitCell.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/symmetry/UnitCell.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -78,7 +78,7 @@ if (mat == null) return; Matrix4f m = new Matrix4f(); - m.set(mat); + m.setM3(mat); matrixFractionalToCartesian.mul2(m, matrixFractionalToCartesian); matrixCartesianToFractional.invertM(matrixFractionalToCartesian); calcUnitcellVertices(); Modified: trunk/Jmol/src/org/jmol/thread/AnimationThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/AnimationThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/AnimationThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -64,65 +64,65 @@ } @Override - protected boolean checkContinue() { - return (continuing && !checkInterrupted() && animationManager.animationOn); - } - - @Override protected void run1(int mode) throws InterruptedException { - // TODO - switch (mode) { - case INIT: - if (Logger.debugging) - Logger.debug("animation thread " + intThread + " running"); - viewer.requestRepaintAndWait(); - isFirst = true; - return; - case MAIN: - if (animationManager.currentModelIndex == framePointer) { - targetTime += animationManager.firstFrameDelayMs; + while (true) + switch (mode) { + case INIT: + if (Logger.debugging) + Logger.debug("animation thread " + intThread + " running"); + viewer.requestRepaintAndWait(); + viewer.startHoverWatcher(false); + isFirst = true; + //$FALL-THROUGH$ + case MAIN: + if (checkInterrupted() || !animationManager.animationOn) { + mode = FINISH; + break; + } + if (animationManager.currentModelIndex == framePointer) { + targetTime += animationManager.firstFrameDelayMs; + sleepTime = (int) (targetTime - (System.currentTimeMillis() - startTime)); + if (!runSleep(sleepTime, CHECK1)) + return; + } + //$FALL-THROUGH$ + case CHECK1: + if (animationManager.currentModelIndex == framePointer2) { + targetTime += animationManager.lastFrameDelayMs; + sleepTime = (int) (targetTime - (System.currentTimeMillis() - startTime)); + if (!runSleep(sleepTime, CHECK2)) + return; + } + //$FALL-THROUGH$ + case CHECK2: + if (!isFirst + && animationManager.lastModelPainted == animationManager.currentModelIndex + && !animationManager.setAnimationNext()) { + mode = FINISH; + break; + } + isFirst = false; + targetTime += (int) ((1000f / animationManager.animationFps) + viewer + .getFrameDelayMs(animationManager.currentModelIndex)); + //$FALL-THROUGH$ + case CHECK3: + while (animationManager.animationOn && !checkInterrupted() + && !viewer.getRefreshing()) { + if (!runSleep(10, CHECK3)) + return; + } + if (!viewer.getSpinOn()) + viewer.refresh(1, "animationThread"); sleepTime = (int) (targetTime - (System.currentTimeMillis() - startTime)); - if (sleepTime > 0 && !runSleep(sleepTime, CHECK1)) + if (!runSleep(sleepTime, MAIN)) return; - } - //$FALL-THROUGH$ - case CHECK1: - if (animationManager.currentModelIndex == framePointer2) { - targetTime += animationManager.lastFrameDelayMs; - sleepTime = (int) (targetTime - (System.currentTimeMillis() - startTime)); - if (sleepTime > 0 && !runSleep(sleepTime, CHECK2)) - return; - } - //$FALL-THROUGH$ - case CHECK2: - if (!isFirst - && animationManager.lastModelPainted == animationManager.currentModelIndex - && !animationManager.setAnimationNext()) { + mode = MAIN; + break; + case FINISH: Logger.debug("animation thread " + intThread + " exiting"); animationManager.setAnimationOff(false); - continuing = false; return; } - isFirst = false; - targetTime += (int) ((1000f / animationManager.animationFps) + viewer - .getFrameDelayMs(animationManager.currentModelIndex)); - //$FALL-THROUGH$ - case CHECK3: - while (continuing && !checkInterrupted() && animationManager.animationOn - && !viewer.getRefreshing()) { - if (!runSleep(10, CHECK3)) - return; - } - if (!viewer.getSpinOn()) - viewer.refresh(1, "animationThread"); - sleepTime = (int) (targetTime - (System.currentTimeMillis() - startTime)); - if (sleepTime < 0) - sleepTime = 0; - runSleep(sleepTime, MAIN); - return; - case FINISH: - return; - } } } \ No newline at end of file Modified: trunk/Jmol/src/org/jmol/thread/CommandWatcherThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/CommandWatcherThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/CommandWatcherThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -27,6 +27,7 @@ import org.jmol.util.Logger; import org.jmol.viewer.ScriptManager; +import org.jmol.viewer.Viewer; public class CommandWatcherThread extends JmolThread { /** @@ -37,8 +38,8 @@ /** * @param scriptManager */ - public CommandWatcherThread(ScriptManager scriptManager) { - super(null, "CommmandWatcherThread"); + public CommandWatcherThread(Viewer viewer, ScriptManager scriptManager) { + super(viewer, "CommmandWatcherThread"); this.scriptManager = scriptManager; } @@ -68,25 +69,8 @@ } @Override - protected boolean checkContinue() { - //TODO - return true; - } - - @Override protected void run1(int mode) throws InterruptedException { - // TODO - switch (mode) { - case INIT: - return; - case MAIN: - return; - case CHECK1: - return; - case FINISH: - scriptManager.clearCommandWatcherThread(); - return; - } + // N/A } } \ No newline at end of file Modified: trunk/Jmol/src/org/jmol/thread/HoverWatcherThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/HoverWatcherThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/HoverWatcherThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -53,36 +53,32 @@ } @Override - protected boolean checkContinue() { - return (!interrupted && (hoverDelay = viewer.getHoverDelay()) > 0); - } - - @Override protected void run1(int mode) throws InterruptedException { - switch (mode) { - case INIT: - if (!isJS) - Thread.currentThread().setPriority(Thread.MIN_PRIORITY); - return; - case MAIN: - if (!runSleep(hoverDelay, CHECK1)) - return; - //$FALL-THROUGH$ - case CHECK1: - if (moved.is(current)) { - // last operation was move - currentTime = System.currentTimeMillis(); - int howLong = (int) (currentTime - moved.time); - if (howLong > hoverDelay && !interrupted) { - actionManager.checkHover(); + while (true) + switch (mode) { + case INIT: + if (!isJS) + Thread.currentThread().setPriority(Thread.MIN_PRIORITY); + //$FALL-THROUGH$ + case MAIN: + hoverDelay = viewer.getHoverDelay(); + if (interrupted || hoverDelay <= 0) + return; + if (!runSleep(hoverDelay, CHECK1)) + return; + //$FALL-THROUGH$ + case CHECK1: + if (moved.is(current)) { + // last operation was move + currentTime = System.currentTimeMillis(); + int howLong = (int) (currentTime - moved.time); + if (howLong > hoverDelay && !interrupted) { + actionManager.checkHover(); + } } + mode = MAIN; + break; } - if (isJS && checkContinue()) - run1(MAIN); - return; - case FINISH: - return; - } } } \ No newline at end of file Modified: trunk/Jmol/src/org/jmol/thread/JmolThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/JmolThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/JmolThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -33,7 +33,6 @@ protected boolean isJS; protected boolean interrupted = false; protected boolean isReset; - protected boolean continuing = true; public JmolThread(Viewer viewer, String name) { @@ -44,7 +43,6 @@ this.name = name + "_" + (++threadIndex); } abstract protected void run1(int mode) throws InterruptedException; - abstract protected boolean checkContinue(); /** * JavaScript only -- @@ -89,50 +87,16 @@ } @Override - public void interrupt() { - interrupted = true; - restartHover(); - if (!isJS) - super.interrupt(); - } - - protected boolean checkInterrupted() { - /** - * @j2sNative - * - * return this.interrupted; - */ - { - return super.isInterrupted(); - } - } - - public void reset() { - isReset = true; - interrupt(); - } - - @Override public void run() { startTime = System.currentTimeMillis(); try { run1(INIT); - while (checkContinue()) { - run1(MAIN); - if (isJS) - return; - } } catch (InterruptedException e) { if (Logger.debugging) oops(e); } catch (Exception e) { oops(e); } - try { - run1(FINISH); - } catch (Exception e) { - Logger.info(name + " exception in FINISH " + e); - } } protected void oops(Exception e) { @@ -163,8 +127,27 @@ } } - public void discontinue() { - continuing = false; + @Override + public void interrupt() { + interrupted = true; + restartHover(); + if (!isJS) + super.interrupt(); } - + + protected boolean checkInterrupted() { + /** + * @j2sNative + * + * return this.interrupted; + */ + { + return super.isInterrupted(); + } + } + + public void reset() { + isReset = true; + interrupt(); + } } Modified: trunk/Jmol/src/org/jmol/thread/MinimizationThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/MinimizationThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/MinimizationThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -39,23 +39,21 @@ } @Override - protected boolean checkContinue() { - return continuing && minimizer.minimizationOn() && !checkInterrupted(); - } - - @Override protected void run1(int mode) throws InterruptedException { - while (checkContinue()) + while (true) switch (mode) { case INIT: lastRepaintTime = startTime; //should save the atom coordinates - if (this.minimizer.startMinimization()) - viewer.startHoverWatcher(false); - else - continuing = false; - return; + if (!this.minimizer.startMinimization()) + return; + viewer.startHoverWatcher(false); + //$FALL-THROUGH$ case MAIN: + if (!minimizer.minimizationOn() || checkInterrupted()) { + mode = FINISH; + break; + } currentTime = System.currentTimeMillis(); int elapsed = (int) (currentTime - lastRepaintTime); int sleepTime = 33 - elapsed; @@ -64,14 +62,10 @@ //$FALL-THROUGH$ case CHECK1: lastRepaintTime = currentTime = System.currentTimeMillis(); - if (!this.minimizer.stepMinimization()) - this.minimizer.endMinimization(); - if (isJS) { - mode = MAIN; - break; - } - return; + mode = (this.minimizer.stepMinimization() ? MAIN : FINISH); + break; case FINISH: + this.minimizer.endMinimization(); restartHover(); return; } Modified: trunk/Jmol/src/org/jmol/thread/MoveToThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/MoveToThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/MoveToThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -97,7 +97,7 @@ float newRotationRadius, Point3f navCenter, float xNav, float yNav, float navDepth) { this.center = center; - matrixEnd.set(end); + matrixEnd.setM(end); this.zoom = zoom; this.xTrans = xTrans; this.yTrans = yTrans; @@ -153,27 +153,20 @@ } @Override - protected boolean checkContinue() { - return continuing; - } - - @Override protected void run1(int mode) throws InterruptedException { while (true) switch (mode) { case INIT: - continuing = (totalSteps > 0); - if (continuing) - viewer.setInMotion(true); - return; + if (totalSteps == 0) { + mode = FINISH; + break; + } + viewer.setInMotion(true); + //$FALL-THROUGH$ case MAIN: if (++iStep >= totalSteps) { - continuing = false; - if (isJS) { - mode = FINISH; - break; - } - return; + mode = FINISH; + break; } doStepTransform(); doEndMove = true; @@ -185,13 +178,14 @@ viewer.requestRepaintAndWait(); if (transformManager.motion == null || !isJS && eval != null && !viewer.isScriptExecuting()) { - continuing = doEndMove = false; return; } currentTime = System.currentTimeMillis(); int sleepTime = (int) (targetTime - currentTime); - runSleep(sleepTime, MAIN); - return; + if (!runSleep(sleepTime, MAIN)) + return; + mode = MAIN; + break; case FINISH: if (totalSteps == 0 || doEndMove) doFinalTransform(); Modified: trunk/Jmol/src/org/jmol/thread/ScriptDelayThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/ScriptDelayThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/ScriptDelayThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -41,40 +41,44 @@ private int seconds; @Override - protected boolean checkContinue() { - return continuing && !interrupted && seconds >= 0 && millis > 0 && !eval.interruptExecution - && eval.currentThread == Thread.currentThread(); - } - - @Override protected void run1(int mode) throws InterruptedException { - switch (mode) { - case INIT: - int delayMax; - if (millis < 0) - millis = -millis; - else if ((delayMax = viewer.getDelayMaximum()) > 0 && millis > delayMax) - millis = delayMax; - millis -= System.currentTimeMillis() - startTime; - if (isJS) { - seconds = 0; - } else { - seconds = (int) millis / 1000; - millis -= seconds * 1000; - if (millis <= 0) - millis = 1; + while (true) + switch (mode) { + case INIT: + int delayMax; + if (millis < 0) + millis = -millis; + else if ((delayMax = viewer.getDelayMaximum()) > 0 && millis > delayMax) + millis = delayMax; + millis -= System.currentTimeMillis() - startTime; + if (isJS) { + seconds = 0; + } else { + seconds = (int) millis / 1000; + millis -= seconds * 1000; + if (millis <= 0) + millis = 1; + } + if (!isJS) + viewer.popHoldRepaintWhy("delay INIT"); + //$FALL-THROUGH$ + case MAIN: + if (interrupted|| eval.interruptExecution + || !isJS && eval.currentThread != Thread.currentThread()) { + mode = FINISH; + break; + } + if (!runSleep((seconds--) > 0 ? 1000 : (int) millis, FINISH)) + return; + if (seconds < 0) + millis = 0; + mode = (seconds > 0 || millis > 0 ? MAIN : FINISH); + break; + case FINISH: + if (!isJS) + viewer.pushHoldRepaintWhy("delay FINISH"); + resumeEval(); + return; } - if (!isJS) - viewer.popHoldRepaintWhy("delay INIT"); - return; - case MAIN: - runSleep((seconds--) > 0 ? 1000 : (int) millis, FINISH); - return; - case FINISH: - if (!isJS) - viewer.pushHoldRepaintWhy("delay FINISH"); - resumeEval(); - return; - } } } \ No newline at end of file Modified: trunk/Jmol/src/org/jmol/thread/ScriptQueueThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/ScriptQueueThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/ScriptQueueThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -97,12 +97,6 @@ } @Override - protected boolean checkContinue() { - //TODO - return true; - } - - @Override protected void run1(int mode) throws InterruptedException { // TODO switch (mode) { Modified: trunk/Jmol/src/org/jmol/thread/SpinThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/SpinThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/SpinThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -49,7 +49,6 @@ private float angle; private boolean haveNotified; private int index; - private boolean doFinish = true; private boolean navigatingSurface; public boolean isGesture() { @@ -66,12 +65,6 @@ this.isGesture = isGesture; } - @Override - protected boolean checkContinue() { - return continuing = continuing && !isReset && !checkInterrupted(); - } - - /** * Java: * @@ -87,15 +80,19 @@ @Override protected void run1(int mode) throws InterruptedException { - while (checkContinue()) + while (true) switch (mode) { case INIT: myFps = (isNav ? transformManager.navFps : transformManager.spinFps); viewer.getGlobalSettings().setParamB( isNav ? "_navigating" : "_spinning", true); viewer.startHoverWatcher(false); - return; + //$FALL-THROUGH$ case MAIN: + if (isReset || checkInterrupted()) { + mode = FINISH; + break; + } if (isNav && myFps != transformManager.navFps) { myFps = transformManager.navFps; index = 0; @@ -108,20 +105,18 @@ } if (myFps == 0 || !(isNav ? transformManager.navOn : transformManager.spinOn)) { - doFinish = false; - return; + mode = FINISH; + break; } navigatingSurface = viewer.getNavigateSurface(); - boolean refreshNeeded = (isNav ? - navigatingSurface - || transformManager.navX != 0 - || transformManager.navY != 0 + boolean refreshNeeded = (isNav ? navigatingSurface + || transformManager.navX != 0 || transformManager.navY != 0 || transformManager.navZ != 0 : transformManager.isSpinInternal && transformManager.internalRotationAxis.angle != 0 - || transformManager.isSpinFixed + || transformManager.isSpinFixed && transformManager.fixedRotationAxis.angle != 0 - || !transformManager.isSpinFixed + || !transformManager.isSpinFixed && !transformManager.isSpinInternal && (transformManager.spinX != 0 || transformManager.spinY != 0 || transformManager.spinZ != 0)); targetTime = (long) (++index * 1000 / myFps); @@ -139,7 +134,6 @@ boolean isInMotion = (bsAtoms == null && viewer.getInMotion()); if (isInMotion) { if (isGesture) { - continuing = isJS; mode = FINISH; break; } @@ -160,12 +154,11 @@ //System.out.println(angle * degreesPerRadian + " " + count + " " + nDegrees + " " + endDegrees); if (!isNav && nDegrees >= endDegrees - 0.001) transformManager.setSpinOn(false); - runSleep(sleepTime, MAIN); - return; - case FINISH: - continuing = false; - if (!doFinish) + if (!runSleep(sleepTime, MAIN)) return; + mode = MAIN; + break; + case FINISH: if (bsAtoms != null && endPositions != null) { // when the standard deviations of the end points was // exact, we know that we want EXACTLY those final positions Modified: trunk/Jmol/src/org/jmol/thread/TimeoutThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/TimeoutThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/TimeoutThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -43,7 +43,7 @@ set(ms, script); } - public void set(int ms, String script) { + private void set(int ms, String script) { sleepTime = ms; if (script != null) this.script = script; @@ -56,26 +56,22 @@ } @Override - protected boolean checkContinue() { - return (!interrupted && continuing && script != null && script.length() != 0 && sleepTime != 0); - } - - @Override protected void run1(int mode) throws InterruptedException { - while (checkContinue()) + while (true) switch (mode) { case INIT: if (!isJS) Thread.currentThread().setPriority(Thread.MIN_PRIORITY); timeouts = viewer.getTimeouts(); targetTime = System.currentTimeMillis() + Math.abs(sleepTime); - return; + //$FALL-THROUGH$ case MAIN: + if (checkInterrupted() || script == null || script.length() == 0) + return; // 26-millisecond check allows - if (!runSleep(26, CHECK1) || System.currentTimeMillis() < targetTime) + if (!runSleep(26, CHECK1)) return; - mode = CHECK2; - break; + //$FALL-THROUGH$ case CHECK1: // JavaScript-only mode = (System.currentTimeMillis() < targetTime ? MAIN : CHECK2); @@ -83,12 +79,10 @@ case CHECK2: // Time's up! currentTime = System.currentTimeMillis(); - if (timeouts.get(name) == null) { - continuing = false; + if (timeouts.get(name) == null) return; - } status++; - continuing = (sleepTime < 0); + boolean continuing = (sleepTime < 0); targetTime = System.currentTimeMillis() + Math.abs(sleepTime); if (!continuing) timeouts.remove(name); @@ -98,9 +92,8 @@ viewer.evalStringQuiet((continuing ? script + ";\ntimeout ID \"" + name + "\";" : script)); } - if (isJS) - run1(continuing ? MAIN : FINISH); - return; + mode = (continuing ? MAIN : FINISH); + break; case FINISH: timeouts.remove(name); return; Modified: trunk/Jmol/src/org/jmol/thread/VibrationThread.java =================================================================== --- trunk/Jmol/src/org/jmol/thread/VibrationThread.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/thread/VibrationThread.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -38,11 +38,6 @@ } @Override - protected boolean checkContinue() { - return !checkInterrupted(); - } - - @Override protected void run1(int mode) throws InterruptedException { int elapsed; while (true) @@ -50,11 +45,11 @@ case INIT: lastRepaintTime = startTime = System.currentTimeMillis(); viewer.startHoverWatcher(false); - return; + //$FALL-THROUGH$ case MAIN: elapsed = (int) (System.currentTimeMillis() - lastRepaintTime); sleepTime = 33 - elapsed; - if (sleepTime > 0 && !runSleep(sleepTime, CHECK1)) + if (!runSleep(sleepTime, CHECK1)) return; //$FALL-THROUGH$ case CHECK1: @@ -64,11 +59,8 @@ / transformManager.vibrationPeriodMs; transformManager.setVibrationT(t); viewer.refresh(3, "VibrationThread:run()"); - if (isJS) { - mode = MAIN; - break; - } - return; + mode = (checkInterrupted() ? FINISH : MAIN); + break; case FINISH: restartHover(); return; Modified: trunk/Jmol/src/org/jmol/util/Matrix3f.java =================================================================== --- trunk/Jmol/src/org/jmol/util/Matrix3f.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/util/Matrix3f.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -18,8 +18,6 @@ import java.io.Serializable; - - /** * A single precision floating point 3 by 3 matrix. * @@ -27,9 +25,9 @@ * 2006/07/28 17:01:33 $ * @author Kenji hiranabe * - * additions by Bob Hanson ha...@st... 9/30/2012 - * for unique constructor and method names - * for the optimization of compiled JavaScript using Java2Script + * additions by Bob Hanson ha...@st... 9/30/2012 for unique + * constructor and method names for the optimization of compiled + * JavaScript using Java2Script */ public class Matrix3f implements Serializable { @@ -85,9 +83,11 @@ } /** - * Constructs and initializes a Matrix3f from the specified 9 - * element array. this.m00 =v[0], this.m01=v[1], etc. - * @param v the array of length 9 containing in order + * Constructs and initializes a Matrix3f from the specified 9 element array. + * this.m00 =v[0], this.m01=v[1], etc. + * + * @param v + * the array of length 9 containing in order * @return m */ public static Matrix3f newA(float[] v) { @@ -95,9 +95,12 @@ m.setA(v); return m; } + /** * Constructs a new matrix with the same values as the Matrix3f parameter. - * @param m1 The source matrix. + * + * @param m1 + * The source matrix. * @return m */ public static Matrix3f newM(Matrix3f m1) { @@ -115,6 +118,7 @@ m.m22 = m1.m22; return m; } + /** * Returns a string that contains the values of this Matrix3f. * @@ -273,7 +277,7 @@ * @param v * the replacement row */ - public final void setRow(int row, Vector3f v) { + public final void setRowV(int row, Vector3f v) { if (row == 0) { m00 = v.x; m01 = v.y; @@ -327,7 +331,7 @@ * @param v * the replacement row */ - public final void setRow(int row, float v[]) { + public final void setRowA(int row, float v[]) { if (row == 0) { m00 = v[0]; m01 = v[1]; @@ -412,7 +416,7 @@ * @param v * the replacement column */ - public final void setColumn(int column, float v[]) { + public final void setColumnA(int column, float v[]) { if (column == 0) { m00 = v[0]; m10 = v[1]; @@ -548,7 +552,7 @@ */ public final void transposeM(Matrix3f m1) { // alias-safe - set(m1); + setM(m1); transpose(); } @@ -601,7 +605,7 @@ * @param m1 * the matrix3f */ - public final void set(Matrix3f m1) { + public final void setM(Matrix3f m1) { m00 = m1.m00; m01 = m1.m01; m02 = m1.m02; @@ -640,7 +644,7 @@ * the matrix to be inverted */ public final void invertM(Matrix3f m1) { - set(m1); + setM(m1); invert(); } @@ -677,7 +681,7 @@ * @param scale * the scale factor for the matrix */ - public final void set(float scale) { + public final void setScale(float scale) { m00 = scale; m01 = 0.0f; m02 = 0.0f; @@ -864,7 +868,8 @@ * Transform the vector vec using this Matrix3f and place the result into * vecOut. * - * @param t the single precision vector to be transformed + * @param t + * the single precision vector to be transformed * @param result * the vector into which the transformed values are placed */ Modified: trunk/Jmol/src/org/jmol/util/Matrix4f.java =================================================================== --- trunk/Jmol/src/org/jmol/util/Matrix4f.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/util/Matrix4f.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -200,7 +200,7 @@ * @param t The translational components of the matrix */ public void setMV(Matrix3f m1, Vector3f t) { - set(m1); + setM3(m1); setTranslation(t); } @@ -800,7 +800,7 @@ * @param m1 * the 3x3 matrix */ - public final void set(Matrix3f m1) { + public final void setM3(Matrix3f m1) { m00 = m1.m00; m01 = m1.m01; m02 = m1.m02; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-11-20 02:33:08 UTC (rev 17729) @@ -9,8 +9,8 @@ ___version=13.1.9_dev +bug fix: ellipsoid rendering fails bug fix: translucent echo oddities in Jmol 13.1.8 -code: preliminary JavaScript Jmol DELAY command implementation bug fix: lost volume rendering in 13.1.8 bug fix: CASTEP density reader fails to reset origin to 0 0 0 in mapping bug fix: UTF files with BOM (byte order marker) present not read correctly @@ -18,20 +18,22 @@ bug fix: set picking draw no longer works in Jmol 13.0 or 13.1 bug fix: translucent echo backgrounds lost in 13.1.8 bug fix: select resno=@{n+3} fails in 12.2, 13.0, and 13.1 -code: full binary loading for JavaScript -- tested only in Firefox, but specifically +bug fix: isosurface AtomicOrbital broken in 13.1.8 + +JavaScript: delay, hover, animation, vibration, moveto, spin, timeout +JavaScript: full binary loading for JavaScript -- tested only in Firefox, but specifically designed for Chrome's insistence that synchronized AJAX processes must not be binary -code: base64 translation of encoded binary strings from JS file reading +JavaScript: base64 translation of encoded binary strings from JS file reading prefix: ";base64," initiates decoding. -code: com.json JSON package removed due to licensing issues -code: JSmol -- all references to InputStream.read(byte[]) --> InputStream.read(byte[], 0, len) +JavaScript: com.json JSON package removed due to licensing issues +JavaScript: JSmol -- all references to InputStream.read(byte[]) --> InputStream.read(byte[], 0, len) to speed file reading processing -code: JSmol -- float[].clone(), int[].clone() not supported in Java2Script -code: java.text.DateFormat not supported in Java2Script -code: Note -- org.jmol.adapter.smarter.Atom is not fully cloned +JavaScript: JSmol -- float[].clone(), int[].clone() not supported in Java2Script +JavaScript: java.text.DateFormat not supported in Java2Script +JavaScript: Note -- org.jmol.adapter.smarter.Atom is not fully cloned (anisoBorU and ellipsoid are not copied and their values must be considered "final") code: refactoring org.jmol.util into org.jmol.io and org.jmol.io2 -bug fix: isosurface AtomicOrbital broken in 13.1.8 ============================================================================= Modified: trunk/Jmol/src/org/jmol/viewer/ScriptManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ScriptManager.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/viewer/ScriptManager.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -159,7 +159,7 @@ if (isStart) { if (commandWatcherThread != null) return; - commandWatcherThread = new CommandWatcherThread(this); + commandWatcherThread = new CommandWatcherThread(viewer, this); commandWatcherThread.start(); } else { if (commandWatcherThread == null) Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -350,7 +350,7 @@ if (rotationMatrix == null) this.rotationMatrix.setIdentity(); else - this.rotationMatrix.set(rotationMatrix); + this.rotationMatrix.setM(rotationMatrix); } else { viewer.getRotation(this.rotationMatrix); } Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -137,7 +137,7 @@ Matrix3f m = (Matrix3f) viewer .getModelSetAuxiliaryInfoValue("defaultOrientationMatrix"); if (m != null) - matrixRotate.set(m); + matrixRotate.setM(m); //} setZoomEnabled(true); zoomToPercent(viewer.isModelKitMode() ? 50 : 100); @@ -360,7 +360,7 @@ z = (z < 0 ? -1 : 1) * (float) Math.sqrt(Math.abs(z)); if (factor == 0) { // mouse down sets the initial rotation and point on the sphere - arcBall0Rotation.set(matrixRotate); + arcBall0Rotation.setM(matrixRotate); arcBall0.set(x, -y, z); if (!Float.isNaN(z)) arcBall0.normalize(); @@ -372,7 +372,7 @@ arcBall1.normalize(); arcBallAxis.cross(arcBall0, arcBall1); axisangleT.setVA(arcBallAxis, factor * (float) Math.acos(arcBall0.dot(arcBall1))); - matrixRotate.set(arcBall0Rotation); + matrixRotate.setM(arcBall0Rotation); rotateAxisAngle2(axisangleT, null); } @@ -776,13 +776,13 @@ public void setRotation(Matrix3f matrixRotation) { if (!Float.isNaN(matrixRotation.m00)) - matrixRotate.set(matrixRotation); + matrixRotate.setM(matrixRotation); } public void getRotation(Matrix3f matrixRotation) { // hmm ... I suppose that there could be a race condiditon here // if matrixRotate is being modified while this is called - matrixRotation.set(matrixRotate); + matrixRotation.setM(matrixRotate); } /* *************************************************************** @@ -1310,7 +1310,7 @@ matrixTemp.setZero(); matrixTemp.setTranslation(vectorTemp); unscaled.sub(matrixTemp); - matrixTemp.set(matrixRotate); + matrixTemp.setM3(matrixRotate); unscaled.mul2(matrixTemp, unscaled); return unscaled; } @@ -1541,7 +1541,7 @@ // multiply by angular rotations // this is *not* the same as matrixTransform.mul(matrixRotate); - matrixTemp.set(stereoFrame ? matrixStereo : matrixRotate); + matrixTemp.setM3(stereoFrame ? matrixStereo : matrixRotate); matrixTransform.mul2(matrixTemp, matrixTransform); // cale to screen coordinates matrixTemp.setIdentity(); Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-11-20 02:28:15 UTC (rev 17728) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-11-20 02:33:08 UTC (rev 17729) @@ -10865,7 +10865,7 @@ private void clearThreads() { if (scriptDelayThread != null) { - scriptDelayThread.discontinue(); + scriptDelayThread.interrupt(); scriptDelayThread = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |