Changeset 162 in Sophya


Ignore:
Timestamp:
Dec 8, 1998, 6:20:04 PM (27 years ago)
Author:
ercodmgr
Message:

Reorganisation de code (FuncDrawer) destructeur virtuel de PeidaInit Reza 8/12/98

Location:
trunk/SophyaPI/PI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/piinit.h

    r93 r162  
    1010  static int FgInit;
    1111public:
    12   PeidaInteractiveInitiator();
    13  ~PeidaInteractiveInitiator();
     12                PeidaInteractiveInitiator();
     13 virtual        ~PeidaInteractiveInitiator();
    1414};
    1515
  • trunk/SophyaPI/PI/pipodrw.cc

    r130 r162  
    66#include "generalfit.h"
    77
    8 //================================================================
    9 // PIFuncDrawer
    10 //================================================================
    11 
    12 PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f)
    13 : mFunc(f)
    14 {}
    15 
    16 PIFuncDrawer::~PIFuncDrawer()
    17 {
    18 }
    19 
    20 void
    21 PIFuncDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
    22 {
    23   PIGrCoord x1, x2, y1, y2;
    24   g->GetGrSpace(x1, x2, y1, y2);
    25   float xMax = x2;
    26   float xMin = x1;
    27   float yMax = y2;
    28   float yMin = y1;
    29   float xStep = (xMax - xMin)/100;
    30   float xOld = xMin;
    31   float yOld = mFunc(xMin);
    32   for (float x = xMin+xStep; x<xMax; x+=xStep) {
    33     double y = mFunc(x);
    34     if (y>yMin && yOld>yMin &&
    35         y<yMax && yOld<yMax)
    36            g->DrawLine(xOld, yOld, x, y);
    37     xOld = x;
    38     yOld = y;
    39   }
    40 }
    418
    429//================================================================
  • trunk/SophyaPI/PI/pipodrw.h

    r130 r162  
    1313#include "histos2.h"
    1414
    15 class PIFuncDrawer : public PIDrawer {
    16 public:
    17   typedef double(*FUNC)(double);
    18                      PIFuncDrawer(FUNC);
    19   virtual           ~PIFuncDrawer();
    20  
    21   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
    22 protected:
    23   FUNC               mFunc;
    24 };
    2515
    2616class GeneralFunction;
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r158 r162  
    343343  }
    344344}
     345
     346
     347//================================================================
     348// PIFuncDrawer
     349// Classe de traceur de fonction  double = f(fouble)
     350//================================================================
     351
     352/* --Methode-- */
     353PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f)
     354: mFunc(f)
     355{}
     356
     357/* --Methode-- */
     358PIFuncDrawer::~PIFuncDrawer()
     359{
     360}
     361
     362/* --Methode-- */
     363void
     364PIFuncDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
     365{
     366  PIGrCoord x1, x2, y1, y2;
     367  g->GetGrSpace(x1, x2, y1, y2);
     368  float xMax = x2;
     369  float xMin = x1;
     370  float yMax = y2;
     371  float yMin = y1;
     372  float xStep = (xMax - xMin)/100;
     373  float xOld = xMin;
     374  float yOld = mFunc(xMin);
     375  for (float x = xMin+xStep; x<xMax; x+=xStep) {
     376    double y = mFunc(x);
     377    if (y>yMin && yOld>yMin &&
     378        y<yMax && yOld<yMax)
     379           g->DrawLine(xOld, yOld, x, y);
     380    xOld = x;
     381    yOld = y;
     382  }
     383}
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r158 r162  
    108108};
    109109
     110// ----------------------------------------------------------
     111// Classe de traceur de fonction  double = f(fouble)
     112// ----------------------------------------------------------
     113
     114class PIFuncDrawer : public PIDrawer {
     115public:
     116  typedef double(*FUNC)(double);
     117                     PIFuncDrawer(FUNC);
     118  virtual           ~PIFuncDrawer();
     119 
     120  virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
     121protected:
     122  FUNC               mFunc;
     123};
     124
    110125#endif
Note: See TracChangeset for help on using the changeset viewer.