Sun, 09 Apr 2023 17:05:40 +0300
Simplify signature of openModelFromPath
85
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
1 | #pragma once |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
2 | #include <QWidget> |
252
da4876bfd822
Move some widgets into a static library
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
206
diff
changeset
|
3 | #include <glm/glm.hpp> |
85
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
4 | |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
5 | class MatrixEditor : public QWidget |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
6 | { |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
7 | Q_OBJECT |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
8 | public: |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
9 | explicit MatrixEditor(QWidget *parent = nullptr); |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
10 | explicit MatrixEditor(const glm::mat4 value, QWidget* parent = nullptr); |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
11 | ~MatrixEditor(); |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
12 | glm::mat4 value() const; |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
13 | void setValue(const glm::mat4& value); |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
14 | Q_SIGNALS: |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
15 | void valueChanged(const glm::mat4& value); |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
16 | private: |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
17 | constexpr int matrixSize() const; |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
18 | Q_SLOT void multiplyButtonPressed(); |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
19 | class QDoubleSpinBox* spinboxes[4][3]; |
253
8b994c917f69
Make LDForge widgets visible in Qt Designer
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
252
diff
changeset
|
20 | class Ui_MatrixEditor *ui; |
85
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
21 | }; |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
22 | |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
23 | constexpr int MatrixEditor::matrixSize() const |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
24 | { |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
25 | return 4; |
40e2940605a3
added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
26 | } |