Changeset 1884 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Jan 22, 2002, 4:56:12 PM (24 years ago)
Author:
cmv
Message:

correct pour le getclickinfo() cmv 22/01/02

Location:
trunk/SophyaPI/PIext
Files:
2 edited

Legend:

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

    r1883 r1884  
    351351
    352352//++
    353 void PIHisto2D::GetClickInfo(string& info, double x, double y)
     353void PIHisto2D::GetClickInfo(string& info,double x,double y,double x0,double y0,bool fgdiff)
    354354//
    355355//      Info specifique du drawer pour la position x,y
    356356//--
    357357{
    358   Histo2D* h = Histogram();
    359   if (h == NULL) return;
    360   int i,j;
    361   char str[128];
    362 
    363   h->FindBin(x,y,i,j);
    364   if(i<0 || i>=h->NBinX() || j<0 || j>=h->NBinY()) info += " ???";
    365   else {
    366     sprintf(str," v= %g",(*h)(i,j));
    367     info += str;
     358Histo2D* h = Histogram();
     359if(h == NULL) return;
     360
     361int i,j;
     362h->FindBin(x,y,i,j);
     363if(i>=0 && i<h->NBinX() && j>=0 && j<h->NBinY()) {
     364  char str[64];
     365  if(fgdiff) {
     366    int i0,j0;
     367    h->FindBin(x0,y0,i0,j0);
     368    if(i0>=0 && i0<h->NBinX() && j0>=0 && j0<h->NBinY()) {
     369      sprintf(str," DV=%g",(*h)(i,j)-(*h)(i0,j0));
     370      info += str;
     371    } else {
     372      info += " DV=?";
     373    }
    368374  }
    369   return;
     375  sprintf(str," V=%g",(*h)(i,j));
     376  info += str;
     377} else {
     378  info += " V=?";
     379}
     380
     381return;
    370382}
    371383
  • trunk/SophyaPI/PIext/pihisto2d.h

    r1883 r1884  
    3232  //   AppendTextInfo a faire un jour - Reza 21/01/2002
    3333  //  virtual void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
    34   virtual void GetClickInfo(string& info, double x, double y); // Info pour position X,Y
     34
     35  virtual void GetClickInfo(string& info, double x, double y
     36                           ,double x0=0.,double y0=0.,bool fgdiff=false);
    3537
    3638  virtual void UpdateLimits();
Note: See TracChangeset for help on using the changeset viewer.