-// 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
// Module : SMESH
//
+#include "utilities.h"
+
#include "SMESH_DriverMesh.hxx"
#include "SMESH_Mesh.hxx"
*
* @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);
}
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();
}
*
* @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;
}
*
* @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