fix for the size map files writing

This commit is contained in:
rnc 2013-06-06 14:31:48 +00:00
parent b41bee030f
commit a0c0c192c3
2 changed files with 16 additions and 11 deletions

View File

@ -396,26 +396,31 @@ Driver_Mesh::Status DriverGMF_Write::PerformSizeMap()
// Vertices Keyword // Vertices Keyword
GmfSetKwd( meshID, GmfVertices, mySizeMapVerticesNumber ); GmfSetKwd( meshID, GmfVertices, mySizeMapVerticesNumber );
double xyz[3]; double xyz[3];
std::list<TLocalSize>::iterator sizes_it; std::vector<SMESHDS_Mesh*>::iterator meshes_it;
std::list<SMESHDS_Mesh*>::iterator meshes_it;
SMESHDS_Mesh* aMesh; SMESHDS_Mesh* aMesh;
for ( sizes_it = myLocalSizes.begin(), meshes_it = mySizeMapMeshes.begin()
; sizes_it != myLocalSizes.end() // Iterate on size map meshes
; sizes_it++, meshes_it++ ) for (meshes_it = mySizeMapMeshes.begin(); meshes_it != mySizeMapMeshes.end(); meshes_it++ )
{ {
aMesh= *meshes_it; aMesh= *meshes_it;
SMDS_NodeIteratorPtr nodeIt = aMesh->nodesIterator(); SMDS_NodeIteratorPtr nodeIt = aMesh->nodesIterator();
// Iterate on the nodes of the mesh and write their coordinates under the GmfVertices keyword
while ( nodeIt->more() ) while ( nodeIt->more() )
{ {
const SMDS_MeshNode* n = nodeIt->next(); const SMDS_MeshNode* n = nodeIt->next();
n->GetXYZ( xyz ); n->GetXYZ( xyz );
GmfSetLin( meshID, GmfVertices, xyz[0], xyz[1], xyz[2], n->getshapeId() ); GmfSetLin( meshID, GmfVertices, xyz[0], xyz[1], xyz[2], n->getshapeId() );
} }
}
// solAtVertices Keyword
int TypTab[] = {GmfSca}; // SolAtVertices Keyword
GmfSetKwd(meshID, GmfSolAtVertices, mySizeMapVerticesNumber, 1, TypTab); int TypTab[] = {GmfSca};
GmfSetKwd(meshID, GmfSolAtVertices, mySizeMapVerticesNumber, 1, TypTab);
std::vector<TLocalSize>::iterator sizes_it;
for ( sizes_it = myLocalSizes.begin(); sizes_it != myLocalSizes.end(); sizes_it++ )
{
for ( int i = 1; i <= sizes_it->nbNodes; i++ ) for ( int i = 1; i <= sizes_it->nbNodes; i++ )
{ {
double ValTab[] = {sizes_it->size}; double ValTab[] = {sizes_it->size};

View File

@ -77,8 +77,8 @@ public:
bool _exportRequiredGroups; bool _exportRequiredGroups;
int mySizeMapVerticesNumber; int mySizeMapVerticesNumber;
std::list<SMESHDS_Mesh*> mySizeMapMeshes; std::vector<SMESHDS_Mesh*> mySizeMapMeshes;
std::list<TLocalSize> myLocalSizes; std::vector<TLocalSize> myLocalSizes;
}; };
#endif #endif