mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Follow-up of a5b202aa1d
(fixed cleanup of toolpaths in preview after scene update)
This commit is contained in:
parent
de65d369a4
commit
f249155340
3 changed files with 12 additions and 5 deletions
|
@ -186,6 +186,7 @@ Preview::Preview(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view_t
|
||||||
, m_loaded(false)
|
, m_loaded(false)
|
||||||
, m_enabled(false)
|
, m_enabled(false)
|
||||||
, m_schedule_background_process(schedule_background_process_func)
|
, m_schedule_background_process(schedule_background_process_func)
|
||||||
|
, m_volumes_cleanup_required(false)
|
||||||
{
|
{
|
||||||
if (init(parent, bed, camera, view_toolbar))
|
if (init(parent, bed, camera, view_toolbar))
|
||||||
{
|
{
|
||||||
|
@ -363,16 +364,20 @@ void Preview::load_print()
|
||||||
load_print_as_sla();
|
load_print_as_sla();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preview::reload_print(bool force, bool keep_volumes)
|
void Preview::reload_print(bool keep_volumes)
|
||||||
{
|
{
|
||||||
if (!IsShown() && !force)
|
if (!IsShown())
|
||||||
|
{
|
||||||
|
m_volumes_cleanup_required = !keep_volumes;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!keep_volumes)
|
if (m_volumes_cleanup_required || !keep_volumes)
|
||||||
{
|
{
|
||||||
m_canvas->reset_volumes();
|
m_canvas->reset_volumes();
|
||||||
m_canvas->reset_legend_texture();
|
m_canvas->reset_legend_texture();
|
||||||
m_loaded = false;
|
m_loaded = false;
|
||||||
|
m_volumes_cleanup_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
load_print();
|
load_print();
|
||||||
|
|
|
@ -86,6 +86,8 @@ class Preview : public wxPanel
|
||||||
BackgroundSlicingProcess* m_process;
|
BackgroundSlicingProcess* m_process;
|
||||||
GCodePreviewData* m_gcode_preview_data;
|
GCodePreviewData* m_gcode_preview_data;
|
||||||
|
|
||||||
|
bool m_volumes_cleanup_required;
|
||||||
|
|
||||||
// Calling this function object forces Plater::schedule_background_process.
|
// Calling this function object forces Plater::schedule_background_process.
|
||||||
std::function<void()> m_schedule_background_process;
|
std::function<void()> m_schedule_background_process;
|
||||||
|
|
||||||
|
@ -112,7 +114,7 @@ public:
|
||||||
void set_drop_target(wxDropTarget* target);
|
void set_drop_target(wxDropTarget* target);
|
||||||
|
|
||||||
void load_print();
|
void load_print();
|
||||||
void reload_print(bool force = false, bool keep_volumes = false);
|
void reload_print(bool keep_volumes = false);
|
||||||
void refresh_print();
|
void refresh_print();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -2388,7 +2388,7 @@ void Plater::priv::set_current_panel(wxPanel* panel)
|
||||||
{
|
{
|
||||||
this->q->reslice();
|
this->q->reslice();
|
||||||
// keeps current gcode preview, if any
|
// keeps current gcode preview, if any
|
||||||
preview->reload_print(false, true);
|
preview->reload_print(true);
|
||||||
preview->set_canvas_as_dirty();
|
preview->set_canvas_as_dirty();
|
||||||
view_toolbar.select_item("Preview");
|
view_toolbar.select_item("Preview");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue