]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix naming bug for the vertices.
authorClarisse GENRAULT - DEN/DANS/DM2S/STMF/LGLS - 2012/10/01 <cg246364@is221554.intra.cea.fr>
Tue, 15 May 2018 15:01:29 +0000 (17:01 +0200)
committerClarisse GENRAULT - DEN/DANS/DM2S/STMF/LGLS - 2012/10/01 <cg246364@is221554.intra.cea.fr>
Tue, 15 May 2018 15:01:29 +0000 (17:01 +0200)
src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp

index 1ab4ce05d6dad80a124556f739ba0a7194e0c538..55e2d14454f6f688a69b55f5634bd632b2dbdddd 100644 (file)
 
 #include <GDMLPlugin_Ellipsoid.h>
 
+#include <GeomAPI_ShapeExplorer.h>
+
 #include <ModelAPI_Data.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeString.h>
 
+#include <sstream>
+
 //=================================================================================================
 GDMLPlugin_Ellipsoid::GDMLPlugin_Ellipsoid() // Nothing to do during instantiation
 {
@@ -108,13 +112,26 @@ void GDMLPlugin_Ellipsoid::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Ellipsoid> t
   theEllipsoidAlgo->prepareNamingFaces();
 
   // Insert to faces
+  // Naming for faces and edges
   int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
-    theEllipsoidAlgo->getCreatedFaces();
+      theEllipsoidAlgo->getCreatedFaces();
   for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-    it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
+       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
     std::shared_ptr<GeomAPI_Shape> 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_"<<anIndex++;
+      theResultEllipsoid->generated(aVertExp.current(), aStream.str(), num++);
+      aVertices.bind(aVertExp.current(), aVertExp.current());
+    }
+  }
 }