- // Do check that we can use external feature
- if ((aSPFeature.get() != NULL) && aSPFeature->isExternal() && (!myExternalObjectMgr->useExternal()))
- return false;
-
- if (aSPFeature.get() == NULL && theShape.get() != NULL && !theShape->isNull() && myExternalObjectMgr->useExternal()) {
- aSelectedObject = myExternalObjectMgr->externalObject(theSelectedObject, theShape, sketch());
- } else {
- // Processing of sketch object
- if (theShape.get()) {
- setPointAttribute(theSelectedObject, theShape);
- return true;
+void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrs& 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_WidgetShapeSelector
+ if (aSPFeature.get() == NULL && myExternalObjectMgr->useExternal()) {
+ GeomShapePtr aShape = theShape;
+ if (!aShape.get()) {
+ ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
+ if (aResult.get())
+ aShape = aResult->shape();