const Config_WidgetAPI* theData,
const std::string& theParentId)
: ModuleBase_ModelWidget(theParent, theData, theParentId),
- myWorkshop(theWorkshop)
+ myWorkshop(theWorkshop), myIsInValidate(false)
{
}
return myPresentedObject;
}
+//********************************************************************
+void ModuleBase_WidgetValidated::storeAttributeValue()
+{
+ myIsInValidate = true;
+}
+
+//********************************************************************
+void ModuleBase_WidgetValidated::restoreAttributeValue(const bool theValid)
+{
+ myIsInValidate = false;
+}
+
//********************************************************************
bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrs& thePrs)
{
if (!isActivated)
activateFilters(true);
- const SelectMgr_ListOfFilter& aFilters = myWorkshop->viewer()->AISContext()->Filters();
- SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
- for (; anIt.More() && aValid; anIt.Next()) {
- Handle(SelectMgr_Filter) aFilter = anIt.Value();
- aValid = aFilter->IsOk(anOwner);
+ Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (!aContext.IsNull()) {
+ const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
+ SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
+ for (; anIt.More() && aValid; anIt.Next()) {
+ Handle(SelectMgr_Filter) aFilter = anIt.Value();
+ aValid = aFilter->IsOk(anOwner);
+ }
}
if (!isActivated)
activateFilters(false);