From 2fbe8125820a68dc99915086b03843f037ae22b6 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 29 May 2015 17:37:39 +0300 Subject: [PATCH] Fix the naming issues of Extrusion created on sketch: sketch result was updated too often that made extrusion naming references invalid --- src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp | 2 +- src/Model/Model_Update.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index b5250e8c3..1decb449c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -181,7 +181,7 @@ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Prism& theFeature, if(theBasis->isEqual(theContext)) theResultBody->store(theFeature.shape()); else - theResultBody->storeGenerated(theContext, theFeature.shape()); + theResultBody->storeGenerated(theBasis, theFeature.shape()); GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape(); theFeature.mapOfShapes(*aSubShapes); diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index ffbb7de24..d3cc6c9c1 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -402,10 +402,13 @@ void Model_Update::updateFeature(FeaturePtr theFeature) for(; aRef != aRefs.end(); aRef++) { std::list::iterator aRefObj = aRef->second.begin(); for(; aRefObj != aRef->second.end(); aRefObj++) { - // if reference is null, it may bmean that this reference is to other document + // if reference is null, it may mean that this reference is to other document // the does not supported by RefList: peremeters may be recomputed - if (!aRefObj->get() || myJustCreated.find(*aRefObj) != myJustCreated.end() || - myJustUpdated.find(*aRefObj) != myJustUpdated.end()) { + if (!aRefObj->get() && theFeature->firstResult().get() && + theFeature->firstResult()->groupName() == ModelAPI_ResultParameter::group()) { + aJustUpdated = true; + } else if (myJustCreated.find(*aRefObj) != myJustCreated.end() || + myJustUpdated.find(*aRefObj) != myJustUpdated.end()) { aJustUpdated = true; } aState = stateByReference(*aRefObj, aState); -- 2.39.2