All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoAABox.h
Go to the documentation of this file.
1 /**
2  * \file GeoAABox.h
3  *
4  * \ingroup GeoAlgo
5  *
6  * \brief Class def header for a class AABox
7  *
8  * @author kazuhiro
9  */
10 
11 /** \addtogroup GeoAlgo
12 
13  @{*/
14 #ifndef BASICTOOL_GEOAABOX_H
15 #define BASICTOOL_GEOAABOX_H
16 
17 #include "GeoHalfLine.h"
18 
19 namespace geoalgo {
20  /**
21  \class AABox
22  @brief Representation of a 3D rectangular box which sides are aligned w/ coordinate axis.
23  A representation of an Axis-Aligned-Boundary-Box, a simple & popular representation of \n
24  3D boundary box for collision detection. The concept was taken from the reference, \n
25  Real-Time-Collision-Detection (RTCD), and in particular Ch. 4.2 (page 77): \n
26 
27  Ref: http://realtimecollisiondetection.net
28 
29  This class uses one of the simplest representation for AABox: "min-max" representation. \n
30  Though this method requires storing 6 floating point values, class attributes (i.e. \n
31  "min" and "max" points) store intuitive values for most UB analyzers. Also it simplifies \n
32  utility function implementations.
33  */
34  class AABox {
35 
36  public:
37 
38  /// Default constructor
39  AABox();
40 
41  /// Default destructor
42  virtual ~AABox(){};
43 
44  /// Alternative ctor (0)
45  AABox(const double x_min, const double y_min, const double z_min,
46  const double x_max, const double y_max, const double z_max);
47 
48  /// Altenartive ctor (1)
49  AABox(const Point_t& min, const Vector_t& max);
50 
51  //
52  // Attribute accessor
53  //
54  const Point_t& Min() const; ///< Minimum point getter
55  const Point_t& Max() const; ///< Maximum point getter
56  void Min(const double x, const double y, const double z); ///< Minimum point setter
57  void Max(const double x, const double y, const double z); ///< Maximum point setter
58  bool Contain(const Point_t &pt) const; ///< Test if a point is contained within the box
59 
60  protected:
61 
62  Point_t _min; ///< Minimum point
63  Point_t _max; ///< Maximum point
64 
65  public:
66 
67  //
68  // Template
69  //
70  /// Alternative ctor using template (3)
71  template <class T, class U> AABox(const T& min, const U& max)
72  : AABox(Point_t(min), Point_t(max))
73  {}
74 
75  /// Streamer
76  #ifndef __CINT__
77  friend std::ostream& operator << (std::ostream &o, ::geoalgo::AABox const& a)
78  { o << "AABox Min " << a.Min() << " Max " << a.Max(); return o; }
79  #endif
80 
81  };
82 
83  typedef AABox AABox_t;
84 
85 }
86 #endif
87 /** @} */ // end of doxygen group
88 
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple &amp; 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): .
const Point_t & Min() const
Minimum point getter.
process_name gaushit a
AABox(const T &min, const U &max)
Alternative ctor using template (3)
process_name opflash particleana ie ie y
bool Contain(const Point_t &pt) const
Test if a point is contained within the box.
const Point_t & Max() const
Maximum point getter.
friend std::ostream & operator<<(std::ostream &o,::geoalgo::AABox const &a)
Streamer.