Rewrote Fill2.pm to C++, deleted Perl infills for good.

Removed dependency on Perl Math::PlanePath module.
Fixed compilation with Visual Studio and SLIC3R_DEBUG: Visual Studio older than 2015 does not support the prinf type specifier %zu. Use %Iu instead.
C++11 move semantics enabled.
This commit is contained in:
bubnikv 2016-11-02 10:47:00 +01:00
parent 3a31d37d35
commit 95ede7c4b8
49 changed files with 628 additions and 1803 deletions

View file

@ -47,7 +47,7 @@ inline int nearest_point_index(const std::vector<Chaining> &pairs, const Point &
}
Polylines PolylineCollection::chained_path_from(
#if SLIC3R_CPPVER > 11
#if SLIC3R_CPPVER >= 11
Polylines &&src,
#else
const Polylines &src,
@ -70,7 +70,7 @@ Polylines PolylineCollection::chained_path_from(
// find nearest point
int endpoint_index = nearest_point_index<double>(endpoints, start_near, no_reverse);
assert(endpoint_index >= 0 && endpoint_index < endpoints.size() * 2);
#if SLIC3R_CPPVER > 11
#if SLIC3R_CPPVER >= 11
retval.push_back(std::move(src[endpoints[endpoint_index/2].idx]));
#else
retval.push_back(src[endpoints[endpoint_index/2].idx]);
@ -83,7 +83,7 @@ Polylines PolylineCollection::chained_path_from(
return retval;
}
#if SLIC3R_CPPVER > 11
#if SLIC3R_CPPVER >= 11
Polylines PolylineCollection::chained_path(Polylines &&src, bool no_reverse)
{
return (src.empty() || src.front().empty()) ?