about summary refs log blame commit diff stats
path: root/src/subway_map.h
blob: 6cb5c638b251d28ff8d2d24b0599f3458354d739 (plain) (tree)
1
2
3
4
5
6
7
8
9







                             
                   
                 
                              









                                        
                     
                     
                     


                         


                                                         
  
                                                             

                                                        
#ifndef SUBWAY_MAP_H_BD2D843E
#define SUBWAY_MAP_H_BD2D843E

#include <wx/wxprec.h>

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <memory>
#include <optional>
#include <vector>

#include <quadtree/Quadtree.h>

class SubwayMap : public wxPanel {
 public:
  SubwayMap(wxWindow *parent);

  void UpdateIndicators();

 private:
  void OnPaint(wxPaintEvent &event);
  void OnMouseMove(wxMouseEvent &event);

  void Redraw();

  wxImage map_image_;
  wxImage owl_image_;

  wxBitmap rendered_;
  int render_x_ = 0;
  int render_y_ = 0;
  int render_width_ = 0;
  int render_height_ = 0;

  struct GetItemBox {
    quadtree::Box<float> operator()(const int &id) const;
  };
  
  std::unique_ptr<quadtree::Quadtree<int, GetItemBox>> tree_;
  std::optional<int> hovered_item_;
};

#endif /* end of include guard: SUBWAY_MAP_H_BD2D843E */