Here's a strange object graphics quirk, I hope someone can explain. An IDLgrImage object can share its data with another IDLgrImage object. But what happens when you want to quit sharing, and unlink the two? Unless I missed something, it seems that you cannot.
Here's an example where we (1) define an image and draw it. (2) share with another image, and draw that. (3) attempt to unshare, set new data to the image, and draw it (it works). (4) modify the original share image, and observe that it is still linked to the first, with the ability to change it. After each 'stop' use '.c' or '.continue' to proceed to the next step.
How does one break the connection and un-share without destroying the second IDLgrImage?
Thanks!
EXAMPLE CODE
oWindow = IDLgrWindow(dimensions=[500,500])
oView = IDLgrView(EYE=1000, COLOR=[50,100,50], DIMENSIONS=[500,500], VIEWPLANE_RECT=[0,0,500,500])
oModel = IDLgrModel()
oView.Add, oModel
oImage = IDLgrImage(bindgen(16,16), LOCATION=[0,0], DIMENSION=[256,256], /GREYSCALE)
oModel.Add, oImage
oWindow.Draw, oView & print, 'A, here we see the bindgen ramp'
stop
oIshare = IDLgrImage(bytscl(randomn(seed,16,16)))
oImage.SetProperty, SHARE_DATA=oIshare ;--- see the shared image
oWindow.Draw, oView & print, 'B, now we see the shared randomness'
stop
oImage.SetProperty, SHARE_DATA=!null, DATA=bytscl(dist(16,16)) ;--- see the dist()
oWindow.Draw, oView & print, 'C, we replace the share with dist() data'
stop
oIshare.SetProperty, DATA=255b-bindgen(16,16)
oWindow.Draw, oView & print, 'D, change the oIshare and it STILL affects the oImage'
end
|