Re: Object boundaries [message #40206 is a reply to message #40205] |
Tue, 27 July 2004 15:41   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Michael Wallace wrote:
> Is it possible to determine the boundaries of an object in an object
> graphics view? For example, say that I wanted the coordinates of an
> IDLgrAxis with it's annotations included. I'd like to get the
> coordinates which describe the bounding box of the axis and everything
> else associated with it (title, tick labels, tick marks, etc).
>
There are a couple of ways.
You can use my bounding box object available here:
http://www.acoustics.washington.edu/~towler/RHTgrAABBRef.htm l
It is a child of IDLgrModel which can return the bounds of all of the
objects contained within it in position/extents form:
IDL> orb=obj_new('orb', radius=3.5, pos=[5,10,12])
% Compiled module: ORB__DEFINE.
IDL> bbox=obj_new('RHTgrAABB')
% Compiled module: RHTGRAABB__DEFINE.
IDL> bbox->add, orb
% Loaded DLM: RHTGRAABB.
IDL> bbox->getaabb, position=p, extents=e
IDL> print, p
5.00000 10.0000 12.0000
IDL> print, e
3.49021 3.49021 3.50000
It does require a DLM which I have compiled for Solaris and Windows.
Or you could use the RSI supplied get_obj_range.pro which might be a
better fit since it seems to deal with text in a special way. Don't
know for sure since I haven't played with it. You can find it in
$IDL_DIR/lib/utilities
-Rick
> I have some other annotations in this view, and I want to make sure that
> there is sufficient spacing between these annotations and the
> annotations automatically created for the axis. I am currently
> positioning the other annotations at exact locations and most of the
> time they're fine, but if my axis gets some long tick labels which
> causes the axis title to get pushed out, the title can collide with the
> other annotations. I'm just searching for a way to position my other
> stuff relative to boundary of the axis annotation to ensure that there
> won't be any overlap. Ideas?
>
> -Mike
|
|
|