MAV2DIcon.h 1.66 KB
Newer Older
1 2 3
#ifndef MAV2DICON_H
#define MAV2DICON_H

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

7
class MAV2DIcon : public qmapcontrol::Point
8 9
{
public:
10 11 12 13 14 15 16
    enum
    {
        MAV_ICON_GENERIC = 0,
        MAV_ICON_AIRPLANE,
        MAV_ICON_QUADROTOR,
        MAV_ICON_ROTARY_WING
    } MAV_ICON_TYPE;
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    /*!
     *
     * @param x longitude
     * @param y latitude
     * @param name name of the circle point
     * @param alignment alignment (Middle or TopLeft)
     * @param pen QPen for drawing
     */
    MAV2DIcon(qreal x, qreal y, QString name = QString(), Alignment alignment = Middle, QPen* pen=0);

    //!
    /*!
     *
     * @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
     */
37
    MAV2DIcon(qreal x, qreal y, int radius = 10, int type=0, const QColor& color=QColor(Qt::red), QString name = QString(), Alignment alignment = Middle, QPen* pen=0);
38 39 40 41 42 43 44 45 46 47 48
    virtual ~MAV2DIcon();

    //! 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);
49

50 51 52
    void drawIcon(QPen* pen);

protected:
53 54 55 56
    float yaw;      ///< Yaw angle of the MAV
    int radius;     ///< Radius / width of the icon
    int type;       ///< Type of aircraft: 0: generic, 1: airplane, 2: quadrotor, 3-n: rotary wing
    QColor iconColor; ///< Color to be used for the icon
57 58 59 60

};

#endif // MAV2DICON_H