@itwin/core-frontend 5.1.2 → 5.2.0-dev.10

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 (612) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/BackgroundMapGeometry.js +13 -13
  3. package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
  4. package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
  5. package/lib/cjs/BriefcaseConnection.js +2 -2
  6. package/lib/cjs/BriefcaseConnection.js.map +1 -1
  7. package/lib/cjs/CheckpointConnection.d.ts.map +1 -1
  8. package/lib/cjs/CheckpointConnection.js +3 -3
  9. package/lib/cjs/CheckpointConnection.js.map +1 -1
  10. package/lib/cjs/ContextRealityModelState.js.map +1 -1
  11. package/lib/cjs/ElementLocateManager.d.ts.map +1 -1
  12. package/lib/cjs/ElementLocateManager.js +7 -6
  13. package/lib/cjs/ElementLocateManager.js.map +1 -1
  14. package/lib/cjs/EmphasizeElements.d.ts.map +1 -1
  15. package/lib/cjs/EmphasizeElements.js +3 -1
  16. package/lib/cjs/EmphasizeElements.js.map +1 -1
  17. package/lib/cjs/EnvironmentDecorations.d.ts.map +1 -1
  18. package/lib/cjs/EnvironmentDecorations.js +4 -0
  19. package/lib/cjs/EnvironmentDecorations.js.map +1 -1
  20. package/lib/cjs/FrustumAnimator.d.ts.map +1 -1
  21. package/lib/cjs/FrustumAnimator.js +3 -2
  22. package/lib/cjs/FrustumAnimator.js.map +1 -1
  23. package/lib/cjs/GlobeAnimator.d.ts.map +1 -1
  24. package/lib/cjs/GlobeAnimator.js +7 -6
  25. package/lib/cjs/GlobeAnimator.js.map +1 -1
  26. package/lib/cjs/HitDetail.d.ts.map +1 -1
  27. package/lib/cjs/HitDetail.js +12 -7
  28. package/lib/cjs/HitDetail.js.map +1 -1
  29. package/lib/cjs/IModelApp.d.ts.map +1 -1
  30. package/lib/cjs/IModelApp.js +2 -1
  31. package/lib/cjs/IModelApp.js.map +1 -1
  32. package/lib/cjs/IModelConnection.d.ts +4 -0
  33. package/lib/cjs/IModelConnection.d.ts.map +1 -1
  34. package/lib/cjs/IModelConnection.js +156 -14
  35. package/lib/cjs/IModelConnection.js.map +1 -1
  36. package/lib/cjs/IpcApp.d.ts.map +1 -1
  37. package/lib/cjs/IpcApp.js +1 -1
  38. package/lib/cjs/IpcApp.js.map +1 -1
  39. package/lib/cjs/LinePlaneIntersect.d.ts.map +1 -1
  40. package/lib/cjs/LinePlaneIntersect.js +2 -0
  41. package/lib/cjs/LinePlaneIntersect.js.map +1 -1
  42. package/lib/cjs/LocalhostIpcApp.d.ts.map +1 -1
  43. package/lib/cjs/LocalhostIpcApp.js +2 -1
  44. package/lib/cjs/LocalhostIpcApp.js.map +1 -1
  45. package/lib/cjs/Marker.d.ts.map +1 -1
  46. package/lib/cjs/Marker.js +4 -3
  47. package/lib/cjs/Marker.js.map +1 -1
  48. package/lib/cjs/ModelState.d.ts.map +1 -1
  49. package/lib/cjs/ModelState.js +2 -2
  50. package/lib/cjs/ModelState.js.map +1 -1
  51. package/lib/cjs/NativeApp.d.ts.map +1 -1
  52. package/lib/cjs/NativeApp.js +5 -4
  53. package/lib/cjs/NativeApp.js.map +1 -1
  54. package/lib/cjs/NativeAppLogger.d.ts.map +1 -1
  55. package/lib/cjs/NativeAppLogger.js +1 -0
  56. package/lib/cjs/NativeAppLogger.js.map +1 -1
  57. package/lib/cjs/PlanarClipMaskState.js +3 -3
  58. package/lib/cjs/PlanarClipMaskState.js.map +1 -1
  59. package/lib/cjs/SelectionSet.d.ts.map +1 -1
  60. package/lib/cjs/SelectionSet.js +1 -0
  61. package/lib/cjs/SelectionSet.js.map +1 -1
  62. package/lib/cjs/SheetViewState.d.ts.map +1 -1
  63. package/lib/cjs/SheetViewState.js +5 -5
  64. package/lib/cjs/SheetViewState.js.map +1 -1
  65. package/lib/cjs/SpatialViewState.d.ts.map +1 -1
  66. package/lib/cjs/SpatialViewState.js +1 -1
  67. package/lib/cjs/SpatialViewState.js.map +1 -1
  68. package/lib/cjs/Sprites.js +2 -2
  69. package/lib/cjs/Sprites.js.map +1 -1
  70. package/lib/cjs/TentativePoint.d.ts.map +1 -1
  71. package/lib/cjs/TentativePoint.js +10 -9
  72. package/lib/cjs/TentativePoint.js.map +1 -1
  73. package/lib/cjs/ViewCreator2d.js +1 -1
  74. package/lib/cjs/ViewCreator2d.js.map +1 -1
  75. package/lib/cjs/ViewCreator3d.js +1 -1
  76. package/lib/cjs/ViewCreator3d.js.map +1 -1
  77. package/lib/cjs/ViewPose.d.ts.map +1 -1
  78. package/lib/cjs/ViewPose.js +4 -1
  79. package/lib/cjs/ViewPose.js.map +1 -1
  80. package/lib/cjs/ViewState.d.ts.map +1 -1
  81. package/lib/cjs/ViewState.js +17 -12
  82. package/lib/cjs/ViewState.js.map +1 -1
  83. package/lib/cjs/ViewingSpace.d.ts.map +1 -1
  84. package/lib/cjs/ViewingSpace.js +2 -0
  85. package/lib/cjs/ViewingSpace.js.map +1 -1
  86. package/lib/cjs/Viewport.d.ts.map +1 -1
  87. package/lib/cjs/Viewport.js +17 -10
  88. package/lib/cjs/Viewport.js.map +1 -1
  89. package/lib/cjs/common/ImageUtil.d.ts.map +1 -1
  90. package/lib/cjs/common/ImageUtil.js +2 -1
  91. package/lib/cjs/common/ImageUtil.js.map +1 -1
  92. package/lib/cjs/common/internal/render/GeometryAccumulator.d.ts.map +1 -1
  93. package/lib/cjs/common/internal/render/GeometryAccumulator.js +4 -3
  94. package/lib/cjs/common/internal/render/GeometryAccumulator.js.map +1 -1
  95. package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.d.ts.map +1 -1
  96. package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.js +2 -0
  97. package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.js.map +1 -1
  98. package/lib/cjs/common/internal/render/MeshBuilder.js +1 -1
  99. package/lib/cjs/common/internal/render/MeshBuilder.js.map +1 -1
  100. package/lib/cjs/common/internal/render/VertexTableBuilder.d.ts.map +1 -1
  101. package/lib/cjs/common/internal/render/VertexTableBuilder.js +16 -7
  102. package/lib/cjs/common/internal/render/VertexTableBuilder.js.map +1 -1
  103. package/lib/cjs/extension/ExtensionAdmin.js +2 -2
  104. package/lib/cjs/extension/ExtensionAdmin.js.map +1 -1
  105. package/lib/cjs/internal/GoogleMapsDecorator.js +1 -1
  106. package/lib/cjs/internal/GoogleMapsDecorator.js.map +1 -1
  107. package/lib/cjs/internal/ScriptUtils.js +1 -0
  108. package/lib/cjs/internal/ScriptUtils.js.map +1 -1
  109. package/lib/cjs/internal/render/UpsampleRealityMeshParams.d.ts.map +1 -1
  110. package/lib/cjs/internal/render/UpsampleRealityMeshParams.js +2 -1
  111. package/lib/cjs/internal/render/UpsampleRealityMeshParams.js.map +1 -1
  112. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  113. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +7 -2
  114. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  115. package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  116. package/lib/cjs/internal/render/webgl/AttributeBuffers.js +5 -3
  117. package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
  118. package/lib/cjs/internal/render/webgl/AttributeMap.d.ts.map +1 -1
  119. package/lib/cjs/internal/render/webgl/AttributeMap.js +2 -0
  120. package/lib/cjs/internal/render/webgl/AttributeMap.js.map +1 -1
  121. package/lib/cjs/internal/render/webgl/BackgroundMapDrape.d.ts.map +1 -1
  122. package/lib/cjs/internal/render/webgl/BackgroundMapDrape.js +2 -2
  123. package/lib/cjs/internal/render/webgl/BackgroundMapDrape.js.map +1 -1
  124. package/lib/cjs/internal/render/webgl/BatchUniforms.js +1 -1
  125. package/lib/cjs/internal/render/webgl/BatchUniforms.js.map +1 -1
  126. package/lib/cjs/internal/render/webgl/BranchState.d.ts.map +1 -1
  127. package/lib/cjs/internal/render/webgl/BranchState.js +2 -1
  128. package/lib/cjs/internal/render/webgl/BranchState.js.map +1 -1
  129. package/lib/cjs/internal/render/webgl/BranchUniforms.js +2 -2
  130. package/lib/cjs/internal/render/webgl/BranchUniforms.js.map +1 -1
  131. package/lib/cjs/internal/render/webgl/CachedGeometry.d.ts.map +1 -1
  132. package/lib/cjs/internal/render/webgl/CachedGeometry.js +2 -2
  133. package/lib/cjs/internal/render/webgl/CachedGeometry.js.map +1 -1
  134. package/lib/cjs/internal/render/webgl/ClipStack.js +1 -1
  135. package/lib/cjs/internal/render/webgl/ClipStack.js.map +1 -1
  136. package/lib/cjs/internal/render/webgl/ColorInfo.js +1 -1
  137. package/lib/cjs/internal/render/webgl/ColorInfo.js.map +1 -1
  138. package/lib/cjs/internal/render/webgl/Contours.js +3 -3
  139. package/lib/cjs/internal/render/webgl/Contours.js.map +1 -1
  140. package/lib/cjs/internal/render/webgl/EDL.js +18 -18
  141. package/lib/cjs/internal/render/webgl/EDL.js.map +1 -1
  142. package/lib/cjs/internal/render/webgl/FeatureOverrides.js +4 -4
  143. package/lib/cjs/internal/render/webgl/FeatureOverrides.js.map +1 -1
  144. package/lib/cjs/internal/render/webgl/FrameBuffer.js +3 -3
  145. package/lib/cjs/internal/render/webgl/FrameBuffer.js.map +1 -1
  146. package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
  147. package/lib/cjs/internal/render/webgl/FrustumUniforms.js +2 -1
  148. package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
  149. package/lib/cjs/internal/render/webgl/GLTimer.d.ts.map +1 -1
  150. package/lib/cjs/internal/render/webgl/GLTimer.js +2 -0
  151. package/lib/cjs/internal/render/webgl/GLTimer.js.map +1 -1
  152. package/lib/cjs/internal/render/webgl/MapLayerParams.js +2 -2
  153. package/lib/cjs/internal/render/webgl/MapLayerParams.js.map +1 -1
  154. package/lib/cjs/internal/render/webgl/MeshData.js +2 -2
  155. package/lib/cjs/internal/render/webgl/MeshData.js.map +1 -1
  156. package/lib/cjs/internal/render/webgl/PerformanceMetrics.js +1 -1
  157. package/lib/cjs/internal/render/webgl/PerformanceMetrics.js.map +1 -1
  158. package/lib/cjs/internal/render/webgl/PlanarClassifier.d.ts.map +1 -1
  159. package/lib/cjs/internal/render/webgl/PlanarClassifier.js +7 -7
  160. package/lib/cjs/internal/render/webgl/PlanarClassifier.js.map +1 -1
  161. package/lib/cjs/internal/render/webgl/PlanarGrid.js +1 -1
  162. package/lib/cjs/internal/render/webgl/PlanarGrid.js.map +1 -1
  163. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.d.ts +0 -3
  164. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
  165. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.js +6 -5
  166. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.js.map +1 -1
  167. package/lib/cjs/internal/render/webgl/PointCloud.js +1 -1
  168. package/lib/cjs/internal/render/webgl/PointCloud.js.map +1 -1
  169. package/lib/cjs/internal/render/webgl/RealityMesh.js +1 -1
  170. package/lib/cjs/internal/render/webgl/RealityMesh.js.map +1 -1
  171. package/lib/cjs/internal/render/webgl/RenderBuffer.js +2 -2
  172. package/lib/cjs/internal/render/webgl/RenderBuffer.js.map +1 -1
  173. package/lib/cjs/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
  174. package/lib/cjs/internal/render/webgl/SceneCompositor.js +115 -85
  175. package/lib/cjs/internal/render/webgl/SceneCompositor.js.map +1 -1
  176. package/lib/cjs/internal/render/webgl/ScratchDrawParams.d.ts.map +1 -1
  177. package/lib/cjs/internal/render/webgl/ScratchDrawParams.js +11 -10
  178. package/lib/cjs/internal/render/webgl/ScratchDrawParams.js.map +1 -1
  179. package/lib/cjs/internal/render/webgl/ScreenSpaceEffect.js +3 -3
  180. package/lib/cjs/internal/render/webgl/ScreenSpaceEffect.js.map +1 -1
  181. package/lib/cjs/internal/render/webgl/ShaderProgram.js +3 -3
  182. package/lib/cjs/internal/render/webgl/ShaderProgram.js.map +1 -1
  183. package/lib/cjs/internal/render/webgl/ShadowUniforms.d.ts.map +1 -1
  184. package/lib/cjs/internal/render/webgl/ShadowUniforms.js +2 -1
  185. package/lib/cjs/internal/render/webgl/ShadowUniforms.js.map +1 -1
  186. package/lib/cjs/internal/render/webgl/SolarShadowMap.d.ts.map +1 -1
  187. package/lib/cjs/internal/render/webgl/SolarShadowMap.js +6 -4
  188. package/lib/cjs/internal/render/webgl/SolarShadowMap.js.map +1 -1
  189. package/lib/cjs/internal/render/webgl/System.d.ts.map +1 -1
  190. package/lib/cjs/internal/render/webgl/System.js +1 -1
  191. package/lib/cjs/internal/render/webgl/System.js.map +1 -1
  192. package/lib/cjs/internal/render/webgl/Target.d.ts.map +1 -1
  193. package/lib/cjs/internal/render/webgl/Target.js +10 -7
  194. package/lib/cjs/internal/render/webgl/Target.js.map +1 -1
  195. package/lib/cjs/internal/render/webgl/Texture.d.ts.map +1 -1
  196. package/lib/cjs/internal/render/webgl/Texture.js +10 -8
  197. package/lib/cjs/internal/render/webgl/Texture.js.map +1 -1
  198. package/lib/cjs/internal/render/webgl/glsl/Animation.d.ts.map +1 -1
  199. package/lib/cjs/internal/render/webgl/glsl/Animation.js +4 -2
  200. package/lib/cjs/internal/render/webgl/glsl/Animation.js.map +1 -1
  201. package/lib/cjs/internal/render/webgl/glsl/Color.d.ts.map +1 -1
  202. package/lib/cjs/internal/render/webgl/glsl/Color.js +2 -1
  203. package/lib/cjs/internal/render/webgl/glsl/Color.js.map +1 -1
  204. package/lib/cjs/internal/render/webgl/glsl/Composite.js +1 -1
  205. package/lib/cjs/internal/render/webgl/glsl/Composite.js.map +1 -1
  206. package/lib/cjs/internal/render/webgl/glsl/CopyStencil.d.ts.map +1 -1
  207. package/lib/cjs/internal/render/webgl/glsl/CopyStencil.js +3 -2
  208. package/lib/cjs/internal/render/webgl/glsl/CopyStencil.js.map +1 -1
  209. package/lib/cjs/internal/render/webgl/glsl/PlanarClassification.js +3 -3
  210. package/lib/cjs/internal/render/webgl/glsl/PlanarClassification.js.map +1 -1
  211. package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.d.ts.map +1 -1
  212. package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.js +4 -3
  213. package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.js.map +1 -1
  214. package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js +8 -8
  215. package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js.map +1 -1
  216. package/lib/cjs/internal/render/webgl/glsl/Surface.js +10 -10
  217. package/lib/cjs/internal/render/webgl/glsl/Surface.js.map +1 -1
  218. package/lib/cjs/internal/render/webgl/glsl/Vertex.js +2 -2
  219. package/lib/cjs/internal/render/webgl/glsl/Vertex.js.map +1 -1
  220. package/lib/cjs/internal/tile/B3dmReader.d.ts.map +1 -1
  221. package/lib/cjs/internal/tile/B3dmReader.js +1 -1
  222. package/lib/cjs/internal/tile/B3dmReader.js.map +1 -1
  223. package/lib/cjs/internal/tile/FetchCloudStorage.js +1 -1
  224. package/lib/cjs/internal/tile/FetchCloudStorage.js.map +1 -1
  225. package/lib/cjs/internal/tile/LRUTileList.d.ts.map +1 -1
  226. package/lib/cjs/internal/tile/LRUTileList.js +4 -0
  227. package/lib/cjs/internal/tile/LRUTileList.js.map +1 -1
  228. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
  229. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js +2 -1
  230. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
  231. package/lib/cjs/internal/tile/OPCFormatInterpreter.js +4 -4
  232. package/lib/cjs/internal/tile/OPCFormatInterpreter.js.map +1 -1
  233. package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
  234. package/lib/cjs/internal/tile/OrbitGtTileTree.js +2 -2
  235. package/lib/cjs/internal/tile/OrbitGtTileTree.js.map +1 -1
  236. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  237. package/lib/cjs/internal/tile/RealityModelTileTree.js +3 -3
  238. package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
  239. package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
  240. package/lib/cjs/internal/tile/RealityTileLoader.js +3 -0
  241. package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
  242. package/lib/cjs/internal/tile/ThreeDTileFormatInterpreter.js +3 -3
  243. package/lib/cjs/internal/tile/ThreeDTileFormatInterpreter.js.map +1 -1
  244. package/lib/cjs/internal/tile/TileUserSet.d.ts.map +1 -1
  245. package/lib/cjs/internal/tile/TileUserSet.js +4 -0
  246. package/lib/cjs/internal/tile/TileUserSet.js.map +1 -1
  247. package/lib/cjs/internal/tile/map/ArcGISTileMap.js +1 -1
  248. package/lib/cjs/internal/tile/map/ArcGISTileMap.js.map +1 -1
  249. package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
  250. package/lib/cjs/internal/tile/map/ArcGisUtilities.js +4 -0
  251. package/lib/cjs/internal/tile/map/ArcGisUtilities.js.map +1 -1
  252. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  253. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
  254. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  255. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
  256. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  257. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +1 -1
  258. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  259. package/lib/cjs/internal/tile/map/MapTileAvailability.d.ts.map +1 -1
  260. package/lib/cjs/internal/tile/map/MapTileAvailability.js +5 -2
  261. package/lib/cjs/internal/tile/map/MapTileAvailability.js.map +1 -1
  262. package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
  263. package/lib/cjs/internal/tile/map/WmtsCapabilities.js +3 -2
  264. package/lib/cjs/internal/tile/map/WmtsCapabilities.js.map +1 -1
  265. package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
  266. package/lib/cjs/properties/FormattedQuantityDescription.js +2 -0
  267. package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
  268. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.d.ts.map +1 -1
  269. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js +2 -0
  270. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
  271. package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  272. package/lib/cjs/quantity-formatting/QuantityFormatter.js +5 -3
  273. package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
  274. package/lib/cjs/tile/GltfReader.d.ts +5 -2
  275. package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
  276. package/lib/cjs/tile/GltfReader.js +54 -16
  277. package/lib/cjs/tile/GltfReader.js.map +1 -1
  278. package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
  279. package/lib/cjs/tile/RealityTile.js +2 -2
  280. package/lib/cjs/tile/RealityTile.js.map +1 -1
  281. package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
  282. package/lib/cjs/tile/RealityTileTree.js +5 -5
  283. package/lib/cjs/tile/RealityTileTree.js.map +1 -1
  284. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  285. package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
  286. package/lib/cjs/tile/TileDrawArgs.js +2 -1
  287. package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
  288. package/lib/cjs/tile/map/ImageryTileTree.js +1 -1
  289. package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
  290. package/lib/cjs/tile/map/MapLayerFormatRegistry.js +1 -1
  291. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  292. package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
  293. package/lib/cjs/tile/map/MapLayerSources.js +9 -1
  294. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  295. package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
  296. package/lib/cjs/tile/map/MapTile.js +10 -8
  297. package/lib/cjs/tile/map/MapTile.js.map +1 -1
  298. package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
  299. package/lib/cjs/tile/map/MapTileTree.js +8 -7
  300. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  301. package/lib/cjs/tile/map/MapTilingScheme.d.ts.map +1 -1
  302. package/lib/cjs/tile/map/MapTilingScheme.js +2 -1
  303. package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
  304. package/lib/cjs/tools/Tool.js +1 -1
  305. package/lib/cjs/tools/Tool.js.map +1 -1
  306. package/lib/esm/BackgroundMapGeometry.js +14 -14
  307. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  308. package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
  309. package/lib/esm/BriefcaseConnection.js +2 -2
  310. package/lib/esm/BriefcaseConnection.js.map +1 -1
  311. package/lib/esm/CheckpointConnection.d.ts.map +1 -1
  312. package/lib/esm/CheckpointConnection.js +4 -4
  313. package/lib/esm/CheckpointConnection.js.map +1 -1
  314. package/lib/esm/ContextRealityModelState.js.map +1 -1
  315. package/lib/esm/ElementLocateManager.d.ts.map +1 -1
  316. package/lib/esm/ElementLocateManager.js +8 -7
  317. package/lib/esm/ElementLocateManager.js.map +1 -1
  318. package/lib/esm/EmphasizeElements.d.ts.map +1 -1
  319. package/lib/esm/EmphasizeElements.js +3 -1
  320. package/lib/esm/EmphasizeElements.js.map +1 -1
  321. package/lib/esm/EnvironmentDecorations.d.ts.map +1 -1
  322. package/lib/esm/EnvironmentDecorations.js +4 -0
  323. package/lib/esm/EnvironmentDecorations.js.map +1 -1
  324. package/lib/esm/FrustumAnimator.d.ts.map +1 -1
  325. package/lib/esm/FrustumAnimator.js +3 -2
  326. package/lib/esm/FrustumAnimator.js.map +1 -1
  327. package/lib/esm/GlobeAnimator.d.ts.map +1 -1
  328. package/lib/esm/GlobeAnimator.js +7 -6
  329. package/lib/esm/GlobeAnimator.js.map +1 -1
  330. package/lib/esm/HitDetail.d.ts.map +1 -1
  331. package/lib/esm/HitDetail.js +12 -7
  332. package/lib/esm/HitDetail.js.map +1 -1
  333. package/lib/esm/IModelApp.d.ts.map +1 -1
  334. package/lib/esm/IModelApp.js +4 -3
  335. package/lib/esm/IModelApp.js.map +1 -1
  336. package/lib/esm/IModelConnection.d.ts +4 -0
  337. package/lib/esm/IModelConnection.d.ts.map +1 -1
  338. package/lib/esm/IModelConnection.js +158 -16
  339. package/lib/esm/IModelConnection.js.map +1 -1
  340. package/lib/esm/IpcApp.d.ts.map +1 -1
  341. package/lib/esm/IpcApp.js +2 -2
  342. package/lib/esm/IpcApp.js.map +1 -1
  343. package/lib/esm/LinePlaneIntersect.d.ts.map +1 -1
  344. package/lib/esm/LinePlaneIntersect.js +2 -0
  345. package/lib/esm/LinePlaneIntersect.js.map +1 -1
  346. package/lib/esm/LocalhostIpcApp.d.ts.map +1 -1
  347. package/lib/esm/LocalhostIpcApp.js +2 -1
  348. package/lib/esm/LocalhostIpcApp.js.map +1 -1
  349. package/lib/esm/Marker.d.ts.map +1 -1
  350. package/lib/esm/Marker.js +5 -4
  351. package/lib/esm/Marker.js.map +1 -1
  352. package/lib/esm/ModelState.d.ts.map +1 -1
  353. package/lib/esm/ModelState.js +3 -3
  354. package/lib/esm/ModelState.js.map +1 -1
  355. package/lib/esm/NativeApp.d.ts.map +1 -1
  356. package/lib/esm/NativeApp.js +5 -4
  357. package/lib/esm/NativeApp.js.map +1 -1
  358. package/lib/esm/NativeAppLogger.d.ts.map +1 -1
  359. package/lib/esm/NativeAppLogger.js +1 -0
  360. package/lib/esm/NativeAppLogger.js.map +1 -1
  361. package/lib/esm/PlanarClipMaskState.js +3 -3
  362. package/lib/esm/PlanarClipMaskState.js.map +1 -1
  363. package/lib/esm/SelectionSet.d.ts.map +1 -1
  364. package/lib/esm/SelectionSet.js +2 -1
  365. package/lib/esm/SelectionSet.js.map +1 -1
  366. package/lib/esm/SheetViewState.d.ts.map +1 -1
  367. package/lib/esm/SheetViewState.js +6 -6
  368. package/lib/esm/SheetViewState.js.map +1 -1
  369. package/lib/esm/SpatialViewState.d.ts.map +1 -1
  370. package/lib/esm/SpatialViewState.js +2 -2
  371. package/lib/esm/SpatialViewState.js.map +1 -1
  372. package/lib/esm/Sprites.js +2 -2
  373. package/lib/esm/Sprites.js.map +1 -1
  374. package/lib/esm/TentativePoint.d.ts.map +1 -1
  375. package/lib/esm/TentativePoint.js +10 -9
  376. package/lib/esm/TentativePoint.js.map +1 -1
  377. package/lib/esm/ViewCreator2d.js +1 -1
  378. package/lib/esm/ViewCreator2d.js.map +1 -1
  379. package/lib/esm/ViewCreator3d.js +1 -1
  380. package/lib/esm/ViewCreator3d.js.map +1 -1
  381. package/lib/esm/ViewPose.d.ts.map +1 -1
  382. package/lib/esm/ViewPose.js +4 -1
  383. package/lib/esm/ViewPose.js.map +1 -1
  384. package/lib/esm/ViewState.d.ts.map +1 -1
  385. package/lib/esm/ViewState.js +18 -13
  386. package/lib/esm/ViewState.js.map +1 -1
  387. package/lib/esm/ViewingSpace.d.ts.map +1 -1
  388. package/lib/esm/ViewingSpace.js +2 -0
  389. package/lib/esm/ViewingSpace.js.map +1 -1
  390. package/lib/esm/Viewport.d.ts.map +1 -1
  391. package/lib/esm/Viewport.js +18 -11
  392. package/lib/esm/Viewport.js.map +1 -1
  393. package/lib/esm/common/ImageUtil.d.ts.map +1 -1
  394. package/lib/esm/common/ImageUtil.js +2 -1
  395. package/lib/esm/common/ImageUtil.js.map +1 -1
  396. package/lib/esm/common/internal/render/GeometryAccumulator.d.ts.map +1 -1
  397. package/lib/esm/common/internal/render/GeometryAccumulator.js +4 -3
  398. package/lib/esm/common/internal/render/GeometryAccumulator.js.map +1 -1
  399. package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.d.ts.map +1 -1
  400. package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.js +2 -0
  401. package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.js.map +1 -1
  402. package/lib/esm/common/internal/render/MeshBuilder.js +2 -2
  403. package/lib/esm/common/internal/render/MeshBuilder.js.map +1 -1
  404. package/lib/esm/common/internal/render/VertexTableBuilder.d.ts.map +1 -1
  405. package/lib/esm/common/internal/render/VertexTableBuilder.js +17 -8
  406. package/lib/esm/common/internal/render/VertexTableBuilder.js.map +1 -1
  407. package/lib/esm/extension/ExtensionAdmin.js +2 -2
  408. package/lib/esm/extension/ExtensionAdmin.js.map +1 -1
  409. package/lib/esm/internal/GoogleMapsDecorator.js +1 -1
  410. package/lib/esm/internal/GoogleMapsDecorator.js.map +1 -1
  411. package/lib/esm/internal/ScriptUtils.js +1 -0
  412. package/lib/esm/internal/ScriptUtils.js.map +1 -1
  413. package/lib/esm/internal/render/UpsampleRealityMeshParams.d.ts.map +1 -1
  414. package/lib/esm/internal/render/UpsampleRealityMeshParams.js +2 -1
  415. package/lib/esm/internal/render/UpsampleRealityMeshParams.js.map +1 -1
  416. package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  417. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +7 -2
  418. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  419. package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  420. package/lib/esm/internal/render/webgl/AttributeBuffers.js +5 -3
  421. package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
  422. package/lib/esm/internal/render/webgl/AttributeMap.d.ts.map +1 -1
  423. package/lib/esm/internal/render/webgl/AttributeMap.js +2 -0
  424. package/lib/esm/internal/render/webgl/AttributeMap.js.map +1 -1
  425. package/lib/esm/internal/render/webgl/BackgroundMapDrape.d.ts.map +1 -1
  426. package/lib/esm/internal/render/webgl/BackgroundMapDrape.js +3 -3
  427. package/lib/esm/internal/render/webgl/BackgroundMapDrape.js.map +1 -1
  428. package/lib/esm/internal/render/webgl/BatchUniforms.js +1 -1
  429. package/lib/esm/internal/render/webgl/BatchUniforms.js.map +1 -1
  430. package/lib/esm/internal/render/webgl/BranchState.d.ts.map +1 -1
  431. package/lib/esm/internal/render/webgl/BranchState.js +2 -1
  432. package/lib/esm/internal/render/webgl/BranchState.js.map +1 -1
  433. package/lib/esm/internal/render/webgl/BranchUniforms.js +3 -3
  434. package/lib/esm/internal/render/webgl/BranchUniforms.js.map +1 -1
  435. package/lib/esm/internal/render/webgl/CachedGeometry.d.ts.map +1 -1
  436. package/lib/esm/internal/render/webgl/CachedGeometry.js +3 -3
  437. package/lib/esm/internal/render/webgl/CachedGeometry.js.map +1 -1
  438. package/lib/esm/internal/render/webgl/ClipStack.js +1 -1
  439. package/lib/esm/internal/render/webgl/ClipStack.js.map +1 -1
  440. package/lib/esm/internal/render/webgl/ColorInfo.js +2 -2
  441. package/lib/esm/internal/render/webgl/ColorInfo.js.map +1 -1
  442. package/lib/esm/internal/render/webgl/Contours.js +4 -4
  443. package/lib/esm/internal/render/webgl/Contours.js.map +1 -1
  444. package/lib/esm/internal/render/webgl/EDL.js +19 -19
  445. package/lib/esm/internal/render/webgl/EDL.js.map +1 -1
  446. package/lib/esm/internal/render/webgl/FeatureOverrides.js +5 -5
  447. package/lib/esm/internal/render/webgl/FeatureOverrides.js.map +1 -1
  448. package/lib/esm/internal/render/webgl/FrameBuffer.js +4 -4
  449. package/lib/esm/internal/render/webgl/FrameBuffer.js.map +1 -1
  450. package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
  451. package/lib/esm/internal/render/webgl/FrustumUniforms.js +2 -1
  452. package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
  453. package/lib/esm/internal/render/webgl/GLTimer.d.ts.map +1 -1
  454. package/lib/esm/internal/render/webgl/GLTimer.js +2 -0
  455. package/lib/esm/internal/render/webgl/GLTimer.js.map +1 -1
  456. package/lib/esm/internal/render/webgl/MapLayerParams.js +3 -3
  457. package/lib/esm/internal/render/webgl/MapLayerParams.js.map +1 -1
  458. package/lib/esm/internal/render/webgl/MeshData.js +3 -3
  459. package/lib/esm/internal/render/webgl/MeshData.js.map +1 -1
  460. package/lib/esm/internal/render/webgl/PerformanceMetrics.js +1 -1
  461. package/lib/esm/internal/render/webgl/PerformanceMetrics.js.map +1 -1
  462. package/lib/esm/internal/render/webgl/PlanarClassifier.d.ts.map +1 -1
  463. package/lib/esm/internal/render/webgl/PlanarClassifier.js +8 -8
  464. package/lib/esm/internal/render/webgl/PlanarClassifier.js.map +1 -1
  465. package/lib/esm/internal/render/webgl/PlanarGrid.js +2 -2
  466. package/lib/esm/internal/render/webgl/PlanarGrid.js.map +1 -1
  467. package/lib/esm/internal/render/webgl/PlanarTextureProjection.d.ts +0 -3
  468. package/lib/esm/internal/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
  469. package/lib/esm/internal/render/webgl/PlanarTextureProjection.js +6 -5
  470. package/lib/esm/internal/render/webgl/PlanarTextureProjection.js.map +1 -1
  471. package/lib/esm/internal/render/webgl/PointCloud.js +2 -2
  472. package/lib/esm/internal/render/webgl/PointCloud.js.map +1 -1
  473. package/lib/esm/internal/render/webgl/RealityMesh.js +2 -2
  474. package/lib/esm/internal/render/webgl/RealityMesh.js.map +1 -1
  475. package/lib/esm/internal/render/webgl/RenderBuffer.js +3 -3
  476. package/lib/esm/internal/render/webgl/RenderBuffer.js.map +1 -1
  477. package/lib/esm/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
  478. package/lib/esm/internal/render/webgl/SceneCompositor.js +116 -86
  479. package/lib/esm/internal/render/webgl/SceneCompositor.js.map +1 -1
  480. package/lib/esm/internal/render/webgl/ScratchDrawParams.d.ts.map +1 -1
  481. package/lib/esm/internal/render/webgl/ScratchDrawParams.js +11 -10
  482. package/lib/esm/internal/render/webgl/ScratchDrawParams.js.map +1 -1
  483. package/lib/esm/internal/render/webgl/ScreenSpaceEffect.js +4 -4
  484. package/lib/esm/internal/render/webgl/ScreenSpaceEffect.js.map +1 -1
  485. package/lib/esm/internal/render/webgl/ShaderProgram.js +4 -4
  486. package/lib/esm/internal/render/webgl/ShaderProgram.js.map +1 -1
  487. package/lib/esm/internal/render/webgl/ShadowUniforms.d.ts.map +1 -1
  488. package/lib/esm/internal/render/webgl/ShadowUniforms.js +2 -1
  489. package/lib/esm/internal/render/webgl/ShadowUniforms.js.map +1 -1
  490. package/lib/esm/internal/render/webgl/SolarShadowMap.d.ts.map +1 -1
  491. package/lib/esm/internal/render/webgl/SolarShadowMap.js +7 -5
  492. package/lib/esm/internal/render/webgl/SolarShadowMap.js.map +1 -1
  493. package/lib/esm/internal/render/webgl/System.d.ts.map +1 -1
  494. package/lib/esm/internal/render/webgl/System.js +2 -2
  495. package/lib/esm/internal/render/webgl/System.js.map +1 -1
  496. package/lib/esm/internal/render/webgl/Target.d.ts.map +1 -1
  497. package/lib/esm/internal/render/webgl/Target.js +11 -8
  498. package/lib/esm/internal/render/webgl/Target.js.map +1 -1
  499. package/lib/esm/internal/render/webgl/Texture.d.ts.map +1 -1
  500. package/lib/esm/internal/render/webgl/Texture.js +11 -9
  501. package/lib/esm/internal/render/webgl/Texture.js.map +1 -1
  502. package/lib/esm/internal/render/webgl/glsl/Animation.d.ts.map +1 -1
  503. package/lib/esm/internal/render/webgl/glsl/Animation.js +5 -3
  504. package/lib/esm/internal/render/webgl/glsl/Animation.js.map +1 -1
  505. package/lib/esm/internal/render/webgl/glsl/Color.d.ts.map +1 -1
  506. package/lib/esm/internal/render/webgl/glsl/Color.js +2 -1
  507. package/lib/esm/internal/render/webgl/glsl/Color.js.map +1 -1
  508. package/lib/esm/internal/render/webgl/glsl/Composite.js +2 -2
  509. package/lib/esm/internal/render/webgl/glsl/Composite.js.map +1 -1
  510. package/lib/esm/internal/render/webgl/glsl/CopyStencil.d.ts.map +1 -1
  511. package/lib/esm/internal/render/webgl/glsl/CopyStencil.js +3 -2
  512. package/lib/esm/internal/render/webgl/glsl/CopyStencil.js.map +1 -1
  513. package/lib/esm/internal/render/webgl/glsl/PlanarClassification.js +4 -4
  514. package/lib/esm/internal/render/webgl/glsl/PlanarClassification.js.map +1 -1
  515. package/lib/esm/internal/render/webgl/glsl/PlanarGrid.d.ts.map +1 -1
  516. package/lib/esm/internal/render/webgl/glsl/PlanarGrid.js +4 -3
  517. package/lib/esm/internal/render/webgl/glsl/PlanarGrid.js.map +1 -1
  518. package/lib/esm/internal/render/webgl/glsl/RealityMesh.js +9 -9
  519. package/lib/esm/internal/render/webgl/glsl/RealityMesh.js.map +1 -1
  520. package/lib/esm/internal/render/webgl/glsl/Surface.js +11 -11
  521. package/lib/esm/internal/render/webgl/glsl/Surface.js.map +1 -1
  522. package/lib/esm/internal/render/webgl/glsl/Vertex.js +3 -3
  523. package/lib/esm/internal/render/webgl/glsl/Vertex.js.map +1 -1
  524. package/lib/esm/internal/tile/B3dmReader.d.ts.map +1 -1
  525. package/lib/esm/internal/tile/B3dmReader.js +2 -2
  526. package/lib/esm/internal/tile/B3dmReader.js.map +1 -1
  527. package/lib/esm/internal/tile/FetchCloudStorage.js +1 -1
  528. package/lib/esm/internal/tile/FetchCloudStorage.js.map +1 -1
  529. package/lib/esm/internal/tile/LRUTileList.d.ts.map +1 -1
  530. package/lib/esm/internal/tile/LRUTileList.js +4 -0
  531. package/lib/esm/internal/tile/LRUTileList.js.map +1 -1
  532. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
  533. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js +2 -1
  534. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
  535. package/lib/esm/internal/tile/OPCFormatInterpreter.js +5 -5
  536. package/lib/esm/internal/tile/OPCFormatInterpreter.js.map +1 -1
  537. package/lib/esm/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
  538. package/lib/esm/internal/tile/OrbitGtTileTree.js +3 -3
  539. package/lib/esm/internal/tile/OrbitGtTileTree.js.map +1 -1
  540. package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  541. package/lib/esm/internal/tile/RealityModelTileTree.js +4 -4
  542. package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
  543. package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
  544. package/lib/esm/internal/tile/RealityTileLoader.js +3 -0
  545. package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
  546. package/lib/esm/internal/tile/ThreeDTileFormatInterpreter.js +4 -4
  547. package/lib/esm/internal/tile/ThreeDTileFormatInterpreter.js.map +1 -1
  548. package/lib/esm/internal/tile/TileUserSet.d.ts.map +1 -1
  549. package/lib/esm/internal/tile/TileUserSet.js +4 -0
  550. package/lib/esm/internal/tile/TileUserSet.js.map +1 -1
  551. package/lib/esm/internal/tile/map/ArcGISTileMap.js +1 -1
  552. package/lib/esm/internal/tile/map/ArcGISTileMap.js.map +1 -1
  553. package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
  554. package/lib/esm/internal/tile/map/ArcGisUtilities.js +4 -0
  555. package/lib/esm/internal/tile/map/ArcGisUtilities.js.map +1 -1
  556. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  557. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
  558. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  559. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +3 -3
  560. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  561. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +2 -2
  562. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  563. package/lib/esm/internal/tile/map/MapTileAvailability.d.ts.map +1 -1
  564. package/lib/esm/internal/tile/map/MapTileAvailability.js +6 -3
  565. package/lib/esm/internal/tile/map/MapTileAvailability.js.map +1 -1
  566. package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
  567. package/lib/esm/internal/tile/map/WmtsCapabilities.js +3 -2
  568. package/lib/esm/internal/tile/map/WmtsCapabilities.js.map +1 -1
  569. package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
  570. package/lib/esm/properties/FormattedQuantityDescription.js +2 -0
  571. package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
  572. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.d.ts.map +1 -1
  573. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js +2 -0
  574. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
  575. package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  576. package/lib/esm/quantity-formatting/QuantityFormatter.js +5 -3
  577. package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
  578. package/lib/esm/tile/GltfReader.d.ts +5 -2
  579. package/lib/esm/tile/GltfReader.d.ts.map +1 -1
  580. package/lib/esm/tile/GltfReader.js +55 -17
  581. package/lib/esm/tile/GltfReader.js.map +1 -1
  582. package/lib/esm/tile/RealityTile.d.ts.map +1 -1
  583. package/lib/esm/tile/RealityTile.js +3 -3
  584. package/lib/esm/tile/RealityTile.js.map +1 -1
  585. package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
  586. package/lib/esm/tile/RealityTileTree.js +6 -6
  587. package/lib/esm/tile/RealityTileTree.js.map +1 -1
  588. package/lib/esm/tile/TileAdmin.js.map +1 -1
  589. package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
  590. package/lib/esm/tile/TileDrawArgs.js +2 -1
  591. package/lib/esm/tile/TileDrawArgs.js.map +1 -1
  592. package/lib/esm/tile/map/ImageryTileTree.js +2 -2
  593. package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
  594. package/lib/esm/tile/map/MapLayerFormatRegistry.js +2 -2
  595. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  596. package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
  597. package/lib/esm/tile/map/MapLayerSources.js +10 -2
  598. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  599. package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
  600. package/lib/esm/tile/map/MapTile.js +11 -9
  601. package/lib/esm/tile/map/MapTile.js.map +1 -1
  602. package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
  603. package/lib/esm/tile/map/MapTileTree.js +9 -8
  604. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  605. package/lib/esm/tile/map/MapTilingScheme.d.ts.map +1 -1
  606. package/lib/esm/tile/map/MapTilingScheme.js +2 -1
  607. package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
  608. package/lib/esm/tools/Tool.js +2 -2
  609. package/lib/esm/tools/Tool.js.map +1 -1
  610. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  611. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  612. package/package.json +20 -20
