eric capps wrote:
>how powerful are atom expressions? i take it getAtomBitSet
>("atomno<10") would return 1111111110...0 (in BitSet parameters of
>course); would an expression like atomno>5 && atomno<30 work? what
>about a wildcard?
>
>
>
atom expressions can do anything.
within(molecule,atomno=3)
atomno < 10 and */1
you name it.
>for that matter, it occurs to me that it may not even be necessary to
>use a BitSet, particularly if the majority of the atoms are changing
>coordinates. rather, we could have a method like:
>
>jmolSetAtomCoords(Double[] coords)
>
>and simply reallocate the atoms[] array to coordinates.length, then
>copy them in. would this not be quicker? this may also be helpful in
>the event that an atom is added or disappears.
>
>
simple things like this are possible; the bitset idea or atom expression
idea provides flexibility. If null, then it could certainly default to
"replace all" but I thought we were interested in something that didn't
necessarily replace all.
>also, is there a reason to use doubles rather than floats?
>
>
JavaScript apparently only as integers and doubles, and you have to
FORCE it to use doubles. Even "1.0" is changed to an integer. So passed
numeric variables from JavaScript to Java can't be floats.
But we could pass a BitSet to JavaScript, have it load the bitset, and
pass it back. This sort of thing is not out of the question:
Viewer.Java:
BitSet getBitSet() {
return new BitSet();
}
JavaScript:
var myViewer = jmolGetPropertyAsJavaObject("jmolViewer")
var myBitSet = myViewer.getBitSet();
myBitSet.set(3);
myBitSet.set(5);
myBitSet.set(6);
jmolSetAtomCoordinates(myBitSet,....)
Ah, actually, if we really wanted to play, we could have some fun with
the following (if they were public):
var atoms = jmolGetPropertyAsJavaObject("jmolViewer").getFrame().atoms
Then right in the JavaScript set all the coordinates you want:
for (var i = 0; i < atoms.length; i++)
atoms[i].point3f.x = ...
atoms[i].point3f.y = ...
atoms[i].point3f.z = ...
But that would be making an aweful lot public.
Bob
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers