22 #include <sys/types.h> 29 return (child->
pos > -1);
41 int hitCount = 0, notfound, currlevel;
59 currlevel = s[top].
sn->
level - 1;
109 struct RTree_Node *newnode, off_t *newnode_pos,
116 int top = 0, down = 0;
131 while (s[top].sn->level > level) {
133 currlevel = s[top].
sn->
level - 1;
149 result =
RTreeAddBranch(b, s[top].sn, &n2, ee, cover, overflow, t);
168 else if (result == 2) {
177 else if (result == 1) {
222 off_t newnode_pos = -1;
235 result = RTreeInsertRect2F(r, child, level, newnode, &newnode_pos,
236 t, &reInsertList, overflow);
261 while (reInsertList) {
264 level = reInsertList->
level;
266 reInsertList = reInsertList->
next;
270 RTreeInsertRect2F(&(b->
rect), b->
child, level, newnode, &newnode_pos, t,
271 &reInsertList, overflow);
308 int i, notfound = 1, currlevel;
310 int top = 0, down = 0;
322 while (notfound && top >= 0) {
324 if (s[top].sn->level > 0) {
326 currlevel = s[top].
sn->
level - 1;
327 for (i = s[top].branch_id; i < t->
nodecard; i++) {
350 if (s[top].sn->branch[i].child.id &&
375 if (s[down].sn->count >= minfill) {
414 if (!RTreeDeleteRect2F(r, child, t, &reInsertList)) {
418 while (reInsertList) {
420 n = reInsertList->
node;
438 reInsertList = reInsertList->
next;
struct RTree_Rect rect_0 rect_1 upperrect orect
#define RTreeCopyRect(r1, r2, t)
int RTreeCompareRect(struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
void RTreeFreeNode(struct RTree_Node *n)
int SearchHitCallback(int id, const struct RTree_Rect *rect, void *arg)
#define MAXLEVEL
Maximum verbosity level.
void RTreeCopyNode(struct RTree_Node *n1, struct RTree_Node *n2, struct RTree *t)
struct RTree_ListBranch * next
struct RTree_ListNode * next
void RTreeInitNode(struct RTree *t, struct RTree_Node *n, int type)
int RTreeSearchF(struct RTree *t, struct RTree_Rect *r, SearchHitCallback *shcb, void *cbarg)
void RTreeFreeListNode(struct RTree_ListNode *p)
int RTreeDeleteRectF(struct RTree_Rect *r, union RTree_Child child, struct RTree *t)
int RTreeValidChildF(union RTree_Child *child)
void RTreeAddNodePos(off_t, int, struct RTree *)
void RTreeDisconnectBranch(struct RTree_Node *, int, struct RTree *)
int RTreeInsertRectF(struct RTree_Rect *r, union RTree_Child child, int level, struct RTree *t)
struct RTree_Branch * branch
int RTreeExpandRect(struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
void RTreeFreeListBranch(struct RTree_ListBranch *p)
struct RTree_Node * RTreeAllocNode(struct RTree *t, int level)
off_t RTreeGetNodePos(struct RTree *t)
int RTreeAddBranch(struct RTree_Branch *, struct RTree_Node *, struct RTree_Node **, struct RTree_ListBranch **, struct RTree_Rect *, char *, struct RTree *)
void RTreeNodeChanged(struct RTree_Node *, off_t, struct RTree *)
struct RTree_Node * RTreeGetNode(off_t, int, struct RTree *)
int RTreePickBranch(struct RTree_Rect *, struct RTree_Node *, struct RTree *)
void RTreeCopyBranch(struct RTree_Branch *, struct RTree_Branch *, struct RTree *)
size_t RTreeWriteNode(struct RTree_Node *n, struct RTree *t)
void RTreeReInsertNode(struct RTree_Node *n, struct RTree_ListNode **ee)
void RTreeNodeCover(struct RTree_Node *, struct RTree_Rect *, struct RTree *)
int RTreeOverlap(struct RTree_Rect *r, struct RTree_Rect *s, struct RTree *t)