mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Movements and rotations by keyboard indipendent from gizmos:
Left arrow = Decrease X by 1mm Right arrow = Increase X by 1mm Up arrow = Decrease Y by 1mm Down arrow = Increase Y by 1mm PgUp = Rotate 45 degrees CCW PgDown = Rotate 45 degrees CW
This commit is contained in:
parent
648060f4ec
commit
87daba9288
2 changed files with 76 additions and 95 deletions
|
@ -776,56 +776,6 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
|||
processed = true;
|
||||
}
|
||||
}
|
||||
else if (m_current == Move)
|
||||
{
|
||||
switch (keyCode)
|
||||
{
|
||||
case WXK_NUMPAD_LEFT: case WXK_LEFT:
|
||||
case WXK_NUMPAD_RIGHT: case WXK_RIGHT:
|
||||
case WXK_NUMPAD_UP: case WXK_UP:
|
||||
case WXK_NUMPAD_DOWN: case WXK_DOWN:
|
||||
{
|
||||
m_parent.do_move(L("Gizmo-Move"));
|
||||
stop_dragging();
|
||||
update_data();
|
||||
|
||||
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.
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
|
||||
// updates camera target constraints
|
||||
m_parent.refresh_camera_scene_box();
|
||||
processed = true;
|
||||
|
||||
break;
|
||||
}
|
||||
default: { break; }
|
||||
}
|
||||
}
|
||||
else if (m_current == Rotate)
|
||||
{
|
||||
switch (keyCode)
|
||||
{
|
||||
case WXK_NUMPAD_LEFT: case WXK_LEFT:
|
||||
case WXK_NUMPAD_RIGHT: case WXK_RIGHT:
|
||||
{
|
||||
m_parent.do_rotate(L("Gizmo-Rotate"));
|
||||
stop_dragging();
|
||||
update_data();
|
||||
|
||||
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.
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
|
||||
// updates camera target constraints
|
||||
m_parent.refresh_camera_scene_box();
|
||||
processed = true;
|
||||
|
||||
break;
|
||||
}
|
||||
default: { break; }
|
||||
}
|
||||
}
|
||||
|
||||
// if (processed)
|
||||
// m_parent.set_cursor(GLCanvas3D::Standard);
|
||||
|
@ -838,44 +788,6 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
|||
// m_parent.set_cursor(GLCanvas3D::Cross);
|
||||
processed = true;
|
||||
}
|
||||
else if (m_current == Move)
|
||||
{
|
||||
auto do_move = [this, &processed](const Vec3d& displacement) {
|
||||
Selection& selection = m_parent.get_selection();
|
||||
selection.start_dragging();
|
||||
start_dragging();
|
||||
selection.translate(displacement);
|
||||
// wxGetApp().obj_manipul()->set_dirty();
|
||||
processed = true;
|
||||
};
|
||||
|
||||
switch (keyCode)
|
||||
{
|
||||
case WXK_NUMPAD_LEFT: case WXK_LEFT: { do_move(-Vec3d::UnitX()); break; }
|
||||
case WXK_NUMPAD_RIGHT: case WXK_RIGHT: { do_move(Vec3d::UnitX()); break; }
|
||||
case WXK_NUMPAD_UP: case WXK_UP: { do_move(Vec3d::UnitY()); break; }
|
||||
case WXK_NUMPAD_DOWN: case WXK_DOWN: { do_move(-Vec3d::UnitY()); break; }
|
||||
default: { break; }
|
||||
}
|
||||
}
|
||||
else if (m_current == Rotate)
|
||||
{
|
||||
auto do_rotate = [this, &processed](double angle_z_rad) {
|
||||
Selection& selection = m_parent.get_selection();
|
||||
selection.start_dragging();
|
||||
start_dragging();
|
||||
selection.rotate(Vec3d(0.0, 0.0, angle_z_rad), TransformationType(TransformationType::World_Relative_Joint));
|
||||
// wxGetApp().obj_manipul()->set_dirty();
|
||||
processed = true;
|
||||
};
|
||||
|
||||
switch (keyCode)
|
||||
{
|
||||
case WXK_NUMPAD_LEFT: case WXK_LEFT: { do_rotate(0.25 * M_PI); break; }
|
||||
case WXK_NUMPAD_RIGHT: case WXK_RIGHT: { do_rotate(-0.25 * M_PI); break; }
|
||||
default: { break; }
|
||||
}
|
||||
}
|
||||
else if (m_current == Cut)
|
||||
{
|
||||
auto do_move = [this, &processed](double delta_z) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue