Changeset 1884 in Sophya


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pidrawer.cc

    r1879 r1884  
    534534
    535535void
    536 PIDrawer::GetClickInfo(string& info, double x, double y)
     536PIDrawer::GetClickInfo(string& info,double x,double y,double x0,double y0,bool fgdiff)
    537537{
    538538}
  • trunk/SophyaPI/PI/pidrawer.h

    r1879 r1884  
    4444
    4545// Renvoie une information liee au drawer pour une position x,y
    46   virtual void       GetClickInfo(string& info, double x, double y);
     46  virtual void       GetClickInfo(string& info,double x,double y
     47                                 ,double x0=0.,double y0=0.,bool fgdiff=false);
    4748
    4849  virtual void       Refresh();      // Recalcule les limites et reaffiche
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r1882 r1884  
    242242// Donne le texte a afficher pour position x,y 
    243243{
    244   char buff[128];
     244  char buff[64];
    245245  PIDrawer*  dr = GetActiveDrawer();
    246   strcpy(buff,"X= ");  sprintf(buff+3, mFormatOpt[0].c_str(), x);
    247   info += buff;
    248   strcpy(buff," Y= ");  sprintf(buff+4, mFormatOpt[1].c_str(), y);
    249   if (mFgDeltaPos)
    250     sprintf(buff+strlen(buff)," (dX=%g, dY=%g)",
    251             x-mPosForDelta[0], y-mPosForDelta[1]);
    252   info += buff;
     246
     247  info+="X=";  sprintf(buff,mFormatOpt[0].c_str(),x); info += buff;
     248  info+=" Y="; sprintf(buff,mFormatOpt[1].c_str(),y); info += buff;
     249  if(mFgDeltaPos) {
     250    sprintf(buff," (dX=%g, dY=%g)",x-mPosForDelta[0],y-mPosForDelta[1]);
     251    info += buff;
     252  }
    253253
    254254  if (dr) {
    255     info += "  "; info += dr->Name();
    256     dr->GetClickInfo(info, x, y);
     255    info += " ";  // info += dr->Name();
     256    dr->GetClickInfo(info,x,y,mPosForDelta[0],mPosForDelta[1],mFgDeltaPos);
    257257  }
    258258  return;
     
    362362  else SelPointerShape(PI_ArrowPointer);
    363363  if (mFgDeltaPos)  DrawDeltaPosMarker();
     364  if (mFgReticule || mFgDeltaPos) {
     365    mWGrC->SelForeground(cForCol);
     366    mWGrC->SelGOMode(cGOmod);
     367    mWGrC->SelLine(cLatt);
     368  }
    364369  if (mTrW)  mTrW->Hide();
    365370}
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r1882 r1884  
    6767                                            // concernant le petit pave autour de la pos. courante
    6868
    69   void               SetTextWin(PILabel * tw, bool trw=true, int tx=500, int ty=30);
     69  void               SetTextWin(PILabel * tw, bool trw=true, int tx=600, int ty=30);
    7070
    7171  virtual void       But1Press(int x, int y);
  • 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.