src/ui/canvas.h

Wed, 26 Feb 2020 22:26:05 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 26 Feb 2020 22:26:05 +0200
changeset 56
fad4a5dd8dee
parent 51
1a9eac27698d
child 57
5c0005f63319
permissions
-rw-r--r--

PartRenderer::modelToScreenCoordinates FINALLY WORKS

#pragma once
#include "gl/partrenderer.h"

class Canvas : public PartRenderer
{
	Q_OBJECT
public:
	Canvas(
		Model* model,
		DocumentManager* documents,
		const ldraw::ColorTable& colorTable,
		QWidget* parent = nullptr);
public slots:
	void handleSelectionChange(const QSet<ldraw::Id>& selectedIds, const QSet<ldraw::Id>& deselectedIds);
protected:
	void mouseMoveEvent(QMouseEvent* event) override;
	void mousePressEvent(QMouseEvent* event) override;
	void mouseReleaseEvent(QMouseEvent* event) override;
signals:
	void newStatusText(const QString& newStatusText);
	void selectionChanged(const QSet<ldraw::Id>& newSelection);
private:
	QPoint lastMousePosition;
	int totalMouseMove = 0;
	QSet<ldraw::Id> selection;
};

mercurial