Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ApproxMVBB::KdTree::TreeBase< Traits > Class Template Reference

#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. More...
 

Protected Attributes

NodeContainerType m_leafs
 Only leaf nodes , continously index ordered: leafs[idx]->getIdx() < leafs[idx+1]->getIdx();. More...
 
NodeContainerType m_nodes
 All nodes, continously index ordered, with first element = m_root. More...
 
NodeType * m_root = nullptr
 Root node, has index 0! More...
 

Friends

template<typename T >
class TreeBase
 
class XML
 

Detailed Description

template<typename Traits>
class ApproxMVBB::KdTree::TreeBase< Traits >

Forward declar all tree classes

======================================================================================= Tree stuff ============================================================================

Definition at line 719 of file KdTree.hpp.

Constructor & Destructor Documentation

template<typename Traits>
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase ( )
inline

Definition at line 1267 of file KdTree.hpp.

template<typename Traits>
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase ( TreeBase< Traits > &&  t)
inline

Definition at line 1269 of file KdTree.hpp.

template<typename Traits>
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase ( const TreeBase< Traits > &  t)
inline

Definition at line 1277 of file KdTree.hpp.

template<typename Traits>
template<typename T >
ApproxMVBB::KdTree::TreeBase< Traits >::TreeBase ( const TreeBase< T > &  t)
inlineexplicit

Definition at line 1282 of file KdTree.hpp.

template<typename Traits>
ApproxMVBB::KdTree::TreeBase< Traits >::~TreeBase ( )
inlineprotected

Prohibit the use of this base polymophically.

Definition at line 1334 of file KdTree.hpp.

Member Function Documentation

template<typename Traits>
template<typename NodeMap , typename NodeToChildMap >
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.

template<typename Traits>
template<typename... T>
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.

template<typename Traits>
template<typename T >
void ApproxMVBB::KdTree::TreeBase< Traits >::copyFrom ( const TreeBase< T > &  tree)
inlineprotected

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.

template<typename Traits>
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.

template<typename Traits>
template<typename Derived >
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.

template<typename Traits>
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getLeaf ( const std::size_t &  leafIndex) const
inline

Definition at line 1492 of file KdTree.hpp.

template<typename Traits>
const LeafContainerType& ApproxMVBB::KdTree::TreeBase< Traits >::getLeafs ( )
inline

Definition at line 1499 of file KdTree.hpp.

template<typename Traits>
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.

template<typename Traits>
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getNode ( const std::size_t &  globalIndex) const
inline

Definition at line 1503 of file KdTree.hpp.

template<typename Traits>
const NodeContainerType& ApproxMVBB::KdTree::TreeBase< Traits >::getNodes ( )
inline

Definition at line 1510 of file KdTree.hpp.

template<typename Traits>
const NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::getRootNode ( )
inline

Definition at line 1514 of file KdTree.hpp.

template<typename Traits>
std::tuple<std::size_t, std::size_t > ApproxMVBB::KdTree::TreeBase< Traits >::getStatistics ( )
inline

Definition at line 1530 of file KdTree.hpp.

template<typename Traits>
void ApproxMVBB::KdTree::TreeBase< Traits >::resetTree ( )
inline

Definition at line 1404 of file KdTree.hpp.

Friends And Related Function Documentation

template<typename Traits>
template<typename T >
friend class TreeBase
friend

Definition at line 1262 of file KdTree.hpp.

template<typename Traits>
friend class XML
friend

Definition at line 1565 of file KdTree.hpp.

Member Data Documentation

template<typename Traits>
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.

template<typename Traits>
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.

template<typename Traits>
NodeType* ApproxMVBB::KdTree::TreeBase< Traits >::m_root = nullptr
protected

Root node, has index 0!

Definition at line 1571 of file KdTree.hpp.


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


asr_approx_mvbb
Author(s): Gassner Nikolai
autogenerated on Mon Jun 10 2019 12:38:09