# HG changeset patch # User deba # Date 1181246849 0 # Node ID 2800d9efb01d7419ef5676269060d0227eeceacc # Parent 24887f3a35ecd67f25cf37380b89d9d8327331c6 Correction for multiple point on starting sweep line diff -r 24887f3a35ec -r 2800d9efb01d tools/lgf-gen.cc --- a/tools/lgf-gen.cc Tue Jun 05 17:30:52 2007 +0000 +++ b/tools/lgf-gen.cc Thu Jun 07 20:07:29 2007 +0000 @@ -281,9 +281,28 @@ std::set > edges; - beach.insert(std::make_pair(Part(-1, siteheap[0].second, -1), - spikeheap.end())); - int siteindex = 1; + int siteindex = 0; + { + SiteHeap front; + + while (siteindex < int(siteheap.size()) && + siteheap[0].first == siteheap[siteindex].first) { + front.push_back(std::make_pair(points[siteheap[siteindex].second].y, + siteheap[siteindex].second)); + ++siteindex; + } + + std::sort(front.begin(), front.end()); + + for (int i = 0; i < int(front.size()); ++i) { + int prev = (i == 0 ? -1 : front[i - 1].second); + int curr = front[i].second; + int next = (i + 1 == int(front.size()) ? -1 : front[i + 1].second); + + beach.insert(std::make_pair(Part(prev, curr, next), + spikeheap.end())); + } + } while (siteindex < int(points.size()) || !spikeheap.empty()) { @@ -784,7 +803,7 @@ std::cout << "Total edge length : " << tlen << std::endl; if(ap["eps"]) - graphToEps(g,prefix+".eps"). + graphToEps(g,prefix+".eps").scaleToA4(). scale(600).nodeScale(.2).edgeWidthScale(.001).preScale(false). coords(coords).run();