Skip to content

Commit

Permalink
+ add method to set a viewer for Mesh selection
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 29, 2016
1 parent ace71ba commit d57b57d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Mod/Mesh/Gui/MeshSelection.cpp
Expand Up @@ -80,6 +80,7 @@ MeshSelection::MeshSelection()
, onlyVisibleTriangles(false)
, activeCB(0)
, selectionCB(0)
, ivViewer(0)
{
setCallback(selectGLCallback);
}
Expand Down Expand Up @@ -139,8 +140,17 @@ std::list<ViewProviderMesh*> 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();
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Mesh/Gui/MeshSelection.h
Expand Up @@ -67,6 +67,7 @@ class MeshGuiExport MeshSelection
void setRemoveComponentOnClick(bool);
void setObjects(const std::vector<Gui::SelectionObject>&);
std::vector<App::DocumentObject*> getObjects() const;
void setViewer(Gui::View3DInventorViewer* v);

protected:
void setCallback(SoEventCallbackCB *cb);
Expand All @@ -86,6 +87,7 @@ class MeshGuiExport MeshSelection
bool addToSelection, addComponent, removeComponent;
SoEventCallbackCB *activeCB;
SoEventCallbackCB *selectionCB;
Gui::View3DInventorViewer* ivViewer;
mutable std::vector<Gui::SelectionObject> meshObjects;

static unsigned char cross_bitmap[];
Expand Down

0 comments on commit d57b57d

Please sign in to comment.