src/widgets/matrixeditor.h

Wed, 15 Jun 2022 19:47:02 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Wed, 15 Jun 2022 19:47:02 +0300
changeset 231
a9bf6bab5ea2
parent 206
654661eab7f3
permissions
-rw-r--r--

Add wireframe button

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>
206
654661eab7f3 More refactor, merged main.h, basics.h and utility.h into one header file basics.h and removed plenty of unused code
Teemu Piippo <teemu@hecknology.net>
parents: 85
diff changeset
3 #include "basics.h"
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 namespace Ui {
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 class MatrixEditor;
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 }
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 class MatrixEditor : public QWidget
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 {
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 Q_OBJECT
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 public:
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 explicit MatrixEditor(QWidget *parent = nullptr);
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 explicit MatrixEditor(const glm::mat4 value, QWidget* parent = nullptr);
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 ~MatrixEditor();
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 glm::mat4 value() const;
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 void setValue(const glm::mat4& value);
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 Q_SIGNALS:
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 void valueChanged(const glm::mat4& value);
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 private:
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 constexpr int matrixSize() const;
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 Q_SLOT void multiplyButtonPressed();
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 class QDoubleSpinBox* spinboxes[4][3];
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 Ui::MatrixEditor *ui;
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 };
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 constexpr int MatrixEditor::matrixSize() const
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 {
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 return 4;
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 }

mercurial