| [1829] | 1 | // This may look like C code, but it is really -*- C++ -*- | 
|---|
|  | 2 | // Classe  GNUPlotContour   : interface avec le code de gnuplot pour tracer les contours | 
|---|
| [1919] | 3 | // Classe  PIContourDrawer  : trace des contours dans PI | 
|---|
| [1829] | 4 | // (c) DAPNIA (CEA)                 LAL (IN2P3/CNRS) | 
|---|
|  | 5 | //                           R. Ansari O.Perdereau  11/2001 | 
|---|
|  | 6 | //=========================================================// | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef PIGNCONT_H_SEEN | 
|---|
|  | 9 | #define PIGNCONT_H_SEEN | 
|---|
|  | 10 | #include "pistdimgapp.h" | 
|---|
|  | 11 | #include "piscdrawwdg.h" | 
|---|
|  | 12 |  | 
|---|
|  | 13 | #include "ntuple.h" | 
|---|
|  | 14 | extern "C" { | 
|---|
| [1844] | 15 | #include "gp_contour.h" | 
|---|
| [1838] | 16 | #include "gp_alloc.h" | 
|---|
| [1857] | 17 | //#include "gpc_set.h" | 
|---|
| [1829] | 18 | } | 
|---|
|  | 19 |  | 
|---|
|  | 20 | class GNUPlotContour{ | 
|---|
|  | 21 | public: | 
|---|
|  | 22 | GNUPlotContour(P2DArrayAdapter*,int *nz,double *z0,double *dz); | 
|---|
|  | 23 | GNUPlotContour(NTupleInterface *nt,int *nz,double *z0,double *dz); | 
|---|
|  | 24 | GNUPlotContour(struct iso_curve *); | 
|---|
|  | 25 | ~GNUPlotContour(); | 
|---|
|  | 26 | void CalcContour(); | 
|---|
|  | 27 | double Level(int i){return My_Levels[i];}; | 
|---|
|  | 28 | const double *Levels(){return My_Levels;}; | 
|---|
|  | 29 | void SetMyLevels(double *ptr,int k); | 
|---|
| [2250] | 30 | void SetMyLevels(vector <double> vec); | 
|---|
| [1829] | 31 | int NLevels(){return Contour_Levels;}; | 
|---|
|  | 32 | void SetNLevel(int n){Contour_Levels=n;}; | 
|---|
|  | 33 | int NContours(){return _npolys;}; | 
|---|
|  | 34 | void SetCntLevelKind(t_contour_levels_kind kind){Contour_Levels_kind = kind;}; | 
|---|
|  | 35 | t_contour_levels_kind GetCntLevelKind(){return Contour_Levels_kind ;}; | 
|---|
|  | 36 | void SetCntKind(t_contour_kind kind){Contour_kind = kind;}; | 
|---|
|  | 37 | t_contour_kind GetCntKind(){return Contour_kind ;}; | 
|---|
|  | 38 |  | 
|---|
| [2250] | 39 |  | 
|---|
| [1829] | 40 | NTuple * & MyIso(){return  _myiso;}; | 
|---|
|  | 41 |  | 
|---|
|  | 42 | double Xmin(){return _xmin;}; | 
|---|
|  | 43 | double Xmax(){return _xmax;}; | 
|---|
|  | 44 | double Ymin(){return _ymin;}; | 
|---|
|  | 45 | double Ymax(){return _ymax;}; | 
|---|
|  | 46 | double Zmin(){return _zmin;}; | 
|---|
|  | 47 | double Zmax(){return _zmax;}; | 
|---|
|  | 48 |  | 
|---|
|  | 49 | private: | 
|---|
|  | 50 |  | 
|---|
|  | 51 | protected: | 
|---|
|  | 52 | NTuple * _myiso; | 
|---|
|  | 53 | int _nx,_ny; | 
|---|
|  | 54 | struct iso_curve *iso1 ; | 
|---|
|  | 55 | bool _Invx,_Invy,_Exy; | 
|---|
|  | 56 | double _Dxp, _Dyp; | 
|---|
|  | 57 | struct gnuplot_contours *_contours; | 
|---|
|  | 58 | int Contour_Levels; | 
|---|
|  | 59 |  | 
|---|
|  | 60 | double *My_Levels; | 
|---|
|  | 61 |  | 
|---|
|  | 62 | double _xmin,_xmax,_ymin,_ymax,_zmin,_zmax; | 
|---|
|  | 63 | int _npolys; | 
|---|
|  | 64 | t_contour_levels_kind Contour_Levels_kind; | 
|---|
|  | 65 | t_contour_kind Contour_kind; | 
|---|
|  | 66 |  | 
|---|
|  | 67 |  | 
|---|
|  | 68 | }; | 
|---|
|  | 69 |  | 
|---|
|  | 70 | class PIContourDrawer : public PIDrawer, public GNUPlotContour{ | 
|---|
|  | 71 | public: | 
|---|
|  | 72 | PIContourDrawer(P2DArrayAdapter* arr,bool autodel ,int *nz=NULL,double *z0=NULL,double *dz=NULL); | 
|---|
|  | 73 | PIContourDrawer(NTupleInterface* nti,bool autodel ,int *nz=NULL,double *z0=NULL,double *dz=NULL); | 
|---|
|  | 74 | virtual           ~PIContourDrawer(); | 
|---|
|  | 75 | virtual void      Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax); | 
|---|
|  | 76 | virtual void      UpdateLimits(); | 
|---|
|  | 77 | virtual bool      IsLineOn(); | 
|---|
|  | 78 | virtual bool      IsMarkOn(); | 
|---|
|  | 79 | virtual bool      IsLabelOn(); | 
|---|
| [2250] | 80 | virtual void      SetLineOn(bool b=true); | 
|---|
|  | 81 | virtual void      SetMarkOn(bool b=true); | 
|---|
|  | 82 | virtual void      SetLabelOn(bool b=true); | 
|---|
| [1829] | 83 |  | 
|---|
|  | 84 | //Init  attributs graphiques | 
|---|
|  | 85 |  | 
|---|
|  | 86 | void InitAtts(); | 
|---|
|  | 87 |  | 
|---|
|  | 88 |  | 
|---|
|  | 89 | //  Methode permettant l'affichage d'une fenetre de controle specialisee | 
|---|
|  | 90 | virtual void      ShowControlWindow(PIBaseWdgGen* wdg); | 
|---|
| [2250] | 91 | //  Desactivation de la fenetre de controle specialisee | 
|---|
|  | 92 | virtual void DeactivateControlWindow(PIBaseWdgGen* wdg); | 
|---|
|  | 93 | //   Methode permettant de decoder des options a partir de chaines | 
|---|
|  | 94 | int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true); | 
|---|
| [1829] | 95 |  | 
|---|
|  | 96 |  | 
|---|
|  | 97 | protected: | 
|---|
|  | 98 | bool _autodel; | 
|---|
|  | 99 | int _nz; | 
|---|
|  | 100 | P2DArrayAdapter* _arr; | 
|---|
|  | 101 | NTupleInterface* _nti; | 
|---|
|  | 102 | bool mLineOn,mMarkOn,mLabelOn; | 
|---|
|  | 103 |  | 
|---|
|  | 104 |  | 
|---|
|  | 105 |  | 
|---|
|  | 106 |  | 
|---|
|  | 107 | }; | 
|---|
|  | 108 |  | 
|---|
|  | 109 |  | 
|---|
|  | 110 | // | 
|---|
|  | 111 |  | 
|---|
|  | 112 | #endif | 
|---|