-
Notifications
You must be signed in to change notification settings - Fork 0
/
DebugHelper.cpp
68 lines (55 loc) · 1.96 KB
/
DebugHelper.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "DebugHelper.h"
std::ostream& operator<<(std::ostream& os, const QVector3D& vector) {
os << "(" << vector.x() << ", " << vector.y() << ", " << vector.z() << ")";
return os;
}
std::ostream& operator<<(std::ostream& os, const Mesh::Vertex& vertex) {
os << "[pos=" << vertex.m_position << ", ";
os << "norm=" << vertex.m_normal << ", ";
os << "col=" << vertex.m_color << "]";
return os;
}
std::ostream& operator<<(std::ostream& os, const QVector<int>& indicies) {
os << "[" << std::endl;
for (int j = 0; j < indicies.size();j+=3) {
int i1 = indicies[j];
int i2 = indicies[j + 1];
int i3 = indicies[j + 2];
os << "(" << i1 << ", " << i2 << ", " << i3 << ")" << std::endl;
}
os << "]" << std::endl;
return os;
}
std::ostream& operator<<(std::ostream& os, const QVector<Mesh::Vertex>& vertices) {
os << "[" << std::endl;
for (int j = 0; j < vertices.size();++j) {
os << vertices[j] << std::endl;
}
os << "]" << std::endl;
return os;
}
std::ostream& operator<<(std::ostream& os, const Polyhedron::Halfedge_iterator& he) {
os << "[" << he->opposite()->vertex() << " -> " << he->vertex() << "]";
return os;
}
std::ostream& operator<<(std::ostream& os, const std::map<Polyhedron::Halfedge_iterator, int>& edge_map) {
os << "[" << std::endl;
for (auto p : edge_map) {
os << "(" << p.first << ", " << p.second<< ")" << std::endl;
}
os << "]" << std::endl;
return os;
}
std::ostream& operator<<(std::ostream& os, const Polyhedron::Vertex_iterator& v) {
Polyhedron::Point_3 p = v->point();
os << "(" << p.x() << ", " << p.y() << ", " << p.z()<< ")";
return os;
}
std::ostream& operator<<(std::ostream& os, const std::map<Polyhedron::Vertex_iterator, int>& even_map) {
os << "[" << std::endl;
for (auto p : even_map) {
os << "[" << (p.first) << ", " << p.second<< "]" << std::endl;
}
os << "]" << std::endl;
return os;
}