1
0
Fork 0

Expose the calc_angle() function as tgPolygonCalcAngle()

This commit is contained in:
curt 2007-11-05 14:02:21 +00:00
parent cc5e739297
commit ffa70e41f7
2 changed files with 8 additions and 2 deletions

View file

@ -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;

View file

@ -37,6 +37,8 @@
#include STL_STRING
#include <vector>
#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 );