From 08cb40a14d5ea6d3d7adf236ed38a32c7cf1c653 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 30 May 2019 15:57:27 +0300 Subject: [PATCH] Exclude ViewCube from selection processing --- src/ModuleBase/ModuleBase_FilterValidated.cpp | 2 ++ src/XGUI/XGUI_Selection.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_FilterValidated.cpp b/src/ModuleBase/ModuleBase_FilterValidated.cpp index 3a4d58485..505bbe3d0 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.cpp +++ b/src/ModuleBase/ModuleBase_FilterValidated.cpp @@ -49,6 +49,8 @@ Standard_Boolean ModuleBase_FilterValidated:: if (aCurrentWidget) { ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs()); myWorkshop->selection()->fillPresentation(aPrs, theOwner); + if (aPrs->isEmpty()) + return false; ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast (aCurrentWidget); if (aWidgetValidated) diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index 64820f7cd..60fe5e30f 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -23,6 +23,10 @@ #include "XGUI_ViewerProxy.h" #include "XGUI_ObjectsBrowser.h" +#ifndef HAVE_SALOME +#include +#endif + #include "ModuleBase_BRepOwner.h" #include "ModuleBase_ResultPrs.h" #include "ModuleBase_ViewerPrs.h" @@ -196,9 +200,15 @@ void XGUI_Selection::getSelectedInBrowser(QList& thePre void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, const Handle(SelectMgr_EntityOwner)& theOwner) const { - thePrs->setOwner(theOwner); Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); +#ifndef HAVE_SALOME + Handle(AppElements_ViewCube) aCube = Handle(AppElements_ViewCube)::DownCast(anIO); + if (!aCube.IsNull()) + return; +#endif + + thePrs->setOwner(theOwner); thePrs->setInteractive(anIO); // we should not check the appearance of this feature because there can be some selected shapes -- 2.39.2