All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoAABox.cxx
Go to the documentation of this file.
1 #ifndef BASICTOOL_GEOAABOX_CXX
2 #define BASICTOOL_GEOAABOX_CXX
3 
4 #include "GeoAABox.h"
5 
6 namespace geoalgo {
7 
8  AABox::AABox()
9  : _min(3)
10  , _max(3)
11  {}
12 
13  AABox::AABox(const double x_min, const double y_min, const double z_min,
14  const double x_max, const double y_max, const double z_max)
15  : _min ( x_min, y_min, z_min )
16  , _max ( x_max, y_max, z_max )
17  {}
18 
19  AABox::AABox(const Point_t& min, const Vector_t& max)
20  : _min ( min )
21  , _max ( max )
22  {
23  if(min.size()!=3 || max.size()!=3)
24  throw GeoAlgoException("AABox ctor accepts only 3D Point!");
25  }
26 
27  const Point_t& AABox::Min() const { return _min; }
28  const Point_t& AABox::Max() const { return _max; }
29 
30  void AABox::Min(const double x, const double y, const double z)
31  { _min[0] = x; _min[1] = y; _min[2] = z; }
32  void AABox::Max(const double x, const double y, const double z)
33  { _max[0] = x; _max[1] = y; _max[2] = z; }
34 
35  bool AABox::Contain(const Point_t &pt) const {
36  return !( (pt[0] < _min[0] || _max[0] < pt[0]) || // point is outside X boundaries OR
37  (pt[1] < _min[1] || _max[1] < pt[1]) || // point is outside Y boundaries OR
38  (pt[2] < _min[2] || _max[2] < pt[2]) // point is outside Z boundaries
39  );
40  }
41 
42 }
43 #endif
44 
45 
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
const Point_t & Min() const
Minimum point getter.
recob::tracking::Point_t Point_t
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.
recob::tracking::Vector_t Vector_t