Use View3DInventorViewer::setSelectionEnabled instead of SoFCUnifiedSelection::selectionRole
This commit is contained in:
@@ -40,7 +40,6 @@
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/SoFCUnifiedSelection.h>
|
||||
#include <Gui/Utilities.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
@@ -96,8 +95,7 @@ void BoxSelection::selectionCallback(void * ud, SoEventCallback * cb)
|
||||
{
|
||||
Gui::View3DInventorViewer* view = static_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
||||
SoNode* root = view->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
view->setSelectionEnabled(true);
|
||||
|
||||
std::vector<SbVec2f> picked = view->getGLPolygon();
|
||||
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
||||
@@ -204,8 +202,7 @@ void BoxSelection::start(TopAbs_ShapeEnum shape)
|
||||
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, this);
|
||||
// avoid that the selection node handles the event otherwise the callback function won't be
|
||||
// called immediately
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
shapeEnum = shape;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/SoFCUnifiedSelection.h>
|
||||
#include <Gui/Tools.h>
|
||||
#include <Gui/Utilities.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
@@ -201,8 +200,7 @@ public:
|
||||
{
|
||||
Gui::View3DInventorViewer* view = static_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
||||
SoNode* root = view->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
view->setSelectionEnabled(true);
|
||||
|
||||
std::vector<SbVec2f> picked = view->getGLPolygon();
|
||||
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
||||
@@ -267,8 +265,7 @@ FaceColors::~FaceColors()
|
||||
d->view->stopSelection();
|
||||
d->view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(),
|
||||
Private::selectionCallback, this);
|
||||
SoNode* root = d->view->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
d->view->setSelectionEnabled(true);
|
||||
}
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
d->connectDelDoc.disconnect();
|
||||
@@ -325,8 +322,7 @@ void FaceColors::onBoxSelectionToggled(bool checked)
|
||||
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), Private::selectionCallback, this);
|
||||
// avoid that the selection node handles the event otherwise the callback function won't be
|
||||
// called immediately
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
d->view = viewer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/SoFCUnifiedSelection.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Mod/Part/App/DatumFeature.h>
|
||||
|
||||
@@ -159,9 +159,7 @@ private:
|
||||
Gui::MDIView *mdi = Gui::Application::Instance->activeDocument()->getActiveView();
|
||||
Gui::View3DInventorViewer *viewer;
|
||||
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
||||
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
viewer->setSelectionEnabled(true);
|
||||
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
|
||||
@@ -169,9 +169,7 @@ private:
|
||||
Gui::MDIView *mdi = Gui::Application::Instance->activeDocument()->getActiveView();
|
||||
Gui::View3DInventorViewer *viewer;
|
||||
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
||||
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
viewer->setSelectionEnabled(true);
|
||||
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
|
||||
@@ -418,9 +418,7 @@ void ViewProviderSketch::purgeHandler()
|
||||
Gui::MDIView *mdi = Gui::Application::Instance->editDocument()->getActiveView();
|
||||
Gui::View3DInventorViewer *viewer;
|
||||
viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
|
||||
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
}
|
||||
|
||||
void ViewProviderSketch::setAxisPickStyle(bool on)
|
||||
@@ -3183,8 +3181,7 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo
|
||||
viewer->setCameraOrientation(rot);
|
||||
|
||||
viewer->setEditing(true);
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
|
||||
viewer->addGraphicsItem(rubberband.get());
|
||||
rubberband->setViewer(viewer);
|
||||
@@ -3204,8 +3201,7 @@ void ViewProviderSketch::unsetEditViewer(Gui::View3DInventorViewer* viewer)
|
||||
|
||||
viewer->removeGraphicsItem(rubberband.get());
|
||||
viewer->setEditing(false);
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
viewer->setSelectionEnabled(true);
|
||||
}
|
||||
|
||||
void ViewProviderSketch::camSensCB(void *data, SoSensor *)
|
||||
|
||||
Reference in New Issue
Block a user