From: <ha...@us...> - 2011-09-05 05:25:28
|
Revision: 16037 http://jmol.svn.sourceforge.net/jmol/?rev=16037&view=rev Author: hansonr Date: 2011-09-05 05:25:19 +0000 (Mon, 05 Sep 2011) Log Message: ----------- general appendLoadNote(String info) method for readers Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java trunk/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java Modified: trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java 2011-09-04 21:43:11 UTC (rev 16036) +++ trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java 2011-09-05 05:25:19 UTC (rev 16037) @@ -112,7 +112,6 @@ setIsPDB(); pdbHeader = (getHeader ? new StringBuffer() : null); applySymmetry = !checkFilter("NOSYMMETRY"); - headerTitle = new StringBuffer(); if (checkFilter("CONF ")) { @@ -276,8 +275,7 @@ private void header() { if (lineLength < 8) return; - headerTitle.append(line.substring(7).trim()).append("\n"); - atomSetCollection.setAtomSetCollectionAuxiliaryInfo("modelLoadNote", headerTitle.toString()); + appendLoadNote(line.substring(7).trim()); if (lineLength >= 66) atomSetCollection.setCollectionName(line.substring(62, 66)); if (lineLength > 50) @@ -288,8 +286,7 @@ private void title() { if (lineLength < 10) return; - headerTitle.append(line.substring(10).trim()).append("\n"); - atomSetCollection.setAtomSetCollectionAuxiliaryInfo("modelLoadNote", headerTitle.toString()); + appendLoadNote(line.substring(10).trim()); } private List<Map<String, String>> vCompnds; Modified: trunk/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java 2011-09-04 21:43:11 UTC (rev 16036) +++ trunk/Jmol/src/org/jmol/adapter/readers/xtal/CrystalReader.java 2011-09-05 05:25:19 UTC (rev 16037) @@ -44,6 +44,8 @@ /** * + * A reader of OUT and OUTP files for CRYSTAL + * * http://www.crystal.unito.it/ * * @author Pieremanuele Canepa, Room 104, FM Group School of Physical Sciences, @@ -270,9 +272,14 @@ /// From here on we are considering only keywords of properties output files - if (line.startsWith(" DEFINITION OF TRACELESS")) { + if (line.startsWith(" DEFINITION OF TRACELESS")) return getPropertyTensors(); + + if (line.startsWith(" MULTIPOLE ANALYSIS BY ATOMS")) { + appendLoadNote("Multipole Analysis"); + return true; } + return true; } @@ -652,7 +659,8 @@ int i = atomIndexLast; // I turned off normalization -- proper way to do this is to // add the "packed" keyword. As it was, it was impossible to - // load the file with its original coordinates + // load the file with its original coordinates, which in many + // cases are VERY interesting and far better (in my opinion!) boolean doNormalizePrimitive = false && isPrimitive && !isMolecular && !isPolymer Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2011-09-04 21:43:11 UTC (rev 16036) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2011-09-05 05:25:19 UTC (rev 16037) @@ -149,7 +149,6 @@ public boolean iHaveUnitCell; public boolean iHaveSymmetryOperators; public boolean continuing = true; - protected StringBuffer headerTitle; protected JmolViewer viewer; // used by GenNBOReader and by CifReader @@ -179,6 +178,7 @@ // private state variables + private StringBuffer loadNote = new StringBuffer(); private boolean doConvertToFractional; private boolean merging; private boolean fileCoordinatesAreFractional; @@ -301,8 +301,14 @@ return (desiredModelNumber > 0 || modelNumber >= lastModelNumber); } + protected void appendLoadNote(String info) { + loadNote.append(info).append("\n"); + } + protected void finalizeReader() throws Exception { applySymmetryAndSetTrajectory(); + if (loadNote.length() > 0) + atomSetCollection.setAtomSetCollectionAuxiliaryInfo("modelLoadNote", loadNote.toString()); } ///////////////////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |