13 auto mptr = std::make_unique<NamedMultiMesh>(std::move(m));
14 auto [it, did] =
m_meshes.emplace(mptr->root_name(), std::move(mptr));
38 if (nmm_name.empty() &&
m_meshes.size() == 1) {
49 return nmm.has_mesh(path);
57 #if defined(WMTK_ENABLED_CPP20)
62 const auto nmm_name = *split.begin();
63 if (nmm_name.empty() &&
m_meshes.size() == 1) {
64 wmtk::logger().debug(
"MeshCollection accessed with an empty name, but has only 1 mesh so "
65 "assuming that is the right mesh");
69 std::vector<std::string_view> names;
73 std::back_inserter(names),
74 [](
const auto& pr) { return pr.first; });
76 "Was unable to find root mesh name {} among {} names [{}] in MeshCollection",
79 fmt::join(names,
","));
87 #if defined(WMTK_ENABLED_CPP20)
92 const auto nmm_name = *split.begin();
93 if (nmm_name.empty() &&
m_meshes.size() == 1) {
94 wmtk::logger().debug(
"MeshCollection accessed with an empty name, but has only 1 mesh so "
95 "assuming that is the right mesh");
100 }
catch (
const std::runtime_error& e) {
101 wmtk::logger().warn(
"Failed to find mesh named {} in mesh list. Path was ", nmm_name, path);
109 std::map<std::string, const Mesh&> meshes;
110 for (
const auto& [name, nnptr] :
m_meshes) {
111 const auto pr = nnptr->all_meshes();
112 meshes.insert(pr.begin(), pr.end());
120 if (it->second->root().is_multi_mesh_root()) {
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
Mesh & get_mesh(const std::string_view &path) const
auto split_path(const std::string_view &view)
spdlog::logger & logger()
Retrieves the current logger.