aboutsummaryrefslogtreecommitdiff
path: root/QuadTree.h
diff options
context:
space:
mode:
Diffstat (limited to 'QuadTree.h')
-rw-r--r--QuadTree.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/QuadTree.h b/QuadTree.h
new file mode 100644
index 0000000..6ee7a5a
--- /dev/null
+++ b/QuadTree.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <memory>
+#include <forward_list>
+
+#include "Artist.h"
+#include "Rectangle.h"
+
+class QuadTree {
+public:
+ const int capacity = 2;
+
+ std::forward_list<Artist *> artists;
+
+ Rectangle boundary;
+ std::unique_ptr<QuadTree> subtree[4] = {
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ };
+
+ void subdivide();
+ void query_range();
+};
+
+
+