From 1dd00032679822013832bc666602579d9a2c2dde Mon Sep 17 00:00:00 2001 From: Clarisse GENRAULT - DEN/DANS/DM2S/STMF/LGLS - 2012/10/01 Date: Tue, 15 May 2018 17:01:29 +0200 Subject: [PATCH] Fix naming bug for the vertices. --- src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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()); + } + } } -- 2.30.2