Wildmeshing Toolkit
transfer_attribute.cpp
Go to the documentation of this file.
1
2
#include "
transfer_attribute.hpp
"
3
#include <string>
4
#include <
wmtk/Mesh.hpp
>
5
#include <
wmtk/utils/cast_attribute.hpp
>
6
7
namespace
wmtk::multimesh::utils
{
8
wmtk::attribute::MeshAttributeHandle
transfer_attribute
(
9
const
wmtk::attribute::MeshAttributeHandle
& original_handle,
10
Mesh
& m)
11
{
12
const
std::string name = original_handle.
mesh
().
get_attribute_name
(original_handle.
handle
());
13
return
transfer_attribute
(original_handle, m, name);
14
}
15
16
wmtk::attribute::MeshAttributeHandle
transfer_attribute
(
17
const
wmtk::attribute::MeshAttributeHandle
& original_handle,
18
Mesh
& m,
19
const
std::string& new_attribute_name)
20
{
21
return
std::visit(
22
[&](
const
auto
& h) {
23
using
T =
typename
std::decay_t<decltype(h)>::Type;
24
return
wmtk::utils::cast_attribute<T>(original_handle, m, new_attribute_name);
25
},
26
27
original_handle.
handle
());
28
}
29
}
// namespace wmtk::multimesh::utils
Mesh.hpp
cast_attribute.hpp
wmtk::Mesh
Definition:
Mesh.hpp:106
wmtk::Mesh::get_attribute_name
std::string get_attribute_name(const TypedAttributeHandle< T > &handle) const
Definition:
Mesh.hpp:949
wmtk::attribute::MeshAttributeHandle
Definition:
MeshAttributeHandle.hpp:26
wmtk::attribute::MeshAttributeHandle::mesh
Mesh & mesh()
Definition:
MeshAttributeHandle.cpp:18
wmtk::attribute::MeshAttributeHandle::handle
HandleVariant & handle()
Definition:
MeshAttributeHandle.hpp:131
wmtk::multimesh::utils
Definition:
Mesh.hpp:91
wmtk::multimesh::utils::transfer_attribute
wmtk::attribute::MeshAttributeHandle transfer_attribute(const wmtk::attribute::MeshAttributeHandle &original_handle, Mesh &m)
Definition:
transfer_attribute.cpp:8
transfer_attribute.hpp
src
wmtk
multimesh
utils
transfer_attribute.cpp
Generated by
1.9.1