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

Home » Public Forums » archive » Re: Object/Direct Graphics Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Object/Direct Graphics Question [message #29343] Wed, 13 February 2002 09:13
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
I am finding that it is often more convenient for me to use built in ROI
and zooming features of object graphics. Especially now that I base
virtually all of my 2D visualization needs on my Display routine, I find
it easy to add features I need to existing OG framework, and most of the
other needed features are in there already.
One thing that is an advantage to object driven (not necessarily OG
though) visualization is that visuals can be very easily saved and restored.
Same I am sure is true with David's MPI_PLOT, which is more of a GUI
driven program AFAIK, whilst Display is more of a command line-driven
replacement for PLOT.
As to what is better, DG or OG, I'd say try both and see what you like.
Ready to use OG 2D programs are available at
http://www.dfanning.com/documents/programs.html#MPI_PLOT
http://spot.colorado.edu/~romashki/idl/display.html
HTH,
Pavel

parrhasius wrote:
>
> I've gone back and read all the posts I could find on object graphics
> vs direct graphics and I still can't decide which one is better for
> what I'm trying to do. Does object graphics have any advantages at
> all for working in 2D? The general consensus, at least a year ago,
> seemed to be that it was best to use direct graphics for this kind of
> thing, but RSI's own XROI program is written using object graphics.
> Since it's a 2D drawing program, would it have been better/faster/more
> maintainable if it were written using direct graphics and object
> programming techniques, as David Fanning likes to suggest?
>
> The program I'm writing is not much more complex than XROI: I need to
> plot, manipulate and erase maybe 10 ~100-vertex polylines on top of
> ~640X400 images, but there is an order to the display of the
> polylines--some of them must always be drawn on top of others, etc,
> and when one is erased anything underneath it must be restored. So
> what's faster: a call to TV and then 10 100-vertex PlotS calls in
> direct graphics, or drawing an IDLgrImage and then drawing 10
> 100-vertex IDLgrPolylines in object graphics? More to the point,
> since drawing such a simple system is probably fast enough using both
> methods, which graphics option makes more sense given this problem?
> Thanks for any help.
Re: Object/Direct Graphics Question [message #29358 is a reply to message #29343] Wed, 13 February 2002 05:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
parrhasius (parrhasius@altavista.com) writes:

> I've gone back and read all the posts I could find on object graphics
> vs direct graphics and I still can't decide which one is better for
> what I'm trying to do. Does object graphics have any advantages at
> all for working in 2D? The general consensus, at least a year ago,
> seemed to be that it was best to use direct graphics for this kind of
> thing, but RSI's own XROI program is written using object graphics.
> Since it's a 2D drawing program, would it have been better/faster/more
> maintainable if it were written using direct graphics and object
> programming techniques, as David Fanning likes to suggest?

I think when object graphics were first introduced
it was more clear-cut which graphics system should
be used. If the project was 2D, stick to direct graphics.
If it was 3D, use object graphics.

That decision is MUCH harder today, partly because the
object graphics system has improved, computers have gotten
faster, graphics card seem to have a better handle on
OpenGL than they used to, etc. Today, I often have a
hard time deciding which graphics system to use, but
more and more I opt for object graphics. They are, at the
end of the day, awfully powerful.

(The only clear-cut decision is when the project requires contour plots
or map projections. Then direct graphics is still the only answer,
in my opinion. Although I have to admit, I sometimes take
advantage of the contouring infrastructure available in
the object graphics library for doing ROI-like things.
But labeled contour plots much be done in direct graphics
or not at all.)

> The program I'm writing is not much more complex than XROI: I need to
> plot, manipulate and erase maybe 10 ~100-vertex polylines on top of
> ~640X400 images, but there is an order to the display of the
> polylines--some of them must always be drawn on top of others, etc,
> and when one is erased anything underneath it must be restored. So
> what's faster: a call to TV and then 10 100-vertex PlotS calls in
> direct graphics, or drawing an IDLgrImage and then drawing 10
> 100-vertex IDLgrPolylines in object graphics? More to the point,
> since drawing such a simple system is probably fast enough using both
> methods, which graphics option makes more sense given this problem?

Since this is not the sort of thing I normally do, I wouldn't
know how to advice you. I expect speed would not be an issue
with this few number of polygons in either system. Because it
is often easier (I.e., takes far fewer lines of code) to write
in direct graphics, I'd probably explore writing a direct graphics
object in this case. It might be easier to handle the polygon
manipulations in object methods, for example. But I'm pretty
sure there is no "best" way to do this. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: latiude/ longitude legend outside the map
Next Topic: Re: Keyboard input from widgets

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

Current Time: Wed Oct 08 19:35:27 PDT 2025

Total time taken to generate the page: 0.00514 seconds