;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME: FILLCORNERMASK ; ; PURPOSE: pour colorier proprement les continents! (c''est une longue ; histoire...) ; ; CATEGORY: pour plt ; ; CALLING SEQUENCE: completecointerre ; ; INPUTS: non ; ; KEYWORD PARAMETERS: _EXTRA ; ; CONT_COLOR: the color of the continent. defaut value is ; (!d.n_colors - 1) < 255 => white ; ; OUTPUTS: non ; ; COMMON BLOCKS: common.pro ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; 8/8/2002 ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO fillcornermask, xin, yin, COINMONTE = coinmonte, COINDESCEND = coindescend $ , CONT_COLOR = cont_color, INDICEZOOM = indicezoom $ , _extra = ex ; compile_opt idl2, strictarrsubs ; @common ;------------------------------------------------------------ if NOT keyword_set(coinmonte) AND NOT keyword_set(coindescend) then return ; tempsun = systime(1) ; pour key_performance ; IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) < 255 ;------------------------------------------------------------ ; definition descoordonnees des points numerotes 1,2,3,4,5,6 cf. les ; schemas en dessous! ;------------------------------------------------------------ ; x1 = reform(xin) y1 = reform(yin) IF (size(x1))[0] EQ 2 THEN x1 = x1 [*, 0] IF (size(y1))[0] EQ 2 THEN y1 = y1 [0, *] x2 = .5*(x1+shift(x1, -1)) y2 = .5*(y1+shift(y1, -1)) nx = n_elements(x1) ny = n_elements(y1) ; ; ; ; cas coin terre en montee: ; 2 points terre en diagonale montante avec 2 points mer sur ; la diagonale descendante. ; ; 3 ; t(i+nx)=1 u(i+nx) t(i+nx+1)=0 ; | \ ; | \ ; 1 | \ 4 ; v(i)---------f(i)------------v(i+1) ; \ | ; \ | ; \ | ; t(i)=0 2 u(i) t(i+1)=1 ; ; if keyword_set(coinmonte) then BEGIN if coinmonte[0] NE -1 then BEGIN iup = coinmonte MOD nx jup = coinmonte/nx for id = 0, n_elements(coinmonte)-1 do BEGIN i = iup[id] j = jup[id] IF i NE nx-1 AND j NE ny-1 THEN BEGIN polyfill, [x1[i], x2[i], x2[i], x1[i+1], x1[i]] $ , [y2[j], y1[j], y1[j+1], y2[j], y2[j]] $ , color = cont_color, _extra = ex ENDIF endfor endif endif ;------------------------------------------------------------ ; cas coin terre en descendante.: ; 2 points terre en diagonale descendante avec 2 points mer sur ; la diagonale montante ; ; 4 ; t(i+nx)=1 u(i+nx) t(i+nx+1)=0 ; / | ; / | ; / 3 | 5 ; v(i)---------f(i)------------v(i+1) ; 1 | / ; | / ; | / ; t(i)=0 2 u(i) t(i+1)=1 ; if keyword_set(coindescend) then BEGIN if coindescend[0] NE -1 then begin idw = coindescend MOD nx jdw = coindescend/nx for id = 0, n_elements(coindescend)-1 do BEGIN i = idw[id] j = jdw[id] IF i NE nx-1 AND j NE ny-1 THEN BEGIN polyfill, [x1[i], x2[i], x2[i], x1[i+1], x1[i]] $ , [y2[j], y1[j+1], y1[j], y2[j], y2[j]] $ , color = cont_color, _extra = ex ENDIF endfor endif endif ;------------------------------------------------------------ IF keyword_set(key_performance) THEN print, 'temps fillcornermask', systime(1)-tempsun ;------------------------------------------------------------ return end