Hi, Mark,
It's certainly fine to take Jmol and use it in any way you like.
Mostly I would recommend being careful about changing classes, as you
can easily get stuck with problems when we upgrade Jmol. But a good
way to do this is to subclass the Jmol classes so that all your code
goes into a layer above ours, and you can always at least try to pull
newer Jmol code in under that layer. (If that makes any sense...)
The reason to use the scripting interface is that then you pretty much
guarantee continued access to any newer Jmol versions.
Merging really is quite a major operation. It does integrate perfectly
new atoms and bonds into the old. But you are right that the operation
itself adds independent sets of atoms and bonds. Then, if you wanted
to connect those to already-present atoms, you would use the "connect"
methods.
There are two modes of merging -- where you create a new "frame" and
when you "append" to an existing frame. Sounds like you are interested
in the append business.
Jmol does the following:
1) FileManager creates an "AtomSetCollection"
2) ModelManager creates (or merges this into) a "ModelSet"
Probably the best place to start, because it involves no file reading,
is in Viewer:
private String createModelSetInline(String strModel, Hashtable htParams,
boolean isAppend, boolean createModelSet) {
//loadInline, openFile, openStringInline
if (!isAppend)
zap(true, false);
fileManager.createAtomSetCollectionFromString(strModel,
setLoadParameters(htParams), isAppend);
return (createModelSet ? createModelSetAndReturnError(isAppend) : null);
}
This is 11.7 code. Note that I recently refactored this section
because there were some bugs that were creeping in, and I couldn't
figure out what was going on. So these methods will be different with
previous versions.
Hope that helps.
Bob
On Tue, Jan 13, 2009 at 10:02 AM, mark gibson <[email protected]> wrote:
> Hi,
> Just joined the list.
> I was wondering about ModelSet merging.
> From looking at the source, merging doesnt seem to be a way of adding
> additional nodes and edges to an existing model set(where new edges may
> connect old & new nodes), but seems like its a way of having multiple
> model sets in jmol. Do I have this right?
>
> Is there some existing way to add more nodes and edges to an existing
> (already created) ModelSet?
>
> If there is developer documentation on this please point me that way.
> What is there for developer documentation?
>
> To give some background, my colleague Victor Chest, whom I am now
> helping, has created an application called NBrowse that is used to
> visualize genetic interactions. JMol is embedded inside of NBrowse
> essentially.
> NBrowse had been mostly talking to JMol via its scripts, and Ive been
> adding more direct java interaction.
> I am guessing this was probably not an intended use of JMol? That is
> basically to be used as a library rather than a stand-alone application?
> (not to mention being used for viewing genetic interactions rather than
> molecules)
>
> Thanks for your help,
> Mark Gibson
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers