LArSoft  v09_90_00
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(const double x_min,
45  const double y_min,
46  const double z_min,
47  const double x_max,
48  const double y_max,
49  const double z_max);
50 
52  AABox(const Point_t& min, const Vector_t& max);
53 
54  //
55  // Attribute accessor
56  //
57  const Point_t& Min() const;
58  const Point_t& Max() const;
59  void Min(const double x, const double y, const double z);
60  void Max(const double x, const double y, const double z);
61  bool Contain(const Point_t& pt) const;
62 
63  protected:
66 
67  public:
68  //
69  // Template
70  //
72  template <class T, class U>
73  AABox(const T& min, const U& 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
const Point_t & Min() const
Minimum point getter.
Definition: GeoAABox.cxx:23
double x_min
Definition: berger.C:15
AABox(const T &min, const U &max)
Alternative ctor using template (3)
Definition: GeoAABox.h:73
bool Contain(const Point_t &pt) const
Test if a point is contained within the box.
Definition: GeoAABox.cxx:45
Class def header for a class Point and Vector.
TMarker * pt
Definition: egs.C:25
double x_max
Definition: berger.C:16
virtual ~AABox()
Default destructor.
Definition: GeoAABox.h:41
AABox AABox_t
Definition: GeoAABox.h:77
const Point_t & Max() const
Maximum point getter.
Definition: GeoAABox.cxx:27