Files Class List
PointCloudN< TYPE, DIMENSIONS > Class Template Reference

Detailed Description

template<typename TYPE, uint32_t DIMENSIONS>
class cy::PointCloudN< TYPE, DIMENSIONS >

A multi-dimensional point cloud using a k-d tree.

+ Inheritance diagram for PointCloudN< TYPE, DIMENSIONS >:

Public Member Functions

Constructors and Destructor
uint32_t GetPointCount () const
 
const Point< TYPE, DIMENSIONS > & GetPoint (uint32_t i) const
 
uint32_t GetPointIndex (uint32_t i) const
 
void Build (uint32_t numPts, const Point< TYPE, DIMENSIONS > *pts)
 
void Build (uint32_t numPts, const Point< TYPE, DIMENSIONS > *pts, const uint32_t *customIndices)
 
void BuildWithFunc (uint32_t numPts, PointPosFunc ptPosFunc)
 
void BuildWithFunc (uint32_t numPts, PointPosFunc ptPosFunc, CustomIndexFunc custIndexFunc)
 
void GetPoints (const Point< TYPE, DIMENSIONS > &position, TYPE radius, _CALLBACK pointFound)
 
int GetPoints (const Point< TYPE, DIMENSIONS > &position, TYPE radius, uint32_t maxCount, PointInfo *closestPoints)
 
int GetPoints (const Point< TYPE, DIMENSIONS > &position, uint32_t maxCount, PointInfo *closestPoints)
 
Closest point methods
bool GetClosest (const Point< TYPE, DIMENSIONS > &position, TYPE radius, uint32_t &closestIndex, Point< TYPE, DIMENSIONS > &closestPosition, TYPE &closestDistanceSquared)
 
bool GetClosest (const Point< TYPE, DIMENSIONS > &position, uint32_t &closestIndex, Point< TYPE, DIMENSIONS > &closestPosition, TYPE &closestDistanceSquared)
 
bool GetClosest (const Point< TYPE, DIMENSIONS > &position, TYPE radius, uint32_t &closestIndex, Point< TYPE, DIMENSIONS > &closestPosition)
 
bool GetClosest (const Point< TYPE, DIMENSIONS > &position, uint32_t &closestIndex, Point< TYPE, DIMENSIONS > &closestPosition)
 
bool GetClosestIndex (const Point< TYPE, DIMENSIONS > &position, TYPE radius, uint32_t &closestIndex)
 
bool GetClosestIndex (const Point< TYPE, DIMENSIONS > &position, uint32_t &closestIndex)
 
bool GetClosestPosition (const Point< TYPE, DIMENSIONS > &position, TYPE radius, Point< TYPE, DIMENSIONS > &closestPosition)
 
bool GetClosestPosition (const Point< TYPE, DIMENSIONS > &position, Point< TYPE, DIMENSIONS > &closestPosition)
 
bool GetClosestDistanceSquared (const Point< TYPE, DIMENSIONS > &position, TYPE radius, TYPE &closestDistanceSquared)
 
bool GetClosestDistanceSquared (const Point< TYPE, DIMENSIONS > &position, TYPE &closestDistanceSquared)
 

Member Function Documentation

§ GetPointCount()

uint32_t GetPointCount ( ) const
inherited

@ Access to internal data

Returns the point count

§ GetPoint()

const Point< TYPE, DIMENSIONS > & GetPoint ( uint32_t  i) const
inherited

Returns the point at position i.

§ GetPointIndex()

uint32_t GetPointIndex ( uint32_t  i) const
inherited

Returns the index of the point at position i.

§ Build() [1/2]

void Build ( uint32_t  numPts,
const Point< TYPE, DIMENSIONS > *  pts 
)
inherited

@ Initialization

Builds a k-d tree for the given points. The positions are stored internally.

§ Build() [2/2]

void Build ( uint32_t  numPts,
const Point< TYPE, DIMENSIONS > *  pts,
const uint32_t *  customIndices 
)
inherited

Builds a k-d tree for the given points. The positions are stored internally, along with the indices to the given array.

§ BuildWithFunc() [1/2]

void BuildWithFunc ( uint32_t  numPts,
PointPosFunc  ptPosFunc 
)
inherited

Builds a k-d tree for the given points. The positions are stored internally, retrieved from the given function.

§ BuildWithFunc() [2/2]

void BuildWithFunc ( uint32_t  numPts,
PointPosFunc  ptPosFunc,
CustomIndexFunc  custIndexFunc 
)
inherited

Builds a k-d tree for the given points. The positions are stored internally, along with the indices to the given array. The positions and custom indices are retrieved from the given functions.

§ GetPoints() [1/3]

void GetPoints ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
_CALLBACK  pointFound 
)
inherited

@ General search methods

Returns all points to the given position within the given radius. Calls the given pointFound function for each point found.

The given pointFound function can reduce the radiusSquared value. However, increasing the radiusSquared value can have unpredictable results. The callback function must be in the following form:

void _CALLBACK(SIZE_TYPE index, const PointType &p, FType distanceSquared, FType &radiusSquared)

§ GetPoints() [2/3]

int GetPoints ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
uint32_t  maxCount,
PointInfo *  closestPoints 
)
inherited

Returns the closest points to the given position within the given radius. It returns the number of points found.

§ GetPoints() [3/3]

int GetPoints ( const Point< TYPE, DIMENSIONS > &  position,
uint32_t  maxCount,
PointInfo *  closestPoints 
)
inherited

Returns the closest points to the given position. It returns the number of points found.

§ GetClosest() [1/4]

bool GetClosest ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
uint32_t &  closestIndex,
Point< TYPE, DIMENSIONS > &  closestPosition,
TYPE &  closestDistanceSquared 
)
inherited

Returns the closest point to the given position within the given radius. It returns true, if a point is found.

§ GetClosest() [2/4]

bool GetClosest ( const Point< TYPE, DIMENSIONS > &  position,
uint32_t &  closestIndex,
Point< TYPE, DIMENSIONS > &  closestPosition,
TYPE &  closestDistanceSquared 
)
inherited

Returns the closest point to the given position. It returns true, if a point is found.

§ GetClosest() [3/4]

bool GetClosest ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
uint32_t &  closestIndex,
Point< TYPE, DIMENSIONS > &  closestPosition 
)
inherited

Returns the closest point index and position to the given position within the given index. It returns true, if a point is found.

§ GetClosest() [4/4]

bool GetClosest ( const Point< TYPE, DIMENSIONS > &  position,
uint32_t &  closestIndex,
Point< TYPE, DIMENSIONS > &  closestPosition 
)
inherited

Returns the closest point index and position to the given position. It returns true, if a point is found.

§ GetClosestIndex() [1/2]

bool GetClosestIndex ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
uint32_t &  closestIndex 
)
inherited

Returns the closest point index to the given position within the given radius. It returns true, if a point is found.

§ GetClosestIndex() [2/2]

bool GetClosestIndex ( const Point< TYPE, DIMENSIONS > &  position,
uint32_t &  closestIndex 
)
inherited

Returns the closest point index to the given position. It returns true, if a point is found.

§ GetClosestPosition() [1/2]

bool GetClosestPosition ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
Point< TYPE, DIMENSIONS > &  closestPosition 
)
inherited

Returns the closest point position to the given position within the given radius. It returns true, if a point is found.

§ GetClosestPosition() [2/2]

bool GetClosestPosition ( const Point< TYPE, DIMENSIONS > &  position,
Point< TYPE, DIMENSIONS > &  closestPosition 
)
inherited

Returns the closest point position to the given position. It returns true, if a point is found.

§ GetClosestDistanceSquared() [1/2]

bool GetClosestDistanceSquared ( const Point< TYPE, DIMENSIONS > &  position,
TYPE  radius,
TYPE &  closestDistanceSquared 
)
inherited

Returns the closest point distance squared to the given position within the given radius. It returns true, if a point is found.

§ GetClosestDistanceSquared() [2/2]

bool GetClosestDistanceSquared ( const Point< TYPE, DIMENSIONS > &  position,
TYPE &  closestDistanceSquared 
)
inherited

Returns the closest point distance squared to the given position. It returns true, if a point is found.