]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #1202 : update the shape of the referenced plane
authormpv <mpv@opencascade.com>
Mon, 25 Jan 2016 11:12:47 +0000 (14:12 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:29 +0000 (17:04 +0300)
src/Model/Model_AttributeSelection.cpp

index 5a211a7525ce117fd401c2fc471041ed82820b94..3ba9a1c5035e9f5139d8bdebcf183a16fd8fbbf1 100644 (file)
@@ -416,6 +416,16 @@ bool Model_AttributeSelection::update()
       std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape);
       aShape->setImpl<TopoDS_Shape>(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<TopoDS_Shape>());
+      std::shared_ptr<Model_Document> aMyDoc = 
+        std::dynamic_pointer_cast<Model_Document>(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());
   }