forked from CCOMJHC/camp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeographicsitem.h
51 lines (37 loc) · 1.14 KB
/
geographicsitem.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef GEOGRAPHICSITEM_H
#define GEOGRAPHICSITEM_H
#include <QGraphicsItem>
#include <QGeoCoordinate>
class AutonomousVehicleProject;
class BackgroundRaster;
class GeoGraphicsItem : public QGraphicsItem
{
Q_INTERFACES(QGraphicsItem)
public:
enum { BackgroundRasterType = UserType+1,
WaypointType,
TrackLineType,
SurveyPatternType,
PointType,
LineStringType,
PolygonType,
ROSLinkType,
SurveyAreaType,
MeasuringToolType
};
GeoGraphicsItem(QGraphicsItem *parentItem = Q_NULLPTR);
QPointF geoToPixel(QGeoCoordinate const &point, AutonomousVehicleProject *p) const;
QGeoCoordinate pixelToGeo(QPointF const &point) const;
void prepareGeometryChange();
bool showLabelFlag() const;
void setShowLabelFlag(bool show=true);
void setLabel(QString const &label);
void setLabelPosition(QPointF pos);
int type() const override=0;
private:
QGraphicsSimpleTextItem *m_label;
QString m_labelText;
bool m_showLabelFlag;
};
Q_DECLARE_METATYPE(GeoGraphicsItem*)
#endif // GEOGRAPHICSITEM_H