]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make extrusion-cut store from-to faces in the data tree.
authormpv <mpv@opencascade.com>
Mon, 12 Nov 2018 06:42:28 +0000 (09:42 +0300)
committermpv <mpv@opencascade.com>
Mon, 12 Nov 2018 06:42:50 +0000 (09:42 +0300)
src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h

index 4ddac51f8e867af90f5eae03150fd691db6eeede..398ff651c0fff8e61ac5518d76c62fa545c7718e 100644 (file)
@@ -316,15 +316,31 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes
       aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
     theResultBody->loadGeneratedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE);
   }
-
+  std::list<std::shared_ptr<GeomAlgoAPI_MakeSweep> > aSweeps; // all sweeps collected
   std::shared_ptr<GeomAlgoAPI_MakeSweep> aMakeSweep =
     std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(theMakeShape);
   if(aMakeSweep.get()) {
+    aSweeps.push_back(aMakeSweep);
+  } else {
+    std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeList =
+      std::dynamic_pointer_cast<GeomAlgoAPI_MakeShapeList>(theMakeShape);
+    if (aMakeList.get()) {
+      ListOfMakeShape::const_iterator anIter = aMakeList->list().cbegin();
+      for(; anIter != aMakeList->list().cend(); anIter++) {
+        std::shared_ptr<GeomAlgoAPI_MakeSweep> aSweep =
+          std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(*anIter);
+        if (aSweep.get())
+          aSweeps.push_back(aSweep);
+      }
+    }
+  }
+  std::list<std::shared_ptr<GeomAlgoAPI_MakeSweep> >::iterator aSweep = aSweeps.begin();
+  for(; aSweep != aSweeps.end(); aSweep++) {
     // Store from shapes.
-    storeShapes(theResultBody, aBaseShapeType, aMakeSweep->fromShapes(), "From_");
+    storeShapes(theResultBody, aBaseShapeType, (*aSweep)->fromShapes(), "From_");
 
     // Store to shapes.
-    storeShapes(theResultBody, aBaseShapeType, aMakeSweep->toShapes(), "To_");
+    storeShapes(theResultBody, aBaseShapeType, (*aSweep)->toShapes(), "To_");
   }
 }
 
index 659399f580cfe2f6c58100510aeca32b47ecd43d..646894a1f75387e8301f40b6e87481a43630b06b 100644 (file)
@@ -54,6 +54,12 @@ void GeomAlgoAPI_MakeShapeList::init(const ListOfMakeShape& theMakeShapeList)
   }
 }
 
+const ListOfMakeShape& GeomAlgoAPI_MakeShapeList::list() const
+{
+  return myListOfMakeShape;
+}
+
+
 //==================================================================================================
 void GeomAlgoAPI_MakeShapeList::appendAlgo(
   const GeomMakeShapePtr theMakeShape)
index 3a5bdf1abb078bf06bd9385540c25adff523a316..b41712e142f54f485dc0146d9e561cc6f3602dda 100644 (file)
@@ -49,6 +49,9 @@ public:
   /// \param[in] theMakeShapeList list of algorithms.
   GEOMALGOAPI_EXPORT void init(const ListOfMakeShape& theMakeShapeList);
 
+  /// \return the list reference
+  GEOMALGOAPI_EXPORT const ListOfMakeShape& list() const;
+
   /// \brief Adds algo to the end of list.
   /// \param[in] theMakeShape algo to be added.
   GEOMALGOAPI_EXPORT void appendAlgo(const GeomMakeShapePtr theMakeShape);