Expose the calc_angle() function as tgPolygonCalcAngle()
This commit is contained in:
parent
cc5e739297
commit
ffa70e41f7
2 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue