Salome HOME
Updated copyright comment
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Fillet1D.cpp
index c19cfa34d8ef0c9ad3326defbe48e3ab5602f0c7..efe33d041b88f18af1c86184a751d7c231145934 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020  CEA/DEN, EDF R&D
+// Copyright (C) 2020-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,6 @@
 //
 
 #include <FeaturesPlugin_Fillet1D.h>
-#include <FeaturesPlugin_Tools.h>
 
 #include <GeomAlgoAPI_Fillet1D.h>
 #include <GeomAlgoAPI_MapShapesAndAncestors.h>
@@ -33,6 +32,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Events.h>
+#include <ModelAPI_Tools.h>
 
 void sendMessageWithFailedShapes(const ListOfShape& theVertices)
 {
@@ -87,7 +87,9 @@ bool FeaturesPlugin_Fillet1D::baseShapes(ListOfShape& theWires, MapShapeSubs& th
     int aNbSel = aSelList->size();
     for (int ind = 0; ind < aNbSel; ++ind) {
       AttributeSelectionPtr aCurSel = aSelList->value(ind);
-      GeomShapePtr aWire = aCurSel->context()->shape();
+      GeomShapePtr aWire = aCurSel->value();
+      if (!aWire.get() && aCurSel->context().get())
+        aWire = aCurSel->context()->shape();
       if (aProcessedWires.find(aWire) != aProcessedWires.end())
         continue;
 
@@ -124,7 +126,6 @@ bool FeaturesPlugin_Fillet1D::baseShapes(ListOfShape& theWires, MapShapeSubs& th
         return false;
       }
 
-
       // keep the sequence of wires and fillet vertices stable
       theWires.push_back(aWire);
       for (GeomAPI_WireExplorer anExp(aWire->wire()); anExp.more(); anExp.next()) {
@@ -190,8 +191,8 @@ bool FeaturesPlugin_Fillet1D::performFillet(const GeomShapePtr& theWire,
   ResultBodyPtr aResult = document()->createBody(data(), theResultIndex);
   ListOfShape anOriginal;
   anOriginal.push_back(theWire);
-  FeaturesPlugin_Tools::loadModifiedShapes(aResult, anOriginal, ListOfShape(),
-                                           aFilletBuilder, aFilletBuilder->shape(), THE_PREFIX);
+  ModelAPI_Tools::loadModifiedShapes(aResult, anOriginal, ListOfShape(),
+                                     aFilletBuilder, aFilletBuilder->shape(), THE_PREFIX);
   setResult(aResult, theResultIndex);
   // store new edges generated from vertices
   for (ListOfShape::const_iterator anIt = theVertices.begin(); anIt != theVertices.end(); ++anIt)