src/ui/canvas.h

changeset 200
ca23936b455b
parent 198
eb9d900dc79a
child 201
5d201ee4a9c3
--- a/src/ui/canvas.h	Wed May 25 20:36:34 2022 +0300
+++ b/src/ui/canvas.h	Mon Jun 06 22:01:22 2022 +0300
@@ -28,7 +28,7 @@
 	using OverpaintCallback = std::function<void(Canvas*, QPainter*)>;
 	Canvas(
 		Model* model,
-		Document* document,
+		EditorTabWidget* document,
 		DocumentManager* documents,
 		const ldraw::ColorTable& colorTable,
 		QWidget* parent = nullptr);
@@ -38,15 +38,15 @@
 	void drawWorldPolygon(QPainter* painter, const std::vector<glm::vec3>& points);
 	Winding worldPolygonWinding(const std::vector<glm::vec3>& points) const;
 	const std::optional<glm::vec3>& getWorldPosition() const;
-	const QSet<ldraw::id_t> selectedObjects() const;
+	const QSet<ModelId> selectedObjects() const;
 	const glm::mat4& getGridMatrix() const;
 	void closeShape();
 	glm::vec3 cameraVector() const;
 	std::optional<glm::vec3> worldPosition;
 	DrawState* drawState = nullptr;
 public Q_SLOTS:
-	void handleSelectionChange(const QSet<ldraw::id_t>& selectedIds, const QSet<ldraw::id_t>& deselectedIds);
-	void rebuildVertices(Document *document);
+	void handleSelectionChange(const QSet<ModelId>& selectedIds, const QSet<ModelId>& deselectedIds);
+	void rebuildVertices(EditorTabWidget *document);
 	void setGridMatrix(const glm::mat4 &newMatrix);
 protected:
 	void mouseMoveEvent(QMouseEvent* event) override;
@@ -70,9 +70,9 @@
 	geom::Plane gridPlane;
 	int totalMouseMove = 0;
 	bool isDark = true;
-	QSet<ldraw::id_t> selection;
+	QSet<ModelId> selection;
 	OverpaintCallback overpaintCallback = nullptr;
-	Document* document;
+	EditorTabWidget* document;
 };
 
 void adjustGridToView(Canvas* canvas);

mercurial