diff --git a/src/Lib/Polygon/polygon.cxx b/src/Lib/Polygon/polygon.cxx index 58be765e..84931e9d 100644 --- a/src/Lib/Polygon/polygon.cxx +++ b/src/Lib/Polygon/polygon.cxx @@ -132,7 +132,7 @@ void TGPolygon::set_elevations( double elev ) { // Calculate theta of angle (a, b, c) -static double calc_angle(point2d a, point2d b, point2d c) { +double tgPolygonCalcAngle(point2d a, point2d b, point2d c) { point2d u, v; double udist, vdist, uv_dot, tmp; @@ -213,7 +213,7 @@ double TGPolygon::minangle_contour( const int contour ) { p3.x = c[p3_index].x(); p3.y = c[p3_index].y(); - angle = calc_angle( p1, p2, p3 ); + angle = tgPolygonCalcAngle( p1, p2, p3 ); if ( angle < min_angle ) { min_angle = angle; diff --git a/src/Lib/Polygon/polygon.hxx b/src/Lib/Polygon/polygon.hxx index 6a7c728a..62c5a169 100644 --- a/src/Lib/Polygon/polygon.hxx +++ b/src/Lib/Polygon/polygon.hxx @@ -37,6 +37,8 @@ #include STL_STRING #include +#include "point2d.hxx" + SG_USING_STD(ostream); SG_USING_STD(string); SG_USING_STD(vector); @@ -192,6 +194,10 @@ typedef poly_list::iterator poly_list_iterator; typedef poly_list::const_iterator const_poly_list_iterator; +// Calculate theta of angle (a, b, c) +double tgPolygonCalcAngle(point2d a, point2d b, point2d c); + + // canonify the polygon winding, outer contour must be anti-clockwise, // all inner contours must be clockwise. TGPolygon tgPolygonCanonify( const TGPolygon& in_poly );