- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::EDGE, aLatTag, aLatName, *theDataMap);
-
- //Insert to faces
- const std::string aToName = "ToFace";
- int aToTag = 2;
- for(ListOfShape::const_iterator anIt = theToFaces.cbegin(); anIt != theToFaces.cend(); anIt++) {
- std::shared_ptr<GeomAPI_Shape> aToFace = *anIt;
- if(theDataMap->isBound(aToFace)) {
- aToFace = theDataMap->find(aToFace);
+ std::shared_ptr<GeomAPI_DataMapOfShapeShape> aDataMap = theMakeShape->mapOfSubShapes();
+ theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::EDGE, aLatTag, aLatName, *aDataMap.get());
+
+ std::shared_ptr<GeomAlgoAPI_MakeSweep> aSweepAlgo = std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(theMakeShape);
+ if(aSweepAlgo.get()) {
+ //Insert to faces
+ const std::string aToName = "ToFace";
+ int aToTag = 2;
+ const ListOfShape& aToFaces = aSweepAlgo->toFaces();
+ for(ListOfShape::const_iterator anIt = aToFaces.cbegin(); anIt != aToFaces.cend(); anIt++) {
+ std::shared_ptr<GeomAPI_Shape> aToFace = *anIt;
+ if(aDataMap->isBound(aToFace)) {
+ aToFace = aDataMap->find(aToFace);
+ }
+ theResultBody->generated(aToFace, aToName, aToTag++);