Fixes so that the testsuite compiles again

This commit is contained in:
Andreas Fabri 2019-04-10 13:18:25 +02:00
parent 2458965c15
commit e632bebdba
2 changed files with 13 additions and 5 deletions

View File

@ -73,7 +73,7 @@ class Indirect_edge_compare
else
{
// construct supporting line for edge
Line_2 line = _construct_line_2(*edge_vtx_1, *edge_vtx_2);
Line_2 line = _construct_line_2(Point_2(*edge_vtx_1), Point_2(*edge_vtx_2));
return _compare_x_at_y_2(Point_2(*vertex), line) == SMALLER;
}
}
@ -102,10 +102,10 @@ class Indirect_edge_compare
// else neither endpoint is shared
// construct supporting line
Line_2 l_p = _construct_line_2(*p, *after_p);
Line_2 l_p = _construct_line_2(Point_2(*p), Point_2(*after_p));
if (_is_horizontal_2(l_p))
{
Line_2 l_q = _construct_line_2(*q, *after_q);
Line_2 l_q = _construct_line_2(Point_2(*q), Point_2(*after_q));
if (_is_horizontal_2(l_q))
{
@ -134,7 +134,7 @@ class Indirect_edge_compare
return q_larger_x;
// else one smaller and one larger
// construct the other line
Line_2 l_q = _construct_line_2(*q, *after_q);
Line_2 l_q = _construct_line_2(Point_2(*q), Point_2(*after_q));
if (_is_horizontal_2(l_q)) // p is not horizontal
{
return _compare_x_at_y_2(Point_2(*q), l_p) == LARGER;

View File

@ -70,6 +70,13 @@ public:
}
};
struct Equal {
bool operator()(const Point_2& p, const Point_2& q) const
{
return p == q;
}
};
// constructor
template<class ForwardIterator>
Rotation_tree_2(ForwardIterator first, ForwardIterator beyond, const Traits& traits)
@ -78,8 +85,9 @@ public:
push_back(*it);
Greater greater (traits.less_xy_2_object());
Equal equal;
std::sort(this->begin(), this->end(), greater);
std::unique(this->begin(), this->end());
std::unique(this->begin(), this->end(),equal);
// front() is the point with the largest x coordinate