-
-//=================================================================================================
-void FeaturesPlugin_Extrusion::loadNamingDS(GeomAlgoAPI_Prism& thePrismAlgo,
- std::shared_ptr<ModelAPI_ResultBody> theResultBody,
- std::shared_ptr<GeomAPI_Shape> theBasis)
-{
- //load result
- theResultBody->storeGenerated(theBasis, thePrismAlgo.shape());
-
- std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = thePrismAlgo.mapOfSubShapes();
-
- //Insert lateral face : Face from Edge
- const std::string aLatName = "LateralFace";
- const int aLatTag = 1;
- theResultBody->loadAndOrientGeneratedShapes(&thePrismAlgo, theBasis, GeomAPI_Shape::EDGE, aLatTag, aLatName, *aSubShapes);
-
- //Insert to faces
- int aToFaceIndex = 1;
- const std::string aToName = "ToFace";
- int aToTag = 2;
- const ListOfShape& aToFaces = thePrismAlgo.toShapes();
- 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);
- }
- std::ostringstream aStr;
- aStr << aToName << "_" << aToFaceIndex++;
- theResultBody->generated(aToFace, aStr.str(), aToTag++);
- }
-
- //Insert from faces
- int aFromFaceIndex = 1;
- const std::string aFromName = "FromFace";
- int aFromTag = aToTag > 10000 ? aToTag : 10000;
- const ListOfShape& aFromFaces = thePrismAlgo.fromShapes();
- 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);
- }
- std::ostringstream aStr;
- aStr << aFromName << "_" << aFromFaceIndex++;
- theResultBody->generated(aFromFace, aStr.str(), aFromTag++);
- }
-}
-