From e79b5ff9e82d84fbbd8e7e8ce6c8232b3c4e7804 Mon Sep 17 00:00:00 2001 From: tritao Date: Wed, 15 Jan 2025 13:39:32 +0000 Subject: [PATCH] Gui: Rename `SoFCEnableHighlightAction` to preselection terminology. --- src/Gui/Selection/SoFCSelection.cpp | 8 ++-- src/Gui/Selection/SoFCSelectionAction.cpp | 52 +++++++++++----------- src/Gui/Selection/SoFCSelectionAction.h | 16 +++---- src/Gui/Selection/SoFCUnifiedSelection.cpp | 8 ++-- src/Gui/View3DSettings.cpp | 2 +- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/Gui/Selection/SoFCSelection.cpp b/src/Gui/Selection/SoFCSelection.cpp index 0d11ebd692..b5dc26de5e 100644 --- a/src/Gui/Selection/SoFCSelection.cpp +++ b/src/Gui/Selection/SoFCSelection.cpp @@ -216,9 +216,9 @@ void SoFCSelection::doAction(SoAction *action) if(!useNewSelection.getValue()) { - if (action->getTypeId() == SoFCEnableHighlightAction::getClassTypeId()) { - auto preaction = static_cast(action); - if (preaction->highlight) { + if (action->getTypeId() == SoFCEnablePreselectionAction::getClassTypeId()) { + auto preaction = static_cast(action); + if (preaction->enabled) { this->preselectionMode = SoFCSelection::AUTO; } else { @@ -228,7 +228,7 @@ void SoFCSelection::doAction(SoAction *action) if (action->getTypeId() == SoFCEnableSelectionAction::getClassTypeId()) { auto selaction = static_cast(action); - if (selaction->selection) { + if (selaction->enabled) { this->selectionMode = SoFCSelection::SEL_ON; } else { diff --git a/src/Gui/Selection/SoFCSelectionAction.cpp b/src/Gui/Selection/SoFCSelectionAction.cpp index 14777bd78b..55f4f06067 100644 --- a/src/Gui/Selection/SoFCSelectionAction.cpp +++ b/src/Gui/Selection/SoFCSelectionAction.cpp @@ -296,7 +296,7 @@ void SoFCEnableSelectionAction::finish() SoFCEnableSelectionAction::SoFCEnableSelectionAction (const SbBool& sel) - : selection(sel) + : enabled(sel) { SO_ACTION_CONSTRUCTOR(SoFCEnableSelectionAction); } @@ -317,7 +317,7 @@ void SoFCEnableSelectionAction::callDoAction(SoAction *action,SoNode *node) // --------------------------------------------------------------- -SO_ACTION_SOURCE(SoFCEnableHighlightAction) +SO_ACTION_SOURCE(SoFCEnablePreselectionAction) /** * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base @@ -327,28 +327,28 @@ SO_ACTION_SOURCE(SoFCEnableHighlightAction) * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ -void SoFCEnableHighlightAction::initClass() +void SoFCEnablePreselectionAction::initClass() { - SO_ACTION_INIT_CLASS(SoFCEnableHighlightAction,SoAction); + SO_ACTION_INIT_CLASS(SoFCEnablePreselectionAction,SoAction); - SO_ENABLE(SoFCEnableHighlightAction, SoSwitchElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoSwitchElement); SO_ACTION_ADD_METHOD(SoNode,nullAction); - SO_ENABLE(SoFCEnableHighlightAction, SoModelMatrixElement); - SO_ENABLE(SoFCEnableHighlightAction, SoShapeStyleElement); - SO_ENABLE(SoFCEnableHighlightAction, SoComplexityElement); - SO_ENABLE(SoFCEnableHighlightAction, SoComplexityTypeElement); - SO_ENABLE(SoFCEnableHighlightAction, SoCoordinateElement); - SO_ENABLE(SoFCEnableHighlightAction, SoFontNameElement); - SO_ENABLE(SoFCEnableHighlightAction, SoFontSizeElement); - SO_ENABLE(SoFCEnableHighlightAction, SoProfileCoordinateElement); - SO_ENABLE(SoFCEnableHighlightAction, SoProfileElement); - SO_ENABLE(SoFCEnableHighlightAction, SoSwitchElement); - SO_ENABLE(SoFCEnableHighlightAction, SoUnitsElement); - SO_ENABLE(SoFCEnableHighlightAction, SoViewVolumeElement); - SO_ENABLE(SoFCEnableHighlightAction, SoViewingMatrixElement); - SO_ENABLE(SoFCEnableHighlightAction, SoViewportRegionElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoModelMatrixElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoShapeStyleElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoComplexityElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoComplexityTypeElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoCoordinateElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoFontNameElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoFontSizeElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoProfileCoordinateElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoProfileElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoSwitchElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoUnitsElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoViewVolumeElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoViewingMatrixElement); + SO_ENABLE(SoFCEnablePreselectionAction, SoViewportRegionElement); @@ -369,28 +369,28 @@ void SoFCEnableHighlightAction::initClass() SO_ACTION_ADD_METHOD(SoFCSelection,callDoAction); } -void SoFCEnableHighlightAction::finish() +void SoFCEnablePreselectionAction::finish() { atexit_cleanup(); } -SoFCEnableHighlightAction::SoFCEnableHighlightAction (const SbBool& sel) - : highlight(sel) +SoFCEnablePreselectionAction::SoFCEnablePreselectionAction (const SbBool& sel) + : enabled(sel) { - SO_ACTION_CONSTRUCTOR(SoFCEnableHighlightAction); + SO_ACTION_CONSTRUCTOR(SoFCEnablePreselectionAction); } -SoFCEnableHighlightAction::~SoFCEnableHighlightAction() = default; +SoFCEnablePreselectionAction::~SoFCEnablePreselectionAction() = default; -void SoFCEnableHighlightAction::beginTraversal(SoNode *node) +void SoFCEnablePreselectionAction::beginTraversal(SoNode *node) { traverse(node); } -void SoFCEnableHighlightAction::callDoAction(SoAction *action,SoNode *node) +void SoFCEnablePreselectionAction::callDoAction(SoAction *action,SoNode *node) { node->doAction(action); } diff --git a/src/Gui/Selection/SoFCSelectionAction.h b/src/Gui/Selection/SoFCSelectionAction.h index 7576ca911a..c3e36e0c06 100644 --- a/src/Gui/Selection/SoFCSelectionAction.h +++ b/src/Gui/Selection/SoFCSelectionAction.h @@ -100,7 +100,7 @@ public: SoFCEnableSelectionAction (const SbBool& sel); ~SoFCEnableSelectionAction() override; - SbBool selection; + SbBool enabled; static void initClass(); static void finish(); @@ -113,19 +113,19 @@ private: }; /** - * The SoFCEnableHighlightAction class is used to inform an SoFCSelection node + * The SoFCEnablePreselectionAction class is used to inform an SoFCSelection node * whether preselection is enabled or disabled. * @author Werner Mayer */ -class GuiExport SoFCEnableHighlightAction : public SoAction +class GuiExport SoFCEnablePreselectionAction : public SoAction { - SO_ACTION_HEADER(SoFCEnableHighlightAction); + SO_ACTION_HEADER(SoFCEnablePreselectionAction); public: - SoFCEnableHighlightAction (const SbBool& sel); - ~SoFCEnableHighlightAction() override; + SoFCEnablePreselectionAction (const SbBool& sel); + ~SoFCEnablePreselectionAction() override; - SbBool highlight; + SbBool enabled; static void initClass(); static void finish(); @@ -164,7 +164,7 @@ private: /** * The SoFCHighlightColorAction class is used to inform an SoFCSelection node - * which preselection color is used. + * which highlight color is used. * @author Werner Mayer */ class GuiExport SoFCHighlightColorAction : public SoAction diff --git a/src/Gui/Selection/SoFCUnifiedSelection.cpp b/src/Gui/Selection/SoFCUnifiedSelection.cpp index 0c6ae57006..2be6b29bd4 100644 --- a/src/Gui/Selection/SoFCUnifiedSelection.cpp +++ b/src/Gui/Selection/SoFCUnifiedSelection.cpp @@ -312,9 +312,9 @@ SoFCUnifiedSelection::getPickedList(SoHandleEventAction* action, bool singlePick void SoFCUnifiedSelection::doAction(SoAction *action) { - if (action->getTypeId() == SoFCEnableHighlightAction::getClassTypeId()) { - auto enableHighlightAction = static_cast(action); - if (enableHighlightAction->highlight) { + if (action->getTypeId() == SoFCEnablePreselectionAction::getClassTypeId()) { + auto enablePreselectionAction = static_cast(action); + if (enablePreselectionAction->enabled) { this->preselectionMode = SoFCUnifiedSelection::AUTO; } else { @@ -324,7 +324,7 @@ void SoFCUnifiedSelection::doAction(SoAction *action) if (action->getTypeId() == SoFCEnableSelectionAction::getClassTypeId()) { auto enableSelectionAction = static_cast(action); - if (enableSelectionAction->selection) { + if (enableSelectionAction->enabled) { this->selectionMode = SoFCUnifiedSelection::ON; } else { diff --git a/src/Gui/View3DSettings.cpp b/src/Gui/View3DSettings.cpp index a91c21709c..c1a2f7e3d9 100644 --- a/src/Gui/View3DSettings.cpp +++ b/src/Gui/View3DSettings.cpp @@ -185,7 +185,7 @@ void View3DSettings::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M } else if (strcmp(Reason,"EnablePreselection") == 0) { const ParameterGrp& rclGrp = ((ParameterGrp&)rCaller); - SoFCEnableHighlightAction cAct(rclGrp.GetBool("EnablePreselection", true)); + SoFCEnablePreselectionAction cAct(rclGrp.GetBool("EnablePreselection", true)); for (auto _viewer : _viewers) { cAct.apply(_viewer->getSceneGraph()); }