class sap.ui.vk.Viewer

Control sample: sap.ui.vk.Viewer
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/vk/Viewer
Application Component: CA-UI5-VTK

Provides simple 3D visualization capability by connecting, configuring and presenting the essential Visualization Toolkit controls a single composite control.


Constructor

Constructor for a new Viewer.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.vk.Viewer(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new Viewer control, generated automatically if no ID is given

mSettings? object

initial settings for the new Viewer control


Properties

Name Type Default Value Description
enableNotifications boolean true

Disables the Message Popover Control

Visibility: public
enableOverlay boolean false

Enables or disables the Overlay control

Visibility: public
enableProgressIndicator boolean true

Enable / disable progress indicator for downloading and rendering VDS files

Visibility: public
enableSceneTree boolean true

Disables the scene tree control Button on the menu

Visibility: public
enableStepNavigation boolean true

Disables the Step Navigation Control Button on the menu

Visibility: public
enableToolbar boolean true

Shows or hides Toolbar control

Visibility: public
height sap.ui.core.CSSSize

Height of the Viewer control

Visibility: public
hotspotColor sap.ui.core.CSSColor rgba(255, 0, 0, 0.7529411764705882)

Color used for highlighting Smart2D hotspots in the CSS Color format.

Visibility: public
hotspotColorABGR int 3221225727

Color used for highlighting Smart2D hotspots in the ABGR format.

Visibility: public
overlayStepNavigation boolean false

If enabled the Step Navigation will be overlayed on top of the viewport. Only set this during initialization. Will not work when set at runtime.

Visibility: public
recursiveSelection boolean false

Whether or not we want ViewStateManager to have recursive selection.

Visibility: public
runtimeSettings object empty object

Optional Emscripten runtime module settings. A JSON object with the following properties:

  • totalMemory {int} size of Emscripten module memory in bytes, default value: 512 MB.
  • logElementId {string} ID of a textarea DOM element to write the log to.
  • statusElementId {string} ID of a DOM element to write the status messages to.
Emscripten runtime module settings cannot be changed after the control is fully initialized.

Visibility: public
shouldTrackVisibilityChanges boolean false

Whether or not we want ViewStateManager to keep track of visibility changes.

Visibility: public
showAllHotspots boolean false

Enables or disables showing of all hotspots

Visibility: public
showSceneTree boolean true

Shows or hides the scene tree control

Visibility: public
showStepNavigation boolean false

Shows or hides the Step Navigation Control

Visibility: public
showStepNavigationThumbnails boolean true

Shows or hides the Step Navigation thumbnails

Visibility: public
toolbarTitle string empty string

The toolbar title

Visibility: public
webGLContextAttributes object ...see text or source

Optional WebGL context attributes. A JSON object with the following boolean properties:

  • antialias {boolean} default value true. If set to true, the context will attempt to perform antialiased rendering if possible.
  • alpha {boolean} default value true. If set to true, the context will have an alpha (transparency) channel.
  • premultipliedAlpha {boolean} default value false. If set to true, the color channels in the framebuffer will be stored premultiplied by the alpha channel to improve performance.
Other WebGL context attributes are also supported. WebGL context attributes cannot be changed after the control is fully initialized.

Visibility: public
width sap.ui.core.CSSSize

Width of the Viewer control

Visibility: public

Aggregations

Default Aggregation: contentResources

Name Cardinality Type Description
contentConnector 0..1 sap.ui.vk.ContentConnector
contentResources (default) 0..n sap.ui.vk.ContentResource

Content resources to load and display in the Viewer control.

layout 0..1 sap.m.VBox
overlay 0..1 sap.ui.vk.Overlay
progressIndicator 0..1 sap.ui.vk.ProgressIndicator
viewStateManager 0..1 sap.ui.vk.ViewStateManager

Events Overview

Event Description
contentResourceChangesProcessed

This event will be fired when any content resource or the contentResources aggregation has been changed and processed.

fullScreen

This event is fired when viewer enters/exits full screen mode.

nodeClicked

This event will be fired when a node is clicked.

sceneDestroying

This event will be fired when scene / image loaded in Viewer is about to be destroyed.

sceneLoadingFailed

This event will be fired when a critical error occurs during scene / image loading.

sceneLoadingSucceeded

This event will be fired when a scene / image has been loaded into the Viewer.

selectionChanged

This event is fired when the nodes are selected/unselected.

urlClicked

This event will be fired when a URL in a note is clicked.

contentResourceChangesProcessed

This event will be fired when any content resource or the contentResources aggregation has been changed and processed.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

fullScreen

This event is fired when viewer enters/exits full screen mode.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
isFullScreen boolean

true: entered full screen; false: exited full screen.

nodeClicked

This event will be fired when a node is clicked.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
nodeRef any

Returns a node reference.

x int
y int

sceneDestroying

This event will be fired when scene / image loaded in Viewer is about to be destroyed.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
scene sap.ui.vk.Scene

Returns a reference to the scene to be destroyed.

preventGarbageCollection function

Returns a function(prevent: boolean) with one boolean parameter. To prevent garbage collection after the scene is destroyed call this function passing true as a parameter.

sceneLoadingFailed

This event will be fired when a critical error occurs during scene / image loading.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
reason object

Returns an optional object describing the reason of the failure.

sceneLoadingSucceeded

This event will be fired when a scene / image has been loaded into the Viewer.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
scene sap.ui.vk.Scene

Returns a reference to the loaded Scene.

selectionChanged

This event is fired when the nodes are selected/unselected.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
selected any[]

Node references to the newly selected nodes.

unselected any[]

Node references to the newly unselected nodes.

urlClicked

This event will be fired when a URL in a note is clicked.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
nodeRef any

Returns a node reference of the note that contains the URL.

url string

Returns a URL that was clicked.


Methods Overview

Method Description
activateFullScreenMode

It activates or deactivates full screen mode.

activateRedlineDesign

Activates the redline design control.

Since 1.77.0 Use {@link sap.ui.vk.tools.RedlineTool} instead
addContentResource

Adds some contentResource to the aggregation contentResources.

attachContentResourceChangesProcessed

Attaches event handler fnFunction to the contentResourceChangesProcessed event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when any content resource or the contentResources aggregation has been changed and processed.

attachFullScreen

Attaches event handler fnFunction to the fullScreen event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event is fired when viewer enters/exits full screen mode.

attachNodeClicked

Attaches event handler fnFunction to the nodeClicked event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a node is clicked.

attachSceneDestroying

Attaches event handler fnFunction to the sceneDestroying event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when scene / image loaded in Viewer is about to be destroyed.

attachSceneLoadingFailed

Attaches event handler fnFunction to the sceneLoadingFailed event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a critical error occurs during scene / image loading.

attachSceneLoadingSucceeded

Attaches event handler fnFunction to the sceneLoadingSucceeded event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a scene / image has been loaded into the Viewer.

attachSelectionChanged

Attaches event handler fnFunction to the selectionChanged event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event is fired when the nodes are selected/unselected.

attachUrlClicked

Attaches event handler fnFunction to the urlClicked event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a URL in a note is clicked.

destroyContentResources

Destroys all the contentResources in the aggregation contentResources.

destroyOverlay

Destroys the overlay in the aggregation overlay.

destroyRedlineDesign

It destroys the current instance of {sap.ui.vk.RedlineDesign}.

Since 1.77.0 Use {@link sap.ui.vk.tools.RedlineTool} instead
detachContentResourceChangesProcessed

Detaches event handler fnFunction from the contentResourceChangesProcessed event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachFullScreen

Detaches event handler fnFunction from the fullScreen event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachNodeClicked

Detaches event handler fnFunction from the nodeClicked event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachSceneDestroying

Detaches event handler fnFunction from the sceneDestroying event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachSceneLoadingFailed

Detaches event handler fnFunction from the sceneLoadingFailed event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachSceneLoadingSucceeded

Detaches event handler fnFunction from the sceneLoadingSucceeded event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachSelectionChanged

Detaches event handler fnFunction from the selectionChanged event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

detachUrlClicked

Detaches event handler fnFunction from the urlClicked event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

sap.ui.vk.Viewer.extend

Creates a new subclass of class sap.ui.vk.Viewer with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

fireContentResourceChangesProcessed

Fires event contentResourceChangesProcessed to attached listeners.

fireFullScreen

Fires event fullScreen to attached listeners.

fireNodeClicked

Fires event nodeClicked to attached listeners.

fireSceneDestroying

Fires event sceneDestroying to attached listeners.

fireSceneLoadingFailed

Fires event sceneLoadingFailed to attached listeners.

fireSceneLoadingSucceeded

Fires event sceneLoadingSucceeded to attached listeners.

fireSelectionChanged

Fires event selectionChanged to attached listeners.

fireUrlClicked

Fires event urlClicked to attached listeners.

getContentResources

Gets content of aggregation contentResources.

Content resources to load and display in the Viewer control.

getEnableNotifications

Gets current value of property enableNotifications.

Disables the Message Popover Control

Default value is true.

getEnableOverlay

Gets current value of property enableOverlay.

Enables or disables the Overlay control

Default value is false.

getEnableProgressIndicator

Gets current value of property enableProgressIndicator.

Enable / disable progress indicator for downloading and rendering VDS files

Default value is true.

getEnableSceneTree

Gets current value of property enableSceneTree.

Disables the scene tree control Button on the menu

Default value is true.

getEnableStepNavigation

Gets current value of property enableStepNavigation.

Disables the Step Navigation Control Button on the menu

Default value is true.

getEnableToolbar

Gets current value of property enableToolbar.

Shows or hides Toolbar control

Default value is true.

getGraphicsCore

Gets the GraphicsCore object if the currently loaded content is a 3D model.

getHeight

Gets current value of property height.

Height of the Viewer control

getHotspotColor

Gets current value of property hotspotColor.

Color used for highlighting Smart2D hotspots in the CSS Color format.

Default value is "rgba(255, 0, 0, 0.7529411764705882)".

getHotspotColorABGR

Gets current value of property hotspotColorABGR.

Color used for highlighting Smart2D hotspots in the ABGR format.

Default value is 0xc00000ff.

sap.ui.vk.Viewer.getMetadata

Returns a metadata object for class sap.ui.vk.Viewer.

getNativeViewport

Gets the 2D viewport used for displaying format natively supported by the browser - 2D images etc.

getOverlay

Gets content of aggregation overlay.

getOverlayStepNavigation

Gets current value of property overlayStepNavigation.

If enabled the Step Navigation will be overlayed on top of the viewport. Only set this during initialization. Will not work when set at runtime.

Default value is false.

getRecursiveSelection

Gets current value of property recursiveSelection.

Whether or not we want ViewStateManager to have recursive selection.

Default value is false.

getRedlineDesign

Gets the RedlineDesign instance used for creating redlining shapes.

Since 1.77.0 Use {@link sap.ui.vk.tools.RedlineTool} instead
getRuntimeSettings

Gets current value of property runtimeSettings.

Optional Emscripten runtime module settings. A JSON object with the following properties:

  • totalMemory {int} size of Emscripten module memory in bytes, default value: 512 MB.
  • logElementId {string} ID of a textarea DOM element to write the log to.
  • statusElementId {string} ID of a DOM element to write the status messages to.
Emscripten runtime module settings cannot be changed after the control is fully initialized.

Default value is {}.

getScene

Gets the Scene currently loaded in the Viewer control.

getSceneTree

Gets the scene tree control to customize it.

getShouldTrackVisibilityChanges

Gets current value of property shouldTrackVisibilityChanges.

Whether or not we want ViewStateManager to keep track of visibility changes.

Default value is false.

getShowAllHotspots

Gets current value of property showAllHotspots.

Enables or disables showing of all hotspots

Default value is false.

getShowSceneTree

Gets current value of property showSceneTree.

Shows or hides the scene tree control

Default value is true.

getShowStepNavigation

Gets current value of property showStepNavigation.

Shows or hides the Step Navigation Control

Default value is false.

getShowStepNavigationThumbnails

Gets current value of property showStepNavigationThumbnails.

Shows or hides the Step Navigation thumbnails

Default value is true.

getToolbar

Gets the toolbar control to customize it - add or remove buttons

getToolbarTitle

Gets current value of property toolbarTitle.

The toolbar title

Default value is empty string.

getViewport

Gets the 3D viewport.

getViewStateManager

Gets the view state manager object used for handling visibility and selection of nodes.

getWebGLContextAttributes

Gets current value of property webGLContextAttributes.

Optional WebGL context attributes. A JSON object with the following boolean properties:

  • antialias {boolean} default value true. If set to true, the context will attempt to perform antialiased rendering if possible.
  • alpha {boolean} default value true. If set to true, the context will have an alpha (transparency) channel.
  • premultipliedAlpha {boolean} default value false. If set to true, the color channels in the framebuffer will be stored premultiplied by the alpha channel to improve performance.
Other WebGL context attributes are also supported. WebGL context attributes cannot be changed after the control is fully initialized.

Default value is ...see text or source.

getWidth

Gets current value of property width.

Width of the Viewer control

indexOfContentResource

Checks for the provided sap.ui.vk.ContentResource in the aggregation contentResources. and returns its index if found or -1 otherwise.

insertContentResource

Inserts a contentResource into the aggregation contentResources.

removeAllContentResources

Removes all the controls from the aggregation contentResources.

Additionally, it unregisters them from the hosting UIArea.

removeContentResource

Removes a contentResource from the aggregation contentResources.

setAuthorizationHandler

Sets an callback function used to authorize user and provide authorization token.

setDecryptionHandler

Sets an object that decrypts content of encrypted models.

setEnableNotifications

Sets a new value for property enableNotifications.

Disables the Message Popover Control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setEnableOverlay

Sets a new value for property enableOverlay.

Enables or disables the Overlay control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setEnableProgressIndicator

Sets a new value for property enableProgressIndicator.

Enable / disable progress indicator for downloading and rendering VDS files

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setEnableSceneTree

Sets a new value for property enableSceneTree.

Disables the scene tree control Button on the menu

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setEnableStepNavigation

Sets a new value for property enableStepNavigation.

Disables the Step Navigation Control Button on the menu

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setEnableToolbar

Sets a new value for property enableToolbar.

Shows or hides Toolbar control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setHeight

Sets a new value for property height.

Height of the Viewer control

When called with a value of null or undefined, the default value of the property will be restored.

setHotspotColor

Sets a new value for property hotspotColor.

Color used for highlighting Smart2D hotspots in the CSS Color format.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is "rgba(255, 0, 0, 0.7529411764705882)".

setHotspotColorABGR

Sets a new value for property hotspotColorABGR.

Color used for highlighting Smart2D hotspots in the ABGR format.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0xc00000ff.

setOverlay

Sets the aggregated overlay.

setOverlayStepNavigation

Sets a new value for property overlayStepNavigation.

If enabled the Step Navigation will be overlayed on top of the viewport. Only set this during initialization. Will not work when set at runtime.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setRecursiveSelection

Sets a new value for property recursiveSelection.

Whether or not we want ViewStateManager to have recursive selection.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setRuntimeSettings

Sets a new value for property runtimeSettings.

Optional Emscripten runtime module settings. A JSON object with the following properties:

  • totalMemory {int} size of Emscripten module memory in bytes, default value: 512 MB.
  • logElementId {string} ID of a textarea DOM element to write the log to.
  • statusElementId {string} ID of a DOM element to write the status messages to.
Emscripten runtime module settings cannot be changed after the control is fully initialized.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is {}.

setShouldTrackVisibilityChanges

Sets a new value for property shouldTrackVisibilityChanges.

Whether or not we want ViewStateManager to keep track of visibility changes.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setShowAllHotspots

Sets a new value for property showAllHotspots.

Enables or disables showing of all hotspots

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setShowSceneTree

Sets a new value for property showSceneTree.

Shows or hides the scene tree control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setShowStepNavigation

Sets a new value for property showStepNavigation.

Shows or hides the Step Navigation Control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setShowStepNavigationThumbnails

Sets a new value for property showStepNavigationThumbnails.

Shows or hides the Step Navigation thumbnails

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setToolbarTitle

Sets a new value for property toolbarTitle.

The toolbar title

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setWebGLContextAttributes

Sets a new value for property webGLContextAttributes.

Optional WebGL context attributes. A JSON object with the following boolean properties:

  • antialias {boolean} default value true. If set to true, the context will attempt to perform antialiased rendering if possible.
  • alpha {boolean} default value true. If set to true, the context will have an alpha (transparency) channel.
  • premultipliedAlpha {boolean} default value false. If set to true, the color channels in the framebuffer will be stored premultiplied by the alpha channel to improve performance.
Other WebGL context attributes are also supported. WebGL context attributes cannot be changed after the control is fully initialized.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is ...see text or source.

setWidth

Sets a new value for property width.

Width of the Viewer control

When called with a value of null or undefined, the default value of the property will be restored.

activateFullScreenMode

It activates or deactivates full screen mode.

Param Type DefaultValue Description
value boolean

Parameter which specifies whether to activate or deactivate full screen mode.

activateRedlineDesign

Activates the redline design control.

Since 1.77.0 Use {@link sap.ui.vk.tools.RedlineTool} instead
Param Type DefaultValue Description
redlineElements sap.ui.vk.RedlineElement sap.ui.vk.RedlineElement[]

The redline element/elements which will be rendered as soon as the redline design control is activated.

addContentResource

Adds some contentResource to the aggregation contentResources.

Param Type DefaultValue Description
oContentResource sap.ui.vk.ContentResource

The contentResource to add; if empty, nothing is inserted

attachContentResourceChangesProcessed

Attaches event handler fnFunction to the contentResourceChangesProcessed event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when any content resource or the contentResources aggregation has been changed and processed.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachFullScreen

Attaches event handler fnFunction to the fullScreen event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event is fired when viewer enters/exits full screen mode.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachNodeClicked

Attaches event handler fnFunction to the nodeClicked event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a node is clicked.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachSceneDestroying

Attaches event handler fnFunction to the sceneDestroying event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when scene / image loaded in Viewer is about to be destroyed.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachSceneLoadingFailed

Attaches event handler fnFunction to the sceneLoadingFailed event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a critical error occurs during scene / image loading.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachSceneLoadingSucceeded

Attaches event handler fnFunction to the sceneLoadingSucceeded event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a scene / image has been loaded into the Viewer.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachSelectionChanged

Attaches event handler fnFunction to the selectionChanged event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event is fired when the nodes are selected/unselected.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

attachUrlClicked

Attaches event handler fnFunction to the urlClicked event of this sap.ui.vk.Viewer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Viewer itself.

This event will be fired when a URL in a note is clicked.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.Viewer itself

destroyContentResources

Destroys all the contentResources in the aggregation contentResources.

destroyOverlay

Destroys the overlay in the aggregation overlay.

destroyRedlineDesign

It destroys the current instance of {sap.ui.vk.RedlineDesign}.

Since 1.77.0 Use {@link sap.ui.vk.tools.RedlineTool} instead

detachContentResourceChangesProcessed

Detaches event handler fnFunction from the contentResourceChangesProcessed event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachFullScreen

Detaches event handler fnFunction from the fullScreen event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachNodeClicked

Detaches event handler fnFunction from the nodeClicked event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSceneDestroying

Detaches event handler fnFunction from the sceneDestroying event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSceneLoadingFailed

Detaches event handler fnFunction from the sceneLoadingFailed event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSceneLoadingSucceeded

Detaches event handler fnFunction from the sceneLoadingSucceeded event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSelectionChanged

Detaches event handler fnFunction from the selectionChanged event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachUrlClicked

Detaches event handler fnFunction from the urlClicked event of this sap.ui.vk.Viewer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.vk.Viewer.extend

Creates a new subclass of class sap.ui.vk.Viewer with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

fireContentResourceChangesProcessed

Fires event contentResourceChangesProcessed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireFullScreen

Fires event fullScreen to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

isFullScreen boolean

true: entered full screen; false: exited full screen.

fireNodeClicked

Fires event nodeClicked to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

nodeRef any

Returns a node reference.

x int
y int

fireSceneDestroying

Fires event sceneDestroying to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

scene sap.ui.vk.Scene

Returns a reference to the scene to be destroyed.

preventGarbageCollection function

Returns a function(prevent: boolean) with one boolean parameter. To prevent garbage collection after the scene is destroyed call this function passing true as a parameter.

fireSceneLoadingFailed

Fires event sceneLoadingFailed to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

reason object

Returns an optional object describing the reason of the failure.

fireSceneLoadingSucceeded

Fires event sceneLoadingSucceeded to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

scene sap.ui.vk.Scene

Returns a reference to the loaded Scene.

fireSelectionChanged

Fires event selectionChanged to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

selected any[]

Node references to the newly selected nodes.

unselected any[]

Node references to the newly unselected nodes.

fireUrlClicked

Fires event urlClicked to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

nodeRef any

Returns a node reference of the note that contains the URL.

url string

Returns a URL that was clicked.

getContentResources

Gets content of aggregation contentResources.

Content resources to load and display in the Viewer control.

getEnableNotifications

Gets current value of property enableNotifications.

Disables the Message Popover Control

Default value is true.

getEnableOverlay

Gets current value of property enableOverlay.

Enables or disables the Overlay control

Default value is false.

getEnableProgressIndicator

Gets current value of property enableProgressIndicator.

Enable / disable progress indicator for downloading and rendering VDS files

Default value is true.

getEnableSceneTree

Gets current value of property enableSceneTree.

Disables the scene tree control Button on the menu

Default value is true.

getEnableStepNavigation

Gets current value of property enableStepNavigation.

Disables the Step Navigation Control Button on the menu

Default value is true.

getEnableToolbar

Gets current value of property enableToolbar.

Shows or hides Toolbar control

Default value is true.

getGraphicsCore

Gets the GraphicsCore object if the currently loaded content is a 3D model.

getHeight

Gets current value of property height.

Height of the Viewer control

getHotspotColor

Gets current value of property hotspotColor.

Color used for highlighting Smart2D hotspots in the CSS Color format.

Default value is "rgba(255, 0, 0, 0.7529411764705882)".

getHotspotColorABGR

Gets current value of property hotspotColorABGR.

Color used for highlighting Smart2D hotspots in the ABGR format.

Default value is 0xc00000ff.

sap.ui.vk.Viewer.getMetadata

Returns a metadata object for class sap.ui.vk.Viewer.

getNativeViewport

Gets the 2D viewport used for displaying format natively supported by the browser - 2D images etc.

getOverlay

Gets content of aggregation overlay.

getOverlayStepNavigation

Gets current value of property overlayStepNavigation.

If enabled the Step Navigation will be overlayed on top of the viewport. Only set this during initialization. Will not work when set at runtime.

Default value is false.

getRecursiveSelection

Gets current value of property recursiveSelection.

Whether or not we want ViewStateManager to have recursive selection.

Default value is false.

getRedlineDesign

Gets the RedlineDesign instance used for creating redlining shapes.

Since 1.77.0 Use {@link sap.ui.vk.tools.RedlineTool} instead

getRuntimeSettings

Gets current value of property runtimeSettings.

Optional Emscripten runtime module settings. A JSON object with the following properties:

Emscripten runtime module settings cannot be changed after the control is fully initialized.

Default value is {}.

getScene

Gets the Scene currently loaded in the Viewer control.

getSceneTree

Gets the scene tree control to customize it.

getShouldTrackVisibilityChanges

Gets current value of property shouldTrackVisibilityChanges.

Whether or not we want ViewStateManager to keep track of visibility changes.

Default value is false.

getShowAllHotspots

Gets current value of property showAllHotspots.

Enables or disables showing of all hotspots

Default value is false.

getShowSceneTree

Gets current value of property showSceneTree.

Shows or hides the scene tree control

Default value is true.

getShowStepNavigation

Gets current value of property showStepNavigation.

Shows or hides the Step Navigation Control

Default value is false.

getShowStepNavigationThumbnails

Gets current value of property showStepNavigationThumbnails.

Shows or hides the Step Navigation thumbnails

Default value is true.

getToolbar

Gets the toolbar control to customize it - add or remove buttons

getToolbarTitle

Gets current value of property toolbarTitle.

The toolbar title

Default value is empty string.

getViewport

Gets the 3D viewport.

getViewStateManager

Gets the view state manager object used for handling visibility and selection of nodes.

getWebGLContextAttributes

Gets current value of property webGLContextAttributes.

Optional WebGL context attributes. A JSON object with the following boolean properties:

Other WebGL context attributes are also supported. WebGL context attributes cannot be changed after the control is fully initialized.

Default value is ...see text or source.

getWidth

Gets current value of property width.

Width of the Viewer control

indexOfContentResource

Checks for the provided sap.ui.vk.ContentResource in the aggregation contentResources. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oContentResource sap.ui.vk.ContentResource

The contentResource whose index is looked for

insertContentResource

Inserts a contentResource into the aggregation contentResources.

Param Type DefaultValue Description
oContentResource sap.ui.vk.ContentResource

The contentResource to insert; if empty, nothing is inserted

iIndex int

The 0-based index the contentResource should be inserted at; for a negative value of iIndex, the contentResource is inserted at position 0; for a value greater than the current size of the aggregation, the contentResource is inserted at the last position

removeAllContentResources

Removes all the controls from the aggregation contentResources.

Additionally, it unregisters them from the hosting UIArea.

removeContentResource

Removes a contentResource from the aggregation contentResources.

Param Type DefaultValue Description
vContentResource int string sap.ui.vk.ContentResource

The contentResource to remove or its index or id

setAuthorizationHandler

Sets an callback function used to authorize user and provide authorization token.

Param Type DefaultValue Description
handler sap.ui.vk.AuthorizationHandler

An callback function.

setDecryptionHandler

Sets an object that decrypts content of encrypted models.

Param Type DefaultValue Description
handler sap.ui.vk.DecryptionHandler

An object that decrypts content of encrypted models.

setEnableNotifications

Sets a new value for property enableNotifications.

Disables the Message Popover Control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bEnableNotifications boolean true

New value for property enableNotifications

setEnableOverlay

Sets a new value for property enableOverlay.

Enables or disables the Overlay control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bEnableOverlay boolean false

New value for property enableOverlay

setEnableProgressIndicator

Sets a new value for property enableProgressIndicator.

Enable / disable progress indicator for downloading and rendering VDS files

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bEnableProgressIndicator boolean true

New value for property enableProgressIndicator

setEnableSceneTree

Sets a new value for property enableSceneTree.

Disables the scene tree control Button on the menu

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bEnableSceneTree boolean true

New value for property enableSceneTree

setEnableStepNavigation

Sets a new value for property enableStepNavigation.

Disables the Step Navigation Control Button on the menu

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bEnableStepNavigation boolean true

New value for property enableStepNavigation

setEnableToolbar

Sets a new value for property enableToolbar.

Shows or hides Toolbar control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bEnableToolbar boolean true

New value for property enableToolbar

setHeight

Sets a new value for property height.

Height of the Viewer control

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sHeight sap.ui.core.CSSSize

New value for property height

setHotspotColor

Sets a new value for property hotspotColor.

Color used for highlighting Smart2D hotspots in the CSS Color format.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is "rgba(255, 0, 0, 0.7529411764705882)".

Param Type DefaultValue Description
sHotspotColor sap.ui.core.CSSColor "rgba(255, 0, 0, 0.7529411764705882)"

New value for property hotspotColor

setHotspotColorABGR

Sets a new value for property hotspotColorABGR.

Color used for highlighting Smart2D hotspots in the ABGR format.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0xc00000ff.

Param Type DefaultValue Description
iHotspotColorABGR int 0xc00000ff

New value for property hotspotColorABGR

setOverlay

Sets the aggregated overlay.

Param Type DefaultValue Description
oOverlay sap.ui.vk.Overlay

The overlay to set

setOverlayStepNavigation

Sets a new value for property overlayStepNavigation.

If enabled the Step Navigation will be overlayed on top of the viewport. Only set this during initialization. Will not work when set at runtime.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bOverlayStepNavigation boolean false

New value for property overlayStepNavigation

setRecursiveSelection

Sets a new value for property recursiveSelection.

Whether or not we want ViewStateManager to have recursive selection.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bRecursiveSelection boolean false

New value for property recursiveSelection

setRuntimeSettings

Sets a new value for property runtimeSettings.

Optional Emscripten runtime module settings. A JSON object with the following properties:

Emscripten runtime module settings cannot be changed after the control is fully initialized.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is {}.

Param Type DefaultValue Description
oRuntimeSettings object {}

New value for property runtimeSettings

setShouldTrackVisibilityChanges

Sets a new value for property shouldTrackVisibilityChanges.

Whether or not we want ViewStateManager to keep track of visibility changes.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bShouldTrackVisibilityChanges boolean false

New value for property shouldTrackVisibilityChanges

setShowAllHotspots

Sets a new value for property showAllHotspots.

Enables or disables showing of all hotspots

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bShowAllHotspots boolean false

New value for property showAllHotspots

setShowSceneTree

Sets a new value for property showSceneTree.

Shows or hides the scene tree control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bShowSceneTree boolean true

New value for property showSceneTree

setShowStepNavigation

Sets a new value for property showStepNavigation.

Shows or hides the Step Navigation Control

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bShowStepNavigation boolean false

New value for property showStepNavigation

setShowStepNavigationThumbnails

Sets a new value for property showStepNavigationThumbnails.

Shows or hides the Step Navigation thumbnails

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bShowStepNavigationThumbnails boolean true

New value for property showStepNavigationThumbnails

setToolbarTitle

Sets a new value for property toolbarTitle.

The toolbar title

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sToolbarTitle string ""

New value for property toolbarTitle

setWebGLContextAttributes

Sets a new value for property webGLContextAttributes.

Optional WebGL context attributes. A JSON object with the following boolean properties:

Other WebGL context attributes are also supported. WebGL context attributes cannot be changed after the control is fully initialized.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is ...see text or source.

Param Type DefaultValue Description
oWebGLContextAttributes object ...see text or source

New value for property webGLContextAttributes

setWidth

Sets a new value for property width.

Width of the Viewer control

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sWidth sap.ui.core.CSSSize

New value for property width