source: Sophya/trunk/SophyaPI/PIext/pihisto2d.h@ 2231

Last change on this file since 2231 was 2231, checked in by ansari, 23 years ago

Implementation de PIHisto2D::DeactivateControlWindow() + Refresh() Widget lors du delete de Drawer - Reza 25/10/2002

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