Skip to main content

Synchronizer

Synchronizer is a class that listens to a specific event on a specific source targets and fires a specific event on a specific target elements. Use cases include: synchronizing a camera between two viewports, synchronizing a windowLevel between various viewports.

Index

Constructors

constructor

  • new Synchronizer(synchronizerId: string, eventName: string, eventHandler: default, options?: any): Synchronizer
  • Parameters

    • synchronizerId: string
    • eventName: string
    • eventHandler: default
    • optionaloptions: any

    Returns Synchronizer

Properties

publicid

id: string

Methods

publicadd

  • Add a viewport to the list of targets and sources both.


    Parameters

    • viewportInfo: default

      The viewportId and its renderingEngineId to add to the list of targets and sources.

    Returns void

publicaddSource

  • addSource(viewportInfo: default): void
  • Add a viewport to the list of sources (source ONLY)


    Parameters

    • viewportInfo: default

      The viewportId and its renderingEngineId to add to the list of targets and sources.

    Returns void

publicaddTarget

  • addTarget(viewportInfo: default): void
  • Add a viewport to the list of viewports that will get the eventHandler executed when the event is fired on the source viewport.


    Parameters

    • viewportInfo: default

      The viewportId and its renderingEngineId to add to the list of targets and sources.

    Returns void

publicdestroy

  • destroy(): void
  • Returns void

publicgetOptions

  • getOptions(viewportId: string): Record<string, unknown>
  • Gets the options for the given viewport id


    Parameters

    • viewportId: string

    Returns Record<string, unknown>

publicgetSourceViewports

  • Get the list of source viewports (as {viewportId, renderingEngineId} objects)


    Returns default[]

    An array of {viewportId, renderingEngineId} objects.

publicgetTargetViewports

  • Get the list of target viewports (as {viewportId, renderingEngineId} objects)


    Returns default[]

    An array of {viewportId, renderingEngineId} objects.

publichasSourceViewport

  • hasSourceViewport(renderingEngineId: string, viewportId: string): boolean
  • Parameters

    • renderingEngineId: string
    • viewportId: string

    Returns boolean

publichasTargetViewport

  • hasTargetViewport(renderingEngineId: string, viewportId: string): boolean
  • Parameters

    • renderingEngineId: string
    • viewportId: string

    Returns boolean

publicisDisabled

  • isDisabled(): boolean
  • “Returns true if the synchronizer is disabled.”


    Returns boolean

    A boolean value.

publicremove

  • remove(viewportInfo: default): void
  • Remove the viewport from the list of targets and sources


    Parameters

    • viewportInfo: default

      The viewport info including viewportId and renderingEngineId.

    Returns void

publicremoveSource

  • removeSource(viewportInfo: default): void
  • Remove the viewport from the list of source viewports


    Parameters

    • viewportInfo: default

      The viewport info including viewportId and renderingEngineId.

    Returns void

publicremoveTarget

  • removeTarget(viewportInfo: default): void
  • Remove the viewport from the list of viewports that are currently targeted by this handler


    Parameters

    • viewportInfo: default

      The viewport info including viewportId and renderingEngineId.

    Returns void

publicsetEnabled

  • setEnabled(enabled: boolean): void
  • Sets a synchronizer enabled


    Parameters

    • enabled: boolean

    Returns void

publicsetOptions

  • setOptions(viewportId: string, options?: Record<string, unknown>): void
  • Sets the options for the viewport id. This can be used to provide configuration on a viewport basis for things like offsets to the general synchronization, or turn on/off synchronization of certain attributes.


    Parameters

    • viewportId: string
    • options: Record<string, unknown> = {}

    Returns void