-
-//********************************************************************
-bool ModuleBase_WidgetShapeSelector::isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs)
-{
- GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs);
- bool aValid;
- // if there is no selected shape, the method returns true
- if (!aShape.get())
- aValid = true;
- else {
- // Check that the selection corresponds to selection type
- TopoDS_Shape aTopoShape = aShape->impl<TopoDS_Shape>();
- aValid = acceptSubShape(aTopoShape);
- }
- if (aValid) {
- // In order to avoid selection of the same object
- ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
- FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(aResult);
- aValid = aSelectedFeature != myFeature;
- }
- return aValid;
-}
-
-//********************************************************************
-bool ModuleBase_WidgetShapeSelector::setSelectionCustom(const ModuleBase_ViewerPrs& thePrs)
-{
- ObjectPtr anObject;
- GeomShapePtr aShape;
- getGeomSelection(thePrs, anObject, aShape);
-
- setObject(anObject, aShape);
- return true;
-}
-
-//********************************************************************
-void ModuleBase_WidgetShapeSelector::deactivate()
-{
- activateSelection(false);
- activateFilters(myWorkshop, false);
- disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
-}