|
Geogram Version 1.10.0-rc
A programming library of geometric algorithms
|
Base class for Axis Aligned Bounding Box trees. More...
#include <geogram/mesh/mesh_AABB.h>
Public Member Functions | |
| void | enlarge_boxes (double amount) |
| Enlarges all the boxes. | |
Protected Member Functions | |
| 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. | |
Static Protected Member Functions | |
| 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 | |
| index_t | nb_ |
| vector< BOX > | bboxes_ |
| vector< index_t > | reorder_ |
Base class for Axis Aligned Bounding Box trees.
| BOX | the box class (Box2d or Box3d). |
Definition at line 71 of file mesh_AABB.h.
|
inlineprotected |
Computes all the elements that have a bbox that intersects a given bbox 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 elements contained in the two nodes are sent as well as the node indices.
| [in] | action | a function that takes as argument an index_t (cell index) invoked for all cells that has a bounding box that overlaps box. |
| [in] | box | the query box |
| [in] | node | index of the first node of the AABB tree |
| [in] | b | index of the first facet in node |
| [in] | e | one position past the index of the last facet in node |
Definition at line 120 of file mesh_AABB.h.
Gets the element stored in a leaf node.
If the AABB is indirect, looks-up the element in the reorder_ permutation, else returns n.
| [in] | i | the leaf index, between 0 and nb elements - 1 |
n Definition at line 360 of file mesh_AABB.h.
|
inline |
Enlarges all the boxes.
| [in] | amount | the amount that should be subtracted from the lower bounds and added to the upper bounds of each box. |
Definition at line 79 of file mesh_AABB.h.
|
inlineprotected |
Computes the hierarchy of bounding boxes recursively.
This function is generic and can be used to compute a bbox hierarchy of arbitrary elements.
| [in] | node_index | the index of the root of the subtree |
| [in] | b | first element index in the subtree |
| [in] | e | one position past the last element index in the subtree |
| [in] | get_bbox | a function that takes a Box3d& and an index_t, that computes the bbox of an element. |
Definition at line 319 of file mesh_AABB.h.
|
inlineprotected |
Initializes this AABB.
| [in] | nb | number of items. |
| [in] | get_bbox | a function(Box&, index_t) that computes the Box associated with a given index, in [0..nb-1]. |
Definition at line 93 of file mesh_AABB.h.
|
inlinestaticprotected |
Computes the maximum node index in a subtree.
| [in] | node_index | node index of the root of the subtree |
| [in] | b | first facet index in the subtree |
| [in] | e | one position past the last facet index in the subtree |
node_index Definition at line 295 of file mesh_AABB.h.
|
inlineprotected |
Computes all the pairs of intersecting elements for two sub-trees of two AABB trees.
Note that the tree structure is completely implicit, therefore the bounds of the (continuous) facet indices sequences that correspond to the elementss contained in the two nodes are sent as well as the node indices.
| [in] | action | a function taking as arguments two index_t's, invoked of all pairs of elements that have overlapping bounding boxes. |
| [in] | node1 | index of the first node of the AABB tree |
| [in] | b1 | index of the first facet in node1 |
| [in] | e1 | one position past the index of the last facet in node1 |
| [in] | other | the second AABB tree |
| [in] | node2 | index of the second node of the second AABB tree |
| [in] | b2 | index of the first facet in node2 |
| [in] | e2 | one position past the index of the second facet in node2 |
Definition at line 240 of file mesh_AABB.h.
|
inlineprotected |
Computes all the pairs of intersecting elements for two sub-trees 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 elementss contained in the two nodes are sent as well as the node indices.
| [in] | action | a function taking as arguments two index_t's, invoked of all pairs of elements that have overlapping bounding boxes. |
| [in] | node1 | index of the first node of the AABB tree |
| [in] | b1 | index of the first facet in node1 |
| [in] | e1 | one position past the index of the last facet in node1 |
| [in] | node2 | index of the second node of the AABB tree |
| [in] | b2 | index of the first facet in node2 |
| [in] | e2 | one position past the index of the second facet in node2 |
Definition at line 167 of file mesh_AABB.h.
Definition at line 366 of file mesh_AABB.h.
Definition at line 365 of file mesh_AABB.h.
used if indirect, or unused if in-place
Definition at line 367 of file mesh_AABB.h.