src/widgets/matrixeditor.h

Sun, 10 Jun 2018 23:07:24 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 10 Jun 2018 23:07:24 +0300
changeset 1401
59b578c77111
parent 1391
5fa4bf1fc781
child 1403
7a2d84112983
permissions
-rw-r--r--

fixed bugs regarding circular primitives

#pragma once
#include <QWidget>
#include "../linetypes/modelobject.h"

class QDoubleSpinBox;
class Ui_MatrixEditor;

class MatrixEditor : public QWidget
{
	Q_OBJECT

public:
	MatrixEditor(
		const Matrix& matrix = Matrix::identity,
		const Vertex& position = {0, 0, 0},
		QWidget* parent = nullptr
	);
	MatrixEditor(QWidget* parent);
	~MatrixEditor();

	Vertex position() const;
	Matrix matrix() const;
	void setPosition(const Vertex& position);
	void setMatrix(const Matrix& matrix);

private slots:
	void scalingChanged();
	void matrixChanged();

private:
	QDoubleSpinBox* matrixCell(int row, int column) const;
	double matrixScaling(int column) const;
	QPair<int, int> cellPosition(QDoubleSpinBox* cellWidget);
	QDoubleSpinBox* vectorElement(int index);

	Ui_MatrixEditor& ui;
};

mercurial