X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_CompositeBoolean.cpp;h=cfe002fb0b1ff080ad3d279ac92825f87d85b8e5;hb=a13f87935d2a6f52f942790b6abc874f1016c9fc;hp=4692110f43eb3efdee8889ae4a6a38af6a09b111;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 4692110f4..cfe002fb0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -173,7 +173,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aListWithObject.push_back(anObject); std::shared_ptr aBoolAlgo(new GeomAlgoAPI_Boolean(aListWithObject, theTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + GeomAlgoAPI_Tools::BOOL_CUT)); // Checking that the algorithm worked properly. if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) { @@ -213,7 +213,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, std::shared_ptr aBoolAlgo(new GeomAlgoAPI_Boolean(aUsedShapes, theTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + GeomAlgoAPI_Tools::BOOL_CUT)); // Checking that the algorithm worked properly. if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) { @@ -225,17 +225,20 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aMakeShapeList->appendAlgo(aBoolAlgo); // Add result to not used solids from compsolid. - aShapesToAdd.push_back(aBoolAlgo->shape()); - std::shared_ptr aFillerAlgo( - new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); - if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) { - myFeature->setError("Error: PaveFiller algorithm failed."); - return false; + GeomShapePtr aBoolRes = aBoolAlgo->shape(); + if (!aShapesToAdd.empty()) { + aShapesToAdd.push_back(aBoolRes); + std::shared_ptr aFillerAlgo( + new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) { + myFeature->setError("Error: PaveFiller algorithm failed."); + return false; + } + aBoolRes = aFillerAlgo->shape(); + aMakeShapeList->appendAlgo(aFillerAlgo); } - aMakeShapeList->appendAlgo(aFillerAlgo); - - if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo->shape()) > 1.e-27) { + if(GeomAlgoAPI_ShapeTools::volume(aBoolRes) > 1.e-27) { theObjects.push_back(aCompSolid); theMakeShapes.push_back(aMakeShapeList); } @@ -307,7 +310,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, if(!anEdgesAndFaces.empty() && !aCutTools.empty()) { std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces, aCutTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + GeomAlgoAPI_Tools::BOOL_CUT)); if(aCutAlgo->isDone() && !aCutAlgo->shape()->isNull() && aCutAlgo->isValid()) { anEdgesAndFaces.clear(); anEdgesAndFaces.push_back(aCutAlgo->shape()); @@ -319,7 +322,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, if(!aShapesToAdd.empty()) { std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(aSolidsToFuse, aShapesToAdd, - GeomAlgoAPI_Boolean::BOOL_CUT)); + GeomAlgoAPI_Tools::BOOL_CUT)); if(aCutAlgo->isDone() && GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) { aSolidsToFuse.clear(); aSolidsToFuse.push_back(aCutAlgo->shape()); @@ -339,7 +342,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, std::shared_ptr aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects, aTools, - GeomAlgoAPI_Boolean::BOOL_FUSE)); + GeomAlgoAPI_Tools::BOOL_FUSE)); // Checking that the algorithm worked properly. if(!aFuseAlgo->isDone() || aFuseAlgo->shape()->isNull() || !aFuseAlgo->isValid()) {