libMesh
Public Member Functions | List of all members
libMesh::MeshTools::BoundingBox Class Reference

Backwards compatibility with forward declarations. More...

#include <mesh_tools.h>

Inheritance diagram for libMesh::MeshTools::BoundingBox:
[legend]

Public Member Functions

 BoundingBox (const Point &new_min, const Point &new_max)
 
 BoundingBox (const std::pair< Point, Point > &bbox)
 
 BoundingBox ()
 
void invalidate ()
 Sets the bounding box to encompass the universe. More...
 
const Pointmin () const
 
Pointmin ()
 
const Pointmax () const
 
Pointmax ()
 
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 &)
 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...
 

Detailed Description

Backwards compatibility with forward declarations.

Deprecated:
Use libMesh::BoundingBox instead.

Definition at line 70 of file mesh_tools.h.

Constructor & Destructor Documentation

◆ BoundingBox() [1/3]

libMesh::MeshTools::BoundingBox::BoundingBox ( const Point new_min,
const Point new_max 
)

Definition at line 73 of file mesh_tools.h.

74  :
75  libMesh::BoundingBox(new_min, new_max) {
76  libmesh_deprecated(); // Switch to libMesh::BoundingBox
77  }
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40

◆ BoundingBox() [2/3]

libMesh::MeshTools::BoundingBox::BoundingBox ( const std::pair< Point, Point > &  bbox)

Definition at line 79 of file mesh_tools.h.

79  :
80  libMesh::BoundingBox(bbox) {
81  libmesh_deprecated(); // Switch to libMesh::BoundingBox
82  }
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40

◆ BoundingBox() [3/3]

libMesh::MeshTools::BoundingBox::BoundingBox ( )

Definition at line 84 of file mesh_tools.h.

84  {
85  libmesh_deprecated(); // Switch to libMesh::BoundingBox
86  }

Member Function Documentation

◆ contains_point()

bool libMesh::BoundingBox::contains_point ( const Point ) const
inherited
Returns
true if the bounding box contains the given point.

◆ intersect()

bool libMesh::BoundingBox::intersect ( const BoundingBox b) const
inherited
Returns
true if the other bounding box has a non-empty intersection with this bounding box.
Deprecated:
Use the BoundingBox::intersects() function instead.

Definition at line 121 of file bounding_box.h.

References libMesh::BoundingBox::intersects().

122  { libmesh_deprecated(); return this->intersects(b); }
bool intersects(const BoundingBox &) const

◆ intersect_with()

void libMesh::BoundingBox::intersect_with ( const BoundingBox )
inherited

Sets this bounding box to be the intersection with the other bounding box.

◆ intersects() [1/2]

bool libMesh::BoundingBox::intersects ( const BoundingBox ) const
inherited
Returns
true if the other bounding box has a non-empty intersection with this bounding box. Exact floating point <= comparisons are performed.

Referenced by libMesh::BoundingBox::intersect().

◆ intersects() [2/2]

bool libMesh::BoundingBox::intersects ( const BoundingBox ,
Real  abstol 
) const
inherited
Returns
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.

◆ invalidate()

void libMesh::BoundingBox::invalidate ( )
inherited

Sets the bounding box to encompass the universe.

Definition at line 64 of file bounding_box.h.

References std::max().

Referenced by libMesh::BoundingBox::BoundingBox().

65  {
66  for (unsigned int i=0; i<LIBMESH_DIM; i++)
67  {
68  this->first(i) = std::numeric_limits<Real>::max();
69  this->second(i) = -std::numeric_limits<Real>::max();
70  }
71  }
long double max(long double a, double b)

◆ max() [1/2]

const Point& libMesh::BoundingBox::max ( ) const
inherited
Returns
A point at the maximum x,y,z coordinates of the box.

Definition at line 85 of file bounding_box.h.

Referenced by libMesh::BoundingBox::union_with().

86  { return this->second; }

◆ max() [2/2]

Point& libMesh::BoundingBox::max ( )
inherited

Definition at line 88 of file bounding_box.h.

89  { return this->second; }

◆ min() [1/2]

const Point& libMesh::BoundingBox::min ( ) const
inherited
Returns
A point at the minimum x,y,z coordinates of the box.

Definition at line 76 of file bounding_box.h.

Referenced by libMesh::BoundingBox::union_with().

77  { return this->first; }

◆ min() [2/2]

Point& libMesh::BoundingBox::min ( )
inherited

Definition at line 79 of file bounding_box.h.

80  { return this->first; }

◆ signed_distance()

Real libMesh::BoundingBox::signed_distance ( const Point p) const
inherited

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

◆ union_with() [1/2]

void libMesh::BoundingBox::union_with ( const Point p)
inherited

Enlarges this bounding box to include the given point.

Definition at line 163 of file bounding_box.h.

References std::max(), libMesh::BoundingBox::max(), std::min(), and libMesh::BoundingBox::min().

164 {
165  for (unsigned int i=0; i<LIBMESH_DIM; i++)
166  {
167  min()(i) = std::min(min()(i), p(i));
168  max()(i) = std::max(max()(i), p(i));
169  }
170 }
long double max(long double a, double b)
const Point & min() const
Definition: bounding_box.h:76
const Point & max() const
Definition: bounding_box.h:85
long double min(long double a, double b)

◆ union_with() [2/2]

void libMesh::BoundingBox::union_with ( const BoundingBox )
inherited

Sets this bounding box to be the union with the other bounding box.


The documentation for this class was generated from the following file: