On Jan 1, 2005, at 12:24 PM, Miguel wrote:


Miguel,

in order to be able to save an xyz file, I would like to see the
following methods in JmolViewer:

String getElementSymbol(int atomIndex)
Vector3f getVibrationVector(int atomIndex)
float getPartialCharge(int atomIndex)

If you think I am wrong about that, please let me know how else I can
get access to the information that these methods hint at.

Yes, I think that this is correct.

I am thinking that we should get all of these things as atom properties.

getAtomProperty(int atomIndex, String propertyName);

We can then pass in propertynames like "elementSymbol"

This would allow us to expand in the future.

Q: What do you think of this?

The (small) disadvantage I see is the the additional parsing that may need to be done when one needs the values not as strings.
For saving purposes that is not a problem, though.


We would need to come up with a set of propertyNames that map the existing/fixed fields to a property.

It does seem like a lot bigger modification to the code then just added the three methods, but you probably feel that I will be asking for some other ones down the line, right?

Actually now I think about it a bit more, would you be interested to start exposing fields for the viewer's modelmanager and frame manager as properties also, e.g., the vibrationScale, vibrationPeriod (which are ones that I may need in order to do the calculation as you suggest below), with something like
String getViewerProperty("vibrationScale");
and maybe also set them (I tend to like symmetry :-)
setViewerProperty("vibrationScale","2.0");
or
setViewerProperty("vibrationScale", 2.0);


These would actually be equivalent to an evalStringQuiet() type script execution, for the ones that have script support.

Ren�



On an aside, I assume that when you show a vibration you calculate an
array of atomic positions for the animation frames. For the export of a
vibration as an XYZ movie, I was planning to do the same, but since I
assume you already do that, I was wondering whether it may make sense
to get yours directly...

I am not sure. It will be a function of the frame rate. It is only a few
lines of code. Perhaps it would just be easier to calculate it yourself.

That's fine with me.

Ren�



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to