Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions
NCollection_EBTree< TheObjType, TheBndType > Class Template Reference

#include <NCollection_EBTree.hxx>

Inheritance diagram for NCollection_EBTree< TheObjType, TheBndType >:
Inheritance graph
[legend]

Public Types

typedef NCollection_UBTree< TheObjType, TheBndTypeUBTree
 
typedef UBTree::TreeNode TreeNode
 

Public Member Functions

 NCollection_EBTree (const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 
 NCollection_EBTree (NCollection_EBTree &&theOther) noexcept
 
NCollection_EBTreeoperator= (NCollection_EBTree &&theOther) noexcept
 
bool Add (const TheObjType &theObj, const TheBndType &theBnd) override
 
bool Remove (const TheObjType &theObj)
 
bool Contains (const TheObjType &theObj) const
 
const TreeNodeFindNode (const TheObjType &theObj) const
 
void Clear (const occ::handle< NCollection_BaseAllocator > &aNewAlloc=nullptr) override
 
- Public Member Functions inherited from NCollection_UBTree< TheObjType, TheBndType >
 NCollection_UBTree ()
 
 NCollection_UBTree (const occ::handle< NCollection_BaseAllocator > &theAllocator)
 
 NCollection_UBTree (NCollection_UBTree &&theOther) noexcept
 
NCollection_UBTreeoperator= (NCollection_UBTree &&theOther) noexcept
 
virtual int Select (Selector &theSelector) const
 
bool IsEmpty () const noexcept
 
const TreeNodeRoot () const noexcept
 
virtual ~NCollection_UBTree ()
 
const occ::handle< NCollection_BaseAllocator > & Allocator () const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from NCollection_UBTree< TheObjType, TheBndType >
TreeNodeChangeLastNode () noexcept
 
int Select (const TreeNode &theBranch, Selector &theSelector) const
 

Detailed Description

template<class TheObjType, class TheBndType>
class NCollection_EBTree< TheObjType, TheBndType >

The algorithm of unbalanced binary tree of overlapped bounding boxes with the possibility of deleting objects from the tree.

In addition to the requirements to the object type defined in the parent class this class requires that the object can be hashed and compared to another object (functions HashCode and IsEqual are defined for it), since the class NCollection_DataMap is used where the object plays the role of the key.

Member Typedef Documentation

◆ TreeNode

typedef UBTree::TreeNode NCollection_EBTree< TheObjType, TheBndType >::TreeNode

◆ UBTree

Constructor & Destructor Documentation

◆ NCollection_EBTree() [1/2]

Constructor.

◆ NCollection_EBTree() [2/2]

Member Function Documentation

◆ Add()

bool NCollection_EBTree< TheObjType, TheBndType >::Add ( const TheObjType & theObj,
const TheBndType & theBnd )
inlineoverridevirtual

Updates the tree with a new object and its bounding box. Extends the functionality of the parent method by maintaining the map myObjNodeMap. Redefined virtual method.

Returns
False if the tree already contains theObj.

Reimplemented from NCollection_UBTree< TheObjType, TheBndType >.

◆ Clear()

void NCollection_EBTree< TheObjType, TheBndType >::Clear ( const occ::handle< NCollection_BaseAllocator > & aNewAlloc = nullptr)
inlineoverridevirtual

Clears the contents of the tree. Redefined virtual method

Reimplemented from NCollection_UBTree< TheObjType, TheBndType >.

◆ Contains()

bool NCollection_EBTree< TheObjType, TheBndType >::Contains ( const TheObjType & theObj) const
inline
Returns
True if the tree contains the object.

◆ FindNode()

const TreeNode & NCollection_EBTree< TheObjType, TheBndType >::FindNode ( const TheObjType & theObj) const
inline
Returns
The leaf node containing the object.

◆ operator=()

◆ Remove()

Removes the given object and updates the tree.

Returns
False if the tree does not contain theObj

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