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

Last change on this file since 2606 was 2523, checked in by cmv, 22 years ago

OptionToString cmv 19/03/04

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