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

The class of KD-tree node of axis-aligned bounding box. More...

#include <aaboxkdtree2d.h>

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

Public Types

using ObjectPtr = const ObjectType *
 

Public Member Functions

 AABoxKDTree2dNode (const std::vector< ObjectPtr > &objects, const AABoxKDTreeParams &params, int depth)
 Constructor which takes a vector of objects, parameters and depth of the node. More...
 
ObjectPtr GetNearestObject (const Vec2d &point) const
 Get the nearest object to a target point by the KD-tree rooted at this node. More...
 
std::vector< ObjectPtrGetObjects (const Vec2d &point, const double distance) const
 Get objects within a distance to a point by the KD-tree rooted at this node. More...
 
AABox2d GetBoundingBox () const
 Get the axis-aligned bounding box of the objects. More...
 

Detailed Description

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

The class of KD-tree node of axis-aligned bounding box.

Member Typedef Documentation

◆ ObjectPtr

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

Constructor & Destructor Documentation

◆ AABoxKDTree2dNode()

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

Constructor which takes a vector of objects, parameters and depth of the node.

Parameters
objectsObjects to build the KD-tree node.
paramsParameters to build the KD-tree.
depthDepth of the KD-tree node.

Member Function Documentation

◆ GetBoundingBox()

template<class ObjectType >
AABox2d apollo::common::math::AABoxKDTree2dNode< 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::AABoxKDTree2dNode< ObjectType >::GetNearestObject ( const Vec2d point) const
inline

Get the nearest object to a target point by the KD-tree rooted at this node.

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::AABoxKDTree2dNode< ObjectType >::GetObjects ( const Vec2d point,
const double  distance 
) const
inline

Get objects within a distance to a point by the KD-tree rooted at this node.

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: