FIX:ban wipe_tower rotate by page up key

jira: STUDIO-7504
Change-Id: Icffaad78ed5750085da3d42d6f4209bd0d7a21e8
(cherry picked from commit efc768113d42f5278baa72171072f64411256594)
This commit is contained in:
zhou.xu 2024-07-01 14:25:55 +08:00 committed by Lane.Wei
parent ed81888b6c
commit bd9d5efff9
3 changed files with 24 additions and 12 deletions

View File

@ -3532,18 +3532,19 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
case WXK_NUMPAD_PAGEUP: case WXK_PAGEUP: case WXK_NUMPAD_PAGEUP: case WXK_PAGEUP:
case WXK_NUMPAD_PAGEDOWN: case WXK_PAGEDOWN: case WXK_NUMPAD_PAGEDOWN: case WXK_PAGEDOWN:
{ {
do_rotate(L("Tool Rotate")); if (m_gizmos.get_gizmo_active_condition(GLGizmosManager::EType::Rotate)) {
m_gizmos.update_data(); do_rotate(L("Tool Rotate"));
m_gizmos.update_data();
// BBS
//wxGetApp().obj_manipul()->set_dirty();
// Let the plater know that the dragging finished, so a delayed refresh
// of the scene with the background processing data should be performed.
post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
// updates camera target constraints
refresh_camera_scene_box();
m_dirty = true;
// BBS
// wxGetApp().obj_manipul()->set_dirty();
// Let the plater know that the dragging finished, so a delayed refresh
// of the scene with the background processing data should be performed.
post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
// updates camera target constraints
refresh_camera_scene_box();
m_dirty = true;
}
break; break;
} }
default: { break; } default: { break; }
@ -3609,6 +3610,9 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR)); post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR));
} else if (m_gizmos.is_enabled() && !m_selection.is_empty() && m_canvas_type != CanvasAssembleView) { } else if (m_gizmos.is_enabled() && !m_selection.is_empty() && m_canvas_type != CanvasAssembleView) {
auto _do_rotate = [this](double angle_z_rad) { auto _do_rotate = [this](double angle_z_rad) {
if (!m_gizmos.get_gizmo_active_condition(GLGizmosManager::EType::Rotate)) {
return;
}
m_selection.start_dragging(); m_selection.start_dragging();
m_selection.rotate(Vec3d(0.0, 0.0, angle_z_rad), TransformationType(TransformationType::World_Relative_Joint)); m_selection.rotate(Vec3d(0.0, 0.0, angle_z_rad), TransformationType(TransformationType::World_Relative_Joint));
m_selection.stop_dragging(); m_selection.stop_dragging();

View File

@ -684,6 +684,13 @@ bool GLGizmosManager::is_show_only_active_plate()
return false; return false;
} }
bool GLGizmosManager::get_gizmo_active_condition(GLGizmosManager::EType type) {
if (auto cur_gizmo = get_gizmo(type)) {
return cur_gizmo->is_activable();
}
return false;
}
void GLGizmosManager::check_object_located_outside_plate() { void GLGizmosManager::check_object_located_outside_plate() {
PartPlateList &plate_list = wxGetApp().plater()->get_partplate_list(); PartPlateList &plate_list = wxGetApp().plater()->get_partplate_list();
auto curr_plate_index = plate_list.get_curr_plate_index(); auto curr_plate_index = plate_list.get_curr_plate_index();
@ -1065,7 +1072,7 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
&& (m_current == SlaSupports || m_current == Hollow || m_current == FdmSupports || m_current == Seam || m_current == MmuSegmentation)) && (m_current == SlaSupports || m_current == Hollow || m_current == FdmSupports || m_current == Seam || m_current == MmuSegmentation))
// don't allow dragging objects with the Sla gizmo on // don't allow dragging objects with the Sla gizmo on
processed = true; processed = true;
else if (evt.Dragging() && !control_down else if (evt.Dragging() && !control_down
&& (m_current == SlaSupports || m_current == Hollow || m_current == FdmSupports || m_current == Seam || m_current == MmuSegmentation || m_current == Cut) && (m_current == SlaSupports || m_current == Hollow || m_current == FdmSupports || m_current == Seam || m_current == MmuSegmentation || m_current == Cut)
&& gizmo_event(SLAGizmoEventType::Dragging, mouse_pos, evt.ShiftDown(), evt.AltDown())) { && gizmo_event(SLAGizmoEventType::Dragging, mouse_pos, evt.ShiftDown(), evt.AltDown())) {
// the gizmo got the event and took some action, no need to do anything more here // the gizmo got the event and took some action, no need to do anything more here

View File

@ -287,6 +287,7 @@ public:
bool is_gizmo_activable_when_single_full_instance(); bool is_gizmo_activable_when_single_full_instance();
bool is_gizmo_click_empty_not_exit(); bool is_gizmo_click_empty_not_exit();
bool is_show_only_active_plate(); bool is_show_only_active_plate();
bool get_gizmo_active_condition(GLGizmosManager::EType type);
void check_object_located_outside_plate(); void check_object_located_outside_plate();
bool get_object_located_outside_plate() { return m_object_located_outside_plate; } bool get_object_located_outside_plate() { return m_object_located_outside_plate; }
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position = Vec2d::Zero(), bool shift_down = false, bool alt_down = false, bool control_down = false); bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position = Vec2d::Zero(), bool shift_down = false, bool alt_down = false, bool control_down = false);