summaryrefslogtreecommitdiff
path: root/experimental/tectonics/tectonics.h
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/tectonics/tectonics.h')
-rw-r--r--experimental/tectonics/tectonics.h52
1 files changed, 1 insertions, 51 deletions
diff --git a/experimental/tectonics/tectonics.h b/experimental/tectonics/tectonics.h
index b2793e9..de5b18a 100644
--- a/experimental/tectonics/tectonics.h
+++ b/experimental/tectonics/tectonics.h
@@ -5,27 +5,7 @@
#include <stdbool.h>
#include <cairo.h>
-struct point_t {
- double x, y;
- void *data;
-};
-
-
-struct quad_region_t {
- struct point_t center;
- double half_dim;
-};
-
-
-struct quadtree_node_t {
- struct quad_region_t region;
-
- int id;
-
- /* children */
- struct quadtree_node_t *nw, *ne, *sw, *se;
-};
-
+#include "geometry.h"
struct world_t {
struct point_t *points;
@@ -35,36 +15,6 @@ struct world_t {
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
- * quadtree
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-bool contains_point(struct quad_region_t region, struct point_t pt);
-struct quadtree_node_t new_node(struct point_t center, double half_dim);
-void subdivide(struct quadtree_node_t *node, struct point_t *points);
-bool insert(struct quadtree_node_t *node,
- struct point_t *points, int id);
-int get_closest(struct quadtree_node_t *root,
- struct point_t *points,
- struct point_t pt);
-void draw_quadtree(cairo_t *cr, struct quadtree_node_t *root);
-void free_tree(struct quadtree_node_t *root);
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * util
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-void get_cairo_size(cairo_t *cr, int *width, int *height);
-double rand01();
-double distance(struct point_t p1, struct point_t p2);
-
-
-/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
* worlds
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~