Wildmeshing Toolkit
UseParentScopeRAII.cpp
Go to the documentation of this file.
1
// clang-format off
2
#include <
wmtk/Mesh.hpp
>
3
#include <
wmtk/PointMesh.hpp
>
4
#include <
wmtk/EdgeMesh.hpp
>
5
#include <
wmtk/TriMesh.hpp
>
6
#include <
wmtk/TetMesh.hpp
>
7
// clang-format on
8
#include <
wmtk/multimesh/MultiMeshVisitor.hpp
>
9
10
namespace
wmtk::multimesh::attribute
{
11
12
UseParentScopeRAII::UseParentScopeRAII
(
Mesh
& mesh)
13
: m_mesh(mesh)
14
{
15
auto
run = [](
auto
&& m) {
16
if
constexpr (!std::is_const_v<std::decay_t<decltype(m)>>) {
17
m.m_attribute_manager.change_to_parent_scope();
18
}
19
};
20
MultiMeshVisitor
visitor(run);
21
visitor.
execute_from_root
(
m_mesh
);
22
}
23
UseParentScopeRAII::~UseParentScopeRAII
()
24
{
25
auto
run = [](
auto
&& m) {
26
if
constexpr (!std::is_const_v<std::decay_t<decltype(m)>>) {
27
m.m_attribute_manager.change_to_child_scope();
28
}
29
};
30
MultiMeshVisitor
visitor(run);
31
visitor.
execute_from_root
(
m_mesh
);
32
}
33
}
// namespace wmtk::multimesh::attribute
EdgeMesh.hpp
Mesh.hpp
MultiMeshVisitor.hpp
PointMesh.hpp
TetMesh.hpp
TriMesh.hpp
wmtk::Mesh
Definition:
Mesh.hpp:107
wmtk::multimesh::MultiMeshVisitor
Definition:
MultiMeshVisitor.hpp:29
wmtk::multimesh::MultiMeshVisitor::execute_from_root
void execute_from_root(Mesh &mesh)
Definition:
MultiMeshVisitor.hpp:79
wmtk::multimesh::attribute::UseParentScopeRAII::~UseParentScopeRAII
~UseParentScopeRAII()
Definition:
UseParentScopeRAII.cpp:23
wmtk::multimesh::attribute::UseParentScopeRAII::m_mesh
Mesh & m_mesh
Definition:
UseParentScopeRAII.hpp:14
wmtk::multimesh::attribute::UseParentScopeRAII::UseParentScopeRAII
UseParentScopeRAII(Mesh &m)
Definition:
UseParentScopeRAII.cpp:12
wmtk::multimesh::attribute
Definition:
AttributeScopeHandle.cpp:9
src
wmtk
multimesh
attribute
UseParentScopeRAII.cpp
Generated by
1.9.1