Wildmeshing Toolkit
NewAttributeStrategy.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <functional>
3 #include <wmtk/PrimitiveType.hpp>
4 #include <wmtk/Types.hpp>
7 
9 
10 #include <bitset>
11 
12 namespace wmtk {
13 class Mesh;
14 class Tuple;
15 } // namespace wmtk
16 
17 namespace wmtk::operations {
18 
20 
22 {
23 public:
24  using SimplexPredicateType = std::function<bool(const simplex::Simplex&)>;
25 
27 
28  virtual bool matches_attribute(const attribute::MeshAttributeHandle&) const = 0;
29  virtual void update_handle_mesh(Mesh&) = 0;
30 
31  virtual PrimitiveType primitive_type() const = 0;
32 
33  virtual Mesh& mesh() = 0;
34  const Mesh& mesh() const;
35 
38 
39  std::bitset<2> evaluate_predicate(PrimitiveType pt, const std::array<Tuple, 2>& simplices)
40  const;
41 
42  std::vector<wmtk::attribute::MeshAttributeHandle> sources() const final override { return {}; }
43 
44  virtual bool invalid_state() const = 0;
45  virtual std::string name() const = 0;
46 
47 protected:
48 private:
50 };
51 
52 } // namespace wmtk::operations
virtual std::string name() const =0
virtual bool invalid_state() const =0
void set_simplex_predicate(SimplexPredicateType &&f)
virtual bool matches_attribute(const attribute::MeshAttributeHandle &) const =0
virtual PrimitiveType primitive_type() const =0
std::bitset< 2 > evaluate_predicate(PrimitiveType pt, const std::array< Tuple, 2 > &simplices) const
std::vector< wmtk::attribute::MeshAttributeHandle > sources() const final override
virtual void update_handle_mesh(Mesh &)=0
std::function< bool(const simplex::Simplex &)> SimplexPredicateType
Definition: Accessor.hpp:6