src/ui/canvas.h

Thu, 27 Feb 2020 14:38:48 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 27 Feb 2020 14:38:48 +0200
changeset 59
60650929dc82
parent 57
5c0005f63319
child 61
4585d8d7a7ec
permissions
-rw-r--r--

fixed testing of whether screenToModelCoordinates's result value is behind the camera

#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;
	void paintGL() override;
signals:
	void newStatusText(const QString& newStatusText);
	void selectionChanged(const QSet<ldraw::Id>& newSelection);
private:
	QPoint lastMousePosition;
	std::optional<glm::vec3> worldPosition;
	int totalMouseMove = 0;
	QSet<ldraw::Id> selection;
};

mercurial