21 auto& v =
fSL->fSweepLine;
22 v.insert(v.begin() +
i,
s);
25 return fSL->fSweepLine.size();
29 return fSL->fSweepLine;
43 Point p0 = {-100, -100},
49 tp.insertSegment(1, s0);
50 tp.insertSegment(2, s1);
52 auto& sl = tp.sweepLine();
54 const Point crossing = {0, 0};
56 const auto l = std::lower_bound(sl.begin(), sl.end(), crossing,
59 const auto r = std::lower_bound(l, sl.end(), crossing,
71 Point p0 = {-100, -100},
77 tp.insertSegment(1, s0);
78 tp.insertSegment(2, s1);
80 auto& sl = tp.sweepLine();
82 const Point crossing = {0, 0};
84 const auto l = std::lower_bound(sl.begin(), sl.end(), crossing,
87 const auto r = std::lower_bound(l, sl.end(), crossing,
100 tp.verifySweepLine(0);
109 SK_ABORT(
"There should be no crossings.");
115 insertions.insert(
s);
117 tp.verifySweepLine(-99);
120 Point{0, -100}, insertions, &eventQueue);
123 tp.verifySweepLine(-99);
130 Point p0 = {-100, -100},
143 fCrossing.push_back({s0, s1, crossingPoint});
145 std::vector<Crossing> fCrossing;
150 insertions.insert(s0);
151 tp.verifySweepLine(-99);
153 p0, insertions, &eventQueue);
156 tp.verifySweepLine(-99);
160 insertions.insert(s2);
161 tp.verifySweepLine(-99);
163 p4, insertions, &eventQueue);
166 tp.verifySweepLine(-99);
170 insertions.insert(s1);
171 tp.verifySweepLine(-99);
173 p2, insertions, &eventQueue);
176 tp.verifySweepLine(-99);
181 tp.verifySweepLine(-51);
185 p5, insertions, &eventQueue);
187 tp.verifySweepLine(-51);
192 tp.verifySweepLine(-1);
195 {0,0}, insertions, &eventQueue);
198 tp.verifySweepLine(1);
203 tp.verifySweepLine(99);
206 p3, insertions, &eventQueue);
209 tp.verifySweepLine(99);
214 tp.verifySweepLine(99);
217 p1, insertions, &eventQueue);
220 tp.verifySweepLine(99);
#define SK_ABORT(message,...)
DEF_TEST(BO_SweepLineSearch, reporter)
#define REPORTER_ASSERT(r, cond,...)
virtual void addCrossing(Point crossingPoint, const Segment &s0, const Segment &s1)=0
void handleDeletions(Point eventPoint, const DeletionSegmentSet &removing) override
void handleInsertionsAndCheckForNewCrossings(Point eventPoint, const InsertionSegmentSet &inserting, EventQueueInterface *queue) override
bool rounded_point_less_than_segment_in_x_lower(const Segment &s, Point p)
bool rounded_point_less_than_segment_in_x_upper(const Segment &s, Point p)
std::set< Segment, OrderBySlope > InsertionSegmentSet
std::set< Segment > DeletionSegmentSet
void verifySweepLine(int32_t y) const
void insertSegment(int i, const Segment &s)
SweepLineTestingPeer(SweepLine *sl)
const std::vector< Segment > & sweepLine() const