}
//********************************************************************
-bool PartSet_WidgetShapeSelector::activateSelectionAndFilters(bool toActivate)
+void PartSet_WidgetShapeSelector::selectionFilters(QIntList& theModuleSelectionFilters,
+ SelectMgr_ListOfFilter& theSelectionFilters)
{
- bool aHasSelectionFilter = ModuleBase_WidgetShapeSelector::activateSelectionAndFilters
- (toActivate);
+ ModuleBase_WidgetShapeSelector::selectionFilters(theModuleSelectionFilters, theSelectionFilters);
+
if (!myUseSketchPlane) {
- XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
- PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(aWorkshop->module());
- bool isUsePlaneFilterOnly = !toActivate;
- aModule->sketchMgr()->activatePlaneFilter(isUsePlaneFilterOnly);
+ if (theModuleSelectionFilters.contains(SF_SketchPlaneFilter))
+ theModuleSelectionFilters.removeAll(SF_SketchPlaneFilter);
}
- return aHasSelectionFilter;
}
//********************************************************************
bool PartSet_WidgetShapeSelector::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
{
bool aValid = false;
- if (thePrs.get() && thePrs->interactive()->IsKind(STANDARD_TYPE(PartSet_CenterPrs)))
+ if (thePrs.get() && thePrs->interactive().get() &&
+ thePrs->interactive()->IsKind(STANDARD_TYPE(PartSet_CenterPrs)))
aValid = true; // we should not check acceptSubShape for such presentation
else
aValid = ModuleBase_WidgetShapeSelector::isValidSelectionCustom(thePrs);