From: mbs Date: Tue, 4 Apr 2023 16:13:19 +0000 (+0100) Subject: allow to use view cube during feature creation X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmbs%2Fviewcube;p=modules%2Fshaper.git allow to use view cube during feature creation --- diff --git a/src/ModuleBase/ModuleBase_FilterValidated.cpp b/src/ModuleBase/ModuleBase_FilterValidated.cpp index 81142e7b3..d68658976 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.cpp +++ b/src/ModuleBase/ModuleBase_FilterValidated.cpp @@ -30,6 +30,8 @@ #include #include +#include + 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 (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)