Wildmeshing Toolkit
AttributesUpdate.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Operation.hpp"
4 
5 namespace wmtk::operations {
6 
7 class AttributesUpdate : public Operation
8 {
9 public:
11 
12  virtual PrimitiveType primitive_type() const override { return PrimitiveType::Vertex; }
13 
14 protected:
15  virtual std::vector<simplex::Simplex> unmodified_primitives(
16  const simplex::Simplex& simplex) const override;
17  virtual std::vector<simplex::Simplex> execute(const simplex::Simplex& simplex) override;
18 };
19 
21 {
22 public:
24 
25  using UpdateFunction = std::function<bool(Mesh&, const simplex::Simplex& s)>;
26 
27  std::vector<simplex::Simplex> execute(const simplex::Simplex& simplex) override;
28 
29  void set_function(const UpdateFunction& func) { m_function = func; }
30 
31 private:
33 };
34 
35 } // namespace wmtk::operations
virtual PrimitiveType primitive_type() const override
virtual std::vector< simplex::Simplex > execute(const simplex::Simplex &simplex) override
returns an empty vector in case of failure
virtual std::vector< simplex::Simplex > unmodified_primitives(const simplex::Simplex &simplex) const override
Returns all simplices that will be potentially affected by the operation.
std::vector< simplex::Simplex > execute(const simplex::Simplex &simplex) override
returns an empty vector in case of failure
void set_function(const UpdateFunction &func)
std::function< bool(Mesh &, const simplex::Simplex &s)> UpdateFunction