LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
View2D.h
Go to the documentation of this file.
1 #ifndef EVDB_VIEW2D_H
9 #define EVDB_VIEW2D_H
10 #include <list>
11 
12 class TMarker;
13 class TPolyMarker;
14 class TLine;
15 class TPolyLine;
16 class TArc;
17 class TBox;
18 class TText;
19 class TLatex;
20 
21 namespace evdb {
22  class View2D {
23  public:
24  View2D();
25  ~View2D();
26 
27  void Draw();
28  void Clear();
29 
30  // The list of object which make up the view
31  TMarker& AddMarker(double x, double y, int c, int st, double sz);
32  TPolyMarker& AddPolyMarker(int n, int c, int st, double sz);
33  TLine& AddLine(double x1, double y1, double x2, double y2);
34  TPolyLine& AddPolyLine(int n, int c, int w, int s);
35  TArc& AddArc(double x,double t,double r,double a=0.,double b=360.);
36  TBox& AddBox(double x1, double y1, double x2, double y2);
37  TText& AddText(double x, double y, const char* text);
38  TLatex& AddLatex(double x, double y, const char* text);
39 
40  private:
41  // Lists of cached drawing objects shared between all instances. Allows us
42  // to avoid costly news and deletes.
43  static std::list<TMarker*> fgMarkerL;
44  static std::list<TPolyMarker*> fgPolyMarkerL;
45  static std::list<TLine*> fgLineL;
46  static std::list<TPolyLine*> fgPolyLineL;
47  static std::list<TArc*> fgArcL;
48  static std::list<TBox*> fgBoxL;
49  static std::list<TText*> fgTextL;
50  static std::list<TLatex*> fgLatexL;
51 
52  // Lists of drawing objects currently being used by this view. Will be
53  // returned to the shared lists when done with them.
54  std::list<TMarker*> fMarkerL;
55  std::list<TPolyMarker*> fPolyMarkerL;
56  std::list<TLine*> fLineL;
57  std::list<TPolyLine*> fPolyLineL;
58  std::list<TArc*> fArcL;
59  std::list<TBox*> fBoxL;
60  std::list<TText*> fTextL;
61  std::list<TLatex*> fLatexL;
62  };
63 }
64 
65 #endif // EVDB_VIEW2D_H
66 
Float_t x
Definition: compare.C:6
TRandom r
Definition: spectrum.C:23
static std::list< TBox * > fgBoxL
Definition: View2D.h:48
Float_t y1[n_points_granero]
Definition: compare.C:5
TPolyLine & AddPolyLine(int n, int c, int w, int s)
Definition: View2D.cxx:210
Float_t x1[n_points_granero]
Definition: compare.C:5
TLine & AddLine(double x1, double y1, double x2, double y2)
Definition: View2D.cxx:187
Float_t y
Definition: compare.C:6
std::list< TBox * > fBoxL
Definition: View2D.h:59
Manage all things related to colors for the event display.
void Clear()
Definition: View2D.cxx:109
static std::list< TPolyMarker * > fgPolyMarkerL
Definition: View2D.h:44
Float_t y2[n_points_geant4]
Definition: compare.C:26
static std::list< TPolyLine * > fgPolyLineL
Definition: View2D.h:46
TBox & AddBox(double x1, double y1, double x2, double y2)
Definition: View2D.cxx:263
std::list< TPolyMarker * > fPolyMarkerL
Definition: View2D.h:55
std::list< TLatex * > fLatexL
Definition: View2D.h:61
void Draw()
Definition: View2D.cxx:89
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
Definition: View2D.cxx:157
TArc & AddArc(double x, double t, double r, double a=0., double b=360.)
Definition: View2D.cxx:238
TText & AddText(double x, double y, const char *text)
Definition: View2D.cxx:286
std::list< TArc * > fArcL
Definition: View2D.h:58
std::list< TPolyLine * > fPolyLineL
Definition: View2D.h:57
TLatex & AddLatex(double x, double y, const char *text)
Definition: View2D.cxx:308
static std::list< TLatex * > fgLatexL
Definition: View2D.h:50
std::list< TLine * > fLineL
Definition: View2D.h:56
static std::list< TMarker * > fgMarkerL
Definition: View2D.h:43
static std::list< TLine * > fgLineL
Definition: View2D.h:45
Char_t n[5]
static std::list< TArc * > fgArcL
Definition: View2D.h:47
std::list< TText * > fTextL
Definition: View2D.h:60
std::list< TMarker * > fMarkerL
Definition: View2D.h:54
Float_t x2[n_points_geant4]
Definition: compare.C:26
static std::list< TText * > fgTextL
Definition: View2D.h:49
TMarker & AddMarker(double x, double y, int c, int st, double sz)
Definition: View2D.cxx:124
Float_t w
Definition: plot.C:20