From: <ha...@us...> - 2012-06-05 18:16:49
|
Revision: 17264 http://jmol.svn.sourceforge.net/jmol/?rev=17264&view=rev Author: hansonr Date: 2012-06-05 18:16:36 +0000 (Tue, 05 Jun 2012) Log Message: ----------- version=12.3.29_dev # new feature: set MESHSCALE (default 1) also allows isosurface/mo mesh scaling # -- was DOTSCALE in 12.3.26, but that is not appropriate Modified Paths: -------------- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java trunk/Jmol/src/org/jmol/script/Token.java trunk/Jmol/src/org/jmol/shapespecial/Draw.java trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java trunk/Jmol/src/org/jmol/util/MeshSurface.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/StateManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -16176,6 +16176,12 @@ } //TODO: check for compatibility with LCAOCARTOONS switch (tok) { + case Token.bitset: + case Token.expressionBegin: + data = atomExpression(i + 1); + tok = Token.decimal; + iToken++; + break; case Token.off: iToken = i + 1; return new Integer(Integer.MIN_VALUE); Modified: trunk/Jmol/src/org/jmol/script/Token.java =================================================================== --- trunk/Jmol/src/org/jmol/script/Token.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/script/Token.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -881,10 +881,11 @@ public final static int historylevel = intparam | 20; public final static int isosurfacepropertysmoothingpower=intparam | 21; public final static int loglevel = intparam | 22; - public final static int minimizationsteps = intparam | 23; - public final static int minpixelselradius = intparam | 24; - public final static int percentvdwatom = intparam | 25; - public final static int perspectivemodel = intparam | 26; + public final static int meshscale = intparam | 23; + public final static int minimizationsteps = intparam | 24; + public final static int minpixelselradius = intparam | 25; + public final static int percentvdwatom = intparam | 26; + public final static int perspectivemodel = intparam | 27; public final static int phongexponent = intparam | 28; public final static int pickingspinrate = intparam | 30; public final static int propertyatomnumberfield = intparam | 31; @@ -2238,6 +2239,7 @@ "historyLevel", new Token(historylevel), "lighting", new Token(lighting), "logLevel", new Token(loglevel), + "meshScale", new Token(meshscale), "minimizationSteps", new Token(minimizationsteps), "minPixelSelRadius", new Token(minpixelselradius), "percentVdwAtom", new Token(percentvdwatom), Modified: trunk/Jmol/src/org/jmol/shapespecial/Draw.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/Draw.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/shapespecial/Draw.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -650,7 +650,7 @@ private void setSlabData() { if (plane != null) { - slabData.getIntersection(0, plane, null, null, null, null, false, true, Token.plane, false); + slabData.getIntersection(0, plane, null, null, null, null, null, false, true, Token.plane, false); polygon = new ArrayList<Object>(); polygon.add(slabData.vertices); polygon.add(slabData.polygonIndexes); Modified: trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -668,7 +668,7 @@ if (mesh == null) return false; data[3] = Integer.valueOf(mesh.modelIndex); - mesh.getIntersection(0, (Point4f) data[1], null, (List<Point3f[]>) data[2], null, null, false, false, Token.plane, false); + mesh.getIntersection(0, (Point4f) data[1], null, (List<Point3f[]>) data[2], null, null, null, false, false, Token.plane, false); return true; } if (property == "getBoundingBox") { Modified: trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -908,8 +908,8 @@ for (int i = 1; i < 27; i++) { vGammaToKPoint.set(pts[i]); Measure.getBisectingPlane(pts[0], vGammaToKPoint, ptTemp, vTemp, planeGammaK); - getIntersection(1, planeGammaK, null, null, null, null, false, false, - Token.plane, true); + getIntersection(1, planeGammaK, null, null, null, null, null, false, + false, Token.plane, true); //System.out.println("#slab " + i + " " + bsSlabGhost.cardinality()); //System.out.println("isosurface s" + i + " plane " + Escape.escape(plane) Modified: trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -420,7 +420,7 @@ } if (diam == Integer.MIN_VALUE) { if (imesh.diameter <= 0) { - diam = viewer.getDotScale(); + diam = viewer.getMeshScale(); } else { diam = viewer.getScreenDim() / 100; } Modified: trunk/Jmol/src/org/jmol/util/MeshSurface.java =================================================================== --- trunk/Jmol/src/org/jmol/util/MeshSurface.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/util/MeshSurface.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -352,11 +352,15 @@ sb.append("brillouin"); slabBrillouin((Point3f[]) slabbingObject); break; + case Token.decimal: + getIntersection(0, null, null, null, null, (BitSet) slabbingObject, null, andCap, + false, Token.decimal, isGhost); + break; case Token.plane: Point4f plane = (Point4f) slabbingObject; sb.append(Escape.escape(plane)); - getIntersection(0, plane, null, null, null, null, andCap, false, - Token.plane, isGhost); + getIntersection(0, plane, null, null, null, null, null, andCap, + false, Token.plane, isGhost); break; case Token.unitcell: case Token.boundbox: @@ -364,13 +368,13 @@ sb.append("within ").append(Escape.escape(box)); Point4f[] faces = BoxInfo.getFacesFromCriticalPoints(box); for (int i = 0; i < faces.length; i++) { - getIntersection(0, faces[i], null, null, null, null, andCap, false, - Token.plane, isGhost); + getIntersection(0, faces[i], null, null, null, null, null, andCap, + false, Token.plane, isGhost); } break; case Token.data: getIntersection(0, null, null, null, (float[]) slabbingObject, null, - false, false, Token.min, isGhost); + null, false, false, Token.min, isGhost); break; case Token.within: case Token.range: @@ -383,8 +387,8 @@ BitSet bs = (BitSet) o[2]; sb.append("within ").append(distance).append( bs == null ? Escape.escape(points) : Escape.escape(bs)); - getIntersection(distance, null, points, null, null, null, andCap, - false, (distance > 0 ? Token.distance : Token.sphere), isGhost); + getIntersection(distance, null, points, null, null, null, null, + andCap, false, (distance > 0 ? Token.distance : Token.sphere), isGhost); break; case Token.range: // isosurface slab within range x.x y.y @@ -395,12 +399,12 @@ sb.append("within range ").append(distance).append(" ").append( distanceMax); bs = (distanceMax < distance ? BitSetUtil.copy(bsSlabDisplay) : null); - getIntersection(distance, null, null, null, null, null, andCap, false, - Token.min, isGhost); + getIntersection(distance, null, null, null, null, null, null, andCap, + false, Token.min, isGhost); BitSet bsA = (bs == null ? null : BitSetUtil.copy(bsSlabDisplay)); BitSetUtil.copy(bs, bsSlabDisplay); - getIntersection(distanceMax, null, null, null, null, null, andCap, - false, Token.max, isGhost); + getIntersection(distanceMax, null, null, null, null, null, null, + andCap, false, Token.max, isGhost); if (bsA != null) bsSlabDisplay.or(bsA); break; @@ -408,8 +412,8 @@ //NOT IMPLEMENTED MeshSurface mesh = (MeshSurface) o[1]; //distance = -1; - getIntersection(0, null, null, null, null, mesh, andCap, false, - distance < 0 ? Token.min : Token.max, isGhost); + getIntersection(0, null, null, null, null, null, mesh, andCap, + false, distance < 0 ? Token.min : Token.max, isGhost); //TODO: unresolved how exactly to store this in the state // -- must indicate exact set of triangles to slab and how! break; @@ -481,6 +485,7 @@ * @param ptCenters a set of atoms to measure distance from * @param vData when not null, this is a query, not an actual slabbing * @param fData vertex values or other data to overlay + * @param bsSource TODO * @param meshSurface second surface; not implemented -- still some problems there * @param andCap to cap this off, crudely only * @param doClean compact set - draw only @@ -489,9 +494,9 @@ */ public void getIntersection(float distance, Point4f plane, Point3f[] ptCenters, List<Point3f[]> vData, - float[] fData, MeshSurface meshSurface, - boolean andCap, boolean doClean, int tokType, - boolean isGhost) { + float[] fData, BitSet bsSource, + MeshSurface meshSurface, boolean andCap, boolean doClean, + int tokType, boolean isGhost) { boolean isSlab = (vData == null); Point3f[] pts = null; if (fData == null) @@ -530,7 +535,7 @@ for (int i = mergeVertexCount0; i < vertexCount; i++) { if (Float.isNaN(fData[i]) || checkSlab(tokType, vertices[i], fData[i], distance, plane, - ptCenters) > 0) + ptCenters, bsSource) > 0) bsSlabDisplay.clear(i); } return; @@ -553,9 +558,9 @@ sourceB = vertexSource[iB]; sourceC = vertexSource[iC]; } - d1 = checkSlab(tokType, vA, valA, distance, plane, ptCenters); - d2 = checkSlab(tokType, vB, valB, distance, plane, ptCenters); - d3 = checkSlab(tokType, vC, valC, distance, plane, ptCenters); + d1 = checkSlab(tokType, vA, valA, (bsSource == null ? distance : sourceA), plane, ptCenters, bsSource); + d2 = checkSlab(tokType, vB, valB, (bsSource == null ? distance : sourceB), plane, ptCenters, bsSource); + d3 = checkSlab(tokType, vC, valC, (bsSource == null ? distance : sourceC), plane, ptCenters, bsSource); int test1 = (d1 != 0 && d1 < 0 ? 1 : 0) + (d2 != 0 && d2 < 0 ? 2 : 0) + (d3 != 0 && d3 < 0 ? 4 : 0); @@ -885,9 +890,11 @@ } private static float checkSlab(int tokType, Point3f v, float val, float distance, - Point4f plane, Point3f[] ptCenters) { + Point4f plane, Point3f[] ptCenters, BitSet bs) { float d; switch (tokType) { + case Token.decimal: + return (bs.get((int)val) ? 1 : -1); case Token.min: d = distance - val; break; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-06-05 18:16:36 UTC (rev 17264) @@ -5,6 +5,9 @@ version=12.3.29_dev +# new feature: set MESHSCALE (default 1) also allows isosurface/mo mesh scaling +# -- was DOTSCALE in 12.3.26, but that is not appropriate + # bug fix: script javascript:xxxx() broken for Jmol object javascript # bug fix: JmolCore.js fix for getPropertyAsArray @@ -132,7 +135,6 @@ # -- minimizationCallback reports actual force field used # # new feature: set energyUnits kJ|kcal -# new feature: set DOTSCALE (default 1) also allows isosurface/mo mesh scaling # new feature: antialiased display and image creation uses larger mesh scaling for cleaner look # # code: adding empirical rules to MMFF94 calculation Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -881,6 +881,7 @@ setParameterValue("measureAllModels", measureAllModels); setParameterValue("measurementLabels", measurementLabels); setParameterValue("measurementUnits", measureDistanceUnits); + setParameterValue("meshScale", meshScale); setParameterValue("messageStyleChime", messageStyleChime); setParameterValue("minBondDistance", minBondDistance); setParameterValue("minPixelSelRadius", minPixelSelRadius); @@ -1146,6 +1147,7 @@ boolean dotSurface = true; int dotDensity = 3; int dotScale = 1; + int meshScale = 1; boolean dynamicMeasurements = false; boolean greyscaleRendering = false; boolean isosurfaceKey = false; Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-06-05 15:38:28 UTC (rev 17263) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-06-05 18:16:36 UTC (rev 17264) @@ -6181,6 +6181,10 @@ private void setIntProperty(String key, int tok, int value) { switch (tok) { + case Token.meshscale: + // 12.3.29 + global.meshScale = value; + break; case Token.minpixelselradius: // 12.2.RC6 global.minPixelSelRadius = value; @@ -7010,6 +7014,10 @@ return global.dotScale; } + public int getMeshScale() { + return global.meshScale; + } + public boolean isRangeSelected() { return global.rangeSelected; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |