Skip to content

feat: [Remote rendering 3.3c] server-authoritative cross-section plane - #139

Open
LKasianAnsys wants to merge 8 commits into
feat/3.3b-fold-edge-visibility-into-global-togglefrom
feat/3.3c-server-authoritative-cross-section-plane
Open

LKasianAnsys wants to merge 8 commits into
feat/3.3b-fold-edge-visibility-into-global-togglefrom
feat/3.3c-server-authoritative-cross-section-plane

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #21

Context

This is the third PR of 4 to move ownership of widget state from the client to the server.

In addition to the widget toggles added in #137 , the cross-section widget's plane state is also synced back to the server. the cross section plane's origin and normal are added to the server. The browser reports the plane it settled on at the end of a drag (EndInteractionEvent), and the plane is saved and restored with the rest of the scene.

Also included: the finalize_scene call on the server moved from VisorVtkLocal.load_state to into VisorSceneBase.apply_state, after the restores and before the state push, so the graph and client rebuilds from a scene up to date with what was just restored. Note that apply_state only has one caller, load_state, so this affects only the load path.

Known Issue

There is a known issue when loading a saved scene with the cross-section visibility set to true. When the saved scene is loaded into a viewer with no dataset, this leaves the cross-section plane hidden in the browser until the cross-section widget button is toggled twice (on to start with (though the plane doesn't render) -> off -> on), after which is is correct and in the right position. The plane and its values restore fine; this appears to be an issue with the client-side display, not one with the state itself. This is deferred to user story 3.6, which is dedicated to addressing the save/load state workflow end to end, after ownership of all parts of the viewer state have been moved to the server.

[edit] After testing a minor version bump of VTK 9.7.0 (Python), it appears this issue goes away.

Manual testing

  • Open the cross-section widget, move the clipping plane's origin and normal. Refresh the browser; note that the widget visibility and clipping plane are both preserved across a refresh.
  • Save and load a viewer state with the cross-section enabled and the clipping plane moved to a distinctly non-default value.

Copilot summary

This pull request implements a server-authoritative, scene-wide cross-section plane that is synchronized from the frontend to the backend, mirroring the camera’s existing contract. It introduces new payloads, record-keeping, and serialization methods, and updates the renderer and scene logic to ensure the cross-section state is consistently tracked, persisted, and restored. This enables reliable round-tripping of the cross-section plane, including after reloads or state restores.

Cross-section plane synchronization and state management:

  • Added SyncCrossSectionPlanePayload to carry the cross-section plane’s origin and normal from the frontend, and registered its handling in the local app (widget_state_payloads.py, local_app.py). [1] [2] [3] [4] [5]
  • Implemented the cross-section plane record and its synchronization in both VisorLocalRenderer and NullRenderer, including new methods for getting, setting, and serializing the plane state. [1] [2] [3] [4] [5]
  • Updated the renderer interface (IRenderer) to require cross-section plane state methods, ensuring all renderer implementations comply.

Scene persistence and state restoration:

  • The scene now records the cross-section plane in its state, mirroring the camera, and ensures it is restored and finalized correctly during state loads and applies. [1] [2] [3]
  • Added server-side synchronization logic for the cross-section plane, ensuring atomic updates and correct serialization for delivery to clients.

@github-actions github-actions Bot added test Work associated with testing added enhancement New feature or request labels Sep 22, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3c-server-authoritative-cross-section-plane branch from 43ac721 to f3eeaf9 Compare September 23, 2026 23:55
@LKasianAnsys LKasianAnsys self-assigned this Sep 23, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.3b-fold-edge-visibility-into-global-toggle September 24, 2026 00:01
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review September 24, 2026 03:52
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3b-fold-edge-visibility-into-global-toggle branch from b10db12 to da48fb9 Compare September 24, 2026 18:05
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3c-server-authoritative-cross-section-plane branch from bba6e39 to 1b79275 Compare September 24, 2026 18:05
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3b-fold-edge-visibility-into-global-toggle branch from da48fb9 to 93267a1 Compare September 24, 2026 18:12
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3c-server-authoritative-cross-section-plane branch from 1b79275 to 7ee86d1 Compare September 24, 2026 18:12

This branch has not been deployed

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

Labels

added enhancement New feature or request test Work associated with testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants