| [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);
 | 
|---|
| [1880] | 31 | 
 | 
|---|
 | 32 |   //   AppendTextInfo a faire un jour - Reza 21/01/2002 
 | 
|---|
 | 33 |   //  virtual void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
 | 
|---|
 | 34 | 
 | 
|---|
| [1884] | 35 |   virtual void GetClickInfo(string& info, double x, double y
 | 
|---|
 | 36 |                            ,double x0=0.,double y0=0.,bool fgdiff=false); 
 | 
|---|
 | 37 | 
 | 
|---|
| [1850] | 38 |   virtual void UpdateLimits();
 | 
|---|
 | 39 |   virtual void DrawStats(PIGraphicUC* g);
 | 
|---|
 | 40 | 
 | 
|---|
| [1856] | 41 | //  Methode permettant l'affichage d'une fenetre de controle specialisee 
 | 
|---|
 | 42 |   virtual void ShowControlWindow(PIBaseWdgGen* wdg);
 | 
|---|
 | 43 | 
 | 
|---|
| [1850] | 44 |   inline Histo2D*       Histogram()   {return(mHisto);}
 | 
|---|
 | 45 |   inline bool           Color()       {return(mFgCol);}
 | 
|---|
 | 46 |   inline CMapId         ColMap()      {return(mCmap);}
 | 
|---|
 | 47 |   inline bool           IsColMapRev() {return(mRevCmap);}
 | 
|---|
 | 48 |   inline unsigned short TypScale()    {return(mTypScal);}
 | 
|---|
 | 49 |   inline unsigned short TypDisplay()  {return(mTypDisp);}
 | 
|---|
 | 50 |   inline float          FPoints()     {return(mFPoints);}
 | 
|---|
 | 51 |   inline float          HMax()        {return(mHMax);}
 | 
|---|
 | 52 |   inline float          HMin()        {return(mHMin);}
 | 
|---|
 | 53 |   inline float          FMax()        {return(mFracMax);}
 | 
|---|
 | 54 |   inline float          FMin()        {return(mFracMin);}
 | 
|---|
 | 55 |   inline float          LogScale()    {return(mLogScale);}
 | 
|---|
 | 56 | 
 | 
|---|
| [165] | 57 | protected:
 | 
|---|
 | 58 |   int NPixBin(PIGraphicUC* g);
 | 
|---|
 | 59 |   char HPrint2(float f);
 | 
|---|
 | 60 | 
 | 
|---|
 | 61 |   Histo2D* mHisto;
 | 
|---|
 | 62 |   bool mAdDO;
 | 
|---|
| [1850] | 63 |   bool mFgCol; CMapId mCmap; bool mRevCmap;
 | 
|---|
 | 64 |   unsigned short mTypScal; float mLogScale;
 | 
|---|
 | 65 |   unsigned short mTypDisp; float mFPoints;
 | 
|---|
| [165] | 66 |   float mHMin,mHMax;
 | 
|---|
 | 67 |   float mFracMin,mFracMax;
 | 
|---|
 | 68 | };
 | 
|---|
 | 69 | 
 | 
|---|
 | 70 | ////////////////////////////////////////////////////////////////////
 | 
|---|
 | 71 | class H2WinArg : public PIWindow {
 | 
|---|
 | 72 | public :
 | 
|---|
| [1856] | 73 |   H2WinArg(PIMsgHandler* par);
 | 
|---|
| [1850] | 74 |   ~H2WinArg();
 | 
|---|
| [165] | 75 | 
 | 
|---|
| [1856] | 76 |   static void ShowPIHisto2DTools();
 | 
|---|
 | 77 |   static void ShowPIHisto2DTools(PIBaseWdgGen* cbw);
 | 
|---|
 | 78 |   static void HidePIHisto2DTools();
 | 
|---|
 | 79 |   static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
 | 
|---|
 | 80 |   static void SetCurrentPIHisto2D(PIHisto2D* h2ddrw);
 | 
|---|
 | 81 | 
 | 
|---|
 | 82 |   static PIBaseWdgGen* GetCurrentBaseWdg();
 | 
|---|
 | 83 |   static PIHisto2D* GetCurrentPIHisto2D();
 | 
|---|
 | 84 | 
 | 
|---|
| [1850] | 85 |   void SetText();
 | 
|---|
 | 86 | 
 | 
|---|
| [1862] | 87 |   virtual void Show();
 | 
|---|
| [1850] | 88 |   virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
 | 
|---|
 | 89 | 
 | 
|---|
| [165] | 90 | protected:
 | 
|---|
| [1856] | 91 |   static PIBaseWdgGen * mBWdg;
 | 
|---|
 | 92 |   static PIHisto2D*  mH2DDrw;
 | 
|---|
| [165] | 93 | 
 | 
|---|
 | 94 |   PIOptMenu * mOPop[3];
 | 
|---|
| [1297] | 95 |   PIMenu    * mCasc[2];
 | 
|---|
| [165] | 96 |   PIButton  * mBut[4];
 | 
|---|
 | 97 |   PILabel   * mLab[4];
 | 
|---|
 | 98 |   PIText    * mText[3];
 | 
|---|
 | 99 |   PIScale   * mPScal;
 | 
|---|
| [1850] | 100 |   PICheckBox* mCkb;
 | 
|---|
| [165] | 101 | 
 | 
|---|
| [1850] | 102 |   bool mFgCol; CMapId mCmap; bool mRevCmap;
 | 
|---|
 | 103 |   unsigned short mTypScal; float mLogScale;
 | 
|---|
 | 104 |   unsigned short mTypDisp; float mFPoints;
 | 
|---|
| [165] | 105 |   float mHMin,mHMax;
 | 
|---|
 | 106 |   float mFracMin,mFracMax;
 | 
|---|
 | 107 | };
 | 
|---|
 | 108 | 
 | 
|---|
 | 109 | #endif
 | 
|---|