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

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

#include <Rtree.h>

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

Public Types

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

Public Member Functions

template<typename Geometry >
std::vector< TreeElementGetIntersections (const Geometry &geometry) const
 Returns segments that intersec the specified geometry Warning: intersection between 3D segments is not implemented by boost. More...
 
template<typename Geometry >
std::vector< TreeElementGetNearestNeighbours (const Geometry &geometry, size_t number_neighbours=1) const
 
template<typename Geometry , typename Filter >
std::vector< TreeElementGetNearestNeighboursWithFilter (const Geometry &geometry, Filter filter, size_t number_neighbours=1) const
 Return nearest neighbors with a user defined filter. More...
 
size_t GetTreeSize () const
 
void InsertElement (const BSegment &segment, const T &element_start, const T &element_end)
 
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::SegmentCloudRtree< T, Dimension >

Rtree class working with 3D segment clouds.

Stores a pair of T elements (one for each end of the segment) Useful to perform fast k-NN searches.

Definition at line 78 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::SegmentCloudRtree< T, Dimension >::BPoint

Definition at line 81 of file Rtree.h.

◆ BSegment

template<typename T, size_t Dimension = 3>
typedef boost::geometry::model::segment<BPoint> carla::geom::SegmentCloudRtree< T, Dimension >::BSegment

Definition at line 82 of file Rtree.h.

◆ TreeElement

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

Definition at line 83 of file Rtree.h.

Member Function Documentation

◆ GetIntersections()

template<typename T, size_t Dimension = 3>
template<typename Geometry >
std::vector<TreeElement> carla::geom::SegmentCloudRtree< T, Dimension >::GetIntersections ( const Geometry &  geometry) const
inline

Returns segments that intersec the specified geometry Warning: intersection between 3D segments is not implemented by boost.

Definition at line 127 of file Rtree.h.

◆ GetNearestNeighbours()

template<typename T, size_t Dimension = 3>
template<typename Geometry >
std::vector<TreeElement> carla::geom::SegmentCloudRtree< T, Dimension >::GetNearestNeighbours ( const Geometry &  geometry,
size_t  number_neighbours = 1 
) const
inline

Definition at line 116 of file Rtree.h.

◆ GetNearestNeighboursWithFilter()

template<typename T, size_t Dimension = 3>
template<typename Geometry , typename Filter >
std::vector<TreeElement> carla::geom::SegmentCloudRtree< T, Dimension >::GetNearestNeighboursWithFilter ( const Geometry &  geometry,
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 103 of file Rtree.h.

◆ GetTreeSize()

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

Definition at line 135 of file Rtree.h.

◆ InsertElement() [1/2]

template<typename T, size_t Dimension = 3>
void carla::geom::SegmentCloudRtree< T, Dimension >::InsertElement ( const BSegment segment,
const T &  element_start,
const T &  element_end 
)
inline

Definition at line 85 of file Rtree.h.

◆ InsertElement() [2/2]

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

Definition at line 89 of file Rtree.h.

◆ InsertElements()

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

Definition at line 93 of file Rtree.h.

Member Data Documentation

◆ _rtree

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

Definition at line 141 of file Rtree.h.


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