Wildmeshing Toolkit
Dart.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <cinttypes>
3 #include <string>
4 #include <tuple>
5 
6 namespace wmtk::autogen {
7 class Dart : public std::tuple<int64_t, int8_t>
8 {
9 public:
10  using tuple_type = std::tuple<int64_t, int8_t>;
11  using tuple_type::tuple_type;
12  Dart()
13  : Dart(-1, -1)
14  {}
15  int64_t& global_id() { return std::get<0>(*this); }
16  int64_t global_id() const { return std::get<0>(*this); }
17 
18  int8_t& local_orientation() { return std::get<1>(*this); }
19  int8_t local_orientation() const { return std::get<1>(*this); }
20 
21  bool is_null() const { return global_id() == -1; }
22 
23  operator std::string() const;
24 
25  const tuple_type& as_tuple() const { return static_cast<const tuple_type&>(*this); }
26 };
27 } // namespace wmtk::autogen
28 auto operator<<(std::ostream& out, const wmtk::autogen::Dart& vec) -> std::ostream&;
auto operator<<(std::ostream &out, const wmtk::autogen::Dart &vec) -> std::ostream &
Definition: Dart.cpp:10
int8_t local_orientation() const
Definition: Dart.hpp:19
int64_t global_id() const
Definition: Dart.hpp:16
bool is_null() const
Definition: Dart.hpp:21
int8_t & local_orientation()
Definition: Dart.hpp:18
std::tuple< int64_t, int8_t > tuple_type
Definition: Dart.hpp:10
const tuple_type & as_tuple() const
Definition: Dart.hpp:25
int64_t & global_id()
Definition: Dart.hpp:15