X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_FilterValidated.cpp;h=88f16c6d8deb50eb9a9cf36c5b00d66ae77b1490;hb=42dfdea5422ab72d81c36155b4c6f352c85c1110;hp=28a43c3d7ee28b0d3bd7046a9817bff49ca87e82;hpb=a90ab0e7171b2dfab838fbc066c2f20217c49c03;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_FilterValidated.cpp b/src/ModuleBase/ModuleBase_FilterValidated.cpp index 28a43c3d7..88f16c6d8 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.cpp +++ b/src/ModuleBase/ModuleBase_FilterValidated.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// File: ModuleBase_FilterValidated.h +// File: ModuleBase_FilterValidated.cpp // Created: 17 Mar 2015 // Author: Natalia ERMOLAEVA @@ -19,17 +19,24 @@ IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter); Standard_Boolean ModuleBase_FilterValidated::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const { + bool aValid = true; ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation(); - if (!anOperation) - return true; - - ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel(); - ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget(); - ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast - (anActiveWidget); - ModuleBase_ViewerPrs aPrs; - myWorkshop->selection()->fillPresentation(aPrs, theOwner); - - return !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs); + if (anOperation) { + ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel(); + ModuleBase_ModelWidget* aCurrentWidget = aPanel->preselectionWidget(); + if (!aCurrentWidget) + aCurrentWidget = aPanel->activeWidget(); + ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast + (aCurrentWidget); + ModuleBase_ViewerPrs aPrs; + myWorkshop->selection()->fillPresentation(aPrs, theOwner); + + aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs); + } + +#ifdef DEBUG_FILTERS + qDebug(QString("ModuleBase_FilterValidated::IsOk = %1").arg(aValid).toStdString().c_str()); +#endif + return aValid; }