CCCoreLib 31 May 2022
CloudCompare Core algorithms
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CCCoreLib::TrueKdTree Class Reference

Proper KD-tree implementation. More...

#include <TrueKdTree.h>

Collaboration diagram for CCCoreLib::TrueKdTree:
Collaboration graph
[legend]

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.
 
GenericIndexedCloudPersistassociatedCloud () 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

BaseNodesplit (ReferenceCloud *subset)
 Recursive split process.
 

Protected Attributes

BaseNodem_root
 Root node.
 
GenericIndexedCloudPersistm_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...
 

Detailed Description

Proper KD-tree implementation.

Member Function Documentation

◆ build()

bool TrueKdTree::build ( double  maxError,
DistanceComputationTools::ERROR_MEASURES  errorMeasure = DistanceComputationTools::RMS,
unsigned  minPointCountPerCell = 3,
unsigned  maxPointCountPerCell = 0,
GenericProgressCallback progressCb = nullptr 
)

Builds KD-tree.

Parameters
maxErrormaximum error per cell (relatively to the best LS plane fit)
errorMeasureerror measurement
minPointCountPerCellminimum number of points per cell (can't be smaller than 3)
maxPointCountPerCellmaximum number of points per cell (speed-up - ignored if < 6)
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)

Member Data Documentation

◆ m_maxPointCountPerCell

unsigned CCCoreLib::TrueKdTree::m_maxPointCountPerCell
protected

Max number of points per cell (speed-up)

Ignored if < 6

◆ m_minPointCountPerCell

unsigned CCCoreLib::TrueKdTree::m_minPointCountPerCell
protected

Min number of points per cell (speed-up)

Can't be < 3


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