From d15257bb6211be57401bfd9894e24c738037c07a Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 30 Nov 2018 16:18:15 +0300 Subject: [PATCH] Fix for slow-down of features creation on many Exctrusion-Cut features referenced to each other. --- src/Model/Model_Document.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 0f9fbcea5..7d0feab8b 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1613,14 +1613,21 @@ bool Model_Document::isLaterByDep(FeaturePtr theThis, FeaturePtr theOther) { if (aRefFeat.get()) { if (aRefFeat == theThis) return false; // other references to this, so other later than this - if (std::dynamic_pointer_cast(aRefFeat)) { - if (!isLaterByDep(theThis, aRefFeat)) // nested composites: recursion - return false; - } + //if (std::dynamic_pointer_cast(aRefFeat)) { + // if (!isLaterByDep(theThis, aRefFeat)) // nested composites: recursion + // return false; + //} } } } } + FeaturePtr aThisOwner = ModelAPI_Tools::compositeOwner(theThis); + if (aThisOwner.get()) { + if (aThisOwner == theOther) + return true; // composite owner is later that its sub + if (!isLaterByDep(aThisOwner, theOther)) + return false; + } return myObjs->isLater(theThis, theOther); } -- 2.39.2