Skip to content

Commit

Permalink
removed excessive method & added test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfedcafe committed Dec 26, 2024
1 parent 934aa84 commit 8e04afe
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 11 deletions.
1 change: 1 addition & 0 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ f3d_test(NAME TestInteractionConsoleOpenWarningClick DATA f3d.glb ARGS --positio
f3d_test(NAME TestInteractionConsoleToggleGrid DATA f3d.glb INTERACTION UI) #Escape;toggle render.grid.enable;Return;Escape
f3d_test(NAME TestInteractionConsoleInvalidCommand DATA f3d.glb INTERACTION UI) #Escape;foo;Return
f3d_test(NAME TestInteractionConsoleInvalidOption DATA f3d.glb INTERACTION UI) #Escape;toggle foo;Return
f3d_test(NAME TestInteractionConsoleClear DATA dragon.vtu INTERACTION UI) #Escape;clear;Return
f3d_test(NAME TestInteractionConsoleTypingSceneInfo DATA f3d.glb INTERACTION UI) #Escape;e;Escape;printt;BackSpace;_scee;Left;Right;_info;Return

if (F3D_MODULE_TINYFILEDIALOGS)
Expand Down
2 changes: 2 additions & 0 deletions doc/user/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The libf3d provides a few commands, many related to manipulating libf3d (options

`reset option.name`: A command to reset a libf3d option to its default values, eg: `reset render.background.blur.coc`.

`clear`: A command to clear ImGui console. No argmument.

Check failure on line 22 in doc/user/COMMANDS.md

View workflow job for this annotation

GitHub Actions / Codespell Check

argmument ==> argument

`print option.name`: A command to print the value of an libf3d option, eg: `print scene.up.direction`.

`cycle_animation`: A specific command to cycle `scene.animation.index` option using model information, No argument.
Expand Down
3 changes: 3 additions & 0 deletions testing/baselines/TestInteractionConsoleClear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions testing/recordings/TestInteractionConsoleClear.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# StreamVersion 1.2
RenderEvent 0 0 0 0 0 0 0

KeyPressEvent 0 0 0 27 1 Escape 0
CharEvent 0 0 0 27 1 Escape 0
KeyReleaseEvent 0 0 0 27 1 Escape 0

KeyPressEvent 0 0 0 101 1 e 0
CharEvent 0 0 0 101 1 e 0
KeyReleaseEvent 0 0 0 101 1 e 0

KeyPressEvent 0 0 0 27 1 Escape 0
CharEvent 0 0 0 27 1 Escape 0
KeyReleaseEvent 0 0 0 27 1 Escape 0

KeyPressEvent 0 0 0 112 1 p 0
CharEvent 0 0 0 112 1 p 0
KeyReleaseEvent 0 0 0 112 1 p 0

KeyPressEvent 0 0 0 114 1 r 0
CharEvent 0 0 0 114 1 r 0
KeyReleaseEvent 0 0 0 114 1 r 0

KeyPressEvent 0 0 0 105 1 i 0
CharEvent 0 0 0 105 1 i 0
KeyReleaseEvent 0 0 0 105 1 i 0

KeyPressEvent 0 0 0 110 1 n 0
CharEvent 0 0 0 110 1 n 0
KeyReleaseEvent 0 0 0 110 1 n 0

KeyPressEvent 0 0 0 116 1 t 0
CharEvent 0 0 0 116 1 t 0
KeyReleaseEvent 0 0 0 116 1 t 0

KeyPressEvent 0 0 0 116 1 t 0
CharEvent 0 0 0 116 1 t 0
KeyReleaseEvent 0 0 0 116 1 t 0

KeyPressEvent 0 0 0 8 1 BackSpace 0
CharEvent 0 0 0 8 1 BackSpace 0
KeyReleaseEvent 0 0 0 8 1 BackSpace 0

KeyPressEvent 0 0 1 0 1 Shift_L 0
KeyPressEvent 0 0 1 95 1 underscore 0
CharEvent 0 0 1 95 1 underscore 0
KeyReleaseEvent 0 0 1 95 1 underscore 0
KeyReleaseEvent 0 0 0 0 1 Shift_L 0

KeyPressEvent 0 0 0 115 1 s 0
CharEvent 0 0 0 115 1 s 0
KeyReleaseEvent 0 0 0 115 1 s 0

KeyPressEvent 0 0 0 99 1 c 0
CharEvent 0 0 0 99 1 c 0
KeyReleaseEvent 0 0 0 99 1 c 0

KeyPressEvent 0 0 0 101 1 e 0
CharEvent 0 0 0 101 1 e 0
KeyReleaseEvent 0 0 0 101 1 e 0

KeyPressEvent 0 0 0 101 1 e 0
CharEvent 0 0 0 101 1 e 0
KeyReleaseEvent 0 0 0 101 1 e 0

KeyPressEvent 0 0 0 0 1 Left 0
KeyReleaseEvent 0 0 0 0 1 Left 0

KeyPressEvent 0 0 0 110 1 n 0
CharEvent 0 0 0 110 1 n 0
KeyReleaseEvent 0 0 0 110 1 n 0

KeyPressEvent 0 0 0 0 1 Right 0
KeyReleaseEvent 0 0 0 0 1 Right 0

KeyPressEvent 0 0 1 0 1 Shift_L 0
KeyPressEvent 0 0 1 95 1 underscore 0
CharEvent 0 0 1 95 1 underscore 0
KeyReleaseEvent 0 0 1 95 1 underscore 0
KeyReleaseEvent 0 0 0 0 1 Shift_L 0

KeyPressEvent 0 0 0 105 1 i 0
CharEvent 0 0 0 105 1 i 0
KeyReleaseEvent 0 0 0 105 1 i 0

KeyPressEvent 0 0 0 110 1 n 0
CharEvent 0 0 0 110 1 n 0
KeyReleaseEvent 0 0 0 110 1 n 0

KeyPressEvent 0 0 0 102 1 f 0
CharEvent 0 0 0 102 1 f 0
KeyReleaseEvent 0 0 0 102 1 f 0

KeyPressEvent 0 0 0 111 1 o 0
CharEvent 0 0 0 111 1 o 0
KeyReleaseEvent 0 0 0 111 1 o 0

KeyPressEvent 0 0 0 13 1 Return 0
CharEvent 0 0 0 13 1 Return 0
KeyReleaseEvent 0 0 0 13 1 Return 0

KeyPressEvent 0 0 0 99 1 c 0
CharEvent 0 0 0 99 1 c 0
KeyReleaseEvent 0 0 0 99 1 c 0


KeyPressEvent 0 0 0 108 1 l 0
CharEvent 0 0 0 108 1 l 0
KeyReleaseEvent 0 0 0 108 1 l 0


KeyPressEvent 0 0 0 101 1 e 0
CharEvent 0 0 0 101 1 e 0
KeyReleaseEvent 0 0 0 101 1 e 0


KeyPressEvent 0 0 0 97 1 a 0
CharEvent 0 0 0 97 1 a 0
KeyReleaseEvent 0 0 0 97 1 a 0


KeyPressEvent 0 0 0 114 1 r 0
CharEvent 0 0 0 114 1 r 0
KeyReleaseEvent 0 0 0 114 1 r 0


KeyPressEvent 0 0 0 13 1 Return 0
CharEvent 0 0 0 13 1 Return 0
KeyReleaseEvent 0 0 0 13 1 Return 0
6 changes: 0 additions & 6 deletions vtkext/private/module/vtkF3DImguiConsole.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,3 @@ void vtkF3DImguiConsole::Clear()
this->Pimpl->NewError = false;
this->Pimpl->NewWarning = false;
}

//----------------------------------------------------------------------------
size_t vtkF3DImguiConsole::GetLogsSize()
{
return this->Pimpl->Logs.size();
}
5 changes: 0 additions & 5 deletions vtkext/private/module/vtkF3DImguiConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ class vtkF3DImguiConsole : public vtkF3DConsoleOutputWindow
*/
void Clear();

/**
* Get console history size
*/
size_t GetLogsSize();

protected:
vtkF3DImguiConsole();
~vtkF3DImguiConsole() override;
Expand Down

0 comments on commit 8e04afe

Please sign in to comment.