#include <KdTree.hpp>
Public Member Functions | |
template<typename NodeMap , typename NodeToChildMap > | |
void | build (NodeType *root, NodeMap &c, NodeToChildMap &links) |
template<typename... T> | |
void | cleanUp (T &&...t) |
void | enumerateNodes () |
template<typename Derived > | |
const NodeType * | getLeaf (const MatrixBase< Derived > &point) const |
const NodeType * | getLeaf (const std::size_t &leafIndex) const |
const LeafContainerType & | getLeafs () |
const NodeType * | getLowestCommonAncestor (const NodeType *a, const NodeType *b) |
const NodeType * | getNode (const std::size_t &globalIndex) const |
const NodeContainerType & | getNodes () |
const NodeType * | getRootNode () |
std::tuple< std::size_t, std::size_t > | getStatistics () |
void | resetTree () |
TreeBase () | |
TreeBase (TreeBase &&t) | |
TreeBase (const TreeBase &t) | |
template<typename T > | |
TreeBase (const TreeBase< T > &t) | |
Protected Member Functions | |
template<typename T > | |
void | copyFrom (const TreeBase< T > &tree) |
~TreeBase () | |
Prohibit the use of this base polymophically. | |
Protected Attributes | |
NodeContainerType | m_leafs |
Only leaf nodes , continously index ordered: leafs[idx]->getIdx() < leafs[idx+1]->getIdx();. | |
NodeContainerType | m_nodes |
All nodes, continously index ordered, with first element = m_root. | |
NodeType * | m_root = nullptr |
Root node, has index 0! | |
Friends | |
class | TreeBase |
class | XML |
======================================================================================= Tree stuff ============================================================================
Definition at line 1259 of file KdTree.hpp.
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase | ( | ) | [inline] |
Definition at line 1267 of file KdTree.hpp.
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase | ( | TreeBase< Traits > && | t | ) | [inline] |
Definition at line 1269 of file KdTree.hpp.
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase | ( | const TreeBase< Traits > & | t | ) | [inline] |
Definition at line 1277 of file KdTree.hpp.
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase | ( | const TreeBase< T > & | t | ) | [inline, explicit] |
Definition at line 1282 of file KdTree.hpp.
ApproxMVBB::KdTree::TreeBase< Traits >::~TreeBase | ( | ) | [inline, protected] |
Prohibit the use of this base polymophically.
Definition at line 1334 of file KdTree.hpp.
void ApproxMVBB::KdTree::TreeBase< Traits >::build | ( | NodeType * | root, |
NodeMap & | c, | ||
NodeToChildMap & | links | ||
) | [inline] |
Built a tree from a node map and links c
is a associative container of nodes with type NodeType where the key type is std::size_t and value type is a pointe to type NodeType. The tree owns the pointers afterwards! links
is an associative container with type NodeToChildMap where the key is std::size_t and specifies the parent and the value type is a std::pair<std::size_t,std::size_t> for left and right child node indices in the map c
.
Definition at line 1349 of file KdTree.hpp.
void ApproxMVBB::KdTree::TreeBase< Traits >::cleanUp | ( | T &&... | t | ) | [inline] |
Clean up the nodes. Parameter are perfectly forwarded to NodeType::cleanUp(...)
Definition at line 1523 of file KdTree.hpp.
void ApproxMVBB::KdTree::TreeBase< Traits >::copyFrom | ( | const TreeBase< T > & | tree | ) | [inline, protected] |
Deep copy, copies all nodes, and leafs , and links childs together Special links added to the Node classes are not preserved! For example: BoundaryInformation Therefore a newNode->setup() routine is called for each new copied node at the end of this function such that every newNode can setup these special links by accesing a (index,newNode) map and the oldNode.
Definition at line 1298 of file KdTree.hpp.
void ApproxMVBB::KdTree::TreeBase< Traits >::enumerateNodes | ( | ) | [inline] |
Enumerate nodes (continously, leafs first, then non-leafs This is reflected in the list m_nodes too, which needs to correspond to getIdx()!
Definition at line 1538 of file KdTree.hpp.
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getLeaf | ( | const MatrixBase< Derived > & | point | ) | const [inline] |
Get cell index of the leaf which owns point point
point
is the d-dimensional point in the frame of reference the kd-Tree was built! Points outside the roots AABB box, are naturally project to the most outer leaf automatically.
Definition at line 1420 of file KdTree.hpp.
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getLeaf | ( | const std::size_t & | leafIndex | ) | const [inline] |
Definition at line 1492 of file KdTree.hpp.
const LeafContainerType& ApproxMVBB::KdTree::TreeBase< Traits >::getLeafs | ( | ) | [inline] |
Definition at line 1499 of file KdTree.hpp.
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getLowestCommonAncestor | ( | const NodeType * | a, |
const NodeType * | b | ||
) | [inline] |
Get common ancestor of two nodes Complexity: O(h) algorithm
Definition at line 1440 of file KdTree.hpp.
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getNode | ( | const std::size_t & | globalIndex | ) | const [inline] |
Definition at line 1503 of file KdTree.hpp.
const NodeContainerType& ApproxMVBB::KdTree::TreeBase< Traits >::getNodes | ( | ) | [inline] |
Definition at line 1510 of file KdTree.hpp.
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getRootNode | ( | ) | [inline] |
Definition at line 1514 of file KdTree.hpp.
std::tuple<std::size_t, std::size_t > ApproxMVBB::KdTree::TreeBase< Traits >::getStatistics | ( | ) | [inline] |
Reimplemented in ApproxMVBB::KdTree::Tree< TTraits >, and ApproxMVBB::KdTree::TreeSimple< TTraits >.
Definition at line 1530 of file KdTree.hpp.
void ApproxMVBB::KdTree::TreeBase< Traits >::resetTree | ( | ) | [inline] |
Reimplemented in ApproxMVBB::KdTree::Tree< TTraits >.
Definition at line 1404 of file KdTree.hpp.
friend class TreeBase [friend] |
Definition at line 1262 of file KdTree.hpp.
friend class XML [friend] |
Reimplemented in ApproxMVBB::KdTree::Tree< TTraits >, and ApproxMVBB::KdTree::TreeSimple< TTraits >.
Definition at line 1565 of file KdTree.hpp.
NodeContainerType ApproxMVBB::KdTree::TreeBase< Traits >::m_leafs [protected] |
Only leaf nodes , continously index ordered: leafs[idx]->getIdx() < leafs[idx+1]->getIdx();.
Definition at line 1568 of file KdTree.hpp.
NodeContainerType ApproxMVBB::KdTree::TreeBase< Traits >::m_nodes [protected] |
All nodes, continously index ordered, with first element = m_root.
Definition at line 1569 of file KdTree.hpp.
NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::m_root = nullptr [protected] |
Root node, has index 0!
Definition at line 1571 of file KdTree.hpp.