Better polymorphism for ExPolygon::XS->rotate

This commit is contained in:
Alessandro Ranellucci 2013-07-14 16:03:06 +02:00
parent 28a4f1a61e
commit 06de21b154
6 changed files with 32 additions and 21 deletions

View file

@ -20,7 +20,7 @@ class ExPolygon
SV* arrayref();
void scale(double factor);
void translate(double x, double y);
void _rotate(double angle, Point* center);
void rotate(double angle, Point* center);
};
typedef std::vector<ExPolygon> ExPolygons;
@ -44,11 +44,11 @@ ExPolygon::translate(double x, double y)
}
void
ExPolygon::_rotate(double angle, Point* center)
ExPolygon::rotate(double angle, Point* center)
{
contour._rotate(angle, center);
contour.rotate(angle, center);
for (Polygons::iterator it = holes.begin(); it != holes.end(); ++it) {
(*it)._rotate(angle, center);
(*it).rotate(angle, center);
}
}