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

Last change on this file since 1883 was 1883, checked in by cmv, 24 years ago

petit bug + texte / ATL-K,DX,DY cmv 22/01/02

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