forked from emilk/sproxel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewGridDialog.cpp
52 lines (41 loc) · 859 Bytes
/
NewGridDialog.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
48
49
50
51
52
#include "NewGridDialog.h"
#include "ui_NewGridDialog.h"
Imath::V3i NewGridDialog::lastSize(16);
bool NewGridDialog::lastIndexed=false;
NewGridDialog::NewGridDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::NewGridDialog)
{
ui->setupUi(this);
ui->width ->setValue(lastSize.x);
ui->height->setValue(lastSize.y);
ui->depth ->setValue(lastSize.z);
if (lastIndexed)
ui->dataIndexed->setChecked(true);
else
ui->dataRGBA->setChecked(true);
}
NewGridDialog::~NewGridDialog()
{
delete ui;
}
int NewGridDialog::exec()
{
int r=QDialog::exec();
if (r)
{
lastSize=getVoxelSize();
lastIndexed=isIndexed();
}
return r;
}
Imath::V3i NewGridDialog::getVoxelSize()
{
return Imath::V3i(ui->width->value(),
ui->height->value(),
ui->depth->value());
}
bool NewGridDialog::isIndexed()
{
return ui->dataIndexed->isChecked();
}