From: azv Date: Fri, 22 Apr 2016 06:30:02 +0000 (+0300) Subject: MPV changes according update mechanism to break infinite loop while creating SketchPl... X-Git-Tag: V_2.3.0~142 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ce4cfd7e9b3422c01ddf691a2cade687c5afd930;p=modules%2Fshaper.git MPV changes according update mechanism to break infinite loop while creating SketchPlugin_Projection --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index c8ca55d4b..93084549c 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -126,9 +126,11 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { const std::set >& aRefs = theFeature->data()->refsToMe(); std::set >::const_iterator aRefIter = aRefs.cbegin(); for(; aRefIter != aRefs.cend(); aRefIter++) { - FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRefIter)->owner()); - if (aReferenced.get()) { - addModified(aReferenced, theFeature); + if ((*aRefIter)->isArgument()) { + FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRefIter)->owner()); + if (aReferenced.get()) { + addModified(aReferenced, theFeature); + } } } // proccess also results @@ -139,9 +141,11 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { const std::set >& aRefs = (*aRes)->data()->refsToMe(); std::set >::const_iterator aRefIter = aRefs.cbegin(); for(; aRefIter != aRefs.cend(); aRefIter++) { - FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRefIter)->owner()); - if (aReferenced.get()) { - addModified(aReferenced, theFeature); + if ((*aRefIter)->isArgument()) { + FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRefIter)->owner()); + if (aReferenced.get()) { + addModified(aReferenced, theFeature); + } } } } @@ -404,18 +408,20 @@ bool Model_Update::processFeature(FeaturePtr theFeature) std::list > > >::iterator anAttrsIter = aDeps.begin(); for(; anAttrsIter != aDeps.end(); anAttrsIter++) { - std::list >::iterator aDepIter = anAttrsIter->second.begin(); - for(; aDepIter != anAttrsIter->second.end(); aDepIter++) { - FeaturePtr aDepFeat = std::dynamic_pointer_cast(*aDepIter); - if (!aDepFeat.get()) { // so, it depends on the result and process the feature owner of it - ResultPtr aDepRes = std::dynamic_pointer_cast(*aDepIter); - if (aDepRes.get()) { - aDepFeat = (*aDepIter)->document()->feature(aDepRes); + if (theFeature->attribute(anAttrsIter->first)->isArgument()) { + std::list >::iterator aDepIter = anAttrsIter->second.begin(); + for(; aDepIter != anAttrsIter->second.end(); aDepIter++) { + FeaturePtr aDepFeat = std::dynamic_pointer_cast(*aDepIter); + if (!aDepFeat.get()) { // so, it depends on the result and process the feature owner of it + ResultPtr aDepRes = std::dynamic_pointer_cast(*aDepIter); + if (aDepRes.get()) { + aDepFeat = (*aDepIter)->document()->feature(aDepRes); + } + } + if (aDepFeat.get()) { + if (processFeature(aDepFeat)) + aIsModified = true; } - } - if (aDepFeat.get()) { - if (processFeature(aDepFeat)) - aIsModified = true; } } }