From 9984db2a4e3a51bf7bbed06bf243db6cdb61e978 Mon Sep 17 00:00:00 2001 From: mbs Date: Tue, 4 Apr 2023 17:13:19 +0100 Subject: [PATCH] allow to use view cube during feature creation --- src/ModuleBase/ModuleBase_FilterValidated.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) -- 2.39.2