]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
Add a new log file with nodes and elements ids mapping between SMDS and GHS3D (SMDS...
authornge <nge>
Mon, 1 Feb 2010 14:08:25 +0000 (14:08 +0000)
committernge <nge>
Mon, 1 Feb 2010 14:08:25 +0000 (14:08 +0000)
src/GHS3DPlugin_GHS3D.cxx

index d34070c7aa44a41a83885ca6f3d4732210c386b7..c340c3d3418c8042f13078cf4b9d937f64d9a117 100644 (file)
@@ -1205,13 +1205,31 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   Ok = writePoints( aPointsFile, helper, aSmdsToGhs3dIdMap, aGhs3dIdToNodeMap, enforcedVertices) &&
        writeFaces ( aFacesFile,  meshDS, aSmdsToGhs3dIdMap );
 
+  // Write aSmdsToGhs3dIdMap to temp file
+  TCollection_AsciiString aSmdsToGhs3dIdMapFileName;
+  aSmdsToGhs3dIdMapFileName = aGenericName + ".ids";  // ids relation
+  ofstream aIdsFile  ( aSmdsToGhs3dIdMapFileName.ToCString()  , ios::out);
+  Ok =
+    aIdsFile.rdbuf()->is_open();
+  if (!Ok) {
+    INFOS( "Can't write into " << aSmdsToGhs3dIdMapFileName);
+    return error(SMESH_Comment("Can't write into ") << aSmdsToGhs3dIdMapFileName);
+  }
+  aIdsFile << "Smds Ghs3d" << std::endl;
+  map <int,int>::const_iterator myit;
+  for (myit=aSmdsToGhs3dIdMap.begin() ; myit != aSmdsToGhs3dIdMap.end() ; ++myit) {
+    aIdsFile << myit->first << " " << myit->second << std::endl;
+  }
+
   aFacesFile.close();
   aPointsFile.close();
+  aIdsFile.close();
   
   if ( ! Ok ) {
     if ( !_keepFiles ) {
       removeFile( aFacesFileName );
       removeFile( aPointsFileName );
+      removeFile( aSmdsToGhs3dIdMapFileName );
     }
     return error(COMPERR_BAD_INPUT_MESH);
   }
@@ -1288,6 +1306,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
     removeFile( aResultFileName );
     removeFile( aBadResFileName );
     removeFile( aBbResFileName );
+    removeFile( aSmdsToGhs3dIdMapFileName );
   }
   std::cout << "<" << aResultFileName.ToCString() << "> GHS3D output file ";
   if ( !Ok )