QMap3DWidget.h 1.15 KB
Newer Older
lm's avatar
lm committed
1 2 3
#ifndef QMAP3DWIDGET_H
#define QMAP3DWIDGET_H

pixhawk's avatar
pixhawk committed
4 5
#include <QLabel>

lm's avatar
lm committed
6 7
#include "Q3DWidget.h"

8
class CheetahModel;
lm's avatar
lm committed
9 10 11 12 13 14 15 16 17 18
class UASInterface;

class QMap3DWidget : public Q3DWidget
{
    Q_OBJECT

public:
    explicit QMap3DWidget(QWidget* parent);
    ~QMap3DWidget();

19
    void buildLayout(void);
20

lm's avatar
lm committed
21 22 23 24 25 26 27 28 29 30 31
    static void display(void* clientData);
    void displayHandler(void);

    static void timer(void* clientData);
    void timerHandler(void);

    double getTime(void) const;

public slots:
    void setActiveUAS(UASInterface* uas);

32 33 34 35 36 37
private slots:
    void showGrid(int state);
    void showTrail(int state);
    void recenterCamera(void);
    void toggleLockCamera(int state);

lm's avatar
lm committed
38 39
protected:
    UASInterface* uas;
pixhawk's avatar
pixhawk committed
40
    QLabel* positionLabel;
lm's avatar
lm committed
41 42

private:
43 44 45 46
    void drawPlatform(float roll, float pitch, float yaw);
    void drawGrid(void);
    void drawTrail(float x, float y, float z);

lm's avatar
lm committed
47 48
    double lastRedrawTime;

49 50 51 52 53 54 55 56 57 58 59 60
    bool displayGrid;
    bool displayTrail;
    bool lockCamera;

    typedef struct
    {
        float x;
        float y;
        float z;
    } Pose3D;
    QVarLengthArray<Pose3D, 10000> trail;

lm's avatar
lm committed
61
    QScopedPointer<CheetahModel> cheetahModel;
lm's avatar
lm committed
62 63 64
};

#endif // QMAP3DWIDGET_H