KaliVeda
Toolkit for HIC analysis
KVCanvas.h
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 
54 class KVCanvas : public TCanvas {
55  friend class KVKeyHandler;
56 
57 protected:
58  Double_t xmin, xmax, ymin, ymax;
59  Double_t oldx, oldy;
61  Int_t X0, Y0;
62  Int_t NdisXbins, NdisYbins;
63  Int_t NXbins, Xfirst0, Xlast0;
64  Int_t NYbins, Yfirst0, Ylast0;
65  TAxis* theXaxis, *theYaxis;
66  Double_t XbinPixel, YbinPixel;
67  Int_t Xf1, Xl1, Yf1, Yl1;
68 
69  Bool_t moved;
70  Bool_t fPPressed;
71  Bool_t fJPressed;
72  Bool_t fAgeOfEmpire;
73  Bool_t fVenerMode;
74  Bool_t fHasDisabledClasses;
75  TString fDisabledClasses;
76  Bool_t fHasDisabledObject;
77 
78  TList fDisabledObjects;
79  TList fShortCuts;
80  Int_t fEnabledShortcuts;
81  TString fSavedAs;
82 
83  TGFrame* fKeyHandler;
84  Bool_t fFreezed;
85 
86 public:
87  KVCanvas();
89  KVCanvas(const char* name, const char* title, Int_t ww, Int_t wh, Bool_t keyHandler = kTRUE);
90  KVCanvas(const char* name, Int_t ww, Int_t wh, Int_t winid);
91  virtual ~KVCanvas();
92 
93  void HandleInput(EEventType event, Int_t px, Int_t py) override;
94  Bool_t IsLogz();
95  Bool_t IsLogy();
96  Bool_t IsLogx();
97 
98  void DisableClass(const char* className);
99  void DisableObject(TObject* obj);
100  void ResetDisabledClass();
101  void ResetDisabledObject();
102 
103  void FreezCavans(Bool_t freez)
104  {
105  fFreezed = freez;
106  }
107  void ShowShortcutsInfos(); // *MENU*
108 
109  void SetVenerMode(Int_t value = 1); // *TOGGLE*
111  {
112  return fVenerMode;
113  }
114 
115  void SetEnabledShortcuts(Int_t value = 1); // *TOGGLE*
117  {
118  return fEnabledShortcuts;
119  }
120 
121 protected:
122 
124  virtual Bool_t HandleKey(Int_t, Int_t py);
125 
126  void DynamicZoom(Int_t Sign, Int_t px, Int_t py);
127  void DynamicZoomTH1(Int_t Sign, Int_t px, Int_t py);
128  void RunAutoExec();
129  void DrawEventStatus(Int_t event, Int_t px, Int_t py, TObject* selected);
130  void ZoomSelected(TH2* TheHisto);
131 
132  void MoveAxis(TAxis* ax, Int_t sign);
133  void ProfileX(TH2* hh);
134  void ProfileY(TH2* hh);
135  void ProjectionX(TH2* hh);
136  void ProjectionY(TH2* hh);
137 
138  void SaveCanvasAs();
139  Bool_t ExpandFunctionRange();
140  TH1* FindHisto();
141 
142  void InitInfos();
143  void AddShortcutsInfo(const char* cut, const char* desc);
144 
145  ClassDefOverride(KVCanvas, 1) //TCanvas with mouse-controlled dynamic zoom and pan & scan
146 };
147 
149 R__EXTERN TObject* gCopyObject;
150 
151 #endif
EEventType
int Int_t
#define R__EXTERN
bool Bool_t
double Double_t
#define ClassDefOverride(name, id)
TCanvas with mouse-controlled dynamic zoom and pan & scan.
Definition: KVCanvas.h:54
void ShowShortcutsInfos()
Definition: KVCanvas.cpp:1106
Bool_t IsLogy()
Definition: KVCanvas.cpp:106
Bool_t IsLogz()
Definition: KVCanvas.cpp:97
void FreezCavans(Bool_t freez)
Definition: KVCanvas.h:103
void DisableObject(TObject *obj)
Definition: KVCanvas.cpp:170
Bool_t IsLogx()
Definition: KVCanvas.cpp:115
void HandleInput(EEventType event, Int_t px, Int_t py) override
Definition: KVCanvas.cpp:221
void DisableClass(const char *className)
Definition: KVCanvas.cpp:139
KVCanvas()
Definition: KVCanvas.cpp:32
void ResetDisabledObject()
Definition: KVCanvas.cpp:160
virtual ~KVCanvas()
Definition: KVCanvas.cpp:51
void SetEnabledShortcuts(Int_t value=1)
Definition: KVCanvas.cpp:1292
Int_t GetEnabledShortcuts()
Definition: KVCanvas.h:116
void SetVenerMode(Int_t value=1)
Definition: KVCanvas.cpp:1121
void ResetDisabledClass()
Definition: KVCanvas.cpp:150
Int_t GetVenerMode()
Definition: KVCanvas.h:110
Utility class to redirect keyboard events to KVCanvas.
Definition: KVKeyHandler.h:20
Bool_t HandleKey(Event_t *event) override
void SetCanvas(KVCanvas* Canvas){};
int Sign(const T &x)