From 01f32e18d6e5fc520a947d3b1b59cb41bf6d9c20 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 6 Aug 2021 13:03:30 +0200 Subject: [PATCH] Fixed build on Linux, abs->std::abs --- src/libslic3r/QuadricEdgeCollapse.cpp | 7 ++++--- src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/QuadricEdgeCollapse.cpp b/src/libslic3r/QuadricEdgeCollapse.cpp index e42ed5deb2..a66dbc192a 100644 --- a/src/libslic3r/QuadricEdgeCollapse.cpp +++ b/src/libslic3r/QuadricEdgeCollapse.cpp @@ -2,6 +2,7 @@ #include #include "MutablePriorityQueue.hpp" #include "SimplifyMeshImpl.hpp" +#include using namespace Slic3r; @@ -316,7 +317,7 @@ double QuadricEdgeCollapse::calculate_error(uint32_t id_v1, const Vertices &vertices) { double det = calculate_determinant(q); - if (abs(det) < std::numeric_limits::epsilon()) { + if (std::abs(det) < std::numeric_limits::epsilon()) { // can't divide by zero auto verts = create_vertices(id_v1, id_v2, vertices); auto errors = vertices_error(q, verts); @@ -333,7 +334,7 @@ Vec3f QuadricEdgeCollapse::calculate_vertex(uint32_t id_v1, const Vertices &vertices) { double det = calculate_determinant(q); - if (abs(det) < std::numeric_limits::epsilon()) { + if (std::abs(det) < std::numeric_limits::epsilon()) { // can't divide by zero auto verts = create_vertices(id_v1, id_v2, vertices); auto errors = vertices_error(q, verts); @@ -650,4 +651,4 @@ void QuadricEdgeCollapse::compact(const VertexInfos & v_infos, its.indices[ti_new++] = its.indices[ti]; } its.indices.erase(its.indices.begin() + ti_new, its.indices.end()); -} \ No newline at end of file +} diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp index 92654c6064..694eeadd4e 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp @@ -9,6 +9,9 @@ #include "libslic3r/Model.hpp" #include "libslic3r/QuadricEdgeCollapse.hpp" +#include +#include + namespace Slic3r::GUI { GLGizmoSimplify::GLGizmoSimplify(GLCanvas3D & parent, @@ -274,8 +277,8 @@ void GLGizmoSimplify::process() state = State::settings; } // need to render last status fn - // without Sleep it freeze until mouse move - Sleep(50); + // without sleep it freezes until mouse move + std::this_thread::sleep_for(std::chrono::milliseconds(50)); m_parent.schedule_extra_frame(0); }); }