Salome HOME
Copyright update 2022
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultBody.cpp
index 96507db5743de1a1db4b9637767f94d5f9336e80..321733a37d0228af4492c59630f2eb4becfb8024 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // 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 "ModelAPI_ResultBody.h"
@@ -67,6 +66,21 @@ void ModelAPI_ResultBody::storeGenerated(const GeomShapePtr& theFromShape,
   updateSubs(theToShape);
 }
 
+void ModelAPI_ResultBody::storeGenerated(
+  const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+{
+  myBuilder->storeGenerated(theFromShapes, theToShape, theMakeShape);
+  myConnect = ConnectionNotComputed;
+
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theToShape, theFromShapes, theMakeShape, true);
+}
+
 void ModelAPI_ResultBody::storeModified(const GeomShapePtr& theOldShape,
                                         const GeomShapePtr& theNewShape,
                                         const bool theIsCleanStored)
@@ -82,15 +96,19 @@ void ModelAPI_ResultBody::storeModified(const GeomShapePtr& theOldShape,
   updateSubs(theNewShape);
 }
 
-void ModelAPI_ResultBody::storeWithoutNaming(const GeomShapePtr& theShape)
+void ModelAPI_ResultBody::storeModified(
+  const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  myBuilder->storeWithoutNaming(theShape);
+  myBuilder->storeModified(theOldShapes, theNewShape, theMakeShape);
   myConnect = ConnectionNotComputed;
 
   static Events_Loop* aLoop = Events_Loop::loop();
   static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
   static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
   aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theNewShape, theOldShapes, theMakeShape, false);
 }
 
 GeomShapePtr ModelAPI_ResultBody::shape()
@@ -98,12 +116,6 @@ GeomShapePtr ModelAPI_ResultBody::shape()
   return myBuilder->shape();
 }
 
-bool ModelAPI_ResultBody::generated(const GeomShapePtr& theNewShape,
-  const std::string& theName, const bool theCheckIsInResult)
-{
-  return myBuilder->generated(theNewShape, theName, theCheckIsInResult);
-}
-
 void ModelAPI_ResultBody::generated(const GeomShapePtr& theOldShape,
                                     const GeomShapePtr& theNewShape,
                                     const std::string& theName)
@@ -119,11 +131,6 @@ void ModelAPI_ResultBody::modified(const GeomShapePtr& theOldShape,
 }
 
 
-void ModelAPI_ResultBody::deleted(const GeomShapePtr& theOldShape)
-{
-  myBuilder->deleted(theOldShape);
-}
-
 void ModelAPI_ResultBody::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
                                             const GeomShapePtr& theOldShape,
                                             const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
@@ -132,40 +139,7 @@ void ModelAPI_ResultBody::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
   myBuilder->loadDeletedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theShapesToExclude);
 }
 
-void ModelAPI_ResultBody::loadModifiedShapes(const GeomMakeShapePtr& theAlgo,
-                                             const GeomShapePtr& theOldShape,
-                                             const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                             const std::string& theName)
-{
-  myBuilder->loadModifiedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theName);
-}
-
-void ModelAPI_ResultBody::loadGeneratedShapes(const GeomMakeShapePtr& theAlgo,
-                                              const GeomShapePtr& theOldShape,
-                                              const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                              const std::string& theName)
-{
-  myBuilder->loadGeneratedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theName);
-}
-
-void ModelAPI_ResultBody::loadFirstLevel(GeomShapePtr theShape,
-                                         const std::string& theName)
-{
-  myBuilder->loadFirstLevel(theShape, theName);
-}
-
-void ModelAPI_ResultBody::loadDisconnectedEdges(GeomShapePtr theShape,
-                                                const std::string& theName)
-{
-  myBuilder->loadDisconnectedEdges(theShape, theName);
-}
-
-void ModelAPI_ResultBody::loadDisconnectedVertexes(GeomShapePtr theShape,
-                                                   const std::string& theName)
-{
-  myBuilder->loadDisconnectedVertexes(theShape, theName);
-}
-
+// LCOV_EXCL_START
 bool ModelAPI_ResultBody::isConnectedTopology()
 {
   if (myConnect == ConnectionNotComputed) {
@@ -180,3 +154,4 @@ void ModelAPI_ResultBody::setDisplayed(const bool theDisplay)
   for (int i = 0; i < numberOfSubs(); i++)
     subResult(i)->setDisplayed(theDisplay);
 }
+// LCOV_EXCL_STOP