From: mpv Date: Thu, 7 May 2020 07:22:27 +0000 (+0300) Subject: Stabilize the fix for the issue #19039 Can't select solids to create a compound X-Git-Tag: V9_5_0b1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=55e4cb688a3421cd7474cec2ed0da69a2e782e1e;p=modules%2Fshaper.git Stabilize the fix for the issue #19039 Can't select solids to create a compound and the issue #19019 Python dump not loadable --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index e5a333e35..f3b094d6c 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -2032,6 +2032,7 @@ ResultPtr Model_AttributeSelection::newestContext( if (allRes.empty()) allRes.push_back(aResult); + bool aFoundReferernce = false; for (std::list::iterator aSub = allRes.begin(); aSub != allRes.end(); aSub++) { ResultPtr aResCont = *aSub; ResultBodyPtr aResBody = std::dynamic_pointer_cast(aResCont); @@ -2065,6 +2066,7 @@ ResultPtr Model_AttributeSelection::newestContext( for (; aResIter != aResults.end(); aResIter++) { if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled()) continue; + aFoundReferernce = true; GeomShapePtr aShape = (*aResIter)->shape(); if (aShape.get() && aShape->isSubShape(aSelectedShape, false)) { aResult = *aResIter; // found new context (produced from this) with same subshape @@ -2072,12 +2074,13 @@ ResultPtr Model_AttributeSelection::newestContext( break; } } - if (!aFindNewContext && !aResults.empty()) { - // #19019 : result is concealed by object that contains no such sub-shape - return theCurrent; - } } } + if (aFoundReferernce && !aFindNewContext && + aResult->groupName() != ModelAPI_ResultConstruction::group()) { + // #19019 : result is concealed by object that contains no such sub-shape + return theCurrent; + } } // if compsolid is context, try to take sub-solid as context: like in GUI and scripts ResultBodyPtr aComp = std::dynamic_pointer_cast(aResult);