refactor: Move LineTool paintGL and paint2D logic to LineTool

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-17 10:38:51 -07:00
parent 1584bfd5a0
commit d015d171ec
3 changed files with 585 additions and 566 deletions

View File

@@ -39,6 +39,20 @@ public:
void setDocument(Document* document);
QVector3D project(const QVector3D& worldCoord, const QMatrix4x4& modelView, const QMatrix4x4& projection, const QRect& viewport);
QVector3D unproject(const QPoint& screenPos, SketchPlane plane);
QOpenGLShaderProgram* shaderProgram() { return m_shaderProgram; }
QOpenGLBuffer& vbo() { return m_vbo; }
int colorLoc() const { return m_colorLoc; }
Camera* camera() const { return m_camera; }
SketchPlane currentPlane() const { return m_currentPlane; }
const QPoint& currentMousePos() const { return m_currentMousePos; }
bool isSnappingOrigin() const { return m_isSnappingOrigin; }
bool isSnappingVertex() const { return m_isSnappingVertex; }
const gp_Pnt& snapVertex() const { return m_snapVertex; }
bool isSnappingHorizontal() const { return m_isSnappingHorizontal; }
bool isSnappingVertical() const { return m_isSnappingVertical; }
public slots:
void onSketchModeStarted(SketchPlane plane);
void onSketchModeEnded();
@@ -64,8 +78,6 @@ protected:
private:
void initShaders();
QVector3D project(const QVector3D& worldCoord, const QMatrix4x4& modelView, const QMatrix4x4& projection, const QRect& viewport);
QVector3D unproject(const QPoint& screenPos, SketchPlane plane);
void drawAxisLabels(QPainter& painter, const QMatrix4x4& modelView, const QMatrix4x4& projection);
void drawSketch(const SketchFeature* sketch);
void drawSelectionPlanes();