From: <ha...@us...> - 2013-04-02 13:32:18
|
Revision: 18060 http://sourceforge.net/p/jmol/code/18060 Author: hansonr Date: 2013-04-02 13:32:13 +0000 (Tue, 02 Apr 2013) Log Message: ----------- ___JmolVersion="13.1.15_dev_01.05.2013b" TODO Q: How does PyMOL fragment a surface? bug fix: PyMOL reader and full surfaces, mixed bigEndian/littleEndian Pickle reading Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/pymol/PickleReader.java trunk/Jmol/src/org/jmol/api/JmolDocument.java trunk/Jmol/src/org/jmol/io2/BinaryDocument.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/adapter/readers/pymol/PickleReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/pymol/PickleReader.java 2013-04-02 12:40:56 UTC (rev 18059) +++ trunk/Jmol/src/org/jmol/adapter/readers/pymol/PickleReader.java 2013-04-02 13:32:13 UTC (rev 18060) @@ -15,6 +15,8 @@ * generic Python Pickle file reader * only utilizing records needed for PyMOL. * + * Unbelievable! -- doubles are in bigEndian, but integers are littleEndian! + * * see http://www.picklingtools.com/ * * @author Bob Hanson ha...@st... @@ -119,7 +121,7 @@ push(Double.valueOf(d)); break; case BININT: - i = binaryDoc.readInt(); + i = binaryDoc.readIntLE(); push(Integer.valueOf(i)); break; case BININT1: @@ -136,7 +138,7 @@ //System.out.println("BINPUT " + i + " " + peek()); break; case LONG_BINPUT: - i = binaryDoc.readInt(); + i = binaryDoc.readIntLE(); //temp.put(Integer.valueOf(i), peek()); //System.out.println("LONG_BINPUT " + i + " " + peek()); break; @@ -147,7 +149,7 @@ //push(o); break; case LONG_BINGET: - i = binaryDoc.readInt(); + i = binaryDoc.readIntLE(); //o = temp.remove(Integer.valueOf(i)); //System.out.println("LONG_BINGET " + i + " " + o); push("LONG_BINGET"); @@ -160,14 +162,17 @@ push(s); break; case BINSTRING: - i = binaryDoc.readInt(); + i = binaryDoc.readIntLE(); + if (i > 100) + System.out.println("String length " + i); + a = new byte[i]; binaryDoc.readByteArray(a, 0, i); s = new String(a, "UTF-8"); push(s); break; case BINUNICODE: - i = binaryDoc.readInt(); + i = binaryDoc.readIntLE(); a = new byte[i]; binaryDoc.readByteArray(a, 0, i); s = new String(a, "UTF-8"); Modified: trunk/Jmol/src/org/jmol/api/JmolDocument.java =================================================================== --- trunk/Jmol/src/org/jmol/api/JmolDocument.java 2013-04-02 12:40:56 UTC (rev 18059) +++ trunk/Jmol/src/org/jmol/api/JmolDocument.java 2013-04-02 13:32:13 UTC (rev 18060) @@ -30,6 +30,8 @@ int readInt() throws Exception; + int readIntLE() throws Exception; + long readLong() throws Exception; float readFloat() throws Exception; Modified: trunk/Jmol/src/org/jmol/io2/BinaryDocument.java =================================================================== --- trunk/Jmol/src/org/jmol/io2/BinaryDocument.java 2013-04-02 12:40:56 UTC (rev 18059) +++ trunk/Jmol/src/org/jmol/io2/BinaryDocument.java 2013-04-02 13:32:13 UTC (rev 18060) @@ -183,6 +183,11 @@ } } + public int readIntLE() throws Exception { + nBytes += 4; + return readLEInt(); + } + public int readInt() throws Exception { nBytes += 4; return (isBigEndian ? ioReadInt() : readLEInt()); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-04-02 12:40:56 UTC (rev 18059) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-04-02 13:32:13 UTC (rev 18060) @@ -9,11 +9,11 @@ # The quotes above look odd for a parameter file, but they are # important for the JavaScript version of Jmol. -___JmolVersion="13.1.15_dev_01.05.2013" +___JmolVersion="13.1.15_dev_01.05.2013b" TODO Q: How does PyMOL fragment a surface? -bug fix: PyMOL reader and full surfaces +bug fix: PyMOL reader and full surfaces, mixed bigEndian/littleEndian Pickle reading new feature: Jmol or JmolData with -g0x0 and load filter "DORESIZE" will automatically resize the image to what is given in the PyMOL file as its default size: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |