CrossingSet reverse_tb(CrossingSet const &cr, unsigned split, std::vector<double> max) { CrossingSet ret; for(unsigned i = 0; i < cr.size(); i++) { Crossings res = reverse_tb(cr[i], split, max); if(i >= split) std::reverse(res.begin(), res.end()); ret.push_back(res); } return ret; }
void mark_crossings(cairo_t* cr, std::vector<Path> &a) { CrossingSet crs = crossings_among(a); for(unsigned i = 0; i < crs.size(); i++) { for(unsigned j = 0; j < crs[i].size(); j++) { Crossing cur = crs[i][j]; draw_cross(cr, a[i].pointAt(cur.a == i ? cur.ta : cur.tb)); cairo_stroke(cr); } } }
Edges edges(std::vector<Path> const &ps, CrossingSet const &crs) { Edges ret = Edges(); for(unsigned i = 0; i < crs.size(); i++) { Edges temp = edges(ps[i], crs[i], i); append(ret, temp); } return ret; }