Waypoint2DIcon.h 1.79 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=24);
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 = 24);
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
public:
47 48
    void updateWaypoint();

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

};

#endif // WAYPOINT2DICON_H