src/widgets/matrixeditor.h

Mon, 04 Jun 2018 23:12:40 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Mon, 04 Jun 2018 23:12:40 +0300
changeset 1391
5fa4bf1fc781
child 1403
7a2d84112983
permissions
-rw-r--r--

added work done on cylinders

1391
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 #include <QWidget>
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 #include "../linetypes/modelobject.h"
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 class QDoubleSpinBox;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 class Ui_MatrixEditor;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 class MatrixEditor : public QWidget
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 {
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 Q_OBJECT
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 public:
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 MatrixEditor(
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 const Matrix& matrix = Matrix::identity,
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 const Vertex& position = {0, 0, 0},
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 QWidget* parent = nullptr
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 );
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 MatrixEditor(QWidget* parent);
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 ~MatrixEditor();
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 Vertex position() const;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 Matrix matrix() const;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 void setPosition(const Vertex& position);
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 void setMatrix(const Matrix& matrix);
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 private slots:
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 void scalingChanged();
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 void matrixChanged();
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 private:
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
31 QDoubleSpinBox* matrixCell(int row, int column) const;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 double matrixScaling(int column) const;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33 QPair<int, int> cellPosition(QDoubleSpinBox* cellWidget);
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 QDoubleSpinBox* vectorElement(int index);
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36 Ui_MatrixEditor& ui;
5fa4bf1fc781 added work done on cylinders
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
37 };

mercurial