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 "histos2.h"
|
---|
15 | #include "piscdrawwdg.h"
|
---|
16 |
|
---|
17 | ////////////////////////////////////////////////////////////////////
|
---|
18 | class PIHisto2D : public PIDrawer {
|
---|
19 | public:
|
---|
20 | PIHisto2D(Histo2D* histo, bool ad=false);
|
---|
21 | virtual ~PIHisto2D();
|
---|
22 |
|
---|
23 | void UseColors(bool fg=false,CMapId cmap=CMAP_GREYINV32,bool revcmap=false);
|
---|
24 | void UseScale(unsigned short type=0,float logscale=10.);
|
---|
25 | void UseDisplay(unsigned short type=0,float fnpt=0.5);
|
---|
26 | void UseDyn(float hmin=1.,float hmax=-1.);
|
---|
27 | void UseFrac(float frmin=0.1,float frmax=0.9);
|
---|
28 | void Print(int lp=0);
|
---|
29 |
|
---|
30 | virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
|
---|
31 | virtual void UpdateLimits();
|
---|
32 | virtual void DrawStats(PIGraphicUC* g);
|
---|
33 |
|
---|
34 | // Methode permettant l'affichage d'une fenetre de controle specialisee
|
---|
35 | virtual void ShowControlWindow(PIBaseWdgGen* wdg);
|
---|
36 |
|
---|
37 | inline Histo2D* Histogram() {return(mHisto);}
|
---|
38 | inline bool Color() {return(mFgCol);}
|
---|
39 | inline CMapId ColMap() {return(mCmap);}
|
---|
40 | inline bool IsColMapRev() {return(mRevCmap);}
|
---|
41 | inline unsigned short TypScale() {return(mTypScal);}
|
---|
42 | inline unsigned short TypDisplay() {return(mTypDisp);}
|
---|
43 | inline float FPoints() {return(mFPoints);}
|
---|
44 | inline float HMax() {return(mHMax);}
|
---|
45 | inline float HMin() {return(mHMin);}
|
---|
46 | inline float FMax() {return(mFracMax);}
|
---|
47 | inline float FMin() {return(mFracMin);}
|
---|
48 | inline float LogScale() {return(mLogScale);}
|
---|
49 |
|
---|
50 | protected:
|
---|
51 | int NPixBin(PIGraphicUC* g);
|
---|
52 | char HPrint2(float f);
|
---|
53 |
|
---|
54 | Histo2D* mHisto;
|
---|
55 | bool mAdDO;
|
---|
56 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
57 | unsigned short mTypScal; float mLogScale;
|
---|
58 | unsigned short mTypDisp; float mFPoints;
|
---|
59 | float mHMin,mHMax;
|
---|
60 | float mFracMin,mFracMax;
|
---|
61 | };
|
---|
62 |
|
---|
63 | ////////////////////////////////////////////////////////////////////
|
---|
64 | class PIH2DWdg : public PIScDrawWdg {
|
---|
65 | public:
|
---|
66 | PIH2DWdg(PIContainerGen *par,const char *nom,int sx=300,int sy=300,int px=0,int py=0);
|
---|
67 | ~PIH2DWdg();
|
---|
68 |
|
---|
69 | void SetHisto(Histo2D* histo);
|
---|
70 | void SetPIHisto(PIHisto2D* pih2);
|
---|
71 |
|
---|
72 | inline PIHisto2D* GetPIHisto() {return mPih;}
|
---|
73 |
|
---|
74 | virtual string GetClickText(double x, double y);
|
---|
75 | virtual void ActivateSpecializedControls(); // Pour activer des controles specifiques
|
---|
76 | virtual void But3Press(int x, int y);
|
---|
77 |
|
---|
78 | protected:
|
---|
79 | PIHisto2D* mPih;
|
---|
80 | };
|
---|
81 |
|
---|
82 | ////////////////////////////////////////////////////////////////////
|
---|
83 | class H2WinArg : public PIWindow {
|
---|
84 | public :
|
---|
85 | H2WinArg(PIMsgHandler* par);
|
---|
86 | ~H2WinArg();
|
---|
87 |
|
---|
88 | static void ShowPIHisto2DTools();
|
---|
89 | static void ShowPIHisto2DTools(PIBaseWdgGen* cbw);
|
---|
90 | static void HidePIHisto2DTools();
|
---|
91 | static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
|
---|
92 | static void SetCurrentPIHisto2D(PIHisto2D* h2ddrw);
|
---|
93 |
|
---|
94 | static PIBaseWdgGen* GetCurrentBaseWdg();
|
---|
95 | static PIHisto2D* GetCurrentPIHisto2D();
|
---|
96 |
|
---|
97 | void SetText();
|
---|
98 |
|
---|
99 | virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
|
---|
100 |
|
---|
101 | protected:
|
---|
102 | static PIBaseWdgGen * mBWdg;
|
---|
103 | static PIHisto2D* mH2DDrw;
|
---|
104 |
|
---|
105 | PIOptMenu * mOPop[3];
|
---|
106 | PIMenu * mCasc[2];
|
---|
107 | PIButton * mBut[4];
|
---|
108 | PILabel * mLab[4];
|
---|
109 | PIText * mText[3];
|
---|
110 | PIScale * mPScal;
|
---|
111 | PICheckBox* mCkb;
|
---|
112 |
|
---|
113 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
114 | unsigned short mTypScal; float mLogScale;
|
---|
115 | unsigned short mTypDisp; float mFPoints;
|
---|
116 | float mHMin,mHMax;
|
---|
117 | float mFracMin,mFracMax;
|
---|
118 | };
|
---|
119 |
|
---|
120 | #endif
|
---|