refactor: Introduce SketchTool base class and derived tool skeletons
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
34
src/SketchTool.h
Normal file
34
src/SketchTool.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef SKETCHTOOL_H
|
||||
#define SKETCHTOOL_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QMouseEvent;
|
||||
class QKeyEvent;
|
||||
class ViewportWidget;
|
||||
class QOpenGLShaderProgram;
|
||||
class QPainter;
|
||||
class QMatrix4x4;
|
||||
|
||||
class SketchTool : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SketchTool(ViewportWidget* viewport);
|
||||
virtual ~SketchTool() = default;
|
||||
|
||||
virtual void mousePressEvent(QMouseEvent *event) = 0;
|
||||
virtual void mouseMoveEvent(QMouseEvent *event) = 0;
|
||||
virtual void keyPressEvent(QKeyEvent *event) = 0;
|
||||
|
||||
virtual void paintGL() = 0;
|
||||
virtual void paint2D(QPainter& painter, const QMatrix4x4& modelView, const QMatrix4x4& projection) = 0;
|
||||
|
||||
virtual void activate();
|
||||
virtual void deactivate();
|
||||
|
||||
protected:
|
||||
ViewportWidget* m_viewport;
|
||||
};
|
||||
|
||||
#endif // SKETCHTOOL_H
|
||||
Reference in New Issue
Block a user