Salome HOME
Preparation of version 2.2.0
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_ExtrusionBoolean.cpp
old mode 100644 (file)
new mode 100755 (executable)
index cc0b7b7..bc514dc
@@ -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
 
@@ -35,7 +35,7 @@ void FeaturesPlugin_ExtrusionBoolean::initMakeSolidsAttributes()
 //=================================================================================================
 void FeaturesPlugin_ExtrusionBoolean::makeSolids(const ListOfShape& theFaces,
                                                  ListOfShape& theResults,
-                                                 std::list<std::shared_ptr<GeomAPI_Interface>>& theAlgos)
+                                                 ListOfMakeShape& theAlgos)
 {
   // Getting extrusion sizes.
   double aToSize = 0.0;
@@ -74,17 +74,16 @@ void FeaturesPlugin_ExtrusionBoolean::makeSolids(const ListOfShape& theFaces,
   theResults.clear();
   for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) {
     std::shared_ptr<GeomAPI_Shape> aBaseShape = *aFacesIt;
-    std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo = std::make_shared<GeomAlgoAPI_Prism>(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()) {
-      setError("Extrusion algorithm failed");
+    if(!aPrismAlgo->isDone() || !aPrismAlgo->shape().get() || aPrismAlgo->shape()->isNull() ||
+       !aPrismAlgo->isValid()) {
+      setError("Error: Extrusion algorithm failed.");
       theResults.clear();
       return;
     }
     theResults.push_back(aPrismAlgo->shape());
     theAlgos.push_back(aPrismAlgo);
   }
-}
\ No newline at end of file
+}