NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Rubber band zoom

Hi Marco,

> I am looking for way to implement a rubberband zoom function for a 2D
> display. Unfortunately I have not found a solution.
> Any suggestions ?

You can create a 2-D display in Java3D using:

  new DisplayImplJ3D("display", new TwoDDisplayRendererJ3D())

Then you can create a visad.bom.RubberBandBoxRendererJ3D
for a RealTuple in this display. See the main() method of
visad/bom/RubberBandBoxRendererJ3D.java for an example.
Note in the CellImpl of that example, you'd call something
like:

  xmap.setRange(samples[0][0], samples[0][1]);
  ymap.setRange(samples[1][0], samples[1][1]);

where xmap and ymap are your ScalarMaps to XAxis and YAxis.
This would rescale the display to the bounds selected by
the rubber band box.

Good luck,
Bill


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