CCCoreLib 31 May 2022
CloudCompare Core algorithms
|
Proper KD-tree implementation. More...
#include <TrueKdTree.h>
Classes | |
class | BaseNode |
Tree base node. More... | |
class | Leaf |
Tree leaf. More... | |
class | Node |
Tree node. More... | |
Public Types | |
using | LeafVector = std::vector< Leaf * > |
A vector of leaves. | |
Public Member Functions | |
TrueKdTree (GenericIndexedCloudPersist *cloud) | |
Default constructor. | |
~TrueKdTree () | |
Destructor. | |
GenericIndexedCloudPersist * | associatedCloud () const |
Returns the associated cloud. | |
bool | build (double maxError, DistanceComputationTools::ERROR_MEASURES errorMeasure=DistanceComputationTools::RMS, unsigned minPointCountPerCell=3, unsigned maxPointCountPerCell=0, GenericProgressCallback *progressCb=nullptr) |
Builds KD-tree. More... | |
void | clear () |
Clears structure. | |
double | getMaxError () const |
Returns max error threshold used for planarity-based split strategy. | |
DistanceComputationTools::ERROR_MEASURES | getMaxErrorType () const |
Returns max error estimator used for planarity-based split strategy. | |
bool | getLeaves (LeafVector &leaves) const |
Returns all leaf nodes. | |
Static Public Attributes | |
static const uint8_t | X_DIM = 0 |
static const uint8_t | Y_DIM = 1 |
static const uint8_t | Z_DIM = 2 |
static const uint8_t | NODE_TYPE = 0 |
static const uint8_t | LEAF_TYPE = 1 |
Protected Member Functions | |
BaseNode * | split (ReferenceCloud *subset) |
Recursive split process. | |
Protected Attributes | |
BaseNode * | m_root |
Root node. | |
GenericIndexedCloudPersist * | m_associatedCloud |
Associated cloud. | |
double | m_maxError |
Max error for planarity-based split strategy (see m_errorMeasure) | |
DistanceComputationTools::ERROR_MEASURES | m_errorMeasure |
Error measurement. | |
unsigned | m_minPointCountPerCell |
Min number of points per cell (speed-up) More... | |
unsigned | m_maxPointCountPerCell |
Max number of points per cell (speed-up) More... | |
Proper KD-tree implementation.
bool TrueKdTree::build | ( | double | maxError, |
DistanceComputationTools::ERROR_MEASURES | errorMeasure = DistanceComputationTools::RMS , |
||
unsigned | minPointCountPerCell = 3 , |
||
unsigned | maxPointCountPerCell = 0 , |
||
GenericProgressCallback * | progressCb = nullptr |
||
) |
Builds KD-tree.
maxError | maximum error per cell (relatively to the best LS plane fit) |
errorMeasure | error measurement |
minPointCountPerCell | minimum number of points per cell (can't be smaller than 3) |
maxPointCountPerCell | maximum number of points per cell (speed-up - ignored if < 6) |
progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
|
protected |
Max number of points per cell (speed-up)
Ignored if < 6
|
protected |
Min number of points per cell (speed-up)
Can't be < 3