$extrastylesheet
#include <mesh_tools.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 () |
| BoundingBox & | expand () |
| bool | intersect (const BoundingBox &) const |
| bool | contains_point (const Point &) const |
Defines a Cartesian bounding box by the two corner extremum.
Definition at line 66 of file mesh_tools.h.
| libMesh::MeshTools::BoundingBox::BoundingBox | ( | const Point & | new_min, |
| const Point & | new_max | ||
| ) | [inline] |
Definition at line 70 of file mesh_tools.h.
:
std::pair<Point, Point>(new_min, new_max)
{}
| libMesh::MeshTools::BoundingBox::BoundingBox | ( | const std::pair< Point, Point > & | bbox | ) | [inline] |
Definition at line 74 of file mesh_tools.h.
:
std::pair<Point, Point> (bbox)
{}
| libMesh::MeshTools::BoundingBox::BoundingBox | ( | ) | [inline] |
Default constructor sets invalid bounds.
Definition at line 81 of file mesh_tools.h.
References invalidate().
{
this->invalidate();
}
| bool libMesh::MeshTools::BoundingBox::contains_point | ( | const Point & | p | ) | const |
Definition at line 283 of file mesh_tools.C.
References libMesh::is_between(), and libMesh::Real.
{
// Make local variables first to make thiings more clear in a moment
Real my_min_x = this->first(0);
Real my_max_x = this->second(0);
bool x_int = is_between(my_min_x, p(0), my_max_x);
bool intersection_true = x_int;
#if LIBMESH_DIM > 1
Real my_min_y = this->first(1);
Real my_max_y = this->second(1);
bool y_int = is_between(my_min_y, p(1), my_max_y);
intersection_true = intersection_true && y_int;
#endif
#if LIBMESH_DIM > 2
Real my_min_z = this->first(2);
Real my_max_z = this->second(2);
bool z_int = is_between(my_min_z, p(2), my_max_z);
intersection_true = intersection_true && z_int;
#endif
return intersection_true;
}
| BoundingBox& libMesh::MeshTools::BoundingBox::expand | ( | ) | [inline] |
Definition at line 107 of file mesh_tools.h.
{ return *this; }
| bool libMesh::MeshTools::BoundingBox::intersect | ( | const BoundingBox & | other_box | ) | const |
Definition at line 243 of file mesh_tools.C.
References libMesh::is_between(), and libMesh::Real.
{
// Make local variables first to make thiings more clear in a moment
const Real& my_min_x = this->first(0);
const Real& my_max_x = this->second(0);
const Real& other_min_x = other_box.first(0);
const Real& other_max_x = other_box.second(0);
const bool x_int = is_between(my_min_x, other_min_x, my_max_x) || is_between(my_min_x, other_max_x, my_max_x) ||
is_between(other_min_x, my_min_x, other_max_x) || is_between(other_min_x, my_max_x, other_max_x);
bool intersection_true = x_int;
#if LIBMESH_DIM > 1
const Real& my_min_y = this->first(1);
const Real& my_max_y = this->second(1);
const Real& other_min_y = other_box.first(1);
const Real& other_max_y = other_box.second(1);
const bool y_int = is_between(my_min_y, other_min_y, my_max_y) || is_between(my_min_y, other_max_y, my_max_y) ||
is_between(other_min_y, my_min_y, other_max_y) || is_between(other_min_y, my_max_y, other_max_y);
intersection_true = intersection_true && y_int;
#endif
#if LIBMESH_DIM > 2
const Real& my_min_z = this->first(2);
const Real& my_max_z = this->second(2);
const Real& other_min_z = other_box.first(2);
const Real& other_max_z = other_box.second(2);
const bool z_int = is_between(my_min_z, other_min_z, my_max_z) || is_between(my_min_z, other_max_z, my_max_z) ||
is_between(other_min_z, my_min_z, other_max_z) || is_between(other_min_z, my_max_z, other_max_z);
intersection_true = intersection_true && z_int;
#endif
return intersection_true;
}
| void libMesh::MeshTools::BoundingBox::invalidate | ( | ) | [inline] |
Definition at line 86 of file mesh_tools.h.
References max().
Referenced by BoundingBox().
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
this->first(i) = std::numeric_limits<Real>::max();
this->second(i) = -std::numeric_limits<Real>::max();
}
}
| const Point& libMesh::MeshTools::BoundingBox::max | ( | ) | const [inline] |
| Point& libMesh::MeshTools::BoundingBox::max | ( | ) | [inline] |
Definition at line 104 of file mesh_tools.h.
{ return this->second; }
| const Point& libMesh::MeshTools::BoundingBox::min | ( | ) | const [inline] |
Definition at line 95 of file mesh_tools.h.
{ return this->first; }
| Point& libMesh::MeshTools::BoundingBox::min | ( | ) | [inline] |
Definition at line 98 of file mesh_tools.h.
{ return this->first; }