Changeset 2755 in Sophya for trunk/SophyaPI/PIext/pintuple.cc
- Timestamp:
- May 23, 2005, 6:33:02 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pintuple.cc
r2690 r2755 198 198 npolyg = 0; 199 199 NptDraw = 0; 200 201 // Mai 2005: Correction bug trace des lignes avec le pts en dehors de la zone (Reza) 202 // flags pour la gestion des points/lignes a tracer 203 bool fgokcurpt = true; // Point courant dans la zone a tracer 204 bool fgoklastpt = true; // Le dernier point etait dans la zone a tracer 200 205 for (long i=0; i<(long)mNT->NbLines(); i++) { 201 xl = xp; yl = yp; 206 xl = xp; yl = yp; fgoklastpt = fgokcurpt; 207 202 208 xp = mNT->GetCell(i, xK); 203 209 yp = mNT->GetCell(i, yK); 204 if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) ) continue; 205 nok++; 206 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) continue; 207 208 NptDraw++; 210 211 // Comptage du nombre de pts dans la zone graphique du widget 212 if ( !((xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2)) ) nok++; 213 // Gestion des limites a tracer 214 fgokcurpt = true; 215 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) fgokcurpt = false; 216 else NptDraw++; 217 209 218 // Taille - couleur de marker en fonction du poids 210 if ( wK >= 0) wp = mNT->GetCell(i, wK);211 if ( mrkSzScale && (wK >= 0)) { // Changement de taille219 if ( fgokcurpt &&(wK >= 0) ) wp = mNT->GetCell(i, wK); 220 if ( fgokcurpt && mrkSzScale && (wK >= 0) ) { // Changement de taille 212 221 sz = (int)((wp-wMin)/dw); 213 222 if (sz < 0) sz = 0; … … 218 227 } 219 228 // Couleur du marker en fonction du poids 220 if( colorScale && (wK >= 0) && cmap ) {229 if( fgokcurpt && colorScale && (wK >= 0) && cmap ) { 221 230 int cid = (int)((wp-wMin)/dwc); 222 231 if (cid < 0) cid = 0; … … 227 236 // Trace d'une ligne reliant les points 228 237 if( connectPts ) { 229 if((npolyg==0) && (i>0)) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;} 230 if(npolyg<NMXMULTP_LOCAL) 238 // On initialise le polygone avec le dernier point, si ce dernier ok 239 if((npolyg==0) && (i>0) && fgokcurpt) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;} 240 // On ajoute le point courant au polygone - sauf si celui-ci est vide 241 if((npolyg<NMXMULTP_LOCAL) && (npolyg>0)) 231 242 {xpolyg[npolyg]=xp; ypolyg[npolyg]=yp; npolyg++;} 232 if(npolyg==NMXMULTP_LOCAL) 243 // On trace le polygone s'il est plein - ou le point courant en dehors 244 // (point courant en dehors -> discontinuite de la ligne 245 if( !fgokcurpt || (npolyg==NMXMULTP_LOCAL) ) 233 246 {g->DrawPolygon(xpolyg,ypolyg,npolyg,false); npolyg=0;} 234 247 } 235 248 249 // Plus rien a faire si point en dehors -- on s'en va 250 if (!fgokcurpt) continue; 251 236 252 // Trace des erreurs selon X et Y 237 if ( xebK >= 0) {253 if (xebK >= 0) { 238 254 xer = mNT->GetCell(i, xebK); 239 255 if(xer>0.) g->DrawLine(xp-xer, yp, xp+xer, yp); 240 256 } 241 if ( yebK >= 0) {257 if (yebK >= 0) { 242 258 yer = mNT->GetCell(i, yebK); 243 259 if(yer>0.) g->DrawLine(xp, yp-yer, xp, yp+yer);
Note:
See TracChangeset
for help on using the changeset viewer.