Salome HOME
Bug #1341: selected point on circle
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_ExtrusionBoolean.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 2a564e9..79b5cda
@@ -1,6 +1,6 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
-// File:        FeaturesPlugin_ExtrusionBoolean.h
+// File:        FeaturesPlugin_ExtrusionBoolean.cpp
 // Created:     11 June 2015
 // Author:      Dmitry Bobylev
 
@@ -33,7 +33,9 @@ void FeaturesPlugin_ExtrusionBoolean::initMakeSolidsAttributes()
 }
 
 //=================================================================================================
-ListOfShape FeaturesPlugin_ExtrusionBoolean::MakeSolids(const ListOfShape& theFaces)
+void FeaturesPlugin_ExtrusionBoolean::makeSolids(const ListOfShape& theFaces,
+                                                 ListOfShape& theResults,
+                                                 ListOfMakeShape& theAlgos)
 {
   // Getting extrusion sizes.
   double aToSize = 0.0;
@@ -69,18 +71,19 @@ ListOfShape FeaturesPlugin_ExtrusionBoolean::MakeSolids(const ListOfShape& theFa
   }
 
   // Extrude faces.
-  ListOfShape anExtrusionList;
+  theResults.clear();
   for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) {
     std::shared_ptr<GeomAPI_Shape> aBaseShape = *aFacesIt;
-    GeomAlgoAPI_Prism aPrismAlgo(aBaseShape, aToShape, aToSize, aFromShape, aFromSize);
+    std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo = std::shared_ptr<GeomAlgoAPI_Prism>(new GeomAlgoAPI_Prism(aBaseShape, aToShape, aToSize, aFromShape, aFromSize));
 
     // Checking that the algorithm worked properly.
-    if(!aPrismAlgo.isDone() || aPrismAlgo.shape()->isNull() || !aPrismAlgo.isValid()) {
+    if(!aPrismAlgo->isDone() || !aPrismAlgo->shape().get() || aPrismAlgo->shape()->isNull() ||
+       !aPrismAlgo->isValid()) {
       setError("Extrusion algorithm failed");
-      return ListOfShape();
+      theResults.clear();
+      return;
     }
-    anExtrusionList.push_back(aPrismAlgo.shape());
+    theResults.push_back(aPrismAlgo->shape());
+    theAlgos.push_back(aPrismAlgo);
   }
-
-  return anExtrusionList;
-}
\ No newline at end of file
+}