]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make the partition selection of plane correctly named, since it is used in the later...
authormpv <mpv@opencascade.com>
Thu, 3 Sep 2015 11:14:32 +0000 (14:14 +0300)
committermpv <mpv@opencascade.com>
Thu, 3 Sep 2015 11:14:32 +0000 (14:14 +0300)
src/Model/Model_AttributeSelection.cpp

index 4fcb26fae33236e9d6918f2e7f192b8a4d6a20a3..b900b181941109b69a79b1878debe87ebb12eff0 100644 (file)
@@ -135,6 +135,15 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext,
       // to sub, so the whole result is selected
       aSelLab.ForgetAllAttributes(true);
       TDataStd_UAttribute::Set(aSelLab, kCONSTUCTION_SIMPLE_REF_ID);
+      // 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(theContext->shape()->impl<TopoDS_Shape>());
+      std::shared_ptr<Model_Document> aMyDoc = 
+        std::dynamic_pointer_cast<Model_Document>(owner()->document());
+      std::string aName = theContext->data()->name();
+      aMyDoc->addNamingName(aSelLab, aName);
+      TDataStd_Name::Set(aSelLab, aName.c_str());
     } else {
       selectConstruction(theContext, theSubShape);
     }