Wildmeshing Toolkit
read_mesh.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <filesystem>
3 #include <memory>
4 #include <vector>
5 
6 namespace wmtk {
7 class Mesh;
8 }
9 namespace wmtk::io {
10 
11 enum class FileType { Auto, Msh, HDF5 };
12 
13 namespace utils {
14 FileType guess_file_type(const std::string_view& file_name);
15 // expects things like ".msh" or ".hdf5", unknown results return auto
16 FileType guess_file_type_from_extension(const std::string_view& suffix);
17 } // namespace utils
18 
19 std::shared_ptr<Mesh> read_mesh(const std::filesystem::path& filename, FileType file_type);
20 
21 std::shared_ptr<Mesh> read_mesh(
22  const std::filesystem::path& filename,
23  const std::vector<std::vector<std::string>>& retrieved_attributes,
24  FileType file_type = FileType::Auto);
25 
26 std::shared_ptr<Mesh> read_mesh(
27  const std::filesystem::path& filename,
28  const bool ignore_z_if_zero = false,
29  const std::vector<std::string>& tetrahedron_attributes = {},
30  FileType file_type = FileType::Auto);
31 
32 
33 } // namespace wmtk::io
FileType guess_file_type(const std::filesystem::path &filename)
Definition: read_mesh.cpp:20
FileType guess_file_type_from_extension(const std::string_view &suffix)
Definition: read_mesh.cpp:9
std::shared_ptr< Mesh > read_mesh(const std::filesystem::path &filename, FileType file_type)
Definition: read_mesh.cpp:35
Definition: Accessor.hpp:6