JR, I was wrong about how to set up the information for displaying cube 
data. I was off by one level. This is correct:

Here's how you set it up:

Hashtable info = new Hashtable();
info.put("volumetricOrigin",....);  //Point3f
info.put("volumetricVectors",...); //Vector3f[3]
info.put("voxelCounts",...); //int[3]
info.put("voxelData",...);  //float[][][]

THEN,

viewer.getModelAuxiliaryInfo(0).put("surfaceInfo",info)

I'll set it up so you can do this twice, once for the surface definition 
and once for the mapped data. Let's put the mapped data in as:

viewer.getModelAuxiliaryInfo(0).put("mappedDataInfo",info)

The 0 is there because you will only have one model loaded in the viewer.

That said, all you really have to do is pass Jmol a string defining a 
WebMO file using

viewer.loadInline("...[webMO data here]....")

and Jmol will do all this for you. No need for any of this volume stuff. 
(I understand, though, you said separately that you wanted to do the 
cube business yourself. That's fine -- this is just easier.)

Then just specify

viewer.script("mo 1")
viewer.script("mo 2")

etc.

Bob

Bob Hanson wrote:

> Hi, JR,
>
>
>
>>  
>>
>>> 2)  Programmatically add isosurfaces, including the possibility of
>>> mapping properties onto the isosurface
>>>   
>>
> we can certainly work with you to do this. I have just now added the 
> capability of sending Jmol a set of array data and having it delivered 
> as cube data. What you will need is a Hashtable structure that can be 
> read as the equivalent
> of a Gaussion cube file. All these should be in Angstroms, not Bohr. 
> Here's how Jmol will read it:
>
>
>  void setupSurfaceInfo() {
>    volumetricOrigin.set((Point3f)surfaceInfo.get("volumetricOrigin"));
>    Vector3f[] v = (Vector3f[])surfaceInfo.get("volumetricVectors");
>    for (int i = 0; i < 3; i++)
>      volumetricVectors[i].set(v[i]);
>    int[] counts = (int[])surfaceInfo.get("voxelCounts");
>    for (int i = 0; i < 3; i++)
>      voxelCounts[i] = counts[i];
>    voxelData = (float[][][])surfaceInfo.get("voxelData");
>    precalculateVoxelData = true;
>  }
>
> Here's how you set it up:
>
> Hashtable info = (Hashtable)viewer.getModelAuxiliaryInfo(modelIndex);
> info.put("volumetricOrigin",....);
> info.put("volumetricVectors",...);
>
> etc.
>
> then
>
> viewer.script("isosurface \"\"  ")
>
> which tells Jmol to render the isosurface with no external file.
>
>
> The voxel data are read
>
> for (int x = 0; x < XDim; x++)
>  for (int y = 0; y < YDim; y++)
>    for (int z = 0; z < ZDim; z++)
>
>
> Jmol can read two data sets and map one onto the other, or it can read 
> one and deliver a planar slice, or it can read one and apply that data 
> to a user-provided function (very preliminary -- works just for 
> JavaScript/web interface right now).
>
> So keep us informed and let me help you.
>
> Bob Hanson
>
>
>
>
>> Egon
>>
>>  
>>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to