Classes |
| struct | CPLRectObj |
Typedefs |
|
typedef struct _CPLQuadTree | CPLQuadTree |
|
typedef void(* | CPLQuadTreeGetBoundsFunc )(const void *hFeature, CPLRectObj *pBounds) |
|
typedef int(* | CPLQuadTreeForeachFunc )(void *pElt, void *pUserData) |
|
typedef void(* | CPLQuadTreeDumpFeatureFunc )(const void *hFeature, int nIndentLevel, void *pUserData) |
Functions |
| CPLQuadTree * | CPLQuadTreeCreate (const CPLRectObj *pGlobalBounds, CPLQuadTreeGetBoundsFunc pfnGetBounds) |
| | Create a new quadtree.
|
| void | CPLQuadTreeDestroy (CPLQuadTree *hQuadtree) |
| | Destroy a quadtree.
|
| void | CPLQuadTreeSetBucketCapacity (CPLQuadTree *hQuadtree, int nBucketCapacity) |
| | Set the maximum capacity of a node of a quadtree.
|
| int | CPLQuadTreeGetAdvisedMaxDepth (int nExpectedFeatures) |
| | Returns the optimal depth of a quadtree to hold nExpectedFeatures.
|
| void | CPLQuadTreeSetMaxDepth (CPLQuadTree *hQuadtree, int nMaxDepth) |
| | Set the maximum depth of a quadtree.
|
| void | CPLQuadTreeInsert (CPLQuadTree *hQuadtree, void *hFeature) |
| | Insert a feature into a quadtree.
|
| void | CPLQuadTreeInsertWithBounds (CPLQuadTree *hQuadtree, void *hFeature, const CPLRectObj *psBounds) |
| | Insert a feature into a quadtree.
|
| void ** | CPLQuadTreeSearch (const CPLQuadTree *hQuadtree, const CPLRectObj *pAoi, int *pnFeatureCount) |
| | Returns all the elements inserted whose bounding box intersects the provided area of interest.
|
| void | CPLQuadTreeForeach (const CPLQuadTree *hQuadtree, CPLQuadTreeForeachFunc pfnForeach, void *pUserData) |
| | Walk through the quadtree and runs the provided function on all the elements.
|
|
void | CPLQuadTreeDump (const CPLQuadTree *hQuadtree, CPLQuadTreeDumpFeatureFunc pfnDumpFeatureFunc, void *pUserData) |
|
void | CPLQuadTreeGetStats (const CPLQuadTree *hQuadtree, int *pnFeatureCount, int *pnNodeCount, int *pnMaxDepth, int *pnMaxBucketCapacity) |
Quad tree implementation.
A quadtree is a tree data structure in which each internal node has up to four children. Quadtrees are most often used to partition a two dimensional space by recursively subdividing it into four quadrants or regions
| void CPLQuadTreeForeach |
( |
const CPLQuadTree * |
hQuadTree, |
|
|
CPLQuadTreeForeachFunc |
pfnForeach, |
|
|
void * |
pUserData |
|
) |
| |
Walk through the quadtree and runs the provided function on all the elements.
This function is provided with the user_data argument of pfnForeach. It must return TRUE to go on the walk through the hash set, or FALSE to make it stop.
Note : the structure of the quadtree must *NOT* be modified during the walk.
- Parameters:
-
| hQuadTree | the quad tree |
| pfnForeach | the function called on each element. |
| pUserData | the user data provided to the function. |