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>2018-08-17 15:14:24 +0300
committerbubnikv <bubnikv@gmail.com>2018-08-17 15:14:24 +0300
commit1ba64da3fee97433d6b580aae8fc8e9875143a66 (patch)
treeb8c8c5239ed3ea9190cafa18afd5a95f38b80a09 /xs/src/libslic3r/libslic3r.h
parent3b89717149664e5702fa1e0a153e54824e2793ff (diff)
Removed Point::scale(),translate(),coincides_with(),distance_to(),
distance_to_squared(),perp_distance_to(),negative(),vector_to(), translate(), distance_to() etc, replaced with the Eigen equivalents.
Diffstat (limited to 'xs/src/libslic3r/libslic3r.h')
-rw-r--r--xs/src/libslic3r/libslic3r.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/xs/src/libslic3r/libslic3r.h b/xs/src/libslic3r/libslic3r.h
index 77006cebe..e6ebc14e5 100644
--- a/xs/src/libslic3r/libslic3r.h
+++ b/xs/src/libslic3r/libslic3r.h
@@ -130,6 +130,17 @@ inline void append(std::vector<T>& dest, std::vector<T>&& src)
src.shrink_to_fit();
}
+// Casting an std::vector<> from one type to another type without warnings about a loss of accuracy.
+template<typename T_TO, typename T_FROM>
+std::vector<T_TO> cast(const std::vector<T_FROM> &src)
+{
+ std::vector<T_TO> dst;
+ dst.reserve(src.size());
+ for (const T_FROM &a : src)
+ dst.emplace_back((T_TO)a);
+ return dst;
+}
+
template <typename T>
inline void remove_nulls(std::vector<T*> &vec)
{