Hidden imgui debug dialog for new visualization in preview

This commit is contained in:
enricoturri1966 2023-10-30 12:09:13 +01:00 committed by Lukas Matena
parent 7ee937857b
commit 72d5116744
6 changed files with 17 additions and 22 deletions

View File

@ -61,6 +61,7 @@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#define ENABLE_NEW_GCODE_VIEWER 1
#define ENABLE_NEW_GCODE_VIEWER_DEBUG (0 && ENABLE_NEW_GCODE_VIEWER)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#endif // _prusaslicer_technologies_h_

View File

@ -1221,7 +1221,7 @@ void GCodeViewer::render()
#endif // ENABLE_GCODE_VIEWER_STATISTICS
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#if ENABLE_NEW_GCODE_VIEWER
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
if (m_use_gcode_viewer_2) {
ImGuiWrapper& imgui = *Slic3r::GUI::wxGetApp().imgui();
imgui.begin(std::string("LibVGCode Viewer Controller"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
@ -1252,7 +1252,7 @@ void GCodeViewer::render()
imgui.end();
}
#endif // ENABLE_NEW_GCODE_VIEWER
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
}

View File

@ -115,13 +115,12 @@ unsigned int ColorRange::get_count() const
return m_count;
}
//################################################################################################################################
// Debug
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
const std::array<float, 2>& ColorRange::get_range() const
{
return m_range;
}
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
} // namespace libvgcode

View File

@ -34,10 +34,9 @@ public:
Color get_color_at(float value) const;
unsigned int get_count() const;
//################################################################################################################################
// Debug
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
const std::array<float, 2>& get_range() const;
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
private:
EType m_type{ EType::Linear };

View File

@ -779,13 +779,12 @@ void Toolpaths::update_enabled_entities()
m_enabled_segments_count = enabled_segments.size();
m_enabled_options_count = enabled_options.size();
//################################################################################################################################
// Debug
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
m_enabled_segments_range = (m_enabled_segments_count > 0) ?
std::make_pair((uint32_t)enabled_segments.front(), (uint32_t)enabled_segments.back()) : std::make_pair((uint32_t)0, (uint32_t)0);
m_enabled_options_range = (m_enabled_options_count > 0) ?
std::make_pair((uint32_t)enabled_options.front(), (uint32_t)enabled_options.back()) : std::make_pair((uint32_t)0, (uint32_t)0);
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
// update gpu buffer for enabled segments
assert(m_enabled_segments_buf_id > 0);
@ -859,10 +858,9 @@ void Toolpaths::render(const Mat4x4f& view_matrix, const Mat4x4f& projection_mat
if (m_settings.options_visibility.at(EOptionType::CenterOfGravity))
render_cog_marker(view_matrix, projection_matrix);
//################################################################################################################################
// Debug
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
render_debug_window();
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
}
EViewType Toolpaths::get_view_type() const
@ -1463,8 +1461,7 @@ void Toolpaths::render_tool_marker(const Mat4x4f& view_matrix, const Mat4x4f& pr
glsafe(glUseProgram(curr_shader));
}
//################################################################################################################################
// Debug
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
void Toolpaths::render_debug_window()
{
Slic3r::GUI::ImGuiWrapper& imgui = *Slic3r::GUI::wxGetApp().imgui();
@ -1627,7 +1624,7 @@ void Toolpaths::render_debug_window()
}
imgui.end();
}
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
} // namespace libvgcode

View File

@ -157,11 +157,10 @@ private:
//
std::vector<PathVertex> m_vertices;
std::vector<uint32_t> m_vertices_map;
//################################################################################################################################
// Debug
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
std::pair<uint32_t, uint32_t> m_enabled_segments_range{ 0, 0 };
std::pair<uint32_t, uint32_t> m_enabled_options_range{ 0, 0 };
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
//
// Member variables used for toolpaths visibiliity
@ -266,10 +265,10 @@ private:
void render_cog_marker(const Mat4x4f& view_matrix, const Mat4x4f& projection_matrix);
void render_tool_marker(const Mat4x4f& view_matrix, const Mat4x4f& projection_matrix);
//################################################################################################################################
#if ENABLE_NEW_GCODE_VIEWER_DEBUG
// Debug
void render_debug_window();
//################################################################################################################################
#endif // ENABLE_NEW_GCODE_VIEWER_DEBUG
};
} // namespace libvgcode