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 
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 }
AABox()
Default constructor.
Definition: GeoAABox.cxx:6
Class def header for a class GeoAlgoException.
Point_t _max
Maximum point.
Definition: GeoAABox.h:63
Point_t _min
Minimum point.
Definition: GeoAABox.h:62
const Point_t & Min() const
Minimum point getter.
Definition: GeoAABox.cxx:25
Class def header for a class AABox.
bool Contain(const Point_t &pt) const
Test if a point is contained within the box.
Definition: GeoAABox.cxx:33
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
const Point_t & Max() const
Maximum point getter.
Definition: GeoAABox.cxx:26
list x
Definition: train.py:276