namespace Geom {
//bool edge_involved_in(Edge const &e, Crossing const &c) {
// if(e.path == c.a) {
// } else if(e.path == c.b) {
// }
// return false;
//}
if(rev) {
} else {
}
} else {
} else {
}
}
}
/*
CrossingGraph create_crossing_graph(PathVector const &p, Crossings const &crs) {
std::vector<Point> locs;
CrossingGraph ret;
for(unsigned i = 0; i < crs.size(); i++) {
Point pnt = p[crs[i].a].pointAt(crs[i].ta);
unsigned j = 0;
for(; j < locs.size(); j++) {
if(are_near(pnt, locs[j])) break;
}
if(j == locs.size()) {
ret.push_back(CrossingNode());
locs.push_back(pnt);
}
ret[j].add_edge(Edge(crs[i].a, crs[i].ta, false));
ret[j].add_edge(Edge(crs[i].a, crs[i].ta, true));
ret[j].add_edge(Edge(crs[i].b, crs[i].tb, false));
ret[j].add_edge(Edge(crs[i].b, crs[i].tb, true));
}
for(unsigned i = 0; i < ret.size(); i++) {
for(unsigned j = 0; j < ret[i].edges.size(); j++) {
unsigned pth = ret[i].edges[j].path;
double t = ret[i].edges[j].time;
bool rev = ret[i].edges[j].reverse;
double size = p[pth].size()+1;
double best = size;
unsigned bix = ret.size();
for(unsigned k = 0; k < ret.size(); k++) {
for(unsigned l = 0; l < ret[k].edges.size(); l++) {
if(ret[i].edges[j].path == ret[k].edges[l].path && (k != i || l != j)) {
double d = wrap_dist(t, ret[i].edges[j].time, size, rev);
if(d < best) {
best = d;
bix = k;
}
}
}
}
if(bix == ret.size()) {
std::cout << "couldn't find an adequate next-crossing node";
bix = i;
}
ret[i].edges[j].node = bix;
}
}
return ret;
*/
/* Various incoherent code bits
// list of sets of edges, each set corresponding to those emanating from the path
CrossingGraph ret;
std::vector<Edge> edges(crs.size());
std::vector<std::vector<bool> > used;
unsigned i, j;
do {
first_false(used, i, j);
CrossingNode cn;
do {
unsigned di = i, dj = j;
crossing_dual(di, dj);
if(!used[di,dj]) {
}
}
} while(!used[i,j])
for(unsigned j = 0; j < crs[i].size(); j++) {
edges.push_back(Edge(i, crs[i][j].getOtherTime(i), false));
edges.push_back(Edge(i, crs[i][j].getOtherTime(i), true));
}
std::sort(edges.begin(), edges.end(), TimeOrder());
for(unsigned j = 0; j < edges.size(); ) {
CrossingNode cn;
double t = edges[j].time;
while(j < edges.size() && are_near(edges[j].time, t)) {
cn.edges.push_back(edges[j]);
}
}
*/
//}
// provide specific method for Paths because paths can be closed or open. Path::size() is named somewhat wrong...
for (unsigned i = 0; i < a.size_default(); i++) {
if (bb) {
}
}
return rs;
}
Crossings n;
sort_crossings(b, i);
a = n;
}
}
}
}
return ret;
}
!i->dir));
}
return ret;
}
}
return ret;
}
}
return ret;
}
// Delete any duplicates in a vector of crossings
// A crossing is considered to be a duplicate when it has both t_a and t_b near to another crossing's t_a and t_b
// For example, duplicates will be found when calculating the intersections of a linesegment with a polygon, if the
// endpoint of that line coincides with a cusp node of the polygon. In that case, an intersection will be found of
// the linesegment with each of the polygon's linesegments extending from the cusp node (i.e. two intersections)
crs.erase((rit + 1).base()); // This +1 and .base() construction is needed to convert to a regular iterator
break; // out of while loop, and continue with next iteration of for loop
}
}
}
}
/* if(cr_a.empty()) return;
//Remove anything with dupes
for(Eraser<Crossings> i(&cr_a); !i.ended(); i++) {
const Crossing cur = *i;
Eraser<Crossings> next(i);
next++;
if(are_near(cur, *next)) {
cr_b.erase(std::find(cr_b.begin(), cr_b.end(), cur));
for(i = next; near(*i, cur); i++) {
cr_b.erase(std::find(cr_b.begin(), cr_b.end(), *i));
}
continue;
}
}
*/
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :