diff --git a/src/Mod/Mesh/Gui/MeshSelection.cpp b/src/Mod/Mesh/Gui/MeshSelection.cpp index 7cb5e3af1..fce098476 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.cpp +++ b/src/Mod/Mesh/Gui/MeshSelection.cpp @@ -80,6 +80,7 @@ MeshSelection::MeshSelection() , onlyVisibleTriangles(false) , activeCB(0) , selectionCB(0) + , ivViewer(0) { setCallback(selectGLCallback); } @@ -139,8 +140,17 @@ std::list MeshSelection::getViewProviders() const return vps; } +void MeshSelection::setViewer(Gui::View3DInventorViewer* v) +{ + ivViewer = v; +} + Gui::View3DInventorViewer* MeshSelection::getViewer() const { + // if a special viewer was set from outside then use this + if (ivViewer) + return ivViewer; + Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (!doc) return 0; Gui::MDIView* view = doc->getActiveView(); diff --git a/src/Mod/Mesh/Gui/MeshSelection.h b/src/Mod/Mesh/Gui/MeshSelection.h index 2aaecf266..749f7c96d 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.h +++ b/src/Mod/Mesh/Gui/MeshSelection.h @@ -67,6 +67,7 @@ public: void setRemoveComponentOnClick(bool); void setObjects(const std::vector&); std::vector getObjects() const; + void setViewer(Gui::View3DInventorViewer* v); protected: void setCallback(SoEventCallbackCB *cb); @@ -86,6 +87,7 @@ private: bool addToSelection, addComponent, removeComponent; SoEventCallbackCB *activeCB; SoEventCallbackCB *selectionCB; + Gui::View3DInventorViewer* ivViewer; mutable std::vector meshObjects; static unsigned char cross_bitmap[];