Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Dec 3, 2024
1 parent 7413b52 commit 5690bf7
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 56 deletions.
20 changes: 10 additions & 10 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ f3d_test(NAME TestVTU DATA dragon.vtu)
f3d_test(NAME TestVTP DATA cow.vtp)
f3d_test(NAME TestVTR DATA RectGrid2.vtr ARGS --scalar-coloring --roughness=1)
f3d_test(NAME TestVTS DATA bluntfin.vts)
f3d_test(NAME TestVTM DATA mb.vtm)
f3d_test(NAME TestVTM DATA mb.vtm UI) # UI OR verbose=error?
f3d_test(NAME TestVTK DATA cow.vtk)
f3d_test(NAME TestNRRD DATA beach.nrrd ARGS -s)
f3d_test(NAME TestSPLAT DATA small.splat ARGS -osy --up=-Y --point-sprites-size=1)
Expand Down Expand Up @@ -226,8 +226,8 @@ f3d_test(NAME TestComponentName DATA from_abq.vtu ARGS --scalar-coloring --bar -
f3d_test(NAME TestNoRender DATA dragon.vtu NO_RENDER)
f3d_test(NAME TestNoRenderWithOptions DATA dragon.vtu ARGS --hdri-ambient --axis NO_RENDER) # These options causes issues if not handled correctly
f3d_test(NAME TestNoFile NO_DATA_FORCE_RENDER)
f3d_test(NAME TestMultiFile DATA mb/recursive ARGS --multi-file-mode=all)
f3d_test(NAME TestMultiFileColoring DATA mb/recursive ARGS --multi-file-mode=all -s --coloring-array=Polynomial -b)
f3d_test(NAME TestMultiFile DATA mb/recursive ARGS --multi-file-mode=all UI) # UI OR verbose=error?
f3d_test(NAME TestMultiFileColoring DATA mb/recursive ARGS --multi-file-mode=all -s --coloring-array=Polynomial -b UI) # UI OR verbose=error?
f3d_test(NAME TestMultiFileVolume DATA multi ARGS --multi-file-mode=all -vsb --coloring-array=Scalars_)
f3d_test(NAME TestMultiFileColoringTexture DATA mb/recursive/mb_1_0.vtp mb/recursive/mb_2_0.vtp world.obj ARGS --multi-file-mode=all -sb --coloring-array=Normals --comp=1)
f3d_test(NAME TestMultiFilePositionals DATA mb/recursive/mb_0_0.vtu mb/recursive/mb_1_0.vtp ARGS --multi-file-mode=all -s --coloring-array=Polynomial -b)
Expand Down Expand Up @@ -462,7 +462,7 @@ if(VTK_VERSION VERSION_GREATER_EQUAL 9.2.20221220)
f3d_test(NAME TestInvalidHDRI DATA cow.vtp HDRI invalid.png REGEXP "Cannot open HDRI file" NO_BASELINE)

# Use a dummy HDRI for simplicity to test default HDRI
f3d_test(NAME TestHDRIDefault DATA suzanne.ply HDRI dummy.png THRESHOLD 0.11) # Threshold is needed for legacy comparison method for VTK 9.3
f3d_test(NAME TestHDRIDefault DATA suzanne.ply HDRI dummy.png THRESHOLD 0.11 UI) # UI OR verbose=error? # Threshold is needed for legacy comparison method for VTK 9.3

configure_file("${F3D_SOURCE_DIR}/testing/configs/hdri.json.in" "${CMAKE_BINARY_DIR}/hdri.json")
f3d_test(NAME TestConfigFileHDRI DATA dragon.vtu CONFIG "${CMAKE_BINARY_DIR}/hdri.json" LONG_TIMEOUT)
Expand Down Expand Up @@ -766,18 +766,18 @@ f3d_test(NAME TestInteractionVolumeAfterColoring DATA waveletArrays.vti ARGS INT
f3d_test(NAME TestInteractionVolumeInverse DATA HeadMRVolume.mhd ARGS --camera-position=127.5,-400,127.5 --camera-view-up=0,0,1 INTERACTION) #VI
f3d_test(NAME TestInteractionMultiFileVolume DATA multi ARGS --multi-file-mode=all INTERACTION) #SSVB
f3d_test(NAME TestInteractionPointCloud DATA pointsCloud.vtp ARGS --point-sprites-size=20 INTERACTION) #O
f3d_test(NAME TestInteractionDirectory DATA mb INTERACTION ARGS --scalar-coloring) #Right;Right;Right;Left;Up;
f3d_test(NAME TestInteractionDirectory DATA mb INTERACTION ARGS --scalar-coloring UI) # UI OR verbose=error? #Right;Right;Right;Left;Up;
f3d_test(NAME TestInteractionDirectoryLoop DATA mb/recursive INTERACTION ARGS --scalar-coloring --filename UI) #Left;Left;Left;Left;Left;
f3d_test(NAME TestInteractionDirectoryEmpty DATA mb INTERACTION NO_DATA_FORCE_RENDER) #Right;Right;Right;
f3d_test(NAME TestInteractionDirectoryEmpty DATA mb INTERACTION NO_DATA_FORCE_RENDER UI) # UI OR verbose=error? #Right;Right;Right;
f3d_test(NAME TestInteractionDirectoryEmptyVerbose DATA mb ARGS --verbose NO_BASELINE INTERACTION REGEXP "is not a file of a supported file format") #Right;Right;Right;HMCSY
f3d_test(NAME TestInteractionAnimationNotStopped DATA InterpolationTest.glb NO_BASELINE INTERACTION)#Space;
f3d_test(NAME TestInteractionResetCamera DATA dragon.vtu INTERACTION LONG_TIMEOUT)#MouseMovements;Return;
f3d_test(NAME TestInteractionResetCameraWithCameraIndex DATA CameraAnimated.glb ARGS --camera-index=0 INTERACTION)#MouseMovements;Return;
f3d_test(NAME TestInteractionTensorsCycleComp DATA tensors.vti ARGS --scalar-coloring --comp=-2 INTERACTION) #SYYYYYYYYYY
f3d_test(NAME TestInteractionTensorsCycleComp DATA tensors.vti ARGS --scalar-coloring --comp=-2 INTERACTION UI) # UI OR verbose=error? #SYYYYYYYYYY
f3d_test(NAME TestInteractionCycleScalarsCompCheck DATA dragon.vtu ARGS -b --scalar-coloring --comp=2 INTERACTION) #S
f3d_test(NAME TestInteractionConfigFileNoColorBar DATA multi CONFIG ${F3D_SOURCE_DIR}/testing/configs/complex.json INTERACTION) #Right;Right;Left
f3d_test(NAME TestInteractionConfigFileBindings DATA dragon.vtu CONFIG ${F3D_SOURCE_DIR}/testing/configs/bindings.json INTERACTION UI) #Ctrl+Shift+O;Ctrl+O;Shift+O;O;3
f3d_test(NAME TestInteractionConfigFileMulti DATA multi CONFIG ${F3D_SOURCE_DIR}/testing/configs/complex.json INTERACTION) #SY;Right;XG;Right;N;Right;Right
f3d_test(NAME TestInteractionConfigFileMulti DATA multi CONFIG ${F3D_SOURCE_DIR}/testing/configs/complex.json INTERACTION UI) # UI OR verbose=error? #SY;Right;XG;Right;N;Right;Right
f3d_test(NAME TestInteractionConfigFileAndCommand DATA multi ARGS -o CONFIG ${F3D_SOURCE_DIR}/testing/configs/complex.json INTERACTION UI) #OX;Right;N;Right;Right;Right
f3d_test(NAME TestInteractionDumpSceneState DATA dragon.vtu NO_BASELINE INTERACTION REGEXP "Camera position: 2.23745,3.83305,507.598")#?
f3d_test(NAME TestInteractionCycleVerbose DATA dragon.vtu ARGS --verbose -s NO_BASELINE INTERACTION REGEXP "Not coloring")#SSSSYC
Expand All @@ -787,7 +787,7 @@ f3d_test(NAME TestInteractionFocalPointPickingDefault DATA dragon.vtu INTERACTIO
f3d_test(NAME TestInteractionFocalPointPickingShift DATA dragon.vtu INTERACTION LONG_TIMEOUT)
f3d_test(NAME TestInteractionFocalPointPickingPoints DATA pointsCloud.vtp INTERACTION)
f3d_test(NAME TestInteractionLightIntensity DATA dragon.vtu INTERACTION LONG_TIMEOUT)
f3d_test(NAME TestInteractionMultiFileColoring DATA mb/recursive ARGS --multi-file-mode=all INTERACTION) #SSSB
f3d_test(NAME TestInteractionMultiFileColoring DATA mb/recursive ARGS --multi-file-mode=all INTERACTION UI) # UI OR verbose=error? #SSSB
f3d_test(NAME TestInteractionReload DATA dragon.vtu ARGS -e INTERACTION) #Up;
f3d_test(NAME TestInteractionLoadParentDirectory DATA multi/dragon.vtu ARGS --filename INTERACTION UI) #Down;
f3d_test(NAME TestInteractionEmptyLoadParentDirectory INTERACTION NO_BASELINE REGEXP "No files loaded, no rendering performed") #Down;
Expand All @@ -812,7 +812,7 @@ f3d_test(NAME TestInteractionCycleAnimationNoAnimation DATA cow.vtp INTERACTION

f3d_test(NAME TestInteractionDropFiles ARGS -n INTERACTION_CONFIGURE UI)#X;DropEvent cow.vtp;DropEvent dragon.vtu suzanne.stl;
f3d_test(NAME TestInteractionMultiFileDrop ARGS --multi-file-mode=all -e INTERACTION_CONFIGURE) #DropEvent mb_1_0.vtp mb_2_0.vtp
f3d_test(NAME TestInteractionDropSameFiles ARGS -x INTERACTION_CONFIGURE)#DropEvent cow.vtp;#DropEvent dragon.vtu;#DropEvent cow.vtp#DropEvent cow.vtp;
f3d_test(NAME TestInteractionDropSameFiles ARGS -x INTERACTION_CONFIGURE UI) #DropEvent cow.vtp;#DropEvent dragon.vtu;#DropEvent cow.vtp#DropEvent cow.vtp;

# A proper test for this is not possible because of the double quotes
f3d_test(NAME TestInteractionDropFileWithQuotes ARGS -n INTERACTION REGEXP "\"'`Quotes\"'`.stl does not exist" NO_BASELINE)#X;DropEvent "'`Quotes"'`.stl";
Expand Down
2 changes: 1 addition & 1 deletion doc/user/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Supports `front`, `top`, `right`, `isometric` arguments. eg: `set_camera top`.

`toggle_volume_rendering`: A specific command to toggle `model.volume.enable` and print coloring information. No argument.

`stop_interactor`: A specific command to stop the interactor hence quitting the application. No argument.
`exit`: A specific command to stop the interactor hence quitting the application. No argument.

`reset_camera`: A specific command to reset the camera to its original location. No argument.

Expand Down
20 changes: 18 additions & 2 deletions library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include "vtkF3DRenderer.h"
#include "vtkF3DUIObserver.h"

#if F3D_MODULE_UI
#include "vtkF3DImguiConsole.h"
#endif

#include <vtkCallbackCommand.h>
#include <vtkCellPicker.h>
#include <vtkGenericRenderWindowInteractor.h>
Expand Down Expand Up @@ -666,8 +670,7 @@ interactor& interactor_impl::initCommands()
this->Internals->Window.PrintColoringDescription(log::VerboseLevel::DEBUG);
});

this->addCommand(
"stop_interactor", [&](const std::vector<std::string>&) { this->Internals->StopInteractor(); });
this->addCommand("exit", [&](const std::vector<std::string>&) { this->Internals->StopInteractor(); });

this->addCommand("reset_camera",
[&](const std::vector<std::string>&) { this->Internals->Window.getCamera().resetToDefault(); });
Expand All @@ -681,6 +684,16 @@ interactor& interactor_impl::initCommands()
this->Internals->AnimationManager->StopAnimation();
this->Internals->Scene.add(files);
});

