Wildmeshing Toolkit
RawSimplexCollection.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wmtk/Mesh.hpp>
4 
5 #include "RawSimplex.hpp"
6 
7 namespace wmtk::simplex {
8 class SimplexCollection;
9 
11 {
12 public:
13  RawSimplexCollection(std::vector<RawSimplex>&& simplices = {})
14  : m_simplices(std::move(simplices))
15  {}
16 
17  RawSimplexCollection(SimplexCollection&& sc);
18 
22  const std::vector<RawSimplex>& simplex_vector() const { return m_simplices; }
23 
27  std::vector<RawSimplex> simplex_vector(const int64_t dimension) const;
28 
34  void add(const RawSimplex& simplex);
35 
36  void add(const Mesh& mesh, const Simplex& simplex);
37 
38  void add(const RawSimplexCollection& simplex_collection);
39 
40  void add(const SimplexCollection& simplex_collection);
41 
42  void add(const Mesh& mesh, const PrimitiveType& ptype, const std::vector<Tuple>& tuple_vec);
43 
47  void sort_and_clean();
48 
54  bool contains(const RawSimplex& simplex) const;
55 
62  const RawSimplexCollection& collection_a,
63  const RawSimplexCollection& collection_b);
64 
71  const RawSimplexCollection& collection_a,
72  const RawSimplexCollection& collection_b);
73 
80  const RawSimplexCollection& collection_a,
81  const RawSimplexCollection& collection_b);
82 
83  auto begin() { return m_simplices.begin(); }
84  auto end() { return m_simplices.end(); }
85  auto begin() const { return m_simplices.begin(); }
86  auto end() const { return m_simplices.end(); }
87  auto cbegin() const { return m_simplices.cbegin(); }
88  auto cend() const { return m_simplices.cend(); }
89 
90 private:
91  std::vector<RawSimplex> m_simplices;
92 };
93 
94 } // namespace wmtk::simplex
static bool are_simplex_collections_equal(const RawSimplexCollection &collection_a, const RawSimplexCollection &collection_b)
Check if the two simplex collections are equal.
void add(const RawSimplex &simplex)
Add simplex to the collection.
bool contains(const RawSimplex &simplex) const
Check if simplex is contained in collection.
static RawSimplexCollection get_intersection(const RawSimplexCollection &collection_a, const RawSimplexCollection &collection_b)
Get intersection of two simplex collections.
static RawSimplexCollection get_union(const RawSimplexCollection &collection_a, const RawSimplexCollection &collection_b)
Get union of two simplex collections.
RawSimplexCollection(std::vector< RawSimplex > &&simplices={})
void sort_and_clean()
Sort simplex vector and remove duplicates.
const std::vector< RawSimplex > & simplex_vector() const
Return const reference to the RawSimplex vector.
A meshless implementation of the simplex that just stores an array of ids.
Definition: RawSimplex.hpp:20