summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdimension/prtree.c14
-rw-r--r--libdimension/prtree.h12
-rw-r--r--tests/libdimension/prtree.c1
3 files changed, 15 insertions, 12 deletions
diff --git a/libdimension/prtree.c b/libdimension/prtree.c
index 55bbf5c..4e6131b 100644
--- a/libdimension/prtree.c
+++ b/libdimension/prtree.c
@@ -21,7 +21,17 @@
#include "dimension-impl.h"
#include <stdlib.h>
-typedef struct dmnsn_pseudo_prtree dmnsn_pseudo_prtree;
+/* Number of children per node */
+#define DMNSN_PRTREE_B 6
+
+struct dmnsn_prtree_node {
+ dmnsn_bounding_box bounding_box;
+
+ /* Children (objects or subtrees) */
+ bool is_leaf;
+ void *children[DMNSN_PRTREE_B];
+ dmnsn_bounding_box bounding_boxes[DMNSN_PRTREE_B];
+};
typedef struct dmnsn_pseudo_prleaf {
void *children[DMNSN_PRTREE_B];
@@ -29,6 +39,8 @@ typedef struct dmnsn_pseudo_prleaf {
dmnsn_bounding_box bounding_box;
} dmnsn_pseudo_prleaf;
+typedef struct dmnsn_pseudo_prtree dmnsn_pseudo_prtree;
+
typedef struct dmnsn_pseudo_prnode {
dmnsn_pseudo_prtree *left, *right;
dmnsn_pseudo_prleaf children[6];
diff --git a/libdimension/prtree.h b/libdimension/prtree.h
index 7848879..7ab616d 100644
--- a/libdimension/prtree.h
+++ b/libdimension/prtree.h
@@ -30,17 +30,7 @@
#include <stdbool.h>
-/* Number of children per node */
-#define DMNSN_PRTREE_B 6
-
-typedef struct dmnsn_prtree_node {
- dmnsn_bounding_box bounding_box;
-
- /* Children (objects or subtrees) */
- bool is_leaf;
- void *children[DMNSN_PRTREE_B];
- dmnsn_bounding_box bounding_boxes[DMNSN_PRTREE_B];
-} dmnsn_prtree_node;
+typedef struct dmnsn_prtree_node dmnsn_prtree_node;
typedef struct dmnsn_prtree {
dmnsn_bounding_box bounding_box;
diff --git a/tests/libdimension/prtree.c b/tests/libdimension/prtree.c
index 8753ed2..1c69fd4 100644
--- a/tests/libdimension/prtree.c
+++ b/tests/libdimension/prtree.c
@@ -22,6 +22,7 @@
*/
#include "dimension-impl.h"
+#include "../../libdimension/prtree.c" /* For DMNSN_PRTREE_B */
#include <stdio.h>
#include <stdlib.h>