Incomplete work for using Boost.Polygon to compute medial axis

This commit is contained in:
Alessandro Ranellucci 2014-01-09 17:26:39 +01:00
parent 11f065ca5e
commit bf91f3096a
1650 changed files with 307148 additions and 9 deletions

View file

@ -22,14 +22,20 @@ Lines
Polygon::lines() const
{
Lines lines;
lines.reserve(this->points.size());
for (Points::const_iterator it = this->points.begin(); it != this->points.end()-1; ++it) {
lines.push_back(Line(*it, *(it + 1)));
}
lines.push_back(Line(this->points.back(), this->points.front()));
this->lines(&lines);
return lines;
}
void
Polygon::lines(Lines* lines) const
{
lines->reserve(lines->size() + this->points.size());
for (Points::const_iterator it = this->points.begin(); it != this->points.end()-1; ++it) {
lines->push_back(Line(*it, *(it + 1)));
}
lines->push_back(Line(this->points.back(), this->points.front()));
}
Polyline*
Polygon::split_at(const Point* point) const
{