]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
allow to use view cube during feature creation mbs/viewcube
authormbs <martin.bernhard@opencascade.com>
Tue, 4 Apr 2023 16:13:19 +0000 (17:13 +0100)
committermbs <martin.bernhard@opencascade.com>
Tue, 4 Apr 2023 16:13:19 +0000 (17:13 +0100)
src/ModuleBase/ModuleBase_FilterValidated.cpp

index 81142e7b36d2207b636beeed11e1000bb85f0cb6..d68658976ccbc5811e0abf05c2908b7e3f658eb0 100644 (file)
@@ -30,6 +30,8 @@
 #include <ModuleBase_ViewerPrs.h>
 #include <ModuleBase_Tools.h>
 
+#include <AIS_ViewCube.hxx>
+
 IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter);
 
 Standard_Boolean ModuleBase_FilterValidated::
@@ -53,8 +55,17 @@ Standard_Boolean ModuleBase_FilterValidated::
           return false;
         ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
                                                                                (aCurrentWidget);
-        if (aWidgetValidated)
+        if (aWidgetValidated) {
           aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
+          if (!aValid && theOwner->HasSelectable()) {
+            // Validate the current widget filters, if the user has picked the navigation cube.
+            // We want to allow the usage of it during feature creation/edition.
+            Handle(SelectMgr_SelectableObject) aSelObj = theOwner->Selectable();
+            Handle(Standard_Type) aType = aSelObj->DynamicType();
+            if (aType == STANDARD_TYPE(AIS_ViewCube))
+              aValid = true;
+          }
+        }
         else{
           ModuleBase_WidgetValidator* aWidgetValidator = aCurrentWidget->widgetValidator();
           if (aWidgetValidator)