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: resetting ranges of a plot space

Hi,

> Brandon Kohn wrote:
> 
> Hello,
> 
> I'm trying to write a zoom function for a 2D display that will allow
> the user to define a rectangle inside the plot area and then redraw to
> this scale.  The problem is that the points are drawn outside the plot
> box after rescaling.  I know that SelectRangeWidgets perform this
> bounding functionality, but I'm having trouble figuring out how it
> actually sets the new bounds, and I'd rather not have a hidden widget
> sitting in my jframe.  Any help?

You can try clipping the display. See visad example # 34.

run with
$VISADHOME/examples/java DisplayTest 34

clip with (see code for further details)

DisplayRendererJ2D dr = (DisplayRendererJ2D
)dpys[0].getDisplayRenderer();
dr.setClip(-1.0f, 1.0f, -1.0f, 1.0f);

Rememeber, the box spans from -1 to 1. Also bear in mind that, in 3D
this looks slightly different.

Cheers,
Ugo


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