|
| PointKDTree (size_t nodes=0, Heuristic heuristic=SlidingMidpoint) |
| Create an empty KD-tree that can hold the specified number of points.
|
|
void | setBoundingBox (const BoundingBoxType &bbox) |
| Set the BoundingBox of the underlying point data.
|
|
const BoundingBoxType & | getBoundingBox () const |
| Return the BoundingBox of the underlying point data.
|
|
size_t | getDepth () const |
| Return the depth of the constructed KD-tree.
|
|
void | setDepth (size_t depth) |
| Set the depth of the constructed KD-tree (be careful with this)
|
|
void | build (bool recomputeBoundingBox=false) |
| Construct the KD-tree hierarchy. More...
|
|
void | search (const PointType &p, float searchRadius, std::vector< IndexType > &results) const |
| Run a search query. More...
|
|
size_t | nnSearch (const PointType &p, float &_sqrSearchRadius, size_t k, SearchResult *results) const |
| Run a k-nearest-neighbor search query. More...
|
|
size_t | nnSearch (const PointType &p, size_t k, SearchResult *results) const |
| Run a k-nearest-neighbor search query without any search radius threshold. More...
|
|
|
void | clear () |
| Clear the kd-tree array.
|
|
void | resize (size_t size) |
| Resize the kd-tree array.
|
|
void | reserve (size_t size) |
| Reserve a certain amount of memory for the kd-tree array.
|
|
size_t | size () const |
| Return the size of the kd-tree.
|
|
size_t | capacity () const |
| Return the capacity of the kd-tree.
|
|
void | push_back (const NodeType &node) |
| Append a kd-tree node to the node array.
|
|
NodeType & | operator[] (size_t idx) |
| Return one of the KD-tree nodes by index.
|
|
const NodeType & | operator[] (size_t idx) const |
| Return one of the KD-tree nodes by index (const version)
|
|
template<typename _NodeType>
class PointKDTree< _NodeType >
Generic multi-dimensional kd-tree data structure for point data.
This class organizes point data in a hierarchical manner so various types of queries can be performed efficiently. It supports several heuristics for building `‘good’' trees, and it is oblivious to the data layout of the nodes themselves.
- Template Parameters
-
_NodeType | Underlying node data structure. See GenericKDTreeNode as an example for the required public interface |
- See also
- GenericKDTreeNode
Definition at line 124 of file kdtree.h.
template<typename _NodeType >
void PointKDTree< _NodeType >::build |
( |
bool |
recomputeBoundingBox = false | ) |
|
|
inline |
Construct the KD-tree hierarchy.
When only adding nodes using the push_back() function, the bounding box is already computed, hence true
can be passed to this function to avoid an unnecessary recomputation.
Definition at line 221 of file kdtree.h.