Undo/redo in FDM supports gizmo

This commit is contained in:
Lukas Matena 2020-05-05 13:45:04 +02:00
parent 0c84a0b696
commit 272de22055
5 changed files with 57 additions and 38 deletions

View file

@ -411,6 +411,11 @@ public:
return timestamp == other.get_timestamp();
}
template<class Archive> void serialize(Archive &ar)
{
ar(m_data);
}
private:
std::map<int, FacetSupportType> m_data;
@ -613,7 +618,8 @@ private:
}
template<class Archive> void load(Archive &ar) {
bool has_convex_hull;
ar(name, source, m_mesh, m_type, m_material_id, m_transformation, m_is_splittable, has_convex_hull);
ar(name, source, m_mesh, m_type, m_material_id, m_transformation,
m_is_splittable, has_convex_hull, m_supported_facets);
cereal::load_by_value(ar, config);
assert(m_mesh);
if (has_convex_hull) {
@ -626,7 +632,8 @@ private:
}
template<class Archive> void save(Archive &ar) const {
bool has_convex_hull = m_convex_hull.get() != nullptr;
ar(name, source, m_mesh, m_type, m_material_id, m_transformation, m_is_splittable, has_convex_hull);
ar(name, source, m_mesh, m_type, m_material_id, m_transformation,
m_is_splittable, has_convex_hull, m_supported_facets);
cereal::save_by_value(ar, config);
if (has_convex_hull)
cereal::save_optional(ar, m_convex_hull);