X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_CompositeBoolean.cpp;h=b47952c5dbbc97c950b8c92bc3d073e7e7038287;hb=5a4405dc843479d921b53b83c181cbe9359414fe;hp=2737a82fb64bfd345a8672a80038f0865201e392;hpb=ea4d65430ad05a8f47f4c2d95c4b09260d6ed3ab;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 2737a82fb..b47952c5d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -203,7 +203,7 @@ void FeaturesPlugin_CompositeBoolean::execute() if(GeomAlgoAPI_ShapeTools::volume(aBoolAlgo.shape()) > 1.e-7) { std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); loadNamingDS(aResultBody, aShells, aSolidsAlgos, anObject, aTools, aBoolAlgo.shape(), - *aBoolAlgo.makeShape(), *aBoolAlgo.mapOfShapes()); + aBoolAlgo, *aBoolAlgo.mapOfSubShapes().get()); setResult(aResultBody, aResultIndex); aResultIndex++; } @@ -230,35 +230,35 @@ void FeaturesPlugin_CompositeBoolean::execute() } } - GeomAlgoAPI_Boolean aBoolAlgo(aUsedInOperationSolids, aTools, myBooleanOperationType); + std::shared_ptr aBoolAlgo(new GeomAlgoAPI_Boolean(aUsedInOperationSolids, aTools, myBooleanOperationType)); // Checking that the algorithm worked properly. - if(!aBoolAlgo.isDone() || aBoolAlgo.shape()->isNull() || !aBoolAlgo.isValid()) { + if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) { setError("Boolean algorithm failed"); return; } GeomAlgoAPI_MakeShapeList aMakeShapeList; - aMakeShapeList.appendAlgo(aBoolAlgo.makeShape()); + aMakeShapeList.appendAlgo(aBoolAlgo); GeomAPI_DataMapOfShapeShape aMapOfShapes; - aMapOfShapes.merge(aBoolAlgo.mapOfShapes()); + aMapOfShapes.merge(aBoolAlgo->mapOfSubShapes()); // Add result to not used solids from compsolid. ListOfShape aShapesToAdd = aNotUsedSolids; - aShapesToAdd.push_back(aBoolAlgo.shape()); - GeomAlgoAPI_PaveFiller aFillerAlgo(aShapesToAdd, true); - if(!aFillerAlgo.isDone()) { + aShapesToAdd.push_back(aBoolAlgo->shape()); + std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + if(!aFillerAlgo->isDone()) { std::string aFeatureError = "PaveFiller algorithm failed"; setError(aFeatureError); return; } - aMakeShapeList.appendAlgo(aFillerAlgo.makeShape()); - aMapOfShapes.merge(aFillerAlgo.mapOfShapes()); + aMakeShapeList.appendAlgo(aFillerAlgo); + aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes()); - if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo.shape()) > 1.e-7) { + if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo->shape()) > 1.e-7) { std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aShells, aSolidsAlgos, aCompSolid, aTools, aFillerAlgo.shape(), aMakeShapeList, aMapOfShapes); + loadNamingDS(aResultBody, aShells, aSolidsAlgos, aCompSolid, aTools, aFillerAlgo->shape(), aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; } @@ -305,12 +305,12 @@ void FeaturesPlugin_CompositeBoolean::execute() for(ListOfShape::iterator anIt = anOriginalSolids.begin(); anIt != anOriginalSolids.end(); anIt++) { ListOfShape aOneObjectList; aOneObjectList.push_back(*anIt); - GeomAlgoAPI_Boolean aCutAlgo(aOneObjectList, aNotUsedSolids, GeomAlgoAPI_Boolean::BOOL_CUT); + std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(aOneObjectList, aNotUsedSolids, GeomAlgoAPI_Boolean::BOOL_CUT)); - if(GeomAlgoAPI_ShapeTools::volume(aCutAlgo.shape()) > 1.e-7) { - aSolidsToFuse.push_back(aCutAlgo.shape()); - aMakeShapeList.appendAlgo(aCutAlgo.makeShape()); - aMapOfShapes.merge(aCutAlgo.mapOfShapes()); + if(GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-7) { + aSolidsToFuse.push_back(aCutAlgo->shape()); + aMakeShapeList.appendAlgo(aCutAlgo); + aMapOfShapes.merge(aCutAlgo->mapOfSubShapes()); } } } @@ -321,42 +321,42 @@ void FeaturesPlugin_CompositeBoolean::execute() aTools = aSolidsToFuse; // Fuse all objects and all tools. - GeomAlgoAPI_Boolean aFuseAlgo(anObjects, aTools, myBooleanOperationType); + std::shared_ptr aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects, aTools, myBooleanOperationType)); // Checking that the algorithm worked properly. - if(!aFuseAlgo.isDone() || aFuseAlgo.shape()->isNull() || !aFuseAlgo.isValid()) { + if(!aFuseAlgo->isDone() || aFuseAlgo->shape()->isNull() || !aFuseAlgo->isValid()) { static const std::string aFeatureError = "Boolean algorithm failed"; setError(aFeatureError); return; } - std::shared_ptr aShape = aFuseAlgo.shape(); - aMakeShapeList.appendAlgo(aFuseAlgo.makeShape()); - aMapOfShapes.merge(aFuseAlgo.mapOfShapes()); + std::shared_ptr aShape = aFuseAlgo->shape(); + aMakeShapeList.appendAlgo(aFuseAlgo); + aMapOfShapes.merge(aFuseAlgo->mapOfSubShapes()); // Add result to not used solids from compsolid (if we have any). if(!aNotUsedSolids.empty()) { aNotUsedSolids.push_back(aShape); - GeomAlgoAPI_PaveFiller aFillerAlgo(aNotUsedSolids, true); - if(!aFillerAlgo.isDone()) { + std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aNotUsedSolids, true)); + if(!aFillerAlgo->isDone()) { std::string aFeatureError = "PaveFiller algorithm failed"; setError(aFeatureError); return; } - if(aFillerAlgo.shape()->isNull()) { + if(aFillerAlgo->shape()->isNull()) { static const std::string aShapeError = "Resulting shape is Null"; setError(aShapeError); return; } - if(!aFillerAlgo.isValid()) { + if(!aFillerAlgo->isValid()) { std::string aFeatureError = "Warning: resulting shape is not valid"; setError(aFeatureError); return; } - aShape = aFillerAlgo.shape(); - aMakeShapeList.appendAlgo(aFillerAlgo.makeShape()); - aMapOfShapes.merge(aFillerAlgo.mapOfShapes()); + aShape = aFillerAlgo->shape(); + aMakeShapeList.appendAlgo(aFillerAlgo); + aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes()); } std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); @@ -393,7 +393,7 @@ void FeaturesPlugin_CompositeBoolean::loadNamingDS(std::shared_ptr