From 22ded87a8ca58e0ff4400b2d4e76787f4ac22bd6 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 6 Apr 2015 19:39:38 +0200 Subject: Fixed bug on closed paths, Clenup of pathinfo (bzr r13645.1.77) --- src/helper/geom-pathinfo.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/helper/geom-pathinfo.cpp') diff --git a/src/helper/geom-pathinfo.cpp b/src/helper/geom-pathinfo.cpp index a37c0e475..ac94c0281 100644 --- a/src/helper/geom-pathinfo.cpp +++ b/src/helper/geom-pathinfo.cpp @@ -17,12 +17,12 @@ namespace Geom { * @brief Pathinfo store the data of a pathvector and allow get info about it * */ -Pathinfo::Pathinfo(Piecewise > pwd2) : _pwd2(pwd2) +Pathinfo::Pathinfo(Piecewise > pwd2) { _setPathInfo(pwd2); } ; -Pathinfo::Pathinfo(Geom::PathVector path_vector, bool skip_degenerate) : _path_vector(path_vector) +Pathinfo::Pathinfo(Geom::PathVector path_vector, bool skip_degenerate) { _setPathInfo(path_vector, skip_degenerate); } @@ -33,13 +33,11 @@ Pathinfo::~Pathinfo() {} void Pathinfo::setPwd2(Piecewise > pwd2) { - _pwd2 = pwd2; _setPathInfo(pwd2); } void Pathinfo::setPathVector(Geom::PathVector path_vector, bool skip_degenerate) { - _path_vector = path_vector; _setPathInfo(path_vector, skip_degenerate); } @@ -52,11 +50,9 @@ void Pathinfo::_setPathInfo(Piecewise > pwd2) void Pathinfo::_setPathInfo(Geom::PathVector path_vector, bool skip_degenerate) { data.clear(); - Geom::PathVector path_in = - path_from_piecewise(remove_short_cuts(_pwd2, 0.1), 0.001); size_t counter = 0; - for (PathVector::const_iterator path_it = path_in.begin(); - path_it != path_in.end(); ++path_it) { + for (PathVector::const_iterator path_it = path_vector.begin(); + path_it != path_vector.end(); ++path_it) { if (path_it->empty()) { continue; } -- cgit v1.2.3