Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ViewService

Manages the view state

Hierarchy

  • ViewService

Index

Constructors

constructor

Properties

Private _currentViewportJSON

_currentViewportJSON: string

Private _desiredViewportMode

_desiredViewportMode: ViewportMode = this.viewportMode

Private _embeddedViewport

_embeddedViewport: Viewport = new Viewport

Private _layers

_layers: object[] = []

Type declaration

Private _mode

_mode: ViewportMode = ViewportMode.EMBEDDED

Private _renderHeight

_renderHeight: number = 0

Private _renderWidth

_renderWidth: number = 0

Private _subviewFrustum

_subviewFrustum: PerspectiveFrustum[] = []

Private _subviewPose

_subviewPose: EntityPose[] = []

Private _subviews

_subviews: Subview[] = []

Private _viewport

_viewport: Viewport = new Viewport

autoLayoutImmersiveMode

autoLayoutImmersiveMode: boolean = true

Automatically layout the element to match the immersive viewport during PresentationMode.IMMERSIVE

autoPublishEmbeddedMode

autoPublishEmbeddedMode: boolean = true

Automatically publish the viewport of the element during PresentationMode.EMBEDDED

autoStyleLayerElements

autoStyleLayerElements: boolean = true

Automatically style layer elements

element

element: HTMLElement

The DOM element associated with this viewport

Private focusService

focusService: FocusService

Private sessionService

sessionService: SessionService

uiEvent

uiEvent: Event<object> = new Event<{event:UIEvent|MouseEvent|TouchEvent|PointerEvent|WheelEvent, forwardEvent:()=>void}>()

UI events that occur within this view. To handle an event (and prevent it from being forwarded to another layer) call event.stopImmediatePropagation().

viewportChangeEvent

viewportChangeEvent: Event<CanvasViewport> = new Event<CanvasViewport>()

An event that is raised when the viewport has changed

viewportModeChangeEvent

viewportModeChangeEvent: Event<ViewportMode> = new Event<ViewportMode>()

An event that is raised when the viewport mode has changed

Accessors

desiredViewportMode

layers

  • get layers(): Array<object>

Protected presentationMode

renderHeight

  • get renderHeight(): number
  • The height which should be used for the render buffer

    Returns number

renderWidth

  • get renderWidth(): number
  • The width which should be used for the render buffer

    Returns number

subviews

viewport

viewportMode

Methods

_processContextFrameState

Private _updateViewport

Private _updateViewportMode

Private _watchEmbeddedViewport

  • _watchEmbeddedViewport(): void

Private getSubviews

getViewport

publishEmbeddedViewport

  • publishEmbeddedViewport(viewport?: Viewport): void
  • Publish the viewport being used in [[PresentationMode.EMBEDDED]] so that the manager knows what our embedded viewport is

    Parameters

    Returns void

requestPresentationMode

  • requestPresentationMode(mode: ViewportMode): Promise<void>

sendUIEventToSession

  • sendUIEventToSession(uievent: UIEvent, session?: SessionPort): void

setLayers

  • setLayers(layers: object[]): void

Generated using TypeDoc