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

Home » Public Forums » archive » Re: IDL objects (not object graphics) tutorial?
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: IDL objects (not object graphics) tutorial? [message #46448] Wed, 23 November 2005 23:55 Go to previous message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
Richard G. French wrote:
> I'd like to learn how to make use of IDL objects. I'm not ready for object
> graphics yet, because I'd like to understand INITS and SELF and classes and
> methods before worrying about viewports and plots disappearing because I am
> not using the correct projection scheme. I've scoured the web in vain
> looking for a simple tutorial on how and when to use objects in IDL. I've
> found a few generic tutorials praising the virtues of object-oriented
> programming, but almost none of the examples give me any sense of why one
> would go to the trouble. For example, one tutorial describes an object that
> can return constants such as the speed of light or Planck's constant, but it
> isn't obvious to me why this is superior to a simple function that returns
> clight() or PlancksConst().
>

It can seems stupid but remeber the things can be done by multiple ways.
That is, all you can do with object can be done without it (but perhaps
is will be more difficult). All you can do with IDL, can be done with C
or Fortran, and can be done in assembler (o nooooo !!!).


Befere learn "object oriented programming", take a look at the basic
concepts related with the "object oriented", then you can understand how
this concepts are applied in IDL. I like to note that OO in IDL is a
bit... special. You can get examples in Java that is pretty clear and
understans the "self" (or this), calls to superclasses and so on.

The OO way isn't always the best way for all problems, but it is really
a more good aporach to some problems because the concepts of OO are more
closely (or not :) ) to the real things than a functional aproach.

The first problem in OO is: Can you model/represent that you want? If
you can model it with classes, association and generalizations and it
helps you, then it is the right way, else it isn't.

For example, you can understand an image as an ObjectImage. This is
composed by ObjectPixel that it composed by three/four ObjectByte.

ObjectImage (1) ----------> (*) ObjectPixel (1) ---------> (4) ObjectByte

Then you can program this classes to implement the methods needed to
work with images, but I think this is a very bad use of OO.

> What I am looking for is something with a simple application or two in which
> it is both clear why using objects is superior AND which explains what is
> meant by self and methods and classes. Without some specific examples to
> look at, I am having a hard time making sense of the nomenclature or of the
> value of the approach.
>

A basic, little or simple application in IDL (or any language) not needs
strictily the aproach to OOP. It depends on your needs. Well, here I
would define the terms "little" and "simple" but I think you understand me.

I can gibve you an example of OO aplication I am working on (with the
rest of my job companion :) ). We are developed an application that can
read some datas from radar, metheorological satelite, lightnings
information and some gis information. Every data is "tranformed" to a so
called class "frame", and every frame is placed in a "layer". Layers can
be visible/invisible, animated/stoped/freezed, ... and all the layers
are visualized together in the same style of photoshop :D (this sound
very good).

Here is a good example of using OOP, because the concepts: layer and
frame are easily represented and handled with object.


> This is prompted in part by David's nifty little pixmap object that I've
> already made use of in a new program - thanks, David.
>
> Someone must be out there just waiting to get rich writing a book on this
> topic. The second volume can be about object graphics - I'd settle for the
> first volume for now - a gentle introduction to objects in IDL. Any
> suggestions? Thanks!
>
> Dick French
>


--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: compound widget for directory selection (no pop_up)
Next Topic: Dynamically adding and removing widgets

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

Current Time: Fri Oct 10 13:15:08 PDT 2025

Total time taken to generate the page: 0.48139 seconds