Re: Layers?

Hi Desiree,

> I was thinking about using the Visad-Display classes for my application,
> I think they run a lot smoother than mine.

Glad to hear it.

> I want to store 3D-Objects in different layers in one view, similar to
> 2D-GeoInformationSystems. For example I do have one Layer for the
> terrain-surface, one layer for a ground-water-surface and several layers
> for hydrogeological-surfaces. I do want them to be independent from
> another, so that I can display several, all or one from the layers at any
> time.
> I read in the Visadpage something about multiple views, and I was not sure
> if this could be something similar to a layer or if these are just
> different frames
> with a new virtual world in each frame?

To have independent layers, put each layer in a different
Data object (not hard since a Data object may be any simple
or complex set of data).  Then link each Data object to a
DisplayImpl like this:

  DisplayImpl display = new DisplayImplJ3D("display");
  . . .
  // for each Data object data_1, data_2, ..., data_n
  DataReference ref_i = new DataReference("ref_i");
  ref_i.setData(data_i);
  DataRenderer renderer_i = new DefaultRendererJ3D();
  display.addReferences(renderer_i, ref_i);
  . . .

Now you can toggle layer i on and off with:

  boolean on_i = ...; // true=on and false=off
  renderer_i.toggle(on_i);

"Multiple views" just means that you can display the same Data
object in multiple DisplayImpls, each with a different set of
ScalarMaps.  You can also display multiple Data objects in the
same DisplayImpl, as you would here to get multiple layers.

> Another question I have is about picking. Is VisAD just meant to visualize
> objects, or is it possible to interact with them, like picking an object
> and then perform a specific behavior?

For picking, you can replace the DefaultRendererJ3D with
PickManipulationRendererJ3D in the visad.bom package.  See
the main() method of PickManipulationRendererJ3D.java for
an example of how to use it.

There are other DataRenderers that you can use in place
of DefaultRendererJ3D that allow you to change the values
of Data objects by redrawing their depictions in Displays.
Examples include visad.java3d.DirectManipulationRendererJ3D,
visad.bom.CurveManipulationRendererJ3D, and a number of
others in the visad.bom package.  Note that the DataReferences
used with these "direct manipulation DataRenderers" are usually
linked to CellImpls, whose doAction() methods are triggered
when the user changes Data values by redrawing.  These CellImpls
can then do all sorts of things in response to the changes.
Look at the main() methods in the various DataREnderers to see
examples of how they are used.  Some of them are also used in
the visad/examples/TestNN.java classes.

> Do you think it is possible for me to mix a little bit and getting the
> nice things out of both (your Display-classes and my Layers for example?)

There is nothing you can't do with VisAD.  The trick is to
know how to get VisAD to do it.  That's why we have Ugo's
Tutorial, Dave's and Tom's Tutorials, the Developer's Guide,
lots of examples, and of course this mailing list.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


  • References:
  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: