[210] | 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 |
|
---|
[165] | 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:
|
---|
[1850] | 20 | PIHisto2D(Histo2D* histo, bool ad=false);
|
---|
| 21 | virtual ~PIHisto2D();
|
---|
[165] | 22 |
|
---|
[1850] | 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);
|
---|
[165] | 29 |
|
---|
[1850] | 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 |
|
---|
[1856] | 34 | // Methode permettant l'affichage d'une fenetre de controle specialisee
|
---|
| 35 | virtual void ShowControlWindow(PIBaseWdgGen* wdg);
|
---|
| 36 |
|
---|
[1850] | 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 |
|
---|
[165] | 50 | protected:
|
---|
| 51 | int NPixBin(PIGraphicUC* g);
|
---|
| 52 | char HPrint2(float f);
|
---|
| 53 |
|
---|
| 54 | Histo2D* mHisto;
|
---|
| 55 | bool mAdDO;
|
---|
[1850] | 56 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
| 57 | unsigned short mTypScal; float mLogScale;
|
---|
| 58 | unsigned short mTypDisp; float mFPoints;
|
---|
[165] | 59 | float mHMin,mHMax;
|
---|
| 60 | float mFracMin,mFracMax;
|
---|
| 61 | };
|
---|
| 62 |
|
---|
| 63 | ////////////////////////////////////////////////////////////////////
|
---|
| 64 | class PIH2DWdg : public PIScDrawWdg {
|
---|
| 65 | public:
|
---|
[1850] | 66 | PIH2DWdg(PIContainerGen *par,const char *nom,int sx=300,int sy=300,int px=0,int py=0);
|
---|
| 67 | ~PIH2DWdg();
|
---|
[165] | 68 |
|
---|
[1850] | 69 | void SetHisto(Histo2D* histo);
|
---|
| 70 | void SetPIHisto(PIHisto2D* pih2);
|
---|
[165] | 71 |
|
---|
[1850] | 72 | inline PIHisto2D* GetPIHisto() {return mPih;}
|
---|
[165] | 73 |
|
---|
[1850] | 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 |
|
---|
[165] | 78 | protected:
|
---|
| 79 | PIHisto2D* mPih;
|
---|
| 80 | };
|
---|
| 81 |
|
---|
| 82 | ////////////////////////////////////////////////////////////////////
|
---|
| 83 | class H2WinArg : public PIWindow {
|
---|
| 84 | public :
|
---|
[1856] | 85 | H2WinArg(PIMsgHandler* par);
|
---|
[1850] | 86 | ~H2WinArg();
|
---|
[165] | 87 |
|
---|
[1856] | 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 |
|
---|
[1850] | 97 | void SetText();
|
---|
| 98 |
|
---|
| 99 | virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
|
---|
| 100 |
|
---|
[165] | 101 | protected:
|
---|
[1856] | 102 | static PIBaseWdgGen * mBWdg;
|
---|
| 103 | static PIHisto2D* mH2DDrw;
|
---|
[165] | 104 |
|
---|
| 105 | PIOptMenu * mOPop[3];
|
---|
[1297] | 106 | PIMenu * mCasc[2];
|
---|
[165] | 107 | PIButton * mBut[4];
|
---|
| 108 | PILabel * mLab[4];
|
---|
| 109 | PIText * mText[3];
|
---|
| 110 | PIScale * mPScal;
|
---|
[1850] | 111 | PICheckBox* mCkb;
|
---|
[165] | 112 |
|
---|
[1850] | 113 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
| 114 | unsigned short mTypScal; float mLogScale;
|
---|
| 115 | unsigned short mTypDisp; float mFPoints;
|
---|
[165] | 116 | float mHMin,mHMax;
|
---|
| 117 | float mFracMin,mFracMax;
|
---|
| 118 | };
|
---|
| 119 |
|
---|
| 120 | #endif
|
---|