Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Displayed Data

Hi Kevin,

> If/when I zoom in on my displayed data, can I obtain the max and min
> values of the data that are being displayed.
>
> For example, let's sat that I have
>
> (latitude, longitude)->(altitude)
>
> projected in 2D with altitude is depicted as RGB.  If I zoom in
> (shift+left click), am I able to get the "ranges" of the visible domain
> values?  I.e.
>
> x1 < lat < y1
> x2 < lon < y2
>
> I thought that I could do this with the DataRenderer getRanges()
> method.  Would this be correct?  If so, is there a way to get the
> default DataRender from the DisplayImpl, or do I created one and add it
> to the Display?

I doubt you can rely on DataRenderer.getRanges() - it is
used for flow rendering and may not give reliable results
when you call it (e.g., when there is no flow rendering).

What you want to do is pretty complex. I'd call
MouseBehavior.findRay(int screen_x, int screen_y) (using
the MouseBehaviorJ3D of your Display) for the four corners
of your screen, intersect the rays with the plain where
your data lie (usually z = 0), then unmap the x and y
coordinates of the intersection through your spatial
ScalarMaps. That can give the lat and lon bounds. From
there you can find Field ranges.

Good luck,
Bill


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690