From 0b798267d6fbdc68db4c0bb456470114f972a354 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Wed, 20 Jul 2022 13:02:23 +0200 Subject: [PATCH] Fix after merge --- src/libslic3r/CutSurface.cpp | 2 +- src/libslic3r/Point.hpp | 9 +++- src/libslic3r/TextConfiguration.hpp | 58 ++++++++++++------------- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 2 +- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp index 7498aa680..9619c7791 100644 --- a/src/libslic3r/CutSurface.cpp +++ b/src/libslic3r/CutSurface.cpp @@ -847,7 +847,7 @@ priv::CutMesh priv::to_cgal(const indexed_triangle_set &its, } } assert(vertices_count <= vertices.size()); - assert(edges_count <= (indices.size() * 3) / 2); + assert(edges_count <= (indices.size() * 3)); assert(faces_count <= indices.size()); CutMesh result; diff --git a/src/libslic3r/Point.hpp b/src/libslic3r/Point.hpp index 06cf34503..f96dd801a 100644 --- a/src/libslic3r/Point.hpp +++ b/src/libslic3r/Point.hpp @@ -553,11 +553,16 @@ namespace cereal { template void serialize(Archive& archive, Slic3r::Vec2d &v) { archive(v.x(), v.y()); } template void serialize(Archive& archive, Slic3r::Vec3d &v) { archive(v.x(), v.y(), v.z()); } + template void serialize(Archive& archive, Slic3r::Matrix4d &m){ archive(binary_data(m.data(), 4*4*sizeof(double))); } template void load(Archive& archive, Slic3r::Matrix2f &m) { archive.loadBinary((char*)m.data(), sizeof(float) * 4); } template void save(Archive& archive, Slic3r::Matrix2f &m) { archive.saveBinary((char*)m.data(), sizeof(float) * 4); } + + // Eigen Transformation serialization + template inline void serialize(Archive& archive, Eigen::Transform& t){ archive(t.matrix()); } + #if ENABLE_WORLD_COORDINATE - template void load(Archive& archive, Slic3r::Transform3d& m) { archive.loadBinary((char*)m.data(), sizeof(double) * 16); } - template void save(Archive& archive, const Slic3r::Transform3d& m) { archive.saveBinary((char*)m.data(), sizeof(double) * 16); } + //template void load(Archive& archive, Slic3r::Transform3d& m) { archive.loadBinary((char*)m.data(), sizeof(double) * 16); } + //template void save(Archive& archive, const Slic3r::Transform3d& m) { archive.saveBinary((char*)m.data(), sizeof(double) * 16); } #endif // ENABLE_WORLD_COORDINATE } diff --git a/src/libslic3r/TextConfiguration.hpp b/src/libslic3r/TextConfiguration.hpp index ae97af512..b97c550bb 100644 --- a/src/libslic3r/TextConfiguration.hpp +++ b/src/libslic3r/TextConfiguration.hpp @@ -11,35 +11,35 @@ #include "Point.hpp" // Transform3d // Serialization through the Cereal library -namespace cereal { - // Eigen Matrix 4x4 serialization - template void serialize(Archive &ar, ::Slic3r::Matrix4d &m){ - ar(binary_data(m.data(), 4*4*sizeof(double))); - } - - // !!! create duplicit implementation - // General solution for Eigen matrix serialization - //template inline typename std::enable_if, Archive>::value, void>::type - //save(Archive & ar, Eigen::PlainObjectBase const & m){ - // typedef Eigen::PlainObjectBase ArrT; - // if(ArrT::RowsAtCompileTime==Eigen::Dynamic) ar(m.rows()); - // if(ArrT::ColsAtCompileTime==Eigen::Dynamic) ar(m.cols()); - // ar(binary_data(m.data(),m.size()*sizeof(typename Derived::Scalar))); - //} - //template inline typename std::enable_if, Archive>::value, void>::type - //load(Archive & ar, Eigen::PlainObjectBase & m){ - // typedef Eigen::PlainObjectBase ArrT; - // Eigen::Index rows=ArrT::RowsAtCompileTime, cols=ArrT::ColsAtCompileTime; - // if(rows==Eigen::Dynamic) ar(rows); - // if(cols==Eigen::Dynamic) ar(cols); - // m.resize(rows,cols); - // ar(binary_data(m.data(),static_cast(rows*cols*sizeof(typename Derived::Scalar)))); - //} - - // Eigen Transformation serialization - template inline void - serialize(Archive & ar, Eigen::Transform& t){ ar(t.matrix()); } -} +//namespace cereal { +// // Eigen Matrix 4x4 serialization +// template void serialize(Archive &ar, ::Slic3r::Matrix4d &m){ +// ar(binary_data(m.data(), 4*4*sizeof(double))); +// } +// +// // !!! create duplicit implementation +// // General solution for Eigen matrix serialization +// //template inline typename std::enable_if, Archive>::value, void>::type +// //save(Archive & ar, Eigen::PlainObjectBase const & m){ +// // typedef Eigen::PlainObjectBase ArrT; +// // if(ArrT::RowsAtCompileTime==Eigen::Dynamic) ar(m.rows()); +// // if(ArrT::ColsAtCompileTime==Eigen::Dynamic) ar(m.cols()); +// // ar(binary_data(m.data(),m.size()*sizeof(typename Derived::Scalar))); +// //} +// //template inline typename std::enable_if, Archive>::value, void>::type +// //load(Archive & ar, Eigen::PlainObjectBase & m){ +// // typedef Eigen::PlainObjectBase ArrT; +// // Eigen::Index rows=ArrT::RowsAtCompileTime, cols=ArrT::ColsAtCompileTime; +// // if(rows==Eigen::Dynamic) ar(rows); +// // if(cols==Eigen::Dynamic) ar(cols); +// // m.resize(rows,cols); +// // ar(binary_data(m.data(),static_cast(rows*cols*sizeof(typename Derived::Scalar)))); +// //} +// +// // Eigen Transformation serialization +// template inline void +// serialize(Archive & ar, Eigen::Transform& t){ ar(t.matrix()); } +//} namespace Slic3r { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index 69260fba4..b6e5f209d 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -2132,7 +2132,7 @@ void GLGizmoEmboss::do_translate(const Vec3d &relative_move) Selection &selection = m_parent.get_selection(); assert(!selection.is_empty()); selection.setup_cache(); - selection.translate(relative_move, ECoordinatesType::Local); + selection.translate(relative_move, TransformationType::Local); std::string snapshot_name; // empty meand no store undo / redo // NOTE: it use L instead of _L macro because prefix _ is appended inside