Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge release into master #1905

Merged
merged 10 commits into from
Jan 12, 2025
4 changes: 2 additions & 2 deletions .github/baselines/install_example_plugin_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set(F3D_MINOR_VERSION 0)
set(F3D_PATCH_VERSION 0)
set(F3D_VERSION ${F3D_MAJOR_VERSION}.${F3D_MINOR_VERSION}.${F3D_PATCH_VERSION})

set(F3D_PATCH_VERSION_EXTRA "RC1")
set(F3D_PATCH_VERSION_EXTRA "RC2")
if(F3D_PATCH_VERSION_EXTRA STREQUAL "")
set(F3D_VERSION_FULL ${F3D_VERSION})
else()
Expand Down
21 changes: 18 additions & 3 deletions application/F3DNSDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,26 @@
// This is a subclass of NSApplicationDelegate.
@interface F3DNSDelegateInternal : NSObject<NSApplicationDelegate>
@property F3DStarter* Starter;
@property BOOL ShouldHandleFileOpening;
@end

@implementation F3DNSDelegateInternal
@synthesize Starter;
@synthesize ShouldHandleFileOpening;

// ----------------------------------------------------------------------------
- (BOOL)application:(NSApplication*)theApplication openFile:(NSString*)filename
{
(void)theApplication;
Starter->AddFile([filename UTF8String]);
Starter->LoadFileGroup();
Starter->Render();
if (ShouldHandleFileOpening)
{
int index = Starter->AddFile([filename UTF8String]);
if (index > -1)
{
Starter->LoadFileGroup(index);
}
Starter->Render();
}
return YES;
}

Expand Down Expand Up @@ -105,6 +113,13 @@ - (void)applicationWillFinishLaunching:(NSNotification *)notification
action:@selector(toggleFullScreen:)
keyEquivalent:@"f"]
setKeyEquivalentModifierMask:NSEventModifierFlagControl | NSEventModifierFlagCommand];

ShouldHandleFileOpening = false;
}

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
ShouldHandleFileOpening = true;
}

@end
Expand Down
11 changes: 10 additions & 1 deletion application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ if(NOT F3D_MACOS_BUNDLE)
f3d_test(NAME TestDefaultConfigFileAndCommand DATA suzanne.stl ARGS --up=-Y --camera-direction=-1,0.5,-1 CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)
f3d_test(NAME TestDefaultConfigTranslucent DATA red_translucent_monkey.gltf CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)

if(VTK_VERSION VERSION_GREATER_EQUAL 9.4.20241219)
f3d_test(NAME TestDefaultConfigFileArmature DATA RiggedFigure.glb ARGS --animation-time=1 --armature CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)
endif()

file(COPY "${F3D_SOURCE_DIR}/resources/configs/thumbnail.d/" "${F3D_SOURCE_DIR}/plugins/native/configs/thumbnail.d/" DESTINATION "${CMAKE_BINARY_DIR}/share/f3d/configs/thumbnail_build.d")
f3d_test(NAME TestThumbnailConfigFileVTU DATA dragon.vtu CONFIG thumbnail_build LONG_TIMEOUT TONE_MAPPING)
f3d_test(NAME TestThumbnailConfigFileVTI DATA vase_4comp.vti CONFIG thumbnail_build LONG_TIMEOUT TONE_MAPPING)
Expand Down Expand Up @@ -417,9 +421,10 @@ f3d_test(NAME TestVerboseAnimationWrongAnimationTimeHigh DATA BoxAnimated.gltf A
f3d_test(NAME TestVerboseAnimationWrongAnimationTimeLow DATA BoxAnimated.gltf ARGS --animation-time=-5 --verbose REGEXP "Animation time -5 is outside of range \\[0, 3\\.70833\\], using 0" NO_BASELINE)

# Armature test
f3d_test(NAME TestGLTFRigNoArmature DATA RiggedFigure.glb ARGS --animation-time=1)
f3d_test(NAME TestGLTFRigArmatureNoArmature DATA RiggedFigure.glb ARGS --animation-time=1 --opacity=0.5 -p)
if(VTK_VERSION VERSION_GREATER_EQUAL 9.4.20241219)
f3d_test(NAME TestGLTFRigArmature DATA RiggedFigure.glb ARGS --animation-time=1 --armature)
f3d_test(NAME TestGLTFRigArmatureWithOpacity DATA RiggedFigure.glb ARGS --animation-time=1 --armature --opacity=0.5 -p)
f3d_test(NAME TestGLTFRigArmatureSphereTube DATA RiggedFigure.glb ARGS --animation-time=1 --armature --point-size=20 --line-width=5)
endif()

Expand Down Expand Up @@ -841,6 +846,10 @@ f3d_test(NAME TestInteractionConsoleInvalidCommand DATA f3d.glb INTERACTION UI)
f3d_test(NAME TestInteractionConsoleInvalidOption DATA f3d.glb INTERACTION UI) #Escape;toggle foo;Return
f3d_test(NAME TestInteractionConsoleClear DATA dragon.vtu INTERACTION UI) #Escape;e;Escape;printt;BackSpace;_scee;Left;n;Right;_info;Return;clear;Return
f3d_test(NAME TestInteractionConsoleTypingSceneInfo DATA f3d.glb INTERACTION UI) #Escape;e;Escape;printt;BackSpace;_scee;Left;Right;_info;Return
f3d_test(NAME TestInteractionConsoleReload DATA f3d.glb INTERACTION UI) #Escape;reload_current_file_group;Return
f3d_test(NAME TestInteractionConsoleLoadNext DATA f3d.glb cow.vtp INTERACTION UI) #Escape;load_next_file_group;Return
f3d_test(NAME TestInteractionConsoleRender ARGS --coloring-by-cells DATA waveletMaterial.vti INTERACTION UI) #Escape;toggle_volume_rendering;Return
f3d_test(NAME TestInteractionConsoleCamera DATA f3d.glb INTERACTION UI) #Escape;set_camera top;Return

if (F3D_MODULE_TINYFILEDIALOGS)
f3d_test(NAME TestInteractionFileOpen INTERACTION NO_BASELINE ENV CTEST_OPEN_DIALOG_FILE=${F3D_SOURCE_DIR}/testing/data/cow.vtp)
Expand Down
2 changes: 1 addition & 1 deletion doc/user/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ For **default scene** formats, certain default values are set automatically:
- roughness: 0.3
- camera-orthographic: false

They will be overridden when using corresponding [options](OPTIONS.md).
They will be overridden when using corresponding [options](OPTIONS.md), either from command line or [configuration file](CONFIGURATION_FILE.md).

## Interacting with your scene

Expand Down
5 changes: 5 additions & 0 deletions library/private/interactor_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ class interactor_impl : public interactor
*/
void EventLoop();

/**
* Set a command to be run on the next event loop
*/
void SetCommandBuffer(const char* command);

/**
* An exception that can be thrown by certain command callbacks
* when the arguments of the callback are incorrect and expected
Expand Down
16 changes: 15 additions & 1 deletion library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class interactor_impl::internals
if (event == vtkF3DConsoleOutputWindow::TriggerEvent)
{
const char* commandWithArgs = static_cast<const char*>(data);
self->Interactor.triggerCommand(commandWithArgs);
self->Interactor.SetCommandBuffer(commandWithArgs);
}
else if (event == vtkF3DConsoleOutputWindow::ShowEvent ||
event == vtkF3DConsoleOutputWindow::HideEvent)
Expand Down Expand Up @@ -516,6 +516,12 @@ class interactor_impl::internals
this->EventLoopUserCallBack();
}

if (this->CommandBuffer.has_value())
{
this->Interactor.triggerCommand(this->CommandBuffer.value());
this->CommandBuffer.reset();
}

this->AnimationManager->Tick();

if (this->RenderRequested)
Expand Down Expand Up @@ -543,6 +549,7 @@ class interactor_impl::internals
std::map<unsigned long, std::pair<int, std::function<void()>>> TimerCallBacks;

std::map<std::string, std::function<void(const std::vector<std::string>&)>> Commands;
std::optional<std::string> CommandBuffer;

std::map<interaction_bind_t, BindingCommands> Bindings;
std::multimap<std::string, interaction_bind_t> GroupedBinds;
Expand Down Expand Up @@ -1254,6 +1261,13 @@ void interactor_impl::UpdateRendererAfterInteraction()
this->Internals->Style->UpdateRendererAfterInteraction();
}

//----------------------------------------------------------------------------
void interactor_impl::SetCommandBuffer(const char* command)
{
// XXX This replace previous command buffer, it should be improved
this->Internals->CommandBuffer = command;
}

//----------------------------------------------------------------------------
interactor_impl::invalid_args_exception::invalid_args_exception(const std::string& what)
: exception(what)
Expand Down
1 change: 1 addition & 0 deletions library/src/window_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ window_impl::window_impl(const options& options, const std::optional<Type>& type
#endif
this->Internals->RenWin->SetMultiSamples(0); // Disable hardware antialiasing
this->Internals->RenWin->SetOffScreenRendering(offscreen);
this->Internals->RenWin->SetWindowName("f3d");
this->Internals->RenWin->AddRenderer(this->Internals->Renderer);
this->Internals->Camera = std::make_unique<detail::camera_impl>();
this->Internals->Camera->SetVTKRenderer(this->Internals->Renderer);
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ wheel.packages = []
version_file = "_version.py"
version_scheme = "no-guess-dev"
local_scheme = "no-local-version"
fallback_version = "3.0.0-RC1"
fallback_version = "3.0.0-RC2"

[tool.scikit-build.cmake.define]
CMAKE_OSX_DEPLOYMENT_TARGET = "10.15"
Expand Down
4 changes: 3 additions & 1 deletion resources/configs/config.d/05_all.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"camera-direction": "-1,-0.5,-1",
"hdri-ambient": true,
"translucency-support": true,
"animation-progress": true
"animation-progress": true,
"point-size": 5,
"line-width": 2
}
}
]
3 changes: 3 additions & 0 deletions testing/baselines/TestDefaultConfigFileArmature.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/TestGLTFRigArmatureNoArmature.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/TestGLTFRigArmatureWithOpacity.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: 0 additions & 3 deletions testing/baselines/TestGLTFRigNoArmature.png

This file was deleted.

3 changes: 3 additions & 0 deletions testing/baselines/TestInteractionConsoleCamera.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/TestInteractionConsoleLoadNext.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/TestInteractionConsoleReload.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/TestInteractionConsoleRender.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions testing/recordings/TestInteractionConsoleCamera.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# StreamVersion 1.2
ConfigureEvent 1249 1374 0 0 0 0 0
ExposeEvent 0 1406 0 0 0 0 0
RenderEvent 0 1406 0 0 0 0 0

KeyPressEvent -763 401 0 27 1 Escape 0
CharEvent -763 401 0 27 1 Escape 0
KeyReleaseEvent -763 401 0 27 1 Escape 0

KeyPressEvent -763 401 0 115 1 s 0
CharEvent -763 401 0 115 1 s 0
KeyReleaseEvent -763 401 0 115 1 s 0

KeyPressEvent -763 401 0 101 1 e 0
CharEvent -763 401 0 101 1 e 0
KeyReleaseEvent -763 401 0 101 1 e 0

KeyPressEvent -763 401 0 116 1 t 0
CharEvent -763 401 0 116 1 t 0
KeyReleaseEvent -763 401 0 116 1 t 0

KeyPressEvent -763 401 1 95 1 underscore 0
CharEvent -763 401 1 95 1 underscore 0
KeyReleaseEvent -763 401 1 95 1 underscore 0

KeyPressEvent -763 401 0 99 1 c 0
CharEvent -763 401 0 99 1 c 0
KeyReleaseEvent -763 401 0 99 1 c 0

KeyPressEvent -763 401 0 97 1 a 0
CharEvent -763 401 0 97 1 a 0
KeyReleaseEvent -763 401 0 97 1 a 0

KeyPressEvent -763 401 0 109 1 m 0
CharEvent -763 401 0 109 1 m 0
KeyReleaseEvent -763 401 0 109 1 m 0

KeyPressEvent -763 401 0 101 1 e 0
CharEvent -763 401 0 101 1 e 0
KeyReleaseEvent -763 401 0 101 1 e 0

KeyPressEvent -763 401 0 114 1 r 0
CharEvent -763 401 0 114 1 r 0
KeyReleaseEvent -763 401 0 114 1 r 0

KeyPressEvent -763 401 0 97 1 a 0
CharEvent -763 401 0 97 1 a 0
KeyReleaseEvent -763 401 0 97 1 a 0

KeyPressEvent -763 401 0 32 1 space 0
CharEvent -763 401 0 32 1 space 0
KeyReleaseEvent -763 401 0 32 1 space 0

KeyPressEvent -763 401 0 116 1 t 0
CharEvent -763 401 0 116 1 t 0
KeyReleaseEvent -763 401 0 116 1 t 0

KeyPressEvent -763 401 0 111 1 o 0
CharEvent -763 401 0 111 1 o 0
KeyReleaseEvent -763 401 0 111 1 o 0

KeyPressEvent -763 401 0 112 1 p 0
CharEvent -763 401 0 112 1 p 0
KeyReleaseEvent -763 401 0 112 1 p 0

KeyPressEvent -763 401 0 13 1 Return 0
CharEvent -763 401 0 13 1 Return 0
KeyReleaseEvent -763 401 0 13 1 Return 0

KeyPressEvent -763 401 0 27 1 Escape 0
CharEvent -763 401 0 27 1 Escape 0
KeyReleaseEvent -763 401 0 27 1 Escape 0

TimerEvent 212 76 0 27 1 Escape 0
1 change: 1 addition & 0 deletions testing/recordings/TestInteractionConsoleClear.log
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ KeyPressEvent 0 0 0 13 1 Return 0
CharEvent 0 0 0 13 1 Return 0
KeyReleaseEvent 0 0 0 13 1 Return 0

TimerEvent 351 169 0 0 0 0 0
2 changes: 2 additions & 0 deletions testing/recordings/TestInteractionConsoleInvalidCommand.log
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ 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

TimerEvent 351 169 0 0 0 0 0
2 changes: 2 additions & 0 deletions testing/recordings/TestInteractionConsoleInvalidOption.log
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ 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

TimerEvent 351 169 0 0 0 0 0
Loading
Loading