QUADTREE Class Reference

Quad search tree implementation. More...

#include <mi32/qtree.h>

List of all members.

Public Types

enum  INITFLAGS { INITFLAG_None = 0x0000, INITFLAG_StoreExtents = 0x0001, INITFLAG_PointOnly = 0x0002, INITFLAG_FastAdd = 0x0004 }

Public Member Functions

ERRVALUE Add (INT32 ItemID, const DRECT2D &Extents)
void Clear ()
ERRVALUE Delete (INT32 ItemID, const DRECT2D &Extents)
ERRVALUE Delete (INT32 ItemID)
void Free ()
ERRVALUE GetItemExtents (INT32 ItemID, DRECT2D &Extents) const
ERRVALUE Initialize (const DRECT2D &Extents, INT32 NumItems, INITFLAGS InitFlags=INITFLAG_None)
bool IsInitialized () const
QUADTREEoperator= (const QUADTREE &rhs)
 QUADTREE (const QUADTREE &rhs)
 QUADTREE ()
ERRVALUE Search (const DRECT2D &rect, BITSET_DEQUE &Deque) const
ERRVALUE Search (const DRECT2D &rect, SIMPLE_ARRAY< INT32 > &ItemList) const
ERRVALUE SortItemListByExtents (SIMPLE_ARRAY< INT32 > &ItemList) const
 ~QUADTREE ()


Detailed Description

Quad search tree implementation.

Definition at line 55 of file qtree.h.


Member Enumeration Documentation

enum QUADTREE::INITFLAGS
 

Enumeration values:
INITFLAG_None 
INITFLAG_StoreExtents  Ignored if INITFLAG_PointOnly is specified, stores DRECT2D passed to Add() according to ItemID.
INITFLAG_PointOnly  Creates optimized version for point only searches.
INITFLAG_FastAdd  Performs no validation check for adding an ItemID multiple times.

Definition at line 57 of file qtree.h.


Constructor & Destructor Documentation

QUADTREE::QUADTREE  ) 
 

Default constructor.

QUADTREE::QUADTREE const QUADTREE rhs  ) 
 

Copy constructor.

QUADTREE::~QUADTREE  ) 
 

Destructor.


Member Function Documentation

ERRVALUE QUADTREE::Add INT32  ItemID,
const DRECT2D Extents
 

Add an element to the quad tree.

void QUADTREE::Clear  ) 
 

Clear the quad tree of all elements, reverts back to the Initialize() state.

ERRVALUE QUADTREE::Delete INT32  ItemID,
const DRECT2D Extents
 

Delete an item from the quad tree.

ERRVALUE QUADTREE::Delete INT32  ItemID  ) 
 

Delete an item from the quad tree Only valid if INITFLAG_StoreExtents is specified in Initialize().

void QUADTREE::Free  ) 
 

Free the memory used by the quad tree.

ERRVALUE QUADTREE::GetItemExtents INT32  ItemID,
DRECT2D Extents
const
 

Get the extents of the item specified Only valid if INITFLAG_StoreExtents is specified in Initialize().

ERRVALUE QUADTREE::Initialize const DRECT2D Extents,
INT32  NumItems,
INITFLAGS  InitFlags = INITFLAG_None
 

Initialize the quad tree for a specific extents and number of elements.

bool QUADTREE::IsInitialized  )  const
 

Determine if the quad tree is initialized.

QUADTREE& QUADTREE::operator= const QUADTREE rhs  ) 
 

Assignment operator.

ERRVALUE QUADTREE::Search const DRECT2D rect,
BITSET_DEQUE Deque
const
 

Search for the ItemID's that fall within the DRECT2D specified If INITFLAG_StoreExtents is not specified in Initialize(), some of the elements might fall outside the extents specified.

ERRVALUE QUADTREE::Search const DRECT2D rect,
SIMPLE_ARRAY< INT32 > &  ItemList
const
 

Search for the ItemID's that fall within the DRECT2D specified If INITFLAG_StoreExtents is not specified in Initialize(), some of the elements might fall outside the extents specified.

ERRVALUE QUADTREE::SortItemListByExtents SIMPLE_ARRAY< INT32 > &  ItemList  )  const
 

Sort the item list using the item extents stored in the quad tree The list is sorted from smallest extents to largest extents item Only valid if INITFLAG_StoreExtents is specified in Initialize().


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:10 2004 for TNTsdk by  doxygen 1.3.8-20040913