| 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 |
| 17 | extern "C" { |
| 18 | #endif |
| 19 | |
| 20 | #include <index.h> |
| 21 | |
| 22 | typedef struct Branch { |
| 23 | Rect_t rect; |
| 24 | struct Node *child; |
| 25 | } Branch_t; |
| 26 | |
| 27 | typedef struct Node { |
| 28 | int count; |
| 29 | int level; /* 0 is leaf, others positive */ |
| 30 | struct Branch branch[NODECARD]; |
| 31 | } Node_t; |
| 32 | |
| 33 | void RTreeFreeNode(RTree_t *, Node_t *); |
| 34 | void InitNode(Node_t *); |
| 35 | void InitBranch(Branch_t *); |
| 36 | Rect_t NodeCover(Node_t *); |
| 37 | int PickBranch(Rect_t *, Node_t *); |
| 38 | int AddBranch(RTree_t *, Branch_t *, Node_t *, Node_t **); |
| 39 | void DisconBranch(Node_t *, int); |
| 40 | void PrintBranch(int, Branch_t *); |
| 41 | Node_t *RTreeNewNode(RTree_t *); |
| 42 | #ifdef RTDEBUG |
| 43 | void PrintNode(Node_t * n); |
| 44 | void PrintBranch(int i, Branch_t * b); |
| 45 | #endif |
| 46 | |
| 47 | #ifdef __cplusplus |
| 48 | } |
| 49 | #endif |
| 50 | |
| 51 | #endif /*NODE_H */ |
| 52 | |