-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
askUvTransformDialog.cpp
47 lines (39 loc) · 1.54 KB
/
askUvTransformDialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
#include "askUvTransformDialog.h"
#include "ui_askUvTransformDialog.h"
AskUvTransformDialog::AskUvTransformDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AskUvTransformDialog)
{
ui->setupUi(this);
connect(ui->invertY,SIGNAL(clicked()),this,SLOT(setInvertY()));
connect(ui->invertX,SIGNAL(clicked()),this,SLOT(setInvertX()));
connect(ui->Reset,SIGNAL(clicked()),this,SLOT(reset()));
connect(ui->traU,SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
connect(ui->traV,SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
connect(ui->scaleU,SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
connect(ui->scaleV,SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
}
void AskUvTransformDialog::getData(float &su, float &sv, float &tu, float &tv){
su = ui->scaleU->value()*0.01;
sv = ui->scaleV->value()*0.01;
tu = ui->traU->value();
tv = ui->traV->value();
}
void AskUvTransformDialog::reset(){
ui->scaleU->setValue(100);
ui->scaleV->setValue(100);
ui->traU->setValue(0);
ui->traV->setValue(0);
}
void AskUvTransformDialog::setInvertY(){
ui->scaleV->setValue(ui->scaleV->value() * -1); /* swy: flip the sign back and forth instead of hardcoding it to -100 */
// ui->traV->setValue(1);
}
void AskUvTransformDialog::setInvertX(){
ui->scaleU->setValue(ui->scaleU->value() * -1); /* swy: flip the sign back and forth instead of hardcoding it to -100 */
// ui->traU->setValue(1);
}
AskUvTransformDialog::~AskUvTransformDialog()
{
delete ui;
}