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

#include <QGraphicsItem>
5
#include "qmapcontrol.h"
6

7 8
#include "Waypoint.h"

9
class Waypoint2DIcon : public qmapcontrol::Point
10 11
{
public:
12 13 14 15 16 17 18 19 20
    /*!
     *
     * @param x longitude
     * @param y latitude
     * @param name name of the circle point
     * @param alignment alignment (Middle or TopLeft)
     * @param pen QPen for drawing
     */
    Waypoint2DIcon(qreal x, qreal y, QString name = QString(), Alignment alignment = Middle, QPen* pen=0);
21

22 23 24 25 26 27 28 29 30 31
    //!
    /*!
     *
     * @param x longitude
     * @param y latitude
     * @param radius the radius of the circle
     * @param name name of the circle point
     * @param alignment alignment (Middle or TopLeft)
     * @param pen QPen for drawing
     */
32 33 34 35 36 37 38 39 40 41 42 43 44
    Waypoint2DIcon(qreal x, qreal y, int radius = 20, QString name = QString(), Alignment alignment = Middle, QPen* pen=0);

    /**
     *
     * @param wp Waypoint
     * @param listIndex Index in the waypoint list
     * @param radius the radius of the circle
     * @param name name of the circle point
     * @param alignment alignment (Middle or TopLeft)
     * @param pen QPen for drawing
     */
    Waypoint2DIcon(Waypoint* wp, int listIndex, int radius = 20, Alignment alignment = Middle, QPen* pen=0);

45
    virtual ~Waypoint2DIcon();
46

47 48 49 50 51 52 53 54 55 56 57 58
    //! 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);

    void setYaw(float yaw);

    void drawIcon(QPen* pen);

59 60 61
public slots:
    void updateWaypoint();

62 63
protected:
    float yaw;      ///< Yaw angle of the MAV
64 65
    int radius;     ///< Radius / diameter of the icon in pixels
    Waypoint* waypoint;   ///< Waypoint data container this icon represents
66 67 68 69

};

#endif // WAYPOINT2DICON_H