Skip to content

Add backdrop.color libf3d and f3 d option#2956

Closed
PedroAbreuMaia wants to merge 33 commits intof3d-app:masterfrom
PedroAbreuMaia:Add-backdrop.color-libf3d-and-F3D-option
Closed

Add backdrop.color libf3d and f3 d option#2956
PedroAbreuMaia wants to merge 33 commits intof3d-app:masterfrom
PedroAbreuMaia:Add-backdrop.color-libf3d-and-F3D-option

Conversation

@PedroAbreuMaia
Copy link
Copy Markdown

@PedroAbreuMaia PedroAbreuMaia commented Mar 19, 2026

Describe your changes

  • Added libf3d option ui.backdrop.color option to control backdrop color.
  • Added a CLI option to control it --backdrop-color
  • This option is set black by default.
  • Added new tests.

Issue ticket number and link if any

#2861

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

Continuous integration

Please write a comment to run CI, eg: \ci fast.
See here for more info.

@mwestphal mwestphal self-requested a review March 22, 2026 12:28
Copy link
Copy Markdown
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know when you need a review @PedroAbreuMaia

@mwestphal mwestphal linked an issue Mar 22, 2026 that may be closed by this pull request
@PedroAbreuMaia PedroAbreuMaia marked this pull request as ready for review March 22, 2026 16:00
@mwestphal
Copy link
Copy Markdown
Member

@mwestphal mwestphal self-requested a review March 22, 2026 20:43
Comment on lines +318 to +321
f3d_test(NAME TestBackdropColorRed DATA suzanne.ply ARGS -n --backdrop-color=1.0,0.0,0.0 UI)
f3d_test(NAME TestBackdropColorGreen DATA suzanne.ply ARGS -n --backdrop-color=0.0,1.0,0.0 UI)
f3d_test(NAME TestBackdropColorBlue DATA suzanne.ply ARGS -n --backdrop-color=0.0,0.0,1.0 UI)
f3d_test(NAME TestBackdropColorWhite DATA suzanne.ply ARGS -n --backdrop-color=1.0,1.0,1.0 UI)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to test all the colors, just a single test is fine, ideally not a full color (like 1,0,0) but something else.

ImGui::SetNextWindowSizeConstraints(
ImVec2(10.f, winHeight), ImVec2(std::numeric_limits<float>::max(), winHeight));
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
//ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this


::SetupNextWindow(ImVec2(viewport->GetWorkCenter().x - 0.5f * totalWidth, margin), winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
//ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

viewport->GetWorkCenter().y - 0.5f * winSize.y),
winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
//ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

::SetupNextWindow(
ImVec2(viewport->GetWorkCenter().x - 0.5f * totalWidth + winOffsetX, margin), winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
//ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

ImVec2(
this->Pimpl->CheatSheetWidth, std::min(viewport->WorkSize.y - (2 * margin), textHeight)));
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
//ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this


::SetupNextWindow(position, winSize);
ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
//ImGui::SetNextWindowBgAlpha(this->BackdropOpacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

*/
void SetBackdropOpacity(const double backdropOpacity);

void SetBackdropColor(const std::array<double, 3>& color);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add doxygen doc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to add the doxygen annotations?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, please :)

Comment thread vtkext/private/module/vtkF3DUIActor.cxx Outdated
this->BackdropColor = color;
this->Initialized = false;
}
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing end of line at the end of the file

@mwestphal
Copy link
Copy Markdown
Member

\ci fast

Copy link
Copy Markdown
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small changes needed. Let me know if anything is unclear :)

I've also run the fast CI to see if it finds anything.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 22, 2026

Style Checks CI failed:

diff --git a/library/src/window_impl.cxx b/library/src/window_impl.cxx
index d3fe715..faf12c5 100644
--- a/library/src/window_impl.cxx
+++ b/library/src/window_impl.cxx
@@ -470,7 +470,7 @@ void window_impl::UpdateDynamicOptions()
   {
     f3d::color_t color = opt.ui.backdrop.color.value();
     renderer->SetBackdropColor({ color[0], color[1], color[2] });
-  }  
+  }
 
   if (this->Internals->Interactor)
   {

PedroAbreuMaia and others added 17 commits March 25, 2026 23:30
Co-authored-by: Archie Payne <115465107+ArchiePayne@users.noreply.github.com>
* do not set axes grid center position

* update test interaction

* Not use interaction test

* do not set axes grid center position

* update test interaction

* Not use interaction test
Co-authored-by: Archie Payne <115465107+ArchiePayne@users.noreply.github.com>
@mwestphal
Copy link
Copy Markdown
Member

Looks like the merge/rebase did not went well, do you need help with that ?

@PedroAbreuMaia
Copy link
Copy Markdown
Author

PedroAbreuMaia commented Mar 26, 2026

Yes, please. I've been trying to do it last night and could not figure it out.

@mwestphal mwestphal self-requested a review March 26, 2026 17:05
@mwestphal
Copy link
Copy Markdown
Member

here is your branch rebase on master: #2975

Let me know if you need help recover it locally and force pushing to your fork.

@mwestphal mwestphal removed their request for review March 26, 2026 19:28
@PedroAbreuMaia PedroAbreuMaia deleted the Add-backdrop.color-libf3d-and-F3D-option branch March 29, 2026 20:16
@PedroAbreuMaia PedroAbreuMaia restored the Add-backdrop.color-libf3d-and-F3D-option branch March 29, 2026 20:20
@PedroAbreuMaia PedroAbreuMaia deleted the Add-backdrop.color-libf3d-and-F3D-option branch March 29, 2026 20:23
@PedroAbreuMaia
Copy link
Copy Markdown
Author

I pulled the one you created locally, but I could not force push it. So I colse that branch and push the local one to its place. Should I open a new PR?

@mwestphal
Copy link
Copy Markdown
Member

there is no reason that you could not force pus on your own fork, but as you prefer :)

@PedroAbreuMaia
Copy link
Copy Markdown
Author

Still, should I open a new PR? Or use the one you opened? And how do get the PR reviewed?

@mwestphal
Copy link
Copy Markdown
Member

Still, should I open a new PR?

Yes

Or use the one you opened?

That you cannot.

And how do get the PR reviewed?

Once you created the PR, you will be able to request a review, it is all documented here: https://f3d.app/dev/CONTRIBUTING#f3d-development-workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add backdrop.color libf3d and F3D option

4 participants