Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6a3775
Add the tests to validate feature.
PedroAbreuMaia Mar 19, 2026
fb46a99
Add the color option to ui backdrop and the way to change it via cons…
PedroAbreuMaia Mar 19, 2026
aa2b94d
Add the backdrop color, and functions to change it to the FD3 modules.
PedroAbreuMaia Mar 19, 2026
017bc3d
Add the baseline images to validate the previously added tests.
PedroAbreuMaia Mar 19, 2026
67eb1ca
Make the corrections requested to PR
PedroAbreuMaia Mar 26, 2026
f3fcc4a
Apply requested changes. Putting the method SetBackdropColor before S…
PedroAbreuMaia Mar 31, 2026
6013f8c
Added documentation of new option.
PedroAbreuMaia Mar 31, 2026
7a1a4d0
Fix the code style errors.
PedroAbreuMaia Mar 31, 2026
cc34cc9
Fizx the code style error.
PedroAbreuMaia Mar 31, 2026
c25b6ed
fix style.
PedroAbreuMaia Mar 31, 2026
20b1ff6
Update library/options.json
PedroAbreuMaia Mar 31, 2026
6272438
Put the default color to F3D_BLACK value.
PedroAbreuMaia Apr 5, 2026
9e04406
Changes the test and the baseline
PedroAbreuMaia Apr 6, 2026
b98ffe2
Change the baseline
PedroAbreuMaia Apr 27, 2026
2f5accb
Fix style checks
PedroAbreuMaia Apr 27, 2026
385e4aa
Fix Style CI
PedroAbreuMaia Apr 29, 2026
a54d338
rebase conflict resolve
PedroAbreuMaia May 6, 2026
56993d7
Update doc/libf3d/03-OPTIONS.md
PedroAbreuMaia May 6, 2026
50f5229
Update vtkext/private/module/vtkF3DRenderer.h
PedroAbreuMaia May 6, 2026
928ec8a
Documents the default color value
PedroAbreuMaia May 6, 2026
3c38cac
Update doc/libf3d/03-OPTIONS.md
PedroAbreuMaia May 6, 2026
3c7ad06
Update doc/user/03-OPTIONS.md
PedroAbreuMaia May 6, 2026
dcef8d4
Update doc/libf3d/03-OPTIONS.md
PedroAbreuMaia May 6, 2026
7664cc8
Update library/options.json
PedroAbreuMaia May 6, 2026
284e899
Changes default_value to parsed_default_value to fix the error on the…
PedroAbreuMaia May 11, 2026
cb5a89e
Change the value of BackdropColor in vtkF#DUIActor.h
PedroAbreuMaia May 12, 2026
5da934b
Update vtkext/private/module/vtkF3DUIActor.h
PedroAbreuMaia May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions application/F3DOptionsTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static inline const std::map<std::string_view, std::string_view> LibOptionsNames
{ "font-scale", "ui.scale" },
{ "font-color", "ui.font_color" },
{ "backdrop-opacity", "ui.backdrop.opacity" },
{ "backdrop-color", "ui.backdrop.color" },
{ "normal-glyphs", "model.normal_glyphs.enable" },
{ "normal-glyphs-scale", "model.normal_glyphs.scale" },
{ "point-sprites-size", "model.point_sprites.size" },
Expand Down
1 change: 1 addition & 0 deletions application/testing/tests.features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ f3d_test(NAME TestAnimationInputChangePointSprites DATA v_rock2.mdl ARGS --point
f3d_test(NAME TestBackdropOpacityOpaque DATA suzanne.ply ARGS -n --backdrop-opacity=1.0 UI)
f3d_test(NAME TestBackdropOpacityTransparent DATA suzanne.ply ARGS -n --backdrop-opacity=0.0 UI)
f3d_test(NAME TestBackdropOpacityMedium DATA suzanne.ply ARGS -n --backdrop-opacity=0.5 UI)
f3d_test(NAME TestBackdropColor DATA suzanne.ply ARGS -n --backdrop-color=0.5,1.0,0.5 UI)

if(VTK_VERSION VERSION_GREATER_EQUAL 9.5.20251001)
f3d_test(NAME TestDefaultConfigFileHDRIFilename DATA dragon.vtu CONFIG config_build ARGS -j --hdri-file=${F3D_SOURCE_DIR}/testing/data/palermo_park_1k.hdr UI LONG_TIMEOUT)
Expand Down
6 changes: 6 additions & 0 deletions doc/libf3d/03-OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ Space separated custom key bindings to display in the drop zone.

Display the logo. Needs ui.drop_zone.enable to be true.

### `ui.backdrop.color` (_color_, default: `f3d_black`)

Set the color of the backdrop behind the UI elements.

Comment thread
PedroAbreuMaia marked this conversation as resolved.
CLI: `--backdrop-color`.
Comment thread
PedroAbreuMaia marked this conversation as resolved.

### `ui.backdrop.opacity` (_double_, default: `0.9`)

Set the opacity of the backdrop behind the UI elements. Value is between 0.0 (fully transparent) and 1.0 (fully opaque).
Expand Down
4 changes: 4 additions & 0 deletions doc/user/03-OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ Only supported on Windows platform.
Provide a script file containing a list of [commands](07-COMMANDS.md) to be executed sequentially.
Allows automation of multiple commands or pre-defined tasks.

### `--backdrop-color=<color>` (_color_, default: `f3d_black`)

Set the color of the backdrop behind text information such as FPS, filename, metadata or cheatsheet.

### `--backdrop-opacity=<opacity>` (_double_, default: `0.9`)

Set the opacity of the backdrop behind text information such as FPS, filename, metadata or cheatsheet.
Expand Down
4 changes: 4 additions & 0 deletions library/options.json
Comment thread
mwestphal marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@
"opacity": {
"type": "double",
"default_value": "0.9"
},
"color": {
"type": "color",
"parsed_default_value": "f3d_black"
}
},
"axis": {
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 @@ -453,6 +453,7 @@ void window_impl::UpdateDynamicOptions()
renderer->ShowMinimalConsole(opt.ui.minimal_console);
renderer->ShowDropZone(opt.ui.drop_zone.enable);
renderer->ShowDropZoneLogo(opt.ui.drop_zone.show_logo);
renderer->SetBackdropColor(opt.ui.backdrop.color);
renderer->SetBackdropOpacity(opt.ui.backdrop.opacity);
renderer->ShowNotification(opt.ui.notifications.enable);
renderer->ShowBindings(opt.ui.notifications.show_bindings);
Expand Down
6 changes: 6 additions & 0 deletions resources/cli-options.json
Comment thread
mwestphal marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@
"valueHelper": "<value>",
"conditional": "F3D_MODULE_UI"
},
{
"longName": "backdrop-color",
"helpText": "UI backdrop color",
"valueHelper": "<color>",
"conditional": "F3D_MODULE_UI"
},
{
"longName": "command-script",
"helpText": "Path to a script file containing commands to execute",
Expand Down
3 changes: 3 additions & 0 deletions testing/baselines/TestBackdropColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 18 additions & 6 deletions vtkext/private/module/vtkF3DImguiActor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,9 @@ void vtkF3DImguiActor::RenderSceneHierarchy(vtkOpenGLRenderWindow* renWin)
ImGui::SetNextWindowSize(ImVec2(defaultWidth, winHeight), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSizeConstraints(
ImVec2(10.f, winHeight), ImVec2(std::numeric_limits<float>::max(), winHeight));
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(
this->BackdropColor[0], this->BackdropColor[1], this->BackdropColor[2], this->BackdropOpacity);

ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoSavedSettings |
Expand Down Expand Up @@ -826,7 +828,9 @@ void vtkF3DImguiActor::RenderFileName()
}

::SetupNextWindow(ImVec2(viewport->GetWorkCenter().x - 0.5f * totalWidth, margin), winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(this->BackdropColor[0], this->BackdropColor[1],
this->BackdropColor[2], this->BackdropOpacity);

ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;
Expand All @@ -851,7 +855,9 @@ void vtkF3DImguiActor::RenderMetaData()
::SetupNextWindow(ImVec2(viewport->WorkSize.x - winSize.x - margin,
viewport->GetWorkCenter().y - 0.5f * winSize.y),
winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(
this->BackdropColor[0], this->BackdropColor[1], this->BackdropColor[2], this->BackdropOpacity);

ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;
Expand Down Expand Up @@ -886,7 +892,9 @@ void vtkF3DImguiActor::RenderHDRIFileName()

::SetupNextWindow(
ImVec2(viewport->GetWorkCenter().x - 0.5f * totalWidth + winOffsetX, margin), winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(this->BackdropColor[0], this->BackdropColor[1],
this->BackdropColor[2], this->BackdropOpacity);

ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;
Expand Down Expand Up @@ -985,7 +993,9 @@ void vtkF3DImguiActor::RenderCheatSheet()
::SetupNextWindow(ImVec2(margin, winTop),
ImVec2(
this->Pimpl->CheatSheetWidth, std::min(viewport->WorkSize.y - (2 * margin), textHeight)));
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(
this->BackdropColor[0], this->BackdropColor[1], this->BackdropColor[2], this->BackdropOpacity);

ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize |
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings |
Expand Down Expand Up @@ -1136,7 +1146,9 @@ void vtkF3DImguiActor::RenderFpsCounter()
viewport->WorkSize.x - winSize.x - margin, viewport->WorkSize.y - winSize.y - margin);

::SetupNextWindow(position, winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4(
this->BackdropColor[0], this->BackdropColor[1], this->BackdropColor[2], this->BackdropOpacity);

ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;
Expand Down
6 changes: 6 additions & 0 deletions vtkext/private/module/vtkF3DRenderer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,12 @@ void vtkF3DRenderer::SetDPIAware(bool enable)
}
}

//----------------------------------------------------------------------------
void vtkF3DRenderer::SetBackdropColor(const std::array<double, 3>& color)
{
this->UIActor->SetBackdropColor(color);
}

//----------------------------------------------------------------------------
void vtkF3DRenderer::SetBackdropOpacity(const double backdropOpacity)
{
Expand Down
5 changes: 5 additions & 0 deletions vtkext/private/module/vtkF3DRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ class vtkF3DRenderer : public vtkOpenGLRenderer
const std::vector<double>& colorZAxis);
///@}

/**
* Set the backdrop color on the underlying UI Actor
*/
void SetBackdropColor(const std::array<double, 3>& color);

/**
* Set the backdrop opacity
* Should be called before ShowAxis
Expand Down
10 changes: 10 additions & 0 deletions vtkext/private/module/vtkF3DUIActor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ void vtkF3DUIActor::SetFontColor(const std::array<double, 3>& color)
}
}

//----------------------------------------------------------------------------
void vtkF3DUIActor::SetBackdropColor(const std::array<double, 3>& color)
{
if (this->BackdropColor != color)
{
this->BackdropColor = color;
this->Initialized = false;
}
}

//----------------------------------------------------------------------------
void vtkF3DUIActor::SetBackdropOpacity(const double backdropOpacity)
{
Expand Down
11 changes: 9 additions & 2 deletions vtkext/private/module/vtkF3DUIActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#ifndef vtkF3DUIActor_h
#define vtkF3DUIActor_h

#include <vtkProp.h>

#include <F3DStyle.h>
#include <array>
#include <chrono>
#include <cstdint>
#include <deque>
#include <map>
#include <vtkProp.h>

class vtkOpenGLRenderWindow;

Expand Down Expand Up @@ -198,6 +198,12 @@ class vtkF3DUIActor : public vtkProp
*/
int RenderOverlay(vtkViewport* vp) override;

/**
* Set the backdrop color
Comment thread
mwestphal marked this conversation as resolved.
* f3d_black by default
Comment thread
PedroAbreuMaia marked this conversation as resolved.
Outdated
*/
void SetBackdropColor(const std::array<double, 3>& color);
Comment thread
mwestphal marked this conversation as resolved.

/**
* Set the backdrop opacity
*/
Expand Down Expand Up @@ -344,6 +350,7 @@ class vtkF3DUIActor : public vtkProp
*/
std::array<double, 3> FontColor = { 1.0, 1.0, 1.0 };

std::array<double, 3> BackdropColor = { 0, 0, 0 };
double BackdropOpacity = 0.9;

bool NotificationVisible = false;
Expand Down
Loading