1/* vim:set shiftwidth=4 ts=8: */
2
3/*************************************************************************
4 * Copyright (c) 2011 AT&T Intellectual Property
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *
10 * Contributors: See CVS logs. Details at http://www.graphviz.org/
11 *************************************************************************/
12
13#ifndef NODE_H
14#define NODE_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#include <index.h>
21
22typedef struct Branch {
23 Rect_t rect;
24 struct Node *child;
25} Branch_t;
26
27typedef struct Node {
28 int count;
29 int level; /* 0 is leaf, others positive */
30 struct Branch branch[NODECARD];
31} Node_t;
32
33void RTreeFreeNode(RTree_t *, Node_t *);
34void InitNode(Node_t *);
35void InitBranch(Branch_t *);
36Rect_t NodeCover(Node_t *);
37int PickBranch(Rect_t *, Node_t *);
38int AddBranch(RTree_t *, Branch_t *, Node_t *, Node_t **);
39void DisconBranch(Node_t *, int);
40void PrintBranch(int, Branch_t *);
41Node_t *RTreeNewNode(RTree_t *);
42#ifdef RTDEBUG
43void PrintNode(Node_t * n);
44void PrintBranch(int i, Branch_t * b);
45#endif
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif /*NODE_H */
52