Wildmeshing Toolkit
RoundedInvariant.cpp
Go to the documentation of this file.
1 #include "RoundedInvariant.hpp"
2 #include <wmtk/Mesh.hpp>
3 
5 
6 namespace wmtk {
7 
9  const Mesh& m,
11  bool inverse_flag)
12  : Invariant(m)
13  , m_coordinate_handle(coordinate)
14  , inverse(inverse_flag)
15 {}
16 
18 {
21 
22  for (int i = 0; i < dim; ++i) {
23  if (!accessor.const_vector_attribute(t.tuple())[i].is_rounded()) return inverse;
24  }
25 
26  return !inverse;
27 }
28 
29 } // 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:944
RoundedInvariant(const Mesh &m, const attribute::TypedAttributeHandle< Rational > &coordinate, bool inverse_flag=false)
Construct a new Rounded Invariant object.
const attribute::TypedAttributeHandle< Rational > m_coordinate_handle
bool before(const simplex::Simplex &t) const override
Handle that represents attributes for some mesh.
const Mesh & mesh() const
Definition: Invariant.cpp:35
const Tuple & tuple() const
Definition: Simplex.hpp:53
Definition: Accessor.hpp:6