20 #ifndef LIBMESH_BOUNDING_BOX_H 21 #define LIBMESH_BOUNDING_BOX_H 24 #include "libmesh/libmesh.h" 25 #include "libmesh/point.h" 45 const Point & new_max) :
66 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
68 this->first(i) = std::numeric_limits<Real>::max();
69 this->second(i) = -std::numeric_limits<Real>::max();
77 {
return this->first; }
80 {
return this->first; }
86 {
return this->second; }
89 {
return this->second; }
175 for (
unsigned int dir=0; dir<LIBMESH_DIM; ++dir)
186 if (!((my_lower(dir) <= other_lower(dir) &&
187 other_lower(dir) <= my_upper(dir)) ||
188 (my_lower(dir) <= other_upper(dir) &&
189 other_upper(dir) <= my_upper(dir))) &&
190 !((other_lower(dir) <= my_lower(dir) &&
191 my_lower(dir) <= other_upper(dir))))
210 for (
unsigned int dir=0; dir<LIBMESH_DIM; ++dir)
212 expanded_my_box.first(dir) -= abstol;
213 expanded_my_box.second(dir) += abstol;
222 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
224 min()(i) = std::min(
min()(i), p(i));
225 max()(i) = std::max(
max()(i), p(i));
232 #endif // LIBMESH_BOUNDING_BOX_H BoundingBox()
Default constructor sets invalid bounds.
bool contains_point(const Point &) const
BoundingBox(const std::pair< Point, Point > &bbox)
void intersect_with(const BoundingBox &)
Sets this bounding box to be the intersection with the other bounding box.
bool intersects(const BoundingBox &) const
void invalidate()
Sets the bounding box to encompass the universe.
The libMesh namespace provides an interface to certain functionality in the library.
Real signed_distance(const Point &p) const
Computes the signed distance, d, from a given Point p to this BoundingBox.
const Point & min() const
BoundingBox(const Point &new_min, const Point &new_max)
Defines a Cartesian bounding box by the two corner extremum.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void union_with(const Point &p)
Enlarges this bounding box to include the given point.
const Point & max() const
void scale(const Real factor)
Scales each dimension of the bounding box by factor.
A Point defines a location in LIBMESH_DIM dimensional Real space.