Vertex Viewer SDK
    Preparing search index...

    Class ViewerStream

    Hierarchy

    • StreamApi
      • ViewerStream
    Index

    Constructors

    Properties

    stateChanged: EventDispatcher<ViewerStreamState> = ...

    Methods

    • Sends a request to signal to the rendering pipeline that an interaction has started. The rendering pipeline will use this as a hint to perform more aggressive rendering optimizations at the expense of rendering quality. Call endInteraction to signal to the rendering pipeline that an interaction has finished.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • Optionalpayload: IBeginInteractionPayload
      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Initiates a websocket connection to Vertex's streaming API. Returns a promise that resolves once the connection is established and can begin accepting messages.

      Parameters

      • descriptor: ConnectionDescriptor

        A function that returns a description of how to establish a WS connection.

      • Optionalsettings: Settings

        A configuration to use when initializing the WS connection.

      Returns Promise<Disposable>

    • Sends a request to perform an alteration to a scene. Alterations include changing item visibility and changing the materials of items.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: ICreateSceneAlterationPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Closes any open WS connections and disposes of resources.

      Returns void

    • Sends a request to tell the rendering pipeline that an interaction has ended.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • Optionalpayload: IEndInteractionPayload
      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IBeginInteractionResult>

    • Sends a request to update the position of the scene's camera as a fly operation

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IFlyToPayload
      • OptionalwithResponse: boolean

      Returns Promise<IStreamResponse>

    • Sends a request to get a stencil buffer image for the current scene view.

      Parameters

      • payload: IGetStencilBufferPayload
      • OptionalwithResponse: boolean

      Returns Promise<IStreamResponse>

    • Sends a request to perform hit detection.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IHitItemsPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to update the current scene view with the state present in the specified scene view state.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: ILoadSceneViewStatePayload
      • OptionalwithResponse: boolean

      Returns Promise<IStreamResponse>

    • Adds a callback that is invoked when the websocket connection is closed.

      Parameters

      • handler: CloseEventHandler

        A handler function.

      Returns Disposable

    • Adds a callback that is invoked when the client receives an event from the server. Returns a Disposable that can be used to remove the listener.

      Parameters

      • handler: EventMessageHandler

        A handler function.

      Returns Disposable

    • Adds a callback that is invoked when the client receives a request from the server. Returns a Disposable that can be used to remove the listener.

      Parameters

      • handler: RequestMessageHandler

        A handler function.

      Returns Disposable

    • Sends a request to reconnect to an existing streaming session.

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IReconnectPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to record performance timings that were measured in the client. The server may use these timings as hints to optimize the rendering performance to provide a better experience.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IRecordPerformancePayload

        The request payload

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to retrieve a new token. This token can be used to authenticate with other Vertex services.

      Parameters

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response.

      Returns Promise<IStreamResponse>

      A promise that completes with the refreshed token.

    • Sends a request to update the position of the scene's camera.

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IUpdateCameraPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Acknowledges a failed request by sending a reply back to the server.

      Parameters

      • reqId: string

        The ID of the received request.

      • error: IError

        An error to reply with.

      Returns void

    • Acknowledges a successful request by sending a reply back to the server with an optional result body.

      Parameters

      • reqId: string

        The ID of the received request.

      • result: Pick<Pick<IStreamResponse, "drawFrame">, "drawFrame"> & Required<{}>

        A result to reply with.

      Returns void

    • Sends a request to reset all overrides for a given scene and optionally to reset the camera to that of the base scene.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IResetViewPlayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to initiate a streaming session.

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IStartStreamPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to sync the clocks between the client and server.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: ISyncTimePayload

        The request payload.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to update the cross sectioning planes of the frame.

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IUpdateCrossSectioningPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to update the dimensions of the frame.

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IUpdateDimensionsPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to update the specified interaction.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IUpdateInteractionPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Sends a request to set or clear the model view of the frame.

      The payload accepts an optional frameCorrelationId that will be sent back on the frame that is associated to this request. Use onRequest to add a callback that'll be invoked when the server sends a request to draw the frame.

      Use withResponse to indicate if the server should reply with a response. If false, the returned promise will complete immediately. Otherwise, it'll complete when a response is received.

      Parameters

      • payload: IUpdateModelViewPayload

        The payload of the request.

      • OptionalwithResponse: boolean

        Indicates if the server should reply with a response. Defaults to true.

      Returns Promise<IStreamResponse>

    • Parameters

      • payload: IUpdateStreamPayload
      • OptionalwithResponse: boolean

      Returns Promise<IUpdateStreamResult>