4 #include <QGraphicsView>
23 class PathView
: public QGraphicsView
28 PathView(QWidget
*parent
= 0);
31 QList
<PathItem
*> loadData(const Data
&data
);
33 void setPOI(POI
*poi
);
34 void setMap(Map
*map
);
35 void setUnits(enum Units units
);
37 void plot(QPainter
*painter
, const QRectF
&target
);
39 int trackCount() const {return _tracks
.count();}
40 int routeCount() const {return _routes
.count();}
41 int waypointCount() const {return _waypoints
.count();}
48 void showPOI(bool show
);
49 void setPOIOverlap(bool overlap
);
50 void showWaypointLabels(bool show
);
51 void showPOILabels(bool show
);
52 void showTracks(bool show
);
53 void showRoutes(bool show
);
54 void showWaypoints(bool show
);
55 void showRouteWaypoints(bool show
);
61 PathItem
*addTrack(const Track
&track
);
62 PathItem
*addRoute(const Route
&route
);
63 void addWaypoints(const QList
<Waypoint
> &waypoints
);
64 void addPOI(const QVector
<Waypoint
> &waypoints
);
68 QRectF
trackBoundingRect() const;
69 QRectF
routeBoundingRect() const;
70 QRectF
waypointBoundingRect() const;
71 qreal
trackScale() const;
72 qreal
routeScale() const;
73 qreal
waypointScale() const;
74 qreal
mapScale(int zoom
) const;
75 void rescale(qreal scale
);
77 void zoom(int z
, const QPoint
&pos
);
78 void updatePOIVisibility();
80 void mouseDoubleClickEvent(QMouseEvent
*event
);
81 void wheelEvent(QWheelEvent
*event
);
82 void keyPressEvent(QKeyEvent
*event
);
83 void drawBackground(QPainter
*painter
, const QRectF
&rect
);
84 void resizeEvent(QResizeEvent
*event
);
85 void paintEvent(QPaintEvent
*event
);
87 QGraphicsScene
*_scene
;
89 QList
<TrackItem
*> _tracks
;
90 QList
<RouteItem
*> _routes
;
91 QList
<WaypointItem
*> _waypoints
;
92 QHash
<Waypoint
, WaypointItem
*> _pois
;
107 bool _showWaypointLabels
;
111 bool _showRouteWaypoints
;
116 #endif // TRACKVIEW_H