Geogram Version 1.9.6
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GEO::MeshCellsAABB Class Reference

Axis Aligned Bounding Box tree of mesh cells. More...

#include <geogram/mesh/mesh_AABB.h>

Inheritance diagram for GEO::MeshCellsAABB:
GEO::MeshAABB3d GEO::AABB< BOX >

Public Member Functions

 MeshCellsAABB ()
 MeshCellsAABB constructor.
 
 MeshCellsAABB (Mesh &M, AABBReorderMode reorder_mode)
 Creates an Axis Aligned Bounding Boxes tree for mesh cells.
 
 MeshCellsAABB (const Mesh &M)
 Creates an Axis Aligned Bounding Boxes tree for mesh cells.
 
void initialize (Mesh &M, AABBReorderMode reorder_mode=AABB_INDIRECT)
 Initializes the Axis Aligned Bounding Boxes tree.
 
 MeshCellsAABB (Mesh &M, bool reorder)
 
void initialize (Mesh &M, bool reorder)
 
index_t containing_tet (const vec3 &p) const
 Finds the index of a tetrahedron that contains a query point.
 
void compute_bbox_cell_bbox_intersections (const Box &box_in, std::function< void(index_t)> action) const
 Computes all the intersections between a given box and the bounding boxes of all the cells.
 
void containing_boxes (const vec3 &p, std::function< void(index_t)> action) const
 Finds all the cells such that their bounding box contain a point.
 
void compute_cell_bbox_intersections (std::function< void(index_t, index_t)> action) const
 Computes all the pairs of intersecting cells.
 
void compute_other_cell_bbox_intersections (MeshCellsAABB *other, std::function< void(index_t, index_t)> action) const
 Computes all the pairs of intersecting cells between this AABB and another one.
 
- Public Member Functions inherited from GEO::MeshAABB3d
 MeshAABB3d ()
 MeshAABB3d constructor.
 
const Meshmesh () const
 Gets the mesh.
 

Static Public Attributes

static constexpr index_t NO_TET = NO_INDEX
 Symbolic constant for indicating that there is no containing tetrahedron.
 

Protected Member Functions

index_t containing_tet_recursive (const vec3 &p, index_t n, index_t b, index_t e) const
 The recursive function used by the implementation of containing_tet().
 
void containing_bboxes_recursive (std::function< void(index_t)> action, const vec3 &p, index_t node, index_t b, index_t e) const
 Computes all the cells that have a bbox that contain a given point in a sub-tree of the AABB tree.
 
- Protected Member Functions inherited from GEO::AABB< BOX >
void initialize (index_t nb, std::function< void(BOX &, index_t)> get_bbox)
 Initializes this AABB.
 
void bbox_intersect_recursive (std::function< void(index_t)> action, const BOX &box, index_t node, index_t b, index_t e) const
 Computes all the elements that have a bbox that intersects a given bbox in a sub-tree of the AABB tree.
 
void self_intersect_recursive (std::function< void(index_t, index_t)> action, index_t node1, index_t b1, index_t e1, index_t node2, index_t b2, index_t e2) const
 Computes all the pairs of intersecting elements for two sub-trees of the AABB tree.
 
void other_intersect_recursive (std::function< void(index_t, index_t)> action, index_t node1, index_t b1, index_t e1, const AABB< BOX > *other, index_t node2, index_t b2, index_t e2) const
 Computes all the pairs of intersecting elements for two sub-trees of two AABB trees.
 
void init_bboxes_recursive (index_t node_index, index_t b, index_t e, std::function< void(BOX &, index_t)> get_bbox)
 Computes the hierarchy of bounding boxes recursively.
 
bool indirect () const
 Tests whether this AABB is indirect or in-place.
 
index_t element_in_leaf (index_t i) const
 Gets the element stored in a leaf node.
 

Additional Inherited Members

- Static Protected Member Functions inherited from GEO::AABB< BOX >
static index_t max_node_index (index_t node_index, index_t b, index_t e)
 Computes the maximum node index in a subtree.
 
- Protected Attributes inherited from GEO::MeshAABB3d
Meshmesh_
 
- Protected Attributes inherited from GEO::AABB< BOX >
index_t nb_
 
vector< BOX > bboxes_
 
vector< index_treorder_
 

Detailed Description

Axis Aligned Bounding Box tree of mesh cells.

Used to quickly find the tetrahedron that contains a given 3d point.

Definition at line 846 of file mesh_AABB.h.

Constructor & Destructor Documentation

◆ MeshCellsAABB() [1/4]

GEO::MeshCellsAABB::MeshCellsAABB ( )
inline

MeshCellsAABB constructor.

Creates an uninitialized MeshCellsAABB.

Definition at line 860 of file mesh_AABB.h.

◆ MeshCellsAABB() [2/4]

GEO::MeshCellsAABB::MeshCellsAABB ( Mesh M,
AABBReorderMode  reorder_mode 
)
inline

Creates an Axis Aligned Bounding Boxes tree for mesh cells.

Parameters
[in]Mthe input mesh. It can be modified, The cells are re-ordered depending on reorder_mode
[in]reorder_modeone of
  • AABB_INDIRECT: leave mesh untouched, store order in separate vector
  • AABB_INPLACE: reorder mesh elements in place
  • AABB_NOREORDER: use order of mesh elements (the mesh was reordered before, using mesh_reorder())

Definition at line 874 of file mesh_AABB.h.

◆ MeshCellsAABB() [3/4]

GEO::MeshCellsAABB::MeshCellsAABB ( const Mesh M)
inline

Creates an Axis Aligned Bounding Boxes tree for mesh cells.

Uses AABB_INDIRECT mode (order stored in separate vector).

Parameters
[in]Ma const reference to the input mesh.

Definition at line 883 of file mesh_AABB.h.

◆ MeshCellsAABB() [4/4]

GEO::MeshCellsAABB::MeshCellsAABB ( Mesh M,
bool  reorder 
)
inline

Definition at line 902 of file mesh_AABB.h.

Member Function Documentation

◆ compute_bbox_cell_bbox_intersections()

void GEO::MeshCellsAABB::compute_bbox_cell_bbox_intersections ( const Box box_in,
std::function< void(index_t)>  action 
) const
inline

Computes all the intersections between a given box and the bounding boxes of all the cells.

Parameters
[in]actiona function that takes as argument an index_t (cell index) invoked for all cells that have a bounding box that intersects box_in.

Definition at line 934 of file mesh_AABB.h.

◆ compute_cell_bbox_intersections()

void GEO::MeshCellsAABB::compute_cell_bbox_intersections ( std::function< void(index_t, index_t)>  action) const
inline

Computes all the pairs of intersecting cells.

Parameters
[in]actionis a function that takes two index_t's, invoked of all pairs of cells that have overlapping bounding boxes. Further processing is necessary to detect actual cell intersections.

Definition at line 965 of file mesh_AABB.h.

◆ compute_other_cell_bbox_intersections()

void GEO::MeshCellsAABB::compute_other_cell_bbox_intersections ( MeshCellsAABB other,
std::function< void(index_t, index_t)>  action 
) const
inline

Computes all the pairs of intersecting cells between this AABB and another one.

Parameters
[in]actionis a function that takes two index_t's, invoked of all pairs of cells that have overlapping bounding boxes. Further processing is necessary to detect actual cell intersections.
[in]otherthe other AABB.

Definition at line 984 of file mesh_AABB.h.

◆ containing_bboxes_recursive()

void GEO::MeshCellsAABB::containing_bboxes_recursive ( std::function< void(index_t)>  action,
const vec3 p,
index_t  node,
index_t  b,
index_t  e 
) const
inlineprotected

Computes all the cells that have a bbox that contain a given point in a sub-tree of the AABB tree.

Note that the tree structure is completely implicit, therefore the bounds of the (continuous) facet indices sequences that correspond to the facets contained in the two nodes are sent as well as the node indices.

Parameters
[in]actiona function that takes an index_t that is invoked for all cells that has a bounding box that contains p.
[in]pa const reference to the query point
[in]nodeindex of the first node of the AABB tree
[in]bindex of the first facet in node
[in]eone position past the index of the last facet in node

Definition at line 1034 of file mesh_AABB.h.

◆ containing_boxes()

void GEO::MeshCellsAABB::containing_boxes ( const vec3 p,
std::function< void(index_t)>  action 
) const
inline

Finds all the cells such that their bounding box contain a point.

Parameters
[in]actiona function that takes an index_t that is invoked for all cells that have a bounding box that contains p.

Definition at line 950 of file mesh_AABB.h.

◆ containing_tet()

index_t GEO::MeshCellsAABB::containing_tet ( const vec3 p) const
inline

Finds the index of a tetrahedron that contains a query point.

Parameters
[in]pa const reference to the query point
Returns
the index of one of the tetrahedra that contains p or NO_TET if p is outside the mesh.
Note
The input mesh needs to be tetrahedralized. If the mesh has arbitrary cells, then one may use instead containing_boxes().

Definition at line 920 of file mesh_AABB.h.

◆ containing_tet_recursive()

index_t GEO::MeshCellsAABB::containing_tet_recursive ( const vec3 p,
index_t  n,
index_t  b,
index_t  e 
) const
protected

The recursive function used by the implementation of containing_tet().

Parameters
[in]pa const reference to the query point
[in]nindex of the current node in the AABB tree
[in]bindex of the first tet in the subtree under node n
[in]eone position past the index of the last tet in the subtree under node n
Returns
the index of one of the tetrahedra that contains p, or NO_TET if p is outside the mesh.

◆ initialize() [1/2]

void GEO::MeshCellsAABB::initialize ( Mesh M,
AABBReorderMode  reorder_mode = AABB_INDIRECT 
)

Initializes the Axis Aligned Bounding Boxes tree.

Parameters
[in]Mthe input mesh. It can be modified, The cells are re-ordered depending on reorder_mode
[in]reorder_modeone of
  • AABB_INPLACE: reorder mesh elements in place
  • AABB_INDIRECT: leave mesh untouched, store order in separate vector
  • AABB_NOREORDER: use order of mesh elements (the mesh was reordered before, using mesh_reorder())

◆ initialize() [2/2]

void GEO::MeshCellsAABB::initialize ( Mesh M,
bool  reorder 
)
inline

Definition at line 907 of file mesh_AABB.h.

Member Data Documentation

◆ NO_TET

constexpr index_t GEO::MeshCellsAABB::NO_TET = NO_INDEX
staticconstexpr

Symbolic constant for indicating that there is no containing tetrahedron.

See also
containing_tet()

Definition at line 854 of file mesh_AABB.h.


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