Salome HOME
updated copyright message
[modules/shaper.git] / src / PartSet / PartSet_Filters.cpp
index c335ea9324fce8462dac1885107c1005cce0a357..18c92c3c0bf2418e1d47b4733781b1dbaa54f969 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -31,6 +31,8 @@
 
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_Shape.hxx>
+#include <AIS_Trihedron.hxx>
+#include <AIS_ViewCube.hxx>
 #include <StdSelect_BRepOwner.hxx>
 
 
@@ -59,9 +61,19 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
   ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation();
 
 #ifdef HAVE_SALOME
-  // Issue #3161: Do not use presentations for non-SHAPER objects
-  if (!anOperation && !aObj.get())
-    return false;
+  if (!aObj.get()) {
+    // Workaround to enable View Cube and Trihedron selection
+    if (!aAisObj.IsNull()) {
+      if (aAisObj->IsKind(STANDARD_TYPE(AIS_Trihedron)) ||
+          aAisObj->IsKind(STANDARD_TYPE(AIS_ViewCube))) {
+        return true;
+      }
+    }
+
+    // Issue #3161: Do not use presentations for non-SHAPER objects
+    if (!anOperation)
+      return false;
+  }
 #endif
 
   // the shapes from different documents should be provided if there is no started operation