From: Clarisse GENRAULT - DEN/DANS/DM2S/STMF/LGLS - 2012/10/01 Date: Tue, 15 May 2018 15:01:29 +0000 (+0200) Subject: Fix naming bug for the vertices. X-Git-Tag: V8_5_0rc2~8^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1dd00032679822013832bc666602579d9a2c2dde;p=modules%2Fshaper.git Fix naming bug for the vertices. --- diff --git a/src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp b/src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp index 1ab4ce05d..55e2d1445 100644 --- a/src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp +++ b/src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp @@ -20,11 +20,15 @@ #include +#include + #include #include #include #include +#include + //================================================================================================= GDMLPlugin_Ellipsoid::GDMLPlugin_Ellipsoid() // Nothing to do during instantiation { @@ -108,13 +112,26 @@ void GDMLPlugin_Ellipsoid::loadNamingDS(std::shared_ptr t theEllipsoidAlgo->prepareNamingFaces(); // Insert to faces + // Naming for faces and edges int num = 1; std::map< std::string, std::shared_ptr > listOfFaces = - theEllipsoidAlgo->getCreatedFaces(); + theEllipsoidAlgo->getCreatedFaces(); for (std::map< std::string, std::shared_ptr >::iterator - it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) { + it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) { std::shared_ptr aFace = (*it).second; theResultEllipsoid->generated(aFace, (*it).first, num++); } + + // Naming vertices + GeomAPI_DataMapOfShapeShape aVertices; + GeomAPI_ShapeExplorer aVertExp(theEllipsoidAlgo->shape(), GeomAPI_Shape::VERTEX); + for(int anIndex = 1; aVertExp.more(); aVertExp.next()) { + if (!aVertices.isBound(aVertExp.current())) { + std::ostringstream aStream; + aStream<<"Vertex_"<generated(aVertExp.current(), aStream.str(), num++); + aVertices.bind(aVertExp.current(), aVertExp.current()); + } + } }