29 lines
626 B
C++
29 lines
626 B
C++
#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};
|
|
|
|
Vector<Ptr<GeometryNode> > mSceneNodes;
|
|
bool mContentDirty{false};
|
|
};
|