Use View3DInventorViewer::setSelectionEnabled instead of SoFCUnifiedSelection::selectionRole

This commit is contained in:
wmayer
2023-05-02 15:44:03 +02:00
committed by wwmayer
parent d668f12ffb
commit b0c9871722
8 changed files with 22 additions and 40 deletions

View File

@@ -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);
}
}
}