about summary refs log tree commit diff stats
path: root/src/subway_map.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-12 18:45:21 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-12 18:45:21 -0400
commite3fbcc9f29a1b1c83b23a4cef3819631fd3117d0 (patch)
treeececdc789eda39a9d07da037a839a9906591864e /src/subway_map.h
parent00658b38bd65e2cb81a502bd72e98ad9c411a7b4 (diff)
downloadlingo-ap-tracker-e3fbcc9f29a1b1c83b23a4cef3819631fd3117d0.tar.gz
lingo-ap-tracker-e3fbcc9f29a1b1c83b23a4cef3819631fd3117d0.tar.bz2
lingo-ap-tracker-e3fbcc9f29a1b1c83b23a4cef3819631fd3117d0.zip
Subway map hover detection with a quadtree
Diffstat (limited to 'src/subway_map.h')
-rw-r--r--src/subway_map.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/subway_map.h b/src/subway_map.h index e375750..6cb5c63 100644 --- a/src/subway_map.h +++ b/src/subway_map.h
@@ -7,8 +7,12 @@
7#include <wx/wx.h> 7#include <wx/wx.h>
8#endif 8#endif
9 9
10#include <memory>
11#include <optional>
10#include <vector> 12#include <vector>
11 13
14#include <quadtree/Quadtree.h>
15
12class SubwayMap : public wxPanel { 16class SubwayMap : public wxPanel {
13 public: 17 public:
14 SubwayMap(wxWindow *parent); 18 SubwayMap(wxWindow *parent);
@@ -29,7 +33,13 @@ class SubwayMap : public wxPanel {
29 int render_y_ = 0; 33 int render_y_ = 0;
30 int render_width_ = 0; 34 int render_width_ = 0;
31 int render_height_ = 0; 35 int render_height_ = 0;
36
37 struct GetItemBox {
38 quadtree::Box<float> operator()(const int &id) const;
39 };
32 40
41 std::unique_ptr<quadtree::Quadtree<int, GetItemBox>> tree_;
42 std::optional<int> hovered_item_;
33}; 43};
34 44
35#endif /* end of include guard: SUBWAY_MAP_H_BD2D843E */ 45#endif /* end of include guard: SUBWAY_MAP_H_BD2D843E */