Re: [visad] Display Range value on screen

Hi Ghansham & Devanshi,

> When I click on screen, I got Lat and Lon values printed, but I also
> want the range value
...
> I dont know if any example code is available in visad.examples.
> Can somebody throw some light on that?

I wrote code in VisBio that does this.

TransformLink.computeCursor:
https://github.com/uw-loci/visbio/blob/841de58a5c85ed7ae0d4c88572a43d4f9c621cb1/src/main/java/loci/visbio/view/TransformLink.java#L637-L687

TransformLink.doMessages:
https://github.com/uw-loci/visbio/blob/841de58a5c85ed7ae0d4c88572a43d4f9c621cb1/src/main/java/loci/visbio/view/TransformLink.java#L691-L739

DisplayUtil.redrawMessages:
https://github.com/uw-loci/visbio/blob/841de58a5c85ed7ae0d4c88572a43d4f9c621cb1/src/main/java/loci/visbio/util/DisplayUtil.java#L369-L402

StackLink.computeCursor (as an alternative to TransformLink):
https://github.com/uw-loci/visbio/blob/841de58a5c85ed7ae0d4c88572a43d4f9c621cb1/src/main/java/loci/visbio/view/StackLink.java#L753-L826

I hope this helps. Sorry I don't have time this week to explain the code in
detail but if you study it you should be able to adapt it to your needs.

Regards,
Curtis


On Sun, May 25, 2014 at 11:07 PM, ghansham <ghansham@xxxxxxxxxxxxxxx> wrote:

> Hi Devanshi,
>
> You can try setting the cursorStringVector on mouse move.
>
> display.getDisplayRenderer().setCursorStringVector(cursorString);
>
> It is not pretty straight forward.
>
> You may have to add displayListener to the display with
> MOUSE_PRESSED_CENTER event enabled on display.
>
> You may get the mouse screen coordinates then you may have transform them
> to display coordinates to Spatial  ScalarMap Coordinates.
> then you may have to use them to find the corresponding range value from
> the visad data object being displayed.
>
> It is a bit complex. I dont know if any example code is available in
> visad.examples. Can somebody throw some light on that?
>
>
> regards
> Ghansham
>
> On 05/24/2014 11:30 PM, visad-request@xxxxxxxxxxxxxxxx wrote:
>
>> Send visad mailing list submissions to
>>         visad@xxxxxxxxxxxxxxxx
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://mailman.unidata.ucar.edu/mailman/listinfo/visad
>> or, via email, send a message with subject or body 'help' to
>>         visad-request@xxxxxxxxxxxxxxxx
>>
>> You can reach the person managing the list at
>>         visad-owner@xxxxxxxxxxxxxxxx
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of visad digest..."
>>
>>
>> Today's Topics:
>>
>>     1. Display Range value on screen (Devanshi Prajapati)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Sat, 24 May 2014 10:21:47 +0530
>> From: Devanshi Prajapati<prajapati.devanshi@xxxxxxxxx>
>> To: "visad@xxxxxxxxxxxxxxxx"<visad@xxxxxxxxxxxxxxxx>
>> Subject: [visad] Display Range value on screen
>> Message-ID:
>>         <CAH3DJ6LeYs49AXYFqCVFd6YEDRMhtYueKVBi5-mmF1VrSdfZzA@mail.
>> gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>>
>> Hello all,
>>
>> My file structure is like: ( Lat , Lon ) -->  Temp.
>> And I map Temp. value to Display.RGB
>> I get a 2D image on screen.
>>
>> When I click on screen, I got Lat and Lon values printed, but I also want
>> the range value, that is "Temp." to be displayed on screen on a mouse
>> click.
>> The image must be in 2D only.
>>
>>
>>
>>
> _______________________________________________
> visad mailing list
> visad@xxxxxxxxxxxxxxxx
> For list information, to unsubscribe, visit: http://www.unidata.ucar.edu/
> mailing_lists/