Wildmeshing Toolkit
TagIntersection.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <deque>
4 #include <wmtk/TetMesh.hpp>
5 #include <wmtk/TriMesh.hpp>
6 #include <wmtk/io/HDF5Writer.hpp>
7 #include <wmtk/io/MeshReader.hpp>
10 #include <wmtk/utils/Logger.hpp>
11 
12 namespace wmtk {
13 namespace components {
18 class TagAttribute
19 {
20 public:
21  attribute::Accessor<int64_t> m_tag_accessor; // access primitives' tag value
22  PrimitiveType m_ptype; // record this tag attribute's primitivetype
23  int64_t m_tag_val; // a given tagvalue used to check or tag the attributes
24 
26  Mesh& m,
27  const attribute::MeshAttributeHandle& attribute,
28  PrimitiveType ptype,
29  int64_t val)
30  : m_tag_accessor(m.create_accessor<int64_t>(attribute))
31  , m_ptype(ptype)
32  , m_tag_val(val)
33  {}
34 
36 
45  bool is_tagged(Mesh& m, const simplex::Simplex& s) const
46  {
47  if (s.primitive_type() != m_ptype) {
48  return false;
49  }
51  }
52 
60  void set_tag(Mesh& m, const simplex::Simplex& s)
61  {
62  if (s.primitive_type() != m_ptype) {
63  return;
64  }
66  }
67 };
68 
75 {
76 public:
84  Mesh& m,
85  const std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>>& input_tags,
86  const std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>>& output_tags);
87 
88 private:
100  Mesh& m,
101  const simplex::Simplex& s,
102  const std::deque<TagAttribute>& input_tag_attributes);
103 };
104 
105 } // namespace components
106 } // namespace wmtk
T & scalar_attribute(const ArgType &t)
T const_scalar_attribute(const ArgType &t) const
Definition: Accessor.hxx:112
void set_tag(Mesh &m, const simplex::Simplex &s)
attribute::Accessor< int64_t > m_tag_accessor
bool is_tagged(Mesh &m, const simplex::Simplex &s) const
TagAttribute(Mesh &m, const attribute::MeshAttributeHandle &attribute, PrimitiveType ptype, int64_t val)
TagAttribute(TagAttribute &)=delete
bool simplex_is_in_intersection(Mesh &m, const simplex::Simplex &s, const std::deque< TagAttribute > &input_tag_attributes)
Check if a given simplex is in the intersection of a given set of tag attributes.
void compute_intersection(Mesh &m, const std::vector< std::tuple< attribute::MeshAttributeHandle, int64_t >> &input_tags, const std::vector< std::tuple< attribute::MeshAttributeHandle, int64_t >> &output_tags)
const Tuple & tuple() const
Definition: Simplex.hpp:53
PrimitiveType primitive_type() const
Definition: Simplex.hpp:51
Definition: Accessor.hpp:6