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

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

correct pour le getclickinfo() cmv 22/01/02

File size: 3.4 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
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
57protected:
58 int NPixBin(PIGraphicUC* g);
59 char HPrint2(float f);
60
61 Histo2D* mHisto;
62 bool mAdDO;
63 bool mFgCol; CMapId mCmap; bool mRevCmap;
64 unsigned short mTypScal; float mLogScale;
65 unsigned short mTypDisp; float mFPoints;
66 float mHMin,mHMax;
67 float mFracMin,mFracMax;
68};
69
70////////////////////////////////////////////////////////////////////
71class H2WinArg : public PIWindow {
72public :
73 H2WinArg(PIMsgHandler* par);
74 ~H2WinArg();
75
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
85 void SetText();
86
87 virtual void Show();
88 virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
89
90protected:
91 static PIBaseWdgGen * mBWdg;
92 static PIHisto2D* mH2DDrw;
93
94 PIOptMenu * mOPop[3];
95 PIMenu * mCasc[2];
96 PIButton * mBut[4];
97 PILabel * mLab[4];
98 PIText * mText[3];
99 PIScale * mPScal;
100 PICheckBox* mCkb;
101
102 bool mFgCol; CMapId mCmap; bool mRevCmap;
103 unsigned short mTypScal; float mLogScale;
104 unsigned short mTypDisp; float mFPoints;
105 float mHMin,mHMax;
106 float mFracMin,mFracMax;
107};
108
109#endif
Note: See TracBrowser for help on using the repository browser.