CARLA
Public Types | Public Member Functions | Private Attributes | List of all members
carla::geom::PointCloudRtree< T, Dimension > Class Template Reference

Rtree class working with 3D point clouds. More...

#include <Rtree.h>

+ Collaboration diagram for carla::geom::PointCloudRtree< T, Dimension >:

Public Types

typedef boost::geometry::model::point< float, Dimension, boost::geometry::cs::cartesian > BPoint
 
typedef std::pair< BPoint, T > TreeElement
 

Public Member Functions

std::vector< TreeElementGetNearestNeighbours (const BPoint &point, size_t number_neighbours=1) const
 
template<typename Filter >
std::vector< TreeElementGetNearestNeighboursWithFilter (const BPoint &point, Filter filter, size_t number_neighbours=1) const
 Return nearest neighbors with a user defined filter. More...
 
size_t GetTreeSize () const
 
void InsertElement (const BPoint &point, const T &element)
 
void InsertElement (const TreeElement &element)
 
void InsertElements (const std::vector< TreeElement > &elements)
 

Private Attributes

boost::geometry::index::rtree< TreeElement, boost::geometry::index::linear< 16 > > _rtree
 

Detailed Description

template<typename T, size_t Dimension = 3>
class carla::geom::PointCloudRtree< T, Dimension >

Rtree class working with 3D point clouds.

Asociates a T element with a 3D point Useful to perform fast k-NN searches

Definition at line 22 of file Rtree.h.

Member Typedef Documentation

◆ BPoint

template<typename T , size_t Dimension = 3>
typedef boost::geometry::model::point<float, Dimension, boost::geometry::cs::cartesian> carla::geom::PointCloudRtree< T, Dimension >::BPoint

Definition at line 25 of file Rtree.h.

◆ TreeElement

template<typename T , size_t Dimension = 3>
typedef std::pair<BPoint, T> carla::geom::PointCloudRtree< T, Dimension >::TreeElement

Definition at line 26 of file Rtree.h.

Member Function Documentation

◆ GetNearestNeighbours()

template<typename T , size_t Dimension = 3>
std::vector<TreeElement> carla::geom::PointCloudRtree< T, Dimension >::GetNearestNeighbours ( const BPoint point,
size_t  number_neighbours = 1 
) const
inline

Definition at line 57 of file Rtree.h.

References carla::geom::PointCloudRtree< T, Dimension >::_rtree.

◆ GetNearestNeighboursWithFilter()

template<typename T , size_t Dimension = 3>
template<typename Filter >
std::vector<TreeElement> carla::geom::PointCloudRtree< T, Dimension >::GetNearestNeighboursWithFilter ( const BPoint point,
Filter  filter,
size_t  number_neighbours = 1 
) const
inline

Return nearest neighbors with a user defined filter.

The filter reveices as an argument a TreeElement value and needs to return a bool to accept or reject the value [&](Rtree::TreeElement const &element){if (IsOk(element)) return true; else return false;}

Definition at line 46 of file Rtree.h.

References carla::geom::PointCloudRtree< T, Dimension >::_rtree.

◆ GetTreeSize()

template<typename T , size_t Dimension = 3>
size_t carla::geom::PointCloudRtree< T, Dimension >::GetTreeSize ( ) const
inline

Definition at line 64 of file Rtree.h.

References carla::geom::PointCloudRtree< T, Dimension >::_rtree.

◆ InsertElement() [1/2]

template<typename T , size_t Dimension = 3>
void carla::geom::PointCloudRtree< T, Dimension >::InsertElement ( const BPoint point,
const T &  element 
)
inline

Definition at line 28 of file Rtree.h.

References carla::geom::PointCloudRtree< T, Dimension >::_rtree.

◆ InsertElement() [2/2]

template<typename T , size_t Dimension = 3>
void carla::geom::PointCloudRtree< T, Dimension >::InsertElement ( const TreeElement element)
inline

Definition at line 32 of file Rtree.h.

References carla::geom::PointCloudRtree< T, Dimension >::_rtree.

◆ InsertElements()

template<typename T , size_t Dimension = 3>
void carla::geom::PointCloudRtree< T, Dimension >::InsertElements ( const std::vector< TreeElement > &  elements)
inline

Definition at line 36 of file Rtree.h.

References carla::geom::PointCloudRtree< T, Dimension >::_rtree.

Member Data Documentation

◆ _rtree

template<typename T , size_t Dimension = 3>
boost::geometry::index::rtree<TreeElement, boost::geometry::index::linear<16> > carla::geom::PointCloudRtree< T, Dimension >::_rtree
private

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