Changeset 226 for trunk/SRC/ToBeReviewed/TRIANGULATION/ciseauxtri.pro
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/TRIANGULATION/ciseauxtri.pro
r192 r226 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; @file_comments 5 ; @file_comments 6 6 ; Delete arrays which do not have to be drawn thanks to 2 tests: 7 7 ; 1) Corners of the array must be in the window 8 ; 2) Lengthes of side of triangles expressed in normalized 9 ; coordinates must not surpass a sill length. 8 ; 2) Lengthes of side of triangles expressed in normalized 9 ; coordinates must not surpass a sill length. 10 10 ; 11 11 ; @categories 12 12 ; 13 13 ; @param TRIANG 14 ; 15 ; @param GLAM 16 ; 17 ; @param GPHI 18 ; 14 ; 15 ; @param GLAM 16 ; 17 ; @param GPHI 18 ; 19 19 ; @keyword _EXTRA 20 20 ; Used to pass your keywords. … … 29 29 ; @version 30 30 ; $Id$ 31 ; 31 ; 32 32 ;- 33 33 ;------------------------------------------------------------ … … 56 56 57 57 tempdeux = systime(1) ; For key_performance =2 58 z = convert_coord(glam[*],gphi[*],/data,/to_normal) 58 z = convert_coord(glam[*],gphi[*],/data,/to_normal) 59 59 x = z[0, *] 60 60 y = z[1, *] … … 63 63 print, 'temps ciseauxtri: convert_coord data to_normal', systime(1)-tempdeux 64 64 ; 65 ; Beware, following the projection, some points x or y can become NaN 66 ; (see points behind the Earth in an orthographic projection). 65 ; Beware, following the projection, some points x or y can become NaN 66 ; (see points behind the Earth in an orthographic projection). 67 67 ; In this case, we have to remove all triangle which contain one of these points. 68 68 ; … … 99 99 testy = abs(temporary(ytri)) GT ((!p.position[3]-!p.position[1])/seuil) 100 100 testy = total(temporary(testy), 1) 101 ; 101 ; 102 102 test = temporary(testx)+temporary(testy) 103 ind=where(temporary(test) EQ 0) 103 ind=where(temporary(test) EQ 0) 104 104 ; 105 105 IF testvar(var = key_performance) EQ 2 THEN $ … … 146 146 if keyword_set(trichanged) then BEGIN 147 147 ; 148 ; We have to check that triangles we keep do not form a triangulation 149 ; in which 2 triangles have a common summit without have a common side. 150 ; 151 ; We constitute the list of rectangles we want to keep (we keep every 148 ; We have to check that triangles we keep do not form a triangulation 149 ; in which 2 triangles have a common summit without have a common side. 150 ; 151 ; We constitute the list of rectangles we want to keep (we keep every 152 152 ; rectangle containing a triangle) 153 153 ; … … 155 155 ; last summit are those of the diagonale of the rectangle defined by 156 156 ; the mesh size. To find from which rectangle a triangle comes, we look 157 ; for the min of the index fol owing x and following y of each triangle.157 ; for the min of the index following x and following y of each triangle. 158 158 ; Then we go by again this indexion following x and y in an indexion 159 159 ; following nx*ny/ … … 166 166 indxtriang2 = triang[2, *]-nx*(triang[2, *]/nx) 167 167 indxmin = indxtriang0 < indxtriang2 168 ; Beware in the case where the grid is periodic and where we have all points 169 ; following x, triangles which assure the periodicity in x have indexes 170 ; following x which are 0 and nx-1. They belong to rectangles of the column 168 ; Beware in the case where the grid is periodic and where we have all points 169 ; following x, triangles which assure the periodicity in x have indexes 170 ; following x which are 0 and nx-1. They belong to rectangles of the column 171 171 ; nx-1 and not to column 0. 172 172 if keyword_set(key_periodic) AND nx EQ jpi then BEGIN 173 173 indxmax = indxtriang0 > indxtriang2 174 174 indxtriang = indxmin + (nx-1)*(indxmin EQ 0 AND indxmax EQ (nx-1)) 175 ENDIF ELSE indxtriang = indxmin 175 ENDIF ELSE indxtriang = indxmin 176 176 listrect = nx*indytriang+indxtriang 177 177 IF testvar(var = key_performance) EQ 2 THEN $ 178 178 print, 'temps ciseauxtri: liste des rectangles', systime(1)-tempdeux 179 179 ; 180 ; Now we have this list, we will make sure that we do not have triangles 180 ; Now we have this list, we will make sure that we do not have triangles 181 181 ; with only a common summit. 182 182 ; … … 195 195 *shift(test, 0, -1)*shift(test, -1, 0)) EQ 1) 196 196 ; We delete the top rectangle (same x index but equal to 1) 197 if vire2[0] NE -1 THEN test[vire2+nx] = 0 197 if vire2[0] NE -1 THEN test[vire2+nx] = 0 198 198 ENDWHILE 199 199 ;stop … … 202 202 avirer = where(temporary(test) EQ 0) 203 203 IF testvar(var = key_performance) EQ 2 THEN $ 204 print, 'temps ciseauxtri: determination des rectangles a virer', systime(1)-tempdeux204 print, 'temps ciseauxtri: determination des rectangles a virer', systime(1)-tempdeux 205 205 ; 206 206 if avirer[0] NE -1 then begin … … 208 208 indnx = n_elements(listrect) 209 209 indny = n_elements(avirer) 210 ind = listrect[*]#replicate(1l, indny) 210 ind = listrect[*]#replicate(1l, indny) 211 211 ind = ind EQ replicate(1, indnx)#avirer[*] 212 212 if indny GT 1 then ind = total(ind, 2) … … 217 217 print, 'temps ciseauxtri: derniere retouche de la triangulation', systime(1)-tempdeux 218 218 endif 219 ; 220 ; 221 if keyword_set(key_performance) THEN print, 'temps ciseauxtri', systime(1)-tempsun 219 ; 220 ; 221 if keyword_set(key_performance) THEN print, 'temps ciseauxtri', systime(1)-tempsun 222 222 ; 223 223 return, triang
Note: See TracChangeset
for help on using the changeset viewer.