Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SdvCtrlUtils

Index

Properties

Static addToAssetQueue

addToAssetQueue: (assets: Scene.SceneAsset[], sdCtrlName?: string) => void = ...

Type declaration

    • (assets: Scene.SceneAsset[], sdCtrlName?: string): void
    • Adds assets to the update queue but does not trigger the update yet.
      This function can be used to accumulate various assets before executing the asset update.
      => Use processAssetQueue for executing the accululated asset updates.

      Parameters

      • assets: Scene.SceneAsset[]
      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns void

Static addToCameraQueue

addToCameraQueue: (target: string | Camera.CameraDefinition | Api.ScenePathType[] | THREE.Box3, isZoomCommand: boolean, transitionMS?: number, sdCtrlName?: string) => void = ...

Type declaration

    • (target: string | Camera.CameraDefinition | Api.ScenePathType[] | THREE.Box3, isZoomCommand: boolean, transitionMS?: number, sdCtrlName?: string): void
    • Adds a camera or zoom command to the camera queue but does not trigger the update yet.
      This function can be used to accumulate various camera commands before executing the camera update.
      => Use processCameraQueue for executing the accumulated camera commands.

      Parameters

      • target: string | Camera.CameraDefinition | Api.ScenePathType[] | THREE.Box3

        Camera position or zoom target

      • isZoomCommand: boolean

        Defines the type of camera queue entry (false: move camera, true: zoom camera)

      • Optional transitionMS: number

        Duration of the movement in milliseconds

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns void

Static addToParamQueue

addToParamQueue: (title: string, value: string | number | boolean | Blob, sdCtrlName?: string) => void = ...

Type declaration

    • (title: string, value: string | number | boolean | Blob, sdCtrlName?: string): void
    • Adds a parameter to the update queue but does not trigger the update yet.
      This function can be used to accumulate various parameter values before executing the parameter update. => Use processParamQueue for executing the accumulated parameter values.

      Parameters

      • title: string
      • value: string | number | boolean | Blob
      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns void

Static getSDApi

getSDApi: (sdCtrlName?: string) => Promise<Api.ApiInterfaceV2> = ...

Type declaration

    • (sdCtrlName?: string): Promise<Api.ApiInterfaceV2>
    • Function for receiving the API of a shapediver instance.
      This function will first wait until the communication plugin of the corresponding shapediver instance is ready.

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<Api.ApiInterfaceV2>

Static getSDApiSync

getSDApiSync: (sdCtrlName?: string) => Api.ApiInterfaceV2 | undefined = ...

Type declaration

    • (sdCtrlName?: string): Api.ApiInterfaceV2 | undefined
    • Function for receiving the API of a shapediver control instance.
      This function will not wait for any shapediver event, instead it will return undefined immediatly, if there is no API available at this time.

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Api.ApiInterfaceV2 | undefined

Static getSDCtrl

getSDCtrl: (sdCtrlName?: string) => ShapeDiver3dEmbedded | undefined = ...

Type declaration

    • Function for receiving shapediver instance

      Parameters

      • Optional sdCtrlName: string

        If the parameter is used, the shapediver instance with the corresponding name will be fetched.
        If parameter is not used, the first available shapediver instance of the configurator will be returned.

      Returns ShapeDiver3dEmbedded | undefined

Static processAssetQueue

processAssetQueue: (sdCtrlName?: string) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • Executes an asset update with all entries from the asset queue

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<SDUpdateQueueResult>

Static processCameraQueue

processCameraQueue: (sdCtrlName?: string) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • Execute a camera update with all entries from the camera queue

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<SDUpdateQueueResult>

Static processParamQueue

processParamQueue: (sdCtrlName?: string) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • Executes a parameter update with all entries from the parameter queue

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<SDUpdateQueueResult>

Static removeAssets

removeAssets: (filter?: Scene.SceneAssetFilter, sdCtrlName?: string, queued?: boolean) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • (filter?: Scene.SceneAssetFilter, sdCtrlName?: string, queued?: boolean): Promise<SDUpdateQueueResult>
    • Removes assets from the scene.
      Further information about the possible filter options can be found in ShapeDiver docs.

      Parameters

      • Optional filter: Scene.SceneAssetFilter
      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      • queued: boolean = false

        true: Assets will be removed after all other pending asset updates or asset remove requests have been finished. false: Assets will be removed in the next JS cycle, no matter if other asset updates or asset remove requrests are currently pending.

      Returns Promise<SDUpdateQueueResult>

Static setCameraPos

setCameraPos: (pos: string | Camera.CameraDefinition, transitionMS?: number, sdCtrlName?: string, queued?: boolean) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • (pos: string | Camera.CameraDefinition, transitionMS?: number, sdCtrlName?: string, queued?: boolean): Promise<SDUpdateQueueResult>
    • Move the camera to a desired position

      Parameters

      • pos: string | Camera.CameraDefinition

        An object or JSON string including an "position" & "target" object.
        See https://viewer.shapediver.com/v2/staging/doc/module-CameraApi-CameraApi.html#updateAsync for further info.

      • Optional transitionMS: number

        Duration of the movement in milliseconds

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      • queued: boolean = false

        true: Execute camera movement after all previously added movement commands have been finished.
        false: Abort current and pending movement commands and move to the desired position immediatly.

      Returns Promise<SDUpdateQueueResult>

