- myExternalObjectMgr->removeExternalValidated(sketch(), myFeature);
-}
-
-//********************************************************************
-bool PartSet_WidgetMultiSelector::setSelectionCustom(const ModuleBase_ViewerPrs& thePrs)
-{
- TopoDS_Shape aShape = thePrs.shape();
- if (!acceptSubShape(aShape))
- return false;
-
- ResultPtr aResult;
- if (!thePrs.owner().IsNull()) {
- ObjectPtr anObject = myWorkshop->selection()->getSelectableObject(thePrs.owner());
- aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
- }
- else {
- aResult = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs.object());
- }
-
-
- if (myFeature) {
- // We can not select a result of our feature
- const std::list<ResultPtr>& aResList = myFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- bool isSkipSelf = false;
- for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) {
- if ((*aIt) == aResult) {
- isSkipSelf = true;
- break;
- }
- }
- if(isSkipSelf)
- return false;
- }
-
- GeomShapePtr aGShape = GeomShapePtr();
- const TopoDS_Shape& aTDSShape = thePrs.shape();
- // if only result is selected, an empty shape is set to the model
- if (aTDSShape.IsNull()) {
- //aSelectionListAttr->append(aResult, GeomShapePtr());
- }
- else {
- aGShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
- //GeomShapePtr aShape(new GeomAPI_Shape());
- aGShape->setImpl(new TopoDS_Shape(aTDSShape));
- // We can not select a result of our feature
- if (aGShape->isEqual(aResult->shape())) {
- //aSelectionListAttr->append(aResult, GeomShapePtr());
- aGShape = GeomShapePtr();
- }
- else {
- //aSelectionListAttr->append(aResult, aShape);
- }
- }
-
- setObject(aResult, aGShape);
- return true;