FIX: [STUDIO-3345] take snapshot for mesh boolean
Change-Id: I316a94b7f1122d48c5499b22c44a4c55545d2703
This commit is contained in:
parent
257e2e0bbb
commit
f55f4e60bb
|
@ -381,7 +381,23 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
|
||||||
ImGuiWrapper::pop_toolbar_style();
|
ImGuiWrapper::pop_toolbar_style();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLGizmoMeshBoolean::on_load(cereal::BinaryInputArchive &ar)
|
||||||
|
{
|
||||||
|
ar(m_enable, m_operation_mode, m_selecting_state, m_diff_delete_input, m_inter_delete_input, m_src, m_tool);
|
||||||
|
ModelObject *curr_model_object = m_c->selection_info() ? m_c->selection_info()->model_object() : nullptr;
|
||||||
|
m_src.mv = curr_model_object == nullptr ? nullptr : m_src.volume_idx < 0 ? nullptr : curr_model_object->volumes[m_src.volume_idx];
|
||||||
|
m_tool.mv = curr_model_object == nullptr ? nullptr : m_tool.volume_idx < 0 ? nullptr : curr_model_object->volumes[m_tool.volume_idx];
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLGizmoMeshBoolean::on_save(cereal::BinaryOutputArchive &ar) const
|
||||||
|
{
|
||||||
|
ar(m_enable, m_operation_mode, m_selecting_state, m_diff_delete_input, m_inter_delete_input, m_src, m_tool);
|
||||||
|
}
|
||||||
|
|
||||||
void GLGizmoMeshBoolean::generate_new_volume(bool delete_input, const TriangleMesh& mesh_result) {
|
void GLGizmoMeshBoolean::generate_new_volume(bool delete_input, const TriangleMesh& mesh_result) {
|
||||||
|
|
||||||
|
wxGetApp().plater()->take_snapshot("Mesh Boolean");
|
||||||
|
|
||||||
ModelObject* curr_model_object = m_c->selection_info()->model_object();
|
ModelObject* curr_model_object = m_c->selection_info()->model_object();
|
||||||
|
|
||||||
// generate new volume
|
// generate new volume
|
||||||
|
|
|
@ -30,6 +30,10 @@ struct VolumeInfo {
|
||||||
volume_idx = -1;
|
volume_idx = -1;
|
||||||
trafo = Transform3d::Identity();
|
trafo = Transform3d::Identity();
|
||||||
};
|
};
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive& ar) {
|
||||||
|
ar(volume_idx, trafo);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
class GLGizmoMeshBoolean : public GLGizmoBase
|
class GLGizmoMeshBoolean : public GLGizmoBase
|
||||||
{
|
{
|
||||||
|
@ -63,6 +67,9 @@ protected:
|
||||||
virtual CommonGizmosDataID on_get_requirements() const override;
|
virtual CommonGizmosDataID on_get_requirements() const override;
|
||||||
virtual void on_render_input_window(float x, float y, float bottom_limit);
|
virtual void on_render_input_window(float x, float y, float bottom_limit);
|
||||||
|
|
||||||
|
void on_load(cereal::BinaryInputArchive &ar) override;
|
||||||
|
void on_save(cereal::BinaryOutputArchive &ar) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_enable{ false };
|
bool m_enable{ false };
|
||||||
MeshBooleanOperation m_operation_mode;
|
MeshBooleanOperation m_operation_mode;
|
||||||
|
|
Loading…
Reference in New Issue