libMesh
|
Defines a Cartesian bounding box by the two corner extremum. More...
#include <bounding_box.h>
Public Member Functions | |
BoundingBox (const Point &new_min, const Point &new_max) | |
BoundingBox (const std::pair< Point, Point > &bbox) | |
BoundingBox () | |
Default constructor sets invalid bounds. More... | |
void | invalidate () |
Sets the bounding box to encompass the universe. More... | |
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 | contains_point (const Point &) const |
void | intersect_with (const BoundingBox &) |
Sets this bounding box to be the intersection with the other bounding box. More... | |
void | union_with (const Point &p) |
Enlarges this bounding box to include the given point. More... | |
void | union_with (const BoundingBox &) |
Sets this bounding box to be the union with the other bounding box. More... | |
Real | signed_distance (const Point &p) const |
Computes the signed distance, d, from a given Point p to this BoundingBox. More... | |
void | scale (const Real factor) |
Scales each dimension of the bounding box by factor . More... | |
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 35 of file bounding_box.C.
References libMesh::is_between(), and libMesh::Real.
Referenced by OutputAssembly::interior_assembly(), main(), signed_distance(), and ElemTest< elem_type >::test_bounding_box().
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 65 of file bounding_box.C.
|
inline |
true
if the other bounding box has a non-empty intersection with this bounding box. Exact floating point <= comparisons are performed. Definition at line 165 of file bounding_box.h.
Referenced by libMesh::TreeNode< N >::insert(), intersects(), BBoxTest::test_no_degenerate(), BBoxTest::test_one_degenerate(), and BBoxTest::test_two_degenerate().
|
inline |
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 202 of file bounding_box.h.
References intersects(), and libMesh::libmesh_assert().
|
inline |
Sets the bounding box to encompass the universe.
Definition at line 64 of file bounding_box.h.
Referenced by BoundingBox().
|
inline |
Definition at line 85 of file bounding_box.h.
Referenced by OutputAssembly::interior_assembly(), main(), MeshGenerationTest::testBuildCube(), MeshGenerationTest::testBuildSquare(), and union_with().
|
inline |
Definition at line 88 of file bounding_box.h.
|
inline |
Definition at line 76 of file bounding_box.h.
Referenced by OutputAssembly::interior_assembly(), main(), MeshGenerationTest::testBuildCube(), MeshGenerationTest::testBuildSquare(), and union_with().
|
inline |
Definition at line 79 of file bounding_box.h.
void libMesh::BoundingBox::scale | ( | const Real | factor | ) |
Scales each dimension of the bounding box by factor
.
Has no effect for dimensions in which either min(dim) == std::numeric_limits<Real>::max() or max(dim) == -std::numeric_limits<Real>::max(), which is the "invalid" state set by the default constructor and by invalidate().
Definition at line 137 of file bounding_box.C.
References dim, and libMesh::Real.
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 100 of file bounding_box.C.
References std::abs(), contains_point(), libMesh::Real, and std::sqrt().
Referenced by BBoxTest::test_signed_distance().
|
inline |
Enlarges this bounding box to include the given point.
Definition at line 220 of file bounding_box.h.
Referenced by libMesh::MeshBase::get_info(), and 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 82 of file bounding_box.C.