MeshLib Documentation
Loading...
Searching...
No Matches
MR::AABBTreeBase< T > Class Template Reference

base class for most AABB-trees (except for AABBTreePoints) More...

#include <MRAABBTreeBase.h>

Public Types

using Traits = T
 
using Node = AABBTreeNode<Traits>
 
using NodeVec = Vector<Node, NodeId>
 
using LeafTag = typename T::LeafTag
 
using LeafId = typename T::LeafId
 
using LeafBitSet = TaggedBitSet<LeafTag>
 
using LeafBMap = BMap<LeafId, LeafId>
 
using BoxT = typename T::BoxT
 

Public Member Functions

const NodeVecnodes () const
 const-access to all nodes
 
const Nodeoperator[] (NodeId nid) const
 const-access to any node
 
BoxT getBoundingBox () const
 returns the root node bounding box
 
size_t heapBytes () const
 returns the amount of memory this object occupies on heap
 
size_t numLeaves () const
 returns the number of leaves in whole tree
 
MRMESH_API std::vector< NodeId > getSubtrees (int minNum) const
 returns at least given number of top-level not-intersecting subtrees, union of which contain all tree leaves
 
MRMESH_API LeafBitSet getSubtreeLeaves (NodeId subtreeRoot) const
 returns all leaves in the subtree with given root
 
MRMESH_API NodeBitSet getNodesFromLeaves (const LeafBitSet &leaves) const
 returns set of nodes containing among direct or indirect children given leaves
 
MRMESH_API void getLeafOrder (LeafBMap &leafMap) const
 
MRMESH_API void getLeafOrderAndReset (LeafBMap &leafMap)
 

Static Public Member Functions

static NodeId rootNodeId ()
 returns root node id
 

Protected Attributes

NodeVec nodes_
 

Detailed Description

template<typename T>
class MR::AABBTreeBase< T >

base class for most AABB-trees (except for AABBTreePoints)

Member Typedef Documentation

◆ BoxT

template<typename T >
using MR::AABBTreeBase< T >::BoxT = typename T::BoxT

◆ LeafBitSet

template<typename T >
using MR::AABBTreeBase< T >::LeafBitSet = TaggedBitSet<LeafTag>

◆ LeafBMap

template<typename T >
using MR::AABBTreeBase< T >::LeafBMap = BMap<LeafId, LeafId>

◆ LeafId

template<typename T >
using MR::AABBTreeBase< T >::LeafId = typename T::LeafId

◆ LeafTag

template<typename T >
using MR::AABBTreeBase< T >::LeafTag = typename T::LeafTag

◆ Node

template<typename T >
using MR::AABBTreeBase< T >::Node = AABBTreeNode<Traits>

◆ NodeVec

template<typename T >
using MR::AABBTreeBase< T >::NodeVec = Vector<Node, NodeId>

◆ Traits

template<typename T >
using MR::AABBTreeBase< T >::Traits = T

Member Function Documentation

◆ getBoundingBox()

template<typename T >
BoxT MR::AABBTreeBase< T >::getBoundingBox ( ) const
inlinenodiscard

returns the root node bounding box

◆ getLeafOrder()

template<typename T >
MRMESH_API void MR::AABBTreeBase< T >::getLeafOrder ( LeafBMap & leafMap) const

fills map: LeafId -> leaf#; buffer in leafMap must be resized before the call, and caller is responsible for filling missing leaf elements

◆ getLeafOrderAndReset()

template<typename T >
MRMESH_API void MR::AABBTreeBase< T >::getLeafOrderAndReset ( LeafBMap & leafMap)

fills map: LeafId -> leaf#, then resets leaf order to 0,1,2,...; buffer in leafMap must be resized before the call, and caller is responsible for filling missing leaf elements

◆ getNodesFromLeaves()

template<typename T >
MRMESH_API NodeBitSet MR::AABBTreeBase< T >::getNodesFromLeaves ( const LeafBitSet & leaves) const
nodiscard

returns set of nodes containing among direct or indirect children given leaves

◆ getSubtreeLeaves()

template<typename T >
MRMESH_API LeafBitSet MR::AABBTreeBase< T >::getSubtreeLeaves ( NodeId subtreeRoot) const
nodiscard

returns all leaves in the subtree with given root

◆ getSubtrees()

template<typename T >
MRMESH_API std::vector< NodeId > MR::AABBTreeBase< T >::getSubtrees ( int minNum) const
nodiscard

returns at least given number of top-level not-intersecting subtrees, union of which contain all tree leaves

◆ heapBytes()

template<typename T >
size_t MR::AABBTreeBase< T >::heapBytes ( ) const
inlinenodiscard

returns the amount of memory this object occupies on heap

◆ nodes()

template<typename T >
const NodeVec & MR::AABBTreeBase< T >::nodes ( ) const
inlinenodiscard

const-access to all nodes

◆ numLeaves()

template<typename T >
size_t MR::AABBTreeBase< T >::numLeaves ( ) const
inlinenodiscard

returns the number of leaves in whole tree

◆ operator[]()

template<typename T >
const Node & MR::AABBTreeBase< T >::operator[] ( NodeId nid) const
inlinenodiscard

const-access to any node

◆ rootNodeId()

template<typename T >
static NodeId MR::AABBTreeBase< T >::rootNodeId ( )
inlinestaticnodiscard

returns root node id

Member Data Documentation

◆ nodes_

template<typename T >
NodeVec MR::AABBTreeBase< T >::nodes_
protected

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