refactor: Migrate ViewportWidget to shader-based OpenGL rendering (FFP disabled)
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
#include <QRect>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <QMap>
|
||||
#include <QOpenGLShaderProgram>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QOpenGLBuffer>
|
||||
|
||||
class QSvgRenderer;
|
||||
class ViewCube;
|
||||
@@ -56,6 +59,7 @@ protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
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);
|
||||
@@ -64,6 +68,14 @@ private:
|
||||
ViewportWidget::SketchPlane checkPlaneSelection(const QPoint& screenPos);
|
||||
|
||||
QMatrix4x4 projection;
|
||||
QOpenGLShaderProgram* m_shaderProgram = nullptr;
|
||||
QOpenGLVertexArrayObject m_vao;
|
||||
QOpenGLBuffer m_vbo;
|
||||
|
||||
// Shader uniform locations
|
||||
int m_projMatrixLoc = -1;
|
||||
int m_mvMatrixLoc = -1;
|
||||
int m_colorLoc = -1;
|
||||
Camera* m_camera = nullptr;
|
||||
ViewCube* m_viewCube;
|
||||
SketchGrid* m_sketchGrid = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user