Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

kdtree::Node Class Reference
[kd-tree Library]

root (and node!) of a kd-tree This class is expected to be used as the core object for rendering and other CPU-intensive tasks, so it therefore has no virtual methods. More...

#include <kdtree.h>

Collaboration diagram for kdtree::Node:
Collaboration graph
[legend]

List of all members.

Classes

struct  dynamic_entry_t
struct  entry_rec_t

Public Types

typedef std::vector< entry_rec_tvec_entries_t

Public Member Functions

 ~Node (void) throw ()
void addStaticEntry (smart_ptr< Entry > &entry, const rect3d_t &r)
 static entries are expensive to add and remove--do so rarely (such as when constructing the tree).
void addDynamicEntry (smart_ptr< dynamic_entry_t > &de)
 dynamic entries are fast to add and remove, but are not used for partitioning and are not affected by subdividing.
bool removeStaticEntry (Entry *entry) throw ()
smart_ptr< dynamic_entry_tpopDynamicEntry (void) throw ()
int getTreeDepth (void) const throw ()
int getNodeCount (void) const throw ()
int getStaticEntryCount (void) const throw ()
void subdivide (eStrategy strategy, float param)
 here you tell the kd-tree to subdivide (recursively), using the given strategy.
eAction iterateStaticEntries (const rect3d_t &r, iteration_callback callback, void *context)
 client can iterate over all entries in the given rect
const NodegetLeftChild (void) const throw ()
const NodegetRightChild (void) const throw ()
NodegetLeftChild (void) throw ()
NodegetRightChild (void) throw ()
const rect3d_tgetRect (void) const throw ()
const plane_tgetSortPlane (void) const throw ()
const vec_entries_tgetStaticEntries (void) const throw ()
vec_entries_tgetStaticEntries (void) throw ()
void setUserPointer (void *context) throw ()
void * getUserPointer (void) const throw ()

Static Public Member Functions

static smart_ptr< Nodecreate (const rect3d_t &bounds)
 when you create a kd-tree node (especially the root!) you had better know the overall boundaries.

Private Member Functions

 Node (void) throw ()
void initialize (const rect3d_t &bounds)
void subdivideInternal (eStrategy strategy, float param)

Private Attributes

smart_ptr< Nodem_left
smart_ptr< Nodem_right
plane_t m_sortPlane
rect3d_t m_bounds
vec_entries_t m_entries
smart_ptr< dynamic_entry_tm_dynamic
void * m_user

Detailed Description

root (and node!) of a kd-tree This class is expected to be used as the core object for rendering and other CPU-intensive tasks, so it therefore has no virtual methods.

Definition at line 160 of file kdtree.h.


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