Sphere brush color in MMU painting gizmo is now the same as color used for painting.
This commit is contained in:
parent
033d9f3a5e
commit
660acede9e
@ -299,7 +299,7 @@ void GLGizmoMmuSegmentation::set_painter_gizmo_data(const Selection &selection)
|
|||||||
if (m_state != On)
|
if (m_state != On)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int prev_extruders_count = m_original_extruders_colors.size();
|
int prev_extruders_count = int(m_original_extruders_colors.size());
|
||||||
if (prev_extruders_count != wxGetApp().extruders_edited_cnt() || get_extruders_colors() != m_original_extruders_colors) {
|
if (prev_extruders_count != wxGetApp().extruders_edited_cnt() || get_extruders_colors() != m_original_extruders_colors) {
|
||||||
this->init_extruders_data();
|
this->init_extruders_data();
|
||||||
// Reinitialize triangle selectors because of change of extruder count need also change the size of GLIndexedVertexArray
|
// Reinitialize triangle selectors because of change of extruder count need also change the size of GLIndexedVertexArray
|
||||||
@ -594,6 +594,18 @@ PainterGizmoType GLGizmoMmuSegmentation::get_painter_type() const
|
|||||||
return PainterGizmoType::MMU_SEGMENTATION;
|
return PainterGizmoType::MMU_SEGMENTATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::array<float, 4> GLGizmoMmuSegmentation::get_cursor_sphere_left_button_color() const
|
||||||
|
{
|
||||||
|
const std::array<uint8_t, 3> &color = m_modified_extruders_colors[m_first_selected_extruder_idx];
|
||||||
|
return {float(color[0]) / 255.0f, float(color[1]) / 255.0f, float(color[2]) / 255.0f, 0.25f};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::array<float, 4> GLGizmoMmuSegmentation::get_cursor_sphere_right_button_color() const
|
||||||
|
{
|
||||||
|
const std::array<uint8_t, 3> &color = m_modified_extruders_colors[m_second_selected_extruder_idx];
|
||||||
|
return {float(color[0]) / 255.0f, float(color[1]) / 255.0f, float(color[2]) / 255.0f, 0.25f};
|
||||||
|
}
|
||||||
|
|
||||||
void TriangleSelectorMmuGui::render(ImGuiWrapper *imgui)
|
void TriangleSelectorMmuGui::render(ImGuiWrapper *imgui)
|
||||||
{
|
{
|
||||||
std::vector<int> color_cnt(m_iva_colors.size());
|
std::vector<int> color_cnt(m_iva_colors.size());
|
||||||
|
@ -31,9 +31,12 @@ public:
|
|||||||
|
|
||||||
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down) override;
|
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down) override;
|
||||||
|
|
||||||
virtual void set_painter_gizmo_data(const Selection& selection) override;
|
void set_painter_gizmo_data(const Selection& selection) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
std::array<float, 4> get_cursor_sphere_left_button_color() const override;
|
||||||
|
std::array<float, 4> get_cursor_sphere_right_button_color() const override;
|
||||||
|
|
||||||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||||
std::string on_get_name() const override;
|
std::string on_get_name() const override;
|
||||||
|
|
||||||
|
@ -251,12 +251,12 @@ void GLGizmoPainterBase::render_cursor_sphere(const Transform3d& trafo) const
|
|||||||
if (is_left_handed)
|
if (is_left_handed)
|
||||||
glFrontFace(GL_CW);
|
glFrontFace(GL_CW);
|
||||||
|
|
||||||
float render_color[4] = { 0.f, 0.f, 0.f, 0.25f };
|
std::array<float, 4> render_color = {0.f, 0.f, 0.f, 0.25f};
|
||||||
if (m_button_down == Button::Left)
|
if (m_button_down == Button::Left)
|
||||||
render_color[2] = 1.f;
|
render_color = this->get_cursor_sphere_left_button_color();
|
||||||
else if (m_button_down == Button::Right)
|
else if (m_button_down == Button::Right)
|
||||||
render_color[0] = 1.f;
|
render_color = this->get_cursor_sphere_right_button_color();
|
||||||
glsafe(::glColor4fv(render_color));
|
glsafe(::glColor4fv(render_color.data()));
|
||||||
|
|
||||||
m_vbo_sphere.render();
|
m_vbo_sphere.render();
|
||||||
|
|
||||||
|
@ -87,6 +87,9 @@ protected:
|
|||||||
void activate_internal_undo_redo_stack(bool activate);
|
void activate_internal_undo_redo_stack(bool activate);
|
||||||
void set_cursor_type(TriangleSelector::CursorType);
|
void set_cursor_type(TriangleSelector::CursorType);
|
||||||
|
|
||||||
|
virtual std::array<float, 4> get_cursor_sphere_left_button_color() const { return {0.f, 0.f, 1.f, 0.25f}; }
|
||||||
|
virtual std::array<float, 4> get_cursor_sphere_right_button_color() const { return {1.f, 0.f, 0.f, 0.25f}; }
|
||||||
|
|
||||||
float m_cursor_radius = 2.f;
|
float m_cursor_radius = 2.f;
|
||||||
static constexpr float CursorRadiusMin = 0.4f; // cannot be zero
|
static constexpr float CursorRadiusMin = 0.4f; // cannot be zero
|
||||||
static constexpr float CursorRadiusMax = 8.f;
|
static constexpr float CursorRadiusMax = 8.f;
|
||||||
|
Loading…
Reference in New Issue
Block a user