Thu, 23 Feb 2017 20:06:22 +0200
Made the GL renderer recieve information of object deletion via signals.
--- a/src/glrenderer.cpp Thu Feb 23 20:03:31 2017 +0200 +++ b/src/glrenderer.cpp Thu Feb 23 20:06:22 2017 +0200 @@ -71,6 +71,7 @@ m_toolTipTimer->setSingleShot (true); setAcceptDrops (true); connect (m_toolTipTimer, SIGNAL (timeout()), this, SLOT (showCameraIconTooltip())); + connect(model, SIGNAL(aboutToRemoveObject(LDObject*)), this, SLOT(removeObject(LDObject*))); resetAllAngles(); m_needZoomToFit = true; @@ -783,9 +784,9 @@ // ============================================================================= // -void GLRenderer::forgetObject(LDObject* obj) +void GLRenderer::removeObject(LDObject* object) { - if (m_objectAtCursor == obj) + if (m_objectAtCursor == object) m_objectAtCursor = nullptr; }
--- a/src/glrenderer.h Thu Feb 23 20:03:31 2017 +0200 +++ b/src/glrenderer.h Thu Feb 23 20:06:22 2017 +0200 @@ -83,7 +83,6 @@ GLCamera& currentCamera(); const GLCamera& currentCamera() const; void drawGLScene(); - void forgetObject(LDObject* obj); void highlightCursorObject(); void initGLData(); bool isPicking() const; @@ -173,6 +172,7 @@ void drawVbos (VboClass surface, VboSubclass colors, GLenum type); void zoomToFit(); void zoomAllToFit(); + Q_SLOT void removeObject(LDObject* object); private slots: void showCameraIconTooltip();
--- a/src/linetypes/modelobject.cpp Thu Feb 23 20:03:31 2017 +0200 +++ b/src/linetypes/modelobject.cpp Thu Feb 23 20:06:22 2017 +0200 @@ -70,10 +70,6 @@ LDObject::~LDObject() { - // Delete the GL lists - if (g_win) - g_win->renderer()->forgetObject(this); - // Remove this object from the list of LDObjects g_allObjects.erase(g_allObjects.find(id())); }