Code cleanup

This commit is contained in:
Enrico Turri 2019-03-01 10:46:28 +01:00
parent 058468d371
commit 8c3df91f2e
4 changed files with 0 additions and 20 deletions

View file

@ -58,7 +58,5 @@
// Printbed textures generated from svg files // Printbed textures generated from svg files
#define ENABLE_TEXTURES_FROM_SVG (1 && ENABLE_1_42_0_ALPHA7) #define ENABLE_TEXTURES_FROM_SVG (1 && ENABLE_1_42_0_ALPHA7)
// Do not regenerate GLVolumes for gcode preview if not needed
#define ENABLE_NO_GCODE_TOOLPATHS_REGENERATION (1 && ENABLE_1_42_0_ALPHA7)
#endif // _technologies_h_ #endif // _technologies_h_

View file

@ -418,22 +418,14 @@ void Preview::load_print()
load_print_as_sla(); load_print_as_sla();
} }
#if ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
void Preview::reload_print(bool force, bool keep_volumes) void Preview::reload_print(bool force, bool keep_volumes)
#else
void Preview::reload_print(bool force)
#endif // ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
{ {
#if ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
if (!keep_volumes) if (!keep_volumes)
{ {
#endif // ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
m_canvas->reset_volumes(); m_canvas->reset_volumes();
m_canvas->reset_legend_texture(); m_canvas->reset_legend_texture();
m_loaded = false; m_loaded = false;
#if ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
} }
#endif // ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
if (!IsShown() && !force) if (!IsShown() && !force)
return; return;

View file

@ -129,11 +129,7 @@ public:
void set_drop_target(wxDropTarget* target); void set_drop_target(wxDropTarget* target);
void load_print(); void load_print();
#if ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
void reload_print(bool force = false, bool keep_volumes = false); void reload_print(bool force = false, bool keep_volumes = false);
#else
void reload_print(bool force = false);
#endif // ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
void refresh_print(); void refresh_print();
private: private:

View file

@ -1997,11 +1997,9 @@ void Plater::priv::schedule_background_process()
this->background_process_timer.Start(500, wxTIMER_ONE_SHOT); this->background_process_timer.Start(500, wxTIMER_ONE_SHOT);
// Notify the Canvas3D that something has changed, so it may invalidate some of the layer editing stuff. // Notify the Canvas3D that something has changed, so it may invalidate some of the layer editing stuff.
this->view3D->get_canvas3d()->set_config(this->config); this->view3D->get_canvas3d()->set_config(this->config);
#if ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
// Reset gcode preview // Reset gcode preview
this->preview->get_canvas3d()->reset_volumes(); this->preview->get_canvas3d()->reset_volumes();
this->preview->get_canvas3d()->reset_legend_texture(); this->preview->get_canvas3d()->reset_legend_texture();
#endif // ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
} }
void Plater::priv::update_print_volume_state() void Plater::priv::update_print_volume_state()
@ -2266,12 +2264,8 @@ void Plater::priv::set_current_panel(wxPanel* panel)
else if (current_panel == preview) else if (current_panel == preview)
{ {
this->q->reslice(); this->q->reslice();
#if ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
// keeps current gcode preview, if any // keeps current gcode preview, if any
preview->reload_print(false, true); preview->reload_print(false, true);
#else
preview->reload_print();
#endif // ENABLE_NO_GCODE_TOOLPATHS_REGENERATION
preview->set_canvas_as_dirty(); preview->set_canvas_as_dirty();
view_toolbar.select_item("Preview"); view_toolbar.select_item("Preview");
} }