DrawingPad.cxx
Go to the documentation of this file.
1 ///
2 /// \file DrawingPad.cxx
3 /// \brief Base class for all event display drawing pads
4 /// \author messier@indiana.edu
5 /// \version $Id: DrawingPad.cxx,v 1.2 2010/11/11 18:11:22 p-novaart Exp $:
6 ///
8 #include <iostream>
9 #include <vector>
10 #include "TPad.h"
11 #include "nuevdb/EventDisplayBase/evdb.h"
18 
21 
22 namespace gar {
23 namespace evd{
24 
25  // Declare singleton HitSelector
26 
27  HitSelector * gTheHitSelector;
28 
29  /// Create a drawing pad for the event display
30  ///
31  /// @param nm : Name of the TPad
32  /// @param ti : Title of the TPad
33  /// @param x1 : Relative x position (0-1) of lower left corner
34  /// @param y1 : Relative y position (0-1) of lower left corner
35  /// @param x2 : Relative x position (0-1) of upper right corner
36  /// @param y2 : Relative y position (0-1) of upper right corner
37  ///
39  const char* ti,
40  double x1, double y1,
41  double x2, double y2)
42  : fPad(0)
43  , fHeaderDraw(0) //Every pointer checked for a 0 value in the destructor should be set to 0 here. aoliv23@lsu.edu
44  , fGeometryDraw(0)
45  , fSimulationDraw(0)
46  , fRawDataDraw(0)
47  , fRecoBaseDraw(0)
48  , fAnalysisBaseDraw(0)
49  {
50  fPad = new TPad(nm,ti,x1,y1,x2,y2);
51  fPad->Draw();
52  fPad->cd();
53  }
54 
55  //......................................................................
56 
58  {
59  if (fHeaderDraw) { delete fHeaderDraw; fHeaderDraw = 0; }
60  if (fGeometryDraw) { delete fGeometryDraw; fGeometryDraw = 0; }
61  if (fSimulationDraw) { delete fSimulationDraw; fSimulationDraw = 0; }
62  if (fRawDataDraw) { delete fRawDataDraw; fRawDataDraw = 0; }
63  if (fRecoBaseDraw) { delete fRecoBaseDraw; fRecoBaseDraw = 0; }
65  // if (fHitSelector) { delete fHitSelector; fHitSelector = 0; }
66  if (fPad) { delete fPad; fPad = 0; }
67  }
68 
69  // //......................................................................
70 
71  //......................................................................
72 
73  ///
74  /// Provide access to the drawer for the detector geometry
75  ///
77  {
78  if (fHeaderDraw==0) fHeaderDraw = new HeaderDrawer();
79  return fHeaderDraw;
80  }
81 
82  ///
83  /// Provide access to the drawer for the detector geometry
84  ///
86  {
88  return fGeometryDraw;
89  }
90 
91  ///
92  /// Provide access to the drawer for the Simulation classes
93  ///
95  {
97  return fSimulationDraw;
98 
99  }
100 
101  ///
102  /// Provide access to the drawer for the RawData classes
103  ///
105  {
106  if (fRawDataDraw==0) fRawDataDraw = new RawDataDrawer();
107  return fRawDataDraw;
108  }
109 
110  //......................................................................
111 
112  ///
113  /// Provide access to the drawer for RecoBase classes
114  ///
116  {
118  return fRecoBaseDraw;
119 
120  }
121 
122  //......................................................................
123 
124  ///
125  /// Provide access to the drawer for AnalysisBase classes
126  ///
128  {
130  return fAnalysisBaseDraw;
131  }
132 
133  //......................................................................
134  //......................................................................
135 
136 }
137 }// namespace
138 ////////////////////////////////////////////////////////////////////////
HitSelector * gTheHitSelector
Definition: DrawingPad.cxx:27
HeaderDrawer * HeaderDraw()
Definition: DrawingPad.cxx:76
GeometryDrawer * fGeometryDraw
Drawer for detector geometry.
Definition: DrawingPad.h:44
SimulationDrawer * SimulationDraw()
Definition: DrawingPad.cxx:94
Aid in the rendering of AnalysisBase objects.
SimulationDrawer * fSimulationDraw
Drawer for simulation objects.
Definition: DrawingPad.h:45
RawDataDrawer * fRawDataDraw
Drawer for raw data.
Definition: DrawingPad.h:46
TPad * fPad
The ROOT graphics pad.
Definition: DrawingPad.h:42
DrawingPad(const char *nm, const char *ti, double x1, double y1, double y2, double x2)
Definition: DrawingPad.cxx:38
GeometryDrawer * GeometryDraw()
Definition: DrawingPad.cxx:85
RawDataDrawer * RawDataDraw()
Definition: DrawingPad.cxx:104
RecoBaseDrawer * fRecoBaseDraw
Drawer for recobase objects.
Definition: DrawingPad.h:47
LArSoft includes.
Definition: InfoTransfer.h:33
Aid in the rendering of RecoBase objects.
HeaderDrawer * fHeaderDraw
Drawer for event header info.
Definition: DrawingPad.h:43
Aid in the rendering of Geometry objects.
Class to aid in the rendering of Geometry objects.
General GArSoft Utilities.
AnalysisBaseDrawer * AnalysisBaseDraw()
Definition: DrawingPad.cxx:127
RecoBaseDrawer * RecoBaseDraw()
Definition: DrawingPad.cxx:115
AnalysisBaseDrawer * fAnalysisBaseDraw
Drawer for analysisbase objects.
Definition: DrawingPad.h:48
Aid in the rendering of RawData objects.
Definition: RawDataDrawer.h:27