Tech ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE set as default

This commit is contained in:
enricoturri1966 2021-02-19 15:38:05 +01:00
parent bbf5c62af5
commit c3a52f9b01
6 changed files with 0 additions and 39 deletions

View File

@ -80,14 +80,6 @@
#define ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN (1 && ENABLE_2_3_0_BETA1) #define ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN (1 && ENABLE_2_3_0_BETA1)
//===================
// 2.3.0.beta3 techs
//===================
#define ENABLE_2_3_0_BETA3 1
#define ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE (1 && ENABLE_2_3_0_BETA3)
//================= //=================
// 2.3.0.rc1 techs // 2.3.0.rc1 techs
//================= //=================

View File

@ -511,21 +511,14 @@ void GCodeViewer::refresh(const GCodeProcessor::Result& gcode_result, const std:
#endif // ENABLE_GCODE_VIEWER_STATISTICS #endif // ENABLE_GCODE_VIEWER_STATISTICS
// update buffers' render paths // update buffers' render paths
#if ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
refresh_render_paths(); refresh_render_paths();
#else
refresh_render_paths(false, false);
#endif // ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
log_memory_used("Refreshed G-code extrusion paths, "); log_memory_used("Refreshed G-code extrusion paths, ");
} }
#if ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void GCodeViewer::refresh_render_paths() void GCodeViewer::refresh_render_paths()
{ {
refresh_render_paths(false, false); refresh_render_paths(false, false);
} }
#endif // ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config) void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config)
{ {

View File

@ -656,9 +656,7 @@ public:
void load(const GCodeProcessor::Result& gcode_result, const Print& print, bool initialized); void load(const GCodeProcessor::Result& gcode_result, const Print& print, bool initialized);
// recalculate ranges in dependence of what is visible and sets tool/print colors // recalculate ranges in dependence of what is visible and sets tool/print colors
void refresh(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors); void refresh(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors);
#if ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void refresh_render_paths(); void refresh_render_paths();
#endif // ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void update_shells_color_by_extruder(const DynamicPrintConfig* config); void update_shells_color_by_extruder(const DynamicPrintConfig* config);
void reset(); void reset();

View File

@ -2328,14 +2328,12 @@ void GLCanvas3D::refresh_gcode_preview(const GCodeProcessor::Result& gcode_resul
request_extra_frame(); request_extra_frame();
} }
#if ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void GLCanvas3D::refresh_gcode_preview_render_paths() void GLCanvas3D::refresh_gcode_preview_render_paths()
{ {
m_gcode_viewer.refresh_render_paths(); m_gcode_viewer.refresh_render_paths();
set_as_dirty(); set_as_dirty();
request_extra_frame(); request_extra_frame();
} }
#endif // ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void GLCanvas3D::load_sla_preview() void GLCanvas3D::load_sla_preview()
{ {

View File

@ -666,9 +666,7 @@ public:
void load_gcode_preview(const GCodeProcessor::Result& gcode_result); void load_gcode_preview(const GCodeProcessor::Result& gcode_result);
void refresh_gcode_preview(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors); void refresh_gcode_preview(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors);
#if ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void refresh_gcode_preview_render_paths(); void refresh_gcode_preview_render_paths();
#endif // ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
void set_gcode_view_preview_type(GCodeViewer::EViewType type) { return m_gcode_viewer.set_view_type(type); } void set_gcode_view_preview_type(GCodeViewer::EViewType type) { return m_gcode_viewer.set_view_type(type); }
GCodeViewer::EViewType get_gcode_view_preview_type() const { return m_gcode_viewer.get_view_type(); } GCodeViewer::EViewType get_gcode_view_preview_type() const { return m_gcode_viewer.get_view_type(); }
void load_sla_preview(); void load_sla_preview();

View File

@ -472,26 +472,8 @@ void Preview::on_combochecklist_options(wxCommandEvent& evt)
return; return;
m_canvas->set_gcode_options_visibility_from_flags(new_flags); m_canvas->set_gcode_options_visibility_from_flags(new_flags);
#if ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
m_canvas->refresh_gcode_preview_render_paths(); m_canvas->refresh_gcode_preview_render_paths();
update_moves_slider(); update_moves_slider();
#else
auto xored = [](unsigned int flags1, unsigned int flags2, unsigned int flag) {
auto is_flag_set = [](unsigned int flags, unsigned int flag) {
return (flags & (1 << flag)) != 0;
};
return !is_flag_set(flags1, flag) != !is_flag_set(flags2, flag);
};
bool skip_refresh = xored(curr_flags, new_flags, static_cast<unsigned int>(OptionType::Shells)) ||
xored(curr_flags, new_flags, static_cast<unsigned int>(OptionType::ToolMarker));
if (!skip_refresh)
refresh_print();
else
m_canvas->set_as_dirty();
#endif // ENABLE_RENDER_PATH_REFRESH_AFTER_OPTIONS_CHANGE
} }
void Preview::update_bottom_toolbar() void Preview::update_bottom_toolbar()