00001
00024 #ifndef INC_MI32_QTREE_H
00025 #define INC_MI32_QTREE_H
00026
00027 #ifndef INC_MI32_SIMPLEAR_H
00028 #include <mi32/simplear.h>
00029 #endif
00030
00031 #ifdef GEOMDLL
00032 #define GEOMLIBEXPORT MI_DLLEXPORT
00033 #define GEOMLIBCLASSEXPORT MI_DLLCLASSEXPORT
00034 #else
00035 #define GEOMLIBEXPORT MI_DLLIMPORT
00036 #define GEOMLIBCLASSEXPORT MI_DLLCLASSIMPORT
00037 #endif
00038
00039 #ifndef GENERATING_DOXYGEN_OUTPUT
00041 struct DRECT2D;
00042 class BITSET_DEQUE;
00043 #endif // GENERATING_DOXYGEN_OUTPUT
00044
00045
00047 class GEOMLIBCLASSEXPORT QUADTREE {
00048 public:
00049 enum INITFLAGS {
00050 INITFLAG_None = 0x0000,
00051 INITFLAG_StoreExtents = 0x0001,
00052 INITFLAG_PointOnly = 0x0002,
00053 INITFLAG_FastAdd = 0x0004
00054 };
00055
00057 QUADTREE (
00058 );
00059
00061 QUADTREE (
00062 const QUADTREE& rhs
00063 );
00064
00066 ~QUADTREE (
00067 );
00068
00070 QUADTREE& operator= (
00071 const QUADTREE& rhs
00072 );
00073
00075 ERRVALUE Add (
00076 INT32 ItemID,
00077 const DRECT2D& Extents
00078 );
00079
00081 void Clear (
00082 );
00083
00086 ERRVALUE Delete (
00087 INT32 ItemID
00088 );
00089
00091 ERRVALUE Delete (
00092 INT32 ItemID,
00093 const DRECT2D& Extents
00094 );
00095
00097 void Free (
00098 );
00099
00102 ERRVALUE GetItemExtents (
00103 INT32 ItemID,
00104 DRECT2D& Extents
00105 ) const;
00106
00108 ERRVALUE Initialize (
00109 const DRECT2D& Extents,
00110 INT32 NumItems,
00111 INITFLAGS InitFlags = INITFLAG_None
00112 );
00113
00115 bool IsInitialized (
00116 ) const;
00117
00120 ERRVALUE Search (
00121 const DRECT2D& rect,
00122 SIMPLE_ARRAY<INT32>& ItemList
00123 ) const;
00124
00127 ERRVALUE Search (
00128 const DRECT2D& rect,
00129 BITSET_DEQUE& Deque
00130 ) const;
00131
00135 ERRVALUE SortItemListByExtents (
00136 SIMPLE_ARRAY<INT32>& ItemList
00137 ) const;
00138
00139 private:
00140 #ifndef GENERATING_DOXYGEN_OUTPUT
00141 class PRIV;
00142 PRIV* m_Priv;
00143 #endif // GENERATING_DOXYGEN_OUTPUT
00144 };
00145
00146 #ifndef GENERATING_DOXYGEN_OUTPUT
00147 DEFINE_ENUM_OP_BITWISE(QUADTREE::INITFLAGS)
00148 #endif
00149
00150 #endif // INC_MI32_QTREE_H