From: <ha...@us...> - 2008-06-13 11:48:44
|
Revision: 9479 http://jmol.svn.sourceforge.net/jmol/?rev=9479&view=rev Author: hansonr Date: 2008-06-13 04:48:40 -0700 (Fri, 13 Jun 2008) Log Message: ----------- version=11.5.40_dev new select() function; H1/H3 fix; quaternion second derivative # new feature: full math on individual atom properties using # a new function: # # select(x;{atomexpression};booleanEvaluation) # # for example: # x = select(x;{*};x.distance({atomno=3}) / 3 > x.distance({atomno=2})) # bug fix: H1 and H3 in DNA are NOT backbone # new feature: quaternion derivative2 (2nd derivative) and quaternion e derivative [experimental] Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Eval.java Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-06-13 11:38:06 UTC (rev 9478) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-06-13 11:48:40 UTC (rev 9479) @@ -7153,7 +7153,8 @@ } private Object parameterExpression(int pt, int ptMax, String key, - boolean asVector, int ptAtom, Hashtable localVars) + boolean asVector, int ptAtom, + Hashtable localVars) throws ScriptException { Object v; boolean isSetCmd = (key != null && key.length() > 0); @@ -7174,31 +7175,28 @@ if (!(v instanceof BitSet)) error(ERROR_invalidArgument); BitSet bsAtoms = (BitSet) v; - if (getToken(i = iToken).tok != Token.semicolon) + if (getToken(i = iToken).tok != Token.semicolon) error(ERROR_invalidArgument); ++i; //skip semicolon BitSet bsSelect = new BitSet(); BitSet bsX = new BitSet(); Token.Token2 t = null; int atomCount = (isSyntaxCheck ? 0 : viewer.getAtomCount()); - if (localVars == null) - localVars = new Hashtable(); - localVars.put(dummy, t = new Token.Token2(Token.bitset, 0, bsX)); - - for (int j = 0; j < atomCount; j++) - if (bsAtoms.get(j)) { - bsX.clear(); - bsX.set(j); - t.intValue2 = j; - v = parameterExpression(i, -1, null, false, j, localVars); - if (!(v instanceof Boolean)) - error(ERROR_invalidArgument); - if (((Boolean) v).booleanValue()) - bsSelect.set(j); - if (tokAt(iToken) != Token.rightparen) - error(ERROR_invalidArgument); - } - i = iToken; + if (localVars == null) + localVars = new Hashtable(); + localVars.put(dummy, t = new Token.Token2(Token.bitset, 0, bsX)); + for (int j = 0; j < atomCount; j++) + if (bsAtoms.get(j)) { + bsX.clear(); + bsX.set(j); + t.intValue2 = j; + if (((Boolean) parameterExpression(i, -1, null, false, j, localVars)) + .booleanValue()) + bsSelect.set(j); + if (tokAt(iToken) != Token.rightparen) + error(ERROR_invalidArgument); + } + i = iToken; v = bsSelect; break; case Token.semicolon: //for (i = 1; i < 3; i=i+1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |