Wildmeshing Toolkit
OrOperationSequence.cpp
Go to the documentation of this file.
2 
3 
4 namespace wmtk::operations {
5 
6 
8  Mesh& mesh,
9  const std::vector<std::shared_ptr<Operation>>& operations)
10  : OperationSequence(mesh, operations)
11 {}
12 
14 
15 
16 std::vector<simplex::Simplex> OrOperationSequence::execute_operations(
17  const simplex::Simplex& simplex)
18 {
19  assert(!m_operations.empty());
20  for (auto& o : m_operations) {
21  const auto out = (*o)(simplex);
22  if (!out.empty()) return out;
23  }
24 
25  return {};
26 }
27 
28 
29 } // namespace wmtk::operations
std::vector< std::shared_ptr< Operation > > m_operations
OrOperationSequence(Mesh &mesh, const std::vector< std::shared_ptr< Operation >> &operations={})
std::vector< simplex::Simplex > execute_operations(const simplex::Simplex &simplex) override