X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultConstruction.cpp;h=b60c6f01263dd644228cf557111a6713a4661edf;hb=b91d2ac3b9986005d94823a3c502c8a7ff5ec7db;hp=07fa238251502f6308d940b1e95480870936a680;hpb=2e60d80d7d0b998fded953311cc8d2931ef5bb4b;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 07fa23825..b60c6f012 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -192,9 +192,11 @@ void Model_ResultConstruction::storeShape(std::shared_ptr theShap { std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData && aData->isValid()) { + std::string aMyName = data()->name(); TDF_Label& aShapeLab = aData->shapeLab(); if (!theShape.get() || theShape->isNull()) { aShapeLab.ForgetAllAttributes(); + TDataStd_Name::Set(aShapeLab, aMyName.c_str()); // restore name forgotten return; } std::shared_ptr aMyDoc = @@ -204,7 +206,6 @@ void Model_ResultConstruction::storeShape(std::shared_ptr theShap aShapeLab.ForgetAllAttributes(); // clear all previously stored TNaming_Builder aBuilder(aShapeLab); aBuilder.Generated(aShape); - std::string aMyName = data()->name(); TDataStd_Name::Set(aShapeLab, aMyName.c_str()); aMyDoc->addNamingName(aShapeLab, aMyName); } else if (aShape.ShapeType() == TopAbs_EDGE) { // store sub-vertices on sub-labels @@ -221,7 +222,6 @@ void Model_ResultConstruction::storeShape(std::shared_ptr theShap TDataStd_Name::Set(aSubLab, aVertexName.c_str()); aMyDoc->addNamingName(aSubLab, aVertexName); } - std::string aMyName = data()->name(); TDataStd_Name::Set(aShapeLab, aMyName.c_str()); aMyDoc->addNamingName(aShapeLab, aMyName); } else { // this is probably sketch, so, work with it as with composite @@ -327,8 +327,10 @@ void Model_ResultConstruction::storeShape(std::shared_ptr theShap } } aShapeLab.ForgetAllAttributes(); // clear all previously stored + TDataStd_Name::Set(aShapeLab, aMyName.c_str()); // restore name forgotten TNaming_Builder aBuilder(aShapeLab); // store the compound to get it ready on open of document aBuilder.Generated(aShape); + aMyDoc->addNamingName(aShapeLab, aMyName); // set new faces to the labels int aCurrentTag = 1; NCollection_List::Iterator anUnordered(anUnorderedFaces);