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

Last change on this file since 2383 was 2383, checked in by ansari, 22 years ago

Ajout methode GetInfoString() aux ObjAdapter + attributs de gestion de position de stat pour PINtuple/PIHisto + positionnement par defaut de stat (statposoff=) lors de disp same - Reza 16/5/2003

File size: 4.0 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 "pidrawer.h"
16#include "piscdrawwdg.h"
17
18////////////////////////////////////////////////////////////////////
19class PIHisto2D : public PIDrawer {
20public:
21 PIHisto2D(Histo2D* histo, bool ad=false);
22 virtual ~PIHisto2D();
23
24 void UseColors(bool fg=false,CMapId cmap=CMAP_GREYINV32,bool revcmap=false);
25 void UseScale(unsigned short type=0,float logscale=10.);
26 void UseDisplay(unsigned short type=0,float fnpt=0.5);
27 void UseDyn(float hmin=1.,float hmax=-1.);
28 void UseFrac(float frmin=0.1,float frmax=0.9);
29 void Print(int lp=0);
30
31 virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
32
33 //AppendTextInfo a faire un jour - Reza 21/01/2002
34 //virtual void AppendTextInfo(string& info,double xmin,double ymin
35 // ,double xmax,double ymax);
36
37 // Ce que fait l'action de clic avec la souris
38 virtual void GetClickInfo(string& info, double x, double y
39 ,double x0=0.,double y0=0.,bool fgdiff=false);
40
41 virtual void UpdateLimits();
42 virtual void DrawStats(PIGraphicUC* g);
43 inline void SetStats(bool fg=true) {stats=fg;}
44 inline void SetStatPosOffset(float ofx=-0.01, float ofy=-0.01)
45 {spoX=ofx; spoY=ofy; }
46
47 // Methode permettant l'affichage d'une fenetre de controle specialisee
48 virtual void ShowControlWindow(PIBaseWdgGen* wdg);
49 // Desactivation de la fenetre de controle specialisee
50 virtual void DeactivateControlWindow(PIBaseWdgGen* wdg);
51
52 // Methode de decodage des options
53 virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
54 virtual void GetOptionsHelpInfo(string& info);
55
56 // Methodes inline
57 inline Histo2D* Histogram() {return(mHisto);}
58 inline bool Color() {return(mFgCol);}
59 inline CMapId ColMap() {return(mCmap);}
60 inline bool IsColMapRev() {return(mRevCmap);}
61 inline unsigned short TypScale() {return(mTypScal);}
62 inline unsigned short TypDisplay() {return(mTypDisp);}
63 inline float FPoints() {return(mFPoints);}
64 inline float HMax() {return(mHMax);}
65 inline float HMin() {return(mHMin);}
66 inline float FMax() {return(mFracMax);}
67 inline float FMin() {return(mFracMin);}
68 inline float LogScale() {return(mLogScale);}
69
70protected:
71 int NPixBin(PIGraphicUC* g);
72 char HPrint2(float f);
73
74 Histo2D* mHisto;
75 bool mAdDO; bool stats;
76 bool mFgCol; CMapId mCmap; bool mRevCmap;
77 unsigned short mTypScal; float mLogScale;
78 unsigned short mTypDisp; float mFPoints;
79 float mHMin,mHMax;
80 float mFracMin,mFracMax;
81 float spoX, spoY; // Stat pos offset par rapport a position defaut
82};
83
84////////////////////////////////////////////////////////////////////
85class H2WinArg : public PIWindow {
86public :
87 H2WinArg(PIMsgHandler* par);
88 ~H2WinArg();
89
90 static void ShowPIHisto2DTools();
91 static void ShowPIHisto2DTools(PIBaseWdgGen* cbw);
92 static void HidePIHisto2DTools();
93 static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
94 static void SetCurrentPIHisto2D(PIHisto2D* h2ddrw);
95
96 static PIBaseWdgGen* GetCurrentBaseWdg();
97 static PIHisto2D* GetCurrentPIHisto2D();
98
99 void SetText();
100
101 virtual void Show();
102 virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
103
104protected:
105 static PIBaseWdgGen * mBWdg;
106 static PIHisto2D* mH2DDrw;
107
108 PIOptMenu * mOPop[3];
109 PIMenu * mCasc[3];
110 PIButton * mBut[4];
111 PILabel * mLab[4];
112 PIText * mText[3];
113 PIScale * mPScal;
114 PICheckBox* mCkb;
115
116 bool mFgCol; CMapId mCmap; bool mRevCmap;
117 unsigned short mTypScal; float mLogScale;
118 unsigned short mTypDisp; float mFPoints;
119 float mHMin,mHMax;
120 float mFracMin,mFracMax;
121};
122
123#endif
Note: See TracBrowser for help on using the repository browser.