Map Matching
qmapscene.h
Go to the documentation of this file.
1 #ifndef QMAPSCENE_H
2 #define QMAPSCENE_H
3 
4 #include "../pointGPS.h"
5 #include "../pointroad.h"
6 #include "../road.h"
7 #include <QGraphicsRectItem>
8 #include <QGraphicsScene>
9 #include <unordered_map>
10 #include <vector>
11 
12 #define GPSDEFAULT "red"
13 #define GPSSELECTED "green"
14 #define ROADDEFAULT "grey"
15 #define ROADSELECTED "blue"
16 #define COLORCLEAR "white"
17 #define X 0
18 #define Y 1
19 
20 class QMapScene : public QGraphicsScene {
21  Q_OBJECT
22 public:
23  explicit QMapScene(QObject* parent = 0);
24  void initialize(int startx, int starty, int width, int height);
25  double transform(double x, int dim);
26  void highlightSelectedPoint(int pointId);
27  void highlightRoadsDefault(bool basic);
28  void setBackToDefault(int pointId);
29  void setNeighborRoads();
30 
31 signals:
32  void signalTrackCompleted(QString);
33  void signalItemToShow(QGraphicsItem*);
34  void signalNeighboursId(std::vector<long>*);
35 public slots:
36  void onSignalAllPoints(std::vector<PointGPS*>*);
37  void onSignalAllRoads(std::unordered_map<long, Road>* roads, std::vector<PointRoad>*);
38  void onSignalStart();
39  void onSignalCurrentPoint(int pointId);
40  void onSignalRoadPath(std::vector<long>* rp);
41 
42 protected:
43  std::vector<PointGPS*>* m_trackPoints;
44  std::unordered_map<long, Road>* m_roads;
45  std::vector<PointRoad>* m_roadPoints;
46  std::vector<long> m_neighboursId;
47  double m_scaleFactor = 1;
48  int m_width;
49  int m_height;
50  int m_shiftX;
51  int m_shiftY;
53  std::vector<QGraphicsRectItem*> pointItems;
54  QGraphicsEllipseItem* m_selectionCircle;
55 };
56 
57 #endif // QMAPSCENE_H
void onSignalAllRoads(std::unordered_map< long, Road > *roads, std::vector< PointRoad > *)
Definition: qmapscene.cpp:92
std::vector< QGraphicsRectItem * > pointItems
Definition: qmapscene.h:53
void setBackToDefault(int pointId)
Definition: qmapscene.cpp:49
void onSignalAllPoints(std::vector< PointGPS * > *)
Definition: qmapscene.cpp:66
void setNeighborRoads()
Definition: qmapscene.cpp:55
std::vector< PointGPS * > * m_trackPoints
Definition: qmapscene.h:43
void onSignalRoadPath(std::vector< long > *rp)
Definition: qmapscene.cpp:138
std::vector< long > m_neighboursId
Definition: qmapscene.h:46
int m_shiftX
Definition: qmapscene.h:50
void signalNeighboursId(std::vector< long > *)
void highlightRoadsDefault(bool basic)
Definition: qmapscene.cpp:36
QGraphicsEllipseItem * m_selectionCircle
Definition: qmapscene.h:54
int m_height
Definition: qmapscene.h:49
std::unordered_map< long, Road > * m_roads
Definition: qmapscene.h:44
void onSignalStart()
Definition: qmapscene.cpp:113
double m_scaleFactor
Definition: qmapscene.h:47
std::vector< PointRoad > * m_roadPoints
Definition: qmapscene.h:45
void onSignalCurrentPoint(int pointId)
Definition: qmapscene.cpp:120
QMapScene(QObject *parent=0)
Definition: qmapscene.cpp:11
void highlightSelectedPoint(int pointId)
Definition: qmapscene.cpp:24
int m_shiftY
Definition: qmapscene.h:51
void signalTrackCompleted(QString)
double transform(double x, int dim)
int m_width
Definition: qmapscene.h:48
void signalItemToShow(QGraphicsItem *)
void initialize(int startx, int starty, int width, int height)
Definition: qmapscene.cpp:17