-//=================================================================================================
-void FeaturesPlugin_CompositeBoolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
- const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
- const ListOfShape& theFaces,
- const std::list<std::shared_ptr<GeomAPI_Interface>>& theSolidsAlgos,
- const ListOfShape& theTools,
- const GeomAlgoAPI_Boolean& theAlgo)
-{
- ModelAPI_BodyBuilder* aResultBuilder = theResultBody->getBodyBuilder();
- //load result
- if(theBaseShape->isEqual(theAlgo.shape())) {
- aResultBuilder->store(theAlgo.shape());
- } else {
- const int aGenTag = 1;
- const int aFrTag = 2;
- const int aToTag = 3;
- const int aModTag = 4;
- const int aDelTag = 5;
- const int aSubsolidsTag=6; /// sub solids will be placed at labels 6, 7, etc. if result is compound of solids
- const std::string aGenName = "Generated";
- const std::string aModName = "Modified";
- const std::string aLatName = "LateralFace";
- const std::string aFrName = "FromFace";
- const std::string aToName = "ToFace";
-
- aResultBuilder->storeModified(theBaseShape, theAlgo.shape(), aSubsolidsTag);
-
- ListOfShape::const_iterator aFaceIter = theFaces.begin();
- std::list<std::shared_ptr<GeomAPI_Interface>>::const_iterator aSolidsAlgosIter = theSolidsAlgos.begin();
- for(; aFaceIter != theFaces.end() && aSolidsAlgosIter != theSolidsAlgos.end(); aFaceIter++, aSolidsAlgosIter++) {
- std::shared_ptr<GeomAPI_Shape> aFromFace;
- std::shared_ptr<GeomAPI_Shape> aToFace;
- 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();
- aResultBuilder->loadAndOrientGeneratedShapes(aPrismAlgo->makeShape().get(), *aFaceIter, GeomAPI_Shape::EDGE, aGenTag,
- aLatName, *aSubShapes.get());
- //TODO:fix
- //aFromFace = aPrismAlgo->firstShape();
- //aToFace = aPrismAlgo->lastShape();
- } 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();
- aResultBuilder->loadAndOrientGeneratedShapes(aRevolAlgo->makeShape().get(), *aFaceIter, GeomAPI_Shape::EDGE, aGenTag,
- aLatName, *aSubShapes.get());
- aFromFace = aRevolAlgo->firstShape();
- aToFace = aRevolAlgo->lastShape();