Cleanup of some method signatures and of XS return types

This commit is contained in:
Alessandro Ranellucci 2015-01-19 18:53:04 +01:00
parent c9cdae1a96
commit 8791f5a493
39 changed files with 252 additions and 339 deletions

View file

@ -98,10 +98,11 @@ Polyline::extend_start(double distance)
/* this method returns a collection of points picked on the polygon contour
so that they are evenly spaced according to the input distance */
void
Polyline::equally_spaced_points(double distance, Points* points) const
Points
Polyline::equally_spaced_points(double distance) const
{
points->push_back(this->first_point());
Points points;
points.push_back(this->first_point());
double len = 0;
for (Points::const_iterator it = this->points.begin() + 1; it != this->points.end(); ++it) {
@ -110,17 +111,18 @@ Polyline::equally_spaced_points(double distance, Points* points) const
if (len < distance) continue;
if (len == distance) {
points->push_back(*it);
points.push_back(*it);
len = 0;
continue;
}
double take = segment_length - (len - distance); // how much we take of this segment
Line segment(*(it-1), *it);
points->push_back(segment.point_at(take));
points.push_back(segment.point_at(take));
it--;
len = -take;
}
return points;
}
void