From: <ha...@us...> - 2011-09-03 14:55:37
|
Revision: 16030 http://jmol.svn.sourceforge.net/jmol/?rev=16030&view=rev Author: hansonr Date: 2011-09-03 14:55:30 +0000 (Sat, 03 Sep 2011) Log Message: ----------- version=12.2.RC6_dev # bug fix: CIF reader not reading isotopes such as D and T Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java trunk/Jmol/src/org/jmol/api/JmolAdapter.java trunk/Jmol/src/org/jmol/modelset/Atom.java trunk/Jmol/src/org/jmol/util/Elements.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java 2011-09-03 11:17:16 UTC (rev 16029) +++ trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java 2011-09-03 14:55:30 UTC (rev 16030) @@ -1612,12 +1612,12 @@ if (isMolecular) { atomRadius = new float[atomCount]; for (int i = firstAtom; i < atomCount; i++) { - int elemno = atoms[i].elementNumber = JmolAdapter + short elemnoWithIsotope = atoms[i].elementNumber = JmolAdapter .getElementNumber(atoms[i].getElementSymbol()); int charge = (atoms[i].formalCharge == Integer.MIN_VALUE ? 0 : atoms[i].formalCharge); - if (elemno > 0) - atomRadius[i] = JmolAdapter.getBondingRadiusFloat(elemno, charge); + if (elemnoWithIsotope > 0) + atomRadius[i] = JmolAdapter.getBondingRadiusFloat(elemnoWithIsotope, charge); } bsConnected = new BitSet[atomCount]; for (int i = firstAtom; i < atomCount; i++) Modified: trunk/Jmol/src/org/jmol/api/JmolAdapter.java =================================================================== --- trunk/Jmol/src/org/jmol/api/JmolAdapter.java 2011-09-03 11:17:16 UTC (rev 16029) +++ trunk/Jmol/src/org/jmol/api/JmolAdapter.java 2011-09-03 14:55:30 UTC (rev 16030) @@ -117,8 +117,8 @@ return Group.lookupGroupID(group3); } - public static float getBondingRadiusFloat(int atomicNumber, int charge) { - return Elements.getBondingRadiusFloat(atomicNumber, charge); + public static float getBondingRadiusFloat(short atomicNumberWithIsotope, int charge) { + return Elements.getBondingRadiusFloat(atomicNumberWithIsotope, charge); } ////////////////////////////////////////////////////////////////// Modified: trunk/Jmol/src/org/jmol/modelset/Atom.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/Atom.java 2011-09-03 11:17:16 UTC (rev 16029) +++ trunk/Jmol/src/org/jmol/modelset/Atom.java 2011-09-03 14:55:30 UTC (rev 16030) @@ -504,13 +504,13 @@ } public float getCovalentRadiusFloat() { - return Elements.getBondingRadiusFloat(atomicAndIsotopeNumber % 128, 0); + return Elements.getBondingRadiusFloat(atomicAndIsotopeNumber, 0); } public float getBondingRadiusFloat() { float[] ionicRadii = group.chain.modelSet.ionicRadii; float r = (ionicRadii == null ? 0 : ionicRadii[index]); - return (r == 0 ? Elements.getBondingRadiusFloat(atomicAndIsotopeNumber % 128, + return (r == 0 ? Elements.getBondingRadiusFloat(atomicAndIsotopeNumber, getFormalCharge()) : r); } Modified: trunk/Jmol/src/org/jmol/util/Elements.java =================================================================== --- trunk/Jmol/src/org/jmol/util/Elements.java 2011-09-03 11:17:16 UTC (rev 16029) +++ trunk/Jmol/src/org/jmol/util/Elements.java 2011-09-03 14:55:30 UTC (rev 16030) @@ -991,7 +991,8 @@ bsCations.set(cationLookupTable[i]>>4); } - public static float getBondingRadiusFloat(int atomicNumber, int charge) { + public static float getBondingRadiusFloat(short atomicNumberAndIsotope, int charge) { + int atomicNumber = getElementNumber(atomicNumberAndIsotope); if (charge > 0 && bsCations.get(atomicNumber)) return getBondingRadiusFloat(atomicNumber, charge, cationLookupTable); if (charge < 0 && bsAnions.get(atomicNumber)) Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-09-03 11:17:16 UTC (rev 16029) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-09-03 14:55:30 UTC (rev 16030) @@ -3,6 +3,7 @@ version=12.2.RC6_dev +# bug fix: CIF reader not reading isotopes such as D and T # new feature: CRYSTAL reader reads property files for tensor quantities # -- displayed as ELLIPSOID # -- note that scale is set using ELLIPSOID N where N is a percent; default 50; max 100 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |