When refering to a specific molecul in Jmol I need the model number.
I mean the number which I use in selections like "... and 3.1 " where 3 is the 
model number.


currently I identify the model index by using viewer.getModelFileName(int) and 
adding one.

This works as long as no model has been deleted.

What is the correct way of obtaining the model number?


Thanks

Christoph



This is my current code:


 private int getModelNumber() {
        final Viewer viewer=getJmolViewer();
        final String path=this.filePath;
        if (viewer!=null && path!=null) {
            for(int i=viewer.getModelCount(); --i>=0;) {
                if (path.equals(viewer.getModelFileName(i))) return i;
            }
        }
        return -1;
    }




------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to