Wildmeshing Toolkit
Loading...
Searching...
No Matches
Swap2dUnroundedVertexInvariant.cpp
Go to the documentation of this file.
2#include <wmtk/Mesh.hpp>
5
6namespace wmtk {
8 const Mesh& m,
10 : Invariant(m, true, false, false)
11 , m_coordinate_handle(coordinate)
12{}
13
15{
16 constexpr static PrimitiveType PV = PrimitiveType::Vertex;
17 constexpr static PrimitiveType PE = PrimitiveType::Edge;
18 constexpr static PrimitiveType PF = PrimitiveType::Triangle;
19
22
23 // get the coords of the vertices
24 // input face end points
25 const std::array<Tuple, 4> vs = {
26 {t.tuple(),
27 mesh().switch_tuple(t.tuple(), PV),
28 mesh().switch_tuples(t.tuple(), {PE, PV}),
29 mesh().switch_tuples(t.tuple(), {PF, PE, PV})}};
30
31 for (const auto& v : vs) {
32 for (int i = 0; i < dim; ++i) {
33 if (!accessor.const_vector_attribute(v)[i].is_rounded()) {
34 return false;
35 }
36 }
37 }
38
39 return true;
40}
41
42} // namespace wmtk
const attribute::Accessor< T, Mesh, D > create_const_accessor(const attribute::MeshAttributeHandle &handle) const
int64_t get_attribute_dimension(const TypedAttributeHandle< T > &handle) const
Definition Mesh.hpp:929
Tuple switch_tuples(const Tuple &tuple, const ContainerType &op_sequence) const
Definition Mesh.hpp:953
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
const attribute::TypedAttributeHandle< Rational > m_coordinate_handle
bool before(const simplex::Simplex &t) const override
Swap2dUnroundedVertexInvariant(const Mesh &m, const attribute::TypedAttributeHandle< Rational > &coordinate)
Handle that represents attributes for some mesh.
const Mesh & mesh() const
Definition Invariant.cpp:35
const Tuple & tuple() const
Definition Simplex.hpp:53
constexpr wmtk::PrimitiveType PF
constexpr PrimitiveType PE
constexpr PrimitiveType PV