GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Marker.h
Go to the documentation of this file.
1 // $Id: TGo4Marker.h 2852 2020-05-18 14:01:41Z linev $
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 fuer 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 #include "TString.h"
19 
20 class TGo4MarkerPainter;
21 class TH1;
22 class TVirtualPad;
23 
32 class TGo4Marker : public TMarker {
33 
34 public:
35  TGo4Marker();
36  TGo4Marker(Double_t x, Double_t y, Int_t style);
37  virtual ~TGo4Marker();
38 
41  virtual void Print(Option_t* opt="") const;
43  void PrintMarker(Option_t* opt="");
44 
46  virtual void Paint(Option_t* opt="");
47 
49  virtual void Draw(Option_t* opt="");
50 
52  virtual void UnDraw(Option_t* opt="");
53 
55  virtual void Pop();
56 
58  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
59 
62 
63  void DeletePainter();
64 
65  void SetVisible(Bool_t on) { fbVisible = on; }
66  Bool_t IsVisible() { return fbVisible; }
67  virtual void SetName(const char *name) { fxName = name; } // *MENU*
68  // void DeleteMarker(); // *MENU*
69 
71  void SetToBin(Int_t xbin, Int_t ybin = 0); // *MENU*
72  void SetLabelDraw(Bool_t on) { fbHasLabel = on; } // // *TOGGLE* *GETTER=HasLabel
73  Bool_t HasLabel() { return fbHasLabel; }
74  void SetLineDraw(Bool_t on) { fbHasConnector = on; } // *TOGGLE* *GETTER=HasConnector
75  Bool_t HasConnector() { return fbHasConnector; }
76  void SetXDraw(Bool_t on) { fbXDraw = on; } // *TOGGLE* *GETTER=IsXDraw
77  Bool_t IsXDraw() { return fbXDraw; }
78  void SetYDraw(Bool_t on) { fbYDraw = on; } // *TOGGLE* *GETTER=IsYDraw
79  Bool_t IsYDraw() { return fbYDraw; }
80  void SetXbinDraw(Bool_t on) { fbXbinDraw = on; } // *TOGGLE* *GETTER=IsXbinDraw
81  Bool_t IsXbinDraw() { return fbXbinDraw; }
82  void SetYbinDraw(Bool_t on) { fbYbinDraw = on; } // *TOGGLE* *GETTER=IsYbinDraw
83  Bool_t IsYbinDraw() { return fbYbinDraw; }
84  void SetContDraw(Bool_t on) { fbContDraw = on; } // *TOGGLE* *GETTER=IsContDraw
85  Bool_t IsContDraw() { return fbContDraw; }
86 
87  const char* GetNumFormat(){return fxNumFormat.Data();}
88  void SetNumFormat(const char* fmt="%.4E"){fxNumFormat=fmt;}// *MENU*
89 
91  void SaveLabelStyle();// *MENU*
92 
94  void ResetLabel();// *MENU*
95 
97  void InitLabelStyle();
98 
99  void SetHistogram(TH1* histo);
100  TH1* GetHistogram() const { return fxHisto; }
101 
103  virtual const char* GetName() const { return fxName.Data(); }
104 
105  void SetXY(Double_t x, Double_t y)
106  {
107  SetX(x);
108  SetY(y);
109  }
110 
112  Int_t GetXbin();
114  Int_t GetYbin();
116  Int_t GetCont();
118  Double_t GetLabelX();
120  Double_t GetLabelY();
121 
122  static Int_t GetInstances();
123 
124  TVirtualPad* GetDrawPad() { return fxDrawPad; }
125 
127  Bool_t CheckDrawPad();
129  Bool_t CheckHistogram();
130 
132  static Bool_t fgbHASLABEL;
133 
135  static Bool_t fgbHASCONNECTOR;
136 
138  static Bool_t fgbXDRAW;
139 
141  static Bool_t fgbYDRAW;
142 
144  static Bool_t fgbXBINDRAW;
145 
147  static Bool_t fgbYBINDRAW;
148 
150  static Bool_t fgbCONTDRAW;
151 
153  static TString fgxNUMFORMAT;
154 
155  static void SetGlobalStyle(Bool_t HASLABEL, Bool_t HASCONNECTOR, Bool_t XDRAW, Bool_t YDRAW,
156  Bool_t XBINDRAW,Bool_t YBINDRAW,Bool_t CONTDRAW, const char *NUMFORMAT);
157 
158  static void GetGlobalStyle(Bool_t &HASLABEL, Bool_t &HASCONNECTOR, Bool_t &XDRAW, Bool_t &YDRAW,
159  Bool_t &XBINDRAW, Bool_t &YBINDRAW, Bool_t &CONTDRAW, TString &NUMFORMAT);
160 
161 protected:
162 
167 
168  void SetPainted(Bool_t on) { fbIsPainted=on; }
169  Bool_t IsPainted() { return fbIsPainted; }
170 
171  void SetDrawPad(TVirtualPad* pad);
172 
173 
174 private:
175 
177  TString fxName;
178 
181  Bool_t fbIsPainted;
182 
184  Bool_t fbVisible;
185 
187  Bool_t fbHasLabel;
188 
191 
193  Bool_t fbXDraw;
194 
196  Bool_t fbYDraw;
197 
199  Bool_t fbXbinDraw;
200 
202  Bool_t fbYbinDraw;
203 
205  Bool_t fbContDraw;
206 
208  TString fxNumFormat;
209 
211  TH1* fxHisto;
212 
215  TVirtualPad* fxDrawPad;
216 
218  static UInt_t fguInstanceCounter;
219 
220 ClassDef(TGo4Marker,1)
221 };
222 
223 #endif //TGO4MARKER_H
224 
Bool_t IsVisible()
Definition: TGo4Marker.h:66
TString fxNumFormat
Definition: TGo4Marker.h:208
void SetDrawPad(TVirtualPad *pad)
Definition: TGo4Marker.cxx:73
static Bool_t fgbHASCONNECTOR
Definition: TGo4Marker.h:135
Bool_t fbVisible
Definition: TGo4Marker.h:184
virtual const char * GetName() const
Definition: TGo4Marker.h:103
void SetLabelDraw(Bool_t on)
Definition: TGo4Marker.h:72
void SetXbinDraw(Bool_t on)
Definition: TGo4Marker.h:80
virtual void Pop()
Definition: TGo4Marker.cxx:137
static Bool_t fgbCONTDRAW
Definition: TGo4Marker.h:150
Bool_t IsPainted()
Definition: TGo4Marker.h:169
void SetYbinDraw(Bool_t on)
Definition: TGo4Marker.h:82
Int_t GetCont()
Definition: TGo4Marker.cxx:194
void ResetLabel()
Definition: TGo4Marker.cxx:310
void SetToBin(Int_t xbin, Int_t ybin=0)
Definition: TGo4Marker.cxx:161
virtual void Paint(Option_t *opt="")
Definition: TGo4Marker.cxx:94
Bool_t fbXbinDraw
Definition: TGo4Marker.h:199
void SetXDraw(Bool_t on)
Definition: TGo4Marker.h:76
static Int_t GetInstances()
Definition: TGo4Marker.cxx:37
virtual void Print(Option_t *opt="") const
Definition: TGo4Marker.cxx:225
Int_t GetXbin()
Definition: TGo4Marker.cxx:178
void SetHistogram(TH1 *histo)
Definition: TGo4Marker.cxx:83
void SetNumFormat(const char *fmt="%.4E")
Definition: TGo4Marker.h:88
static Bool_t fgbXDRAW
Definition: TGo4Marker.h:138
void SaveLabelStyle()
Definition: TGo4Marker.cxx:258
Bool_t CheckHistogram()
Definition: TGo4Marker.cxx:88
static Bool_t fgbYBINDRAW
Definition: TGo4Marker.h:147
virtual void SetName(const char *name)
Definition: TGo4Marker.h:67
Bool_t HasConnector()
Definition: TGo4Marker.h:75
void SetPainted(Bool_t on)
Definition: TGo4Marker.h:168
TH1 * GetHistogram() const
Definition: TGo4Marker.h:100
TVirtualPad * GetDrawPad()
Definition: TGo4Marker.h:124
static void SetGlobalStyle(Bool_t HASLABEL, Bool_t HASCONNECTOR, Bool_t XDRAW, Bool_t YDRAW, Bool_t XBINDRAW, Bool_t YBINDRAW, Bool_t CONTDRAW, const char *NUMFORMAT)
Definition: TGo4Marker.cxx:282
virtual TGo4MarkerPainter * CreatePainter()
Definition: TGo4Marker.cxx:154
Int_t GetYbin()
Definition: TGo4Marker.cxx:186
TGo4MarkerPainter * fxPainter
Definition: TGo4Marker.h:166
TH1 * fxHisto
Definition: TGo4Marker.h:211
virtual void Draw(Option_t *opt="")
Definition: TGo4Marker.cxx:110
Bool_t HasLabel()
Definition: TGo4Marker.h:73
void DeletePainter()
Definition: TGo4Marker.cxx:318
Bool_t fbYbinDraw
Definition: TGo4Marker.h:202
void SetContDraw(Bool_t on)
Definition: TGo4Marker.h:84
Bool_t fbContDraw
Definition: TGo4Marker.h:205
virtual void UnDraw(Option_t *opt="")
Definition: TGo4Marker.cxx:124
Double_t GetLabelY()
Definition: TGo4Marker.cxx:212
void PrintMarker(Option_t *opt="")
Definition: TGo4Marker.cxx:236
const char * GetNumFormat()
Definition: TGo4Marker.h:87
static Bool_t fgbYDRAW
Definition: TGo4Marker.h:141
Bool_t fbXDraw
Definition: TGo4Marker.h:193
void SetVisible(Bool_t on)
Definition: TGo4Marker.h:65
static UInt_t fguInstanceCounter
Definition: TGo4Marker.h:218
Bool_t IsXDraw()
Definition: TGo4Marker.h:77
Bool_t fbHasConnector
Definition: TGo4Marker.h:190
void SetXY(Double_t x, Double_t y)
Definition: TGo4Marker.h:105
Bool_t IsYbinDraw()
Definition: TGo4Marker.h:83
static Bool_t fgbXBINDRAW
Definition: TGo4Marker.h:144
static TString fgxNUMFORMAT
Definition: TGo4Marker.h:153
Double_t GetLabelX()
Definition: TGo4Marker.cxx:203
Bool_t IsXbinDraw()
Definition: TGo4Marker.h:81
static Bool_t fgbHASLABEL
Definition: TGo4Marker.h:132
static void GetGlobalStyle(Bool_t &HASLABEL, Bool_t &HASCONNECTOR, Bool_t &XDRAW, Bool_t &YDRAW, Bool_t &XBINDRAW, Bool_t &YBINDRAW, Bool_t &CONTDRAW, TString &NUMFORMAT)
Definition: TGo4Marker.cxx:296
Bool_t fbHasLabel
Definition: TGo4Marker.h:187
void SetLineDraw(Bool_t on)
Definition: TGo4Marker.h:74
TString fxName
Definition: TGo4Marker.h:177
TVirtualPad * fxDrawPad
Definition: TGo4Marker.h:215
void SetYDraw(Bool_t on)
Definition: TGo4Marker.h:78
Bool_t CheckDrawPad()
Definition: TGo4Marker.cxx:78
void InitLabelStyle()
Definition: TGo4Marker.cxx:270
Bool_t IsContDraw()
Definition: TGo4Marker.h:85
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition: TGo4Marker.cxx:143
Bool_t IsYDraw()
Definition: TGo4Marker.h:79
Bool_t fbIsPainted
Definition: TGo4Marker.h:181
Bool_t fbYDraw
Definition: TGo4Marker.h:196
virtual ~TGo4Marker()
Definition: TGo4Marker.cxx:66