#include <bounding_box.h>
Public Member Functions | |
BoundingBox (const Point &new_min, const Point &new_max) | |
BoundingBox (const std::pair< Point, Point > &bbox) | |
BoundingBox () | |
void | invalidate () |
const Point & | min () const |
Point & | min () |
const Point & | max () const |
Point & | max () |
bool | intersects (const BoundingBox &) const |
bool | intersects (const BoundingBox &, Real abstol) const |
bool | intersect (const BoundingBox &b) const |
bool | contains_point (const Point &) const |
void | intersect_with (const BoundingBox &) |
void | union_with (const Point &p) |
void | union_with (const BoundingBox &) |
Real | signed_distance (const Point &p) const |
Defines a Cartesian bounding box by the two corner extremum.
Definition at line 40 of file bounding_box.h.
Definition at line 44 of file bounding_box.h.
Definition at line 49 of file bounding_box.h.
|
inline |
Default constructor sets invalid bounds.
Definition at line 56 of file bounding_box.h.
References invalidate().
bool libMesh::BoundingBox::contains_point | ( | const Point & | p | ) | const |
true
if the bounding box contains the given point. Definition at line 135 of file bounding_box.C.
References libMesh::is_between(), and libMesh::Real.
Referenced by signed_distance().
|
inline |
true
if the other bounding box has a non-empty intersection with this bounding box.Definition at line 121 of file bounding_box.h.
References intersects().
void libMesh::BoundingBox::intersect_with | ( | const BoundingBox & | other_box | ) |
Sets this bounding box to be the intersection with the other bounding box.
Definition at line 165 of file bounding_box.C.
References std::max(), and std::min().
bool libMesh::BoundingBox::intersects | ( | const BoundingBox & | other_box | ) | const |
true
if the other bounding box has a non-empty intersection with this bounding box. Exact floating point <= comparisons are performed. Definition at line 35 of file bounding_box.C.
References libMesh::is_between(), and libMesh::Real.
Referenced by libMesh::TreeNode< N >::insert(), and intersect().
bool libMesh::BoundingBox::intersects | ( | const BoundingBox & | other_box, |
Real | abstol | ||
) | const |
true
if the other bounding box has a non-empty intersection with this bounding box. abstol is an absolute tolerance used to make "fuzzy" comparisons. abstol must be strictly > 0.0, and both BBoxes being compared are "inflated" by abstol in each direction, i.e. (xmin, ymin, zmin) -> (xmin - abstol, ymin - abstol, zmin - abstol) (xmax, ymax, zmax) -> (xmax + abstol, ymax + abstol, zmax + abstol) before the intersection comparisons are made. This approach can be helpful for detecting intersections between two degenerate (planar) bounding boxes that lie in nearly (to within abstol) the same plane and in certain situations should be considered intersecting. Definition at line 75 of file bounding_box.C.
References libMesh::is_between(), and libMesh::Real.
|
inline |
Sets the bounding box to encompass the universe.
Definition at line 64 of file bounding_box.h.
References std::max().
Referenced by BoundingBox().
|
inline |
Definition at line 85 of file bounding_box.h.
Referenced by union_with().
|
inline |
Definition at line 88 of file bounding_box.h.
|
inline |
Definition at line 76 of file bounding_box.h.
Referenced by union_with().
|
inline |
Definition at line 79 of file bounding_box.h.
Computes the signed distance, d, from a given Point p to this BoundingBox. The sign convention is: d > 0 if the point is outside the BoundingBox d <= 0 if the point is inside the Bounding Box
Definition at line 200 of file bounding_box.C.
References std::abs(), contains_point(), std::max(), std::min(), and libMesh::Real.
|
inline |
Enlarges this bounding box to include the given point
Definition at line 163 of file bounding_box.h.
References std::max(), max(), std::min(), and min().
Referenced by libMesh::Cell::loose_bounding_box().
void libMesh::BoundingBox::union_with | ( | const BoundingBox & | other_box | ) |
Sets this bounding box to be the union with the other bounding box.
Definition at line 182 of file bounding_box.C.
References std::max(), and std::min().