FLImaging 6.5.13.1
KDTree.h
1#pragma once
2
11#include "TRect.h"
12
14namespace FLImaging
15{
17 namespace Base
18 {
19 template<typename T>
20 class CFLArray;
21
22 template<template<typename> class T1, typename T2>
23 class CInternalKDTree;
24
44 template<template<typename> class T1, typename T2>
45 class FL_EXPORT CKDTree : public CFLBase
46 {
47 public:
56
68 CKDTree(const CFLArray<T1<T2>>& flaVertices);
69
81 CKDTree(const CFLArray<T1<T2>>* pFlaVertices);
82
90 virtual ~CKDTree();
91
103 const CResult Clear();
104
120 const CResult Build(const CFLArray<T1<T2>>& flaVertices);
121
137 const CResult Build(const CFLArray<T1<T2>>* pFlaVertices);
138
150 int64_t GetCount() const;
151
165 const T1<T2>& GetNearestPoint(const T1<T2>& tpPoint) const;
166
180 size_t GetNearestIndex(const T1<T2>& tpPoint) const;
181
195 std::pair<T1<T2>, size_t> GetNearestPointAndIndex(const T1<T2>& tpPoint) const;
196
197
215 const CResult GetNearestNeighborsPoints(const T1<T2>& tpPoint, int32_t i32NearestNeighborsCount, CFLArray<T1<T2>>& flaResultPoints) const;
216
234 const CResult GetNearestNeighborsIndices(const T1<T2>& tpPoint, int32_t i32NearestNeighborsCount, CFLArray<uint64_t>& flaResultIndices) const;
235
253 const CResult GetNearestNeighborsIndices(const T1<T2>& tpPoint, int32_t i32NearestNeighborsCount, CFLArray<uint32_t>& flaResultIndices) const;
254
274 const CResult GetNearestNeighborsPointsAndIndices(const T1<T2>& tpPoint, int32_t i32NearestNeighborsCount, CFLArray<T1<T2>>& flaResultPoints, CFLArray<uint64_t>& flaResultIndices) const;
275
295 const CResult GetNearestNeighborsPointsAndIndices(const T1<T2>& tpPoint, int32_t i32NearestNeighborsCount, CFLArray<T1<T2>>& flaResultPoints, CFLArray<uint32_t>& flaResultIndices) const;
296
297
315 const CResult GetPointsInRange(const T1<T2>& tpLowerBound, const T1<T2>& tpUpperBound, CFLArray<T1<T2>>& flaResultPoints) const;
316
334 const CResult GetIndicesInRange(const T1<T2>& tpLowerBound, const T1<T2>& tpUpperBound, CFLArray<uint64_t>& flaResultIndices) const;
335
353 const CResult GetIndicesInRange(const T1<T2>& tpLowerBound, const T1<T2>& tpUpperBound, CFLArray<uint32_t>& flaResultIndices) const;
354
374 const CResult GetPointsAndIndicesInRange(const T1<T2>& tpLowerBound, const T1<T2>& tpUpperBound, CFLArray<T1<T2>>& flaResultPoints, CFLArray<uint64_t>& flaResultIndices) const;
375
395 const CResult GetPointsAndIndicesInRange(const T1<T2>& tpLowerBound, const T1<T2>& tpUpperBound, CFLArray<T1<T2>>& flaResultPoints, CFLArray<uint32_t>& flaResultIndices) const;
396
397
398
399
417 const CResult GetPointsInRadius(const T1<T2>& tpCenter, T2 tRadius, CFLArray<T1<T2>>& flaResultPoints) const;
418
436 const CResult GetIndicesInRadius(const T1<T2>& tpCenter, T2 tRadius, CFLArray<uint64_t>& flaResultIndices) const;
437
455 const CResult GetIndicesInRadius(const T1<T2>& tpCenter, T2 tRadius, CFLArray<uint32_t>& flaResultIndices) const;
456
476 const CResult GetPointsAndIndicesInRadius(const T1<T2>& tpCenter, T2 tRadius, CFLArray<T1<T2>>& flaResultPoints, CFLArray<uint64_t>& flaResultIndices) const;
477
497 const CResult GetPointsAndIndicesInRadius(const T1<T2>& tpCenter, T2 tRadius, CFLArray<T1<T2>>& flaResultPoints, CFLArray<uint32_t>& flaResultIndices) const;
498
499
500
501
502
516 const CResult OperateAdd(const T1<T2>& tpVector);
517
531 const CResult OperateMultiply(const T1<T2>& tpVector);
532
533 DeclareGetClassType();
534
535
536 protected:
537
538 CInternalKDTree<T1, T2>* m_pInternal;
539
540 friend class CInternalKDTree<T1, T2>;
541 };
542 }
543}
Template type array class.
Definition RangeTree.h:19
Top-level base class of FLImaging.
Definition FLBase.h:36
KDTree class. Binary Search Tree of K dimensions. .
Definition KDTree.h:46
const CResult GetNearestNeighborsPointsAndIndices(const T1< T2 > &tpPoint, int32_t i32NearestNeighborsCount, CFLArray< T1< T2 > > &flaResultPoints, CFLArray< uint64_t > &flaResultIndices) const
Search for the nearest vertices from the given vertex and return the coordinates and indices of the s...
int64_t GetCount() const
Retrieves the number of elements in the constructed data.
const CResult GetIndicesInRange(const T1< T2 > &tpLowerBound, const T1< T2 > &tpUpperBound, CFLArray< uint32_t > &flaResultIndices) const
Searches for vertices contained within the input range and returns the indices of the found vertices.
const CResult Build(const CFLArray< T1< T2 > > &flaVertices)
Build data.
const CResult GetPointsAndIndicesInRange(const T1< T2 > &tpLowerBound, const T1< T2 > &tpUpperBound, CFLArray< T1< T2 > > &flaResultPoints, CFLArray< uint32_t > &flaResultIndices) const
Searches for vertices contained within the input range and return the coordinates and indices of the ...
virtual ~CKDTree()
Destructor.
const CResult Build(const CFLArray< T1< T2 > > *pFlaVertices)
Build data.
std::pair< T1< T2 >, size_t > GetNearestPointAndIndex(const T1< T2 > &tpPoint) const
After searching for the nearest vertex from the input vertex, it returns the coordinates and index of...
const CResult OperateMultiply(const T1< T2 > &tpVector)
Multiply the input vector element-wise with all nodes.
const CResult GetNearestNeighborsIndices(const T1< T2 > &tpPoint, int32_t i32NearestNeighborsCount, CFLArray< uint32_t > &flaResultIndices) const
Searches for the nearest vertex from the given vertex and returns the index of the found vertex.
const CResult GetPointsInRange(const T1< T2 > &tpLowerBound, const T1< T2 > &tpUpperBound, CFLArray< T1< T2 > > &flaResultPoints) const
Search for the vertices contained within the given radius and return the coordinates of the found ver...
const T1< T2 > & GetNearestPoint(const T1< T2 > &tpPoint) const
After searching for the nearest vertex from the input vertex, it returns the coordinates of the found...
const CResult GetNearestNeighborsIndices(const T1< T2 > &tpPoint, int32_t i32NearestNeighborsCount, CFLArray< uint64_t > &flaResultIndices) const
Searches for the nearest vertex from the given vertex and returns the index of the found vertex.
size_t GetNearestIndex(const T1< T2 > &tpPoint) const
After searching for the nearest vertex from the input vertex, it returns the index of the found verte...
const CResult GetPointsAndIndicesInRange(const T1< T2 > &tpLowerBound, const T1< T2 > &tpUpperBound, CFLArray< T1< T2 > > &flaResultPoints, CFLArray< uint64_t > &flaResultIndices) const
Searches for vertices contained within the input range and return the coordinates and indices of the ...
const CResult GetNearestNeighborsPointsAndIndices(const T1< T2 > &tpPoint, int32_t i32NearestNeighborsCount, CFLArray< T1< T2 > > &flaResultPoints, CFLArray< uint32_t > &flaResultIndices) const
Search for the nearest vertices from the given vertex and return the coordinates and indices of the s...
const CResult GetIndicesInRange(const T1< T2 > &tpLowerBound, const T1< T2 > &tpUpperBound, CFLArray< uint64_t > &flaResultIndices) const
Searches for vertices contained within the input range and returns the indices of the found vertices.
const CResult GetIndicesInRadius(const T1< T2 > &tpCenter, T2 tRadius, CFLArray< uint64_t > &flaResultIndices) const
Searches for vertices contained within the input radius and returns the indices of the found vertices...
const CResult OperateAdd(const T1< T2 > &tpVector)
Add the input vector to all nodes.
const CResult GetIndicesInRadius(const T1< T2 > &tpCenter, T2 tRadius, CFLArray< uint32_t > &flaResultIndices) const
Searches for vertices contained within the input radius and returns the indices of the found vertices...
const CResult GetPointsInRadius(const T1< T2 > &tpCenter, T2 tRadius, CFLArray< T1< T2 > > &flaResultPoints) const
Search for the vertices contained within the given radius and return the coordinates of the found ver...
CKDTree(const CFLArray< T1< T2 > > &flaVertices)
Constructor.
CKDTree(const CFLArray< T1< T2 > > *pFlaVertices)
Constructor.
const CResult GetPointsAndIndicesInRadius(const T1< T2 > &tpCenter, T2 tRadius, CFLArray< T1< T2 > > &flaResultPoints, CFLArray< uint64_t > &flaResultIndices) const
Searches for vertices contained within the input radius and return the coordinates and indices of the...
const CResult GetPointsAndIndicesInRadius(const T1< T2 > &tpCenter, T2 tRadius, CFLArray< T1< T2 > > &flaResultPoints, CFLArray< uint32_t > &flaResultIndices) const
Searches for vertices contained within the input radius and return the coordinates and indices of the...
const CResult GetNearestNeighborsPoints(const T1< T2 > &tpPoint, int32_t i32NearestNeighborsCount, CFLArray< T1< T2 > > &flaResultPoints) const
Searches for the nearest vertex from the given vertex and returns the coordinates of the found vertex...
const CResult Clear()
Clear data.
FLImaging module execution result object.
Definition ResultsDef.h:1514