Wildmeshing Toolkit
MeshCollection.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <map>
3 #include <memory>
4 #include "NamedMultiMesh.hpp"
5 
7 
8 class InputOptions;
10 {
11 public:
13  template <typename... Args>
14  NamedMultiMesh& emplace_mesh(Args&&... 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 
34 private:
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
bool has_mesh(const std::string_view &path) const
bool has_named_multimesh(const std::string_view &path) const
NamedMultiMesh & add_mesh(NamedMultiMesh o)
NamedMultiMesh & emplace_mesh(Args &&... args)
std::map< std::string, const Mesh & > all_meshes() const
std::map< std::string_view, std::unique_ptr< NamedMultiMesh > > m_meshes