Ponca  84886bac0b52a686e88046a375da13f12f2b87d2
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::KdTree< DataPoint > Struct Template Reference

Abstract KdTree type with KdTreeDefaultTraits. More...

#include <kdTree.h>

+ Inheritance diagram for Ponca::KdTree< DataPoint >:
+ Collaboration diagram for Ponca::KdTree< DataPoint >:

Additional Inherited Members

- Public Types inherited from Ponca::KdTreeBase< KdTreeDefaultTraits< DataPoint > >
using DataPoint = typename Traits::DataPoint
 DataPoint given by user via Traits.
 
using IndexType = typename Traits::IndexType
 Type used to index points into the PointContainer.
 
using LeafSizeType = typename Traits::LeafSizeType
 Type used to store the size of leaf nodes.
 
using PointContainer = typename Traits::PointContainer
 Container for DataPoint used inside the KdTree.
 
using IndexContainer = typename Traits::IndexContainer
 Container for indices used inside the KdTree.
 
using NodeIndexType = typename Traits::NodeIndexType
 Type used to index nodes into the NodeContainer.
 
using NodeType = typename Traits::NodeType
 Type of nodes used inside the KdTree.
 
using NodeContainer = typename Traits::NodeContainer
 Container for nodes used inside the KdTree.
 
using Scalar = typename DataPoint::Scalar
 Scalar given by user via DataPoint.
 
using VectorType = typename DataPoint::VectorType
 VectorType given by user via DataPoint.
 
using AabbType = typename NodeType::AabbType
 Bounding box type given by user via NodeType.
 
- Public Member Functions inherited from Ponca::KdTreeBase< KdTreeDefaultTraits< DataPoint > >
void build (PointUserContainer &&points, Converter c)
 Generate a tree from a custom contained type converted using the specified converter.
 
void build (PointUserContainer &&points)
 Generate a tree from a custom contained type converted using DefaultConverter.
 
void build (PointUserContainer &&points, Converter c)
 
void clear ()
 Clear tree data.
 
NodeIndexType node_count () const
 
IndexType sample_count () const
 
IndexType pointCount () const
 
NodeIndexType leaf_count () const
 
PointContainerpoints ()
 
const PointContainerpoints () const
 
const NodeContainernodes () const
 
const IndexContainersamples () const
 
LeafSizeType minCellSize () const
 Read leaf min size.
 
void setMinCellSize (LeafSizeType min_cell_size)
 Write leaf min size.
 
IndexType pointFromSample (IndexType sample_index) const
 Return the point index associated with the specified sample index.
 
DataPointpointDataFromSample (IndexType sample_index)
 Return the DataPoint associated with the specified sample index.
 
const DataPointpointDataFromSample (IndexType sample_index) const
 Return the DataPoint associated with the specified sample index.
 
KdTreeKNearestPointQuery< KdTreeDefaultTraits< DataPoint > > kNearestNeighbors (const VectorType &point, IndexType k) const
 Computes a Query object to iterate over the k-nearest neighbors of a point. The returned object can be reset and reused with the () operator (using the same argument types as parameters).
 
KdTreeKNearestIndexQuery< KdTreeDefaultTraits< DataPoint > > kNearestNeighbors (IndexType index, IndexType k) const
 Computes a Query object to iterate over the k-nearest neighbors of a point. The returned object can be reset and reused with the () operator (using the same argument types as parameters).
 
KdTreeKNearestPointQuery< KdTreeDefaultTraits< DataPoint > > kNearestNeighborsQuery () const
 Convenience function that provides an empty k-nearest neighbors Query object.
 
KdTreeKNearestIndexQuery< KdTreeDefaultTraits< DataPoint > > kNearestNeighborsIndexQuery () const
 Convenience function that provides an empty k-nearest neighbors Query object.
 
KdTreeNearestPointQuery< KdTreeDefaultTraits< DataPoint > > nearestNeighbor (const VectorType &point) const
 Computes a Query object that contains the nearest point. The returned object can be reset and reused with the () operator (using the same argument types as parameters).
 
KdTreeNearestIndexQuery< KdTreeDefaultTraits< DataPoint > > nearestNeighbor (IndexType index) const
 Computes a Query object that contains the nearest point. The returned object can be reset and reused with the () operator (using the same argument types as parameters).
 
KdTreeNearestIndexQuery< KdTreeDefaultTraits< DataPoint > > nearestNeighborQuery () const
 Convenience function that provides an empty nearest neighbor Query object.
 
KdTreeNearestIndexQuery< KdTreeDefaultTraits< DataPoint > > nearestNeighborIndexQuery () const
 Convenience function that provides an empty nearest neighbor Query object.
 
KdTreeRangePointQuery< KdTreeDefaultTraits< DataPoint > > rangeNeighbors (const VectorType &point, Scalar r) const
 Computes a Query object to iterate over the neighbors that are inside a given radius. The returned object can be reset and reused with the () operator (using the same argument types as parameters).
 
KdTreeRangeIndexQuery< KdTreeDefaultTraits< DataPoint > > rangeNeighbors (IndexType index, Scalar r) const
 Computes a Query object to iterate over the neighbors that are inside a given radius. The returned object can be reset and reused with the () operator (using the same argument types as parameters).
 
KdTreeRangePointQuery< KdTreeDefaultTraits< DataPoint > > rangeNeighborsQuery () const
 Convenience function that provides an empty range neighbor Query object.
 
KdTreeRangeIndexQuery< KdTreeDefaultTraits< DataPoint > > rangeNeighborsIndexQuery () const
 KdTreeBase::rangeNeighborsQuery.
 
bool valid () const
 
void print (std::ostream &os, bool verbose=false) const
 
void buildWithSampling (PointUserContainer &&points, IndexUserContainer sampling, Converter c)
 
- Static Public Attributes inherited from Ponca::KdTreeBase< KdTreeDefaultTraits< DataPoint > >
static constexpr std::size_t MAX_NODE_COUNT
 The maximum number of nodes that the kd-tree can have.
 
static constexpr std::size_t MAX_POINT_COUNT
 The maximum number of points that can be stored in the kd-tree.
 
static constexpr int MAX_DEPTH
 The maximum depth of the kd-tree.
 
static constexpr bool SUPPORTS_SUBSAMPLING
 
- Protected Member Functions inherited from Ponca::KdTreeBase< KdTreeDefaultTraits< DataPoint > >
void buildWithSampling (PointUserContainer &&points, IndexUserContainer sampling, Converter c)
 Generate a tree sampled from a custom contained type converted using a Converter
 
void buildWithSampling (PointUserContainer &&points, IndexUserContainer sampling)
 Generate a tree sampled from a custom contained type converted using a KdTreeBase::DefaultConverter.
 
- Protected Attributes inherited from Ponca::KdTreeBase< KdTreeDefaultTraits< DataPoint > >
PointContainer m_points
 
NodeContainer m_nodes
 
IndexContainer m_indices
 
LeafSizeType m_min_cell_size
 Minimal number of points per leaf.
 
NodeIndexType m_leaf_count
 Number of leaves in the Kdtree (computed during construction)
 

Detailed Description

template<typename DataPoint>
struct Ponca::KdTree< DataPoint >

Abstract KdTree type with KdTreeDefaultTraits.

See also
KdTreeDefaultTraits for the default trait interface documentation.
KdTreeBase for complete API
Warning
It is not possible to create instances of type KdTree. This type must only be used to store pointers to KdTreeDense or KdTreeSparse objects, e.g. the declaration
// Abstract pointer type that can receive KdTreeSparse or KdTreeDense objects
Ponca::KdTree<DataPoint> *kdtree {nullptr};
Abstract KdTree type with KdTreeDefaultTraits.
Definition kdTree.h:47
// Assign sparse
kdtree = &kdtreeSparse; // Or kdtree = new Ponca::KdTreeSparse<DataPoint> (points, sampling);
// Assign dense
kdtree = &kdtreeDense; // Or kdtree = new Ponca::KdTreeDense<DataPoint> (points, sampling);
[KdTree type definition]

Definition at line 47 of file kdTree.h.