@itwin/core-frontend 5.11.0-dev.9 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/lib/cjs/AccuDraw.d.ts +2 -0
  3. package/lib/cjs/AccuDraw.d.ts.map +1 -1
  4. package/lib/cjs/AccuDraw.js +9 -1
  5. package/lib/cjs/AccuDraw.js.map +1 -1
  6. package/lib/cjs/BingLocation.d.ts +4 -0
  7. package/lib/cjs/BingLocation.d.ts.map +1 -1
  8. package/lib/cjs/BingLocation.js +6 -1
  9. package/lib/cjs/BingLocation.js.map +1 -1
  10. package/lib/cjs/CesiumAccessClient.d.ts +52 -0
  11. package/lib/cjs/CesiumAccessClient.d.ts.map +1 -0
  12. package/lib/cjs/CesiumAccessClient.js +10 -0
  13. package/lib/cjs/CesiumAccessClient.js.map +1 -0
  14. package/lib/cjs/DisplayStyleState.js +2 -2
  15. package/lib/cjs/DisplayStyleState.js.map +1 -1
  16. package/lib/cjs/GeoProviders.d.ts +45 -0
  17. package/lib/cjs/GeoProviders.d.ts.map +1 -0
  18. package/lib/cjs/GeoProviders.js +49 -0
  19. package/lib/cjs/GeoProviders.js.map +1 -0
  20. package/lib/cjs/GraphicalEditingScope.d.ts +22 -1
  21. package/lib/cjs/GraphicalEditingScope.d.ts.map +1 -1
  22. package/lib/cjs/GraphicalEditingScope.js +27 -1
  23. package/lib/cjs/GraphicalEditingScope.js.map +1 -1
  24. package/lib/cjs/HitDetail.d.ts +1 -1
  25. package/lib/cjs/HitDetail.d.ts.map +1 -1
  26. package/lib/cjs/HitDetail.js +10 -7
  27. package/lib/cjs/HitDetail.js.map +1 -1
  28. package/lib/cjs/IModelApp.d.ts +33 -0
  29. package/lib/cjs/IModelApp.d.ts.map +1 -1
  30. package/lib/cjs/IModelApp.js +33 -0
  31. package/lib/cjs/IModelApp.js.map +1 -1
  32. package/lib/cjs/IModelConnection.d.ts +9 -9
  33. package/lib/cjs/IModelConnection.d.ts.map +1 -1
  34. package/lib/cjs/IModelConnection.js +21 -14
  35. package/lib/cjs/IModelConnection.js.map +1 -1
  36. package/lib/cjs/IpcApp.d.ts +1 -1
  37. package/lib/cjs/IpcApp.js +1 -1
  38. package/lib/cjs/IpcApp.js.map +1 -1
  39. package/lib/cjs/NativeApp.d.ts.map +1 -1
  40. package/lib/cjs/NativeApp.js +1 -3
  41. package/lib/cjs/NativeApp.js.map +1 -1
  42. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -1
  43. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  44. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +23 -5
  45. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  46. package/lib/cjs/SelectionSet.d.ts +7 -7
  47. package/lib/cjs/SelectionSet.js +3 -3
  48. package/lib/cjs/SelectionSet.js.map +1 -1
  49. package/lib/cjs/SubCategoriesCache.d.ts +15 -3
  50. package/lib/cjs/SubCategoriesCache.d.ts.map +1 -1
  51. package/lib/cjs/SubCategoriesCache.js +98 -26
  52. package/lib/cjs/SubCategoriesCache.js.map +1 -1
  53. package/lib/cjs/ViewGlobalLocation.d.ts +1 -1
  54. package/lib/cjs/ViewGlobalLocation.d.ts.map +1 -1
  55. package/lib/cjs/ViewGlobalLocation.js +3 -6
  56. package/lib/cjs/ViewGlobalLocation.js.map +1 -1
  57. package/lib/cjs/ViewState.d.ts +1 -1
  58. package/lib/cjs/ViewState.js +1 -1
  59. package/lib/cjs/ViewState.js.map +1 -1
  60. package/lib/cjs/Viewport.d.ts +5 -4
  61. package/lib/cjs/Viewport.d.ts.map +1 -1
  62. package/lib/cjs/Viewport.js +16 -4
  63. package/lib/cjs/Viewport.js.map +1 -1
  64. package/lib/cjs/core-frontend.d.ts +3 -0
  65. package/lib/cjs/core-frontend.d.ts.map +1 -1
  66. package/lib/cjs/core-frontend.js +4 -0
  67. package/lib/cjs/core-frontend.js.map +1 -1
  68. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
  69. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  70. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +1 -1
  71. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  72. package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts +2 -2
  73. package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  74. package/lib/cjs/internal/render/webgl/AttributeBuffers.js +2 -2
  75. package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
  76. package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts +1 -1
  77. package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
  78. package/lib/cjs/internal/render/webgl/ClippingProgram.js +1 -1
  79. package/lib/cjs/internal/render/webgl/ClippingProgram.js.map +1 -1
  80. package/lib/cjs/internal/render/webgl/ShaderProgram.d.ts +2 -2
  81. package/lib/cjs/internal/render/webgl/ShaderProgram.d.ts.map +1 -1
  82. package/lib/cjs/internal/render/webgl/ShaderProgram.js +2 -2
  83. package/lib/cjs/internal/render/webgl/ShaderProgram.js.map +1 -1
  84. package/lib/cjs/internal/render/webgl/Technique.d.ts +3 -3
  85. package/lib/cjs/internal/render/webgl/Technique.d.ts.map +1 -1
  86. package/lib/cjs/internal/render/webgl/Technique.js +3 -3
  87. package/lib/cjs/internal/render/webgl/Technique.js.map +1 -1
  88. package/lib/cjs/internal/tile/DynamicIModelTile.d.ts +3 -3
  89. package/lib/cjs/internal/tile/DynamicIModelTile.d.ts.map +1 -1
  90. package/lib/cjs/internal/tile/DynamicIModelTile.js +26 -6
  91. package/lib/cjs/internal/tile/DynamicIModelTile.js.map +1 -1
  92. package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
  93. package/lib/cjs/internal/tile/IModelTileTree.js +4 -2
  94. package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
  95. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +1 -1
  96. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  97. package/lib/cjs/internal/tile/RealityModelTileTree.js +7 -3
  98. package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
  99. package/lib/cjs/internal/tile/RealityTileLoader.d.ts +22 -0
  100. package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
  101. package/lib/cjs/internal/tile/RealityTileLoader.js +53 -5
  102. package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
  103. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
  104. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  105. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
  106. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  107. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -1
  108. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  109. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -1
  110. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  111. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
  112. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
  113. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
  114. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  115. package/lib/cjs/properties/AngleDescription.d.ts +2 -1
  116. package/lib/cjs/properties/AngleDescription.d.ts.map +1 -1
  117. package/lib/cjs/properties/AngleDescription.js +4 -1
  118. package/lib/cjs/properties/AngleDescription.js.map +1 -1
  119. package/lib/cjs/properties/FormattedQuantityDescription.d.ts +29 -1
  120. package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
  121. package/lib/cjs/properties/FormattedQuantityDescription.js +35 -0
  122. package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
  123. package/lib/cjs/properties/LengthDescription.d.ts +6 -3
  124. package/lib/cjs/properties/LengthDescription.d.ts.map +1 -1
  125. package/lib/cjs/properties/LengthDescription.js +12 -3
  126. package/lib/cjs/properties/LengthDescription.js.map +1 -1
  127. package/lib/cjs/render/Decorations.d.ts +1 -1
  128. package/lib/cjs/render/Decorations.d.ts.map +1 -1
  129. package/lib/cjs/render/Decorations.js +1 -1
  130. package/lib/cjs/render/Decorations.js.map +1 -1
  131. package/lib/cjs/render/GraphicBranch.d.ts +1 -1
  132. package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
  133. package/lib/cjs/render/GraphicBranch.js +1 -1
  134. package/lib/cjs/render/GraphicBranch.js.map +1 -1
  135. package/lib/cjs/render/RenderSystem.d.ts +2 -2
  136. package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
  137. package/lib/cjs/render/RenderSystem.js +1 -1
  138. package/lib/cjs/render/RenderSystem.js.map +1 -1
  139. package/lib/cjs/render/ScreenSpaceEffectBuilder.d.ts +1 -1
  140. package/lib/cjs/render/ScreenSpaceEffectBuilder.js.map +1 -1
  141. package/lib/cjs/request/Request.d.ts +2 -2
  142. package/lib/cjs/request/Request.js.map +1 -1
  143. package/lib/cjs/tile/RealityTile.d.ts +5 -0
  144. package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
  145. package/lib/cjs/tile/RealityTile.js +4 -0
  146. package/lib/cjs/tile/RealityTile.js.map +1 -1
  147. package/lib/cjs/tile/Tile.d.ts +1 -1
  148. package/lib/cjs/tile/Tile.d.ts.map +1 -1
  149. package/lib/cjs/tile/Tile.js +1 -1
  150. package/lib/cjs/tile/Tile.js.map +1 -1
  151. package/lib/cjs/tile/TileAdmin.d.ts +23 -1
  152. package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
  153. package/lib/cjs/tile/TileAdmin.js +17 -1
  154. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  155. package/lib/cjs/tile/TileTree.d.ts +1 -1
  156. package/lib/cjs/tile/TileTree.d.ts.map +1 -1
  157. package/lib/cjs/tile/TileTree.js +1 -1
  158. package/lib/cjs/tile/TileTree.js.map +1 -1
  159. package/lib/cjs/tile/TileTreeReference.d.ts +1 -1
  160. package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
  161. package/lib/cjs/tile/TileTreeReference.js +1 -1
  162. package/lib/cjs/tile/TileTreeReference.js.map +1 -1
  163. package/lib/cjs/tile/map/BingElevation.d.ts +16 -4
  164. package/lib/cjs/tile/map/BingElevation.d.ts.map +1 -1
  165. package/lib/cjs/tile/map/BingElevation.js +18 -8
  166. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  167. package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts +16 -1
  168. package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  169. package/lib/cjs/tile/map/CesiumTerrainProvider.js +58 -18
  170. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  171. package/lib/cjs/tile/map/ImageryTileTree.d.ts +2 -2
  172. package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
  173. package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
  174. package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
  175. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +6 -1
  176. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  177. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  178. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +1 -0
  179. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  180. package/lib/cjs/tile/map/MapLayerImageryFormats.js +3 -0
  181. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  182. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +1 -1
  183. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  184. package/lib/cjs/tile/map/MapLayerImageryProvider.js +1 -1
  185. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  186. package/lib/cjs/tile/map/MapTileTree.d.ts +1 -1
  187. package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
  188. package/lib/cjs/tile/map/MapTileTree.js +20 -9
  189. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  190. package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +7 -1
  191. package/lib/cjs/tile/map/TerrainMeshProvider.d.ts.map +1 -1
  192. package/lib/cjs/tile/map/TerrainMeshProvider.js +1 -1
  193. package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
  194. package/lib/cjs/tools/AccuDrawShortcutTool.d.ts +29 -0
  195. package/lib/cjs/tools/AccuDrawShortcutTool.d.ts.map +1 -0
  196. package/lib/cjs/tools/AccuDrawShortcutTool.js +139 -0
  197. package/lib/cjs/tools/AccuDrawShortcutTool.js.map +1 -0
  198. package/lib/cjs/tools/AccuDrawTool.d.ts +13 -68
  199. package/lib/cjs/tools/AccuDrawTool.d.ts.map +1 -1
  200. package/lib/cjs/tools/AccuDrawTool.js +103 -129
  201. package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
  202. package/lib/cjs/tools/SetupCameraTools.d.ts +89 -0
  203. package/lib/cjs/tools/SetupCameraTools.d.ts.map +1 -0
  204. package/lib/cjs/tools/SetupCameraTools.js +444 -0
  205. package/lib/cjs/tools/SetupCameraTools.js.map +1 -0
  206. package/lib/cjs/tools/ToolAdmin.d.ts +5 -2
  207. package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
  208. package/lib/cjs/tools/ToolAdmin.js +30 -7
  209. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  210. package/lib/cjs/tools/ViewTool.d.ts +1 -81
  211. package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
  212. package/lib/cjs/tools/ViewTool.js +13 -410
  213. package/lib/cjs/tools/ViewTool.js.map +1 -1
  214. package/lib/esm/AccuDraw.d.ts +2 -0
  215. package/lib/esm/AccuDraw.d.ts.map +1 -1
  216. package/lib/esm/AccuDraw.js +9 -1
  217. package/lib/esm/AccuDraw.js.map +1 -1
  218. package/lib/esm/BingLocation.d.ts +4 -0
  219. package/lib/esm/BingLocation.d.ts.map +1 -1
  220. package/lib/esm/BingLocation.js +6 -1
  221. package/lib/esm/BingLocation.js.map +1 -1
  222. package/lib/esm/CesiumAccessClient.d.ts +52 -0
  223. package/lib/esm/CesiumAccessClient.d.ts.map +1 -0
  224. package/lib/esm/CesiumAccessClient.js +9 -0
  225. package/lib/esm/CesiumAccessClient.js.map +1 -0
  226. package/lib/esm/DisplayStyleState.js +2 -2
  227. package/lib/esm/DisplayStyleState.js.map +1 -1
  228. package/lib/esm/GeoProviders.d.ts +45 -0
  229. package/lib/esm/GeoProviders.d.ts.map +1 -0
  230. package/lib/esm/GeoProviders.js +45 -0
  231. package/lib/esm/GeoProviders.js.map +1 -0
  232. package/lib/esm/GraphicalEditingScope.d.ts +22 -1
  233. package/lib/esm/GraphicalEditingScope.d.ts.map +1 -1
  234. package/lib/esm/GraphicalEditingScope.js +27 -1
  235. package/lib/esm/GraphicalEditingScope.js.map +1 -1
  236. package/lib/esm/HitDetail.d.ts +1 -1
  237. package/lib/esm/HitDetail.d.ts.map +1 -1
  238. package/lib/esm/HitDetail.js +11 -8
  239. package/lib/esm/HitDetail.js.map +1 -1
  240. package/lib/esm/IModelApp.d.ts +33 -0
  241. package/lib/esm/IModelApp.d.ts.map +1 -1
  242. package/lib/esm/IModelApp.js +34 -1
  243. package/lib/esm/IModelApp.js.map +1 -1
  244. package/lib/esm/IModelConnection.d.ts +9 -9
  245. package/lib/esm/IModelConnection.d.ts.map +1 -1
  246. package/lib/esm/IModelConnection.js +21 -14
  247. package/lib/esm/IModelConnection.js.map +1 -1
  248. package/lib/esm/IpcApp.d.ts +1 -1
  249. package/lib/esm/IpcApp.js +1 -1
  250. package/lib/esm/IpcApp.js.map +1 -1
  251. package/lib/esm/NativeApp.d.ts.map +1 -1
  252. package/lib/esm/NativeApp.js +1 -3
  253. package/lib/esm/NativeApp.js.map +1 -1
  254. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -1
  255. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  256. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +24 -6
  257. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  258. package/lib/esm/SelectionSet.d.ts +7 -7
  259. package/lib/esm/SelectionSet.js +3 -3
  260. package/lib/esm/SelectionSet.js.map +1 -1
  261. package/lib/esm/SubCategoriesCache.d.ts +15 -3
  262. package/lib/esm/SubCategoriesCache.d.ts.map +1 -1
  263. package/lib/esm/SubCategoriesCache.js +99 -27
  264. package/lib/esm/SubCategoriesCache.js.map +1 -1
  265. package/lib/esm/ViewGlobalLocation.d.ts +1 -1
  266. package/lib/esm/ViewGlobalLocation.d.ts.map +1 -1
  267. package/lib/esm/ViewGlobalLocation.js +3 -6
  268. package/lib/esm/ViewGlobalLocation.js.map +1 -1
  269. package/lib/esm/ViewState.d.ts +1 -1
  270. package/lib/esm/ViewState.js +1 -1
  271. package/lib/esm/ViewState.js.map +1 -1
  272. package/lib/esm/Viewport.d.ts +5 -4
  273. package/lib/esm/Viewport.d.ts.map +1 -1
  274. package/lib/esm/Viewport.js +16 -4
  275. package/lib/esm/Viewport.js.map +1 -1
  276. package/lib/esm/core-frontend.d.ts +3 -0
  277. package/lib/esm/core-frontend.d.ts.map +1 -1
  278. package/lib/esm/core-frontend.js +6 -1
  279. package/lib/esm/core-frontend.js.map +1 -1
  280. package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
  281. package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  282. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +1 -1
  283. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  284. package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts +2 -2
  285. package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  286. package/lib/esm/internal/render/webgl/AttributeBuffers.js +2 -2
  287. package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
  288. package/lib/esm/internal/render/webgl/ClippingProgram.d.ts +1 -1
  289. package/lib/esm/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
  290. package/lib/esm/internal/render/webgl/ClippingProgram.js +1 -1
  291. package/lib/esm/internal/render/webgl/ClippingProgram.js.map +1 -1
  292. package/lib/esm/internal/render/webgl/ShaderProgram.d.ts +2 -2
  293. package/lib/esm/internal/render/webgl/ShaderProgram.d.ts.map +1 -1
  294. package/lib/esm/internal/render/webgl/ShaderProgram.js +2 -2
  295. package/lib/esm/internal/render/webgl/ShaderProgram.js.map +1 -1
  296. package/lib/esm/internal/render/webgl/Technique.d.ts +3 -3
  297. package/lib/esm/internal/render/webgl/Technique.d.ts.map +1 -1
  298. package/lib/esm/internal/render/webgl/Technique.js +3 -3
  299. package/lib/esm/internal/render/webgl/Technique.js.map +1 -1
  300. package/lib/esm/internal/tile/DynamicIModelTile.d.ts +3 -3
  301. package/lib/esm/internal/tile/DynamicIModelTile.d.ts.map +1 -1
  302. package/lib/esm/internal/tile/DynamicIModelTile.js +26 -6
  303. package/lib/esm/internal/tile/DynamicIModelTile.js.map +1 -1
  304. package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
  305. package/lib/esm/internal/tile/IModelTileTree.js +4 -2
  306. package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
  307. package/lib/esm/internal/tile/RealityModelTileTree.d.ts +1 -1
  308. package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  309. package/lib/esm/internal/tile/RealityModelTileTree.js +7 -3
  310. package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
  311. package/lib/esm/internal/tile/RealityTileLoader.d.ts +22 -0
  312. package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
  313. package/lib/esm/internal/tile/RealityTileLoader.js +54 -6
  314. package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
  315. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
  316. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  317. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
  318. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  319. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -1
  320. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  321. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -1
  322. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  323. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
  324. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
  325. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
  326. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  327. package/lib/esm/properties/AngleDescription.d.ts +2 -1
  328. package/lib/esm/properties/AngleDescription.d.ts.map +1 -1
  329. package/lib/esm/properties/AngleDescription.js +4 -1
  330. package/lib/esm/properties/AngleDescription.js.map +1 -1
  331. package/lib/esm/properties/FormattedQuantityDescription.d.ts +29 -1
  332. package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
  333. package/lib/esm/properties/FormattedQuantityDescription.js +35 -1
  334. package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
  335. package/lib/esm/properties/LengthDescription.d.ts +6 -3
  336. package/lib/esm/properties/LengthDescription.d.ts.map +1 -1
  337. package/lib/esm/properties/LengthDescription.js +12 -3
  338. package/lib/esm/properties/LengthDescription.js.map +1 -1
  339. package/lib/esm/render/Decorations.d.ts +1 -1
  340. package/lib/esm/render/Decorations.d.ts.map +1 -1
  341. package/lib/esm/render/Decorations.js +1 -1
  342. package/lib/esm/render/Decorations.js.map +1 -1
  343. package/lib/esm/render/GraphicBranch.d.ts +1 -1
  344. package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
  345. package/lib/esm/render/GraphicBranch.js +1 -1
  346. package/lib/esm/render/GraphicBranch.js.map +1 -1
  347. package/lib/esm/render/RenderSystem.d.ts +2 -2
  348. package/lib/esm/render/RenderSystem.d.ts.map +1 -1
  349. package/lib/esm/render/RenderSystem.js +1 -1
  350. package/lib/esm/render/RenderSystem.js.map +1 -1
  351. package/lib/esm/render/ScreenSpaceEffectBuilder.d.ts +1 -1
  352. package/lib/esm/render/ScreenSpaceEffectBuilder.js.map +1 -1
  353. package/lib/esm/request/Request.d.ts +2 -2
  354. package/lib/esm/request/Request.js.map +1 -1
  355. package/lib/esm/tile/RealityTile.d.ts +5 -0
  356. package/lib/esm/tile/RealityTile.d.ts.map +1 -1
  357. package/lib/esm/tile/RealityTile.js +4 -0
  358. package/lib/esm/tile/RealityTile.js.map +1 -1
  359. package/lib/esm/tile/Tile.d.ts +1 -1
  360. package/lib/esm/tile/Tile.d.ts.map +1 -1
  361. package/lib/esm/tile/Tile.js +1 -1
  362. package/lib/esm/tile/Tile.js.map +1 -1
  363. package/lib/esm/tile/TileAdmin.d.ts +23 -1
  364. package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
  365. package/lib/esm/tile/TileAdmin.js +17 -1
  366. package/lib/esm/tile/TileAdmin.js.map +1 -1
  367. package/lib/esm/tile/TileTree.d.ts +1 -1
  368. package/lib/esm/tile/TileTree.d.ts.map +1 -1
  369. package/lib/esm/tile/TileTree.js +1 -1
  370. package/lib/esm/tile/TileTree.js.map +1 -1
  371. package/lib/esm/tile/TileTreeReference.d.ts +1 -1
  372. package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
  373. package/lib/esm/tile/TileTreeReference.js +1 -1
  374. package/lib/esm/tile/TileTreeReference.js.map +1 -1
  375. package/lib/esm/tile/map/BingElevation.d.ts +16 -4
  376. package/lib/esm/tile/map/BingElevation.d.ts.map +1 -1
  377. package/lib/esm/tile/map/BingElevation.js +18 -8
  378. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  379. package/lib/esm/tile/map/CesiumTerrainProvider.d.ts +16 -1
  380. package/lib/esm/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  381. package/lib/esm/tile/map/CesiumTerrainProvider.js +56 -18
  382. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  383. package/lib/esm/tile/map/ImageryTileTree.d.ts +2 -2
  384. package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
  385. package/lib/esm/tile/map/ImageryTileTree.js +2 -2
  386. package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
  387. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +6 -1
  388. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  389. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  390. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +1 -0
  391. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  392. package/lib/esm/tile/map/MapLayerImageryFormats.js +3 -0
  393. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  394. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +1 -1
  395. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  396. package/lib/esm/tile/map/MapLayerImageryProvider.js +1 -1
  397. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  398. package/lib/esm/tile/map/MapTileTree.d.ts +1 -1
  399. package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
  400. package/lib/esm/tile/map/MapTileTree.js +21 -10
  401. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  402. package/lib/esm/tile/map/TerrainMeshProvider.d.ts +7 -1
  403. package/lib/esm/tile/map/TerrainMeshProvider.d.ts.map +1 -1
  404. package/lib/esm/tile/map/TerrainMeshProvider.js +1 -1
  405. package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
  406. package/lib/esm/tools/AccuDrawShortcutTool.d.ts +29 -0
  407. package/lib/esm/tools/AccuDrawShortcutTool.d.ts.map +1 -0
  408. package/lib/esm/tools/AccuDrawShortcutTool.js +134 -0
  409. package/lib/esm/tools/AccuDrawShortcutTool.js.map +1 -0
  410. package/lib/esm/tools/AccuDrawTool.d.ts +13 -68
  411. package/lib/esm/tools/AccuDrawTool.d.ts.map +1 -1
  412. package/lib/esm/tools/AccuDrawTool.js +102 -128
  413. package/lib/esm/tools/AccuDrawTool.js.map +1 -1
  414. package/lib/esm/tools/SetupCameraTools.d.ts +89 -0
  415. package/lib/esm/tools/SetupCameraTools.d.ts.map +1 -0
  416. package/lib/esm/tools/SetupCameraTools.js +439 -0
  417. package/lib/esm/tools/SetupCameraTools.js.map +1 -0
  418. package/lib/esm/tools/ToolAdmin.d.ts +5 -2
  419. package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
  420. package/lib/esm/tools/ToolAdmin.js +30 -7
  421. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  422. package/lib/esm/tools/ViewTool.d.ts +1 -81
  423. package/lib/esm/tools/ViewTool.d.ts.map +1 -1
  424. package/lib/esm/tools/ViewTool.js +14 -409
  425. package/lib/esm/tools/ViewTool.js.map +1 -1
  426. package/lib/public/locales/en/iModelJs.json +2 -1
  427. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  428. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  429. package/package.json +24 -23
@@ -1 +1 @@
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,GAAP,OAAO,CAA4B;IAE9D,CAAC;IAEe,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC;IAEe,MAAM,CAAC,GAAW,EAAE,IAAY;QAC9C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAEe,KAAK;QACnB,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACpC,CAAC;IAEe,MAAM,CAAC,GAAY;QACjC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAA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I,CAAC;AACd,CAAC;AAED,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAuE;IACzG,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACf,MAAM,OAAO,GAAG,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 { 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
+ {"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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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 { 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 - might be removed in next major version. 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 - might be removed in next major version. 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 - might be removed in next major version. 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 - might be removed in next major version. 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 - might be removed in next major version. 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 - might be removed in next major version. 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 - might be removed in next major version. 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,6 +1,6 @@
1
1
  import { Id64Arg, Id64Set, Id64String } from "@itwin/core-bentley";
2
2
  import { SubCategoryAppearance, SubCategoryResultRow } from "@itwin/core-common";
3
- import { IModelConnection } from "./IModelConnection";
3
+ import type { IModelConnection } from "./IModelConnection";
4
4
  /** A cancelable paginated request for subcategory information.
5
5
  * @see SubCategoriesCache
6
6
  * @internal
@@ -9,7 +9,7 @@ export interface SubCategoriesRequest {
9
9
  /** The Ids of any categories which were requested but were not yet loaded. */
10
10
  readonly missingCategoryIds: Id64Set;
11
11
  /** A promise which resolves to true when all of the requested categories have been loaded, or to false if not all categories were loaded.
12
- * Categories may fail to load if the request is explicitly canceled or if the IModelConnection is closed before all categories are loaded.
12
+ * Categories may fail to load if the request is explicitly canceled, if the IModelConnection is closed before all categories are loaded, or if the query fails.
13
13
  */
14
14
  readonly promise: Promise<boolean>;
15
15
  /** Cancels the request. */
@@ -21,10 +21,16 @@ export interface SubCategoriesRequest {
21
21
  export declare class SubCategoriesCache {
22
22
  private readonly _byCategoryId;
23
23
  private readonly _appearances;
24
+ private readonly _staleCategoryIds;
24
25
  private readonly _imodel;
25
- private _missingAtTimeOfPreload;
26
+ private _invalidationGeneration;
27
+ private readonly _onChanged;
26
28
  constructor(imodel: IModelConnection);
27
29
  attachToBriefcase(imodel: IModelConnection): void;
30
+ /** Register a listener to be notified when transaction changes invalidate cached subcategory information.
31
+ * @internal
32
+ */
33
+ addChangedListener(listener: () => void): () => void;
28
34
  /** Get the Ids of all subcategories belonging to the category with the specified Id, or undefined if no such information is present. */
29
35
  getSubCategories(categoryId: string): Id64Set | undefined;
30
36
  /** Get the base appearance of the subcategory with the specified Id, or undefined if no such information is present. */
@@ -47,6 +53,12 @@ export declare class SubCategoriesCache {
47
53
  * @internal
48
54
  */
49
55
  add(categoryId: string, subCategoryId: string, appearance: SubCategoryAppearance, override: boolean): void;
56
+ private isCategoryStale;
57
+ private markCategoryFresh;
58
+ private markAllCategoriesStale;
59
+ private markCategoriesStale;
60
+ private hasStaleCategories;
61
+ private deleteCategory;
50
62
  getCategoryInfo(inputCategoryIds: Id64String | Iterable<Id64String>): Promise<Map<Id64String, IModelConnection.Categories.CategoryInfo>>;
51
63
  getSubCategoryInfo(categoryId: Id64String, inputSubCategoryIds: Id64String | Iterable<Id64String>): Promise<Map<Id64String, IModelConnection.Categories.SubCategoryInfo>>;
52
64
  private mapSubCategoryInfos;
@@ -1 +1 @@
1
- {"version":3,"file":"SubCategoriesCache.d.ts","sourceRoot":"","sources":["../../src/SubCategoriesCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAuB,MAAM,qBAAqB,CAAC;AACzH,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;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;QAEjC,IAAW,WAAW,YAAsD;oBAEzD,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,SAAO;QAY5F,MAAM;QAEA,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;KAyBrD;IAED,KAAY,SAAS,GAAG,CAAC,sBAAsB,EAAE,OAAO,KAAK,IAAI,CAAC;IAElE,MAAa,UAAU;QACrB,SAAgB,WAAW,EAAE,OAAO,CAAC;QACrC,SAAgB,KAAK,EAAE,SAAS,EAAE,CAAC;oBAEhB,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;KAIzD;IAED;;;;;OAKG;IACH,MAAa,KAAK;QAEhB,SAAS,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;QAChC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;QAC7B,SAAS,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;QAC1C,SAAS,CAAC,SAAS,UAAS;QAE5B;;WAEG;QACI,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;QASnF,+CAA+C;QACxC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;QAW/B,IAAW,OAAO,IAAI,OAAO,CAE5B;QAED,OAAO,CAAC,WAAW;QAgBnB,OAAO,CAAC,cAAc;QAoCtB,OAAO,CAAC,QAAQ;KAgBjB;CACF"}
@@ -2,17 +2,18 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- import { assert, CompressedId64Set, Id64, OrderedId64Iterable } from "@itwin/core-bentley";
5
+ import { assert, BeEvent, CompressedId64Set, Id64, OrderedId64Iterable } from "@itwin/core-bentley";
6
6
  import { SubCategoryAppearance } from "@itwin/core-common";
7
- const invalidCategoryIdEntry = new Set();
8
7
  /** A cache of information about the subcategories contained within an [[IModelConnection]]. It is populated on demand.
9
8
  * @internal
10
9
  */
11
10
  export class SubCategoriesCache {
12
11
  _byCategoryId = new Map();
13
12
  _appearances = new Map();
13
+ _staleCategoryIds = new Set();
14
14
  _imodel;
15
- _missingAtTimeOfPreload;
15
+ _invalidationGeneration = 0;
16
+ _onChanged = new BeEvent();
16
17
  constructor(imodel) {
17
18
  this._imodel = imodel;
18
19
  }
@@ -23,36 +24,58 @@ export class SubCategoriesCache {
23
24
  assert(imodel.isBriefcaseConnection());
24
25
  imodel.txns.onElementsChanged.addListener((changes) => {
25
26
  const affectedSubCategories = new Set();
27
+ const affectedCategories = new Set();
28
+ let invalidateAllCategories = false;
29
+ let changed = false;
26
30
  for (const change of changes) {
27
31
  if (change.metadata.is("BisCore:Category")) {
28
32
  if (change.type === "deleted") {
29
- this._byCategoryId.delete(change.id);
33
+ this.deleteCategory(change.id);
34
+ changed = true;
30
35
  }
31
36
  }
32
37
  else if (change.metadata.is("BisCore:SubCategory")) {
33
38
  if (change.type === "inserted") {
34
- // We don't know to which category the subcategory belongs. Blow away the entire cache.
35
- this._byCategoryId.clear();
36
- this._appearances.clear();
37
- return;
39
+ // We don't know to which category the subcategory belongs, so every cached category may be stale.
40
+ invalidateAllCategories = true;
41
+ changed = true;
42
+ continue;
38
43
  }
39
- this._appearances.delete(change.id);
40
44
  affectedSubCategories.add(change.id);
41
45
  }
42
46
  }
43
- if (affectedSubCategories.size > 0) {
47
+ if (invalidateAllCategories) {
48
+ this.markAllCategoriesStale();
49
+ }
50
+ else if (affectedSubCategories.size > 0) {
44
51
  for (const [catId, subCatIds] of this._byCategoryId) {
45
52
  for (const subCatId of affectedSubCategories) {
46
53
  if (subCatIds.has(subCatId)) {
47
- this._byCategoryId.delete(catId);
54
+ affectedCategories.add(catId);
55
+ changed = true;
48
56
  affectedSubCategories.delete(subCatId);
49
57
  break;
50
58
  }
51
59
  }
52
60
  }
61
+ if (affectedCategories.size > 0)
62
+ this.markCategoriesStale(affectedCategories);
63
+ // If any affected subcategories were NOT found in cache and categories are currently stale,
64
+ // bump generation to invalidate in-flight reload queries that may return stale data.
65
+ if (affectedSubCategories.size > 0 && this.hasStaleCategories()) {
66
+ changed = true;
67
+ }
68
+ }
69
+ if (changed) {
70
+ this._invalidationGeneration++;
71
+ this._onChanged.raiseEvent();
53
72
  }
54
73
  });
55
74
  }
75
+ /** Register a listener to be notified when transaction changes invalidate cached subcategory information.
76
+ * @internal
77
+ */
78
+ addChangedListener(listener) { return this._onChanged.addListener(listener); }
56
79
  /** Get the Ids of all subcategories belonging to the category with the specified Id, or undefined if no such information is present. */
57
80
  getSubCategories(categoryId) { return this._byCategoryId.get(categoryId); }
58
81
  /** Get the base appearance of the subcategory with the specified Id, or undefined if no such information is present. */
@@ -67,10 +90,14 @@ export class SubCategoriesCache {
67
90
  if (undefined === missing)
68
91
  return undefined;
69
92
  const request = new SubCategoriesCache.Request(missing, this._imodel);
93
+ const generation = this._invalidationGeneration;
70
94
  const promise = request.dispatch().then((result) => {
71
- if (undefined !== result)
95
+ const completed = undefined !== result && !request.wasCanceled && generation === this._invalidationGeneration;
96
+ if (completed)
72
97
  this.processResults(result, missing);
73
- return !request.wasCanceled;
98
+ // On failure (result undefined due to query error), do NOT cache empty sets for uncached categories.
99
+ // Leave them absent so getMissing() will include them in subsequent load() retries.
100
+ return completed;
74
101
  });
75
102
  return {
76
103
  missingCategoryIds: missing,
@@ -81,9 +108,16 @@ export class SubCategoriesCache {
81
108
  /** Load all subcategories that come from used spatial categories of the iModel into the cache. */
82
109
  async loadAllUsedSpatialSubCategories() {
83
110
  try {
111
+ const generation = this._invalidationGeneration;
84
112
  const results = await this._imodel.queryAllUsedSpatialSubCategories();
85
- if (undefined !== results) {
86
- this.processResults(results, new Set(), false);
113
+ if (generation === this._invalidationGeneration && undefined !== results) {
114
+ const staleCategories = new Set(this._staleCategoryIds);
115
+ // This preload can return partial results on very large iModels, so keep stale categories additive and
116
+ // preserve their stale state until a targeted reload can fully reconcile them.
117
+ for (const row of results)
118
+ this.add(row.parentId, row.id, SubCategoriesCache.createSubCategoryAppearance(row.appearance), staleCategories.has(row.parentId));
119
+ if (staleCategories.size > 0)
120
+ this.markCategoriesStale(staleCategories);
87
121
  }
88
122
  }
89
123
  catch {
@@ -94,7 +128,7 @@ export class SubCategoriesCache {
94
128
  getMissing(categoryIds) {
95
129
  let missing;
96
130
  for (const catId of Id64.iterable(categoryIds)) {
97
- if (undefined === this._byCategoryId.get(catId)) {
131
+ if (undefined === this._byCategoryId.get(catId) || this.isCategoryStale(catId)) {
98
132
  if (undefined === missing)
99
133
  missing = new Set();
100
134
  missing.add(catId);
@@ -105,6 +139,8 @@ export class SubCategoriesCache {
105
139
  clear() {
106
140
  this._byCategoryId.clear();
107
141
  this._appearances.clear();
142
+ this._staleCategoryIds.clear();
143
+ this._invalidationGeneration++;
108
144
  }
109
145
  onIModelConnectionClose() {
110
146
  this.clear();
@@ -115,14 +151,25 @@ export class SubCategoriesCache {
115
151
  props = JSON.parse(json);
116
152
  return new SubCategoryAppearance(props);
117
153
  }
118
- processResults(result, missing, override = true) {
154
+ processResults(result, refreshedCategoryIds, override = true) {
155
+ const previousSubCategoryIds = new Map();
156
+ for (const id of refreshedCategoryIds) {
157
+ const previous = this._byCategoryId.get(id);
158
+ if (undefined !== previous)
159
+ previousSubCategoryIds.set(id, previous);
160
+ this._byCategoryId.set(id, new Set());
161
+ this.markCategoryFresh(id);
162
+ }
119
163
  for (const row of result) {
120
164
  this.add(row.parentId, row.id, SubCategoriesCache.createSubCategoryAppearance(row.appearance), override);
121
165
  }
122
- // Ensure that any category Ids which returned no results (e.g., non-existent category, invalid Id, etc) are still recorded so they are not repeatedly re-requested
123
- for (const id of missing)
124
- if (undefined === this._byCategoryId.get(id))
125
- this._byCategoryId.set(id, invalidCategoryIdEntry);
166
+ for (const [categoryId, previous] of previousSubCategoryIds) {
167
+ const current = this._byCategoryId.get(categoryId);
168
+ for (const subCategoryId of previous) {
169
+ if (!current?.has(subCategoryId))
170
+ this._appearances.delete(subCategoryId);
171
+ }
172
+ }
126
173
  }
127
174
  /** Exposed strictly for tests.
128
175
  * @internal
@@ -132,9 +179,38 @@ export class SubCategoriesCache {
132
179
  if (undefined === set)
133
180
  this._byCategoryId.set(categoryId, set = new Set());
134
181
  set.add(subCategoryId);
182
+ this.markCategoryFresh(categoryId);
135
183
  if (override || !this._appearances.has(subCategoryId))
136
184
  this._appearances.set(subCategoryId, appearance);
137
185
  }
186
+ isCategoryStale(categoryId) {
187
+ return this._staleCategoryIds.has(categoryId);
188
+ }
189
+ markCategoryFresh(categoryId) {
190
+ this._staleCategoryIds.delete(categoryId);
191
+ }
192
+ markAllCategoriesStale() {
193
+ // We don't know which cached category the inserted subcategory belongs to, so every currently-cached
194
+ // category may now be missing a subcategory. Mark them all stale so they are re-requested on next load.
195
+ // Categories cached after this point are loaded fresh and are intentionally left out.
196
+ for (const categoryId of this._byCategoryId.keys())
197
+ this._staleCategoryIds.add(categoryId);
198
+ }
199
+ markCategoriesStale(categoryIds) {
200
+ for (const categoryId of categoryIds)
201
+ this._staleCategoryIds.add(categoryId);
202
+ }
203
+ hasStaleCategories() {
204
+ return this._staleCategoryIds.size > 0;
205
+ }
206
+ deleteCategory(categoryId) {
207
+ const subCategoryIds = this._byCategoryId.get(categoryId);
208
+ if (undefined !== subCategoryIds)
209
+ for (const subCategoryId of subCategoryIds)
210
+ this._appearances.delete(subCategoryId);
211
+ this._byCategoryId.delete(categoryId);
212
+ this._staleCategoryIds.delete(categoryId);
213
+ }
138
214
  async getCategoryInfo(inputCategoryIds) {
139
215
  // Eliminate duplicates...
140
216
  const categoryIds = new Set(typeof inputCategoryIds === "string" ? [inputCategoryIds] : inputCategoryIds);
@@ -144,9 +220,7 @@ export class SubCategoriesCache {
144
220
  const map = new Map();
145
221
  for (const categoryId of categoryIds) {
146
222
  const subCategoryIds = this._byCategoryId.get(categoryId);
147
- if (!subCategoryIds)
148
- continue;
149
- const subCategories = this.mapSubCategoryInfos(categoryId, subCategoryIds);
223
+ const subCategories = undefined !== subCategoryIds ? this.mapSubCategoryInfos(categoryId, subCategoryIds) : new Map();
150
224
  map.set(categoryId, { id: categoryId, subCategories });
151
225
  }
152
226
  return map;
@@ -202,9 +276,7 @@ export class SubCategoriesCache {
202
276
  return undefined;
203
277
  }
204
278
  catch {
205
- // ###TODO: detect cases in which retry is warranted
206
- // Note that currently, if we succeed in obtaining some pages of results and fail to retrieve another page, we will end up processing the
207
- // incomplete results. Since we're not retrying, that's the best we can do.
279
+ return undefined;
208
280
  }
209
281
  // Finished with current batch of categoryIds. Dispatch the next batch if one exists.
210
282
  if (++this._curCategoryIdsIndex < this._categoryIds.length) {