eric capps wrote:

>On Jun 23, 2006, at 7:52 AM, Bob Hanson wrote:
>
>  
>
>>right. There are a couple of schemes I can think of --
>>
>>
>>where you pick off coord in the coordList based on scanning the  
>>atomList
>>
>>void replaceCoordinates(BitSet atomList, Point3f[] coordList) {
>>int ipt = 0;
>>for (int i = atomList.size(); --i >=0;)
>>  if(atomList.get(i))
>>    atoms[i].point3f.set(coordList[ipt++])
>>}
>>
>>for example, would do the trick.
>>    
>>
>
>bob, what is the purpose of the atomList variable here? in  
>particular, why are you using a BitSet? is it supposed to indicate  
>which coordinates are to be replaced?
>  
>
Right, this would be a simple compact way of indicating just the atoms 
you want changed without having to list all of them.

>  
>
>>>2) if you do think this will work quickly enough, do you think i
>>>should work from the inside out, that is, from the Frame class to the
>>>ModelManager, and so on, out to Eval? or vice versa?
>>>
>>>what i think would be great is a command like:
>>>
>>>"update (# of atoms) (coordinates of atoms)"
>>>
>>>
>>>      
>>>
>>Be more specific here. What do you actually mean? Perhaps:
>>
>>update (atomno<=10) {coord1} {coord2} {coord3} ......
>>
>>Are you sure we want this to be a script command? (this will slow the
>>operation considerably)
>>Question 1: Do you want to access this from a web page for the applet?
>>Question 2: Do you primarily want to use the application?
>>
>>We could much better, I think, make this a JmolViewer interface  
>>function.
>>    
>>
>
>you're right, a script command isn't the best way. for my purposes  
>this would be in an applet context. new coordinates (i.e. calls to  
>this method) would be passed in either through javascript (and i  
>guess Jmol-new.js) or a separate java control applet. that's another  
>issue that is probably outside the scope of this topic, is it easy to  
>allow another embedded applet in the same page communicate with jmol?
>
>  
>
OK, if it's applet, then the bitset idea is not so good. The best way 
would be to use something like I've already set up, where you change a 
specific atom's coordinate. But what is very slow is passing variables 
back and forth from JavaScript to the applet. So we have to come up with 
a mechanism of passing an array ONCE to do the job. JavaScript doesn't 
have bitsets, but Jmol does have the capability of turning any atom 
expression into a BitSet. Thus, we have in Viewer:

  BitSet getAtomBitSet(String atomExpression) {
    return selectionManager.getAtomBitSet(atomExpression);
  }

My idea would be then, for the applet, something like:

jmolSetAtomCoordinates("atomno<10",Coordinates)

where "Coordinates" is an array of double[3] values, I think, defining 
the new coordinate. Maybe....

Right now I've implemented:

  public void setAtomCoord(int atomIndex, float x, float y, float z) {
    modelManager.setAtomCoord(atomIndex,x,y,z);
  }

  public void setAtomCoordRelative(int atomIndex, float x, float y, 
float z) {
    modelManager.setAtomCoordRelative(atomIndex,x,y,z);
  }
 
(The second moves an atom by a cetain amount, not TO a certain place.)

But we can't be calling this thousands of times. We need ONE call. We'll 
have to experiment to see how well Java can read JavaScript arrays. I 
suspect there's no problem.



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

Reply via email to