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.
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
. beginGesture(x, y)Marks the start of the current gesture operation. endGesture()Marks the end of the current gesture operation. 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. setScene(scene)Attaches the scene to the Viewport for rendering. setViewInfo(viewInfo)Sets the current scene to use the camera view information acquired from the getViewInfo method. 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. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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 |
Returns a metadata object for class sap.ui.vk.Viewport.
Returns:
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:
Marks the end of the current gesture operation.
Returns:
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. |
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:
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:
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:
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:
Attaches the scene to the Viewport for rendering.
Parameters:
Returns:
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:
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
- position
- projection
- bindingType
- fieldOfView/zoomFactor
|
Parameters:
{object} | viewStateManager | Takes a viewStateManager object as parameter. |
Returns:
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:
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: