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

Last change on this file since 1880 was 1880, checked in by ansari, 24 years ago

Adaptation/implementation de la methode PIDrawer/PIHisto2D::GetClickInfo() - Reza 21/01/2002

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