Gui: Rename SoFCUnifiedSelection::selectionRole for clarity.

This commit is contained in:
tritao
2025-01-13 23:07:15 +00:00
parent 2225e7c32f
commit 589ff46a58
3 changed files with 10 additions and 12 deletions

View File

@@ -113,12 +113,12 @@ SoFCUnifiedSelection::SoFCUnifiedSelection()
{
SO_NODE_CONSTRUCTOR(SoFCUnifiedSelection);
SO_NODE_ADD_FIELD(colorHighlight, (SbColor(1.0f, 0.6f, 0.0f)));
SO_NODE_ADD_FIELD(colorSelection, (SbColor(0.1f, 0.8f, 0.1f)));
SO_NODE_ADD_FIELD(highlightMode, (AUTO));
SO_NODE_ADD_FIELD(selectionMode, (ON));
SO_NODE_ADD_FIELD(selectionRole, (true));
SO_NODE_ADD_FIELD(useNewSelection, (true));
SO_NODE_ADD_FIELD(colorHighlight, (SbColor(1.0f, 0.6f, 0.0f)));
SO_NODE_ADD_FIELD(colorSelection, (SbColor(0.1f, 0.8f, 0.1f)));
SO_NODE_ADD_FIELD(highlightMode, (AUTO));
SO_NODE_ADD_FIELD(selectionMode, (ON));
SO_NODE_ADD_FIELD(selectionEnabled, (true));
SO_NODE_ADD_FIELD(useNewSelection, (true));
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, AUTO);
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, ON);
@@ -729,7 +729,7 @@ void
SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
{
// If off then don't handle this event
if (!selectionRole.getValue()) {
if (!selectionEnabled.getValue()) {
inherited::handleEvent(action);
return;
}

View File

@@ -76,7 +76,7 @@ public:
SoSFColor colorSelection;
SoSFEnum highlightMode;
SoSFEnum selectionMode;
SoSFBool selectionRole;
SoSFBool selectionEnabled;
SoSFBool useNewSelection;
void doAction(SoAction *action) override;

View File

@@ -1798,14 +1798,12 @@ const std::vector<SbVec2s>& View3DInventorViewer::getPolygon(SelectionRole* role
void View3DInventorViewer::setSelectionEnabled(bool enable)
{
SoNode* root = getSceneGraph();
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(enable); // NOLINT
this->selectionRoot->selectionEnabled.setValue(enable); // NOLINT
}
bool View3DInventorViewer::isSelectionEnabled() const
{
SoNode* root = getSceneGraph();
return static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.getValue(); // NOLINT
return this->selectionRoot->selectionEnabled.getValue(); // NOLINT
}
SbVec2f View3DInventorViewer::screenCoordsOfPath(SoPath* path) const