From: mpv Date: Mon, 12 Nov 2018 06:42:28 +0000 (+0300) Subject: Make extrusion-cut store from-to faces in the data tree. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=788eb40a677b1c29e608d7d67f9f135b9f63c8fa;p=modules%2Fshaper.git Make extrusion-cut store from-to faces in the data tree. --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp index 4ddac51f8..398ff651c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp @@ -316,15 +316,31 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { theResultBody->loadGeneratedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE); } - + std::list > aSweeps; // all sweeps collected std::shared_ptr aMakeSweep = std::dynamic_pointer_cast(theMakeShape); if(aMakeSweep.get()) { + aSweeps.push_back(aMakeSweep); + } else { + std::shared_ptr aMakeList = + std::dynamic_pointer_cast(theMakeShape); + if (aMakeList.get()) { + ListOfMakeShape::const_iterator anIter = aMakeList->list().cbegin(); + for(; anIter != aMakeList->list().cend(); anIter++) { + std::shared_ptr aSweep = + std::dynamic_pointer_cast(*anIter); + if (aSweep.get()) + aSweeps.push_back(aSweep); + } + } + } + std::list >::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_"); } } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp index 659399f58..646894a1f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp @@ -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) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h index 3a5bdf1ab..b41712e14 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h @@ -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);