Quad search tree implementation. More...
#include <mi32/qtree.h>
Public Types | |
| enum | INITFLAGS { INITFLAG_None = 0x0000, INITFLAG_StoreExtents = 0x0001, INITFLAG_PointOnly = 0x0002, INITFLAG_FastAdd = 0x0004 } |
Public Member Functions | |
| QUADTREE (const QUADTREE &rhs) | |
| QUADTREE () | |
| ~QUADTREE () | |
| 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 |
| QUADTREE & | operator= (const QUADTREE &rhs) |
| 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 |
Quad search tree implementation.
| enum QUADTREE::INITFLAGS |
| QUADTREE::QUADTREE | ( | ) |
Default constructor.
| QUADTREE::QUADTREE | ( | const QUADTREE & | rhs | ) |
Copy constructor.
| QUADTREE::~QUADTREE | ( | ) |
Destructor.
| void QUADTREE::Clear | ( | ) |
Clear the quad tree of all elements, reverts back to the Initialize() state.
Delete an item from the quad tree.
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.
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.
| 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().
1.6.1