#if F3D_MODULE_UI
this->addCommand("toggle_console",
[&](const std::vector<std::string>&)
{
vtkF3DImguiConsole* console = vtkF3DImguiConsole::SafeDownCast(vtkOutputWindow::GetInstance());
console->ToggleVisibility();
});
#endif

return *this;
}

Expand Down Expand Up @@ -886,6 +899,9 @@ interactor& interactor_impl::initBindings()
this->addBinding({mod_t::ANY, "7"}, "set_camera top", "Camera", std::bind(docStr, "Top View camera"));
this->addBinding({mod_t::ANY, "9"}, "set_camera isometric", "Camera", std::bind(docStr, "Isometric View camera"));
this->addBinding({mod_t::NONE, "H"}, "toggle ui.cheatsheet", "Others", std::bind(docStr, "Toggle cheatsheet display"));
#if F3D_MODULE_UI
this->addBinding({mod_t::NONE, "Escape"}, "toggle_console", "Others", std::bind(docStr, "Display/Hide console"));
#endif
this->addBinding({mod_t::ANY, "Question"}, "print_scene_info", "Others", std::bind(docStr, "Print scene descr to terminal"));
this->addBinding({mod_t::NONE, "Return"}, "reset_camera", "Others", std::bind(docStr, "Reset camera to initial parameters"));
this->addBinding({mod_t::NONE, "Space"}, "toggle_animation", "Others", std::bind(docStr, "Play/Pause animation if any"));
Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKMultiColoring.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

