From: mpv Date: Wed, 24 Oct 2018 07:12:43 +0000 (+0300) Subject: Support of selection of the whole part result in naming names X-Git-Tag: End2018~276 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1b0f26b4c1d0fd11abbf46d02d46c5a4c245196f;p=modules%2Fshaper.git Support of selection of the whole part result in naming names --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index d30830cc0..0e95d42a5 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -876,6 +876,18 @@ std::string Model_AttributeSelection::namingName(const std::string& theDefaultNa return contextName(aCont); } + // if it is in result of another part + if (aCont->groupName() == ModelAPI_ResultPart::group()) { + ResultPartPtr aPart = std::dynamic_pointer_cast(aCont); + int anIndex; + GeomShapePtr aValue = value(); + if (aValue.get()) + return aPart->data()->name() + "/" + aPart->nameInPart(aValue, anIndex); + else + return aPart->data()->name(); + } + + // whole infinitive construction if (aCont->groupName() == ModelAPI_ResultConstruction::group()) { ResultConstructionPtr aConstr = std::dynamic_pointer_cast(aCont); @@ -971,6 +983,10 @@ void Model_AttributeSelection::selectSubShape( ResultPartPtr aPart = std::dynamic_pointer_cast(aFound); aDoc = std::dynamic_pointer_cast(aPart->partDoc()); aSubShapeName = aSubShapeName.substr(aPartEnd +1); + if (aSubShapeName.empty()) { // the whole Part result + setValue(aPart, anEmptyShape); + return; + } } } }