4 #include <QGraphicsView>
23 class PathView
: public QGraphicsView
28 PathView(Map
*map
, POI
*poi
, QWidget
*parent
= 0);
31 QList
<PathItem
*> loadData(const Data
&data
);
33 void setPalette(const Palette
&palette
);
34 void setPOI(POI
*poi
);
35 void setMap(Map
*map
);
36 void setUnits(enum Units units
);
38 void plot(QPainter
*painter
, const QRectF
&target
);
40 int trackCount() const {return _tracks
.count();}
41 int routeCount() const {return _routes
.count();}
42 int waypointCount() const {return _waypoints
.count();}
46 void useOpenGL(bool use
);
51 void showMap(bool show
);
52 void showPOI(bool show
);
53 void setPOIOverlap(bool overlap
);
54 void showWaypointLabels(bool show
);
55 void showPOILabels(bool show
);
56 void showTracks(bool show
);
57 void showRoutes(bool show
);
58 void showWaypoints(bool show
);
59 void showRouteWaypoints(bool show
);
60 void setTrackWidth(int width
);
61 void setRouteWidth(int width
);
62 void setTrackStyle(Qt::PenStyle style
);
63 void setRouteStyle(Qt::PenStyle style
);
69 PathItem
*addTrack(const Track
&track
);
70 PathItem
*addRoute(const Route
&route
);
71 void addWaypoints(const QList
<Waypoint
> &waypoints
);
72 void addPOI(const QVector
<Waypoint
> &waypoints
);
76 qreal
mapScale() const;
77 QPointF
contentCenter() const;
79 void zoom(int zoom
, const QPoint
&pos
, const Coordinates
&c
);
80 void digitalZoom(int zoom
);
81 void resetDigitalZoom();
82 void updatePOIVisibility();
83 void updateWaypointsBoundingRect(const QPointF
&wp
);
85 void mouseDoubleClickEvent(QMouseEvent
*event
);
86 void wheelEvent(QWheelEvent
*event
);
87 void keyPressEvent(QKeyEvent
*event
);
88 void drawBackground(QPainter
*painter
, const QRectF
&rect
);
89 void resizeEvent(QResizeEvent
*event
);
90 void paintEvent(QPaintEvent
*event
);
91 void scrollContentsBy(int dx
, int dy
);
93 QGraphicsScene
*_scene
;
95 QList
<TrackItem
*> _tracks
;
96 QList
<RouteItem
*> _routes
;
97 QList
<WaypointItem
*> _waypoints
;
98 QHash
<Waypoint
, WaypointItem
*> _pois
;
100 QRectF _tr
, _rr
, _wr
;
113 bool _showWaypointLabels
;
117 bool _showRouteWaypoints
;
120 Qt::PenStyle _trackStyle
;
121 Qt::PenStyle _routeStyle
;
127 #endif // TRACKVIEW_H