From: <ha...@us...> - 2007-10-07 20:18:52
|
Revision: 8378 http://jmol.svn.sourceforge.net/jmol/?rev=8378&view=rev Author: hansonr Date: 2007-10-07 13:18:49 -0700 (Sun, 07 Oct 2007) Log Message: ----------- 11.3.31 version Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/Atom.java trunk/Jmol/src/org/jmol/modelset/ModelSet.java trunk/Jmol/src/org/jmol/shape/Measures.java trunk/Jmol/src/org/jmol/viewer/Token.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/modelset/Atom.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/Atom.java 2007-10-07 20:03:29 UTC (rev 8377) +++ trunk/Jmol/src/org/jmol/modelset/Atom.java 2007-10-07 20:18:49 UTC (rev 8378) @@ -1298,7 +1298,7 @@ int ichCloseBracket = strFormat.indexOf('}', ich); if (ichCloseBracket > ich) { // also picks up -1 when no '}' is found String propertyName = strFormat.substring(ich, ichCloseBracket); - floatT = Viewer.getDataFloat(propertyName, atomIndex); + floatT = group.chain.modelSet.viewer.getDataFloat(propertyName, atomIndex); if (Float.isNaN(floatT)) strT = getClientAtomStringProperty(propertyName); if (strT != null || !Float.isNaN(floatT)) { Modified: trunk/Jmol/src/org/jmol/modelset/ModelSet.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelSet.java 2007-10-07 20:03:29 UTC (rev 8377) +++ trunk/Jmol/src/org/jmol/modelset/ModelSet.java 2007-10-07 20:18:49 UTC (rev 8378) @@ -2714,6 +2714,8 @@ return getSpecSeqcode(specInfo, true); case Token.spec_model: return getSpecModel(specInfo); + case Token.atomno: + return getSpecAtomNumber(specInfo); } return null; } @@ -2776,6 +2778,16 @@ return getModelAtomBitSet(getModelNumberIndex(modelNumber, true)); } + private BitSet getSpecAtomNumber(int atomno) { + //for Measures + BitSet bs = new BitSet(); + for (int i = atomCount; --i >= 0;) { + if (atoms[i].getAtomNumber() == atomno) + bs.set(i); + } + return bs; + } + /** * general lookup involving a range * @param tokType Modified: trunk/Jmol/src/org/jmol/shape/Measures.java =================================================================== --- trunk/Jmol/src/org/jmol/shape/Measures.java 2007-10-07 20:03:29 UTC (rev 8377) +++ trunk/Jmol/src/org/jmol/shape/Measures.java 2007-10-07 20:18:49 UTC (rev 8378) @@ -32,6 +32,7 @@ import org.jmol.util.BitSetUtil; import org.jmol.util.Escape; import org.jmol.viewer.JmolConstants; +import org.jmol.viewer.Token; import java.util.BitSet; import java.util.Vector; @@ -250,7 +251,7 @@ int nPoints = atomCountPlusIndices[0]; for (int i = 1; i <= nPoints; i++) { Atom atom = modelSet.atoms[atomCountPlusIndices[i]]; - measureList.addElement(viewer.getAtomBits("atomno", atom.getAtomNumber())); + measureList.addElement(viewer.getAtomBits(Token.atomno, atom.getAtomNumber())); } define(measureList, isDelete, false, false); return; Modified: trunk/Jmol/src/org/jmol/viewer/Token.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Token.java 2007-10-07 20:03:29 UTC (rev 8377) +++ trunk/Jmol/src/org/jmol/viewer/Token.java 2007-10-07 20:18:49 UTC (rev 8378) @@ -374,7 +374,7 @@ final static int atompropertyfloat = atomproperty | 1 << 5; - final static int atomno = atomproperty | 1; + final public static int atomno = atomproperty | 1; final static int atomID = atomproperty | 2; final static int bondcount = atomproperty | 3; final static int atomIndex = atomproperty | 4; Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2007-10-07 20:03:29 UTC (rev 8377) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2007-10-07 20:18:49 UTC (rev 8378) @@ -2320,7 +2320,7 @@ return dataManager.getDataFloat(label); } - float getDataFloat(String label, int atomIndex) { + public float getDataFloat(String label, int atomIndex) { return dataManager.getDataFloat(label, atomIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |