Repository navigation
fix: fix cross section position for apis that clear the scene - #239
Open
LKasianAnsys wants to merge 2 commits into
Open
LKasianAnsys wants to merge 2 commits into
LKasianAnsys wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Resolves #238
Summary
Addresses a bug on main observed in both CLIENT and SERVER mode: running the
startAPI with a dataset afteradd_datasethad previously been called, results in the new dataset from thestartAPI call not appearing in the viewer console.The bug
Expected behaviour of the
startAPI:If a scene already contained one or more datasets, running
startwith no dataset provided would bring up the old scene; runningstartwith a dataset provided as input would clear the scene and start a fresh scene with only the dataset that was provided as input.Observed behaviour when the
startAPI is called:Root cause: the renderer saves the cross-section plane position the first time it places it (fitted to the first dataset). On every later placement it puts that saved position back, so that a user-dragged plane survives part toggles. But
clear()never discarded that saved position, and the renderer couldn't tell a default position from a deliberately set one. After start cleared the scene, the new dataset got the plane fitted to the old dataset.Fix summary
The renderer now records whether the cross-section plane was placed on purpose, through
sync_cross_section_plane(a client or server drag, orload_state). If it wasn't,update_boundsrecomputes the default plane from the current scene bounds on every dataset add.VisorSceneBase.clear()now calls the newreset_cross_section_plane(), so start, update and clear all discard any previous plane and the next dataset gets a correct default position. A deliberately placed plane is still preserved until the next clear.