25 return (child->
pos > -1);
47 s[top].
pos =
t->rootpos;
53 if (s[top].
sn->level > 0) {
56 for (i = s[top].
branch_id; i <
t->nodecard; i++) {
57 if (s[top].
sn->branch[i].child.pos > -1 &&
75 for (i = 0; i <
t->leafcard; i++) {
76 if (s[top].
sn->branch[i].child.id &&
80 if (!
shcb(s[top].
sn->branch[i].child.id,
81 &(s[top].
sn->branch[i].rect),
cbarg)) {
112 int top = 0,
down = 0;
123 s[top].
pos =
t->rootpos;
127 while (s[top].sn->level > level) {
144 cover = &(s[top - 1].
sn->branch[s[top - 1].
branch_id].rect);
164 else if (result == 2) {
173 else if (result == 1) {
184 cover = &(s[top - 1].
sn->branch[s[top - 1].
branch_id].rect);
242 b->child.pos =
t->rootpos;
278 b->child.pos =
t->rootpos;
306 int top = 0,
down = 0;
314 s[top].
pos =
t->rootpos;
320 if (s[top].sn->level > 0) {
323 for (i = s[top].branch_id; i <
t->nodecard; i++) {
324 if (n->
branch[i].child.pos > -1 &&
345 for (i = 0; i <
t->leafcard; i++) {
346 if (s[top].sn->branch[i].child.id &&
347 s[top].sn->branch[i].child.id ==
371 minfill = (s[
down].
sn->level ?
t->min_node_fill :
t->min_leaf_fill);
372 if (s[
down].sn->count >= minfill) {
420 for (i = 0; i <
t->nodecard; i++) {
421 if (n->
branch[i].child.pos > -1) {
428 for (i = 0; i <
t->leafcard; i++) {
429 if (n->
branch[i].child.id) {
445 for (i = 0; i <
t->nodecard; i++) {
446 if (n->
branch[i].child.pos > -1)
450 t->rootpos = n->
branch[i].child.pos;
int RTreeAddBranch(struct RTree_Branch *, struct RTree_Node *, struct RTree_Node **, struct RTree_ListBranch **, struct RTree_Rect *, char *, struct RTree *)
void RTreeDisconnectBranch(struct RTree_Node *, int, struct RTree *)
void RTreeNodeCover(struct RTree_Node *, struct RTree_Rect *, struct RTree *)
void RTreeAddNodePos(off_t, int, struct RTree *)
struct RTree_Node * RTreeGetNode(off_t, int, struct RTree *)
void RTreeCopyBranch(struct RTree_Branch *, struct RTree_Branch *, struct RTree *)
int RTreePickBranch(struct RTree_Rect *, struct RTree_Node *, struct RTree *)
void RTreeNodeChanged(struct RTree_Node *, off_t, struct RTree *)
int RTreeExpandRect(struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
#define RTreeCopyRect(r1, r2, t)
int RTreeCompareRect(struct RTree_Rect *, struct RTree_Rect *, struct RTree *)
int RTreeSearchF(struct RTree *t, struct RTree_Rect *r, SearchHitCallback *shcb, void *cbarg)
int RTreeValidChildF(union RTree_Child *child)
int RTreeDeleteRectF(struct RTree_Rect *r, union RTree_Child child, struct RTree *t)
int RTreeInsertRectF(struct RTree_Rect *r, union RTree_Child child, int level, struct RTree *t)
off_t RTreeGetNodePos(struct RTree *t)
size_t RTreeWriteNode(struct RTree_Node *n, struct RTree *t)
void RTreeCopyNode(struct RTree_Node *n1, struct RTree_Node *n2, struct RTree *t)
void RTreeFreeNode(struct RTree_Node *n)
struct RTree_Node * RTreeAllocNode(struct RTree *t, int level)
void RTreeInitNode(struct RTree *t, struct RTree_Node *n, int type)
int RTreeOverlap(struct RTree_Rect *r, struct RTree_Rect *s, struct RTree *t)
int SearchHitCallback(int id, const struct RTree_Rect *rect, void *arg)
struct RTree_Branch * branch
void RTreeFreeListNode(struct RTree_ListNode *p)
void RTreeReInsertNode(struct RTree_Node *n, struct RTree_ListNode **ee)
void RTreeFreeListBranch(struct RTree_ListBranch *p)
#define MAXLEVEL
Maximum verbosity level.