OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKernel
NCollection


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, TheBndType > 
UBTree
typedef TYPENAME UBTree::TreeNode TreeNode

Public Member Functions

 NCollection_EBTree (const Handle(NCollection_BaseAllocator)&theAllocator=0L)
Standard_EXPORT Standard_Boolean Add (const TheObjType &theObj, const TheBndType &theBnd)
Standard_EXPORT Standard_Boolean Remove (const TheObjType &theObj)
Standard_Boolean Contains (const TheObjType &theObj) const
const TreeNodeFindNode (const TheObjType &theObj) const
void Clear (const Handle(NCollection_BaseAllocator)&aNewAlloc=0L)

Private Member Functions

 NCollection_EBTree (const NCollection_EBTree &)
 Copy constructor (prohibited).
NCollection_EBTreeoperator= (const NCollection_EBTree &)
 Assignment operator (prohibited).

Private Attributes

NCollection_DataMap< TheObjType,
TreeNode * > 
myObjNodeMap
 map of object to node pointer

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

template<class TheObjType, class TheBndType>
typedef TYPENAME UBTree::TreeNode NCollection_EBTree< TheObjType, TheBndType >::TreeNode
 

template<class TheObjType, class TheBndType>
typedef NCollection_UBTree<TheObjType, TheBndType> NCollection_EBTree< TheObjType, TheBndType >::UBTree
 


Constructor & Destructor Documentation

template<class TheObjType, class TheBndType>
NCollection_EBTree< TheObjType, TheBndType >::NCollection_EBTree const Handle(NCollection_BaseAllocator)&  theAllocator = 0L  )  [inline]
 

Constructor.

template<class TheObjType, class TheBndType>
NCollection_EBTree< TheObjType, TheBndType >::NCollection_EBTree const NCollection_EBTree< TheObjType, TheBndType > &   )  [private]
 


Member Function Documentation

template<class TheObjType, class TheBndType>
Standard_Boolean NCollection_EBTree< TheObjType, TheBndType >::Add const TheObjType &  theObj,
const TheBndType &  theBnd
[virtual]
 

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

template<class TheObjType, class TheBndType>
void NCollection_EBTree< TheObjType, TheBndType >::Clear const Handle(NCollection_BaseAllocator)&  aNewAlloc = 0L  )  [inline, virtual]
 

Clears the contents of the tree. Redefined virtual method

Reimplemented from NCollection_UBTree< TheObjType, TheBndType >.

template<class TheObjType, class TheBndType>
Standard_Boolean NCollection_EBTree< TheObjType, TheBndType >::Contains const TheObjType &  theObj  )  const [inline]
 

Returns:
True if the tree contains the object.

template<class TheObjType, class TheBndType>
const TreeNode& NCollection_EBTree< TheObjType, TheBndType >::FindNode const TheObjType &  theObj  )  const [inline]
 

Returns:
The leaf node containing the object.

template<class TheObjType, class TheBndType>
NCollection_EBTree& NCollection_EBTree< TheObjType, TheBndType >::operator= const NCollection_EBTree< TheObjType, TheBndType > &   )  [private]
 

template<class TheObjType, class TheBndType>
Standard_Boolean NCollection_EBTree< TheObjType, TheBndType >::Remove const TheObjType &  theObj  ) 
 

Removes the given object and updates the tree.

Returns:
False if the tree does not contain theObj


Field Documentation

template<class TheObjType, class TheBndType>
NCollection_DataMap<TheObjType, TreeNode*> NCollection_EBTree< TheObjType, TheBndType >::myObjNodeMap [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:12:56 2008 for OpenCASCADE by  doxygen 1.4.1