feat: isolate selection with adjustable context opacity - #797
Draft
maxkrut wants to merge 1 commit into
Draft
Conversation
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.
Add
Highlighter.isolationto isolate the select style while showing its surrounding model with adjustable opacity:Zero hides context; positive values multiply the original material opacity and preserve context colors. Selected materials retain their highlight. Newly streamed materials receive the same factor, and positive slider changes reuse graphics materials without enumerating all IFC item IDs or creating worker highlight definitions. The example slider has a 1% step; the API accepts finite values from 0 to 1.
Selection changes follow active isolation; clearing selection or resetting shows all items. Call
refresh()after loading another model. Isolation owns item visibility while active, like Hider; it does not restore an earlier arbitrary visibility filter.A null select material, or selected items painted by a higher-priority overlapping style, causes an explicit rejection for translucent isolation. An overlap introduced while active resets isolation and reports the error; style membership and priorities are preserved. Disposal cancels updates and restores materials synchronously; call
reset()first when keeping the scene and restoring item visibility.Validation: Node regression tests (
yarn test:isolation) cover streamed materials, glass opacity, 100 slider changes, selection/clear, invalid values, worker rejection, request settlement races, in-flight disposal and integration with Highlighter. TypeScript and library builds pass; the standalone example uses the existing public school model. No new dependencies or core-package API changes.