Vertex Viewer SDK
    Preparing search index...

    Class StreamApi

    The API client to interact with Vertex's streaming API.

    Index
    • 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

      • payload: IBeginInteractionPayload = {}
      • withResponse: boolean = true

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

      Returns Promise<IStreamResponse>

    • 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.

      • withResponse: boolean = true

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

      Returns Promise<IStreamResponse>

    • 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

      • payload: IEndInteractionPayload = {}
      • withResponse: boolean = true

        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
      • withResponse: boolean = true

      Returns Promise<IStreamResponse>

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

      Parameters

      • payload: IGetStencilBufferPayload
      • withResponse: boolean = true

      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.

      • withResponse: boolean = true

        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
      • withResponse: boolean = true

      Returns Promise<IStreamResponse>

    • 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.

      • withResponse: boolean = true

        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

      • withResponse: boolean = true

        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

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

        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.

      • withResponse: boolean = true

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

      Returns Promise<IStreamResponse>

    • Parameters

      • payload: IUpdateStreamPayload
      • withResponse: boolean = false

      Returns Promise<IUpdateStreamResult>