From: <ha...@us...> - 2011-07-14 16:08:52
|
Revision: 15771 http://jmol.svn.sourceforge.net/jmol/?rev=15771&view=rev Author: hansonr Date: 2011-07-14 16:08:45 +0000 (Thu, 14 Jul 2011) Log Message: ----------- pdbAddHydrogens with appendNew problem Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/AtomCollection.java trunk/Jmol/src/org/jmol/modelset/ModelCollection.java trunk/Jmol/src/org/jmol/modelset/ModelLoader.java trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java Modified: trunk/Jmol/src/org/jmol/modelset/AtomCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/AtomCollection.java 2011-07-14 08:48:22 UTC (rev 15770) +++ trunk/Jmol/src/org/jmol/modelset/AtomCollection.java 2011-07-14 16:08:45 UTC (rev 15771) @@ -1040,6 +1040,10 @@ + " set"; int n = 0; boolean isDefault = (type == TAINT_COORD); + if (bs != null && bs.length() > atomCount) { + System.out.println("atomcollection check bs " + Escape.escape(bs)); + return; + } if (bs != null) for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) { s.append(i + 1).append(" ").append(atoms[i].getElementSymbol()).append( Modified: trunk/Jmol/src/org/jmol/modelset/ModelCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2011-07-14 08:48:22 UTC (rev 15770) +++ trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2011-07-14 16:08:45 UTC (rev 15771) @@ -4088,6 +4088,10 @@ for (int i = i0; i < atomCount; i++) { atoms[i] = atoms[map[i]]; atoms[i].index = i; + Model m = models[atoms[i].modelIndex]; + if (m.firstAtomIndex == map[i]) + m.firstAtomIndex = i; + m.bsAtoms.set(i); } if (vibrationVectors != null) for (int i = i0; i < atomCount; i++) Modified: trunk/Jmol/src/org/jmol/modelset/ModelLoader.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2011-07-14 08:48:22 UTC (rev 15770) +++ trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2011-07-14 16:08:45 UTC (rev 15771) @@ -1388,13 +1388,19 @@ int[] mapNewToOld = new int[modelSet.atomCount - bsDeletedAtoms.cardinality()]; int n = baseAtomIndex; - for (int i = baseAtomIndex; i < modelSet.atomCount; i++) + Model[] models = modelSet.models; + Atom[] atoms = modelSet.atoms; + for (int i = baseAtomIndex; i < modelSet.atomCount; i++) { + models[atoms[i].modelIndex].bsAtoms.clear(i); + models[atoms[i].modelIndex].bsAtomsDeleted.clear(i); if (bsDeletedAtoms.get(i)) { mapOldToNew[i] = n - 1; + models[atoms[i].modelIndex].atomCount--; } else { mapNewToOld[n] = i; mapOldToNew[i] = n++; } + } modelSet.modelSetAuxiliaryInfo.put("bsDeletedAtoms", bsDeletedAtoms); // adjust group pointers for (int i = baseGroupIndex; i < groups.length; i++) { Modified: trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java =================================================================== --- trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java 2011-07-14 08:48:22 UTC (rev 15770) +++ trunk/Jmol/src/org/jmol/modelsetbio/Resolver.java 2011-07-14 16:08:45 UTC (rev 15771) @@ -529,7 +529,7 @@ continue; } String value = htBondMap.get(key); - Logger.info(key + " was not used; order=" + value); + Logger.info("bond " + key + " was not used; order=" + value); if (htBondMap.get(key).equals("1")) { htKeysUsed.put(key, Boolean.TRUE); continue; // that's ok This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |