-//********************************************************************
-bool PartSet_WidgetSubShapeSelector::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
-{
- bool aValid = ModuleBase_WidgetShapeSelector::isValidSelectionCustom(thePrs);
- if (aValid) {
- ObjectPtr anObject = myWorkshop->selection()->getResult(thePrs);
- aValid = myExternalObjectMgr->isValidObject(anObject);
- }
- return aValid;
-}
-
-void PartSet_WidgetSubShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr& thePrs,
- ObjectPtr& theObject,
- GeomShapePtr& theShape)
-{
- ModuleBase_WidgetShapeSelector::getGeomSelection(thePrs, theObject, theShape);
-
- FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theObject);
- std::shared_ptr<SketchPlugin_Feature> aSPFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aSelectedFeature);
- // there is no a sketch feature is selected, but the shape exists, try to create an exernal object
- // TODO: unite with the same functionality in PartSet_WidgetSubShapeSelector
- if (aSPFeature.get() == NULL) {
- ObjectPtr anExternalObject = ObjectPtr();
- if (myExternalObjectMgr->useExternal()) {
- GeomShapePtr aShape = theShape;
- if (!aShape.get()) {
- ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
- if (aResult.get())
- aShape = aResult->shape();
- }
- if (aShape.get() != NULL && !aShape->isNull())
- anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
- }
- /// the object is null if the selected feature is "external"(not sketch entity feature of the
- /// current sketch) and it is not created by object manager
- theObject = anExternalObject;
- }
-}
-
-//********************************************************************
-void PartSet_WidgetSubShapeSelector::restoreAttributeValue(const AttributePtr& theAttribute,
- const bool theValid)
-{
- ModuleBase_WidgetShapeSelector::restoreAttributeValue(theAttribute, theValid);
- myExternalObjectMgr->removeExternal(sketch(), myFeature, myWorkshop, true);
-}
-*/