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 *)
|
||||
|
||||
Reference in New Issue
Block a user