From 4ff5acb28c5677a92a0f0783ce762694e84b5285 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 19 Aug 2003 02:38:08 +0000 Subject: [PATCH] Still support a minimum angle threshold for quality refinement in the trangulator wrapper, but this isn't used by the calling layer any more. --- src/BuildTiles/Triangulate/triangle.cxx | 10 +++++++--- src/BuildTiles/Triangulate/triangle.hxx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/BuildTiles/Triangulate/triangle.cxx b/src/BuildTiles/Triangulate/triangle.cxx index 1b42a01e..0708b240 100644 --- a/src/BuildTiles/Triangulate/triangle.cxx +++ b/src/BuildTiles/Triangulate/triangle.cxx @@ -338,7 +338,7 @@ static void write_out_data(struct triangulateio *out) { // generates extra nodes for a better triangulation. 2 = second pass // after split/reassem where we don't want any extra nodes generated. -int TGTriangle::run_triangulate( const string& angle, const int pass ) { +int TGTriangle::run_triangulate( double angle, const int pass ) { TGPolygon poly; Point3D p; struct triangulateio in, out, vorout; @@ -491,10 +491,14 @@ int TGTriangle::run_triangulate( const string& angle, const int pass ) { // use a quality value of 10 (q10) meaning no interior // triangle angles less than 10 degrees // tri_options = "pczAen"; - if ( angle == "0" ) { + if ( angle < 0.00001 ) { tri_options = "pczAen"; } else { - tri_options = "pczq" + angle + "Aen"; + char angle_str[256]; + sprintf( angle_str, "%.2f", angle ); + tri_options = "pczq"; + tri_options += angle_str; + tri_options += "Aen"; } // // string tri_options = "pzAen"; // // string tri_options = "pczq15S400Aen"; diff --git a/src/BuildTiles/Triangulate/triangle.hxx b/src/BuildTiles/Triangulate/triangle.hxx index 88ccdb47..e55246a1 100644 --- a/src/BuildTiles/Triangulate/triangle.hxx +++ b/src/BuildTiles/Triangulate/triangle.hxx @@ -91,7 +91,7 @@ public: // generates extra nodes for a better triangulation. 2 = second // pass after split/reassem where we don't want any extra nodes // generated. - int run_triangulate( const string& angle, const int pass ); + int run_triangulate( double angle, const int pass ); inline TGTriNodes get_out_nodes() const { return out_nodes; } inline size_t get_out_nodes_size() const { return out_nodes.size(); }