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 64 of file AABB.h.
References enlarge(), 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 87 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 196 of file AABB.h.
References containsPoint(), getMaxPoint(), and getMinPoint().
|
inline |
check if point is in the axis aligned bounding box
Definition at line 143 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by containsAABB(), main(), and anonymous_namespace{AddFaultToVoxelGrid.cpp}::markFaults().
|
inline |
Definition at line 161 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 226 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 187 of file AABB.h.
References _max_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), adjustExtent(), compute2DGaussBellCurveValues(), computeSinXSinY(), computeStepFunction(), containsAABB(), MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), MeshLib::MeshElementGrid::getGridCellCoordinates(), MeshLib::MeshElementGrid::getMaxPoint(), getMeshExtent(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), main(), MeshGeoToolsLib::GeoMapper::mapStationData(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), GeoLib::PointVec::resetInternalDataStructures(), rotateGeometryToXY(), GeoLib::PointVec::uniqueInsert(), and Layers2GridDialog::updateExpectedVoxel().
|
inline |
Definition at line 174 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by MeshElementRemovalDialog::accept(), anonymous_namespace{CoordinateSystem.cpp}::getCoordinateSystem(), GeoLib::Polygon::isPntInPolygon(), main(), MeshGeoToolsLib::GeoMapper::mapPointDataToMeshSurface(), anonymous_namespace{AddFaultToVoxelGrid.cpp}::markFaults(), GeoLib::PointVec::resetInternalDataStructures(), 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 180 of file AABB.h.
References _min_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), adjustExtent(), compute2DGaussBellCurveValues(), computeSinXSinY(), computeStepFunction(), containsAABB(), MeshGeoToolsLib::getCandidateElementsForLineSegmentIntersection(), GeoLib::SurfaceGrid::getGridCellCoordinates(), MeshLib::MeshElementGrid::getGridCellCoordinates(), getMeshExtent(), MeshLib::MeshElementGrid::getMinPoint(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(), main(), MeshGeoToolsLib::GeoMapper::mapStationData(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), GeoLib::PointVec::resetInternalDataStructures(), rotateGeometryToXY(), GeoLib::PointVec::uniqueInsert(), and Layers2GridDialog::updateExpectedVoxel().
|
inlineprivate |
|
inlineprivate |
|
inline |
Checks if the bounding box has to be updated.
Definition at line 108 of file AABB.h.
References _max_pnt, _min_pnt, and enlarge().
Referenced by GeoLib::PointVec::uniqueInsert(), and update().
|
inlineprivate |
|
inlineprivate |
Definition at line 274 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 258 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by AABB(), AABB(), and updateWithoutEnlarge().
|
friend |
Definition at line 202 of file AABB.h.
|
private |
Definition at line 218 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), enlarge(), getMaxPoint(), getMinMaxPoints(), init(), update(), and updateWithoutEnlarge().
|
private |
Definition at line 215 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), getMinMaxPoints(), getMinPoint(), init(), update(), and updateWithoutEnlarge().