71 |
71 |
72 public: |
72 public: |
73 GLRenderer(Model* model, QWidget* parent = nullptr); |
73 GLRenderer(Model* model, QWidget* parent = nullptr); |
74 ~GLRenderer(); |
74 ~GLRenderer(); |
75 |
75 |
|
76 QColor backgroundColor() const; |
76 Camera camera() const; |
77 Camera camera() const; |
77 const CameraInfo& cameraInfo(Camera camera) const; |
78 const CameraInfo& cameraInfo(Camera camera) const; |
78 QString cameraName(Camera camera) const; |
79 QString cameraName(Camera camera) const; |
79 QByteArray capturePixels(); |
80 QByteArray capturePixels(); |
80 void compileObject(LDObject* obj); |
81 void compileObject(LDObject* obj); |
81 GLCompiler* compiler() const; |
82 GLCompiler* compiler() const; |
82 Vertex convert2dTo3d(const QPoint& pos2d, bool snap) const; |
83 Vertex convert2dTo3d(const QPoint& pos2d, bool snap) const; |
83 QPoint convert3dTo2d(const Vertex& pos3d) const; |
84 QPoint convert3dTo2d(const Vertex& pos3d) const; |
84 QString currentCameraName() const; |
85 QString currentCameraName() const; |
85 int depthNegateFactor() const; |
86 int depthNegateFactor() const; |
86 void drawPoint(QPainter& painter, QPointF pos, QColor color = QColor (64, 192, 0)) const; |
|
87 void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d); |
|
88 void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d, QPointF pos); |
|
89 void drawGLScene(); |
87 void drawGLScene(); |
90 void forgetObject(LDObject* obj); |
88 void forgetObject(LDObject* obj); |
91 Axis getCameraAxis(bool y, Camera camid = (Camera) -1); |
89 Axis getCameraAxis(bool y, Camera camid = (Camera) -1); |
92 double getDepthValue() const; |
90 double getDepthValue() const; |
93 void getRelativeAxes(Axis& relX, Axis& relY) const; |
91 void getRelativeAxes(Axis& relX, Axis& relY) const; |
96 void highlightCursorObject(); |
94 void highlightCursorObject(); |
97 void initGLData(); |
95 void initGLData(); |
98 bool isDrawOnly() const; |
96 bool isDrawOnly() const; |
99 bool isPicking() const; |
97 bool isPicking() const; |
100 Qt::KeyboardModifiers keyboardModifiers() const; |
98 Qt::KeyboardModifiers keyboardModifiers() const; |
101 QPen linePen() const; |
|
102 void makeCurrent(); |
99 void makeCurrent(); |
103 bool mouseHasMoved() const; |
100 bool mouseHasMoved() const; |
104 QPoint const& mousePosition() const; |
101 QPoint const& mousePosition() const; |
105 QPointF const& mousePositionF() const; |
102 QPointF const& mousePositionF() const; |
106 void needZoomToFit(); |
103 void needZoomToFit(); |
116 void setDepthValue(double depth); |
113 void setDepthValue(double depth); |
117 void setDrawOnly(bool value); |
114 void setDrawOnly(bool value); |
118 void setPicking(bool a); |
115 void setPicking(bool a); |
119 QPen textPen() const; |
116 QPen textPen() const; |
120 void zoomNotch(bool inward); |
117 void zoomNotch(bool inward); |
|
118 |
|
119 static const QPen thinBorderPen; |
121 |
120 |
122 protected: |
121 protected: |
123 void contextMenuEvent(QContextMenuEvent* event); |
122 void contextMenuEvent(QContextMenuEvent* event); |
124 void dragEnterEvent(QDragEnterEvent* event); |
123 void dragEnterEvent(QDragEnterEvent* event); |
125 void initializeGL(); |
124 void initializeGL(); |
173 bool m_isCameraMoving = false; |
172 bool m_isCameraMoving = false; |
174 bool m_needZoomToFit = true; |
173 bool m_needZoomToFit = true; |
175 QPoint m_mousePosition; |
174 QPoint m_mousePosition; |
176 QPoint m_globalpos; |
175 QPoint m_globalpos; |
177 QPointF m_mousePositionF; |
176 QPointF m_mousePositionF; |
178 QPen m_thinBorderPen; |
|
179 Camera m_camera; |
177 Camera m_camera; |
180 Camera m_toolTipCamera; |
178 Camera m_toolTipCamera; |
181 GLuint m_axeslist; |
179 GLuint m_axeslist; |
182 int m_width = 0; |
180 int m_width = 0; |
183 int m_height = 0; |
181 int m_height = 0; |