diff options
author | bubnikv <bubnikv@gmail.com> | 2016-11-02 12:47:00 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2016-11-02 12:47:00 +0300 |
commit | 95ede7c4b8cc40fe0fcf1960f25dfa9c66843b29 (patch) | |
tree | 609d320018e09d27f4b945915572d0fdf6e8c906 /xs/src/libslic3r/Polygon.hpp | |
parent | 3a31d37d3574093565ed4fc8baa7f90428d9324e (diff) |
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.
Diffstat (limited to 'xs/src/libslic3r/Polygon.hpp')
-rw-r--r-- | xs/src/libslic3r/Polygon.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Polygon.hpp b/xs/src/libslic3r/Polygon.hpp index 4466d2d23..21f46117d 100644 --- a/xs/src/libslic3r/Polygon.hpp +++ b/xs/src/libslic3r/Polygon.hpp @@ -58,6 +58,18 @@ extern bool remove_sticks(Polygons &polys); // Remove polygons with less than 3 edges. extern bool remove_degenerate(Polygons &polys); extern bool remove_small(Polygons &polys, double min_area); + +// Append a vector of polygons at the end of another vector of polygons. +inline void polygons_append(Polygons &dst, const Polygons &src) { dst.insert(dst.end(), src.begin(), src.end()); } +#if SLIC3R_CPPVER >= 11 +inline void polygons_append(Polygons &dst, Polygons &&src) +{ + if (dst.empty()) + dst = std::move(src); + else + std::move(std::begin(src), std::end(src), std::back_inserter(dst)); +} +#endif } // start Boost |