![]() |
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) | |
AABB (AABB const &)=default | |
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 |
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 57 of file AABB.h.
References enlarge(), init(), and updateWithoutEnlarge().
|
default |
|
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 82 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 190 of file AABB.h.
References containsPoint(), getMaxPoint(), and getMinPoint().
|
inline |
check if point is in the axis aligned bounding box
Definition at line 138 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by containsAABB(), and markFaults().
|
inline |
Definition at line 156 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by MeshLib::Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh().
|
inlineprivate |
|
inline |
returns a point that coordinates are maximal for each dimension within the given point set
Definition at line 181 of file AABB.h.
References _max_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), MeshElementRemovalDialog::accept(), adjustExtent(), 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 |
returns a point that coordinates are minimal for each dimension for the given point set
Definition at line 174 of file AABB.h.
References _min_pnt.
Referenced by GeoLib::Grid< POINT >::Grid(), MeshElementRemovalDialog::accept(), adjustExtent(), 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 |
|
inlineprivate |
|
inlineprivate |
Definition at line 256 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 240 of file AABB.h.
References _max_pnt, and _min_pnt.
Referenced by AABB(), and updateWithoutEnlarge().
|
private |
Definition at line 200 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), enlarge(), getMaxPoint(), init(), update(), and updateWithoutEnlarge().
|
private |
Definition at line 197 of file AABB.h.
Referenced by containsPoint(), containsPointXY(), getMinPoint(), init(), update(), and updateWithoutEnlarge().