Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
NCollection_UBTree< TheObjType, TheBndType >::TreeNode Class Reference

#include <NCollection_UBTree.hxx>

Public Member Functions

 TreeNode (const TheObjType &theObj, const TheBndType &theBnd)
bool IsLeaf () const noexcept
bool IsRoot () const noexcept
const TheBndType & Bnd () const noexcept
TheBndType & ChangeBnd () noexcept
const TheObjType & Object () const noexcept
const TreeNode & Child (const int i) const noexcept
TreeNode & ChangeChild (const int i) noexcept
const TreeNode & Parent () const noexcept
TreeNode & ChangeParent () noexcept
void Gemmate (const TheBndType &theNewBnd, const TheObjType &theObj, const TheBndType &theBnd, const occ::handle< NCollection_BaseAllocator > &theAlloc)
void Kill (const int i, const occ::handle< NCollection_BaseAllocator > &theAlloc)
 ~TreeNode ()

Static Public Member Functions

static void delNode (TreeNode *theNode, const occ::handle< NCollection_BaseAllocator > &theAlloc)
 Deleter of tree node. The whole hierarchy of its children is also deleted. This method should be used instead of operator delete. Uses iterative traversal to avoid stack overflow on deeply unbalanced trees.

Detailed Description

template<class TheObjType, class TheBndType>
class NCollection_UBTree< TheObjType, TheBndType >::TreeNode

Class describing the node of the tree. Initially the tree consists of one leaf. A node can grow to a branch holding two childs:

  • one correspondent to initial node
  • the new one with a new object and bounding box

Constructor & Destructor Documentation

◆ TreeNode()

template<class TheObjType, class TheBndType>
NCollection_UBTree< TheObjType, TheBndType >::TreeNode::TreeNode ( const TheObjType & theObj,
const TheBndType & theBnd )
inline

◆ ~TreeNode()

template<class TheObjType, class TheBndType>
NCollection_UBTree< TheObjType, TheBndType >::TreeNode::~TreeNode ( )
inline

Member Function Documentation

◆ Bnd()

template<class TheObjType, class TheBndType>
const TheBndType & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::Bnd ( ) const
inlinenoexcept

◆ ChangeBnd()

template<class TheObjType, class TheBndType>
TheBndType & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::ChangeBnd ( )
inlinenoexcept

◆ ChangeChild()

template<class TheObjType, class TheBndType>
TreeNode & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::ChangeChild ( const int i)
inlinenoexcept

◆ ChangeParent()

template<class TheObjType, class TheBndType>
TreeNode & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::ChangeParent ( )
inlinenoexcept

◆ Child()

template<class TheObjType, class TheBndType>
const TreeNode & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::Child ( const int i) const
inlinenoexcept

◆ delNode()

template<class TheObjType, class TheBndType>
void NCollection_UBTree< TheObjType, TheBndType >::TreeNode::delNode ( TreeNode * theNode,
const occ::handle< NCollection_BaseAllocator > & theAlloc )
inlinestatic

Deleter of tree node. The whole hierarchy of its children is also deleted. This method should be used instead of operator delete. Uses iterative traversal to avoid stack overflow on deeply unbalanced trees.

◆ Gemmate()

template<class TheObjType, class TheBndType>
void NCollection_UBTree< TheObjType, TheBndType >::TreeNode::Gemmate ( const TheBndType & theNewBnd,
const TheObjType & theObj,
const TheBndType & theBnd,
const occ::handle< NCollection_BaseAllocator > & theAlloc )
inline

Forces *this node being gemmated such a way that it becomes a branch holding the previous content of *this node at the first child and theObj at the second child.

Parameters
theNewBndnew bounding box comprizing both child nodes.
theObjadded object.
theBndbounding box of theObj.
theAllocallocator providing memory to the new child nodes, provided by the calling Tree instance.

◆ IsLeaf()

template<class TheObjType, class TheBndType>
bool NCollection_UBTree< TheObjType, TheBndType >::TreeNode::IsLeaf ( ) const
inlinenoexcept

◆ IsRoot()

template<class TheObjType, class TheBndType>
bool NCollection_UBTree< TheObjType, TheBndType >::TreeNode::IsRoot ( ) const
inlinenoexcept

◆ Kill()

template<class TheObjType, class TheBndType>
void NCollection_UBTree< TheObjType, TheBndType >::TreeNode::Kill ( const int i,
const occ::handle< NCollection_BaseAllocator > & theAlloc )
inline

Kills the i-th child, and *this accepts the content of another child

◆ Object()

template<class TheObjType, class TheBndType>
const TheObjType & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::Object ( ) const
inlinenoexcept

◆ Parent()

template<class TheObjType, class TheBndType>
const TreeNode & NCollection_UBTree< TheObjType, TheBndType >::TreeNode::Parent ( ) const
inlinenoexcept

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