Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RealityService

A service which makes requests to manage the reality viewer.

Hierarchy

  • RealityService

Index

Constructors

constructor

Properties

Private _changeEvent

_changeEvent: Event<object> = new Event<{ previous?: string, current: string }>()

Private _connectEvent

_connectEvent: Event<SessionPort> = new Event<SessionPort>()

Private Optional _current

_current: string

Private _sessions

_sessions: SessionPort[] = []

Private contextService

contextService: ContextService

default

default: string = RealityViewer.EMPTY

The default Reality Viewer.

Private sessionService

sessionService: SessionService

Accessors

changeEvent

  • get changeEvent(): Event<object>
  • An event that is raised when the presenting reality viewer is changed.

    Returns Event<object>

connectEvent

  • An event that provides a session for sending / receiving commands to / from a reality.

    The session passed via this event can represent either endpoint of a connection between RealityViewer <--> RealityAugmenter/RealityManager.

    If running in a RealityAugmenter, the session represents a connection to a RealityViewer.

    If running in a RealityViewer, the session represents a connection to a RealityAugmenter.

    Returns Event<SessionPort>

current

  • get current(): string | undefined
  • The URI for the currently presenting Reality Viewer.

    Returns string | undefined

sessions

  • A collection of connected sessions.

    If running in a RealityAugmenter, this collection represents connections to any loaded RealityViewers.

    If running in a RealityViewer, this collection represents connections to any RealityAugmenters.

    Returns Array<SessionPort>

Methods

install

  • install(uri: string): Promise<void>
  • Install the specified reality viewer

    Parameters

    • uri: string

    Returns Promise<void>

request

  • request(uri: string): Promise<void>

resetStageGeolocation

  • resetStageGeolocation(realitySession: SessionPort): Promise<void>
  • Ask a reality to move the stage to the given geolocation

    Parameters

    Returns Promise<void>

setDesired

  • setDesired(reality: object | undefined): void
  • Deprecated. Use [[RealityService#request]]

    deprecated

    Parameters

    • reality: object | undefined

    Returns void

setStageGeolocation

  • setStageGeolocation(realitySession: SessionPort, geolocation: Cartographic): Promise<void>
  • Ask a reality to move the stage to the given geolocation

    Parameters

    • realitySession: SessionPort
    • geolocation: Cartographic

    Returns Promise<void>

uninstall

  • uninstall(uri: string): Promise<void>
  • Uninstall the specified reality viewer

    Parameters

    • uri: string

    Returns Promise<void>

Generated using TypeDoc