From: <ha...@us...> - 2011-06-14 23:19:13
|
Revision: 15589 http://jmol.svn.sourceforge.net/jmol/?rev=15589&view=rev Author: hansonr Date: 2011-06-14 23:19:06 +0000 (Tue, 14 Jun 2011) Log Message: ----------- version=12.1.50_dev # bug fix: isosurface SLAB not saved in JVXL; (now as vertex data only) Modified Paths: -------------- trunk/Jmol/src/org/jmol/jvxl/data/JvxlCoder.java trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java trunk/Jmol/src/org/jmol/shape/Mesh.java trunk/Jmol/src/org/jmol/shapesurface/Isosurface.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 Modified: trunk/Jmol/src/org/jmol/jvxl/data/JvxlCoder.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/data/JvxlCoder.java 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/jvxl/data/JvxlCoder.java 2011-06-14 23:19:06 UTC (rev 15589) @@ -558,7 +558,7 @@ JvxlData jvxlData, MeshData meshData, boolean escapeXml) { int[] vertexIdNew = new int[meshData.vertexCount]; if (appendXmlTriangleData(sb, meshData.polygonIndexes, - meshData.polygonCount, vertexIdNew, escapeXml)) + meshData.polygonCount, meshData.bsSlabDisplay, vertexIdNew, escapeXml)) appendXmlVertexData(sb, jvxlData, vertexIdNew, meshData.vertices, meshData.vertexValues, meshData.vertexCount, meshData.polygonColorData, meshData.polygonCount, @@ -608,12 +608,13 @@ * @param sb * @param triangles * @param nData + * @param bsInclude * @param vertexIdNew * @param escapeXml * @return (triangles are present) */ private static boolean appendXmlTriangleData(StringBuffer sb, int[][] triangles, int nData, - int[] vertexIdNew, boolean escapeXml) { + BitSet bsInclude, int[] vertexIdNew, boolean escapeXml) { StringBuffer list1 = new StringBuffer(); int ilast = 1; int p = 0; @@ -621,7 +622,7 @@ boolean addPlus = false; int nTri = 0; for (int i = 0; i < nData;) { - if (triangles[i] == null) { + if (triangles[i] == null || (bsInclude != null && !bsInclude.get(i))) { i++; continue; } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2011-06-14 23:19:06 UTC (rev 15589) @@ -54,7 +54,7 @@ protected int colorDataCount; private int excludedTriangleCount; private int excludedVertexCount; - private int invalidatedVertexCount; + private int invalidatedVertexCount; protected boolean haveContourData; private XmlReader xr; Modified: trunk/Jmol/src/org/jmol/shape/Mesh.java =================================================================== --- trunk/Jmol/src/org/jmol/shape/Mesh.java 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/shape/Mesh.java 2011-06-14 23:19:06 UTC (rev 15589) @@ -118,7 +118,7 @@ public void clear(String meshType) { bsDisplay = null; - bsValid = null; + bsSlabDisplay = null; connections = null; vertexCount0 = polygonCount0 = vertexCount = polygonCount = 0; scale = 1; Modified: trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2011-06-14 23:19:06 UTC (rev 15589) @@ -395,6 +395,7 @@ } if (thisMesh != null && thisMesh.polygonCount != 0) { thisMesh.slabPolygons((Object[]) value); + thisMesh.jvxlData.vertexDataOnly = true; thisMesh.initialize(thisMesh.lighting, null, null); if (thisMesh.colorEncoder != null) { thisMesh.vertexColixes = null; @@ -926,6 +927,9 @@ thisMesh.ptCenter.set(center); thisMesh.ptOffset = offset; thisMesh.scale3d = (thisMesh.jvxlData.jvxlPlane == null ? 0 : scale3d); + if (thisMesh.bsSlabDisplay != null) + thisMesh.jvxlData.vertexDataOnly = true; +// thisMesh.bsSlabDisplay = thisMesh.jvxlData.bsSlabDisplay; } /* @@ -1143,7 +1147,7 @@ meshData.polygonCount = mesh.polygonCount; meshData.polygonIndexes = mesh.polygonIndexes; meshData.polygonColixes = mesh.polygonColixes; - meshData.bsValid = mesh.bsValid; + meshData.bsSlabDisplay = mesh.bsSlabDisplay; meshData.polygonCount0 = mesh.polygonCount0; meshData.vertexCount0 = mesh.vertexCount0; meshData.slabOptions = mesh.slabOptions; @@ -1168,7 +1172,7 @@ mesh.polygonCount = meshData.polygonCount; mesh.polygonIndexes = meshData.polygonIndexes; mesh.polygonColixes = meshData.polygonColixes; - mesh.bsValid = meshData.bsValid; + mesh.bsSlabDisplay = meshData.bsSlabDisplay; mesh.polygonCount0 = meshData.polygonCount0; mesh.vertexCount0 = meshData.vertexCount0; mesh.slabOptions = meshData.slabOptions; Modified: trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceRenderer.java 2011-06-14 23:19:06 UTC (rev 15589) @@ -256,7 +256,7 @@ for (int i = imesh.polygonCount; --i >= 0;) { int[] vertexIndexes = polygonIndexes[i]; - if (vertexIndexes == null || imesh.bsValid != null && !imesh.bsValid.get(i)) + if (vertexIndexes == null || imesh.bsSlabDisplay != null && !imesh.bsSlabDisplay.get(i)) continue; int iA = vertexIndexes[0]; int iB = vertexIndexes[1]; Modified: trunk/Jmol/src/org/jmol/util/MeshSurface.java =================================================================== --- trunk/Jmol/src/org/jmol/util/MeshSurface.java 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/util/MeshSurface.java 2011-06-14 23:19:06 UTC (rev 15589) @@ -105,8 +105,8 @@ polygonIndexes = new int[SEED_COUNT][]; else if (polygonCount == polygonIndexes.length) polygonIndexes = (int[][]) ArrayUtil.doubleLength(polygonIndexes); - if (bsValid != null) - bsValid.set(polygonCount); + if (bsSlabDisplay != null) + bsSlabDisplay.set(polygonCount); polygonIndexes[polygonCount++] = polygon; return n; } @@ -169,14 +169,14 @@ public void invalidatePolygons() { for (int i = polygonCount; --i >= 0;) - if ((bsValid == null || bsValid.get(i)) && !setABC(i)) + if ((bsSlabDisplay == null || bsSlabDisplay.get(i)) && !setABC(i)) polygonIndexes[i] = null; } protected int iA, iB, iC; protected boolean setABC(int i) { - if (bsValid != null && !bsValid.get(i)) + if (bsSlabDisplay != null && !bsSlabDisplay.get(i)) return false; int[] vertexIndexes = polygonIndexes[i]; return vertexIndexes != null @@ -187,7 +187,7 @@ public int polygonCount0; public int vertexCount0; - public BitSet bsValid; + public BitSet bsSlabDisplay; public StringBuffer slabOptions; public void slabPolygons(List<Object[]> slabInfo) { @@ -198,11 +198,11 @@ public void slabPolygons(Object[] slabInfo) { Object slabbingObject = slabInfo[0]; if (slabbingObject == null) { - if (bsValid != null) { + if (bsSlabDisplay != null) { polygonCount = polygonCount0; vertexCount = vertexCount0; polygonCount0 = vertexCount0 = 0; - bsValid.set(0, polygonCount); + bsSlabDisplay.set(0, polygonCount); slabOptions = new StringBuffer(" slab none"); } return; @@ -210,8 +210,8 @@ if (polygonCount0 == 0 || vertexCount0 == 0) { polygonCount0 = polygonCount; vertexCount0 = vertexCount; - bsValid = new BitSet(); - bsValid.set(0, polygonCount); + bsSlabDisplay = new BitSet(); + bsSlabDisplay.set(0, polygonCount); if (polygonCount == 0 && vertexCount == 0) return; } @@ -448,7 +448,7 @@ addTriangleCheck(iA, iD, iE, check1 & 5 | 2, check2, 0); break; } - bsValid.clear(i); + bsSlabDisplay.clear(i); if (andCap && iD > 0) iPts.add(new int[] { iD, iE }); } else if (pts != null) { Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-06-14 21:38:21 UTC (rev 15588) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-06-14 23:19:06 UTC (rev 15589) @@ -3,6 +3,7 @@ version=12.1.50_dev +# bug fix: isosurface SLAB not saved in JVXL; (now as vertex data only) # note: {*}.find("MF") was not documented (Jmol 12.0) # bug fix: isosurface slab within 5.0 {3} -- should be ALL those atoms, not just center # -- as opposed to the CENTER using isosurface slab within 5.0 @{{3}.xyz} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |