Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
index.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/*
18 * this library is derived from an archived home directory of Antonin Guttman
19 * that implemented the ideas described in
20 * "R-trees: a dynamic index structure for spatial searching"
21 * Antonin Guttman, University of California, Berkeley
22 * SIGMOD '84 Proceedings of the 1984 ACM SIGMOD international conference on Management of data
23 * ISBN:0-89791-128-8
24 * http://dx.doi.org/10.1145/602259.602266
25 * this copy of the code was retrieved from
26 * http://web.archive.org/web/20030210112132/http://www.es.ucsc.edu/~tonig/rtrees/
27 * we are using the quadratic node splitter only
28 * we made a few cosmetic changes to fit our needs
29 * per Antonin there is no copyright
30 */
31
32/*-----------------------------------------------------------------------------
33| Global definitions.
34-----------------------------------------------------------------------------*/
35
36#ifndef NUMDIMS
37#define NUMDIMS 2
38#endif /*NUMDIMS*/
39/* #define NDEBUG */
40#define NUMSIDES 2*NUMDIMS
41/* branching factor of a node */
42/* #define NODECARD (int)((PGSIZE-(2*sizeof(int)))/sizeof(struct Branch))*/
43#define NODECARD 64
44typedef struct RTree RTree_t;
45
46#include <label/rectangle.h>
47#include <label/node.h>
48#include <label/split.q.h>
49
50#define CX(i) (i)
51#define NX(i) (i+NUMDIMS)
52#define CY(i) (i+1)
53#define NY(i) (i+1+NUMDIMS)
54
55typedef struct Leaf {
57 void *data;
59
60typedef struct LeafList {
61 struct LeafList *next;
64
65 struct RTree {
67
69};
70
71RTree_t *RTreeOpen(void);
72int RTreeClose(RTree_t * rtp);
75int RTreeInsert(RTree_t *, Rect_t *, void *, Node_t **, int);
76
80
81#ifdef RTDEBUG
82void PrintNode(Node_t *);
83#endif
84
85#ifdef __cplusplus
86}
87#endif
LeafList_t * RTreeLeafListAdd(LeafList_t *llp, Leaf_t *lp)
Definition index.c:30
void RTreeLeafListFree(LeafList_t *llp)
Definition index.c:40
RTree_t * RTreeOpen(void)
Definition index.c:51
int RTreeClose(RTree_t *rtp)
Definition index.c:89
Node_t * RTreeNewIndex(void)
Definition index.c:61
LeafList_t * RTreeNewLeafList(Leaf_t *lp)
Definition index.c:19
struct Leaf Leaf_t
int RTreeInsert(RTree_t *, Rect_t *, void *, Node_t **, int)
Definition index.c:182
LeafList_t * RTreeSearch(RTree_t *, Node_t *, Rect_t *)
Definition index.c:140
struct LeafList LeafList_t
Leaf_t * leaf
Definition index.h:62
struct LeafList * next
Definition index.h:61
Definition index.h:55
void * data
Definition index.h:57
Rect_t rect
Definition index.h:56
Definition node.h:24
Definition index.h:65
SplitQ_t split
Definition index.h:68
Node_t * root
Definition index.h:66