ViewManager Class
The ViewManager holds the list of opened views, plus the selected view. It also provides notifications of view open/close and suspend/resume. Applications must call addViewport when new Viewports that should be associated with user events are created.
A single ViewManager is created when startup is called. It can be accessed via the static member viewManager.
The ViewManager controls the render loop, which causes the contents of each registered Viewport to update on the screen.
Implements
- Iterable<ScreenViewport>
Methods
Name | Description | |
---|---|---|
constructor(): ViewManager | ||
[iterator](): Iterator<ScreenViewport, any, any> | Iterate over the viewports registered with the view manager. | |
addDecorator(decorator: Decorator): () => void | Add a new Decorator to display decorations into the active views. | |
addToolTipProvider(provider: ToolTipProvider): () => void | Register a new ToolTipProvider to customize the locate tooltip. | |
addViewport(newVp: ScreenViewport): BentleyStatus | Add a new Viewport to the list of opened views and create an EventController for it. | |
clearSelectedView(): void | Set the selected Viewport to undefined. | |
dropDecorator(decorator: Decorator): boolean | Drop (remove) a Decorator so it is no longer active. | |
dropToolTipProvider(provider: ToolTipProvider): void | Drop (remove) a ToolTipProvider so it is no longer active. | |
dropViewport(vp: ScreenViewport, disposeOfViewport: booleantrue): BentleyStatus | Remove a Viewport from the list of opened views, and optionally dispose of it. | |
getElementToolTip(hit: HitDetail): Promise<string | HTMLElement> | Compute the tooltip for a persistent element. | |
getFirstOpenView(): undefined | ScreenViewport | Get the first opened view. | |
hasViewport(viewport: ScreenViewport): boolean | Returns true if the specified viewport is currently being managed by this ViewManager. | |
invalidateCachedDecorationsAllViews(decorator: ViewportDecorator): void | Instruct each registered Viewport that the cached Decorations for the specified decorator should be discarded and recreated on the next frame. |
|
invalidateDecorationsAllViews(): void | Force each registered Viewport to regenerate its Decorations on the next frame. | |
invalidateScenes(): void | Requests that createScene be invoked for every viewport on the next frame. | |
invalidateSymbologyOverridesAllViews(): void | Force each registered Viewport to regenerate its Overrides on the next frame. | |
setAntialiasingAllViews(numSamples: number): void | Sets the number of MSAA samples for all currently- and subsequently-opened ScreenViewports. | |
setSelectedView(vp: ScreenViewport): Promise<BentleyStatus> | Sets the selected Viewport. | |
setViewCursor(cursor: string"default"): void | Change the cursor shown in all Viewports. |
Properties
Name | Type | Description | |
---|---|---|---|
crossHairCursor Accessor ReadOnly | string | ||
cursor | string | ||
decorators Readonly | Decorator[] | ||
dynamicsCursor Accessor ReadOnly | string | ||
grabbingCursor Accessor ReadOnly | string | ||
grabCursor Accessor ReadOnly | string | ||
inDynamicsMode | boolean | ||
lookCursor Accessor ReadOnly | string | ||
onBeginRender Readonly | BeEvent<() => void> | Called at the beginning of each tick of the render loop, before any viewports have been updated. | |
onFinishRender Readonly | BeEvent<() => void> | Called at the end of each tick of the render loop, after all viewports have been updated. | |
onSelectedViewportChanged Readonly | BeUiEvent<SelectedViewportChangedArgs> | Called after the selected view changes. | |
onViewClose Readonly | BeUiEvent<ScreenViewport> | Called after a view is closed. | |
onViewOpen Readonly | BeUiEvent<ScreenViewport> | Called after a view is opened. | |
onViewResume Readonly | BeUiEvent<ScreenViewport> | Called after a suspended view is resumed. | |
onViewSuspend Readonly | BeUiEvent<ScreenViewport> | Called after a view is suspended. | |
rotateCursor Accessor ReadOnly | string | ||
selectedView Accessor ReadOnly | undefined | ScreenViewport | The "selected view" is the default for certain operations. | |
walkCursor Accessor ReadOnly | string | ||
zoomCursor Accessor ReadOnly | string |
Defined in
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.