Jet
v1.3.3
|
Generic k-d tree structure. More...
#include <jet/kdtree.h>
Classes | |
struct | Node |
Simple K-d tree node. More... | |
Public Types | |
typedef Vector< T, K > | Point |
typedef BoundingBox< T, K > | BBox |
typedef std::vector< Point > | ContainerType |
typedef ContainerType::iterator | Iterator |
typedef ContainerType::const_iterator | ConstIterator |
typedef std::vector< Node > | NodeContainerType |
typedef NodeContainerType::iterator | NodeIterator |
typedef NodeContainerType::const_iterator | ConstNodeIterator |
Public Member Functions | |
KdTree () | |
Constructs an empty kD-tree instance. More... | |
void | build (const ConstArrayAccessor1< Point > &points) |
Builds internal acceleration structure for given points list. More... | |
void | forEachNearbyPoint (const Point &origin, T radius, const std::function< void(size_t, const Point &)> &callback) const |
bool | hasNearbyPoint (const Point &origin, T radius) const |
size_t | nearestPoint (const Point &origin) const |
Returns index of the nearest point. More... | |
Iterator | begin () |
Returns the mutable begin iterator of the item. More... | |
Iterator | end () |
Returns the mutable end iterator of the item. More... | |
ConstIterator | begin () const |
Returns the immutable begin iterator of the item. More... | |
ConstIterator | end () const |
Returns the immutable end iterator of the item. More... | |
NodeIterator | beginNode () |
Returns the mutable begin iterator of the node. More... | |
NodeIterator | endNode () |
Returns the mutable end iterator of the node. More... | |
ConstNodeIterator | beginNode () const |
Returns the immutable begin iterator of the node. More... | |
ConstNodeIterator | endNode () const |
Returns the immutable end iterator of the node. More... | |
void | reserve (size_t numPoints, size_t numNodes) |
Reserves memory space for this tree. More... | |
Generic k-d tree structure.
typedef BoundingBox<T, K> jet::KdTree< T, K >::BBox |
typedef ContainerType::const_iterator jet::KdTree< T, K >::ConstIterator |
typedef NodeContainerType::const_iterator jet::KdTree< T, K >::ConstNodeIterator |
typedef std::vector<Point> jet::KdTree< T, K >::ContainerType |
typedef ContainerType::iterator jet::KdTree< T, K >::Iterator |
typedef std::vector<Node> jet::KdTree< T, K >::NodeContainerType |
typedef NodeContainerType::iterator jet::KdTree< T, K >::NodeIterator |
typedef Vector<T, K> jet::KdTree< T, K >::Point |
jet::KdTree< T, K >::KdTree | ( | ) |
Constructs an empty kD-tree instance.
Iterator jet::KdTree< T, K >::begin | ( | ) |
Returns the mutable begin iterator of the item.
ConstIterator jet::KdTree< T, K >::begin | ( | ) | const |
Returns the immutable begin iterator of the item.
NodeIterator jet::KdTree< T, K >::beginNode | ( | ) |
Returns the mutable begin iterator of the node.
ConstNodeIterator jet::KdTree< T, K >::beginNode | ( | ) | const |
Returns the immutable begin iterator of the node.
void jet::KdTree< T, K >::build | ( | const ConstArrayAccessor1< Point > & | points | ) |
Builds internal acceleration structure for given points list.
Iterator jet::KdTree< T, K >::end | ( | ) |
Returns the mutable end iterator of the item.
ConstIterator jet::KdTree< T, K >::end | ( | ) | const |
Returns the immutable end iterator of the item.
NodeIterator jet::KdTree< T, K >::endNode | ( | ) |
Returns the mutable end iterator of the node.
ConstNodeIterator jet::KdTree< T, K >::endNode | ( | ) | const |
Returns the immutable end iterator of the node.
void jet::KdTree< T, K >::forEachNearbyPoint | ( | const Point & | origin, |
T | radius, | ||
const std::function< void(size_t, const Point &)> & | callback | ||
) | const |
Invokes the callback function for each nearby point around the origin within given radius.
[in] | origin | The origin position. |
[in] | radius | The search radius. |
[in] | callback | The callback function. |
bool jet::KdTree< T, K >::hasNearbyPoint | ( | const Point & | origin, |
T | radius | ||
) | const |
Returns true if there are any nearby points for given origin within radius.
[in] | origin | The origin. |
[in] | radius | The radius. |
size_t jet::KdTree< T, K >::nearestPoint | ( | const Point & | origin | ) | const |
Returns index of the nearest point.
void jet::KdTree< T, K >::reserve | ( | size_t | numPoints, |
size_t | numNodes | ||
) |
Reserves memory space for this tree.