mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Merge branch 'et_gcode_viewer' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer
This commit is contained in:
		
						commit
						1c09484a5d
					
				
					 18 changed files with 1415 additions and 47 deletions
				
			
		|  | @ -400,7 +400,9 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ | ||||||
|     // and maybe other problems. We will therefore go through layer_tools and detect and fix this.
 |     // and maybe other problems. We will therefore go through layer_tools and detect and fix this.
 | ||||||
|     // So, if there is a non-object layer starting with different extruder than the last one ended with (or containing more than one extruder),
 |     // So, if there is a non-object layer starting with different extruder than the last one ended with (or containing more than one extruder),
 | ||||||
|     // we'll mark it with has_wipe tower.
 |     // we'll mark it with has_wipe tower.
 | ||||||
|     assert(! m_layer_tools.empty() && m_layer_tools.front().has_wipe_tower); | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | //    assert(! m_layer_tools.empty() && m_layer_tools.front().has_wipe_tower);
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (! m_layer_tools.empty() && m_layer_tools.front().has_wipe_tower) { |     if (! m_layer_tools.empty() && m_layer_tools.front().has_wipe_tower) { | ||||||
|         for (size_t i = 0; i + 1 < m_layer_tools.size();) { |         for (size_t i = 0; i + 1 < m_layer_tools.size();) { | ||||||
|             const LayerTools < = m_layer_tools[i]; |             const LayerTools < = m_layer_tools[i]; | ||||||
|  |  | ||||||
|  | @ -44,6 +44,9 @@ | ||||||
| 
 | 
 | ||||||
| // Enable G-Code viewer
 | // Enable G-Code viewer
 | ||||||
| #define ENABLE_GCODE_VIEWER (1 && ENABLE_2_3_0_ALPHA1) | #define ENABLE_GCODE_VIEWER (1 && ENABLE_2_3_0_ALPHA1) | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #define ENABLE_SHADERS_MANAGER (1 && ENABLE_GCODE_VIEWER) | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #define ENABLE_GCODE_VIEWER_STATISTICS (0 && ENABLE_GCODE_VIEWER) | #define ENABLE_GCODE_VIEWER_STATISTICS (0 && ENABLE_GCODE_VIEWER) | ||||||
| 
 | 
 | ||||||
| #endif // _prusaslicer_technologies_h_
 | #endif // _prusaslicer_technologies_h_
 | ||||||
|  |  | ||||||
|  | @ -23,6 +23,8 @@ set(SLIC3R_GUI_SOURCES | ||||||
|     GUI/3DScene.cpp |     GUI/3DScene.cpp | ||||||
|     GUI/3DScene.hpp |     GUI/3DScene.hpp | ||||||
|     GUI/format.hpp |     GUI/format.hpp | ||||||
|  |     GUI/GLShadersManager.hpp | ||||||
|  |     GUI/GLShadersManager.cpp | ||||||
|     GUI/GLShader.cpp |     GUI/GLShader.cpp | ||||||
|     GUI/GLShader.hpp     |     GUI/GLShader.hpp     | ||||||
|     GUI/GLCanvas3D.hpp |     GUI/GLCanvas3D.hpp | ||||||
|  |  | ||||||
|  | @ -15,6 +15,11 @@ | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
| #endif // ENABLE_GCODE_VIEWER
 | #endif // ENABLE_GCODE_VIEWER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | //#if ENABLE_SHADERS_MANAGER
 | ||||||
|  | //#include "GLShader.hpp"
 | ||||||
|  | //#endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| #include <GL/glew.h> | #include <GL/glew.h> | ||||||
| 
 | 
 | ||||||
|  | @ -163,9 +168,17 @@ Bed3D::Axes::~Axes() | ||||||
| void Bed3D::Axes::render() const | void Bed3D::Axes::render() const | ||||||
| { | { | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     auto render_axis = [this](const Transform3f& transform) { | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     auto render_axis = [this](const Transform3f& transform, GLint color_id, const std::array<float, 4>& color) { |     auto render_axis = [this](const Transform3f& transform, GLint color_id, const std::array<float, 4>& color) { | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)color.data())); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)color.data())); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         glsafe(::glPushMatrix()); |         glsafe(::glPushMatrix()); | ||||||
|         glsafe(::glMultMatrixf(transform.data())); |         glsafe(::glMultMatrixf(transform.data())); | ||||||
|  | @ -174,14 +187,43 @@ void Bed3D::Axes::render() const | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_arrow.init_from(stilized_arrow(16, DefaultTipRadius, DefaultTipLength, DefaultStemRadius, m_stem_length)); |     m_arrow.init_from(stilized_arrow(16, DefaultTipRadius, DefaultTipLength, DefaultStemRadius, m_stem_length)); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light"); | ||||||
|  |     if (shader == nullptr) | ||||||
|  |         return; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (!m_shader.init("gouraud_light.vs", "gouraud_light.fs")) |     if (!m_shader.init("gouraud_light.vs", "gouraud_light.fs")) | ||||||
|         BOOST_LOG_TRIVIAL(error) << "Unable to initialize gouraud_light shader: please, check that the files gouraud_light.vs and gouraud_light.fs are available"; |         BOOST_LOG_TRIVIAL(error) << "Unable to initialize gouraud_light shader: please, check that the files gouraud_light.vs and gouraud_light.fs are available"; | ||||||
| 
 | 
 | ||||||
|     if (!m_shader.is_initialized()) |     if (!m_shader.is_initialized()) | ||||||
|         return; |         return; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glEnable(GL_DEPTH_TEST)); |     glsafe(::glEnable(GL_DEPTH_TEST)); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     shader->start_using(); | ||||||
|  | 
 | ||||||
|  |     // x axis
 | ||||||
|  |     shader->set_uniform("uniform_color", { 0.75f, 0.0f, 0.0f, 1.0f }); | ||||||
|  |     render_axis(Geometry::assemble_transform(m_origin, { 0.0, 0.5 * M_PI, 0.0f }).cast<float>()); | ||||||
|  | 
 | ||||||
|  |     // y axis
 | ||||||
|  |     shader->set_uniform("uniform_color", { 0.0f, 0.75f, 0.0f, 1.0f }); | ||||||
|  |     render_axis(Geometry::assemble_transform(m_origin, { -0.5 * M_PI, 0.0, 0.0f }).cast<float>()); | ||||||
|  | 
 | ||||||
|  |     // z axis
 | ||||||
|  |     shader->set_uniform("uniform_color", { 0.0f, 0.0f, 0.75f, 1.0f }); | ||||||
|  |     render_axis(Geometry::assemble_transform(m_origin).cast<float>()); | ||||||
|  | 
 | ||||||
|  |     shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.start_using(); |     m_shader.start_using(); | ||||||
|     GLint color_id = ::glGetUniformLocation(m_shader.get_shader_program_id(), "uniform_color"); |     GLint color_id = ::glGetUniformLocation(m_shader.get_shader_program_id(), "uniform_color"); | ||||||
| 
 | 
 | ||||||
|  | @ -195,6 +237,9 @@ void Bed3D::Axes::render() const | ||||||
|     render_axis(Geometry::assemble_transform(m_origin).cast<float>(), color_id, { 0.0f, 0.0f, 0.75f, 1.0f }); |     render_axis(Geometry::assemble_transform(m_origin).cast<float>(), color_id, { 0.0f, 0.0f, 0.75f, 1.0f }); | ||||||
| 
 | 
 | ||||||
|     m_shader.stop_using(); |     m_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glDisable(GL_DEPTH_TEST)); |     glsafe(::glDisable(GL_DEPTH_TEST)); | ||||||
| #else | #else | ||||||
|  | @ -540,6 +585,16 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) const | ||||||
| 
 | 
 | ||||||
|     if (m_triangles.get_vertices_count() > 0) |     if (m_triangles.get_vertices_count() > 0) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         GLShaderProgram* shader = wxGetApp().get_shader("printbed"); | ||||||
|  |         if (shader != nullptr) | ||||||
|  |         { | ||||||
|  |             shader->start_using(); | ||||||
|  |             shader->set_uniform("transparent_background", bottom); | ||||||
|  |             shader->set_uniform("svg_source", boost::algorithm::iends_with(m_texture.get_source(), ".svg")); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (m_shader.get_shader_program_id() == 0) |         if (m_shader.get_shader_program_id() == 0) | ||||||
|             m_shader.init("printbed.vs", "printbed.fs"); |             m_shader.init("printbed.vs", "printbed.fs"); | ||||||
| 
 | 
 | ||||||
|  | @ -548,6 +603,9 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) const | ||||||
|             m_shader.start_using(); |             m_shader.start_using(); | ||||||
|             m_shader.set_uniform("transparent_background", bottom); |             m_shader.set_uniform("transparent_background", bottom); | ||||||
|             m_shader.set_uniform("svg_source", boost::algorithm::iends_with(m_texture.get_source(), ".svg")); |             m_shader.set_uniform("svg_source", boost::algorithm::iends_with(m_texture.get_source(), ".svg")); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|             if (m_vbo_id == 0) |             if (m_vbo_id == 0) | ||||||
|             { |             { | ||||||
|  | @ -568,8 +626,17 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) const | ||||||
| 
 | 
 | ||||||
|             unsigned int stride = m_triangles.get_vertex_data_size(); |             unsigned int stride = m_triangles.get_vertex_data_size(); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |             GLint position_id = shader->get_attrib_location("v_position"); | ||||||
|  |             GLint tex_coords_id = shader->get_attrib_location("v_tex_coords"); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             GLint position_id = m_shader.get_attrib_location("v_position"); |             GLint position_id = m_shader.get_attrib_location("v_position"); | ||||||
|             GLint tex_coords_id = m_shader.get_attrib_location("v_tex_coords"); |             GLint tex_coords_id = m_shader.get_attrib_location("v_tex_coords"); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|             // show the temporary texture while no compressed data is available
 |             // show the temporary texture while no compressed data is available
 | ||||||
|             GLuint tex_id = (GLuint)m_temp_texture.get_id(); |             GLuint tex_id = (GLuint)m_temp_texture.get_id(); | ||||||
|  | @ -607,7 +674,15 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) const | ||||||
|             glsafe(::glDisable(GL_BLEND)); |             glsafe(::glDisable(GL_BLEND)); | ||||||
|             glsafe(::glDepthMask(GL_TRUE)); |             glsafe(::glDepthMask(GL_TRUE)); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |             shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             m_shader.stop_using(); |             m_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -3,7 +3,13 @@ | ||||||
| 
 | 
 | ||||||
| #include "GLTexture.hpp" | #include "GLTexture.hpp" | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "GLShader.hpp" | #include "GLShader.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
| #include "GLModel.hpp" | #include "GLModel.hpp" | ||||||
| #endif // ENABLE_GCODE_VIEWER
 | #endif // ENABLE_GCODE_VIEWER
 | ||||||
|  | @ -69,7 +75,13 @@ class Bed3D | ||||||
|         Vec3d m_origin{ Vec3d::Zero() }; |         Vec3d m_origin{ Vec3d::Zero() }; | ||||||
|         float m_stem_length{ DefaultStemLength }; |         float m_stem_length{ DefaultStemLength }; | ||||||
|         mutable GL_Model m_arrow; |         mutable GL_Model m_arrow; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         mutable Shader m_shader; |         mutable Shader m_shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     public: |     public: | ||||||
| #else | #else | ||||||
|  | @ -118,7 +130,13 @@ private: | ||||||
|     mutable GLBed m_model; |     mutable GLBed m_model; | ||||||
|     // temporary texture shown until the main texture has still no levels compressed
 |     // temporary texture shown until the main texture has still no levels compressed
 | ||||||
|     mutable GLTexture m_temp_texture; |     mutable GLTexture m_temp_texture; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     mutable Shader m_shader; |     mutable Shader m_shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     mutable unsigned int m_vbo_id; |     mutable unsigned int m_vbo_id; | ||||||
|     Axes m_axes; |     Axes m_axes; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,6 +12,11 @@ | ||||||
| #include "DoubleSlider.hpp" | #include "DoubleSlider.hpp" | ||||||
| #include "GLCanvas3D.hpp" | #include "GLCanvas3D.hpp" | ||||||
| #include "GLToolbar.hpp" | #include "GLToolbar.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | //#if ENABLE_SHADERS_MANAGER
 | ||||||
|  | //#include "GLShader.hpp"
 | ||||||
|  | //#endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "GUI_Preview.hpp" | #include "GUI_Preview.hpp" | ||||||
| #include "libslic3r/Model.hpp" | #include "libslic3r/Model.hpp" | ||||||
| #if ENABLE_GCODE_VIEWER_STATISTICS | #if ENABLE_GCODE_VIEWER_STATISTICS | ||||||
|  | @ -107,6 +112,9 @@ void GCodeViewer::IBuffer::reset() | ||||||
|     render_paths = std::vector<RenderPath>(); |     render_paths = std::vector<RenderPath>(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| bool GCodeViewer::IBuffer::init_shader(const std::string& vertex_shader_src, const std::string& fragment_shader_src) | bool GCodeViewer::IBuffer::init_shader(const std::string& vertex_shader_src, const std::string& fragment_shader_src) | ||||||
| { | { | ||||||
|     if (!shader.init(vertex_shader_src, fragment_shader_src)) { |     if (!shader.init(vertex_shader_src, fragment_shader_src)) { | ||||||
|  | @ -116,6 +124,9 @@ bool GCodeViewer::IBuffer::init_shader(const std::string& vertex_shader_src, con | ||||||
| 
 | 
 | ||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| void GCodeViewer::IBuffer::add_path(const GCodeProcessor::MoveVertex& move, unsigned int i_id, unsigned int s_id) | void GCodeViewer::IBuffer::add_path(const GCodeProcessor::MoveVertex& move, unsigned int i_id, unsigned int s_id) | ||||||
| { | { | ||||||
|  | @ -149,11 +160,33 @@ GCodeViewer::Color GCodeViewer::Extrusions::Range::get_color_at(float value) con | ||||||
| void GCodeViewer::SequentialView::Marker::init() | void GCodeViewer::SequentialView::Marker::init() | ||||||
| { | { | ||||||
|     m_model.init_from(stilized_arrow(16, 2.0f, 4.0f, 1.0f, 8.0f)); |     m_model.init_from(stilized_arrow(16, 2.0f, 4.0f, 1.0f, 8.0f)); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     init_shader(); |     init_shader(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GCodeViewer::SequentialView::Marker::render() const | void GCodeViewer::SequentialView::Marker::render() const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     if (!m_visible) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light"); | ||||||
|  |     if (shader == nullptr) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|  |     glsafe(::glEnable(GL_BLEND)); | ||||||
|  |     glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); | ||||||
|  | 
 | ||||||
|  |     shader->start_using(); | ||||||
|  |     shader->set_uniform("uniform_color", m_color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (!m_visible || !m_shader.is_initialized()) |     if (!m_visible || !m_shader.is_initialized()) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|  | @ -164,6 +197,9 @@ void GCodeViewer::SequentialView::Marker::render() const | ||||||
|     GLint color_id = ::glGetUniformLocation(m_shader.get_shader_program_id(), "uniform_color"); |     GLint color_id = ::glGetUniformLocation(m_shader.get_shader_program_id(), "uniform_color"); | ||||||
|     if (color_id >= 0) |     if (color_id >= 0) | ||||||
|         glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)m_color.data())); |         glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)m_color.data())); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glPushMatrix()); |     glsafe(::glPushMatrix()); | ||||||
|     glsafe(::glMultMatrixf(m_world_transform.data())); |     glsafe(::glMultMatrixf(m_world_transform.data())); | ||||||
|  | @ -172,16 +208,30 @@ void GCodeViewer::SequentialView::Marker::render() const | ||||||
| 
 | 
 | ||||||
|     glsafe(::glPopMatrix()); |     glsafe(::glPopMatrix()); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.stop_using(); |     m_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glDisable(GL_BLEND)); |     glsafe(::glDisable(GL_BLEND)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| void GCodeViewer::SequentialView::Marker::init_shader() | void GCodeViewer::SequentialView::Marker::init_shader() | ||||||
| { | { | ||||||
|     if (!m_shader.init("gouraud_light.vs", "gouraud_light.fs")) |     if (!m_shader.init("gouraud_light.vs", "gouraud_light.fs")) | ||||||
|         BOOST_LOG_TRIVIAL(error) << "Unable to initialize gouraud_light shader: please, check that the files gouraud_light.vs and gouraud_light.fs are available"; |         BOOST_LOG_TRIVIAL(error) << "Unable to initialize gouraud_light shader: please, check that the files gouraud_light.vs and gouraud_light.fs are available"; | ||||||
| } | } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| const std::vector<GCodeViewer::Color> GCodeViewer::Extrusion_Role_Colors {{ | const std::vector<GCodeViewer::Color> GCodeViewer::Extrusion_Role_Colors {{ | ||||||
|     { 0.50f, 0.50f, 0.50f },   // erNone
 |     { 0.50f, 0.50f, 0.50f },   // erNone
 | ||||||
|  | @ -390,6 +440,31 @@ void GCodeViewer::set_layers_z_range(const std::array<double, 2>& layers_z_range | ||||||
|     wxGetApp().plater()->update_preview_moves_slider(); |     wxGetApp().plater()->update_preview_moves_slider(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | void GCodeViewer::init_shaders() | ||||||
|  | { | ||||||
|  |     unsigned char begin_id = buffer_id(GCodeProcessor::EMoveType::Retract); | ||||||
|  |     unsigned char end_id = buffer_id(GCodeProcessor::EMoveType::Count); | ||||||
|  | 
 | ||||||
|  |     for (unsigned char i = begin_id; i < end_id; ++i) | ||||||
|  |     { | ||||||
|  |         switch (buffer_type(i)) | ||||||
|  |         { | ||||||
|  |         case GCodeProcessor::EMoveType::Tool_change:  { m_buffers[i].shader = "toolchanges"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Color_change: { m_buffers[i].shader = "colorchanges"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Pause_Print:  { m_buffers[i].shader = "pauses"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Custom_GCode: { m_buffers[i].shader = "customs"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Retract:      { m_buffers[i].shader = "retractions"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Unretract:    { m_buffers[i].shader = "unretractions"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Extrude:      { m_buffers[i].shader = "extrusions"; break; } | ||||||
|  |         case GCodeProcessor::EMoveType::Travel:       { m_buffers[i].shader = "travels"; break; } | ||||||
|  |         default: { break; } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| bool GCodeViewer::init_shaders() | bool GCodeViewer::init_shaders() | ||||||
| { | { | ||||||
|     unsigned char begin_id = buffer_id(GCodeProcessor::EMoveType::Retract); |     unsigned char begin_id = buffer_id(GCodeProcessor::EMoveType::Retract); | ||||||
|  | @ -424,6 +499,9 @@ bool GCodeViewer::init_shaders() | ||||||
| 
 | 
 | ||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result) | void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result) | ||||||
| { | { | ||||||
|  | @ -750,6 +828,9 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool | ||||||
| 
 | 
 | ||||||
| void GCodeViewer::render_toolpaths() const | void GCodeViewer::render_toolpaths() const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     auto set_color = [](GLint current_program_id, const Color& color) { |     auto set_color = [](GLint current_program_id, const Color& color) { | ||||||
|         if (current_program_id > 0) { |         if (current_program_id > 0) { | ||||||
|             GLint color_id = ::glGetUniformLocation(current_program_id, "uniform_color"); |             GLint color_id = ::glGetUniformLocation(current_program_id, "uniform_color"); | ||||||
|  | @ -760,6 +841,9 @@ void GCodeViewer::render_toolpaths() const | ||||||
|         } |         } | ||||||
|         BOOST_LOG_TRIVIAL(error) << "Unable to find uniform_color uniform"; |         BOOST_LOG_TRIVIAL(error) << "Unable to find uniform_color uniform"; | ||||||
|     }; |     }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glCullFace(GL_BACK)); |     glsafe(::glCullFace(GL_BACK)); | ||||||
|     glsafe(::glLineWidth(3.0f)); |     glsafe(::glLineWidth(3.0f)); | ||||||
|  | @ -779,11 +863,29 @@ void GCodeViewer::render_toolpaths() const | ||||||
|         if (!buffer.visible) |         if (!buffer.visible) | ||||||
|             continue; |             continue; | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         GLShaderProgram* shader = wxGetApp().get_shader(buffer.shader.c_str()); | ||||||
|  |         if (shader != nullptr) { | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (buffer.shader.is_initialized()) { |         if (buffer.shader.is_initialized()) { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
|             GCodeProcessor::EMoveType type = buffer_type(i); |             GCodeProcessor::EMoveType type = buffer_type(i); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |             shader->start_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             buffer.shader.start_using(); |             buffer.shader.start_using(); | ||||||
|   | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
|             glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer.ibo_id)); |             glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer.ibo_id)); | ||||||
| 
 | 
 | ||||||
|             switch (type) |             switch (type) | ||||||
|  | @ -791,7 +893,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             case GCodeProcessor::EMoveType::Tool_change: |             case GCodeProcessor::EMoveType::Tool_change: | ||||||
|             { |             { | ||||||
|                 Color color = { 1.0f, 1.0f, 1.0f }; |                 Color color = { 1.0f, 1.0f, 1.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                 shader->set_uniform("uniform_color", color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); |                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); |                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); | ||||||
|  | @ -807,7 +917,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             case GCodeProcessor::EMoveType::Color_change: |             case GCodeProcessor::EMoveType::Color_change: | ||||||
|             { |             { | ||||||
|                 Color color = { 1.0f, 0.0f, 0.0f }; |                 Color color = { 1.0f, 0.0f, 0.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                 shader->set_uniform("uniform_color", color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); |                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); |                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); | ||||||
|  | @ -823,7 +941,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             case GCodeProcessor::EMoveType::Pause_Print: |             case GCodeProcessor::EMoveType::Pause_Print: | ||||||
|             { |             { | ||||||
|                 Color color = { 0.0f, 1.0f, 0.0f }; |                 Color color = { 0.0f, 1.0f, 0.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                 shader->set_uniform("uniform_color", color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); |                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); |                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); | ||||||
|  | @ -839,7 +965,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             case GCodeProcessor::EMoveType::Custom_GCode: |             case GCodeProcessor::EMoveType::Custom_GCode: | ||||||
|             { |             { | ||||||
|                 Color color = { 0.0f, 0.0f, 1.0f }; |                 Color color = { 0.0f, 0.0f, 1.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                 shader->set_uniform("uniform_color", color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); |                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); |                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); | ||||||
|  | @ -855,7 +989,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             case GCodeProcessor::EMoveType::Retract: |             case GCodeProcessor::EMoveType::Retract: | ||||||
|             { |             { | ||||||
|                 Color color = { 1.0f, 0.0f, 1.0f }; |                 Color color = { 1.0f, 0.0f, 1.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                 shader->set_uniform("uniform_color", color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); |                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); |                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); | ||||||
|  | @ -871,7 +1013,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             case GCodeProcessor::EMoveType::Unretract: |             case GCodeProcessor::EMoveType::Unretract: | ||||||
|             { |             { | ||||||
|                 Color color = { 0.0f, 1.0f, 1.0f }; |                 Color color = { 0.0f, 1.0f, 1.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                 shader->set_uniform("uniform_color", color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); |                 set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); |                     glsafe(::glEnable(GL_PROGRAM_POINT_SIZE)); | ||||||
|  | @ -888,7 +1038,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             { |             { | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                     shader->set_uniform("uniform_color", path.color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                     set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), path.color); |                     set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), path.color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                     glsafe(::glMultiDrawElements(GL_LINE_STRIP, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_INT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); |                     glsafe(::glMultiDrawElements(GL_LINE_STRIP, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_INT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); | ||||||
| #if ENABLE_GCODE_VIEWER_STATISTICS | #if ENABLE_GCODE_VIEWER_STATISTICS | ||||||
|                     ++m_statistics.gl_multi_line_strip_calls_count; |                     ++m_statistics.gl_multi_line_strip_calls_count; | ||||||
|  | @ -901,7 +1059,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             { |             { | ||||||
|                 for (const RenderPath& path : buffer.render_paths) |                 for (const RenderPath& path : buffer.render_paths) | ||||||
|                 { |                 { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |                     shader->set_uniform("uniform_color", path.color); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                     set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), path.color); |                     set_color(static_cast<GLint>(buffer.shader.get_shader_program_id()), path.color); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|                     glsafe(::glMultiDrawElements(GL_LINE_STRIP, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_INT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); |                     glsafe(::glMultiDrawElements(GL_LINE_STRIP, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_INT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); | ||||||
| #if ENABLE_GCODE_VIEWER_STATISTICS | #if ENABLE_GCODE_VIEWER_STATISTICS | ||||||
|                     ++m_statistics.gl_multi_line_strip_calls_count; |                     ++m_statistics.gl_multi_line_strip_calls_count; | ||||||
|  | @ -913,7 +1079,15 @@ void GCodeViewer::render_toolpaths() const | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); |             glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |             shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             buffer.shader.stop_using(); |             buffer.shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -923,6 +1097,24 @@ void GCodeViewer::render_toolpaths() const | ||||||
| 
 | 
 | ||||||
| void GCodeViewer::render_shells() const | void GCodeViewer::render_shells() const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     if (!m_shells.visible || m_shells.volumes.empty()) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("shells"); | ||||||
|  |     if (shader == nullptr) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|  | //    glsafe(::glDepthMask(GL_FALSE));
 | ||||||
|  | 
 | ||||||
|  |     shader->start_using(); | ||||||
|  |     m_shells.volumes.render(GLVolumeCollection::Transparent, true, wxGetApp().plater()->get_camera().get_view_matrix()); | ||||||
|  |     shader->stop_using(); | ||||||
|  | 
 | ||||||
|  | //    glsafe(::glDepthMask(GL_TRUE));
 | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (!m_shells.visible || m_shells.volumes.empty() || !m_shells.shader.is_initialized()) |     if (!m_shells.visible || m_shells.volumes.empty() || !m_shells.shader.is_initialized()) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|  | @ -933,6 +1125,9 @@ void GCodeViewer::render_shells() const | ||||||
|     m_shells.shader.stop_using(); |     m_shells.shader.stop_using(); | ||||||
| 
 | 
 | ||||||
| //    glsafe(::glDepthMask(GL_TRUE));
 | //    glsafe(::glDepthMask(GL_TRUE));
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GCodeViewer::render_legend() const | void GCodeViewer::render_legend() const | ||||||
|  |  | ||||||
|  | @ -2,7 +2,13 @@ | ||||||
| #define slic3r_GCodeViewer_hpp_ | #define slic3r_GCodeViewer_hpp_ | ||||||
| 
 | 
 | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "GLShader.hpp" | #include "GLShader.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
| #include "libslic3r/GCode/GCodeProcessor.hpp" | #include "libslic3r/GCode/GCodeProcessor.hpp" | ||||||
| #include "GLModel.hpp" | #include "GLModel.hpp" | ||||||
|  | @ -78,13 +84,27 @@ class GCodeViewer | ||||||
|     { |     { | ||||||
|         unsigned int ibo_id{ 0 }; |         unsigned int ibo_id{ 0 }; | ||||||
|         size_t indices_count{ 0 }; |         size_t indices_count{ 0 }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         std::string shader; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         Shader shader; |         Shader shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         std::vector<Path> paths; |         std::vector<Path> paths; | ||||||
|         std::vector<RenderPath> render_paths; |         std::vector<RenderPath> render_paths; | ||||||
|         bool visible{ false }; |         bool visible{ false }; | ||||||
| 
 | 
 | ||||||
|         void reset(); |         void reset(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         bool init_shader(const std::string& vertex_shader_src, const std::string& fragment_shader_src); |         bool init_shader(const std::string& vertex_shader_src, const std::string& fragment_shader_src); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         void add_path(const GCodeProcessor::MoveVertex& move, unsigned int i_id, unsigned int s_id); |         void add_path(const GCodeProcessor::MoveVertex& move, unsigned int i_id, unsigned int s_id); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  | @ -93,7 +113,13 @@ class GCodeViewer | ||||||
|     { |     { | ||||||
|         GLVolumeCollection volumes; |         GLVolumeCollection volumes; | ||||||
|         bool visible{ false }; |         bool visible{ false }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         Shader shader; |         Shader shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     // helper to render extrusion paths
 |     // helper to render extrusion paths
 | ||||||
|  | @ -203,7 +229,13 @@ public: | ||||||
|             Transform3f m_world_transform; |             Transform3f m_world_transform; | ||||||
|             std::array<float, 4> m_color{ 1.0f, 1.0f, 1.0f, 1.0f }; |             std::array<float, 4> m_color{ 1.0f, 1.0f, 1.0f, 1.0f }; | ||||||
|             bool m_visible{ false }; |             bool m_visible{ false }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             Shader m_shader; |             Shader m_shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         public: |         public: | ||||||
|             void init(); |             void init(); | ||||||
|  | @ -218,8 +250,14 @@ public: | ||||||
| 
 | 
 | ||||||
|             void render() const; |             void render() const; | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         private: |         private: | ||||||
|             void init_shader(); |             void init_shader(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         struct Endpoints |         struct Endpoints | ||||||
|  | @ -273,7 +311,16 @@ public: | ||||||
|     bool init() { |     bool init() { | ||||||
|         set_toolpath_move_type_visible(GCodeProcessor::EMoveType::Extrude, true); |         set_toolpath_move_type_visible(GCodeProcessor::EMoveType::Extrude, true); | ||||||
|         m_sequential_view.marker.init(); |         m_sequential_view.marker.init(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         init_shaders(); | ||||||
|  |         return true; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         return init_shaders(); |         return init_shaders(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // extract rendering data from the given parameters
 |     // extract rendering data from the given parameters
 | ||||||
|  | @ -317,7 +364,15 @@ public: | ||||||
|     void enable_legend(bool enable) { m_legend_enabled = enable; } |     void enable_legend(bool enable) { m_legend_enabled = enable; } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     void init_shaders(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     bool init_shaders(); |     bool init_shaders(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     void load_toolpaths(const GCodeProcessor::Result& gcode_result); |     void load_toolpaths(const GCodeProcessor::Result& gcode_result); | ||||||
|     void load_shells(const Print& print, bool initialized); |     void load_shells(const Print& print, bool initialized); | ||||||
|     void refresh_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last) const; |     void refresh_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last) const; | ||||||
|  |  | ||||||
|  | @ -156,10 +156,19 @@ GLCanvas3D::LayersEditing::~LayersEditing() | ||||||
| 
 | 
 | ||||||
| const float GLCanvas3D::LayersEditing::THICKNESS_BAR_WIDTH = 70.0f; | const float GLCanvas3D::LayersEditing::THICKNESS_BAR_WIDTH = 70.0f; | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | void GLCanvas3D::LayersEditing::init() | ||||||
|  | { | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| bool GLCanvas3D::LayersEditing::init(const std::string& vertex_shader_filename, const std::string& fragment_shader_filename) | bool GLCanvas3D::LayersEditing::init(const std::string& vertex_shader_filename, const std::string& fragment_shader_filename) | ||||||
| { | { | ||||||
|     if (!m_shader.init(vertex_shader_filename, fragment_shader_filename)) |     if (!m_shader.init(vertex_shader_filename, fragment_shader_filename)) | ||||||
|         return false; |         return false; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glGenTextures(1, (GLuint*)&m_z_texture_id)); |     glsafe(::glGenTextures(1, (GLuint*)&m_z_texture_id)); | ||||||
|     glsafe(::glBindTexture(GL_TEXTURE_2D, m_z_texture_id)); |     glsafe(::glBindTexture(GL_TEXTURE_2D, m_z_texture_id)); | ||||||
|  | @ -170,7 +179,13 @@ bool GLCanvas3D::LayersEditing::init(const std::string& vertex_shader_filename, | ||||||
|     glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1)); |     glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1)); | ||||||
|     glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); |     glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     return true; |     return true; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GLCanvas3D::LayersEditing::set_config(const DynamicPrintConfig* config) | void GLCanvas3D::LayersEditing::set_config(const DynamicPrintConfig* config) | ||||||
|  | @ -203,7 +218,15 @@ void GLCanvas3D::LayersEditing::select_object(const Model &model, int object_id) | ||||||
| 
 | 
 | ||||||
| bool GLCanvas3D::LayersEditing::is_allowed() const | bool GLCanvas3D::LayersEditing::is_allowed() const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     return wxGetApp().get_shader("variable_layer_height") != nullptr && m_z_texture_id > 0; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     return m_shader.is_initialized() && m_shader.get_shader()->shader_program_id > 0 && m_z_texture_id > 0; |     return m_shader.is_initialized() && m_shader.get_shader()->shader_program_id > 0 && m_z_texture_id > 0; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool GLCanvas3D::LayersEditing::is_enabled() const | bool GLCanvas3D::LayersEditing::is_enabled() const | ||||||
|  | @ -361,7 +384,15 @@ Rect GLCanvas3D::LayersEditing::get_bar_rect_viewport(const GLCanvas3D& canvas) | ||||||
| 
 | 
 | ||||||
| bool GLCanvas3D::LayersEditing::is_initialized() const | bool GLCanvas3D::LayersEditing::is_initialized() const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     return wxGetApp().get_shader("variable_layer_height") != nullptr; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     return m_shader.is_initialized(); |     return m_shader.is_initialized(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string GLCanvas3D::LayersEditing::get_tooltip(const GLCanvas3D& canvas) const | std::string GLCanvas3D::LayersEditing::get_tooltip(const GLCanvas3D& canvas) const | ||||||
|  | @ -395,6 +426,21 @@ std::string GLCanvas3D::LayersEditing::get_tooltip(const GLCanvas3D& canvas) con | ||||||
| 
 | 
 | ||||||
| void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3D& canvas, const Rect& bar_rect) const | void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3D& canvas, const Rect& bar_rect) const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("variable_layer_height"); | ||||||
|  |     if (shader == nullptr) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|  |     shader->start_using(); | ||||||
|  | 
 | ||||||
|  |     shader->set_uniform("z_to_texture_row", float(m_layers_texture.cells - 1) / (float(m_layers_texture.width) * m_object_max_z)); | ||||||
|  |     shader->set_uniform("z_texture_row_to_normalized", 1.0f / (float)m_layers_texture.height); | ||||||
|  |     shader->set_uniform("z_cursor", m_object_max_z * this->get_cursor_z_relative(canvas)); | ||||||
|  |     shader->set_uniform("z_cursor_band_width", band_width); | ||||||
|  |     shader->set_uniform("object_max_z", m_object_max_z); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.start_using(); |     m_shader.start_using(); | ||||||
| 
 | 
 | ||||||
|     m_shader.set_uniform("z_to_texture_row", float(m_layers_texture.cells - 1) / (float(m_layers_texture.width) * m_object_max_z)); |     m_shader.set_uniform("z_to_texture_row", float(m_layers_texture.cells - 1) / (float(m_layers_texture.width) * m_object_max_z)); | ||||||
|  | @ -402,6 +448,9 @@ void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3 | ||||||
|     m_shader.set_uniform("z_cursor", m_object_max_z * this->get_cursor_z_relative(canvas)); |     m_shader.set_uniform("z_cursor", m_object_max_z * this->get_cursor_z_relative(canvas)); | ||||||
|     m_shader.set_uniform("z_cursor_band_width", band_width); |     m_shader.set_uniform("z_cursor_band_width", band_width); | ||||||
|     m_shader.set_uniform("object_max_z", m_object_max_z); |     m_shader.set_uniform("object_max_z", m_object_max_z); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glPixelStorei(GL_UNPACK_ALIGNMENT, 1)); |     glsafe(::glPixelStorei(GL_UNPACK_ALIGNMENT, 1)); | ||||||
|     glsafe(::glBindTexture(GL_TEXTURE_2D, m_z_texture_id)); |     glsafe(::glBindTexture(GL_TEXTURE_2D, m_z_texture_id)); | ||||||
|  | @ -421,7 +470,15 @@ void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3 | ||||||
|     glsafe(::glEnd()); |     glsafe(::glEnd()); | ||||||
|     glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); |     glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.stop_using(); |     m_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GLCanvas3D::LayersEditing::render_profile(const Rect& bar_rect) const | void GLCanvas3D::LayersEditing::render_profile(const Rect& bar_rect) const | ||||||
|  | @ -455,6 +512,29 @@ void GLCanvas3D::LayersEditing::render_volumes(const GLCanvas3D& canvas, const G | ||||||
| { | { | ||||||
|     assert(this->is_allowed()); |     assert(this->is_allowed()); | ||||||
|     assert(this->last_object_id != -1); |     assert(this->last_object_id != -1); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("variable_layer_height"); | ||||||
|  |     assert(shader != nullptr); | ||||||
|  | 
 | ||||||
|  |     GLint current_program_id = 0; | ||||||
|  |     glsafe(::glGetIntegerv(GL_CURRENT_PROGRAM, ¤t_program_id)); | ||||||
|  |     if (shader->get_id() != static_cast<GLuint>(current_program_id)) | ||||||
|  |         // The layer editing shader is not yet active. Activate it.
 | ||||||
|  |         shader->start_using(); | ||||||
|  |     else | ||||||
|  |         // The layer editing shader was already active.
 | ||||||
|  |         current_program_id = 0; | ||||||
|  | 
 | ||||||
|  |     const_cast<LayersEditing*>(this)->generate_layer_height_texture(); | ||||||
|  | 
 | ||||||
|  |     // Uniforms were resolved, go ahead using the layer editing shader.
 | ||||||
|  |     shader->set_uniform("z_to_texture_row", float(m_layers_texture.cells - 1) / (float(m_layers_texture.width) * float(m_object_max_z))); | ||||||
|  |     shader->set_uniform("z_texture_row_to_normalized", 1.0f / float(m_layers_texture.height)); | ||||||
|  |     shader->set_uniform("z_cursor", float(m_object_max_z) * float(this->get_cursor_z_relative(canvas))); | ||||||
|  |     shader->set_uniform("z_cursor_band_width", float(this->band_width)); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     GLint shader_id = m_shader.get_shader()->shader_program_id; |     GLint shader_id = m_shader.get_shader()->shader_program_id; | ||||||
|     assert(shader_id > 0); |     assert(shader_id > 0); | ||||||
| 
 | 
 | ||||||
|  | @ -467,15 +547,16 @@ void GLCanvas3D::LayersEditing::render_volumes(const GLCanvas3D& canvas, const G | ||||||
|         // The layer editing shader was already active.
 |         // The layer editing shader was already active.
 | ||||||
|         current_program_id = -1; |         current_program_id = -1; | ||||||
| 
 | 
 | ||||||
|     GLint z_to_texture_row_id               = ::glGetUniformLocation(shader_id, "z_to_texture_row"); |     GLint z_to_texture_row_id = ::glGetUniformLocation(shader_id, "z_to_texture_row"); | ||||||
|     GLint z_texture_row_to_normalized_id    = ::glGetUniformLocation(shader_id, "z_texture_row_to_normalized"); |     GLint z_texture_row_to_normalized_id = ::glGetUniformLocation(shader_id, "z_texture_row_to_normalized"); | ||||||
|     GLint z_cursor_id                       = ::glGetUniformLocation(shader_id, "z_cursor"); |     GLint z_cursor_id = ::glGetUniformLocation(shader_id, "z_cursor"); | ||||||
|     GLint z_cursor_band_width_id            = ::glGetUniformLocation(shader_id, "z_cursor_band_width"); |     GLint z_cursor_band_width_id = ::glGetUniformLocation(shader_id, "z_cursor_band_width"); | ||||||
|     GLint world_matrix_id                   = ::glGetUniformLocation(shader_id, "volume_world_matrix"); |     GLint world_matrix_id = ::glGetUniformLocation(shader_id, "volume_world_matrix"); | ||||||
|     GLint object_max_z_id                   = ::glGetUniformLocation(shader_id, "object_max_z"); |     GLint object_max_z_id = ::glGetUniformLocation(shader_id, "object_max_z"); | ||||||
|     glcheck(); |     glcheck(); | ||||||
| 
 | 
 | ||||||
|     if (z_to_texture_row_id != -1 && z_texture_row_to_normalized_id != -1 && z_cursor_id != -1 && z_cursor_band_width_id != -1 && world_matrix_id != -1)  | 
 | ||||||
|  |     if (z_to_texture_row_id != -1 && z_texture_row_to_normalized_id != -1 && z_cursor_id != -1 && z_cursor_band_width_id != -1 && world_matrix_id != -1) | ||||||
|     { |     { | ||||||
|         const_cast<LayersEditing*>(this)->generate_layer_height_texture(); |         const_cast<LayersEditing*>(this)->generate_layer_height_texture(); | ||||||
| 
 | 
 | ||||||
|  | @ -484,6 +565,9 @@ void GLCanvas3D::LayersEditing::render_volumes(const GLCanvas3D& canvas, const G | ||||||
|         glsafe(::glUniform1f(z_texture_row_to_normalized_id, GLfloat(1.0f / m_layers_texture.height))); |         glsafe(::glUniform1f(z_texture_row_to_normalized_id, GLfloat(1.0f / m_layers_texture.height))); | ||||||
|         glsafe(::glUniform1f(z_cursor_id, GLfloat(m_object_max_z) * GLfloat(this->get_cursor_z_relative(canvas)))); |         glsafe(::glUniform1f(z_cursor_id, GLfloat(m_object_max_z) * GLfloat(this->get_cursor_z_relative(canvas)))); | ||||||
|         glsafe(::glUniform1f(z_cursor_band_width_id, GLfloat(this->band_width))); |         glsafe(::glUniform1f(z_cursor_band_width_id, GLfloat(this->band_width))); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         // Initialize the layer height texture mapping.
 |         // Initialize the layer height texture mapping.
 | ||||||
|         GLsizei w = (GLsizei)m_layers_texture.width; |         GLsizei w = (GLsizei)m_layers_texture.width; | ||||||
|         GLsizei h = (GLsizei)m_layers_texture.height; |         GLsizei h = (GLsizei)m_layers_texture.height; | ||||||
|  | @ -499,17 +583,29 @@ void GLCanvas3D::LayersEditing::render_volumes(const GLCanvas3D& canvas, const G | ||||||
|             // Render the object using the layer editing shader and texture.
 |             // Render the object using the layer editing shader and texture.
 | ||||||
|             if (! glvolume->is_active || glvolume->composite_id.object_id != this->last_object_id || glvolume->is_modifier) |             if (! glvolume->is_active || glvolume->composite_id.object_id != this->last_object_id || glvolume->is_modifier) | ||||||
|                 continue; |                 continue; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |             shader->set_uniform("volume_world_matrix", glvolume->world_matrix()); | ||||||
|  |             shader->set_uniform("object_max_z", GLfloat(0)); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             if (world_matrix_id != -1) |             if (world_matrix_id != -1) | ||||||
|                 glsafe(::glUniformMatrix4fv(world_matrix_id, 1, GL_FALSE, (const GLfloat*)glvolume->world_matrix().cast<float>().data())); |                 glsafe(::glUniformMatrix4fv(world_matrix_id, 1, GL_FALSE, (const GLfloat*)glvolume->world_matrix().cast<float>().data())); | ||||||
|             if (object_max_z_id != -1) |             if (object_max_z_id != -1) | ||||||
|                 glsafe(::glUniform1f(object_max_z_id, GLfloat(0))); |                 glsafe(::glUniform1f(object_max_z_id, GLfloat(0))); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|             glvolume->render(); |             glvolume->render(); | ||||||
|         } |         } | ||||||
|         // Revert back to the previous shader.
 |         // Revert back to the previous shader.
 | ||||||
|         glBindTexture(GL_TEXTURE_2D, 0); |         glBindTexture(GL_TEXTURE_2D, 0); | ||||||
|         if (current_program_id > 0) |         if (current_program_id > 0) | ||||||
|             glsafe(::glUseProgram(current_program_id)); |             glsafe(::glUseProgram(current_program_id)); | ||||||
|     }  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |     } | ||||||
|     else  |     else  | ||||||
|     { |     { | ||||||
|         // Something went wrong. Just render the object.
 |         // Something went wrong. Just render the object.
 | ||||||
|  | @ -522,6 +618,9 @@ void GLCanvas3D::LayersEditing::render_volumes(const GLCanvas3D& canvas, const G | ||||||
| 			glvolume->render(); | 			glvolume->render(); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GLCanvas3D::LayersEditing::adjust_layer_height_profile() | void GLCanvas3D::LayersEditing::adjust_layer_height_profile() | ||||||
|  | @ -1645,6 +1744,12 @@ bool GLCanvas3D::init() | ||||||
|     if (m_multisample_allowed) |     if (m_multisample_allowed) | ||||||
|         glsafe(::glEnable(GL_MULTISAMPLE)); |         glsafe(::glEnable(GL_MULTISAMPLE)); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     if (m_main_toolbar.is_enabled()) | ||||||
|  |         m_layers_editing.init(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (!m_shader.init("gouraud.vs", "gouraud.fs")) |     if (!m_shader.init("gouraud.vs", "gouraud.fs")) | ||||||
|     { |     { | ||||||
|         std::cout << "Unable to initialize gouraud shader: please, check that the files gouraud.vs and gouraud.fs are available" << std::endl; |         std::cout << "Unable to initialize gouraud shader: please, check that the files gouraud.vs and gouraud.fs are available" << std::endl; | ||||||
|  | @ -1656,6 +1761,9 @@ bool GLCanvas3D::init() | ||||||
|         std::cout << "Unable to initialize variable_layer_height shader: please, check that the files variable_layer_height.vs and variable_layer_height.fs are available" << std::endl; |         std::cout << "Unable to initialize variable_layer_height shader: please, check that the files variable_layer_height.vs and variable_layer_height.fs are available" << std::endl; | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|     if (!m_main_toolbar.is_enabled()) |     if (!m_main_toolbar.is_enabled()) | ||||||
|  | @ -4515,8 +4623,17 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool | ||||||
|         return ret; |         return ret; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     static const std::array<float, 4> orange = { 0.923f, 0.504f, 0.264f, 1.0f }; | ||||||
|  |     static const std::array<float, 4> gray   = { 0.64f, 0.64f, 0.64f, 1.0f }; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     static const GLfloat orange[] = { 0.923f, 0.504f, 0.264f, 1.0f }; |     static const GLfloat orange[] = { 0.923f, 0.504f, 0.264f, 1.0f }; | ||||||
|     static const GLfloat gray[] = { 0.64f, 0.64f, 0.64f, 1.0f }; |     static const GLfloat gray[] = { 0.64f, 0.64f, 0.64f, 1.0f }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     GLVolumePtrs visible_volumes; |     GLVolumePtrs visible_volumes; | ||||||
| 
 | 
 | ||||||
|  | @ -4560,6 +4677,22 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool | ||||||
| 
 | 
 | ||||||
|     camera.apply_projection(box, near_z, far_z); |     camera.apply_projection(box, near_z, far_z); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("gouraud"); | ||||||
|  |     if (shader == nullptr) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|  |     if (transparent_background) | ||||||
|  |         glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f)); | ||||||
|  | 
 | ||||||
|  |     glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); | ||||||
|  |     glsafe(::glEnable(GL_DEPTH_TEST)); | ||||||
|  | 
 | ||||||
|  |     shader->start_using(); | ||||||
|  |     shader->set_uniform("print_box.volume_detection", 0); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (transparent_background) |     if (transparent_background) | ||||||
|         glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f)); |         glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f)); | ||||||
| 
 | 
 | ||||||
|  | @ -4575,24 +4708,44 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool | ||||||
| 
 | 
 | ||||||
|     if (print_box_detection_id != -1) |     if (print_box_detection_id != -1) | ||||||
|         glsafe(::glUniform1i(print_box_detection_id, 0)); |         glsafe(::glUniform1i(print_box_detection_id, 0)); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     for (const GLVolume* vol : visible_volumes) |     for (const GLVolume* vol : visible_volumes) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader->set_uniform("uniform_color", (vol->printable && !vol->is_outside) ? orange : gray); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (vol->printable && !vol->is_outside) ? orange : gray)); |             glsafe(::glUniform4fv(color_id, 1, (vol->printable && !vol->is_outside) ? orange : gray)); | ||||||
|         else |         else | ||||||
|             glsafe(::glColor4fv((vol->printable && !vol->is_outside) ? orange : gray)); |             glsafe(::glColor4fv((vol->printable && !vol->is_outside) ? orange : gray)); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         vol->render(); |         vol->render(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.stop_using(); |     m_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glDisable(GL_DEPTH_TEST)); |     glsafe(::glDisable(GL_DEPTH_TEST)); | ||||||
| 
 | 
 | ||||||
|     if (show_bed) |     if (show_bed) | ||||||
|         _render_bed(!camera.is_looking_downward(), false); |         _render_bed(!camera.is_looking_downward(), false); | ||||||
| 
 | 
 | ||||||
|  |     // restore background color
 | ||||||
|     if (transparent_background) |     if (transparent_background) | ||||||
|         glsafe(::glClearColor(1.0f, 1.0f, 1.0f, 1.0f)); |         glsafe(::glClearColor(1.0f, 1.0f, 1.0f, 1.0f)); | ||||||
| } | } | ||||||
|  | @ -5531,7 +5684,18 @@ void GLCanvas3D::_render_objects() const | ||||||
| 
 | 
 | ||||||
|     m_volumes.set_clipping_plane(m_camera_clipping_plane.get_data()); |     m_volumes.set_clipping_plane(m_camera_clipping_plane.get_data()); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShaderProgram* shader = wxGetApp().get_shader("gouraud"); | ||||||
|  |     if (shader != nullptr) | ||||||
|  |     { | ||||||
|  |         shader->start_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.start_using(); |     m_shader.start_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (m_picking_enabled && !m_gizmos.is_dragging() && m_layers_editing.is_enabled() && (m_layers_editing.last_object_id != -1) && (m_layers_editing.object_max_z() > 0.0f)) { |     if (m_picking_enabled && !m_gizmos.is_dragging() && m_layers_editing.is_enabled() && (m_layers_editing.last_object_id != -1) && (m_layers_editing.object_max_z() > 0.0f)) { | ||||||
|         int object_id = m_layers_editing.last_object_id; |         int object_id = m_layers_editing.last_object_id; | ||||||
|         m_volumes.render(GLVolumeCollection::Opaque, false, wxGetApp().plater()->get_camera().get_view_matrix(), [object_id](const GLVolume& volume) { |         m_volumes.render(GLVolumeCollection::Opaque, false, wxGetApp().plater()->get_camera().get_view_matrix(), [object_id](const GLVolume& volume) { | ||||||
|  | @ -5540,7 +5704,8 @@ void GLCanvas3D::_render_objects() const | ||||||
|             }); |             }); | ||||||
|         // Let LayersEditing handle rendering of the active object using the layer height profile shader.
 |         // Let LayersEditing handle rendering of the active object using the layer height profile shader.
 | ||||||
|         m_layers_editing.render_volumes(*this, this->m_volumes); |         m_layers_editing.render_volumes(*this, this->m_volumes); | ||||||
|     } else { |     } | ||||||
|  |     else { | ||||||
|         // do not cull backfaces to show broken geometry, if any
 |         // do not cull backfaces to show broken geometry, if any
 | ||||||
|         m_volumes.render(GLVolumeCollection::Opaque, m_picking_enabled, wxGetApp().plater()->get_camera().get_view_matrix(), [this](const GLVolume& volume) { |         m_volumes.render(GLVolumeCollection::Opaque, m_picking_enabled, wxGetApp().plater()->get_camera().get_view_matrix(), [this](const GLVolume& volume) { | ||||||
|             return (m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0); |             return (m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0); | ||||||
|  | @ -5548,7 +5713,16 @@ void GLCanvas3D::_render_objects() const | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     m_volumes.render(GLVolumeCollection::Transparent, false, wxGetApp().plater()->get_camera().get_view_matrix()); |     m_volumes.render(GLVolumeCollection::Transparent, false, wxGetApp().plater()->get_camera().get_view_matrix()); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     shader->stop_using(); | ||||||
|  |     } | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     m_shader.stop_using(); |     m_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     m_camera_clipping_plane = ClippingPlane::ClipsNothing(); |     m_camera_clipping_plane = ClippingPlane::ClipsNothing(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -7,7 +7,13 @@ | ||||||
| 
 | 
 | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
| #include "GLToolbar.hpp" | #include "GLToolbar.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "GLShader.hpp" | #include "GLShader.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "Event.hpp" | #include "Event.hpp" | ||||||
| #include "Selection.hpp" | #include "Selection.hpp" | ||||||
| #include "Gizmos/GLGizmosManager.hpp" | #include "Gizmos/GLGizmosManager.hpp" | ||||||
|  | @ -167,7 +173,13 @@ private: | ||||||
|     private: |     private: | ||||||
| 
 | 
 | ||||||
|         bool                        m_enabled; |         bool                        m_enabled; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         Shader                      m_shader; |         Shader                      m_shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         unsigned int                m_z_texture_id; |         unsigned int                m_z_texture_id; | ||||||
|         // Not owned by LayersEditing.
 |         // Not owned by LayersEditing.
 | ||||||
|         const DynamicPrintConfig   *m_config; |         const DynamicPrintConfig   *m_config; | ||||||
|  | @ -214,8 +226,16 @@ private: | ||||||
|         LayersEditing(); |         LayersEditing(); | ||||||
|         ~LayersEditing(); |         ~LayersEditing(); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         void init(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         bool init(const std::string& vertex_shader_filename, const std::string& fragment_shader_filename); |         bool init(const std::string& vertex_shader_filename, const std::string& fragment_shader_filename); | ||||||
| 		void set_config(const DynamicPrintConfig* config); | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         void set_config(const DynamicPrintConfig* config); | ||||||
|         void select_object(const Model &model, int object_id); |         void select_object(const Model &model, int object_id); | ||||||
| 
 | 
 | ||||||
|         bool is_allowed() const; |         bool is_allowed() const; | ||||||
|  | @ -457,7 +477,13 @@ private: | ||||||
|     WarningTexture m_warning_texture; |     WarningTexture m_warning_texture; | ||||||
|     wxTimer m_timer; |     wxTimer m_timer; | ||||||
|     LayersEditing m_layers_editing; |     LayersEditing m_layers_editing; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     Shader m_shader; |     Shader m_shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     Mouse m_mouse; |     Mouse m_mouse; | ||||||
|     mutable GLGizmosManager m_gizmos; |     mutable GLGizmosManager m_gizmos; | ||||||
|     mutable GLToolbar m_main_toolbar; |     mutable GLToolbar m_main_toolbar; | ||||||
|  | @ -587,7 +613,13 @@ public: | ||||||
|     void set_color_by(const std::string& value); |     void set_color_by(const std::string& value); | ||||||
| 
 | 
 | ||||||
|     void refresh_camera_scene_box(); |     void refresh_camera_scene_box(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     const Shader& get_shader() const { return m_shader; } |     const Shader& get_shader() const { return m_shader; } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     BoundingBoxf3 volumes_bounding_box() const; |     BoundingBoxf3 volumes_bounding_box() const; | ||||||
|     BoundingBoxf3 scene_bounding_box() const; |     BoundingBoxf3 scene_bounding_box() const; | ||||||
|  |  | ||||||
|  | @ -1,11 +1,289 @@ | ||||||
| #include <GL/glew.h> | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | #include "libslic3r/libslic3r.h" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "GLShader.hpp" | #include "GLShader.hpp" | ||||||
| 
 | 
 | ||||||
| #include "libslic3r/Utils.hpp" |  | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
| #include <boost/nowide/fstream.hpp> | #include "libslic3r/Utils.hpp" | ||||||
| 
 | 
 | ||||||
|  | #include <boost/nowide/fstream.hpp> | ||||||
|  | #include <GL/glew.h> | ||||||
|  | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | #include <boost/log/trivial.hpp> | ||||||
|  | 
 | ||||||
|  | namespace Slic3r { | ||||||
|  | 
 | ||||||
|  | GLShaderProgram::~GLShaderProgram() | ||||||
|  | { | ||||||
|  |     if (m_id > 0) | ||||||
|  |         glsafe(::glDeleteProgram(m_id)); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::init_from_files(const std::string& name, const ShaderFilenames& filenames) | ||||||
|  | { | ||||||
|  |     auto load_from_file = [](const std::string& filename) { | ||||||
|  |         std::string path = resources_dir() + "/shaders/" + filename; | ||||||
|  |         boost::nowide::ifstream s(path, boost::nowide::ifstream::binary); | ||||||
|  |         if (!s.good()) | ||||||
|  |         { | ||||||
|  |             BOOST_LOG_TRIVIAL(error) << "Couldn't open file: '" << path << "'"; | ||||||
|  |             return std::string(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         s.seekg(0, s.end); | ||||||
|  |         int file_length = static_cast<int>(s.tellg()); | ||||||
|  |         s.seekg(0, s.beg); | ||||||
|  |         std::string source(file_length, '\0'); | ||||||
|  |         s.read(source.data(), file_length); | ||||||
|  |         if (!s.good()) | ||||||
|  |         { | ||||||
|  |             BOOST_LOG_TRIVIAL(error) << "Error while loading file: '" << path << "'"; | ||||||
|  |             return std::string(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         s.close(); | ||||||
|  |         return source; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     ShaderSources sources = {}; | ||||||
|  |     for (size_t i = 0; i < static_cast<size_t>(EShaderType::Count); ++i) { | ||||||
|  |         sources[i] = filenames[i].empty() ? std::string() : load_from_file(filenames[i]); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     bool valid = (!sources[static_cast<size_t>(EShaderType::Vertex)].empty() && !sources[static_cast<size_t>(EShaderType::Fragment)].empty()) || | ||||||
|  |         !sources[static_cast<size_t>(EShaderType::Compute)].empty(); | ||||||
|  | 
 | ||||||
|  |     return valid ? init_from_texts(name, sources) : false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::init_from_texts(const std::string& name, const ShaderSources& sources) | ||||||
|  | { | ||||||
|  |     auto shader_type_as_string = [](EShaderType type) { | ||||||
|  |         switch (type) | ||||||
|  |         { | ||||||
|  |         case EShaderType::Vertex:         { return "vertex"; } | ||||||
|  |         case EShaderType::Fragment:       { return "fragment"; } | ||||||
|  |         case EShaderType::Geometry:       { return "geometry"; } | ||||||
|  |         case EShaderType::TessEvaluation: { return "tesselation evaluation"; } | ||||||
|  |         case EShaderType::TessControl:    { return "tesselation control"; } | ||||||
|  |         case EShaderType::Compute:        { return "compute"; } | ||||||
|  |         default:                          { return "unknown"; } | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     auto create_shader = [](EShaderType type) { | ||||||
|  |         GLuint id = 0; | ||||||
|  |         switch (type) | ||||||
|  |         { | ||||||
|  |         case EShaderType::Vertex:         { id = ::glCreateShader(GL_VERTEX_SHADER); glcheck(); break; } | ||||||
|  |         case EShaderType::Fragment:       { id = ::glCreateShader(GL_FRAGMENT_SHADER); glcheck(); break; } | ||||||
|  |         case EShaderType::Geometry:       { id = ::glCreateShader(GL_GEOMETRY_SHADER); glcheck(); break; } | ||||||
|  |         case EShaderType::TessEvaluation: { id = ::glCreateShader(GL_TESS_EVALUATION_SHADER); glcheck(); break; } | ||||||
|  |         case EShaderType::TessControl:    { id = ::glCreateShader(GL_TESS_CONTROL_SHADER); glcheck(); break; } | ||||||
|  |         case EShaderType::Compute:        { id = ::glCreateShader(GL_COMPUTE_SHADER); glcheck(); break; } | ||||||
|  |         default:                          { break; } | ||||||
|  |         } | ||||||
|  |             | ||||||
|  |         return (id == 0) ? std::make_pair(false, GLuint(0)) : std::make_pair(true, id); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     auto release_shaders = [](const std::array<GLuint, static_cast<size_t>(EShaderType::Count)>& shader_ids) { | ||||||
|  |         for (size_t i = 0; i < static_cast<size_t>(EShaderType::Count); ++i) { | ||||||
|  |             if (shader_ids[i] > 0) | ||||||
|  |                 glsafe(::glDeleteShader(shader_ids[i])); | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     assert(m_id == 0); | ||||||
|  | 
 | ||||||
|  |     m_name = name; | ||||||
|  | 
 | ||||||
|  |     std::array<GLuint, static_cast<size_t>(EShaderType::Count)> shader_ids = { 0 }; | ||||||
|  | 
 | ||||||
|  |     for (size_t i = 0; i < static_cast<size_t>(EShaderType::Count); ++i) { | ||||||
|  |         const std::string& source = sources[i]; | ||||||
|  |         if (!source.empty()) | ||||||
|  |         { | ||||||
|  |             EShaderType type = static_cast<EShaderType>(i); | ||||||
|  |             auto [result, id] = create_shader(type); | ||||||
|  |             if (result) | ||||||
|  |                 shader_ids[i] = id; | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 BOOST_LOG_TRIVIAL(error) << "glCreateShader() failed for " << shader_type_as_string(type) << " shader of shader program '" << name << "'"; | ||||||
|  |                 return false; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             const char* source_ptr = source.c_str(); | ||||||
|  |             glsafe(::glShaderSource(id, 1, &source_ptr, nullptr)); | ||||||
|  |             glsafe(::glCompileShader(id)); | ||||||
|  |             GLint params; | ||||||
|  |             glsafe(::glGetShaderiv(id, GL_COMPILE_STATUS, ¶ms)); | ||||||
|  |             if (params == GL_FALSE) { | ||||||
|  |                 // Compilation failed. 
 | ||||||
|  |                 glsafe(::glGetShaderiv(id, GL_INFO_LOG_LENGTH, ¶ms)); | ||||||
|  |                 std::vector<char> msg(params); | ||||||
|  |                 glsafe(::glGetShaderInfoLog(id, params, ¶ms, msg.data())); | ||||||
|  |                 BOOST_LOG_TRIVIAL(error) << "Unable to compile " << shader_type_as_string(type) << " shader of shader program '" << name << "':\n" << msg.data(); | ||||||
|  | 
 | ||||||
|  |                 // release shader
 | ||||||
|  |                 release_shaders(shader_ids); | ||||||
|  |                 return false; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     m_id = ::glCreateProgram(); | ||||||
|  |     glcheck(); | ||||||
|  |     if (m_id == 0) { | ||||||
|  |         BOOST_LOG_TRIVIAL(error) << "glCreateProgram() failed for shader program '" << name << "'"; | ||||||
|  | 
 | ||||||
|  |         // release shaders
 | ||||||
|  |         release_shaders(shader_ids); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     for (size_t i = 0; i < static_cast<size_t>(EShaderType::Count); ++i) { | ||||||
|  |         if (shader_ids[i] > 0) | ||||||
|  |             glsafe(::glAttachShader(m_id, shader_ids[i])); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     glsafe(::glLinkProgram(m_id)); | ||||||
|  |     GLint params; | ||||||
|  |     glsafe(::glGetProgramiv(m_id, GL_LINK_STATUS, ¶ms)); | ||||||
|  |     if (params == GL_FALSE) { | ||||||
|  |         // Linking failed. 
 | ||||||
|  |         glsafe(::glGetProgramiv(m_id, GL_INFO_LOG_LENGTH, ¶ms)); | ||||||
|  |         std::vector<char> msg(params); | ||||||
|  |         glsafe(::glGetProgramInfoLog(m_id, params, ¶ms, msg.data())); | ||||||
|  |         BOOST_LOG_TRIVIAL(error) << "Unable to link shader program '" << name << "':\n" << msg.data(); | ||||||
|  | 
 | ||||||
|  |         // release shaders
 | ||||||
|  |         release_shaders(shader_ids); | ||||||
|  | 
 | ||||||
|  |         // release shader program
 | ||||||
|  |         glsafe(::glDeleteProgram(m_id)); | ||||||
|  |         m_id = 0; | ||||||
|  | 
 | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // release shaders, they are no more needed
 | ||||||
|  |     release_shaders(shader_ids); | ||||||
|  | 
 | ||||||
|  |     return true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::start_using() const | ||||||
|  | { | ||||||
|  |     if (m_id == 0) | ||||||
|  |         return false; | ||||||
|  | 
 | ||||||
|  |     glsafe(::glUseProgram(m_id)); | ||||||
|  |     return true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void GLShaderProgram::stop_using() const | ||||||
|  | { | ||||||
|  |     glsafe(::glUseProgram(0)); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, int value) const | ||||||
|  | { | ||||||
|  |     int id = get_uniform_location(name); | ||||||
|  |     if (id >= 0) { | ||||||
|  |         glsafe(::glUniform1i(id, static_cast<GLint>(value))); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, bool value) const | ||||||
|  | { | ||||||
|  |     return set_uniform(name, value ? 1 : 0); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, float value) const | ||||||
|  | { | ||||||
|  |     int id = get_uniform_location(name); | ||||||
|  |     if (id >= 0) { | ||||||
|  |         glsafe(::glUniform1f(id, static_cast<GLfloat>(value))); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, const std::array<float, 3>& value) const | ||||||
|  | { | ||||||
|  |     int id = get_uniform_location(name); | ||||||
|  |     if (id >= 0) { | ||||||
|  |         glsafe(::glUniform3fv(id, 1, static_cast<const GLfloat*>(value.data()))); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, const std::array<float, 4>& value) const | ||||||
|  | { | ||||||
|  |     int id = get_uniform_location(name); | ||||||
|  |     if (id >= 0) { | ||||||
|  |         glsafe(::glUniform4fv(id, 1, static_cast<const GLfloat*>(value.data()))); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, const float* value, size_t size) const | ||||||
|  | { | ||||||
|  |     if (size == 1) | ||||||
|  |         return set_uniform(name, value[0]); | ||||||
|  |     else if (size < 5) | ||||||
|  |     { | ||||||
|  |         int id = get_uniform_location(name); | ||||||
|  |         if (id >= 0) { | ||||||
|  |             if (size == 2) | ||||||
|  |                 glsafe(::glUniform2fv(id, 1, static_cast<const GLfloat*>(value))); | ||||||
|  |             else if (size == 3) | ||||||
|  |                 glsafe(::glUniform3fv(id, 1, static_cast<const GLfloat*>(value))); | ||||||
|  |             else | ||||||
|  |                 glsafe(::glUniform4fv(id, 1, static_cast<const GLfloat*>(value))); | ||||||
|  | 
 | ||||||
|  |             return true; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, const Transform3f& value) const | ||||||
|  | { | ||||||
|  |     int id = get_uniform_location(name); | ||||||
|  |     if (id >= 0) { | ||||||
|  |         glsafe(::glUniformMatrix4fv(id, 1, GL_FALSE, static_cast<const GLfloat*>(value.matrix().data()))); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool GLShaderProgram::set_uniform(const char* name, const Transform3d& value) const | ||||||
|  | { | ||||||
|  |     return set_uniform(name, value.cast<float>()); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | int GLShaderProgram::get_attrib_location(const char* name) const | ||||||
|  | { | ||||||
|  |     return (m_id > 0) ? ::glGetAttribLocation(m_id, name) : -1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | int GLShaderProgram::get_uniform_location(const char* name) const | ||||||
|  | { | ||||||
|  |     return (m_id > 0) ? ::glGetUniformLocation(m_id, name) : -1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | } // namespace Slic3r
 | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include <string> | #include <string> | ||||||
| #include <utility> | #include <utility> | ||||||
| #include <assert.h> | #include <assert.h> | ||||||
|  | @ -364,3 +642,6 @@ void Shader::reset() | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| } // namespace Slic3r
 | } // namespace Slic3r
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,64 @@ | ||||||
| #ifndef slic3r_GLShader_hpp_ | #ifndef slic3r_GLShader_hpp_ | ||||||
| #define slic3r_GLShader_hpp_ | #define slic3r_GLShader_hpp_ | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | #include <array> | ||||||
|  | #include <string> | ||||||
|  | 
 | ||||||
|  | namespace Slic3r { | ||||||
|  | 
 | ||||||
|  | class GLShaderProgram | ||||||
|  | { | ||||||
|  | public: | ||||||
|  |     enum class EShaderType | ||||||
|  |     { | ||||||
|  |         Vertex, | ||||||
|  |         Fragment, | ||||||
|  |         Geometry, | ||||||
|  |         TessEvaluation, | ||||||
|  |         TessControl, | ||||||
|  |         Compute, | ||||||
|  |         Count | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     typedef std::array<std::string, static_cast<size_t>(EShaderType::Count)> ShaderFilenames; | ||||||
|  |     typedef std::array<std::string, static_cast<size_t>(EShaderType::Count)> ShaderSources; | ||||||
|  | 
 | ||||||
|  | private: | ||||||
|  |     std::string m_name; | ||||||
|  |     unsigned int m_id{ 0 }; | ||||||
|  | 
 | ||||||
|  | public: | ||||||
|  |     ~GLShaderProgram(); | ||||||
|  | 
 | ||||||
|  |     bool init_from_files(const std::string& name, const ShaderFilenames& filenames); | ||||||
|  |     bool init_from_texts(const std::string& name, const ShaderSources& sources); | ||||||
|  | 
 | ||||||
|  |     const std::string& get_name() const { return m_name; } | ||||||
|  |     unsigned int get_id() const { return m_id; } | ||||||
|  | 
 | ||||||
|  |     bool start_using() const; | ||||||
|  |     void stop_using() const; | ||||||
|  | 
 | ||||||
|  |     bool set_uniform(const char* name, int value) const; | ||||||
|  |     bool set_uniform(const char* name, bool value) const; | ||||||
|  |     bool set_uniform(const char* name, float value) const; | ||||||
|  |     bool set_uniform(const char* name, const std::array<float, 3>& value) const; | ||||||
|  |     bool set_uniform(const char* name, const std::array<float, 4>& value) const; | ||||||
|  |     bool set_uniform(const char* name, const float* value, size_t size) const; | ||||||
|  |     bool set_uniform(const char* name, const Transform3f& value) const; | ||||||
|  |     bool set_uniform(const char* name, const Transform3d& value) const; | ||||||
|  | 
 | ||||||
|  |     // returns -1 if not found
 | ||||||
|  |     int get_attrib_location(const char* name) const; | ||||||
|  |     // returns -1 if not found
 | ||||||
|  |     int get_uniform_location(const char* name) const; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | } // namespace Slic3r
 | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "libslic3r/libslic3r.h" | #include "libslic3r/libslic3r.h" | ||||||
| #include "libslic3r/Point.hpp" | #include "libslic3r/Point.hpp" | ||||||
| 
 | 
 | ||||||
|  | @ -67,5 +125,8 @@ private: | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| #endif /* slic3r_GLShader_hpp_ */ | #endif /* slic3r_GLShader_hpp_ */ | ||||||
|  |  | ||||||
							
								
								
									
										76
									
								
								src/slic3r/GUI/GLShadersManager.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								src/slic3r/GUI/GLShadersManager.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,76 @@ | ||||||
|  | #include "libslic3r/libslic3r.h" | ||||||
|  | #include "GLShadersManager.hpp" | ||||||
|  | 
 | ||||||
|  | #include <cassert> | ||||||
|  | #include <algorithm> | ||||||
|  | 
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | 
 | ||||||
|  | namespace Slic3r { | ||||||
|  | 
 | ||||||
|  | std::pair<bool, std::string> GLShadersManager::init() | ||||||
|  | { | ||||||
|  |     std::string error; | ||||||
|  | 
 | ||||||
|  |     auto append_shader = [this, &error](const std::string& name, const GLShaderProgram::ShaderFilenames& filenames) { | ||||||
|  |         m_shaders.push_back(std::make_unique<GLShaderProgram>()); | ||||||
|  |         if (!m_shaders.back()->init_from_files(name, filenames)) { | ||||||
|  |             error += name + "\n"; | ||||||
|  |             // if any error happens while initializating the shader, we remove it from the list
 | ||||||
|  |             m_shaders.pop_back(); | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  |         return true; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     assert(m_shaders.empty()); | ||||||
|  | 
 | ||||||
|  |     bool valid = true; | ||||||
|  | 
 | ||||||
|  |     // used to render bed axes, selection hints
 | ||||||
|  |     valid &= append_shader("gouraud_light", { "gouraud_light.vs", "gouraud_light.fs" }); | ||||||
|  |     // used to render printbed
 | ||||||
|  |     valid &= append_shader("printbed", { "printbed.vs", "printbed.fs" }); | ||||||
|  |     // used to render tool changes in gcode preview
 | ||||||
|  |     valid &= append_shader("toolchanges", { "toolchanges.vs", "toolchanges.fs" }); | ||||||
|  |     // used to render color changes in gcode preview
 | ||||||
|  |     valid &= append_shader("colorchanges", { "colorchanges.vs", "colorchanges.fs" }); | ||||||
|  |     // used to render pause prints in gcode preview
 | ||||||
|  |     valid &= append_shader("pauses", { "pauses.vs", "pauses.fs" }); | ||||||
|  |     // used to render custom gcode points in gcode preview
 | ||||||
|  |     valid &= append_shader("customs", { "customs.vs", "customs.fs" }); | ||||||
|  |     // used to render retractions in gcode preview
 | ||||||
|  |     valid &= append_shader("retractions", { "retractions.vs", "retractions.fs" }); | ||||||
|  |     // used to render unretractions in gcode preview
 | ||||||
|  |     valid &= append_shader("unretractions", { "unretractions.vs", "unretractions.fs" }); | ||||||
|  |     // used to render extrusion paths in gcode preview
 | ||||||
|  |     valid &= append_shader("extrusions", { "extrusions.vs", "extrusions.fs" }); | ||||||
|  |     // used to render travel paths in gcode preview
 | ||||||
|  |     valid &= append_shader("travels", { "travels.vs", "travels.fs" }); | ||||||
|  |     // used to render shells in gcode preview
 | ||||||
|  |     valid &= append_shader("shells", { "shells.vs", "shells.fs" }); | ||||||
|  |     // used to render objects in 3d editor
 | ||||||
|  |     valid &= append_shader("gouraud", { "gouraud.vs", "gouraud.fs" }); | ||||||
|  |     // used to render variable layers heights in 3d editor
 | ||||||
|  |     valid &= append_shader("variable_layer_height", { "variable_layer_height.vs", "variable_layer_height.fs" }); | ||||||
|  | 
 | ||||||
|  |     return { valid, error }; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void GLShadersManager::shutdown() | ||||||
|  | { | ||||||
|  |     for (std::unique_ptr<GLShaderProgram>& shader : m_shaders) | ||||||
|  |     { | ||||||
|  |         shader.reset(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | GLShaderProgram* GLShadersManager::get_shader(const std::string& shader_name) | ||||||
|  | { | ||||||
|  |     auto it = std::find_if(m_shaders.begin(), m_shaders.end(), [shader_name](std::unique_ptr<GLShaderProgram>& p) { return p->get_name() == shader_name; }); | ||||||
|  |     return (it != m_shaders.end()) ? it->get() : nullptr; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | } // namespace Slic3r
 | ||||||
|  | 
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
							
								
								
									
										31
									
								
								src/slic3r/GUI/GLShadersManager.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/slic3r/GUI/GLShadersManager.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | ||||||
|  | #ifndef slic3r_GLShadersManager_hpp_ | ||||||
|  | #define slic3r_GLShadersManager_hpp_ | ||||||
|  | 
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | 
 | ||||||
|  | #include "GLShader.hpp" | ||||||
|  | 
 | ||||||
|  | #include <vector> | ||||||
|  | #include <string> | ||||||
|  | #include <memory> | ||||||
|  | 
 | ||||||
|  | namespace Slic3r { | ||||||
|  | 
 | ||||||
|  | class GLShadersManager | ||||||
|  | { | ||||||
|  |     std::vector<std::unique_ptr<GLShaderProgram>> m_shaders; | ||||||
|  | 
 | ||||||
|  | public: | ||||||
|  |     std::pair<bool, std::string> init(); | ||||||
|  |     // call this method before to release the OpenGL context
 | ||||||
|  |     void shutdown(); | ||||||
|  | 
 | ||||||
|  |     // returns nullptr if not found
 | ||||||
|  |     GLShaderProgram* get_shader(const std::string& shader_name); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | } // namespace Slic3r
 | ||||||
|  | 
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | 
 | ||||||
|  | #endif //  slic3r_GLShadersManager_hpp_
 | ||||||
|  | @ -217,6 +217,16 @@ public: | ||||||
|     void            gcode_thumbnails_debug(); |     void            gcode_thumbnails_debug(); | ||||||
| #endif // ENABLE_THUMBNAIL_GENERATOR_DEBUG
 | #endif // ENABLE_THUMBNAIL_GENERATOR_DEBUG
 | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     // returns nullptr if not found
 | ||||||
|  |     GLShaderProgram* get_shader(const std::string& shader_name) { return m_opengl_mgr.get_shader(shader_name); } | ||||||
|  | 
 | ||||||
|  | //    // returns 0 if not found
 | ||||||
|  | //    unsigned int get_shader_id(const std::string& shader_name) const { return m_opengl_mgr.get_shader_id(shader_name); }
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
| private: | private: | ||||||
|     bool            on_init_inner(); |     bool            on_init_inner(); | ||||||
| 	void            init_app_config(); | 	void            init_app_config(); | ||||||
|  |  | ||||||
|  | @ -28,6 +28,17 @@ | ||||||
| namespace Slic3r { | namespace Slic3r { | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | // A safe wrapper around glGetString to report a "N/A" string in case glGetString returns nullptr.
 | ||||||
|  | inline std::string gl_get_string_safe(GLenum param, const std::string& default_value) | ||||||
|  | { | ||||||
|  |     const char* value = (const char*)::glGetString(param); | ||||||
|  |     return std::string((value != nullptr) ? value : default_value); | ||||||
|  | } | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
| const std::string& OpenGLManager::GLInfo::get_version() const | const std::string& OpenGLManager::GLInfo::get_version() const | ||||||
| { | { | ||||||
|     if (!m_detected) |     if (!m_detected) | ||||||
|  | @ -85,6 +96,14 @@ float OpenGLManager::GLInfo::get_max_anisotropy() const | ||||||
| 
 | 
 | ||||||
| void OpenGLManager::GLInfo::detect() const | void OpenGLManager::GLInfo::detect() const | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     m_version = gl_get_string_safe(GL_VERSION, "N/A"); | ||||||
|  |     m_glsl_version = gl_get_string_safe(GL_SHADING_LANGUAGE_VERSION, "N/A"); | ||||||
|  |     m_vendor = gl_get_string_safe(GL_VENDOR, "N/A"); | ||||||
|  |     m_renderer = gl_get_string_safe(GL_RENDERER, "N/A"); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     const char* data = (const char*)::glGetString(GL_VERSION); |     const char* data = (const char*)::glGetString(GL_VERSION); | ||||||
|     if (data != nullptr) |     if (data != nullptr) | ||||||
|         m_version = data; |         m_version = data; | ||||||
|  | @ -100,6 +119,9 @@ void OpenGLManager::GLInfo::detect() const | ||||||
|     data = (const char*)::glGetString(GL_RENDERER); |     data = (const char*)::glGetString(GL_RENDERER); | ||||||
|     if (data != nullptr) |     if (data != nullptr) | ||||||
|         m_renderer = data; |         m_renderer = data; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     glsafe(::glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_max_tex_size)); |     glsafe(::glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_max_tex_size)); | ||||||
| 
 | 
 | ||||||
|  | @ -119,6 +141,13 @@ bool OpenGLManager::GLInfo::is_version_greater_or_equal_to(unsigned int major, u | ||||||
|     if (!m_detected) |     if (!m_detected) | ||||||
|         detect(); |         detect(); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     if (m_version == "N/A") | ||||||
|  |         return false; | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
|     std::vector<std::string> tokens; |     std::vector<std::string> tokens; | ||||||
|     boost::split(tokens, m_version, boost::is_any_of(" "), boost::token_compress_on); |     boost::split(tokens, m_version, boost::is_any_of(" "), boost::token_compress_on); | ||||||
| 
 | 
 | ||||||
|  | @ -159,15 +188,34 @@ std::string OpenGLManager::GLInfo::to_string(bool format_as_html, bool extension | ||||||
|     std::string line_end = format_as_html ? "<br>" : "\n"; |     std::string line_end = format_as_html ? "<br>" : "\n"; | ||||||
| 
 | 
 | ||||||
|     out << h2_start << "OpenGL installation" << h2_end << line_end; |     out << h2_start << "OpenGL installation" << h2_end << line_end; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     out << b_start << "GL version:   " << b_end << m_version << line_end; | ||||||
|  |     out << b_start << "Vendor:       " << b_end << m_vendor << line_end; | ||||||
|  |     out << b_start << "Renderer:     " << b_end << m_renderer << line_end; | ||||||
|  |     out << b_start << "GLSL version: " << b_end << m_glsl_version << line_end; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     out << b_start << "GL version:   " << b_end << (m_version.empty() ? "N/A" : m_version) << line_end; |     out << b_start << "GL version:   " << b_end << (m_version.empty() ? "N/A" : m_version) << line_end; | ||||||
|     out << b_start << "Vendor:       " << b_end << (m_vendor.empty() ? "N/A" : m_vendor) << line_end; |     out << b_start << "Vendor:       " << b_end << (m_vendor.empty() ? "N/A" : m_vendor) << line_end; | ||||||
|     out << b_start << "Renderer:     " << b_end << (m_renderer.empty() ? "N/A" : m_renderer) << line_end; |     out << b_start << "Renderer:     " << b_end << (m_renderer.empty() ? "N/A" : m_renderer) << line_end; | ||||||
|     out << b_start << "GLSL version: " << b_end << (m_glsl_version.empty() ? "N/A" : m_glsl_version) << line_end; |     out << b_start << "GLSL version: " << b_end << (m_glsl_version.empty() ? "N/A" : m_glsl_version) << line_end; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     if (extensions) |     if (extensions) | ||||||
|     { |     { | ||||||
|         std::vector<std::string> extensions_list; |         std::vector<std::string> extensions_list; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         std::string extensions_str = gl_get_string_safe(GL_EXTENSIONS, ""); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         std::string extensions_str = (const char*)::glGetString(GL_EXTENSIONS); |         std::string extensions_str = (const char*)::glGetString(GL_EXTENSIONS); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         boost::split(extensions_list, extensions_str, boost::is_any_of(" "), boost::token_compress_off); |         boost::split(extensions_list, extensions_str, boost::is_any_of(" "), boost::token_compress_off); | ||||||
| 
 | 
 | ||||||
|         if (!extensions_list.empty()) |         if (!extensions_list.empty()) | ||||||
|  | @ -199,6 +247,12 @@ OpenGLManager::OSInfo OpenGLManager::s_os_info; | ||||||
| 
 | 
 | ||||||
| OpenGLManager::~OpenGLManager() | OpenGLManager::~OpenGLManager() | ||||||
| { | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     m_shaders_manager.shutdown(); | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
| #if ENABLE_HACK_CLOSING_ON_OSX_10_9_5 | #if ENABLE_HACK_CLOSING_ON_OSX_10_9_5 | ||||||
| #ifdef __APPLE__  | #ifdef __APPLE__  | ||||||
|     // This is an ugly hack needed to solve the crash happening when closing the application on OSX 10.9.5 with newer wxWidgets
 |     // This is an ugly hack needed to solve the crash happening when closing the application on OSX 10.9.5 with newer wxWidgets
 | ||||||
|  | @ -240,19 +294,43 @@ bool OpenGLManager::init_gl() | ||||||
|         else |         else | ||||||
|             s_framebuffers_type = EFramebufferType::Unknown; |             s_framebuffers_type = EFramebufferType::Unknown; | ||||||
| 
 | 
 | ||||||
|         if (! s_gl_info.is_version_greater_or_equal_to(2, 0)) { | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         	// Complain about the OpenGL version.
 | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         bool valid_version = s_gl_info.is_version_greater_or_equal_to(2, 0); | ||||||
|  |         if (!valid_version) { | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         if (!s_gl_info.is_version_greater_or_equal_to(2, 0)) { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
|  |             // Complain about the OpenGL version.
 | ||||||
|             wxString message = from_u8((boost::format( |             wxString message = from_u8((boost::format( | ||||||
|                 _utf8(L("PrusaSlicer requires OpenGL 2.0 capable graphics driver to run correctly, \n" |                 _utf8(L("PrusaSlicer requires OpenGL 2.0 capable graphics driver to run correctly, \n" | ||||||
|                     "while OpenGL version %s, render %s, vendor %s was detected."))) % s_gl_info.get_version() % s_gl_info.get_renderer() % s_gl_info.get_vendor()).str()); |                     "while OpenGL version %s, render %s, vendor %s was detected."))) % s_gl_info.get_version() % s_gl_info.get_renderer() % s_gl_info.get_vendor()).str()); | ||||||
|         	message += "\n"; |             message += "\n"; | ||||||
|         	message += _L("You may need to update your graphics card driver."); |         	message += _L("You may need to update your graphics card driver."); | ||||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||||
|         	message += "\n"; |             message += "\n"; | ||||||
|         	message += _L("As a workaround, you may run PrusaSlicer with a software rendered 3D graphics by running prusa-slicer.exe with the --sw_renderer parameter."); |         	message += _L("As a workaround, you may run PrusaSlicer with a software rendered 3D graphics by running prusa-slicer.exe with the --sw_renderer parameter."); | ||||||
| #endif | #endif | ||||||
|         	wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Unsupported OpenGL version"), wxOK | wxICON_ERROR); |         	wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Unsupported OpenGL version"), wxOK | wxICON_ERROR); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         if (valid_version) { | ||||||
|  |             // load shaders
 | ||||||
|  |             auto [result, error] = m_shaders_manager.init(); | ||||||
|  |             if (!result) { | ||||||
|  |                 wxString message = from_u8((boost::format( | ||||||
|  |                     _utf8(L("Unable to load the following shaders:\n%s"))) % error).str()); | ||||||
|  |                 wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Error loading shaders"), wxOK | wxICON_ERROR); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return true; |     return true; | ||||||
|  |  | ||||||
|  | @ -1,6 +1,12 @@ | ||||||
| #ifndef slic3r_OpenGLManager_hpp_ | #ifndef slic3r_OpenGLManager_hpp_ | ||||||
| #define slic3r_OpenGLManager_hpp_ | #define slic3r_OpenGLManager_hpp_ | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | #include "GLShadersManager.hpp" | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
| class wxWindow; | class wxWindow; | ||||||
| class wxGLCanvas; | class wxGLCanvas; | ||||||
| class wxGLContext; | class wxGLContext; | ||||||
|  | @ -70,6 +76,11 @@ private: | ||||||
| 
 | 
 | ||||||
|     bool m_gl_initialized{ false }; |     bool m_gl_initialized{ false }; | ||||||
|     wxGLContext* m_context{ nullptr }; |     wxGLContext* m_context{ nullptr }; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShadersManager m_shaders_manager; | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     static GLInfo s_gl_info; |     static GLInfo s_gl_info; | ||||||
| #if ENABLE_HACK_CLOSING_ON_OSX_10_9_5 | #if ENABLE_HACK_CLOSING_ON_OSX_10_9_5 | ||||||
| #ifdef __APPLE__  | #ifdef __APPLE__  | ||||||
|  | @ -86,9 +97,18 @@ public: | ||||||
|     ~OpenGLManager(); |     ~OpenGLManager(); | ||||||
| 
 | 
 | ||||||
|     bool init_gl(); |     bool init_gl(); | ||||||
| 
 |  | ||||||
|     wxGLContext* init_glcontext(wxGLCanvas& canvas); |     wxGLContext* init_glcontext(wxGLCanvas& canvas); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     // returns nullptr if not found
 | ||||||
|  |     GLShaderProgram* get_shader(const std::string& shader_name) { return m_shaders_manager.get_shader(shader_name); } | ||||||
|  | 
 | ||||||
|  | //    // returns 0 if not found
 | ||||||
|  | //    unsigned int get_shader_id(const std::string& shader_name) const { return m_shaders_manager.get_shader_id(shader_name); }
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
|     static bool are_compressed_textures_supported() { return s_compressed_textures_supported; } |     static bool are_compressed_textures_supported() { return s_compressed_textures_supported; } | ||||||
|     static bool can_multisample() { return s_multisample == EMultisampleState::Enabled; } |     static bool can_multisample() { return s_multisample == EMultisampleState::Enabled; } | ||||||
|     static bool are_framebuffers_supported() { return (s_framebuffers_type != EFramebufferType::Unknown); } |     static bool are_framebuffers_supported() { return (s_framebuffers_type != EFramebufferType::Unknown); } | ||||||
|  |  | ||||||
|  | @ -8,6 +8,11 @@ | ||||||
| #include "GUI_ObjectList.hpp" | #include "GUI_ObjectList.hpp" | ||||||
| #include "Gizmos/GLGizmoBase.hpp" | #include "Gizmos/GLGizmoBase.hpp" | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | //#if ENABLE_SHADERS_MANAGER
 | ||||||
|  | //#include "GLShader.hpp"
 | ||||||
|  | //#endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "Camera.hpp" | #include "Camera.hpp" | ||||||
| 
 | 
 | ||||||
| #include <GL/glew.h> | #include <GL/glew.h> | ||||||
|  | @ -113,11 +118,17 @@ bool Selection::init() | ||||||
|     m_arrow.init_from(straight_arrow(10.0f, 5.0f, 5.0f, 10.0f, 1.0f)); |     m_arrow.init_from(straight_arrow(10.0f, 5.0f, 5.0f, 10.0f, 1.0f)); | ||||||
|     m_curved_arrow.init_from(circular_arrow(16, 10.0f, 5.0f, 10.0f, 5.0f, 1.0f)); |     m_curved_arrow.init_from(circular_arrow(16, 10.0f, 5.0f, 10.0f, 5.0f, 1.0f)); | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     if (!m_arrows_shader.init("gouraud_light.vs", "gouraud_light.fs")) |     if (!m_arrows_shader.init("gouraud_light.vs", "gouraud_light.fs")) | ||||||
|     { |     { | ||||||
|         BOOST_LOG_TRIVIAL(error) << "Unable to initialize gouraud_light shader: please, check that the files gouraud_light.vs and gouraud_light.fs are available"; |         BOOST_LOG_TRIVIAL(error) << "Unable to initialize gouraud_light shader: please, check that the files gouraud_light.vs and gouraud_light.fs are available"; | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #else | #else | ||||||
|     if (!m_arrow.init()) |     if (!m_arrow.init()) | ||||||
|         return false; |         return false; | ||||||
|  | @ -1253,13 +1264,31 @@ void Selection::render_sidebar_hints(const std::string& sidebar_field, const Sha | ||||||
|     if (sidebar_field.empty()) |     if (sidebar_field.empty()) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     GLShaderProgram* shader = nullptr; | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | 
 | ||||||
|     if (!boost::starts_with(sidebar_field, "layer")) |     if (!boost::starts_with(sidebar_field, "layer")) | ||||||
|     { |     { | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader = wxGetApp().get_shader("gouraud_light"); | ||||||
|  |         if (shader == nullptr) | ||||||
|  |             return; | ||||||
|  | 
 | ||||||
|  |         shader->start_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (!m_arrows_shader.is_initialized()) |         if (!m_arrows_shader.is_initialized()) | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|         m_arrows_shader.start_using(); |         m_arrows_shader.start_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         glsafe(::glClear(GL_DEPTH_BUFFER_BIT)); |         glsafe(::glClear(GL_DEPTH_BUFFER_BIT)); | ||||||
| #else | #else | ||||||
|         shader.start_using(); |         shader.start_using(); | ||||||
|  | @ -1322,13 +1351,46 @@ void Selection::render_sidebar_hints(const std::string& sidebar_field, const Sha | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (boost::starts_with(sidebar_field, "position")) |     if (boost::starts_with(sidebar_field, "position")) | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         render_sidebar_position_hints(sidebar_field, *shader); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         render_sidebar_position_hints(sidebar_field); |         render_sidebar_position_hints(sidebar_field); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     else if (boost::starts_with(sidebar_field, "rotation")) |     else if (boost::starts_with(sidebar_field, "rotation")) | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         render_sidebar_rotation_hints(sidebar_field, *shader); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         render_sidebar_rotation_hints(sidebar_field); |         render_sidebar_rotation_hints(sidebar_field); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_GCODE_VIEWER | ||||||
|  |     else if (boost::starts_with(sidebar_field, "scale") || boost::starts_with(sidebar_field, "size")) | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | render_sidebar_scale_hints(sidebar_field, *shader); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         render_sidebar_scale_hints(sidebar_field); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     else if (boost::starts_with(sidebar_field, "scale")) |     else if (boost::starts_with(sidebar_field, "scale")) | ||||||
|         render_sidebar_scale_hints(sidebar_field); |         render_sidebar_scale_hints(sidebar_field); | ||||||
|     else if (boost::starts_with(sidebar_field, "size")) |     else if (boost::starts_with(sidebar_field, "size")) | ||||||
|         render_sidebar_size_hints(sidebar_field); |         render_sidebar_size_hints(sidebar_field); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_GCODE_VIEWER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     else if (boost::starts_with(sidebar_field, "layer")) |     else if (boost::starts_with(sidebar_field, "layer")) | ||||||
|         render_sidebar_layers_hints(sidebar_field); |         render_sidebar_layers_hints(sidebar_field); | ||||||
| 
 | 
 | ||||||
|  | @ -1337,7 +1399,15 @@ void Selection::render_sidebar_hints(const std::string& sidebar_field, const Sha | ||||||
|     if (!boost::starts_with(sidebar_field, "layer")) |     if (!boost::starts_with(sidebar_field, "layer")) | ||||||
|     { |     { | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader->stop_using(); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         m_arrows_shader.stop_using(); |         m_arrows_shader.stop_using(); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #else | #else | ||||||
|         glsafe(::glDisable(GL_LIGHTING)); |         glsafe(::glDisable(GL_LIGHTING)); | ||||||
|         shader.stop_using(); |         shader.stop_using(); | ||||||
|  | @ -1942,35 +2012,76 @@ void Selection::render_bounding_box(const BoundingBoxf3& box, float* color) cons | ||||||
|     glsafe(::glEnd()); |     glsafe(::glEnd()); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Selection::render_sidebar_position_hints(const std::string& sidebar_field) const |  | ||||||
| { |  | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | void Selection::render_sidebar_position_hints(const std::string& sidebar_field, GLShaderProgram& shader) const | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | void Selection::render_sidebar_position_hints(const std::string& sidebar_field) const | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     GLint color_id = ::glGetUniformLocation(m_arrows_shader.get_shader_program_id(), "uniform_color"); |     GLint color_id = ::glGetUniformLocation(m_arrows_shader.get_shader_program_id(), "uniform_color"); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     if (boost::ends_with(sidebar_field, "x")) |     if (boost::ends_with(sidebar_field, "x")) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader.set_uniform("uniform_color", AXES_COLOR[0], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[0])); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[0])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         glsafe(::glRotated(-90.0, 0.0, 0.0, 1.0)); |         glsafe(::glRotated(-90.0, 0.0, 0.0, 1.0)); | ||||||
|         m_arrow.render(); |         m_arrow.render(); | ||||||
|     } |     } | ||||||
|     else if (boost::ends_with(sidebar_field, "y")) |     else if (boost::ends_with(sidebar_field, "y")) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader.set_uniform("uniform_color", AXES_COLOR[1], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[1])); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[1])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         m_arrow.render(); |         m_arrow.render(); | ||||||
|     } |     } | ||||||
|     else if (boost::ends_with(sidebar_field, "z")) |     else if (boost::ends_with(sidebar_field, "z")) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader.set_uniform("uniform_color", AXES_COLOR[2], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[2])); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[2])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         glsafe(::glRotated(90.0, 1.0, 0.0, 0.0)); |         glsafe(::glRotated(90.0, 1.0, 0.0, 0.0)); | ||||||
|         m_arrow.render(); |         m_arrow.render(); | ||||||
|     } |     } | ||||||
|  | } | ||||||
| #else | #else | ||||||
|  | void Selection::render_sidebar_position_hints(const std::string & sidebar_field) const | ||||||
|  | { | ||||||
|     if (boost::ends_with(sidebar_field, "x")) |     if (boost::ends_with(sidebar_field, "x")) | ||||||
|     { |     { | ||||||
|         glsafe(::glRotated(-90.0, 0.0, 0.0, 1.0)); |         glsafe(::glRotated(-90.0, 0.0, 0.0, 1.0)); | ||||||
|  | @ -1983,38 +2094,79 @@ void Selection::render_sidebar_position_hints(const std::string& sidebar_field) | ||||||
|         glsafe(::glRotated(90.0, 1.0, 0.0, 0.0)); |         glsafe(::glRotated(90.0, 1.0, 0.0, 0.0)); | ||||||
|         render_sidebar_position_hint(Z); |         render_sidebar_position_hint(Z); | ||||||
|     } |     } | ||||||
| #endif // ENABLE_GCODE_VIEWER
 |  | ||||||
| } | } | ||||||
|  | #endif // ENABLE_GCODE_VIEWER
 | ||||||
| 
 | 
 | ||||||
| void Selection::render_sidebar_rotation_hints(const std::string& sidebar_field) const |  | ||||||
| { |  | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | void Selection::render_sidebar_rotation_hints(const std::string& sidebar_field, GLShaderProgram& shader) const | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | void Selection::render_sidebar_rotation_hints(const std::string& sidebar_field) const | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     GLint color_id = ::glGetUniformLocation(m_arrows_shader.get_shader_program_id(), "uniform_color"); |     GLint color_id = ::glGetUniformLocation(m_arrows_shader.get_shader_program_id(), "uniform_color"); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|     if (boost::ends_with(sidebar_field, "x")) |     if (boost::ends_with(sidebar_field, "x")) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader.set_uniform("uniform_color", AXES_COLOR[0], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[0])); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[0])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         glsafe(::glRotated(90.0, 0.0, 1.0, 0.0)); |         glsafe(::glRotated(90.0, 0.0, 1.0, 0.0)); | ||||||
|         render_sidebar_rotation_hint(X); |         render_sidebar_rotation_hint(X); | ||||||
|     } |     } | ||||||
|     else if (boost::ends_with(sidebar_field, "y")) |     else if (boost::ends_with(sidebar_field, "y")) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader.set_uniform("uniform_color", AXES_COLOR[1], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[1])); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[1])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         glsafe(::glRotated(-90.0, 1.0, 0.0, 0.0)); |         glsafe(::glRotated(-90.0, 1.0, 0.0, 0.0)); | ||||||
|         render_sidebar_rotation_hint(Y); |         render_sidebar_rotation_hint(Y); | ||||||
|     } |     } | ||||||
|     else if (boost::ends_with(sidebar_field, "z")) |     else if (boost::ends_with(sidebar_field, "z")) | ||||||
|     { |     { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         shader.set_uniform("uniform_color", AXES_COLOR[2], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         if (color_id >= 0) |         if (color_id >= 0) | ||||||
|             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[2])); |             glsafe(::glUniform4fv(color_id, 1, (const GLfloat*)AXES_COLOR[2])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
|         render_sidebar_rotation_hint(Z); |         render_sidebar_rotation_hint(Z); | ||||||
|     } |     } | ||||||
|  | } | ||||||
| #else | #else | ||||||
|  | void Selection::render_sidebar_rotation_hints(const std::string & sidebar_field) const | ||||||
|  | { | ||||||
|     if (boost::ends_with(sidebar_field, "x")) |     if (boost::ends_with(sidebar_field, "x")) | ||||||
|     { |     { | ||||||
|         glsafe(::glRotated(90.0, 0.0, 1.0, 0.0)); |         glsafe(::glRotated(90.0, 0.0, 1.0, 0.0)); | ||||||
|  | @ -2027,37 +2179,74 @@ void Selection::render_sidebar_rotation_hints(const std::string& sidebar_field) | ||||||
|     } |     } | ||||||
|     else if (boost::ends_with(sidebar_field, "z")) |     else if (boost::ends_with(sidebar_field, "z")) | ||||||
|         render_sidebar_rotation_hint(Z); |         render_sidebar_rotation_hint(Z); | ||||||
| #endif // ENABLE_GCODE_VIEWER
 |  | ||||||
| } | } | ||||||
|  | #endif // ENABLE_GCODE_VIEWER
 | ||||||
| 
 | 
 | ||||||
|  | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | void Selection::render_sidebar_scale_hints(const std::string& sidebar_field, GLShaderProgram& shader) const | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| void Selection::render_sidebar_scale_hints(const std::string& sidebar_field) const | void Selection::render_sidebar_scale_hints(const std::string& sidebar_field) const | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| { | { | ||||||
|     bool uniform_scale = requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling(); |     bool uniform_scale = requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling(); | ||||||
| 
 | 
 | ||||||
| #if ENABLE_GCODE_VIEWER |  | ||||||
|     if (boost::ends_with(sidebar_field, "x") || uniform_scale) |     if (boost::ends_with(sidebar_field, "x") || uniform_scale) | ||||||
|     { |     { | ||||||
|         glsafe(::glPushMatrix()); |         glsafe(::glPushMatrix()); | ||||||
|         glsafe(::glRotated(-90.0, 0.0, 0.0, 1.0)); |         glsafe(::glRotated(-90.0, 0.0, 0.0, 1.0)); | ||||||
|         render_sidebar_scale_hint(X); | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|         glsafe(::glPopMatrix()); | #if ENABLE_SHADERS_MANAGER | ||||||
|     } |         render_sidebar_scale_hint(X, shader); | ||||||
| 
 |  | ||||||
|     if (boost::ends_with(sidebar_field, "y") || uniform_scale) |  | ||||||
|     { |  | ||||||
|         glsafe(::glPushMatrix()); |  | ||||||
|         render_sidebar_scale_hint(Y); |  | ||||||
|         glsafe(::glPopMatrix()); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     if (boost::ends_with(sidebar_field, "z") || uniform_scale) |  | ||||||
|     { |  | ||||||
|         glsafe(::glPushMatrix()); |  | ||||||
|         glsafe(::glRotated(90.0, 1.0, 0.0, 0.0)); |  | ||||||
|         render_sidebar_scale_hint(Z); |  | ||||||
|         glsafe(::glPopMatrix()); |  | ||||||
|     } |  | ||||||
| #else | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         render_sidebar_scale_hint(X); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         glsafe(::glPopMatrix()); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (boost::ends_with(sidebar_field, "y") || uniform_scale) | ||||||
|  |     { | ||||||
|  |         glsafe(::glPushMatrix()); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         render_sidebar_scale_hint(Y, shader); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         render_sidebar_scale_hint(Y); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         glsafe(::glPopMatrix()); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (boost::ends_with(sidebar_field, "z") || uniform_scale) | ||||||
|  |     { | ||||||
|  |         glsafe(::glPushMatrix()); | ||||||
|  |         glsafe(::glRotated(90.0, 1.0, 0.0, 0.0)); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |         render_sidebar_scale_hint(Z, shader); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         render_sidebar_scale_hint(Z); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  |         glsafe(::glPopMatrix()); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | #else | ||||||
|  | void Selection::render_sidebar_scale_hints(const std::string & sidebar_field) const | ||||||
|  | { | ||||||
|  |     bool uniform_scale = requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling(); | ||||||
|  | 
 | ||||||
|     if (boost::ends_with(sidebar_field, "x") || uniform_scale) |     if (boost::ends_with(sidebar_field, "x") || uniform_scale) | ||||||
|     { |     { | ||||||
|         glsafe(::glPushMatrix()); |         glsafe(::glPushMatrix()); | ||||||
|  | @ -2080,13 +2269,19 @@ void Selection::render_sidebar_scale_hints(const std::string& sidebar_field) con | ||||||
|         render_sidebar_scale_hint(Z); |         render_sidebar_scale_hint(Z); | ||||||
|         glsafe(::glPopMatrix()); |         glsafe(::glPopMatrix()); | ||||||
|     } |     } | ||||||
| #endif // ENABLE_GCODE_VIEWER
 |  | ||||||
| } | } | ||||||
|  | #endif // ENABLE_GCODE_VIEWER
 | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| void Selection::render_sidebar_size_hints(const std::string& sidebar_field) const | void Selection::render_sidebar_size_hints(const std::string& sidebar_field) const | ||||||
| { | { | ||||||
|     render_sidebar_scale_hints(sidebar_field); |     render_sidebar_scale_hints(sidebar_field); | ||||||
| } | } | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_GCODE_VIEWER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| 
 | 
 | ||||||
| void Selection::render_sidebar_layers_hints(const std::string& sidebar_field) const | void Selection::render_sidebar_layers_hints(const std::string& sidebar_field) const | ||||||
| { | { | ||||||
|  | @ -2178,13 +2373,29 @@ void Selection::render_sidebar_rotation_hint(Axis axis) const | ||||||
|     m_curved_arrow.render(); |     m_curved_arrow.render(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | void Selection::render_sidebar_scale_hint(Axis axis, GLShaderProgram& shader) const | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| void Selection::render_sidebar_scale_hint(Axis axis) const | void Selection::render_sidebar_scale_hint(Axis axis) const | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| { | { | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     shader.set_uniform("uniform_color", (requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling()) ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis], 4); | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     GLint color_id = ::glGetUniformLocation(m_arrows_shader.get_shader_program_id(), "uniform_color"); |     GLint color_id = ::glGetUniformLocation(m_arrows_shader.get_shader_program_id(), "uniform_color"); | ||||||
| 
 | 
 | ||||||
|     if (color_id >= 0) |     if (color_id >= 0) | ||||||
|         glsafe(::glUniform4fv(color_id, 1, (requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling()) ? (const GLfloat*)UNIFORM_SCALE_COLOR : (const GLfloat*)AXES_COLOR[axis])); |         glsafe(::glUniform4fv(color_id, 1, (requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling()) ? (const GLfloat*)UNIFORM_SCALE_COLOR : (const GLfloat*)AXES_COLOR[axis])); | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #else | #else | ||||||
|     m_arrow.set_color(((requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling()) ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis]), 3); |     m_arrow.set_color(((requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling()) ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis]), 3); | ||||||
| #endif // ENABLE_GCODE_VIEWER
 | #endif // ENABLE_GCODE_VIEWER
 | ||||||
|  |  | ||||||
|  | @ -6,7 +6,13 @@ | ||||||
| #include "3DScene.hpp" | #include "3DScene.hpp" | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
| #include "GLModel.hpp" | #include "GLModel.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #include "GLShader.hpp" | #include "GLShader.hpp" | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #endif // ENABLE_GCODE_VIEWER
 | #endif // ENABLE_GCODE_VIEWER
 | ||||||
| 
 | 
 | ||||||
| #if ENABLE_RENDER_SELECTION_CENTER | #if ENABLE_RENDER_SELECTION_CENTER | ||||||
|  | @ -15,7 +21,15 @@ typedef class GLUquadric GLUquadricObj; | ||||||
| #endif // ENABLE_RENDER_SELECTION_CENTER
 | #endif // ENABLE_RENDER_SELECTION_CENTER
 | ||||||
| 
 | 
 | ||||||
| namespace Slic3r { | namespace Slic3r { | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  | class GLShaderProgram; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| class Shader; | class Shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| class TransformationType | class TransformationType | ||||||
| { | { | ||||||
|  | @ -207,7 +221,13 @@ private: | ||||||
| #if ENABLE_GCODE_VIEWER | #if ENABLE_GCODE_VIEWER | ||||||
|     GL_Model m_arrow; |     GL_Model m_arrow; | ||||||
|     GL_Model m_curved_arrow; |     GL_Model m_curved_arrow; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_SHADERS_MANAGER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     Shader m_arrows_shader; |     Shader m_arrows_shader; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #else | #else | ||||||
|     mutable GLArrow m_arrow; |     mutable GLArrow m_arrow; | ||||||
|     mutable GLCurvedArrow m_curved_arrow; |     mutable GLCurvedArrow m_curved_arrow; | ||||||
|  | @ -368,16 +388,40 @@ private: | ||||||
|     void render_selected_volumes() const; |     void render_selected_volumes() const; | ||||||
|     void render_synchronized_volumes() const; |     void render_synchronized_volumes() const; | ||||||
|     void render_bounding_box(const BoundingBoxf3& box, float* color) const; |     void render_bounding_box(const BoundingBoxf3& box, float* color) const; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     void render_sidebar_position_hints(const std::string& sidebar_field, GLShaderProgram& shader) const; | ||||||
|  |     void render_sidebar_rotation_hints(const std::string& sidebar_field, GLShaderProgram& shader) const; | ||||||
|  |     void render_sidebar_scale_hints(const std::string& sidebar_field, GLShaderProgram& shader) const; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     void render_sidebar_position_hints(const std::string& sidebar_field) const; |     void render_sidebar_position_hints(const std::string& sidebar_field) const; | ||||||
|     void render_sidebar_rotation_hints(const std::string& sidebar_field) const; |     void render_sidebar_rotation_hints(const std::string& sidebar_field) const; | ||||||
|     void render_sidebar_scale_hints(const std::string& sidebar_field) const; |     void render_sidebar_scale_hints(const std::string& sidebar_field) const; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if !ENABLE_GCODE_VIEWER | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     void render_sidebar_size_hints(const std::string& sidebar_field) const; |     void render_sidebar_size_hints(const std::string& sidebar_field) const; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // !ENABLE_GCODE_VIEWER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     void render_sidebar_layers_hints(const std::string& sidebar_field) const; |     void render_sidebar_layers_hints(const std::string& sidebar_field) const; | ||||||
| #if !ENABLE_GCODE_VIEWER | #if !ENABLE_GCODE_VIEWER | ||||||
|     void render_sidebar_position_hint(Axis axis) const; |     void render_sidebar_position_hint(Axis axis) const; | ||||||
| #endif // !ENABLE_GCODE_VIEWER
 | #endif // !ENABLE_GCODE_VIEWER
 | ||||||
|     void render_sidebar_rotation_hint(Axis axis) const; |     void render_sidebar_rotation_hint(Axis axis) const; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #if ENABLE_SHADERS_MANAGER | ||||||
|  |     void render_sidebar_scale_hint(Axis axis, GLShaderProgram& shader) const; | ||||||
|  | #else | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|     void render_sidebar_scale_hint(Axis axis) const; |     void render_sidebar_scale_hint(Axis axis) const; | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
|  | #endif // ENABLE_SHADERS_MANAGER
 | ||||||
|  | //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 | ||||||
| #if !ENABLE_GCODE_VIEWER | #if !ENABLE_GCODE_VIEWER | ||||||
|     void render_sidebar_size_hint(Axis axis, double length) const; |     void render_sidebar_size_hint(Axis axis, double length) const; | ||||||
| #endif // !ENABLE_GCODE_VIEWER
 | #endif // !ENABLE_GCODE_VIEWER
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri