+ add method to set a viewer for Mesh selection

This commit is contained in:
wmayer 2016-04-29 18:14:28 +02:00
parent ace71bab58
commit d57b57d7ba
2 changed files with 12 additions and 0 deletions

View File

@ -80,6 +80,7 @@ MeshSelection::MeshSelection()
, onlyVisibleTriangles(false)
, activeCB(0)
, selectionCB(0)
, ivViewer(0)
{
setCallback(selectGLCallback);
}
@ -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();

View File

@ -67,6 +67,7 @@ public:
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);
@ -86,6 +87,7 @@ private:
bool addToSelection, addComponent, removeComponent;
SoEventCallbackCB *activeCB;
SoEventCallbackCB *selectionCB;
Gui::View3DInventorViewer* ivViewer;
mutable std::vector<Gui::SelectionObject> meshObjects;
static unsigned char cross_bitmap[];