Revision: 18525 http://sourceforge.net/p/jmol/code/18525 Author: hansonr Date: 2013-08-08 04:26:38 +0000 (Thu, 08 Aug 2013) Log Message: ----------- ___JmolVersion="13.2.4_dev_2013.08.07"
bug fix: shapeInfo not reporting visibility of isosurface Modified Paths: -------------- branches/v13_2/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java branches/v13_2/Jmol/src/org/jmol/script/ScriptEvaluator.java branches/v13_2/Jmol/src/org/jmol/shapesurface/Isosurface.java branches/v13_2/Jmol/src/org/jmol/smiles/SmilesParser.java branches/v13_2/Jmol/src/org/jmol/util/Parser.java branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java Modified: branches/v13_2/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java 2013-08-08 04:26:38 UTC (rev 18525) @@ -33,6 +33,7 @@ import org.jmol.util.Logger; import org.jmol.util.Matrix3f; import org.jmol.util.P3; +import org.jmol.util.Parser; import org.jmol.util.Quaternion; import org.jmol.util.SB; import org.jmol.util.Tensor; @@ -958,7 +959,7 @@ atomSetCollection.setAtomSetModelProperty("Ramanactivity", data[3]); atomSetCollection.setAtomSetName((isLongMode ? "LO " : "") + data[0] + " " + TextFormat.formatDecimal(freq, 2) + " cm-1 (" - + TextFormat.formatDecimal(Float.parseFloat(data[1]), 0) + + TextFormat.formatDecimal(Parser.fVal(data[1]), 0) + " km/Mole), " + activity); } Modified: branches/v13_2/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/script/ScriptEvaluator.java 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/script/ScriptEvaluator.java 2013-08-08 04:26:38 UTC (rev 18525) @@ -9294,8 +9294,8 @@ htParams.put("unitcell", fparams); if (iGroup == Integer.MIN_VALUE) iGroup = -1; + i = iToken + 1; } - i = iToken + 1; if (iGroup != Integer.MIN_VALUE) htParams.put("spaceGroupIndex", Integer.valueOf(iGroup)); } Modified: branches/v13_2/Jmol/src/org/jmol/shapesurface/Isosurface.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/shapesurface/Isosurface.java 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/shapesurface/Isosurface.java 2013-08-08 04:26:38 UTC (rev 18525) @@ -1536,6 +1536,7 @@ protected void addMeshInfo(IsosurfaceMesh mesh, Map<String, Object> info) { info.put("ID", (mesh.thisID == null ? "<noid>" : mesh.thisID)); + info.put("visible", Boolean.valueOf(mesh.visible)); info.put("vertexCount", Integer.valueOf(mesh.vertexCount)); if (mesh.calculatedVolume != null) info.put("volume", mesh.calculatedVolume); Modified: branches/v13_2/Jmol/src/org/jmol/smiles/SmilesParser.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/smiles/SmilesParser.java 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/smiles/SmilesParser.java 2013-08-08 04:26:38 UTC (rev 18525) @@ -641,9 +641,9 @@ isNot = true; s = s.substring(1); } - float min = (pt + 1 == pt2 ? 0 : Float.parseFloat(s)); + float min = (pt + 1 == pt2 ? 0 : Parser.fVal(s)); s = strMeasure.substring(pt2 + 1); - float max = (s.length() == 0 ? Float.MAX_VALUE : Float.parseFloat(s)); + float max = (s.length() == 0 ? Float.MAX_VALUE : Parser.fVal(s)); m = new SmilesMeasure(molecule, index, type, min, max, isNot); molecule.measures.addLast(m); if (index > 0) Modified: branches/v13_2/Jmol/src/org/jmol/util/Parser.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/util/Parser.java 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/util/Parser.java 2013-08-08 04:26:38 UTC (rev 18525) @@ -358,10 +358,23 @@ } private final static float[] decimalScale = { 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, - 0.000001f, 0.0000001f, 0.00000001f }; + 0.000001f, 0.0000001f, 0.00000001f, + 0.000000001f, 0.0000000001f, 0.00000000001f, + 0.000000000001f, 0.000000000001f, 0.000000000001f, + }; private final static float[] tensScale = { 10, 100, 1000, 10000, 100000, 1000000 }; + /** + * A float parser that is 30% faster than Float.parseFloat(x) and + * also accepts x.yD+-n + * + * @param str + * @param ichMax + * @param next pointer; incremented + * @param isStrict + * @return value or Float.NaN + */ private static float parseFloatChecked(String str, int ichMax, int[] next, boolean isStrict) { boolean digitSeen = false; float value = 0; @@ -376,27 +389,31 @@ negative = true; } char ch = 0; + int ival = 0; while (ich < ichMax && (ch = str.charAt(ich)) >= '0' && ch <= '9') { - value = value * 10 + (ch - '0'); + ival = (ival << 3) + (ival << 1) + (ch - '0'); ++ich; digitSeen = true; } boolean isDecimal = false; + int ival2 = 0; + int iscale = 0; if (ch == '.') { isDecimal = true; - int iscale = 0; while (++ich < ichMax && (ch = str.charAt(ich)) >= '0' && ch <= '9') { - if (iscale < decimalScale.length) - value += (ch - '0') * decimalScale[iscale]; - ++iscale; + if (iscale < decimalScale.length) { + ival2 = (ival2 << 3) + (ival2 << 1) + (ch - '0'); + iscale++; + } digitSeen = true; } } + value = ival; + if (ival2 != 0) + value += ival2 * decimalScale[iscale - 1]; boolean isExponent = false; if (!digitSeen) value = Float.NaN; - else if (negative) - value = -value; if (ich < ichMax && (ch == 'E' || ch == 'e' || ch == 'D')) { isExponent = true; if (++ich >= ichMax) @@ -408,18 +425,18 @@ int exponent = parseIntChecked(str, ichMax, next); if (exponent == Integer.MIN_VALUE) return Float.NaN; - if (exponent > 0) - value *= ((exponent < tensScale.length) ? tensScale[exponent - 1] - : Math.pow(10, exponent)); - else if (exponent < 0) - value *= ((-exponent < decimalScale.length) ? decimalScale[-exponent - 1] - : Math.pow(10, exponent)); + if (exponent > 0 && exponent <= tensScale.length) + value *= tensScale[exponent - 1]; + else if (exponent < 0 && -exponent <= decimalScale.length) + value *= decimalScale[-exponent - 1]; + else if (exponent != 0) + value *= Math.pow(10, exponent); } else { next[0] = ich; // the exponent code finds its own ichNextParse } - if (value == Float.NEGATIVE_INFINITY) - value = -Float.MAX_VALUE; - else if (value == Float.POSITIVE_INFINITY) + if (negative) + value = -value; + if (value == Float.POSITIVE_INFINITY) value= Float.MAX_VALUE; return (!isStrict || (!isExponent || isDecimal) && checkTrailingText(str, next[0], ichMax) Modified: branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-08-08 04:26:38 UTC (rev 18525) @@ -9,8 +9,12 @@ # Don't use ___ in your text, as that is the key for stripping out # the information saved in the JAR version of this file. -___JmolVersion="13.2.4_dev_2013.07.30" +___JmolVersion="13.2.4_dev_2013.08.07" +bug fix: shapeInfo not reporting visibility of isosurface +code: Even faster float parsing +bug fix: filter lost after CENTROID or PACKED load option +bug fix: set rangeSelected not functional bug fix: minimization can fail after MMFF switches to UFF. bug fix: CIF reader fix for no element given "phenyl1" in ZjzxlegN.cif Modified: branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java 2013-08-08 03:55:19 UTC (rev 18524) +++ branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java 2013-08-08 04:26:38 UTC (rev 18525) @@ -3473,7 +3473,7 @@ public void setCurrentColorRange(String label) { float[] data = getDataFloat(label); BS bs = (data == null ? null : (BS) (dataManager.getData(label))[2]); - if (bs != null && getBoolean(T.rangeselected)) + if (bs != null && global.rangeSelected) bs.and(getSelectionSet(false)); setCurrentColorRangeData(data, bs); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits