Changeset 162 in Sophya
- Timestamp:
- Dec 8, 1998, 6:20:04 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piinit.h
r93 r162 10 10 static int FgInit; 11 11 public: 12 PeidaInteractiveInitiator();13 ~PeidaInteractiveInitiator();12 PeidaInteractiveInitiator(); 13 virtual ~PeidaInteractiveInitiator(); 14 14 }; 15 15 -
trunk/SophyaPI/PI/pipodrw.cc
r130 r162 6 6 #include "generalfit.h" 7 7 8 //================================================================9 // PIFuncDrawer10 //================================================================11 12 PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f)13 : mFunc(f)14 {}15 16 PIFuncDrawer::~PIFuncDrawer()17 {18 }19 20 void21 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 }41 8 42 9 //================================================================ -
trunk/SophyaPI/PI/pipodrw.h
r130 r162 13 13 #include "histos2.h" 14 14 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 };25 15 26 16 class GeneralFunction; -
trunk/SophyaPI/PI/piscdrawwdg.cc
r158 r162 343 343 } 344 344 } 345 346 347 //================================================================ 348 // PIFuncDrawer 349 // Classe de traceur de fonction double = f(fouble) 350 //================================================================ 351 352 /* --Methode-- */ 353 PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f) 354 : mFunc(f) 355 {} 356 357 /* --Methode-- */ 358 PIFuncDrawer::~PIFuncDrawer() 359 { 360 } 361 362 /* --Methode-- */ 363 void 364 PIFuncDrawer::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 108 108 }; 109 109 110 // ---------------------------------------------------------- 111 // Classe de traceur de fonction double = f(fouble) 112 // ---------------------------------------------------------- 113 114 class PIFuncDrawer : public PIDrawer { 115 public: 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); 121 protected: 122 FUNC mFunc; 123 }; 124 110 125 #endif
Note:
See TracChangeset
for help on using the changeset viewer.