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:53

Properties​

id​

id: string

Defined in​

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

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:111


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:120


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:158


destroy()​

destroy(): void

Returns​

void

Defined in​

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


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:103


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:171


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:179


hasSourceViewport()​

hasSourceViewport(renderingEngineId, viewportId): boolean

Parameters​

• renderingEngineId: string

• viewportId: string

Returns​

boolean

Defined in​

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


hasTargetViewport()​

hasTargetViewport(renderingEngineId, viewportId): boolean

Parameters​

• renderingEngineId: string

• viewportId: string

Returns​

boolean

Defined in​

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


isDisabled()​

isDisabled(): boolean

"Returns true if the synchronizer is disabled."

Returns​

boolean

A boolean value.

Defined in​

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


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:192


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:201


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:234


setEnabled()​

setEnabled(enabled): void

Sets a synchronizer enabled

Parameters​

• enabled: boolean

Returns​

void

Defined in​

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


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:88