From: <ha...@us...> - 2013-12-18 18:35:51
|
Revision: 19124 http://sourceforge.net/p/jmol/code/19124 Author: hansonr Date: 2013-12-18 18:35:44 +0000 (Wed, 18 Dec 2013) Log Message: ----------- various incommensurate fixes; ___JmolVersion="14.1.3_dev_2013.12.17" bug fix: capture time slightly off; needs 50 ms addition. This may vary with rendering speeds. bug fix: CIF reader goes into molecular mode even if geom_bond block is all "? ? ? ? ?" Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java trunk/Jmol/src/org/jmol/adapter/readers/cif/MSReader.java trunk/Jmol/src/org/jmol/adapter/readers/cif/Subsystem.java trunk/Jmol/src/org/jmol/api/SymmetryInterface.java trunk/Jmol/src/org/jmol/render/UccageRenderer.java trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java trunk/Jmol/src/org/jmol/symmetry/Symmetry.java trunk/Jmol/src/org/jmol/util/ModulationSet.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -569,16 +569,9 @@ if (mr != null && str.equals("_cell_subsystem_code")) mr.processSubsystemLoopBlock(); - if (str.startsWith("_geom_bond")) { - if (!doApplySymmetry) { - isMolecular = true; - doApplySymmetry = true; - latticeCells[0] = latticeCells[1] = latticeCells[2] = 1; - } - if (isMolecular) { - processGeomBondLoopBlock(); - return; - } + if (str.startsWith("_geom_bond") && (isMolecular || !doApplySymmetry)) { + processGeomBondLoopBlock(); + return; } skipLoop(); } @@ -1281,6 +1274,7 @@ String name1 = null; String name2 = null; Integer order = Integer.valueOf(1); + int bondCount = 0; while (tokenizer.getData()) { int atomIndex1 = -1; int atomIndex2 = -1; @@ -1328,12 +1322,20 @@ //break; } } - if (atomIndex1 < 0 || atomIndex2 < 0) + if (atomIndex1 < 0 || atomIndex2 < 0 || distance == 0) continue; - if (distance > 0) - bondTypes.addLast(new Object[] { name1, name2, Float.valueOf(distance), - Float.valueOf(dx), order }); + bondCount++; + bondTypes.addLast(new Object[] { name1, name2, Float.valueOf(distance), + Float.valueOf(dx), order }); } + if (bondCount > 0) { + Logger.info(bondCount + " bonds read"); + if (!doApplySymmetry) { + isMolecular = true; + doApplySymmetry = true; + latticeCells[0] = latticeCells[1] = latticeCells[2] = 1; + } + } } ///////////////////////////////////// Modified: trunk/Jmol/src/org/jmol/adapter/readers/cif/MSReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cif/MSReader.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/adapter/readers/cif/MSReader.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -347,7 +347,12 @@ // Loop through all modulations, selecting only those for the current model. // Process O, D, and U modulations via method addAtomModulation - haveAtomMods = false; + if (htSubsystems == null) { + haveAtomMods = false; + } else { + haveAtomMods = true; + htAtomMods = new Hashtable<String, List<Modulation>>(); + } for (Entry<String, P3> e : htModulation.entrySet()) { if ((key = checkKey(e.getKey(), true)) == null) continue; @@ -532,6 +537,10 @@ // (Special positions should generate the same atom regardless of which operation is employed.) List<Modulation> list = htAtomMods.get(a.atomName); + if (list == null && a.altLoc != '\0' && htSubsystems != null) { + // force treatment if a subsystem + list = new List<Modulation>(); + } if (list == null || cr.symmetry == null || a.bsSymmetry == null) return; int iop = Math.max(a.bsSymmetry.nextSetBit(0), 0); Modified: trunk/Jmol/src/org/jmol/adapter/readers/cif/Subsystem.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cif/Subsystem.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/adapter/readers/cif/Subsystem.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -1,5 +1,6 @@ package org.jmol.adapter.readers.cif; +import javajs.util.List; import javajs.util.M3; import javajs.util.M4; import javajs.util.Matrix; @@ -29,8 +30,8 @@ for (int j = n; --j >= 0;) a[i][j] = iw[i][j]; w = new Matrix(a, n, n); - if (w.trace() == n) - w = null; + //if (w.trace() == n) + //w = null; } public SymmetryInterface getSymmetry() { @@ -107,8 +108,8 @@ // Matrix winv = w.inverse(); - symmetry.createSpaceGroup(-1, "P1", symmetry.getNotionalUnitCell()); SymmetryInterface s0 = msReader.cr.atomSetCollection.symmetry; + symmetry.createSpaceGroup(-1, "[subsystem " + code + "]", new List<M4>()); int nOps = s0.getSpaceGroupOperationCount(); for (int iop = 0; iop < nOps; iop++) { M3 gammaE = new M3(); Modified: trunk/Jmol/src/org/jmol/api/SymmetryInterface.java =================================================================== --- trunk/Jmol/src/org/jmol/api/SymmetryInterface.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/api/SymmetryInterface.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -52,7 +52,7 @@ public boolean createSpaceGroup(int desiredSpaceGroupIndex, String name, - float[] notionalUnitCell); + Object object); public String getSpaceGroupInfo(String name, SymmetryInterface cellInfo); Modified: trunk/Jmol/src/org/jmol/render/UccageRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/render/UccageRenderer.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/render/UccageRenderer.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -42,15 +42,12 @@ byte fid; //boolean doLocalize; - private final P3[] verticesT = new P3[8]; - { - for (int i = 8; --i >= 0; ) { - verticesT[i] = new P3(); - } - } + private final P3[] verticesT = new P3[8]; @Override protected void initRenderer() { + for (int i = 8; --i >= 0; ) + verticesT[i] = new P3(); tickEdges = BoxInfo.uccageTickEdges; draw000 = false; } Modified: trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -78,7 +78,8 @@ private static String[] canonicalSeitzList; int index; - + + boolean isSSG; String name = "unknown!"; String hallSymbol; //String schoenfliesSymbol; //parsed but not read @@ -106,7 +107,7 @@ int latticeOp = -1; Map<String, Integer> xyzList = new Hashtable<String, Integer>(); - private int modulationDimension; + private int modDim; boolean doNormalize = true; @@ -188,7 +189,7 @@ } finalOperations = null; isBio = (name.indexOf("bio") >= 0); - if (index >= getSpaceGroups().length && !isBio) { + if (index >= getSpaceGroups().length && !isBio && name.indexOf("SSG:") < 0) { SpaceGroup sg = getDerivedSpaceGroup(); if (sg != null) name = sg.getName(); @@ -343,7 +344,7 @@ * @return valid space group or null */ SpaceGroup getDerivedSpaceGroup() { - if (index >= 0 && index < spaceGroupDefinitions.length) + if (index >= 0 && index < spaceGroupDefinitions.length || modDim > 0) return this; if (finalOperations != null) setFinalOperations(null, 0, 0, false); @@ -432,16 +433,16 @@ xyz0 = xyz0.substring(1); if (xyzList.containsKey(xyz0)) return xyzList.get(xyz0).intValue(); - if (xyz0.startsWith("x1,x2,x3,x4") && modulationDimension == 0) { + if (xyz0.startsWith("x1,x2,x3,x4") && modDim == 0) { xyzList.clear(); operationCount = 0; - modulationDimension = javajs.util.PT.parseInt(xyz0.substring(xyz0 + modDim = javajs.util.PT.parseInt(xyz0.substring(xyz0 .lastIndexOf("x") + 1)) - 3; } SymmetryOperation op = new SymmetryOperation(null, null, 0, opId, doNormalize); - if (!op.setMatrixFromXYZ(xyz0, modulationDimension)) { + if (!op.setMatrixFromXYZ(xyz0, modDim)) { Logger.error("couldn't interpret symmetry operation: " + xyz0); return -1; } @@ -1406,14 +1407,14 @@ int nOps = latticeOp = operationCount; for (int j = 0; j < lattvecs.size(); j++) { float[] data = lattvecs.get(j); - if (data.length > modulationDimension + 3) + if (data.length > modDim + 3) return; for (int i = 0; i < nOps; i++) { SymmetryOperation op = operations[i]; float[] rotTrans = op.rotTransMatrix; SymmetryOperation newOp = new SymmetryOperation(null, null, 0, 0, doNormalize); - newOp.modDim = modulationDimension; + newOp.modDim = modDim; newOp.rotTransMatrix = AU.arrayCopyF(rotTrans, -1); newOp.setFromMatrix(data, false); newOp.xyzOriginal = newOp.xyz; Modified: trunk/Jmol/src/org/jmol/symmetry/Symmetry.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/Symmetry.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/symmetry/Symmetry.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -160,9 +160,9 @@ @Override public boolean createSpaceGroup(int desiredSpaceGroupIndex, String name, - float[] notionalUnitCell) { + Object object) { spaceGroup = SpaceGroup.createSpaceGroup(desiredSpaceGroupIndex, name, - notionalUnitCell); + object); if (spaceGroup != null && Logger.debugging) Logger.debug("using generated space group " + spaceGroup.dumpInfo(null)); return spaceGroup != null; @@ -810,6 +810,7 @@ * @return Jones-Faithful representation */ public String addOp(double[][] rot, double[][] trans) { + spaceGroup.isSSG = true; int d = rot.length; String s = ""; for (int i = 0; i < d; i++) { Modified: trunk/Jmol/src/org/jmol/util/ModulationSet.java =================================================================== --- trunk/Jmol/src/org/jmol/util/ModulationSet.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/util/ModulationSet.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -262,6 +262,7 @@ modInfo.put("sI", sI); modInfo.put("q123", q123); modInfo.put("symop", Integer.valueOf(iop + 1)); + modInfo.put("unitcell", unitCell.getUnitCellInfo()); List<Hashtable<String, Object>> mInfo = new List<Hashtable<String, Object>>(); for (int i = 0; i < mods.size(); i++) Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-12-18 18:35:44 UTC (rev 19124) @@ -13,6 +13,10 @@ ___JmolVersion="14.1.3_dev_2013.12.17" +bug fix: capture time slightly off; needs 50 ms addition. This may vary with rendering speeds. + +bug fix: CIF reader goes into molecular mode even if geom_bond block is all "? ? ? ? ?" + new feature: unitcell {atomset} -- unit cell based on first atom of atom set. -- canceled by any unitcell {none} Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2013-12-18 15:03:21 UTC (rev 19123) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2013-12-18 18:35:44 UTC (rev 19124) @@ -4321,7 +4321,7 @@ } if (captureParams != null && Boolean.FALSE != captureParams.get("captureEnabled")) { //showString(transformManager.matrixRotate.toString(), false); - if (System.currentTimeMillis() >= ((Long)captureParams.get("endTime")).longValue()) + if (System.currentTimeMillis() + 50 > ((Long)captureParams.get("endTime")).longValue()) captureParams.put("captureMode", Integer.valueOf(T.end)); processWriteOrCapture(captureParams); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |