From: mpv Date: Thu, 14 Dec 2017 14:25:22 +0000 (+0300) Subject: Apply the history propagation also for the sketch results. X-Git-Tag: V_2.10.0RC~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=719c1fae8dd0e0b229b680e378bd01a3ad06e31c;p=modules%2Fshaper.git Apply the history propagation also for the sketch results. --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 5c35d4b9c..916e93328 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -864,36 +864,36 @@ void Model_AttributeSelection::selectSubShape( } } } - // try to find the latest active result that must be used instead of the selected - // to set the active context (like in GUI selection), not concealed one - bool aFindNewContext = true; - while(aFindNewContext && aCont.get() && aShapeToBeSelected.get()) { - aFindNewContext = false; - const std::set& aRefs = aCont->data()->refsToMe(); - std::set::const_iterator aRef = aRefs.begin(); - for(; !aFindNewContext && aRef != aRefs.end(); aRef++) { - if (!aRef->get() || !(*aRef)->owner().get()) - continue; - // concealed attribute only - FeaturePtr aRefFeat = std::dynamic_pointer_cast((*aRef)->owner()); - if (!ModelAPI_Session::get()->validators()->isConcealed( - aRefFeat->getKind(), (*aRef)->id())) + } + // try to find the latest active result that must be used instead of the selected + // to set the active context (like in GUI selection), not concealed one + bool aFindNewContext = true; + while(aFindNewContext && aCont.get() && aShapeToBeSelected.get()) { + aFindNewContext = false; + const std::set& aRefs = aCont->data()->refsToMe(); + std::set::const_iterator aRef = aRefs.begin(); + for(; !aFindNewContext && aRef != aRefs.end(); aRef++) { + if (!aRef->get() || !(*aRef)->owner().get()) + continue; + // concealed attribute only + FeaturePtr aRefFeat = std::dynamic_pointer_cast((*aRef)->owner()); + if (!ModelAPI_Session::get()->validators()->isConcealed( + aRefFeat->getKind(), (*aRef)->id())) + continue; + // search the feature result that contains sub-shape selected + std::list > aResults; + ModelAPI_Tools::allResults(aRefFeat, aResults); + std::list >::iterator aResIter = aResults.begin(); + for(; aResIter != aResults.end(); aResIter++) { + if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled()) continue; - // search the feature result that contains sub-shape selected - std::list > aResults; - ModelAPI_Tools::allResults(aRefFeat, aResults); - std::list >::iterator aResIter = aResults.begin(); - for(; aResIter != aResults.end(); aResIter++) { - if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled()) - continue; - GeomShapePtr aShape = (*aResIter)->shape(); - if (aShape.get() && aShape->isSubShape(aShapeToBeSelected, false)) { - aCont = *aResIter; // found new context (produced from this) with same subshape - //if (!aShape->isSubShape(aShapeToBeSelected, true)) // take context orientation - // aShapeToBeSelected->setOrientation(); - aFindNewContext = true; // continue searching futher - break; - } + GeomShapePtr aShape = (*aResIter)->shape(); + if (aShape.get() && aShape->isSubShape(aShapeToBeSelected, false)) { + aCont = *aResIter; // found new context (produced from this) with same subshape + //if (!aShape->isSubShape(aShapeToBeSelected, true)) // take context orientation + // aShapeToBeSelected->setOrientation(); + aFindNewContext = true; // continue searching futher + break; } } }