From a0c0c192c32738eba18bea0af95ce44abe085643 Mon Sep 17 00:00:00 2001 From: rnc Date: Thu, 6 Jun 2013 14:31:48 +0000 Subject: [PATCH] fix for the size map files writing --- src/DriverGMF/DriverGMF_Write.cxx | 23 ++++++++++++++--------- src/DriverGMF/DriverGMF_Write.hxx | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/DriverGMF/DriverGMF_Write.cxx b/src/DriverGMF/DriverGMF_Write.cxx index ea28f31cf..691405f3b 100644 --- a/src/DriverGMF/DriverGMF_Write.cxx +++ b/src/DriverGMF/DriverGMF_Write.cxx @@ -396,26 +396,31 @@ Driver_Mesh::Status DriverGMF_Write::PerformSizeMap() // Vertices Keyword GmfSetKwd( meshID, GmfVertices, mySizeMapVerticesNumber ); double xyz[3]; - std::list::iterator sizes_it; - std::list::iterator meshes_it; + std::vector::iterator meshes_it; SMESHDS_Mesh* aMesh; - for ( sizes_it = myLocalSizes.begin(), meshes_it = mySizeMapMeshes.begin() - ; sizes_it != myLocalSizes.end() - ; sizes_it++, meshes_it++ ) + + // Iterate on size map meshes + for (meshes_it = mySizeMapMeshes.begin(); meshes_it != mySizeMapMeshes.end(); meshes_it++ ) { aMesh= *meshes_it; SMDS_NodeIteratorPtr nodeIt = aMesh->nodesIterator(); + + // Iterate on the nodes of the mesh and write their coordinates under the GmfVertices keyword while ( nodeIt->more() ) { const SMDS_MeshNode* n = nodeIt->next(); n->GetXYZ( xyz ); GmfSetLin( meshID, GmfVertices, xyz[0], xyz[1], xyz[2], n->getshapeId() ); } - - // solAtVertices Keyword - int TypTab[] = {GmfSca}; - GmfSetKwd(meshID, GmfSolAtVertices, mySizeMapVerticesNumber, 1, TypTab); + } + + // SolAtVertices Keyword + int TypTab[] = {GmfSca}; + GmfSetKwd(meshID, GmfSolAtVertices, mySizeMapVerticesNumber, 1, TypTab); + std::vector::iterator sizes_it; + for ( sizes_it = myLocalSizes.begin(); sizes_it != myLocalSizes.end(); sizes_it++ ) + { for ( int i = 1; i <= sizes_it->nbNodes; i++ ) { double ValTab[] = {sizes_it->size}; diff --git a/src/DriverGMF/DriverGMF_Write.hxx b/src/DriverGMF/DriverGMF_Write.hxx index a1779a674..36d3b230a 100644 --- a/src/DriverGMF/DriverGMF_Write.hxx +++ b/src/DriverGMF/DriverGMF_Write.hxx @@ -77,8 +77,8 @@ public: bool _exportRequiredGroups; int mySizeMapVerticesNumber; - std::list mySizeMapMeshes; - std::list myLocalSizes; + std::vector mySizeMapMeshes; + std::vector myLocalSizes; }; #endif -- 2.30.2