Class sap.ui.vk.ViewportModule: sap/ui/vk/Viewport

extends Control

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

Experimental API:Since 1.32.0 This class is experimental and might be modified or removed in future versions.

Constructor Summary
new sap.ui.vk.Viewport(sId?, mSettings?)Constructor for a new Viewport.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.vk.Viewport.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vk.Viewport with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vk.Viewport.getMetadata()Returns a metadata object for class sap.ui.vk.Viewport.
beginGesture(x, y)Marks the start of the current gesture operation.
endGesture()Marks the end of the current gesture operation.
getGraphicsCore()Gets the GraphicsCore object the Viewport is attached to.
getShowDebugInfo()Gets current value of property showDebugInfo.
getViewInfo()Retrieves information about the current camera view in the scene, and saves the information in a JSON-like object.
pan(dx, dy)Performs a pan gesture to pan across the Viewport.
queueCommand(command)Queues a command for execution during the rendering cycle.
rotate(dx, dy)Rotates the content resource displayed on the Viewport.
setGraphicsCore(graphicsCore)Attaches or detaches the Viewport to the GraphicsCore object.
setScene(scene)Attaches the scene to the Viewport for rendering.
setShowDebugInfo(bShowDebugInfo)Sets a new value for property showDebugInfo.
setViewInfo(viewInfo)Sets the current scene to use the camera view information acquired from the getViewInfo method.
setViewStateManager(viewStateManager)
tap(x, y, isDoubleClick)Executes a click or tap gesture.
zoom(dy)Performs a zoom gesture to zoom in or out on the beginGesture coordinate.
Constructor Detail
new sap.ui.vk.Viewport(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? ID for the new Viewport control. Generated automatically if no ID is given.
{object}mSettings? Initial settings for the new Viewport control.
Method Detail
sap.ui.vk.Viewport.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.core.Control.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.vk.Viewport.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vk.Viewport.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
beginGesture(x, y): sap.ui.vk.Viewport
Marks the start of the current gesture operation.
Parameters:
{int}x The x-coordinate of the gesture.
{int}y The y-coordinate of the gesture.
Returns:
{sap.ui.vk.Viewport} this
endGesture(): sap.ui.vk.Viewport
Marks the end of the current gesture operation.
Returns:
{sap.ui.vk.Viewport} this
getGraphicsCore(): sap.ui.vk.GraphicsCore
Gets the GraphicsCore object the Viewport is attached to.
Returns:
{sap.ui.vk.GraphicsCore} The GraphicsCore object the Viewport is attached to, or null.
getShowDebugInfo(): boolean
Gets current value of property showDebugInfo.

Shows or hides the debug info.

Returns:
{boolean} Value of property showDebugInfo
getViewInfo(): object
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.
Returns:
{object} JSON-like object which holds the current view information.
pan(dx, dy): sap.ui.vk.Viewport
Performs a pan gesture to pan across the Viewport.
Parameters:
{int}dx The change in distance along the x-coordinate.
{int}dy The change in distance along the y-coordinate.
Returns:
{sap.ui.vk.Viewport} this
queueCommand(command): sap.ui.vk.Viewport
Queues a command for execution during the rendering cycle. All gesture operations should be called using this method.
Parameters:
{function}command The command to be executed.
Returns:
{sap.ui.vk.Viewport} this
rotate(dx, dy): sap.ui.vk.Viewport
Rotates the content resource displayed on the Viewport.
Parameters:
{int}dx The change in x-coordinate used to define the desired rotation.
{int}dy The change in y-coordinate used to define the desired rotation.
Returns:
{sap.ui.vk.Viewport} this
setGraphicsCore(graphicsCore): sap.ui.vk.Viewport
Attaches or detaches the Viewport to the GraphicsCore object.
Parameters:
{sap.ui.vk.GraphicsCore}graphicsCore The GraphicsCore object or null. If the graphicsCore parameter is not null, a rendering object corresponding to the Viewport is created. If the graphicsCore parameter is null, the rendering object corresponding to the Viewport is destroyed.
Returns:
{sap.ui.vk.Viewport}this to allow method chaining.
setScene(scene): sap.ui.vk.Viewport
Attaches the scene to the Viewport for rendering.
Parameters:
{sap.ui.vk.Scene}scene The scene to attach to the Viewport.
Returns:
{sap.ui.vk.Viewport}this to allow method chaining.
setShowDebugInfo(bShowDebugInfo): sap.ui.vk.Viewport
Sets a new value for property showDebugInfo.

Shows or hides the debug info.

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

Parameters:
{boolean}bShowDebugInfo New value for property showDebugInfo
Returns:
{sap.ui.vk.Viewport} Reference to this in order to allow method chaining
setViewInfo(viewInfo)
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.
Parameters:
{object}viewInfo A JSON-like object containing view information acquired using the getViewInfo method.
The structure of the viewInfo object is outlined as follows:
  • animation
    • animationTime
    • stepIndex
    • procedureIndex
  • camera
    • rotation
      • yaw
      • pitch
      • roll
    • position
      • x
      • y
      • z
    • projection
    • bindingType
    • fieldOfView/zoomFactor
setViewStateManager(viewStateManager): sap.ui.vk.Viewport
Parameters:
{object}viewStateManager Takes a viewStateManager object as parameter.
Returns:
{sap.ui.vk.Viewport} this
tap(x, y, isDoubleClick): sap.ui.vk.Viewport
Executes a click or tap gesture.
Parameters:
{int}x The tap gesture's x-coordinate.
{int}y The tap gesture's y-coordinate.
{boolean}isDoubleClick 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.
Returns:
{sap.ui.vk.Viewport} this
Performs a zoom gesture to zoom in or out on the beginGesture coordinate.
Parameters:
{double}dy Zoom factor. A scale factor that specifies how much to zoom in or out by.
Returns:
{sap.ui.vk.Viewport} this