GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Marker.h
Go to the documentation of this file.
1 // $Id: TGo4Marker.h 878 2012-08-22 15:36:25Z adamczew $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4MARKER_H
15 #define TGO4MARKER_H
16 
17 #include "TMarker.h"
18 
19 class TGo4MarkerPainter;
20 class TH1;
21 class TVirtualPad;
22 
31 class
32 
33 #ifndef __CINT__
34 #ifdef WIN32
35 #ifndef BUILDING_GO4BASE_DLL
36 __declspec(dllimport)
37 #endif
38 #endif
39 #endif
40 
41 TGo4Marker : public TMarker {
42 
43 public:
44  TGo4Marker();
45  TGo4Marker(Double_t x, Double_t y, Int_t style);
46  virtual ~TGo4Marker();
47 
50  virtual void Print(Option_t* opt="") const;
52  void PrintMarker(Option_t* opt="");
53 
55  virtual void Paint(Option_t* opt="");
56 
58  virtual void Draw(Option_t* opt="");
59 
61  virtual void UnDraw(Option_t* opt="");
62 
64  virtual void Pop();
65 
66 
68  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
69 
70 
71 
73  virtual TGo4MarkerPainter* CreatePainter();
74 
75 
76  void SetVisible(Bool_t on){fbVisible=on;}
77  Bool_t IsVisible(){return fbVisible;}
78  virtual void SetName(const char* name){fxName=name;} // *MENU*
79  //void DeleteMarker(); // *MENU*
80 
82  void SetToBin(Int_t xbin, Int_t ybin=0); // *MENU*
83  void SetLabelDraw(Bool_t on){fbHasLabel=on;} // *MENU*
84  Bool_t HasLabel(){return fbHasLabel;}
85  void SetLineDraw(Bool_t on){fbHasConnector=on;} // *MENU*
86  Bool_t HasConnector(){return fbHasConnector;}
87  void SetXDraw(Bool_t on){fbXDraw=on;}// *MENU*
88  Bool_t IsXDraw(){return fbXDraw;}
89  void SetYDraw(Bool_t on){fbYDraw=on;}// *MENU*
90  Bool_t IsYDraw(){return fbYDraw;}
91  void SetXbinDraw(Bool_t on){fbXbinDraw=on;}// *MENU*
92  Bool_t IsXbinDraw(){return fbXbinDraw;}
93  void SetYbinDraw(Bool_t on){fbYbinDraw=on;}// *MENU*
94  Bool_t IsYbinDraw(){return fbYbinDraw;}
95  void SetContDraw(Bool_t on){fbContDraw=on;}// *MENU*
96  Bool_t IsContDraw(){return fbContDraw;}
97 
98  const char* GetNumFormat(){return fxNumFormat.Data();}
99  void SetNumFormat(const char* fmt="%.4E"){fxNumFormat=fmt;}// *MENU*
100 
101 
102 
104  void SaveLabelStyle();// *MENU*
105 
107  void ResetLabel();// *MENU*
108 
110  void InitLabelStyle();
111 
112  void SetHistogram(TH1* histo);
113  TH1* GetHistogram() const { return fxHisto; }
114 
116  virtual const char* GetName() const {return fxName.Data();}
117 
119  Int_t GetXbin();
121  Int_t GetYbin();
123  Int_t GetCont();
125  Double_t GetLabelX();
127  Double_t GetLabelY();
128 
129  static Int_t GetInstances(){return fguInstanceCounter;}
130 
131  TVirtualPad* GetDrawPad(){return fxDrawPad;}
132 
134  Bool_t CheckDrawPad();
136  Bool_t CheckHistogram();
137 
138  void DeletePainter();
139 
141  static Bool_t fgbHASLABEL;
142 
144  static Bool_t fgbHASCONNECTOR;
145 
147  static Bool_t fgbXDRAW;
148 
150  static Bool_t fgbYDRAW;
151 
153  static Bool_t fgbXBINDRAW;
154 
156  static Bool_t fgbYBINDRAW;
157 
159  static Bool_t fgbCONTDRAW;
160 
162  static TString fgxNUMFORMAT;
163 
164 protected:
165 
170 
171  void SetPainted(Bool_t on) { fbIsPainted=on; }
172  Bool_t IsPainted() { return fbIsPainted; }
173 
174  void SetDrawPad(TVirtualPad* pad);
175 
176 
177 private:
178 
180  TString fxName;
181 
184  Bool_t fbIsPainted;
185 
187  Bool_t fbVisible;
188 
190  Bool_t fbHasLabel;
191 
194 
196  Bool_t fbXDraw;
197 
199  Bool_t fbYDraw;
200 
202  Bool_t fbXbinDraw;
203 
205  Bool_t fbYbinDraw;
206 
208  Bool_t fbContDraw;
209 
211  TString fxNumFormat;
212 
214  TH1* fxHisto;
215 
218  TVirtualPad* fxDrawPad;
219 
221  static UInt_t fguInstanceCounter;
222 
223 ClassDef(TGo4Marker,1)
224 };
225 
226 #endif //TGO4MARKER_H
227 
Bool_t IsVisible()
Definition: TGo4Marker.h:77
TString fxNumFormat
Definition: TGo4Marker.h:211
static Bool_t fgbHASCONNECTOR
Definition: TGo4Marker.h:144
Bool_t fbVisible
Definition: TGo4Marker.h:187
virtual const char * GetName() const
Definition: TGo4Marker.h:116
void SetLabelDraw(Bool_t on)
Definition: TGo4Marker.h:83
void SetXbinDraw(Bool_t on)
Definition: TGo4Marker.h:91
static Bool_t fgbCONTDRAW
Definition: TGo4Marker.h:159
Bool_t IsPainted()
Definition: TGo4Marker.h:172
void SetYbinDraw(Bool_t on)
Definition: TGo4Marker.h:93
Bool_t fbXbinDraw
Definition: TGo4Marker.h:202
void SetXDraw(Bool_t on)
Definition: TGo4Marker.h:87
void SetNumFormat(const char *fmt="%.4E")
Definition: TGo4Marker.h:99
static Bool_t fgbXDRAW
Definition: TGo4Marker.h:147
static Bool_t fgbYBINDRAW
Definition: TGo4Marker.h:156
virtual void SetName(const char *name)
Definition: TGo4Marker.h:78
Bool_t HasConnector()
Definition: TGo4Marker.h:86
void SetPainted(Bool_t on)
Definition: TGo4Marker.h:171
TH1 * GetHistogram() const
Definition: TGo4Marker.h:113
TVirtualPad * GetDrawPad()
Definition: TGo4Marker.h:131
TGo4MarkerPainter * fxPainter
Definition: TGo4Marker.h:169
TH1 * fxHisto
Definition: TGo4Marker.h:214
Bool_t HasLabel()
Definition: TGo4Marker.h:84
Bool_t fbYbinDraw
Definition: TGo4Marker.h:205
void SetContDraw(Bool_t on)
Definition: TGo4Marker.h:95
Bool_t fbContDraw
Definition: TGo4Marker.h:208
const char * GetNumFormat()
Definition: TGo4Marker.h:98
static Bool_t fgbYDRAW
Definition: TGo4Marker.h:150
Bool_t fbXDraw
Definition: TGo4Marker.h:196
void SetVisible(Bool_t on)
Definition: TGo4Marker.h:76
static UInt_t fguInstanceCounter
Definition: TGo4Marker.h:221
Bool_t IsXDraw()
Definition: TGo4Marker.h:88
Bool_t fbHasConnector
Definition: TGo4Marker.h:193
Bool_t IsYbinDraw()
Definition: TGo4Marker.h:94
static Bool_t fgbXBINDRAW
Definition: TGo4Marker.h:153
static TString fgxNUMFORMAT
Definition: TGo4Marker.h:162
Bool_t IsXbinDraw()
Definition: TGo4Marker.h:92
static Bool_t fgbHASLABEL
Definition: TGo4Marker.h:141
Bool_t fbHasLabel
Definition: TGo4Marker.h:190
void SetLineDraw(Bool_t on)
Definition: TGo4Marker.h:85
static Int_t GetInstances()
Definition: TGo4Marker.h:129
TString fxName
Definition: TGo4Marker.h:180
TVirtualPad * fxDrawPad
Definition: TGo4Marker.h:218
void SetYDraw(Bool_t on)
Definition: TGo4Marker.h:89
Bool_t IsContDraw()
Definition: TGo4Marker.h:96
Bool_t IsYDraw()
Definition: TGo4Marker.h:90
Bool_t fbIsPainted
Definition: TGo4Marker.h:184
Bool_t fbYDraw
Definition: TGo4Marker.h:199