SlugsVideoCamControl.cpp 2.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#include "SlugsVideoCamControl.h"
#include "ui_SlugsVideoCamControl.h"

#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QTextStream>
#include <QScrollBar>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QDebug>
11
#include <qmath.h>
tecnosapiens's avatar
tecnosapiens committed
12 13 14 15
#include <QPainter>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
16 17
#include <QPushButton>
#include "SlugsPadCameraControl.h"
18 19 20


SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
21
    QWidget(parent),
22
    ui(new Ui::SlugsVideoCamControl)
23 24
{
    ui->setupUi(this);
25 26
//   x1= 0;
//   y1 = 0;
27

28
    connect(ui->viewCamBordeatMap_checkBox,SIGNAL(clicked(bool)),this,SLOT(changeViewCamBorderAtMapStatus(bool)));
29 30 31 32 33 34 35 36
    padCamera = new SlugsPadCameraControl(this);

    ui->gridLayout->addWidget(padCamera);

    connect(padCamera,SIGNAL(mouseMoveCoord(int,int)),this,SLOT(mousePadMoveEvent(int,int)));
    connect(padCamera,SIGNAL(mousePressCoord(int,int)),this,SLOT(mousePadPressEvent(int,int)));
    connect(padCamera,SIGNAL(mouseReleaseCoord(int,int)),this,SLOT(mousePadReleaseEvent(int,int)));
    connect(padCamera,SIGNAL(changeCursorPosition(double,double,QString)),this,SLOT(getDeltaPositionPad(double,double,QString)));
tecnosapiens's avatar
tecnosapiens committed
37 38


39 40 41 42 43 44 45
}

SlugsVideoCamControl::~SlugsVideoCamControl()
{
    delete ui;
}

46 47 48
//void SlugsVideoCamControl::mouseMoveEvent(QMouseEvent *event)
//{
//     Q_UNUSED(event);
49

50
//}
51 52


53 54 55
//void SlugsVideoCamControl::mousePressEvent(QMouseEvent *evnt)
//{
//  Q_UNUSED(evnt);
56

57
//}
58

59 60 61
//void SlugsVideoCamControl::mouseReleaseEvent(QMouseEvent *evnt)
//{
//    Q_UNUSED(evnt);
62

63
//}
64

65

66 67
//void SlugsVideoCamControl::mousePadMoveEvent(int x, int y)
//{
68

69
//}
70

71 72
//void SlugsVideoCamControl::mousePadPressEvent(int x, int y)
//{
73

74
//}
75

76 77
//void SlugsVideoCamControl::mousePadReleaseEvent(int x, int y)
//{
78 79


80
//}
81

82
void SlugsVideoCamControl::changeViewCamBorderAtMapStatus(bool status)
83
{
84
    emit viewCamBorderAtMap(status);
85 86
}

87
void SlugsVideoCamControl::getDeltaPositionPad(double bearing, double distance, QString dirText)
tecnosapiens's avatar
tecnosapiens committed
88
{
89 90 91
    ui->label_dir->setText(dirText);
    ui->label_x->setText("Distancia= " + QString::number(distance));
    ui->label_y->setText("Bearing= " + QString::number(bearing));
tecnosapiens's avatar
tecnosapiens committed
92

93
    emit changeCamPosition(20, bearing, dirText);
tecnosapiens's avatar
tecnosapiens committed
94 95
}