Salome HOME
Renamed SHAPER_CONFIG_FILE to PLUGINS_CONFIG_FILE
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_PaveFiller.cpp
index ad20d9eddf723dfdebd14d1a5af8e68294d13f8d..3dd1cb0b0b7fffd70f4918754dee048bacc0e34b 100644 (file)
@@ -12,6 +12,7 @@
 #include <BOPAlgo_Builder.hxx>
 #include <BOPAlgo_PaveFiller.hxx>
 #include <TopoDS_Builder.hxx>
+#include <TopoDS_Iterator.hxx>
 
 //=================================================================================================
 GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids)
@@ -26,7 +27,14 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape, const bool
   BOPAlgo_PaveFiller aPaveFiller;
   BOPCol_ListOfShape aListOfShape;
   for(ListOfShape::const_iterator anIt = theListOfShape.cbegin(); anIt != theListOfShape.cend(); anIt++) {
-    aListOfShape.Append((*anIt)->impl<TopoDS_Shape>());
+    const TopoDS_Shape& aShape = (*anIt)->impl<TopoDS_Shape>();
+    if(aShape.ShapeType() == TopAbs_COMPOUND) {
+      for(TopoDS_Iterator anIter(aShape); anIter.More(); anIter.Next()) {
+        aListOfShape.Append(anIter.Value());
+      }
+    } else {
+      aListOfShape.Append(aShape);
+    }
   }
   aPaveFiller.SetArguments(aListOfShape);
   aPaveFiller.Perform();