X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_BodyBuilder.cpp;h=1a8ea5507f9518ca3810ac4bb6ba615e21bbfe6d;hb=f6bd0f4e080b833c0de7ef25822ebee641073445;hp=9633826011ce623cb10f03dc8b2073b19a1bd2b1;hpb=0fb6ac8ec037eab4f2512ea6fe7be1c6cc2e02b6;p=modules%2Fshaper.git diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 963382601..1a8ea5507 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -360,13 +360,19 @@ void Model_BodyBuilder::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, TopoDS_Shape aShapeIn = theShapeIn->impl(); TopTools_MapOfShape aView; TopExp_Explorer ShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape); + GeomShapePtr aResultShape = shape(); for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { const TopoDS_Shape& aRoot = ShapeExplorer.Current (); if (!aView.Add(aRoot)) continue; std::shared_ptr aRShape(new GeomAPI_Shape()); aRShape->setImpl((new TopoDS_Shape(aRoot))); if (theMS->isDeleted (aRShape)) { - builder(theTag)->Delete(aRoot); + if (!aResultShape->isSubShape(aRShape, false)) { + ListOfShape aHist; + theMS->modified(aRShape, aHist); + if (aHist.size() == 0 || (aHist.size() == 1 && aHist.front()->isSame(aRShape))) + builder(theTag)->Delete(aRoot); + } } } } @@ -379,7 +385,9 @@ static void keepTopLevelShapes(ListOfShape& theShapes, const TopoDS_Shape& theRo ListOfShape::iterator anIt = theShapes.begin(); while (anIt != theShapes.end()) { TopoDS_Shape aNewShape = (*anIt)->impl(); - if (theRoot.IsSame(aNewShape) || (theResultShape && + bool aSkip = aNewShape.IsNull() || + (aNewShape.ShapeType() == TopAbs_EDGE && BRep_Tool::Degenerated(TopoDS::Edge(aNewShape))); + if (aSkip || theRoot.IsSame(aNewShape) || (theResultShape && (!theResultShape->isSubShape(*anIt, false) || theResultShape->isSame(*anIt)))) { ListOfShape::iterator aRemoveIt = anIt++; theShapes.erase(aRemoveIt);