Note -- this is all 10.x

Dave,

[EMAIL PROTECTED] wrote:

>Bob,
>
>Here is my suggested list of desirable functionality.
>I think all these are fairly minor changes, or in some cases
>no change at all.
>Let me what you think.
>
>1. Measurement table should display all measurements in current
>measurement list.
>By measurement list I mean the data accessed by the viewer api
>getMeasurementCount() and getMeasurementCountPlusIndices()
>
>  
>
If this is not current operation, it's a bug. Let me know.

>2. 'measure ON/OFF' should control *display* of current measurement
>list,
>not delete anything. If this breaks backward-compatibility, you could
>have
>new keywords 'measure DISPLAYON/DISPLAYOFF'
>
>  
>
yes, we'll need those keywords. Very good idea. Very simple, too, 
because with the visibility business I have set up, it's trivial to add 
an additional flag that adds this level of detail.

>3. 'measure DELETEALL' deletes all measurements from measurement list
>  
>
this is just

  measures off

>'measure x y' creates new measurement
>  
>
where x and y can be either two atom numbers (running sequentially 
through ALL models; 1-based) or two atom expressions. In the case of 
atom expressions, unless the ALL keyword is used, the FIRST atom in any 
given atom expression is used.

>'measure DELETE x y' deletes this measurement
>
>  
>
I've implemented this specifically for atom expressions. If you think 
it's important to do so with raw atom numbers, let me know.


>4. On measurement table:
>'Delete All' button is equivalent to 'measure DELETEALL'
>  
>
currently DeleteAll

>'Delete' button equivalent to 'measure DELETE x y', where x y is
>selected
>measurement.
>  
>
current action

>5. In viewer:
>selecting a measurement with clicking is equivalent to 
>'measure x y'
>  
>
current action

>selecting an already selected measurement with clicking
>is equivalent to 'measure DELETE x y'
>
>  
>
current action

>6. The above commands apply to the current frame only,
>unless 'set measureAllModels ON' is set, in which case they apply
>to the same measurement in all frames.
>
>  
>
current action

>7. The 'measure ALL x y' syntax in 10.x should be restricted to
>the current frame, only extended if 'set measureAllModels ON' 
>is set, as with all other 'measure' commands.
>  
>
ah, THAT's a good idea! Excellent!

>8. It should be possible to create measurements between atoms in
>different
>frames (using e.g. measure 1/1 1/2) If 'set measureAllModels ON' is set,
>this measurement should
>be created between the first selected atom in the current frame, and the
>other
>atoms in all frames (e.g. you could track the distance moved by one atom
>over an MD trajectory).
>
>  
>
current action -- no special keywords required. Because we are being so 
specific, the code recognizes the intent.


>9. The 'set measurement' commands should remain as present.
>
>  
>
ok

>10. The atom boxes in the measurement table should label both the atom 
>number and the frame number, e.g. 23/1 H.
>
>  
>
done (yesterday)

>11. The menu and popup Measurement tick boxes should be equivalent
>to 'measure ON/OFF'
>
>  
>
Let's think more about what the menu options should be and where they 
should be. Here you mean DISPLAYON/DISPLAYOFF, I think.

OK, so that's not so bad. I see two modifications to make:

a) displayon/displayoff
b) "ALL" with current model only

That sound right?

You might want to look into using the JmolViewer interface function:

  abstract public Object getProperty(String returnType, String infoType, 
String paramInfo);

specifically

  getProperty(null,"measurementInfo")

also viewable through the script command

getProperty measurementInfo

It returns the following object, which is a Vector of Hashtables. (This 
is JSON, but you'll recognize it simply as a compact way of describing 
nested Vectors and Hashtables.):

 [
  {"atoms": [{"atomno": 11,"_ipt": 10,"info": "O 11 #11"},{"atomno": 
9,"_ipt": 8,"info": "O 9 #9"}]
    ,"index": 0
    ,"strMeasurement": "0.462 nm"
    ,"type": "distance"
    ,"count": 2
    ,"value": 4.624748}
 ,{"atoms": [{"atomno": 5,"_ipt": 4,"info": "C 5 #5"},{"atomno": 
2,"_ipt": 1,"info": "N 2 #2"}]
    ,"index": 1
    ,"strMeasurement": "0.292 nm"
    ,"type": "distance"
    ,"count": 2
    ,"value": 2.9233778}
  ,{"atoms": ....etc.
 ]

So, for example, in Java:

 Vector info = viewer.getProperty(null,"measurementInfo")

int nMeasures = info.length();
Float distance1 = info.get(0).get("value");
Float distance2 = info.get(1).get("value");
String distance1label = info.get(0).get("strMeasurement");
String measure1atom1label = info.get(0).get("atoms").get(0).get("info");
String measure1atom2label = info.get(0).get("atoms").get(1).get("info");

At least, it's supposed to work that way; I haven't tried it....
Am I right that you have access to all the JmolViewer methods?
JmolViewer.getProperty() is far richer than anything else in this 
regard, and with the null there it returns the
actual Java object. You can get just about anything you can imagine with 
this.

Bob Hanson



_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to