-
Notifications
You must be signed in to change notification settings - Fork 2
/
ClippingPlanesEditor.cpp
126 lines (107 loc) · 2.88 KB
/
ClippingPlanesEditor.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include "ClippingPlanesEditor.h"
#include "ui_ClippingPlanesEditor.h"
#include "GLWidget.h"
#include <QKeyEvent>
ClippingPlanesEditor::ClippingPlanesEditor(QWidget* parent) :
QWidget(parent),
_glView(dynamic_cast<GLWidget*>(parent))
{
setupUi(this);
}
ClippingPlanesEditor::~ClippingPlanesEditor()
{
}
void ClippingPlanesEditor::keyPressEvent(QKeyEvent* e)
{
if (e->key() != Qt::Key_Escape)
QWidget::keyPressEvent(e);
else {/* minimize */ }
}
void ClippingPlanesEditor::on_checkBoxXY_toggled(bool checked)
{
_glView->_clipYZEnabled = checked;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_checkBoxYZ_toggled(bool checked)
{
_glView->_clipZXEnabled = checked;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_checkBoxZX_toggled(bool checked)
{
_glView->_clipXYEnabled = checked;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_checkBoxFlipXY_toggled(bool checked)
{
_glView->_clipXFlipped = checked;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_checkBoxFlipYZ_toggled(bool checked)
{
_glView->_clipYFlipped = checked;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_checkBoxFlipZX_toggled(bool checked)
{
_glView->_clipZFlipped = checked;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_checkBoxCapping_toggled(bool checked)
{
_glView->_cappingEnabled = checked;
_glView->showFloor(!checked);
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_doubleSpinBoxXYCoeff_valueChanged(double val)
{
_glView->_clipXCoeff = val;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_doubleSpinBoxYZCoeff_valueChanged(double val)
{
_glView->_clipYCoeff = val;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_doubleSpinBoxZXCoeff_valueChanged(double val)
{
_glView->_clipZCoeff = val;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_doubleSpinBoxDX_valueChanged(double arg1)
{
_glView->_clipDX = arg1;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_doubleSpinBoxDY_valueChanged(double arg1)
{
_glView->_clipDY = arg1;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_doubleSpinBoxDZ_valueChanged(double arg1)
{
_glView->_clipDZ = arg1;
_glView->updateClippingPlane();
_glView->update();
}
void ClippingPlanesEditor::on_pushButtonResetCoeffs_clicked()
{
doubleSpinBoxDX->setValue(0);
doubleSpinBoxDY->setValue(0);
doubleSpinBoxDZ->setValue(0);
doubleSpinBoxZXCoeff->setValue(0);
doubleSpinBoxXYCoeff->setValue(0);
doubleSpinBoxYZCoeff->setValue(0);
}