#include <cQuadtree.h>
A 2d space we need to sub divide for fast access. e.g. Maps. https://en.wikipedia.org/wiki/Quadtree Similar to 3D ISpatialTest
◆ ARRAYOBJ_t
◆ cQuadtree()
GrayLib::cQuadtree::cQuadtree |
( |
RECTQ_t |
boundary | ) |
|
◆ ~cQuadtree()
GrayLib::cQuadtree::~cQuadtree |
( |
| ) |
|
◆ AddObject() [1/2]
bool GrayLib::cQuadtree::AddObject |
( |
const RECTQ_t & |
rect, |
|
|
IQuadObject * |
pObj |
|
) |
| |
ASSUME object is not already here ! ASSUME object fits into parent. rect MUST be equal or fully inside this.
◆ AddObject() [2/2]
bool GrayLib::cQuadtree::AddObject |
( |
IQuadObject * |
pObj | ) |
|
|
inline |
ASSUME object is not already here ! ASSUME object fits into parent.
◆ AddObjectGrow()
void GrayLib::cQuadtree::AddObjectGrow |
( |
IQuadObject * |
pObj | ) |
|
grow the boundary to fit this object.
- Note
- Used only at top level.
◆ CollapseCheck()
bool GrayLib::cQuadtree::CollapseCheck |
( |
size_t |
i | ) |
|
|
protected |
Collapse a branch if its empty.
◆ get_Boundary()
const RECTQ_t& GrayLib::cQuadtree::get_Boundary |
( |
| ) |
const |
|
inline |
◆ GetRect()
◆ isEmptyQuad()
bool GrayLib::cQuadtree::isEmptyQuad |
( |
| ) |
const |
◆ RemoveAll()
void GrayLib::cQuadtree::RemoveAll |
( |
| ) |
|
◆ RemoveObject() [1/2]
bool GrayLib::cQuadtree::RemoveObject |
( |
const RECTQ_t & |
rect, |
|
|
IQuadObject * |
pObj |
|
) |
| |
◆ RemoveObject() [2/2]
bool GrayLib::cQuadtree::RemoveObject |
( |
IQuadObject * |
pObj | ) |
|
|
inline |
◆ SetBoundary()
bool GrayLib::cQuadtree::SetBoundary |
( |
const RECTQ_t & |
rect, |
|
|
OUT ARRAYOBJ_t & |
aBumped |
|
) |
| |
Set new boundary. We must re-balance this and all its existing children ! Set the boundary bigger in order to make this more efficient on subsequent adds.
- aBumped = reject/remove all items that didn't fit in the new boundary.
◆ UNITTEST_FRIEND()
GrayLib::cQuadtree::UNITTEST_FRIEND |
( |
cQuadtree |
| ) |
|
◆ VisitObjectsOverlap()
bool GrayLib::cQuadtree::VisitObjectsOverlap |
( |
const RECTQ_t & |
rect, |
|
|
IQuadVisit * |
pVisit |
|
) |
| const |
Find the objects in this box (or its children).
- Returns
- false = pVisit indicated to stop search.
The documentation for this class was generated from the following files: