Robert, Angel, thanks for your quick responses! Apologies for my delay reply, in full-on deadline mode.

I appreciate that Jmol is developed by volunteers and am all too aware of the challenges involved in writing and maintaing documentation.. Usually I rely on finding reference code on GitHub or similar, but this time my searches didn't turn up so much to work with.

I have looked at Biojava' Structure + .gui classes as well as Spice, but again they don't quite cover the details I need. I wasn't aware of the "examples" code, I didn't use SVN to check out the code and I guess Sourceforge blocks Google from indexing the repo. Some of that code was helpful, but it still didn't help me understand how to access Jmol's internals.

I do realize I'm doing something most Jmol users have no need to do. This is an art project and I'm doing a lot of unorthodox styling and animation that has little to do with Jmol's scientific purposes. It would be hard accomplish my goals within the scripting framework, so I'm using an external application framework (implemented in Processing http://processing.org).

Responding to your feedback:

    - Script status checking


Meaning? This would be via script callbacks. Are you using JmolStatusListener? See examples.basic.org.jmol.Export.java

I'm executing hundreds or thousands of commands for every frame, so knowing the state of the script execution is crucial. My problem was an exception being thrown inside a QueueThread and crashing the scripting engine, a condition I could neither detect nor rectify. set debugging and debugScript were not really helpful, I'm experimenting with ScriptContext but I'm still not sure how to restart the engine even if I could detect the error.

Luckily my problem has been solved for now (knock on wood), I must have fixed whatever bug in my code that was causing it. The actual cause is still a mystery, though.

My problem in general is accessing Jmol's internal state and mechanisms, most importantly the scripting engine, repaint mechanism as well as molecular data with associated styling. Initially I had hoped to bypass the scripting interface and manipulate structures and styles directly, but that's less essential and seems an unrealistic goal for now.

Scripting does works for me most of the time, although I would preferred programmatic access through a DOM or similiar since I have to execute so many commands to produce a single frame of animation. Just constructing the needed String objects could be a a performance hit, I'm using StringBuffers wherever possible but I still need to create a ton of object instances.

I've pored over Viewer.java and its associated classes in detail, but without demo code or javadoc it's a pretty big puzzle. I'm sure there are callbacks and API mechanisms I should be using that I'm not aware of. Don't mistake my questions for criticisms, I'll be the first to admit to being an ignorant Jmol noob as well as a coder of limited skills.

In short: Any tips on sample code or good practices would be welcome.

-marius


On 08-May-13 07:53, Angel Herráez wrote:
Hi Marius

That looks terrific!  A great demonstration of Jmol abilities.

I will let others (Bob) reply to your technical questions.


- Error handling
Probably by using debug levels and callbacks
http://chemapps.stolaf.edu/jmol/docs/#setdebugging
http://chemapps.stolaf.edu/jmol/docs/#setcallback


- Script status checking
Callbacks


- Precise repaint control so that repaint will wait for scripts that I
executed every frame to produce animation
See
http://chemapps.stolaf.edu/jmol/docs/#refresh
(not what you want)
And maybe also "set repaintWaitMs n", look for it under
http://chemapps.stolaf.edu/jmol/docs/#setmisc


Confounded by the lack of documentation
http://chemapps.stolaf.edu/jmol/docs/

I know it is not very friendly, but there's a lot of information
there. The wiki is more friendly, but far from exhaustive.
We have many users, not so many developers and documenters.
Volunteers are always welcome tro contribute.


Finally, I think it would be great to share your production. Would
you mind that we link to your Flickr page? I could add a link to the
presentation mode in the Wiki, maybe in Home page > About Jmol > Jmol
Art -- is that a suitable term?



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today!http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users



--
//////////////////////////////////////////////////
Marius Watz

New web site:http://mariuswatz.com
Silk screen prints:http://randomnumber.nu/?cat=21
//////////////////////////////////////////////////
http://twitter.com/mariuswatz
http://twitter.com/generatorx
http://flickr.com/photos/watz

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to