@sapui5/sap.ui.vk 1.138.0 → 1.140.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 (220) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vk/.library +9 -1
  3. package/src/sap/ui/vk/AnimationPlayback.js +1 -1
  4. package/src/sap/ui/vk/AnimationPlayer.js +1 -1
  5. package/src/sap/ui/vk/AnimationSequence.js +1 -1
  6. package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
  7. package/src/sap/ui/vk/AnimationTrack.js +1 -1
  8. package/src/sap/ui/vk/Annotation.js +3 -3
  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 +149 -95
  12. package/src/sap/ui/vk/ContentManager.js +1 -1
  13. package/src/sap/ui/vk/ContentResource.js +26 -7
  14. package/src/sap/ui/vk/ContentType.js +41 -0
  15. package/src/sap/ui/vk/Core.js +1 -1
  16. package/src/sap/ui/vk/DownloadManager.js +1 -1
  17. package/src/sap/ui/vk/DrawerToolbar.js +46 -19
  18. package/src/sap/ui/vk/DvlException.js +1 -1
  19. package/src/sap/ui/vk/FlexibleControl.js +1 -1
  20. package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
  21. package/src/sap/ui/vk/Highlight.js +1 -1
  22. package/src/sap/ui/vk/ImageContentManager.js +1 -1
  23. package/src/sap/ui/vk/JointUtils.js +1 -1
  24. package/src/sap/ui/vk/LayerProxy.js +1 -1
  25. package/src/sap/ui/vk/Loco.js +1 -1
  26. package/src/sap/ui/vk/Material.js +1 -1
  27. package/src/sap/ui/vk/NativeViewport.js +1 -1
  28. package/src/sap/ui/vk/NodeHierarchy.js +1 -1
  29. package/src/sap/ui/vk/NodeProxy.js +1 -1
  30. package/src/sap/ui/vk/NodeUtils.js +1 -1
  31. package/src/sap/ui/vk/Notifications.js +1 -1
  32. package/src/sap/ui/vk/OrthographicCamera.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 +5 -1
  48. package/src/sap/ui/vk/SceneTree.js +20 -3
  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 +1 -1
  55. package/src/sap/ui/vk/ViewGallery.js +1 -1
  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 +3 -10
  60. package/src/sap/ui/vk/ViewStateManagerBase.js +2 -2
  61. package/src/sap/ui/vk/Viewer.js +13 -3
  62. package/src/sap/ui/vk/Viewport.js +1 -1
  63. package/src/sap/ui/vk/ViewportBase.js +24 -70
  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/ecad/ElementsPanel.js +408 -385
  74. package/src/sap/ui/vk/ecad/LayersPanel.js +95 -99
  75. package/src/sap/ui/vk/i18n/messagebundle.properties +44 -46
  76. package/src/sap/ui/vk/i18n/messagebundle_ar.properties +27 -13
  77. package/src/sap/ui/vk/i18n/messagebundle_bg.properties +27 -13
  78. package/src/sap/ui/vk/i18n/messagebundle_ca.properties +27 -13
  79. package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +27 -13
  80. package/src/sap/ui/vk/i18n/messagebundle_cs.properties +27 -13
  81. package/src/sap/ui/vk/i18n/messagebundle_cy.properties +27 -13
  82. package/src/sap/ui/vk/i18n/messagebundle_da.properties +27 -13
  83. package/src/sap/ui/vk/i18n/messagebundle_de.properties +28 -14
  84. package/src/sap/ui/vk/i18n/messagebundle_el.properties +27 -13
  85. package/src/sap/ui/vk/i18n/messagebundle_en.properties +27 -327
  86. package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +27 -13
  87. package/src/sap/ui/vk/i18n/messagebundle_en_US_saprigi.properties +24 -12
  88. package/src/sap/ui/vk/i18n/messagebundle_es.properties +29 -15
  89. package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +27 -13
  90. package/src/sap/ui/vk/i18n/messagebundle_et.properties +27 -13
  91. package/src/sap/ui/vk/i18n/messagebundle_fi.properties +27 -13
  92. package/src/sap/ui/vk/i18n/messagebundle_fr.properties +27 -13
  93. package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +27 -13
  94. package/src/sap/ui/vk/i18n/messagebundle_hi.properties +27 -13
  95. package/src/sap/ui/vk/i18n/messagebundle_hr.properties +27 -13
  96. package/src/sap/ui/vk/i18n/messagebundle_hu.properties +27 -13
  97. package/src/sap/ui/vk/i18n/messagebundle_id.properties +29 -15
  98. package/src/sap/ui/vk/i18n/messagebundle_it.properties +27 -13
  99. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +27 -13
  100. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +29 -15
  101. package/src/sap/ui/vk/i18n/messagebundle_kk.properties +39 -25
  102. package/src/sap/ui/vk/i18n/messagebundle_ko.properties +24 -10
  103. package/src/sap/ui/vk/i18n/messagebundle_lt.properties +27 -13
  104. package/src/sap/ui/vk/i18n/messagebundle_lv.properties +27 -13
  105. package/src/sap/ui/vk/i18n/messagebundle_mk.properties +27 -13
  106. package/src/sap/ui/vk/i18n/messagebundle_ms.properties +27 -13
  107. package/src/sap/ui/vk/i18n/messagebundle_nl.properties +27 -13
  108. package/src/sap/ui/vk/i18n/messagebundle_no.properties +28 -14
  109. package/src/sap/ui/vk/i18n/messagebundle_pl.properties +27 -13
  110. package/src/sap/ui/vk/i18n/messagebundle_pt.properties +27 -13
  111. package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +27 -13
  112. package/src/sap/ui/vk/i18n/messagebundle_ro.properties +27 -13
  113. package/src/sap/ui/vk/i18n/messagebundle_ru.properties +27 -13
  114. package/src/sap/ui/vk/i18n/messagebundle_sh.properties +27 -13
  115. package/src/sap/ui/vk/i18n/messagebundle_sk.properties +27 -13
  116. package/src/sap/ui/vk/i18n/messagebundle_sl.properties +27 -13
  117. package/src/sap/ui/vk/i18n/messagebundle_sr.properties +27 -13
  118. package/src/sap/ui/vk/i18n/messagebundle_sv.properties +27 -13
  119. package/src/sap/ui/vk/i18n/messagebundle_th.properties +27 -13
  120. package/src/sap/ui/vk/i18n/messagebundle_tr.properties +27 -13
  121. package/src/sap/ui/vk/i18n/messagebundle_uk.properties +27 -13
  122. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +28 -14
  123. package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +27 -13
  124. package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +27 -13
  125. package/src/sap/ui/vk/library.js +5 -5
  126. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  127. package/src/sap/ui/vk/measurements/Area.js +1 -1
  128. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  129. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  130. package/src/sap/ui/vk/measurements/Face.js +1 -1
  131. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  132. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  133. package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
  134. package/src/sap/ui/vk/pdf/Page.js +9 -10
  135. package/src/sap/ui/vk/pdf/Utils.js +4 -2
  136. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  137. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  138. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  139. package/src/sap/ui/vk/svg/ContentManager.js +4 -5
  140. package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
  141. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  142. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  143. package/src/sap/ui/vk/svg/Scene.js +1 -1
  144. package/src/sap/ui/vk/svg/SceneBuilder.js +1 -1
  145. package/src/sap/ui/vk/svg/ViewStateManager.js +1 -1
  146. package/src/sap/ui/vk/svg/Viewport.js +11 -18
  147. package/src/sap/ui/vk/thirdparty/BufferGeometryUtils.js +86 -27
  148. package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
  149. package/src/sap/ui/vk/thirdparty/three.js +54501 -32246
  150. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  151. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  152. package/src/sap/ui/vk/threejs/Billboard.js +23 -11
  153. package/src/sap/ui/vk/threejs/Callout.js +1 -1
  154. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  155. package/src/sap/ui/vk/threejs/ContentManager.js +2 -2
  156. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  157. package/src/sap/ui/vk/threejs/HighlightPlayer.js +14 -22
  158. package/src/sap/ui/vk/threejs/Material.js +1 -1
  159. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  160. package/src/sap/ui/vk/threejs/NodeProxy.js +9 -11
  161. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  162. package/src/sap/ui/vk/threejs/OutlineRenderer.js +4 -10
  163. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  164. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  165. package/src/sap/ui/vk/threejs/Scene.js +1 -15
  166. package/src/sap/ui/vk/threejs/SceneBuilder.js +1 -4
  167. package/src/sap/ui/vk/threejs/Texture.js +1 -1
  168. package/src/sap/ui/vk/threejs/ThreeExtensions.js +10 -174
  169. package/src/sap/ui/vk/threejs/ThreeUtils.js +7 -18
  170. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  171. package/src/sap/ui/vk/threejs/ViewStateManager.js +755 -451
  172. package/src/sap/ui/vk/threejs/Viewport.js +47 -35
  173. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  174. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  175. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  176. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  177. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  178. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  179. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  180. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  181. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  182. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  183. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  184. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  185. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  186. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  187. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  188. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  189. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  190. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  191. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  192. package/src/sap/ui/vk/tools/Gizmo.js +4 -3
  193. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  194. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  195. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  196. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  197. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  198. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  199. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  200. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  201. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  202. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  203. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  204. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  205. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  206. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  207. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  208. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  209. package/src/sap/ui/vk/tools/Tool.js +1 -1
  210. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  211. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  212. package/src/sap/ui/vk/tools/TooltipToolHandler.js +5 -0
  213. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  214. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
  215. package/src/sap/ui/vk/totara/SceneContext.js +3 -1
  216. package/src/sap/ui/vk/totara/TotaraLoader.js +2 -2
  217. package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +18 -21
  218. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
  219. package/ui5.yaml +5 -3
  220. package/src/sap/ui/vk/threejs/v2/ViewStateManager.js +0 -1445
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ui.vk",
3
- "version": "1.138.0",
3
+ "version": "1.140.0",
4
4
  "description": "SAPUI5 Library sap.ui.vk",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.138.0</version>
10
+ <version>1.140.0</version>
11
11
 
12
12
  <documentation>SAPUI5 Visualization Toolkit.</documentation>
13
13
 
@@ -35,6 +35,14 @@
35
35
  <libraryName>sap.ui.richtexteditor</libraryName>
36
36
  <lazy>true</lazy>
37
37
  </dependency>
38
+ <dependency>
39
+ <libraryName>sap.ui.comp</libraryName>
40
+ <lazy>true</lazy>
41
+ </dependency>
42
+ <dependency>
43
+ <libraryName>sap.f</libraryName>
44
+ <lazy>true</lazy>
45
+ </dependency>
38
46
  </dependencies>
39
47
 
40
48
  <appData>
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  *
28
28
  * @private
29
29
  * @author SAP SE
30
- * @version 1.138.0
30
+ * @version 1.140.0
31
31
  * @extends sap.ui.base.EventProvider
32
32
  * @alias sap.ui.vk.AnimationPlayback
33
33
  */
@@ -31,7 +31,7 @@ sap.ui.define([
31
31
  *
32
32
  * @public
33
33
  * @author SAP SE
34
- * @version 1.138.0
34
+ * @version 1.140.0
35
35
  * @extends sap.ui.core.Element
36
36
  * @alias sap.ui.vk.AnimationPlayer
37
37
  * @since 1.67.0
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  *
34
34
  * @private
35
35
  * @author SAP SE
36
- * @version 1.138.0
36
+ * @version 1.140.0
37
37
  * @extends sap.ui.base.Object
38
38
  * @alias sap.ui.vk.AnimationSequence
39
39
  * @implements sap.ui.vk.IJointCollection
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @extends sap.m.Slider
27
27
  *
28
28
  * @author SAP SE
29
- * @version 1.138.0
29
+ * @version 1.140.0
30
30
  *
31
31
  * @constructor
32
32
  * @private
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @param {boolean} parameters.infinite infinite flag
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.138.0
35
+ * @version 1.140.0
36
36
  * @extends sap.ui.base.Object
37
37
  * @alias sap.ui.vk.AnimationTrack
38
38
  *
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  *
41
41
  * @public
42
42
  * @author SAP SE
43
- * @version 1.138.0
43
+ * @version 1.140.0
44
44
  * @extends sap.ui.core.Control
45
45
  * @alias sap.ui.vk.Annotation
46
46
  * @since 1.76.0
@@ -386,10 +386,11 @@ sap.ui.define([
386
386
  var targetNode = this.getTargetNodes()[0];
387
387
  if (this.getDisplay() && targetNode) {
388
388
  var viewport = this._viewport;
389
+ const vsm = viewport._getViewStateManagerThreeJS();
389
390
  var nodeScreen = this._getNodeRefScreenCenter(viewport, targetNode);
390
391
  var hitNode = viewport.hitTest(nodeScreen.x, nodeScreen.y);
391
392
  var annotation = this.getDomRef();
392
- if (targetNode.visible == false) {
393
+ if (vsm.getVisibilityState(targetNode) == false) {
393
394
  annotation.style.visibility = "hidden";
394
395
  } else {
395
396
  annotation.style.visibility = "visible";
@@ -401,7 +402,6 @@ sap.ui.define([
401
402
  // Display annotation when hit node is the target node
402
403
  annotation.style.visibility = "visible";
403
404
  } else {
404
- var vsm = Element.getElementById(viewport.getViewStateManager());
405
405
  var worldPos = vsm.getTransformationWorld(hitNode.object).translation;
406
406
  var hitPos = viewport.projectToScreen(worldPos[0], worldPos[1], worldPos[2], viewport.getCamera());
407
407
  // Hide annotation when target node is deeper than the hit node
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @public
37
37
  * @abstract
38
38
  * @author SAP SE
39
- * @version 1.138.0
39
+ * @version 1.140.0
40
40
  * @extends sap.ui.base.Object
41
41
  * @implements sap.ui.base.Poolable, sap.ui.vk.BaseNodeProxy
42
42
  * @alias sap.ui.vk.BaseNodeProxy
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @public
24
24
  * @abstract
25
25
  * @author SAP SE
26
- * @version 1.138.0
26
+ * @version 1.140.0
27
27
  * @extends sap.ui.base.ManagedObject
28
28
  * @alias sap.ui.vk.Camera
29
29
  * @since 1.52.0
@@ -7,23 +7,23 @@
7
7
 
8
8
  // Provides object sap.ui.vk.ContentConnector.
9
9
  sap.ui.define([
10
- "sap/ui/base/Object",
10
+ "sap/base/Log",
11
11
  "sap/ui/base/ManagedObjectObserver",
12
12
  "sap/ui/core/Element",
13
- "./Messages",
14
- "./getResourceBundle",
15
13
  "./ContentResource",
14
+ "./ContentType",
16
15
  "./Core",
17
- "sap/base/Log"
16
+ "./getResourceBundle",
17
+ "./Messages"
18
18
  ], function(
19
- BaseObject,
19
+ Log,
20
20
  ManagedObjectObserver,
21
21
  Element,
22
- Messages,
23
- getResourceBundle,
24
22
  ContentResource,
23
+ ContentType,
25
24
  vkCore,
26
- Log
25
+ getResourceBundle,
26
+ Messages
27
27
  ) {
28
28
  "use strict";
29
29
 
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @param {object} [mSettings] Initial settings for the new ContentConnector object.
41
41
  * @public
42
42
  * @author SAP SE
43
- * @version 1.138.0
43
+ * @version 1.140.0
44
44
  * @extends sap.ui.core.Element
45
45
  * @alias sap.ui.vk.ContentConnector
46
46
  */
@@ -719,7 +719,79 @@ sap.ui.define([
719
719
  return result;
720
720
  };
721
721
 
722
- var resolvers = [
722
+ // This function handles the cases when the content resource source type is "auto". In this case
723
+ // it is expected that the content resource has a source URL that points to a remote server that
724
+ // provides information about the content resource. The function sends a request to the server
725
+ // to get the content type and returns the content manager class name and dimension based on the
726
+ // content type.
727
+ //
728
+ // If the request fails or the content type is not recognized, the function returns `null`
729
+ // indicating that the next resolver should be tried.
730
+ async function autoResolver(contentResource) {
731
+ const sourceType = contentResource.getSourceType()?.toLowerCase();
732
+ const source = contentResource.getSource();
733
+ const veId = contentResource.getVeid() ?? "";
734
+
735
+ if (sourceType !== "auto" || typeof source !== "string" || veId === "") {
736
+ return null;
737
+ }
738
+
739
+ const url = `${source}${source.endsWith("/") ? "" : "/"}scenes/${veId}/info`;
740
+
741
+ try {
742
+ const response = await fetch(url);
743
+
744
+ if (!response.ok) {
745
+ return null;
746
+ }
747
+
748
+ const { contentType } = await response.json();
749
+
750
+ switch (contentType) {
751
+ case ContentType.IMAGE2D:
752
+ case ContentType.IMAGE360:
753
+ case ContentType.MATERIAL:
754
+ case ContentType.MODEL3D:
755
+ case ContentType.NAVIGATION:
756
+ case ContentType.SYMBOL:
757
+ contentResource.setEffectiveSourceType("stream");
758
+
759
+ return {
760
+ dimension: 3,
761
+ contentManagerClassName: "sap.ui.vk.threejs.ContentManager"
762
+ };
763
+
764
+ case ContentType.DRAWING2D:
765
+ case ContentType.ECAD:
766
+ contentResource.setEffectiveSourceType(contentType === ContentType.ECAD
767
+ ? "ecad"
768
+ : "stream2d"
769
+ );
770
+
771
+ return {
772
+ dimension: 2,
773
+ contentManagerClassName: "sap.ui.vk.svg.ContentManager"
774
+ };
775
+
776
+ case ContentType.PDF:
777
+ contentResource.setEffectiveSourceType("stream");
778
+
779
+ return {
780
+ dimension: 2,
781
+ contentManagerClassName: "sap.ui.vk.pdf.ContentManager"
782
+ };
783
+
784
+ default:
785
+ return null;
786
+ }
787
+ } catch (e) {
788
+ Log.error("Failed to resolve content resource type automatically.", e, "sap.ui.vk.ContentConnector");
789
+ }
790
+
791
+ return null;
792
+ }
793
+
794
+ const resolvers = [
723
795
  {
724
796
  pattern: /(^threejs[:.])|(^(threejs|stream|vds4)$)/,
725
797
  dimension: 3,
@@ -744,7 +816,8 @@ sap.ui.define([
744
816
  pattern: /^(pdf)$/,
745
817
  dimension: 2,
746
818
  contentManagerClassName: "sap.ui.vk.pdf.ContentManager"
747
- }
819
+ },
820
+ autoResolver
748
821
  ];
749
822
 
750
823
  /**
@@ -768,53 +841,42 @@ sap.ui.define([
768
841
  * </pre>
769
842
  * @private
770
843
  */
771
- var resolveContentManager = function(contentResource) {
772
- return new Promise(function(resolve, reject) {
773
- var entries = resolvers.slice();
774
- var test = function(index) {
775
- if (index >= entries.length) {
776
- reject();
777
- return;
844
+ async function resolveContentManager(contentResource) {
845
+ const sourceType = contentResource.getSourceType()?.toLowerCase();
846
+
847
+ let resolver = null;
848
+
849
+ for (const entry of resolvers.slice()) {
850
+ if (typeof entry === "function") {
851
+ try {
852
+ resolver = await entry(contentResource);
853
+ break;
854
+ } catch {
855
+ continue;
778
856
  }
779
- var resolver = entries[index];
780
- (function() {
781
-
782
- var sourceType = contentResource.getSourceType();
783
- if (sourceType) {
784
- sourceType = sourceType.toLowerCase();
785
- }
786
-
787
- if (typeof resolver === "function") {
788
- return resolver(contentResource);
789
- } else if (typeof resolver.pattern === "string") {
790
- var patternLowerCase = resolver.pattern.toLowerCase();
791
- if (patternLowerCase === sourceType) {
792
- return Promise.resolve(resolver);
793
- }
794
- } else if (resolver.pattern instanceof RegExp) {
857
+ } else if (typeof entry.pattern === "string") {
858
+ if (entry.pattern.toLowerCase() === sourceType) {
859
+ resolver = entry;
860
+ break;
861
+ }
862
+ } else if (entry.pattern instanceof RegExp) {
863
+ if (entry.pattern.test(sourceType)) {
864
+ resolver = entry;
865
+ break;
866
+ }
867
+ }
868
+ }
795
869
 
796
- if (resolver.pattern.test(sourceType)) {
797
- return Promise.resolve(resolver);
798
- }
799
- }
800
- // Skip to the next resolver.
801
- return Promise.reject();
802
- })().then(
803
- function(value) { // onFulfilled
804
- resolve({
805
- dimension: value.dimension,
806
- contentManagerClassName: value.contentManagerClassName,
807
- settings: value.settings
808
- });
809
- },
810
- function() { // onRejected
811
- test(index + 1);
812
- }
813
- );
870
+ if (resolver == null) {
871
+ return null;
872
+ } else {
873
+ return {
874
+ dimension: resolver.dimension,
875
+ contentManagerClassName: resolver.contentManagerClassName,
876
+ settings: resolver.settings
814
877
  };
815
- test(0);
816
- });
817
- };
878
+ }
879
+ }
818
880
 
819
881
  /**
820
882
  * Adds a new content manager resolver.
@@ -1045,8 +1107,8 @@ sap.ui.define([
1045
1107
  /**
1046
1108
  * Collects information about content resource types.
1047
1109
  *
1048
- * Content resources can be 2D and 3D models. Depending of content type different rendering technologies
1049
- * should be used, e.g. DVL, ThreeJS or native browser capabilities, e.g. for raster 2D files.
1110
+ * Content resources can be 2D and 3D models, PDFs, raster images. Depending on content type different rendering
1111
+ * technologies should be used, e.g. DVL, ThreeJS or native browser capabilities, e.g. for raster 2D files.
1050
1112
  *
1051
1113
  * This method has a side effect - it assigns content manager resolvers to the content resources.
1052
1114
  *
@@ -1063,7 +1125,7 @@ sap.ui.define([
1063
1125
  * @private
1064
1126
  * @since 1.50.0
1065
1127
  */
1066
- ContentConnector.prototype._collectContentResourceSourceTypeInformation = function(contentResources) {
1128
+ ContentConnector.prototype._collectContentResourceSourceTypeInformation = async function(contentResources) {
1067
1129
  var noSourceTypes = false;
1068
1130
  var unknownSourceTypes = false;
1069
1131
  var dimensions = {};
@@ -1075,44 +1137,36 @@ sap.ui.define([
1075
1137
  contentResource.getContentResources().forEach(flatten);
1076
1138
  });
1077
1139
 
1078
- return Promise
1079
- .all(
1080
- flatList.map(
1081
- function(contentResource) {
1082
- return resolveContentManager(contentResource)
1083
- .then(
1084
- function(resolver) { // onFulfilled
1085
- dimensions[resolver.dimension] = true;
1086
- contentManagerClassNames[resolver.contentManagerClassName] = true;
1087
- return resolver;
1088
- },
1089
- function() { // onRejected
1090
- if (contentResource.getSourceType()) {
1091
- unknownSourceTypes = true;
1092
- } else {
1093
- noSourceTypes = true;
1094
- }
1095
- return false;
1096
- }
1097
- );
1098
- }
1099
- )
1100
- )
1101
- .then(function(results) {
1102
- for (var i = 0, count = flatList.length; i < count; ++i) {
1103
- if (results[i]) {
1104
- // Assign the resolver to the content resource.
1105
- // It might be used by those content managers that support additional settings.
1106
- flatList[i]._contentManagerResolver = results[i];
1107
- }
1140
+ const resolvers = await Promise.all(flatList.map(async function(contentResource) {
1141
+ const resolver = await resolveContentManager(contentResource);
1142
+
1143
+ if (resolver == null) {
1144
+ if (contentResource.getSourceType()) {
1145
+ unknownSourceTypes = true;
1146
+ } else {
1147
+ noSourceTypes = true;
1108
1148
  }
1109
- return {
1110
- noSourceTypes: noSourceTypes,
1111
- unknownSourceTypes: unknownSourceTypes,
1112
- dimensions: Object.getOwnPropertyNames(dimensions).sort(),
1113
- contentManagerClassNames: Object.getOwnPropertyNames(contentManagerClassNames)
1114
- };
1115
- });
1149
+ } else {
1150
+ dimensions[resolver.dimension] = true;
1151
+ contentManagerClassNames[resolver.contentManagerClassName] = true;
1152
+ }
1153
+ return resolver;
1154
+ }));
1155
+
1156
+ for (const [i, resolver] of resolvers.entries()) {
1157
+ if (resolver != null) {
1158
+ // Assign the resolver to the content resource.
1159
+ // It might be used by those content managers that support additional settings.
1160
+ flatList[i]._contentManagerResolver = resolver;
1161
+ }
1162
+ }
1163
+
1164
+ return {
1165
+ noSourceTypes: noSourceTypes,
1166
+ unknownSourceTypes: unknownSourceTypes,
1167
+ dimensions: Object.getOwnPropertyNames(dimensions).toSorted().map(Number),
1168
+ contentManagerClassNames: Object.getOwnPropertyNames(contentManagerClassNames)
1169
+ };
1116
1170
  };
1117
1171
 
1118
1172
  /**
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @protected
27
27
  * @abstract
28
28
  * @author SAP SE
29
- * @version 1.138.0
29
+ * @version 1.140.0
30
30
  * @extends sap.ui.base.ManagedObject
31
31
  * @alias sap.ui.vk.ContentManager
32
32
  * @since 1.50.0
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @param {object} [oScope] scope An object for resolving string-based type and formatter references in bindings.
28
28
  * @public
29
29
  * @author SAP SE
30
- * @version 1.138.0
30
+ * @version 1.140.0
31
31
  * @extends sap.ui.base.ManagedObject
32
32
  * @alias sap.ui.vk.ContentResource
33
33
  */
@@ -44,6 +44,7 @@ sap.ui.define([
44
44
 
45
45
  /**
46
46
  * The source type of the content resource. Valid types:
47
+ *
47
48
  * <ul>
48
49
  * <li>vds</li>
49
50
  * <li>vds4</li>
@@ -54,18 +55,26 @@ sap.ui.define([
54
55
  * <li>jpeg</li>
55
56
  * <li>gif</li>
56
57
  * <li>bmp</li>
57
- * <li>tif*</li>
58
- * <li>tiff*</li>
58
+ * <li>tif</li>
59
+ * <li>tiff</li>
59
60
  * <li>stream</li>
60
61
  * <li>stream2d</li>
61
62
  * <li>ecad</li>
62
63
  * <li>pdf</li>
64
+ * <li>auto</li>
63
65
  * </ul>
66
+ *
64
67
  * The source type may be omitted if this is a grouping content node.
65
- * </br>NOTE: The tif and tiff image formats are not supported on all browsers.
66
- * Source type "vds" initializes deprecated DVL namespace and uses legacy library to load and display VDS file content.
67
- * If source type of "vds4" is used then new namespace based on Threejs rendering model will be used to load and display VDS file content.
68
- * Since DVL namespace is deprecated in one of future releases it will be removed and source type "vds" will also use Threejs model.
68
+ * <p>
69
+ * If the <code>source</code> property points to an IPD Visualization service the
70
+ * <code>sourceType</code> property can be assigned value <code>auto</code>. The
71
+ * actual <code>sourceType</code> property will be detected by making a request to
72
+ * the backend.
73
+ * <p>
74
+ * NOTE: The tif and tiff image formats are not supported on all browsers.
75
+ * Source type "vds" initializes deprecated DVL namespace and uses legacy library to load and display VDS file content.
76
+ * If source type of "vds4" is used then new namespace based on Threejs rendering model will be used to load and display VDS file content.
77
+ * Since DVL namespace is deprecated in one of future releases it will be removed and source type "vds" will also use Threejs model.
69
78
  */
70
79
  sourceType: "string",
71
80
 
@@ -220,6 +229,8 @@ sap.ui.define([
220
229
 
221
230
  constructor: function(sId, mSettings, oScope) {
222
231
  ManagedObject.apply(this, arguments);
232
+
233
+ this._effectiveSourceType = undefined;
223
234
  }
224
235
  });
225
236
 
@@ -307,5 +318,13 @@ sap.ui.define([
307
318
  return categories;
308
319
  };
309
320
 
321
+ ContentResource.prototype.getEffectiveSourceType = function() {
322
+ return this._effectiveSourceType ?? this.getSourceType();
323
+ };
324
+
325
+ ContentResource.prototype.setEffectiveSourceType = function(effectiveSourceType) {
326
+ this._effectiveSourceType = effectiveSourceType;
327
+ };
328
+
310
329
  return ContentResource;
311
330
  });
@@ -0,0 +1,41 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+
8
+ sap.ui.define([
9
+ "sap/ui/base/DataType"
10
+ ], function(
11
+ DataType
12
+ ) {
13
+ "use strict";
14
+
15
+ /**
16
+ * Defines the type of content in a scene.
17
+ *
18
+ * See VisualContentType in IPD Visualization API.
19
+ *
20
+ * @enum {string}
21
+ * @alias sap.ui.vk.ContentType
22
+ * @private
23
+ * @since 1.139.0
24
+ */
25
+ const ContentType = {
26
+ MODEL3D: "3DModel",
27
+ IMAGE2D: "2DImage",
28
+ IMAGE360: "360Image",
29
+ DRAWING2D: "2DDrawing",
30
+ NAVIGATION: "Navigation",
31
+ FOLDER: "Folder",
32
+ SYMBOL: "Symbol",
33
+ MATERIAL: "Material",
34
+ PDF: "PDF",
35
+ ECAD: "ECAD"
36
+ };
37
+
38
+ DataType.registerEnum("sap.ui.vk.ContentType", ContentType);
39
+
40
+ return ContentType;
41
+ });
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * @final
40
40
  * @private
41
41
  * @author SAP SE
42
- * @version 1.138.0
42
+ * @version 1.140.0
43
43
  * @extends sap.ui.base.ManagedObject
44
44
  * @alias sap.ui.vk.Core
45
45
  * @since 1.50.0
@@ -37,7 +37,7 @@ sap.ui.define([
37
37
  * If left undefined, the number of retry attempts will default to 1. Passing in 0 disables any retry attempts.
38
38
  * @private
39
39
  * @author SAP SE
40
- * @version 1.138.0
40
+ * @version 1.140.0
41
41
  * @extends sap.ui.base.EventProvider
42
42
  * @alias sap.ui.vk.DownloadManager
43
43
  * @since 1.32.0