src/ui/canvas.h

changeset 105
6ca6e8c647d4
parent 104
cd4df75924b7
child 106
128efb9d148b
--- a/src/ui/canvas.h	Mon Jul 19 19:28:16 2021 +0300
+++ b/src/ui/canvas.h	Mon Jul 19 23:41:52 2021 +0300
@@ -8,11 +8,24 @@
 	Q_OBJECT
 public:
 	struct MouseClickInfo;
+	enum PreviewLayerName : std::int8_t
+	{
+		DrawToolPreview
+	};
+	struct PreviewLayer
+	{
+		QSet<geom::NPolygon> polygons;
+		QColor color{64, 255, 128};
+	};
+	static constexpr int NUM_PREVIEW_LAYERS = 1;
+
 	Canvas(
 		Model* model,
 		DocumentManager* documents,
 		const ldraw::ColorTable& colorTable,
 		QWidget* parent = nullptr);
+	const PreviewLayer& getPreviewLayer(PreviewLayerName name) const;
+	PreviewLayer& modifyPreviewLayer(PreviewLayerName name);
 public slots:
 	void handleSelectionChange(const QSet<ldraw::id_t>& selectedIds, const QSet<ldraw::id_t>& deselectedIds);
 protected:
@@ -36,6 +49,7 @@
 	geom::Plane gridPlane;
 	int totalMouseMove = 0;
 	QSet<ldraw::id_t> selection;
+	PreviewLayer previewLayers[NUM_PREVIEW_LAYERS];
 };
 
 struct Canvas::MouseClickInfo

mercurial