class sap.ui.vk.Viewport

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

Provides a rendering canvas for the 3D elements of a loaded scene.


Constructor

Constructor for a new Viewport.

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.

This class does not have its own settings, but all settings applicable to the base type sap.ui.vk.ViewportBase can be used.

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

ID for the new Viewport control. Generated automatically if no ID is given.

mSettings? object

Initial settings for the new Viewport control.

Borrowed Properties

Name Type Default Value Description
backgroundColorBottom sap.ui.core.CSSColor rgba(255, 255, 255, 1)

Viewport background bottom color in the CSS Color format

Visibility: public
backgroundColorTop sap.ui.core.CSSColor rgba(50, 50, 50, 1)

Viewport background top color in the CSS Color format

Visibility: public
disableHotspotHovering boolean false

Disables hotspot hovering

Visibility: public
freezeCamera boolean false

Freeze camera

Visibility: public
height sap.ui.core.CSSSize 100%

Viewport height

Visibility: public
hotspotColor sap.ui.core.CSSColor rgba(89, 0, 0, 0.73)

Color used for highlighting hotspots in the CSS Color format

Visibility: public
hotspotColorABGR int 1493172411

Color used for highlighting hotspots in the ABGR format

Visibility: public
keepOutputSize boolean false Visibility: public
renderMode sap.ui.vk.RenderMode Default

Viewport render mode

Visibility: public
selectionDisplayMode sap.ui.vk.SelectionDisplayMode Highlight

Selection display mode

Visibility: public
selectionMode sap.ui.vk.SelectionMode Sticky

Selection mode

Visibility: public
showAllHotspots boolean false

Enables or disables showing of all hotspots

Visibility: public
showAllHotspotsTintColor sap.ui.core.CSSColor rgba(255, 255, 0, .35)

Color used to highlight all hotspots when the showAllHotspots property has a value of true.

Visibility: public
showDebugInfo boolean false

Shows or hides the debug info.

Visibility: public
showSafeArea boolean false

Shows or hides the Safe Area

Visibility: public
showSelectionBoundingBoxes boolean true

Show selection bounding boxes

Visibility: public
width sap.ui.core.CSSSize 100%

Viewport width

Visibility: public

Borrowed Aggregations

Name Cardinality Type Description
annotations 0..n sap.ui.vk.Annotation

HTML Annotations present in the active view

content 0..n sap.ui.core.Control

The controls inside the viewport.

outputSettings 0..1 sap.ui.vk.OutputSettings

Output size settings of the viewport

safeArea 0..1 sap.ui.vk.SafeArea

SafeArea control for viewport


Methods Overview

Method Description
activateView

Calls activateView with view definition

sap.ui.vk.Viewport.extend

Creates a new subclass of class sap.ui.vk.Viewport 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.vk.ViewportBase.extend.

getCurrentView

Get current view - remembered when activateView function is called

getImage

Returns viewport content as an image of desired size.

sap.ui.vk.Viewport.getMetadata

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

getSymbolNodes

Get the Symbol node from nodeId, if nodeId is not set, returns a collection of all Symbol nodes

getViewInfo

Retrieves information about the current camera view in the scene, and saves the information in a JSON-like object. The information can then be used at a later time to restore the scene to the same camera view using the setViewInfo method.

setViewInfo

Sets the current scene to use the camera view information acquired from the getViewInfo method.
Internally, the setViewInfo method activates certain steps at certain animation times, and then changes the camera position, rotation and field of view (FOV) / zoom factor.

showHotspots
tap

Executes a click or tap gesture.

zoomTo

Zooms the scene to a bounding box created from a particular set of nodes.

activateView

Calls activateView with view definition

Param Type DefaultValue Description
view sap.ui.vk.View

object definition

playViewGroup boolean

true if view activation is part of playing view group

notAnimateCameraChange boolean

true if not animating the change of camera

sap.ui.vk.Viewport.extend

Creates a new subclass of class sap.ui.vk.Viewport 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.vk.ViewportBase.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

getCurrentView

Get current view - remembered when activateView function is called

getImage

Returns viewport content as an image of desired size.

Param Type DefaultValue Description
width int

Requested image width in pixels (allowed values 8 to 2048)

