29 lines
651 B
C++
29 lines
651 B
C++
#ifndef LINETOOL_H
|
|
#define LINETOOL_H
|
|
|
|
#include "SketchTool.h"
|
|
#include <gp_Pnt.hxx>
|
|
|
|
class LineTool : public SketchTool
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit LineTool(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_isDefiningLine = false;
|
|
gp_Pnt m_firstLinePoint;
|
|
};
|
|
|
|
#endif // LINETOOL_H
|