Skip to main content

Class: 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.

Constructors

new Synchronizer()

new Synchronizer(synchronizerId, eventName, eventHandler, options?): Synchronizer

Parameters

synchronizerId: string

eventName: string

eventHandler: ISynchronizerEventHandler

options?: SynchronizerOptions

Returns

Synchronizer

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:45

Properties

id

id: string

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:43

Methods

add()

add(viewportInfo): void

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

Parameters

viewportInfo: IViewportId

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

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:102


addSource()

addSource(viewportInfo): void

Add a viewport to the list of sources (source ONLY)

Parameters

viewportInfo: IViewportId

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

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:111


addTarget()

addTarget(viewportInfo): 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: IViewportId

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

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:148


destroy()

destroy(): void

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:173


getOptions()

getOptions(viewportId): Record<string, unknown>

Gets the options for the given viewport id

Parameters

viewportId: string

Returns

Record<string, unknown>

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:94


getSourceViewports()

getSourceViewports(): IViewportId[]

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

Returns

IViewportId[]

An array of {viewportId, renderingEngineId} objects.

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:161


getTargetViewports()

getTargetViewports(): IViewportId[]

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

Returns

IViewportId[]

An array of {viewportId, renderingEngineId} objects.

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:169


hasSourceViewport()

hasSourceViewport(renderingEngineId, viewportId): boolean

Parameters

renderingEngineId: string

viewportId: string

Returns

boolean

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:237


hasTargetViewport()

hasTargetViewport(renderingEngineId, viewportId): boolean

Parameters

renderingEngineId: string

viewportId: string

Returns

boolean

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:247


isDisabled()

isDisabled(): boolean

"Returns true if the synchronizer is disabled."

Returns

boolean

A boolean value.

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:69


remove()

remove(viewportInfo): void

Remove the viewport from the list of targets and sources

Parameters

viewportInfo: IViewportId

The viewport info including viewportId and renderingEngineId.

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:182


removeSource()

removeSource(viewportInfo): void

Remove the viewport from the list of source viewports

Parameters

viewportInfo: IViewportId

The viewport info including viewportId and renderingEngineId.

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:191


removeTarget()

removeTarget(viewportInfo): void

Remove the viewport from the list of viewports that are currently targeted by this handler

Parameters

viewportInfo: IViewportId

The viewport info including viewportId and renderingEngineId.

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:226


setEnabled()

setEnabled(enabled): void

Sets a synchronizer enabled

Parameters

enabled: boolean

Returns

void

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:89


setOptions()

setOptions(viewportId, options): 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

Defined in

tools/src/store/SynchronizerManager/Synchronizer.ts:79