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

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

(Un)Sensitive sur fenetre H2WinArg, PIH2DWdg enlevee cmv 17/01/02

File size: 3.7 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 virtual void UpdateLimits();
32 virtual void DrawStats(PIGraphicUC* g);
33
34// Methode permettant l'affichage d'une fenetre de controle specialisee
35 virtual void ShowControlWindow(PIBaseWdgGen* wdg);
36
37 inline Histo2D* Histogram() {return(mHisto);}
38 inline bool Color() {return(mFgCol);}
39 inline CMapId ColMap() {return(mCmap);}
40 inline bool IsColMapRev() {return(mRevCmap);}
41 inline unsigned short TypScale() {return(mTypScal);}
42 inline unsigned short TypDisplay() {return(mTypDisp);}
43 inline float FPoints() {return(mFPoints);}
44 inline float HMax() {return(mHMax);}
45 inline float HMin() {return(mHMin);}
46 inline float FMax() {return(mFracMax);}
47 inline float FMin() {return(mFracMin);}
48 inline float LogScale() {return(mLogScale);}
49
50protected:
51 int NPixBin(PIGraphicUC* g);
52 char HPrint2(float f);
53
54 Histo2D* mHisto;
55 bool mAdDO;
56 bool mFgCol; CMapId mCmap; bool mRevCmap;
57 unsigned short mTypScal; float mLogScale;
58 unsigned short mTypDisp; float mFPoints;
59 float mHMin,mHMax;
60 float mFracMin,mFracMax;
61};
62
63////////////////////////////////////////////////////////////////////
64/*
65// NOT USED ANYMORE... KEEP IT FOR MEMORY
66class PIH2DWdg : public PIScDrawWdg {
67public:
68 PIH2DWdg(PIContainerGen *par,const char *nom,int sx=300,int sy=300,int px=0,int py=0);
69 ~PIH2DWdg();
70 void SetHisto(Histo2D* histo);
71 void SetPIHisto(PIHisto2D* pih2);
72 inline PIHisto2D* GetPIHisto() {return mPih;}
73 virtual string GetClickText(double x, double y);
74 virtual void ActivateSpecializedControls(); // Pour activer des controles specifiques
75 virtual void But3Press(int x, int y);
76protected:
77 PIHisto2D* mPih;
78};
79*/
80
81////////////////////////////////////////////////////////////////////
82class H2WinArg : public PIWindow {
83public :
84 H2WinArg(PIMsgHandler* par);
85 ~H2WinArg();
86
87 static void ShowPIHisto2DTools();
88 static void ShowPIHisto2DTools(PIBaseWdgGen* cbw);
89 static void HidePIHisto2DTools();
90 static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
91 static void SetCurrentPIHisto2D(PIHisto2D* h2ddrw);
92
93 static PIBaseWdgGen* GetCurrentBaseWdg();
94 static PIHisto2D* GetCurrentPIHisto2D();
95
96 void SetText();
97
98 virtual void Show();
99 virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL);
100
101protected:
102 static PIBaseWdgGen * mBWdg;
103 static PIHisto2D* mH2DDrw;
104
105 PIOptMenu * mOPop[3];
106 PIMenu * mCasc[2];
107 PIButton * mBut[4];
108 PILabel * mLab[4];
109 PIText * mText[3];
110 PIScale * mPScal;
111 PICheckBox* mCkb;
112
113 bool mFgCol; CMapId mCmap; bool mRevCmap;
114 unsigned short mTypScal; float mLogScale;
115 unsigned short mTypDisp; float mFPoints;
116 float mHMin,mHMax;
117 float mFracMin,mFracMax;
118};
119
120#endif
Note: See TracBrowser for help on using the repository browser.