![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
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. More... | |
Public Member Functions | |
| TrueKdTree (GenericIndexedCloudPersist *cloud) | |
| Default constructor. More... | |
| ~TrueKdTree () | |
| Destructor. More... | |
| GenericIndexedCloudPersist * | associatedCloud () const |
| Returns the associated cloud. More... | |
| 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. More... | |
| double | getMaxError () const |
| Returns max error threshold used for planarity-based split strategy. More... | |
| DistanceComputationTools::ERROR_MEASURES | getMaxErrorType () const |
| Returns max error estimator used for planarity-based split strategy. More... | |
| bool | getLeaves (LeafVector &leaves) const |
| Returns all leaf nodes. More... | |
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. More... | |
Protected Attributes | |
| BaseNode * | m_root |
| Root node. More... | |
| GenericIndexedCloudPersist * | m_associatedCloud |
| Associated cloud. More... | |
| double | m_maxError |
| Max error for planarity-based split strategy (see m_errorMeasure) More... | |
| DistanceComputationTools::ERROR_MEASURES | m_errorMeasure |
| Error measurement. More... | |
| 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.
Definition at line 23 of file TrueKdTree.h.
| using cloudViewer::TrueKdTree::LeafVector = std::vector<Leaf*> |
A vector of leaves.
Definition at line 105 of file TrueKdTree.h.
|
explicit |
| TrueKdTree::~TrueKdTree | ( | ) |
|
inline |
Returns the associated cloud.
Definition at line 114 of file TrueKdTree.h.
| 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) |
Definition at line 247 of file TrueKdTree.cpp.
References cloudViewer::ReferenceCloud::addPointIndex(), count, InitProgress(), m_associatedCloud, m_errorMeasure, m_maxError, m_maxPointCountPerCell, m_minPointCountPerCell, m_root, s_sortedCoordsForSplit, cloudViewer::GenericCloud::size(), and split().
Referenced by qFacets::extractFacets().
| void TrueKdTree::clear | ( | ) |
Clears structure.
Definition at line 29 of file TrueKdTree.cpp.
References m_root.
Referenced by ~TrueKdTree().
| bool TrueKdTree::getLeaves | ( | LeafVector & | leaves | ) | const |
Returns all leaf nodes.
Definition at line 321 of file TrueKdTree.cpp.
References m_root, and GetLeavesVisitor::visit().
Referenced by ccKdTreeForFacetExtraction::FuseCells().
|
inline |
Returns max error threshold used for planarity-based split strategy.
Definition at line 138 of file TrueKdTree.h.
Referenced by ccPropertiesTreeDelegate::fillWithPointKdTree().
|
inline |
Returns max error estimator used for planarity-based split strategy.
Definition at line 141 of file TrueKdTree.h.
Referenced by ccPropertiesTreeDelegate::fillWithPointKdTree().
|
protected |
Recursive split process.
Definition at line 76 of file TrueKdTree.cpp.
References abs(), cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::DistanceComputationTools::ComputeCloud2PlaneDistance(), count, error(), cloudViewer::ReferenceCloud::getAssociatedCloud(), cloudViewer::ReferenceCloud::getBoundingBox(), cloudViewer::Neighbourhood::getLSPlane(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::TrueKdTree::BaseNode::isLeaf(), cloudViewer::TrueKdTree::Node::leftChild, m_errorMeasure, m_maxError, m_maxPointCountPerCell, m_minPointCountPerCell, ParallelSort, cloudViewer::TrueKdTree::BaseNode::parent, cloudViewer::TrueKdTree::Leaf::points, cloudViewer::ReferenceCloud::reserve(), cloudViewer::TrueKdTree::Node::rightChild, s_sortedCoordsForSplit, cloudViewer::ReferenceCloud::size(), cloudViewer::TrueKdTree::Node::splitDim, cloudViewer::TrueKdTree::Node::splitValue, Tuple3Tpl< Type >::u, UpdateProgress(), Tuple3Tpl< Type >::x, X_DIM, Tuple3Tpl< Type >::y, Y_DIM, Tuple3Tpl< Type >::z, and Z_DIM.
Referenced by build().
|
static |
Definition at line 30 of file TrueKdTree.h.
|
protected |
Associated cloud.
Definition at line 156 of file TrueKdTree.h.
Referenced by build(), and TrueKdTree().
|
protected |
|
protected |
Max error for planarity-based split strategy (see m_errorMeasure)
Definition at line 159 of file TrueKdTree.h.
|
protected |
Max number of points per cell (speed-up)
Ignored if < 6
Definition at line 172 of file TrueKdTree.h.
|
protected |
|
protected |
Root node.
Definition at line 153 of file TrueKdTree.h.
Referenced by build(), clear(), and getLeaves().
|
static |
Definition at line 29 of file TrueKdTree.h.
|
static |
Definition at line 26 of file TrueKdTree.h.
Referenced by split().
|
static |
Definition at line 27 of file TrueKdTree.h.
Referenced by split().
|
static |
Definition at line 28 of file TrueKdTree.h.
Referenced by split().