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: ISynchronizerEventHandler): Synchronizer
  • Parameters

    • synchronizerId: string
    • eventName: string
    • eventHandler: ISynchronizerEventHandler

    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

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