X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_ShapeTools.cpp;h=852163df3df21b261cf67792238218d01d92946d;hb=03b823cbbe43236117bc50c34398f3ce273f729b;hp=de201f61c10e071b8c92d7f475d13483bd123061;hpb=34afe547352180006fee9600173c4dc93dc1f6c3;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index de201f61c..852163df3 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -85,18 +85,28 @@ void GeomAlgoAPI_ShapeTools::combineShapes(const std::shared_ptr aTA = TopAbs_SOLID; } - // Map subshapes and shapes. + // Get free shapes. const TopoDS_Shape& aShapesComp = theCompound->impl(); - BOPCol_IndexedDataMapOfShapeListOfShape aMapEF; - BOPTools::MapShapesAndAncestors(aShapesComp, aTS, aTA, aMapEF); - if(aMapEF.IsEmpty()) { + for(TopoDS_Iterator anIter(aShapesComp); anIter.More(); anIter.Next() ) { + const TopoDS_Shape& aShape = anIter.Value(); + if(aShape.ShapeType() > aTA) { + std::shared_ptr aGeomShape(new GeomAPI_Shape); + aGeomShape->setImpl(new TopoDS_Shape(aShape)); + theFreeShapes.push_back(aGeomShape); + } + } + + // Map subshapes and shapes. + BOPCol_IndexedDataMapOfShapeListOfShape aMapSA; + BOPTools::MapShapesAndAncestors(aShapesComp, aTS, aTA, aMapSA); + if(aMapSA.IsEmpty()) { return; } // Get all shapes with common subshapes and free shapes. NCollection_Map aFreeShapes; NCollection_Vector> aShapesWithCommonSubshapes; - for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapEF); anIter.More(); anIter.Next()) { + for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) { const TopoDS_Shape& aShape = anIter.Key(); BOPCol_ListOfShape& aListOfShape = anIter.ChangeValue(); if(aListOfShape.IsEmpty()) { @@ -120,7 +130,7 @@ void GeomAlgoAPI_ShapeTools::combineShapes(const std::shared_ptr aListOfShape.Clear(); for(NCollection_List::Iterator aTempIter(aTempList); aTempIter.More(); aTempIter.Next()) { const TopoDS_Shape& aTempShape = aTempIter.Value(); - for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapEF); anIter.More(); anIter.Next()) { + for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) { BOPCol_ListOfShape& aTempListOfShape = anIter.ChangeValue(); if(aTempListOfShape.IsEmpty()) { continue;