#include <ModuleBase_ISelection.h>
#include <ModuleBase_Operation.h>
#include <ModuleBase_WidgetValidated.h>
+#include <ModuleBase_WidgetValidator.h>
#include <ModuleBase_ViewerPrs.h>
IMPLEMENT_STANDARD_HANDLE(ModuleBase_FilterValidated, SelectMgr_Filter);
ModuleBase_ModelWidget* aCurrentWidget = aPanel->preselectionWidget();
if (!aCurrentWidget)
aCurrentWidget = myWorkshop->module()->activeWidget();
- ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
- (aCurrentWidget);
- ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
- myWorkshop->selection()->fillPresentation(aPrs, theOwner);
-
- aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
+ if (aCurrentWidget) {
+ ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
+ myWorkshop->selection()->fillPresentation(aPrs, theOwner);
+ ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
+ (aCurrentWidget);
+ if (aWidgetValidated)
+ aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
+ else{
+ ModuleBase_WidgetValidator* aWidgetValidator = aCurrentWidget->widgetValidator();
+ if (aWidgetValidator)
+ aValid = aWidgetValidator->isValidSelection(aPrs);
+ }
+ }
}
#ifdef DEBUG_FILTERS