Revision: 20875 http://sourceforge.net/p/jmol/code/20875 Author: hansonr Date: 2015-12-01 05:14:58 +0000 (Tue, 01 Dec 2015) Log Message: ----------- Jmol.___JmolVersion="14.5.0_2015.11.30"
bug fix: getProperty("JSON", "variableInfo", "x") will fail if x is an array -- was problem with JSV_predict2 failing to properly map atoms between Jmol and JSME bug fix: {atomset}.sxyz gives incorrect screen coordinate when antialiased bug fix: point(pt, true|false) also modifies pt itself bug fix: point({atomset}, true) gives incorrect screen coordinate when antialiased. bug fix: point({atomset}, false) gives incorrect Cartesian coordinate when antialiased. bug fix: popup menu item "Surfaces...Off" resets atom selection bug fix: files with names containing "[]" cannot be loaded. bug fix: print {cell=555}.find("cellFormula") can fail because of 2% slop involved in defining cell=555 bug fix: {atomset}.split() [split atomset by model] returns array of strings, not array of atoms bug fix: getproperty SHAPEINFO fails if CGO is present bug fix: CGO from state deletes DRAW objects bug fix: CGO not properly isolated to current model; "fixed" not implemented Modified Paths: -------------- branches/v14_4/Jmol/src/org/jmol/api/SymmetryInterface.java branches/v14_4/Jmol/src/org/jmol/modelset/Atom.java branches/v14_4/Jmol/src/org/jmol/popup/AwtSwingPopupHelper.java branches/v14_4/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java branches/v14_4/Jmol/src/org/jmol/script/SV.java branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java branches/v14_4/Jmol/src/org/jmol/symmetry/Symmetry.java branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties Modified: branches/v14_4/Jmol/src/org/jmol/api/SymmetryInterface.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/api/SymmetryInterface.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/api/SymmetryInterface.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -156,10 +156,10 @@ public SymmetryInterface setPointGroup( SymmetryInterface pointGroupPrevious, - T3[] atomset, BS bsAtoms, + T3[] atomset, + BS bsAtoms, boolean haveVibration, - float distanceTolerance, - float linearTolerance, boolean localEnvOnly); + float distanceTolerance, float linearTolerance, boolean localEnvOnly); public void setSpaceGroup(boolean doNormalize); Modified: branches/v14_4/Jmol/src/org/jmol/modelset/Atom.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/modelset/Atom.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/modelset/Atom.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -1369,8 +1369,7 @@ return (group.chain.model.isJmolDataFrame ? getFractionalCoordPt(!vwr.g.legacyJavaFloat, false, ptTemp) : getFractionalUnitCoordPt(!vwr.g.legacyJavaFloat, false, ptTemp)); case T.screenxyz: - return P3.new3(sX, group.chain.model.ms.vwr.getScreenHeight() - - sY, sZ); + return P3.new3(vwr.antialiased ? sX / 2 : sX, vwr.getScreenHeight() - (vwr.antialiased ? sY / 2 : sY), vwr.antialiased ? sZ / 2 : sZ); case T.vibxyz: return getVibrationVector(); case T.modxyz: Modified: branches/v14_4/Jmol/src/org/jmol/popup/AwtSwingPopupHelper.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/popup/AwtSwingPopupHelper.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/popup/AwtSwingPopupHelper.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -112,6 +112,8 @@ @Override public int getItemType(SC m) { + if (m == null) + return 0; JComponent jc = ((AwtSwingComponent) m).jc; return (jc instanceof JMenu ? 4 : jc instanceof JRadioButtonMenuItem ? 3 Modified: branches/v14_4/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -1007,7 +1007,7 @@ "isosurface delete resolution 0 vdw color range -0.1 0.1 map MEP translucent" }, { "surfOpaque", "mo opaque;isosurface opaque" }, { "surfTranslucent", "mo translucent;isosurface translucent" }, - { "surfOff", "mo delete;isosurface delete;select *;dots off" }, + { "surfOff", "mo delete;isosurface delete;var ~~sel = {selected};select *;dots off;select ~~sel" }, { "FILEMOLload", "save orientation;load \"\";restore orientation;center" }, { "FILEUNITone", Modified: branches/v14_4/Jmol/src/org/jmol/script/SV.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/script/SV.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/script/SV.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -1230,10 +1230,9 @@ * * @param args * @param pt 0: to JSON, 5: to base64, 12: to bytearray, 22: to array - * @param array2D * @return formatted string */ - public static Object format(SV[] args, int pt, boolean array2D) { + public static Object format(SV[] args, int pt) { switch (args.length) { case 0: return ""; @@ -1757,4 +1756,17 @@ } return this; } + + /** + * Safely create a JSON key - object pair, allowing for already-named arrays + * + * @param key + * @param property + * @return JSON object + */ + public static Object safeJSON(String key, Object property) { + return "{" + + (property instanceof SV ? PT.esc(key) + " : " + format(new SV[] { null, (SV) property }, + 0) : PT.toJSON(key, property)) + "}"; + } } Modified: branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -1548,7 +1548,7 @@ if (pt >= 0 && args.length != 2) return false; if (pt >= 0 || args.length < 2 || args[1].tok != T.varray) { - Object o = SV.format(args, pt, false); + Object o = SV.format(args, pt); return (format.equalsIgnoreCase("json") ? mp.addXStr((String)o) : mp.addXObj(o)); } // fill an array with applied formats @@ -1557,7 +1557,7 @@ String[] sa = new String[a.size()]; for (int i = sa.length; --i >= 0;) { args2[1] = a.get(i); - sa[i] = SV.format(args2, pt, true).toString(); + sa[i] = SV.format(args2, pt).toString(); } return mp.addXAS(sa); } @@ -2093,7 +2093,7 @@ * @param mp * @param args * @param tok - * @return + * @return true * @throws ScriptException */ private boolean evaluatePlane(ScriptMathProcessor mp, SV[] args, int tok) @@ -2272,20 +2272,34 @@ Object pt = Escape.uP(s); return (pt instanceof P3 ? mp.addXPt((P3) pt) : mp.addXStr("" + pt)); case 2: - // to/from screen coordinates P3 pt3; switch (args[1].tok) { case T.off: - if ((pt3 = SV.ptValue(args[0])) == null) - return false; - // these are screen coordinates - vwr.tm.unTransformPoint(pt3, pt3); - break; case T.on: - if ((pt3 = SV.ptValue(args[0])) == null) + // to/from screen coordinates + switch (args[0].tok) { + case T.point3f: + pt3 = P3.newP((T3) args[0].value); + break; + case T.bitset: + pt3 = vwr.ms.getAtomSetCenter(SV.bsSelectVar(args[0])); + break; + default: return false; - // this is TO screen coordinates + } + if (args[1].tok == T.on) { + // this is TO screen coordinates, 0 at bottom left vwr.tm.transformPt3f(pt3, pt3); + pt3.y = vwr.tm.height - pt3.y; + if (vwr.antialiased) + pt3.scale(0.5f); + } else { + // this is FROM screen coordinates + if (vwr.antialiased) + pt3.scale(2f); + pt3.y = vwr.tm.height - pt3.y; + vwr.tm.unTransformPoint(pt3, pt3); + } break; case T.point3f: // unitcell transform Modified: branches/v14_4/Jmol/src/org/jmol/symmetry/Symmetry.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/symmetry/Symmetry.java 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/symmetry/Symmetry.java 2015-12-01 05:14:58 UTC (rev 20875) @@ -96,14 +96,14 @@ @Override public SymmetryInterface setPointGroup(SymmetryInterface siLast, - T3[] atomset, BS bsAtoms, + T3[] atomset, + BS bsAtoms, boolean haveVibration, float distanceTolerance, - float linearTolerance, - boolean localEnvOnly) { + float linearTolerance, boolean localEnvOnly) { pointGroup = PointGroup.getPointGroup(siLast == null ? null - : ((Symmetry) siLast).pointGroup, atomset, bsAtoms, haveVibration, - distanceTolerance, linearTolerance, localEnvOnly); + : ((Symmetry) siLast).pointGroup, atomset, bsAtoms, + haveVibration, distanceTolerance, linearTolerance, localEnvOnly); return this; } @@ -323,7 +323,7 @@ @Override public String getSymmetryInfoStr() { - return symmetryInfo == null ? "" : symmetryInfo.infoStr; + return (symmetryInfo == null ? "" : symmetryInfo.infoStr); } @Override @@ -379,9 +379,9 @@ boolean isAbsolute) { uc.toFractional(ptTemp, isAbsolute); // {1 1 1} here is the original cell - return (ptTemp.x >= cell.x - 1f - slop && ptTemp.x <= cell.x + slop - && ptTemp.y >= cell.y - 1f - slop && ptTemp.y <= cell.y + slop - && ptTemp.z >= cell.z - 1f - slop && ptTemp.z <= cell.z + slop); + return (ptTemp.x >= cell.x - 1f - SimpleUnitCell.SLOP && ptTemp.x <= cell.x + SimpleUnitCell.SLOP + && ptTemp.y >= cell.y - 1f - SimpleUnitCell.SLOP && ptTemp.y <= cell.y + SimpleUnitCell.SLOP + && ptTemp.z >= cell.z - 1f - SimpleUnitCell.SLOP && ptTemp.z <= cell.z + SimpleUnitCell.SLOP); } @Override Modified: branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties 2015-12-01 05:13:30 UTC (rev 20874) +++ branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties 2015-12-01 05:14:58 UTC (rev 20875) @@ -8,17 +8,18 @@ # see also http://chemapps.stolaf.edu/jmol/zip for daily updates -Jmol.___JmolVersion="14.4.0_2015.11.29" +Jmol.___JmolVersion="14.5.0_2015.11.30" +bug fix: getProperty("JSON", "variableInfo", "x") will fail if x is an array + -- was problem with JSV_predict2 failing to properly map atoms between Jmol and JSME +bug fix: {atomset}.sxyz gives incorrect screen coordinate when antialiased +bug fix: point(pt, true|false) also modifies pt itself +bug fix: point({atomset}, true) gives incorrect screen coordinate when antialiased. +bug fix: point({atomset}, false) gives incorrect Cartesian coordinate when antialiased. +bug fix: popup menu item "Surfaces...Off" resets atom selection bug fix: files with names containing "[]" cannot be loaded. bug fix: print {cell=555}.find("cellFormula") can fail because of 2% slop involved in defining cell=555 - -JmolVersion="14.4.0_2015.11.27" - bug fix: {atomset}.split() [split atomset by model] returns array of strings, not array of atoms - -JmolVersion="14.4.0_2015.11.26" - bug fix: getproperty SHAPEINFO fails if CGO is present bug fix: CGO from state deletes DRAW objects bug fix: CGO not properly isolated to current model; "fixed" not implemented This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits