From: <ha...@us...> - 2010-08-27 19:37:10
|
Revision: 14163 http://jmol.svn.sourceforge.net/jmol/?rev=14163&view=rev Author: hansonr Date: 2010-08-27 19:37:04 +0000 (Fri, 27 Aug 2010) Log Message: ----------- version=12.1.9_dev # bug fix: failure to read old-style JVXL files. Modified Paths: -------------- trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2010-08-27 18:05:22 UTC (rev 14162) +++ trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2010-08-27 19:37:04 UTC (rev 14163) @@ -685,21 +685,21 @@ vs.add(v); } int n = vs.size(); - if (n > 0) + if (n > 0) { jvxlData.vContours = ArrayUtil.createArrayOfArrayList(n); - // 3D contour values and colors - jvxlData.contourColixes = params.contourColixes = new short[n]; - jvxlData.contourValues = params.contoursDiscrete = new float[n]; - for (int i = 0; i < n; i++) { - jvxlData.vContours[i] = vs.get(i); - jvxlData.contourValues[i] = ((Float) jvxlData.vContours[i].get(2)).floatValue(); - jvxlData.contourColixes[i] = ((short[]) jvxlData.vContours[i].get(3))[0]; + // 3D contour values and colors + jvxlData.contourColixes = params.contourColixes = new short[n]; + jvxlData.contourValues = params.contoursDiscrete = new float[n]; + for (int i = 0; i < n; i++) { + jvxlData.vContours[i] = vs.get(i); + jvxlData.contourValues[i] = ((Float) jvxlData.vContours[i].get(2)) + .floatValue(); + jvxlData.contourColixes[i] = ((short[]) jvxlData.vContours[i].get(3))[0]; + } + jvxlData.contourColors = Graphics3D.getHexCodes(jvxlData.contourColixes); + Logger.info("JVXL read: " + n + " discrete contours"); + Logger.info("JVXL read: contour values: " + values); + Logger.info("JVXL read: contour colors: " + colors); } - Logger.info("JVXL read: " + n + " discrete contours"); - Logger.info("JVXL read: contour values: " + values); - Logger.info("JVXL read: contour colors: " + colors); - jvxlData.contourColors = Graphics3D.getHexCodes(jvxlData.contourColixes); } - - } Modified: trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java 2010-08-27 18:05:22 UTC (rev 14162) +++ trunk/Jmol/src/org/jmol/shapesurface/IsosurfaceMesh.java 2010-08-27 19:37:04 UTC (rev 14163) @@ -447,7 +447,7 @@ public void setDiscreteColixes(float[] values, short[] colixes) { if (values != null) jvxlData.contourValues = values; - if (values == null) + if (values == null || values.length == 0) values = jvxlData.contourValues = jvxlData.contourValuesUsed; if (colixes == null && jvxlData.contourColixes != null) { colixes = jvxlData.contourColixes; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-08-27 18:05:22 UTC (rev 14162) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-08-27 19:37:04 UTC (rev 14163) @@ -3,6 +3,7 @@ version=12.1.9_dev +# bug fix: failure to read old-style JVXL files. # bug fix: reading nth model from a file within a ZIP collection not possible # -------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |