HierarchyTree< NodeClass > Class Template Reference

#include <hierarchy_tree.h>

Inherits HierarchyTreeBase.

Inheritance diagram for HierarchyTree< NodeClass >:

Inheritance graph
[legend]
Collaboration diagram for HierarchyTree< NodeClass >:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { ChildrenCount = 2 }

Public Member Functions

 HierarchyTree ()
 ~HierarchyTree ()
NodeNavigator getRoot (void)
 access to root
NodeClass & getNode (const int level, const int index)
 common node access
bool isNodeValid (const int level, const int index)
 checks node validity (wheter it is out-of-tree-bounds or not)
void build (void)
 constructs full tree based on previous definition of extent of root node
void setNodeDelegate (NodeDelegate *del)
 sets the node delegate
void render (void)
void render (const NodeNavigator &navigator)

Private Types

typedef std::vector< NodeClass > TOneLevel
 container for nodes - one tree level
typedef std::vector< TOneLevel * > TLevels
 container for tree levels

Private Member Functions

void addLevel (void)
 allocates next level
void build (const int minPoint[D], const int maxPoint[D], typename TLevels::size_type level, typename TOneLevel::size_type index)
 constructs full tree based on extent definition

Private Attributes

NodeDelegatemNodeDelegate
 delegate pointer
TLevels mLevels
 nodes

Classes

class  NodeDelegate
 interface for NodeClass definition at building phase More...
class  NodeNavigator
 provides easy access to the tree hierarchy More...

Detailed Description

template<class NodeClass>
class HierarchyTree< NodeClass >

Definition at line 129 of file hierarchy_tree.h.


Member Typedef Documentation

template<class NodeClass>
typedef std::vector< TOneLevel * > HierarchyTree< NodeClass >::TLevels [private]
 

container for tree levels

Definition at line 284 of file hierarchy_tree.h.

template<class NodeClass>
typedef std::vector< NodeClass > HierarchyTree< NodeClass >::TOneLevel [private]
 

container for nodes - one tree level

Definition at line 283 of file hierarchy_tree.h.


Member Enumeration Documentation

template<class NodeClass>
anonymous enum
 

Enumerator:
ChildrenCount 

Definition at line 131 of file hierarchy_tree.h.


Constructor & Destructor Documentation

template<class NodeClass>
HierarchyTree< NodeClass >::HierarchyTree  )  [inline]
 

Definition at line 238 of file hierarchy_tree.h.

template<class NodeClass>
HierarchyTree< NodeClass >::~HierarchyTree  ) 
 

Definition at line 313 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::mLevels.


Member Function Documentation

template<class NodeClass>
void HierarchyTree< NodeClass >::addLevel void   )  [private]
 

allocates next level

The size is ChildrenCount-times greater than the size of previous level.

Definition at line 324 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::ChildrenCount, and HierarchyTree< NodeClass >::mLevels.

template<class NodeClass>
void HierarchyTree< NodeClass >::build const int  minPoint[D],
const int  maxPoint[D],
typename TLevels::size_type  level,
typename TOneLevel::size_type  index
[private]
 

constructs full tree based on extent definition

Recursively constructs the tree.

Parameters:
minPoint defines extent
maxPoint defines extent
level current node - level
index current node - offset
Note:
extent of the root node is defined by HierarchyTreeBase::SetExtent()

template<class NodeClass>
void HierarchyTree< NodeClass >::build void   )  [inline]
 

constructs full tree based on previous definition of extent of root node

Note:
extent of the root node is defined by HierarchyTreeBase::SetExtent()

Definition at line 266 of file hierarchy_tree.h.

References HierarchyTreeBase::mRootMax, and HierarchyTreeBase::mRootMin.

Referenced by TerrainGeoMipMap::createHierarchyTree().

template<class NodeClass>
NodeClass& HierarchyTree< NodeClass >::getNode const int  level,
const int  index
[inline]
 

common node access

Parameters:
level node's depth in tree
index node's offset in tree
Returns:
user's node class reference

Definition at line 253 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::mLevels.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::operator *().

template<class NodeClass>
NodeNavigator HierarchyTree< NodeClass >::getRoot void   )  [inline]
 

access to root

Returns:
node navigator initialized to root-node position

Definition at line 245 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::NodeNavigator::NodeNavigator().

Referenced by TerrainGeoMipMap::render(), HierarchyTree< NodeClass >::render(), and TerrainGeoMipMap::update().

Here is the call graph for this function:

template<class NodeClass>
bool HierarchyTree< NodeClass >::isNodeValid const int  level,
const int  index
[inline]
 

checks node validity (wheter it is out-of-tree-bounds or not)

Returns:
true if valid

Definition at line 259 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::mLevels.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::isValid().

template<class NodeClass>
void HierarchyTree< NodeClass >::render const NodeNavigator navigator  ) 
 

Definition at line 414 of file hierarchy_tree.h.

References Frustum::OUTSIDE.

template<class NodeClass>
void HierarchyTree< NodeClass >::render void   ) 
 

Definition at line 395 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::getRoot().

Referenced by TerrainGeoMipMap::render().

Here is the call graph for this function:

template<class NodeClass>
void HierarchyTree< NodeClass >::setNodeDelegate NodeDelegate del  )  [inline]
 

sets the node delegate

Parameters:
del pointer to delegate
Note:
provides the ability of building user data in hierachy of this tree

Definition at line 276 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::mNodeDelegate.

Referenced by TerrainGeoMipMap::TerrainGeoMipMap().


Member Data Documentation

template<class NodeClass>
TLevels HierarchyTree< NodeClass >::mLevels [private]
 

nodes

Definition at line 309 of file hierarchy_tree.h.

Referenced by HierarchyTree< NodeClass >::addLevel(), HierarchyTree< NodeClass >::getNode(), HierarchyTree< NodeClass >::isNodeValid(), and HierarchyTree< NodeClass >::~HierarchyTree().

template<class NodeClass>
NodeDelegate* HierarchyTree< NodeClass >::mNodeDelegate [private]
 

delegate pointer

Definition at line 308 of file hierarchy_tree.h.

Referenced by HierarchyTree< NodeClass >::setNodeDelegate().


The documentation for this class was generated from the following file:
Generated on Wed Apr 12 14:17:06 2006 for bjs by  doxygen 1.4.5