From: mpv Date: Thu, 9 Jan 2020 07:21:23 +0000 (+0300) Subject: Fix for the issue #18499 EDF 20572 - Problem of points selection in viewer - crash... X-Git-Tag: V9_5_0a1~73 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=50bf59f84057fb21c5441d20bae6b5cdee3c7afa;p=modules%2Fshaper.git Fix for the issue #18499 EDF 20572 - Problem of points selection in viewer - crash of the PartSet points selection for the Part compound. --- diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index be65e0f40..2c5c5c381 100644 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -183,7 +183,9 @@ void Model_BodyBuilder::store(const GeomShapePtr& theShape, return; // null shape inside if(!theIsStoreSameShapes) { - Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aShape, aShapeLab); + Handle(TNaming_NamedShape) aNS; + if (TNaming_Tool::HasLabel(aShapeLab, aShape)) + aNS = TNaming_Tool::NamedShape(aShape, aShapeLab); // the last condition is for the issue 2751 : existing shape may be found in compound-NS if(!aNS.IsNull() && !aNS->IsEmpty() && aNS->Get().IsSame(aShape)) { // This shape is already in document, store reference instead of shape; @@ -386,7 +388,9 @@ void Model_BodyBuilder::storeModified(const std::list& theOldShape if (aData.get()) { TDF_Label aShapeLab = aData->shapeLab(); TopoDS_Shape aShapeNew = theNewShape->impl(); - Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aShapeNew, aShapeLab); + Handle(TNaming_NamedShape) aNS; + if (TNaming_Tool::HasLabel(aShapeLab, aShapeNew)) + aNS = TNaming_Tool::NamedShape(aShapeNew, aShapeLab); // the last condition is for the issue 2751 : existing shape may be found in compound-NS if (!aNS.IsNull() && !aNS->IsEmpty() && aNS->Get().IsSame(aShapeNew)) { // This shape is already in document, store reference instead of shape;