-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps.cpp
More file actions
119 lines (99 loc) · 2.3 KB
/
maps.cpp
File metadata and controls
119 lines (99 loc) · 2.3 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include "maps.h"
int main () {
DCELHandler make;
int n, m;
cin >> n;
vector <Edge> v;
vector <Pt> p;
for (int i = 0; i < n; i++) {
double x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
v.push_back (Edge (x1, y1, x2, y2));
}
cin >> m;
for (int i = 0; i < m; i++) {
double x, y;
cin >> x >> y;
p.push_back (Pt (x, y));
}
auto A = make.construct (v);
make.fill (A, p);
cin >> n;
v.clear ();
for (int i = 0; i < n; i++) {
double x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
v.push_back (Edge (x1, y1, x2, y2));
}
cin >> m;
p.clear ();
for (int i = 0; i < m; i++) {
double x, y;
cin >> x >> y;
p.push_back (Pt (x, y));
}
auto B = make.construct (v);
make.fill (B, p);
auto AB = make.merge (A, B);
cout << "START AB---------------------------------------\n";
cout << A.outer_bound << ' ' << B.outer_bound << endl;
for (Face* f : A.f) {
if (f -> painted) cout << "Painted!\n";
for (auto k : f -> inner) {
cout << "Inner:\n";
cout << f << ' ';
make.report (k);
for (halfEdge* e = k -> next; e != k; e = e -> next) {
cout << f << ' ';
make.report (e);
}
}
cout << "Outer:\n";
cout << f << ' ';
make.report (f -> outer);
for (halfEdge* e = f -> outer -> next; e != f -> outer; e = e -> next) {
cout << f << ' ';
make.report (e);
}
}
cout << "----------------------------\n";
for (Face* f : B.f) {
if (f -> painted) cout << "Painted!\n";
for (auto k : f -> inner) {
cout << "Inner:\n";
cout << f << ' ';
make.report (k);
for (halfEdge* e = k -> next; e != k; e = e -> next) {
cout << f << ' ';
make.report (e);
}
}
cout << "Outer:\n";
cout << f << ' ';
make.report (f -> outer);
for (halfEdge* e = f -> outer -> next; e != f -> outer; e = e -> next) {
cout << f << ' ';
make.report (e);
}
}
cout << "----------------------------\n";
for (Face* f : AB.f) {
if (f -> painted) cout << "Painted!\n";
for (auto k : f -> inner) {
cout << "Inner:\n";
cout << f << ' ';
make.report (k);
for (halfEdge* e = k -> next; e != k; e = e -> next) {
cout << f << ' ';
make.report (e);
}
}
cout << "Outer:\n";
cout << f << ' ';
make.report (f -> outer);
for (halfEdge* e = f -> outer -> next; e != f -> outer; e = e -> next) {
cout << f << ' ';
make.report (e);
}
}
}