- //load result
- if(theBaseShape->isEqual(theResultShape)) {
- theResultBody->store(theResultShape);
- } else {
- const int aGenTag = 1;
- const int aModTag = 2;
- const int aDelTag = 3;
- const int aSubsolidsTag=4; /// sub solids will be placed at labels 6, 7, etc. if result is compound of solids
- int aToTag = 5; // may be many labels, starting from this index
- int aFromTag = 10000; // may be many labels, starting from this index or last aToTag index
- const std::string aGenName = "Generated";
- const std::string aModName = "Modified";
- const std::string aLatName = "LateralFace";
- const std::string aFromName = "FromFace";
- const std::string aToName = "ToFace";
-
- theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
-
- 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();
- }