-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMergeDialog.cpp
57 lines (46 loc) · 1.34 KB
/
MergeDialog.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
53
54
55
56
57
#include "MergeDialog.h"
MergeDialog::MergeDialog(QWidget * _parent) : QDialog(_parent)
{
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(createMergeGroup());
QDialogButtonBox * defaultButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(defaultButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(defaultButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
layout->addWidget(defaultButtonBox);
setLayout(layout);
setWindowTitle(tr("Select Merge Way:"));
resize(360, 240);
}
MergeDialog::~MergeDialog()
{
}
void MergeDialog::accept()
{
if (average->isChecked())
{
done(1);
}
else if (one2two->isChecked())
{
done(2);
}
else if (two2one->isChecked())
{
done(3);
}
};
QGroupBox * MergeDialog::createMergeGroup()
{
mergeGroup = new QGroupBox(tr("Merge Options"));
average = new QRadioButton(tr("Average of Two Vertices"));
one2two = new QRadioButton(tr("Move the vertex in Mesh 1 to the vertex in Mesh 2"));
two2one = new QRadioButton(tr("Move the vertex in Mesh 2 to the vertex in Mesh 1"));
average->setChecked(true);
QVBoxLayout * vbox = new QVBoxLayout();
vbox->addWidget(average);
vbox->addWidget(one2two);
vbox->addWidget(two2one);
vbox->addStretch(1);
mergeGroup->setLayout(vbox);
return mergeGroup;
}