diff --git a/Applications/DataExplorer/DataView/SaveMeshDialog.cpp b/Applications/DataExplorer/DataView/SaveMeshDialog.cpp index 3529c72010c9583dc873d477ffb54ebe96a235e4..f9658bdb2ed74f7032f59bd283f8f875f5224167 100644 --- a/Applications/DataExplorer/DataView/SaveMeshDialog.cpp +++ b/Applications/DataExplorer/DataView/SaveMeshDialog.cpp @@ -80,7 +80,7 @@ void SaveMeshDialog::accept() int dataMode = this->dataModeBox->currentIndex(); bool compress (this->compressionCheckBox->isChecked()); - FileIO::VtuInterface vtkIO(&_mesh, dataMode, compress); + MeshLib::IO::VtuInterface vtkIO(&_mesh, dataMode, compress); vtkIO.writeToFile(file_name.toStdString().c_str()); } if (fi.suffix().toLower() == "msh") diff --git a/Applications/Utils/FileConverter/GMSH2OGS.cpp b/Applications/Utils/FileConverter/GMSH2OGS.cpp index ca795b9ff1a61fd43e13dceccf944299458c65fb..73433fb0e3fc1aadddd9ad55950da564a0937f63 100644 --- a/Applications/Utils/FileConverter/GMSH2OGS.cpp +++ b/Applications/Utils/FileConverter/GMSH2OGS.cpp @@ -121,7 +121,7 @@ int main (int argc, char* argv[]) ogs_mesh_fname += ".vtu"; } INFO("Writing %s.", ogs_mesh_fname.c_str()); - FileIO::VtuInterface mesh_io(mesh); + MeshLib::IO::VtuInterface mesh_io(mesh); mesh_io.writeToFile(ogs_mesh_fname); } INFO("\tDone."); diff --git a/Applications/Utils/FileConverter/OGS2VTK.cpp b/Applications/Utils/FileConverter/OGS2VTK.cpp index 80965c42f970d9cac15f9643034a5cdc03cb4086..4b8260390a06cf4e3ef42e2d016e51fcc0b71a69 100644 --- a/Applications/Utils/FileConverter/OGS2VTK.cpp +++ b/Applications/Utils/FileConverter/OGS2VTK.cpp @@ -51,7 +51,7 @@ int main (int argc, char* argv[]) MeshLib::Mesh* mesh (MeshLib::IO::readMeshFromFile(mesh_in.getValue())); INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements()); - FileIO::VtuInterface vtu(mesh); + MeshLib::IO::VtuInterface vtu(mesh); vtu.writeToFile(mesh_out.getValue()); delete custom_format; diff --git a/Applications/Utils/FileConverter/TIN2VTK.cpp b/Applications/Utils/FileConverter/TIN2VTK.cpp index 9106f78bc1de0829204d190be1c922e09a0c0080..a839ab5d2fcb4578a52605e449b972a0e3679619 100644 --- a/Applications/Utils/FileConverter/TIN2VTK.cpp +++ b/Applications/Utils/FileConverter/TIN2VTK.cpp @@ -70,7 +70,7 @@ int main (int argc, char* argv[]) INFO("Mesh created: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements()); INFO("Write it into VTU"); - FileIO::VtuInterface writer(mesh.get()); + MeshLib::IO::VtuInterface writer(mesh.get()); writer.writeToFile(outArg.getValue()); delete custom_format; diff --git a/Applications/Utils/FileConverter/VTK2OGS.cpp b/Applications/Utils/FileConverter/VTK2OGS.cpp index bd258e45b81f37eedbc1b5e10e44d4bfae9e73b9..7e902882b705297294d92473fdd8ac057b620fdc 100644 --- a/Applications/Utils/FileConverter/VTK2OGS.cpp +++ b/Applications/Utils/FileConverter/VTK2OGS.cpp @@ -47,7 +47,7 @@ int main (int argc, char* argv[]) cmd.add(mesh_out); cmd.parse(argc, argv); - MeshLib::Mesh* mesh (FileIO::VtuInterface::readVTUFile(mesh_in.getValue())); + MeshLib::Mesh* mesh (MeshLib::IO::VtuInterface::readVTUFile(mesh_in.getValue())); INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements()); MeshLib::IO::Legacy::MeshIO meshIO; diff --git a/Applications/Utils/FileConverter/VTK2TIN.cpp b/Applications/Utils/FileConverter/VTK2TIN.cpp index e716699991062bb21da473f48dd7b8f2b0478a9d..5352fc93909f844973d38ed2304261f8b2ef41c1 100644 --- a/Applications/Utils/FileConverter/VTK2TIN.cpp +++ b/Applications/Utils/FileConverter/VTK2TIN.cpp @@ -54,7 +54,7 @@ int main (int argc, char* argv[]) cmd.add(mesh_out); cmd.parse(argc, argv); - std::unique_ptr<MeshLib::Mesh> mesh (FileIO::VtuInterface::readVTUFile(mesh_in.getValue())); + std::unique_ptr<MeshLib::Mesh> mesh (MeshLib::IO::VtuInterface::readVTUFile(mesh_in.getValue())); INFO("Mesh read: %d nodes, %d elements.", mesh->getNNodes(), mesh->getNElements()); INFO("Converting the mesh to TIN"); diff --git a/Applications/Utils/MeshEdit/MoveMesh.cpp b/Applications/Utils/MeshEdit/MoveMesh.cpp index ff306cbfa91f303c23c7f568ef77ee203ccc97d8..88d0234492435157870c52d62b544a4ae226c137 100644 --- a/Applications/Utils/MeshEdit/MoveMesh.cpp +++ b/Applications/Utils/MeshEdit/MoveMesh.cpp @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) out_fname += "_displaced.vtu"; } - FileIO::VtuInterface mesh_io(mesh); + MeshLib::IO::VtuInterface mesh_io(mesh); mesh_io.writeToFile(out_fname); delete mesh; diff --git a/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp b/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp index 5507d08f8163752c279055998649f3154dde7842..16bdb49ada6e7f44d19cb7ce0f7be8d6f7099675 100644 --- a/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp +++ b/Applications/Utils/OGSFileConverter/OGSFileConverter.cpp @@ -123,7 +123,7 @@ void OGSFileConverter::convertVTU2MSH(const QStringList &input, const QString &o if (fileExists(output_str)) continue; - MeshLib::Mesh const*const mesh (FileIO::VtuInterface::readVTUFile(it->toStdString().c_str())); + MeshLib::Mesh const*const mesh (MeshLib::IO::VtuInterface::readVTUFile(it->toStdString().c_str())); if (mesh == nullptr) { OGSError::box("Error reading mesh " + fi.fileName()); @@ -157,7 +157,7 @@ void OGSFileConverter::convertMSH2VTU(const QStringList &input, const QString &o OGSError::box("Error reading mesh " + fi.fileName()); continue; } - FileIO::VtuInterface vtu(mesh); + MeshLib::IO::VtuInterface vtu(mesh); vtu.writeToFile(output_str); delete mesh; } diff --git a/MeshLib/IO/VtkIO/VtuInterface-impl.h b/MeshLib/IO/VtkIO/VtuInterface-impl.h index 23c7b97cde573270defcb67ce3343bc46c682201..f87f71f9437dcddb9588744a7a01dc2bbf91bb3a 100644 --- a/MeshLib/IO/VtkIO/VtuInterface-impl.h +++ b/MeshLib/IO/VtkIO/VtuInterface-impl.h @@ -26,7 +26,9 @@ #include "InSituLib/VtkMappedMeshSource.h" -namespace FileIO +namespace MeshLib +{ +namespace IO { template<typename UnstructuredGridWriter> @@ -76,4 +78,5 @@ bool VtuInterface::writeVTU(std::string const &file_name, const int num_partitio return (vtuWriter->Write() > 0); } -} +} // end namespace IO +} // end namespace MeshLib diff --git a/MeshLib/IO/VtkIO/VtuInterface.cpp b/MeshLib/IO/VtkIO/VtuInterface.cpp index 8969aa6f74175d5ebbc69e9770ea077781cfb46d..014e58215eb49727b2b6f722671387a178789f5b 100644 --- a/MeshLib/IO/VtkIO/VtuInterface.cpp +++ b/MeshLib/IO/VtkIO/VtuInterface.cpp @@ -35,7 +35,9 @@ #include "MeshLib/Mesh.h" #include "MeshLib/MeshGenerators/VtkMeshConverter.h" -namespace FileIO +namespace MeshLib +{ +namespace IO { VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compress) : @@ -101,5 +103,5 @@ bool VtuInterface::writeToFile(std::string const &file_name) return writeVTU<vtkXMLUnstructuredGridWriter>(file_name); #endif } - -} +} // end namespace IO +} // end namespace MeshLib diff --git a/MeshLib/IO/VtkIO/VtuInterface.h b/MeshLib/IO/VtkIO/VtuInterface.h index 55f3215d4059c8eccdbb43faa7308d3320f594e9..6408d0034af43872c2003a4000ab0a2a5684070d 100644 --- a/MeshLib/IO/VtkIO/VtuInterface.h +++ b/MeshLib/IO/VtkIO/VtuInterface.h @@ -19,10 +19,9 @@ #include <vtkXMLWriter.h> namespace MeshLib { - class Mesh; -} +class Mesh; -namespace FileIO +namespace IO { /** @@ -57,7 +56,8 @@ private: bool _use_compressor; }; -} +} // end namespace IO +} // end namespace MeshLib #include "VtuInterface-impl.h" diff --git a/MeshLib/IO/readMeshFromFile.cpp b/MeshLib/IO/readMeshFromFile.cpp index 5c6e737a7efb2079fbda72a78691c0bd99e0c802..1cd0691e77b1257282d677cf0fb704ccd8f11e6b 100644 --- a/MeshLib/IO/readMeshFromFile.cpp +++ b/MeshLib/IO/readMeshFromFile.cpp @@ -56,7 +56,7 @@ MeshLib::Mesh* readMeshFromFile(const std::string &file_name) } if (BaseLib::hasFileExtension("vtu", file_name)) - return FileIO::VtuInterface::readVTUFile(file_name); + return MeshLib::IO::VtuInterface::readVTUFile(file_name); ERR("readMeshFromFile(): Unknown mesh file format in file %s.", file_name.c_str()); return nullptr; diff --git a/MeshLib/IO/writeMeshToFile.cpp b/MeshLib/IO/writeMeshToFile.cpp index e83cfaf547bf418213b5ac46f0b149cb34cd116d..e15e9cb6ae220b4be3fef5d6a1b5f0fa83b2e41c 100644 --- a/MeshLib/IO/writeMeshToFile.cpp +++ b/MeshLib/IO/writeMeshToFile.cpp @@ -30,7 +30,7 @@ void writeMeshToFile(const MeshLib::Mesh &mesh, const std::string &file_name) meshIO.setMesh(&mesh); meshIO.writeToFile(file_name); } else if (BaseLib::hasFileExtension("vtu", file_name)) { - FileIO::VtuInterface writer(&mesh); + MeshLib::IO::VtuInterface writer(&mesh); writer.writeToFile(file_name); } else { ERR("writeMeshToFile(): Unknown mesh file format in file %s.", file_name.c_str()); diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h index 54acf77aa35b7bcf3fbe2fd0afbc157f5424bc59..cdf0fe4f329d4626e35ee5c1f10042f5eb30ae23 100644 --- a/ProcessLib/Process.h +++ b/ProcessLib/Process.h @@ -101,7 +101,7 @@ public: // Write output file DBUG("Writing output to \'%s\'.", file_name.c_str()); - FileIO::VtuInterface vtu_interface(&_mesh, vtkXMLWriter::Binary, true); + MeshLib::IO::VtuInterface vtu_interface(&_mesh, vtkXMLWriter::Binary, true); vtu_interface.writeToFile(file_name); } diff --git a/Tests/InSituLib/TestVtkMappedMeshSource.cpp b/Tests/InSituLib/TestVtkMappedMeshSource.cpp index 85924f24bf4ea0ea429d332a5d8de75e27baf41d..0599345e61f6499284ec840ad4b67f819faee3fe 100644 --- a/Tests/InSituLib/TestVtkMappedMeshSource.cpp +++ b/Tests/InSituLib/TestVtkMappedMeshSource.cpp @@ -216,7 +216,7 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip) { if(dataMode == vtkXMLWriter::Ascii && compressed) continue; - FileIO::VtuInterface vtuInterface(mesh, dataMode, compressed); + MeshLib::IO::VtuInterface vtuInterface(mesh, dataMode, compressed); ASSERT_TRUE(vtuInterface.writeToFile(test_data_file)); // -- Read back VTK mesh