Salome HOME
Exclude ViewCube from selection processing
authorvsv <vsv@opencascade.com>
Thu, 30 May 2019 12:57:27 +0000 (15:57 +0300)
committervsv <vsv@opencascade.com>
Thu, 30 May 2019 12:57:27 +0000 (15:57 +0300)
src/ModuleBase/ModuleBase_FilterValidated.cpp
src/XGUI/XGUI_Selection.cpp

index 3a4d58485de7bec23192b5ea4ebd0be2ebb48d0f..505bbe3d07fc6f5dac796ba0d35517ba3d097746 100644 (file)
@@ -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<ModuleBase_WidgetValidated*>
                                                                                (aCurrentWidget);
         if (aWidgetValidated)
index 64820f7cd3612094d4a357f62c79524f3e98193b..60fe5e30f296d254f0d42ec2b75136524b02b07e 100644 (file)
 #include "XGUI_ViewerProxy.h"
 #include "XGUI_ObjectsBrowser.h"
 
+#ifndef HAVE_SALOME
+#include <AppElements_ViewCube.h>
+#endif
+
 #include "ModuleBase_BRepOwner.h"
 #include "ModuleBase_ResultPrs.h"
 #include "ModuleBase_ViewerPrs.h"
@@ -196,9 +200,15 @@ void XGUI_Selection::getSelectedInBrowser(QList<ModuleBase_ViewerPrsPtr>& 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