From 0463dc1bd2640d4efa518e841471a100ffa8da66 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 24 Oct 2018 10:12:43 +0300 Subject: [PATCH] Support of selection of the whole part result in naming names --- src/Model/Model_AttributeSelection.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; + } } } } -- 2.39.2