33 #ifndef CPL_QUAD_TREE_H_INCLUDED
34 #define CPL_QUAD_TREE_H_INCLUDED
78 int nIndentLevel,
void *pUserData);
113 int *pnFeatureCount,
int *pnNodeCount,
114 int *pnMaxDepth,
int *pnMaxBucketCapacity);
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:299
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
CPLQuadTree * CPLQuadTreeCreate(const CPLRectObj *pGlobalBounds, CPLQuadTreeGetBoundsFunc pfnGetBounds)
Create a new quadtree.
Definition: cpl_quad_tree.cpp:154
void CPLQuadTreeRemove(CPLQuadTree *hQuadtree, void *hFeature, const CPLRectObj *psBounds)
Remove a feature from a quadtree.
Definition: cpl_quad_tree.cpp:458
void(* CPLQuadTreeGetBoundsExFunc)(const void *hFeature, void *pUserData, CPLRectObj *pBounds)
CPLQuadTreeGetBoundsExFunc.
Definition: cpl_quad_tree.h:71
void CPLQuadTreeInsert(CPLQuadTree *hQuadtree, void *hFeature)
Insert a feature into a quadtree.
Definition: cpl_quad_tree.cpp:346
int(* CPLQuadTreeForeachFunc)(void *pElt, void *pUserData)
CPLQuadTreeForeachFunc.
Definition: cpl_quad_tree.h:75
void(* CPLQuadTreeGetBoundsFunc)(const void *hFeature, CPLRectObj *pBounds)
CPLQuadTreeGetBoundsFunc.
Definition: cpl_quad_tree.h:68
void CPLQuadTreeGetStats(const CPLQuadTree *hQuadtree, int *pnFeatureCount, int *pnNodeCount, int *pnMaxDepth, int *pnMaxBucketCapacity)
Get stats.
Definition: cpl_quad_tree.cpp:1067
void CPLQuadTreeDump(const CPLQuadTree *hQuadtree, CPLQuadTreeDumpFeatureFunc pfnDumpFeatureFunc, void *pUserData)
Dump quad tree.
Definition: cpl_quad_tree.cpp:1034
void CPLQuadTreeForeach(const CPLQuadTree *hQuadtree, CPLQuadTreeForeachFunc pfnForeach, void *pUserData)
Walk through the quadtree and runs the provided function on all the elements.
Definition: cpl_quad_tree.cpp:971
void CPLQuadTreeSetBucketCapacity(CPLQuadTree *hQuadtree, int nBucketCapacity)
Set the maximum capacity of a node of a quadtree.
Definition: cpl_quad_tree.cpp:312
void CPLQuadTreeSetMaxDepth(CPLQuadTree *hQuadtree, int nMaxDepth)
Set the maximum depth of a quadtree.
Definition: cpl_quad_tree.cpp:294
void CPLQuadTreeDestroy(CPLQuadTree *hQuadtree)
Destroy a quadtree.
Definition: cpl_quad_tree.cpp:514
struct _CPLQuadTree CPLQuadTree
Opaque type for a quad tree.
Definition: cpl_quad_tree.h:65
CPLQuadTree * CPLQuadTreeCreateEx(const CPLRectObj *pGlobalBounds, CPLQuadTreeGetBoundsExFunc pfnGetBounds, void *pUserData)
Create a new quadtree.
Definition: cpl_quad_tree.cpp:203
void CPLQuadTreeInsertWithBounds(CPLQuadTree *hQuadtree, void *hFeature, const CPLRectObj *psBounds)
Insert a feature into a quadtree.
Definition: cpl_quad_tree.cpp:375
void(* CPLQuadTreeDumpFeatureFunc)(const void *hFeature, int nIndentLevel, void *pUserData)
CPLQuadTreeDumpFeatureFunc.
Definition: cpl_quad_tree.h:77
void CPLQuadTreeForceUseOfSubNodes(CPLQuadTree *hQuadTree)
Force the quadtree to insert as much as possible a feature whose bbox spread over multiple subnodes i...
Definition: cpl_quad_tree.cpp:330
void ** CPLQuadTreeSearch(const CPLQuadTree *hQuadtree, const CPLRectObj *pAoi, int *pnFeatureCount)
Returns all the elements inserted whose bounding box intersects the provided area of interest.
Definition: cpl_quad_tree.cpp:907
int CPLQuadTreeGetAdvisedMaxDepth(int nExpectedFeatures)
Returns the optimal depth of a quadtree to hold nExpectedFeatures.
Definition: cpl_quad_tree.cpp:247
Describe a rectangle.
Definition: cpl_quad_tree.h:57
double minx
Minimum x.
Definition: cpl_quad_tree.h:58
double maxy
Maximum y.
Definition: cpl_quad_tree.h:61
double miny
Minimum y.
Definition: cpl_quad_tree.h:59
double maxx
Maximum x.
Definition: cpl_quad_tree.h:60