height int

Requested image height in pixels (allowed values 8 to 2048)

topColor string

The sap.ui.core.CSSColor to be used for top background color

bottomColor string

The sap.ui.core.CSSColor to be used for bottom background color

includeSelection boolean

Include selected nodes

sap.ui.vk.Viewport.getMetadata

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

getSymbolNodes

Get the Symbol node from nodeId, if nodeId is not set, returns a collection of all Symbol nodes

Param Type DefaultValue Description
nodeId string

node Id string, optional

getViewInfo

Retrieves information about the current camera view in the scene, and saves the information in a JSON-like object. The information can then be used at a later time to restore the scene to the same camera view using the setViewInfo method.

Param Type DefaultValue Description
query object

Query object which indicates what information to be retrieved.

camera boolean object true

Indicator to retrieve camera information.

matrices boolean false

Indicator to retrieve camera view and projection matrices.

useTransitionCamera boolean false

Indicator to retrieve the transition camera properties instead of regular one's.

animation boolean true

Indicator to retrieve animation information.

visibility boolean object false

Indicator to retrieve visibility information.

mode sap.ui.vk.VisibilityMode sap.ui.vk.VisibilityMode.Complete

Indicator to retrieve the complete visibility definition or just the difference.

selection boolean object false

Indicator to retrieve selection information.

setViewInfo

Sets the current scene to use the camera view information acquired from the getViewInfo method.
Internally, the setViewInfo method activates certain steps at certain animation times, and then changes the camera position, rotation and field of view (FOV) / zoom factor.

Param Type DefaultValue Description
viewInfo object

A JSON-like object containing view information acquired using the getViewInfo method.

camera object

A JSON-like object containing the camera information.

rotation object

Rotation defined in Aircraft principal axes .

yaw float

Angle around the vertical axis in degrees.

pitch float

Angle around the lateral axis in degrees.

roll float

Angle around the longitudinal axis in degrees.

position object

Position defined in 3-dimensional space.

x float

X coordinate.

y float

Y coordinate.

z float

Z coordinate.

bindingType sap.ui.vk.CameraFOVBindingType

Camera field of view binding type.

projectionType sap.ui.vk.CameraProjectionType

Camera projection type.

fieldOfView float

Camera field of view in degrees. Applicable only to perspective cameras.

zoomFactor float

Camera zoom factor. Applicable only to orthographic cameras.

animation object

A JSON-like object containing the animation information.

stepVeId string

Step VE ID. If it is omitted then procedure and step indices are used.

procedureIndex int

Procedure index in the list of procedures.

stepIndex int

Step index in the list of steps in the procedure.

animationTime float 0

Time at which to activate the step.

visibility object

A JSON-like object containing the visibility information.

mode sap.ui.vk.VisibilityMode

If the mode equals to complete then the visible and hidden fields are defined. If the mode equals differences then the changes field is defined.

visible string[]

List of Ids of visible nodes.

hidden string[]

List of Ids of hidden nodes.

changes string[]

List of Ids of nodes with inverted visibility.

flyToDuration float 0

Fly-to animation duration in seconds.

showHotspots

Param Type DefaultValue Description
nodeRefs any any[]

The node reference or the array of node references that we want to tint.

show boolean

Whether to highlight the nodes or remove the highlight.

color int sap.ui.vk.CSSColor

The color to use for highlighting the nodes passed as argument.

tap

Executes a click or tap gesture.

Param Type DefaultValue Description
x int

The tap gesture's x-coordinate.

y int

The tap gesture's y-coordinate.

isDoubleClick boolean

Indicates whether the tap gesture should be interpreted as a double-click. A value of true indicates a double-click gesture, and false indicates a single click gesture.

zoomTo

Zooms the scene to a bounding box created from a particular set of nodes.

Param Type DefaultValue Description
what sap.ui.vk.ZoomTo sap.ui.vk.ZoomTo[]

What set of nodes to zoom to.

nodeRef any

Is only used if what == sap.ui.vk.ZoomTo.Node.

crossFadeSeconds float

Time to perform the "fly to" animation. Set to 0 to do this immediately.

margin float

Margin. Set to 0 to zoom to the entire screen.