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