Changeset 2469 in Sophya for trunk/SophyaPI/PIext/pintuple.cc
- Timestamp:
- Dec 2, 2003, 8:36:10 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pintuple.cc
r2388 r2469 140 140 141 141 /* --Methode-- */ 142 #define NMXMULTP_LOCAL 30 // Pour multipoint sans new 142 143 void PINTuple::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax) 143 144 { 144 145 double xp,yp,xer,yer,wp; 145 146 double xl,yl; 146 int nok ;147 int nok,npolyg; 147 148 148 149 if (!mNT) return; … … 158 159 PIColorMap * cmap = NULL; 159 160 double dwc = 1.; 160 double nwc = 1.;161 int nwc = 1; 161 162 bool revcmap; 162 163 CMapId mcmapid = GetGraphicAtt().GetColMapId(revcmap); … … 165 166 cmap->ReverseColorIndex(revcmap); 166 167 nwc = cmap->NCol(); 167 dwc = (wMax-wMin)/ nwc;168 dwc = (wMax-wMin)/(double)nwc; 168 169 } 169 170 … … 187 188 nok = 0; 188 189 xp = yp = xl = yl = 0; 190 PIGrCoord xpolyg[NMXMULTP_LOCAL], ypolyg[NMXMULTP_LOCAL]; 191 npolyg = 0; 189 192 for (long i=0; i<(long)mNT->NbLines(); i++) { 190 xl = xp; yl = yp; 193 xl = xp; yl = yp; 191 194 xp = mNT->GetCell(i, xK); 192 195 yp = mNT->GetCell(i, yK); … … 213 216 } 214 217 215 if ( (i > 0) && connectPts ) 216 g->DrawLine(xl, yl, xp, yp); // On relie les points ... 218 // Trace d'une ligne reliant les points 219 if( connectPts ) { 220 if(npolyg==0) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;} 221 if(npolyg<NMXMULTP_LOCAL) 222 {xpolyg[npolyg]=xp; ypolyg[npolyg]=yp; npolyg++;} 223 if(npolyg==NMXMULTP_LOCAL) 224 {g->DrawPolygon(xpolyg,ypolyg,npolyg,false); npolyg=0;} 225 } 226 227 // Trace des erreurs selon X et Y 217 228 if ( xebK >= 0 ) { 218 229 xer = mNT->GetCell(i, xebK); … … 223 234 if(yer>0.) g->DrawLine(xp, yp-yer, xp, yp+yer); 224 235 } 236 225 237 // Trace du marker 226 238 if ((wK >= 0)||(lK < 0)||(mmrk != PI_NotDefMarker)) g->DrawMarker(xp, yp); 239 227 240 // Trace eventuel du label 228 241 if (lK >= 0) g->DrawString(xp, yp, mNT->GetCelltoString(i, lK).c_str()); 229 242 230 243 } 244 245 // Fin du trace d'une ligne reliant les points si necessaire 246 if( connectPts && npolyg>1 ) 247 {g->DrawPolygon(xpolyg,ypolyg,npolyg,false); npolyg=0;} 231 248 232 249 if (stats) { // Trace de stats … … 262 279 return; 263 280 } 281 #undef NMXMULTP_LOCAL 264 282 265 283 /* --Methode-- */
Note:
See TracChangeset
for help on using the changeset viewer.