#include <algorithm>
namespace Geom {
struct Event {
double x;
unsigned ix;
bool closing;
// Lexicographic ordering by x then closing
if(x < other.x) return true;
if(x > other.x) return false;
}
}
};
/**
* \brief Make a list of pairs of self intersections in a list of Rects.
*
* \param rs: vector of Rect.
* \param d: dimension to sweep along
*
* [(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J]
* then A.left <= B.left
*/
}
//if(iter != open.end())
} else {
}
}
}
}
return pairs;
}
/**
* \brief Make a list of pairs of red-blue intersections between two lists of Rects.
*
* \param a: vector of Rect.
* \param b: vector of Rect.
* \param d: dimension to scan along
*
* [(A = rs[i], B = rs[j]) for i,J in enumerate(pairs) for j in J]
* then A.left <= B.left, A in a, B in b
*/
std::vector<std::vector<unsigned> > sweep_bounds(std::vector<Rect> a, std::vector<Rect> b, Dim2 d) {
for(unsigned n = 0; n < 2; n++) {
for(unsigned i = 0; i < sz; i++) {
Rect r = n ? b[i] : a[i];
}
}
{// As elegant as putting the initialiser in the for was, it upsets some legacy compilers (MS VS C++)
unsigned i[] = {0,0};
//std::cout << n << "[" << ix << "] - " << (closing ? "closer" : "opener") << "\n";
if(closing) {
} else {
if(n) {
//n = 1
//opening a B, add to all open a
}
}
} else {
//n = 0
//opening an A, add all open b
}
}
}
}
i[n]++;
}}
return pairs;
}
//Fake cull, until the switch to the real sweep is made.
for(unsigned j = 0; j < b; j++)
for(unsigned i = 0; i < a; i++)
return ret;
}
}
/*
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 :