2022-12-05 10:59:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Widget.h"
|
|
|
|
#include "CanvasElements.h"
|
|
|
|
|
|
|
|
class GeometryNode;
|
|
|
|
|
|
|
|
class CanvasDrawingArea : public Widget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~CanvasDrawingArea();
|
|
|
|
void setActiveDrawingCommand(CanvasDrawCommand command)
|
|
|
|
{
|
|
|
|
mActiveDrawingCommand = command;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool isDirty() const override;
|
|
|
|
void doPaint(const PaintEvent* event) override;
|
|
|
|
|
|
|
|
void onMyMouseEvent(const MouseEvent* event) override;
|
|
|
|
|
|
|
|
void addShapeAt(unsigned x, unsigned y);
|
|
|
|
|
|
|
|
CanvasDrawCommand mActiveDrawingCommand{CanvasDrawCommand::LINE};
|
|
|
|
|
2023-12-21 09:18:44 +00:00
|
|
|
Vector<Ptr<GeometryNode> > mSceneNodes;
|
2022-12-05 10:59:45 +00:00
|
|
|
bool mContentDirty{false};
|
|
|
|
};
|