diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 15:37:31 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 15:37:31 +0200 |
commit | e8601b35b601b0ee1486dfaa12385e71b7f2b300 (patch) | |
tree | 244fc97a12ee17e28e6fc407988508bfbc06d89a /QuadTree.h | |
parent | fe8f7273f0efdfe319a0d3e3b2fc2847992745af (diff) |
WIP quadtree visualization scaffolding
Diffstat (limited to 'QuadTree.h')
-rw-r--r-- | QuadTree.h | 28 |
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(); +}; + + + |