The Selection Handling Viewer demonstrates scene picking and highlight state for model nodes, model shapes, and drawing elements. It is the first example to focus on interaction rather than only loading and visibility.

Use this example to study interactive selection:
The shared SelectionHandlingViewer extends the base viewer by adding a highlight manager to each visualization state. The React page owns the mode switcher and the notification text shown after selection changes.
| Source | Description |
|---|---|
SelectionHandlingViewerreact/src/pages/selection-handling-viewer/SelectionHandlingViewer.tsx | Main page component. It renders upload controls, visualization switching, highlight-mode controls, notification output, and the viewport. |
VisualizationStatusSwitcherreact/src/features/visualization-status-switcher/VisualizationStatusSwitcher.tsx | Lets the user switch between available model and drawing visualization states. |
useSelectionVisualizationContextreact/src/features/visualization-context/useSelectionVisualizationContext.ts | Mirrors viewer state and highlight-manager changes into React state. |
useNotificationreact/src/common/hooks/useNotification.ts | Stores user-facing selection feedback after highlight events. |
Canvasreact/src/features/canvas/Canvas.tsx | Provides the mounted canvas for raycasting and rendering. |
| Source | Description |
|---|---|
SelectionHandlingViewershared/src/viewers/selection-handling-viewer/SelectionHandlingViewer.ts | Extends BaseModelViewer, creates model or drawing highlight managers for each visualization state, and disposes them on state changes. |
ModelHighlightManagershared/src/features/model/interaction/ModelHighlightManager.ts | Maps model-node, face, and edge references to visual highlight state. |
DrawingHighlightManagershared/src/features/drawing/interaction/DrawingHighlightManager.ts | Maps drawing intersections and references to visual highlight state. |
SceneRaycastershared/src/features/viewport/interaction/SceneRaycaster.ts | Converts pointer events into Three.js intersections and highlight-manager input. |
ObjectStyleHighlighter and ObjectPassHighlightershared/src/features/viewport/interaction/highlighter/ | Apply the visual highlight styles used by selection modes. |
shared/src/features/model/interaction/ | Maps viewport intersections to model nodes and shapes. |