SlugsPadCameraControl.h 1.41 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#ifndef SLUGSPADCAMERACONTROL_H
#define SLUGSPADCAMERACONTROL_H

#include <QtGui/QWidget>
#include <QGraphicsView>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QDebug>
#include <qmath.h>
#include <QPainter>
#include "UASManager.h"

13 14 15
namespace Ui
{
class SlugsPadCameraControl;
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
}

class SlugsPadCameraControl : public QWidget //QGraphicsView//
{
    Q_OBJECT

public:
    explicit SlugsPadCameraControl(QWidget *parent = 0);

    ~SlugsPadCameraControl();

    enum MotionCamera {
        UP,
        DOWN,
        LEFT,
        RIGHT,
        RIGHT_UP,
        RIGHT_DOWN,
        LEFT_UP,
        LEFT_DOWN,
        NONE
    };

public slots:
    void getDeltaPositionPad(int x, int y);
    QPointF ObtenerMarcacionDistanciaPixel(double lon1, double lat1, double lon2, double lat2);
    void activeUasSet(UASInterface *uas);

signals:
    void changeMotionCamera(MotionCamera);

protected:
    void mousePressEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);
    void keyPressEvent(QKeyEvent *event);
    //void paintEvent(QPaintEvent *pe);


private:
    Ui::SlugsPadCameraControl *ui;
    bool dragging;
    int x1;
    int y1;
    int xFin;
    int yFin;
    QString directionPad;
    MotionCamera motion;
    UASInterface* activeUAS;
    QPoint movePad;

};

#endif // SLUGSPADCAMERACONTROL_H