Fix after merge

This commit is contained in:
Filip Sykala - NTB T15p 2022-07-20 13:02:23 +02:00
parent 79a7f588b9
commit 0b798267d6
4 changed files with 38 additions and 33 deletions

View File

@ -847,7 +847,7 @@ priv::CutMesh priv::to_cgal(const indexed_triangle_set &its,
} }
} }
assert(vertices_count <= vertices.size()); assert(vertices_count <= vertices.size());
assert(edges_count <= (indices.size() * 3) / 2); assert(edges_count <= (indices.size() * 3));
assert(faces_count <= indices.size()); assert(faces_count <= indices.size());
CutMesh result; CutMesh result;

View File

@ -553,11 +553,16 @@ namespace cereal {
template<class Archive> void serialize(Archive& archive, Slic3r::Vec2d &v) { archive(v.x(), v.y()); } template<class Archive> void serialize(Archive& archive, Slic3r::Vec2d &v) { archive(v.x(), v.y()); }
template<class Archive> void serialize(Archive& archive, Slic3r::Vec3d &v) { archive(v.x(), v.y(), v.z()); } template<class Archive> void serialize(Archive& archive, Slic3r::Vec3d &v) { archive(v.x(), v.y(), v.z()); }
template<class Archive> void serialize(Archive& archive, Slic3r::Matrix4d &m){ archive(binary_data(m.data(), 4*4*sizeof(double))); }
template<class Archive> void load(Archive& archive, Slic3r::Matrix2f &m) { archive.loadBinary((char*)m.data(), sizeof(float) * 4); } template<class Archive> void load(Archive& archive, Slic3r::Matrix2f &m) { archive.loadBinary((char*)m.data(), sizeof(float) * 4); }
template<class Archive> void save(Archive& archive, Slic3r::Matrix2f &m) { archive.saveBinary((char*)m.data(), sizeof(float) * 4); } template<class Archive> void save(Archive& archive, Slic3r::Matrix2f &m) { archive.saveBinary((char*)m.data(), sizeof(float) * 4); }
// Eigen Transformation serialization
template<class Archive, class T, int N> inline void serialize(Archive& archive, Eigen::Transform<T, N, Eigen::Affine, Eigen::DontAlign>& t){ archive(t.matrix()); }
#if ENABLE_WORLD_COORDINATE #if ENABLE_WORLD_COORDINATE
template<class Archive> void load(Archive& archive, Slic3r::Transform3d& m) { archive.loadBinary((char*)m.data(), sizeof(double) * 16); } //template<class Archive> void load(Archive& archive, Slic3r::Transform3d& m) { archive.loadBinary((char*)m.data(), sizeof(double) * 16); }
template<class Archive> void save(Archive& archive, const Slic3r::Transform3d& m) { archive.saveBinary((char*)m.data(), sizeof(double) * 16); } //template<class Archive> void save(Archive& archive, const Slic3r::Transform3d& m) { archive.saveBinary((char*)m.data(), sizeof(double) * 16); }
#endif // ENABLE_WORLD_COORDINATE #endif // ENABLE_WORLD_COORDINATE
} }

View File

@ -11,35 +11,35 @@
#include "Point.hpp" // Transform3d #include "Point.hpp" // Transform3d
// Serialization through the Cereal library // Serialization through the Cereal library
namespace cereal { //namespace cereal {
// Eigen Matrix 4x4 serialization // // Eigen Matrix 4x4 serialization
template <class Archive> void serialize(Archive &ar, ::Slic3r::Matrix4d &m){ // template <class Archive> void serialize(Archive &ar, ::Slic3r::Matrix4d &m){
ar(binary_data(m.data(), 4*4*sizeof(double))); // ar(binary_data(m.data(), 4*4*sizeof(double)));
} // }
//
// !!! create duplicit implementation // // !!! create duplicit implementation
// General solution for Eigen matrix serialization // // General solution for Eigen matrix serialization
//template <class Archive, class Derived> inline typename std::enable_if<traits::is_output_serializable<BinaryData<typename Derived::Scalar>, Archive>::value, void>::type // //template <class Archive, class Derived> inline typename std::enable_if<traits::is_output_serializable<BinaryData<typename Derived::Scalar>, Archive>::value, void>::type
//save(Archive & ar, Eigen::PlainObjectBase<Derived> const & m){ // //save(Archive & ar, Eigen::PlainObjectBase<Derived> const & m){
// typedef Eigen::PlainObjectBase<Derived> ArrT; // // typedef Eigen::PlainObjectBase<Derived> ArrT;
// if(ArrT::RowsAtCompileTime==Eigen::Dynamic) ar(m.rows()); // // if(ArrT::RowsAtCompileTime==Eigen::Dynamic) ar(m.rows());
// if(ArrT::ColsAtCompileTime==Eigen::Dynamic) ar(m.cols()); // // if(ArrT::ColsAtCompileTime==Eigen::Dynamic) ar(m.cols());
// ar(binary_data(m.data(),m.size()*sizeof(typename Derived::Scalar))); // // ar(binary_data(m.data(),m.size()*sizeof(typename Derived::Scalar)));
//} // //}
//template <class Archive, class Derived> inline typename std::enable_if<traits::is_input_serializable<BinaryData<typename Derived::Scalar>, Archive>::value, void>::type // //template <class Archive, class Derived> inline typename std::enable_if<traits::is_input_serializable<BinaryData<typename Derived::Scalar>, Archive>::value, void>::type
//load(Archive & ar, Eigen::PlainObjectBase<Derived> & m){ // //load(Archive & ar, Eigen::PlainObjectBase<Derived> & m){
// typedef Eigen::PlainObjectBase<Derived> ArrT; // // typedef Eigen::PlainObjectBase<Derived> ArrT;
// Eigen::Index rows=ArrT::RowsAtCompileTime, cols=ArrT::ColsAtCompileTime; // // Eigen::Index rows=ArrT::RowsAtCompileTime, cols=ArrT::ColsAtCompileTime;
// if(rows==Eigen::Dynamic) ar(rows); // // if(rows==Eigen::Dynamic) ar(rows);
// if(cols==Eigen::Dynamic) ar(cols); // // if(cols==Eigen::Dynamic) ar(cols);
// m.resize(rows,cols); // // m.resize(rows,cols);
// ar(binary_data(m.data(),static_cast<std::size_t>(rows*cols*sizeof(typename Derived::Scalar)))); // // ar(binary_data(m.data(),static_cast<std::size_t>(rows*cols*sizeof(typename Derived::Scalar))));
//} // //}
//
// Eigen Transformation serialization // // Eigen Transformation serialization
template<class Archive, class T, int N> inline void // template<class Archive, class T, int N> inline void
serialize(Archive & ar, Eigen::Transform<T, N, Eigen::Affine, Eigen::DontAlign>& t){ ar(t.matrix()); } // serialize(Archive & ar, Eigen::Transform<T, N, Eigen::Affine, Eigen::DontAlign>& t){ ar(t.matrix()); }
} //}
namespace Slic3r { namespace Slic3r {

View File

@ -2132,7 +2132,7 @@ void GLGizmoEmboss::do_translate(const Vec3d &relative_move)
Selection &selection = m_parent.get_selection(); Selection &selection = m_parent.get_selection();
assert(!selection.is_empty()); assert(!selection.is_empty());
selection.setup_cache(); 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 std::string snapshot_name; // empty meand no store undo / redo
// NOTE: it use L instead of _L macro because prefix _ is appended inside // NOTE: it use L instead of _L macro because prefix _ is appended inside