From b780cf923f22ecafbebd2e9736c5823625cde3a5 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Tue, 2 Sep 2025 21:26:11 +0200 Subject: [PATCH] Part/Gui: Rename Pick Geometry tool to Clarify Selection Co-authored-by: realthunder --- src/Gui/CommandView.cpp | 22 +++++++++++----------- src/Gui/Navigation/NavigationStyle.cpp | 10 +++++----- src/Gui/Selection/Selection.cpp | 10 +++++----- src/Gui/Selection/Selection.h | 6 +++--- src/Gui/Selection/SelectionView.cpp | 6 +++--- src/Gui/View3DInventorViewer.cpp | 8 ++++---- src/Gui/Workbench.cpp | 2 +- src/Mod/Part/Gui/SoBrepEdgeSet.cpp | 6 +++--- src/Mod/Part/Gui/SoBrepFaceSet.cpp | 2 +- src/Mod/Part/Gui/SoBrepPointSet.cpp | 4 ++-- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 6764e67c83..2e3d14e2ba 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3957,25 +3957,25 @@ bool StdCmdAlignToSelection::isActive() } //=========================================================================== -// Std_PickGeometry +// Std_ClarifySelection //=========================================================================== -DEF_STD_CMD_A(StdCmdPickGeometry) +DEF_STD_CMD_A(StdCmdClarifySelection) -StdCmdPickGeometry::StdCmdPickGeometry() - : Command("Std_PickGeometry") +StdCmdClarifySelection::StdCmdClarifySelection() + : Command("Std_ClarifySelection") { sGroup = "View"; - sMenuText = QT_TR_NOOP("Pick geometry"); - sToolTipText = QT_TR_NOOP("Pick hidden geometries under the mouse cursor in 3D view.\n" - "This command is supposed to be activated by keyboard shortcut."); - sWhatsThis = "Std_PickGeometry"; + sMenuText = QT_TR_NOOP("Clarify Selection"); + sToolTipText = QT_TR_NOOP("Displays a context menu at the mouse cursor to select overlapping " + "or obstructed geometry in the 3D view.\n"); + sWhatsThis = "Std_ClarifySelection"; sStatusTip = sToolTipText; sAccel = "G, G"; eType = NoTransaction | AlterSelection; } -void StdCmdPickGeometry::activated(int iMsg) +void StdCmdClarifySelection::activated(int iMsg) { Q_UNUSED(iMsg); @@ -4066,7 +4066,7 @@ void StdCmdPickGeometry::activated(int iMsg) contextMenu.doPick(selections); } -bool StdCmdPickGeometry::isActive() +bool StdCmdClarifySelection::isActive() { auto view = qobject_cast(getMainWindow()->activeWindow()); return view != nullptr; @@ -4104,7 +4104,7 @@ void CreateViewStdCommands() rcCmdMgr.addCommand(new StdRecallWorkingView()); rcCmdMgr.addCommand(new StdCmdViewGroup()); rcCmdMgr.addCommand(new StdCmdAlignToSelection()); - rcCmdMgr.addCommand(new StdCmdPickGeometry()); + rcCmdMgr.addCommand(new StdCmdClarifySelection()); rcCmdMgr.addCommand(new StdCmdViewExample1()); rcCmdMgr.addCommand(new StdCmdViewExample2()); diff --git a/src/Gui/Navigation/NavigationStyle.cpp b/src/Gui/Navigation/NavigationStyle.cpp index d70b3ceec1..a5b853d9d4 100644 --- a/src/Gui/Navigation/NavigationStyle.cpp +++ b/src/Gui/Navigation/NavigationStyle.cpp @@ -1974,7 +1974,7 @@ void NavigationStyle::openPopupMenu(const SbVec2s& position) item->setChecked(true); } - // Add Pick Geometry option if there are objects under cursor + // Add Clarify Selection option if there are objects under cursor bool separator = false; auto posAction = !contextMenu->actions().empty() ? contextMenu->actions().front() : nullptr; @@ -1990,12 +1990,12 @@ void NavigationStyle::openPopupMenu(const SbVec2s& position) if (pplist.getLength() > 0) { separator = true; - auto cmd = Application::Instance->commandManager().getCommandByName("Std_PickGeometry"); + auto cmd = Application::Instance->commandManager().getCommandByName("Std_ClarifySelection"); if (cmd) { pickAction = new QAction(cmd->getAction()->text(), contextMenu); pickAction->setShortcut(cmd->getAction()->shortcut()); } else { - pickAction = new QAction(QObject::tr("Pick geometry"), contextMenu); + pickAction = new QAction(QObject::tr("Clarify Selection"), contextMenu); } if (posAction) { contextMenu->insertAction(posAction, pickAction); @@ -2026,8 +2026,8 @@ void NavigationStyle::openPopupMenu(const SbVec2s& position) } if (pickAction && used == pickAction) { - // Execute the Pick Geometry command at this position - auto cmd = Application::Instance->commandManager().getCommandByName("Std_PickGeometry"); + // Execute the Clarify Selection command at this position + auto cmd = Application::Instance->commandManager().getCommandByName("Std_ClarifySelection"); if (cmd && cmd->isActive()) { cmd->invoke(0); } diff --git a/src/Gui/Selection/Selection.cpp b/src/Gui/Selection/Selection.cpp index 11d0c14082..566ca86242 100644 --- a/src/Gui/Selection/Selection.cpp +++ b/src/Gui/Selection/Selection.cpp @@ -2605,12 +2605,12 @@ PyObject *SelectionSingleton::sGetSelectionFromStack(PyObject * /*self*/, PyObje PY_CATCH; } -bool SelectionSingleton::pickGeometryActive = false; +bool SelectionSingleton::clarifySelectionActive = false; -bool SelectionSingleton::isPickGeometryActive() { - return pickGeometryActive; +bool SelectionSingleton::isClarifySelectionActive() { + return clarifySelectionActive; } -void SelectionSingleton::setPickGeometryActive(bool active) { - pickGeometryActive = active; +void SelectionSingleton::setClarifySelectionActive(bool active) { + clarifySelectionActive = active; } diff --git a/src/Gui/Selection/Selection.h b/src/Gui/Selection/Selection.h index 2faf778350..aa0eb9576c 100644 --- a/src/Gui/Selection/Selection.h +++ b/src/Gui/Selection/Selection.h @@ -291,7 +291,7 @@ private: class GuiExport SelectionSingleton : public Base::Subject { public: - static bool pickGeometryActive; + static bool clarifySelectionActive; struct SelObj { const char* DocName; @@ -411,8 +411,8 @@ public: */ void setVisible(VisibleState visible); - static bool isPickGeometryActive(); - static void setPickGeometryActive(bool active); + static bool isClarifySelectionActive(); + static void setClarifySelectionActive(bool active); /// signal on new object boost::signals2::signal signalSelectionChanged; diff --git a/src/Gui/Selection/SelectionView.cpp b/src/Gui/Selection/SelectionView.cpp index ad000310e3..d6b0ee8bf7 100644 --- a/src/Gui/Selection/SelectionView.cpp +++ b/src/Gui/Selection/SelectionView.cpp @@ -731,7 +731,7 @@ struct SubMenuInfo { PickData SelectionMenu::doPick(const std::vector &sels) { clear(); - Gui::Selection().setPickGeometryActive(true); + Gui::Selection().setClarifySelectionActive(true); std::vector selsCopy = sels; currentSelections = &selsCopy; @@ -822,8 +822,8 @@ void SelectionMenu::buildMenuStructure(std::map &menus PickData SelectionMenu::onPicked(QAction *picked, const std::vector &sels) { - // Clear the PickGeometry active flag when menu is done - Gui::Selection().setPickGeometryActive(false); + // Clear the ClarifySelection active flag when menu is done + Gui::Selection().setClarifySelectionActive(false); Gui::Selection().rmvPreselect(); if (!picked) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 2f185fe7b2..f6ac7667ac 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -237,15 +237,15 @@ public: longPressTimer->setInterval(1000); // after 1s of LMB press on viewport it gets toggled connect(longPressTimer, &QTimer::timeout, [this]() { if (currentViewer) { - triggerPickGeometry(); + triggerClarifySelection(); } }); } ~ViewerEventFilter() override = default; private: - void triggerPickGeometry() { - Gui::Command::runCommand(Gui::Command::Gui, "Gui.runCommand('Std_PickGeometry')"); + void triggerClarifySelection() { + Gui::Command::runCommand(Gui::Command::Gui, "Gui.runCommand('Std_ClarifySelection')"); } QTimer* longPressTimer; @@ -2520,7 +2520,7 @@ void View3DInventorViewer::renderScene() glClear(GL_DEPTH_BUFFER_BIT); // process delayed paths with priority support - if (Gui::Selection().isPickGeometryActive()) { + if (Gui::Selection().isClarifySelectionActive()) { Gui::SoDelayedAnnotationsElement::processDelayedPathsWithPriority(state, glra); } else { // standard processing for normal delayed annotations diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index c244079487..41e53d9aa5 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -738,7 +738,7 @@ MenuItem* StdWorkbench::setupMenuBar() const << "Std_ProjectUtil" << "Std_DlgParameter" << "Std_DlgCustomize" - << "Std_PickGeometry"; + << "Std_ClarifySelection"; // Macro auto macro = new MenuItem( menuBar ); diff --git a/src/Mod/Part/Gui/SoBrepEdgeSet.cpp b/src/Mod/Part/Gui/SoBrepEdgeSet.cpp index 7a1a6f4d3b..0f2345d2eb 100644 --- a/src/Mod/Part/Gui/SoBrepEdgeSet.cpp +++ b/src/Mod/Part/Gui/SoBrepEdgeSet.cpp @@ -90,9 +90,9 @@ void SoBrepEdgeSet::GLRender(SoGLRenderAction *action) if (Gui::Selection() - .isPickGeometryActive() && !Gui::SoDelayedAnnotationsElement::isProcessingDelayedPaths + .isClarifySelectionActive() && !Gui::SoDelayedAnnotationsElement::isProcessingDelayedPaths && ((ctx && !ctx->hl.empty()) || viewProvider->isFaceHighlightActive())) { - // if we are using pickgeometry - add this to delayed paths with priority + // if we are using clarifyselection - add this to delayed paths with priority // as we want to get this rendered on top of everything viewProvider->setFaceHighlightActive(true); Gui::SoDelayedAnnotationsElement::addDelayedPath(action->getState(), @@ -154,7 +154,7 @@ void SoBrepEdgeSet::GLRender(SoGLRenderAction *action) } if(ctx2 && !ctx2->selectionIndex.empty()) renderSelection(action,ctx2,false); - else if (Gui::Selection().isPickGeometryActive() + else if (Gui::Selection().isClarifySelectionActive() && ((ctx && !ctx->hl.empty()) || viewProvider->isFaceHighlightActive()) && Gui::SoDelayedAnnotationsElement::isProcessingDelayedPaths) { state->push(); diff --git a/src/Mod/Part/Gui/SoBrepFaceSet.cpp b/src/Mod/Part/Gui/SoBrepFaceSet.cpp index b1a006e03c..449bd9439a 100644 --- a/src/Mod/Part/Gui/SoBrepFaceSet.cpp +++ b/src/Mod/Part/Gui/SoBrepFaceSet.cpp @@ -533,7 +533,7 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action) selCounter.checkRenderCache(state); // for the tool add this node to delayed paths as we want to render it on top of the scene - if (Gui::Selection().isPickGeometryActive() && ctx && ctx->isHighlighted() + if (Gui::Selection().isClarifySelectionActive() && ctx && ctx->isHighlighted() && !ctx->isHighlightAll() && ctx->highlightIndex >= 0 && ctx->highlightIndex < partIndex.getNum()) { diff --git a/src/Mod/Part/Gui/SoBrepPointSet.cpp b/src/Mod/Part/Gui/SoBrepPointSet.cpp index 9dec883f45..bfb028e8c9 100644 --- a/src/Mod/Part/Gui/SoBrepPointSet.cpp +++ b/src/Mod/Part/Gui/SoBrepPointSet.cpp @@ -84,9 +84,9 @@ void SoBrepPointSet::GLRender(SoGLRenderAction *action) if(selContext2->checkGlobal(ctx)) ctx = selContext2; - // for pickgeometry, add this node to delayed path if it is highlighted and render it on + // for clarifyselection, add this node to delayed path if it is highlighted and render it on // top of everything else (highest priority) - if (Gui::Selection().isPickGeometryActive() && ctx && ctx->isHighlighted() + if (Gui::Selection().isClarifySelectionActive() && ctx && ctx->isHighlighted() && !ctx->isHighlightAll() && ctx->highlightIndex >= 0 && !Gui::SoDelayedAnnotationsElement::isProcessingDelayedPaths) { viewProvider->setFaceHighlightActive(true);