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

Home » Public Forums » archive » IDL_Object example // help with
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL_Object example // help with [message #87876] Sat, 01 March 2014 13:29 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Hi, all,

In an effort to learn more about the IDL_Object class, I created an array object that I want to behave exactly like a normal array by using the _Overload* methods. Everything is working out fine, except for the _OverloadBracketsLeftSide. I have no idea how to do it.

Here is the class
https://dl.dropboxusercontent.com/u/42944960/mrarray__define .pro

With a normal array, I can do something like this

IDL> array = fltarr(2,4,4)
IDL> array[0, 1:2, [0,2,3]] = randomu(1, 1, 2, 3)

or even

IDL> array = fltarr(2,4,4)
IDL> array[0, 1:2, [0,2,3]] = randomu(1, 6)

Does anyone know how to do this with the _OverloadBracketsLeftSide method? I thought I saw a clever recursive approach by Mike Galloy in one of his classes, but I cannot seem to find it again.



Examples using MrArray__Define (suggestions welcome)::

myArray = obj_new('MrArray', findgen(3,10))
help, myArray
print, myArray
print, myArray - 6
help, myArray[1:2, 4:7] ;_OverloadBracketsRightSide was easy (but perhaps ugly)
print, myArray * myArray
array -> SetType, 'BYTE'
print, myArray AND 5
print, ~myArray
myArray.array = randomu(5, 5, 5)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: More info on Slither
Next Topic: Problem with long integer color when saving a cgwindow to file

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

Current Time: Wed Oct 08 13:38:40 PDT 2025

Total time taken to generate the page: 0.00466 seconds