Salome HOME
Fix for issue #2545: Radius is not calculated on arc
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_CompositeBoolean.cpp
index ebc6420e776c57e55bf0922a96283d9510731653..f54449b36ed98d0e6939561bcfea1eebfab2ef8f 100644 (file)
@@ -78,20 +78,27 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean()
     int aTag = 1;
 
     ResultBodyPtr aResultBody = myFeature->document()->createBody(myFeature->data(), aResultIndex);
-    aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape(), aTag);
 
-    aTag += 5000;
-
-    // Store generation history.
-    ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
-    ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
-    for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
-        ++aGenBaseIt, ++aGenMSIt) {
-      storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt, aTag);
+    if((*aBoolObjIt)->isEqual((*aBoolMSIt)->shape())) {
+      aResultBody->store((*aBoolMSIt)->shape(), false);
     }
+    else
+    {
+      aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape(), aTag);
+
+      aTag += 5000;
+
+      // Store generation history.
+      ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
+      ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
+      for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
+          ++aGenBaseIt, ++aGenMSIt) {
+        storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt, aTag);
+      }
 
-    int aModTag = aTag;
-    storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt, aModTag);
+      int aModTag = aTag;
+      storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt, aModTag);
+    }
 
     myFeature->setResult(aResultBody, aResultIndex++);
   }
@@ -389,7 +396,7 @@ void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr the
     }
     theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt,
       (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
-      GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get());
+      GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get(), false, false, true);
     theResultBody->loadDeletedShapes(theMakeShape.get(), *anIt, GeomAPI_Shape::FACE, aDelTag);
   }
 }