ACF $AcfVersion:0$
Public Types | Public Member Functions | List of all members
imath::TKdTree< TPoint, Dimensions > Class Template Reference

#include <TKdTree.h>

Public Types

typedef std::array< double, Dimensions > Coordinate
 
typedef std::function< double(const TPoint &p, uint8_t index)> GetComponentFunc
 
typedef std::function< double(const Coordinate &x, const TPoint &y)> GetDistanceFunc
 

Public Member Functions

 TKdTree (const TKdTree &)=delete
 
TKdTreeoperator= (const TKdTree &)=delete
 
 TKdTree ()
 
template<typename iterator >
void MakeTree (iterator begin, iterator end, const GetComponentFunc &getComponentFunc, const GetDistanceFunc &getDistanceFunc)
 
void MakeTree (const std::function< TPoint(size_t)> &construct, size_t n, const GetComponentFunc &getComponentFunc, const GetDistanceFunc &getDistanceFunc)
 
bool Empty () const
 
bool Nearest (const Coordinate &pt, TPoint &p, double &resultDistance, double maxDistance=std::numeric_limits< double >::max()) const
 
bool KNearest (const Coordinate &pt, std::vector< std::pair< TPoint, double > > &neighborsWithDistance, size_t k) const
 
bool InRadius (const Coordinate &pt, double radius, std::vector< std::pair< TPoint, double > > &pointsWithDistance) const
 

Detailed Description

template<typename TPoint, uint8_t Dimensions>
class imath::TKdTree< TPoint, Dimensions >

Definition at line 15 of file TKdTree.h.

Member Typedef Documentation

◆ Coordinate

template<typename TPoint , uint8_t Dimensions>
typedef std::array<double, Dimensions> imath::TKdTree< TPoint, Dimensions >::Coordinate

Definition at line 18 of file TKdTree.h.

◆ GetComponentFunc

template<typename TPoint , uint8_t Dimensions>
typedef std::function<double(const TPoint& p, uint8_t index)> imath::TKdTree< TPoint, Dimensions >::GetComponentFunc

Definition at line 19 of file TKdTree.h.

◆ GetDistanceFunc

template<typename TPoint , uint8_t Dimensions>
typedef std::function<double(const Coordinate& x, const TPoint& y)> imath::TKdTree< TPoint, Dimensions >::GetDistanceFunc

Definition at line 20 of file TKdTree.h.

Constructor & Destructor Documentation

◆ TKdTree() [1/2]

template<typename TPoint , uint8_t Dimensions>
imath::TKdTree< TPoint, Dimensions >::TKdTree ( const TKdTree< TPoint, Dimensions > &  )
delete

◆ TKdTree() [2/2]

template<typename TPoint , uint8_t Dimensions>
imath::TKdTree< TPoint, Dimensions >::TKdTree ( )
inline

Definition at line 174 of file TKdTree.h.

Member Function Documentation

◆ Empty()

template<typename TPoint , uint8_t Dimensions>
bool imath::TKdTree< TPoint, Dimensions >::Empty ( ) const
inline

Definition at line 211 of file TKdTree.h.

◆ InRadius()

template<typename TPoint , uint8_t Dimensions>
bool imath::TKdTree< TPoint, Dimensions >::InRadius ( const Coordinate pt,
double  radius,
std::vector< std::pair< TPoint, double > > &  pointsWithDistance 
) const
inline

Definition at line 256 of file TKdTree.h.

◆ KNearest()

template<typename TPoint , uint8_t Dimensions>
bool imath::TKdTree< TPoint, Dimensions >::KNearest ( const Coordinate pt,
std::vector< std::pair< TPoint, double > > &  neighborsWithDistance,
size_t  k 
) const
inline

Definition at line 235 of file TKdTree.h.

◆ MakeTree() [1/2]

template<typename TPoint , uint8_t Dimensions>
void imath::TKdTree< TPoint, Dimensions >::MakeTree ( const std::function< TPoint(size_t)> &  construct,
size_t  n,
const GetComponentFunc getComponentFunc,
const GetDistanceFunc getDistanceFunc 
)
inline

Definition at line 195 of file TKdTree.h.

◆ MakeTree() [2/2]

template<typename TPoint , uint8_t Dimensions>
template<typename iterator >
void imath::TKdTree< TPoint, Dimensions >::MakeTree ( iterator  begin,
iterator  end,
const GetComponentFunc getComponentFunc,
const GetDistanceFunc getDistanceFunc 
)
inline

Definition at line 179 of file TKdTree.h.

◆ Nearest()

template<typename TPoint , uint8_t Dimensions>
bool imath::TKdTree< TPoint, Dimensions >::Nearest ( const Coordinate pt,
TPoint &  p,
double &  resultDistance,
double  maxDistance = std::numeric_limits<double>::max() 
) const
inline

Definition at line 216 of file TKdTree.h.

◆ operator=()

template<typename TPoint , uint8_t Dimensions>
TKdTree & imath::TKdTree< TPoint, Dimensions >::operator= ( const TKdTree< TPoint, Dimensions > &  )
delete

The documentation for this class was generated from the following file: