Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-03-22 17:35:09 +0300
committerbubnikv <bubnikv@gmail.com>2017-03-22 17:35:09 +0300
commit04cd4747089e528ea88a33edb12ad83ed9f9d82f (patch)
tree7722a1369e6e3dee1d2167142d3a59d93c4f290d /xs/src/libslic3r/libslic3r.h
parent6b99cbdc02598ef54f59fa4a45af81100d49b99f (diff)
Fixed some instance of simplify_polygons() invocation.
Geometry::deg2rad() made a template. Some methods of Layer made inline. Added a helper template remove_nulls().
Diffstat (limited to 'xs/src/libslic3r/libslic3r.h')
-rw-r--r--xs/src/libslic3r/libslic3r.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/xs/src/libslic3r/libslic3r.h b/xs/src/libslic3r/libslic3r.h
index e2c99b00f..4699cc9dc 100644
--- a/xs/src/libslic3r/libslic3r.h
+++ b/xs/src/libslic3r/libslic3r.h
@@ -119,6 +119,14 @@ void append(std::vector<T>& dest, std::vector<T>&& src)
src.shrink_to_fit();
}
+template <typename T>
+void remove_nulls(std::vector<T*> &vec)
+{
+ vec.erase(
+ std::remove_if(vec.begin(), vec.end(), [](const T *ptr) { return ptr == nullptr; }),
+ vec.end());
+}
+
} // namespace Slic3r
#endif