Static setParamValue

setParamValue: (title: string, value: string | boolean | number | Blob, sdCtrlName?: string, queued?: boolean) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • (title: string, value: string | boolean | number | Blob, sdCtrlName?: string, queued?: boolean): Promise<SDUpdateQueueResult>
    • Set parameter value of the model.
      Changes are not sent immediatly but forwarded to a designated queue instead (see description of queued parameter).

      Parameters

      • title: string
      • value: string | boolean | number | Blob
      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      • queued: boolean = false

        true: Parameter will be applied after all currently pending parameter updates are finished.
        In this case the current parameter update will not be aborted, which could otherwise lead to missing or erronous parameter updates.
        false: Parameter will be applied in the next JS cycle, no matter if other parameter updates are currently pending.
        Parameter updates which are triggered within the same JS cycle are accumulated and applied in one update.\

      Returns Promise<SDUpdateQueueResult>

Static updateAssets

updateAssets: (assets: Scene.SceneAsset[], sdCtrlName?: string, queued?: boolean) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • (assets: Scene.SceneAsset[], sdCtrlName?: string, queued?: boolean): Promise<SDUpdateQueueResult>
    • Adds or updates assets to the 3d scene.
      Further information about the desired asset structure can be found in ShapeDiver docs.

      Parameters

      • assets: Scene.SceneAsset[]
      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      • queued: boolean = false

        true: Assets will be updated after all currently pending asset updates are finished.
        In this case the current asset update will not be aborted, which could otherwise lead to missing or erronous asset updates.
        false: Assest will be updated in the next JS cycle, no matter if other asset updates are currently pending.
        Asset updates which are triggered within the same JS cycle are accumulated and applied in one update.

      Returns Promise<SDUpdateQueueResult>

Static updateHtmlAnchor

updateHtmlAnchor: (htmlAssets: HtmlAnchorAsset[], sdCtrlName?: string, queued?: boolean) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • Function for adding and updating anchor assets with a customizable HTML string as content.
      Adding, removing and updating the asset position is already handled within this function, whereas these tasks can be exchanged or extended by the user to solve specific use cases.

      See Release Notes for a detailed description of this functionality.

      Parameters

      • htmlAssets: HtmlAnchorAsset[]

        Configuration of assets which should be updated, see Cbn.CJS.HtmlAnchorAsset for detailed info

      • Optional sdCtrlName: string

        Optional name of the associated Shapediver control.
        If not configured, the first shapediver instance of the configurator is used.

      • queued: boolean = false

        true: Assets will be updated after all currently pending asset updates are finished.
        In this case the current asset update will not be aborted, which could otherwise lead to missing or erronous asset updates.
        false: Assets will be updated in the next JS cycle, no matter if other asset updates are currently pending.
        Asset updates which are triggered within the same JS cycle are accumulated and applied in one update.

      Returns Promise<SDUpdateQueueResult>

Static waitForCommPluginReady

waitForCommPluginReady: (sdCtrlName?: string) => Promise<void> = ...

Type declaration

    • (sdCtrlName?: string): Promise<void>
    • Function for waiting until the comm plugin of a shapediver instance is ready

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<void>

Static waitForSceneVisible

waitForSceneVisible: (sdCtrlName?: string) => Promise<void> = ...

Type declaration

    • (sdCtrlName?: string): Promise<void>
    • Function for waiting until the scene of a shapediver instance is visible

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<void>

Static waitForSettingsRegistered

waitForSettingsRegistered: (sdCtrlName?: string) => Promise<void> = ...

Type declaration

    • (sdCtrlName?: string): Promise<void>
    • Function for waiting until the model settings are registered.
      At this point custom settings can be applied safely without getting overwritten by model settings.

      Parameters

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      Returns Promise<void>

Static zoomCamera

zoomCamera: (scenePathsOrBB?: Api.ScenePathType[] | THREE.Box3, transitionMS?: number, sdCtrlName?: string, queued?: boolean) => Promise<SDUpdateQueueResult> = ...

Type declaration

    • (scenePathsOrBB?: Api.ScenePathType[] | THREE.Box3, transitionMS?: number, sdCtrlName?: string, queued?: boolean): Promise<SDUpdateQueueResult>
    • Zoom in on a certain part of the scene without modifying the camera direction

      Parameters

      • Optional scenePathsOrBB: Api.ScenePathType[] | THREE.Box3

        The zooming target, this can either be a certain scene path within the 3d model, a bounding box or the whole visible scene if the parameter is left empty

      • Optional transitionMS: number

        Duration of the movement in milliseconds

      • Optional sdCtrlName: string

        If not configured, the first shapediver instance of the configurator is used

      • queued: boolean = false

        true: execute camera movement after all previously added movement commands have been finished
        false: Abort current and pending movement commands and move to the desired position immediatly

      Returns Promise<SDUpdateQueueResult>

Generated using TypeDoc