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
|
---|
3 | // Classe PIContourDrawer : trace des contours dans PI
|
---|
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" {
|
---|
15 | #include "gp_contour.h"
|
---|
16 | #include "gp_alloc.h"
|
---|
17 | //#include "gpc_set.h"
|
---|
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);
|
---|
30 | void SetMyLevels(vector <double> vec);
|
---|
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() const {return Contour_Levels_kind ;};
|
---|
36 | void SetCntKind(t_contour_kind kind){Contour_kind = kind;};
|
---|
37 | t_contour_kind GetCntKind() const {return Contour_kind ;};
|
---|
38 |
|
---|
39 |
|
---|
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() const;
|
---|
78 | virtual bool IsMarkOn() const;
|
---|
79 | virtual bool IsLabelOn() const;
|
---|
80 | virtual void SetLineOn(bool b=true);
|
---|
81 | virtual void SetMarkOn(bool b=true);
|
---|
82 | virtual void SetLabelOn(bool b=true);
|
---|
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);
|
---|
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 | virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
|
---|
95 | virtual int OptionToString(vector<string> & opt) const;
|
---|
96 | // Texte d'aide des options disponibles
|
---|
97 | virtual void GetOptionsHelpInfo(string& info);
|
---|
98 |
|
---|
99 |
|
---|
100 | protected:
|
---|
101 | bool _autodel;
|
---|
102 | int _nz;
|
---|
103 | P2DArrayAdapter* _arr;
|
---|
104 | NTupleInterface* _nti;
|
---|
105 | bool mLineOn,mMarkOn,mLabelOn;
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 | };
|
---|
111 |
|
---|
112 |
|
---|
113 | //
|
---|
114 |
|
---|
115 | #endif
|
---|