From 46a35c319e62aeb3832b24769278aa33e8246861 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 25 Jan 2016 14:12:47 +0300 Subject: [PATCH] Fix for the issue #1202 : update the shape of the referenced plane --- src/Model/Model_AttributeSelection.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 5a211a752..3ba9a1c50 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -416,6 +416,16 @@ bool Model_AttributeSelection::update() std::shared_ptr aShape(new GeomAPI_Shape); aShape->setImpl(new TopoDS_Shape(aComp)); selectConstruction(aContext, aShape); + } else { + // For correct naming selection, put the shape into the naming structure. + // It seems sub-shapes are not needed: only this shape is (and can be ) selected. + TNaming_Builder aBuilder(aSelLab); + aBuilder.Generated(aContext->shape()->impl()); + std::shared_ptr aMyDoc = + std::dynamic_pointer_cast(owner()->document()); + std::string aName = aContext->data()->name(); + aMyDoc->addNamingName(aSelLab, aName); + TDataStd_Name::Set(aSelLab, aName.c_str()); } return setInvalidIfFalse(aSelLab, aContext->shape() && !aContext->shape()->isNull()); } -- 2.39.2