[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"
|
---|
[2234] | 15 | #include "pidrawer.h"
|
---|
[165] | 16 | #include "piscdrawwdg.h"
|
---|
| 17 |
|
---|
| 18 | ////////////////////////////////////////////////////////////////////
|
---|
| 19 | class PIHisto2D : public PIDrawer {
|
---|
| 20 | public:
|
---|
[1850] | 21 | PIHisto2D(Histo2D* histo, bool ad=false);
|
---|
| 22 | virtual ~PIHisto2D();
|
---|
[165] | 23 |
|
---|
[1850] | 24 | void UseColors(bool fg=false,CMapId cmap=CMAP_GREYINV32,bool revcmap=false);
|
---|
| 25 | void UseScale(unsigned short type=0,float logscale=10.);
|
---|
| 26 | void UseDisplay(unsigned short type=0,float fnpt=0.5);
|
---|
| 27 | void UseDyn(float hmin=1.,float hmax=-1.);
|
---|
| 28 | void UseFrac(float frmin=0.1,float frmax=0.9);
|
---|
| 29 | void Print(int lp=0);
|
---|
[165] | 30 |
|
---|
[1850] | 31 | virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
|
---|
[1880] | 32 |
|
---|
[2234] | 33 | //AppendTextInfo a faire un jour - Reza 21/01/2002
|
---|
| 34 | //virtual void AppendTextInfo(string& info,double xmin,double ymin
|
---|
| 35 | // ,double xmax,double ymax);
|
---|
[1880] | 36 |
|
---|
[2234] | 37 | // Ce que fait l'action de clic avec la souris
|
---|
[1884] | 38 | virtual void GetClickInfo(string& info, double x, double y
|
---|
| 39 | ,double x0=0.,double y0=0.,bool fgdiff=false);
|
---|
| 40 |
|
---|
[1850] | 41 | virtual void UpdateLimits();
|
---|
| 42 | virtual void DrawStats(PIGraphicUC* g);
|
---|
[2234] | 43 | inline void SetStats(bool fg=true) {stats=fg;}
|
---|
[1850] | 44 |
|
---|
[2234] | 45 | // Methode permettant l'affichage d'une fenetre de controle specialisee
|
---|
[1856] | 46 | virtual void ShowControlWindow(PIBaseWdgGen* wdg);
|
---|
[2234] | 47 | // Desactivation de la fenetre de controle specialisee
|
---|
[2231] | 48 | virtual void DeactivateControlWindow(PIBaseWdgGen* wdg);
|
---|
[1856] | 49 |
|
---|
[2234] | 50 | // Methode de decodage des options
|
---|
| 51 | virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
|
---|
| 52 | virtual void GetOptionsHelpInfo(string& info);
|
---|
| 53 |
|
---|
| 54 | // Methodes inline
|
---|
[1850] | 55 | inline Histo2D* Histogram() {return(mHisto);}
|
---|
| 56 | inline bool Color() {return(mFgCol);}
|
---|
| 57 | inline CMapId ColMap() {return(mCmap);}
|
---|
| 58 | inline bool IsColMapRev() {return(mRevCmap);}
|
---|
| 59 | inline unsigned short TypScale() {return(mTypScal);}
|
---|
| 60 | inline unsigned short TypDisplay() {return(mTypDisp);}
|
---|
| 61 | inline float FPoints() {return(mFPoints);}
|
---|
| 62 | inline float HMax() {return(mHMax);}
|
---|
| 63 | inline float HMin() {return(mHMin);}
|
---|
| 64 | inline float FMax() {return(mFracMax);}
|
---|
| 65 | inline float FMin() {return(mFracMin);}
|
---|
| 66 | inline float LogScale() {return(mLogScale);}
|
---|
| 67 |
|
---|
[165] | 68 | protected:
|
---|
| 69 | int NPixBin(PIGraphicUC* g);
|
---|
| 70 | char HPrint2(float f);
|
---|
| 71 |
|
---|
| 72 | Histo2D* mHisto;
|
---|
[2234] | 73 | bool mAdDO; bool stats;
|
---|
[1850] | 74 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
| 75 | unsigned short mTypScal; float mLogScale;
|
---|
| 76 | unsigned short mTypDisp; float mFPoints;
|
---|
[165] | 77 | float mHMin,mHMax;
|
---|
| 78 | float mFracMin,mFracMax;
|
---|
| 79 | };
|
---|
| 80 |
|
---|
| 81 | ////////////////////////////////////////////////////////////////////
|
---|
| 82 | class H2WinArg : public PIWindow {
|
---|
| 83 | public :
|
---|
[1856] | 84 | H2WinArg(PIMsgHandler* par);
|
---|
[1850] | 85 | ~H2WinArg();
|
---|
[165] | 86 |
|
---|
[1856] | 87 | static void ShowPIHisto2DTools();
|
---|
| 88 | static void ShowPIHisto2DTools(PIBaseWdgGen* cbw);
|
---|
| 89 | static void HidePIHisto2DTools();
|
---|
| 90 | static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
|
---|
| 91 | static void SetCurrentPIHisto2D(PIHisto2D* h2ddrw);
|
---|
| 92 |
|
---|
| 93 | static PIBaseWdgGen* GetCurrentBaseWdg();
|
---|
| 94 | static PIHisto2D* GetCurrentPIHisto2D();
|
---|
| 95 |
|
---|
[1850] | 96 | void SetText();
|
---|
| 97 |
|
---|
[1862] | 98 | virtual void Show();
|
---|
[1850] | 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
|
---|