30 lines
643 B
C
30 lines
643 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};
|
||
|
|
||
|
std::vector<std::unique_ptr<GeometryNode> > mSceneNodes;
|
||
|
bool mContentDirty{false};
|
||
|
};
|