widgets/matrixeditor.h

Sat, 08 Apr 2023 12:55:11 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sat, 08 Apr 2023 12:55:11 +0300
changeset 343
4a82990affd5
parent 253
8b994c917f69
permissions
-rw-r--r--

Fix BFC formatting not working due to being evaluated after comment format

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 }

mercurial