- const int aModTag = 1;
- const int aDeleteTag = 2;
- const std::string aModName = "Modified";
- theResultBody->loadAndOrientModifiedShapes(theAlgo.makeShape().get(), theBaseShape, GeomAPI_Shape::FACE,
- aModTag, aModName, *theAlgo.mapOfShapes().get());
- theResultBody->loadDeletedShapes(theAlgo.makeShape().get(), theBaseShape, GeomAPI_Shape::FACE, aDeleteTag);
+ ListOfShape::const_iterator aShellsIter = theShells.begin();
+ std::list<std::shared_ptr<GeomAPI_Interface>>::const_iterator aSolidsAlgosIter = theSolidsAlgos.begin();
+ for(; aShellsIter != theShells.end() && aSolidsAlgosIter != theSolidsAlgos.end(); aShellsIter++, aSolidsAlgosIter++) {
+ ListOfShape aFromFaces;
+ ListOfShape aToFaces;
+ std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes;
+
+ //Insert lateral face : Face from Edge
+ if(std::dynamic_pointer_cast<GeomAlgoAPI_Prism>(*aSolidsAlgosIter)) {
+ std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo = std::dynamic_pointer_cast<GeomAlgoAPI_Prism>(*aSolidsAlgosIter);
+ aSubShapes = aPrismAlgo->mapOfShapes();
+ theResultBody->loadAndOrientGeneratedShapes(aPrismAlgo->makeShape().get(), *aShellsIter, GeomAPI_Shape::EDGE, aGenTag,
+ aLatName, *aSubShapes.get());
+
+ aFromFaces = aPrismAlgo->fromFaces();
+ aToFaces = aPrismAlgo->toFaces();
+ } else if(std::dynamic_pointer_cast<GeomAlgoAPI_Revolution>(*aSolidsAlgosIter)) {
+ std::shared_ptr<GeomAlgoAPI_Revolution> aRevolAlgo = std::dynamic_pointer_cast<GeomAlgoAPI_Revolution>(*aSolidsAlgosIter);
+ aSubShapes = aRevolAlgo->mapOfShapes();
+ theResultBody->loadAndOrientGeneratedShapes(aRevolAlgo->makeShape().get(), *aShellsIter, GeomAPI_Shape::EDGE, aGenTag,
+ aLatName, *aSubShapes.get());
+ aFromFaces = aRevolAlgo->fromFaces();
+ aToFaces = aRevolAlgo->toFaces();
+ }
+
+ //Insert to faces
+ for(ListOfShape::const_iterator anIt = aToFaces.cbegin(); anIt != aToFaces.cend(); anIt++) {
+ std::shared_ptr<GeomAPI_Shape> aToFace = *anIt;
+ if(aSubShapes->isBound(aToFace)) {
+ aToFace = aSubShapes->find(aToFace);
+ }
+ theResultBody->generated(aToFace, aToName, aToTag++);
+ }
+
+ //Insert from faces
+ if (aFromTag < aToTag) aFromTag = aToTag;
+ for(ListOfShape::const_iterator anIt = aFromFaces.cbegin(); anIt != aFromFaces.cend(); anIt++) {
+ std::shared_ptr<GeomAPI_Shape> aFromFace = *anIt;
+ if(aSubShapes->isBound(aFromFace)) {
+ aFromFace = aSubShapes->find(aFromFace);
+ }
+ theResultBody->generated(aFromFace, aFromName, aFromTag++);
+ }
+ }
+
+ theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
+ aModTag, aModName, theMapOfShapes);
+ theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aDelTag);