src/widgets/matrixeditor.h

Wed, 17 Feb 2021 16:49:35 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 17 Feb 2021 16:49:35 +0200
changeset 102
9f435f66bd0c
parent 85
40e2940605a3
child 206
654661eab7f3
permissions
-rw-r--r--

stuff

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>
40e2940605a3 added a matrix editing widget
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 #include "main.h"
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