Object graphics questions and comment [message #9709] |
Fri, 08 August 1997 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Hello,
I'm in the process of writing a viewer for atmospheric absorption
spectra - the data files of which often contain 1000's of spectra. I
decided to use IDL object graphics for a number of reasons:
- makes it easy to do zoom boxes
- makes it easy to do overplotting on resizeable window (sort of like
David Fannings XWINDOW but without the need for a wrapper)
- makes it easy to add annotation
- in the words of Mr. Fanning, makes me look like an "up-to-date and
with-it IDL programmer".
Anyway, I create a zoom box on a left button down event, add it to my
plot_model and draw the resulting view (info_ptr is a pointer to the
info structure ala D.F. and is stored in the user value of the top level
base) :
(*info_ptr).zbox = obj_new( 'IDLgrPolygon',
$
(*info_ptr).zbox_norm_xcoords, $
(*info_ptr).zbox_norm_ycoords, $
color = [ 0, 255, 0 ], style = 1 )
(*info_ptr).plot_model -> add, (*info_ptr).zbox
(*info_ptr).window -> draw, (*info_ptr).view
For motion events I do the following after updating the dynamic corner
of the zoombox:
old_zbox = (*info_ptr).zbox
(*info_ptr).plot_model -> remove, (*info_ptr).zbox
obj_destroy, old_zbox
(*info_ptr).zbox = obj_new( 'IDLgrPolygon', $
(*info_ptr).zbox_norm_xcoords, $
(*info_ptr).zbox_norm_ycoords, $
color = [ 0, 255, 0 ], style = 1 )
(*info_ptr).plot_model -> add, (*info_ptr).zbox
(*info_ptr).window -> draw, (*info_ptr).view
Now all this works great. I get a lovely zoom box except IT IS SOOOOO
SLOW? I test my code on a 1000 element data set and the zoom box can't
keep up with the mouse motion events. Increase the number of points and
it's unusable.
MY QUESTIONS: Is the snail pace response implicit of IDLs of object
graphics (another e.g. IDLs Insight. Good lord) or is there another way
to do this without having to do a
(*info_ptr).window -> draw, (*info_ptr).view
every time? In Direct Graphics you simply erase ONLY the box and then
redraw ONLY the new box, you don't redraw the entire view. Can this be
done using Object Graphics? The documentation is obtuse and unhelpful.
MY COMMENT: IMO, IDLs Object Graphics is necessary for easier
programming of user friendly data visualisation tools. However, the
speed of Object Graphics verges on being laughable (my perhaps poorly
programmed example above notwithstanding). It is a step backwards and
does not encourage the average IDL programmer (me) to utilise this
powerful tool. My (hopeful) assumption is that future incremental
releases of IDLv5 will contain Object Graphics that produce graphics as
fast or faster than Direct Graphics.
Phew!
I'm curious - who out there are actually using IDLs Object Graphics
capability?
regards,
Paul van Delst
Space Science and Engineering Center
University of Wisconsin-Madison
(608) 265-5357
|
|
|