Wildmeshing Toolkit
Loading...
Searching...
No Matches
MeshCollection.hpp
Go to the documentation of this file.
1#pragma once
2#include <map>
3#include <memory>
4#include "NamedMultiMesh.hpp"
5
7
8class InputOptions;
10{
11public:
13 template <typename... Args>
15 {
16 return add_mesh(NamedMultiMesh(std::forward<Args>(args)...));
17 }
18 // NamedMultiMesh& add_mesh(const InputOptions& opts);
19
20 const NamedMultiMesh& get_named_multimesh(const std::string_view& path) const;
21 const Mesh& get_mesh(const std::string_view& path) const;
22 bool has_mesh(const std::string_view& path) const;
23 bool has_named_multimesh(const std::string_view& path) const;
24
25 NamedMultiMesh& get_named_multimesh(const std::string_view& path);
26 Mesh& get_mesh(const std::string_view& path);
27
28 // over time meshes can merge and have aliases
29 // Thsi operation removes meshes whose naming structure aren't the root of a naming tree
30 void make_canonical();
31
32 std::map<std::string, const Mesh&> all_meshes() const;
33
34private:
35 std::map<std::string_view, std::unique_ptr<NamedMultiMesh>> m_meshes;
36};
37} // namespace wmtk::components::multimesh
const NamedMultiMesh & get_named_multimesh(const std::string_view &path) const
const Mesh & get_mesh(const std::string_view &path) const
NamedMultiMesh & add_mesh(NamedMultiMesh &&o)
bool has_mesh(const std::string_view &path) const
bool has_named_multimesh(const std::string_view &path) const
std::map< std::string, const Mesh & > all_meshes() const
std::map< std::string_view, std::unique_ptr< NamedMultiMesh > > m_meshes
NamedMultiMesh & emplace_mesh(Args &&... args)