Revision: 20123 http://sourceforge.net/p/jmol/code/20123 Author: hansonr Date: 2014-11-25 02:53:08 +0000 (Tue, 25 Nov 2014) Log Message: ----------- Jmol.___JmolVersion="14.3.9_2014.11.24"
new feature: isosurface "==1blu" -- difference map; defaults to sigma=3 Modified Paths: -------------- trunk/Jmol/src/org/jmol/jvxl/data/JvxlData.java trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java trunk/Jmol/src/org/jmol/script/ScriptEval.java trunk/Jmol/src/org/jmol/scriptext/CmdExt.java trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/jvxl/data/JvxlData.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/data/JvxlData.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/jvxl/data/JvxlData.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -85,6 +85,7 @@ public JvxlData() { } + public String msg = ""; public boolean wasJvxl; public boolean wasCubic; @@ -191,10 +192,11 @@ contourColors = null; isSlabbable = false; mapLattice = null; - processLattice = null; meshColor = null; + msg = ""; nPointsX = 0; nVertexColors = 0; + processLattice = null; slabInfo = null; slabValue = Integer.MIN_VALUE; thisSet = Integer.MIN_VALUE; Modified: trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -80,7 +80,7 @@ void init2JXR(SurfaceGenerator sg, BufferedReader br) { init2VFR(sg, br); jvxlData.wasJvxl = isJvxl = true; - isXLowToHigh = false; + isXLowToHigh = canDownsample = false; xr = new XmlReader(br); } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -138,6 +138,8 @@ Logger.info("voxel grid origin:" + volumetricOrigin); int downsampleFactor = params.downsampleFactor; boolean downsampling = (canDownsample && downsampleFactor > 1); + if (downsampleFactor > 1 && !canDownsample) + jvxlData.msg += "\ncannot downsample this file type"; if (downsampling) { downsampleRemainders = new int[3]; Logger.info("downsample factor = " + downsampleFactor); Modified: trunk/Jmol/src/org/jmol/script/ScriptEval.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEval.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/script/ScriptEval.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -8299,7 +8299,7 @@ if (max == Float.MAX_VALUE) ce.hi = max; setShapeProperty(shapeType, "remapColor", ce); - showString(getIsosurfaceDataRange(shapeType, "")); + showString(((String) getShapeProperty(JC.SHAPE_ISOSURFACE, "dataRangeStr")).replace('\n',' ')); if (translucentLevel == Float.MAX_VALUE) return; } else if (max != Float.MAX_VALUE) { @@ -8594,15 +8594,6 @@ return filename; } - public String getIsosurfaceDataRange(int iShape, String sep) { - float[] dataRange = (float[]) getShapeProperty(iShape, "dataRange"); - return (dataRange != null && dataRange[0] != Float.MAX_VALUE - && dataRange[0] != dataRange[1] ? sep + "isosurface" - + " full data range " + dataRange[0] + " to " + dataRange[1] - + " with color scheme spanning " + dataRange[2] + " to " + dataRange[3] - : ""); - } - private P3[] getObjectBoundingBox(String id) { Object[] data = new Object[] { id, null, null }; return (getShapePropertyData(JC.SHAPE_ISOSURFACE, "getBoundingBox", data) Modified: trunk/Jmol/src/org/jmol/scriptext/CmdExt.java =================================================================== --- trunk/Jmol/src/org/jmol/scriptext/CmdExt.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/scriptext/CmdExt.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -3191,8 +3191,8 @@ if (tokProperty != T.color) { pt = new P3(); for (int iAtom = ac; --iAtom >= 0;) - data[iAtom] = atoms[iAtom].atomPropertyFloat(vwr, - tokProperty, pt); + data[iAtom] = atoms[iAtom].atomPropertyFloat(vwr, tokProperty, + pt); } } if (tokProperty == T.color) @@ -3870,10 +3870,9 @@ if (xyzdata.length != nX || xyzdata[0].length != nY || xyzdata[0][0].length != nZ) { eval.iToken = ptX; - eval.errorStr(ScriptError.ERROR_what, "xyzdata[" - + xyzdata.length + "][" + xyzdata[0].length + "][" - + xyzdata[0][0].length + "] is not of size [" + nX + "][" - + nY + "][" + nZ + "]"); + eval.errorStr(ScriptError.ERROR_what, "xyzdata[" + xyzdata.length + + "][" + xyzdata[0].length + "][" + xyzdata[0][0].length + + "] is not of size [" + nX + "][" + nY + "][" + nZ + "]"); } vxy.addLast(xyzdata); // (5) = float[][][] data //if (!surfaceObjectSeen) @@ -4135,18 +4134,22 @@ filename = info[0]; String strCutoff = (!firstPass || !Float.isNaN(cutoff) ? null : info[1]); + String diff = info[2]; if (strCutoff != null && !chk) { cutoff = Float.NaN; + String key = (diff == null ? "MAP_SIGMA_DENS" : "DIFF_SIGMA_DENS"); try { - String sfdat = vwr.getFileAsString3(strCutoff, false, null); - Logger.info(sfdat); - sfdat = PT.split(sfdat, "MAP_SIGMA_DENS")[1]; - cutoff = PT.parseFloat(sfdat); - showString("using cutoff = " + cutoff); + String sfdat = vwr.getFileAsString3(strCutoff, false, null); + Logger.info(sfdat); + sfdat = PT.split(sfdat, key)[1]; + cutoff = PT.parseFloat(sfdat); } catch (Exception e) { - Logger.error("MAP_SIGMA_DENS -- could not read " + info[1]); + Logger.error(key + " -- could not read " + strCutoff); } if (cutoff > 0) { + if (diff != null && Float.isNaN(sigma)) + sigma = 3; + showString("using cutoff = " + cutoff + (Float.isNaN(sigma) ? "" : " sigma=" + sigma)); if (!Float.isNaN(sigma)) { cutoff *= sigma; sigma = Float.NaN; @@ -4164,7 +4167,7 @@ if (bs.nextSetBit(0) >= 0) { getWithinDistanceVector(propertyList, 2.0f, null, bs, false); sbCommand.append(" within 2.0 ").append(Escape.eBS(bs)); - } + } } if (firstPass) defaultMesh = true; @@ -4281,7 +4284,7 @@ sbCommand.append(" true"); processLattice = true; i++; - } + } } break; default: @@ -4419,8 +4422,7 @@ if (doCalcVolume) { volume = (doCalcVolume ? getShapeProperty(iShape, "volume") : null); if (volume instanceof Float) - vwr.setFloatProperty("isosurfaceVolume", - ((Float) volume).floatValue()); + vwr.setFloatProperty("isosurfaceVolume", ((Float) volume).floatValue()); else vwr.g.setUserVariable("isosurfaceVolume", SV.getVariableAD((double[]) volume)); @@ -4440,18 +4442,9 @@ s = (String) getShapeProperty(iShape, "ID"); if (s != null && !eval.tQuiet) { cutoff = ((Float) getShapeProperty(iShape, "cutoff")).floatValue(); - if (Float.isNaN(cutoff) && !Float.isNaN(sigma)) { + if (Float.isNaN(cutoff) && !Float.isNaN(sigma)) Logger.error("sigma not supported"); - } - s += " created"; - if (isIsosurface) - s += " with cutoff=" + cutoff; - float[] minMax = (float[]) getShapeProperty(iShape, "minMaxInfo"); - if (minMax[0] != Float.MAX_VALUE) - s += " min=" + minMax[0] + " max=" + minMax[1]; - s += "; " + JC.shapeClassBases[iShape].toLowerCase() + " count: " - + getShapeProperty(iShape, "count"); - s += eval.getIsosurfaceDataRange(iShape, "\n"); + s += " created " + getShapeProperty(iShape, "message"); } } String sarea, svol; Modified: trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -853,14 +853,26 @@ Object ret = getPropMC(property); if (ret != null) return ret; + if (property == "message") { + String s = ""; + if (shapeID == JC.SHAPE_ISOSURFACE) + s += " with cutoff=" + jvxlData.cutoff; + if (jvxlData.dataMin != Float.MAX_VALUE) + s += " min=" + jvxlData.dataMin + " max=" + jvxlData.dataMax; + s += "; " + JC.shapeClassBases[shapeID].toLowerCase() + " count: " + + getPropMC("count"); + return s + getPropI("dataRangeStr") + jvxlData.msg; + } if (property == "dataRange") - return (thisMesh == null || jvxlData.jvxlPlane != null - && thisMesh.colorEncoder == null - ? null - : new float[] { - jvxlData.mappedDataMin, jvxlData.mappedDataMax, - (jvxlData.isColorReversed ? jvxlData.valueMappedToBlue : jvxlData.valueMappedToRed), - (jvxlData.isColorReversed ? jvxlData.valueMappedToRed : jvxlData.valueMappedToBlue)}); + return getDataRange(); + if (property == "dataRangeStr") { + float[] dataRange = getDataRange(); + return (dataRange != null && dataRange[0] != Float.MAX_VALUE + && dataRange[0] != dataRange[1] ? "\nisosurface" + + " full data range " + dataRange[0] + " to " + dataRange[1] + + " with color scheme spanning " + dataRange[2] + " to " + dataRange[3] + : ""); + } if (property == "moNumber") return Integer.valueOf(moNumber); if (property == "moLinearCombination") @@ -910,6 +922,17 @@ return null; } + private float[] getDataRange() { + return (thisMesh == null || jvxlData.jvxlPlane != null + && thisMesh.colorEncoder == null ? null : new float[] { + jvxlData.mappedDataMin, + jvxlData.mappedDataMax, + (jvxlData.isColorReversed ? jvxlData.valueMappedToBlue + : jvxlData.valueMappedToRed), + (jvxlData.isColorReversed ? jvxlData.valueMappedToRed + : jvxlData.valueMappedToBlue) }); + } + private Object calculateVolumeOrArea(boolean isArea) { if (isArea) { if (thisMesh.calculatedArea != null) Modified: trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -320,7 +320,7 @@ if (propertyName.equals("list")) { String s = (String) getPropI("list"); if (s.length() > 1) - s += "cutoff = " + getPropI("cutoff") + "\n"; + s += "cutoff = " + jvxlData.cutoff + "\n"; return vwr.getMoInfo(-1) + "\n" + s; } if (propertyName == "moNumber") Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2014-11-25 02:53:08 UTC (rev 20123) @@ -15,8 +15,12 @@ TODO: design and implement sidechain mutation -- MUTATE command ? TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT command for problems) -Jmol.___JmolVersion="14.3.9_2014.11.23" +Jmol.___JmolVersion="14.3.9_2014.11.24" +new feature: isosurface "==1blu" -- difference map; defaults to sigma=3 + +JmolVersion="14.3.9_2014.11.23" + bug fix: isosurface slab plane -xy not recognizing "-" bug fix: PNGJ writing broken bug fix: VASP CHGCAR reader not recognized for primitive cell Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2014-11-23 23:25:34 UTC (rev 20122) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2014-11-25 02:53:08 UTC (rev 20123) @@ -4307,9 +4307,15 @@ return (withPrefix ? "MOL3D::" : "") + PT.formatStringS(format, "FILE", f); case '_': // isosurface "=...", but we code that type as '_' + String diff = (f.startsWith("=") ? "_diff" : null); + if (diff != null) + f = f.substring(1); String server = FileManager.fixFileNameVariables(g.edsUrlFormat, f); + if (diff != null) + server = PT.rep(server, ".omap", "_diff.omap"); + String strCutoff = FileManager.fixFileNameVariables(g.edsUrlCutoff, f); - return new String[] { server, strCutoff }; + return new String[] { server, strCutoff, diff }; } return f; } 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