Use View3DInventorViewer::setSelectionEnabled instead of SoFCUnifiedSelection::selectionRole
This commit is contained in:
@@ -72,7 +72,6 @@
|
||||
#include "SelectionObject.h"
|
||||
#include "SoAxisCrossKit.h"
|
||||
#include "SoFCOffscreenRenderer.h"
|
||||
#include "SoFCUnifiedSelection.h"
|
||||
#include "TextureMapping.h"
|
||||
#include "Tools.h"
|
||||
#include "Tree.h"
|
||||
@@ -2831,8 +2830,7 @@ static void doSelect(void* ud, SoEventCallback * cb)
|
||||
bool selectElement = ud ? true : false;
|
||||
auto viewer = static_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
||||
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
viewer->setSelectionEnabled(true);
|
||||
|
||||
SelectionMode selectionMode = CENTER;
|
||||
|
||||
@@ -2897,9 +2895,9 @@ void StdBoxSelection::activated(int iMsg)
|
||||
SoKeyboardEvent ev;
|
||||
viewer->navigationStyle()->processEvent(&ev);
|
||||
}
|
||||
|
||||
SelectionCallbackHandler::Create(viewer, View3DInventorViewer::Rubberband, QCursor(QPixmap(cursor_box_select), 7, 7), doSelect, nullptr);
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2978,9 +2976,9 @@ void StdBoxElementSelection::activated(int iMsg)
|
||||
SoKeyboardEvent ev;
|
||||
viewer->navigationStyle()->processEvent(&ev);
|
||||
}
|
||||
|
||||
SelectionCallbackHandler::Create(viewer, View3DInventorViewer::Rubberband, QCursor(QPixmap(cursor_box_element_select), 7, 7), doSelect, this);
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,9 +189,9 @@ void ViewProviderDragger::setEditViewer(Gui::View3DInventorViewer* viewer, int M
|
||||
{
|
||||
auto rootPickStyle = new SoPickStyle();
|
||||
rootPickStyle->style = SoPickStyle::UNPICKABLE;
|
||||
auto selection = static_cast<SoFCUnifiedSelection*>(viewer->getSceneGraph());
|
||||
auto selection = static_cast<SoGroup*>(viewer->getSceneGraph());
|
||||
selection->insertChild(rootPickStyle, 0);
|
||||
selection->selectionRole.setValue(false);
|
||||
viewer->setSelectionEnabled(false);
|
||||
csysDragger->setUpAutoScale(viewer->getSoRenderManager()->getCamera());
|
||||
|
||||
auto mat = viewer->getDocument()->getEditingTransform();
|
||||
@@ -208,12 +208,12 @@ void ViewProviderDragger::setEditViewer(Gui::View3DInventorViewer* viewer, int M
|
||||
|
||||
void ViewProviderDragger::unsetEditViewer(Gui::View3DInventorViewer* viewer)
|
||||
{
|
||||
auto selection = static_cast<SoFCUnifiedSelection*>(viewer->getSceneGraph());
|
||||
auto selection = static_cast<SoGroup*>(viewer->getSceneGraph());
|
||||
SoNode *child = selection->getChild(0);
|
||||
if (child && child->isOfType(SoPickStyle::getClassTypeId())) {
|
||||
selection->removeChild(child);
|
||||
selection->selectionRole.setValue(true);
|
||||
}
|
||||
if (child && child->isOfType(SoPickStyle::getClassTypeId())) {
|
||||
selection->removeChild(child);
|
||||
viewer->setSelectionEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderDragger::dragStartCallback(void *, SoDragger *)
|
||||
|
||||
@@ -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