aboutsummaryrefslogtreecommitdiff
path: root/mapman/src/painter.hpp
blob: f7822a98b1f4c4480ea73f24c322fa39777c891d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef MAPPAINTER_HPP
#define MAPPAINTER_HPP

#include <utility>
#include <vector>
#include <QObject>

class QGraphicsScene;
class QGraphicsView;
class QGraphicsItem;
class map_library;

class map_painter : public QObject
{
    Q_OBJECT
public:
    map_painter(); 
    ~map_painter();
    void set_dimension(int h, int v);
    void set_map_library(map_library *lib);
    void set_map_id(int pos, bool populated, int id, bool user_input = false);

    QGraphicsView* view() { return v; }
signals:
    void map_id_changed(int pos, bool populated, int id);
private:
    QGraphicsView *v;
    QGraphicsScene *s;
    map_library *l;
    int hc;
    int vc;
    std::vector<QGraphicsItem*> slices;
    std::vector<std::tuple<QGraphicsItem*, QGraphicsItem*>> bgspr;
};

#endif