int TestSDKMultiColoring(int argc, char* argv[])
{
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::DEBUG);
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::ERROR);
f3d::engine eng = f3d::engine::create(true);
f3d::scene& sce = eng.getScene();
f3d::options& opt = eng.getOptions();
Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKMultiOptions.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

int TestSDKMultiOptions(int argc, char* argv[])
{
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::DEBUG);
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::ERROR);
f3d::engine eng = f3d::engine::create(true);
f3d::scene& sce = eng.getScene();
f3d::options& opt = eng.getOptions();
Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKScene.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int TestSDKScene(int argc, char* argv[])
{
PseudoUnitTest test;

f3d::log::setVerboseLevel(f3d::log::VerboseLevel::DEBUG);
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::ERROR);
f3d::engine eng = f3d::engine::create(true);
f3d::scene& sce = eng.getScene();
f3d::window& win = eng.getWindow().setSize(300, 300);
Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKSceneFromMemory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int TestSDKSceneFromMemory(int argc, char* argv[])
{
PseudoUnitTest test;

f3d::log::setVerboseLevel(f3d::log::VerboseLevel::DEBUG);
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::ERROR);
f3d::engine eng = f3d::engine::create(true);
f3d::scene& sce = eng.getScene();
f3d::window& win = eng.getWindow().setSize(300, 300);
Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKWindowAuto.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

