Skip to content

Commit

Permalink
Fix: Add shortcut to rotate camera by 90degrees #14 (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
dk1242 authored Sep 27, 2024
1 parent df8c01a commit 095349c
Show file tree
Hide file tree
Showing 18 changed files with 423 additions and 20 deletions.
2 changes: 2 additions & 0 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ f3d_test(NAME TestInteractionCameraHotkeys DATA cow.vtp INTERACTION)
f3d_test(NAME TestInteractionZoomToMouse DATA cow.vtp INTERACTION)
f3d_test(NAME TestInteractionOrthographicProjection DATA cow.vtp INTERACTION) #5;5
f3d_test(NAME TestInteractionZoomToggleOrthographicProjection DATA cow.vtp INTERACTION) #MouseWheel;5;Mousewheelx6;5
f3d_test(NAME TestInteractionRotateCameraMinus90 DATA f3d.glb INTERACTION)
f3d_test(NAME TestInteractionRotateCamera90 DATA f3d.glb INTERACTION)

# Progress test
f3d_test(NAME TestProgress DATA cow.vtp ARGS --progress NO_BASELINE)
Expand Down
2 changes: 2 additions & 0 deletions doc/user/INTERACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Note that some hotkeys can be available or not depending on the file being loade
Camera Hotkeys:
* <kbd>1</kbd>: front view camera.
* <kbd>3</kbd>: right view camera.
* <kbd>4</kbd>: roll the camera left by 90 degrees.
* <kbd>5</kbd>: toggle orthographic projection.
* <kbd>6</kbd>: roll the camera right by 90 degrees.
* <kbd>7</kbd>: top view camera.
* <kbd>9</kbd>: isometric view camera.
* <kbd>Enter</kbd>: reset the camera to its initial parameters.
Expand Down
8 changes: 8 additions & 0 deletions library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,18 @@ class interactor_impl::internals
self->SetViewOrbit(ViewType::VT_RIGHT, self);
render = true;
break;
case '4':
self->Window.getCamera().roll(-90);
render = true;
break;
case '5':
self->Options.scene.camera.orthographic = !self->Options.scene.camera.orthographic;
render = true;
break;
case '6':
self->Window.getCamera().roll(90);
render = true;
break;
case '7':
self->SetViewOrbit(ViewType::VT_TOP, self);
render = true;
Expand Down
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionCheatsheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionCheatsheetBlackBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionCheatsheetRaytracing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionCheatsheetScalars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionCheatsheetWhiteBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestInteractionNoFileCheatsheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing/baselines/TestInteractionRotateCamera90.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing/baselines/TestInteractionRotateCameraMinus90.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 133 additions & 0 deletions testing/recordings/TestInteractionRotateCamera90.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# StreamVersion 1.2
ExposeEvent 0 599 0 0 0 0 0
RenderEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
ExposeEvent 0 599 0 0 0 0 0
RenderEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
KeyPressEvent 1051 -293 0 54 1 6 0
CharEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
KeyReleaseEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
TimerEvent 1051 -293 0 54 1 6 0
Loading

0 comments on commit 095349c

Please sign in to comment.