@sapui5/sap.ui.vk 1.141.0 → 1.143.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/ui/vk/.library +1 -1
- package/src/sap/ui/vk/AnimationPlayback.js +1 -1
- package/src/sap/ui/vk/AnimationPlayer.js +1 -1
- package/src/sap/ui/vk/AnimationSequence.js +1 -1
- package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
- package/src/sap/ui/vk/AnimationTrack.js +1 -1
- package/src/sap/ui/vk/Annotation.js +1 -1
- package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/Camera.js +1 -1
- package/src/sap/ui/vk/ContentConnector.js +1 -1
- package/src/sap/ui/vk/ContentManager.js +1 -1
- package/src/sap/ui/vk/ContentResource.js +1 -1
- package/src/sap/ui/vk/Core.js +1 -1
- package/src/sap/ui/vk/DownloadManager.js +1 -1
- package/src/sap/ui/vk/DrawerToolbar.js +35 -35
- package/src/sap/ui/vk/DvlException.js +1 -1
- package/src/sap/ui/vk/FlexibleControl.js +1 -1
- package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
- package/src/sap/ui/vk/Highlight.js +1 -1
- package/src/sap/ui/vk/ImageContentManager.js +1 -1
- package/src/sap/ui/vk/JointUtils.js +1 -1
- package/src/sap/ui/vk/LayerProxy.js +1 -1
- package/src/sap/ui/vk/Loco.js +1 -1
- package/src/sap/ui/vk/Material.js +1 -1
- package/src/sap/ui/vk/NativeViewport.js +1 -1
- package/src/sap/ui/vk/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/NodeProxy.js +1 -1
- package/src/sap/ui/vk/NodeUtils.js +1 -1
- package/src/sap/ui/vk/Notifications.js +1 -1
- package/src/sap/ui/vk/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/ProgressIndicator.js +1 -1
- package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
- package/src/sap/ui/vk/RedlineConversation.js +1 -1
- package/src/sap/ui/vk/RedlineDesign.js +1 -1
- package/src/sap/ui/vk/RedlineElement.js +1 -1
- package/src/sap/ui/vk/RedlineElementComment.js +1 -1
- package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
- package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
- package/src/sap/ui/vk/RedlineElementLine.js +1 -1
- package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
- package/src/sap/ui/vk/RedlineElementText.js +1 -1
- package/src/sap/ui/vk/RedlineSurface.js +1 -1
- package/src/sap/ui/vk/SafeArea.js +1 -1
- package/src/sap/ui/vk/Scene.js +1 -1
- package/src/sap/ui/vk/SceneTree.js +1 -1
- package/src/sap/ui/vk/StepNavigation.js +1 -1
- package/src/sap/ui/vk/Texture.js +1 -1
- package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
- package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
- package/src/sap/ui/vk/Toolbar.js +1 -1
- package/src/sap/ui/vk/View.js +1 -1
- package/src/sap/ui/vk/ViewGallery.js +1 -1
- package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
- package/src/sap/ui/vk/ViewGroup.js +1 -1
- package/src/sap/ui/vk/ViewManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
- package/src/sap/ui/vk/Viewer.js +1 -1
- package/src/sap/ui/vk/Viewport.js +26 -3
- package/src/sap/ui/vk/ViewportBase.js +17 -1
- package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
- package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
- package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/Scene.js +1 -1
- package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/dvl/Viewport.js +1 -1
- package/src/sap/ui/vk/ecad/ElementsPanel.js +1 -1
- package/src/sap/ui/vk/ecad/LayersPanel.js +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_es.properties +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_iw.properties +1 -1
- package/src/sap/ui/vk/library.js +2 -2
- package/src/sap/ui/vk/matai/MataiLoaderWorker.js +29 -7
- package/src/sap/ui/vk/measurements/Angle.js +1 -1
- package/src/sap/ui/vk/measurements/Area.js +1 -1
- package/src/sap/ui/vk/measurements/Distance.js +1 -1
- package/src/sap/ui/vk/measurements/Edge.js +1 -1
- package/src/sap/ui/vk/measurements/Face.js +1 -1
- package/src/sap/ui/vk/measurements/Feature.js +1 -1
- package/src/sap/ui/vk/measurements/Vertex.js +1 -1
- package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
- package/src/sap/ui/vk/pdf/Viewport.js +1 -1
- package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/svg/ContentManager.js +1 -1
- package/src/sap/ui/vk/svg/Element.js +16 -5
- package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/svg/Scene.js +1 -1
- package/src/sap/ui/vk/svg/SceneBuilder.js +16 -9
- package/src/sap/ui/vk/svg/Text.js +2 -0
- package/src/sap/ui/vk/svg/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/svg/Viewport.js +7 -1
- package/src/sap/ui/vk/thirdparty/pdf.js +1 -1
- package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
- package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
- package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/Billboard.js +17 -16
- package/src/sap/ui/vk/threejs/Callout.js +2 -2
- package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
- package/src/sap/ui/vk/threejs/DetailView.js +1 -1
- package/src/sap/ui/vk/threejs/HighlightPlayer.js +11 -3
- package/src/sap/ui/vk/threejs/Material.js +1 -1
- package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
- package/src/sap/ui/vk/threejs/Scene.js +1 -1
- package/src/sap/ui/vk/threejs/SceneBuilder.js +6 -6
- package/src/sap/ui/vk/threejs/Texture.js +1 -1
- package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
- package/src/sap/ui/vk/threejs/ViewStateManager.js +4 -3
- package/src/sap/ui/vk/threejs/Viewport.js +8 -9
- package/src/sap/ui/vk/threejs/ViewportGestureHandler.js +4 -6
- package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Gizmo.js +1 -1
- package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Tool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
- package/src/sap/ui/vk/ve/dvl.js +7 -7
- package/src/sap/ui/vk/ve/dvl.wasm +0 -0
- package/src/sap/ui/vk/ve/matai.js +2 -2
- package/src/sap/ui/vk/ve/matai.wasm +0 -0
|
@@ -66,7 +66,7 @@ sap.ui.define([
|
|
|
66
66
|
*
|
|
67
67
|
* @private
|
|
68
68
|
* @author SAP SE
|
|
69
|
-
* @version 1.
|
|
69
|
+
* @version 1.143.0
|
|
70
70
|
*/
|
|
71
71
|
var SceneBuilder = function(rootNode, contentResource, resolve, reject) {
|
|
72
72
|
this._rootNode = rootNode;
|
|
@@ -128,20 +128,27 @@ sap.ui.define([
|
|
|
128
128
|
if (outputSettings && camera) {
|
|
129
129
|
// update line width in materials if coordinate space is in device/paper units
|
|
130
130
|
const outputDPI = 72; // ignore outputSettings.dpi as VEA ignores DPI setting and always uses 72 DPI
|
|
131
|
-
const
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
const
|
|
131
|
+
const mmPerInch = 25.4; // 1 inch = 25.4 mm
|
|
132
|
+
const outputSizeMM = Math.min(outputSettings.width, outputSettings.height); // in mm
|
|
133
|
+
const outputSize = outputSizeMM * (outputDPI / mmPerInch); // in dots (1 dot = 1/72 inch)
|
|
134
|
+
const mediumViewportSize = 768; // medium viewport size in pixels (1024x768)
|
|
135
|
+
// console.log(`setScene outputSettings: ${JSON.stringify(outputSettings)}`);
|
|
135
136
|
|
|
136
137
|
this._materialMap.forEach(function(material) {
|
|
137
|
-
if (material.lineStyle.widthCoordinateSpace ===
|
|
138
|
-
|
|
138
|
+
if (material.lineStyle.widthCoordinateSpace === 3) { // sap::ve::core::Material::CoordinateSpace::NormalizedViewport
|
|
139
|
+
// 2D viewport space (x and y values range from -1.0 to 1.0, the origin representing the center of view)
|
|
140
|
+
material.lineWidth = material.lineStyle.width * mediumViewportSize * 0.5; // 768 is a medium viewport size in pixels
|
|
141
|
+
material.lineStyle.widthCoordinateSpace = 0; // convert to screen space
|
|
142
|
+
} else if (material.lineStyle.widthCoordinateSpace === 4) { // sap::ve::core::Material::CoordinateSpace::Device (device/paper units)
|
|
143
|
+
if (info.showPaperSpace) {
|
|
144
|
+
// this mode requires conversion to world space units, so that the line thickness is affected by initial camera zoom factor
|
|
145
|
+
material.lineWidth = material.lineStyle.width * 2 / (outputSize * camera._initialZoom);
|
|
146
|
+
} else {
|
|
139
147
|
// this mode has a weird behavior in VE Author, the line thickness is measured in weird units that are converted
|
|
140
148
|
// to pixels (doesn't depend on the zoom factor), but it depends on the viewport size
|
|
141
|
-
material.lineWidth = material.lineStyle.width *
|
|
149
|
+
material.lineWidth = material.lineStyle.width * mediumViewportSize / outputSize;
|
|
142
150
|
material.lineStyle.widthCoordinateSpace = 0; // convert to screen space
|
|
143
151
|
}
|
|
144
|
-
// material.lineWidth = material.lineStyle.width / (outputSize * camera._initialZoom);
|
|
145
152
|
}
|
|
146
153
|
});
|
|
147
154
|
}
|
|
@@ -658,6 +658,8 @@ sap.ui.define([
|
|
|
658
658
|
customText.setHtmlTextContent(options.htmlText);
|
|
659
659
|
}
|
|
660
660
|
customText.userData.customText = true; // mark the custom text element for special hit test handling
|
|
661
|
+
customText.parent = this;
|
|
662
|
+
this._updateColor();
|
|
661
663
|
return this;
|
|
662
664
|
};
|
|
663
665
|
|
|
@@ -49,7 +49,7 @@ sap.ui.define([
|
|
|
49
49
|
* @param {object} [mSettings] Initial settings for the new ViewStateManager object.
|
|
50
50
|
* @public
|
|
51
51
|
* @author SAP SE
|
|
52
|
-
* @version 1.
|
|
52
|
+
* @version 1.143.0
|
|
53
53
|
* @extends sap.ui.vk.ViewStateManagerBase
|
|
54
54
|
* @alias sap.ui.vk.svg.ViewStateManager
|
|
55
55
|
* @since 1.80.0
|
|
@@ -76,7 +76,7 @@ sap.ui.define([
|
|
|
76
76
|
*
|
|
77
77
|
* @public
|
|
78
78
|
* @author SAP SE
|
|
79
|
-
* @version 1.
|
|
79
|
+
* @version 1.143.0
|
|
80
80
|
* @extends sap.ui.vk.ViewportBase
|
|
81
81
|
* @alias sap.ui.vk.svg.Viewport
|
|
82
82
|
*/
|
|
@@ -339,6 +339,8 @@ sap.ui.define([
|
|
|
339
339
|
root.traverse(function(node) {
|
|
340
340
|
if (node.customText?.style.size === "0px") { // "0px" is a special case, it means "default font size"
|
|
341
341
|
node.customText.style.size = fontSize + "px";
|
|
342
|
+
node.customText.setHtmlTextContent(node.customText.getHtmlTextContent()); // recreate the HTML content with new font size
|
|
343
|
+
node._updateCustomText(); // update position of the custom text
|
|
342
344
|
}
|
|
343
345
|
});
|
|
344
346
|
};
|
|
@@ -625,6 +627,10 @@ sap.ui.define([
|
|
|
625
627
|
return null; // element not found in the scene
|
|
626
628
|
}
|
|
627
629
|
|
|
630
|
+
if (hit.userData.customText && hit.parent && hit.parent._vkGetNodeContentType() === NodeContentType.DynamicContent) {
|
|
631
|
+
return hit.parent;
|
|
632
|
+
}
|
|
633
|
+
|
|
628
634
|
if ((ignoreHotspots && elem._vkGetNodeContentType() === NodeContentType.Hotspot) ||
|
|
629
635
|
hit.userData.customText) {
|
|
630
636
|
return undefined; // ignore hotspots if the "ignoreHotspots" flag is set and ignore custom text elements
|
|
@@ -22162,7 +22162,7 @@ class SignatureExtractor {
|
|
|
22162
22162
|
const header = new Uint32Array(data.buffer, 0, data.length >> 2);
|
|
22163
22163
|
const version = header[1];
|
|
22164
22164
|
if (version !== 0) {
|
|
22165
|
-
throw new Error(`Invalid version: 1.
|
|
22165
|
+
throw new Error(`Invalid version: 1.143.0`);
|
|
22166
22166
|
}
|
|
22167
22167
|
const width = header[2];
|
|
22168
22168
|
const height = header[3];
|
|
@@ -55837,7 +55837,7 @@ class PDFDocument {
|
|
|
55837
55837
|
if (PDF_VERSION_REGEXP.test(version)) {
|
|
55838
55838
|
this.#version = version;
|
|
55839
55839
|
} else {
|
|
55840
|
-
warn(`Invalid PDF header version: 1.
|
|
55840
|
+
warn(`Invalid PDF header version: 1.143.0`);
|
|
55841
55841
|
}
|
|
55842
55842
|
}
|
|
55843
55843
|
parseStartXRef() {
|
|
@@ -39,7 +39,7 @@ sap.ui.define([
|
|
|
39
39
|
*
|
|
40
40
|
* @private
|
|
41
41
|
* @author SAP SE
|
|
42
|
-
* @version 1.
|
|
42
|
+
* @version 1.143.0
|
|
43
43
|
* @extends sap.ui.base.ManagedObject
|
|
44
44
|
* @alias sap.ui.vk.threejs.Billboard
|
|
45
45
|
*/
|
|
@@ -210,7 +210,7 @@ sap.ui.define([
|
|
|
210
210
|
};
|
|
211
211
|
|
|
212
212
|
Billboard.prototype.setFont = function(value) {
|
|
213
|
-
this.setProperty("font", value, true);
|
|
213
|
+
this.setProperty("font", value.replace(/[^a-zA-Z0-9 ]/g, ""), true); // sanitize font name, VDS may have special characters in font name
|
|
214
214
|
this._needUpdateTexture = true;
|
|
215
215
|
return this;
|
|
216
216
|
};
|
|
@@ -400,7 +400,7 @@ sap.ui.define([
|
|
|
400
400
|
return (this.getFontItalic() ? "italic " : "") + this.getFontWeight() + " " + (this.getFontSize() * pixelRatio) + "px " + (this.getFont() || "Arial");
|
|
401
401
|
};
|
|
402
402
|
|
|
403
|
-
Billboard.prototype._renderPlainText = function(pixelRatio) {
|
|
403
|
+
Billboard.prototype._renderPlainText = function(pixelRatio, resolve) {
|
|
404
404
|
var canvas = document.createElement("canvas");
|
|
405
405
|
var ctx = canvas.getContext("2d");
|
|
406
406
|
var fontSize = this.getFontSize() * pixelRatio;
|
|
@@ -463,10 +463,10 @@ sap.ui.define([
|
|
|
463
463
|
ctx.fillText(link, width - margin, height - margin);
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
this._setBillboardTexture(canvas, width, height);
|
|
466
|
+
this._setBillboardTexture(canvas, width, height, resolve);
|
|
467
467
|
};
|
|
468
468
|
|
|
469
|
-
Billboard.prototype._renderHtmlText = function(pixelRatio) {
|
|
469
|
+
Billboard.prototype._renderHtmlText = function(pixelRatio, resolve) {
|
|
470
470
|
var canvas = document.createElement("canvas");
|
|
471
471
|
var ctx = canvas.getContext("2d");
|
|
472
472
|
var borderWidth = this.getBorderLineStyle() !== BillboardBorderLineStyle.None ? this.getBorderWidth() * pixelRatio : 0;
|
|
@@ -522,13 +522,13 @@ sap.ui.define([
|
|
|
522
522
|
canvas.getContext("2d").drawImage(htmlCanvas, margin, margin);
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
setTimeout(this._setBillboardTexture.bind(this, canvas, width, height), 0);
|
|
525
|
+
setTimeout(this._setBillboardTexture.bind(this, canvas, width, height, resolve), 0);
|
|
526
526
|
|
|
527
527
|
document.body.removeChild(iframe);
|
|
528
528
|
}.bind(this));
|
|
529
529
|
};
|
|
530
530
|
|
|
531
|
-
Billboard.prototype._renderText = function(pixelRatio) {
|
|
531
|
+
Billboard.prototype._renderText = function(pixelRatio, resolve) {
|
|
532
532
|
|
|
533
533
|
var fontFace = this.getFont() || "Arial";
|
|
534
534
|
var fontSize = this.getFontSize() * 1.333; // = 96.0 / 72.0, conversion factor from Pt (points) to pixels
|
|
@@ -998,7 +998,7 @@ sap.ui.define([
|
|
|
998
998
|
y += lineSpacing;
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
|
-
this._setBillboardTexture(canvas, contentWidth, contentHeight);
|
|
1001
|
+
this._setBillboardTexture(canvas, contentWidth, contentHeight, resolve);
|
|
1002
1002
|
document.body.removeChild(canvas);
|
|
1003
1003
|
} else if (this.getEncoding() === BillboardTextEncoding.HtmlText && typeof html2canvas != "undefined") {// HtmlText (aka RichText)
|
|
1004
1004
|
|
|
@@ -1040,7 +1040,7 @@ sap.ui.define([
|
|
|
1040
1040
|
ctx.drawImage(htmlCanvas, borderWidth, borderWidth);
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
|
-
setTimeout(this._setBillboardTexture.bind(this, canvas, contentWidth, contentHeight), 0);
|
|
1043
|
+
setTimeout(this._setBillboardTexture.bind(this, canvas, contentWidth, contentHeight, resolve), 0);
|
|
1044
1044
|
|
|
1045
1045
|
document.body.removeChild(htmlFrame);
|
|
1046
1046
|
document.body.removeChild(canvas);
|
|
@@ -1050,7 +1050,7 @@ sap.ui.define([
|
|
|
1050
1050
|
}
|
|
1051
1051
|
};
|
|
1052
1052
|
|
|
1053
|
-
Billboard.prototype._setBillboardTexture = function(canvas, width, height) {
|
|
1053
|
+
Billboard.prototype._setBillboardTexture = function(canvas, width, height, resolve) {
|
|
1054
1054
|
var u = width / canvas.width,
|
|
1055
1055
|
v = height / canvas.height;
|
|
1056
1056
|
this._billboard.geometry = new THREE.PlaneGeometry(1, 1).setAttribute("uv", new THREE.Float32BufferAttribute([0, 1, u, 1, 0, 1 - v, u, 1 - v], 2));
|
|
@@ -1058,6 +1058,7 @@ sap.ui.define([
|
|
|
1058
1058
|
var texture = new THREE.CanvasTexture(canvas);
|
|
1059
1059
|
texture.magFilter = THREE.NearestFilter;
|
|
1060
1060
|
this.setTexture(texture);
|
|
1061
|
+
resolve?.();
|
|
1061
1062
|
};
|
|
1062
1063
|
|
|
1063
1064
|
var pos4 = new THREE.Vector4(),
|
|
@@ -1067,28 +1068,28 @@ sap.ui.define([
|
|
|
1067
1068
|
quat = new THREE.Quaternion(),
|
|
1068
1069
|
tmpScale = new THREE.Vector3();
|
|
1069
1070
|
|
|
1070
|
-
Billboard.prototype._updateTexture = function() {
|
|
1071
|
+
Billboard.prototype._updateTexture = function(resolve) {
|
|
1071
1072
|
this._width = this.getWidth();
|
|
1072
1073
|
this._height = this.getHeight();
|
|
1073
1074
|
|
|
1074
1075
|
if (this.getText() && !this.getTexture()) {
|
|
1075
1076
|
|
|
1076
|
-
this._renderText(window.devicePixelRatio);
|
|
1077
|
+
this._renderText(window.devicePixelRatio, resolve);
|
|
1077
1078
|
/*
|
|
1078
1079
|
switch (this.getEncoding()) {
|
|
1079
1080
|
default:
|
|
1080
1081
|
case BillboardTextEncoding.PlainText:
|
|
1081
|
-
this._renderPlainText(window.devicePixelRatio);
|
|
1082
|
+
this._renderPlainText(window.devicePixelRatio, resolve);
|
|
1082
1083
|
break;
|
|
1083
1084
|
case BillboardTextEncoding.HtmlText:
|
|
1084
|
-
this._renderHtmlText(window.devicePixelRatio);
|
|
1085
|
+
this._renderHtmlText(window.devicePixelRatio, resolve);
|
|
1085
1086
|
break;
|
|
1086
1087
|
}
|
|
1087
1088
|
*/
|
|
1088
1089
|
}
|
|
1089
1090
|
};
|
|
1090
1091
|
|
|
1091
|
-
Billboard.prototype._update = function(renderer, camera, viewportSize) {
|
|
1092
|
+
Billboard.prototype._update = function(renderer, camera, viewportSize, backgroundProjection, vsm, resolve) {
|
|
1092
1093
|
var node = this.getNode();
|
|
1093
1094
|
if (!node || !node.visible) {
|
|
1094
1095
|
return;
|
|
@@ -1096,7 +1097,7 @@ sap.ui.define([
|
|
|
1096
1097
|
|
|
1097
1098
|
if (this._needUpdateTexture) {
|
|
1098
1099
|
this._needUpdateTexture = false;
|
|
1099
|
-
this._updateTexture();
|
|
1100
|
+
this._updateTexture(resolve);
|
|
1100
1101
|
}
|
|
1101
1102
|
|
|
1102
1103
|
node.matrix.copy(node.parent.matrixWorld).invert();
|
|
@@ -39,7 +39,7 @@ sap.ui.define([
|
|
|
39
39
|
*
|
|
40
40
|
* @private
|
|
41
41
|
* @author SAP SE
|
|
42
|
-
* @version 1.
|
|
42
|
+
* @version 1.143.0
|
|
43
43
|
* @extends sap.ui.vk.threejs.Billboard
|
|
44
44
|
* @alias sap.ui.vk.threejs.Callout
|
|
45
45
|
*/
|
|
@@ -153,7 +153,7 @@ sap.ui.define([
|
|
|
153
153
|
// set billboard scale
|
|
154
154
|
var scale = pos4.w * 2 / (viewportSize.x * camera.projectionMatrix.elements[0]);
|
|
155
155
|
const outputSettings = renderer.userData?.outputSettings;
|
|
156
|
-
if (outputSettings) {
|
|
156
|
+
if (outputSettings?.width > 0 && outputSettings.height > 0) {
|
|
157
157
|
const outputDPI = 72; // ignore outputSettings.dpi as VEA ignores DPI setting and always uses 72 DPI
|
|
158
158
|
const mmToInch = 1 / 25.4; // 1 inch = 25.4 mm
|
|
159
159
|
const pointToPixel = 4 / 3; // 1 inch = 72 points(common for older screens) = 96 pixels(standard web displays), so 1 point = 96 / 72 pixels = 4 / 3 pixels
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
* @class Provides a class to communicate with content delivery service.
|
|
34
34
|
* @private
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.143.0
|
|
37
37
|
* @extends sap.ui.base.ManagedObject
|
|
38
38
|
* @alias sap.ui.vk.threejs.ContentDeliveryService
|
|
39
39
|
*/
|
|
@@ -112,7 +112,7 @@ sap.ui.define([
|
|
|
112
112
|
* @param {object} [mSettings] Initial settings for the new ContentManager object.
|
|
113
113
|
* @protected
|
|
114
114
|
* @author SAP SE
|
|
115
|
-
* @version 1.
|
|
115
|
+
* @version 1.143.0
|
|
116
116
|
* @extends sap.ui.vk.ContentManager
|
|
117
117
|
* @alias sap.ui.vk.threejs.ContentManager
|
|
118
118
|
* @since 1.50.0
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @private
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.143.0
|
|
26
26
|
* @extends sap.ui.base.Object
|
|
27
27
|
* @alias sap.ui.vk.threejs.HighlightPlayer
|
|
28
28
|
*/
|
|
@@ -56,6 +56,14 @@ sap.ui.define([
|
|
|
56
56
|
return this;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
HighlightPlayer.prototype._collectHighlightedNodes = function() {
|
|
60
|
+
const highlightedNodes = new Set();
|
|
61
|
+
this._highlightsNodesMap.forEach(function(nodesInfo, highlight) {
|
|
62
|
+
nodesInfo.nodes.forEach(highlightedNodes.add.bind(highlightedNodes));
|
|
63
|
+
});
|
|
64
|
+
return highlightedNodes;
|
|
65
|
+
};
|
|
66
|
+
|
|
59
67
|
HighlightPlayer.prototype.setViewStateManager = function(vsm) {
|
|
60
68
|
this._viewStateManager = vsm;
|
|
61
69
|
};
|
|
@@ -108,10 +116,10 @@ sap.ui.define([
|
|
|
108
116
|
const res = highlight.evaluate(this._timeElapsed / 1000.0);
|
|
109
117
|
|
|
110
118
|
if (res.color != null) {
|
|
111
|
-
this._viewStateManager.setNodesHighlightColor(nodesInfo.nodes, res.
|
|
119
|
+
this._viewStateManager.setNodesHighlightColor(nodesInfo.nodes, res.color);
|
|
112
120
|
}
|
|
113
121
|
if (res.opacity != null) {
|
|
114
|
-
this._viewStateManager.setOpacity(nodesInfo.nodes, res.isCompleted ? null : res.opacity);
|
|
122
|
+
this._viewStateManager.setOpacity(nodesInfo.nodes, res.isCompleted && highlight.isFadeInOut() ? null : res.opacity);
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
if (res.isCompleted) {
|
|
@@ -104,7 +104,7 @@ sap.ui.define([
|
|
|
104
104
|
*
|
|
105
105
|
* @private
|
|
106
106
|
* @author SAP SE
|
|
107
|
-
* @version 1.
|
|
107
|
+
* @version 1.143.0
|
|
108
108
|
*/
|
|
109
109
|
var SceneBuilder = function(rootNode, contentResource, resolve, reject) {
|
|
110
110
|
this._rootNode = rootNode;
|
|
@@ -625,7 +625,7 @@ sap.ui.define([
|
|
|
625
625
|
node.name = nodeInfo.name;
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
if (nodeInfo.visible
|
|
628
|
+
if (nodeInfo.visible != null && !userData.skipIt) {
|
|
629
629
|
node.visible = !!nodeInfo.visible;
|
|
630
630
|
}
|
|
631
631
|
|
|
@@ -2759,6 +2759,10 @@ sap.ui.define([
|
|
|
2759
2759
|
material = this._createTemporaryMaterial(materialId);
|
|
2760
2760
|
}
|
|
2761
2761
|
|
|
2762
|
+
if (materialInfo.diffuseColour) {
|
|
2763
|
+
material.color.fromArray(materialInfo.diffuseColour); // material.color may be later overridden by materialInfo.lineColour
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2762
2766
|
if (materialInfo.lineWidth > 0) {
|
|
2763
2767
|
// note: "LineBasicMaterial" does not support line thickness rendering, see three.js doc:
|
|
2764
2768
|
// "Due to limitations of the OpenGL Core Profile with the WebGL renderer on most platforms linewidth will always be 1 regardless of the set value."
|
|
@@ -2786,10 +2790,6 @@ sap.ui.define([
|
|
|
2786
2790
|
|
|
2787
2791
|
material.userData.materialInfo = materialInfo;
|
|
2788
2792
|
|
|
2789
|
-
if (materialInfo.diffuseColour) {
|
|
2790
|
-
material.color.fromArray(materialInfo.diffuseColour);
|
|
2791
|
-
}
|
|
2792
|
-
|
|
2793
2793
|
if (materialInfo.specularColour && material.specular) {
|
|
2794
2794
|
material.specular.fromArray(materialInfo.specularColour);
|
|
2795
2795
|
if (materialInfo.specularLevel) {
|
|
@@ -82,7 +82,7 @@ sap.ui.define([
|
|
|
82
82
|
* @param {object} [mSettings] Initial settings for the new ViewStateManager object.
|
|
83
83
|
* @public
|
|
84
84
|
* @author SAP SE
|
|
85
|
-
* @version 1.
|
|
85
|
+
* @version 1.143.0
|
|
86
86
|
* @extends sap.ui.vk.ViewStateManagerBase
|
|
87
87
|
* @alias sap.ui.vk.threejs.ViewStateManager
|
|
88
88
|
* @since 1.32.0
|
|
@@ -2387,7 +2387,6 @@ sap.ui.define([
|
|
|
2387
2387
|
this._resetNodesMaterialAndOpacityByCurrentView(view);
|
|
2388
2388
|
this._prepareTransition(view);
|
|
2389
2389
|
this._resetNodesStatusByCurrentView(view, true);
|
|
2390
|
-
this._highlightPlayer.reset(view, this._scene);
|
|
2391
2390
|
|
|
2392
2391
|
this.fireViewStateApplied({
|
|
2393
2392
|
view: view,
|
|
@@ -2443,6 +2442,7 @@ sap.ui.define([
|
|
|
2443
2442
|
};
|
|
2444
2443
|
|
|
2445
2444
|
ViewStateManager.prototype._prepareTransition = function(view) {
|
|
2445
|
+
this._highlightPlayer.reset(view, this._scene);
|
|
2446
2446
|
this._transitionPlayer.reset();
|
|
2447
2447
|
this._transitionPlayer.fadeInNodes = [];
|
|
2448
2448
|
this._transitionPlayer.fadeOutNodes = [];
|
|
@@ -2454,6 +2454,7 @@ sap.ui.define([
|
|
|
2454
2454
|
return;
|
|
2455
2455
|
}
|
|
2456
2456
|
|
|
2457
|
+
const highlightedNodes = this._highlightPlayer._collectHighlightedNodes();
|
|
2457
2458
|
var visibleNodes = new Set();
|
|
2458
2459
|
var hiddenNodes = new Set();
|
|
2459
2460
|
nodeInfos.forEach(function(info) {
|
|
@@ -2466,7 +2467,7 @@ sap.ui.define([
|
|
|
2466
2467
|
|
|
2467
2468
|
var collectTransitionMeshes = function(nodeRef, newVisible, oldVisible) {
|
|
2468
2469
|
if (!nodeRef.userData.skipIt) {
|
|
2469
|
-
newVisible = newVisible && visibleNodes.has(nodeRef);
|
|
2470
|
+
newVisible = (newVisible && visibleNodes.has(nodeRef)) || highlightedNodes.has(nodeRef); // highlighted nodes are always visible
|
|
2470
2471
|
oldVisible = oldVisible && this.getVisibilityState(nodeRef);
|
|
2471
2472
|
}
|
|
2472
2473
|
|
|
@@ -94,7 +94,7 @@ sap.ui.define([
|
|
|
94
94
|
*
|
|
95
95
|
* @public
|
|
96
96
|
* @author SAP SE
|
|
97
|
-
* @version 1.
|
|
97
|
+
* @version 1.143.0
|
|
98
98
|
* @extends sap.ui.vk.ViewportBase
|
|
99
99
|
* @alias sap.ui.vk.threejs.Viewport
|
|
100
100
|
*/
|
|
@@ -1086,17 +1086,16 @@ sap.ui.define([
|
|
|
1086
1086
|
let somethingWasChanged = false;
|
|
1087
1087
|
renderer.userData ??= {};
|
|
1088
1088
|
renderer.userData.outputSettings = viewport._outputSettings;
|
|
1089
|
+
const resolve = () => { viewport.setShouldRenderFrame(true); };
|
|
1089
1090
|
|
|
1090
1091
|
// update billboards, callouts, lock to viewport nodes, etc
|
|
1091
1092
|
scene.children.forEach(function(root) {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1093
|
+
root.userData._vkDynamicObjects?.forEach(function(object) {
|
|
1094
|
+
if (object.parent) {
|
|
1095
|
+
object._vkUpdate(renderer, camera, viewportSize, backgroundProjection, vsm, resolve);
|
|
1096
|
+
somethingWasChanged = true;
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1100
1099
|
});
|
|
1101
1100
|
|
|
1102
1101
|
return somethingWasChanged;
|
|
@@ -52,11 +52,6 @@ sap.ui.define([
|
|
|
52
52
|
var gestureTarget = new THREE.Vector3(); // center of interaction
|
|
53
53
|
var zoomTarget = new THREE.Vector2();
|
|
54
54
|
|
|
55
|
-
// turn table const
|
|
56
|
-
var ANGLE_EPSILON = 0.001;
|
|
57
|
-
var MIN_PITCH = -Math.PI / 2 + ANGLE_EPSILON;
|
|
58
|
-
var MAX_PITCH = Math.PI / 2 - ANGLE_EPSILON;
|
|
59
|
-
|
|
60
55
|
this.isTurnTableMode = true; // true by default
|
|
61
56
|
this._timeIntervalForCameraAnimation = 500; // millisecond, time interval for one camera moving animation
|
|
62
57
|
this._startTimeForCameraAnimation = 0; // update count during camera moving animation
|
|
@@ -192,8 +187,11 @@ sap.ui.define([
|
|
|
192
187
|
}
|
|
193
188
|
|
|
194
189
|
rotation.setFromAxisAngle(sceneUpDir, deltaYaw); // Y-axis for now
|
|
190
|
+
const ANGLE_EPSILON = 0.001;
|
|
191
|
+
const minPitch = Math.max(THREE.MathUtils.degToRad(viewport.getMinCameraPitch()), -Math.PI / 2 + ANGLE_EPSILON);
|
|
192
|
+
const maxPitch = Math.min(THREE.MathUtils.degToRad(viewport.getMaxCameraPitch()), Math.PI / 2 - ANGLE_EPSILON);
|
|
195
193
|
var pitch = Math.atan2(lookDir.y, Math.sqrt(lookDir.x * lookDir.x + lookDir.z * lookDir.z));
|
|
196
|
-
deltaPitch = THREE.MathUtils.clamp(deltaPitch,
|
|
194
|
+
deltaPitch = THREE.MathUtils.clamp(deltaPitch, minPitch - pitch, maxPitch - pitch);
|
|
197
195
|
} else {
|
|
198
196
|
rotation.setFromAxisAngle(upDir, deltaYaw);
|
|
199
197
|
}
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @param {object} [mSettings] An optional map/JSON object with initial property values, aggregated objects etc. for the new tool instance.
|
|
33
33
|
* @public
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.143.0
|
|
36
36
|
* @extends sap.ui.vk.tools.Tool
|
|
37
37
|
* @alias sap.ui.vk.tools.AnchorPointTool
|
|
38
38
|
*/
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @param {object} [mSettings] An optional map/JSON object with initial property values, aggregated objects etc. for the new tool instance.
|
|
33
33
|
* @public
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.143.0
|
|
36
36
|
* @extends sap.ui.vk.tools.Tool
|
|
37
37
|
* @alias sap.ui.vk.tools.AxisAngleRotationTool
|
|
38
38
|
*/
|
|
@@ -34,7 +34,7 @@ sap.ui.define([
|
|
|
34
34
|
* @param {object} [mSettings] An optional map/JSON object with initial property values, aggregated objects etc. for the new tool instance.
|
|
35
35
|
* @public
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
37
|
+
* @version 1.143.0
|
|
38
38
|
* @extends sap.ui.vk.tools.Tool
|
|
39
39
|
* @alias sap.ui.vk.tools.CreateEllipseTool
|
|
40
40
|
*/
|