Wildmeshing Toolkit
MaxFunctionInvariant.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <optional>
7 #include "Invariant.hpp"
8 
9 namespace wmtk {
10 
11 namespace function {
12 class PerSimplexFunction;
13 }
14 
15 namespace invariants {
16 
18 {
19 public:
21  const PrimitiveType type,
22  const std::shared_ptr<function::PerSimplexFunction>& func,
23  const std::optional<TypedAttributeHandle<Rational>>& coordinate = {});
24 
25  bool before(const simplex::Simplex& simplex) const override;
26 
27  bool after(
28  const std::vector<Tuple>& top_dimension_tuples_before,
29  const std::vector<Tuple>& top_dimension_tuples_after) const override;
30 
31 private:
32  std::shared_ptr<function::PerSimplexFunction> m_func;
34  const std::optional<TypedAttributeHandle<Rational>> m_coordinate_handle;
35  mutable bool was_v0_rounded;
36 };
37 } // namespace invariants
38 } // namespace wmtk
Handle that represents attributes for some mesh.
bool after(const std::vector< Tuple > &top_dimension_tuples_before, const std::vector< Tuple > &top_dimension_tuples_after) const override
std::shared_ptr< function::PerSimplexFunction > m_func
const std::optional< TypedAttributeHandle< Rational > > m_coordinate_handle
bool before(const simplex::Simplex &simplex) const override
MaxFunctionInvariant(const PrimitiveType type, const std::shared_ptr< function::PerSimplexFunction > &func, const std::optional< TypedAttributeHandle< Rational >> &coordinate={})
Definition: Accessor.hpp:6