Skip to content

feat: Remote rendering 3.1b - implement per-part apply logic on the renderer and node pipeline - #51

Merged
LKasianAnsys merged 14 commits into
mainfrom
feat/3.1b-per-part-apply-logic
Sep 2, 2026
Merged

LKasianAnsys merged 14 commits into
mainfrom
feat/3.1b-per-part-apply-logic

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #18

Context

This is the second of 5 PRs for user story 3.1 (#18) of the phased implementation plan (here) for adding remote rendering in VISOR.

Per-part visual state (visibility, opacity, diffuse color, color variable), is currently held client-side on VisorPartState and reaches the server only via getAppStateAsync when the save_state API is called. This story inverts that, making VisorDatasetRegistry the source of truth for per-part state by the end of 3.1.

This PR is the second step: filling in the no-op apply_* logic on the renderer so the server can drive VTK for a single part. There are still no callers in this PR. The trigger handlers are added on the server in PR 3, the client-initiated triggers are added in PR 4, and this is extended to save/load state in PR 5.

Notes:

  • Per-node mutation lives on VtkNodePipeline. The renderer resolves the node and delegates, and does no VTK work of its own. As much as possible, the VTK logic common between the LOCAL (vtk-wasm) and REMOTE modes will be shared.
  • set_color_variable does array validation and mapper calls only. Moving color variable ownership color LUT authority and application on the server is scheduled for user story 3.5, so this is deferred here.
  • An unrecognized point/cell association logs and returns rather than falling through to a default.

Copilot summary

This pull request implements per-part apply logic for the renderer and node pipeline, enabling fine-grained visual control over individual parts in the VTK pipeline. The main changes introduce concrete implementations for visibility, opacity, diffuse color, selection, and color variable application at the part level, moving the logic from no-ops to actual delegation to the VtkNodePipeline.

Renderer and Node Pipeline Enhancements:

  • Implemented per-part apply logic for apply_visibility, apply_opacity, apply_diffuse_color, apply_selected, apply_color_variable, and clear_color_variable in VisorLocalRenderer, delegating to corresponding methods on VtkNodePipeline. These methods now resolve the pipeline for a given node ID, log a debug message if the node is unknown, and never raise exceptions. (src/ansys/visor/viewer/renderer/local_renderer.py) [1] [2]
  • Added new methods to VtkNodePipeline for set_selected, set_visibility, set_opacity, set_diffuse_color, set_color_variable, and clear_color_variable, with detailed docstrings and robust handling of invalid associations or missing arrays. (src/ansys/visor/viewer/vtk/node_pipeline.py)

Testing Improvements:

  • Refactored and expanded unit tests in test_local_renderer.py to verify that each per-part apply method delegates correctly to the pipeline, including handling of unknown node IDs as logged no-ops. Added a new test class TestDelegatedApplyBodies for this purpose. (tests/unit/renderer/test_local_renderer.py)
  • Added a new fixture and supporting code in test_node_pipeline.py to enable testing of color variable application with realistic VTK datasets containing named point and cell arrays. (tests/unit/vtk/test_node_pipeline.py)

These changes collectively enable fine-grained, per-part visual control in the renderer, laying groundwork for further features.

@github-actions github-actions Bot added test Work associated with testing added enhancement New feature or request labels Aug 28, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.1a-registry-per-part-write-path August 28, 2026 20:00
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.1b-per-part-apply-logic branch from bdd6ec6 to 4f7deb5 Compare August 28, 2026 20:03
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.1a-registry-per-part-write-path branch from 029c950 to ff688aa Compare August 31, 2026 15:29
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.1b-per-part-apply-logic branch from 7b61414 to 0c50362 Compare August 31, 2026 15:29
@LKasianAnsys LKasianAnsys self-assigned this Aug 31, 2026
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review August 31, 2026 16:38
@margalva
margalva self-requested a review September 1, 2026 20:16
margalva
margalva previously approved these changes Sep 1, 2026
Base automatically changed from feat/3.1a-registry-per-part-write-path to main September 1, 2026 21:42
@LKasianAnsys
LKasianAnsys dismissed margalva’s stale review September 1, 2026 21:42

The base branch was changed.

@LKasianAnsys

Copy link
Copy Markdown
Collaborator Author

@margalva Thank you for approving; after the 3.1a merge this branch was updated to the new base (main), and needs a re-approval.

@LKasianAnsys
LKasianAnsys merged commit 4bf47fe into main Sep 2, 2026
20 checks passed
@LKasianAnsys
LKasianAnsys deleted the feat/3.1b-per-part-apply-logic branch September 2, 2026 18:44
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.

3 participants