waypointlineitem.h 1008 Bytes
Newer Older
1 2 3 4
#ifndef WAYPOINTLINEITEM_H
#define WAYPOINTLINEITEM_H

#include <QGraphicsLineItem>
5
#include "../../opmapcontrol.h"
6

lm's avatar
lm committed
7 8
namespace mapcontrol {
class WaypointLineItem : public QObject,public QGraphicsLineItem
9
{
lm's avatar
lm committed
10 11
    Q_OBJECT
    Q_INTERFACES(QGraphicsItem)
12
public:
lm's avatar
lm committed
13
    enum { Type = UserType + 7 };
lm's avatar
lm committed
14
    WaypointLineItem(WayPointItem* wp1, WayPointItem* wp2, QColor color=QColor(Qt::red), MapGraphicItem* parent=0);
lm's avatar
lm committed
15
    int type() const;
lm's avatar
lm committed
16 17 18 19 20 21 22 23

public slots:
    /**
    * @brief Update waypoint values
    *
    * @param waypoint The waypoint object that just changed
    */
    void updateWPValues(WayPointItem* waypoint);
24 25
    /**
    * @brief Update waypoint values
LM's avatar
LM committed
26 27 28 29
    */
    void updateWPValues();
    /**
    * @brief Update waypoint values
30 31 32
    *
    */
    void RefreshPos();
lm's avatar
lm committed
33 34 35 36 37 38 39

protected:
    internals::PointLatLng point1;
    internals::PointLatLng point2;
    WayPointItem* wp1;
    WayPointItem* wp2;
    MapGraphicItem* map;              ///< The map this item is parent of
40
};
lm's avatar
lm committed
41
}
42 43

#endif // WAYPOINTLINEITEM_H