![]() |
OGS
|
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type PNT_TYPE.
Let \(P = \{p_k \in \mathbb{R}^3, \ k=1, \dotsc, n\}\) a set of 3d points. The bounding volume is described by its lower, left, front point \(\ell\) and the upper, right, back point \(u\), i.e. the coordinates of \(\ell\) and \(u\) are computed as follows \(\ell_i = \min \limits_{p \in P} p_i\), \(u_i = \max \limits_{p \in P} p_i\), respectively. The bounding box consists of half-open intervals \([\ell_x, u_x) \times [\ell_y, u_y) \times [\ell_z, u_z).\) The bounding box is enlarged up to the next available floating point number such that all input points are contained in the bounding box.
#include <AABB.h>
Public Member Functions | |
template<typename PNT_TYPE > | |
AABB (std::vector< PNT_TYPE * > const &pnts, std::vector< std::size_t > const &ids) | |
template<typename InputIterator > | |
AABB (InputIterator first, InputIterator last) | |
template<typename PNT_TYPE > | |
bool | update (PNT_TYPE const &p) |
template<typename T > | |
bool | containsPoint (T const &pnt, double eps) const |
template<typename T > | |
bool | containsPointXY (T const &pnt) const |
MinMaxPoints | getMinMaxPoints () const |
Eigen::Vector3d const & | getMinPoint () const |
Eigen::Vector3d const & | getMaxPoint () const |
bool | containsAABB (AABB const &other_aabb) const |
Private Member Functions | |
void | enlarge (std::bitset< 3 > to_update=7) |
template<typename PNT_TYPE > | |
void | init (PNT_TYPE const &pnt) |
template<typename PNT_TYPE > | |
void | init (PNT_TYPE *const &pnt) |
template<typename PNT_TYPE > | |
void | updateWithoutEnlarge (PNT_TYPE const &p) |
template<typename PNT_TYPE > | |
void | updateWithoutEnlarge (PNT_TYPE *const &pnt) |
template<typename PNT_TYPE > | |
void | update (PNT_TYPE const *pnt) |
Private Attributes | |
Eigen::Vector3d | _min_pnt |
Eigen::Vector3d | _max_pnt |
|
inline |
construction of object, initialization the axis aligned bounding box
PNT_TYPE | a point type supporting accessing the coordinates via operator[] |
Definition at line 63 of file AABB.h.
References enlarge(), MeshLib::views::ids, init(), and updateWithoutEnlarge().
|
inline |
Construction of object using input iterators. In contrast to give a vector this approach is more generic. You can use every (stl) container and C arrays as input for constructing the object.
first | the input iterator to the initial position in the sequence |
last | the input iterator to the final position in a container, i.e. [first, last). |
Definition at line 86 of file AABB.h.
References enlarge(), init(), OGS_FATAL, and updateWithoutEnlarge().
|
inline |
Method checks if the given AABB object is contained within the AABB represented by this object.
other_aabb | the AABB to test with |
Definition at line 195 of file AABB.h.
References containsPoint(), getMaxPoint(), and getMinPoint().
|
inline |
check if point is in the axis aligned bounding box
Definition at line 142 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by containsAABB(), main(), and markFaults().
|
inline |
Definition at line 160 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh().
|
inlineprivate |
Enlarge the bounding box the smallest possible amount (modifying the unit in the last place). Only the coordinates of the maximum point are changed such that the half-open property will be preserved.
Definition at line 213 of file AABB.h.
References _max_pnt.
|
inline |
returns a point that coordinates are maximal for each dimension within the given point set
Definition at line 186 of file AABB.h.
References _max_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), MeshElementRemovalDialog::accept(), adjustExtent(), compute2DGaussBellCurveValues(), computeSinXSinY(), containsAABB(), MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), MeshLib::CoordinateSystem::getCoordinateSystem(), MeshLib::MeshElementGrid::getGridCellCoordinates(), MeshLib::MeshElementGrid::getMaxPoint(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), GeoLib::Polygon::isPntInPolygon(), main(), MeshGeoToolsLib::GeoMapper::mapPointDataToMeshSurface(), MeshGeoToolsLib::GeoMapper::mapStationData(), markFaults(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), GeoLib::PointVec::resetInternalDataStructures(), rotateGeometryToXY(), ElementTreeModel::setMesh(), GeoLib::SurfaceGrid::sortTrianglesInGridCells(), and GeoLib::PointVec::uniqueInsert().
|
inline |
|
inline |
returns a point that coordinates are minimal for each dimension for the given point set
Definition at line 179 of file AABB.h.
References _min_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), MeshElementRemovalDialog::accept(), adjustExtent(), compute2DGaussBellCurveValues(), computeSinXSinY(), containsAABB(), MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), MeshLib::CoordinateSystem::getCoordinateSystem(), GeoLib::SurfaceGrid::getGridCellCoordinates(), MeshLib::MeshElementGrid::getGridCellCoordinates(), MeshLib::MeshElementGrid::getMinPoint(), MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), GeoLib::Polygon::isPntInPolygon(), main(), MeshGeoToolsLib::GeoMapper::mapPointDataToMeshSurface(), MeshGeoToolsLib::GeoMapper::mapStationData(), markFaults(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), GeoLib::PointVec::resetInternalDataStructures(), rotateGeometryToXY(), ElementTreeModel::setMesh(), GeoLib::SurfaceGrid::sortTrianglesInGridCells(), and GeoLib::PointVec::uniqueInsert().
|
inlineprivate |
|
inlineprivate |
|
inline |
Checks if the bounding box has to be updated.
Definition at line 107 of file AABB.h.
References _max_pnt, _min_pnt, and enlarge().
Referenced by GeoLib::PointVec::uniqueInsert(), and update().
|
inlineprivate |
|
inlineprivate |
Definition at line 261 of file AABB.h.
References updateWithoutEnlarge().
|
inlineprivate |
Private method that is used internally to update the min and max point of the bounding box using point \(p\) without enlarging the bounding box. Using this method the bounding box of the initial point set is enlarged only once.
p | point that will possibly change the bounding box points |
Definition at line 245 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by AABB(), and updateWithoutEnlarge().
|
private |
Definition at line 205 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), enlarge(), getMaxPoint(), getMinMaxPoints(), init(), update(), and updateWithoutEnlarge().
|
private |
Definition at line 202 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), getMinMaxPoints(), getMinPoint(), init(), update(), and updateWithoutEnlarge().