Revision: 20396 http://sourceforge.net/p/jmol/code/20396 Author: hansonr Date: 2015-03-21 02:12:09 +0000 (Sat, 21 Mar 2015) Log Message: ----------- Jmol.___JmolVersion="14.2.13_2015.03.20b"
bug fix: popup menu Symmetry broken bug fix: PDB reader does not save unit cell on simple load Modified Paths: -------------- branches/v14_2/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java branches/v14_2/Jmol/src/org/jmol/modelset/ModelLoader.java branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java branches/v14_2/Jmol/src/org/jmol/popup/JmolGenericPopup.java branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties Modified: branches/v14_2/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java 2015-03-21 02:11:19 UTC (rev 20395) +++ branches/v14_2/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java 2015-03-21 02:12:09 UTC (rev 20396) @@ -422,6 +422,7 @@ protected void finalizeReaderPDB() throws Exception { checkNotPDB(); + checkUnitCellParams(); if (!isCourseGrained) connectAll(maxSerial, isConnectStateBug); SymmetryInterface symmetry; @@ -474,6 +475,14 @@ } } + private void checkUnitCellParams() { + if (iHaveUnitCell) { + asc.setCurrentModelInfo("unitCellParams", unitCellParams); + if (sgName != null) + asc.setCurrentModelInfo("spaceGroup", sgName); + } + } + private void checkForResidualBFactors(SymmetryInterface symmetry) { Atom[] atoms = asc.atoms; boolean isResidual = false; @@ -649,8 +658,7 @@ */ - @SuppressWarnings("unchecked") - private void remark350() throws Exception { + private void remark350() throws Exception { Lst<M4> biomts = null; Lst<String> biomtchains = null; vBiomolecules = new Lst<Map<String, Object>>(); @@ -1318,6 +1326,7 @@ haveMappedSerials = false; sbConect = null; asc.newAtomSet(); + checkUnitCellParams(); if (!isCourseGrained) setModelPDB(true); asc.setCurrentAtomSetNumber(modelNumber); @@ -1344,7 +1353,7 @@ a = Float.NaN; // 1 for a means no unit cell setUnitCell(a, getFloat(15, 9), getFloat(24, 9), getFloat(33, 7), getFloat(40, 7), getFloat(47, 7)); - if (sgName == null) + if (sgName == null || sgName.equals("unspecified!")) setSpaceGroupName(PT.parseTrimmedRange(line, 55, 66)); } Modified: branches/v14_2/Jmol/src/org/jmol/modelset/ModelLoader.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/modelset/ModelLoader.java 2015-03-21 02:11:19 UTC (rev 20395) +++ branches/v14_2/Jmol/src/org/jmol/modelset/ModelLoader.java 2015-03-21 02:12:09 UTC (rev 20396) @@ -1097,15 +1097,15 @@ // 1. apply CONECT records and set bsExclude to omit them // 2. apply stereochemistry from JME - BS bsExclude = (ms - .getInfoM("someModelsHaveCONECT") == null ? null + BS bsExclude = (ms.getInfoM("someModelsHaveCONECT") == null ? null : new BS()); if (bsExclude != null) ms.setPdbConectBonding(baseAtomIndex, baseModelIndex, bsExclude); // 2. for each model in the collection, int modelAtomCount = 0; - boolean symmetryAlreadyAppliedToBonds = vwr.getBoolean(T.applysymmetrytobonds); + boolean symmetryAlreadyAppliedToBonds = vwr + .getBoolean(T.applysymmetrytobonds); boolean doAutoBond = vwr.getBoolean(T.autobond); boolean forceAutoBond = vwr.getBoolean(T.forceautobond); BS bs = null; @@ -1115,15 +1115,12 @@ if (!noAutoBond) for (int i = baseModelIndex; i < modelCount; i++) { modelAtomCount = models[i].bsAtoms.cardinality(); - int modelBondCount = ms.getInfoI(i, - "initialBondCount"); + int modelBondCount = ms.getInfoI(i, "initialBondCount"); boolean modelIsPDB = models[i].isBioModel; if (modelBondCount < 0) { modelBondCount = ms.bondCount; } - boolean modelHasSymmetry = ms.getInfoB(i, - "hasSymmetry"); // check for PDB file with fewer than one bond per every two atoms // this is in case the PDB format is being usurped for non-RCSB uses // In other words, say someone uses the PDB format to indicate atoms and @@ -1135,12 +1132,8 @@ // automatic bonding, and additional bonds might be made. boolean doBond = (forceAutoBond || doAutoBond && (modelBondCount == 0 - || modelIsPDB - && jmolData == null - && (ms - .getMSInfoB("havePDBHeaderName") || modelBondCount < modelAtomCount / 2) || modelHasSymmetry - && !symmetryAlreadyAppliedToBonds - && !ms.getInfoB(i, "hasBonds"))); + || modelIsPDB && jmolData == null && (ms.getMSInfoB("havePDBHeaderName") || modelBondCount < modelAtomCount / 2) + || ms.getInfoB(i, "hasSymmetry") && !symmetryAlreadyAppliedToBonds && !ms.getInfoB(i, "hasBonds"))); if (!doBond) continue; autoBonding = true; @@ -1154,8 +1147,8 @@ if (modulationOn) ms.setModulation(null, true, modulationTUV, false); if (autoBonding) { - ms.autoBondBs4(bs, bs, bsExclude, null, - ms.defaultCovalentMad, vwr.getBoolean(T.legacyautobonding)); + ms.autoBondBs4(bs, bs, bsExclude, null, ms.defaultCovalentMad, + vwr.getBoolean(T.legacyautobonding)); Logger .info("ModelSet: autobonding; use autobond=false to not generate bonds automatically"); } else { Modified: branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java 2015-03-21 02:11:19 UTC (rev 20395) +++ branches/v14_2/Jmol/src/org/jmol/modelset/ModelSet.java 2015-03-21 02:12:09 UTC (rev 20396) @@ -904,11 +904,23 @@ } public SymmetryInterface getUnitCell(int modelIndex) { - return (!haveUnitCells || modelIndex < 0 || modelIndex >= mc ? null - : am[modelIndex].simpleCage != null ? am[modelIndex].simpleCage - : unitCells == null || modelIndex >= unitCells.length - || !unitCells[modelIndex].haveUnitCell() ? null - : unitCells[modelIndex]); + if (modelIndex < 0 || modelIndex >= mc) + return null; + if (am[modelIndex].simpleCage != null) + return am[modelIndex].simpleCage; + if (unitCells != null && modelIndex < unitCells.length + && unitCells[modelIndex].haveUnitCell()) + return unitCells[modelIndex]; + if (getInfo(modelIndex, "unitCellParams") != null) { + if (unitCells == null) + unitCells = new SymmetryInterface[mc]; + getSymTemp(true).setSymmetryInfo(modelIndex, am[modelIndex].auxiliaryInfo, null); + SymmetryInterface unitCell = symTemp; + symTemp = null; + haveUnitCells = true; + return unitCells[modelIndex] = unitCell; + } + return null; } public void setModelCage(int modelIndex, SymmetryInterface simpleCage) { Modified: branches/v14_2/Jmol/src/org/jmol/popup/JmolGenericPopup.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/popup/JmolGenericPopup.java 2015-03-21 02:11:19 UTC (rev 20395) +++ branches/v14_2/Jmol/src/org/jmol/popup/JmolGenericPopup.java 2015-03-21 02:12:09 UTC (rev 20396) @@ -105,7 +105,7 @@ private boolean isMultiConfiguration; private boolean isMultiFrame; private boolean isPDB; - private boolean isSymmetry; + private boolean hasSymmetry; private boolean isUnitCell; private boolean isVibration; private boolean isZapped; @@ -377,7 +377,7 @@ modelInfo = new Hashtable<String, Object>(); isPDB = checkBoolean("isPDB"); isMultiFrame = (modelCount > 1); - isSymmetry = checkBoolean("hasSymmetry"); + hasSymmetry = modelInfo.containsKey("hasSymmetry"); isUnitCell = modelInfo.containsKey("unitCellParams"); fileHasUnitCell = (isPDB && isUnitCell || checkBoolean("fileHasUnitCell")); isLastFrame = (modelIndex == modelCount - 1); @@ -604,7 +604,7 @@ for (int i = VibrationOnly.size(); --i >= 0;) menuEnable(VibrationOnly.get(i), isVibration); for (int i = SymmetryOnly.size(); --i >= 0;) - menuEnable(SymmetryOnly.get(i), isSymmetry && isUnitCell); + menuEnable(SymmetryOnly.get(i), hasSymmetry && isUnitCell); for (int i = ChargesOnly.size(); --i >= 0;) menuEnable(ChargesOnly.get(i), haveCharges); for (int i = TemperatureOnly.size(); --i >= 0;) @@ -722,7 +722,7 @@ return; menuRemoveAll(menu, 0); menuEnable(menu, false); - if (!isSymmetry || modelIndex < 0) + if (!hasSymmetry || modelIndex < 0) return; Map<String, Object> info = (Map<String, Object>) vwr.getProperty( "DATA_API", "spaceGroupInfo", null); @@ -763,7 +763,7 @@ return; menuRemoveAll(menu, 0); menuEnable(menu, false); - if (!isSymmetry || modelIndex < 0) + if (!hasSymmetry || modelIndex < 0) return; String[] list = (String[]) modelInfo.get("symmetryOperations"); if (list == null) Modified: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-21 02:11:19 UTC (rev 20395) +++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-21 02:12:09 UTC (rev 20396) @@ -4,8 +4,13 @@ # THIS IS THE RELEASE BRANCH # BUG FIXES ONLY, PLEASE -Jmol.___JmolVersion="14.2.13_2015.03.20" +Jmol.___JmolVersion="14.2.13_2015.03.20b" +bug fix: popup menu Symmetry broken +bug fix: PDB reader does not save unit cell on simple load + +JmolVersion="14.2.13_2015.03.20" + bug fix: use of {*}.xxxx = for(i;{*};....) fails JmolVersion="14.2.13_2015.03.19" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits