@sapui5/sap.ui.vk 1.134.0 → 1.135.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.
Files changed (173) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vk/.library +1 -1
  3. package/src/sap/ui/vk/AnimationPlayback.js +1 -2
  4. package/src/sap/ui/vk/AnimationPlayer.js +1 -1
  5. package/src/sap/ui/vk/AnimationSequence.js +1 -5
  6. package/src/sap/ui/vk/AnimationTimeSlider.js +1 -2
  7. package/src/sap/ui/vk/AnimationTrack.js +2 -4
  8. package/src/sap/ui/vk/Annotation.js +1 -1
  9. package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
  10. package/src/sap/ui/vk/Camera.js +1 -1
  11. package/src/sap/ui/vk/ContentConnector.js +1 -1
  12. package/src/sap/ui/vk/ContentManager.js +1 -1
  13. package/src/sap/ui/vk/ContentResource.js +1 -1
  14. package/src/sap/ui/vk/Core.js +1 -1
  15. package/src/sap/ui/vk/DownloadManager.js +1 -1
  16. package/src/sap/ui/vk/DrawerToolbar.js +1 -1
  17. package/src/sap/ui/vk/DvlException.js +1 -1
  18. package/src/sap/ui/vk/FlexibleControl.js +1 -1
  19. package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
  20. package/src/sap/ui/vk/Highlight.js +40 -318
  21. package/src/sap/ui/vk/ImageContentManager.js +1 -1
  22. package/src/sap/ui/vk/JointUtils.js +1 -2
  23. package/src/sap/ui/vk/LayerProxy.js +1 -1
  24. package/src/sap/ui/vk/Loco.js +1 -1
  25. package/src/sap/ui/vk/Material.js +1 -1
  26. package/src/sap/ui/vk/NativeViewport.js +1 -1
  27. package/src/sap/ui/vk/NodeHierarchy.js +1 -1
  28. package/src/sap/ui/vk/NodeProxy.js +1 -1
  29. package/src/sap/ui/vk/NodeUtils.js +1 -2
  30. package/src/sap/ui/vk/Notifications.js +1 -1
  31. package/src/sap/ui/vk/OrthographicCamera.js +1 -1
  32. package/src/sap/ui/vk/OutputSettings.js +1 -1
  33. package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
  34. package/src/sap/ui/vk/ProgressIndicator.js +1 -1
  35. package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
  36. package/src/sap/ui/vk/RedlineConversation.js +1 -1
  37. package/src/sap/ui/vk/RedlineDesign.js +1 -1
  38. package/src/sap/ui/vk/RedlineElement.js +1 -1
  39. package/src/sap/ui/vk/RedlineElementComment.js +1 -1
  40. package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
  41. package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
  42. package/src/sap/ui/vk/RedlineElementLine.js +1 -1
  43. package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
  44. package/src/sap/ui/vk/RedlineElementText.js +1 -1
  45. package/src/sap/ui/vk/RedlineSurface.js +1 -1
  46. package/src/sap/ui/vk/SafeArea.js +1 -1
  47. package/src/sap/ui/vk/Scene.js +1 -1
  48. package/src/sap/ui/vk/SceneTree.js +1 -1
  49. package/src/sap/ui/vk/StepNavigation.js +1 -1
  50. package/src/sap/ui/vk/Texture.js +1 -1
  51. package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
  52. package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
  53. package/src/sap/ui/vk/Toolbar.js +1 -1
  54. package/src/sap/ui/vk/View.js +57 -75
  55. package/src/sap/ui/vk/ViewGallery.js +10 -2
  56. package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
  57. package/src/sap/ui/vk/ViewGroup.js +1 -1
  58. package/src/sap/ui/vk/ViewManager.js +1 -1
  59. package/src/sap/ui/vk/ViewStateManager.js +1 -5
  60. package/src/sap/ui/vk/ViewStateManagerBase.js +1 -3
  61. package/src/sap/ui/vk/Viewer.js +1 -131
  62. package/src/sap/ui/vk/Viewport.js +1 -1
  63. package/src/sap/ui/vk/ViewportBase.js +3 -1
  64. package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
  65. package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
  66. package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
  67. package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
  68. package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
  69. package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
  70. package/src/sap/ui/vk/dvl/Scene.js +1 -1
  71. package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
  72. package/src/sap/ui/vk/dvl/Viewport.js +1 -1
  73. package/src/sap/ui/vk/library.js +3 -2
  74. package/src/sap/ui/vk/matai/MataiLoaderWorker.js +4 -0
  75. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  76. package/src/sap/ui/vk/measurements/Area.js +1 -1
  77. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  78. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  79. package/src/sap/ui/vk/measurements/Face.js +1 -1
  80. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  81. package/src/sap/ui/vk/measurements/Surface.js +1 -1
  82. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  83. package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
  84. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  85. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  86. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  87. package/src/sap/ui/vk/svg/ContentManager.js +1 -1
  88. package/src/sap/ui/vk/svg/HotspotHelper.js +2 -4
  89. package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
  90. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  91. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  92. package/src/sap/ui/vk/svg/Scene.js +1 -1
  93. package/src/sap/ui/vk/svg/SceneBuilder.js +1 -2
  94. package/src/sap/ui/vk/svg/ViewStateManager.js +1 -2
  95. package/src/sap/ui/vk/svg/Viewport.js +1 -1
  96. package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
  97. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -2
  98. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  99. package/src/sap/ui/vk/threejs/Billboard.js +1 -2
  100. package/src/sap/ui/vk/threejs/Callout.js +1 -2
  101. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  102. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  103. package/src/sap/ui/vk/threejs/DetailView.js +1 -2
  104. package/src/sap/ui/vk/threejs/HighlightPlayer.js +18 -25
  105. package/src/sap/ui/vk/threejs/Material.js +1 -4
  106. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  107. package/src/sap/ui/vk/threejs/NodeProxy.js +7 -26
  108. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  109. package/src/sap/ui/vk/threejs/ParametricGenerators.js +1 -1
  110. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  111. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -2
  112. package/src/sap/ui/vk/threejs/PolylineGeometry.js +29 -1
  113. package/src/sap/ui/vk/threejs/Scene.js +83 -76
  114. package/src/sap/ui/vk/threejs/SceneBuilder.js +7 -22
  115. package/src/sap/ui/vk/threejs/Texture.js +1 -4
  116. package/src/sap/ui/vk/threejs/ThreeExtensions.js +21 -74
  117. package/src/sap/ui/vk/threejs/ThreeUtils.js +1 -1
  118. package/src/sap/ui/vk/threejs/Thrustline.js +1 -4
  119. package/src/sap/ui/vk/threejs/ViewStateManager.js +7 -8
  120. package/src/sap/ui/vk/threejs/Viewport.js +1 -3
  121. package/src/sap/ui/vk/threejs/v2/ViewStateManager.js +12 -29
  122. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  123. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +11 -3
  124. package/src/sap/ui/vk/tools/AngleMeasurementToolGizmo.js +2 -1
  125. package/src/sap/ui/vk/tools/AreaMeasurementToolGizmo.js +2 -1
  126. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -7
  127. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  128. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  129. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +3 -2
  130. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +3 -2
  131. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  132. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +3 -2
  133. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  134. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +3 -2
  135. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  136. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +12 -1
  137. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  138. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +11 -1
  139. package/src/sap/ui/vk/tools/DistanceMeasurementToolGizmo.js +2 -1
  140. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  141. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +3 -2
  142. package/src/sap/ui/vk/tools/ExplodeItemGroup.js +1 -1
  143. package/src/sap/ui/vk/tools/ExplodeTool.js +3 -3
  144. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +3 -2
  145. package/src/sap/ui/vk/tools/Gizmo.js +2 -5
  146. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  147. package/src/sap/ui/vk/tools/MeasurementToolGizmo.js +2 -1
  148. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  149. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  150. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  151. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  152. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  153. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  154. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  155. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  156. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  157. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  158. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  159. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  160. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  161. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  162. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +13 -1
  163. package/src/sap/ui/vk/tools/Tool.js +1 -1
  164. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  165. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  166. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  167. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
  168. package/src/sap/ui/vk/ve/matai.js +1 -1
  169. package/src/sap/ui/vk/ve/matai.wasm +0 -0
  170. package/src/sap/ui/vk/tools/AnchorPointToolGizmoRenderer.js +0 -40
  171. package/src/sap/ui/vk/tools/CreateTextToolGizmoRenderer.js +0 -41
  172. package/src/sap/ui/vk/tools/CrossSectionToolGizmoRenderer.js +0 -40
  173. package/src/sap/ui/vk/tools/SceneOrientationToolGizmoRenderer.js +0 -39
@@ -74,7 +74,7 @@ sap.ui.define([
74
74
  *
75
75
  * @public
76
76
  * @author SAP SE
77
- * @version 1.134.0
77
+ * @version 1.135.0
78
78
  * @extends sap.ui.vk.ViewportBase
79
79
  * @alias sap.ui.vk.svg.Viewport
80
80
  */
@@ -54306,7 +54306,7 @@ class PDFDocument {
54306
54306
  if (PDF_VERSION_REGEXP.test(version)) {
54307
54307
  this._version = version;
54308
54308
  } else {
54309
- warn(`Invalid PDF header version: 1.134.0`);
54309
+ warn(`Invalid PDF header version: 1.135.0`);
54310
54310
  }
54311
54311
  }
54312
54312
  parseStartXRef() {
@@ -35,8 +35,7 @@ sap.ui.define([
35
35
  *
36
36
  * @private
37
37
  * @author SAP SE
38
- * @version 1.134.0
39
- * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.
38
+ * @version 1.135.0
40
39
  */
41
40
  var AnimationHelper = function() {
42
41
  };
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  *
36
36
  * @public
37
37
  * @author SAP SE
38
- * @version 1.134.0
38
+ * @version 1.135.0
39
39
  * @extends sap.ui.vk.BaseNodeProxy
40
40
  * @implements sap.ui.base.Poolable
41
41
  * @alias sap.ui.vk.threejs.BaseNodeProxy
@@ -39,10 +39,9 @@ sap.ui.define([
39
39
  *
40
40
  * @private
41
41
  * @author SAP SE
42
- * @version 1.134.0
42
+ * @version 1.135.0
43
43
  * @extends sap.ui.base.ManagedObject
44
44
  * @alias sap.ui.vk.threejs.Billboard
45
- * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.
46
45
  */
47
46
  var Billboard = BaseObject.extend("sap.ui.vk.threejs.Billboard", /** @lends sap.ui.vk.threejs.Billboard.prototype */ {
48
47
  metadata: {
@@ -39,10 +39,9 @@ sap.ui.define([
39
39
  *
40
40
  * @private
41
41
  * @author SAP SE
42
- * @version 1.134.0
42
+ * @version 1.135.0
43
43
  * @extends sap.ui.vk.threejs.Billboard
44
44
  * @alias sap.ui.vk.threejs.Callout
45
- * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.
46
45
  */
47
46
  var Callout = Billboard.extend("sap.ui.vk.threejs.Callout", /** @lends sap.ui.vk.threejs.Callout.prototype */ {
48
47
  metadata: {
@@ -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.134.0
36
+ * @version 1.135.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.134.0
115
+ * @version 1.135.0
116
116
  * @extends sap.ui.vk.ContentManager
117
117
  * @alias sap.ui.vk.threejs.ContentManager
118
118
  * @since 1.50.0
@@ -33,10 +33,9 @@ sap.ui.define([
33
33
  *
34
34
  * @private
35
35
  * @author SAP SE
36
- * @version 1.134.0
36
+ * @version 1.135.0
37
37
  * @extends sap.ui.base.ManagedObject
38
38
  * @alias sap.ui.vk.threejs.DetailView
39
- * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.
40
39
  */
41
40
  var DetailView = BaseObject.extend("sap.ui.vk.threejs.DetailView", /** @lends sap.ui.vk.threejs.DetailView.prototype */ {
42
41
  metadata: {
@@ -24,10 +24,9 @@ sap.ui.define([
24
24
  *
25
25
  * @private
26
26
  * @author SAP SE
27
- * @version 1.134.0
27
+ * @version 1.135.0
28
28
  * @extends sap.ui.base.Object
29
29
  * @alias sap.ui.vk.threejs.HighlightPlayer
30
- * @experimental Since 1.67.0 This class is experimental and might be modified or removed in future versions.
31
30
  */
32
31
  var HighlightPlayer = BaseObject.extend("sap.ui.vk.threejs.HighlightPlayer", /** @lends sap.ui.vk.three.HighlightPlayer.prototype */ {
33
32
 
@@ -106,38 +105,32 @@ sap.ui.define([
106
105
  }
107
106
  this._timeElapsed = time - this._startTime;
108
107
 
109
- var that = this;
110
-
111
108
  var completedHighlights = [];
112
109
  this._highlightsNodesMap.forEach(function(nodesInfo, highlight) {
113
- var resColor = highlight.getColour(that._timeElapsed / 1000.0);
114
- var nodes = nodesInfo.nodes, ni;
115
- if (resColor !== undefined) {
116
- for (ni = 0; ni < nodes.length; ni++) {
117
- nodes[ni]._vkSetHighlightColor(resColor.colour);
118
- }
119
- }
110
+ const res = highlight.evaluate(this._timeElapsed / 1000.0);
120
111
 
121
- var resOpacity = highlight.getOpacity(that._timeElapsed / 1000.0);
122
- if (resOpacity !== undefined) {
123
- for (ni = 0; ni < nodes.length; ni++) {
124
- nodes[ni]._vkSetOpacity(resOpacity.opacity);
112
+ nodesInfo.nodes.forEach(function(node) {
113
+ if (res.color != null) {
114
+ node._vkSetHighlightColor(res.color);
125
115
  }
126
-
127
- if (resOpacity.isCompleted && highlight.isFadeOut() && nodesInfo.hiddenNodes !== undefined) {
128
- that._viewStateManager.setVisibilityState(nodesInfo.hiddenNodes, false, false);
116
+ if (res.opacity != null) {
117
+ node._vkSetOpacity(res.opacity);
129
118
  }
130
- }
119
+ });
131
120
 
132
- if ((resColor === undefined || resColor.isCompleted) && (resOpacity === undefined || resOpacity.isCompleted)) {
133
- completedHighlights.push(highlight);
121
+ if (res.isCompleted) {
122
+ if (highlight.isFadeOut() && nodesInfo.hiddenNodes !== undefined) {
123
+ this._viewStateManager.setVisibilityState(nodesInfo.hiddenNodes, false, false);
124
+ }
125
+ if (highlight.isFadeInOut()) {
126
+ completedHighlights.push(highlight);
127
+ }
134
128
  }
135
-
136
- });
129
+ }, this);
137
130
 
138
131
  completedHighlights.forEach(function(highlight) {
139
- that._highlightsNodesMap.delete(highlight);
140
- });
132
+ this._highlightsNodesMap.delete(highlight);
133
+ }, this);
141
134
 
142
135
  if (this._highlightsNodesMap.size === 0) {
143
136
  this._state = HighlightDisplayState.stopped;
@@ -28,13 +28,10 @@ sap.ui.define([
28
28
  /**
29
29
  * Constructor for a new Material.
30
30
  *
31
- *
32
31
  * @class Provides the interface for the material.
33
- *
34
- *
35
32
  * @public
36
33
  * @author SAP SE
37
- * @version 1.134.0
34
+ * @version 1.135.0
38
35
  * @extends sap.ui.vk.Material
39
36
  * @alias sap.ui.vk.threejs.Material
40
37
  * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  *
56
56
  * @public
57
57
  * @author SAP SE
58
- * @version 1.134.0
58
+ * @version 1.135.0
59
59
  * @extends sap.ui.vk.NodeHierarchy
60
60
  * @alias sap.ui.vk.threejs.NodeHierarchy
61
61
  */
@@ -42,7 +42,7 @@ sap.ui.define([
42
42
  *
43
43
  * @public
44
44
  * @author SAP SE
45
- * @version 1.134.0
45
+ * @version 1.135.0
46
46
  * @extends sap.ui.vk.NodeProxy
47
47
  * @alias sap.ui.vk.threejs.NodeProxy
48
48
  */
@@ -252,33 +252,14 @@ sap.ui.define([
252
252
  }
253
253
 
254
254
  if (nodeRef.material !== undefined) {
255
- if (nodeRef.userData.highlightColor !== undefined) {
256
- if (nodeRef.userData.originalMaterial.side) {
257
- materialRef.side = nodeRef.userData.originalMaterial.side;
258
- }
259
- nodeRef.userData.originalMaterial = materialRef;
260
- materialRef.userData.materialUsed++;
261
-
262
- nodeRef.material = materialRef.clone();
263
- var c = abgrToColor(nodeRef.userData.highlightColor);
264
- nodeRef.material.color.lerp(new THREE.Color(c.red / 255.0, c.green / 255.0, c.blue / 255.0), c.alpha);
265
- // when highlightColor = 0: total transparent, so do not change original emissive and specular
266
- if (materialRef.userData.defaultHighlightingEmissive && nodeRef.userData.highlightColor !== 0) {
267
- nodeRef.material.emissive.copy(materialRef.userData.defaultHighlightingEmissive);
268
- }
269
- if (materialRef.userData.defaultHighlightingSpecular && nodeRef.userData.highlightColor !== 0) {
270
- nodeRef.material.specular.copy(materialRef.userData.defaultHighlightingSpecular);
271
- }
272
- } else {
273
- if (nodeRef.material.side) {
274
- materialRef.side = nodeRef.material.side;
275
- }
276
- nodeRef.material = materialRef;
277
- materialRef.userData.materialUsed++;
278
- delete nodeRef.userData.originalMaterial;
255
+ if (nodeRef.material.side) {
256
+ materialRef.side = nodeRef.material.side;
279
257
  }
258
+ nodeRef.material = materialRef;
259
+ materialRef.userData.materialUsed++;
260
+ delete nodeRef.userData.originalMaterial;
280
261
 
281
- nodeRef._vkUpdateMaterialOpacity(); // todo: probably should be _vkUpdateMaterialColorAndOpacity, not _vkUpdateMaterialOpacity
262
+ nodeRef._vkUpdateMaterialColorAndOpacity();
282
263
  }
283
264
  };
284
265
 
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  *
25
25
  * @public
26
26
  * @author SAP SE
27
- * @version 1.134.0
27
+ * @version 1.135.0
28
28
  * @extends sap.ui.vk.OrthographicCamera
29
29
  * @alias sap.ui.vk.threejs.OrthographicCamera
30
30
  * @since 1.52.0
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  },
28
28
 
29
29
  generateBox: function(boxJson, material) {
30
- const mesh = new THREE.Mesh(new THREE.BoxGeometry(boxJson.width, boxJson.length, boxJson.height), material || undefined);
30
+ const mesh = new THREE.Mesh(new THREE.BoxGeometry(boxJson.length, boxJson.width, boxJson.height), material || undefined);
31
31
  mesh.name = "box";
32
32
  return mesh;
33
33
  },
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  *
25
25
  * @public
26
26
  * @author SAP SE
27
- * @version 1.134.0
27
+ * @version 1.135.0
28
28
  * @extends sap.ui.vk.PerspectiveCamera
29
29
  * @alias sap.ui.vk.threejs.PerspectiveCamera
30
30
  * @since 1.52.0
@@ -26,9 +26,8 @@ sap.ui.define([
26
26
  * @abstract
27
27
  * @private
28
28
  * @author SAP SE
29
- * @version 1.134.0
29
+ * @version 1.135.0
30
30
  * @alias sap.ui.vk.threejs.PointCloudGroup
31
- * @experimental Since 1.118.0 This class is experimental and might be modified or removed in future versions.
32
31
  */
33
32
  const PointCloudGroup = function(settings) {
34
33
  this._position = new THREE.Vector3();
@@ -13,7 +13,7 @@ sap.ui.define([
13
13
  ) {
14
14
  "use strict";
15
15
 
16
- function PolylineGeometry() {
16
+ function PolylineGeometry(outlineGeometry = null) {
17
17
  var _this = new THREE.InstancedBufferGeometry();
18
18
 
19
19
  Object.setPrototypeOf(_this, PolylineGeometry.prototype);
@@ -28,6 +28,34 @@ sap.ui.define([
28
28
  _this.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
29
29
  _this.setAttribute("uv", new THREE.Float32BufferAttribute(uvs, 2));
30
30
 
31
+ const positionAttribute = outlineGeometry ? outlineGeometry.getAttribute("position") : null;
32
+ if (positionAttribute && positionAttribute.count > 0) {
33
+ const normal1 = outlineGeometry.getAttribute("normal1").array;
34
+ const normal2 = outlineGeometry.getAttribute("normal2").array;
35
+ const positions = [];
36
+ const vertexCount = positionAttribute.count;
37
+ const pa = positionAttribute.array;
38
+ for (let i = 0; i < vertexCount; ++i) {
39
+ positions.push(new THREE.Vector3(pa[i * 3], pa[i * 3 + 1], pa[i * 3 + 2]));
40
+ }
41
+
42
+ const edgeCount = vertexCount / 2;
43
+ const indices = [];
44
+ const normals = new Float32Array(6 * edgeCount);
45
+ for (let j = 0; j < edgeCount; ++j) {
46
+ indices.push(j * 2);
47
+ indices.push(j * 2 + 1);
48
+ normals[j * 6] = normal1[j * 6];
49
+ normals[j * 6 + 1] = normal1[j * 6 + 1];
50
+ normals[j * 6 + 2] = normal1[j * 6 + 2];
51
+ normals[j * 6 + 3] = normal2[j * 6];
52
+ normals[j * 6 + 4] = normal2[j * 6 + 1];
53
+ normals[j * 6 + 5] = normal2[j * 6 + 2];
54
+ }
55
+
56
+ _this.setVertices(positions, indices, normals);
57
+ }
58
+
31
59
  return _this;
32
60
  }
33
61
 
@@ -16,6 +16,7 @@ sap.ui.define([
16
16
  "./PolylineMaterial",
17
17
  "./PolylineMesh",
18
18
  "./ThreeUtils",
19
+ "../totara/TotaraUtils",
19
20
  "sap/base/util/uid"
20
21
  ], function(
21
22
  Log,
@@ -27,6 +28,7 @@ sap.ui.define([
27
28
  PolylineMaterial,
28
29
  PolylineMesh,
29
30
  ThreeUtils,
31
+ TotaraUtils,
30
32
  uid
31
33
  ) {
32
34
  "use strict";
@@ -41,7 +43,7 @@ sap.ui.define([
41
43
  * @param {THREE.Scene} scene The three.js scene object.
42
44
  * @public
43
45
  * @author SAP SE
44
- * @version 1.134.0
46
+ * @version 1.135.0
45
47
  * @extends sap.ui.vk.Scene
46
48
  * @alias sap.ui.vk.threejs.Scene
47
49
  */
@@ -70,6 +72,8 @@ sap.ui.define([
70
72
  this._initialView = null;
71
73
  this._materialMap = new Map();
72
74
 
75
+ this._outlineGeometryToNodes = new Map(); // array of mesh nodes that have this geometry
76
+
73
77
  // A storage (map) with all loaded annotations.
74
78
  //
75
79
  // annotationId -> { annotationInfo, node, attachment, targetNodes[] }
@@ -227,6 +231,7 @@ sap.ui.define([
227
231
  };
228
232
 
229
233
  Scene.prototype.destroy = function() {
234
+ this._outlineGeometryToNodes.clear();
230
235
  this.clearThreeScene();
231
236
  // if (this._sceneBuilder) {
232
237
  // this._sceneBuilder.cleanup();
@@ -668,7 +673,7 @@ sap.ui.define([
668
673
  return rg ? [rg.lastVertex - rg.firstVertex, rg.count] : [positionAttribute.count, geometry.index ? geometry.index.array.length : positionAttribute.count];
669
674
  }
670
675
 
671
- function addMeshVerticesIndices(resultVertices, resultIndices, resultCounts, node, isChild) {
676
+ function addMeshVerticesIndices(resultVertices, resultIndices, resultCounts, node, isChild, geometryToNodesMap) {
672
677
  const geometry = node.isMesh && (!!node.userData.skipIt === isChild) && !nodeBoxIsNull(node) && node.geometry;
673
678
  const positionAttribute = geometry && geometry.isBufferGeometry && geometry.getAttribute("position");
674
679
  if (!positionAttribute) {
@@ -681,6 +686,10 @@ sap.ui.define([
681
686
  tm = node.matrix;
682
687
  }
683
688
 
689
+ if (geometryToNodesMap) {
690
+ TotaraUtils.pushElementIntoMapArray(geometryToNodesMap, node.userData.geometryId, isChild ? node.parent : node);
691
+ }
692
+
684
693
  const rg = node.userData.renderGroup;
685
694
  const vertexStart = rg ? rg.firstVertex : 0;
686
695
  const vertexCount = rg ? (rg.lastVertex - vertexStart) : positionAttribute.count;
@@ -723,32 +732,58 @@ sap.ui.define([
723
732
  resultCounts[1] += indexCount;
724
733
  }
725
734
 
726
- function createMergedGeometry(node) {
727
- let i, childCount = node.children.length;
728
- let [vertexCount, indexCount] = countMeshVerticesIndices(node, false);
729
- for (i = 0; i < childCount; ++i) {
730
- const [childVertexCount, childIndexCount] = countMeshVerticesIndices(node.children[i], true);
731
- vertexCount += childVertexCount;
732
- indexCount += childIndexCount;
733
- }
735
+ function _addOutlineGeometry(node, isPolylineMesh, outlineMaterial, geometryToNodesMap) {
736
+ try {
737
+ // create merged geometry first
738
+ let i, childCount = node.children.length;
739
+ let [vertexCount, indexCount] = countMeshVerticesIndices(node, false);
740
+ for (i = 0; i < childCount; ++i) {
741
+ const [childVertexCount, childIndexCount] = countMeshVerticesIndices(node.children[i], true);
742
+ vertexCount += childVertexCount;
743
+ indexCount += childIndexCount;
744
+ }
734
745
 
735
- if (!vertexCount) {
736
- return null;
737
- }
746
+ if (!vertexCount) {
747
+ return;
748
+ }
738
749
 
739
- const vertices = new Float32Array(vertexCount * 3);
740
- const indices = new Uint32Array(indexCount);
741
- let counts = [0, 0]; // [0] - vertex, [1] - index
750
+ const vertices = new Float32Array(vertexCount * 3);
751
+ const indices = new Uint32Array(indexCount);
752
+ let counts = [0, 0]; // [0] - vertex, [1] - index
742
753
 
743
- addMeshVerticesIndices(vertices, indices, counts, node, false);
744
- for (i = 0; i < childCount; ++i) {
745
- addMeshVerticesIndices(vertices, indices, counts, node.children[i], true);
746
- }
754
+ addMeshVerticesIndices(vertices, indices, counts, node, false, geometryToNodesMap);
755
+ for (i = 0; i < childCount; ++i) {
756
+ addMeshVerticesIndices(vertices, indices, counts, node.children[i], true, geometryToNodesMap);
757
+ }
758
+
759
+ const geometry = new THREE.BufferGeometry();
760
+ geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3));
761
+ geometry.setIndex(new THREE.BufferAttribute(indices, 1));
762
+
763
+ // now create the outline geometry from it
764
+ const outlineGeometry = new OutlineGeometry(geometry);
765
+ const positionAttribute = outlineGeometry.getAttribute("position");
766
+ if (positionAttribute && positionAttribute.count > 0) {
767
+ let line;
768
+ if (isPolylineMesh) {
769
+ const polylineGeometry = new PolylineGeometry(outlineGeometry);
770
+ polylineGeometry.boundingBox = new THREE.Box3(); // set empty bounding box, disable hit testing
771
+ line = new PolylineMesh(polylineGeometry, outlineMaterial);
772
+ } else {
773
+ outlineGeometry.boundingBox = new THREE.Box3(); // set empty bounding box, disable hit testing
774
+ line = new THREE.LineSegments(outlineGeometry, outlineMaterial);
775
+ }
747
776
 
748
- const geometry = new THREE.BufferGeometry();
749
- geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3));
750
- geometry.setIndex(new THREE.BufferAttribute(indices, 1));
751
- return geometry;
777
+ line.isOutline = true;
778
+ line.userData.skipIt = true;
779
+ line.renderOrder = node.renderOrder + 0.5;
780
+ line.matrixWorldNeedsUpdate = true;
781
+ node.add(line);
782
+ node.hasOutline = true;
783
+ }
784
+ } catch (err) {
785
+ Log.error("Unable to create outline geometry for node " + node.name, err);
786
+ }
752
787
  }
753
788
 
754
789
  function setMeshMaterial(node, newMaterial) {
@@ -794,58 +829,8 @@ sap.ui.define([
794
829
  // }
795
830
 
796
831
  if (!node.hasOutline) {// create outline
797
- try {
798
- var mergedGeometry = createMergedGeometry(node);
799
- if (mergedGeometry !== null) {
800
- node.hasOutline = true;
801
- var outlineGeometry = new OutlineGeometry(mergedGeometry);
802
- var positionAttribute = outlineGeometry.getAttribute("position");
803
- if (positionAttribute && positionAttribute.count > 0) {
804
- let line;
805
-
806
- if (this._illustrationLineWidth > 0.0) {
807
- // convert to PolylineGeometry
808
- const normal1 = outlineGeometry.getAttribute("normal1").array;
809
- const normal2 = outlineGeometry.getAttribute("normal2").array;
810
- const positions = [];
811
- const vertexCount = positionAttribute.count;
812
- const pa = positionAttribute.array;
813
- for (let i = 0; i < vertexCount; ++i) {
814
- positions.push(new THREE.Vector3(pa[i * 3], pa[i * 3 + 1], pa[i * 3 + 2]));
815
- }
816
-
817
- const edgeCount = vertexCount / 2;
818
- const indices = [];
819
- const normals = new Float32Array(6 * edgeCount);
820
- for (let j = 0; j < edgeCount; ++j) {
821
- indices.push(j * 2);
822
- indices.push(j * 2 + 1);
823
- normals[j * 6] = normal1[j * 6];
824
- normals[j * 6 + 1] = normal1[j * 6 + 1];
825
- normals[j * 6 + 2] = normal1[j * 6 + 2];
826
- normals[j * 6 + 3] = normal2[j * 6];
827
- normals[j * 6 + 4] = normal2[j * 6 + 1];
828
- normals[j * 6 + 5] = normal2[j * 6 + 2];
829
- }
830
-
831
- const polylineGeometry = new PolylineGeometry();
832
- polylineGeometry.setVertices(positions, indices, normals);
833
- polylineGeometry.boundingBox = new THREE.Box3(); // set empty bounding box, disable hit testing
834
- line = new PolylineMesh(polylineGeometry, this._outlineThickMaterial);
835
- } else {
836
- outlineGeometry.boundingBox = new THREE.Box3(); // set empty bounding box, disable hit testing
837
- line = new THREE.LineSegments(outlineGeometry, this._outlineMaterial);
838
- }
839
-
840
- line.isOutline = true;
841
- line.renderOrder = node.renderOrder + 0.5;
842
- line.matrixWorldNeedsUpdate = true;
843
- node.add(line);
844
- }
845
- }
846
- } catch (err) {
847
- Log.error("Unable to create outline geometry for node " + node.name, err);
848
- }
832
+ const isThickLines = this._illustrationLineWidth > 0.0;
833
+ _addOutlineGeometry(node, isThickLines, isThickLines ? this._outlineThickMaterial : this._outlineMaterial, this._outlineGeometryToNodes);
849
834
  }
850
835
  if (node.isMesh && node.material && !node.material.isLineBasicMaterial && !node.material.isLineMaterial) {// update material
851
836
  switch (renderMode) {
@@ -887,6 +872,28 @@ sap.ui.define([
887
872
  }
888
873
  };
889
874
 
875
+ Scene.prototype.onGeometryUpdated = function(geometryId) {
876
+ const nodes = this._outlineGeometryToNodes.get(geometryId);
877
+ if (nodes) {
878
+ for (let ni = 0; ni < nodes.length; ++ni) {
879
+ const node = nodes[ni];
880
+ const ch = node.children;
881
+ for (let i = ch.length - 1; i >= 0; --i) {
882
+ const outlineNode = ch[i];
883
+ if (outlineNode.isOutline) {
884
+ const isPolylineMesh = outlineNode.isPolylineMesh;
885
+ const outlineMaterial = outlineNode.material;
886
+ node.remove(outlineNode);
887
+
888
+ // must rebuild the outline mesh used in illustration rendering as it was built off a proxy mesh
889
+ _addOutlineGeometry(node, isPolylineMesh, outlineMaterial, null);
890
+ break;
891
+ }
892
+ }
893
+ }
894
+ }
895
+ };
896
+
890
897
  /**
891
898
  * Get initial view
892
899
  *
@@ -104,8 +104,7 @@ sap.ui.define([
104
104
  *
105
105
  * @private
106
106
  * @author SAP SE
107
- * @version 1.134.0
108
- * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.
107
+ * @version 1.135.0
109
108
  */
110
109
  var SceneBuilder = function(rootNode, contentResource, resolve, reject) {
111
110
  this._rootNode = rootNode;
@@ -386,26 +385,12 @@ sap.ui.define([
386
385
  return matrix;
387
386
  };
388
387
 
389
- var DefaultHighlightingEmissive = {
390
- r: 0.0235,
391
- g: 0.0235,
392
- b: 0.0235
393
- };
394
-
395
- var DefaultHighlightingSpecular = {
396
- r: 0.0602,
397
- g: 0.0602,
398
- b: 0.0602
399
- };
400
-
401
388
  ////////////////////////////////////////////////////////////////////////////////////////////////////////
402
389
  // Create a place-holder material, whose value should be updated when material data is available
403
390
  SceneBuilder.prototype._createTemporaryMaterial = function(materialId, materialType) {
404
391
  var vkMaterial = new Material(materialType || MaterialType.MeshPhongMaterial);
405
392
  var material = vkMaterial.getMaterialRef();
406
393
  material.vertexColors = true; // note: we will turn vertex colors in the shader if geometry.attributes.color is not defined
407
- material.userData.defaultHighlightingEmissive = DefaultHighlightingEmissive;
408
- material.userData.defaultHighlightingSpecular = DefaultHighlightingSpecular;
409
394
  material.userData.materialUsed = 0;
410
395
  material.userData.materialId = materialId;
411
396
  material.userData.toBeUpdated = true;
@@ -1558,7 +1543,7 @@ sap.ui.define([
1558
1543
 
1559
1544
  if (geoInfo.isPointCloud) { // update scene point scale
1560
1545
  const nativeSceneUD = this._vkScene.getSceneRef().userData;
1561
- const points = geoInfo.data.points;
1546
+ const points = data.points;
1562
1547
  const box = new THREE.Box3().setFromArray(points); // todo: pass bbox from loader instead of recomputing
1563
1548
 
1564
1549
  nativeSceneUD.pointCloudBoundingBox ??= new THREE.Box3();
@@ -1613,14 +1598,16 @@ sap.ui.define([
1613
1598
  var meshId = submeshInfo.meshId;
1614
1599
  var nodes = this._meshNodes.get(meshId);
1615
1600
  if (nodes) {
1616
- // "nodes" is a list of all meshes that have this geometry
1617
- for (var ni = 0; ni < nodes.length; ni++) {
1601
+ // "nodes" is a list of all meshes that have this geometry and already exist in the scene
1602
+ for (let ni = 0; ni < nodes.length; ++ni) {
1618
1603
  // "nodes[ni].children" are all submeshes of a mesh
1619
1604
  replaceSubmeshGeometry(nodes[ni].children,
1620
1605
  this._geometrySubmeshIndices.get(nodes[ni].userData.nodeId + ":" + geometryId),
1621
1606
  geometryId, geometryDescriptor, nativeSceneUD, true);
1622
1607
  }
1623
1608
  }
1609
+
1610
+ // "submeshes" are copies that don't exist in the scene (it is not attached to any nodes)
1624
1611
  var submeshes = this._meshSubmeshes.get(meshId);
1625
1612
  if (submeshes) {
1626
1613
  replaceSubmeshGeometry(submeshes, submeshInfo.submeshIndex,
@@ -1631,6 +1618,7 @@ sap.ui.define([
1631
1618
  this._geometryProxies.delete(geometryId);
1632
1619
  }
1633
1620
 
1621
+ this._vkScene.onGeometryUpdated(geometryId);
1634
1622
  if (this._fireSceneUpdated) {
1635
1623
  this._fireSceneUpdated(skipHierarchyProcessing);
1636
1624
  }
@@ -2837,9 +2825,6 @@ sap.ui.define([
2837
2825
  // exact pixel to pixel equality seems to be impossible without using custom shaders
2838
2826
  // material.specular.multiplyScalar(3.0 / (material.shininess * 0.5 + 1.0));
2839
2827
 
2840
- material.userData.defaultHighlightingEmissive = DefaultHighlightingEmissive;
2841
- material.userData.defaultHighlightingSpecular = DefaultHighlightingSpecular;
2842
-
2843
2828
  material.userData.imageIdsToAddAsTexture = new Set();
2844
2829
  var info, infos;
2845
2830
  if (materialInfo.textureDiffuse) {
@@ -18,13 +18,10 @@ sap.ui.define([
18
18
  /**
19
19
  * Constructor for a new Material.
20
20
  *
21
- *
22
21
  * @class Provides the interface for the material.
23
- *
24
- *
25
22
  * @public
26
23
  * @author SAP SE
27
- * @version 1.134.0
24
+ * @version 1.135.0
28
25
  * @extends sap.ui.vk.Texture
29
26
  * @alias sap.ui.vk.threejs.Texture
30
27
  * @experimental Since 1.60.0 This class is experimental and might be modified or removed in future versions.