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:
2026-02-17 10:18:36 -07:00
parent e64755ea0c
commit 3e2f464de9
7 changed files with 209 additions and 4 deletions

28
src/RectangleTool.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef RECTANGLETOOL_H
#define RECTANGLETOOL_H
#include "SketchTool.h"
#include <gp_Pnt.hxx>
class RectangleTool : public SketchTool
{
Q_OBJECT
public:
explicit RectangleTool(ViewportWidget* viewport);
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void paintGL() override;
void paint2D(QPainter& painter, const QMatrix4x4& modelView, const QMatrix4x4& projection) override;
void activate() override;
void deactivate() override;
private:
bool m_isDefiningRectangle = false;
gp_Pnt m_firstRectanglePoint;
};
#endif // RECTANGLETOOL_H