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

4
#include <QGraphicsItem>
5

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

9
class MAV2DIcon : public mapcontrol::UAVItem
10 11
{
public:
12
    enum {
13 14 15
        MAV_ICON_GENERIC = 0,
        MAV_ICON_AIRPLANE,
        MAV_ICON_QUADROTOR,
16 17
        MAV_ICON_COAXIAL,
        MAV_ICON_HELICOPTER,
18
    } MAV_ICON_TYPE;
19 20

    //!
21 22 23 24
    /*!
     *
     * @param x longitude
     * @param y latitude
25
     * @param radius the radius of the circle
26 27 28 29
     * @param name name of the circle point
     * @param alignment alignment (Middle or TopLeft)
     * @param pen QPen for drawing
     */
30
    MAV2DIcon(mapcontrol::MapGraphicItem* map,mapcontrol::OPMapWidget* parent, UASInterface* uas, int radius = 40, int type=0);
31 32 33 34 35 36 37 38 39

    /*!
     *
     * @param x longitude
     * @param y latitude
     * @param name name of the circle point
     * @param alignment alignment (Middle or TopLeft)
     * @param pen QPen for drawing
     */
40
    MAV2DIcon(mapcontrol::MapGraphicItem* map,mapcontrol::OPMapWidget* parent, qreal lat=0, qreal lon=0, qreal alt=0, QColor color=QColor());
41

42 43
    virtual ~MAV2DIcon();

44 45
    /** @brief Mark this system as selected */
    void setSelectedUAS(bool selected);
46
    void setYaw(float yaw);
47
    /** @brief Set the airframe this MAV uses */
48 49 50
    void setAirframe(int airframe) {
        this->airframe = airframe;
    }
51

52
    /** @brief Get system id */
53 54 55
    int getUASId() const {
        return uasid;
    }
56

57
    void drawIcon();
58
    static void drawAirframePolygon(int airframe, QPainter& painter, int radius, QColor& iconColor, float yaw);
59 60

protected:
61 62 63
    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
64
    int airframe;   ///< The specific type of airframe used
65
    QColor iconColor; ///< Color to be used for the icon
66 67
    bool selected;  ///< Wether this is the system currently in focus
    int uasid;      ///< ID of tracked system
68
    QSize size;
69 70 71 72

};

#endif // MAV2DICON_H