Waypoint2DIcon.h 1.9 KB
Newer Older
1 2 3 4 5
#ifndef WAYPOINT2DICON_H
#define WAYPOINT2DICON_H

#include <QGraphicsItem>

6
#include "Waypoint.h"
7
#include "opmapcontrol.h"
8

9
class Waypoint2DIcon : public mapcontrol::WayPointItem
10 11
{
public:
12
    /**
13
     *
14 15
     * @param latitude
     * @param longitude
16 17
     * @param name name of the circle point
     */
18
    Waypoint2DIcon(mapcontrol::MapGraphicItem* map, mapcontrol::OPMapWidget* parent, qreal latitude, qreal longitude, qreal altitude, int listindex, QString name = QString(), QString description = QString(), int radius=30);
19 20 21 22 23 24

    /**
     *
     * @param wp Waypoint
     * @param radius the radius of the circle
     */
25
    Waypoint2DIcon(mapcontrol::MapGraphicItem* map, mapcontrol::OPMapWidget* parent, Waypoint* wp, const QColor& color, int listindex, int radius = 31);
26

27
    virtual ~Waypoint2DIcon();
28

29 30 31 32 33 34 35 36
    //! sets the QPen which is used for drawing the circle
    /*!
     * A QPen can be used to modify the look of the drawn circle
     * @param pen the QPen which should be used for drawing
     * @see http://doc.trolltech.com/4.3/qpen.html
     */
    virtual void setPen(QPen* pen);

37
    void SetHeading(float heading);
38

39 40 41 42 43 44
    /** @brief Rectangle to be updated on changes */
    QRectF boundingRect() const;
    /** @brief Draw the icon in a double buffer */
    void drawIcon();
    /** @brief Draw the icon on a QPainter device (map) */
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
45 46
    /** @brief UNUSED FUNCTION: Waypoints in QGC are purely passive */
    void SetReached(const bool &value);
47

48
public:
49 50
    void updateWaypoint();

51
protected:
52 53
    mapcontrol::OPMapWidget* parent; ///< Parent widget
    int radius;           ///< Radius / diameter of the icon in pixels
54
    Waypoint* waypoint;   ///< Waypoint data container this icon represents
55 56 57 58 59
    QPen* mypen;
    QColor color;
    bool showAcceptanceRadius;
    bool showOrbit;
//    QSize size;
60 61 62 63

};

#endif // WAYPOINT2DICON_H