Re: Object boundaries [message #40343 is a reply to message #40205] |
Mon, 02 August 2004 09:18  |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
> Graphics objects normally have XRANGE, YRANGE and ZRANGE properties that
> tell you the coordinates of the object's bounding rectangle.
> Unfortunately, for an IDLgrAxis this does not include the tick text and
> title, but you can get those separately. Consider the following code...
>
> oaxis = obj_new('idlgraxis')
> xobjview, oaxis
> oaxis->GetProperty, XRANGE=xr, YRANgE=yr, ZRANgE=zr
> print, xr, yr, zr
> ; 0.00000000 1.0000000
> ; 0.00000000 0.20000000
> ; 0.00000000 0.00000000
> oaxis->GetProperty, TICKTEXT=ott
> ott->GetProperty, XRANGE=xr_tt, YRANGE=yr_tt, ZRANGE=zr_tt
> print, xr_tt, yr_tt, zr_tt
> ; -0.047485654 1.0474857
> ; -0.081563380 -0.020111518
> ; 0.00000000 0.00000000
> ;; Ditto for the TITLE object, but you'll have to check if it is
> ;; valid first.
While this works, is there any way to remove the call to xobjview? When
I remove that call and try the code, I get back 0.0 for all of the tick
text ranges. Is this because IDL doesn't know where it is before it's
drawn? If so, can I just create a temporary IDLgrBuffer or something,
and draw to it and grab the numbers from that? If this is the solution,
that seems pretty ugly to have to create a random IDLgrBuffer in the
middle of my code, but that's the way RSI works, I suppose. ;-)
-Mike
|
|
|