![]() |
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 |
Friends | |
| std::ostream & | operator<< (std::ostream &os, AABB const &aabb) |
|
inline |
construction of object, initialization the axis aligned bounding box
| PNT_TYPE | a point type supporting accessing the coordinates via operator[] |
Definition at line 53 of file AABB.h.
References enlarge(), init(), and updateWithoutEnlarge().
Referenced by GeoLib::Grid< POINT >::Grid(), GeoLib::SurfaceGrid::SurfaceGrid(), containsAABB(), and operator<<.
|
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 76 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 185 of file AABB.h.
References AABB(), containsPoint(), getMaxPoint(), and getMinPoint().
|
inline |
check if point is in the axis aligned bounding box
Definition at line 132 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by containsAABB(), MeshToolsLib::findNodesInBoundedDomain(), main(), and anonymous_namespace{AddFaultToVoxelGrid.cpp}::markFaults().
|
inline |
Definition at line 150 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by MeshToolsLib::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 215 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 176 of file AABB.h.
References _max_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), adjustExtent(), compute2DGaussBellCurveValues(), computeSinXSinY(), computeStepFunction(), containsAABB(), GeoLib::Grid< POINT >::createGridGeometry(), MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), getMeshExtent(), GeoLib::Grid< POINT >::getNearestPoint(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshGeoToolsLib::GeoMapper::mapStationData(), mergeSubdomainMeshes(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), MeshToolsLib::partitionNodesByCoordinateMatch(), rotateGeometryToXY(), and Layers2GridDialog::updateExpectedVoxel().
|
inline |
Definition at line 163 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by MeshElementRemovalDialog::accept(), anonymous_namespace{CoordinateSystem.cpp}::getCoordinateSystem(), GeoLib::Grid< POINT >::getGridCoords(), main(), MeshGeoToolsLib::GeoMapper::mapPointDataToMeshSurface(), anonymous_namespace{AddFaultToVoxelGrid.cpp}::markFaults(), operator<<, ElementTreeModel::setMesh(), and GeoLib::SurfaceGrid::sortTrianglesInGridCells().
|
inline |
returns a point that coordinates are minimal for each dimension for the given point set
Definition at line 169 of file AABB.h.
References _min_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), adjustExtent(), compute2DGaussBellCurveValues(), computeSinXSinY(), computeStepFunction(), containsAABB(), GeoLib::Grid< POINT >::createGridGeometry(), MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), GeoLib::SurfaceGrid::getGridCellCoordinates(), getMeshExtent(), GeoLib::Grid< POINT >::getNearestPoint(), GeoLib::Grid< POINT >::getPointCellBorderDistances(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), MeshGeoToolsLib::GeoMapper::mapStationData(), mergeSubdomainMeshes(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), MeshToolsLib::partitionNodesByCoordinateMatch(), rotateGeometryToXY(), and Layers2GridDialog::updateExpectedVoxel().
|
inlineprivate |
|
inlineprivate |
|
inline |
Checks if the bounding box has to be updated.
Definition at line 97 of file AABB.h.
References _max_pnt, _min_pnt, and enlarge().
Referenced by update().
|
inlineprivate |
|
inlineprivate |
Definition at line 263 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 247 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by AABB(), AABB(), and updateWithoutEnlarge().
|
friend |
Definition at line 191 of file AABB.h.
References AABB(), and getMinMaxPoints().
|
private |
Definition at line 207 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), enlarge(), getMaxPoint(), getMinMaxPoints(), init(), update(), and updateWithoutEnlarge().
|
private |
Definition at line 204 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), getMinMaxPoints(), getMinPoint(), init(), update(), and updateWithoutEnlarge().