[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
IDLgrPolyline
- Subject: IDLgrPolyline
- From: majewski(at)cygnus.uwa.edu.au (Leon Majewski)
- Date: Tue, 25 Jul 2000 16:20:38 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: RSSRG
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:20408
Hi,
I'm rather new to object graphics (a whole 5 days now) and was
wondering whether or not i was doing the sensible thing here.
Aas part of my honours project I'm detecting surface currents from
sequential satellite imagery....
I'm trying to create a field of displacement vectors, with arrows
pointing from the origin (i,i) to the destination (i+delx, j+dely). I
figured that a (whole lot of) polyline with an invisible character at
the start and a visible character at the end would suffice for arrows
- and this seems to be true (& easy).
However I wonder if how I am adding each polyline to the model (view,
window) is the best approach (see code segment below). When I have a
large number of polylines to be added it takes a (rather) long time.
A code segment follows, however, documentation and a working program &
data are available (if you are so keen to help [or just interested])
at http://cygnus.uwa.edu.au/~majewski/MCC.html
thanks
leon
-----------------------------------
# Data_set is an array of floats [*,*,3] usually [50,50,3] however I
want to move towards [200,200,3] or more.
#data_set[*,*,0] = x displacement
#data_set[*,*,1] = y displacement
#data_set[*,*,2] = cross correlation coefficient
for j = 0, maxj do begin
for i = 0, maxi, step do begin
if (Data_set[i,j,2]) ge 0.3 then begin
delx = Data_set[i,j,0]
dely = Data_set[i,j,1]
corr = Data_set[i,j,2]
; Make an array of symbols: #1 invisible, #2 color of line
Symbols=[OBJ_NEW('IDLgrSymbol', data=0),OBJ_NEW('IDLgrSymbol',
SIZE=0.125, data=5, COLOR=[250*corr,0,0])]
; Make a line between origin and origin+displacement
MyPolyLine = OBJ_NEW('IDLgrPolyline', [[i,j], [i+delx,j+dely],
[i,j]], COLOR=[250*corr,0,0], SYMBOL=symbols)
OModel -> ADD, MyPolyLine
endif
endfor
endfor
oXAxis = OBJ_NEW('IDLgrAxis',0,range=[-3,max_side+3])
OModel->Add, oXAxis
oYAxis = OBJ_NEW('IDLgrAxis',1,range=[-3,max_side+3])
OModel->Add, oYAxis
OView -> ADD, oModel
OWindow -> DRAW, oView
-------------------------
Leon Majewski
Remote Sensing & Satellite Research Group
Curtin University of Technology, Perth, Australia
email: majewski@ses.curtin.edu.au