3DScene update_volumes_colors_by_extruder method moved to c++

This commit is contained in:
Enrico Turri 2018-05-29 15:07:06 +02:00
parent 5ee5465f94
commit df14a3c399
11 changed files with 64 additions and 22 deletions

View file

@ -2105,6 +2105,11 @@ void _3DScene::select_view(wxGLCanvas* canvas, const std::string& direction)
s_canvas_mgr.select_view(canvas, direction);
}
void _3DScene::update_volumes_colors_by_extruder(wxGLCanvas* canvas)
{
s_canvas_mgr.update_volumes_colors_by_extruder(canvas);
}
bool _3DScene::start_using_shader(wxGLCanvas* canvas)
{
return s_canvas_mgr.start_using_shader(canvas);

View file

@ -644,14 +644,14 @@ public:
static void zoom_to_bed(wxGLCanvas* canvas);
static void zoom_to_volumes(wxGLCanvas* canvas);
static void select_view(wxGLCanvas* canvas, const std::string& direction);
static void update_volumes_colors_by_extruder(wxGLCanvas* canvas);
static bool start_using_shader(wxGLCanvas* canvas);
static void stop_using_shader(wxGLCanvas* canvas);
static void render(wxGLCanvas* canvas);
static void render_volumes(wxGLCanvas* canvas, bool fake_colors);
static void render_texture(wxGLCanvas* canvas, unsigned int tex_id, float left, float right, float bottom, float top);
static void register_on_viewport_changed_callback(wxGLCanvas* canvas, void* callback);

View file

@ -1520,6 +1520,14 @@ void GLCanvas3D::select_view(const std::string& direction)
}
}
void GLCanvas3D::update_volumes_colors_by_extruder()
{
if ((m_volumes == nullptr) || (m_config == nullptr))
return;
m_volumes->update_colors_by_extruder(m_config);
}
bool GLCanvas3D::start_using_shader() const
{
return m_shader.start_using();

View file

@ -428,13 +428,13 @@ public:
void zoom_to_volumes();
void select_view(const std::string& direction);
void update_volumes_colors_by_extruder();
bool start_using_shader() const;
void stop_using_shader() const;
void render(bool useVBOs) const;
void render_volumes(bool fake_colors) const;
void render_texture(unsigned int tex_id, float left, float right, float bottom, float top) const;
void register_on_viewport_changed_callback(void* callback);

View file

@ -597,6 +597,13 @@ void GLCanvas3DManager::select_view(wxGLCanvas* canvas, const std::string& direc
it->second->select_view(direction);
}
void GLCanvas3DManager::update_volumes_colors_by_extruder(wxGLCanvas* canvas)
{
CanvasesMap::const_iterator it = _get_canvas(canvas);
if (it != m_canvases.end())
it->second->update_volumes_colors_by_extruder();
}
bool GLCanvas3DManager::start_using_shader(wxGLCanvas* canvas) const
{
CanvasesMap::const_iterator it = _get_canvas(canvas);

View file

@ -145,13 +145,13 @@ public:
void zoom_to_volumes(wxGLCanvas* canvas);
void select_view(wxGLCanvas* canvas, const std::string& direction);
void update_volumes_colors_by_extruder(wxGLCanvas* canvas);
bool start_using_shader(wxGLCanvas* canvas) const;
void stop_using_shader(wxGLCanvas* canvas) const;
void render(wxGLCanvas* canvas) const;
void render_volumes(wxGLCanvas* canvas, bool fake_colors) const;
void render_texture(wxGLCanvas* canvas, unsigned int tex_id, float left, float right, float bottom, float top) const;
void register_on_viewport_changed_callback(wxGLCanvas* canvas, void* callback);

View file

@ -717,6 +717,12 @@ select_view(canvas, direction)
CODE:
_3DScene::select_view((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), direction);
void
update_volumes_colors_by_extruder(canvas)
SV *canvas;
CODE:
_3DScene::update_volumes_colors_by_extruder((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
bool
start_using_shader(canvas)
SV *canvas;