|
Plugins
|
A Bounding Volume Hierarchy tree for efficient spatial querying of line segments. More...
#include <river_sss.h>
Public Types | |
| using | line_type = FVLineSourceOrSink< dim, TLineData > |
Public Member Functions | |
| void | build (std::vector< SmartPtr< line_type > > &lines) |
| Builds the BVH from a vector of line segments. | |
| void | query (const AABox< MathVector< dim > > &box, std::vector< size_t > &out) const |
| Finds all line segments whose bounding boxes potentially overlap with the query box. | |
Private Member Functions | |
| SmartPtr< LineBVHNode< dim > > | build_node (std::vector< SmartPtr< line_type > > &lines, std::vector< size_t > &ids, int depth) |
| Internal recursive function to build the tree nodes. | |
| void | query_node (const LineBVHNode< dim > *node, const AABox< MathVector< dim > > &box, std::vector< size_t > &out) const |
| Internal recursive function for spatial querying. | |
Private Attributes | |
| SmartPtr< LineBVHNode< dim > > | m_root |
A Bounding Volume Hierarchy tree for efficient spatial querying of line segments.
The tree is built by recursively splitting the set of lines along the longest axis of their combined bounding box. This reduces spatial query complexity from O(N) to O(log N).
| using ug::d3f::LineBVHTree< dim, TLineData >::line_type = FVLineSourceOrSink<dim, TLineData> |
|
inline |
Builds the BVH from a vector of line segments.
References ug::d3f::LineBVHTree< dim, TLineData >::build_node(), and ug::d3f::LineBVHTree< dim, TLineData >::m_root.
|
inlineprivate |
Internal recursive function to build the tree nodes.
References ug::d3f::LineBVHTree< dim, TLineData >::build_node(), and make_sp().
Referenced by ug::d3f::LineBVHTree< dim, TLineData >::build(), and ug::d3f::LineBVHTree< dim, TLineData >::build_node().
|
inline |
Finds all line segments whose bounding boxes potentially overlap with the query box.
References ug::d3f::LineBVHTree< dim, TLineData >::m_root, and ug::d3f::LineBVHTree< dim, TLineData >::query_node().
|
inlineprivate |
Internal recursive function for spatial querying.
References ug::d3f::LineBVHNode< dim >::bbox, ug::d3f::LineBVHNode< dim >::indices, ug::d3f::LineBVHNode< dim >::is_leaf(), ug::d3f::LineBVHNode< dim >::left, ug::d3f::LineBVHTree< dim, TLineData >::query_node(), and ug::d3f::LineBVHNode< dim >::right.
Referenced by ug::d3f::LineBVHTree< dim, TLineData >::query(), and ug::d3f::LineBVHTree< dim, TLineData >::query_node().
|
private |