Salome HOME
[bos #38090] [CEA] improve loadModifiedShapes deal with thousands of faces faster
[modules/shaper.git] / src / Model / Model_BodyBuilder.cpp
index d397d0a9b3f4176d8a862af9d6d89d1b81a4c46e..9a9fc1454bc590d2d3dafc32b93fd038a2a93fab 100644 (file)
@@ -626,7 +626,8 @@ void Model_BodyBuilder::loadModifiedShapes(const GeomMakeShapePtr& theAlgo,
 {
   GeomShapePtr aResultShape = shape();
   GeomShapePtr aShapeToExplore = theOldShape;
-  if (theAlgo->isNewShapesCollected(theOldShape, theShapeTypeToExplore)) {
+  bool isAlgoHistoryCollected = theAlgo->isNewShapesCollected(theOldShape, theShapeTypeToExplore);
+  if (isAlgoHistoryCollected) {
     // use optimized set of old shapes for this
     GeomShapePtr aCompound = theAlgo->oldShapesForNew(theOldShape,
                                                       aResultShape,
@@ -664,7 +665,12 @@ void Model_BodyBuilder::loadModifiedShapes(const GeomMakeShapePtr& theAlgo,
 
     // Get new shapes.
     ListOfShape aNewShapes;
-    theAlgo->modified(anOldSubShape, aNewShapes);
+    if (isAlgoHistoryCollected) {
+      theAlgo->modifiedCached(anOldSubShape, aNewShapes);
+    }
+    else {
+      theAlgo->modified(anOldSubShape, aNewShapes);
+    }
     for (ListOfShape::const_iterator aNewShapesIt = aNewShapes.cbegin();
          aNewShapesIt != aNewShapes.cend();
          ++aNewShapesIt)