diff -r cd4df75924b7 -r 6ca6e8c647d4 src/ui/canvas.h --- 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 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& selectedIds, const QSet& deselectedIds); protected: @@ -36,6 +49,7 @@ geom::Plane gridPlane; int totalMouseMove = 0; QSet selection; + PreviewLayer previewLayers[NUM_PREVIEW_LAYERS]; }; struct Canvas::MouseClickInfo