Wildmeshing Toolkit
Loading...
Searching...
No Matches
Simplex.cpp
Go to the documentation of this file.
1#include "Simplex.hpp"
2
3#include <tuple>
4#include <wmtk/Mesh.hpp>
5namespace wmtk::simplex {
6
7Simplex::Simplex(const Mesh& m, const PrimitiveType& ptype, const Tuple& t)
8#if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING)
9 : Simplex(ptype, t, m.id(t, ptype))
10#else
11 : Simplex(ptype, t)
12#endif
13{}
14
15#if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING)
16bool Simplex::operator==(const Simplex& o) const
17{
18 return m_primitive_type == o.m_primitive_type && m_index == o.m_index;
19}
20
21bool Simplex::operator<(const Simplex& o) const
22{
23 return std::tie(m_primitive_type, m_index) < std::tie(o.m_primitive_type, o.m_index);
24}
25#endif
26} // namespace wmtk::simplex
int64_t id(const Tuple &tuple, PrimitiveType type) const
return the global id of the Tuple of the given dimension
Definition Mesh.hpp:1006
The Tuple is the basic navigation tool in our mesh data structure.
Definition Tuple.hpp:19
PrimitiveType m_primitive_type
Definition Simplex.hpp:31