| Last change
 on this file since 3696 was             3572, checked in by cmv, 17 years ago | 
        
          | 
char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009
 | 
        
          | File size:
            1.3 KB | 
      
      
| Rev | Line |  | 
|---|
| [165] | 1 | //  Adaptateurs et Drawers divers pour Outils PEIDA++ | 
|---|
|  | 2 | //                             R. Ansari  06-08/98 | 
|---|
|  | 3 | // LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA | 
|---|
|  | 4 |  | 
|---|
| [2615] | 5 | #include "sopnamsp.h" | 
|---|
| [165] | 6 | #include "pipodrw.h" | 
|---|
|  | 7 | #include "generalfit.h" | 
|---|
|  | 8 |  | 
|---|
|  | 9 |  | 
|---|
|  | 10 | //================================================================ | 
|---|
|  | 11 | // PIGFFDrawer | 
|---|
|  | 12 | //================================================================ | 
|---|
|  | 13 |  | 
|---|
|  | 14 | PIGFFDrawer::PIGFFDrawer(GeneralFunction* f) | 
|---|
|  | 15 | : mFunc(f), mNParms(f->NPar()), mParms(new double[mNParms]) | 
|---|
|  | 16 | { | 
|---|
|  | 17 | ASSERT(f->NVar() == 1); | 
|---|
|  | 18 | } | 
|---|
|  | 19 |  | 
|---|
|  | 20 | PIGFFDrawer::~PIGFFDrawer() | 
|---|
|  | 21 | { | 
|---|
|  | 22 | delete[] mParms; | 
|---|
|  | 23 | } | 
|---|
|  | 24 |  | 
|---|
|  | 25 | void | 
|---|
|  | 26 | PIGFFDrawer::SetParms(double const* p) | 
|---|
|  | 27 | { | 
|---|
|  | 28 | for (int i=0; i<mNParms; i++) | 
|---|
|  | 29 | mParms[i] = p[i]; | 
|---|
|  | 30 | } | 
|---|
|  | 31 |  | 
|---|
|  | 32 |  | 
|---|
|  | 33 | void | 
|---|
| [205] | 34 | PIGFFDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double/*ymin*/, double/*xmax*/, double/*ymax*/) | 
|---|
| [165] | 35 | { | 
|---|
|  | 36 | PIGrCoord x1, x2, y1, y2; | 
|---|
|  | 37 | g->GetGrSpace(x1, x2, y1, y2); | 
|---|
| [205] | 38 | double xMax = x2; | 
|---|
|  | 39 | double xMin = x1; | 
|---|
|  | 40 | double yMax = y2; | 
|---|
|  | 41 | double yMin = y1; | 
|---|
|  | 42 | double xStep = (xMax - xMin)/100; | 
|---|
|  | 43 | double xOld = xMin; | 
|---|
|  | 44 | double yOld = 0; | 
|---|
|  | 45 | //  double yOld = f->Value(&xMin, mParms); | 
|---|
|  | 46 | for (double x = xMin+xStep; x<xMax; x+=xStep) { | 
|---|
|  | 47 | double y = 0; // $CHECK$ | 
|---|
|  | 48 | //    double y = f->Value(&x, mParms); | 
|---|
| [165] | 49 | if (y>yMin && yOld>yMin && | 
|---|
|  | 50 | y<yMax && yOld<yMax) | 
|---|
|  | 51 | g->DrawLine(xOld, yOld, x, y); | 
|---|
|  | 52 | xOld = x; | 
|---|
|  | 53 | yOld = y; | 
|---|
|  | 54 | } | 
|---|
|  | 55 | } | 
|---|
|  | 56 |  | 
|---|
| [584] | 57 |  | 
|---|
|  | 58 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.