28 return (child->
pos > -1);
50 s[top].
pos =
t->rootpos;
56 if (s[top].
sn->level > 0) {
59 for (i = s[top].
branch_id; i <
t->nodecard; i++) {
60 if (s[top].
sn->branch[i].child.pos > -1 &&
78 for (i = 0; i <
t->leafcard; i++) {
79 if (s[top].
sn->branch[i].child.id &&
83 if (!
shcb(s[top].
sn->branch[i].child.id,
84 &(s[top].
sn->branch[i].rect),
cbarg)) {
115 int top = 0,
down = 0;
126 s[top].
pos =
t->rootpos;
130 while (s[top].sn->level > level) {
147 cover = &(s[top - 1].
sn->branch[s[top - 1].
branch_id].rect);
167 else if (result == 2) {
176 else if (result == 1) {
187 cover = &(s[top - 1].
sn->branch[s[top - 1].
branch_id].rect);
245 b->child.pos =
t->rootpos;
281 b->child.pos =
t->rootpos;
309 int top = 0,
down = 0;
317 s[top].
pos =
t->rootpos;
323 if (s[top].sn->level > 0) {
326 for (i = s[top].branch_id; i <
t->nodecard; i++) {
327 if (n->
branch[i].child.pos > -1 &&
348 for (i = 0; i <
t->leafcard; i++) {
349 if (s[top].sn->branch[i].child.id &&
350 s[top].sn->branch[i].child.id ==
374 minfill = (s[
down].
sn->level ?
t->min_node_fill :
t->min_leaf_fill);
375 if (s[
down].sn->count >= minfill) {
423 for (i = 0; i <
t->nodecard; i++) {
424 if (n->
branch[i].child.pos > -1) {
431 for (i = 0; i <
t->leafcard; i++) {
432 if (n->
branch[i].child.id) {
448 for (i = 0; i <
t->nodecard; i++) {
449 if (n->
branch[i].child.pos > -1)
453 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.