Miguel wrote:

Miguel, what are your plans for

select connected() ?

This is very important, particularly in the area of polyhedra. It allows
extensive selectivity that I need for selecting specific polyhedra.

Is this "bondcount" supposed to be a replacement for that?


Yes, 'bondcount' supplies the same functionality as 'connected()'

The 'bondcount' code has been in there for years ... under the internal
name of '_bondedcount'.

The 'connected()' code was also including hbonds in the calculations ...
so I went ahead and added 'hbondcount' as a clone of the 'bondcount' code.

Oh, did you look carefully at my last Compiler class code? MUCH more than simply counting bonds. Please -- that is important.

    clauseConnected  ::= CONNECTED ( integer , integer , expression ) |
                         CONNECTED ( integer , expression ) |
                         CONNECTED ( integer , integer ) |
                         CONNECTED ( expression ) |
                         CONNECTED ( integer ) |
                         CONNECTED

thus:

connected(minbonds, maxbonds, atomExpression)
connected(nbonds, atomExpression)
connected(minbonds, maxbonds)
connected(atomExpression)
connected(nbonds)

Far as I can tell, you are only implementing the last of those, right?
Here's the thing: with more flexible polyhedra we will have need to be very specific in selecting out what centers we are turning into polyhedra. The issue, I found, is that when you generate a few unit cells worth of atoms, some are always on the edge and not really desired. What connected(....) does is allow a very fine-grained selection of these otherwise difficult to select atoms so that they cna be included or excluded.

Trust me on this... we need the full clauseConnected()
You'll probably come up with a better way to pass on the information; I used within() as a model. It DOES work. I suppose a natural extension would be


connected(minbonds, maxbonds, bondtype, atomExpression)

but I didn't go that far.


boolean clauseConnected() {
    int min = 1;
    int max = 100;
    int tok;
    boolean iHaveExpression = false;
    Token token;
    tokenNext();                     // Connected
    while (!iHaveExpression) {
      if (tokPeek() != Token.leftparen)
        break;
      tokenNext();                     // (
      tok = tokPeek();
      if (tok == Token.integer) {
        token = tokenNext();             // minimum # of bonds (optional)
        if (token.intValue < 0)
          nonnegativeIntegerExpected();
        min = token.intValue;
        token = tokenNext();
        tok = token.tok;
        if (tok == Token.rightparen) // )
          break;
        if (tok != Token.opOr)   // ,
          commaOrCloseExpected();
        tok = tokPeek();
      }
      if (tok == Token.integer) {
        token = tokenNext();             // maximum # of bonds (optional)
        if (token.intValue < 0)
          nonnegativeIntegerExpected();
        max = token.intValue;
        token = tokenNext();
        tok = token.tok;
        if (tok == Token.rightparen) // )
          break;
        if (tok != Token.opOr)   // ,
          return commaOrCloseExpected();
        tok = tokPeek();
      }
      if (tok == Token.rightparen) // )
        break;
      if (!clauseOr()) // *expression*
        return false;
      if (!tokenNext(Token.rightparen)) // )T
        return rightParenthesisExpected();
      iHaveExpression = true;
    }
    if (! iHaveExpression)
      addTokenToPostfix(new Token(Token.all));
    return addTokenToPostfix(new Token(Token.connected, min,
        new Integer(max)));
  }







Miguel



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge."  - Albert Einstein


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to