Changeset 205 in Sophya for trunk/SophyaPI/PIext/pihisto2d.cc
- Timestamp:
- Mar 1, 1999, 6:05:59 PM (27 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto2d.cc
r165 r205 157 157 158 158 //++ 159 void PIHisto2D::Draw(PIGraphicUC* g, float,float, float, float)159 void PIHisto2D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax) 160 160 // 161 161 // Dessin de l'histogramme. … … 164 164 if(!mHisto) return; 165 165 // Caracteristiques histogramme 166 floatdx = mHisto->WBinX(),dy = mHisto->WBinY();167 floatp1dx,p1dy;166 double dx = mHisto->WBinX(),dy = mHisto->WBinY(); 167 double p1dx,p1dy; 168 168 g->DGrC2UC(1.f,1.f,p1dx,p1dy); 169 169 … … 197 197 int FontSize = g->GetFontSize(); 198 198 if(mTypDisp==2) { 199 floatdxg,dyg,dg;199 double dxg,dyg,dg; 200 200 g->DUC2GrC(dx,dy,dxg,dyg); 201 201 dg =(dxg<dyg) ? dxg : dyg; … … 235 235 } 236 236 237 // Pour ne pas dessiner en dehors des axes 238 if ( (left0+dx/2. < xmin) || (left0+dx/2. > xmax) || 239 (bottom0+dy/2. < ymin) || (bottom0+dy/2. > ymax) ) continue; 240 237 241 // Dessin proprement dit selon le choix graphique. 238 242 if(mTypDisp==0) { 239 243 //..... carres de tailles variables 240 floatleft = left0 + 0.5*(1.-fracred)*dx, width = fracred*dx;241 floatbottom = bottom0 + 0.5*(1.-fracred)*dy, height = fracred*dy;244 double left = left0 + 0.5*(1.-fracred)*dx, width = fracred*dx; 245 double bottom = bottom0 + 0.5*(1.-fracred)*dy, height = fracred*dy; 242 246 if (cmap) g->DrawFBox(left,bottom,width,height); 243 247 else g->DrawBox(left,bottom,width,height); … … 246 250 int ipt = int( (float) npt *frac ); 247 251 for(int k=0;k<ipt;k++) { 248 floatx = left0 + frand01()*dx;249 floaty = bottom0 + frand01()*dy;252 double x = left0 + frand01()*dx; 253 double y = bottom0 + frand01()*dy; 250 254 g->DrawMarker(x,y); 251 255 } … … 254 258 char c[2]; 255 259 c[0] = HPrint2(frac); c[1]='\0'; 256 floatx = left0 + dx/2.;257 floaty = bottom0 + dy/2.;260 double x = left0 + dx/2.; 261 double y = bottom0 + dy/2.; 258 262 g->DrawString(x,y,c); 259 263 } else if(mTypDisp==3) { … … 283 287 // Une boite dans le coin superieur droit 284 288 if (mLAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine); 285 floatcellHeight = (YMax() - YMin()) * 0.05;286 floatcellWidth = (XMax() - XMin()) * 0.23;289 double cellHeight = (YMax() - YMin()) * 0.05; 290 double cellWidth = (XMax() - XMin()) * 0.23; 287 291 g->DrawLine(XMax() - cellWidth, YMax(), 288 292 XMax() - cellWidth, YMax() - cellHeight); … … 331 335 //-- 332 336 { 333 floatdx = mHisto->WBinX(),dy = mHisto->WBinY();334 floatdxg,dyg;337 double dx = mHisto->WBinX(),dy = mHisto->WBinY(); 338 double dxg,dyg; 335 339 g->DUC2GrC(dx,dy,dxg,dyg); 336 340 int np = (int) dxg * (int) dyg; … … 413 417 414 418 //++ 415 string PIH2DWdg::GetClickText( float x, floaty)419 string PIH2DWdg::GetClickText(double x, double y) 416 420 // 417 421 // Quand on click (and drag) le bouton-1, affichage
Note:
See TracChangeset
for help on using the changeset viewer.