From: <ha...@us...> - 2010-11-18 13:24:29
|
Revision: 14682 http://jmol.svn.sourceforge.net/jmol/?rev=14682&view=rev Author: hansonr Date: 2010-11-18 13:24:22 +0000 (Thu, 18 Nov 2010) Log Message: ----------- version=12.1.24_dev # bug fix: find("SMILES", smilesString) does not find Jmol atomIndex == 0 # bug fix: find("SMILES", smilesString) does not find [2H] Modified Paths: -------------- trunk/Jmol/src/org/jmol/smiles/SmilesAtom.java trunk/Jmol/src/org/jmol/smiles/SmilesSearch.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/smiles/SmilesAtom.java =================================================================== --- trunk/Jmol/src/org/jmol/smiles/SmilesAtom.java 2010-11-18 13:23:21 UTC (rev 14681) +++ trunk/Jmol/src/org/jmol/smiles/SmilesAtom.java 2010-11-18 13:24:22 UTC (rev 14682) @@ -618,14 +618,18 @@ .getOtherAtom(this).index); } + private int covalentHydrogenCount = -1; + public int getCovalentHydrogenCount() { + if (covalentHydrogenCount >= 0) + return covalentHydrogenCount; if (parent != null) return parent.getCovalentHydrogenCount(); - int n = 0; + covalentHydrogenCount = 0; for (int k = 0; k < bonds.length; k++) if (bonds[k].getOtherAtom(this).elementNumber == 1) - n++; - return n; + covalentHydrogenCount++; + return covalentHydrogenCount; } public int getValence() { Modified: trunk/Jmol/src/org/jmol/smiles/SmilesSearch.java =================================================================== --- trunk/Jmol/src/org/jmol/smiles/SmilesSearch.java 2010-11-18 13:23:21 UTC (rev 14681) +++ trunk/Jmol/src/org/jmol/smiles/SmilesSearch.java 2010-11-18 13:24:22 UTC (rev 14682) @@ -742,7 +742,7 @@ // "=" <n> Jmol index - if (patternAtom.jmolIndex > 0 + if (patternAtom.jmolIndex >= 0 && atom.getIndex() != patternAtom.jmolIndex) break; @@ -773,7 +773,8 @@ break; // H explicit H count - n = patternAtom.missingHydrogenCount; + //problem here is that you can have C[H] + n = patternAtom.getCovalentHydrogenCount() + patternAtom.missingHydrogenCount; if (n >= 0 && n != atom.getCovalentHydrogenCount()) break; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-11-18 13:23:21 UTC (rev 14681) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-11-18 13:24:22 UTC (rev 14682) @@ -3,6 +3,8 @@ version=12.1.24_dev +# bug fix: find("SMILES", smilesString) does not find Jmol atomIndex == 0 +# bug fix: find("SMILES", smilesString) does not find [2H] # bug fix: slightly better response to command line input errors (complete command in history) # new feature: print point(3.5) -- rounds down (toward 0) to nearest integer # bug fix: IDTF exporter inverts rotation matrix from pt1, pt2, for dx = dy = 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |