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

extends Control

Provides a control for three js canvas.

Constructor Summary
new sap.ui.vbm.Viewport()Constructor for a new three js viewport for Adapter3D.
Event Summary
cameraChange(oControlEvent)This event is fired when camera positioning changed
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.vbm.Viewport.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vbm.Viewport with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vbm.Viewport.getMetadata()Returns a metadata object for class sap.ui.vbm.Viewport.
attachCameraChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the cameraChange event of this sap.ui.vbm.Viewport.
detachCameraChange(fnFunction, oListener)Detaches event handler fnFunction from the cameraChange event of this sap.ui.vbm.Viewport.
fireCameraChange(mArguments?)Fires event cameraChange to attached listeners.
getCameraHistoryLength()Gets current value of property cameraHistoryLength.
getCameraHistoryPos()Gets current value of property cameraHistoryPos.
getHeight()Gets current value of property height.
getWidth()Gets current value of property width.
setCameraHistoryLength(iCameraHistoryLength)Sets a new value for property cameraHistoryLength.
setCameraHistoryPos(iCameraHistoryPos)Sets a new value for property cameraHistoryPos.
setHeight(sHeight)Sets a new value for property height.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.ui.vbm.Viewport()
Constructor for a new three js viewport for Adapter3D.

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.

Event Detail
cameraChange(oControlEvent)
This event is fired when camera positioning changed
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{int}oControlEvent.getParameters.historyPos Current position in camera history
{int}oControlEvent.getParameters.historyLength Camera history length
Method Detail
sap.ui.vbm.Viewport.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vbm.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.vbm.Viewport.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vbm.Viewport.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachCameraChange(oData?, fnFunction, oListener?): sap.ui.vbm.Viewport
Attaches event handler fnFunction to the cameraChange event of this sap.ui.vbm.Viewport.

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.vbm.Viewport itself.

This event is fired when camera positioning changed

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vbm.Viewport itself
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining
detachCameraChange(fnFunction, oListener): sap.ui.vbm.Viewport
Detaches event handler fnFunction from the cameraChange event of this sap.ui.vbm.Viewport.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining
fireCameraChange(mArguments?): sap.ui.vbm.Viewport
Fires event cameraChange to attached listeners.

Expects the following event parameters:

  • historyPos of type intCurrent position in camera history
  • historyLength of type intCamera history length
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining
getCameraHistoryLength(): int
Gets current value of property cameraHistoryLength.

Camera history length (read only)

Default value is 0.

Returns:
{int} Value of property cameraHistoryLength
getCameraHistoryPos(): int
Gets current value of property cameraHistoryPos.

Camera history position

Returns:
{int} Value of property cameraHistoryPos
getHeight(): sap.ui.core.CSSSize
Gets current value of property height.

Viewport height

Default value is 100%.

Returns:
{sap.ui.core.CSSSize} Value of property height
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Viewport width

Default value is 100%.

Returns:
{sap.ui.core.CSSSize} Value of property width
setCameraHistoryLength(iCameraHistoryLength): sap.ui.vbm.Viewport
Sets a new value for property cameraHistoryLength.

Camera history length (read only)

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

Default value is 0.

Parameters:
{int}iCameraHistoryLength New value for property cameraHistoryLength
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining
setCameraHistoryPos(iCameraHistoryPos): sap.ui.vbm.Viewport
Sets a new value for property cameraHistoryPos.

Camera history position

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

Parameters:
{int}iCameraHistoryPos New value for property cameraHistoryPos
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining
setHeight(sHeight): sap.ui.vbm.Viewport
Sets a new value for property height.

Viewport height

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

Default value is 100%.

Parameters:
{sap.ui.core.CSSSize}sHeight New value for property height
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining
setWidth(sWidth): sap.ui.vbm.Viewport
Sets a new value for property width.

Viewport width

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

Default value is 100%.

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.ui.vbm.Viewport} Reference to this in order to allow method chaining