Salome HOME
Correct case when the weak-named attribute is dumped in Geom mode: geometrical repres...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Boolean.cpp
index 64dcb89497206d838606d3d604baafe6d84f9c79..c9d9524c41610898521dcb5c621638e44d23b201 100644 (file)
 #include <BOPAlgo_BOP.hxx>
 #include <TopTools_ListOfShape.hxx>
 
+//=================================================================================================
+GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
+                                         const GeomShapePtr theTool,
+                                         const OperationType theOperationType)
+{
+  ListOfShape aListWithObject, aListWithTool;
+  aListWithObject.push_back(theObject);
+  aListWithTool.push_back(theTool);
+  build(aListWithObject, aListWithTool, theOperationType);
+}
+
+//=================================================================================================
+GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
+                                         const ListOfShape& theTools,
+                                         const OperationType theOperationType)
+{
+  ListOfShape aListWithObject;
+  aListWithObject.push_back(theObject);
+  build(aListWithObject, theTools, theOperationType);
+}
+
 //=================================================================================================
 GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const ListOfShape& theObjects,
                                          const ListOfShape& theTools,
@@ -86,9 +107,8 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects,
 
   // Building and getting result.
   aBuilder->Perform();
-  if(aBuilder->ErrorStatus() != 0) {
+  if (aBuilder->HasErrors())
     return;
-  }
   TopoDS_Shape aResult = aBuilder->Shape();
 
   if(aResult.ShapeType() == TopAbs_COMPOUND) {