Salome HOME
Merge remote-tracking branch 'remotes/origin/EDF_2020_Lot2'
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Shell.cpp
index 7f1010307502ee73fa57b18556aa824de3880354..d11e2bd6b6e01d70a2fb621aa9adbd5862c59cc0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -48,6 +48,18 @@ void BuildPlugin_Shell::execute()
   ListOfShape aShapes, aContexts;
   getOriginalShapesAndContexts(BASE_OBJECTS_ID(), aShapes, aContexts);
 
+  // Collect sketch faces.
+  for (int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
+    AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
+    GeomShapePtr aShape = aSelection->value();
+    ResultConstructionPtr aContext =
+        std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aSelection->context());
+    if (!aShape && aContext) {
+      for (int i = 0; i < aContext->facesNum(); ++i)
+        aShapes.push_back(aContext->face(i));
+    }
+  }
+
   // Sew faces.
   GeomMakeShapePtr aSewingAlgo(new GeomAlgoAPI_Sewing(aShapes));