Wildmeshing Toolkit
marching.cpp
Go to the documentation of this file.
1 #include "marching.hpp"
2 
5 
6 #include "MarchingOptions.hpp"
7 #include "internal/Marching.hpp"
8 
9 namespace wmtk::components {
10 
11 void marching(Mesh& mesh, const MarchingOptions& options)
12 {
13  assert(
16 
17 
19  std::map<PrimitiveType, attribute::MeshAttributeHandle> label_handles = options.label_handles;
20 
21  assert(&pos_handle.mesh() == &mesh);
22 
23  Marching mc(pos_handle, label_handles, options.input_values, options.output_value);
24 
25  for (const auto& [filter_handle, filter_value] : options.edge_filter_handles) {
26  mc.add_filter(filter_handle, filter_value);
27  }
28 
30  mc.process();
31 }
32 
33 } // namespace wmtk::components
PrimitiveType top_simplex_type() const
Definition: Mesh.hpp:997
This component implements a marching triangle/tetrahedra.
Definition: Marching.hpp:11
void add_filter(const attribute::MeshAttributeHandle &label, const int64_t value)
Add an edge filter to marching.
Definition: Marching.cpp:361
void process()
Perform the actual marching.
Definition: Marching.cpp:60
void add_pass_through(const attribute::MeshAttributeHandle &pass_through)
Add pass through attributes.
Definition: Marching.cpp:368
void marching(Mesh &mesh, const MarchingOptions &options)
Perform maching tetrahedra/triangles.
Definition: marching.cpp:11
std::vector< std::pair< attribute::MeshAttributeHandle, int64_t > > edge_filter_handles
Filters (int64_t) on edge labels.
attribute::MeshAttributeHandle position_handle
vertex positions (double)
std::vector< int64_t > input_values
The label values (int64_t) in between the marching surface should be placed.
std::vector< attribute::MeshAttributeHandle > pass_through_attributes
Any other attribute goes here.
int64_t output_value
The output label value (int 64_t) is assigned to the marching surface in all primitive types for whic...
std::map< PrimitiveType, attribute::MeshAttributeHandle > label_handles
Labels for inside, outside, and marching surface (int64_t).