Add a critical point where the set of rings using a polygon edge changes

This commit is contained in:
Eric Fischer
2016-10-05 17:16:18 -07:00
parent 04157e7728
commit f7daa05515
5 changed files with 163 additions and 12 deletions
+17 -1
View File
@@ -28,6 +28,22 @@ struct draw {
draw() {
}
bool operator<(draw const &s) const {
if (y < s.y || (y == s.y && x < s.x)) {
return true;
} else {
return false;
}
}
bool operator==(draw const &s) const {
return y == s.y && x == s.x;
}
bool operator!=(draw const &s) const {
return y != s.y || x != s.x;
}
};
typedef std::vector<draw> drawvec;
@@ -43,7 +59,7 @@ drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *reduced, double
drawvec clip_lines(drawvec &geom, int z, int detail, long long buffer);
bool point_within_tile(long long x, long long y, int z, int detail, long long buffer);
int quick_check(long long *bbox, int z, int detail, long long buffer);
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification);
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification, bool already_marked);
drawvec reorder_lines(drawvec &geom);
drawvec fix_polygon(drawvec &geom);
std::vector<drawvec> chop_polygon(std::vector<drawvec> &geoms);