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

Home » Public Forums » archive » Draw IDLgrImage and IDLgrPlot in the correct order
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
Draw IDLgrImage and IDLgrPlot in the correct order [message #61652] Thu, 24 July 2008 14:41 Go to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Hi group,

I drew an IDLgrImage and an IDLgrPlot in this order. Always, when I
draw the Window, the Image is drawn on the plot. I dont know what to
do to draw the plot on the image and not viceversa.

Can anybody help me?

Thanks,

Bernat
Re: Draw IDLgrImage and IDLgrPlot in the correct order [message #61713 is a reply to message #61652] Fri, 25 July 2008 11:41 Go to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
:P
Re: Draw IDLgrImage and IDLgrPlot in the correct order [message #61714 is a reply to message #61652] Fri, 25 July 2008 11:33 Go to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Oh thank you so much !

With your example I found the problem. I added the image in the Model
after the plot. That was the problem.
Now I do that in the correct order and all is good..

Thank you !

Bernat
Re: Draw IDLgrImage and IDLgrPlot in the correct order [message #61716 is a reply to message #61652] Fri, 25 July 2008 11:29 Go to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jul 25, 1:53 pm, humanumbre...@gmail.com wrote:
> On Jul 25, 12:39 pm, bernat <bernat.puigdomen...@gmail.com> wrote:
>
>> Yes, sure !
>
> Unfortunately I would like to help, but I think I need a piece of code
> or something to work with.
>
> Do you have this ?
>
> It works for me by default, as long as I add them one after the other:
>
> oView = OBJ_NEW('IDLgrView',  $
>                     VIEWPLANE_RECT=[0,0,80, 100])
> oModel = OBJ_NEW('IDLgrModel')
> oView->Add, oModel
>
> head = READ_BINARY( FILEPATH('head.dat', $
>   SUBDIRECTORY=['examples','data']), $
>   DATA_DIMS=[80,100, 57])
>
> oModel->Add, OBJ_NEW('IDLgrImage', head[*,*,0], /INTERP)
> y = FIndGen(200)
> y = Sin(y/2) / Exp(y/1000)
> x = IndGen(N_Elements(y))
>
> plot = OBJ_NEW('IDLgrPlot',x,y,color=[255,255,255])
> oModel->Add,plot
> oWin = OBJ_NEW('IDLitWindow', DIMENSIONS=[300,300], $
> TITLE="Test")
> oWin->Add, oView

This might help too:


pro test3
szx = 1000L
szy = 650L
img = bytscl(dist(szx,szy))
N = 100L
x = randomu(seed,N) * szx
y = randomu(seed,N) * szy

w = obj_new('IDLgrWindow', dim = [szx,szy], retain = 0, render = 0)
v = obj_new('IDLgrView', view = [0,0,szx,szy])
m = obj_new('IDLgrModel')
im = obj_new('IDLgrImage', img)
pl = obj_new('IDLgrPolyline', x, y, color = [255,0,0] )
pg = obj_new('IDLgrPolygon',[0,szx,szx,0],[0,0,szy,szy],
[-0.1,-0.1,-0.1,-0.1], $
color=[255,255,255], $
TEXTURE_MAP=im, TEXTURE_COORD=[[0,0],[1,0],[1,1],[0,1]])
v -> add, m
m -> add, pg
m -> add, pl
t0 = systime(1)
widget_control, hourglass=1
for dx = 0, 700 do begin
pl -> SetProperty, xcoord = [dx,1]
w -> draw, v
endfor
widget_control, hourglass=0
print, 'Time = ', systime(1) - t0

end

Cheers,
--Justin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Draw IDLgrImage and IDLgrPlot in the correct order
Next Topic: plot problem

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

Current Time: Sat Oct 11 03:35:46 PDT 2025

Total time taken to generate the page: 0.88355 seconds