ImFusion Web SDK

View

A single rendering view (e.g. single anatomical plane) that is hosted inside a Display.

Extends

Extended by

Methods

MethodDescription
addObject()Add a custom GlObject to this view
removeObject()Remove a custom GlObject from this view
onVisibleDataChanged()Fires when the visible data in the view changes.
setBorderColor()Set the border color for this view.
screenshot()Creates a screenshot of the this view.
setBackgroundColor()Set the optional background color used to clear the viewport before rendering anything.

Inherited from ClassHandle

MethodDescription
isAliasOf()Returns true if this handle and other alias the same underlying C++ object.
delete()Releases this JavaScript handle.
deleteLater()Schedules this handle for deferred deletion and returns this handle.
isDeleted()Returns true if this handle has already been deleted.
[dispose]()Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually.
clone()Returns a new JavaScript handle aliasing the same underlying C++ object.

addObject()

ts
addObject(object: GlObject | null): void;

Add a custom GlObject to this view

Parameters

ParameterType
objectGlObject | null

Returns

void


removeObject()

ts
removeObject(object: GlObject | null): void;

Remove a custom GlObject from this view

Parameters

ParameterType
objectGlObject | null

Returns

void


onVisibleDataChanged()

ts
onVisibleDataChanged(callback: (before: HandleArray<Data>, after: HandleArray<Data>) => void): () => void;

Fires when the visible data in the view changes.

Parameters

ParameterTypeDescription
callback(before: HandleArray<Data>, after: HandleArray<Data>) => voidCalled with the data arrays before and after the change.

Returns

Unsubscribe function.

() => void


setBorderColor()

ts
setBorderColor(color: vec3): void;

Set the border color for this view. This color will also be reflected in the slice indicators in other views.

Parameters

ParameterType
colorvec3

Returns

void


screenshot()

ts
screenshot(withAlpha: boolean, backgroundColor: vec4):
  | Uint8Array<ArrayBufferLike>
  | undefined;

Creates a screenshot of the this view.

Parameters

ParameterTypeDescription
withAlphabooleanIf true, the screenshot will include an alpha channel.
backgroundColorvec4The background color to use for the screenshot.

Returns

| Uint8Array<ArrayBufferLike> | undefined

The screenshot as PNG encoded data.


setBackgroundColor()

ts
setBackgroundColor(color?: vec3): void;

Set the optional background color used to clear the viewport before rendering anything.

Parameters

ParameterTypeDescription
color?vec3The new background color. Omitting the parameter causes the view to not clear its viewport before rendering.

Returns

void

On this page