Salome HOME
Avoid crash if there is no parent of selection attribute.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_PaveFiller.cpp
index aada7a927aa49d8eb01fbf36bdf45befbe6d62cf..de0eee7eb3697b91002beda20f49729683832a45 100644 (file)
@@ -40,8 +40,8 @@ GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape
 void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
                                    const bool theIsMakeCompSolids)
 {
-  BOPAlgo_PaveFiller aPaveFiller;
-  BOPCol_ListOfShape aListOfShape;
+  BOPAlgo_PaveFiller* aPaveFiller = new BOPAlgo_PaveFiller;
+  TopTools_ListOfShape aListOfShape;
   for(ListOfShape::const_iterator
     anIt = theListOfShape.cbegin(); anIt != theListOfShape.cend(); anIt++) {
     const TopoDS_Shape& aShape = (*anIt)->impl<TopoDS_Shape>();
@@ -53,22 +53,18 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
       aListOfShape.Append(aShape);
     }
   }
-  aPaveFiller.SetArguments(aListOfShape);
-  aPaveFiller.Perform();
-  Standard_Integer iErr = aPaveFiller.ErrorStatus();
-  if(iErr) {
+  aPaveFiller->SetArguments(aListOfShape);
+  aPaveFiller->Perform();
+  if (aPaveFiller->HasErrors())
     return;
-  }
 
   BOPAlgo_Builder* aBuilder = new BOPAlgo_Builder();
   this->setImpl(aBuilder);
   this->setBuilderType(OCCT_BOPAlgo_Builder);
   aBuilder->SetArguments(aListOfShape);
-  aBuilder->PerformWithFiller(aPaveFiller);
-  iErr = aBuilder->ErrorStatus();
-  if(iErr) {
+  aBuilder->PerformWithFiller(*aPaveFiller);
+  if (aBuilder->HasErrors())
     return;
-  }
 
   TopoDS_Shape aResult = aBuilder->Shape();
   if(aResult.ShapeType() == TopAbs_COMPOUND) {