]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesAPI/FeaturesAPI_Fillet.cpp
Salome HOME
Task 3.2. To keep compounds’ sub-shapes for all operations (issue #3139)
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Fillet.cpp
index 914db27e7a2f2b49f4009988d570841cb413247c..d84e0017540195506e9f04f2f325d9817a6d0334 100644 (file)
@@ -112,6 +112,9 @@ void FeaturesAPI_Fillet::dump(ModelHighAPI_Dumper& theDumper) const
     theDumper << ", " << anAttrRadius1 << ", " << anAttrRadius2;
   }
 
+  if (!aBase->data()->version().empty())
+    theDumper << ", keepSubResults = True";
+
   theDumper << ")" << std::endl;
 }
 
@@ -124,19 +127,20 @@ void FeaturesAPI_Fillet::execIfBaseNotEmpty()
 
 //==================================================================================================
 
-FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
-                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                    const ModelHighAPI_Double& theRadius)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Fillet::ID());
-  return FilletPtr(new FeaturesAPI_Fillet(aFeature, theBaseObjects, theRadius));
-}
-
 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
                     const ModelHighAPI_Double& theRadius1,
-                    const ModelHighAPI_Double& theRadius2)
+                    const ModelHighAPI_Double& theRadius2,
+                    const bool keepSubResults)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Fillet::ID());
-  return FilletPtr(new FeaturesAPI_Fillet(aFeature, theBaseObjects, theRadius1, theRadius2));
+  if (!keepSubResults)
+    aFeature->data()->setVersion("");
+
+  FilletPtr aFillet;
+  if (theRadius2.value() < 0.0)
+    aFillet.reset(new FeaturesAPI_Fillet(aFeature, theBaseObjects, theRadius1));
+  else
+    aFillet.reset(new FeaturesAPI_Fillet(aFeature, theBaseObjects, theRadius1, theRadius2));
+  return aFillet;
 }