X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_BodyBuilder.cpp;h=bfa8d62fe1a32d7a78b6a20dd77aa45c8e1e4172;hb=383021cb51c4720904096ca851db5ee79255b402;hp=2d025aa88d1b1402f2d7d1f28f677072a7a125c0;hpb=323ddeaed96f1be1a1071a7facc924085cd65d39;p=modules%2Fshaper.git diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 2d025aa88..bfa8d62fe 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -370,13 +370,14 @@ void Model_BodyBuilder::loadAndOrientModifiedShapes ( GeomAPI_DataMapOfShapeShape& theSubShapes, const bool theIsStoreSeparate) { + int anIndex = 1; int aTag = theTag; + bool isBuilt = !theName.empty(); std::string aName = theName; std::ostringstream aStream; - int anIndex = 1; + GeomShapePtr aResultShape = shape(); TopoDS_Shape aShapeIn = theShapeIn->impl(); TopTools_MapOfShape aView; - bool isBuilt = theName.empty(); TopExp_Explorer aShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape); for (; aShapeExplorer.More(); aShapeExplorer.Next ()) { const TopoDS_Shape& aRoot = aShapeExplorer.Current (); @@ -387,14 +388,16 @@ void Model_BodyBuilder::loadAndOrientModifiedShapes ( theMS->modified(aRShape, aList); std::list >::const_iterator anIt = aList.begin(), aLast = aList.end(); for (; anIt != aLast; anIt++) { - TopoDS_Shape aNewShape = (*anIt)->impl(); + TopoDS_Shape aNewShape = (*anIt)->impl(); if (theSubShapes.isBound(*anIt)) { std::shared_ptr aMapShape(theSubShapes.find(*anIt)); aNewShape.Orientation(aMapShape->impl().Orientation()); } - if (!aRoot.IsSame (aNewShape)) { + GeomShapePtr aGeomNewShape(new GeomAPI_Shape()); + aGeomNewShape->setImpl(new TopoDS_Shape(aNewShape)); + if(!aRoot.IsSame(aNewShape) && aResultShape->isSubShape(aGeomNewShape)) { builder(aTag)->Modify(aRoot,aNewShape); - if(!isBuilt) { + if(isBuilt) { if(theIsStoreSeparate) { aStream.str(std::string()); aStream.clear();