#ifndef ROUTEITEM_H #define ROUTEITEM_H #include #include "markeritem.h" #include "route.h" #include "units.h" class RouteItem : public QGraphicsItem { public: RouteItem(const Route &route, QGraphicsItem *parent = 0); QPainterPath shape() const {return _shape;} QRectF boundingRect() const {return _shape.boundingRect();} void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); const QPainterPath &path() const {return _path;} void setScale(qreal scale); void setColor(const QColor &color); void setUnits(enum Units units); void showMarker(bool show) {_marker->setVisible(show);} void moveMarker(qreal distance); void showWaypoints(bool show); void showWaypointLabels(bool show); private: void updateShape(); QString toolTip(); QPainterPath _path; QPainterPath _shape; QPen _pen; MarkerItem *_marker; Units _units; qreal _distance; }; #endif // ROUTEITEM_H