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 syncViewports and connectViewports methods.
@see - Multiple Viewport Sample for an interactive demonstration.
- TwoWayViewportFrustumSync to synchronize only the frusta of the viewports.
- connectViewportViews to synchronize the state of more than two viewports.
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 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 Protected Readonly | VoidFunction[] |
Defined in
- core/frontend/src/ViewportSync.ts Line 144
Last Updated: 21 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.