Ortho3DPad.h
Go to the documentation of this file.
1 ///
2 /// \file Ortho3DPad.h
3 /// \brief Drawing pad showing an orthographic projection of 3D objects
4 /// in the detector
5 /// \author greenlee@fnal.gov
6 ///
7 
8 #ifndef EVD_ORTHO3DPAD_H
9 #define EVD_ORTHO3DPAD_H
10 
13 #include "RQ_OBJECT.h"
14 #include <vector>
15 
16 #include "TBox.h"
17 class TH1F;
18 class TGNumberEntry;
19 
20 namespace evdb { class View2D; }
21 
22 namespace evd {
23 
24  /// A drawing pad showing an orthographic rendering of 3D objects.
25 
26  class Ortho3DPad : public DrawingPad {
27  public:
28 
29  // So this class can receive gui signals.
30 
31  RQ_OBJECT("evd::Ortho3DPad")
32 
33  public:
34 
35  // Constructor, destructor.
36 
37  Ortho3DPad(const char* nm, const char* ti,
38  evd::OrthoProj_t proj,
39  double x1, double y1,
40  double x2, double y2);
41  ~Ortho3DPad();
42 
43  // Accessors.
44 
45  double GetMarkerSize() const {return 4.*fMSize;} // Size in pixels.
46 
47  // Methods.
48 
49  void Draw(const char* opt=0);
50  void SetZoom(double xlo, double ylo, double xhi, double yhi, bool update);
51  void UnZoom(bool update);
52  void SetMarkerSize(double size, bool update); // Size in pixels.
53 
54  // Widget-related methods.
55 
56  void SetMSizeEntry(TGNumberEntry* p); // Add number entry widget.
57  void SetMSize(); // Slot for marker size signals.
58 
59  // Handler for mouse events.
60 
61  static void MouseEvent(evd::Ortho3DPad* p);
62  void MouseEvent();
63 
64  private:
65 
66  // Static attributes.
67 
68  static Ortho3DPad* fMousePad; ///< Selected pad for mouse action.
69 
70  // Attributes.
71 
72  TH1F* fHisto; ///< Enclosing histogram.
73  evd::OrthoProj_t fProj; ///< Projection.
74  double fXLo; ///< Low x value.
75  double fXHi; ///< High x value.
76  double fYLo; ///< Low y value.
77  double fYHi; ///< High y value.
78  double fMSize; ///< Marker size.
79  std::vector<TBox> TPCBox; ///< TPC box
80  evdb::View2D* fView; ///< Collection of graphics objects to render
81 
82  // Widgets.
83 
84  TGNumberEntry* fMSizeEntry; ///< For changing marker size.
85 
86  // Mouse/zoom status attributes.
87 
88  bool fPress; ///< Is button 1 pressed?
89  bool fBoxDrawn; ///< Is selection box drawn?
90  int fPressPx; ///< Pixel location where button 1 was pressed.
91  int fPressPy; ///< Poxel location where button 1 was pressed.
92  int fCurrentPx; ///< Current pixel location of mouse.
93  int fCurrentPy; ///< Current pixel location of mouse.
94  double fPressX; ///< User location where button 1 was pressed.
95  double fPressY; ///< User location where button 1 was pressed.
96  double fReleaseX; ///< User location where button 1 was released.
97  double fReleaseY; ///< User location where button 1 was released.
98  };
99 }
100 
101 #endif
102 ////////////////////////////////////////////////////////////////////////
double fXHi
High x value.
Definition: Ortho3DPad.h:75
int fPressPy
Poxel location where button 1 was pressed.
Definition: Ortho3DPad.h:91
Define OrthoProj_t enum for selecting orthographic view.
double fReleaseX
User location where button 1 was released.
Definition: Ortho3DPad.h:96
opt
Definition: train.py:196
double fYHi
High y value.
Definition: Ortho3DPad.h:77
A drawing pad showing an orthographic rendering of 3D objects.
Definition: Ortho3DPad.h:26
int fCurrentPy
Current pixel location of mouse.
Definition: Ortho3DPad.h:93
int fPressPx
Pixel location where button 1 was pressed.
Definition: Ortho3DPad.h:90
OrthoProj_t
Definition: OrthoProj.h:12
double fXLo
Low x value.
Definition: Ortho3DPad.h:74
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
double fReleaseY
User location where button 1 was released.
Definition: Ortho3DPad.h:97
LArSoft includes.
Definition: InfoTransfer.h:33
evd::OrthoProj_t fProj
Projection.
Definition: Ortho3DPad.h:73
bool fBoxDrawn
Is selection box drawn?
Definition: Ortho3DPad.h:89
double fYLo
Low y value.
Definition: Ortho3DPad.h:76
Base class for event display drawing pads.
Definition: DrawingPad.h:29
p
Definition: test.py:223
void Draw(const char *plot, const char *title)
Definition: gXSecComp.cxx:580
double fPressX
User location where button 1 was pressed.
Definition: Ortho3DPad.h:94
double fPressY
User location where button 1 was pressed.
Definition: Ortho3DPad.h:95
int fCurrentPx
Current pixel location of mouse.
Definition: Ortho3DPad.h:92
std::vector< TBox > TPCBox
TPC box.
Definition: Ortho3DPad.h:79
double GetMarkerSize() const
Definition: Ortho3DPad.h:45
TH1F * fHisto
Enclosing histogram.
Definition: Ortho3DPad.h:72
bool fPress
Is button 1 pressed?
Definition: Ortho3DPad.h:88
static Ortho3DPad * fMousePad
Selected pad for mouse action.
Definition: Ortho3DPad.h:68
TGNumberEntry * fMSizeEntry
For changing marker size.
Definition: Ortho3DPad.h:84
evdb::View2D * fView
Collection of graphics objects to render.
Definition: Ortho3DPad.h:80
double fMSize
Marker size.
Definition: Ortho3DPad.h:78