8000
Skip to content

fix: recompute axes grid bounds when switching files#2988

Draft
soumyasavarn wants to merge 14 commits intof3d-app:masterfrom
soumyasavarn:fix/axes-grid-not-recomputed-on-file-switch
Draft

fix: recompute axes grid bounds when switching files#2988
soumyasavarn wants to merge 14 commits intof3d-app:masterfrom
soumyasavarn:fix/axes-grid-not-recomputed-on-file-switch

Conversation

@soumyasavarn
Copy link
Copy Markdown

Describe your changes

GridAxesConfigured was not being reset when the importer changed on file switch, so ConfigureGridAxesUsingCurrentActors() was never re-called with the new file's bounds. Added this->GridAxesConfigured = false; alongside the existing this->GridConfigured = false; in UpdateActors() in vtkext/private/module/vtkF3DRenderer.cxx.

Issue ticket number and link if any

Fixes #2963

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.

GridAxesConfigured was not being reset when the importer changed
(i.e. on file switch), so ConfigureGridAxesUsingCurrentActors()
was never re-called. Add GridAxesConfigured = false alongside
the existing GridConfigured = false in UpdateActors().

Fixes f3d-app#2963
@soumyasavarn
Copy link
Copy Markdown
Author

\ci fast

@mwestphal mwestphal self-requested a review March 30, 2026 09:49
@soumyasavarn soumyasavarn marked this pull request as ready for review March 30, 2026 09:49
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.

one small change

@soumyasavarn soumyasavarn marked this pull request as draft March 30, 2026 11:42
soumyasavarn and others added 3 commits March 30, 2026 17:32
removed unnecessary comment

Co-authored-by: Mathieu Westphal <mwestphal.f3d@protonmail.com>
Co-authored-by: Mathieu Westphal <mwestphal.f3d@protonmail.com>
@soumyasavarn soumyasavarn marked this pull request as ready for review March 30, 2026 12:43
@soumyasavarn soumyasavarn requested a review from mwestphal March 31, 2026 04:07
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.

hum, the result doesnt look right, the axes grid should be centered on the dragon.

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.

the feature doesnt seem to work yet.

8000
Co-authored-by: Mathieu Westphal <mwestphal.f3d@protonmail.com>
@soumyasavarn soumyasavarn marked this pull request as draft March 31, 2026 07:45
@soumyasavarn
Copy link
Copy Markdown
Author

@mwestphal I tested with the "F3D-3.4.1-147-g30c7f045-Windows-x86_64-raytracing":

  • dragon.vtu alone with --axes-grid → correctly centered
  • cow.vtp + dragon.vtu, pressing Right to switch → axes grid disappears completely

My fix makes the grid reappear on switch, but the bounds show -58 to 100
instead of the expected -100 to 100. Could this be related to actor transforms
being different when dragon is loaded as the second file vs first file?
Or is there something else that needs resetting on file switch?

@mwestphal
Copy link
Copy Markdown
Member

@mwestphal I tested with the "F3D-3.4.1-147-g30c7f045-Windows-x86_64-raytracing":

* dragon.vtu alone with --axes-grid → correctly centered

* cow.vtp + dragon.vtu, pressing Right to switch → axes grid disappears completely

My fix makes the grid reappear on switch, but the bounds show -58 to 100 instead of the expected -100 to 100. Could this be related to actor transforms being different when dragon is loaded as the second file vs first file? Or is there something else that needs resetting on file switch?

It looks like the bounds computation is not correct for some reason, so you need to dig into that.

@mwestphal
Copy link
Copy Markdown
Member

@soumyasavarn Merge branch 'f3d-app:master' into fix/axes-grid-not-recomputed-on-fi…

Please do not merge with master, but use rebase instead, and only when needed.

…lity

This ensures ConfigureColoringAndVisibilities() is called when switching
files, correctly updating actor visibility for the new file. Without this,
old file actors may remain visible, causing wrong bounds computation for
the axes grid.
@soumyasavarn soumyasavarn force-pushed the fix/axes-grid-not-recomputed-on-file-switch branch from 4398688 to d3e2e36 Compare March 31, 2026 17:57
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.

Axes grid is not recomputed when switching file

2 participants

0