int TestSDKWindowAuto(int argc, char* argv[])
{
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::DEBUG);
f3d::log::setVerboseLevel(f3d::log::VerboseLevel::ERROR);
f3d::engine eng = f3d::engine::create();
f3d::window& win = eng.getWindow();
win.setWindowName("Test").setSize(300, 300).setPosition(100, 100);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions vtkext/private/module/Testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ set(test_sources
TestF3DRendererWithColoring.cxx
)

if(WIN32 AND F3D_WINDOWS_GUI)
list(APPEND test_sources TestF3DWinGuiObjectFactory.cxx)
endif()

if(F3D_MODULE_EXR)
list(APPEND test_sources
TestF3DEXRReader.cxx
Expand Down
23 changes: 0 additions & 23 deletions vtkext/private/module/Testing/TestF3DWinGuiObjectFactory.cxx

This file was deleted.

17 changes: 9 additions & 8 deletions vtkext/private/module/vtkF3DImguiConsole.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ vtkF3DImguiConsole::vtkF3DImguiConsole()
//----------------------------------------------------------------------------
vtkF3DImguiConsole::~vtkF3DImguiConsole() = default;

//----------------------------------------------------------------------------
void vtkF3DImguiConsole::ToggleVisibility()
{
this->Pimpl->ConsoleOpened = !this->Pimpl->ConsoleOpened;
}

//----------------------------------------------------------------------------
void vtkF3DImguiConsole::DisplayText(const char* text)
{
Expand Down Expand Up @@ -95,7 +101,7 @@ void vtkF3DImguiConsole::Show()
ImGui::PushStyleColor(ImGuiCol_Text,
this->Pimpl->NewError ? ImVec4(1.0f, 0.0f, 0.0f, 1.0f) : ImVec4(1.0f, 1.0f, 0.0f, 1.0f));

if (ImGui::Button("!") || ImGui::IsKeyPressed(ImGuiKey_Escape, false))
if (ImGui::Button("!"))
{
this->Pimpl->ConsoleOpened = true;
}
Expand All @@ -104,13 +110,6 @@ void vtkF3DImguiConsole::Show()

ImGui::End();
}
else
{
if (ImGui::IsKeyPressed(ImGuiKey_Escape, false))
{
this->Pimpl->ConsoleOpened = true;
}
}
}
else
{
Expand All @@ -127,6 +126,8 @@ void vtkF3DImguiConsole::Show()
ImGuiWindowFlags winFlags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;

// Since imgui has focus, it won't propagate the "Escape" key event to VTK
// So let's handle the console visibility here
if (ImGui::IsKeyPressed(ImGuiKey_Escape, false) && this->Pimpl->CurrentInput[0] == '\0')
{
this->Pimpl->ConsoleOpened = false;
Expand Down
6 changes: 5 additions & 1 deletion vtkext/private/module/vtkF3DImguiConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ class vtkF3DImguiConsole : public vtkOutputWindow

/**
* Show window
* Return optionally a command to run
*/
void Show();

/**
* Toggle visibility
*/
void ToggleVisibility();

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

0 comments on commit 5690bf7

Please sign in to comment.