diff -r 02f142b399b1 -r 94c92c923713 src/ui/canvas.h --- a/src/ui/canvas.h Sat Jul 24 01:50:38 2021 +0300 +++ b/src/ui/canvas.h Sun Jul 25 13:49:37 2021 +0300 @@ -1,4 +1,6 @@ #pragma once +#include +#include #include "gl/partrenderer.h" #include "gl/gridprogram.h" #include "gl/axesprogram.h" @@ -8,14 +10,27 @@ Q_OBJECT public: struct MouseClickInfo; + struct MouseMoveInfo; enum PreviewLayerName : std::int8_t { DrawToolPreview }; struct PreviewLayer { - QVector polygons; - QColor color{64, 255, 128}; + struct Point + { + glm::vec3 location; + QBrush brush = {}; + QPen pen = {}; + }; + struct Polygon + { + geom::NPolygon geometry; + QBrush brush = {}; + QPen pen = {}; + }; + QVector points; + QVector polygons; }; static constexpr int NUM_PREVIEW_LAYERS = 1; @@ -40,6 +55,7 @@ void newStatusText(const QString& newStatusText); void selectionChanged(const QSet& newSelection); void mouseClick(const MouseClickInfo& info); + void mouseMove(const MouseMoveInfo& info); private: void updateGridMatrix(); glm::vec3 cameraVector() const; @@ -59,3 +75,9 @@ std::optional worldPosition; Canvas* invoker; }; + +struct Canvas::MouseMoveInfo +{ + std::optional worldPosition; + Canvas* invoker; +};