Waypoint2DIcon.h 1.6 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
    void SetHeading(float heading);
30

31 32 33 34 35 36
    /** @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);
lm's avatar
lm committed
37 38
    /** @brief Enable and format the waypoint number display */
    void SetShowNumber(const bool &value);
39

40
public:
41 42
    void updateWaypoint();

43
protected:
44 45
    mapcontrol::OPMapWidget* parent; ///< Parent widget
    int radius;           ///< Radius / diameter of the icon in pixels
46
    Waypoint* waypoint;   ///< Waypoint data container this icon represents
47 48 49 50
    QColor color;
    bool showAcceptanceRadius;
    bool showOrbit;
//    QSize size;
51 52 53 54

};

#endif // WAYPOINT2DICON_H