Entry point for the Visual API.

Constructors

  • Constructor.

    Parameters

    • element: string | HTMLCanvasElement

      The canvas element that will be used for rendering and creating the WebGLContext.

    Returns Visual

Accessors

  • get analytics(): AnalyticsUtility
  • Gets the analytic event utility wrapper.

    Returns AnalyticsUtility

    The analytic event utility wrapper.

  • get camera(): CameraUtility
  • Gets the camera utility wrapper.

    Returns CameraUtility

    The camera utility wrapper.

  • get canvasElement(): HTMLCanvasElement
  • Gets the canvas element of Atlatl Visual.

    Returns HTMLCanvasElement

    The HTML Canvas element associated with the Visual.

  • get destroyed(): boolean
  • State of instance destructions.

    Returns boolean

    The state of instance destructions.

  • get deviceInfo(): DeviceInfo
  • Gets the device information wrapper.

    Returns DeviceInfo

    The device information wrapper.

  • get id(): string
  • The unique id associated with this Visual instance.

    Returns string

    The unique id that is associated with this Visual instance.

  • get loadingScreen(): LoadingScreen
  • Gets the loading screen of Atlatl Visual. It can be used for showing/hiding the loading screen.

    Returns LoadingScreen

    The loading screen component associated with the Visual.

  • get sessionID(): string
  • Returns the session ID that is used for Atlatl Visual.

    Returns string

    The session ID.

  • get buildNumber(): number
  • Gets the build number of Atlatl Visual. It is the last number within the version string.

    Returns number

  • get env(): string
  • Gets the environment that Atlatl Visual communicates with.

    Returns string

  • get version(): string
  • Gets the version of Atlatl Visual in the format v.v.v.b. 'v' being the semantic version and 'b' being the build number.

    Returns string

Methods

  • Captures an image that represents the current scene.

    Parameters

    • Optional options: ImageCaptureOptions

      Parameters that modify the image that will be captured. If no imageHandler is provided, a png image will be downloaded to the user's Downloads folder.

    Returns Promise<string>

    A promise that resolves with the base64 encoded string for the image, once the screenshot has been taken.

  • Creates model viewer element

    Returns Promise<HTMLElement>

    A promise that resolves with model viewer HTML element

  • Destroys the Visual instance.

    Returns Promise<void>

    Resolves when the instance, associated canvas and product templates are destroyed.

  • Gets all the ProductTemplate instances that have been loaded and are associated with this Visual instance.

    Returns ProductTemplate[]

    A list of all ProductTemplate instances that have been loaded.

  • Gets a ProductTemplate instance with the specified namespace, name, and version. Will throw an error if the ProductTemplate cannot be found.

    Parameters

    • namespace: string

      The namespace of the ProductTemplate to get.

    • name: string

      The name of the ProductTemplate to get.

    • Optional version: number

      The version of the ProductTemplate to get. If not specified, the first template matching the namespace and name will be returned.

    Returns ProductTemplate

    The ProductTemplate that matches the namespace, name, and version that was passed in, if any.

  • Gets a ProductTemplate instance matching the passed in id.

    Parameters

    • id: string

      The unique id associated with the ProductTemplate

    Returns ProductTemplate

    The ProductTemplate that matches the id that is passed in.

  • Gets all the ProductTemplate instances that are associated with this Visual instance.

    Returns ProductTemplate[]

    A list of all ProductTemplate instances.

  • Initializes runtime, gets and stores client and ci info

    Parameters

    • client: string

      The client ID to use to get the info from the appropriate services

    • Optional options: InitOptions

      The set of options to be used during initialization.

    Returns Promise<void>

    A resolved promise once the client has been authorized

  • Registers a callback function to be invoked when the specified event occurs.

    Parameters

    • name: "cameraMove"

      The name of the event to listen for.

    • Optional callback: (() => Promise<void>)

      An optional callback function to be invoked when the event occurs.

        • (): Promise<void>
        • Returns Promise<void>

    Returns Promise<void>

    A promise that will resolve once the event is completed

  • Sets the background/clear color for the canvas.

    Parameters

    • color: number[]

      The background color to set.

    Returns void

  • Sets the environment to use.

    Parameters

    • name: string

      The name of the environment.

    Returns Promise<void>

    A promise that resolves when the environment is set.

  • Transitions the camera to the specified location within a specified time.

    Parameters

    Returns Promise<void>

    A promise that resolves when the transition finishes.

  • Gets a ProductTemplate instance with the specified namespace, name, and version. Will return null if the ProductTemplate cannot be found.

    Parameters

    • namespace: string

      The namespace of the ProductTemplate to get.

    • name: string

      The name of the ProductTemplate to get.

    • Optional version: number

      The version of the ProductTemplate to get.

    Returns ProductTemplate

    The ProductTemplate that matches the namespace, name, and version that was passed in, if any.

  • Retrieves the Visual instance associated with the given ID.

    Parameters

    • id: string

      The ID of the instance we want to retrieve.

    Returns Visual

    The Visual instance that was created with the specified ID.

  • Retrieves all instantiated Visual instances.

    Returns Visual[]

    A list of all the Visual instances that have been created.

Generated using TypeDoc