From d27177cb4cba8931208fd57fb2617f39aaf15bbf Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 17 Sep 2015 13:51:28 +0300 Subject: [PATCH] Fix for generation of ExtrusionSketch preview while the nested sketch element is modified. --- src/Model/Model_Update.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 417a3de14..a9e917215 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -278,8 +278,13 @@ void Model_Update::updateFeature(FeaturePtr theFeature) return; // do not execute the composite that contains the current - //CompositeFeaturePtr aMain = std::dynamic_pointer_cast(theFeature); - //bool isPostponedMain = aMain.get() && aMain->isSub(theFeature->document()->currentFeature(false)); + bool isPostponedMain = false; + CompositeFeaturePtr aMain = std::dynamic_pointer_cast(theFeature); + if (theFeature->getKind() == "ExtrusionSketch" && aMain.get()) { + CompositeFeaturePtr aCurrentOwner = + ModelAPI_Tools::compositeOwner(theFeature->document()->currentFeature(false)); + isPostponedMain = aCurrentOwner.get() && aMain->isSub(aCurrentOwner); + } #ifdef DEB_UPDATE std::cout<<"Update Feature "<name()<data()->execState(); if (aFactory->validate(theFeature)) { - //if (!isPostponedMain) { + if (!isPostponedMain) { #ifdef DEB_UPDATE std::cout<<"Execute Feature "<name()<name()<