mirror of
https://github.com/boostorg/polygon.git
synced 2026-02-16 01:32:14 +00:00
syncing with internal version
[SVN r73338]
This commit is contained in:
@@ -445,7 +445,7 @@ namespace boost { namespace polygon{
|
||||
};
|
||||
template <typename S45V>
|
||||
static inline void sortScan45Vector(S45V& vec) {
|
||||
gtlsort(vec.begin(), vec.end(), lessScan45Vertex());
|
||||
polygon_sort(vec.begin(), vec.end(), lessScan45Vertex());
|
||||
}
|
||||
|
||||
template <typename CountType, typename output_functor>
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace boost { namespace polygon{
|
||||
Interval rectIvl = nodep->rect.get(orient);
|
||||
leadingEdges.push_back(EdgeAssociation(std::pair<Unit, Interval>(leading, rectIvl), nodep));
|
||||
}
|
||||
gtlsort(leadingEdges.begin(), leadingEdges.end(), lessEdgeAssociation());
|
||||
polygon_sort(leadingEdges.begin(), leadingEdges.end(), lessEdgeAssociation());
|
||||
typename std::vector<EdgeAssociation>::iterator leadingBegin = leadingEdges.begin();
|
||||
iT trailingBegin = beginNode;
|
||||
while(leadingBegin != leadingEdges.end()) {
|
||||
|
||||
@@ -904,7 +904,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 0), 2, -1));
|
||||
data.push_back(Vertex45(Point(10, 10), 2, 1));
|
||||
data.push_back(Vertex45(Point(10, 10), 0, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -928,7 +928,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 10), 2, -1));
|
||||
data.push_back(Vertex45(Point(10, 20), 2, 1));
|
||||
data.push_back(Vertex45(Point(10, 20), 1, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -953,7 +953,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 10), 0, -1));
|
||||
data.push_back(Vertex45(Point(20, 10), 1, -1));
|
||||
data.push_back(Vertex45(Point(20, 10), 0, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1018,7 +1018,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(12, 8), 1, -1));
|
||||
// result == 12 8 -1 1
|
||||
data.push_back(Vertex45(Point(12, 8), -1, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1051,7 +1051,7 @@ namespace boost { namespace polygon{
|
||||
stdcout << "scanning\n";
|
||||
scan45.scan(result, vertices.begin(), vertices.end());
|
||||
|
||||
gtlsort(result.begin(), result.end());
|
||||
polygon_sort(result.begin(), result.end());
|
||||
pf.scan(polys, result.begin(), result.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1123,7 +1123,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(8, 6), -1, -1));
|
||||
data.push_back(Vertex45(Point(8, 6), 1, 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1195,7 +1195,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 8), -1, -1));
|
||||
data.push_back(Vertex45(Point(10, 8), 1, 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1239,7 +1239,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 22), 2, -1));
|
||||
data.push_back(Vertex45(Point(10, 22), 0, -1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1668,7 +1668,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 0), 2, -1));
|
||||
data.push_back(Vertex45(Point(10, 10), 2, 1));
|
||||
data.push_back(Vertex45(Point(10, 10), 0, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1692,7 +1692,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 10), 2, -1));
|
||||
data.push_back(Vertex45(Point(10, 20), 2, 1));
|
||||
data.push_back(Vertex45(Point(10, 20), 1, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1716,7 +1716,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 10), 0, -1));
|
||||
data.push_back(Vertex45(Point(20, 10), 1, -1));
|
||||
data.push_back(Vertex45(Point(20, 10), 0, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1742,7 +1742,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 10), 0, 1));
|
||||
data.push_back(Vertex45(Point(20, 20), 1, 1));
|
||||
data.push_back(Vertex45(Point(20, 20), 2, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1768,7 +1768,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(20, 10), 0, 1));
|
||||
data.push_back(Vertex45(Point(20, -10), -1, -1));
|
||||
data.push_back(Vertex45(Point(20, -10), 2, -1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1801,7 +1801,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(2, 2), 0, 1));
|
||||
data.push_back(Vertex45(Point(3, 2), 1, 1));
|
||||
data.push_back(Vertex45(Point(3, 2), 0, -1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1835,7 +1835,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(2, 2), 2, -1));
|
||||
data.push_back(Vertex45(Point(2, 2), 0, -1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1899,7 +1899,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(12, 8), 1, -1));
|
||||
// result == 12 8 -1 1
|
||||
data.push_back(Vertex45(Point(12, 8), -1, 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1933,7 +1933,7 @@ namespace boost { namespace polygon{
|
||||
stdcout << "scanning\n";
|
||||
scan45.scan(result, vertices.begin(), vertices.end());
|
||||
|
||||
gtlsort(result.begin(), result.end());
|
||||
polygon_sort(result.begin(), result.end());
|
||||
pf.scan(polys, result.begin(), result.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2005,7 +2005,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(8, 6), -1, -1));
|
||||
data.push_back(Vertex45(Point(8, 6), 1, 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2077,7 +2077,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 8), -1, -1));
|
||||
data.push_back(Vertex45(Point(10, 8), 1, 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2121,7 +2121,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(Vertex45(Point(10, 22), 2, -1));
|
||||
data.push_back(Vertex45(Point(10, 22), 0, -1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace boost { namespace polygon{
|
||||
// orient_ = orient;
|
||||
// output_.clear();
|
||||
// output_.insert(output_.end(), input_begin, input_end);
|
||||
// gtlsort(output_.begin(), output_.end());
|
||||
// polygon_sort(output_.begin(), output_.end());
|
||||
// }
|
||||
};
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace boost { namespace polygon{
|
||||
template <typename graph_type>
|
||||
static void performTouch(graph_type& graph, TouchSetData& tsd) {
|
||||
|
||||
gtlsort(tsd.begin(), tsd.end(), lessVertex45Compact());
|
||||
polygon_sort(tsd.begin(), tsd.end(), lessVertex45Compact());
|
||||
typedef std::vector<std::pair<Point, typename boolean_op_45<Unit>::template Scan45CountT<CountTouch> > > TSD;
|
||||
TSD tsd_;
|
||||
tsd_.reserve(tsd.size());
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace boost { namespace polygon{
|
||||
// orient_ = orient;
|
||||
// output_.clear();
|
||||
// output_.insert(output_.end(), input_begin, input_end);
|
||||
// gtlsort(output_.begin(), output_.end());
|
||||
// polygon_sort(output_.begin(), output_.end());
|
||||
// }
|
||||
void sort() const {} //is always sorted
|
||||
};
|
||||
|
||||
@@ -1219,7 +1219,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
static inline void sort_vertex_arbitrary_count(vertex_arbitrary_count& count, const Point& pt) {
|
||||
less_half_edge_count lfec(pt);
|
||||
gtlsort(count.begin(), count.end(), lfec);
|
||||
polygon_sort(count.begin(), count.end(), lfec);
|
||||
}
|
||||
|
||||
typedef std::vector<std::pair<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*> > incoming_count;
|
||||
@@ -1243,7 +1243,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
static inline void sort_incoming_count(incoming_count& count, const Point& pt) {
|
||||
less_incoming_count lfec(pt);
|
||||
gtlsort(count.begin(), count.end(), lfec);
|
||||
polygon_sort(count.begin(), count.end(), lfec);
|
||||
}
|
||||
|
||||
static inline void compact_vertex_arbitrary_count(const Point& pt, vertex_arbitrary_count &count) {
|
||||
@@ -1814,7 +1814,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(10, 0), Point(10, 10), -1));
|
||||
data.push_back(vertex_half_edge(Point(10, 10), Point(10, 0), 1));
|
||||
data.push_back(vertex_half_edge(Point(10, 10), Point(0, 10), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1838,7 +1838,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(10, 10), Point(10, 20), -1));
|
||||
data.push_back(vertex_half_edge(Point(10, 20), Point(10, 10), 1));
|
||||
data.push_back(vertex_half_edge(Point(10, 20), Point(0, 10), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1862,7 +1862,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(2, -4), Point(2, 4), -1));
|
||||
data.push_back(vertex_half_edge(Point(2, 4), Point(-2, 2), 1));
|
||||
data.push_back(vertex_half_edge(Point(2, 4), Point(2, -4), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1908,7 +1908,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(10, 22), Point(10, 12), -1));
|
||||
data.push_back(vertex_half_edge(Point(10, 22), Point(2, 22), -1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1955,7 +1955,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(5, 5), -1));
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(5, 2), 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -1995,7 +1995,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(5, 5), -1));
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(4, 1), 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2035,7 +2035,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(5, 5), -1));
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(4, 1), 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2063,7 +2063,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
data.push_back(vertex_half_edge(Point(-1, 4), Point(0, 2), -1));
|
||||
data.push_back(vertex_half_edge(Point(0, 2), Point(-1, 4), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2769,7 +2769,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(10, 0), Point(10, 10), -1));
|
||||
data.push_back(vertex_half_edge(Point(10, 10), Point(10, 0), 1));
|
||||
data.push_back(vertex_half_edge(Point(10, 10), Point(0, 10), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2792,7 +2792,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(10, 10), Point(10, 20), -1));
|
||||
data.push_back(vertex_half_edge(Point(10, 20), Point(10, 10), 1));
|
||||
data.push_back(vertex_half_edge(Point(10, 20), Point(0, 10), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2815,7 +2815,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(2, -4), Point(2, 4), -1));
|
||||
data.push_back(vertex_half_edge(Point(2, 4), Point(-2, 2), 1));
|
||||
data.push_back(vertex_half_edge(Point(2, 4), Point(2, -4), 1));
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2860,7 +2860,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(10, 22), Point(10, 12), -1));
|
||||
data.push_back(vertex_half_edge(Point(10, 22), Point(2, 22), -1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
@@ -2907,7 +2907,7 @@ namespace boost { namespace polygon{
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(5, 5), -1));
|
||||
data.push_back(vertex_half_edge(Point(7, 2), Point(5, 2), 1));
|
||||
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(polys, data.begin(), data.end());
|
||||
stdcout << "result size: " << polys.size() << std::endl;
|
||||
for(std::size_t i = 0; i < polys.size(); ++i) {
|
||||
|
||||
14
include/boost/polygon/detail/polygon_sort_adaptor.hpp
Executable file → Normal file
14
include/boost/polygon/detail/polygon_sort_adaptor.hpp
Executable file → Normal file
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
//! @brief gtlsort_adaptor default implementation that calls std::sort
|
||||
//! @brief polygon_sort_adaptor default implementation that calls std::sort
|
||||
namespace boost {
|
||||
namespace polygon {
|
||||
|
||||
@@ -23,9 +23,9 @@ namespace boost {
|
||||
typedef int unit_type; // default GTL unit
|
||||
};
|
||||
|
||||
//! @brief gtlsort_adaptor default implementation that calls std::sort
|
||||
//! @brief polygon_sort_adaptor default implementation that calls std::sort
|
||||
template<typename T>
|
||||
struct gtlsort_adaptor {
|
||||
struct polygon_sort_adaptor {
|
||||
//! @brief wrapper that mimics std::sort() function and takes
|
||||
// the same arguments
|
||||
template<typename RandomAccessIterator_Type>
|
||||
@@ -47,17 +47,17 @@ namespace boost {
|
||||
|
||||
//! @brief user level wrapper for sorting quantities
|
||||
template <typename iter_type>
|
||||
void gtlsort(iter_type _b_, iter_type _e_)
|
||||
void polygon_sort(iter_type _b_, iter_type _e_)
|
||||
{
|
||||
gtlsort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_);
|
||||
polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_);
|
||||
}
|
||||
|
||||
//! @brief user level wrapper for sorting quantities that takes predicate
|
||||
// as additional argument
|
||||
template <typename iter_type, typename pred_type>
|
||||
void gtlsort(iter_type _b_, iter_type _e_, const pred_type& _pred_)
|
||||
void polygon_sort(iter_type _b_, iter_type _e_, const pred_type& _pred_)
|
||||
{
|
||||
gtlsort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_, _pred_);
|
||||
polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_, _pred_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
inline void perform_merge(result_type& result, property_merge_data& data) {
|
||||
if(data.empty()) return;
|
||||
//sort
|
||||
gtlsort(data.begin(), data.end(), less_vertex_data<vertex_property>());
|
||||
polygon_sort(data.begin(), data.end(), less_vertex_data<vertex_property>());
|
||||
//scanline
|
||||
bool firstIteration = true;
|
||||
scanlinePosition = scanline.end();
|
||||
@@ -442,7 +442,7 @@ private:
|
||||
inline void performExtract(T& result, property_merge_data& data) {
|
||||
if(data.empty()) return;
|
||||
//sort
|
||||
gtlsort(data.begin(), data.end(), less_vertex_data<vertex_property>());
|
||||
polygon_sort(data.begin(), data.end(), less_vertex_data<vertex_property>());
|
||||
|
||||
//scanline
|
||||
bool firstIteration = true;
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace boost { namespace polygon{
|
||||
template <typename output_type>
|
||||
static void performMerge(output_type& result, MergeSetData& tsd) {
|
||||
|
||||
gtlsort(tsd.begin(), tsd.end(), lessVertex45Compact());
|
||||
polygon_sort(tsd.begin(), tsd.end(), lessVertex45Compact());
|
||||
typedef std::vector<std::pair<Point, typename boolean_op_45<Unit>::template Scan45CountT<CountMerge> > > TSD;
|
||||
TSD tsd_;
|
||||
tsd_.reserve(tsd.size());
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace boost { namespace polygon{
|
||||
ends.push_back(std::make_pair((*itr).first.first.y(), count));
|
||||
ends.push_back(std::make_pair((*itr).first.second.y(), -count));
|
||||
}
|
||||
gtlsort(ends.begin(), ends.end());
|
||||
polygon_sort(ends.begin(), ends.end());
|
||||
histogram.reserve(ends.size());
|
||||
histogram.push_back(std::make_pair(ends.front().first, std::make_pair(0, 0)));
|
||||
for(typename std::vector<std::pair<Unit, int> >::iterator itr = ends.begin(); itr != ends.end(); ++itr) {
|
||||
@@ -161,7 +161,7 @@ namespace boost { namespace polygon{
|
||||
}
|
||||
}
|
||||
typename scanline_base<Unit>::compute_intersection_pack pack_;
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
//find all intersection points
|
||||
for(typename std::vector<std::pair<half_edge, segment_id> >::iterator outer = data.begin();
|
||||
outer != data.end(); ++outer) {
|
||||
@@ -198,7 +198,7 @@ namespace boost { namespace polygon{
|
||||
}
|
||||
}
|
||||
}
|
||||
gtlsort(pts.begin(), pts.end());
|
||||
polygon_sort(pts.begin(), pts.end());
|
||||
typename std::vector<Point>::iterator newend = std::unique(pts.begin(), pts.end());
|
||||
typename std::vector<Point>::iterator lfinger = pts.begin();
|
||||
//find all segments that interact with intersection points
|
||||
@@ -289,7 +289,7 @@ namespace boost { namespace polygon{
|
||||
std::swap(data[i].first.first, data[i].first.second);
|
||||
}
|
||||
}
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
for(typename std::vector<std::pair<half_edge, segment_id> >::iterator outer = data.begin();
|
||||
outer != data.end(); ++outer) {
|
||||
const half_edge& he1 = (*outer).first;
|
||||
@@ -359,7 +359,7 @@ namespace boost { namespace polygon{
|
||||
tmpPts.reserve(pts.size());
|
||||
tmpPts.insert(tmpPts.end(), pts.begin(), pts.end());
|
||||
less_point_down_slope lpds;
|
||||
gtlsort(tmpPts.begin(), tmpPts.end(), lpds);
|
||||
polygon_sort(tmpPts.begin(), tmpPts.end(), lpds);
|
||||
segment_edge(output_segments, he, id, tmpPts.begin(), tmpPts.end());
|
||||
} else {
|
||||
segment_edge(output_segments, he, id, pts.begin(), pts.end());
|
||||
@@ -501,7 +501,7 @@ namespace boost { namespace polygon{
|
||||
// }
|
||||
|
||||
// //merge sloping element data
|
||||
// gtlsort(sloping_ends.begin(), sloping_ends.end());
|
||||
// polygon_sort(sloping_ends.begin(), sloping_ends.end());
|
||||
// std::map<Unit, std::set<iterator> > sloping_elements;
|
||||
// std::set<iterator> merge_elements;
|
||||
// for(typename std::vector<std::pair<Unit, iterator> >::iterator slop_iter = sloping_ends.begin();
|
||||
@@ -1313,7 +1313,7 @@ namespace boost { namespace polygon{
|
||||
output.push_back(vertex_half_edge(he.first, he.second, count));
|
||||
output.push_back(vertex_half_edge(he.second, he.first, -count));
|
||||
}
|
||||
gtlsort(output.begin(), output.end());
|
||||
polygon_sort(output.begin(), output.end());
|
||||
}
|
||||
|
||||
class test_functor {
|
||||
@@ -1531,7 +1531,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
inline void sort_property_merge_data() {
|
||||
less_vertex_data<vertex_property> lvd(&evalAtXforYPack_);
|
||||
gtlsort(pmd.begin(), pmd.end(), lvd);
|
||||
polygon_sort(pmd.begin(), pmd.end(), lvd);
|
||||
}
|
||||
public:
|
||||
inline property_merge_data& get_property_merge_data() { return pmd; }
|
||||
@@ -1576,7 +1576,7 @@ namespace boost { namespace polygon{
|
||||
pts.push_back(lines[i].first.first);
|
||||
pts.push_back(lines[i].first.second);
|
||||
}
|
||||
gtlsort(pts.begin(), pts.end());
|
||||
polygon_sort(pts.begin(), pts.end());
|
||||
for(std::size_t i = 0; i < pts.size(); i+=2) {
|
||||
if(pts[i] != pts[i+1]) {
|
||||
//stdcout << "Non-closed figures after line intersection!\n";
|
||||
@@ -1686,7 +1686,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
static inline void sort_vertex_half_edges(vertex_data& vertex) {
|
||||
less_half_edge_pair lessF(vertex.first);
|
||||
gtlsort(vertex.second.begin(), vertex.second.end(), lessF);
|
||||
polygon_sort(vertex.second.begin(), vertex.second.end(), lessF);
|
||||
}
|
||||
|
||||
class less_half_edge_pair {
|
||||
@@ -2168,7 +2168,7 @@ pts.push_back(Point(12344171, 6695983 )); pts.push_back(Point(12287208, 6672388
|
||||
outpts.push_back((*itr).first.first);
|
||||
outpts.push_back((*itr).first.second);
|
||||
}
|
||||
gtlsort(outpts.begin(), outpts.end());
|
||||
polygon_sort(outpts.begin(), outpts.end());
|
||||
for(std::size_t i = 0; i < outpts.size(); i+=2) {
|
||||
if(outpts[i] != outpts[i+1]) {
|
||||
stdcout << "Polygon set not a closed figure\n";
|
||||
@@ -2583,7 +2583,7 @@ pts.push_back(Point(12344171, 6695983 )); pts.push_back(Point(12287208, 6672388
|
||||
|
||||
inline void sort_property_merge_data() {
|
||||
less_vertex_data<vertex_property> lvd(&evalAtXforYPack_);
|
||||
gtlsort(pmd.begin(), pmd.end(), lvd);
|
||||
polygon_sort(pmd.begin(), pmd.end(), lvd);
|
||||
}
|
||||
public:
|
||||
inline arbitrary_boolean_op() : pmd(), evalAtXforYPack_() {}
|
||||
@@ -2807,7 +2807,7 @@ pts.push_back(Point(12344171, 6695983 )); pts.push_back(Point(12287208, 6672388
|
||||
|
||||
inline void sort_property_merge_data() {
|
||||
less_vertex_data<vertex_property> lvd(&evalAtXforYPack_);
|
||||
gtlsort(pmd.begin(), pmd.end(), lvd);
|
||||
polygon_sort(pmd.begin(), pmd.end(), lvd);
|
||||
}
|
||||
public:
|
||||
inline arbitrary_connectivity_extraction() : pmd(), evalAtXforYPack_() {}
|
||||
|
||||
1
include/boost/polygon/gmp_override.hpp
Executable file → Normal file
1
include/boost/polygon/gmp_override.hpp
Executable file → Normal file
@@ -125,5 +125,4 @@ namespace boost { namespace polygon {
|
||||
|
||||
}
|
||||
}
|
||||
//==
|
||||
#endif
|
||||
|
||||
2
include/boost/polygon/interval_concept.hpp
Executable file → Normal file
2
include/boost/polygon/interval_concept.hpp
Executable file → Normal file
@@ -471,7 +471,7 @@ namespace boost { namespace polygon{
|
||||
typedef typename interval_traits<interval_type>::coordinate_type Unit;
|
||||
Unit coords[4] = {low(interval), high(interval), low(b), high(b)};
|
||||
//consider implementing faster sorting of small fixed length range
|
||||
gtlsort(coords, coords+4);
|
||||
polygon_sort(coords, coords+4);
|
||||
low(interval, coords[1]);
|
||||
high(interval, coords[2]);
|
||||
return interval;
|
||||
|
||||
9
include/boost/polygon/isotropy.hpp
Executable file → Normal file
9
include/boost/polygon/isotropy.hpp
Executable file → Normal file
@@ -140,6 +140,7 @@ namespace boost { namespace polygon{
|
||||
template <typename T>
|
||||
struct coordinate_traits {};
|
||||
|
||||
//used to override long double with an infinite precision datatype
|
||||
template <typename T>
|
||||
struct high_precision_type {
|
||||
typedef long double type;
|
||||
@@ -150,6 +151,14 @@ namespace boost { namespace polygon{
|
||||
return T(v);
|
||||
}
|
||||
|
||||
//used to override std::sort with an alternative (parallel) algorithm
|
||||
template <typename iter_type>
|
||||
void polygon_sort(iter_type _b_, iter_type _e_);
|
||||
|
||||
template <typename iter_type, typename pred_type>
|
||||
void polygon_sort(iter_type _b_, iter_type _e_, const pred_type& _pred_);
|
||||
|
||||
|
||||
template <>
|
||||
struct coordinate_traits<int> {
|
||||
typedef int coordinate_type;
|
||||
|
||||
15
include/boost/polygon/polygon_45_set_data.hpp
Executable file → Normal file
15
include/boost/polygon/polygon_45_set_data.hpp
Executable file → Normal file
@@ -212,7 +212,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
void sort() const{
|
||||
if(unsorted_) {
|
||||
gtlsort(data_.begin(), data_.end());
|
||||
polygon_sort(data_.begin(), data_.end());
|
||||
unsorted_ = false;
|
||||
}
|
||||
}
|
||||
@@ -220,6 +220,7 @@ namespace boost { namespace polygon{
|
||||
template <typename input_iterator_type>
|
||||
void set(input_iterator_type input_begin, input_iterator_type input_end) {
|
||||
data_.clear();
|
||||
reserve(std::distance(input_begin, input_end));
|
||||
insert(input_begin, input_end);
|
||||
dirty_ = true;
|
||||
unsorted_ = true;
|
||||
@@ -1262,7 +1263,7 @@ namespace boost { namespace polygon{
|
||||
//std::cout << "SCAN " << currentX << "\n";
|
||||
//scan event
|
||||
scan45.scan(eventOut, eventIn.begin(), eventIn.end());
|
||||
gtlsort(eventOut.begin(), eventOut.end());
|
||||
polygon_sort(eventOut.begin(), eventOut.end());
|
||||
std::size_t ptCount = 0;
|
||||
for(std::size_t i = 0; i < eventOut.size(); ++i) {
|
||||
if(!result_data.empty() &&
|
||||
@@ -1333,7 +1334,7 @@ namespace boost { namespace polygon{
|
||||
}
|
||||
}
|
||||
scan45.scan(eventOut, eventIn.begin(), eventIn.end());
|
||||
gtlsort(eventOut.begin(), eventOut.end());
|
||||
polygon_sort(eventOut.begin(), eventOut.end());
|
||||
|
||||
std::size_t ptCount = 0;
|
||||
for(std::size_t i = 0; i < eventOut.size(); ++i) {
|
||||
@@ -1385,7 +1386,7 @@ namespace boost { namespace polygon{
|
||||
//std::cout << "SCAN " << currentX << "\n";
|
||||
//scan event
|
||||
scan45.scan(eventOut, eventIn.begin(), eventIn.end());
|
||||
gtlsort(eventOut.begin(), eventOut.end());
|
||||
polygon_sort(eventOut.begin(), eventOut.end());
|
||||
std::size_t ptCount = 0;
|
||||
for(std::size_t i = 0; i < eventOut.size(); ++i) {
|
||||
if(!result_data.empty() &&
|
||||
@@ -1422,7 +1423,7 @@ namespace boost { namespace polygon{
|
||||
++iter1;
|
||||
}
|
||||
scan45.scan(eventOut, eventIn.begin(), eventIn.end());
|
||||
gtlsort(eventOut.begin(), eventOut.end());
|
||||
polygon_sort(eventOut.begin(), eventOut.end());
|
||||
|
||||
std::size_t ptCount = 0;
|
||||
for(std::size_t i = 0; i < eventOut.size(); ++i) {
|
||||
@@ -1639,7 +1640,7 @@ namespace boost { namespace polygon{
|
||||
result.error_data_.push_back(ci);
|
||||
}
|
||||
Data2 new_result_data;
|
||||
gtlsort(result_data.begin(), result_data.end());
|
||||
polygon_sort(result_data.begin(), result_data.end());
|
||||
applyUnary45OpOnVectors<Unit2, 0>(new_result_data, result_data); //OR operation
|
||||
result_data.swap(new_result_data);
|
||||
}
|
||||
@@ -1749,7 +1750,7 @@ namespace boost { namespace polygon{
|
||||
result.error_data_.push_back(ci);
|
||||
}
|
||||
Data2 new_result_data;
|
||||
gtlsort(result_data.begin(), result_data.end());
|
||||
polygon_sort(result_data.begin(), result_data.end());
|
||||
applyUnary45OpOnVectors<Unit2, 0>(new_result_data, result_data); //OR operation
|
||||
result_data.swap(new_result_data);
|
||||
}
|
||||
|
||||
4
include/boost/polygon/polygon_45_set_traits.hpp
Executable file → Normal file
4
include/boost/polygon/polygon_45_set_traits.hpp
Executable file → Normal file
@@ -94,6 +94,7 @@ namespace boost { namespace polygon{
|
||||
static inline void set(std::list<T>& polygon_set, input_iterator_type input_begin, input_iterator_type input_end) {
|
||||
polygon_set.clear();
|
||||
polygon_45_set_data<typename polygon_45_set_traits<std::list<T> >::coordinate_type> ps;
|
||||
ps.reserve(std::distance(input_begin, input_end));
|
||||
ps.insert(input_begin, input_end);
|
||||
ps.sort();
|
||||
ps.clean();
|
||||
@@ -105,7 +106,10 @@ namespace boost { namespace polygon{
|
||||
template <typename input_iterator_type>
|
||||
static inline void set(std::vector<T>& polygon_set, input_iterator_type input_begin, input_iterator_type input_end) {
|
||||
polygon_set.clear();
|
||||
size_t num_ele = std::distance(input_begin, input_end);
|
||||
polygon_set.reserve(num_ele);
|
||||
polygon_45_set_data<typename polygon_45_set_traits<std::list<T> >::coordinate_type> ps;
|
||||
ps.reserve(num_ele);
|
||||
ps.insert(input_begin, input_end);
|
||||
ps.sort();
|
||||
ps.clean();
|
||||
|
||||
5
include/boost/polygon/polygon_90_set_data.hpp
Executable file → Normal file
5
include/boost/polygon/polygon_90_set_data.hpp
Executable file → Normal file
@@ -296,7 +296,7 @@ namespace boost { namespace polygon{
|
||||
|
||||
void sort() const{
|
||||
if(unsorted_) {
|
||||
gtlsort(data_.begin(), data_.end());
|
||||
polygon_sort(data_.begin(), data_.end());
|
||||
unsorted_ = false;
|
||||
}
|
||||
}
|
||||
@@ -304,6 +304,7 @@ namespace boost { namespace polygon{
|
||||
template <typename input_iterator_type>
|
||||
void set(input_iterator_type input_begin, input_iterator_type input_end, orientation_2d orient) {
|
||||
data_.clear();
|
||||
reserve(std::distance(input_begin, input_end));
|
||||
data_.insert(data_.end(), input_begin, input_end);
|
||||
orient_ = orient;
|
||||
dirty_ = true;
|
||||
@@ -427,7 +428,7 @@ namespace boost { namespace polygon{
|
||||
point_data<coordinate_type> prev_pt = poly[0];
|
||||
point_data<coordinate_type> current_pt = poly[1];
|
||||
encompass(extents_rectangle, current_pt);
|
||||
for(int i = 2; i < poly.size(); ++i) {
|
||||
for(std::size_t i = 2; i < poly.size(); ++i) {
|
||||
point_data<coordinate_type> next_pt = poly[i];
|
||||
encompass(extents_rectangle, next_pt);
|
||||
modify_pt(poly[i-1], prev_pt, current_pt, next_pt, west_shrinking, east_shrinking, south_shrinking, north_shrinking);
|
||||
|
||||
5
include/boost/polygon/polygon_90_set_traits.hpp
Executable file → Normal file
5
include/boost/polygon/polygon_90_set_traits.hpp
Executable file → Normal file
@@ -278,6 +278,7 @@ namespace boost { namespace polygon{
|
||||
static inline void set(std::list<T>& polygon_set, input_iterator_type input_begin, input_iterator_type input_end, orientation_2d orient) {
|
||||
polygon_set.clear();
|
||||
polygon_90_set_data<typename polygon_90_set_traits<std::list<T> >::coordinate_type> ps(orient);
|
||||
ps.reserve(std::distance(input_begin, input_end));
|
||||
ps.insert(input_begin, input_end, orient);
|
||||
ps.clean();
|
||||
get_90_dispatch(polygon_set, ps, orient, concept_type());
|
||||
@@ -289,7 +290,10 @@ namespace boost { namespace polygon{
|
||||
template <typename input_iterator_type>
|
||||
static inline void set(std::vector<T>& polygon_set, input_iterator_type input_begin, input_iterator_type input_end, orientation_2d orient) {
|
||||
polygon_set.clear();
|
||||
size_t num_ele = std::distance(input_begin, input_end);
|
||||
polygon_set.reserve(num_ele);
|
||||
polygon_90_set_data<typename polygon_90_set_traits<std::list<T> >::coordinate_type> ps(orient);
|
||||
ps.reserve(num_ele);
|
||||
ps.insert(input_begin, input_end, orient);
|
||||
ps.clean();
|
||||
get_90_dispatch(polygon_set, ps, orient, concept_type());
|
||||
@@ -304,6 +308,7 @@ namespace boost { namespace polygon{
|
||||
input_iterator_type input_begin, input_iterator_type input_end,
|
||||
orientation_2d orient) {
|
||||
polygon_set.clear();
|
||||
polygon_set.reserve(std::distance(input_begin, input_end));
|
||||
polygon_set.insert(input_begin, input_end, orient);
|
||||
}
|
||||
|
||||
|
||||
18
include/boost/polygon/polygon_set_data.hpp
Executable file → Normal file
18
include/boost/polygon/polygon_set_data.hpp
Executable file → Normal file
@@ -11,7 +11,6 @@
|
||||
#include "polygon_45_set_concept.hpp"
|
||||
#include "polygon_traits.hpp"
|
||||
#include "detail/polygon_arbitrary_formation.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace boost { namespace polygon {
|
||||
|
||||
@@ -248,7 +247,7 @@ namespace boost { namespace polygon {
|
||||
data.push_back(vertex_half_edge((*itr).first.first, (*itr).first.second, (*itr).second));
|
||||
data.push_back(vertex_half_edge((*itr).first.second, (*itr).first.first, -1 * (*itr).second));
|
||||
}
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(container, data.begin(), data.end());
|
||||
//std::cout << "DONE FORMING POLYGONS\n";
|
||||
}
|
||||
@@ -321,7 +320,7 @@ namespace boost { namespace polygon {
|
||||
|
||||
void sort() const{
|
||||
if(unsorted_) {
|
||||
gtlsort(data_.begin(), data_.end());
|
||||
polygon_sort(data_.begin(), data_.end());
|
||||
unsorted_ = false;
|
||||
}
|
||||
}
|
||||
@@ -329,6 +328,7 @@ namespace boost { namespace polygon {
|
||||
template <typename input_iterator_type>
|
||||
void set(input_iterator_type input_begin, input_iterator_type input_end) {
|
||||
clear();
|
||||
reserve(std::distance(input_begin,input_end));
|
||||
insert(input_begin, input_end);
|
||||
dirty_ = true;
|
||||
unsorted_ = true;
|
||||
@@ -388,8 +388,13 @@ namespace boost { namespace polygon {
|
||||
inline polygon_set_data&
|
||||
scale_down(typename coordinate_traits<coordinate_type>::unsigned_area_type factor) {
|
||||
for(typename value_type::iterator itr = data_.begin(); itr != data_.end(); ++itr) {
|
||||
bool vb = (*itr).first.first.x() == (*itr).first.second.x();
|
||||
::boost::polygon::scale_down((*itr).first.first, factor);
|
||||
::boost::polygon::scale_down((*itr).first.second, factor);
|
||||
bool va = (*itr).first.first.x() == (*itr).first.second.x();
|
||||
if(!vb && va) {
|
||||
(*itr).second *= -1;
|
||||
}
|
||||
}
|
||||
unsorted_ = true;
|
||||
dirty_ = true;
|
||||
@@ -400,8 +405,13 @@ namespace boost { namespace polygon {
|
||||
inline polygon_set_data& scale(polygon_set_data& polygon_set,
|
||||
const scaling_type& scaling) {
|
||||
for(typename value_type::iterator itr = begin(); itr != end(); ++itr) {
|
||||
bool vb = (*itr).first.first.x() == (*itr).first.second.x();
|
||||
::boost::polygon::scale((*itr).first.first, scaling);
|
||||
::boost::polygon::scale((*itr).first.second, scaling);
|
||||
bool va = (*itr).first.first.x() == (*itr).first.second.x();
|
||||
if(!vb && va) {
|
||||
(*itr).second *= -1;
|
||||
}
|
||||
}
|
||||
unsorted_ = true;
|
||||
dirty_ = true;
|
||||
@@ -790,7 +800,7 @@ namespace boost { namespace polygon {
|
||||
data.push_back(vertex_half_edge((*itr).first.first, (*itr).first.second, (*itr).second));
|
||||
data.push_back(vertex_half_edge((*itr).first.second, (*itr).first.first, -1 * (*itr).second));
|
||||
}
|
||||
gtlsort(data.begin(), data.end());
|
||||
polygon_sort(data.begin(), data.end());
|
||||
pf.scan(container, data.begin(), data.end());
|
||||
}
|
||||
};
|
||||
|
||||
4
include/boost/polygon/polygon_set_traits.hpp
Executable file → Normal file
4
include/boost/polygon/polygon_set_traits.hpp
Executable file → Normal file
@@ -82,6 +82,7 @@ namespace boost { namespace polygon{
|
||||
static inline void set(std::list<T>& polygon_set, input_iterator_type input_begin, input_iterator_type input_end) {
|
||||
polygon_set.clear();
|
||||
polygon_set_data<typename polygon_set_traits<std::list<T> >::coordinate_type> ps;
|
||||
ps.reserve(std::distance(input_begin, input_end));
|
||||
ps.insert(input_begin, input_end);
|
||||
ps.get(polygon_set);
|
||||
}
|
||||
@@ -91,7 +92,10 @@ namespace boost { namespace polygon{
|
||||
template <typename input_iterator_type>
|
||||
static inline void set(std::vector<T>& polygon_set, input_iterator_type input_begin, input_iterator_type input_end) {
|
||||
polygon_set.clear();
|
||||
size_t num_ele = std::distance(input_begin, input_end);
|
||||
polygon_set.reserve(num_ele);
|
||||
polygon_set_data<typename polygon_set_traits<std::list<T> >::coordinate_type> ps;
|
||||
ps.reserve(num_ele);
|
||||
ps.insert(input_begin, input_end);
|
||||
ps.get(polygon_set);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user