Added various has_duplicate_points() checks, to be used by asserts.
Removed some "extern" function modifiers, they have no meaning in C++.
This commit is contained in:
parent
7eea15fdde
commit
fec5d92bc8
7 changed files with 183 additions and 27 deletions
|
@ -179,6 +179,15 @@ Point Point::projection_onto(const Line &line) const
|
|||
return ((line.a - *this).cast<double>().squaredNorm() < (line.b - *this).cast<double>().squaredNorm()) ? line.a : line.b;
|
||||
}
|
||||
|
||||
bool has_duplicate_points(std::vector<Point> &&pts)
|
||||
{
|
||||
std::sort(pts.begin(), pts.end());
|
||||
for (size_t i = 1; i < pts.size(); ++ i)
|
||||
if (pts[i - 1] == pts[i])
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
BoundingBox get_extents(const Points &pts)
|
||||
{
|
||||
return BoundingBox(pts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue