28 #ifndef BOX_ELEMENT_HH_
29 #define BOX_ELEMENT_HH_
61 <<
"out of bounds: <" << EI_interval_left::val
62 <<
", " << EI_interval_right::val <<
">\n");
91 ASSERT( arma::min( min <= max ) ,
"Wrong coordinates in constructor.");
122 const Point &
min()
const {
129 const Point &
max()
const {
136 double min(
unsigned int axis)
const {
143 double max(
unsigned int axis)
const {
151 double size(
unsigned int axis)
const {
152 return max()[axis] -
min()[axis];
180 for (
unsigned int i=0; i<
dimension; i++) {
198 for (
unsigned int i=0; i<
dimension; i++) {
227 void split(
unsigned int axis,
double splitting_point,
239 << EI_split_point(splitting_point) );
247 for(
unsigned int j=0; j<
dimension; j++) {
258 return (diff[1] > diff[0])
259 ? ( diff[2] > diff[1] ? 2 : 1 )
260 : ( diff[2] > diff[0] ? 2 : 0 );
277 << box.
min(2) <<
"; "
280 << box.
max(2) <<
")";
void set_max(unsigned int axis, double max)
Bounding box in 3d ambient space.
void split(unsigned int axis, double splitting_point, BoundingBox &left, BoundingBox &right) const
unsigned char longest_axis() const
Space< dimension >::Point Point
Currently we assume.
double max(unsigned int axis) const
double min(unsigned int axis) const
Point min_vertex_
minimal coordinates of bounding box
void expand(const Point &point)
static const double epsilon
stabilization parameter
Point max_vertex_
maximal coordinates of bounding box
bool intersect(const BoundingBox &b2) const
BoundingBox(const Point &min, const Point &max)
ostream & operator<<(ostream &stream, const BoundingBox &box)
Overloads output operator for box.
TYPEDEF_ERR_INFO(EI_split_point, double)
Global macros to enhance readability and debugging, general constants.
bool contains_point(const Point &point) const
static const unsigned int dimension
Currently we set dimension to 3.
bool projection_lt(unsigned int axis, double value) const
#define ASSERT_LESS(a, b)
const Point & max() const
bool projection_gt(unsigned int axis, double value) const
double size(unsigned int axis) const
void set_min(unsigned int axis, double min)
const Point & min() const
DECLARE_EXCEPTION(ExcSplitting,<< "Split point "<< EI_split_point::val<< "out of bounds: <"<< EI_interval_left::val<< ", "<< EI_interval_right::val<< ">\n")
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
double projection_center(unsigned int axis) const
BoundingBox(const Point &min)