Provides a rendering canvas for the 3D elements of a loaded scene.
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.
new sap.ui.vk.dvl.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. |
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 |
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 |
Event | Description |
---|---|
frameRenderingFinished |
This event will be fired when the frame rendering has finished. |
pan | |
rotate | |
zoom |
This event will be fired when the frame rendering has finished.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
dx | int | |
dy | int |
Method | Description |
---|---|
attachFrameRenderingFinished |
Attaches event handler When called, the context of the event handler (its This event will be fired when the frame rendering has finished. |
attachPan |
Attaches event handler When called, the context of the event handler (its |
attachRotate |
Attaches event handler When called, the context of the event handler (its |
attachZoom |
Attaches event handler When called, the context of the event handler (its |
beginGesture |
Marks the start of the current gesture operation. |
detachFrameRenderingFinished |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachPan |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachRotate |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachZoom |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
endGesture |
Marks the end of the current gesture operation. |
sap.ui.vk.dvl.Viewport.extend |
Creates a new subclass of class sap.ui.vk.dvl.Viewport with name
|
fireFrameRenderingFinished |
Fires event frameRenderingFinished to attached listeners. |
firePan |
Fires event pan to attached listeners. |
fireRotate |
Fires event rotate to attached listeners. |
fireZoom |
Fires event zoom to attached listeners. |
getBackgroundColorBottomABGR |
Gets current value of property backgroundColorBottomABGR. Viewport background bottom color in the ABGR format Default value is |
getBackgroundColorTopABGR |
Gets current value of property backgroundColorTopABGR. Viewport background top color in the ABGR format Default value is |
getGraphicsCore |
Gets the GraphicsCore object the Viewport is attached to. |
getIsolatedNode | |
sap.ui.vk.dvl.Viewport.getMetadata |
Returns a metadata object for class sap.ui.vk.dvl.Viewport. |
getOutputSize |
Gets position and size of the viewport square. The information can be used for making calculations when restoring Redlining elements. |
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. |
pan |
Performs a |
queueCommand |
Queues a command for execution during the rendering cycle. All gesture operations should be called using this method. |
rectSelect |
Executes a rectangular selection. |
rotate |
Rotates the content resource displayed on the Viewport. |
setBackgroundColorBottomABGR |
Sets the background color for the bottom area of the Viewport. |
setBackgroundColorTopABGR |
Sets the background color for the top area of the Viewport. |
setGraphicsCore |
Attaches or detaches the Viewport to the GraphicsCore object. |
setScene |
Attaches the scene to the Viewport for rendering. |
setSelectionRect |
Set selection rectangle for rendering |
setShouldRenderFrame | |
setViewInfo |
Sets the current scene to use the camera view information acquired from the getViewInfo method. |
showHotspots | |
tap |
Executes a click or tap gesture. |
zoom |
Performs a |
zoomTo |
Zooms the scene to a bounding box created from a particular set of nodes. |
Attaches event handler fnFunction
to the frameRenderingFinished event of this sap.ui.vk.dvl.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.vk.dvl.Viewport
itself.
This event will be fired when the frame rendering has finished.
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 |
Attaches event handler fnFunction
to the pan event of this sap.ui.vk.dvl.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.vk.dvl.Viewport
itself.
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 |
Attaches event handler fnFunction
to the rotate event of this sap.ui.vk.dvl.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.vk.dvl.Viewport
itself.
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 |
Attaches event handler fnFunction
to the zoom event of this sap.ui.vk.dvl.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.vk.dvl.Viewport
itself.
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 |
Marks the start of the current gesture operation.
Param | Type | DefaultValue | Description |
---|---|---|---|
x | int |
The x-coordinate of the gesture. |
|
y | int |
The y-coordinate of the gesture. |
Detaches event handler fnFunction
from the frameRenderingFinished event of this sap.ui.vk.dvl.Viewport
.
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 |
Detaches event handler fnFunction
from the pan event of this sap.ui.vk.dvl.Viewport
.
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 |
Detaches event handler fnFunction
from the rotate event of this sap.ui.vk.dvl.Viewport
.
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 |
Detaches event handler fnFunction
from the zoom event of this sap.ui.vk.dvl.Viewport
.
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 |
Creates a new subclass of class sap.ui.vk.dvl.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 |
Fires event frameRenderingFinished to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event pan to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
dx | int | ||
dy | int |
Fires event rotate to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
dx | int | ||
dy | int |
Fires event zoom to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
zoomFactor | float |
Gets current value of property backgroundColorBottomABGR.
Viewport background bottom color in the ABGR format
Default value is 0xffffffff
.
Gets current value of property backgroundColorTopABGR.
Viewport background top color in the ABGR format
Default value is 0xff000000
.
Gets position and size of the viewport square. The information can be used for making calculations when restoring Redlining elements.
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. |
Performs a pan
gesture to pan across the Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
dx | int |
The change in distance along the x-coordinate. |
|
dy | int |
The change in distance along the y-coordinate. |
Queues a command for execution during the rendering cycle. All gesture operations should be called using this method.
Param | Type | DefaultValue | Description |
---|---|---|---|
command | function |
The command to be executed. |
Executes a rectangular selection.
Param | Type | DefaultValue | Description |
---|---|---|---|
x1 | int |
The x-coordinate of starting vertex of selection rectangle. |
|
y1 | int |
The y-coordinate of starting vertex of selection rectangle. |
|
x2 | int |
The x-coordinate of ending vertex of selection rectangle. |
|
y2 | int |
The y-coordinate of ending vertex of selection rectangle. |
Rotates the content resource displayed on the Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
dx | int |
The change in x-coordinate used to define the desired rotation. |
|
dy | int |
The change in y-coordinate used to define the desired rotation. |
Sets the background color for the bottom area of the Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
integerColor | int |
Takes an integer value as parameter. For example: 0xffffffff as hexadecimal value (0x prefix, FF alpha, FF blue, FF green, FF red) |
Sets the background color for the top area of the Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
integerColor | int |
Takes an integer value as parameter. For example: 0xffffffff as hexadecimal value (0x prefix, FF alpha, FF blue, FF green, FF red) |
Attaches or detaches the Viewport to the GraphicsCore object.
Param | Type | DefaultValue | Description |
---|---|---|---|
graphicsCore | sap.ui.vk.dvl.GraphicsCore |
The GraphicsCore object or |
Attaches the scene to the Viewport for rendering.
Param | Type | DefaultValue | Description |
---|---|---|---|
scene | sap.ui.vk.Scene |
The scene to attach to the Viewport. |
Set selection rectangle for rendering
Param | Type | DefaultValue | Description |
---|---|---|---|
rect | object |
coordinates of selection rectangle |
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. |
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. |
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 |
Performs a zoom
gesture to zoom in or out on the beginGesture coordinate.
Param | Type | DefaultValue | Description |
---|---|---|---|
dy | float |
Zoom factor. A scale factor that specifies how much to zoom in or out by. |
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. |