From 6dc447503082f1e42d33e3dd6d8426aafe67ff59 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 17 Jul 2023 15:07:51 +0200 Subject: [PATCH] Fixed missing template keywords, compiled on MSVCC but not on other compilers. --- src/libslic3r/MultiPoint.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/MultiPoint.hpp b/src/libslic3r/MultiPoint.hpp index dcd192bac7..ece2ce2d90 100644 --- a/src/libslic3r/MultiPoint.hpp +++ b/src/libslic3r/MultiPoint.hpp @@ -50,18 +50,19 @@ inline OutputIterator douglas_peucker(InputIterator begin, InputIterator end, Ou } else { SquareLengthType max_dist_sq = 0; // Find point furthest from line seg created by (anchor, floater) and note it. - const Vector v = (f - a).cast(); + const Vector v = (f - a).template cast(); if (const SquareLengthType l2 = v.squaredNorm(); l2 == 0) { // Zero length segment, find the furthest point between anchor and floater. for (auto it = std::next(anchor); it != floater; ++ it) - if (SquareLengthType dist_sq = (point_getter(*it) - a).cast().squaredNorm(); dist_sq > max_dist_sq) { + if (SquareLengthType dist_sq = (point_getter(*it) - a).template cast().squaredNorm(); + dist_sq > max_dist_sq) { max_dist_sq = dist_sq; furthest = it; } } else { // Find Find the furthest point from the line . const double dl2 = double(l2); - const Vec2d dv = v.cast(); + const Vec2d dv = v.template cast(); for (auto it = std::next(anchor); it != floater; ++ it) { const auto p = point_getter(*it); const Vector va = (p - a).template cast(); @@ -70,11 +71,11 @@ inline OutputIterator douglas_peucker(InputIterator begin, InputIterator end, Ou if (t <= 0) { dist_sq = va.squaredNorm(); } else if (t >= l2) { - dist_sq = (p - f).cast().squaredNorm(); + dist_sq = (p - f).template cast().squaredNorm(); } else if (double dt = double(t) / dl2; dt <= 0) { dist_sq = va.squaredNorm(); } else if (dt >= 1.) { - dist_sq = (p - f).cast().squaredNorm(); + dist_sq = (p - f).template cast().squaredNorm(); } else { const Vector w = (dt * dv).cast(); dist_sq = (w - va).squaredNorm();