18 #ifndef BOX_ELEMENT_HH_ 19 #define BOX_ELEMENT_HH_ 51 <<
"out of bounds: <" << EI_interval_left::val
52 <<
", " << EI_interval_right::val <<
">\n");
84 OLD_ASSERT( arma::min( min <= max ) ,
"Wrong coordinates in constructor.");
115 const Point &
min()
const {
122 const Point &
max()
const {
129 double min(
unsigned int axis)
const {
136 double max(
unsigned int axis)
const {
144 double size(
unsigned int axis)
const {
145 return max()[axis] -
min()[axis];
173 for (
unsigned int i=0; i<
dimension; i++) {
191 for (
unsigned int i=0; i<
dimension; i++) {
220 void split(
unsigned int axis,
double splitting_point,
232 << EI_split_point(splitting_point) );
240 for(
unsigned int j=0; j<
dimension; j++) {
251 return (diff[1] > diff[0])
252 ? ( diff[2] > diff[1] ? 2 : 1 )
253 : ( diff[2] > diff[0] ? 2 : 0 );
262 Point projected_point;
263 for (
unsigned int i=0; i<
dimension; ++i) {
266 else projected_point[i] = point[i];
269 return projected_point;
285 << box.
min(2) <<
"; " 288 << 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
static constexpr bool value
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 OLD_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)
Point project_point(const Point &point) const
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 OLD_ASSERT_LE(a, b)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
double projection_center(unsigned int axis) const
BoundingBox(const Point &min)