From: <ha...@us...> - 2012-05-24 16:44:56
|
Revision: 17206 http://jmol.svn.sourceforge.net/jmol/?rev=17206&view=rev Author: hansonr Date: 2012-05-24 16:44:45 +0000 (Thu, 24 May 2012) Log Message: ----------- version=12.3.27_dev # new feature: [menu] vibration [*,/] 2 # new feature: XSF isosurface reader # new feature: load CENTROID (only complete molecules having cenroid in unit cell) # bug fix: write PNGJ broken in 12.3.26 Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java trunk/Jmol/src/org/jmol/modelset/ModelCollection.java trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java trunk/Jmol/src/org/jmol/script/Token.java trunk/Jmol/src/org/jmol/util/Quadric.java trunk/Jmol/src/org/jmol/util/SurfaceFileTyper.java trunk/Jmol/src/org/jmol/viewer/FileManager.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Added Paths: ----------- trunk/Jmol/src/org/jmol/adapter/readers/xtal/MagResReader.java trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java Added: trunk/Jmol/src/org/jmol/adapter/readers/xtal/MagResReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/xtal/MagResReader.java (rev 0) +++ trunk/Jmol/src/org/jmol/adapter/readers/xtal/MagResReader.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -0,0 +1,116 @@ +package org.jmol.adapter.readers.xtal; + +/** + * Piero Canepa + * + * Quantum Espresso + * http://www.quantum-espresso.org and http://qe-forge.org/frs/?group_id=10 + * @author Pieremanuele Canepa, Room 104, FM Group School of Physical Sciences, + * Ingram Building, University of Kent, Canterbury, Kent, CT2 7NH United + * Kingdom, pc...@ke... + * + * @version 1.0 + */ + +import jspecview.util.TextFormat; + +import org.jmol.adapter.smarter.Atom; +import org.jmol.adapter.smarter.AtomSetCollectionReader; +import org.jmol.util.Eigen; +import org.jmol.util.Escape; +import org.jmol.util.Logger; + +public class MagResReader extends AtomSetCollectionReader { + + private float[] cellParams; + private float maxIso = 10000; + + @Override + protected void initializeReader() { + setFractionalCoordinates(false); + doApplySymmetry = false; + atomSetCollection.newAtomSet(); + } + + @Override + protected boolean checkLine() throws Exception { + if (line.startsWith("lattice")) { + readCellParams(); + } else if (line.contains("Coordinates")) { + readAtom(); + } else if (line.contains("J-coupling Total") || line.contains("TOTAL tensor")) { + readTensor(); + } + return true; + } + + + private void readCellParams() throws Exception { + String[] tokens = getTokens(); + cellParams = new float[9]; + for (int i = 0; i < 9; i++) + cellParams[i] = parseFloat(tokens[i + 1]) * ANGSTROMS_PER_BOHR; + addPrimitiveLatticeVector(0, cellParams, 0); + addPrimitiveLatticeVector(1, cellParams, 3); + addPrimitiveLatticeVector(2, cellParams, 6); + setSpaceGroupName("P1"); + } + + /* + C 1 Coordinates 2.054 0.000 0.000 A + */ + + private Atom atom; + private void readAtom() throws Exception { + float f = line.trim().endsWith("A") ? 1 : ANGSTROMS_PER_BOHR; + String[] tokens = getTokens(); + atom = atomSetCollection.addNewAtom(); + atom.elementSymbol = tokens[0]; + atom.atomName = tokens[0] + tokens[1]; + float x = parseFloat(tokens[3]) * f; + float y = parseFloat(tokens[4]) * f; + float z = parseFloat(tokens[5]) * f; + atom.set(x, y, z); + setAtomCoord(atom); + } + + /* + J-coupling Total + + W 1 Eigenvalue sigma_xx -412163.5628 + W 1 Eigenvector sigma_xx 0.1467 -0.9892 0.0000 + W 1 Eigenvalue sigma_yy -412163.6752 + W 1 Eigenvector sigma_yy 0.9892 0.1467 0.0000 + W 1 Eigenvalue sigma_zz -432981.4974 + W 1 Eigenvector sigma_zz 0.0000 0.0000 1.0000 + +TOTAL tensor + + -0.0216 -0.1561 -0.0137 + -0.1561 -0.1236 -0.0359 + -0.0137 -0.0359 0.1452 + + */ + private void readTensor() throws Exception { + boolean isJ = (line.indexOf("J-") >= 0); + atomSetCollection.setAtomSetName(line.trim()); + float[] data = new float[9]; + readLine(); + String s = TextFormat.simpleReplace(readLine() + readLine() + readLine(), "-", " -"); + fillFloatArray(s, 0, data); + float f = 3; + if (isJ) { + discardLinesUntilContains("Isotropic"); + float iso = parseFloat(getTokens()[3]); + if (Math.abs(iso) > maxIso) + return; + f = 0.04f; + } + double[][] a = new double[3][3]; + for (int i = 0, pt = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + a[i][j] = data[pt++]; + atom.setEllipsoid(Eigen.getEllipsoid(a)); + atom.ellipsoid[0].scale(f); + } +} Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -801,13 +801,15 @@ } float symmetryRange; + + private boolean doCentroidUnitCell; void setSymmetryRange(float factor) { symmetryRange = factor; setAtomSetCollectionAuxiliaryInfo("symmetryRange", new Float(factor)); } void setLatticeCells(int[] latticeCells, boolean applySymmetryToBonds, - boolean doPackUnitCell, String supercell) { + boolean doPackUnitCell, boolean doCentroidUnitCell, String supercell) { //set when unit cell is determined // x <= 555 and y >= 555 indicate a range of cells to load // AROUND the central cell 555 and that @@ -824,6 +826,7 @@ doNormalize = latticeCells[0] != 0 && (!isLatticeRange || latticeCells[2] == 1); this.applySymmetryToBonds = applySymmetryToBonds; this.doPackUnitCell = doPackUnitCell; + this.doCentroidUnitCell = doCentroidUnitCell; if (supercell != null) setSuperCell(supercell, null); } @@ -1049,11 +1052,13 @@ .setFinalOperations(atoms, iAtomFirst, noSymmetryCount, doNormalize); int operationCount = symmetry.getSpaceGroupOperationCount(); getSymmetry().setMinMaxLatticeParameters(minXYZ, maxXYZ); - if (doPackUnitCell || symmetryRange != 0 && maxXYZ.x - minXYZ.x == 1 + if (doCentroidUnitCell || doPackUnitCell || symmetryRange != 0 && maxXYZ.x - minXYZ.x == 1 && maxXYZ.y - minXYZ.y == 1 && maxXYZ.z - minXYZ.z == 1) { // weird Mac bug does not allow new Point3i(minXYZ) !! minXYZ0 = new Point3i(minXYZ.x, minXYZ.y, minXYZ.z); maxXYZ0 = new Point3i(maxXYZ.x, maxXYZ.y, maxXYZ.z); + if (doCentroidUnitCell) + setAtomSetCollectionAuxiliaryInfo("centroidMinMax", new int[] {minXYZ.x, minXYZ.y, minXYZ.z, maxXYZ.x, maxXYZ.y, maxXYZ.z}); dtype = (int) getSymmetry() .getUnitCellInfo(SimpleUnitCell.INFO_DIMENSIONS); switch (dtype) { Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -448,7 +448,9 @@ latticeCells[0] = (int) pt.x; latticeCells[1] = (int) pt.y; latticeCells[2] = (int) pt.z; - doPackUnitCell = (htParams.containsKey("packed") || latticeCells[2] < 0); + doCentroidUnitCell = (htParams.containsKey("centroid")); + doPackUnitCell = !doCentroidUnitCell && (htParams.containsKey("packed") || latticeCells[2] < 0); + } supercell = (String) htParams.get("supercell"); doApplySymmetry = (latticeCells[0] > 0 && latticeCells[1] > 0); @@ -583,7 +585,7 @@ if (ignoreFileSymmetryOperators) return; atomSetCollection.setLatticeCells(latticeCells, applySymmetryToBonds, - doPackUnitCell, supercell); + doPackUnitCell, doCentroidUnitCell, supercell); if (!atomSetCollection.addSpaceGroupOperation(xyz)) Logger.warn("Skipping symmetry operation " + xyz); iHaveSymmetryOperators = true; @@ -718,7 +720,9 @@ public boolean readMolecularOrbitals; protected boolean reverseModels; private String nameRequired; + protected boolean doCentroidUnitCell; + // MANY: "NOVIB" "NOMO" // CSF, SPARTAN: "NOORIENT" // CRYSTAL: "CONV" (conventional), "INPUT" @@ -730,7 +734,7 @@ // PDB: "BIOMOLECULE n;" "NOSYMMETRY" "CONF n" // Spartan: "INPUT", "ESPCHARGES" // P2N: "ALTNAME" - // CASTEP: "CHARGE=HIRSH q={i,j,k}" + // CASTEP: "CHARGE=HIRSH q={i,j,k}; CENTROID" protected void setFilter(String filter0) { if (filter0 == null) { @@ -934,7 +938,7 @@ atomSetCollection.setSymmetryRange(symmetryRange); if (doConvertToFractional || fileCoordinatesAreFractional) { atomSetCollection.setLatticeCells(latticeCells, applySymmetryToBonds, - doPackUnitCell, supercell); + doPackUnitCell, doCentroidUnitCell, supercell); if (ignoreFileSpaceGroupName || !iHaveSymmetryOperators) { if (!merging || symmetry == null) getSymmetry(); @@ -1214,7 +1218,7 @@ fileScaling.z = 1; setFractionalCoordinates(true); latticeCells = new int[3]; - atomSetCollection.setLatticeCells(latticeCells, true, false, supercell); + atomSetCollection.setLatticeCells(latticeCells, true, false, false, supercell); setUnitCell(plotScale.x * 2 / (maxXYZ.x - minXYZ.x), plotScale.y * 2 / (maxXYZ.y - minXYZ.y), plotScale.z * 2 / (maxXYZ.z == minXYZ.z ? 1 : maxXYZ.z - minXYZ.z), 90, 90, 90); Modified: trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -50,7 +50,7 @@ "Molden;MopacGraphf;GenNBO;NWChem;Odyssey;Psi;Qchem;Spartan;SpartanSmol;" + "WebMO;", "simple.", ";Alchemy;Ampac;Cube;FoldingXyz;GhemicalMM;HyperChem;Jme;Mopac;ZMatrix;", - "xtal.", ";Aims;Castep;Crystal;Dmol;Espresso;Gulp;Shelx;Siesta;VaspOutcar;Wien2k;" + "xtal.", ";Aims;Castep;Crystal;Dmol;Espresso;Gulp;MagRes;Shelx;Siesta;VaspOutcar;Wien2k;" }; public final static String getReaderClassBase(String type) { @@ -916,10 +916,13 @@ private final static String[] zMatrixFileStartRecords = {"ZMatrix", "#ZMATRIX"}; + private final static String[] magResFileStartRecords = + {"MagRes", "# magres"}; + private final static String[][] fileStartsWithRecords = { cubeFileStartRecords, mol2Records, webmoFileStartRecords, moldenFileStartRecords, dcdFileStartRecords, tlsDataOnlyFileStartRecords, - zMatrixFileStartRecords }; + zMatrixFileStartRecords, magResFileStartRecords }; //////////////////////////////////////////////////////////////// // these test lines that startWith one of these strings Modified: trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/jvxl/readers/SurfaceGenerator.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -127,7 +127,6 @@ import javax.vecmath.Point4f; import javax.vecmath.Vector3f; -import org.jmol.util.*; import org.jmol.atomdata.AtomData; import org.jmol.atomdata.AtomDataServer; import org.jmol.atomdata.RadiusData; @@ -137,6 +136,14 @@ import org.jmol.jvxl.data.MeshData; import org.jmol.jvxl.api.MeshDataServer; import org.jmol.jvxl.calc.MarchingSquares; +import org.jmol.util.ArrayUtil; +import org.jmol.util.BinaryDocument; +import org.jmol.util.ColorEncoder; +import org.jmol.util.Logger; +import org.jmol.util.Measure; +import org.jmol.util.Parser; +import org.jmol.util.SurfaceFileTyper; +import org.jmol.util.TextFormat; public class SurfaceGenerator { @@ -1248,6 +1255,8 @@ return new JaguarReader(this, br); if (fileType.equals("Xplor")) return new XplorReader(this, br); + if (fileType.equals("Xsf")) + return new XsfReader(this, br); if (fileType.equals("PltFormatted")) return new PltFormattedReader(this, br); if (fileType.equals("MRC")) { Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VolumeFileReader.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -139,12 +139,12 @@ } } for (int i = 0; i < 3; ++i) { + if (!isAngstroms) + volumetricVectors[i].scale(ANGSTROMS_PER_BOHR); line = voxelCounts[i] + " " + volumetricVectors[i].x + " " + volumetricVectors[i].y + " " + volumetricVectors[i].z; jvxlFileHeaderBuffer.append(line).append('\n'); Logger.info("voxel grid count/vector:" + line); - if (!isAngstroms) - volumetricVectors[i].scale(ANGSTROMS_PER_BOHR); } scaleIsosurface(params.scale); volumeData.setVolumetricXml(); Added: trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java (rev 0) +++ trunk/Jmol/src/org/jmol/jvxl/readers/XsfReader.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -0,0 +1,60 @@ +/* $RCSfile$ + * $Author: hansonr $ + * $Date: 2007-03-30 11:40:16 -0500 (Fri, 30 Mar 2007) $ + * $Revision: 7273 $ + * + * Copyright (C) 2007 Miguel, Bob, Jmol Development + * + * Contact: ha...@st... + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.jmol.jvxl.readers; + +import java.io.BufferedReader; + +import javax.vecmath.Vector3f; + +import org.jmol.util.Logger; +import org.jmol.util.Parser; + +class XsfReader extends VolumeFileReader { + + XsfReader(SurfaceGenerator sg, BufferedReader br) { + super(sg, br); + } + + @Override + protected void readParameters() throws Exception { + if (Float.isNaN(params.cutoff)) + params.cutoff = 0.05f; + isAngstroms = false; + jvxlFileHeaderBuffer = new StringBuffer(); + while (readLine() != null && line.indexOf("BEGIN_DATAGRID") < 0) + continue; + jvxlFileHeaderBuffer.append("XsfReader file\n"); + readLine(); + voxelCounts[0] = parseInt(line); + voxelCounts[1] = parseInt(); + voxelCounts[2] = parseInt(); + volumetricOrigin.set(parseFloat(readLine()), parseFloat(), parseFloat()); + volumetricOrigin.scale(ANGSTROMS_PER_BOHR); + for (int i = 0; i < 3; ++i) + volumetricVectors[i].set(parseFloat(readLine()), parseFloat(), parseFloat()); + nSurfaces = 1; + } +} + + Modified: trunk/Jmol/src/org/jmol/modelset/ModelCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -1807,6 +1807,45 @@ } } + public void setCentroid(int[] minmax) { + SymmetryInterface uc = getUnitCell(modelCount - 1); + if (uc == null) + return; + BitSet bsDelete = new BitSet(); + Model m = models[modelCount - 1]; + int i0 = m.firstAtomIndex; + getMolecules(); + Point3f center = new Point3f(); + boolean isOneMolecule = (molecules[moleculeCount - 1].firstAtomIndex == m.firstAtomIndex); + for (int i = moleculeCount; --i >= 0 && molecules[i].firstAtomIndex >= i0;) { + BitSet bs = molecules[i].atomList; + center.set(0, 0, 0); + int n = 0; + for (int j = bs.nextSetBit(0); j >= 0; j = bs.nextSetBit(j + 1)) { + center.add(atoms[j]); + if (isOneMolecule) { + if (isNotCentroid(center, 1, uc, minmax)) + bsDelete.set(j); + continue; + } + n++; + } + if (n > 0 && isNotCentroid(center, n, uc, minmax)) + bsDelete.or(bs); + } + if (bsDelete.nextSetBit(0) >= 0) + viewer.deleteAtoms(bsDelete, false); + } + + private boolean isNotCentroid(Point3f center, int n, SymmetryInterface uc, int[] minmax) { + center.scale(1f/n); + uc.toFractional(center, false); + return (center.x <= minmax[0] || center.x > minmax[3] + || center.y <= minmax[1] || center.y > minmax[4] + || center.z <= minmax[2] || center.z > minmax[5]); + + } + public JmolMolecule[] getMolecules() { if (moleculeCount > 0) return molecules; Modified: trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java =================================================================== --- trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -119,7 +119,7 @@ + "backbone cartoon cartoonRockets ribbons rockets strands trace" }, { "VIBRATIONvectorMenu", - "vectorOff vectorOn vector3 vector005 vector01 - " + "vectorOff vectorOn vibScale20 vibScale05 vector3 vector005 vector01 - " + "vectorScale02 vectorScale05 vectorScale1 vectorScale2 vectorScale5" }, { "stereoMenu", @@ -170,7 +170,7 @@ + "[set_spin_FPS]Menu" }, { "VIBRATIONMenu", - "vibrationOff vibrationOn VIBRATIONvectorMenu" }, + "vibrationOff vibrationOn vibration20 vibration05 VIBRATIONvectorMenu" }, { "spectraMenu", "hnmrMenu cnmrMenu" }, @@ -364,6 +364,8 @@ { "vibrationOff", "vibration off" }, { "vibrationOn", "vibration on" }, + { "vibration20", "vibrationScale *= 2" }, + { "vibration05", "vibrationScale /= 2" }, { "vectorOff", "vectors off" }, { "vectorOn", "vectors on" }, @@ -685,6 +687,8 @@ "VIBRATIONMenu", GT._("Vibration"), "vibrationOff", GT._("Off"), "vibrationOn", GT._("On"), + "vibration20", "*2", + "vibration05", "/2", "VIBRATIONvectorMenu", GT._("Vectors"), "spectraMenu", GT._("Spectra"), "hnmrMenu", GT._("1H-NMR"), Modified: trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -8453,6 +8453,7 @@ String[] tempFileInfo = null; String errMsg = null; String sOptions = ""; + boolean isCentroid; int tokType = 0; int tok; @@ -8590,7 +8591,7 @@ || theTok == Token.varray || theTok == Token.leftsquare || theTok == Token.spacebeforesquare || theTok == Token.offset || theTok == Token.range - || theTok == Token.manifest || theTok == Token.packed + || theTok == Token.manifest || theTok == Token.packed || theTok == Token.centroid || theTok == Token.supercell || theTok == Token.filter && tokAt(i + 3) != Token.coord || theTok == Token.identifier && tokAt(i + 3) != Token.coord) { @@ -8649,7 +8650,7 @@ tok = tokAt(i); } - if (tok == Token.packed || tok == Token.supercell) { + if (tok == Token.packed || tok == Token.centroid || tok == Token.supercell) { if (lattice == null) lattice = new Point3f(555, 555, -1); iToken = i - 1; @@ -8667,6 +8668,10 @@ htParams.put("packed", Boolean.TRUE); sOptions += " PACKED"; i++; + } else if (tokAt(i) == Token.centroid) { + htParams.put("centroid", Boolean.TRUE); + sOptions += " CENTROID"; + i++; } // SUPERCELL @@ -8964,12 +8969,13 @@ if (logMessages) scriptStatusOrBuffer("Successfully loaded:" + (filenames == null ? htParams.get("fullPathName") : modelName)); + Map<String, Object> info = viewer.getModelSetAuxiliaryInfo(); + if (info != null && info.containsKey("centroidMinMax")) + viewer.setCentroid((int[]) info.get("centroidMinMax")); String script = viewer.getDefaultLoadScript(); String msg = ""; if (script.length() > 0) msg += "\nUsing defaultLoadScript: " + script; - - Map<String, Object> info = viewer.getModelSetAuxiliaryInfo(); if (info != null && viewer.getAllowEmbeddedScripts()) { String embeddedScript = (String) info.remove("jmolscript"); if (embeddedScript != null && embeddedScript.length() > 0) { @@ -8979,6 +8985,7 @@ script = "allowEmbeddedScripts = false;try{" + script + "} allowEmbeddedScripts = true;"; } + } logLoadInfo(msg); Modified: trunk/Jmol/src/org/jmol/script/Token.java =================================================================== --- trunk/Jmol/src/org/jmol/script/Token.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/script/Token.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -1073,6 +1073,7 @@ final static int cancel = misc | 49; public final static int cap = misc | 50 | expression; final static int cavity = misc | 52; + final static int centroid = misc | 53; final static int check = misc | 54; final static int chemical = misc | 55; final static int circle = misc | 56; @@ -1984,6 +1985,7 @@ "cancel", new Token(cancel), "cap", new Token(cap), "cavity", new Token(cavity), + "centroid", new Token(centroid), "check", new Token(check), "chemical", new Token(chemical), "circle", new Token(circle), Modified: trunk/Jmol/src/org/jmol/util/Quadric.java =================================================================== --- trunk/Jmol/src/org/jmol/util/Quadric.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/util/Quadric.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -37,6 +37,11 @@ public boolean isThermalEllipsoid = true; public float scale = 1; + public void scale(float f) { + for (int i = 0; i < 3; i++) + lengths[i] *= f; + } + @Override public String toString() { return (vectors == null ? "" + lengths[0] : Modified: trunk/Jmol/src/org/jmol/util/SurfaceFileTyper.java =================================================================== --- trunk/Jmol/src/org/jmol/util/SurfaceFileTyper.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/util/SurfaceFileTyper.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -100,6 +100,8 @@ return "Obj"; if (line.indexOf("# object with") == 0) return "Nff"; + if (line.indexOf("BEGIN_DATAGRID") >= 0) + return "Xsf"; // binary formats: problem here is that the buffered reader // may be translating byte sequences into unicode // and thus shifting the offset Modified: trunk/Jmol/src/org/jmol/viewer/FileManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/FileManager.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/viewer/FileManager.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -1293,7 +1293,6 @@ int pt = Math.max(fname.lastIndexOf("|"), fname.lastIndexOf("/")); fnameShort = fnameShort.substring(pt + 1); } - Logger.info("...adding " + fname + " (" + bytes.length + " bytes)"); String key = ";" + fnameShort + ";"; if (fileList.indexOf(key) >= 0) { Logger.info("duplicate entry"); @@ -1301,21 +1300,24 @@ } fileList += key; os.putNextEntry(new ZipEntry(fnameShort)); + int nOut = 0; if (bytes == null) { // get data from disk FileInputStream in = new FileInputStream(fname); int len; while ((len = in.read(buf)) > 0) { os.write(buf, 0, len); - nBytesOut += len; + nOut += len; } in.close(); } else { // data are already in byte form os.write(bytes, 0, bytes.length); - nBytesOut += bytes.length; + nOut += bytes.length; } + nBytesOut += nOut; os.closeEntry(); + Logger.info("...added " + fname + " (" + nOut + " bytes)"); } os.close(); Logger.info(nBytesOut + " bytes prior to compression"); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-05-24 16:44:45 UTC (rev 17206) @@ -5,6 +5,11 @@ version=12.3.27_dev +# new feature: [menu] vibration [*,/] 2 +# new feature: XSF isosurface reader +# new feature: load CENTROID (only complete molecules having cenroid in unit cell) +# bug fix: write PNGJ broken in 12.3.26 +# bug fix: reading of JVXL-version 1 (nonXML) files does not display colors # bug fix: translate y 10 works, but translate Y 10 does not # bug fix: 12.3.26 breaks Jmol/JspecView connection Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-05-23 19:51:33 UTC (rev 17205) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-05-24 16:44:45 UTC (rev 17206) @@ -10421,4 +10421,8 @@ if (modelIndex >= 0) modelSet.setModelAuxiliaryInfo(modelIndex, "modelID", id); } + + public void setCentroid(int[] minmax) { + modelSet.setCentroid(minmax); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |