1 #ifndef UGDK_UTIL_BOX_H_
2 #define UGDK_UTIL_BOX_H_
10 template <
int DIMENSIONS>
13 typedef std::array<Coordinate, DIMENSIONS>
Point;
35 template <
int DIMENSIONS>
38 template <
int DIMENSIONS>
40 : min_coordinates_(min_coordinates), max_coordinates_(max_coordinates) {}
42 template <
int DIMENSIONS>
45 template <
int DIMENSIONS>
50 template <
int DIMENSIONS>
52 return max_coordinates_[depth % DIMENSIONS] <= boundary;
55 template <
int DIMENSIONS>
57 return boundary < min_coordinates_[depth % DIMENSIONS];
60 template <
int DIMENSIONS>
62 for (
int k = 0; k < DIMENSIONS; ++k) {
73 template <
int DIMENSIONS>
75 for (
int k = 0; k < DIMENSIONS; ++k) {
84 template <
int DIMENSIONS>
86 return min_coordinates_;
89 template <
int DIMENSIONS>
91 return max_coordinates_;
const Point & min_coordinates() const
Definition: box.h:85
Box()
Definition: box.h:36
bool IsAbove(int depth, Coordinate boundary) const
Definition: box.h:56
Point min_coordinates_
Definition: box.h:29
std::array< Coordinate, DIMENSIONS > Point
Definition: box.h:13
bool Intersects(const Box *box) const
Definition: box.h:74
Point max_coordinates_
Definition: box.h:30
Definition: animation.h:11
void UpdateBox(const Box &)
Definition: box.h:46
const Point & max_coordinates() const
Definition: box.h:90
bool IsBelow(int depth, Coordinate boundary) const
Definition: box.h:51
virtual ~Box()
Definition: box.h:43
bool Contains(const Box &box) const
Definition: box.h:61
double Coordinate
Definition: structure.h:7