1 | #ifndef PIHISTO2D_H
|
---|
2 | #define PIHISTO2D_H
|
---|
3 |
|
---|
4 | #include "pisysdep.h"
|
---|
5 | #include PIMENU_H
|
---|
6 | #include PIMENUBAR_H
|
---|
7 | #include PIOPTMENU_H
|
---|
8 |
|
---|
9 | #include "histos2.h"
|
---|
10 | #include "piscdrawwdg.h"
|
---|
11 |
|
---|
12 | ////////////////////////////////////////////////////////////////////
|
---|
13 | class PIHisto2D : public PIDrawer {
|
---|
14 | public:
|
---|
15 | PIHisto2D(Histo2D* histo, bool ad=false);
|
---|
16 | virtual ~PIHisto2D();
|
---|
17 | void UseColors(bool fg=false, CMapId cmap=CMAP_GREYINV32);
|
---|
18 | void UseScale(unsigned short type=0,float logscale=10.);
|
---|
19 | void UseDisplay(unsigned short type=0, float fnpt=0.5);
|
---|
20 | void UseDyn(float hmin=1., float hmax=-1.);
|
---|
21 | void UseFrac(float frmin=0.1, float frmax=0.9);
|
---|
22 | void Print(int lp=0);
|
---|
23 | virtual void Draw(PIGraphicUC* g,float xmin,float ymin,float xmax,float ymax);
|
---|
24 | virtual void UpdateLimits();
|
---|
25 | virtual void DrawStats(PIGraphicUC* g);
|
---|
26 |
|
---|
27 | inline Histo2D* Histogram() { return(mHisto); }
|
---|
28 | inline bool Color() { return(mFgCol); }
|
---|
29 | inline CMapId ColMap() { return(mCmap); }
|
---|
30 | inline unsigned short TypScale() { return(mTypScal); }
|
---|
31 | inline unsigned short TypDisplay() { return(mTypDisp); }
|
---|
32 | inline float FPoints() { return(mFPoints); }
|
---|
33 | inline float HMax() { return(mHMax);}
|
---|
34 | inline float HMin() { return(mHMin);}
|
---|
35 | inline float FMax() { return(mFracMax);}
|
---|
36 | inline float FMin() { return(mFracMin);}
|
---|
37 | inline float LogScale() { return(mLogScale);}
|
---|
38 |
|
---|
39 | protected:
|
---|
40 | int NPixBin(PIGraphicUC* g);
|
---|
41 | char HPrint2(float f);
|
---|
42 |
|
---|
43 | Histo2D* mHisto;
|
---|
44 | bool mAdDO;
|
---|
45 | bool mFgCol;
|
---|
46 | CMapId mCmap;
|
---|
47 | unsigned short mTypScal;
|
---|
48 | unsigned short mTypDisp;
|
---|
49 | float mFPoints;
|
---|
50 | float mHMin,mHMax;
|
---|
51 | float mFracMin,mFracMax;
|
---|
52 | float mLogScale;
|
---|
53 | };
|
---|
54 |
|
---|
55 | ////////////////////////////////////////////////////////////////////
|
---|
56 | class PIH2DWdg : public PIScDrawWdg {
|
---|
57 | public:
|
---|
58 | PIH2DWdg(PIContainerGen *par, char *nom, int sx=300, int sy=300,
|
---|
59 | int px=0, int py=0);
|
---|
60 | ~PIH2DWdg();
|
---|
61 |
|
---|
62 | void SetHisto(Histo2D* histo);
|
---|
63 | void SetPIHisto(PIHisto2D* pih2);
|
---|
64 | inline PIHisto2D* GetPIHisto() {return mPih;}
|
---|
65 |
|
---|
66 | virtual string GetClickText(float x, float y);
|
---|
67 | virtual void But3Press(int x, int y);
|
---|
68 |
|
---|
69 | protected:
|
---|
70 | PIHisto2D* mPih;
|
---|
71 |
|
---|
72 | };
|
---|
73 |
|
---|
74 | ////////////////////////////////////////////////////////////////////
|
---|
75 | class H2WinArg : public PIWindow {
|
---|
76 | public :
|
---|
77 | H2WinArg(PIH2DWdg *par);
|
---|
78 | ~H2WinArg();
|
---|
79 | void SetPIH2DWdg(PIH2DWdg* h2wdg);
|
---|
80 | void SetText();
|
---|
81 | void GetText();
|
---|
82 | virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
|
---|
83 |
|
---|
84 | protected:
|
---|
85 | PIH2DWdg * mH2Wdg;
|
---|
86 |
|
---|
87 | PIOptMenu * mOPop[3];
|
---|
88 | PIButton * mBut[4];
|
---|
89 | PILabel * mLab[4];
|
---|
90 | PIText * mText[3];
|
---|
91 | PIScale * mPScal;
|
---|
92 |
|
---|
93 | bool mFgCol;
|
---|
94 | CMapId mCmap;
|
---|
95 | unsigned short mTypScal;
|
---|
96 | unsigned short mTypDisp;
|
---|
97 | float mFPoints;
|
---|
98 | float mHMin,mHMax;
|
---|
99 | float mFracMin,mFracMax;
|
---|
100 | float mLogScale;
|
---|
101 | };
|
---|
102 |
|
---|
103 | #endif
|
---|