X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Boolean.cpp;h=c9d9524c41610898521dcb5c621638e44d23b201;hb=f60dc9dd94d5d4b0ea07e3e3cbfd5b3028f0942d;hp=edf07536095315320d190d5644981b0775de760c;hpb=423c10234142d14d0d5de89383f2f96a4ec5930f;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp index edf075360..c9d9524c4 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_Boolean.cpp -// Created: 02 Sept 2014 -// Author: Vitaly Smetannikov +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include "GeomAlgoAPI_Boolean.h" @@ -12,6 +26,27 @@ #include #include +//================================================================================================= +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, @@ -72,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) {