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

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

1-/ correction bug init. sur TypScal (pb vu par Marc switch Lineaire/Log10)
2-/ Amelioration du widget d'options (clic souris 3)
3-/ reverse color map

cmv 7/1/2002

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