Changeset 205 in Sophya for trunk/SophyaPI/PIext/pihisto2d.cc


Ignore:
Timestamp:
Mar 1, 1999, 6:05:59 PM (27 years ago)
Author:
ercodmgr
Message:

1/ Adaptation pour passage en double de trace en coordonnees graphiques
User (UC) (float -> double)
2/ Adaptation pour passage en double pour les ArrayAdapter

Reza 1/03/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r165 r205  
    157157
    158158//++
    159 void PIHisto2D::Draw(PIGraphicUC* g,float,float, float, float)
     159void PIHisto2D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    160160//
    161161//      Dessin de l'histogramme.
     
    164164if(!mHisto) return;
    165165// Caracteristiques histogramme
    166 float dx = mHisto->WBinX(),dy = mHisto->WBinY();
    167 float p1dx,p1dy;
     166double dx = mHisto->WBinX(),dy = mHisto->WBinY();
     167double p1dx,p1dy;
    168168g->DGrC2UC(1.f,1.f,p1dx,p1dy);
    169169
     
    197197int FontSize = g->GetFontSize();
    198198if(mTypDisp==2) {
    199   float dxg,dyg,dg;
     199  double dxg,dyg,dg;
    200200  g->DUC2GrC(dx,dy,dxg,dyg);
    201201  dg =(dxg<dyg) ? dxg : dyg;
     
    235235  }
    236236
     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
    237241  // Dessin proprement dit selon le choix graphique.
    238242  if(mTypDisp==0) {
    239243    //..... carres de tailles variables
    240     float left   = left0   + 0.5*(1.-fracred)*dx, width  = fracred*dx;
    241     float bottom = 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;
    242246    if (cmap) g->DrawFBox(left,bottom,width,height);
    243247    else      g->DrawBox(left,bottom,width,height);
     
    246250    int ipt  = int( (float) npt *frac );
    247251    for(int k=0;k<ipt;k++) {
    248       float x = left0 + frand01()*dx;
    249       float y = bottom0 + frand01()*dy;
     252      double x = left0 + frand01()*dx;
     253      double y = bottom0 + frand01()*dy;
    250254      g->DrawMarker(x,y);
    251255    }
     
    254258    char c[2];
    255259    c[0] = HPrint2(frac); c[1]='\0';
    256     float x = left0 + dx/2.;
    257     float y = bottom0 + dy/2.;
     260    double x = left0 + dx/2.;
     261    double y = bottom0 + dy/2.;
    258262    g->DrawString(x,y,c);
    259263  } else if(mTypDisp==3) {
     
    283287  // Une boite dans le coin superieur droit
    284288  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    285   float cellHeight = (YMax() - YMin()) * 0.05;
    286   float cellWidth  = (XMax() - XMin()) * 0.23;
     289  double cellHeight = (YMax() - YMin()) * 0.05;
     290  double cellWidth  = (XMax() - XMin()) * 0.23;
    287291  g->DrawLine(XMax() - cellWidth, YMax(),
    288292                       XMax() - cellWidth, YMax() - cellHeight);
     
    331335//--
    332336{
    333 float dx = mHisto->WBinX(),dy = mHisto->WBinY();
    334 float dxg,dyg;
     337double dx = mHisto->WBinX(),dy = mHisto->WBinY();
     338double dxg,dyg;
    335339g->DUC2GrC(dx,dy,dxg,dyg);
    336340int np = (int) dxg * (int) dyg;
     
    413417
    414418//++
    415 string  PIH2DWdg::GetClickText(float x, float y)
     419string  PIH2DWdg::GetClickText(double x, double y)
    416420//
    417421//      Quand on click (and drag) le bouton-1, affichage
Note: See TracChangeset for help on using the changeset viewer.