mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 01:40:33 +05:00
Removing hard coded meshname from Mesh import
This commit is contained in:
parent
45f8178054
commit
cc3662690d
@ -52,6 +52,12 @@ bool diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, con
|
|||||||
return m0_1->isEqual(m0_2, 1e-12);
|
return m0_1->isEqual(m0_2, 1e-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string getMeshName(std::string mesh_file){
|
||||||
|
std::unique_ptr<MEDFileUMesh> myMedMesh=MEDFileUMesh::New(mesh_file);
|
||||||
|
|
||||||
|
return myMedMesh->getLevel0Mesh()->getName();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Import a mesh from a mesh file (MED) into a SMESH_Mesh object
|
* @brief Import a mesh from a mesh file (MED) into a SMESH_Mesh object
|
||||||
*
|
*
|
||||||
@ -61,9 +67,10 @@ bool diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, con
|
|||||||
*
|
*
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
|
int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
|
||||||
// TODO: change that as it depends on the language
|
// TODO: change that as it depends on the language
|
||||||
std::cout << "Importing mesh from " << mesh_file << std::endl;
|
std::string mesh_name = getMeshName(mesh_file);
|
||||||
|
std::cout << "Importing mesh from " << mesh_file << " mesh " << mesh_name2 << std::endl;
|
||||||
int ret = aMesh.MEDToMesh(mesh_file.c_str(), mesh_name.c_str());
|
int ret = aMesh.MEDToMesh(mesh_file.c_str(), mesh_name.c_str());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,7 @@ bool diffMEDFile(const std::string mesh_file1,
|
|||||||
const std::string mesh_file2,
|
const std::string mesh_file2,
|
||||||
const std::string mesh_name);
|
const std::string mesh_name);
|
||||||
int importMesh(const std::string mesh_file,
|
int importMesh(const std::string mesh_file,
|
||||||
SMESH_Mesh& aMesh,
|
SMESH_Mesh& aMesh);
|
||||||
const std::string meshName);
|
|
||||||
int exportMesh(const std::string mesh_file,
|
int exportMesh(const std::string mesh_file,
|
||||||
SMESH_Mesh& aMesh,
|
SMESH_Mesh& aMesh,
|
||||||
const std::string meshName);
|
const std::string meshName);
|
||||||
|
@ -291,8 +291,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
if(file_name != "")
|
if(file_name != "")
|
||||||
{
|
{
|
||||||
fs::path mesh_file = fs::path(aMesh.tmp_folder) / fs::path(file_name);
|
fs::path mesh_file = fs::path(aMesh.tmp_folder) / fs::path(file_name);
|
||||||
// TODO: change mesh name
|
exportMesh(mesh_file.string(), aMesh, "MESH");
|
||||||
exportMesh(mesh_file.string(), aMesh, "Maillage_1");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//Resetting threaded pool info
|
//Resetting threaded pool info
|
||||||
|
Loading…
Reference in New Issue
Block a user