Salome HOME
Bug #1341: selected point on circle
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_CompositeBoolean.cpp
index 0eb79e23a44e1f4f66237973dfb714e33296288a..b47952c5dbbc97c950b8c92bc3d073e7e7038287 100644 (file)
@@ -246,19 +246,19 @@ void FeaturesPlugin_CompositeBoolean::execute()
         // Add result to not used solids from compsolid.
         ListOfShape aShapesToAdd = aNotUsedSolids;
         aShapesToAdd.push_back(aBoolAlgo->shape());
-        GeomAlgoAPI_PaveFiller aFillerAlgo(aShapesToAdd, true);
-        if(!aFillerAlgo.isDone()) {
+        std::shared_ptr<GeomAlgoAPI_PaveFiller> 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<ModelAPI_ResultBody> 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++;
         }
@@ -337,26 +337,26 @@ void FeaturesPlugin_CompositeBoolean::execute()
       // 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<GeomAlgoAPI_PaveFiller> 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<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
@@ -393,7 +393,7 @@ void FeaturesPlugin_CompositeBoolean::loadNamingDS(std::shared_ptr<ModelAPI_Resu
     const int aModTag = 2;
     const int aDelTag = 3;
     const int aSubsolidsTag=4; /// sub solids will be placed at labels 6, 7, etc. if result is compound of solids
-    int aToTag = 5; // may be many labels, starting from this index
+    int aToTag = 5000; // may be many labels, starting from this index
     int aFromTag = 10000; // may be many labels, starting from this index or last aToTag index
     const std::string aGenName = "Generated";
     const std::string aModName = "Modified";