comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Rubberband box for object graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Rubberband box for object graphics [message #42541 is a reply to message #42539] Fri, 11 February 2005 06:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
"Rainnie, JA \(John\)" <J.A.Rainnie@rl.ac.uk> writes:

> I'm delving into the IDL graphics objects, and specifically I wish to
> develop a plot window using the IDLgrPlot class. Thanks to several
> examples (mostly Dave Fanning's xPlot) I've mananged to do this.
> However, I really need to implement a rubberband box so the user can
> interactively zoom into this plot (like DF's zPlot). The conversion from
> device to data coordinates is of course done in direct graphics with the
> Convert_Coord function. However, I can't find any examples of how this
> is done for object graphics.
>
> Has anyone done this - and are there any examples you can direct me to.

I've never done this, but my little program SCALE_VECTOR
has solved an awful lot of problems like this for me, and
I think that is where I would start. You will know the
endpoints of your box (in the X direction), and you will
know the X extent of your View in the draw widget, so
the conversion would look something like this:

dataCoords = Scale_Vector([boxPt[0], boxPt[1]], view_x[0], veiw_x[1])

Scale_Vector is found is the usual place. :-)

Cheers,

David

P.S. After writing the code for Scale_Vector (I had a flash
of insight after working on an object graphics project) I
promptly forgot how it is that it works. But it does work, spectacularly
well. So I think whatever the algorithm is in there, that is what you
want to employ in any object graphics coordinate conversion
routine.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: how to create IDL batch job in window?
Next Topic: Draw Widget Type Field

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 22:19:18 PDT 2025

Total time taken to generate the page: 0.79981 seconds