1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 | // Module PIext : PIHisto2D PIH2DWdg
|
---|
3 | // Traceur Histo-2D C. Magneville 97-98
|
---|
4 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
5 |
|
---|
6 | #ifndef PIHISTO2D_H
|
---|
7 | #define PIHISTO2D_H
|
---|
8 |
|
---|
9 | #include "pisysdep.h"
|
---|
10 | #include PIMENU_H
|
---|
11 | #include PIMENUBAR_H
|
---|
12 | #include PIOPTMENU_H
|
---|
13 |
|
---|
14 | #include "pidrawer.h"
|
---|
15 | #include "piscdrawwdg.h"
|
---|
16 |
|
---|
17 | #include "phistwrapper.h"
|
---|
18 |
|
---|
19 | ////////////////////////////////////////////////////////////////////
|
---|
20 | class PIHisto2D : public PIDrawer {
|
---|
21 | public:
|
---|
22 | PIHisto2D(P2DHistoWrapper* h2wp, bool ad=false);
|
---|
23 | virtual ~PIHisto2D();
|
---|
24 |
|
---|
25 | void UseColors(bool fg=false,CMapId cmap=CMAP_GREYINV32,bool revcmap=false);
|
---|
26 | void UseScale(unsigned short type=0,double logscale=10.);
|
---|
27 | void UseDisplay(unsigned short type=0,double fnpt=0.5);
|
---|
28 | void UseDyn(double hmin=1.,double hmax=-1.);
|
---|
29 | void UseFrac(double frmin=0.1,double frmax=0.9);
|
---|
30 | void Print(int lp=0);
|
---|
31 |
|
---|
32 | virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
|
---|
33 |
|
---|
34 | //AppendTextInfo a faire un jour - Reza 21/01/2002
|
---|
35 | //virtual void AppendTextInfo(string& info,double xmin,double ymin
|
---|
36 | // ,double xmax,double ymax);
|
---|
37 |
|
---|
38 | // Ce que fait l'action de clic avec la souris
|
---|
39 | virtual void GetClickInfo(string& info, double x, double y
|
---|
40 | ,double x0=0.,double y0=0.,bool fgdiff=false);
|
---|
41 |
|
---|
42 | virtual void UpdateLimits();
|
---|
43 | virtual void DrawStats(PIGraphicUC* g);
|
---|
44 | inline void SetStats(bool fg=true) {stats=fg;}
|
---|
45 | inline void SetStatPosOffset(double ofx=-0.01, double ofy=-0.01)
|
---|
46 | {spoX=ofx; spoY=ofy; }
|
---|
47 |
|
---|
48 | // Methode permettant l'affichage d'une fenetre de controle specialisee
|
---|
49 | virtual void ShowControlWindow(PIBaseWdgGen* wdg);
|
---|
50 | // Desactivation de la fenetre de controle specialisee
|
---|
51 | virtual void DeactivateControlWindow(PIBaseWdgGen* wdg);
|
---|
52 |
|
---|
53 | // Methode de decodage des options
|
---|
54 | virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
|
---|
55 | virtual int OptionToString(vector<string> & opt) const;
|
---|
56 | virtual void GetOptionsHelpInfo(string& info);
|
---|
57 |
|
---|
58 | // Methodes inline
|
---|
59 | inline P2DHistoWrapper* HistoWrapper() {return(mHistoWp);}
|
---|
60 | inline bool Color() {return(mFgCol);}
|
---|
61 | inline CMapId ColMap() {return(mCmap);}
|
---|
62 | inline bool IsColMapRev() {return(mRevCmap);}
|
---|
63 | inline unsigned short TypScale() {return(mTypScal);}
|
---|
64 | inline unsigned short TypDisplay() {return(mTypDisp);}
|
---|
65 | inline double FPoints() {return(mFPoints);}
|
---|
66 | inline double HMax() {return(mHMax);}
|
---|
67 | inline double HMin() {return(mHMin);}
|
---|
68 | inline double FMax() {return(mFracMax);}
|
---|
69 | inline double FMin() {return(mFracMin);}
|
---|
70 | inline double LogScale() {return(mLogScale);}
|
---|
71 |
|
---|
72 | protected:
|
---|
73 | int NPixBin(PIGraphicUC* g);
|
---|
74 | char HPrint2(double f);
|
---|
75 |
|
---|
76 | P2DHistoWrapper* mHistoWp;
|
---|
77 | bool mAdDO; bool stats;
|
---|
78 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
79 | unsigned short mTypScal; double mLogScale;
|
---|
80 | unsigned short mTypDisp; double mFPoints;
|
---|
81 | double mHMin,mHMax;
|
---|
82 | double mFracMin,mFracMax;
|
---|
83 | double spoX, spoY; // Stat pos offset par rapport a position defaut
|
---|
84 | };
|
---|
85 |
|
---|
86 | ////////////////////////////////////////////////////////////////////
|
---|
87 | class H2WinArg : public PIWindow {
|
---|
88 | public :
|
---|
89 | H2WinArg(PIMsgHandler* par);
|
---|
90 | ~H2WinArg();
|
---|
91 |
|
---|
92 | static void ShowPIHisto2DTools();
|
---|
93 | static void ShowPIHisto2DTools(PIBaseWdgGen* cbw);
|
---|
94 | static void HidePIHisto2DTools();
|
---|
95 | static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
|
---|
96 | static void SetCurrentPIHisto2D(PIHisto2D* h2ddrw);
|
---|
97 |
|
---|
98 | static PIBaseWdgGen* GetCurrentBaseWdg();
|
---|
99 | static PIHisto2D* GetCurrentPIHisto2D();
|
---|
100 |
|
---|
101 | void SetText();
|
---|
102 |
|
---|
103 | virtual void Show();
|
---|
104 | virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
|
---|
105 |
|
---|
106 | protected:
|
---|
107 | static PIBaseWdgGen * mBWdg;
|
---|
108 | static PIHisto2D* mH2DDrw;
|
---|
109 |
|
---|
110 | PIOptMenu * mOPop[3];
|
---|
111 | PIMenu * mCasc[3];
|
---|
112 | PIButton * mBut[4];
|
---|
113 | PILabel * mLab[4];
|
---|
114 | PIText * mText[3];
|
---|
115 | PIScale * mPScal;
|
---|
116 | PICheckBox* mCkb;
|
---|
117 |
|
---|
118 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
119 | unsigned short mTypScal; double mLogScale;
|
---|
120 | unsigned short mTypDisp; double mFPoints;
|
---|
121 | double mHMin,mHMax;
|
---|
122 | double mFracMin,mFracMax;
|
---|
123 | };
|
---|
124 |
|
---|
125 | #endif
|
---|