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

Home » Public Forums » archive » call_method
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: call_method [message #26569 is a reply to message #26480] Thu, 06 September 2001 21:31 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "David Fanning" <david@dfanning.com>
> P.S. Let's just say that if you wanted to enlighten us
> as to *why* you do this all the time, I would be all
> ears. :-)

Well, not all the time.

OK, to get specific, I have a general purpose graphics object called
MGHgrGraph, based on IDLgrView. MGHgrGraph has a method called NewAtom that
creates a graphics atom and attaches it to the graphics tree. Creating an
object graphics plot usually consists of creating an MGHgrGraph then calling
NewAtom several times. The function form of the NewAtom method returns a
reference to the atom; the procedure form doesn't. Most of the time I don't
need the reference, so I call the procedure form; sometimes I do need the
reference, so I call the function form. (The code is a bit more readable
when the procedure form is used, I think.)

The function definition contains all the code to implement NewAtom. The
procedure form is a wrapper that looks like this

pro MGHgrGraph::NewAtom, P1, P2, P3, P4, RESULT=result, _EXTRA=extra

compile_opt IDL2

case n_params() of
0: result = self->NewAtom( _EXTRA=extra )
1: result = self->NewAtom( P1, _EXTRA=extra )
2: result = self->NewAtom( P1, P2, _EXTRA=extra )
3: result = self->NewAtom( P1, P2, P3, _EXTRA=extra )
4: result = self->NewAtom( P1, P2, P3, P4, _EXTRA=extra )
endcase

end

The RESULT keyword is for when I change my mind & decide I *do* want the
object reference after all.

> It must have something to do with all those sheep. :-)

I don't farm sheep but do I farm olive trees. They have the advantage that
they don't move around so much, but on the other hand they aren't as warm &
cuddly.


---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research



--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: a newbie question on code efficiency
Next Topic: Re: object graphics to postcript and how to copy an object tree

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

Current Time: Sat Nov 29 14:41:05 PST 2025

Total time taken to generate the page: 2.15951 seconds