[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 |
|
---|
[2234] | 14 | #include "pidrawer.h"
|
---|
[165] | 15 | #include "piscdrawwdg.h"
|
---|
| 16 |
|
---|
[3145] | 17 | #include "phistwrapper.h"
|
---|
| 18 |
|
---|
[165] | 19 | ////////////////////////////////////////////////////////////////////
|
---|
| 20 | class PIHisto2D : public PIDrawer {
|
---|
| 21 | public:
|
---|
[3145] | 22 | PIHisto2D(P2DHistoWrapper* h2wp, bool ad=false);
|
---|
[1850] | 23 | virtual ~PIHisto2D();
|
---|
[165] | 24 |
|
---|
[1850] | 25 | void UseColors(bool fg=false,CMapId cmap=CMAP_GREYINV32,bool revcmap=false);
|
---|
[3149] | 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);
|
---|
[1850] | 30 | void Print(int lp=0);
|
---|
[165] | 31 |
|
---|
[1850] | 32 | virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
|
---|
[1880] | 33 |
|
---|
[2234] | 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);
|
---|
[1880] | 37 |
|
---|
[2234] | 38 | // Ce que fait l'action de clic avec la souris
|
---|
[1884] | 39 | virtual void GetClickInfo(string& info, double x, double y
|
---|
| 40 | ,double x0=0.,double y0=0.,bool fgdiff=false);
|
---|
| 41 |
|
---|
[1850] | 42 | virtual void UpdateLimits();
|
---|
| 43 | virtual void DrawStats(PIGraphicUC* g);
|
---|
[2234] | 44 | inline void SetStats(bool fg=true) {stats=fg;}
|
---|
[3149] | 45 | inline void SetStatPosOffset(double ofx=-0.01, double ofy=-0.01)
|
---|
[2383] | 46 | {spoX=ofx; spoY=ofy; }
|
---|
[1850] | 47 |
|
---|
[2234] | 48 | // Methode permettant l'affichage d'une fenetre de controle specialisee
|
---|
[1856] | 49 | virtual void ShowControlWindow(PIBaseWdgGen* wdg);
|
---|
[2234] | 50 | // Desactivation de la fenetre de controle specialisee
|
---|
[2231] | 51 | virtual void DeactivateControlWindow(PIBaseWdgGen* wdg);
|
---|
[1856] | 52 |
|
---|
[2234] | 53 | // Methode de decodage des options
|
---|
| 54 | virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
|
---|
[2523] | 55 | virtual int OptionToString(vector<string> & opt) const;
|
---|
[2234] | 56 | virtual void GetOptionsHelpInfo(string& info);
|
---|
| 57 |
|
---|
| 58 | // Methodes inline
|
---|
[3145] | 59 | inline P2DHistoWrapper* HistoWrapper() {return(mHistoWp);}
|
---|
[1850] | 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);}
|
---|
[3149] | 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);}
|
---|
[1850] | 71 |
|
---|
[165] | 72 | protected:
|
---|
| 73 | int NPixBin(PIGraphicUC* g);
|
---|
[3149] | 74 | char HPrint2(double f);
|
---|
[165] | 75 |
|
---|
[3145] | 76 | P2DHistoWrapper* mHistoWp;
|
---|
[2234] | 77 | bool mAdDO; bool stats;
|
---|
[1850] | 78 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
[3149] | 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
|
---|
[165] | 84 | };
|
---|
| 85 |
|
---|
| 86 | ////////////////////////////////////////////////////////////////////
|
---|
| 87 | class H2WinArg : public PIWindow {
|
---|
| 88 | public :
|
---|
[1856] | 89 | H2WinArg(PIMsgHandler* par);
|
---|
[1850] | 90 | ~H2WinArg();
|
---|
[165] | 91 |
|
---|
[1856] | 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 |
|
---|
[1850] | 101 | void SetText();
|
---|
| 102 |
|
---|
[1862] | 103 | virtual void Show();
|
---|
[1850] | 104 | virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
|
---|
| 105 |
|
---|
[165] | 106 | protected:
|
---|
[1856] | 107 | static PIBaseWdgGen * mBWdg;
|
---|
| 108 | static PIHisto2D* mH2DDrw;
|
---|
[165] | 109 |
|
---|
| 110 | PIOptMenu * mOPop[3];
|
---|
[2380] | 111 | PIMenu * mCasc[3];
|
---|
[165] | 112 | PIButton * mBut[4];
|
---|
| 113 | PILabel * mLab[4];
|
---|
| 114 | PIText * mText[3];
|
---|
| 115 | PIScale * mPScal;
|
---|
[1850] | 116 | PICheckBox* mCkb;
|
---|
[165] | 117 |
|
---|
[1850] | 118 | bool mFgCol; CMapId mCmap; bool mRevCmap;
|
---|
[3149] | 119 | unsigned short mTypScal; double mLogScale;
|
---|
| 120 | unsigned short mTypDisp; double mFPoints;
|
---|
| 121 | double mHMin,mHMax;
|
---|
| 122 | double mFracMin,mFracMax;
|
---|
[165] | 123 | };
|
---|
| 124 |
|
---|
| 125 | #endif
|
---|