@@ -1 +1 @@
1
- {"version":3,"file":"NativeApp.js","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAC+C,aAAa,EAAE,0BAA0B,EACzE,mBAAmB,EAA0B,YAAY,EACrB,QAAQ,GACjE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAiB,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CAAC;;AAGH;;;;GAIG;AACH,MAAM,OAAO,OAAO;IACU;IAA5B,YAA4B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAI,CAAC;IAE3C,sEAAsE;IAC/D,KAAK,CAAC,YAAY,CAAC,GAAW;QACnC,OAAO,SAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;IAED,8BAA8B;IACvB,KAAK,CAAC,OAAO,CAAC,GAAW;QAC9B,OAAO,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,0BAA0B;IACnB,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAmB;QACnD,OAAO,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,iCAAiC;IAC1B,KAAK,CAAC,UAAU,CAAC,GAAW;QACjC,OAAO,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,SAAS;QACpB,OAAO,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BeEvent, GuidString, Logger } from \"@itwin/core-bentley\";\nimport {\n BriefcaseDownloader, BriefcaseProps, CatalogIModel, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps,\n NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications, OverriddenBy,\n RemoveFunction, RequestNewBriefcaseProps, StorageValue, SyncMode,\n} from \"@itwin/core-common\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { IpcApp, IpcAppOptions, NotificationHandler } from \"./IpcApp\";\nimport { NativeAppLogger } from \"./NativeAppLogger\";\nimport { OnDownloadProgress } from \"./BriefcaseConnection\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\n\n/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for\n * backwards compatibility, a [SyncMode]($common). If [SyncMode.PullAndPush]($common) is supplied, a new briefcaseId will be acquired.\n * @public\n */\nexport type DownloadBriefcaseId =\n { syncMode?: SyncMode, briefcaseId?: never } |\n { briefcaseId: number, syncMode?: never };\n\n/**\n* Options to download a briefcase\n* @public\n*/\nexport type DownloadBriefcaseOptions = DownloadBriefcaseId & {\n /** the full path for the briefcase file */\n fileName?: string;\n /** Function called regularly to report progress of download. */\n progressCallback?: OnDownloadProgress;\n /** interval for calling progress function, in milliseconds */\n progressInterval?: number;\n};\n\n/** NativeApp notifications from backend */\nclass NativeAppNotifyHandler extends NotificationHandler implements NativeAppNotifications {\n public get channelName() { return nativeAppIpcStrings.notifyChannel; }\n public notifyInternetConnectivityChanged(status: InternetConnectivityStatus) {\n Logger.logInfo(FrontendLoggerCategory.NativeApp, \"Internet connectivity changed\");\n NativeApp.onInternetConnectivityChanged.raiseEvent(status);\n }\n}\n\n/**\n * Options for [[NativeApp.startup]]\n * @public\n */\nexport interface NativeAppOpts extends IpcAppOptions {\n nativeApp?: object;\n}\n\n/**\n * The frontend of a native application\n * @see [Native Applications]($docs/learning/NativeApps.md)\n * @public\n */\nexport class NativeApp {\n private static _removeAppNotify?: RemoveFunction;\n\n /** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */\n public static nativeAppIpc = IpcApp.makeIpcProxy<NativeAppFunctions>(nativeAppIpcStrings.channelName);\n public static catalogIpc = IpcApp.makeIpcProxy<CatalogIModel.IpcMethods, CatalogIModel.IpcChannel>(\"catalogIModel/ipc\");\n\n private static _storages = new Map<string, Storage>();\n private static _onOnline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);\n };\n private static _onOffline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Offline);\n };\n private static async setConnectivity(by: OverriddenBy, status: InternetConnectivityStatus) {\n await this.nativeAppIpc.overrideInternetConnectivity(by, status);\n }\n private static hookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.addEventListener(\"online\", this._onOnline);\n window.addEventListener(\"offline\", this._onOffline);\n }\n }\n private static unhookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.removeEventListener(\"online\", this._onOnline);\n window.removeEventListener(\"offline\", this._onOffline);\n }\n }\n /** event called when internet connectivity changes, if known */\n public static onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\n\n /** determine whether the app currently has internet connectivity, if known */\n public static async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\n return this.nativeAppIpc.checkInternetConnectivity();\n }\n /** @internal */\n public static async overrideInternetConnectivity(status: InternetConnectivityStatus): Promise<void> {\n return this.nativeAppIpc.overrideInternetConnectivity(OverriddenBy.User, status);\n }\n private static _isValid = false;\n public static get isValid(): boolean { return this._isValid; }\n\n /**\n * This is called by either ElectronApp.startup or MobileApp.startup - it should not be called directly\n * @internal\n */\n public static async startup(ipc: IpcSocketFrontend, opts?: NativeAppOpts) {\n await IpcApp.startup(ipc, opts);\n if (this._isValid)\n return;\n this._isValid = true;\n\n this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend\n NativeApp.hookBrowserConnectivityEvents();\n\n // initialize current online state.\n if (window.navigator.onLine) {\n await this.setConnectivity(OverriddenBy.Browser, window.navigator.onLine ? InternetConnectivityStatus.Online : InternetConnectivityStatus.Offline);\n }\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n NativeApp.unhookBrowserConnectivityEvents();\n await NativeAppLogger.flush();\n await IpcApp.shutdown();\n this._isValid = false;\n }\n\n public static async requestDownloadBriefcase(iTwinId: string, iModelId: string, downloadOptions: DownloadBriefcaseOptions,\n asOf?: IModelVersion): Promise<BriefcaseDownloader>;\n\n public static async requestDownloadBriefcase(\n iTwinId: string,\n iModelId: string,\n downloadOptions: DownloadBriefcaseOptions,\n asOf: IModelVersion = IModelVersion.latest()\n ): Promise<BriefcaseDownloader> {\n const shouldReportProgress = !!downloadOptions.progressCallback;\n\n let stopProgressEvents = () => { };\n if (shouldReportProgress) {\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\n downloadOptions.progressCallback?.(data);\n };\n\n stopProgressEvents = IpcApp.addListener(`nativeApp.progress-${iModelId}`, handleProgress);\n }\n\n const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :\n (downloadOptions.syncMode === SyncMode.PullOnly ? 0 : await this.nativeAppIpc.acquireNewBriefcaseId(iModelId));\n\n const fileName = downloadOptions.fileName ?? await this.getBriefcaseFileName({ briefcaseId, iModelId });\n const requestProps: RequestNewBriefcaseProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };\n\n const doDownload = async (): Promise<void> => {\n try {\n await this.nativeAppIpc.downloadBriefcase(requestProps, shouldReportProgress, downloadOptions.progressInterval);\n } finally {\n stopProgressEvents();\n }\n };\n\n const requestCancel = async (): Promise<boolean> => {\n const status = await this.nativeAppIpc.requestCancelDownloadBriefcase(fileName);\n if (status)\n stopProgressEvents();\n return status;\n };\n\n return { briefcaseId, fileName, downloadPromise: doDownload(), requestCancel };\n }\n\n /** Get the full path filename for a briefcase within the briefcase cache */\n public static async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\n return this.nativeAppIpc.getBriefcaseFileName(props);\n }\n\n /** Delete an existing briefcase\n * @param fileName the briefcase fileName\n */\n public static async deleteBriefcase(fileName: string): Promise<void> {\n await this.nativeAppIpc.deleteBriefcaseFiles(fileName);\n }\n\n /** Get a list of all briefcase files held in the local briefcase cache directory */\n public static async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\n return this.nativeAppIpc.getCachedBriefcases(iModelId);\n }\n\n /**\n * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.\n * @param name Should be a local filename without an extension.\n * @returns a Promise for the [[Storage]].\n */\n public static async openStorage(name: string): Promise<Storage> {\n if (this._storages.has(name))\n return this._storages.get(name)!;\n\n const storage = new Storage(await this.nativeAppIpc.storageMgrOpen(name));\n this._storages.set(storage.id, storage);\n return storage;\n }\n\n /**\n * Close a Storage and optionally delete it.\n * @param storage normally not call directly instead use Storage.close()\n * @param deleteStorage if true, delete the storage from disk after closing it.\n */\n public static async closeStorage(storage: Storage, deleteStorage: boolean = false): Promise<void> {\n if (!this._storages.has(storage.id))\n throw new Error(`Storage [Id=${storage.id}] not open`);\n\n await this.nativeAppIpc.storageMgrClose(storage.id, deleteStorage);\n this._storages.delete(storage.id);\n }\n\n /** Get the list of existing Storages on the local disk. */\n public static async getStorageNames(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageMgrNames();\n }\n}\n\n/**\n * A local disk-based cache for key value pairs for NativeApps.\n * @note This should be used only for local caching, since its not guaranteed to exist permanently.\n * @public\n */\nexport class Storage {\n constructor(public readonly id: string) { }\n\n /** get the type of a value for a key, or undefined if not present. */\n public async getValueType(key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\n return NativeApp.nativeAppIpc.storageGetValueType(this.id, key);\n }\n\n /** Get the value for a key */\n public async getData(key: string): Promise<StorageValue> {\n return NativeApp.nativeAppIpc.storageGet(this.id, key);\n }\n\n /** Set value for a key */\n public async setData(key: string, value: StorageValue): Promise<void> {\n return NativeApp.nativeAppIpc.storageSet(this.id, key, value);\n }\n\n /**\n * Return an array of all keys in this Storage.\n * @note This can be expensive, depending on the number of keys present.\n */\n public async getKeys(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageKeys(this.id);\n }\n\n /** Remove a key and its data. */\n public async removeData(key: string): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemove(this.id, key);\n }\n\n /** Remove all keys and their data. */\n public async removeAll(): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemoveAll(this.id);\n }\n}\n"]}
1
+ {"version":3,"file":"NativeApp.js","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAC+C,aAAa,EAAE,0BAA0B,EACzE,mBAAmB,EAA0B,YAAY,EACrB,QAAQ,GACjE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAiB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAyBpD,2CAA2C;AAC3C,MAAM,sBAAuB,SAAQ,mBAAmB;IACtD,IAAW,WAAW,KAAK,OAAO,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC/D,iCAAiC,CAAC,MAAkC;QACzE,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,+BAA+B,CAAC,CAAC;QAClF,SAAS,CAAC,6BAA6B,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;CACF;AAUD;;;;GAIG;AACH,MAAM,OAAO,SAAS;IACZ,MAAM,CAAC,gBAAgB,CAAkB;IAEjD,kFAAkF;IAC3E,MAAM,CAA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AC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,iCAAiC;IAC1B,KAAK,CAAC,UAAU,CAAC,GAAW;QACjC,OAAO,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,SAAS;QACpB,OAAO,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BeEvent, GuidString, Logger } from \"@itwin/core-bentley\";\nimport {\n BriefcaseDownloader, BriefcaseProps, CatalogIModel, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps,\n NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications, OverriddenBy,\n RemoveFunction, RequestNewBriefcaseProps, StorageValue, SyncMode,\n} from \"@itwin/core-common\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { IpcApp, IpcAppOptions, NotificationHandler } from \"./IpcApp\";\nimport { NativeAppLogger } from \"./NativeAppLogger\";\nimport { OnDownloadProgress } from \"./BriefcaseConnection\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\n\n/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for\n * backwards compatibility, a [SyncMode]($common). If [SyncMode.PullAndPush]($common) is supplied, a new briefcaseId will be acquired.\n * @public\n */\nexport type DownloadBriefcaseId =\n { syncMode?: SyncMode, briefcaseId?: never } |\n { briefcaseId: number, syncMode?: never };\n\n/**\n* Options to download a briefcase\n* @public\n*/\nexport type DownloadBriefcaseOptions = DownloadBriefcaseId & {\n /** the full path for the briefcase file */\n fileName?: string;\n /** Function called regularly to report progress of download. */\n progressCallback?: OnDownloadProgress;\n /** interval for calling progress function, in milliseconds */\n progressInterval?: number;\n};\n\n/** NativeApp notifications from backend */\nclass NativeAppNotifyHandler extends NotificationHandler implements NativeAppNotifications {\n public get channelName() { return nativeAppIpcStrings.notifyChannel; }\n public notifyInternetConnectivityChanged(status: InternetConnectivityStatus) {\n Logger.logInfo(FrontendLoggerCategory.NativeApp, \"Internet connectivity changed\");\n NativeApp.onInternetConnectivityChanged.raiseEvent(status);\n }\n}\n\n/**\n * Options for [[NativeApp.startup]]\n * @public\n */\nexport interface NativeAppOpts extends IpcAppOptions {\n nativeApp?: object;\n}\n\n/**\n * The frontend of a native application\n * @see [Native Applications]($docs/learning/NativeApps.md)\n * @public\n */\nexport class NativeApp {\n private static _removeAppNotify?: RemoveFunction;\n\n /** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */\n public static nativeAppIpc = IpcApp.makeIpcProxy<NativeAppFunctions>(nativeAppIpcStrings.channelName);\n public static catalogIpc = IpcApp.makeIpcProxy<CatalogIModel.IpcMethods, CatalogIModel.IpcChannel>(\"catalogIModel/ipc\");\n\n private static _storages = new Map<string, Storage>();\n private static _onOnline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);\n };\n private static _onOffline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Offline);\n };\n private static async setConnectivity(by: OverriddenBy, status: InternetConnectivityStatus) {\n await this.nativeAppIpc.overrideInternetConnectivity(by, status);\n }\n private static hookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.addEventListener(\"online\", this._onOnline);\n window.addEventListener(\"offline\", this._onOffline);\n }\n }\n private static unhookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.removeEventListener(\"online\", this._onOnline);\n window.removeEventListener(\"offline\", this._onOffline);\n }\n }\n /** event called when internet connectivity changes, if known */\n public static onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\n\n /** determine whether the app currently has internet connectivity, if known */\n public static async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\n return this.nativeAppIpc.checkInternetConnectivity();\n }\n /** @internal */\n public static async overrideInternetConnectivity(status: InternetConnectivityStatus): Promise<void> {\n return this.nativeAppIpc.overrideInternetConnectivity(OverriddenBy.User, status);\n }\n private static _isValid = false;\n public static get isValid(): boolean { return this._isValid; }\n\n /**\n * This is called by either ElectronApp.startup or MobileApp.startup - it should not be called directly\n * @internal\n */\n public static async startup(ipc: IpcSocketFrontend, opts?: NativeAppOpts) {\n await IpcApp.startup(ipc, opts);\n if (this._isValid)\n return;\n this._isValid = true;\n\n this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend\n NativeApp.hookBrowserConnectivityEvents();\n\n // initialize current online state.\n if (window.navigator.onLine) {\n await this.setConnectivity(OverriddenBy.Browser, window.navigator.onLine ? InternetConnectivityStatus.Online : InternetConnectivityStatus.Offline);\n }\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n NativeApp.unhookBrowserConnectivityEvents();\n await NativeAppLogger.flush();\n await IpcApp.shutdown();\n this._isValid = false;\n }\n\n public static async requestDownloadBriefcase(iTwinId: string, iModelId: string, downloadOptions: DownloadBriefcaseOptions,\n asOf?: IModelVersion): Promise<BriefcaseDownloader>;\n\n public static async requestDownloadBriefcase(\n iTwinId: string,\n iModelId: string,\n downloadOptions: DownloadBriefcaseOptions,\n asOf: IModelVersion = IModelVersion.latest()\n ): Promise<BriefcaseDownloader> {\n const shouldReportProgress = !!downloadOptions.progressCallback;\n\n let stopProgressEvents = () => { };\n if (shouldReportProgress) {\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\n downloadOptions.progressCallback?.(data);\n };\n\n stopProgressEvents = IpcApp.addListener(`nativeApp.progress-${iModelId}`, handleProgress);\n }\n\n const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :\n (downloadOptions.syncMode === SyncMode.PullOnly ? 0 : await this.nativeAppIpc.acquireNewBriefcaseId(iModelId));\n\n const fileName = downloadOptions.fileName ?? await this.getBriefcaseFileName({ briefcaseId, iModelId });\n const requestProps: RequestNewBriefcaseProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };\n\n const doDownload = async (): Promise<void> => {\n try {\n await this.nativeAppIpc.downloadBriefcase(requestProps, shouldReportProgress, downloadOptions.progressInterval);\n } finally {\n stopProgressEvents();\n }\n };\n\n const requestCancel = async (): Promise<boolean> => {\n const status = await this.nativeAppIpc.requestCancelDownloadBriefcase(fileName);\n if (status)\n stopProgressEvents();\n return status;\n };\n\n return { briefcaseId, fileName, downloadPromise: doDownload(), requestCancel };\n }\n\n /** Get the full path filename for a briefcase within the briefcase cache */\n public static async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\n return this.nativeAppIpc.getBriefcaseFileName(props);\n }\n\n /** Delete an existing briefcase\n * @param fileName the briefcase fileName\n */\n public static async deleteBriefcase(fileName: string): Promise<void> {\n await this.nativeAppIpc.deleteBriefcaseFiles(fileName);\n }\n\n /** Get a list of all briefcase files held in the local briefcase cache directory */\n public static async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\n return this.nativeAppIpc.getCachedBriefcases(iModelId);\n }\n\n /**\n * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.\n * @param name Should be a local filename without an extension.\n * @returns a Promise for the [[Storage]].\n */\n public static async openStorage(name: string): Promise<Storage> {\n let storage = this._storages.get(name);\n if (!storage) {\n storage = new Storage(await this.nativeAppIpc.storageMgrOpen(name));\n this._storages.set(storage.id, storage);\n }\n \n return storage;\n }\n\n /**\n * Close a Storage and optionally delete it.\n * @param storage normally not call directly instead use Storage.close()\n * @param deleteStorage if true, delete the storage from disk after closing it.\n */\n public static async closeStorage(storage: Storage, deleteStorage: boolean = false): Promise<void> {\n if (!this._storages.has(storage.id))\n throw new Error(`Storage [Id=${storage.id}] not open`);\n\n await this.nativeAppIpc.storageMgrClose(storage.id, deleteStorage);\n this._storages.delete(storage.id);\n }\n\n /** Get the list of existing Storages on the local disk. */\n public static async getStorageNames(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageMgrNames();\n }\n}\n\n/**\n * A local disk-based cache for key value pairs for NativeApps.\n * @note This should be used only for local caching, since its not guaranteed to exist permanently.\n * @public\n */\nexport class Storage {\n constructor(public readonly id: string) { }\n\n /** get the type of a value for a key, or undefined if not present. */\n public async getValueType(key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\n return NativeApp.nativeAppIpc.storageGetValueType(this.id, key);\n }\n\n /** Get the value for a key */\n public async getData(key: string): Promise<StorageValue> {\n return NativeApp.nativeAppIpc.storageGet(this.id, key);\n }\n\n /** Set value for a key */\n public async setData(key: string, value: StorageValue): Promise<void> {\n return NativeApp.nativeAppIpc.storageSet(this.id, key, value);\n }\n\n /**\n * Return an array of all keys in this Storage.\n * @note This can be expensive, depending on the number of keys present.\n */\n public async getKeys(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageKeys(this.id);\n }\n\n /** Remove a key and its data. */\n public async removeData(key: string): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemove(this.id, key);\n }\n\n /** Remove all keys and their data. */\n public async removeAll(): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemoveAll(this.id);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAppLogger.d.ts","sourceRoot":"","sources":["../../src/NativeAppLogger.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAwB,eAA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,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe;WAIrE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe;WAIjE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;WAO5B,UAAU;CAQzB"}
@@ -25,6 +25,7 @@ export class NativeAppLogger {
25
25
  static async flushBucket(messages) {
26
26
  try {
27
27
  while (messages.length > 0) {
28
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
29
  const msg = messages.shift();
29
30
  await IpcApp.appFunctionIpc.log(msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });
30
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAppLogger.js","sourceRoot":"","sources":["../../src/NativeAppLogger.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAmB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAalC;;;GAGG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,CAAC,SAAS,GAAiB,EAAE,CAAC;IACpC,MAAM,CAAC,UAAU,CAA4B;IAC7C,MAAM,CAAC,cAAc;QAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,UAAU,GAAG,IAAI,OAAO,CAAO,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;YACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACpB,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAEO,MAAM,C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AE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAE7H,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, Logger, LoggingMetaData, LogLevel } from \"@itwin/core-bentley\";\nimport { IpcApp } from \"./IpcApp\";\n\n/**\n * Describe log message\n * @internal\n */\ninterface LogMessage {\n timestamp: number;\n level: LogLevel;\n category: string;\n message: string;\n metaData: any;\n}\n/**\n * NativeAppLogger send log message from frontend to backend. It works on native app only.\n * @internal\n */\nexport class NativeAppLogger {\n private static _messages: LogMessage[] = [];\n private static _onFlushed: Promise<void> | undefined;\n private static flushToBackend() {\n if (!this._onFlushed && this._messages.length > 0) {\n this._onFlushed = new Promise<void>(() => this._onFlushed = undefined);\n const messages = this._messages;\n this._messages = [];\n setTimeout(async () => this.flushBucket(messages));\n }\n }\n\n private static async flushBucket(messages: LogMessage[]): Promise<void> {\n try {\n while (messages.length > 0) {\n const msg: LogMessage = messages.shift()!;\n await IpcApp.appFunctionIpc.log(msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });\n }\n } finally {\n // Put back unsent messages.\n this._messages.unshift(...messages);\n if (this._messages.length > 0) {\n this.flushToBackend();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve(this._onFlushed);\n }\n }\n }\n\n private static log(level: LogLevel, category: string, message: string, metaData: LoggingMetaData) {\n this._messages.push({ timestamp: Date.now(), level, category, message, metaData: BentleyError.getMetaData(metaData) });\n this.flushToBackend();\n }\n\n public static logError(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Error, category, message, metaData);\n }\n\n public static logInfo(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Info, category, message, metaData);\n }\n\n public static logTrace(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Trace, category, message, metaData);\n }\n\n public static logWarning(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Warning, category, message, metaData);\n }\n\n public static async flush(): Promise<void> {\n this.flushToBackend();\n if (this._onFlushed) {\n return this._onFlushed;\n }\n }\n\n public static initialize() {\n const errCb = (category: string, message: string, metaData: LoggingMetaData) => this.logError(category, message, metaData);\n const warnCb = (category: string, message: string, metaData: LoggingMetaData) => this.logWarning(category, message, metaData);\n const infoCb = (category: string, message: string, metaData: LoggingMetaData) => this.logInfo(category, message, metaData);\n const traceCb = (category: string, message: string, metaData: LoggingMetaData) => this.logTrace(category, message, metaData);\n\n Logger.initialize(errCb, warnCb, infoCb, traceCb);\n }\n}\n"]}
1
+ {"version":3,"file":"NativeAppLogger.js","sourceRoot":"","sources":["../../src/NativeAppLogger.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAmB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAalC;;;GAGG;AACH,MAAM,OAAO,eAAe;IAClB,MAAM,CAAC,SAAS,GAAiB,EAAE,CAAC;IACpC,MAAM,CAAC,UAAU,CAA4B;IAC7C,MAAM,CAAC,cAAc;QAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,UAAU,GAAG,IAAI,OAAO,CAAO,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;YACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,CAAC,SAA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AyB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC3H,MAAM,OAAO,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAE,QAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAE7H,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, Logger, LoggingMetaData, LogLevel } from \"@itwin/core-bentley\";\nimport { IpcApp } from \"./IpcApp\";\n\n/**\n * Describe log message\n * @internal\n */\ninterface LogMessage {\n timestamp: number;\n level: LogLevel;\n category: string;\n message: string;\n metaData: any;\n}\n/**\n * NativeAppLogger send log message from frontend to backend. It works on native app only.\n * @internal\n */\nexport class NativeAppLogger {\n private static _messages: LogMessage[] = [];\n private static _onFlushed: Promise<void> | undefined;\n private static flushToBackend() {\n if (!this._onFlushed && this._messages.length > 0) {\n this._onFlushed = new Promise<void>(() => this._onFlushed = undefined);\n const messages = this._messages;\n this._messages = [];\n setTimeout(async () => this.flushBucket(messages));\n }\n }\n\n private static async flushBucket(messages: LogMessage[]): Promise<void> {\n try {\n while (messages.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const msg: LogMessage = messages.shift()!;\n await IpcApp.appFunctionIpc.log(msg.timestamp, msg.level, msg.category, msg.message, { ...msg.metaData });\n }\n } finally {\n // Put back unsent messages.\n this._messages.unshift(...messages);\n if (this._messages.length > 0) {\n this.flushToBackend();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve(this._onFlushed);\n }\n }\n }\n\n private static log(level: LogLevel, category: string, message: string, metaData: LoggingMetaData) {\n this._messages.push({ timestamp: Date.now(), level, category, message, metaData: BentleyError.getMetaData(metaData) });\n this.flushToBackend();\n }\n\n public static logError(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Error, category, message, metaData);\n }\n\n public static logInfo(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Info, category, message, metaData);\n }\n\n public static logTrace(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Trace, category, message, metaData);\n }\n\n public static logWarning(category: string, message: string, metaData: LoggingMetaData) {\n this.log(LogLevel.Warning, category, message, metaData);\n }\n\n public static async flush(): Promise<void> {\n this.flushToBackend();\n if (this._onFlushed) {\n return this._onFlushed;\n }\n }\n\n public static initialize() {\n const errCb = (category: string, message: string, metaData: LoggingMetaData) => this.logError(category, message, metaData);\n const warnCb = (category: string, message: string, metaData: LoggingMetaData) => this.logWarning(category, message, metaData);\n const infoCb = (category: string, message: string, metaData: LoggingMetaData) => this.logInfo(category, message, metaData);\n const traceCb = (category: string, message: string, metaData: LoggingMetaData) => this.logTrace(category, message, metaData);\n\n Logger.initialize(errCb, warnCb, infoCb, traceCb);\n }\n}\n"]}
@@ -94,16 +94,16 @@ export class PlanarClipMaskState {
94
94
  // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.
95
95
  switch (this.settings.mode) {
96
96
  case PlanarClipMaskMode.IncludeElements: {
97
- overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds, true);
97
+ overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds ?? [], true);
98
98
  return overrides;
99
99
  }
100
100
  case PlanarClipMaskMode.ExcludeElements: {
101
101
  overrides.ignoreSubCategory = true;
102
- overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds);
102
+ overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds ?? []);
103
103
  return overrides;
