From: <ha...@us...> - 2007-03-08 21:07:05
|
Revision: 7059 http://svn.sourceforge.net/jmol/?rev=7059&view=rev Author: hansonr Date: 2007-03-08 13:07:00 -0800 (Thu, 08 Mar 2007) Log Message: ----------- 11.1.20 bug fix in isosurface for selective coloring Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/Isosurface.java Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-03-08 19:06:26 UTC (rev 7058) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-03-08 21:07:00 UTC (rev 7059) @@ -1631,12 +1631,12 @@ return atom.getMoleculeNumber(); case Token.temperature: // 0 - 9999 propertyValue = atom.getBfactor100(); - return (propertyValue < 0 ? Integer.MAX_VALUE : propertyValue); + return (propertyValue < 0 ? Integer.MAX_VALUE : asInt ? propertyValue : propertyValue / 100f); case Token.surfacedistance: if (frame.getSurfaceDistanceMax() == 0) dots(statementLength, Dots.DOTS_MODE_CALCONLY); propertyValue = atom.getSurfaceDistance100(); - return (propertyValue < 0 ? Integer.MAX_VALUE : propertyValue); + return (propertyValue < 0 ? Integer.MAX_VALUE : asInt ? propertyValue : propertyValue / 100f); case Token.occupancy: return atom.getOccupancy(); case Token.polymerLength: Modified: trunk/Jmol/src/org/jmol/viewer/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Isosurface.java 2007-03-08 19:06:26 UTC (rev 7058) +++ trunk/Jmol/src/org/jmol/viewer/Isosurface.java 2007-03-08 21:07:00 UTC (rev 7059) @@ -2257,6 +2257,8 @@ float x21, float x22) { float v1 = x11 + fx * (x12 - x11); float v2 = x21 + fx * (x22 - x21); +// if (v1 + fy*(v2-v1) > 100) +// System.out.println ("getfrac " + x11 + " " + x12 + " " + x21 + " " + x22 + " " + v1 + " " + v2); return v1 + fy * (v2 - v1); } @@ -4773,7 +4775,7 @@ for (int x = 0; x < nPointsX; ++x) for (int y = 0; y < nPointsY; ++y) for (int z = 0; z < nPointsZ; ++z) - property[x][y][z] = maxValue; + property[x][y][z] = Float.NaN; isProperty = true; propMax = theProperty.length; solvMax = solvent_atomNo.length; @@ -4795,9 +4797,11 @@ float v = ptXyzTemp.distance(ptA) - rA; if (v < voxelData[i][j][k]) { voxelData[i][j][k] = (isNearby ? Float.NaN : v); - if (isProperty && iAtom < solvMax - && (iPt = solvent_atomNo[iAtom]) >= 0 && iPt < propMax) + if (isProperty && iAtom < solvMax + && (iPt = solvent_atomNo[iAtom]) >= 0 && iPt < propMax) { property[i][j][k] = theProperty[iPt]; + //System.out.println("theprop "+ iPt + " ijk " + i + " " + j + " " + k + " = " + theProperty[iPt]); + } } ptXyzTemp.add(volumetricVectors[2]); } @@ -4808,8 +4812,6 @@ ptXyzTemp.add(volumetricVectors[0]); } } - if (dataType == SURFACE_PROPERTY) - voxelData = property; if ((dataType == SURFACE_SOLVENT || dataType == SURFACE_MOLECULAR) && solventRadius > 0) { Point3i ptA0 = new Point3i(); @@ -4857,8 +4859,14 @@ ptXyzTemp); if (!Float.isNaN(dVS)) { float v = solventRadius - dVS; - if (v < voxelData[i][j][k]) + if (v < voxelData[i][j][k]) { voxelData[i][j][k] = v; + if (isProperty && iAtom < solvMax + && (iPt = solvent_atomNo[iAtom]) >= 0 && iPt < propMax) { + property[i][j][k] = theProperty[iPt]; + //System.out.println("theprop "+ iPt + " ijk " + i + " " + j + " " + k + " = " + theProperty[iPt]); + } + } } ptXyzTemp.add(volumetricVectors[2]); } @@ -4871,7 +4879,16 @@ } } } - if (thePlane != null) { + if (dataType == SURFACE_PROPERTY) + voxelData = property; + if (thePlane == null) { + for (int i = pt0.x; i < pt1.x; i++) + for (int j = pt0.y; j < pt1.y; j++) + for (int k = pt0.z; k < pt1.z; k++) + if (voxelData[i][j][k] == Float.MAX_VALUE) + voxelData[i][j][k] = Float.NaN; + + } else { maxValue = 0.001f; for (int x = 0; x < nPointsX; ++x) for (int y = 0; y < nPointsY; ++y) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |