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

Home » Public Forums » archive » object creation 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 creation question [message #11557] Mon, 20 April 1998 00:00
l-wicker is currently offline  l-wicker
Messages: 1
Registered: April 1998
Junior Member
I am trying to use objects to help develop a 2D plotting package for my
cloud model data. I have run into a conceptual snag, and think that I am
missing something obvious. Suppose I want to create an object which
stores, amoung other things, a 2d array of data (like for imaging or
contouring, etc). So I create the object using:

--
data2d = obj_new('scalar2d')
--

Then I define a structure definition as:

--
Pro scalar2d__define

struct = {scalar2d, sdata: fltarr(nx,ny)}

End
--

and then an init method:

--
Pro scalar2d::init

array = fltarr(20,30)

self.sdata = array

End
--

But, of course, this fails, because I have to declare the SIZE of sdata in
the procedure scalar2d__define. For various reason, I really dont want to
have to know the size of the array, at least until the init method. I can
pass the data in as part of the object creation, however, but I dont see
how that helps, since the define procedure does not seem to recognize any
arguments passed.

I am new to this object stuff, and perhaps I am missing some information
about named structure workings as well. I see that other object init
methods in the object graphics library have this type of function (i.e.,
IDLgrPlot creates an object which stores data passed in directly in the
call, and it can be of various dimensions), yet I cant seem to figure out
how to do this. Is there a trick, or am I missing something obvious?
Thanks for any help anybody can give.

Lou Wicker
Texas A&M University
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ***IDL Speed Survey (IDLSPEC) Results!!!
Next Topic: Too much

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

Current Time: Wed Oct 08 18:07:12 PDT 2025

Total time taken to generate the page: 0.00480 seconds