Repository navigation
feat: [Remote rendering 3.5b] client uses server owned variables - #153
LKasianAnsys wants to merge 9 commits into
Conversation
a6e2619 to
328ccf1
Compare
c04cb7f to
77400e7
Compare
c74c908 to
bf18e1b
Compare
08b8ab1 to
be7deda
Compare
bf18e1b to
40fb6b1
Compare
40fb6b1 to
857b098
Compare
… registered on a failed rebuild
ansBAkula
left a comment
There was a problem hiding this comment.
@LKasianAnsys Cool stuff again.
I tried to break the "a dataset containing an array with a component count the client has no labels for" case by manually setting numComponents to 14 in the state JSON file and then loading it back. However, it loaded successfully and did not throw any error.
Also, you mentioned that labels are currently supported for component counts 1, 2, 3, 4, and 9. I can easily map 1, 2, 3, and 9 to common field types, but I'm curious about 4. What kind of field or use case does the 4-component label correspond to?
|
@ansBAkula Thanks! Yes, editing To hit that path, you need actual data with an unsupported width, for example a dataset where at least one part has a 6-component array. With the latest commit on this branch it should not throw an error: If you do test on a dataset with, say, a 6-component variable, you should see the following:
For the 4-component with: yes good question. It looks like we display this as [ |
Issue
Addresses #23
Context
This is the second PR for user story 3.5 in Phase 3 of the remote rendering epic, which sees the visualizer state authority move from client to server.
In this PR, the client stops owning the variable definition on its end, and treats
VisorVariableManageras a projection of the delivered records. Custom range edits are sent to the server and re-delivered.Callouts:
add_dataset, which is attributable to the fact that the client still replaces the color lookup tables. This is resolved in the PR for 3.5c (feat: [Remote rendering 3.5c] Server creates color lookup table and client stops creating its own #161), where the lookup tables are created only on the server.onServerUpdateAsyncinApp.tsx) no longer carries variable state. The delivered record is the only source after a rebuild.Pre-existing issue fix:
main.setRecordsnow skips a record whose component count has no label definition with one console warning instead of refusing the whole delivery. The server still lists such variables, but the client does not display them.onServerUpdateAsyncnow registers its server listeners in afinallyblock, so a failed rebuild can no longer leave the page silently ignoring later pushes.What to look for:
add_datasetadd_dataset.To test the last bullet point, run the following:
examples/assets/vtk_scene_sphere_l2_b3_r32_v3_c1_z0.vtm), and color a part by a variable with range [0, 1] (e.g. gradient)add_datasetto add a dataset with the same variable but having a wider range (egvtk_scene_sphere_l2_b3_r32_v3_c1_s2_z6.vtm, which has [0, 2] on the same variable).This should result in the new default range being applied to all parts colored by that variable. Run the same test after having set a custom variable range on before adding the second variable, and the custom range should be preserved after
add_dataset.Copilot summary
This pull request shifts variable state ownership to the server. The client now reads and applies variable records delivered by the server, rather than maintaining its own copies. This results in a cleaner separation of responsibilities and improved synchronization between client and server variable states. The changes also include improved handling of variable range updates, more robust frontend rebuilds, and enhanced panel refresh logic.
Variable State Ownership and Synchronization:
VisorFrontendclass now includes asendVariableRangeAsyncmethod to report variable range changes to the server, with errors logged but not rethrown, and updates thesetVariableRangeAsyncmethod to always notify the server after applying a range locally. [1] [2] [3]Frontend and UI Handling:
App.tsxto ensure event listeners are consistently managed and that the new frontend instance is only set after successful initialization. [1] [2] [3]refreshSelectionAsyncmethod, allowing the UI to re-read and display the current selection's variable ranges after state updates. [1] [2] [3] [4] [5]Scene Graph and Variable Application:
Testing and Utilities: