Ponca  e26a0e88a45818354616c1a7180bcd203aecad3c
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::KdTreeDenseBase< Traits > Class Template Reference

Customizable base class for dense KdTree datastructure. More...

#include <kdTree.h>

+ Inheritance diagram for Ponca::KdTreeDenseBase< Traits >:
+ Collaboration diagram for Ponca::KdTreeDenseBase< Traits >:

Public Member Functions

 KdTreeDenseBase ()=default
 Default constructor creating an empty tree.
 
template<typename PointUserContainer >
 KdTreeDenseBase (PointUserContainer &&points)
 Constructor generating a tree from a custom contained type converted using a KdTreeBase::DefaultConverter.
 
- Public Member Functions inherited from Ponca::KdTreeBase< Traits >
template<typename PointUserContainer , typename Converter >
void build (PointUserContainer &&points, Converter c)
 Generate a tree from a custom contained type converted using the specified converter.
 
template<typename PointUserContainer >
void build (PointUserContainer &&points)
 Generate a tree from a custom contained type converted using DefaultConverter.
 
void clear ()
 Clear tree data.
 
NodeIndexType node_count () const
 
IndexType sample_count () const
 
IndexType point_count () const
 
NodeIndexType leaf_count () const
 
PointContainerpoints ()
 
const PointContainerpoints () const
 
const NodeContainernodes () const
 
const IndexContainersamples () const
 
LeafSizeType min_cell_size () const
 Read leaf min size.
 
void set_min_cell_size (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< Traits > k_nearest_neighbors (const VectorType &point, IndexType k) const
 
KdTreeKNearestIndexQuery< Traits > k_nearest_neighbors (IndexType index, IndexType k) const
 
KdTreeNearestPointQuery< Traits > nearest_neighbor (const VectorType &point) const
 
KdTreeNearestIndexQuery< Traits > nearest_neighbor (IndexType index) const
 
KdTreeRangePointQuery< Traits > range_neighbors (const VectorType &point, Scalar r) const
 
KdTreeRangeIndexQuery< Traits > range_neighbors (IndexType index, Scalar r) const
 
bool valid () const
 
void print (std::ostream &os, bool verbose=false) const
 
template<typename PointUserContainer , typename Converter >
void build (PointUserContainer &&points, Converter c)
 
template<typename PointUserContainer , typename IndexUserContainer , typename Converter >
void buildWithSampling (PointUserContainer &&points, IndexUserContainer sampling, Converter c)
 

Additional Inherited Members

- Public Types inherited from Ponca::KdTreeBase< Traits >
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.
 
- Static Public Attributes inherited from Ponca::KdTreeBase< Traits >
static constexpr std::size_t MAX_NODE_COUNT = NodeType::MAX_COUNT
 The maximum number of nodes that the kd-tree can have.
 
static constexpr std::size_t MAX_POINT_COUNT = std::size_t(2) << sizeof(IndexType)*8
 The maximum number of points that can be stored in the kd-tree.
 
static constexpr int MAX_DEPTH = Traits::MAX_DEPTH
 The maximum depth of the kd-tree.
 
static constexpr bool SUPPORTS_SUBSAMPLING = false
 
- Protected Member Functions inherited from Ponca::KdTreeBase< Traits >
template<typename PointUserContainer , typename IndexUserContainer , typename Converter >
void buildWithSampling (PointUserContainer &&points, IndexUserContainer sampling, Converter c)
 Generate a tree sampled from a custom contained type converted using a Converter
 
template<typename PointUserContainer , typename IndexUserContainer >
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< Traits >
PointContainer m_points
 
NodeContainer m_nodes
 
IndexContainer m_indices
 
LeafSizeType m_min_cell_size {64}
 Minimal number of points per leaf.
 
NodeIndexType m_leaf_count {0}
 Number of leaves in the Kdtree (computed during construction)
 

Detailed Description

template<typename Traits>
class Ponca::KdTreeDenseBase< Traits >

Customizable base class for dense KdTree datastructure.

This version of the KdTree does not support subsampling. For an implementation that supports subsampling, see KdTreeSparseBase.

See also
Ponca::KdTreeDense
Ponca::KdTreeSparse
Template Parameters
TraitsTraits type providing the types and constants used by the kd-tree. Must have the same interface as the default traits type.
See also
KdTreeDefaultTraits for the trait interface documentation.

Definition at line 352 of file kdTree.h.

Constructor & Destructor Documentation

◆ KdTreeDenseBase() [1/2]

template<typename Traits >
Ponca::KdTreeDenseBase< Traits >::KdTreeDenseBase ( )
default

Default constructor creating an empty tree.

See also
build

◆ KdTreeDenseBase() [2/2]

template<typename Traits >
template<typename PointUserContainer >
Ponca::KdTreeDenseBase< Traits >::KdTreeDenseBase ( PointUserContainer &&  points)
inlineexplicit

Constructor generating a tree from a custom contained type converted using a KdTreeBase::DefaultConverter.

Definition at line 364 of file kdTree.h.