Apollo  6.0
Open source self driving car software
Public Types | Public Member Functions | List of all members
apollo::common::math::AABoxKDTree2d< ObjectType > Class Template Reference

The class of KD-tree of Aligned Axis Bounding Box(AABox). More...

#include <aaboxkdtree2d.h>

Collaboration diagram for apollo::common::math::AABoxKDTree2d< ObjectType >:
Collaboration graph

Public Types

using ObjectPtr = const ObjectType *
 

Public Member Functions

 AABoxKDTree2d (const std::vector< ObjectType > &objects, const AABoxKDTreeParams &params)
 Constructor which takes a vector of objects and parameters. More...
 
ObjectPtr GetNearestObject (const Vec2d &point) const
 Get the nearest object to a target point. More...
 
std::vector< ObjectPtrGetObjects (const Vec2d &point, const double distance) const
 Get objects within a distance to a point. More...
 
AABox2d GetBoundingBox () const
 Get the axis-aligned bounding box of the objects. More...
 

Detailed Description

template<class ObjectType>
class apollo::common::math::AABoxKDTree2d< ObjectType >

The class of KD-tree of Aligned Axis Bounding Box(AABox).

Member Typedef Documentation

◆ ObjectPtr

template<class ObjectType >
using apollo::common::math::AABoxKDTree2d< ObjectType >::ObjectPtr = const ObjectType *

Constructor & Destructor Documentation

◆ AABoxKDTree2d()

template<class ObjectType >
apollo::common::math::AABoxKDTree2d< ObjectType >::AABoxKDTree2d ( const std::vector< ObjectType > &  objects,
const AABoxKDTreeParams params 
)
inline

Constructor which takes a vector of objects and parameters.

Parameters
paramsParameters to build the KD-tree.

Member Function Documentation

◆ GetBoundingBox()

template<class ObjectType >
AABox2d apollo::common::math::AABoxKDTree2d< ObjectType >::GetBoundingBox ( ) const
inline

Get the axis-aligned bounding box of the objects.

Returns
The axis-aligned bounding box of the objects.

◆ GetNearestObject()

template<class ObjectType >
ObjectPtr apollo::common::math::AABoxKDTree2d< ObjectType >::GetNearestObject ( const Vec2d point) const
inline

Get the nearest object to a target point.

Parameters
pointThe target point. Search it's nearest object.
Returns
The nearest object to the target point.

◆ GetObjects()

template<class ObjectType >
std::vector<ObjectPtr> apollo::common::math::AABoxKDTree2d< ObjectType >::GetObjects ( const Vec2d point,
const double  distance 
) const
inline

Get objects within a distance to a point.

Parameters
pointThe center point of the range to search objects.
distanceThe radius of the range to search objects.
Returns
All objects within the specified distance to the specified point.

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