From 20276324c05b036014c2a0e288bb2e5011143376 Mon Sep 17 00:00:00 2001 From: tritao Date: Mon, 13 Jan 2025 23:13:31 +0000 Subject: [PATCH] Gui: Cleanup `SoFCUnifiedSelection::handleEvent`. --- src/Gui/Selection/SoFCUnifiedSelection.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Gui/Selection/SoFCUnifiedSelection.cpp b/src/Gui/Selection/SoFCUnifiedSelection.cpp index 0fd85e0ef1..d406ef93b1 100644 --- a/src/Gui/Selection/SoFCUnifiedSelection.cpp +++ b/src/Gui/Selection/SoFCUnifiedSelection.cpp @@ -734,27 +734,18 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) return; } - auto mymode = static_cast(this->highlightMode.getValue()); + auto highlightMode = static_cast(this->highlightMode.getValue()); const SoEvent * event = action->getEvent(); - // If we don't need to pick for locate highlighting, - // then just behave as separator and return. - // NOTE: we still have to pick for ON even though we don't have - // to re-render, because the app needs to be notified as the mouse - // goes over locate highlight nodes. - //if (highlightMode.getValue() == OFF) { - // inherited::handleEvent( action ); - // return; - //} - // // If this is a mouseMotion event, then check for locate highlighting // - if (event->isOfType(SoLocation2Event::getClassTypeId())) { + bool isMouseMotionEvent = event->isOfType(SoLocation2Event::getClassTypeId()); + if (isMouseMotionEvent) { // NOTE: If preselection is off then we do not check for a picked point because otherwise this search may slow // down extremely the system on really big data sets. In this case we just check for a picked point if the data // set has been selected. - if (mymode == AUTO || mymode == ON) { + if (highlightMode == AUTO || highlightMode == ON) { // check to see if the mouse is over our geometry... auto infos = this->getPickedList(action,true); if(!infos.empty())