From: <ha...@us...> - 2008-03-16 23:48:43
|
Revision: 9141 http://jmol.svn.sourceforge.net/jmol/?rev=9141&view=rev Author: hansonr Date: 2008-03-16 16:48:38 -0700 (Sun, 16 Mar 2008) Log Message: ----------- version=11.5.18_dev # bug fix: isosurface user VolumeData not properly loading Modified Paths: -------------- trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java trunk/Jmol/src/org/jmol/jvxl/readers/VoxelReader.java trunk/Jmol/src/org/jmol/shapespecial/Isosurface.java trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -78,6 +78,7 @@ } protected void generateCube() { + volumeData.voxelData = voxelData = new float[nPointsX][nPointsY][nPointsZ]; Hashtable moData = params.moData; try { MOCalculationInterface q = (MOCalculationInterface) Class.forName( Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -44,6 +44,7 @@ } protected void generateCube() { + volumeData.voxelData = voxelData = new float[nPointsX][nPointsY][nPointsZ]; try { MepCalculationInterface m = (MepCalculationInterface) Class.forName( JmolConstants.CLASSBASE_QUANTUM + "MepCalculation").newInstance(); Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -150,7 +150,7 @@ /////////////// calculation methods ////////////// - protected void generateCube() { + protected void generateCube() { /* * * Jmol cavity rendering. Tim Driscoll suggested "filling a @@ -170,6 +170,7 @@ * */ + volumeData.voxelData = voxelData = new float[nPointsX][nPointsY][nPointsZ]; if (isCavity && params.theProperty != null) { /* * couldn't get this to work -- we only have half of the points Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -196,16 +196,18 @@ readVoxelDataIndividually(isMapData); return; } - if (dataType != Parameters.SURFACE_INFO) { - volumeData.voxelData = voxelData = new float[nPointsX][nPointsY][nPointsZ]; - generateCube(); - } + generateCube(); if (isMapData) return; nDataPoints = JvxlReader.jvxlCreateSurfaceData(jvxlData, volumeData.voxelData, params.cutoff, params.isCutoffAbsolute, nPointsX, nPointsY, nPointsZ); } protected void generateCube() { - //generic VolumeData reader does not require this; others do. + Logger.info("data type: user volumeData"); + Logger.info("voxel grid origin:" + volumetricOrigin); + for (int i = 0; i < 3; ++i) + Logger.info("voxel grid vector:" + volumetricVectors[i]); + Logger.info("Read " + nPointsX + " x " + nPointsY + " x " + nPointsZ + + " data points"); } } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -29,6 +29,10 @@ import org.jmol.util.Parser; import org.jmol.util.Logger; + +//import org.jmol.viewer.Viewer; + + class VolumeFileReader extends VoxelReader { protected BufferedReader br; @@ -42,6 +46,7 @@ VolumeFileReader(SurfaceGenerator sg, BufferedReader br) { super(sg); this.br = br; + //Viewer.testData = volumeData; //TESTING ONLY!!! REMOVE IMPORT!!! } static String determineFileType(BufferedReader bufferedReader) { Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VoxelReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VoxelReader.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VoxelReader.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -257,14 +257,17 @@ readVolumeParameters(); jvxlData.insideOut = params.insideOut; if (justForPlane) { + float[][][] voxelDataTemp = volumeData.voxelData; volumeData.setDataDistanceToPlane(params.thePlane); if (meshDataServer != null) meshDataServer.fillMeshData(meshData, MeshData.MODE_GET_VERTICES); params.setMapRanges(this); + generateSurfaceData(); + volumeData.voxelData = voxelDataTemp; } else { readVolumeData(false); + generateSurfaceData(); } - generateSurfaceData(); jvxlData.jvxlFileHeader = jvxlFileHeaderBuffer.toString(); jvxlData.cutoff = (isJvxl ? jvxlCutoff : params.cutoff); jvxlData.pointsPerAngstrom = 1f/volumeData.volumetricVectorLengths[0]; Modified: trunk/Jmol/src/org/jmol/shapespecial/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/Isosurface.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/shapespecial/Isosurface.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -135,8 +135,6 @@ public void initShape() { super.initShape(); myType = "isosurface"; - jvxlData = new JvxlData(); - sg = new SurfaceGenerator(viewer, this, colorEncoder, null, jvxlData); } //private boolean logMessages; @@ -281,6 +279,10 @@ setScriptInfo(); setJvxlInfo(); } + if ("init" == propertyName) { + sg = new SurfaceGenerator(viewer, this, colorEncoder, null, jvxlData = new JvxlData()); + } + //surface generator only (return TRUE) or shared (return FALSE) if (sg.setParameter(propertyName, value, bs)) @@ -493,6 +495,7 @@ if (!discardAll) return; title = null; + sg = null; if (thisMesh == null) return; thisMesh.surfaceSet = null; Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -10217,6 +10217,10 @@ * */ String filename = parameterAsString(i); + if (filename.equals("TESTDATA") && Viewer.testData != null) { + propertyValue = Viewer.testData; + break; + } if (filename.length() == 0) { if (surfaceObjectSeen || planeSeen) propertyValue = viewer.getModelAuxiliaryInfo(modelIndex, Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2008-03-16 23:48:38 UTC (rev 9141) @@ -3,6 +3,8 @@ version=11.5.18_dev +# bug fix: isosurface user VolumeData not properly loading + # ----------------------------------------------------------------------------- #version=11.5.17 Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2008-03-16 14:05:17 UTC (rev 9140) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2008-03-16 23:48:38 UTC (rev 9141) @@ -6442,4 +6442,6 @@ return selectionManager.bsDeleted; } + public static Object testData; // for isosurface + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |