mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-21 17:39:10 -07:00
GCode Preview - Legend texture shown only when gcode is available
This commit is contained in:
@@ -1229,6 +1229,11 @@ unsigned int _3DScene::LegendTexture::get_texture_height() const
|
||||
return m_tex_height;
|
||||
}
|
||||
|
||||
void _3DScene::LegendTexture::reset_texture()
|
||||
{
|
||||
_destroy_texture();
|
||||
}
|
||||
|
||||
bool _3DScene::LegendTexture::_create_texture(const Print& print, const wxBitmap& bitmap)
|
||||
{
|
||||
if ((m_tex_width == 0) || (m_tex_height == 0))
|
||||
@@ -1270,6 +1275,8 @@ void _3DScene::LegendTexture::_destroy_texture()
|
||||
{
|
||||
::glDeleteTextures(1, &m_tex_id);
|
||||
m_tex_id = 0;
|
||||
m_tex_height = 0;
|
||||
m_tex_width = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1316,7 +1323,10 @@ void _3DScene::load_gcode_preview(const Print* print, GLVolumeCollection* volume
|
||||
_load_gcode_retractions(*print, *volumes, use_VBOs);
|
||||
_load_gcode_unretractions(*print, *volumes, use_VBOs);
|
||||
|
||||
_generate_legend_texture(*print);
|
||||
if (volumes->empty())
|
||||
reset_legend_texture();
|
||||
else
|
||||
_generate_legend_texture(*print);
|
||||
}
|
||||
|
||||
_update_gcode_volumes_visibility(*print, *volumes);
|
||||
@@ -1337,6 +1347,11 @@ unsigned int _3DScene::get_legend_texture_height()
|
||||
return s_legend_texture.get_texture_height();
|
||||
}
|
||||
|
||||
void _3DScene::reset_legend_texture()
|
||||
{
|
||||
s_legend_texture.reset_texture();
|
||||
}
|
||||
|
||||
// Create 3D thick extrusion lines for a skirt and brim.
|
||||
// Adds a new Slic3r::GUI::3DScene::Volume to volumes.
|
||||
void _3DScene::_load_print_toolpaths(
|
||||
|
||||
Reference in New Issue
Block a user