Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / Model / Model_ResultBody.cpp
index cfc9ff6e306d1b28ba1b12614e4def24dca8e0ac..8b736b3390be79340d546aceab0e8125992e375c 100644 (file)
@@ -52,20 +52,24 @@ Model_ResultBody::~Model_ResultBody()
   delete myBuilder;
 }
 
-void Model_ResultBody::generated(const GeomShapePtr& theNewShape,
-                                 const std::string& theName)
+bool Model_ResultBody::generated(const GeomShapePtr& theNewShape,
+  const std::string& theName, const bool theCheckIsInResult)
 {
+  bool aResult = false;
   if (mySubs.size()) { // consists of subs
     for (std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
          aSubIter != mySubs.cend();
          ++aSubIter)
     {
       const ResultBodyPtr& aSub = *aSubIter;
-      aSub->generated(theNewShape, theName);
+      if (aSub->generated(theNewShape, theName, theCheckIsInResult))
+        aResult = true;
     }
   } else { // do for this directly
-    myBuilder->generated(theNewShape, theName);
+    if (myBuilder->generated(theNewShape, theName, theCheckIsInResult))
+      aResult = true;
   }
+  return aResult;
 }
 
 void Model_ResultBody::loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,