Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_FusionFaces.cpp
index 22e2d8383df9f6321bba22e74ec9e43ac1f0ebdd..d77104cc9840fd992829bf2fdf4c7e155c8437fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_FusionFaces.h"
@@ -26,6 +25,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_Tools.h>
 
 #include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_ShapeExplorer.h>
@@ -70,13 +70,10 @@ void FeaturesPlugin_FusionFaces::execute()
   // Store result
   GeomShapePtr aResultShape = anAlgo->shape();
   ResultBodyPtr aResultBody = document()->createBody(data());
-  if (aResultShape->isEqual(aBaseShape)) {
-    aResultBody->store(aResultShape);
-  } else {
-    aResultBody->storeModified(aBaseShape, aResultShape);
 
-    aResultBody->loadModifiedShapes(anAlgo, aBaseShape, GeomAPI_Shape::EDGE);
-    aResultBody->loadModifiedShapes(anAlgo, aBaseShape, GeomAPI_Shape::FACE);
-  }
+  ListOfShape aBaseShapesList;
+  aBaseShapesList.push_back(aBaseShape);
+  ModelAPI_Tools::loadModifiedShapes(aResultBody, aBaseShapesList, ListOfShape(),
+                                     anAlgo, aResultShape);
   setResult(aResultBody);
 }