55 typedef struct cpSpatialIndex cpSpatialIndex;
58 struct cpSpatialIndex {
63 cpSpatialIndex *staticIndex, *dynamicIndex;
69 typedef struct cpSpaceHash cpSpaceHash;
86 typedef struct cpBBTree cpBBTree;
106 typedef struct cpSweep1D cpSweep1D;
117 typedef void (*cpSpatialIndexDestroyImpl)(cpSpatialIndex *index);
119 typedef int (*cpSpatialIndexCountImpl)(cpSpatialIndex *index);
122 typedef cpBool (*cpSpatialIndexContainsImpl)(cpSpatialIndex *index,
void *obj,
cpHashValue hashid);
123 typedef void (*cpSpatialIndexInsertImpl)(cpSpatialIndex *index,
void *obj,
cpHashValue hashid);
124 typedef void (*cpSpatialIndexRemoveImpl)(cpSpatialIndex *index,
void *obj,
cpHashValue hashid);
126 typedef void (*cpSpatialIndexReindexImpl)(cpSpatialIndex *index);
127 typedef void (*cpSpatialIndexReindexObjectImpl)(cpSpatialIndex *index,
void *obj,
cpHashValue hashid);
128 typedef void (*cpSpatialIndexReindexQueryImpl)(cpSpatialIndex *index,
cpSpatialIndexQueryFunc func,
void *data);
134 cpSpatialIndexDestroyImpl destroy;
136 cpSpatialIndexCountImpl count;
137 cpSpatialIndexEachImpl each;
139 cpSpatialIndexContainsImpl contains;
140 cpSpatialIndexInsertImpl insert;
141 cpSpatialIndexRemoveImpl
remove;
143 cpSpatialIndexReindexImpl reindex;
144 cpSpatialIndexReindexObjectImpl reindexObject;
145 cpSpatialIndexReindexQueryImpl reindexQuery;
147 cpSpatialIndexQueryImpl query;
148 cpSpatialIndexSegmentQueryImpl segmentQuery;
159 if(index->klass) index->klass->destroy(index);
165 return index->klass->count(index);
171 index->klass->each(index, func, data);
178 return index->klass->contains(index, obj, hashid);
185 index->klass->insert(index, obj, hashid);
192 index->klass->remove(index, obj, hashid);
198 index->klass->reindex(index);
204 index->klass->reindexObject(index, obj, hashid);
210 index->klass->query(index, obj, bb, func, data);
216 index->klass->segmentQuery(index, obj, a, b, t_exit, func, data);
224 index->klass->reindexQuery(index, func, data);