@sapui5/sap.ui.vk 1.134.0 → 1.136.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 (182) 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 +9 -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/VisibilityMode.js +2 -1
  65. package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
  66. package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
  67. package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
  68. package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
  69. package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
  70. package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
  71. package/src/sap/ui/vk/dvl/Scene.js +1 -1
  72. package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
  73. package/src/sap/ui/vk/dvl/Viewport.js +1 -1
  74. package/src/sap/ui/vk/ecad/ElementsPanel.js +469 -0
  75. package/src/sap/ui/vk/{tools/AnchorPointToolGizmoRenderer.js → ecad/ElementsPanelRenderer.js} +13 -12
  76. package/src/sap/ui/vk/ecad/LayersPanel.js +440 -0
  77. package/src/sap/ui/vk/{tools/CrossSectionToolGizmoRenderer.js → ecad/LayersPanelRenderer.js} +13 -12
  78. package/src/sap/ui/vk/ecad/VisibilityType.js +31 -0
  79. package/src/sap/ui/vk/i18n/messagebundle.properties +50 -0
  80. package/src/sap/ui/vk/library.js +5 -3
  81. package/src/sap/ui/vk/matai/MataiLoaderWorker.js +4 -0
  82. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  83. package/src/sap/ui/vk/measurements/Area.js +1 -1
  84. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  85. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  86. package/src/sap/ui/vk/measurements/Face.js +1 -1
  87. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  88. package/src/sap/ui/vk/measurements/Surface.js +1 -1
  89. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  90. package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
  91. package/src/sap/ui/vk/pdf/PageGallery.js +3 -5
  92. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  93. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  94. package/src/sap/ui/vk/svg/ContentDeliveryService.js +2 -1
  95. package/src/sap/ui/vk/svg/ContentManager.js +2 -1
  96. package/src/sap/ui/vk/svg/HotspotHelper.js +2 -4
  97. package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
  98. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  99. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  100. package/src/sap/ui/vk/svg/Scene.js +1 -1
  101. package/src/sap/ui/vk/svg/SceneBuilder.js +1 -2
  102. package/src/sap/ui/vk/svg/ViewStateManager.js +1 -2
  103. package/src/sap/ui/vk/svg/Viewport.js +1 -1
  104. package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
  105. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -2
  106. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  107. package/src/sap/ui/vk/threejs/Billboard.js +2 -3
  108. package/src/sap/ui/vk/threejs/Callout.js +1 -2
  109. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +2 -1
  110. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  111. package/src/sap/ui/vk/threejs/DetailView.js +1 -2
  112. package/src/sap/ui/vk/threejs/HighlightPlayer.js +18 -25
  113. package/src/sap/ui/vk/threejs/Material.js +1 -4
  114. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  115. package/src/sap/ui/vk/threejs/NodeProxy.js +7 -26
  116. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  117. package/src/sap/ui/vk/threejs/ParametricGenerators.js +1 -1
  118. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  119. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -2
  120. package/src/sap/ui/vk/threejs/PolylineGeometry.js +29 -1
  121. package/src/sap/ui/vk/threejs/Scene.js +83 -76
  122. package/src/sap/ui/vk/threejs/SceneBuilder.js +8 -23
  123. package/src/sap/ui/vk/threejs/Texture.js +1 -4
  124. package/src/sap/ui/vk/threejs/ThreeExtensions.js +30 -75
  125. package/src/sap/ui/vk/threejs/ThreeUtils.js +1 -1
  126. package/src/sap/ui/vk/threejs/Thrustline.js +1 -4
  127. package/src/sap/ui/vk/threejs/ViewStateManager.js +7 -8
  128. package/src/sap/ui/vk/threejs/Viewport.js +1 -3
  129. package/src/sap/ui/vk/threejs/v2/ViewStateManager.js +12 -29
  130. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  131. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +11 -3
  132. package/src/sap/ui/vk/tools/AngleMeasurementToolGizmo.js +2 -1
  133. package/src/sap/ui/vk/tools/AreaMeasurementToolGizmo.js +2 -1
  134. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -7
  135. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  136. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  137. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +3 -2
  138. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +3 -2
  139. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  140. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +3 -2
  141. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  142. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +3 -2
  143. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  144. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +12 -1
  145. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  146. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +11 -1
  147. package/src/sap/ui/vk/tools/DistanceMeasurementToolGizmo.js +2 -1
  148. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  149. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +3 -2
  150. package/src/sap/ui/vk/tools/ExplodeItemGroup.js +1 -1
  151. package/src/sap/ui/vk/tools/ExplodeTool.js +3 -3
  152. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +3 -2
  153. package/src/sap/ui/vk/tools/Gizmo.js +2 -5
  154. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  155. package/src/sap/ui/vk/tools/MeasurementToolGizmo.js +2 -1
  156. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  157. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  158. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  159. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  160. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  161. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  162. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  163. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  164. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  165. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  166. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  167. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  168. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  169. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  170. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +13 -1
  171. package/src/sap/ui/vk/tools/Tool.js +1 -1
  172. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  173. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  174. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  175. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
  176. package/src/sap/ui/vk/totara/TotaraUtils.js +5 -0
  177. package/src/sap/ui/vk/ve/dvl.js +1 -1
  178. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
  179. package/src/sap/ui/vk/ve/matai.js +1 -1
  180. package/src/sap/ui/vk/ve/matai.wasm +0 -0
  181. package/src/sap/ui/vk/tools/CreateTextToolGizmoRenderer.js +0 -41
  182. package/src/sap/ui/vk/tools/SceneOrientationToolGizmoRenderer.js +0 -39
@@ -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.136.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.136.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) {
@@ -3834,7 +3819,7 @@ sap.ui.define([
3834
3819
  color1[3] = ((info.color1 >>> 24) & 255) / 255; // highlighting intensity
3835
3820
  color2[3] = ((info.color2 >>> 24) & 255) / 255; // highlighting intensity
3836
3821
  highlight.colours = [color1, color2];
3837
- highlight.opacities = [info.opacity1, info.opacity2];
3822
+ highlight.opacities = [THREE.MathUtils.clamp(info.opacity1, 0, 1), THREE.MathUtils.clamp(info.opacity2, 0, 1)];
3838
3823
  this._vkScene.createHighlight(info.id, highlight);
3839
3824
  view.addHighlightedNodes(info.id, highlightNodes);
3840
3825
  }
@@ -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.136.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.
@@ -20,18 +20,6 @@ sap.ui.define([
20
20
  ) {
21
21
  "use strict";
22
22
 
23
- THREE.Object3D.prototype.defaultEmissive = {
24
- r: 0.0235,
25
- g: 0.0235,
26
- b: 0.0235
27
- };
28
-
29
- THREE.Object3D.prototype.defaultSpecular = {
30
- r: 0.0602,
31
- g: 0.0602,
32
- b: 0.0602
33
- };
34
-
35
23
  // TODO(VSM): REMOVE
36
24
  THREE.Object3D.prototype._vkCalculateObjectOrientedBoundingBox = function() {
37
25
  ThreeUtils.computeObjectOrientedBoundingBox(this, this.userData.boundingBox = new THREE.Box3());
@@ -100,30 +88,12 @@ sap.ui.define([
100
88
  }
101
89
 
102
90
  var userData = this.userData;
91
+ userData.blendColor = null;
103
92
 
104
93
  if (userData.originalMaterial) {
105
- if (userData.originalMaterial.color.r === undefined) {
106
- // TODO(VSM): should we call `ThreeUtils.disposeMaterial(this.material)`?
107
- userData.originalMaterial = null;
108
- } else if (userData.originalMaterial.map !== this.material.map ||
109
- userData.originalMaterial.bumpMap !== this.material.bumpMap ||
110
- userData.originalMaterial.alphaMap !== this.material.alphaMap ||
111
- userData.originalMaterial.envMap !== this.material.envMap ||
112
- userData.originalMaterial.emissiveMap !== this.material.emissiveMap ||
113
- userData.originalMaterial.aoMap !== this.material.aoMap) {
114
- // textures are added to original material after node material is cloned, need to re-clone
115
- // the same original material may be shared among nodes, so need to check for each node
116
- // TODO(VSM): should we call `ThreeUtils.disposeMaterial(this.material)`?
117
- this.material = userData.originalMaterial.clone();
118
- } else {
119
- this.material.color.copy(userData.originalMaterial.color);
120
- if (this.material.emissive !== undefined) {
121
- this.material.emissive.copy(userData.originalMaterial.emissive);
122
- }
123
- if (this.material.specular !== undefined) {
124
- this.material.specular.copy(userData.originalMaterial.specular);
125
- }
126
- }
94
+ this.material.color.copy(userData.originalMaterial.color); // diffuse color, may be multiplied by material.map
95
+ this.material.emissive?.copy(userData.originalMaterial.emissive);
96
+ this.material.specular?.copy(userData.originalMaterial.specular);
127
97
  }
128
98
 
129
99
  if (userData.highlightColor !== undefined || userData.tintColor !== undefined || userData.highlightingColor !== undefined) {
@@ -134,52 +104,29 @@ sap.ui.define([
134
104
  this.material = this.material.clone();
135
105
  }
136
106
 
137
- if (userData.highlightingColor !== undefined) {
107
+ const color = new THREE.Vector4(0, 0, 0, 0);
138
108
 
139
- var color = new THREE.Color();
140
- color.fromArray(userData.highlightingColor).lerp(userData.originalMaterial.color, 1 - userData.highlightingColor[3]);
109
+ if (userData.highlightingColor !== undefined) { // highlighting animation of the view (HighlightPlayer)
110
+ color.fromArray(userData.highlightingColor);
111
+ }
141
112
 
142
- this.material.color.copy(color);
113
+ if (userData.tintColor !== undefined) { // tinting (ViewStateManangert)
114
+ const c = abgrToColor(userData.tintColor);
115
+ color.lerp(new THREE.Vector4(c.red / 255.0, c.green / 255.0, c.blue / 255.0, 1), c.alpha);
143
116
  }
144
117
 
145
- var c;
146
- if (userData.tintColor !== undefined) {
147
- c = abgrToColor(userData.tintColor);
148
- this.material.color.lerp(new THREE.Color(c.red / 255.0, c.green / 255.0, c.blue / 255.0), c.alpha);
149
- if (this.material.emissive !== undefined) {
150
- if (this.material.userData.defaultHighlightingEmissive) {
151
- this.material.emissive.copy(this.material.userData.defaultHighlightingEmissive);
152
- } else {
153
- this.material.emissive.copy(THREE.Object3D.prototype.defaultEmissive);
154
- }
155
- }
156
- if (this.material.specular !== undefined) {
157
- if (this.material.userData.defaultHighlightingSpecular) {
158
- this.material.specular.copy(this.material.userData.defaultHighlightingSpecular);
159
- } else {
160
- this.material.specular.copy(THREE.Object3D.prototype.defaultSpecular);
161
- }
162
- }
118
+ if (userData.highlightColor !== undefined) { // selection (ViewStateManangert)
119
+ const c = abgrToColor(userData.highlightColor);
120
+ color.lerp(new THREE.Vector4(c.red / 255.0, c.green / 255.0, c.blue / 255.0, 1), c.alpha);
163
121
  }
164
122
 
165
- if (userData.highlightColor !== undefined) {
166
- c = abgrToColor(userData.highlightColor);
167
- this.material.color.lerp(new THREE.Color(c.red / 255.0, c.green / 255.0, c.blue / 255.0), c.alpha);
168
- // when highlightColor = 0: total transparent, so do not change original emssive and specular
169
- if (this.material.emissive !== undefined && userData.highlightColor !== 0) {
170
- if (this.material.userData.defaultHighlightingEmissive) {
171
- this.material.emissive.copy(this.material.userData.defaultHighlightingEmissive);
172
- } else {
173
- this.material.emissive.copy(THREE.Object3D.prototype.defaultEmissive);
174
- }
175
- }
176
- if (this.material.specular !== undefined && userData.highlightColor !== 0) {
177
- if (this.material.userData.defaultHighlightingSpecular) {
178
- this.material.specular.copy(this.material.userData.defaultHighlightingSpecular);
179
- } else {
180
- this.material.specular.copy(THREE.Object3D.prototype.defaultSpecular);
181
- }
182
- }
123
+ if (color.w > 0) {
124
+ userData.blendColor = color.toArray();
125
+
126
+ const blendColor = new THREE.Color(color.x, color.y, color.z);
127
+ this.material.color.lerp(blendColor, color.w);
128
+ this.material.emissive?.lerp(blendColor, color.w * 0.5);
129
+ this.material.specular?.multiplyScalar(1 - 0.75 * color.w); // reduce specular as it may overexpose the highlighting
183
130
  }
184
131
  }
185
132
 
@@ -201,9 +148,12 @@ sap.ui.define([
201
148
  var opacity = 1.0;
202
149
 
203
150
  var hasOpacity = false;
151
+ let renderMethod;
204
152
 
205
153
  var obj3D = this; // eslint-disable-line consistent-this
206
154
  do {
155
+ renderMethod ??= obj3D.userData.renderMethod;
156
+
207
157
  var currentOpacity = null, joint = null;
208
158
  if (nodeJointMap) {
209
159
  joint = nodeJointMap.get(obj3D);
@@ -234,6 +184,11 @@ sap.ui.define([
234
184
  obj3D = obj3D.parent;
235
185
  } while (obj3D);
236
186
 
187
+ if (renderMethod === 2) { // TRANSPARENT
188
+ opacity *= 0.5;
189
+ hasOpacity = true;
190
+ }
191
+
237
192
  if (hasOpacity || this.renderOrder > 0) {
238
193
  if (!userData.originalMaterial) {
239
194
  userData.originalMaterial = this.material;
@@ -252,7 +207,7 @@ sap.ui.define([
252
207
 
253
208
  if (this.material.opacity) {
254
209
  this.material.opacity *= opacity;
255
- var materialIsTransparent = userData.originalMaterial.transparent || this.material.opacity < 0.99;
210
+ var materialIsTransparent = userData.originalMaterial.transparent || this.material.opacity < 1;
256
211
  if (materialIsTransparent !== this.material.transparent) {
257
212
  this.material.transparent = materialIsTransparent;
258
213
  this.material.needsUpdate = true; // three.js needs to update shaders for this material
@@ -455,7 +455,7 @@ sap.ui.define([
455
455
  // '0' - hidden, '1' - draw as cluster, '2' - render by three js, '3' - cluster with custom color
456
456
  if (!cluster.isPoints && (ud.initialMaterialId !== ud.materialId
457
457
  || node.renderOrder != 0
458
- || ud.highlightingColor
458
+ || ud.blendColor != null
459
459
  || ud.defaultMaterial // defaultMaterial is used for Outline objects
460
460
  || node.material.transparent === true)) {
461
461
 
@@ -27,14 +27,11 @@ sap.ui.define([
27
27
  * Constructor for a new Thrustline.
28
28
  *
29
29
  * @class
30
- *
31
- *
32
30
  * @private
33
31
  * @author SAP SE
34
- * @version 1.134.0
32
+ * @version 1.136.0
35
33
  * @extends sap.ui.base.ManagedObject
36
34
  * @alias sap.ui.vk.threejs.Thrustline
37
- * @experimental Since 1.65.0 This class is experimental and might be modified or removed in future versions.
38
35
  */
39
36
  var Thrustline = BaseObject.extend("sap.ui.vk.threejs.Thrustline", /** @lends sap.ui.vk.threejs.Thrustline.prototype */ {
40
37
  metadata: {
@@ -67,7 +67,7 @@ sap.ui.define([
67
67
  * @param {object} [mSettings] Initial settings for the new ViewStateManager object.
68
68
  * @public
69
69
  * @author SAP SE
70
- * @version 1.134.0
70
+ * @version 1.136.0
71
71
  * @extends sap.ui.vk.ViewStateManagerBase
72
72
  * @alias sap.ui.vk.threejs.ViewStateManager
73
73
  * @since 1.32.0
@@ -2180,7 +2180,6 @@ sap.ui.define([
2180
2180
  *
2181
2181
  * @returns {?string} Image type string, or null
2182
2182
  * @private
2183
- * @experimental Since 1.82.0 This method is experimental and might be modified or removed in future versions
2184
2183
  */
2185
2184
  ViewStateManager.prototype.getBackgroundImageType = function() {
2186
2185
  // currently can only use background node name to determine the image type
@@ -2194,7 +2193,6 @@ sap.ui.define([
2194
2193
  * @param {string} imageType Image type string
2195
2194
  * @returns {object} Background node object
2196
2195
  * @private
2197
- * @experimental Since 1.82.0 This method is experimental and might be modified or removed in future versions
2198
2196
  */
2199
2197
  ViewStateManager.prototype.setBackgroundImageType = function(imageType) {
2200
2198
  var backgroundNodes = this._getBackgroundNodeInfos();
@@ -2512,8 +2510,9 @@ sap.ui.define([
2512
2510
  if (fadeInNodes && fadeInNodes.length) {
2513
2511
  var fadeInHighlight = new Highlight("FadeIn", {
2514
2512
  duration: timeInterval / 500.0,
2515
- opacities: [0.0, 1.0],
2516
- cycles: 1
2513
+ opacities: [1.0, 0.0],
2514
+ cycles: 0.5,
2515
+ type: "FadeIn"
2517
2516
  });
2518
2517
  this._transitionPlayer.addHighlights(fadeInHighlight, fadeInNodes);
2519
2518
  }
@@ -2521,9 +2520,9 @@ sap.ui.define([
2521
2520
  if (fadeOutNodes && fadeOutNodes.length) {
2522
2521
  var fadeOutHighlight = new Highlight("FadeOut", {
2523
2522
  duration: timeInterval / 500.0,
2524
- opacities: [1.0, 0.0],
2525
- cycles: 1,
2526
- fadeOut: true
2523
+ opacities: [0.0, 1.0],
2524
+ cycles: 0.5,
2525
+ type: "FadeOut"
2527
2526
  });
2528
2527
  this._transitionPlayer.addHighlights(fadeOutHighlight, fadeOutNodes);
2529
2528
  }
@@ -88,7 +88,7 @@ sap.ui.define([
88
88
  *
89
89
  * @public
90
90
  * @author SAP SE
91
- * @version 1.134.0
91
+ * @version 1.136.0
92
92
  * @extends sap.ui.vk.ViewportBase
93
93
  * @alias sap.ui.vk.threejs.Viewport
94
94
  */
@@ -835,7 +835,6 @@ sap.ui.define([
835
835
  *
836
836
  * @returns {?string} Background projection or undefined
837
837
  * @private
838
- * @experimental Since 1.106.0 This method is experimental and might be modified or removed in future versions
839
838
  */
840
839
  Viewport.prototype.getBackgroundProjection = function() {
841
840
  return bgNodeNameToProjectionType[this._backgroundNode && this._backgroundNode.name];
@@ -2673,7 +2672,6 @@ sap.ui.define([
2673
2672
  * @param {object} options.parametricContent parametric content object
2674
2673
  * @returns {any[]} An array of Background nodes
2675
2674
  * @private
2676
- * @experimental Since 1.82.0 This method is experimental and might be modified or removed in future versions
2677
2675
  */
2678
2676
  Viewport.prototype.setBackgroundNode = function(options) {
2679
2677
  var nodeHierarchy = this._viewStateManager.getNodeHierarchy();
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * @param {object} [mSettings] Initial settings for the new ViewStateManager object.
44
44
  * @private
45
45
  * @author SAP SE
46
- * @version 1.134.0
46
+ * @version 1.136.0
47
47
  * @extends sap.ui.vk.threejs.ViewStateManager
48
48
  * @alias sap.ui.vk.threejs.v2.ViewStateManager
49
49
  * @since 1.99.0
@@ -1338,6 +1338,11 @@ sap.ui.define([
1338
1338
  ViewStateManager.prototype._updateNodeStateMaterials = function() {
1339
1339
  var materialCache = this._materialCache;
1340
1340
 
1341
+ // node highlighting and tinting may work and look differently in the default ViewStateManager.js as it uses
1342
+ // THREE.Object3D._vkUpdateMaterialColorAndOpacity() method to update the material color and opacity
1343
+
1344
+ const defaultHighlightingEmissive = { r: 0.0235, g: 0.0235, b: 0.0235 };
1345
+ const defaultHighlightingSpecular = { r: 0.0602, g: 0.0602, b: 0.0602 };
1341
1346
  var highlightColorABGR = this.getHighlightColor(true);
1342
1347
  var highlightColor = abgrToColor(highlightColorABGR);
1343
1348
  var highlightColorThreeJS = new THREE.Color(highlightColor.red / 255.0, highlightColor.green / 255.0, highlightColor.blue / 255.0);
@@ -1350,6 +1355,8 @@ sap.ui.define([
1350
1355
  // TODO(VSM): do we really need this? I added this in case if material.color was
1351
1356
  // modified in a previous iteration. When can it happen?
1352
1357
  state.material.color.copy(nodeRef.material.color);
1358
+ state.material.emissive?.copy(nodeRef.material.emissive);
1359
+ state.material.specular?.copy(nodeRef.material.specular);
1353
1360
  }
1354
1361
 
1355
1362
  var material = state.material;
@@ -1359,39 +1366,15 @@ sap.ui.define([
1359
1366
  if (tintColor != null) {
1360
1367
  color = abgrToColor(tintColor);
1361
1368
  material.color.lerp(new THREE.Color(color.red / 255.0, color.green / 255.0, color.blue / 255.0), color.alpha);
1362
- if (material.emissive != null) {
1363
- if (material.userData.defaultHighlightingEmissive) {
1364
- material.emissive.copy(material.userData.defaultHighlightingEmissive);
1365
- } else {
1366
- material.emissive.copy(THREE.Object3D.prototype.defaultEmissive);
1367
- }
1368
- }
1369
- if (material.specular != null) {
1370
- if (material.userData.defaultHighlightingSpecular) {
1371
- material.specular.copy(material.userData.defaultHighlightingSpecular);
1372
- } else {
1373
- material.specular.copy(THREE.Object3D.prototype.defaultSpecular);
1374
- }
1375
- }
1369
+ material.emissive?.copy(defaultHighlightingEmissive);
1370
+ material.specular?.copy(defaultHighlightingSpecular);
1376
1371
  }
1377
1372
 
1378
1373
  if (state.selected || state.ancestorSelected) {
1379
1374
  material.color.lerp(highlightColorThreeJS, highlightColor.alpha);
1380
1375
  // when highlightColor = 0: total transparent, so do not change original emissive and specular
1381
- if (material.emissive != null && highlightColorABGR !== 0) {
1382
- if (material.userData.defaultHighlightingEmissive) {
1383
- material.emissive.copy(material.userData.defaultHighlightingEmissive);
1384
- } else {
1385
- material.emissive.copy(THREE.Object3D.prototype.defaultEmissive);
1386
- }
1387
- }
1388
- if (material.specular != null && highlightColorABGR !== 0) {
1389
- if (material.userData.defaultHighlightingSpecular) {
1390
- material.specular.copy(material.userData.defaultHighlightingSpecular);
1391
- } else {
1392
- material.specular.copy(THREE.Object3D.prototype.defaultSpecular);
1393
- }
1394
- }
1376
+ material.emissive?.copy(defaultHighlightingEmissive);
1377
+ material.specular?.copy(defaultHighlightingSpecular);
1395
1378
  }
1396
1379
 
1397
1380
  var worldOpacity = this._computeWorldOpacity(nodeRef, state);