Created a total_lengt() free function for Polygons and Polylines.

Modified the "extra perimeters when needed" function to use the new free functions,
extended the tooltip of the "extra perimeters when needed" feature.
This commit is contained in:
bubnikv 2017-02-02 16:03:32 +01:00
parent c25ae35737
commit 4256af22ff
4 changed files with 18 additions and 11 deletions

View file

@ -59,6 +59,13 @@ extern BoundingBox get_extents_rotated(const Polygon &poly, double angle);
extern BoundingBox get_extents_rotated(const Polygons &polygons, double angle);
extern std::vector<BoundingBox> get_extents_vector(const Polygons &polygons);
inline double total_length(const Polygons &polylines) {
double total = 0;
for (Polygons::const_iterator it = polylines.begin(); it != polylines.end(); ++it)
total += it->length();
return total;
}
// Remove sticks (tentacles with zero area) from the polygon.
extern bool remove_sticks(Polygon &poly);
extern bool remove_sticks(Polygons &polys);