LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
GeoAABox.h
Go to the documentation of this file.
1 
14 #ifndef BASICTOOL_GEOAABOX_H
15 #define BASICTOOL_GEOAABOX_H
16 
17 #include "larcorealg/GeoAlgo/GeoVector.h" // for Point_t, Vector_t
18 
19 namespace geoalgo {
34  class AABox {
35 
36  public:
38  AABox();
39 
41  virtual ~AABox(){};
42 
44  AABox(double const x_min,
45  double const y_min,
46  double const z_min,
47  double const x_max,
48  double const y_max,
49  double const z_max);
50 
52  AABox(Point_t const& min, Vector_t const& max);
53 
54  //
55  // Attribute accessor
56  //
57  Point_t const& Min() const;
58  Point_t const& Max() const;
59  void Min(double const x, double const y, double const z);
60  void Max(double const x, double const y, double const z);
61  bool Contain(Point_t const& pt) const;
62 
63  protected:
66 
67  public:
68  //
69  // Template
70  //
72  template <class T, class U>
73  AABox(T const& min, U const& max) : AABox(Point_t(min), Point_t(max))
74  {}
75  };
76 
77  typedef AABox AABox_t;
78 }
79 #endif
80  // end of doxygen group
Float_t x
Definition: compare.C:6
AABox()
Default constructor.
Definition: GeoAABox.cxx:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple & popular representation of 3D boundary box for collision detection. The concept was taken from the reference, Real-Time-Collision-Detection (RTCD), and in particular Ch. 4.2 (page 77): .
Definition: GeoAABox.h:34
Point_t _max
Maximum point.
Definition: GeoAABox.h:65
Point_t _min
Minimum point.
Definition: GeoAABox.h:64
double x_min
Definition: berger.C:15
Class def header for a class Point and Vector.
TMarker * pt
Definition: egs.C:25
Point_t const & Max() const
Maximum point getter.
Definition: GeoAABox.cxx:27
bool Contain(Point_t const &pt) const
Test if a point is contained within the box.
Definition: GeoAABox.cxx:45
double x_max
Definition: berger.C:16
virtual ~AABox()
Default destructor.
Definition: GeoAABox.h:41
AABox(T const &min, U const &max)
Alternative ctor using template (3)
Definition: GeoAABox.h:73
AABox AABox_t
Definition: GeoAABox.h:77
Point_t const & Min() const
Minimum point getter.
Definition: GeoAABox.cxx:23