X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Boolean.cpp;h=2fa01fadd233ebf49337a72921f286b9fec114b4;hb=682438a4bfd569dd672e736f30e325345c49943e;hp=5322a17e574f2cda35773de03e882ea21fb734c7;hpb=4a63ac1b481fbddea2f240d067c52e51db17c1db;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp index 5322a17e5..2fa01fadd 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp @@ -8,10 +8,7 @@ #include -#include -#include -#include -#include +#include #include //================================================================================================= @@ -47,35 +44,35 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects, } // Creating boolean operation. - BRepAlgoAPI_BooleanOperation* anOperation; + BOPAlgo_BOP* aBuilder = new BOPAlgo_BOP(); switch (theOperationType) { case BOOL_CUT: { - anOperation = new BRepAlgoAPI_Cut(); + aBuilder->SetOperation(BOPAlgo_CUT); break; } case BOOL_FUSE: { - anOperation = new BRepAlgoAPI_Fuse(); + aBuilder->SetOperation(BOPAlgo_FUSE); break; } case BOOL_COMMON: { - anOperation = new BRepAlgoAPI_Common(); + aBuilder->SetOperation(BOPAlgo_COMMON); break; } default: { return; } } - this->setImpl(anOperation); - this->setBuilderType(OCCT_BRepBuilderAPI_MakeShape); - anOperation->SetArguments(anObjects); - anOperation->SetTools(aTools); + this->setImpl(aBuilder); + this->setBuilderType(OCCT_BOPAlgo_Builder); + aBuilder->SetArguments(anObjects); + aBuilder->SetTools(aTools); // Building and getting result. - anOperation->Build(); - if(anOperation->IsDone() != Standard_True) { + aBuilder->Perform(); + if(aBuilder->ErrorStatus() != 0) { return; } - TopoDS_Shape aResult = anOperation->Shape(); + TopoDS_Shape aResult = aBuilder->Shape(); if(aResult.ShapeType() == TopAbs_COMPOUND) { aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);