KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVCanvas.h
Go to the documentation of this file.
1 
4 #ifndef __KVCanvas_H
5 #define __KVCanvas_H
6 
7 #include "TCanvas.h"
8 #include "TH2.h"
9 #include "TGFrame.h"
10 #include "TList.h"
11 #include "TGFileDialog.h"
12 #include "TSystem.h"
13 #include "TGClient.h"
14 
53 class KVCanvas : public TCanvas {
54  friend class KVKeyHandler;
55 
56 protected:
67 
76 
81 
84 
85 public:
86  KVCanvas();
88  KVCanvas(const char* name, const char* title, Int_t ww, Int_t wh, Bool_t keyHandler = kTRUE);
89  KVCanvas(const char* name, Int_t ww, Int_t wh, Int_t winid);
90  virtual ~KVCanvas();
91 
92  void HandleInput(EEventType event, Int_t px, Int_t py);
93  Bool_t IsLogz();
94  Bool_t IsLogy();
95  Bool_t IsLogx();
96 
97  void DisableClass(const char* className);
98  void DisableObject(TObject* obj);
99  void ResetDisabledClass();
100  void ResetDisabledObject();
101 
102  void FreezCavans(Bool_t freez)
103  {
104  fFreezed = freez;
105  }
106  void ShowShortcutsInfos(); // *MENU*
107 
108  void SetVenerMode(Int_t value = 1); // *TOGGLE*
110  {
111  return fVenerMode;
112  }
113 
114  void SetEnabledShortcuts(Int_t value = 1); // *TOGGLE*
116  {
117  return fEnabledShortcuts;
118  }
119 
120 protected:
121 
123  virtual Bool_t HandleKey(Int_t, Int_t py);
124 
125  void DynamicZoom(Int_t Sign, Int_t px, Int_t py);
126  void DynamicZoomTH1(Int_t Sign, Int_t px, Int_t py);
127  void RunAutoExec();
128  void DrawEventStatus(Int_t event, Int_t px, Int_t py, TObject* selected);
129  void ZoomSelected(TH2* TheHisto);
130 
131  void MoveAxis(TAxis* ax, Int_t sign);
132  void ProfileX(TH2* hh);
133  void ProfileY(TH2* hh);
134  void ProjectionX(TH2* hh);
135  void ProjectionY(TH2* hh);
136 
137  void SaveCanvasAs();
139  TH1* FindHisto();
140 
141  void InitInfos();
142  void AddShortcutsInfo(const char* cut, const char* desc);
143 
144  ClassDef(KVCanvas, 1) //TCanvas with mouse-controlled dynamic zoom and pan & scan
145 };
146 
149 
150 #endif
EEventType
int Int_t
#define R__EXTERN
R__EXTERN TObject * gCopyObject
................ global variable
Definition: KVCanvas.h:148
bool Bool_t
double Double_t
#define ClassDef(name, id)
TCanvas with mouse-controlled dynamic zoom and pan & scan.
Definition: KVCanvas.h:53
void ShowShortcutsInfos()
Definition: KVCanvas.cpp:1107
void ProjectionY(TH2 *hh)
Definition: KVCanvas.cpp:1342
Int_t Xlast0
number of bins on x-axis, initial displayed bins
Definition: KVCanvas.h:62
TString fSavedAs
Definition: KVCanvas.h:80
Bool_t IsLogy()
Definition: KVCanvas.cpp:107
Bool_t IsLogz()
Definition: KVCanvas.cpp:98
void AddShortcutsInfo(const char *cut, const char *desc)
Definition: KVCanvas.cpp:1098
Bool_t fFreezed
Definition: KVCanvas.h:83
void MoveAxis(TAxis *ax, Int_t sign)
Definition: KVCanvas.cpp:1073
Double_t XbinPixel
Definition: KVCanvas.h:65
void FreezCavans(Bool_t freez)
Definition: KVCanvas.h:102
TList fShortCuts
Definition: KVCanvas.h:78
Double_t ymin
Definition: KVCanvas.h:57
Int_t fEnabledShortcuts
Definition: KVCanvas.h:79
TAxis * theXaxis
Definition: KVCanvas.h:64
Double_t ymax
Definition: KVCanvas.h:57
Int_t Xf1
Definition: KVCanvas.h:66
Bool_t fVenerMode
Definition: KVCanvas.h:72
Bool_t fPPressed
Definition: KVCanvas.h:69
Bool_t ExpandFunctionRange()
Definition: KVCanvas.cpp:1275
void DisableObject(TObject *obj)
Definition: KVCanvas.cpp:171
Double_t oldx
Definition: KVCanvas.h:58
Bool_t IsLogx()
Definition: KVCanvas.cpp:116
void HandleInput(EEventType event, Int_t px, Int_t py)
Definition: KVCanvas.cpp:222
Int_t X0
! variables for pan & scan
Definition: KVCanvas.h:60
void DisableClass(const char *className)
Definition: KVCanvas.cpp:140
KVCanvas()
Definition: KVCanvas.cpp:32
Int_t NdisYbins
number of displayed bins on X & Y
Definition: KVCanvas.h:61
Bool_t fHasDisabledClasses
Definition: KVCanvas.h:73
Int_t NYbins
Definition: KVCanvas.h:63
Bool_t fJPressed
Definition: KVCanvas.h:70
void ResetDisabledObject()
Definition: KVCanvas.cpp:161
void ProfileY(TH2 *hh)
Definition: KVCanvas.cpp:1180
virtual ~KVCanvas()
Definition: KVCanvas.cpp:51
TAxis * theYaxis
the axes of the histogram
Definition: KVCanvas.h:64
void RunAutoExec()
Execute the list of TExecs in the current pad.
Definition: KVCanvas.cpp:126
Int_t Ylast0
number of bins on y-axis, initial displayed bins
Definition: KVCanvas.h:63
Int_t Yfirst0
Definition: KVCanvas.h:63
void SetEnabledShortcuts(Int_t value=1)
Definition: KVCanvas.cpp:1293
TList fDisabledObjects
Definition: KVCanvas.h:77
TString fDisabledClasses
Definition: KVCanvas.h:74
void DrawEventStatus(Int_t event, Int_t px, Int_t py, TObject *selected)
Definition: KVCanvas.cpp:186
void ProfileX(TH2 *hh)
Definition: KVCanvas.cpp:1166
Double_t xmax
Definition: KVCanvas.h:57
void InitInfos()
Definition: KVCanvas.cpp:1131
Int_t NdisXbins
Definition: KVCanvas.h:61
Int_t Yf1
Definition: KVCanvas.h:66
Bool_t fAgeOfEmpire
Definition: KVCanvas.h:71
TGFrame * fKeyHandler
handler for keys
Definition: KVCanvas.h:82
Double_t xmin
Definition: KVCanvas.h:57
Int_t Xl1
Definition: KVCanvas.h:66
void ZoomSelected(TH2 *TheHisto)
Definition: KVCanvas.cpp:660
void DynamicZoomTH1(Int_t Sign, Int_t px, Int_t py)
Zoom in or out of histogram with mouse wheel.
Definition: KVCanvas.cpp:684
Int_t GetEnabledShortcuts()
Definition: KVCanvas.h:115
TH1 * FindHisto()
Definition: KVCanvas.cpp:1261
void SetVenerMode(Int_t value=1)
Definition: KVCanvas.cpp:1122
Double_t oldy
Definition: KVCanvas.h:58
Double_t YbinPixel
size of bins in pixels
Definition: KVCanvas.h:65
Int_t Xfirst0
Definition: KVCanvas.h:62
virtual Bool_t HandleKey(Int_t, Int_t py)
virtual Bool_t HandleKey(Event_t* /*event*‍/){return kTRUE;}
Definition: KVCanvas.cpp:779
void DynamicZoom(Int_t Sign, Int_t px, Int_t py)
Definition: KVCanvas.cpp:723
void ResetDisabledClass()
Definition: KVCanvas.cpp:151
Int_t Y0
coordinates of initial click in pad pixels
Definition: KVCanvas.h:60
Int_t Yl1
last modification to axis limits
Definition: KVCanvas.h:66
Int_t GetVenerMode()
Definition: KVCanvas.h:109
void SaveCanvasAs()
Definition: KVCanvas.cpp:1200
Int_t NXbins
Definition: KVCanvas.h:62
Bool_t fHasDisabledObject
Definition: KVCanvas.h:75
void ProjectionX(TH2 *hh)
Definition: KVCanvas.cpp:1302
Bool_t moved
Definition: KVCanvas.h:68
Utility class to redirect keyboard events to KVCanvas.
Definition: KVKeyHandler.h:19
int Sign(const T &x)