- //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();
- ListOfMakeShape::const_iterator aSolidsAlgosIter = theSolidsAlgos.begin();
- for(; aShellsIter != theShells.end() && aSolidsAlgosIter != theSolidsAlgos.end(); aShellsIter++, aSolidsAlgosIter++) {
- //Insert lateral face : Face from Edge
- std::shared_ptr<GeomAlgoAPI_MakeShape> aSolidAlgo = std::dynamic_pointer_cast<GeomAlgoAPI_MakeShape>(*aSolidsAlgosIter);
- if(aSolidAlgo.get()) {
- std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = aSolidAlgo->mapOfSubShapes();
- theResultBody->loadAndOrientGeneratedShapes(aSolidAlgo.get(), *aShellsIter, GeomAPI_Shape::EDGE, aGenTag,
- aLatName, *aSubShapes.get());
-
-
- std::shared_ptr<GeomAlgoAPI_MakeSweep> aSweepAlgo = std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(aSolidAlgo);
- if(aSweepAlgo.get()) {
- //Insert to faces
- const ListOfShape& aToFaces = aSweepAlgo->toFaces();
- 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++);
- }