61 const GLCamera& currentCamera() const; |
61 const GLCamera& currentCamera() const; |
62 Qt::KeyboardModifiers keyboardModifiers() const; |
62 Qt::KeyboardModifiers keyboardModifiers() const; |
63 const Model* model() const; |
63 const Model* model() const; |
64 QPoint const& mousePosition() const; |
64 QPoint const& mousePosition() const; |
65 QPointF const& mousePositionF() const; |
65 QPointF const& mousePositionF() const; |
66 LDObject* objectAtCursor() const; |
66 QPersistentModelIndex objectAtCursor() const; |
67 QSet<LDObject*> pick(const QRect& range); |
67 QSet<LDObject*> pick(const QRect& range); |
68 LDObject* pick(int mouseX, int mouseY); |
68 LDObject* pick(int mouseX, int mouseY); |
69 void resetAllAngles(); |
69 void resetAllAngles(); |
70 void resetAngles(); |
70 void resetAngles(); |
71 QImage screenCapture(); |
71 QImage screenCapture(); |
82 static const GLRotationMatrix backCameraMatrix; |
82 static const GLRotationMatrix backCameraMatrix; |
83 static const GLRotationMatrix rightCameraMatrix; |
83 static const GLRotationMatrix rightCameraMatrix; |
84 static const GLRotationMatrix ldrawToGLAdapterMatrix; |
84 static const GLRotationMatrix ldrawToGLAdapterMatrix; |
85 |
85 |
86 signals: |
86 signals: |
87 void objectHighlightingChanged(LDObject* object); |
87 void objectHighlightingChanged(const QModelIndex& oldIndex, const QModelIndex& newIndex); |
88 |
88 |
89 protected: |
89 protected: |
90 void initializeGL(); |
90 void initializeGL(); |
91 virtual void drawFixedCameraBackdrop(); |
91 virtual void drawFixedCameraBackdrop(); |
92 void keyPressEvent(QKeyEvent* event); |
92 void keyPressEvent(QKeyEvent* event); |
116 } |
116 } |
117 |
117 |
118 private: |
118 private: |
119 const Model* const m_model; |
119 const Model* const m_model; |
120 class GLCompiler* m_compiler; |
120 class GLCompiler* m_compiler; |
121 LDObject* m_objectAtCursor = nullptr; |
121 QPersistentModelIndex m_objectAtCursor; |
122 CameraIcon m_cameraIcons[7]; |
122 CameraIcon m_cameraIcons[7]; |
123 QTimer* m_toolTipTimer; |
123 QTimer* m_toolTipTimer; |
124 Qt::MouseButtons m_lastButtons; |
124 Qt::MouseButtons m_lastButtons; |
125 Qt::KeyboardModifiers m_currentKeyboardModifiers; |
125 Qt::KeyboardModifiers m_currentKeyboardModifiers; |
126 QGenericMatrix<4, 4, GLfloat> m_rotationMatrix; |
126 QGenericMatrix<4, 4, GLfloat> m_rotationMatrix; |
149 void highlightCursorObject(); |
149 void highlightCursorObject(); |
150 void initializeAxes(); |
150 void initializeAxes(); |
151 void initializeLighting(); |
151 void initializeLighting(); |
152 void initGLData(); |
152 void initGLData(); |
153 void needZoomToFit(); |
153 void needZoomToFit(); |
154 Q_SLOT void removeObject(LDObject* object); |
|
155 void setPicking(bool picking); |
154 void setPicking(bool picking); |
156 Q_SLOT void showCameraIconTooltip(); |
155 Q_SLOT void showCameraIconTooltip(); |
157 void zoomToFit(); |
156 void zoomToFit(); |
158 void zoomAllToFit(); |
157 void zoomAllToFit(); |
159 }; |
158 }; |