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

Home » Public Forums » archive » Object Oriented programming 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
Object Oriented programming question [message #15080] Thu, 22 April 1999 00:00 Go to next message
Jean-Francois Lavoie is currently offline  Jean-Francois Lavoie
Messages: 2
Registered: April 1999
Junior Member
Hi, I'm new to IDL and I'm looking forward using Object Oriented programming
under IDL. As far as I can see, IDL doesn't support internal method calling
inside a class, am I right ? I mean, within class A, suppose we have method
A::Init and then A::SetValue, how can (or is it simply possible) to call the
A::SetValue method from A::Init ? I didn't find any way to do this yet..
Can someone help ? Thanks,


Jean-Francois Lavoie

Trainee - Industrial Vision and 3D Sensors
INO - National Optics Institute
369 Franquet Street
Sainte-Foy, Quebec
CANADA G1P 4N8

Phone : (418) 657-7006
Fax : (418) 657-7009
Re: Object Oriented programming question [message #15155 is a reply to message #15080] Fri, 23 April 1999 00:00 Go to previous messageGo to next message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
In article <372074A1.3FD713D7@astro.estec.esa.nl>,
>
> Oh that's pretty simple (sorry I shouldn't say this ;-) - a good
> way to see how is the file lib/trackball__define.pro
>
> at definition of an object like trackball, the ::init method
> is called which may be defined in such a way that you can specify
> required and optional parameters - remember that you set the
> object using self.(whatever...)
>
> it is a very good (and probably the only) way to have all object
> related methods in one file like the above examples trackball_define.pro
> follow stricktly the order:
> a) first arbitrary methods specialized for this object only
> b) typical, more general methods (SetProperty, GetPro....
> c) the init method
> d) finally, the define method
>
> IDL does then the rest - if you need another example like
> creating a complete atom by a set of objects starting from
> simple spheres, mail me (only an example, not fully done)


There is no problem defining object methods each in their
own files. For larger objects with many methods, I prefer
to put each method in its own file, and let IDL's automatic
compilation do the rest. Objects can be defined in the file
"obj__define.pro", and methods in "obj__method1.pro",
"obj__method2.pro", etc.

The only thing to watch our for is under case-sensitive
operating systems, you must name your files in all lower case,
although within IDL you can use case. For example, I might
have the object method called "plotData", which would be placed
in the file "obj__plotdata.pro". But for the implementation,
I would typically write

PRO obj::plotData
.
.
.
END



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code ES 84
Work: http://www.batse.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Re: Object Oriented programming question [message #15163 is a reply to message #15080] Fri, 23 April 1999 00:00 Go to previous messageGo to next message
Michael Werger is currently offline  Michael Werger
Messages: 34
Registered: May 1997
Member
Jean-Francois Lavoie wrote:
>
> Hi, I'm new to IDL and I'm looking forward using Object Oriented programming
> under IDL. As far as I can see, IDL doesn't support internal method calling
> inside a class, am I right ? I mean, within class A, suppose we have method
> A::Init and then A::SetValue, how can (or is it simply possible) to call the
> A::SetValue method from A::Init ? I didn't find any way to do this yet..
> Can someone help ? Thanks,
>
> Jean-Francois Lavoie
>
> Trainee - Industrial Vision and 3D Sensors
> INO - National Optics Institute
> 369 Franquet Street
> Sainte-Foy, Quebec
> CANADA G1P 4N8
>

Oh that's pretty simple (sorry I shouldn't say this ;-) - a good
way to see how is the file lib/trackball__define.pro

at definition of an object like trackball, the ::init method
is called which may be defined in such a way that you can specify
required and optional parameters - remember that you set the
object using self.(whatever...)

it is a very good (and probably the only) way to have all object
related methods in one file like the above examples trackball_define.pro
follow stricktly the order:
a) first arbitrary methods specialized for this object only
b) typical, more general methods (SetProperty, GetPro....
c) the init method
d) finally, the define method

IDL does then the rest - if you need another example like
creating a complete atom by a set of objects starting from
simple spheres, mail me (only an example, not fully done)

Cheers,

--
Michael Werger ------------o
ESA ESTEC & Praesepe B.V. |
Astrophysics Division mwerger@astro.estec.esa.nl|
| Postbus 299 http://astro.estec.esa.nl |
| 2200 AG Noordwijk +31 71 565 3783 (Voice)
o------------------- The Netherlands +31 71 565 4690 (FAX)
Re: Object Oriented programming question [message #15212 is a reply to message #15080] Mon, 26 April 1999 00:00 Go to previous message
Jean-Francois Lavoie is currently offline  Jean-Francois Lavoie
Messages: 2
Registered: April 1999
Junior Member
Thanks to everybody, that helped a lot ! :) I am a C++ programmer and
programming with IDL is like not knowing where to go because the IDL
programmer has so much liberty.. I feel like programming in Basic. But it
is a very powerful language and saves a lot of time. Thanks again !

Jean-Francois
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: WIDGET_TABLE does not allow editing
Next Topic: Better Fitting routine

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

Current Time: Wed Oct 08 16:01:08 PDT 2025

Total time taken to generate the page: 0.00767 seconds