From: <ha...@us...> - 2013-05-31 14:48:12
|
Revision: 18267 http://sourceforge.net/p/jmol/code/18267 Author: hansonr Date: 2013-05-31 14:48:08 +0000 (Fri, 31 May 2013) Log Message: ----------- ___JmolVersion="13.1.16_dev_2013.05.31" bug fix: JavaScript reading of old-style JVXL files Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java trunk/Jmol/src/org/jmol/jvxl/readers/ApbsReader.java trunk/Jmol/src/org/jmol/jvxl/readers/AtomDataReader.java trunk/Jmol/src/org/jmol/jvxl/readers/AtomPropertyMapper.java trunk/Jmol/src/org/jmol/jvxl/readers/CastepDensityReader.java trunk/Jmol/src/org/jmol/jvxl/readers/CubeReader.java trunk/Jmol/src/org/jmol/jvxl/readers/DelPhiBinaryReader.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoFxyReader.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoIntersectReader.java 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/IsoPlaneReader.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoShapeReader.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java trunk/Jmol/src/org/jmol/jvxl/readers/JaguarReader.java trunk/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java trunk/Jmol/src/org/jmol/jvxl/readers/PltFormattedReader.java trunk/Jmol/src/org/jmol/jvxl/readers/PolygonFileReader.java trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceFileReader.java trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java trunk/Jmol/src/org/jmol/jvxl/readers/UhbdReader.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/XsfReader.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -28,7 +28,6 @@ import org.jmol.api.JmolAdapter; import org.jmol.api.JmolDocument; import org.jmol.api.SymmetryInterface; -import org.jmol.modelset.ModelSet; import org.jmol.util.BS; import org.jmol.util.BSUtil; import org.jmol.util.Logger; @@ -1577,7 +1576,6 @@ } /** - * @param modelSet * @param baseModelIndex * @param baseAtomIndex */ Modified: trunk/Jmol/src/org/jmol/jvxl/readers/ApbsReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/ApbsReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/ApbsReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -39,7 +39,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); // data are HIGH on the inside and LOW on the outside if (params.thePlane == null) params.insideOut = !params.insideOut; Modified: trunk/Jmol/src/org/jmol/jvxl/readers/AtomDataReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/AtomDataReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/AtomDataReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -53,9 +53,8 @@ AtomDataReader(){} - @Override - void init(SurfaceGenerator sg) { - super.init(sg); + protected void initADR(SurfaceGenerator sg) { + initVDR(sg); precalculateVoxelData = true; atomDataServer = sg.getAtomDataServer(); } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/AtomPropertyMapper.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/AtomPropertyMapper.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/AtomPropertyMapper.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -32,24 +32,27 @@ import org.jmol.api.MepCalculationInterface; import org.jmol.jvxl.data.MeshData; +/** + * maps property data + * + */ class AtomPropertyMapper extends AtomDataReader { private MepCalculationInterface mepCalc; private String mepType; private int calcType = 0; + AtomPropertyMapper(){} @Override void init(SurfaceGenerator sg) { - super.init(sg); + initADR(sg); mepType = (String) sg.getReaderData(); } - //// maps property data //// private boolean doSmoothProperty; private AtomIndexIterator iter; private float smoothingPower; - @Override protected void setup(boolean isMapData) { Modified: trunk/Jmol/src/org/jmol/jvxl/readers/CastepDensityReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/CastepDensityReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/CastepDensityReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -37,7 +37,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); canDownsample = isProgressive = false; isAngstroms = true; } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/CubeReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/CubeReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/CubeReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -36,7 +36,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); } @Override Modified: trunk/Jmol/src/org/jmol/jvxl/readers/DelPhiBinaryReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/DelPhiBinaryReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/DelPhiBinaryReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -66,7 +66,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader brNull) { String fileName = (String) ((Object[]) sg.getReaderData())[0]; - super.init2(sg, null); + init2VFR(sg, br); binarydoc = newBinaryDocument(); binarydoc.setStream(sg.getAtomDataServer().getBufferedInputStream(fileName), false); // data are HIGH on the inside and LOW on the outside Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoFxyReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoFxyReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoFxyReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -35,7 +35,7 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); + initADR(sg); isXLowToHigh = true; precalculateVoxelData = false; atomDataServer = sg.getAtomDataServer(); Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoIntersectReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoIntersectReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoIntersectReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -41,7 +41,7 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); + initADR(sg); } ///// VDW intersection reader -- not mappable ////// Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoMOReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -50,8 +50,8 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); - isNci = (params.qmOrbitalType == Parameters.QM_TYPE_NCI_PRO); + initADR(sg); + isNci = (params.qmOrbitalType == Parameters.QM_TYPE_NCI_PRO); if (isNci) { // NCI analysis org.jmol.quantum.NciCalculation // allows for progressive plane reading, which requires Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoMepReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -34,7 +34,7 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); + initADR(sg); type = "Mep"; } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoPlaneReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoPlaneReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoPlaneReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -29,7 +29,7 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); + initADR(sg); precalculateVoxelData = false; } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoShapeReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoShapeReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoShapeReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -49,7 +49,7 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); + initVDR(sg); Object o = sg.getReaderData(); if (o instanceof Float) { sphere_radiusAngstroms = ((Float) o).floatValue(); Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -49,7 +49,7 @@ @Override void init(SurfaceGenerator sg) { - super.init(sg); + initADR(sg); } ///// solvent-accessible, solvent-excluded surface ////// Modified: trunk/Jmol/src/org/jmol/jvxl/readers/JaguarReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/JaguarReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/JaguarReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -46,7 +46,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); nSurfaces = 1; // ? params.insideOut = !params.insideOut; } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -45,7 +45,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2JXR(sg, br); isXmlFile = false; JVXL_VERSION = "2.0"; } @@ -265,9 +265,8 @@ @Override protected void readSurfaceData(boolean isMapDataIgnored) throws Exception { thisInside = !params.isContoured; - if (readSurfaceDataXML()) - return; - readVolumeFileSurfaceData(); + if (!readSurfaceDataXML()) + readSurfaceDataJXR(); } @Override Modified: trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -72,7 +72,11 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2JXR(sg, br); + } + + void init2JXR(SurfaceGenerator sg, BufferedReader br) { + init2VFR(sg, br); jvxlData.wasJvxl = isJvxl = true; isXLowToHigh = false; xr = new XmlReader(br); @@ -402,7 +406,7 @@ // if (thisInside) // bsVoxelBitSet = BitSetUtil.copyInvert(bsVoxelBitSet, // bsVoxelBitSet.size()); - readVolumeFileSurfaceData(); + readSurfaceDataJXR(); } protected boolean readSurfaceDataXML() throws Exception { @@ -421,8 +425,8 @@ return false; } - protected void readVolumeFileSurfaceData() throws Exception { - super.readSurfaceData(false); + protected void readSurfaceDataJXR() throws Exception { + readSurfaceDataVFR(false); volumeData.setMappingPlane(null); } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -41,7 +41,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); isAngstroms = true; adjustment = sg.getParams().center; if (adjustment == null || adjustment.x == Float.MAX_VALUE) Modified: trunk/Jmol/src/org/jmol/jvxl/readers/PltFormattedReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/PltFormattedReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/PltFormattedReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -51,7 +51,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); isAngstroms = true; jvxlData.wasCubic = true; jvxlFileHeaderBuffer = new SB(); Modified: trunk/Jmol/src/org/jmol/jvxl/readers/PolygonFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/PolygonFileReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/PolygonFileReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -39,7 +39,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2SFR(sg, br); jvxlFileHeaderBuffer = new SB(); jvxlFileHeaderBuffer.append("#created ").append("" + new Date()).append("\n"); vertexDataOnly = true; Modified: trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceFileReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceFileReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -31,6 +31,9 @@ import org.jmol.api.JmolDocument; import org.jmol.util.Parser; +/** + * PolygonFileReader or VolumeFileReader + */ abstract class SurfaceFileReader extends SurfaceReader { protected BufferedReader br; @@ -41,7 +44,15 @@ } @Override + void init(SurfaceGenerator sg) { + initSR(sg); + } + void init2(SurfaceGenerator sg, BufferedReader br) { + init2SFR(sg, br); + } + + void init2SFR(SurfaceGenerator sg, BufferedReader br) { init(sg); this.br = br; } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -1044,7 +1044,7 @@ } private SurfaceReader newReaderBr(String name, BufferedReader br) { - SurfaceReader sr = (SurfaceReader) getInterface(name); + SurfaceFileReader sr = (SurfaceFileReader) getInterface(name); if (sr != null) sr.init2(this, br); return sr; Modified: trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -23,11 +23,8 @@ */ package org.jmol.jvxl.readers; -import java.io.BufferedReader; import java.io.OutputStream; - - import org.jmol.api.QuantumPlaneCalculationInterface; import org.jmol.jvxl.api.MeshDataServer; import org.jmol.jvxl.api.VertexDataServer; @@ -232,14 +229,13 @@ SurfaceReader() {} /** - * @param surfaceGenerator - * @param br + * implemented in SurfaceFileReader and + * + * @param sg */ - void init2(SurfaceGenerator surfaceGenerator, BufferedReader br) { - // nothing here unless it's a file reader - } + abstract void init(SurfaceGenerator sg); - void init(SurfaceGenerator sg) { + void initSR(SurfaceGenerator sg) { this.sg = sg; params = sg.getParams(); marchingSquares = sg.getMarchingSquares(); Modified: trunk/Jmol/src/org/jmol/jvxl/readers/UhbdReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/UhbdReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/UhbdReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -71,7 +71,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); // data are HIGH on the inside and LOW on the outside if (params.thePlane == null) params.insideOut = !params.insideOut; Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -62,15 +62,14 @@ VolumeDataReader() {} - @Override - void init(SurfaceGenerator sg) { - super.init(sg); + protected void initVDR(SurfaceGenerator sg) { + initSR(sg); useOriginStepsPoints = (params.origin != null && params.points != null && params.steps != null); dataType = params.dataType; precalculateVoxelData = true; allowMapData = true; } - + /** * @param isMapData */ Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -56,7 +56,11 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); + } + + void init2VFR(SurfaceGenerator sg, BufferedReader br) { + init2SFR(sg, br); canDownsample = isProgressive = isXLowToHigh = true; jvxlData.wasCubic = true; boundingBox = params.boundingBox; @@ -212,6 +216,10 @@ @Override protected void readSurfaceData(boolean isMapData) throws Exception { + readSurfaceDataVFR(isMapData); + } + + protected void readSurfaceDataVFR(boolean isMapData) throws Exception { /* * possibilities: * Modified: trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java 2013-05-31 14:48:08 UTC (rev 18267) @@ -36,7 +36,7 @@ @Override void init2(SurfaceGenerator sg, BufferedReader br) { - super.init2(sg, br); + init2VFR(sg, br); } private boolean isBXSF = false; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-05-30 20:46:54 UTC (rev 18266) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-05-31 14:48:08 UTC (rev 18267) @@ -9,8 +9,10 @@ # The quotes above look odd for a parameter file, but they are # important for the JavaScript version of Jmol. -___JmolVersion="13.1.16_dev_2013.05.30c" +___JmolVersion="13.1.16_dev_2013.05.31" +bug fix: JavaScript reading of old-style JVXL files + PyMOL: adds SASURFACE option (surface_solvent ON), with "carving" (ProFusion_ABL.pse, scene F6) new feature: restore SCENE "xxxx" nSec new feature: Scene menu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |