Salome HOME
bos #33557 [CEA] Merge pyramid method using geometrical median for the apex.
[modules/smesh.git] / src / SMESH / SMESH_DriverMesh.cxx
index 470278e93d5fb12f51873f896e3920a6ae0548f4..beeced2361d41cda08edd7022e561542348966e0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -25,6 +25,8 @@
 //  Module : SMESH
 //
 
+#include "utilities.h"
+
 #include "SMESH_DriverMesh.hxx"
 
 #include "SMESH_Mesh.hxx"
@@ -44,7 +46,7 @@ using namespace MEDCoupling;
  *
  * @return true if the mesh within the files are identical
  */
-bool diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, const std::string mesh_name){
+bool SMESH_DriverMesh::diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, const std::string mesh_name){
   MEDFileUMesh* medmesh1 = MEDFileUMesh::New(mesh_file1, mesh_name);
   MEDFileUMesh* medmesh2 = MEDFileUMesh::New(mesh_file2, mesh_name);
   MEDCouplingUMesh *m0_1=medmesh1->getMeshAtLevel(0,false);
@@ -53,7 +55,8 @@ bool diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, con
 }
 
 std::string getMeshName(std::string mesh_file){
-  std::unique_ptr<MEDFileUMesh> myMedMesh=MEDFileUMesh::New(mesh_file);
+  // TODO: Memory leak but desctructor private check with AG
+  MEDFileUMesh * myMedMesh = MEDFileUMesh::New(mesh_file);
 
   return myMedMesh->getLevel0Mesh()->getName();
 }
@@ -67,10 +70,10 @@ std::string getMeshName(std::string mesh_file){
  *
  * @return error code
  */
-int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
+int SMESH_DriverMesh::importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
   // TODO: change that as it depends on the language
   std::string mesh_name = getMeshName(mesh_file);
-  std::cout << "Importing mesh from " << mesh_file << " mesh " << mesh_name2 << std::endl;
+  MESSAGE("Importing mesh from " << mesh_file << " mesh " << mesh_name);
   int ret = aMesh.MEDToMesh(mesh_file.c_str(), mesh_name.c_str());
   return ret;
 }
@@ -84,10 +87,10 @@ int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
  *
  * @return error code
  */
-int exportMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
+int SMESH_DriverMesh::exportMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
 
-  // TODO: See how to get the name of the mesh. Is it usefull ?
-  std::cout << "Exporting mesh to " << mesh_file << std::endl;
+  MESSAGE("Exporting mesh to " << mesh_file);
   aMesh.ExportMED(mesh_file.c_str(), // theFile
                   mesh_name.c_str(), // theMeshName
                   false, // theAutoGroups