TwoWayViewportSync Class
Forms a bidirectional connection between two Viewports such that the ViewStates of each are synchronized with one another. For example, panning in one viewport will cause the other viewport to pan by the same distance, and changing the RenderMode of one viewport will change it in the other viewport. By default, all aspects of the views - display style, category and model selectors, frustum, etc - are synchronized, but this can be customized by subclassing and overriding the TwoWayViewportSync.syncViewports and connectViewports methods.
see Multiple Viewport Sample for an interactive demonstration.
see TwoWayViewportFrustumSync to synchronize only the frusta of the viewports.
see connectViewportViews to synchronize the state of more than two viewports.
extensions
Extended by
Methods
Name | Description | |
---|---|---|
constructor(): TwoWayViewportSync | ||
connect(viewport1: Viewport, viewport2: Viewport): void | Establish the connection between two Viewports. | |
connectViewports(source: Viewport, target: Viewport): void Protected | Invoked from TwoWayViewportSync.connect to set up the initial synchronization between the two viewports. | |
disconnect(): void | Remove the connection between the two views. | |
syncViewports(source: Viewport, target: Viewport): void Protected | Invoked each time source changes to update target to match. |
Properties
Name | Type | Description | |
---|---|---|---|
_disconnect ProtectedReadonly | VoidFunction[] |
Defined in
- core/frontend/src/ViewportSync.ts Line 144
Last Updated: 20 June, 2023