Salome HOME
Fix for the robinet model with partitions: final groups selection with neighbors...
[modules/shaper.git] / src / Model / Model_ResultBody.cpp
index 8f8c218bb0bbc22529f54ddf102bd352c96c2066..4acd17d8fa0a3732d69c6da75779ca9ee9aea54a 100644 (file)
@@ -272,8 +272,8 @@ void Model_ResultBody::updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisS
         aSub = mySubs[aSubIndex];
       }
       GeomShapePtr anOldSubShape = aSub->shape();
-      aSub->store(aShape, false); // store even equal to call "clear": #2814
       if (!aShape->isEqual(anOldSubShape)) {
+        aSub->store(aShape, false);
         aECreator->sendUpdated(aSub, EVENT_DISP);
         aECreator->sendUpdated(aSub, EVENT_UPD);
       }
@@ -294,6 +294,7 @@ void Model_ResultBody::updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisS
       // redisplay this because result with and without subs are displayed differently
       aECreator->sendUpdated(data()->owner(), EVENT_DISP);
     }
+    cleanCash();
   } else if (!mySubs.empty()) { // erase all subs
     while(!mySubs.empty()) {
       ResultBodyPtr anErased = *(mySubs.rbegin());
@@ -327,3 +328,14 @@ bool Model_ResultBody::isConnectedTopology()
   }
   return false; // invalid case
 }
+
+void Model_ResultBody::cleanCash()
+{
+  myBuilder->cleanCash();
+  for (std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
+    aSubIter != mySubs.cend(); ++aSubIter)
+  {
+    const ResultBodyPtr& aSub = *aSubIter;
+    aSub->cleanCash();
+  }
+}