mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-11 14:39:06 +08:00
New selection -> Improved sychronization of instances selection between 3D scene and right panel
This commit is contained in:
parent
cc5405e84d
commit
5d94e6adb8
@ -3997,6 +3997,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
m_gizmos.update_on_off_state(m_selection);
|
m_gizmos.update_on_off_state(m_selection);
|
||||||
update_gizmos_data();
|
update_gizmos_data();
|
||||||
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
||||||
|
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -4021,16 +4022,10 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// propagate event through callback
|
// propagate event through callback
|
||||||
#if ENABLE_EXTENDED_SELECTION
|
#if !ENABLE_EXTENDED_SELECTION
|
||||||
if (m_picking_enabled && (m_hover_volume_id != -1))
|
|
||||||
{
|
|
||||||
int object_idx = m_selection.get_object_idx();
|
|
||||||
_on_select(m_hover_volume_id, object_idx);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (m_picking_enabled && (volume_idx != -1))
|
if (m_picking_enabled && (volume_idx != -1))
|
||||||
_on_select(volume_idx, selected_object_idx);
|
_on_select(volume_idx, selected_object_idx);
|
||||||
#endif // ENABLE_EXTENDED_SELECTION
|
#endif // !ENABLE_EXTENDED_SELECTION
|
||||||
|
|
||||||
#if ENABLE_EXTENDED_SELECTION
|
#if ENABLE_EXTENDED_SELECTION
|
||||||
if (m_hover_volume_id != -1)
|
if (m_hover_volume_id != -1)
|
||||||
@ -4357,10 +4352,11 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
#if ENABLE_EXTENDED_SELECTION
|
#if ENABLE_EXTENDED_SELECTION
|
||||||
m_selection.clear();
|
m_selection.clear();
|
||||||
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
||||||
|
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
|
||||||
#else
|
#else
|
||||||
deselect_volumes();
|
deselect_volumes();
|
||||||
#endif // ENABLE_EXTENDED_SELECTION
|
|
||||||
_on_select(-1, -1);
|
_on_select(-1, -1);
|
||||||
|
#endif // ENABLE_EXTENDED_SELECTION
|
||||||
update_gizmos_data();
|
update_gizmos_data();
|
||||||
}
|
}
|
||||||
#if ENABLE_GIZMOS_RESET
|
#if ENABLE_GIZMOS_RESET
|
||||||
@ -6645,6 +6641,7 @@ void GLCanvas3D::_on_move(const std::vector<int>& volume_idxs)
|
|||||||
}
|
}
|
||||||
#endif // ENABLE_EXTENDED_SELECTION
|
#endif // ENABLE_EXTENDED_SELECTION
|
||||||
|
|
||||||
|
#if !ENABLE_EXTENDED_SELECTION
|
||||||
void GLCanvas3D::_on_select(int volume_idx, int object_idx)
|
void GLCanvas3D::_on_select(int volume_idx, int object_idx)
|
||||||
{
|
{
|
||||||
#if ENABLE_EXTENDED_SELECTION
|
#if ENABLE_EXTENDED_SELECTION
|
||||||
@ -6680,6 +6677,7 @@ void GLCanvas3D::_on_select(int volume_idx, int object_idx)
|
|||||||
wxGetApp().obj_list()->select_current_volume(obj_id, vol_id);
|
wxGetApp().obj_list()->select_current_volume(obj_id, vol_id);
|
||||||
#endif // !ENABLE_EXTENDED_SELECTION
|
#endif // !ENABLE_EXTENDED_SELECTION
|
||||||
}
|
}
|
||||||
|
#endif // !ENABLE_EXTENDED_SELECTION
|
||||||
|
|
||||||
std::vector<float> GLCanvas3D::_parse_colors(const std::vector<std::string>& colors)
|
std::vector<float> GLCanvas3D::_parse_colors(const std::vector<std::string>& colors)
|
||||||
{
|
{
|
||||||
|
@ -970,7 +970,9 @@ private:
|
|||||||
#else
|
#else
|
||||||
void _on_move(const std::vector<int>& volume_idxs);
|
void _on_move(const std::vector<int>& volume_idxs);
|
||||||
#endif // ENABLE_EXTENDED_SELECTION
|
#endif // ENABLE_EXTENDED_SELECTION
|
||||||
|
#if !ENABLE_EXTENDED_SELECTION
|
||||||
void _on_select(int volume_idx, int object_idx);
|
void _on_select(int volume_idx, int object_idx);
|
||||||
|
#endif // !ENABLE_EXTENDED_SELECTION
|
||||||
|
|
||||||
// generates the legend texture in dependence of the current shown view type
|
// generates the legend texture in dependence of the current shown view type
|
||||||
void _generate_legend_texture(const GCodePreviewData& preview_data, const std::vector<float>& tool_colors);
|
void _generate_legend_texture(const GCodePreviewData& preview_data, const std::vector<float>& tool_colors);
|
||||||
|
@ -1054,7 +1054,11 @@ void ObjectList::part_selection_changed()
|
|||||||
|
|
||||||
m_selected_object_id = obj_idx;
|
m_selected_object_id = obj_idx;
|
||||||
|
|
||||||
|
#if ENABLE_EXTENDED_SELECTION
|
||||||
|
wxGetApp().obj_manipul()->update_settings_value(_3DScene::get_canvas(wxGetApp().canvas3D())->get_selection());
|
||||||
|
#else
|
||||||
wxGetApp().obj_manipul()->update_values();
|
wxGetApp().obj_manipul()->update_values();
|
||||||
|
#endif // ENABLE_EXTENDED_SELECTION
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::update_manipulation_sizer(const bool is_simple_mode)
|
void ObjectList::update_manipulation_sizer(const bool is_simple_mode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user