+ add method to set a viewer for Mesh selection
This commit is contained in:
parent
ace71bab58
commit
d57b57d7ba
|
@ -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();
|
||||
|
|
|
@ -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[];
|
||||
|
|
Loading…
Reference in New Issue
Block a user