Salome HOME
Change tooltip.
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Fillet.cpp
index 0df54c18949b68ce1e28861c372e3c8cd290f4c4..8b0fdab8130349a2b35a6160557a2a2124f6565f 100644 (file)
@@ -25,7 +25,6 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
-#include <ModelAPI_ResultCompSolid.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_Validator.h>
@@ -113,8 +112,16 @@ void FeaturesPlugin_Fillet::execute()
       return;
 
     ResultPtr aContext = anObjectAttr->context();
-    ResultCompSolidPtr aCtxOwner = ModelAPI_Tools::compSolidOwner(aContext);
-    GeomShapePtr aParent = aCtxOwner ? aCtxOwner->shape() : aContext->shape();
+    GeomShapePtr aParent;
+    if (aContext.get()) {
+      ResultBodyPtr aCtxOwner = ModelAPI_Tools::bodyOwner(aContext);
+      aParent = aCtxOwner ? aCtxOwner->shape() : aContext->shape();
+    } else { // get it from a feature
+      FeaturePtr aFeature = anObjectAttr->contextFeature();
+      if (aFeature.get()) {
+        aParent = aFeature->firstResult()->shape();
+      }
+    }
     if (!aParent)
       return;
 
@@ -208,7 +215,6 @@ void FeaturesPlugin_Fillet::loadNamingDS(
   const int aSubsolidsTag = 4;
 
   theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
-  theResultBody->storeGenerated(theBaseShape, theResultShape);
 
   const std::string aModFaceName = "Modified_Face";
   const std::string aFilletFaceName = "Fillet_Face";