-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdgt_print.hpp
51 lines (39 loc) · 1.01 KB
/
dgt_print.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "p3a_grid3.hpp"
#include "p3a_static_vector.hpp"
#include "dgt_point.hpp"
namespace p3a {
template <class T>
inline std::ostream& operator<<(std::ostream& os, vector3<T> const& v) {
os << "[" << v.x() << ", " << v.y() << ", " << v.z() << "]";
return os;
}
template <class T>
inline std::ostream& operator<<(std::ostream& os, box3<T> const& b) {
os << b.lower() << "<->" << b.upper();
return os;
}
inline std::ostream& operator<<(std::ostream& os, grid3 const& g) {
os << g.extents();
return os;
}
inline std::ostream& operator<<(std::ostream& os, subgrid3 const& s) {
os << s.lower() << "<->" << s.upper();
return os;
}
template <class T, int N>
inline std::ostream& operator<<(std::ostream& os, static_vector<T, N> const& v) {
os << "[";
for (int i = 0; i < N-1; ++i) {
os << v[i] << ", ";
}
os << v[N-1] << "]";
return os;
}
}
namespace dgt {
inline std::ostream& operator<<(std::ostream& os, Point const& pt) {
os << "["<< pt.depth << "], " << pt.ijk;
return os;
}
}