-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSphericalHarmonicsEditor.cpp
More file actions
83 lines (71 loc) · 2.72 KB
/
SphericalHarmonicsEditor.cpp
File metadata and controls
83 lines (71 loc) · 2.72 KB
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
#include "SphericalHarmonicsEditor.h"
#include "ui_SphericalHarmonicsEditor.h"
#include "SphericalHarmonic.h"
#include "GLView.h"
SphericalHarmonicsEditor::SphericalHarmonicsEditor(SphericalHarmonic* sphere, QWidget *parent) :
QDialog(parent),
ui(new Ui::SphericalHarmonicsEditor),
_sphere(sphere)
{
ui->setupUi(this);
ui->doubleSpinBoxM0->setValue(_sphere->_coeff1);
ui->doubleSpinBoxM2->setValue(_sphere->_coeff2);
ui->doubleSpinBoxM4->setValue(_sphere->_coeff3);
ui->doubleSpinBoxM6->setValue(_sphere->_coeff4);
ui->doubleSpinBoxM1->setValue(_sphere->_power1);
ui->doubleSpinBoxM3->setValue(_sphere->_power2);
ui->doubleSpinBoxM5->setValue(_sphere->_power3);
ui->doubleSpinBoxM7->setValue(_sphere->_power4);
}
SphericalHarmonicsEditor::~SphericalHarmonicsEditor()
{
delete ui;
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM0_valueChanged(double val)
{
_sphere->_coeff1 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM1_valueChanged(double val)
{
_sphere->_power1 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM2_valueChanged(double val)
{
_sphere->_coeff2 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM3_valueChanged(double val)
{
_sphere->_power2 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM4_valueChanged(double val)
{
_sphere->_coeff3 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM5_valueChanged(double val)
{
_sphere->_power3 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM6_valueChanged(double val)
{
_sphere->_coeff4 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}
void SphericalHarmonicsEditor::on_doubleSpinBoxM7_valueChanged(double val)
{
_sphere->_power4 = val;
_sphere->buildMesh(_sphere->getSlices(), _sphere->getStacks());
dynamic_cast<GLView*>(parent())->updateViewBoundingSphere();
}