104
104
  }
105
105
  case PlanarClipMaskMode.IncludeSubCategories: {
106
- for (const subCategoryId of this.settings.subCategoryOrElementIds)
106
+ for (const subCategoryId of this.settings.subCategoryOrElementIds ?? [])
107
107
  overrides.setVisibleSubCategory(subCategoryId);
108
108
  return overrides;
109
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PlanarClipMaskState.js","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAuB,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACd,QAAQ,CAAyB;IACzC,aAAa,CAAuB;IACpC,UAAU,GAAG,KAAK,CAAC;IACnB,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,GAAY,OAAO,CAAC,UAAU,EAAE,CAAC;IAEnD,YAAoB,QAAgC;QAClD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAgC;QACnD,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAA0B;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAW,sBAAsB,KAAc,OAAO,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAAA,CAAC;IAE/E,iBAAiB,CAAC,KAA2B;QAClD,IAAI,IAAI,CAAC,aAAa;YACpB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB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C;YACnB,CAAC;YACD,KAAK,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC7C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAwB;oBAChE,SAAS,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;gBACjD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskProps, PlanarClipMaskSettings } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { SceneContext } from \"./ViewContext\";\nimport { Range3d } from \"@itwin/core-geometry\";\n\n/** The State of Planar Clip Mask applied to a reality model or background map.\n * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.\n * @beta\n */\nexport class PlanarClipMaskState {\n public readonly settings: PlanarClipMaskSettings;\n private _tileTreeRefs?: TileTreeReference[];\n private _allLoaded = false;\n private _usingViewportOverrides = false;\n private _maskRange: Range3d = Range3d.createNull();\n\n private constructor(settings: PlanarClipMaskSettings) {\n this.settings = settings;\n }\n\n public static create(settings: PlanarClipMaskSettings): PlanarClipMaskState {\n return new PlanarClipMaskState(settings);\n }\n\n public static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState {\n return this.create(PlanarClipMaskSettings.fromJSON(props));\n }\n\n public get usingViewportOverrides(): boolean { return this._usingViewportOverrides; };\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n if (this._tileTreeRefs)\n this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));\n }\n\n // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask, and extend the maskRange if needed.\n public getTileTrees(context: SceneContext, classifiedModelId: Id64String, maskRange: Range3d): TileTreeReference[] | undefined {\n if (this.settings.mode === PlanarClipMaskMode.Priority) {\n // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.\n // For this case, we don't need a maskRange so leave it as null.\n const viewTrees = new Array<TileTreeReference>();\n const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;\n for (const ref of context.viewport.getTileTreeRefs()) {\n const tree = ref.treeOwner.load();\n if (tree && tree.modelId !== classifiedModelId && ref.planarClipMaskPriority > thisPriority)\n viewTrees.push(ref);\n }\n\n return viewTrees;\n }\n\n // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn\n // since batched tiles cannot turn on/off individual models just by their tile tree refs.\n // Keep calling this until loaded so that the range is valid.\n if (!this._allLoaded) {\n this._tileTreeRefs = new Array<TileTreeReference>();\n if (this.settings.modelIds && context.viewport.view.isSpatialView()) {\n context.viewport.view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs, maskRange);\n }\n this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);\n maskRange.clone(this._maskRange);\n } else // If already loaded, just set the maskRange to the saved maskRange.\n this._maskRange.clone(maskRange);\n\n return this._allLoaded ? this._tileTreeRefs : undefined;\n }\n\n // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.\n public getPlanarClipMaskSymbologyOverrides(context: SceneContext, featureSymbologySource: FeatureSymbology.Source): FeatureSymbology.Overrides | undefined {\n this._usingViewportOverrides = false;\n // First obtain a list of models that will need to be turned off for drawing the planar clip mask (only used for batched tile trees).\n const overrideModels = context.viewport.view.isSpatialView() ? context.viewport.view.getModelsNotInMask(this.settings.modelIds, PlanarClipMaskMode.Priority === this.settings.mode) : undefined;\n\n const noSubCategoryOrElementIds = !this.settings.subCategoryOrElementIds;\n if (noSubCategoryOrElementIds && !overrideModels)\n return undefined;\n\n const ovrBasedOnContext = PlanarClipMaskMode.Priority === this.settings.mode || PlanarClipMaskMode.Models === this.settings.mode || noSubCategoryOrElementIds;\n const viewport = overrideModels && ovrBasedOnContext ? context.viewport : undefined;\n const overrides = FeatureSymbology.Overrides.withSource(featureSymbologySource, viewport);\n\n if (overrideModels) {\n // overrideModels is used for batched models. For those, we need to create model overrides to turn off models that are\n // not wanted in the mask (using transparency) no matter what mask mode is being used.\n const appOff = FeatureAppearance.fromTransparency(1.0);\n // For Priority or Models mode, we need to start with the current overrides and modify them\n if (ovrBasedOnContext) {\n this._usingViewportOverrides = true; // Set flag to use listener since context.viewport might change afterwards.\n overrides.addInvisibleElementOverridesToNeverDrawn(); // need this for fully trans element overrides to not participate in mask\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n return overrides;\n }\n // Otherwise, we just start with a default overrides and modify it.\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n }\n\n // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.\n switch (this.settings.mode) {\n case PlanarClipMaskMode.IncludeElements: {\n overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds!, true);\n return overrides;\n }\n case PlanarClipMaskMode.ExcludeElements: {\n overrides.ignoreSubCategory = true;\n overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds!);\n return overrides;\n }\n case PlanarClipMaskMode.IncludeSubCategories: {\n for (const subCategoryId of this.settings.subCategoryOrElementIds!)\n overrides.setVisibleSubCategory(subCategoryId);\n return overrides;\n }\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"PlanarClipMaskState.js","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAA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------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskProps, PlanarClipMaskSettings } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { SceneContext } from \"./ViewContext\";\nimport { Range3d } from \"@itwin/core-geometry\";\n\n/** The State of Planar Clip Mask applied to a reality model or background map.\n * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.\n * @beta\n */\nexport class PlanarClipMaskState {\n public readonly settings: PlanarClipMaskSettings;\n private _tileTreeRefs?: TileTreeReference[];\n private _allLoaded = false;\n private _usingViewportOverrides = false;\n private _maskRange: Range3d = Range3d.createNull();\n\n private constructor(settings: PlanarClipMaskSettings) {\n this.settings = settings;\n }\n\n public static create(settings: PlanarClipMaskSettings): PlanarClipMaskState {\n return new PlanarClipMaskState(settings);\n }\n\n public static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState {\n return this.create(PlanarClipMaskSettings.fromJSON(props));\n }\n\n public get usingViewportOverrides(): boolean { return this._usingViewportOverrides; };\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n if (this._tileTreeRefs)\n this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));\n }\n\n // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask, and extend the maskRange if needed.\n public getTileTrees(context: SceneContext, classifiedModelId: Id64String, maskRange: Range3d): TileTreeReference[] | undefined {\n if (this.settings.mode === PlanarClipMaskMode.Priority) {\n // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.\n // For this case, we don't need a maskRange so leave it as null.\n const viewTrees = new Array<TileTreeReference>();\n const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;\n for (const ref of context.viewport.getTileTreeRefs()) {\n const tree = ref.treeOwner.load();\n if (tree && tree.modelId !== classifiedModelId && ref.planarClipMaskPriority > thisPriority)\n viewTrees.push(ref);\n }\n\n return viewTrees;\n }\n\n // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn\n // since batched tiles cannot turn on/off individual models just by their tile tree refs.\n // Keep calling this until loaded so that the range is valid.\n if (!this._allLoaded) {\n this._tileTreeRefs = new Array<TileTreeReference>();\n if (this.settings.modelIds && context.viewport.view.isSpatialView()) {\n context.viewport.view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs, maskRange);\n }\n this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);\n maskRange.clone(this._maskRange);\n } else // If already loaded, just set the maskRange to the saved maskRange.\n this._maskRange.clone(maskRange);\n\n return this._allLoaded ? this._tileTreeRefs : undefined;\n }\n\n // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.\n public getPlanarClipMaskSymbologyOverrides(context: SceneContext, featureSymbologySource: FeatureSymbology.Source): FeatureSymbology.Overrides | undefined {\n this._usingViewportOverrides = false;\n // First obtain a list of models that will need to be turned off for drawing the planar clip mask (only used for batched tile trees).\n const overrideModels = context.viewport.view.isSpatialView() ? context.viewport.view.getModelsNotInMask(this.settings.modelIds, PlanarClipMaskMode.Priority === this.settings.mode) : undefined;\n\n const noSubCategoryOrElementIds = !this.settings.subCategoryOrElementIds;\n if (noSubCategoryOrElementIds && !overrideModels)\n return undefined;\n\n const ovrBasedOnContext = PlanarClipMaskMode.Priority === this.settings.mode || PlanarClipMaskMode.Models === this.settings.mode || noSubCategoryOrElementIds;\n const viewport = overrideModels && ovrBasedOnContext ? context.viewport : undefined;\n const overrides = FeatureSymbology.Overrides.withSource(featureSymbologySource, viewport);\n\n if (overrideModels) {\n // overrideModels is used for batched models. For those, we need to create model overrides to turn off models that are\n // not wanted in the mask (using transparency) no matter what mask mode is being used.\n const appOff = FeatureAppearance.fromTransparency(1.0);\n // For Priority or Models mode, we need to start with the current overrides and modify them\n if (ovrBasedOnContext) {\n this._usingViewportOverrides = true; // Set flag to use listener since context.viewport might change afterwards.\n overrides.addInvisibleElementOverridesToNeverDrawn(); // need this for fully trans element overrides to not participate in mask\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n return overrides;\n }\n // Otherwise, we just start with a default overrides and modify it.\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n }\n\n // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.\n switch (this.settings.mode) {\n case PlanarClipMaskMode.IncludeElements: {\n overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds ?? [], true);\n return overrides;\n }\n case PlanarClipMaskMode.ExcludeElements: {\n overrides.ignoreSubCategory = true;\n overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds ?? []);\n return overrides;\n }\n case PlanarClipMaskMode.IncludeSubCategories: {\n for (const subCategoryId of this.settings.subCategoryOrElementIds ?? [])\n overrides.setVisibleSubCategory(subCategoryId);\n return overrides;\n }\n }\n\n return undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionSet.d.ts","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAsB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,oBAAY,qBAAqB;IAC/B,sCAAsC;IACtC,GAAG,IAAA;IACH,0CAA0C;IAC1C,MAAM,IAAA;IACN,wEAAwE;IACxE,OAAO,IAAA;IACP,8CAA8C;IAC9C,KAAK,IAAA;CACN;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC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;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM;IAI1B;;;OAGG;IACI,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO;IAI/C;;OAEG;IACI,QAAQ,IAAI,IAAI;IAavB;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO;IA2ClD;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO;IA2CxD;;;OAGG;IACI,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO;IAgC7F,6DAA6D;IACtD,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO;IAwBpD,0DAA0D;IACnD,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO;CA2DtD;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
@@ -5,7 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module SelectionSet
7
7
  */
8
- import { BeEvent, Id64 } from "@itwin/core-bentley";
8
+ import { assert, BeEvent, Id64 } from "@itwin/core-bentley";
9
9
  import { IModelApp } from "./IModelApp";
10
10
  /** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].
11
11
  * @public
@@ -129,6 +129,7 @@ export class HiliteSet {
129
129
  this.add(set.active);
130
130
  }
131
131
  else {
132
+ assert(undefined !== this.#selectionChangesListener);
132
133
  this.#selectionChangesListener();
133
134
  this.#selectionChangesListener = undefined;
134
135
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG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G,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;QACD,IAAI,GAAG,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,EACjB,MAAM,EACN,GAAG,EACH,QAAQ,EACR,UAAU,GAMX;IACC,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QACnB,CAAC;QACD,IAAI,GAAG,OAAO,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module SelectionSet\n */\nimport { BeEvent, Id64, Id64Arg, Id64Array, Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\n\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\n * @public\n * @extensions\n */\nexport enum SelectionSetEventType {\n /** Ids have been added to the set. */\n Add,\n /** Ids have been removed from the set. */\n Remove,\n /** Some ids have been added to the set and others have been removed. */\n Replace,\n /** All ids have been removed from the set. */\n Clear,\n}\n\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are added to the selection set.\n * @public\n * @extensions\n */\nexport interface SelectAddEvent {\n type: SelectionSetEventType.Add;\n /**\n * The Ids of the elements added to the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.\n */\n added: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been added to selection set. */\n additions: SelectableIds;\n /** The affected SelectionSet. */\n set: SelectionSet;\n}\n\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are removed from the selection set.\n * @public\n * @extensions\n */\nexport interface SelectRemoveEvent {\n /** The type of operation that produced this event. */\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\n /**\n * The element Ids removed from the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.\n */\n removed: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */\n removals: SelectableIds;\n /** The affected SelectionSet. */\n set: SelectionSet;\n}\n\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are simultaneously added to and removed from the selection set.\n * @public\n * @extensions\n */\nexport interface SelectReplaceEvent {\n type: SelectionSetEventType.Replace;\n /**\n * The element Ids added to the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.\n */\n added: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been added to selection set. */\n additions: SelectableIds;\n /**\n * The element Ids removed from the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.\n */\n removed: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */\n removals: SelectableIds;\n /** The affected SelectionSet. */\n set: SelectionSet;\n}\n\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\n * ```ts\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\n * console.log(\"Added \" + (ev.additions.elements?.size ?? 0) + \" elements\");\n *\n * if (SelectionSetEventType.Add !== ev.type)\n * console.log(\"Removed \" + (ev.removals.elements?.size ?? 0) + \" elements\");\n * }\n * ```\n * @public\n * @extensions\n */\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\n\n/** Holds a set of hilited entities and makes any changes to the set by passing the change\n * function to given `change` callback.\n * @internal\n */\nclass HilitedIds extends Id64.Uint32Set {\n public constructor(private _change: (func: () => void) => void) {\n super();\n }\n\n public override add(low: number, high: number) {\n this._change(() => super.add(low, high));\n }\n\n public override delete(low: number, high: number) {\n this._change(() => super.delete(low, high));\n }\n\n public override clear() {\n this._change(() => super.clear());\n }\n\n public override addIds(ids: Id64Arg) {\n this._change(() => super.addIds(ids));\n }\n\n public override deleteIds(ids: Id64Arg) {\n this._change(() => super.deleteIds(ids));\n }\n}\n\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\n *\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\n * @public\n */\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\n\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\n *\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\n * features belonging to different subcategories.\n *\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\n *\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\n * are also responsible for removing them as appropriate.\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\n * @public\n * @extensions\n */\nexport class HiliteSet {\n #mode: ModelSubCategoryHiliteMode = \"union\";\n #selectionChangesListener?: () => void;\n #changing = false;\n\n /** The set of hilited elements. */\n public readonly elements: Id64.Uint32Set;\n\n /** The set of hilited subcategories.\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\n */\n public readonly subcategories: Id64.Uint32Set;\n\n /** The set of hilited [[GeometricModelState]]s.\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\n */\n public readonly models: Id64.Uint32Set;\n\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\n * [[elements]] is always hilited regardless of its model or subcategories.\n */\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\n return this.#mode;\n }\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\n if (mode === this.#mode) {\n return;\n }\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\n this.#mode = mode;\n }\n\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\n\n /** Construct a HiliteSet\n * @param iModel The iModel containing the entities to be hilited.\n * @param syncWithSelectionSet If true, the hilite set contents will be synchronized with those in the `iModel`'s [[SelectionSet]].\n */\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\n this.elements = new HilitedIds((func) => this.#change(func));\n this.subcategories = new HilitedIds((func) => this.#change(func));\n this.models = new HilitedIds((func) => this.#change(func));\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\n }\n\n /** Control whether the hilite set will be synchronized with the contents of the [[SelectionSet]].\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\n */\n public get wantSyncWithSelectionSet(): boolean {\n return !!this.#selectionChangesListener;\n }\n public set wantSyncWithSelectionSet(want: boolean) {\n if (want === this.wantSyncWithSelectionSet) {\n return;\n }\n if (want) {\n const set = this.iModel.selectionSet;\n this.#selectionChangesListener = set.onChanged.addListener((ev) => this.#processSelectionSetEvent(ev));\n this.add(set.active);\n } else {\n this.#selectionChangesListener!();\n this.#selectionChangesListener = undefined;\n }\n }\n\n #onChanged() {\n if (!this.#changing) {\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\n }\n }\n\n #change(func: () => void) {\n const changing = this.#changing;\n this.#changing = true;\n try {\n func();\n } finally {\n this.#changing = changing;\n }\n this.#onChanged();\n }\n\n #processSelectionSetEvent(ev: SelectionSetEvent) {\n switch (ev.type) {\n case SelectionSetEventType.Add:\n return this.add(ev.additions);\n case SelectionSetEventType.Replace:\n return this.#change(() => {\n this.add(ev.additions);\n this.remove(ev.removals);\n });\n case SelectionSetEventType.Remove:\n case SelectionSetEventType.Clear:\n return this.remove(ev.removals);\n }\n }\n\n /** Adds a collection of geometric element, model and subcategory ids to this hilite set. */\n public add(additions: SelectableIds): void {\n this.#change(() => {\n additions.elements && this.elements.addIds(additions.elements);\n additions.models && this.models.addIds(additions.models);\n additions.subcategories && this.subcategories.addIds(additions.subcategories);\n });\n }\n\n /** Removes a collection of geometric element, model and subcategory ids from this hilite set. */\n public remove(removals: SelectableIds): void {\n this.#change(() => {\n removals.elements && this.elements.deleteIds(removals.elements);\n removals.models && this.models.deleteIds(removals.models);\n removals.subcategories && this.subcategories.deleteIds(removals.subcategories);\n });\n }\n\n /** Replaces ids currently in the hilite set with the given collection. */\n public replace(ids: SelectableIds): void {\n this.#change(() => {\n this.clear();\n this.add(ids);\n });\n }\n\n /** Remove all elements from the hilited set. */\n public clear() {\n this.#change(() => {\n this.elements.clear();\n this.models.clear();\n this.subcategories.clear();\n });\n }\n\n /** Returns true if nothing is hilited. */\n public get isEmpty(): boolean {\n return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty;\n }\n\n /** Toggle the hilited state of one or more elements.\n * @param arg the ID(s) of the elements whose state is to be toggled.\n * @param onOff True to add the elements to the hilited set, false to remove them.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[add]], [[remove]], [[replace]] instead.\n */\n public setHilite(arg: Id64Arg, onOff: boolean): void {\n if (onOff) {\n this.add({ elements: arg });\n } else {\n this.remove({ elements: arg });\n }\n }\n}\n\n/** A set of *currently selected* geometric elements, models and subcategories for an `IModelConnection`.\n * Generally, selected elements are displayed with a customizable hilite effect within a [[Viewport]], see [[HiliteSet]].\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\n * @public\n * @extensions\n */\nexport class SelectionSet {\n #selection: {\n [P in keyof SelectableIds]-?: Id64Set;\n };\n\n /** The IDs of the selected elements.\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get elements(): Set<Id64String> {\n return this.#selection.elements;\n }\n\n /** The IDs of the selected models.\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get models(): Set<Id64String> {\n return this.#selection.models;\n }\n\n /** The IDs of the selected subcategories.\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get subcategories(): Set<Id64String> {\n return this.#selection.subcategories;\n }\n\n /** Get the active selection as a collection of geometric element, model and subcategory ids.\n * @note Do not modify the sets in returned collection directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get active(): { [P in keyof SelectableIds]-?: Set<Id64String> } {\n return { ...this.#selection };\n }\n\n /** Called whenever ids are added or removed from this `SelectionSet` */\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\n\n public constructor(public iModel: IModelConnection) {\n this.#selection = {\n elements: new Set(),\n models: new Set(),\n subcategories: new Set(),\n };\n }\n\n #sendChangedEvent(ev: SelectionSetEvent) {\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\n this.onChanged.raiseEvent(ev);\n }\n\n /** Get the number of entries in this selection set. */\n public get size() {\n return this.elements.size + this.models.size + this.subcategories.size;\n }\n\n /** Check whether there are any ids in this selection set. */\n public get isActive() {\n return this.elements.size > 0 || this.models.size > 0 || this.subcategories.size > 0;\n }\n\n /** Return true if elemId is in this `SelectionSet`.\n * @see [[isSelected]]\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.\n */\n public has(elemId?: string) {\n return !!elemId && this.elements.has(elemId);\n }\n\n /** Query whether an Id is in the selection set.\n * @see [[has]]\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.\n */\n public isSelected(elemId?: Id64String): boolean {\n return !!elemId && this.elements.has(elemId);\n }\n\n /** Clear current selection set.\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\n */\n public emptyAll(): void {\n if (!this.isActive) {\n return;\n }\n const removals = this.#selection;\n this.#selection = {\n elements: new Set(),\n models: new Set(),\n subcategories: new Set(),\n };\n this.#sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removals, removed: removals.elements });\n }\n\n /**\n * Add one or more Ids to the current selection set.\n * @param elem The set of Ids to add.\n * @returns true if any elements were added.\n */\n public add(adds: Id64Arg | SelectableIds): boolean {\n return !!this.#add(adds);\n }\n\n #add(adds: Id64Arg | SelectableIds, sendEvent = true): SelectableIds | undefined {\n const oldSize = this.size;\n const additions: { [P in keyof SelectableIds]: Id64Array } = {};\n forEachSelectableType({\n ids: adds,\n elements: (elementIds) =>\n addIds({\n target: this.#selection.elements,\n ids: elementIds,\n onAdd: (id) => (additions.elements ??= []).push(id),\n }),\n models: (modelIds) =>\n addIds({\n target: this.#selection.models,\n ids: modelIds,\n onAdd: (id) => (additions.models ??= []).push(id),\n }),\n subcategories: (subcategoryIds) =>\n addIds({\n target: this.#selection.subcategories,\n ids: subcategoryIds,\n onAdd: (id) => (additions.subcategories ??= []).push(id),\n }),\n });\n const changed = oldSize !== this.size;\n if (!changed) {\n return undefined;\n }\n if (sendEvent) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Add,\n set: this,\n additions,\n added: additions.elements ?? [],\n });\n }\n return additions;\n }\n\n /**\n * Remove one or more Ids from the current selection set.\n * @param elem The set of Ids to remove.\n * @returns true if any elements were removed.\n */\n public remove(removes: Id64Arg | SelectableIds): boolean {\n return !!this.#remove(removes);\n }\n\n #remove(removes: Id64Arg | SelectableIds, sendEvent = true): SelectableIds | undefined {\n const oldSize = this.size;\n const removals: { [P in keyof SelectableIds]: Id64Array } = {};\n forEachSelectableType({\n ids: removes,\n elements: (elementIds) =>\n removeIds({\n target: this.#selection.elements,\n ids: elementIds,\n onRemove: (id) => (removals.elements ??= []).push(id),\n }),\n models: (modelIds) =>\n removeIds({\n target: this.#selection.models,\n ids: modelIds,\n onRemove: (id) => (removals.models ??= []).push(id),\n }),\n subcategories: (subcategoryIds) =>\n removeIds({\n target: this.#selection.subcategories,\n ids: subcategoryIds,\n onRemove: (id) => (removals.subcategories ??= []).push(id),\n }),\n });\n const changed = oldSize !== this.size;\n if (!changed) {\n return undefined;\n }\n if (sendEvent) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Remove,\n set: this,\n removals,\n removed: removals.elements ?? [],\n });\n }\n return removals;\n }\n\n /**\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\n * @returns True if any Ids were either added or removed.\n */\n public addAndRemove(adds: Id64Arg | SelectableIds, removes: Id64Arg | SelectableIds): boolean {\n const additions = this.#add(adds, false);\n const removals = this.#remove(removes, false);\n const addedElements = additions?.elements ?? [];\n const removedElements = removals?.elements ?? [];\n if (additions && removals) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Replace,\n set: this,\n additions,\n added: addedElements,\n removals,\n removed: removedElements,\n });\n } else if (additions) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Add,\n set: this,\n additions,\n added: addedElements,\n });\n } else if (removals) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Remove,\n set: this,\n removals,\n removed: removedElements,\n });\n }\n return !!additions || !!removals;\n }\n\n /** Invert the state of a set of Ids in the `SelectionSet` */\n public invert(ids: Id64Arg | SelectableIds): boolean {\n const adds: { [P in keyof SelectableIds]: Id64Set } = {};\n const removes: { [P in keyof SelectableIds]: Id64Set } = {};\n forEachSelectableType({\n ids,\n elements: (elementIds) => {\n for (const id of Id64.iterable(elementIds)) {\n ((this.elements.has(id) ? removes : adds).elements ??= new Set()).add(id);\n }\n },\n models: (modelIds) => {\n for (const id of Id64.iterable(modelIds)) {\n ((this.models.has(id) ? removes : adds).models ??= new Set()).add(id);\n }\n },\n subcategories: (subcategoryIds) => {\n for (const id of Id64.iterable(subcategoryIds)) {\n ((this.subcategories.has(id) ? removes : adds).subcategories ??= new Set()).add(id);\n }\n },\n });\n return this.addAndRemove(adds, removes);\n }\n\n /** Change selection set to be the supplied set of Ids. */\n public replace(ids: Id64Arg | SelectableIds): boolean {\n if (areEqual(this.#selection, ids)) {\n return false;\n }\n\n const previousSelection = this.#selection;\n this.#selection = {\n elements: new Set(),\n models: new Set(),\n subcategories: new Set(),\n };\n this.#add(ids, false);\n\n const additions: { [P in keyof SelectableIds]: Id64Set } = {};\n const removals: { [P in keyof SelectableIds]: Id64Set } = {};\n forEachSelectableType({\n ids: this.#selection,\n elements: (elementIds) => {\n removeIds({\n target: previousSelection.elements,\n ids: elementIds,\n onNotFound: (id) => (additions.elements ??= new Set()).add(id),\n });\n if (previousSelection.elements.size > 0) {\n removals.elements = previousSelection.elements;\n }\n },\n models: (modelIds) => {\n removeIds({\n target: previousSelection.models,\n ids: modelIds,\n onNotFound: (id) => (additions.models ??= new Set()).add(id),\n });\n if (previousSelection.models.size > 0) {\n removals.models = previousSelection.models;\n }\n },\n subcategories: (subcategoryIds) => {\n removeIds({\n target: previousSelection.subcategories,\n ids: subcategoryIds,\n onNotFound: (id) => (additions.subcategories ??= new Set()).add(id),\n });\n if (previousSelection.subcategories.size > 0) {\n removals.subcategories = previousSelection.subcategories;\n }\n },\n });\n\n this.#sendChangedEvent({\n type: SelectionSetEventType.Replace,\n set: this,\n additions,\n added: additions.elements ?? [],\n removals,\n removed: removals.elements ?? [],\n });\n return true;\n }\n}\n\n/**\n * A collection of geometric element, model and subcategory ids that can be added to\n * a [[SelectionSet]] or [[HiliteSet]].\n * @public\n */\nexport interface SelectableIds {\n elements?: Id64Arg;\n models?: Id64Arg;\n subcategories?: Id64Arg;\n}\n\nfunction forEachSelectableType({\n ids,\n elements,\n models,\n subcategories,\n}: {\n ids: Id64Arg | SelectableIds;\n elements: (ids: Id64Arg) => void;\n models: (ids: Id64Arg) => void;\n subcategories: (ids: Id64Arg) => void;\n}): SelectableIds {\n if (typeof ids === \"string\" || Array.isArray(ids) || ids instanceof Set) {\n elements(ids);\n return { elements: ids };\n }\n elements(ids.elements ?? []);\n models(ids.models ?? []);\n subcategories(ids.subcategories ?? []);\n return ids;\n}\n\nfunction areEqual(lhs: { [P in keyof SelectableIds]-?: Id64Set }, rhs: Id64Arg | SelectableIds): boolean {\n let result = true;\n forEachSelectableType({\n ids: rhs,\n elements: (elementIds) => {\n if (result && !areIdsEqual(lhs.elements, elementIds)) {\n result = false;\n }\n },\n models: (modelIds) => {\n if (result && !areIdsEqual(lhs.models, modelIds)) {\n result = false;\n }\n },\n subcategories: (subcategoryIds) => {\n if (result && !areIdsEqual(lhs.subcategories, subcategoryIds)) {\n result = false;\n }\n },\n });\n return result;\n}\n\nfunction areIdsEqual(lhs: Set<Id64String>, rhs: Id64Arg): boolean {\n // Size is unreliable if input can contain duplicates...\n if (Array.isArray(rhs)) {\n rhs = Id64.toIdSet(rhs);\n }\n if (lhs.size !== Id64.sizeOf(rhs)) {\n return false;\n }\n for (const id of Id64.iterable(rhs)) {\n if (!lhs.has(id)) {\n return false;\n }\n }\n return true;\n}\n\nfunction addIds({ target, ids, onAdd }: { target: Id64Set; ids: Id64Arg; onAdd?: (id: Id64String) => void }) {\n let size = target.size;\n for (const id of Id64.iterable(ids)) {\n target.add(id);\n const newSize = target.size;\n if (newSize !== size) {\n onAdd?.(id);\n }\n size = newSize;\n }\n}\n\nfunction removeIds({\n target,\n ids,\n onRemove,\n onNotFound,\n}: {\n target: Id64Set;\n ids: Id64Arg;\n onRemove?: (id: Id64String) => void;\n onNotFound?: (id: Id64String) => void;\n}) {\n let size = target.size;\n for (const id of Id64.iterable(ids)) {\n target.delete(id);\n const newSize = target.size;\n if (newSize !== size) {\n onRemove?.(id);\n } else {\n onNotFound?.(id);\n }\n size = newSize;\n }\n}\n"]}
1
+ {"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAA2C,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,sCAAsC;IACtC,+DAAG,CAAA;IACH,0CAA0C;IAC1C,qEAAM,CAAA;IACN,wEAAwE;IACxE,uEAAO,CAAA;IACP,8CAA8C;IAC9C,mEAAK,CAAA;AACP,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AA6ED;;;GAGG;AACH,MAAM,UAAW,SAAQ,IAAI,CAAC,SAAS;IACV;IAA3B,YAA2B,OAAmC;QAC5D,KAAK,EAAE,CAAC;QADiB,YAAO,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;QAClB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QACnB,CAAC;QACD,IAAI,GAAG,OAAO,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module SelectionSet\n */\nimport { assert, BeEvent, Id64, Id64Arg, Id64Array, Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\n\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\n * @public\n * @extensions\n */\nexport enum SelectionSetEventType {\n /** Ids have been added to the set. */\n Add,\n /** Ids have been removed from the set. */\n Remove,\n /** Some ids have been added to the set and others have been removed. */\n Replace,\n /** All ids have been removed from the set. */\n Clear,\n}\n\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are added to the selection set.\n * @public\n * @extensions\n */\nexport interface SelectAddEvent {\n type: SelectionSetEventType.Add;\n /**\n * The Ids of the elements added to the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.\n */\n added: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been added to selection set. */\n additions: SelectableIds;\n /** The affected SelectionSet. */\n set: SelectionSet;\n}\n\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are removed from the selection set.\n * @public\n * @extensions\n */\nexport interface SelectRemoveEvent {\n /** The type of operation that produced this event. */\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\n /**\n * The element Ids removed from the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.\n */\n removed: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */\n removals: SelectableIds;\n /** The affected SelectionSet. */\n set: SelectionSet;\n}\n\n/** Passed to [[SelectionSet.onChanged]] event listeners when ids are simultaneously added to and removed from the selection set.\n * @public\n * @extensions\n */\nexport interface SelectReplaceEvent {\n type: SelectionSetEventType.Replace;\n /**\n * The element Ids added to the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.\n */\n added: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been added to selection set. */\n additions: SelectableIds;\n /**\n * The element Ids removed from the set.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.\n */\n removed: Id64Arg;\n /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */\n removals: SelectableIds;\n /** The affected SelectionSet. */\n set: SelectionSet;\n}\n\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\n * ```ts\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\n * console.log(\"Added \" + (ev.additions.elements?.size ?? 0) + \" elements\");\n *\n * if (SelectionSetEventType.Add !== ev.type)\n * console.log(\"Removed \" + (ev.removals.elements?.size ?? 0) + \" elements\");\n * }\n * ```\n * @public\n * @extensions\n */\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\n\n/** Holds a set of hilited entities and makes any changes to the set by passing the change\n * function to given `change` callback.\n * @internal\n */\nclass HilitedIds extends Id64.Uint32Set {\n public constructor(private _change: (func: () => void) => void) {\n super();\n }\n\n public override add(low: number, high: number) {\n this._change(() => super.add(low, high));\n }\n\n public override delete(low: number, high: number) {\n this._change(() => super.delete(low, high));\n }\n\n public override clear() {\n this._change(() => super.clear());\n }\n\n public override addIds(ids: Id64Arg) {\n this._change(() => super.addIds(ids));\n }\n\n public override deleteIds(ids: Id64Arg) {\n this._change(() => super.deleteIds(ids));\n }\n}\n\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\n *\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\n * @public\n */\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\n\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\n *\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\n * features belonging to different subcategories.\n *\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\n *\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\n * are also responsible for removing them as appropriate.\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\n * @public\n * @extensions\n */\nexport class HiliteSet {\n #mode: ModelSubCategoryHiliteMode = \"union\";\n #selectionChangesListener?: () => void;\n #changing = false;\n\n /** The set of hilited elements. */\n public readonly elements: Id64.Uint32Set;\n\n /** The set of hilited subcategories.\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\n */\n public readonly subcategories: Id64.Uint32Set;\n\n /** The set of hilited [[GeometricModelState]]s.\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\n */\n public readonly models: Id64.Uint32Set;\n\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\n * [[elements]] is always hilited regardless of its model or subcategories.\n */\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\n return this.#mode;\n }\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\n if (mode === this.#mode) {\n return;\n }\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\n this.#mode = mode;\n }\n\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\n\n /** Construct a HiliteSet\n * @param iModel The iModel containing the entities to be hilited.\n * @param syncWithSelectionSet If true, the hilite set contents will be synchronized with those in the `iModel`'s [[SelectionSet]].\n */\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\n this.elements = new HilitedIds((func) => this.#change(func));\n this.subcategories = new HilitedIds((func) => this.#change(func));\n this.models = new HilitedIds((func) => this.#change(func));\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\n }\n\n /** Control whether the hilite set will be synchronized with the contents of the [[SelectionSet]].\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\n */\n public get wantSyncWithSelectionSet(): boolean {\n return !!this.#selectionChangesListener;\n }\n public set wantSyncWithSelectionSet(want: boolean) {\n if (want === this.wantSyncWithSelectionSet) {\n return;\n }\n if (want) {\n const set = this.iModel.selectionSet;\n this.#selectionChangesListener = set.onChanged.addListener((ev) => this.#processSelectionSetEvent(ev));\n this.add(set.active);\n } else {\n assert(undefined !== this.#selectionChangesListener);\n this.#selectionChangesListener();\n this.#selectionChangesListener = undefined;\n }\n }\n\n #onChanged() {\n if (!this.#changing) {\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\n }\n }\n\n #change(func: () => void) {\n const changing = this.#changing;\n this.#changing = true;\n try {\n func();\n } finally {\n this.#changing = changing;\n }\n this.#onChanged();\n }\n\n #processSelectionSetEvent(ev: SelectionSetEvent) {\n switch (ev.type) {\n case SelectionSetEventType.Add:\n return this.add(ev.additions);\n case SelectionSetEventType.Replace:\n return this.#change(() => {\n this.add(ev.additions);\n this.remove(ev.removals);\n });\n case SelectionSetEventType.Remove:\n case SelectionSetEventType.Clear:\n return this.remove(ev.removals);\n }\n }\n\n /** Adds a collection of geometric element, model and subcategory ids to this hilite set. */\n public add(additions: SelectableIds): void {\n this.#change(() => {\n additions.elements && this.elements.addIds(additions.elements);\n additions.models && this.models.addIds(additions.models);\n additions.subcategories && this.subcategories.addIds(additions.subcategories);\n });\n }\n\n /** Removes a collection of geometric element, model and subcategory ids from this hilite set. */\n public remove(removals: SelectableIds): void {\n this.#change(() => {\n removals.elements && this.elements.deleteIds(removals.elements);\n removals.models && this.models.deleteIds(removals.models);\n removals.subcategories && this.subcategories.deleteIds(removals.subcategories);\n });\n }\n\n /** Replaces ids currently in the hilite set with the given collection. */\n public replace(ids: SelectableIds): void {\n this.#change(() => {\n this.clear();\n this.add(ids);\n });\n }\n\n /** Remove all elements from the hilited set. */\n public clear() {\n this.#change(() => {\n this.elements.clear();\n this.models.clear();\n this.subcategories.clear();\n });\n }\n\n /** Returns true if nothing is hilited. */\n public get isEmpty(): boolean {\n return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty;\n }\n\n /** Toggle the hilited state of one or more elements.\n * @param arg the ID(s) of the elements whose state is to be toggled.\n * @param onOff True to add the elements to the hilited set, false to remove them.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[add]], [[remove]], [[replace]] instead.\n */\n public setHilite(arg: Id64Arg, onOff: boolean): void {\n if (onOff) {\n this.add({ elements: arg });\n } else {\n this.remove({ elements: arg });\n }\n }\n}\n\n/** A set of *currently selected* geometric elements, models and subcategories for an `IModelConnection`.\n * Generally, selected elements are displayed with a customizable hilite effect within a [[Viewport]], see [[HiliteSet]].\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\n * @public\n * @extensions\n */\nexport class SelectionSet {\n #selection: {\n [P in keyof SelectableIds]-?: Id64Set;\n };\n\n /** The IDs of the selected elements.\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get elements(): Set<Id64String> {\n return this.#selection.elements;\n }\n\n /** The IDs of the selected models.\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get models(): Set<Id64String> {\n return this.#selection.models;\n }\n\n /** The IDs of the selected subcategories.\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get subcategories(): Set<Id64String> {\n return this.#selection.subcategories;\n }\n\n /** Get the active selection as a collection of geometric element, model and subcategory ids.\n * @note Do not modify the sets in returned collection directly. Instead, use methods like [[SelectionSet.add]].\n */\n public get active(): { [P in keyof SelectableIds]-?: Set<Id64String> } {\n return { ...this.#selection };\n }\n\n /** Called whenever ids are added or removed from this `SelectionSet` */\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\n\n public constructor(public iModel: IModelConnection) {\n this.#selection = {\n elements: new Set(),\n models: new Set(),\n subcategories: new Set(),\n };\n }\n\n #sendChangedEvent(ev: SelectionSetEvent) {\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\n this.onChanged.raiseEvent(ev);\n }\n\n /** Get the number of entries in this selection set. */\n public get size() {\n return this.elements.size + this.models.size + this.subcategories.size;\n }\n\n /** Check whether there are any ids in this selection set. */\n public get isActive() {\n return this.elements.size > 0 || this.models.size > 0 || this.subcategories.size > 0;\n }\n\n /** Return true if elemId is in this `SelectionSet`.\n * @see [[isSelected]]\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.\n */\n public has(elemId?: string) {\n return !!elemId && this.elements.has(elemId);\n }\n\n /** Query whether an Id is in the selection set.\n * @see [[has]]\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.\n */\n public isSelected(elemId?: Id64String): boolean {\n return !!elemId && this.elements.has(elemId);\n }\n\n /** Clear current selection set.\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\n */\n public emptyAll(): void {\n if (!this.isActive) {\n return;\n }\n const removals = this.#selection;\n this.#selection = {\n elements: new Set(),\n models: new Set(),\n subcategories: new Set(),\n };\n this.#sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removals, removed: removals.elements });\n }\n\n /**\n * Add one or more Ids to the current selection set.\n * @param elem The set of Ids to add.\n * @returns true if any elements were added.\n */\n public add(adds: Id64Arg | SelectableIds): boolean {\n return !!this.#add(adds);\n }\n\n #add(adds: Id64Arg | SelectableIds, sendEvent = true): SelectableIds | undefined {\n const oldSize = this.size;\n const additions: { [P in keyof SelectableIds]: Id64Array } = {};\n forEachSelectableType({\n ids: adds,\n elements: (elementIds) =>\n addIds({\n target: this.#selection.elements,\n ids: elementIds,\n onAdd: (id) => (additions.elements ??= []).push(id),\n }),\n models: (modelIds) =>\n addIds({\n target: this.#selection.models,\n ids: modelIds,\n onAdd: (id) => (additions.models ??= []).push(id),\n }),\n subcategories: (subcategoryIds) =>\n addIds({\n target: this.#selection.subcategories,\n ids: subcategoryIds,\n onAdd: (id) => (additions.subcategories ??= []).push(id),\n }),\n });\n const changed = oldSize !== this.size;\n if (!changed) {\n return undefined;\n }\n if (sendEvent) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Add,\n set: this,\n additions,\n added: additions.elements ?? [],\n });\n }\n return additions;\n }\n\n /**\n * Remove one or more Ids from the current selection set.\n * @param elem The set of Ids to remove.\n * @returns true if any elements were removed.\n */\n public remove(removes: Id64Arg | SelectableIds): boolean {\n return !!this.#remove(removes);\n }\n\n #remove(removes: Id64Arg | SelectableIds, sendEvent = true): SelectableIds | undefined {\n const oldSize = this.size;\n const removals: { [P in keyof SelectableIds]: Id64Array } = {};\n forEachSelectableType({\n ids: removes,\n elements: (elementIds) =>\n removeIds({\n target: this.#selection.elements,\n ids: elementIds,\n onRemove: (id) => (removals.elements ??= []).push(id),\n }),\n models: (modelIds) =>\n removeIds({\n target: this.#selection.models,\n ids: modelIds,\n onRemove: (id) => (removals.models ??= []).push(id),\n }),\n subcategories: (subcategoryIds) =>\n removeIds({\n target: this.#selection.subcategories,\n ids: subcategoryIds,\n onRemove: (id) => (removals.subcategories ??= []).push(id),\n }),\n });\n const changed = oldSize !== this.size;\n if (!changed) {\n return undefined;\n }\n if (sendEvent) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Remove,\n set: this,\n removals,\n removed: removals.elements ?? [],\n });\n }\n return removals;\n }\n\n /**\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\n * @returns True if any Ids were either added or removed.\n */\n public addAndRemove(adds: Id64Arg | SelectableIds, removes: Id64Arg | SelectableIds): boolean {\n const additions = this.#add(adds, false);\n const removals = this.#remove(removes, false);\n const addedElements = additions?.elements ?? [];\n const removedElements = removals?.elements ?? [];\n if (additions && removals) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Replace,\n set: this,\n additions,\n added: addedElements,\n removals,\n removed: removedElements,\n });\n } else if (additions) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Add,\n set: this,\n additions,\n added: addedElements,\n });\n } else if (removals) {\n this.#sendChangedEvent({\n type: SelectionSetEventType.Remove,\n set: this,\n removals,\n removed: removedElements,\n });\n }\n return !!additions || !!removals;\n }\n\n /** Invert the state of a set of Ids in the `SelectionSet` */\n public invert(ids: Id64Arg | SelectableIds): boolean {\n const adds: { [P in keyof SelectableIds]: Id64Set } = {};\n const removes: { [P in keyof SelectableIds]: Id64Set } = {};\n forEachSelectableType({\n ids,\n elements: (elementIds) => {\n for (const id of Id64.iterable(elementIds)) {\n ((this.elements.has(id) ? removes : adds).elements ??= new Set()).add(id);\n }\n },\n models: (modelIds) => {\n for (const id of Id64.iterable(modelIds)) {\n ((this.models.has(id) ? removes : adds).models ??= new Set()).add(id);\n }\n },\n subcategories: (subcategoryIds) => {\n for (const id of Id64.iterable(subcategoryIds)) {\n ((this.subcategories.has(id) ? removes : adds).subcategories ??= new Set()).add(id);\n }\n },\n });\n return this.addAndRemove(adds, removes);\n }\n\n /** Change selection set to be the supplied set of Ids. */\n public replace(ids: Id64Arg | SelectableIds): boolean {\n if (areEqual(this.#selection, ids)) {\n return false;\n }\n\n const previousSelection = this.#selection;\n this.#selection = {\n elements: new Set(),\n models: new Set(),\n subcategories: new Set(),\n };\n this.#add(ids, false);\n\n const additions: { [P in keyof SelectableIds]: Id64Set } = {};\n const removals: { [P in keyof SelectableIds]: Id64Set } = {};\n forEachSelectableType({\n ids: this.#selection,\n elements: (elementIds) => {\n removeIds({\n target: previousSelection.elements,\n ids: elementIds,\n onNotFound: (id) => (additions.elements ??= new Set()).add(id),\n });\n if (previousSelection.elements.size > 0) {\n removals.elements = previousSelection.elements;\n }\n },\n models: (modelIds) => {\n removeIds({\n target: previousSelection.models,\n ids: modelIds,\n onNotFound: (id) => (additions.models ??= new Set()).add(id),\n });\n if (previousSelection.models.size > 0) {\n removals.models = previousSelection.models;\n }\n },\n subcategories: (subcategoryIds) => {\n removeIds({\n target: previousSelection.subcategories,\n ids: subcategoryIds,\n onNotFound: (id) => (additions.subcategories ??= new Set()).add(id),\n });\n if (previousSelection.subcategories.size > 0) {\n removals.subcategories = previousSelection.subcategories;\n }\n },\n });\n\n this.#sendChangedEvent({\n type: SelectionSetEventType.Replace,\n set: this,\n additions,\n added: additions.elements ?? [],\n removals,\n removed: removals.elements ?? [],\n });\n return true;\n }\n}\n\n/**\n * A collection of geometric element, model and subcategory ids that can be added to\n * a [[SelectionSet]] or [[HiliteSet]].\n * @public\n */\nexport interface SelectableIds {\n elements?: Id64Arg;\n models?: Id64Arg;\n subcategories?: Id64Arg;\n}\n\nfunction forEachSelectableType({\n ids,\n elements,\n models,\n subcategories,\n}: {\n ids: Id64Arg | SelectableIds;\n elements: (ids: Id64Arg) => void;\n models: (ids: Id64Arg) => void;\n subcategories: (ids: Id64Arg) => void;\n}): SelectableIds {\n if (typeof ids === \"string\" || Array.isArray(ids) || ids instanceof Set) {\n elements(ids);\n return { elements: ids };\n }\n elements(ids.elements ?? []);\n models(ids.models ?? []);\n subcategories(ids.subcategories ?? []);\n return ids;\n}\n\nfunction areEqual(lhs: { [P in keyof SelectableIds]-?: Id64Set }, rhs: Id64Arg | SelectableIds): boolean {\n let result = true;\n forEachSelectableType({\n ids: rhs,\n elements: (elementIds) => {\n if (result && !areIdsEqual(lhs.elements, elementIds)) {\n result = false;\n }\n },\n models: (modelIds) => {\n if (result && !areIdsEqual(lhs.models, modelIds)) {\n result = false;\n }\n },\n subcategories: (subcategoryIds) => {\n if (result && !areIdsEqual(lhs.subcategories, subcategoryIds)) {\n result = false;\n }\n },\n });\n return result;\n}\n\nfunction areIdsEqual(lhs: Set<Id64String>, rhs: Id64Arg): boolean {\n // Size is unreliable if input can contain duplicates...\n if (Array.isArray(rhs)) {\n rhs = Id64.toIdSet(rhs);\n }\n if (lhs.size !== Id64.sizeOf(rhs)) {\n return false;\n }\n for (const id of Id64.iterable(rhs)) {\n if (!lhs.has(id)) {\n return false;\n }\n }\n return true;\n}\n\nfunction addIds({ target, ids, onAdd }: { target: Id64Set; ids: Id64Arg; onAdd?: (id: Id64String) => void }) {\n let size = target.size;\n for (const id of Id64.iterable(ids)) {\n target.add(id);\n const newSize = target.size;\n if (newSize !== size) {\n onAdd?.(id);\n }\n size = newSize;\n }\n}\n\nfunction removeIds({\n target,\n ids,\n onRemove,\n onNotFound,\n}: {\n target: Id64Set;\n ids: Id64Arg;\n onRemove?: (id: Id64String) => void;\n onNotFound?: (id: Id64String) => void;\n}) {\n let size = target.size;\n for (const id of Id64.iterable(ids)) {\n target.delete(id);\n const newSize = target.size;\n if (newSize !== size) {\n onRemove?.(id);\n } else {\n onNotFound?.(id);\n }\n size = newSize;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SheetViewState.d.ts","sourceRoot":"","sources":["../../src/SheetViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAsC,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAoD,OAAO,EAAE,OAAO,EAA4B,OAAO,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvK,OAAO,EACL,gBAAgB,EAAiF,4BAA4B,EAAE,6BAA6B,EAAmC,UAAU,EACpL,mBAAmB,EAAE,qBAAqB,EAAqB,cAAc,EACnG,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAStD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAqB,QAAQ,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACnI,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAkC,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AAwTxG;;;GAGG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,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
7
  */
8
- import { assert, CompressedId64Set, dispose } from "@itwin/core-bentley";
8
+ import { assert, CompressedId64Set, dispose, expectDefined } from "@itwin/core-bentley";
9
9
  import { Angle, ClipShape, ClipVector, Constant, Matrix3d, Point2d, Point3d, PolyfaceBuilder, Range2d, Range3d, StrokeOptions, Transform } from "@itwin/core-geometry";
10
10
  import { ColorDef, Feature, FeatureTable, Frustum, Gradient, GraphicParams, PackedFeatureTable, Placement2d, TextureTransparency, } from "@itwin/core-common";
11
11
  import { CategorySelectorState } from "./CategorySelectorState";
@@ -123,7 +123,7 @@ class ViewAttachmentsInfo {
123
123
  return new ViewAttachmentsInfo(ids);
124
124
  }
125
125
  toJSON() {
126
- return this.isLoaded ? this._props.map((x) => x.id) : [...this._ids];
126
+ return this.isLoaded ? this._props.map((x) => expectDefined(x.id)) : [...this._ids];
127
127
  }
128
128
  clone(iModel) {
129
129
  let attachments = this._attachments;
@@ -296,7 +296,7 @@ export class SheetViewState extends ViewState2d {
296
296
  const cat = new CategorySelectorState(viewStateData.categorySelectorProps, iModel);
297
297
  const displayStyleState = new DisplayStyle2dState(viewStateData.displayStyleProps, iModel);
298
298
  // use "new this" so subclasses are correct
299
- return new this(viewStateData.viewDefinitionProps, iModel, cat, displayStyleState, viewStateData.sheetProps, viewStateData.sheetAttachments);
299
+ return new this(viewStateData.viewDefinitionProps, iModel, cat, displayStyleState, expectDefined(viewStateData.sheetProps), expectDefined(viewStateData.sheetAttachments));
300
300
  }
301
301
  toProps() {
302
302
  const props = super.toProps();
@@ -399,9 +399,9 @@ export class SheetViewState extends ViewState2d {
399
399
  }
400
400
  /** @internal */
401
401
  get secondaryViewports() {
402
- const attachments = this._attachments;
403
- if (!attachments)
402
+ if (this._attachments === undefined)
404
403
  return super.secondaryViewports;
404
+ const attachments = this._attachments;
405
405
  function* iterator() {
406
406
  for (const attachment of attachments) {
407
407
  const vp = attachment.viewport;
@@ -588,7 +588,7 @@ class OrthographicAttachment {
588
588
  const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);
589
589
  origin.addInPlace(viewOrgToAttachment);
590
590
  this._toSheet = Transform.createRefs(origin, matrix);
591
- this._fromSheet = this._toSheet.inverse();
591
+ this._fromSheet = expectDefined(this._toSheet.inverse());
592
592
  // If the attached view is a section drawing, it may itself have an attached spatial view with a clip.
593
593
  // The clip needs to be transformed into sheet space.
594
594
  if (view.isDrawingView())