@itwin/core-frontend 5.2.0-dev.3 → 5.2.0-dev.31

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 (701) hide show
  1. package/CHANGELOG.md +76 -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 +5 -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.d.ts +3 -0
  58. package/lib/cjs/PlanarClipMaskState.d.ts.map +1 -1
  59. package/lib/cjs/PlanarClipMaskState.js +8 -4
  60. package/lib/cjs/PlanarClipMaskState.js.map +1 -1
  61. package/lib/cjs/RealityDataSource.d.ts.map +1 -1
  62. package/lib/cjs/RealityDataSource.js +5 -1
  63. package/lib/cjs/RealityDataSource.js.map +1 -1
  64. package/lib/cjs/SelectionSet.d.ts.map +1 -1
  65. package/lib/cjs/SelectionSet.js +1 -0
  66. package/lib/cjs/SelectionSet.js.map +1 -1
  67. package/lib/cjs/SheetViewState.d.ts.map +1 -1
  68. package/lib/cjs/SheetViewState.js +5 -5
  69. package/lib/cjs/SheetViewState.js.map +1 -1
  70. package/lib/cjs/SpatialViewState.d.ts.map +1 -1
  71. package/lib/cjs/SpatialViewState.js +1 -1
  72. package/lib/cjs/SpatialViewState.js.map +1 -1
  73. package/lib/cjs/Sprites.js +2 -2
  74. package/lib/cjs/Sprites.js.map +1 -1
  75. package/lib/cjs/TentativePoint.d.ts.map +1 -1
  76. package/lib/cjs/TentativePoint.js +10 -9
  77. package/lib/cjs/TentativePoint.js.map +1 -1
  78. package/lib/cjs/ViewContext.d.ts +10 -1
  79. package/lib/cjs/ViewContext.d.ts.map +1 -1
  80. package/lib/cjs/ViewContext.js +12 -1
  81. package/lib/cjs/ViewContext.js.map +1 -1
  82. package/lib/cjs/ViewCreator2d.js +1 -1
  83. package/lib/cjs/ViewCreator2d.js.map +1 -1
  84. package/lib/cjs/ViewCreator3d.js +1 -1
  85. package/lib/cjs/ViewCreator3d.js.map +1 -1
  86. package/lib/cjs/ViewPose.d.ts.map +1 -1
  87. package/lib/cjs/ViewPose.js +4 -1
  88. package/lib/cjs/ViewPose.js.map +1 -1
  89. package/lib/cjs/ViewState.d.ts.map +1 -1
  90. package/lib/cjs/ViewState.js +17 -12
  91. package/lib/cjs/ViewState.js.map +1 -1
  92. package/lib/cjs/ViewingSpace.d.ts.map +1 -1
  93. package/lib/cjs/ViewingSpace.js +2 -0
  94. package/lib/cjs/ViewingSpace.js.map +1 -1
  95. package/lib/cjs/Viewport.d.ts.map +1 -1
  96. package/lib/cjs/Viewport.js +17 -10
  97. package/lib/cjs/Viewport.js.map +1 -1
  98. package/lib/cjs/common/ImageUtil.d.ts.map +1 -1
  99. package/lib/cjs/common/ImageUtil.js +2 -1
  100. package/lib/cjs/common/ImageUtil.js.map +1 -1
  101. package/lib/cjs/common/internal/render/GeometryAccumulator.d.ts.map +1 -1
  102. package/lib/cjs/common/internal/render/GeometryAccumulator.js +4 -3
  103. package/lib/cjs/common/internal/render/GeometryAccumulator.js.map +1 -1
  104. package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.d.ts.map +1 -1
  105. package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.js +2 -0
  106. package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.js.map +1 -1
  107. package/lib/cjs/common/internal/render/MeshBuilder.js +1 -1
  108. package/lib/cjs/common/internal/render/MeshBuilder.js.map +1 -1
  109. package/lib/cjs/common/internal/render/VertexTableBuilder.d.ts.map +1 -1
  110. package/lib/cjs/common/internal/render/VertexTableBuilder.js +16 -7
  111. package/lib/cjs/common/internal/render/VertexTableBuilder.js.map +1 -1
  112. package/lib/cjs/extension/ExtensionAdmin.js +2 -2
  113. package/lib/cjs/extension/ExtensionAdmin.js.map +1 -1
  114. package/lib/cjs/internal/GoogleMapsDecorator.js +7 -7
  115. package/lib/cjs/internal/GoogleMapsDecorator.js.map +1 -1
  116. package/lib/cjs/internal/ScriptUtils.js +1 -0
  117. package/lib/cjs/internal/ScriptUtils.js.map +1 -1
  118. package/lib/cjs/internal/cross-package.d.ts +1 -1
  119. package/lib/cjs/internal/cross-package.d.ts.map +1 -1
  120. package/lib/cjs/internal/cross-package.js +2 -1
  121. package/lib/cjs/internal/cross-package.js.map +1 -1
  122. package/lib/cjs/internal/render/UpsampleRealityMeshParams.d.ts.map +1 -1
  123. package/lib/cjs/internal/render/UpsampleRealityMeshParams.js +2 -1
  124. package/lib/cjs/internal/render/UpsampleRealityMeshParams.js.map +1 -1
  125. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  126. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +7 -2
  127. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  128. package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  129. package/lib/cjs/internal/render/webgl/AttributeBuffers.js +5 -3
  130. package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
  131. package/lib/cjs/internal/render/webgl/AttributeMap.d.ts.map +1 -1
  132. package/lib/cjs/internal/render/webgl/AttributeMap.js +2 -0
  133. package/lib/cjs/internal/render/webgl/AttributeMap.js.map +1 -1
  134. package/lib/cjs/internal/render/webgl/BackgroundMapDrape.d.ts.map +1 -1
  135. package/lib/cjs/internal/render/webgl/BackgroundMapDrape.js +3 -3
  136. package/lib/cjs/internal/render/webgl/BackgroundMapDrape.js.map +1 -1
  137. package/lib/cjs/internal/render/webgl/BatchUniforms.d.ts +4 -1
  138. package/lib/cjs/internal/render/webgl/BatchUniforms.d.ts.map +1 -1
  139. package/lib/cjs/internal/render/webgl/BatchUniforms.js +16 -5
  140. package/lib/cjs/internal/render/webgl/BatchUniforms.js.map +1 -1
  141. package/lib/cjs/internal/render/webgl/BranchState.d.ts.map +1 -1
  142. package/lib/cjs/internal/render/webgl/BranchState.js +2 -1
  143. package/lib/cjs/internal/render/webgl/BranchState.js.map +1 -1
  144. package/lib/cjs/internal/render/webgl/BranchUniforms.js +2 -2
  145. package/lib/cjs/internal/render/webgl/BranchUniforms.js.map +1 -1
  146. package/lib/cjs/internal/render/webgl/CachedGeometry.d.ts.map +1 -1
  147. package/lib/cjs/internal/render/webgl/CachedGeometry.js +2 -2
  148. package/lib/cjs/internal/render/webgl/CachedGeometry.js.map +1 -1
  149. package/lib/cjs/internal/render/webgl/ClipStack.js +1 -1
  150. package/lib/cjs/internal/render/webgl/ClipStack.js.map +1 -1
  151. package/lib/cjs/internal/render/webgl/ColorInfo.js +1 -1
  152. package/lib/cjs/internal/render/webgl/ColorInfo.js.map +1 -1
  153. package/lib/cjs/internal/render/webgl/Contours.js +3 -3
  154. package/lib/cjs/internal/render/webgl/Contours.js.map +1 -1
  155. package/lib/cjs/internal/render/webgl/EDL.js +18 -18
  156. package/lib/cjs/internal/render/webgl/EDL.js.map +1 -1
  157. package/lib/cjs/internal/render/webgl/FeatureOverrides.d.ts +3 -3
  158. package/lib/cjs/internal/render/webgl/FeatureOverrides.d.ts.map +1 -1
  159. package/lib/cjs/internal/render/webgl/FeatureOverrides.js +14 -14
  160. package/lib/cjs/internal/render/webgl/FeatureOverrides.js.map +1 -1
  161. package/lib/cjs/internal/render/webgl/FrameBuffer.js +3 -3
  162. package/lib/cjs/internal/render/webgl/FrameBuffer.js.map +1 -1
  163. package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
  164. package/lib/cjs/internal/render/webgl/FrustumUniforms.js +2 -1
  165. package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
  166. package/lib/cjs/internal/render/webgl/GLTimer.d.ts.map +1 -1
  167. package/lib/cjs/internal/render/webgl/GLTimer.js +2 -0
  168. package/lib/cjs/internal/render/webgl/GLTimer.js.map +1 -1
  169. package/lib/cjs/internal/render/webgl/Graphic.d.ts +3 -3
  170. package/lib/cjs/internal/render/webgl/Graphic.d.ts.map +1 -1
  171. package/lib/cjs/internal/render/webgl/Graphic.js +7 -7
  172. package/lib/cjs/internal/render/webgl/Graphic.js.map +1 -1
  173. package/lib/cjs/internal/render/webgl/MapLayerParams.js +2 -2
  174. package/lib/cjs/internal/render/webgl/MapLayerParams.js.map +1 -1
  175. package/lib/cjs/internal/render/webgl/MeshData.js +2 -2
  176. package/lib/cjs/internal/render/webgl/MeshData.js.map +1 -1
  177. package/lib/cjs/internal/render/webgl/PerformanceMetrics.js +1 -1
  178. package/lib/cjs/internal/render/webgl/PerformanceMetrics.js.map +1 -1
  179. package/lib/cjs/internal/render/webgl/PlanarClassifier.d.ts +1 -0
  180. package/lib/cjs/internal/render/webgl/PlanarClassifier.d.ts.map +1 -1
  181. package/lib/cjs/internal/render/webgl/PlanarClassifier.js +27 -11
  182. package/lib/cjs/internal/render/webgl/PlanarClassifier.js.map +1 -1
  183. package/lib/cjs/internal/render/webgl/PlanarGrid.js +1 -1
  184. package/lib/cjs/internal/render/webgl/PlanarGrid.js.map +1 -1
  185. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.d.ts +0 -3
  186. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
  187. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.js +6 -5
  188. package/lib/cjs/internal/render/webgl/PlanarTextureProjection.js.map +1 -1
  189. package/lib/cjs/internal/render/webgl/PointCloud.js +1 -1
  190. package/lib/cjs/internal/render/webgl/PointCloud.js.map +1 -1
  191. package/lib/cjs/internal/render/webgl/RealityMesh.js +1 -1
  192. package/lib/cjs/internal/render/webgl/RealityMesh.js.map +1 -1
  193. package/lib/cjs/internal/render/webgl/RenderBuffer.js +2 -2
  194. package/lib/cjs/internal/render/webgl/RenderBuffer.js.map +1 -1
  195. package/lib/cjs/internal/render/webgl/RenderCommands.d.ts +2 -1
  196. package/lib/cjs/internal/render/webgl/RenderCommands.d.ts.map +1 -1
  197. package/lib/cjs/internal/render/webgl/RenderCommands.js +3 -1
  198. package/lib/cjs/internal/render/webgl/RenderCommands.js.map +1 -1
  199. package/lib/cjs/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
  200. package/lib/cjs/internal/render/webgl/SceneCompositor.js +118 -85
  201. package/lib/cjs/internal/render/webgl/SceneCompositor.js.map +1 -1
  202. package/lib/cjs/internal/render/webgl/ScratchDrawParams.d.ts.map +1 -1
  203. package/lib/cjs/internal/render/webgl/ScratchDrawParams.js +11 -10
  204. package/lib/cjs/internal/render/webgl/ScratchDrawParams.js.map +1 -1
  205. package/lib/cjs/internal/render/webgl/ScreenSpaceEffect.js +3 -3
  206. package/lib/cjs/internal/render/webgl/ScreenSpaceEffect.js.map +1 -1
  207. package/lib/cjs/internal/render/webgl/ShaderProgram.js +3 -3
  208. package/lib/cjs/internal/render/webgl/ShaderProgram.js.map +1 -1
  209. package/lib/cjs/internal/render/webgl/ShadowUniforms.d.ts.map +1 -1
  210. package/lib/cjs/internal/render/webgl/ShadowUniforms.js +2 -1
  211. package/lib/cjs/internal/render/webgl/ShadowUniforms.js.map +1 -1
  212. package/lib/cjs/internal/render/webgl/SolarShadowMap.d.ts.map +1 -1
  213. package/lib/cjs/internal/render/webgl/SolarShadowMap.js +6 -4
  214. package/lib/cjs/internal/render/webgl/SolarShadowMap.js.map +1 -1
  215. package/lib/cjs/internal/render/webgl/System.d.ts.map +1 -1
  216. package/lib/cjs/internal/render/webgl/System.js +1 -1
  217. package/lib/cjs/internal/render/webgl/System.js.map +1 -1
  218. package/lib/cjs/internal/render/webgl/Target.d.ts.map +1 -1
  219. package/lib/cjs/internal/render/webgl/Target.js +12 -9
  220. package/lib/cjs/internal/render/webgl/Target.js.map +1 -1
  221. package/lib/cjs/internal/render/webgl/Texture.d.ts.map +1 -1
  222. package/lib/cjs/internal/render/webgl/Texture.js +10 -8
  223. package/lib/cjs/internal/render/webgl/Texture.js.map +1 -1
  224. package/lib/cjs/internal/render/webgl/VisibleTileFeatures.js +1 -1
  225. package/lib/cjs/internal/render/webgl/VisibleTileFeatures.js.map +1 -1
  226. package/lib/cjs/internal/render/webgl/glsl/Animation.d.ts.map +1 -1
  227. package/lib/cjs/internal/render/webgl/glsl/Animation.js +4 -2
  228. package/lib/cjs/internal/render/webgl/glsl/Animation.js.map +1 -1
  229. package/lib/cjs/internal/render/webgl/glsl/Color.d.ts.map +1 -1
  230. package/lib/cjs/internal/render/webgl/glsl/Color.js +2 -1
  231. package/lib/cjs/internal/render/webgl/glsl/Color.js.map +1 -1
  232. package/lib/cjs/internal/render/webgl/glsl/Composite.js +1 -1
  233. package/lib/cjs/internal/render/webgl/glsl/Composite.js.map +1 -1
  234. package/lib/cjs/internal/render/webgl/glsl/CopyStencil.d.ts.map +1 -1
  235. package/lib/cjs/internal/render/webgl/glsl/CopyStencil.js +3 -2
  236. package/lib/cjs/internal/render/webgl/glsl/CopyStencil.js.map +1 -1
  237. package/lib/cjs/internal/render/webgl/glsl/PlanarClassification.js +3 -3
  238. package/lib/cjs/internal/render/webgl/glsl/PlanarClassification.js.map +1 -1
  239. package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.d.ts.map +1 -1
  240. package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.js +4 -3
  241. package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.js.map +1 -1
  242. package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js +8 -8
  243. package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js.map +1 -1
  244. package/lib/cjs/internal/render/webgl/glsl/Surface.js +10 -10
  245. package/lib/cjs/internal/render/webgl/glsl/Surface.js.map +1 -1
  246. package/lib/cjs/internal/render/webgl/glsl/Vertex.js +2 -2
  247. package/lib/cjs/internal/render/webgl/glsl/Vertex.js.map +1 -1
  248. package/lib/cjs/internal/tile/B3dmReader.d.ts.map +1 -1
  249. package/lib/cjs/internal/tile/B3dmReader.js +1 -1
  250. package/lib/cjs/internal/tile/B3dmReader.js.map +1 -1
  251. package/lib/cjs/internal/tile/DynamicIModelTile.js +1 -0
  252. package/lib/cjs/internal/tile/DynamicIModelTile.js.map +1 -1
  253. package/lib/cjs/internal/tile/FetchCloudStorage.js +1 -1
  254. package/lib/cjs/internal/tile/FetchCloudStorage.js.map +1 -1
  255. package/lib/cjs/internal/tile/LRUTileList.d.ts.map +1 -1
  256. package/lib/cjs/internal/tile/LRUTileList.js +4 -0
  257. package/lib/cjs/internal/tile/LRUTileList.js.map +1 -1
  258. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
  259. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js +2 -1
  260. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
  261. package/lib/cjs/internal/tile/OPCFormatInterpreter.js +4 -4
  262. package/lib/cjs/internal/tile/OPCFormatInterpreter.js.map +1 -1
  263. package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
  264. package/lib/cjs/internal/tile/OrbitGtTileTree.js +2 -2
  265. package/lib/cjs/internal/tile/OrbitGtTileTree.js.map +1 -1
  266. package/lib/cjs/internal/tile/PrimaryTileTree.d.ts +2 -0
  267. package/lib/cjs/internal/tile/PrimaryTileTree.d.ts.map +1 -1
  268. package/lib/cjs/internal/tile/PrimaryTileTree.js +17 -12
  269. package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
  270. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  271. package/lib/cjs/internal/tile/RealityModelTileTree.js +3 -3
  272. package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
  273. package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
  274. package/lib/cjs/internal/tile/RealityTileLoader.js +3 -0
  275. package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
  276. package/lib/cjs/internal/tile/ThreeDTileFormatInterpreter.js +3 -3
  277. package/lib/cjs/internal/tile/ThreeDTileFormatInterpreter.js.map +1 -1
  278. package/lib/cjs/internal/tile/TileUserSet.d.ts.map +1 -1
  279. package/lib/cjs/internal/tile/TileUserSet.js +4 -0
  280. package/lib/cjs/internal/tile/TileUserSet.js.map +1 -1
  281. package/lib/cjs/internal/tile/map/ArcGISTileMap.js +1 -1
  282. package/lib/cjs/internal/tile/map/ArcGISTileMap.js.map +1 -1
  283. package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
  284. package/lib/cjs/internal/tile/map/ArcGisUtilities.js +4 -0
  285. package/lib/cjs/internal/tile/map/ArcGisUtilities.js.map +1 -1
  286. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  287. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
  288. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  289. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
  290. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  291. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +1 -1
  292. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  293. package/lib/cjs/internal/tile/map/MapTileAvailability.d.ts.map +1 -1
  294. package/lib/cjs/internal/tile/map/MapTileAvailability.js +5 -2
  295. package/lib/cjs/internal/tile/map/MapTileAvailability.js.map +1 -1
  296. package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
  297. package/lib/cjs/internal/tile/map/WmtsCapabilities.js +3 -2
  298. package/lib/cjs/internal/tile/map/WmtsCapabilities.js.map +1 -1
  299. package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
  300. package/lib/cjs/properties/FormattedQuantityDescription.js +2 -0
  301. package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
  302. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.d.ts.map +1 -1
  303. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js +2 -0
  304. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
  305. package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  306. package/lib/cjs/quantity-formatting/QuantityFormatter.js +5 -3
  307. package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
  308. package/lib/cjs/tile/GltfReader.d.ts +5 -2
  309. package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
  310. package/lib/cjs/tile/GltfReader.js +69 -17
  311. package/lib/cjs/tile/GltfReader.js.map +1 -1
  312. package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
  313. package/lib/cjs/tile/RealityTile.js +2 -2
  314. package/lib/cjs/tile/RealityTile.js.map +1 -1
  315. package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
  316. package/lib/cjs/tile/RealityTileTree.js +5 -5
  317. package/lib/cjs/tile/RealityTileTree.js.map +1 -1
  318. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  319. package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
  320. package/lib/cjs/tile/TileDrawArgs.js +2 -1
  321. package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
  322. package/lib/cjs/tile/map/ImageryTileTree.js +1 -1
  323. package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
  324. package/lib/cjs/tile/map/MapLayerFormatRegistry.js +1 -1
  325. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  326. package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
  327. package/lib/cjs/tile/map/MapLayerSources.js +9 -1
  328. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  329. package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
  330. package/lib/cjs/tile/map/MapTile.js +10 -8
  331. package/lib/cjs/tile/map/MapTile.js.map +1 -1
  332. package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
  333. package/lib/cjs/tile/map/MapTileTree.js +8 -7
  334. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  335. package/lib/cjs/tile/map/MapTilingScheme.d.ts.map +1 -1
  336. package/lib/cjs/tile/map/MapTilingScheme.js +2 -1
  337. package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
  338. package/lib/cjs/tools/Tool.js +1 -1
  339. package/lib/cjs/tools/Tool.js.map +1 -1
  340. package/lib/cjs/tools/ToolAdmin.d.ts +5 -0
  341. package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
  342. package/lib/cjs/tools/ToolAdmin.js +9 -0
  343. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  344. package/lib/cjs/workers/ImdlParser/webpack.config.js +8 -0
  345. package/lib/esm/BackgroundMapGeometry.js +14 -14
  346. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  347. package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
  348. package/lib/esm/BriefcaseConnection.js +2 -2
  349. package/lib/esm/BriefcaseConnection.js.map +1 -1
  350. package/lib/esm/CheckpointConnection.d.ts.map +1 -1
  351. package/lib/esm/CheckpointConnection.js +4 -4
  352. package/lib/esm/CheckpointConnection.js.map +1 -1
  353. package/lib/esm/ContextRealityModelState.js.map +1 -1
  354. package/lib/esm/ElementLocateManager.d.ts.map +1 -1
  355. package/lib/esm/ElementLocateManager.js +8 -7
  356. package/lib/esm/ElementLocateManager.js.map +1 -1
  357. package/lib/esm/EmphasizeElements.d.ts.map +1 -1
  358. package/lib/esm/EmphasizeElements.js +3 -1
  359. package/lib/esm/EmphasizeElements.js.map +1 -1
  360. package/lib/esm/EnvironmentDecorations.d.ts.map +1 -1
  361. package/lib/esm/EnvironmentDecorations.js +4 -0
  362. package/lib/esm/EnvironmentDecorations.js.map +1 -1
  363. package/lib/esm/FrustumAnimator.d.ts.map +1 -1
  364. package/lib/esm/FrustumAnimator.js +3 -2
  365. package/lib/esm/FrustumAnimator.js.map +1 -1
  366. package/lib/esm/GlobeAnimator.d.ts.map +1 -1
  367. package/lib/esm/GlobeAnimator.js +7 -6
  368. package/lib/esm/GlobeAnimator.js.map +1 -1
  369. package/lib/esm/HitDetail.d.ts.map +1 -1
  370. package/lib/esm/HitDetail.js +12 -7
  371. package/lib/esm/HitDetail.js.map +1 -1
  372. package/lib/esm/IModelApp.d.ts.map +1 -1
  373. package/lib/esm/IModelApp.js +7 -3
  374. package/lib/esm/IModelApp.js.map +1 -1
  375. package/lib/esm/IModelConnection.d.ts +4 -0
  376. package/lib/esm/IModelConnection.d.ts.map +1 -1
  377. package/lib/esm/IModelConnection.js +158 -16
  378. package/lib/esm/IModelConnection.js.map +1 -1
  379. package/lib/esm/IpcApp.d.ts.map +1 -1
  380. package/lib/esm/IpcApp.js +2 -2
  381. package/lib/esm/IpcApp.js.map +1 -1
  382. package/lib/esm/LinePlaneIntersect.d.ts.map +1 -1
  383. package/lib/esm/LinePlaneIntersect.js +2 -0
  384. package/lib/esm/LinePlaneIntersect.js.map +1 -1
  385. package/lib/esm/LocalhostIpcApp.d.ts.map +1 -1
  386. package/lib/esm/LocalhostIpcApp.js +2 -1
  387. package/lib/esm/LocalhostIpcApp.js.map +1 -1
  388. package/lib/esm/Marker.d.ts.map +1 -1
  389. package/lib/esm/Marker.js +5 -4
  390. package/lib/esm/Marker.js.map +1 -1
  391. package/lib/esm/ModelState.d.ts.map +1 -1
  392. package/lib/esm/ModelState.js +3 -3
  393. package/lib/esm/ModelState.js.map +1 -1
  394. package/lib/esm/NativeApp.d.ts.map +1 -1
  395. package/lib/esm/NativeApp.js +5 -4
  396. package/lib/esm/NativeApp.js.map +1 -1
  397. package/lib/esm/NativeAppLogger.d.ts.map +1 -1
  398. package/lib/esm/NativeAppLogger.js +1 -0
  399. package/lib/esm/NativeAppLogger.js.map +1 -1
  400. package/lib/esm/PlanarClipMaskState.d.ts +3 -0
  401. package/lib/esm/PlanarClipMaskState.d.ts.map +1 -1
  402. package/lib/esm/PlanarClipMaskState.js +8 -4
  403. package/lib/esm/PlanarClipMaskState.js.map +1 -1
  404. package/lib/esm/RealityDataSource.d.ts.map +1 -1
  405. package/lib/esm/RealityDataSource.js +5 -1
  406. package/lib/esm/RealityDataSource.js.map +1 -1
  407. package/lib/esm/SelectionSet.d.ts.map +1 -1
  408. package/lib/esm/SelectionSet.js +2 -1
  409. package/lib/esm/SelectionSet.js.map +1 -1
  410. package/lib/esm/SheetViewState.d.ts.map +1 -1
  411. package/lib/esm/SheetViewState.js +6 -6
  412. package/lib/esm/SheetViewState.js.map +1 -1
  413. package/lib/esm/SpatialViewState.d.ts.map +1 -1
  414. package/lib/esm/SpatialViewState.js +2 -2
  415. package/lib/esm/SpatialViewState.js.map +1 -1
  416. package/lib/esm/Sprites.js +2 -2
  417. package/lib/esm/Sprites.js.map +1 -1
  418. package/lib/esm/TentativePoint.d.ts.map +1 -1
  419. package/lib/esm/TentativePoint.js +10 -9
  420. package/lib/esm/TentativePoint.js.map +1 -1
  421. package/lib/esm/ViewContext.d.ts +10 -1
  422. package/lib/esm/ViewContext.d.ts.map +1 -1
  423. package/lib/esm/ViewContext.js +12 -1
  424. package/lib/esm/ViewContext.js.map +1 -1
  425. package/lib/esm/ViewCreator2d.js +1 -1
  426. package/lib/esm/ViewCreator2d.js.map +1 -1
  427. package/lib/esm/ViewCreator3d.js +1 -1
  428. package/lib/esm/ViewCreator3d.js.map +1 -1
  429. package/lib/esm/ViewPose.d.ts.map +1 -1
  430. package/lib/esm/ViewPose.js +4 -1
  431. package/lib/esm/ViewPose.js.map +1 -1
  432. package/lib/esm/ViewState.d.ts.map +1 -1
  433. package/lib/esm/ViewState.js +18 -13
  434. package/lib/esm/ViewState.js.map +1 -1
  435. package/lib/esm/ViewingSpace.d.ts.map +1 -1
  436. package/lib/esm/ViewingSpace.js +2 -0
  437. package/lib/esm/ViewingSpace.js.map +1 -1
  438. package/lib/esm/Viewport.d.ts.map +1 -1
  439. package/lib/esm/Viewport.js +18 -11
  440. package/lib/esm/Viewport.js.map +1 -1
  441. package/lib/esm/common/ImageUtil.d.ts.map +1 -1
  442. package/lib/esm/common/ImageUtil.js +2 -1
  443. package/lib/esm/common/ImageUtil.js.map +1 -1
  444. package/lib/esm/common/internal/render/GeometryAccumulator.d.ts.map +1 -1
  445. package/lib/esm/common/internal/render/GeometryAccumulator.js +4 -3
  446. package/lib/esm/common/internal/render/GeometryAccumulator.js.map +1 -1
  447. package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.d.ts.map +1 -1
  448. package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.js +2 -0
  449. package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.js.map +1 -1
  450. package/lib/esm/common/internal/render/MeshBuilder.js +2 -2
  451. package/lib/esm/common/internal/render/MeshBuilder.js.map +1 -1
  452. package/lib/esm/common/internal/render/VertexTableBuilder.d.ts.map +1 -1
  453. package/lib/esm/common/internal/render/VertexTableBuilder.js +17 -8
  454. package/lib/esm/common/internal/render/VertexTableBuilder.js.map +1 -1
  455. package/lib/esm/extension/ExtensionAdmin.js +2 -2
  456. package/lib/esm/extension/ExtensionAdmin.js.map +1 -1
  457. package/lib/esm/internal/GoogleMapsDecorator.js +7 -7
  458. package/lib/esm/internal/GoogleMapsDecorator.js.map +1 -1
  459. package/lib/esm/internal/ScriptUtils.js +1 -0
  460. package/lib/esm/internal/ScriptUtils.js.map +1 -1
  461. package/lib/esm/internal/cross-package.d.ts +1 -1
  462. package/lib/esm/internal/cross-package.d.ts.map +1 -1
  463. package/lib/esm/internal/cross-package.js +1 -1
  464. package/lib/esm/internal/cross-package.js.map +1 -1
  465. package/lib/esm/internal/render/UpsampleRealityMeshParams.d.ts.map +1 -1
  466. package/lib/esm/internal/render/UpsampleRealityMeshParams.js +2 -1
  467. package/lib/esm/internal/render/UpsampleRealityMeshParams.js.map +1 -1
  468. package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  469. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +7 -2
  470. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  471. package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  472. package/lib/esm/internal/render/webgl/AttributeBuffers.js +5 -3
  473. package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
  474. package/lib/esm/internal/render/webgl/AttributeMap.d.ts.map +1 -1
  475. package/lib/esm/internal/render/webgl/AttributeMap.js +2 -0
  476. package/lib/esm/internal/render/webgl/AttributeMap.js.map +1 -1
  477. package/lib/esm/internal/render/webgl/BackgroundMapDrape.d.ts.map +1 -1
  478. package/lib/esm/internal/render/webgl/BackgroundMapDrape.js +4 -4
  479. package/lib/esm/internal/render/webgl/BackgroundMapDrape.js.map +1 -1
  480. package/lib/esm/internal/render/webgl/BatchUniforms.d.ts +4 -1
  481. package/lib/esm/internal/render/webgl/BatchUniforms.d.ts.map +1 -1
  482. package/lib/esm/internal/render/webgl/BatchUniforms.js +16 -5
  483. package/lib/esm/internal/render/webgl/BatchUniforms.js.map +1 -1
  484. package/lib/esm/internal/render/webgl/BranchState.d.ts.map +1 -1
  485. package/lib/esm/internal/render/webgl/BranchState.js +2 -1
  486. package/lib/esm/internal/render/webgl/BranchState.js.map +1 -1
  487. package/lib/esm/internal/render/webgl/BranchUniforms.js +3 -3
  488. package/lib/esm/internal/render/webgl/BranchUniforms.js.map +1 -1
  489. package/lib/esm/internal/render/webgl/CachedGeometry.d.ts.map +1 -1
  490. package/lib/esm/internal/render/webgl/CachedGeometry.js +3 -3
  491. package/lib/esm/internal/render/webgl/CachedGeometry.js.map +1 -1
  492. package/lib/esm/internal/render/webgl/ClipStack.js +1 -1
  493. package/lib/esm/internal/render/webgl/ClipStack.js.map +1 -1
  494. package/lib/esm/internal/render/webgl/ColorInfo.js +2 -2
  495. package/lib/esm/internal/render/webgl/ColorInfo.js.map +1 -1
  496. package/lib/esm/internal/render/webgl/Contours.js +4 -4
  497. package/lib/esm/internal/render/webgl/Contours.js.map +1 -1
  498. package/lib/esm/internal/render/webgl/EDL.js +19 -19
  499. package/lib/esm/internal/render/webgl/EDL.js.map +1 -1
  500. package/lib/esm/internal/render/webgl/FeatureOverrides.d.ts +3 -3
  501. package/lib/esm/internal/render/webgl/FeatureOverrides.d.ts.map +1 -1
  502. package/lib/esm/internal/render/webgl/FeatureOverrides.js +15 -15
  503. package/lib/esm/internal/render/webgl/FeatureOverrides.js.map +1 -1
  504. package/lib/esm/internal/render/webgl/FrameBuffer.js +4 -4
  505. package/lib/esm/internal/render/webgl/FrameBuffer.js.map +1 -1
  506. package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
  507. package/lib/esm/internal/render/webgl/FrustumUniforms.js +2 -1
  508. package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
  509. package/lib/esm/internal/render/webgl/GLTimer.d.ts.map +1 -1
  510. package/lib/esm/internal/render/webgl/GLTimer.js +2 -0
  511. package/lib/esm/internal/render/webgl/GLTimer.js.map +1 -1
  512. package/lib/esm/internal/render/webgl/Graphic.d.ts +3 -3
  513. package/lib/esm/internal/render/webgl/Graphic.d.ts.map +1 -1
  514. package/lib/esm/internal/render/webgl/Graphic.js +7 -7
  515. package/lib/esm/internal/render/webgl/Graphic.js.map +1 -1
  516. package/lib/esm/internal/render/webgl/MapLayerParams.js +3 -3
  517. package/lib/esm/internal/render/webgl/MapLayerParams.js.map +1 -1
  518. package/lib/esm/internal/render/webgl/MeshData.js +3 -3
  519. package/lib/esm/internal/render/webgl/MeshData.js.map +1 -1
  520. package/lib/esm/internal/render/webgl/PerformanceMetrics.js +1 -1
  521. package/lib/esm/internal/render/webgl/PerformanceMetrics.js.map +1 -1
  522. package/lib/esm/internal/render/webgl/PlanarClassifier.d.ts +1 -0
  523. package/lib/esm/internal/render/webgl/PlanarClassifier.d.ts.map +1 -1
  524. package/lib/esm/internal/render/webgl/PlanarClassifier.js +28 -12
  525. package/lib/esm/internal/render/webgl/PlanarClassifier.js.map +1 -1
  526. package/lib/esm/internal/render/webgl/PlanarGrid.js +2 -2
  527. package/lib/esm/internal/render/webgl/PlanarGrid.js.map +1 -1
  528. package/lib/esm/internal/render/webgl/PlanarTextureProjection.d.ts +0 -3
  529. package/lib/esm/internal/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
  530. package/lib/esm/internal/render/webgl/PlanarTextureProjection.js +6 -5
  531. package/lib/esm/internal/render/webgl/PlanarTextureProjection.js.map +1 -1
  532. package/lib/esm/internal/render/webgl/PointCloud.js +2 -2
  533. package/lib/esm/internal/render/webgl/PointCloud.js.map +1 -1
  534. package/lib/esm/internal/render/webgl/RealityMesh.js +2 -2
  535. package/lib/esm/internal/render/webgl/RealityMesh.js.map +1 -1
  536. package/lib/esm/internal/render/webgl/RenderBuffer.js +3 -3
  537. package/lib/esm/internal/render/webgl/RenderBuffer.js.map +1 -1
  538. package/lib/esm/internal/render/webgl/RenderCommands.d.ts +2 -1
  539. package/lib/esm/internal/render/webgl/RenderCommands.d.ts.map +1 -1
  540. package/lib/esm/internal/render/webgl/RenderCommands.js +3 -1
  541. package/lib/esm/internal/render/webgl/RenderCommands.js.map +1 -1
  542. package/lib/esm/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
  543. package/lib/esm/internal/render/webgl/SceneCompositor.js +119 -86
  544. package/lib/esm/internal/render/webgl/SceneCompositor.js.map +1 -1
  545. package/lib/esm/internal/render/webgl/ScratchDrawParams.d.ts.map +1 -1
  546. package/lib/esm/internal/render/webgl/ScratchDrawParams.js +11 -10
  547. package/lib/esm/internal/render/webgl/ScratchDrawParams.js.map +1 -1
  548. package/lib/esm/internal/render/webgl/ScreenSpaceEffect.js +4 -4
  549. package/lib/esm/internal/render/webgl/ScreenSpaceEffect.js.map +1 -1
  550. package/lib/esm/internal/render/webgl/ShaderProgram.js +4 -4
  551. package/lib/esm/internal/render/webgl/ShaderProgram.js.map +1 -1
  552. package/lib/esm/internal/render/webgl/ShadowUniforms.d.ts.map +1 -1
  553. package/lib/esm/internal/render/webgl/ShadowUniforms.js +2 -1
  554. package/lib/esm/internal/render/webgl/ShadowUniforms.js.map +1 -1
  555. package/lib/esm/internal/render/webgl/SolarShadowMap.d.ts.map +1 -1
  556. package/lib/esm/internal/render/webgl/SolarShadowMap.js +7 -5
  557. package/lib/esm/internal/render/webgl/SolarShadowMap.js.map +1 -1
  558. package/lib/esm/internal/render/webgl/System.d.ts.map +1 -1
  559. package/lib/esm/internal/render/webgl/System.js +2 -2
  560. package/lib/esm/internal/render/webgl/System.js.map +1 -1
  561. package/lib/esm/internal/render/webgl/Target.d.ts.map +1 -1
  562. package/lib/esm/internal/render/webgl/Target.js +13 -10
  563. package/lib/esm/internal/render/webgl/Target.js.map +1 -1
  564. package/lib/esm/internal/render/webgl/Texture.d.ts.map +1 -1
  565. package/lib/esm/internal/render/webgl/Texture.js +11 -9
  566. package/lib/esm/internal/render/webgl/Texture.js.map +1 -1
  567. package/lib/esm/internal/render/webgl/VisibleTileFeatures.js +1 -1
  568. package/lib/esm/internal/render/webgl/VisibleTileFeatures.js.map +1 -1
  569. package/lib/esm/internal/render/webgl/glsl/Animation.d.ts.map +1 -1
  570. package/lib/esm/internal/render/webgl/glsl/Animation.js +5 -3
  571. package/lib/esm/internal/render/webgl/glsl/Animation.js.map +1 -1
  572. package/lib/esm/internal/render/webgl/glsl/Color.d.ts.map +1 -1
  573. package/lib/esm/internal/render/webgl/glsl/Color.js +2 -1
  574. package/lib/esm/internal/render/webgl/glsl/Color.js.map +1 -1
  575. package/lib/esm/internal/render/webgl/glsl/Composite.js +2 -2
  576. package/lib/esm/internal/render/webgl/glsl/Composite.js.map +1 -1
  577. package/lib/esm/internal/render/webgl/glsl/CopyStencil.d.ts.map +1 -1
  578. package/lib/esm/internal/render/webgl/glsl/CopyStencil.js +3 -2
  579. package/lib/esm/internal/render/webgl/glsl/CopyStencil.js.map +1 -1
  580. package/lib/esm/internal/render/webgl/glsl/PlanarClassification.js +4 -4
  581. package/lib/esm/internal/render/webgl/glsl/PlanarClassification.js.map +1 -1
  582. package/lib/esm/internal/render/webgl/glsl/PlanarGrid.d.ts.map +1 -1
  583. package/lib/esm/internal/render/webgl/glsl/PlanarGrid.js +4 -3
  584. package/lib/esm/internal/render/webgl/glsl/PlanarGrid.js.map +1 -1
  585. package/lib/esm/internal/render/webgl/glsl/RealityMesh.js +9 -9
  586. package/lib/esm/internal/render/webgl/glsl/RealityMesh.js.map +1 -1
  587. package/lib/esm/internal/render/webgl/glsl/Surface.js +11 -11
  588. package/lib/esm/internal/render/webgl/glsl/Surface.js.map +1 -1
  589. package/lib/esm/internal/render/webgl/glsl/Vertex.js +3 -3
  590. package/lib/esm/internal/render/webgl/glsl/Vertex.js.map +1 -1
  591. package/lib/esm/internal/tile/B3dmReader.d.ts.map +1 -1
  592. package/lib/esm/internal/tile/B3dmReader.js +2 -2
  593. package/lib/esm/internal/tile/B3dmReader.js.map +1 -1
  594. package/lib/esm/internal/tile/DynamicIModelTile.js +1 -0
  595. package/lib/esm/internal/tile/DynamicIModelTile.js.map +1 -1
  596. package/lib/esm/internal/tile/FetchCloudStorage.js +1 -1
  597. package/lib/esm/internal/tile/FetchCloudStorage.js.map +1 -1
  598. package/lib/esm/internal/tile/LRUTileList.d.ts.map +1 -1
  599. package/lib/esm/internal/tile/LRUTileList.js +4 -0
  600. package/lib/esm/internal/tile/LRUTileList.js.map +1 -1
  601. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
  602. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js +2 -1
  603. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
  604. package/lib/esm/internal/tile/OPCFormatInterpreter.js +5 -5
  605. package/lib/esm/internal/tile/OPCFormatInterpreter.js.map +1 -1
  606. package/lib/esm/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
  607. package/lib/esm/internal/tile/OrbitGtTileTree.js +3 -3
  608. package/lib/esm/internal/tile/OrbitGtTileTree.js.map +1 -1
  609. package/lib/esm/internal/tile/PrimaryTileTree.d.ts +2 -0
  610. package/lib/esm/internal/tile/PrimaryTileTree.d.ts.map +1 -1
  611. package/lib/esm/internal/tile/PrimaryTileTree.js +16 -12
  612. package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
  613. package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  614. package/lib/esm/internal/tile/RealityModelTileTree.js +4 -4
  615. package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
  616. package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
  617. package/lib/esm/internal/tile/RealityTileLoader.js +3 -0
  618. package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
  619. package/lib/esm/internal/tile/ThreeDTileFormatInterpreter.js +4 -4
  620. package/lib/esm/internal/tile/ThreeDTileFormatInterpreter.js.map +1 -1
  621. package/lib/esm/internal/tile/TileUserSet.d.ts.map +1 -1
  622. package/lib/esm/internal/tile/TileUserSet.js +4 -0
  623. package/lib/esm/internal/tile/TileUserSet.js.map +1 -1
  624. package/lib/esm/internal/tile/map/ArcGISTileMap.js +1 -1
  625. package/lib/esm/internal/tile/map/ArcGISTileMap.js.map +1 -1
  626. package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
  627. package/lib/esm/internal/tile/map/ArcGisUtilities.js +4 -0
  628. package/lib/esm/internal/tile/map/ArcGisUtilities.js.map +1 -1
  629. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  630. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
  631. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  632. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +3 -3
  633. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  634. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +2 -2
  635. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  636. package/lib/esm/internal/tile/map/MapTileAvailability.d.ts.map +1 -1
  637. package/lib/esm/internal/tile/map/MapTileAvailability.js +6 -3
  638. package/lib/esm/internal/tile/map/MapTileAvailability.js.map +1 -1
  639. package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
  640. package/lib/esm/internal/tile/map/WmtsCapabilities.js +3 -2
  641. package/lib/esm/internal/tile/map/WmtsCapabilities.js.map +1 -1
  642. package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
  643. package/lib/esm/properties/FormattedQuantityDescription.js +2 -0
  644. package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
  645. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.d.ts.map +1 -1
  646. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js +2 -0
  647. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
  648. package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  649. package/lib/esm/quantity-formatting/QuantityFormatter.js +5 -3
  650. package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
  651. package/lib/esm/tile/GltfReader.d.ts +5 -2
  652. package/lib/esm/tile/GltfReader.d.ts.map +1 -1
  653. package/lib/esm/tile/GltfReader.js +70 -18
  654. package/lib/esm/tile/GltfReader.js.map +1 -1
  655. package/lib/esm/tile/RealityTile.d.ts.map +1 -1
  656. package/lib/esm/tile/RealityTile.js +3 -3
  657. package/lib/esm/tile/RealityTile.js.map +1 -1
  658. package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
  659. package/lib/esm/tile/RealityTileTree.js +6 -6
  660. package/lib/esm/tile/RealityTileTree.js.map +1 -1
  661. package/lib/esm/tile/TileAdmin.js.map +1 -1
  662. package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
  663. package/lib/esm/tile/TileDrawArgs.js +2 -1
  664. package/lib/esm/tile/TileDrawArgs.js.map +1 -1
  665. package/lib/esm/tile/map/ImageryTileTree.js +2 -2
  666. package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
  667. package/lib/esm/tile/map/MapLayerFormatRegistry.js +2 -2
  668. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  669. package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
  670. package/lib/esm/tile/map/MapLayerSources.js +10 -2
  671. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  672. package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
  673. package/lib/esm/tile/map/MapTile.js +11 -9
  674. package/lib/esm/tile/map/MapTile.js.map +1 -1
  675. package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
  676. package/lib/esm/tile/map/MapTileTree.js +9 -8
  677. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  678. package/lib/esm/tile/map/MapTilingScheme.d.ts.map +1 -1
  679. package/lib/esm/tile/map/MapTilingScheme.js +2 -1
  680. package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
  681. package/lib/esm/tools/Tool.js +2 -2
  682. package/lib/esm/tools/Tool.js.map +1 -1
  683. package/lib/esm/tools/ToolAdmin.d.ts +5 -0
  684. package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
  685. package/lib/esm/tools/ToolAdmin.js +9 -0
  686. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  687. package/lib/esm/workers/ImdlParser/webpack.config.js +8 -0
  688. package/lib/public/images/GoogleMaps_Logo_Gray.svg +50 -0
  689. package/lib/public/images/GoogleMaps_Logo_WithDarkOutline.svg +78 -0
  690. package/lib/public/images/GoogleMaps_Logo_WithLightOutline.svg +78 -0
  691. package/lib/public/locales/en/iModelJs.json +1 -1
  692. package/lib/public/scripts/draco_decoder.wasm +0 -0
  693. package/lib/public/scripts/draco_encoder.js +52 -0
  694. package/lib/public/scripts/draco_wasm_wrapper.js +117 -0
  695. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  696. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  697. package/package.json +25 -23
  698. package/lib/public/images/google_on_non_white.png +0 -0
  699. package/lib/public/images/google_on_non_white_hdpi.png +0 -0
  700. package/lib/public/images/google_on_white.png +0 -0
  701. package/lib/public/images/google_on_white_hdpi.png +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CheckpointConnection.js","sourceRoot":"","sources":["../../src/CheckpointConnection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EACkB,WAAW,EAAE,sBAAsB,EAAsB,aAAa,EAAE,UAAU,EAAuB,YAAY,EAC5I,UAAU,EAAE,eAAe,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gB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0DAA0D,EAAE,cAAc,CAAC,CAAC;QAC5G,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,mEAAmE;QAC/G,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,sCAAsC;IAC/B,KAAK,CAAC,KAAK;QAChB,IAAI,IAAI,CAAC,QAAQ;YACf,OAAO;QAET,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,QAAQ;YACf,MAAM,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;YAEvD,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE5E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelConnection\r\n */\r\n\r\nimport { BentleyError, BentleyStatus, GuidString, Logger } from \"@itwin/core-bentley\";\r\nimport {\r\n IModelConnectionProps, IModelError, IModelReadRpcInterface, IModelRpcOpenProps, IModelVersion, RpcManager, RpcNotFoundResponse, RpcOperation,\r\n RpcRequest, RpcRequestEvent,\r\n} from \"@itwin/core-common\";\r\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { IModelRoutingContext } from \"./IModelRoutingContext\";\r\nimport { IpcApp } from \"./IpcApp\";\r\n\r\nconst loggerCategory = FrontendLoggerCategory.IModelConnection;\r\n\r\n/**\r\n * An IModelConnection to a Checkpoint of an iModel.\r\n * @see [CheckpointConnection]($docs/learning/frontend/IModelConnection)\r\n * @public\r\n */\r\nexport class CheckpointConnection extends IModelConnection {\r\n private readonly _fromIpc: boolean;\r\n\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public override get iTwinId(): GuidString { return super.iTwinId!; }\r\n /** The Guid that identifies this iModel. */\r\n public override get iModelId(): GuidString { return super.iModelId!; }\r\n\r\n /** Returns `true` if [[close]] has already been called. */\r\n public get isClosed(): boolean { return this._isClosed ? true : false; }\r\n protected _isClosed?: boolean;\r\n\r\n protected constructor(props: IModelConnectionProps, fromIpc: boolean) {\r\n super(props);\r\n this._fromIpc = fromIpc;\r\n }\r\n\r\n /** Type guard for instanceof [[CheckpointConnection]] */\r\n public override isCheckpointConnection(): this is CheckpointConnection { return true; }\r\n\r\n /**\r\n * Open a readonly IModelConnection to a Checkpoint of an iModel.\r\n */\r\n public static async openRemote(iTwinId: GuidString, iModelId: GuidString, version = IModelVersion.latest()): Promise<CheckpointConnection> {\r\n if (undefined === IModelApp.hubAccess)\r\n throw new Error(\"Missing an implementation of IModelApp.hubAccess\");\r\n\r\n const accessToken = await IModelApp.getAccessToken();\r\n const changeset = await IModelApp.hubAccess.getChangesetFromVersion({ accessToken, iModelId, version });\r\n\r\n let connection: CheckpointConnection;\r\n const iModelProps = { iTwinId, iModelId, changeset };\r\n if (IpcApp.isValid) {\r\n connection = new this(await IpcApp.appFunctionIpc.openCheckpoint(iModelProps), true);\r\n } else {\r\n const routingContext = IModelRoutingContext.current || IModelRoutingContext.default;\r\n connection = new this(await this.callOpen(iModelProps, routingContext), false);\r\n RpcManager.setIModel(connection);\r\n connection.routingContext = routingContext;\r\n RpcRequest.notFoundHandlers.addListener(connection._reopenConnectionHandler);\r\n }\r\n\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n private static async callOpen(iModelToken: IModelRpcOpenProps, routingContext: IModelRoutingContext): Promise<IModelConnectionProps> {\r\n // Try opening the iModel repeatedly accommodating any pending responses from the backend.\r\n // Waits for an increasing amount of time (but within a range) before checking on the pending request again.\r\n const connectionRetryIntervalRange = { min: 100, max: 5000 }; // in milliseconds\r\n let connectionRetryInterval = Math.min(connectionRetryIntervalRange.min, IModelConnection.connectionTimeout);\r\n\r\n const openForReadOperation = RpcOperation.lookup(IModelReadRpcInterface, \"getConnectionProps\");\r\n if (!openForReadOperation)\r\n throw new IModelError(BentleyStatus.ERROR, \"IModelReadRpcInterface.getConnectionProps() is not available\");\r\n openForReadOperation.policy.retryInterval = () => connectionRetryInterval;\r\n\r\n Logger.logTrace(loggerCategory, `IModelConnection.open`, iModelToken);\r\n const startTime = Date.now();\r\n\r\n const removeListener = RpcRequest.events.addListener((type: RpcRequestEvent, request: RpcRequest) => { // eslint-disable-line @typescript-eslint/no-deprecated\r\n if (type !== RpcRequestEvent.PendingUpdateReceived) // eslint-disable-line @typescript-eslint/no-deprecated\r\n return;\r\n if (!(openForReadOperation && request.operation === openForReadOperation))\r\n return;\r\n\r\n Logger.logTrace(loggerCategory, \"Received pending open notification in IModelConnection.open\", iModelToken);\r\n\r\n const connectionTimeElapsed = Date.now() - startTime;\r\n if (connectionTimeElapsed > IModelConnection.connectionTimeout) {\r\n Logger.logError(loggerCategory, `Timed out opening connection in IModelConnection.open (took longer than ${IModelConnection.connectionTimeout} milliseconds)`, iModelToken);\r\n throw new IModelError(BentleyStatus.ERROR, \"Opening a connection was timed out\"); // NEEDS_WORK: More specific error status\r\n }\r\n\r\n connectionRetryInterval = Math.min(connectionRetryIntervalRange.max, connectionRetryInterval * 2, IModelConnection.connectionTimeout - connectionTimeElapsed);\r\n if (request.retryInterval !== connectionRetryInterval) {\r\n request.retryInterval = connectionRetryInterval;\r\n Logger.logTrace(loggerCategory, `Adjusted open connection retry interval to ${request.retryInterval} milliseconds in IModelConnection.open`, iModelToken);\r\n }\r\n });\r\n\r\n const openPromise = IModelReadRpcInterface.getClientForRouting(routingContext.token).getConnectionProps(iModelToken);\r\n let openResponse: IModelConnectionProps;\r\n try {\r\n openResponse = await openPromise;\r\n } finally {\r\n Logger.logTrace(loggerCategory, \"Completed open request in IModelConnection.open\", iModelToken);\r\n removeListener();\r\n }\r\n\r\n return openResponse;\r\n }\r\n\r\n private _reopenConnectionHandler = async (request: RpcRequest<RpcNotFoundResponse>, response: any, resubmit: () => void, reject: (reason?: any) => void) => {\r\n if (!response.hasOwnProperty(\"isIModelNotFoundResponse\"))\r\n reject();\r\n\r\n const iModelRpcProps = request.parameters[0];\r\n if (this._fileKey !== iModelRpcProps.key)\r\n reject(); // The handler is called for a different connection than this\r\n\r\n Logger.logTrace(loggerCategory, \"Attempting to reopen connection\", () => iModelRpcProps);\r\n\r\n try {\r\n const openResponse = await CheckpointConnection.callOpen(iModelRpcProps, this.routingContext);\r\n // The new/reopened connection may have a new rpcKey and/or changesetId, but the other IModelRpcTokenProps should be the same\r\n this._fileKey = openResponse.key;\r\n this.changeset = openResponse.changeset!;\r\n\r\n } catch (error) {\r\n reject(BentleyError.getErrorMessage(error));\r\n } finally {\r\n }\r\n\r\n Logger.logTrace(loggerCategory, \"Resubmitting original request after reopening connection\", iModelRpcProps);\r\n request.parameters[0] = this.getRpcProps(); // Modify the token of the original request before resubmitting it.\r\n resubmit();\r\n };\r\n\r\n /** Close this CheckpointConnection */\r\n public async close(): Promise<void> {\r\n if (this.isClosed)\r\n return;\r\n\r\n this.beforeClose();\r\n if (this._fromIpc)\r\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\r\n else\r\n RpcRequest.notFoundHandlers.removeListener(this._reopenConnectionHandler);\r\n\r\n this._isClosed = true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CheckpointConnection.js","sourceRoot":"","sources":["../../src/CheckpointConnection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EACkB,WAAW,EAAE,sBAAsB,EAAsB,aAAa,EAAE,UAAU,EAA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AI,CAAC,SAAS,GAAG,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAEzD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9C,CAAC;gBAAS,CAAC;QACX,CAAC;QAED,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,0DAA0D,EAAE,cAAc,CAAC,CAAC;QAC5G,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,mEAAmE;QAC/G,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,sCAAsC;IAC/B,KAAK,CAAC,KAAK;QAChB,IAAI,IAAI,CAAC,QAAQ;YACf,OAAO;QAET,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,QAAQ;YACf,MAAM,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;YAEvD,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE5E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelConnection\r\n */\r\n\r\nimport { BentleyError, BentleyStatus, expectDefined, Guid, GuidString, Logger } from \"@itwin/core-bentley\";\r\nimport {\r\n IModelConnectionProps, IModelError, IModelReadRpcInterface, IModelRpcOpenProps, IModelVersion, RpcManager, RpcNotFoundResponse, RpcOperation,\r\n RpcRequest, RpcRequestEvent,\r\n} from \"@itwin/core-common\";\r\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { IModelRoutingContext } from \"./IModelRoutingContext\";\r\nimport { IpcApp } from \"./IpcApp\";\r\n\r\nconst loggerCategory = FrontendLoggerCategory.IModelConnection;\r\n\r\n/**\r\n * An IModelConnection to a Checkpoint of an iModel.\r\n * @see [CheckpointConnection]($docs/learning/frontend/IModelConnection)\r\n * @public\r\n */\r\nexport class CheckpointConnection extends IModelConnection {\r\n private readonly _fromIpc: boolean;\r\n\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public override get iTwinId(): GuidString { return super.iTwinId ?? Guid.empty; }\r\n /** The Guid that identifies this iModel. */\r\n public override get iModelId(): GuidString { return super.iModelId ?? Guid.empty; }\r\n\r\n /** Returns `true` if [[close]] has already been called. */\r\n public get isClosed(): boolean { return this._isClosed ? true : false; }\r\n protected _isClosed?: boolean;\r\n\r\n protected constructor(props: IModelConnectionProps, fromIpc: boolean) {\r\n super(props);\r\n this._fromIpc = fromIpc;\r\n }\r\n\r\n /** Type guard for instanceof [[CheckpointConnection]] */\r\n public override isCheckpointConnection(): this is CheckpointConnection { return true; }\r\n\r\n /**\r\n * Open a readonly IModelConnection to a Checkpoint of an iModel.\r\n */\r\n public static async openRemote(iTwinId: GuidString, iModelId: GuidString, version = IModelVersion.latest()): Promise<CheckpointConnection> {\r\n if (undefined === IModelApp.hubAccess)\r\n throw new Error(\"Missing an implementation of IModelApp.hubAccess\");\r\n\r\n const accessToken = await IModelApp.getAccessToken();\r\n const changeset = await IModelApp.hubAccess.getChangesetFromVersion({ accessToken, iModelId, version });\r\n\r\n let connection: CheckpointConnection;\r\n const iModelProps = { iTwinId, iModelId, changeset };\r\n if (IpcApp.isValid) {\r\n connection = new this(await IpcApp.appFunctionIpc.openCheckpoint(iModelProps), true);\r\n } else {\r\n const routingContext = IModelRoutingContext.current || IModelRoutingContext.default;\r\n connection = new this(await this.callOpen(iModelProps, routingContext), false);\r\n RpcManager.setIModel(connection);\r\n connection.routingContext = routingContext;\r\n RpcRequest.notFoundHandlers.addListener(connection._reopenConnectionHandler);\r\n }\r\n\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n private static async callOpen(iModelToken: IModelRpcOpenProps, routingContext: IModelRoutingContext): Promise<IModelConnectionProps> {\r\n // Try opening the iModel repeatedly accommodating any pending responses from the backend.\r\n // Waits for an increasing amount of time (but within a range) before checking on the pending request again.\r\n const connectionRetryIntervalRange = { min: 100, max: 5000 }; // in milliseconds\r\n let connectionRetryInterval = Math.min(connectionRetryIntervalRange.min, IModelConnection.connectionTimeout);\r\n\r\n const openForReadOperation = RpcOperation.lookup(IModelReadRpcInterface, \"getConnectionProps\");\r\n if (!openForReadOperation)\r\n throw new IModelError(BentleyStatus.ERROR, \"IModelReadRpcInterface.getConnectionProps() is not available\");\r\n openForReadOperation.policy.retryInterval = () => connectionRetryInterval;\r\n\r\n Logger.logTrace(loggerCategory, `IModelConnection.open`, iModelToken);\r\n const startTime = Date.now();\r\n\r\n const removeListener = RpcRequest.events.addListener((type: RpcRequestEvent, request: RpcRequest) => { // eslint-disable-line @typescript-eslint/no-deprecated\r\n if (type !== RpcRequestEvent.PendingUpdateReceived) // eslint-disable-line @typescript-eslint/no-deprecated\r\n return;\r\n if (!(openForReadOperation && request.operation === openForReadOperation))\r\n return;\r\n\r\n Logger.logTrace(loggerCategory, \"Received pending open notification in IModelConnection.open\", iModelToken);\r\n\r\n const connectionTimeElapsed = Date.now() - startTime;\r\n if (connectionTimeElapsed > IModelConnection.connectionTimeout) {\r\n Logger.logError(loggerCategory, `Timed out opening connection in IModelConnection.open (took longer than ${IModelConnection.connectionTimeout} milliseconds)`, iModelToken);\r\n throw new IModelError(BentleyStatus.ERROR, \"Opening a connection was timed out\"); // NEEDS_WORK: More specific error status\r\n }\r\n\r\n connectionRetryInterval = Math.min(connectionRetryIntervalRange.max, connectionRetryInterval * 2, IModelConnection.connectionTimeout - connectionTimeElapsed);\r\n if (request.retryInterval !== connectionRetryInterval) {\r\n request.retryInterval = connectionRetryInterval;\r\n Logger.logTrace(loggerCategory, `Adjusted open connection retry interval to ${request.retryInterval} milliseconds in IModelConnection.open`, iModelToken);\r\n }\r\n });\r\n\r\n const openPromise = IModelReadRpcInterface.getClientForRouting(routingContext.token).getConnectionProps(iModelToken);\r\n let openResponse: IModelConnectionProps;\r\n try {\r\n openResponse = await openPromise;\r\n } finally {\r\n Logger.logTrace(loggerCategory, \"Completed open request in IModelConnection.open\", iModelToken);\r\n removeListener();\r\n }\r\n\r\n return openResponse;\r\n }\r\n\r\n private _reopenConnectionHandler = async (request: RpcRequest<RpcNotFoundResponse>, response: any, resubmit: () => void, reject: (reason?: any) => void) => {\r\n if (!response.hasOwnProperty(\"isIModelNotFoundResponse\"))\r\n reject();\r\n\r\n const iModelRpcProps = request.parameters[0];\r\n if (this._fileKey !== iModelRpcProps.key)\r\n reject(); // The handler is called for a different connection than this\r\n\r\n Logger.logTrace(loggerCategory, \"Attempting to reopen connection\", () => iModelRpcProps);\r\n\r\n try {\r\n const openResponse = await CheckpointConnection.callOpen(iModelRpcProps, this.routingContext);\r\n // The new/reopened connection may have a new rpcKey and/or changesetId, but the other IModelRpcTokenProps should be the same\r\n this._fileKey = openResponse.key;\r\n this.changeset = expectDefined(openResponse.changeset);\r\n\r\n } catch (error) {\r\n reject(BentleyError.getErrorMessage(error));\r\n } finally {\r\n }\r\n\r\n Logger.logTrace(loggerCategory, \"Resubmitting original request after reopening connection\", iModelRpcProps);\r\n request.parameters[0] = this.getRpcProps(); // Modify the token of the original request before resubmitting it.\r\n resubmit();\r\n };\r\n\r\n /** Close this CheckpointConnection */\r\n public async close(): Promise<void> {\r\n if (this.isClosed)\r\n return;\r\n\r\n this.beforeClose();\r\n if (this._fromIpc)\r\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\r\n else\r\n RpcRequest.notFoundHandlers.removeListener(this._reopenConnectionHandler);\r\n\r\n this._isClosed = true;\r\n }\r\n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,WAAW,CAAC,CAAC,WAAW,EAAE,EAAE;YACvD,IAAI,CAAC,QAAQ,CAAC,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,6FAA6F;IAC7F,IAAW,OAAO,KAAwB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjE,wGAAwG;IACxG,IAAoB,WAAW;QAC7B,MAAM,CAAC,KAAK,CAAC,WAAW,YAAY,uBAAuB,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC,WAAW,CAAC;IAC3B,CAAC;IAED,mEAAmE;IACnE,IAAW,OAAO;QAChB,OAAO,CAAC,IAAI,CAAC,QAAQ,YAAY,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,CAAC;IAED,kEAAkE;IAClE,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { ContextRealityModel, ContextRealityModelProps, FeatureAppearance, RealityDataFormat, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"./DisplayStyleState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\nimport { createOrbitGtTileTreeReference, createRealityTileTreeReference, RealityModelTileTree, TileTreeReference } from \"./tile/internal\";\r\n\r\n/** A [ContextRealityModel]($common) attached to a [[DisplayStyleState]] supplying a [[TileTreeReference]] used to draw the\r\n * reality model in a [[Viewport]].\r\n * @see [DisplayStyleSettings.contextRealityModels]($common).\r\n * @see [[DisplayStyleState.contextRealityModelStates]].\r\n * @see [[DisplayStyleState.attachRealityModel]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class ContextRealityModelState extends ContextRealityModel {\r\n private readonly _treeRef: RealityModelTileTree.Reference;\r\n /** The iModel with which the reality model is associated. */\r\n public readonly iModel: IModelConnection;\r\n /** The reality data source key with which the reality model is associated. */\r\n public override readonly rdSourceKey: RealityDataSourceKey;\r\n\r\n /** @internal */\r\n public constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState) {\r\n super(props, { createClassifiers: (container) => SpatialClassifiersState.create(container) });\r\n this.iModel = iModel;\r\n this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;\r\n if (undefined === props.orbitGtBlob) {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromUrl(props.tilesetUrl);\r\n } else {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);\r\n }\r\n const useOrbitGtTileTreeReference = this.rdSourceKey.format === RealityDataFormat.OPC;\r\n this._treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n iModel,\r\n source: displayStyle,\r\n rdSourceKey: this.rdSourceKey,\r\n url: props.tilesetUrl,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n planarClipMask: this.planarClipMaskSettings,\r\n getDisplaySettings: () => this.displaySettings,\r\n getBackgroundBase: () => displayStyle.settings.mapImagery.backgroundBase,\r\n getBackgroundLayers: () => displayStyle.settings.mapImagery.backgroundLayers,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n iModel,\r\n orbitGtBlob: props.orbitGtBlob!,\r\n rdSourceKey: this.rdSourceKey,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n source: displayStyle,\r\n getDisplaySettings: () => this.displaySettings,\r\n });\r\n\r\n this.onPlanarClipMaskChanged.addListener((newSettings) => {\r\n this._treeRef.planarClipMask = newSettings ? PlanarClipMaskState.create(newSettings) : undefined;\r\n });\r\n }\r\n\r\n /** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */\r\n public get treeRef(): TileTreeReference { return this._treeRef; }\r\n\r\n /** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */\r\n public override get classifiers(): SpatialClassifiersState {\r\n assert(super.classifiers instanceof SpatialClassifiersState);\r\n return super.classifiers;\r\n }\r\n\r\n /** The transient Id assigned to this reality model at run-time. */\r\n public get modelId(): Id64String | undefined {\r\n return (this._treeRef instanceof RealityModelTileTree.Reference) ? this._treeRef.modelId : undefined;\r\n }\r\n\r\n /** Whether the reality model spans the entire globe ellipsoid. */\r\n public get isGlobal(): boolean {\r\n return this.treeRef.isGlobal;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ContextRealityModelState.js","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAA4B,iBAAiB,EAAE,iBAAiB,EAAwB,MAAM,oBAAoB,CAAC;AAG/I,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,oBAAoB,EAAqB,MAAM,iBAAiB,CAAC;AAE1I;;;;;;;GAOG;AACH,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CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,CAAC;IAED,kEAAkE;IAClE,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { ContextRealityModel, ContextRealityModelProps, FeatureAppearance, RealityDataFormat, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"./DisplayStyleState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\nimport { createOrbitGtTileTreeReference, createRealityTileTreeReference, RealityModelTileTree, TileTreeReference } from \"./tile/internal\";\r\n\r\n/** A [ContextRealityModel]($common) attached to a [[DisplayStyleState]] supplying a [[TileTreeReference]] used to draw the\r\n * reality model in a [[Viewport]].\r\n * @see [DisplayStyleSettings.contextRealityModels]($common).\r\n * @see [[DisplayStyleState.contextRealityModelStates]].\r\n * @see [[DisplayStyleState.attachRealityModel]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class ContextRealityModelState extends ContextRealityModel {\r\n private readonly _treeRef: RealityModelTileTree.Reference;\r\n /** The iModel with which the reality model is associated. */\r\n public readonly iModel: IModelConnection;\r\n /** The reality data source key with which the reality model is associated. */\r\n public override readonly rdSourceKey: RealityDataSourceKey;\r\n\r\n /** @internal */\r\n public constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState) {\r\n super(props, { createClassifiers: (container) => SpatialClassifiersState.create(container) });\r\n this.iModel = iModel;\r\n this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;\r\n if (undefined === props.orbitGtBlob) {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromUrl(props.tilesetUrl);\r\n } else {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);\r\n }\r\n const useOrbitGtTileTreeReference = this.rdSourceKey.format === RealityDataFormat.OPC;\r\n this._treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n iModel,\r\n source: displayStyle,\r\n rdSourceKey: this.rdSourceKey,\r\n url: props.tilesetUrl,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n planarClipMask: this.planarClipMaskSettings,\r\n getDisplaySettings: () => this.displaySettings,\r\n getBackgroundBase: () => displayStyle.settings.mapImagery.backgroundBase,\r\n getBackgroundLayers: () => displayStyle.settings.mapImagery.backgroundLayers,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n iModel,\r\n orbitGtBlob: props.orbitGtBlob,\r\n rdSourceKey: this.rdSourceKey,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n source: displayStyle,\r\n getDisplaySettings: () => this.displaySettings,\r\n });\r\n\r\n this.onPlanarClipMaskChanged.addListener((newSettings) => {\r\n this._treeRef.planarClipMask = newSettings ? PlanarClipMaskState.create(newSettings) : undefined;\r\n });\r\n }\r\n\r\n /** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */\r\n public get treeRef(): TileTreeReference { return this._treeRef; }\r\n\r\n /** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */\r\n public override get classifiers(): SpatialClassifiersState {\r\n assert(super.classifiers instanceof SpatialClassifiersState);\r\n return super.classifiers;\r\n }\r\n\r\n /** The transient Id assigned to this reality model at run-time. */\r\n public get modelId(): Id64String | undefined {\r\n return (this._treeRef instanceof RealityModelTileTree.Reference) ? this._treeRef.modelId : undefined;\r\n }\r\n\r\n /** Whether the reality model spans the entire globe ellipsoid. */\r\n public get isGlobal(): boolean {\r\n return this.treeRef.isGlobal;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementLocateManager.d.ts","sourceRoot":"","sources":["../../src/ElementLocateManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAW,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG5D,OAAO,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtD;;;GAGG;AACH,oBAAY,YAAY;IACtB,QAAQ,IAAI;IACZ,UAAU,IAAI;CACf;AAED;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED;;;GAGG;AACH,oBAAY,UAAU;IACpB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,UAAU,IAAI;IACd,QAAQ,MAAM;IACd,cAAc,MAAM;IACpB,YAAY,MAAM;IAClB,aAAa,MAAM;IACnB,oBAAoB,MAAM;CAC3B;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB,yDAAyD;IAClD,gBAAgB,UAAS;IAChC,+DAA+D;IACxD,iBAAiB,UAAS;IACjC,wCAAwC;IACjC,OAAO,SAAM;IACpB,gDAAgD;IACzC,SAAS,YAAuB;IACvC;;;;OAIG;IACI,oBAAoB,UAAS;IACpC;;;OAGG;IACI,8BAA8B,UAAS;IAE9C,yCAAyC;IAClC,KAAK,IAAI,aAAa;IAStB,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAOnC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,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CAYlM"}
@@ -5,7 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module LocatingElements
7
7
  */
8
- import { Id64 } from "@itwin/core-bentley";
8
+ import { expectDefined, Id64 } from "@itwin/core-bentley";
9
9
  import { Point2d, Point3d } from "@itwin/core-geometry";
10
10
  import { HitDetail, HitList, HitSource } from "./HitDetail";
11
11
  import { IModelApp } from "./IModelApp";
@@ -134,7 +134,7 @@ export class ElementPicker {
134
134
  }
135
135
  /** return the HitList for the last Pick performed. Optionally allows the caller to take ownership of the list. */
136
136
  getHitList(takeOwnership) {
137
- const list = this.hitList;
137
+ const list = expectDefined(this.hitList);
138
138
  if (takeOwnership)
139
139
  this.hitList = undefined;
140
140
  return list;
@@ -236,11 +236,12 @@ export class ElementPicker {
236
236
  hitPoint: hitPointWorld,
237
237
  distXY: testPointView.distance(elmPoint),
238
238
  });
239
- this.hitList.addHit(hit);
240
- if (this.hitList.hits.length > options.maxHits)
241
- this.hitList.hits.length = options.maxHits; // truncate array...
239
+ const hitList = expectDefined(this.hitList);
240
+ hitList.addHit(hit);
241
+ if (hitList.hits.length > options.maxHits)
242
+ hitList.hits.length = options.maxHits; // truncate array...
242
243
  }
243
- result = this.hitList.length;
244
+ result = expectDefined(this.hitList).length;
244
245
  };
245
246
  const args = {
246
247
  receiver,
@@ -256,7 +257,7 @@ export class ElementPicker {
256
257
  testHit(hit, vp, pickPointWorld, pickRadiusView, options) {
257
258
  if (0 === this.doPick(vp, pickPointWorld, pickRadiusView, options))
258
259
  return false;
259
- return this.hitList.hits.some((thisHit) => hit.isSameHit(thisHit));
260
+ return expectDefined(this.hitList).hits.some((thisHit) => hit.isSameHit(thisHit));
260
261
  }
261
262
  }
262
263
  /**
@@ -1 +1 @@
1
- {"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AM,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAC1E,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAErB,8FAA8F;QAC9F,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO;YACrB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LocatingElements\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { HitDetail, HitList, HitSource } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { Pixel } from \"./render/Pixel\";\r\nimport { InputSource, InteractiveTool } from \"./tools/Tool\";\r\nimport { ScreenViewport, Viewport } from \"./Viewport\";\r\nimport { ViewRect } from \"./common/ViewRect\";\r\n\r\n/** The possible actions for which a locate filter can be called.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum LocateAction {\r\n Identify = 0,\r\n AutoLocate = 1,\r\n}\r\n\r\n/** Values to return from a locate filter.\r\n * Return `Reject` to indicate the element is unacceptable.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum LocateFilterStatus {\r\n Accept = 0,\r\n Reject = 1,\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SnapStatus {\r\n Success = 0,\r\n Aborted = 1,\r\n NoElements = 2,\r\n Disabled = 100,\r\n NoSnapPossible = 200,\r\n NotSnappable = 300,\r\n FilteredByApp = 600,\r\n FilteredByAppQuietly = 700,\r\n}\r\n\r\n/** Options that customize the way element location (i.e. *picking*) works.\r\n * @public\r\n * @extensions\r\n */\r\nexport class LocateOptions {\r\n /** If true, also test graphics from view decorations. */\r\n public allowDecorations = false;\r\n /** If true, also test graphics with non-locatable flag set. */\r\n public allowNonLocatable = false;\r\n /** Maximum number of hits to return. */\r\n public maxHits = 20;\r\n /** The [[HitSource]] identifying the caller. */\r\n public hitSource = HitSource.DataPoint;\r\n /** If true, also test graphics from an IModelConnection other than the one associated with the Viewport. This can occur if, e.g., a\r\n * [[TiledGraphicsProvider]] is used to display graphics from a different iModel into the [[Viewport]].\r\n * @note If you override this, you must be prepared to properly handle [[HitDetail]]s originating from other IModelConnections.\r\n * @see [[HitDetail.iModel]] and [[HitDetail.isExternalIModelHit]]\r\n */\r\n public allowExternalIModels = false;\r\n /** If true, then the world point of a hit on a model will preserve any transforms applied to the model at display time,\r\n * such as those supplied by a [[ModelDisplayTransformProvider]] or [PlanProjectionSettings.elevation]($common).\r\n * Otherwise, the world point will be multiplied by the inverse of any such transforms to correlate it with the model's true coordinate space.\r\n */\r\n public preserveModelDisplayTransforms = false;\r\n\r\n /** Make a copy of this LocateOptions. */\r\n public clone(): LocateOptions {\r\n const other = new LocateOptions();\r\n other.allowDecorations = this.allowDecorations;\r\n other.allowNonLocatable = this.allowNonLocatable;\r\n other.maxHits = this.maxHits;\r\n other.hitSource = this.hitSource;\r\n other.allowExternalIModels = this.allowExternalIModels;\r\n return other;\r\n }\r\n public setFrom(other: LocateOptions): void {\r\n this.allowDecorations = other.allowDecorations;\r\n this.allowNonLocatable = other.allowNonLocatable;\r\n this.maxHits = other.maxHits;\r\n this.hitSource = other.hitSource;\r\n this.allowExternalIModels = other.allowExternalIModels;\r\n }\r\n public init() {\r\n this.allowDecorations = this.allowNonLocatable = this.allowExternalIModels = false;\r\n this.maxHits = 20;\r\n this.hitSource = HitSource.DataPoint;\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class LocateResponse {\r\n public snapStatus = SnapStatus.Success;\r\n public reason?: string;\r\n public explanation = \"\";\r\n\r\n /** @internal */\r\n public clone(): LocateResponse {\r\n const other = new LocateResponse();\r\n other.snapStatus = this.snapStatus;\r\n other.reason = this.reason;\r\n other.explanation = this.explanation;\r\n return other;\r\n }\r\n\r\n /** @internal */\r\n public setFrom(other: LocateResponse): void {\r\n this.snapStatus = other.snapStatus;\r\n this.reason = other.reason;\r\n this.explanation = other.explanation;\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface HitListHolder {\r\n setHitList(list: HitList<HitDetail> | undefined): void;\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class ElementPicker {\r\n public viewport?: Viewport;\r\n public readonly pickPointWorld = new Point3d();\r\n public hitList?: HitList<HitDetail>;\r\n\r\n public empty() {\r\n this.pickPointWorld.setZero();\r\n this.viewport = undefined;\r\n if (this.hitList)\r\n this.hitList.empty();\r\n else\r\n this.hitList = new HitList<HitDetail>();\r\n }\r\n\r\n /** return the HitList for the last Pick performed. Optionally allows the caller to take ownership of the list. */\r\n public getHitList(takeOwnership: boolean): HitList<HitDetail> {\r\n const list = this.hitList!;\r\n if (takeOwnership)\r\n this.hitList = undefined;\r\n return list;\r\n }\r\n\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** Return a hit from the list of hits created the last time pickElements was called. */\r\n public getHit(i: number): HitDetail | undefined { return this.hitList ? this.hitList.getHit(i) : undefined; }\r\n\r\n public resetCurrentHit(): void {\r\n if (this.hitList)\r\n this.hitList.resetCurrentHit();\r\n }\r\n\r\n private comparePixel(pixel1: Pixel.Data, pixel2: Pixel.Data, distXY1: number, distXY2: number) {\r\n let priority1 = pixel1.computeHitPriority();\r\n let priority2 = pixel2.computeHitPriority();\r\n\r\n // If two hits have the same priority, prefer a contour over a non-contour.\r\n priority1 -= pixel1.contour ? 0.5 : 0;\r\n priority2 -= pixel2.contour ? 0.5 : 0;\r\n\r\n if (priority1 < priority2)\r\n return -1;\r\n if (priority1 > priority2)\r\n return 1;\r\n if (distXY1 < distXY2)\r\n return -1;\r\n if (distXY1 > distXY2)\r\n return 1;\r\n if (pixel1.distanceFraction > pixel2.distanceFraction)\r\n return -1;\r\n if (pixel1.distanceFraction < pixel2.distanceFraction)\r\n return 1;\r\n\r\n return 0;\r\n }\r\n\r\n /** Generate a list of elements that are close to a given point.\r\n * @param vp Viewport to use for pick\r\n * @param pickPointWorld Pick location in world coordinates\r\n * @param pickRadiusView Pick radius in pixels\r\n * @param options Pick options to use\r\n * @param excludedElements Optional ids to not draw during pick. Allows hits for geometry obscured by these ids to be returned.\r\n * @returns The number of hits in the hitList of this object.\r\n */\r\n public doPick(vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions, excludedElements?: Iterable<Id64String>): number {\r\n if (this.hitList && this.hitList.length > 0 && vp === this.viewport && pickPointWorld.isAlmostEqual(this.pickPointWorld)) {\r\n this.hitList.resetCurrentHit();\r\n return this.hitList.length;\r\n }\r\n\r\n this.empty(); // empty the hit list\r\n this.viewport = vp;\r\n this.pickPointWorld.setFrom(pickPointWorld);\r\n\r\n const pickPointView = vp.worldToView(pickPointWorld);\r\n const testPointView = new Point2d(Math.floor(pickPointView.x + 0.5), Math.floor(pickPointView.y + 0.5));\r\n let pixelRadius = Math.floor(pickRadiusView + 0.5);\r\n const rect = new ViewRect(testPointView.x - pixelRadius, testPointView.y - pixelRadius, testPointView.x + pixelRadius, testPointView.y + pixelRadius);\r\n if (rect.isNull)\r\n return 0;\r\n const receiver = (pixels: Pixel.Buffer | undefined) => {\r\n if (undefined === pixels)\r\n return;\r\n\r\n testPointView.x = vp.cssPixelsToDevicePixels(testPointView.x);\r\n testPointView.y = vp.cssPixelsToDevicePixels(testPointView.y);\r\n pixelRadius = vp.cssPixelsToDevicePixels(pixelRadius);\r\n\r\n const elmHits = new Map<string, Point2d>();\r\n const testPoint = Point2d.createZero();\r\n for (testPoint.x = testPointView.x - pixelRadius; testPoint.x <= testPointView.x + pixelRadius; ++testPoint.x) {\r\n for (testPoint.y = testPointView.y - pixelRadius; testPoint.y <= testPointView.y + pixelRadius; ++testPoint.y) {\r\n const pixel = pixels.getPixel(testPoint.x, testPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId || Id64.isInvalid(pixel.elementId))\r\n continue; // no geometry at this location...\r\n\r\n const distXY = testPointView.distance(testPoint);\r\n if (distXY > pixelRadius)\r\n continue; // ignore corners. it's a locate circle not square...\r\n\r\n const oldPoint = elmHits.get(pixel.elementId);\r\n if (undefined !== oldPoint) {\r\n if (this.comparePixel(pixel, pixels.getPixel(oldPoint.x, oldPoint.y), distXY, testPointView.distance(oldPoint)) < 0)\r\n oldPoint.setFrom(testPoint); // new hit is better, update location...\r\n } else {\r\n elmHits.set(pixel.elementId, testPoint.clone());\r\n }\r\n }\r\n }\r\n if (0 === elmHits.size)\r\n return;\r\n\r\n for (const elmPoint of elmHits.values()) {\r\n const pixel = pixels.getPixel(elmPoint.x, elmPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId)\r\n continue;\r\n\r\n const hitPointWorld = vp.getPixelDataWorldPoint({\r\n pixels,\r\n x: elmPoint.x,\r\n y: elmPoint.y,\r\n preserveModelDisplayTransforms: options.preserveModelDisplayTransforms,\r\n });\r\n\r\n if (!hitPointWorld)\r\n continue;\r\n\r\n const hit = new HitDetail({\r\n ...pixel.toHitProps(vp),\r\n testPoint: pickPointWorld,\r\n viewport: vp,\r\n hitSource: options.hitSource,\r\n hitPoint: hitPointWorld,\r\n distXY: testPointView.distance(elmPoint),\r\n });\r\n\r\n this.hitList!.addHit(hit);\r\n if (this.hitList!.hits.length > options.maxHits)\r\n this.hitList!.hits.length = options.maxHits; // truncate array...\r\n }\r\n\r\n result = this.hitList!.length;\r\n };\r\n\r\n const args = {\r\n receiver,\r\n rect,\r\n selector: Pixel.Selector.All,\r\n excludeNonLocatable: !options.allowNonLocatable,\r\n excludedElements,\r\n };\r\n let result: number = 0;\r\n vp.readPixels(args);\r\n\r\n return result;\r\n }\r\n\r\n public testHit(hit: HitDetail, vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions): boolean {\r\n if (0 === this.doPick(vp, pickPointWorld, pickRadiusView, options))\r\n return false;\r\n\r\n return this.hitList!.hits.some((thisHit) => hit.isSameHit(thisHit));\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class ElementLocateManager {\r\n public hitList?: HitList<HitDetail>;\r\n public currHit?: HitDetail;\r\n public readonly options = new LocateOptions();\r\n public readonly picker = new ElementPicker();\r\n\r\n /** get the full message key for a locate failure */\r\n public static getFailureMessageKey(key: string) { return `LocateFailure.${key}`; }\r\n public onInitialized() { }\r\n public get apertureInches() { return 0.11; }\r\n public get touchApertureInches() { return 0.22; }\r\n\r\n public clear(): void { this.setCurrHit(undefined); }\r\n public setHitList(list?: HitList<HitDetail>) { this.hitList = list; }\r\n public setCurrHit(hit?: HitDetail): void { this.currHit = hit; }\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** return the current path from either the snapping logic or the pre-locating systems. */\r\n public getPreLocatedHit(): HitDetail | undefined {\r\n // NOTE: Check AccuSnap first as Tentative is used to build intersect snap. For normal snaps when a Tentative is active there should be no AccuSnap.\r\n const fromAccuSnap = IModelApp.accuSnap.getHitAndList(this);\r\n const preLocated = fromAccuSnap ?? IModelApp.tentativePoint.getHitAndList(this);\r\n\r\n if (preLocated) {\r\n const excludedElements = (preLocated.isElementHit ? new Set<string>([preLocated.sourceId]) : undefined);\r\n\r\n if (excludedElements || !fromAccuSnap) {\r\n // NOTE: For tentative snap, get new hit list at snap point; want reset to cycle hits using adjusted point location...\r\n const point = (fromAccuSnap ? preLocated.hitPoint : preLocated.getPoint());\r\n const vp = preLocated.viewport;\r\n\r\n this.picker.empty();\r\n this.picker.doPick(vp, point, (vp.pixelsFromInches(this.apertureInches) / 2.0) + 1.5, this.options, excludedElements);\r\n this.setHitList(this.picker.getHitList(true));\r\n\r\n if (excludedElements) {\r\n if (undefined === this.hitList)\r\n this.hitList = new HitList<HitDetail>();\r\n this.hitList.insertHit(0, preLocated);\r\n }\r\n }\r\n }\r\n\r\n if (this.hitList)\r\n this.hitList.resetCurrentHit();\r\n\r\n return preLocated;\r\n }\r\n\r\n public async filterHit(hit: HitDetail, _action: LocateAction, out: LocateResponse): Promise<LocateFilterStatus> {\r\n // Tools must opt-in to locate of transient geometry as it requires special treatment.\r\n if (!this.options.allowDecorations && !hit.isElementHit) {\r\n if (hit.isModelHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"RealityModel\");\r\n else if (hit.isMapHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Map\");\r\n else\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Transient\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n // Tools must opt-in to locate geometry from external iModels.\r\n if (!this.options.allowExternalIModels && hit.isExternalIModelHit) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ExternalIModel\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n if (undefined !== hit.subCategoryId && !hit.isExternalIModelHit) {\r\n const appearance = hit.viewport.getSubCategoryAppearance(hit.subCategoryId);\r\n if (appearance.dontLocate) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"NotLocatableSubCategory\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n }\r\n\r\n const tool = IModelApp.toolAdmin.activeTool;\r\n if (!(tool && tool instanceof InteractiveTool))\r\n return LocateFilterStatus.Accept;\r\n\r\n const status = await tool.filterHit(hit, out);\r\n if (LocateFilterStatus.Reject === status)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ByApp\");\r\n\r\n return status;\r\n }\r\n\r\n public initLocateOptions() { this.options.init(); }\r\n public initToolLocate() {\r\n this.initLocateOptions();\r\n this.clear();\r\n this.picker.empty();\r\n IModelApp.tentativePoint.clear(true);\r\n }\r\n\r\n private async _doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, vp: ScreenViewport | undefined, source: InputSource, filterHits: boolean): Promise<HitDetail | undefined> {\r\n if (!vp)\r\n return;\r\n\r\n // the \"newSearch\" flag indicates whether the caller wants us to conduct a new search at the testPoint, or just continue returning paths from the previous search.\r\n if (newSearch) {\r\n const hit = this.getPreLocatedHit();\r\n\r\n // if we're snapped to something, that path has the highest priority and becomes the active hit.\r\n if (hit) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(hit, LocateAction.Identify, response))\r\n return hit;\r\n\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n this.picker.empty();\r\n this.picker.doPick(vp, testPoint, (vp.pixelsFromInches(InputSource.Touch === source ? this.touchApertureInches : this.apertureInches) / 2.0) + 1.5, this.options);\r\n\r\n const hitList = this.picker.getHitList(true);\r\n this.setHitList(hitList);\r\n }\r\n\r\n let newHit: HitDetail | undefined;\r\n while (undefined !== (newHit = this.getNextHit())) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(newHit, LocateAction.Identify, response))\r\n return newHit;\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public async doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, view: ScreenViewport | undefined, source: InputSource, filterHits = true): Promise<HitDetail | undefined> {\r\n response.reason = ElementLocateManager.getFailureMessageKey(\"NoElements\");\r\n response.explanation = \"\";\r\n\r\n const hit = await this._doLocate(response, newSearch, testPoint, view, source, filterHits);\r\n this.setCurrHit(hit);\r\n\r\n // if we found a hit, remove it from the list of remaining hits near the current search point.\r\n if (hit && this.hitList)\r\n this.hitList.removeHitsFrom(hit.sourceId);\r\n return hit;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ElementLocateManager.js","sourceRoot":"","sources":["../../src/ElementLocateManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,uDAAY,CAAA;IACZ,2DAAc,CAAA;AAChB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+DAAU,CAAA;IACV,+DAAU,CAAA;AACZ,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IACpB,iDAAW,CAAA;IACX,iDAAW,CAAA;IACX,uDAAc,CAAA;IACd,qDAAc,CAAA;IACd,iEAAoB,CAAA;IACpB,6DAAkB,CAAA;IAClB,+DAAmB,CAAA;IACnB,6EAA0B,CAAA;AAC5B,CAAC,EATW,UAAU,KAAV,UAAU,QASrB;AAED;;;GAGG;AACH,MAAM,OAAO,aAAa;IACxB,yDAAyD;IAClD,gBAAgB,GAAG,KAAK,CAAC;IAChC,+DAA+D;IACxD,iBAAi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B,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,QAAwB,EAAE,SAAkB,EAAE,SAAkB,EAAE,IAAgC,EAAE,MAAmB,EAAE,UAAU,GAAG,IAAI;QAC9J,QAAQ,CAAC,MAAM,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAC1E,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAErB,8FAA8F;QAC9F,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO;YACrB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LocatingElements\r\n */\r\n\r\nimport { expectDefined, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { HitDetail, HitList, HitSource } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { Pixel } from \"./render/Pixel\";\r\nimport { InputSource, InteractiveTool } from \"./tools/Tool\";\r\nimport { ScreenViewport, Viewport } from \"./Viewport\";\r\nimport { ViewRect } from \"./common/ViewRect\";\r\n\r\n/** The possible actions for which a locate filter can be called.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum LocateAction {\r\n Identify = 0,\r\n AutoLocate = 1,\r\n}\r\n\r\n/** Values to return from a locate filter.\r\n * Return `Reject` to indicate the element is unacceptable.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum LocateFilterStatus {\r\n Accept = 0,\r\n Reject = 1,\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SnapStatus {\r\n Success = 0,\r\n Aborted = 1,\r\n NoElements = 2,\r\n Disabled = 100,\r\n NoSnapPossible = 200,\r\n NotSnappable = 300,\r\n FilteredByApp = 600,\r\n FilteredByAppQuietly = 700,\r\n}\r\n\r\n/** Options that customize the way element location (i.e. *picking*) works.\r\n * @public\r\n * @extensions\r\n */\r\nexport class LocateOptions {\r\n /** If true, also test graphics from view decorations. */\r\n public allowDecorations = false;\r\n /** If true, also test graphics with non-locatable flag set. */\r\n public allowNonLocatable = false;\r\n /** Maximum number of hits to return. */\r\n public maxHits = 20;\r\n /** The [[HitSource]] identifying the caller. */\r\n public hitSource = HitSource.DataPoint;\r\n /** If true, also test graphics from an IModelConnection other than the one associated with the Viewport. This can occur if, e.g., a\r\n * [[TiledGraphicsProvider]] is used to display graphics from a different iModel into the [[Viewport]].\r\n * @note If you override this, you must be prepared to properly handle [[HitDetail]]s originating from other IModelConnections.\r\n * @see [[HitDetail.iModel]] and [[HitDetail.isExternalIModelHit]]\r\n */\r\n public allowExternalIModels = false;\r\n /** If true, then the world point of a hit on a model will preserve any transforms applied to the model at display time,\r\n * such as those supplied by a [[ModelDisplayTransformProvider]] or [PlanProjectionSettings.elevation]($common).\r\n * Otherwise, the world point will be multiplied by the inverse of any such transforms to correlate it with the model's true coordinate space.\r\n */\r\n public preserveModelDisplayTransforms = false;\r\n\r\n /** Make a copy of this LocateOptions. */\r\n public clone(): LocateOptions {\r\n const other = new LocateOptions();\r\n other.allowDecorations = this.allowDecorations;\r\n other.allowNonLocatable = this.allowNonLocatable;\r\n other.maxHits = this.maxHits;\r\n other.hitSource = this.hitSource;\r\n other.allowExternalIModels = this.allowExternalIModels;\r\n return other;\r\n }\r\n public setFrom(other: LocateOptions): void {\r\n this.allowDecorations = other.allowDecorations;\r\n this.allowNonLocatable = other.allowNonLocatable;\r\n this.maxHits = other.maxHits;\r\n this.hitSource = other.hitSource;\r\n this.allowExternalIModels = other.allowExternalIModels;\r\n }\r\n public init() {\r\n this.allowDecorations = this.allowNonLocatable = this.allowExternalIModels = false;\r\n this.maxHits = 20;\r\n this.hitSource = HitSource.DataPoint;\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class LocateResponse {\r\n public snapStatus = SnapStatus.Success;\r\n public reason?: string;\r\n public explanation = \"\";\r\n\r\n /** @internal */\r\n public clone(): LocateResponse {\r\n const other = new LocateResponse();\r\n other.snapStatus = this.snapStatus;\r\n other.reason = this.reason;\r\n other.explanation = this.explanation;\r\n return other;\r\n }\r\n\r\n /** @internal */\r\n public setFrom(other: LocateResponse): void {\r\n this.snapStatus = other.snapStatus;\r\n this.reason = other.reason;\r\n this.explanation = other.explanation;\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface HitListHolder {\r\n setHitList(list: HitList<HitDetail> | undefined): void;\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class ElementPicker {\r\n public viewport?: Viewport;\r\n public readonly pickPointWorld = new Point3d();\r\n public hitList?: HitList<HitDetail>;\r\n\r\n public empty() {\r\n this.pickPointWorld.setZero();\r\n this.viewport = undefined;\r\n if (this.hitList)\r\n this.hitList.empty();\r\n else\r\n this.hitList = new HitList<HitDetail>();\r\n }\r\n\r\n /** return the HitList for the last Pick performed. Optionally allows the caller to take ownership of the list. */\r\n public getHitList(takeOwnership: boolean): HitList<HitDetail> {\r\n const list = expectDefined(this.hitList);\r\n if (takeOwnership)\r\n this.hitList = undefined;\r\n return list;\r\n }\r\n\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** Return a hit from the list of hits created the last time pickElements was called. */\r\n public getHit(i: number): HitDetail | undefined { return this.hitList ? this.hitList.getHit(i) : undefined; }\r\n\r\n public resetCurrentHit(): void {\r\n if (this.hitList)\r\n this.hitList.resetCurrentHit();\r\n }\r\n\r\n private comparePixel(pixel1: Pixel.Data, pixel2: Pixel.Data, distXY1: number, distXY2: number) {\r\n let priority1 = pixel1.computeHitPriority();\r\n let priority2 = pixel2.computeHitPriority();\r\n\r\n // If two hits have the same priority, prefer a contour over a non-contour.\r\n priority1 -= pixel1.contour ? 0.5 : 0;\r\n priority2 -= pixel2.contour ? 0.5 : 0;\r\n\r\n if (priority1 < priority2)\r\n return -1;\r\n if (priority1 > priority2)\r\n return 1;\r\n if (distXY1 < distXY2)\r\n return -1;\r\n if (distXY1 > distXY2)\r\n return 1;\r\n if (pixel1.distanceFraction > pixel2.distanceFraction)\r\n return -1;\r\n if (pixel1.distanceFraction < pixel2.distanceFraction)\r\n return 1;\r\n\r\n return 0;\r\n }\r\n\r\n /** Generate a list of elements that are close to a given point.\r\n * @param vp Viewport to use for pick\r\n * @param pickPointWorld Pick location in world coordinates\r\n * @param pickRadiusView Pick radius in pixels\r\n * @param options Pick options to use\r\n * @param excludedElements Optional ids to not draw during pick. Allows hits for geometry obscured by these ids to be returned.\r\n * @returns The number of hits in the hitList of this object.\r\n */\r\n public doPick(vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions, excludedElements?: Iterable<Id64String>): number {\r\n if (this.hitList && this.hitList.length > 0 && vp === this.viewport && pickPointWorld.isAlmostEqual(this.pickPointWorld)) {\r\n this.hitList.resetCurrentHit();\r\n return this.hitList.length;\r\n }\r\n\r\n this.empty(); // empty the hit list\r\n this.viewport = vp;\r\n this.pickPointWorld.setFrom(pickPointWorld);\r\n\r\n const pickPointView = vp.worldToView(pickPointWorld);\r\n const testPointView = new Point2d(Math.floor(pickPointView.x + 0.5), Math.floor(pickPointView.y + 0.5));\r\n let pixelRadius = Math.floor(pickRadiusView + 0.5);\r\n const rect = new ViewRect(testPointView.x - pixelRadius, testPointView.y - pixelRadius, testPointView.x + pixelRadius, testPointView.y + pixelRadius);\r\n if (rect.isNull)\r\n return 0;\r\n const receiver = (pixels: Pixel.Buffer | undefined) => {\r\n if (undefined === pixels)\r\n return;\r\n\r\n testPointView.x = vp.cssPixelsToDevicePixels(testPointView.x);\r\n testPointView.y = vp.cssPixelsToDevicePixels(testPointView.y);\r\n pixelRadius = vp.cssPixelsToDevicePixels(pixelRadius);\r\n\r\n const elmHits = new Map<string, Point2d>();\r\n const testPoint = Point2d.createZero();\r\n for (testPoint.x = testPointView.x - pixelRadius; testPoint.x <= testPointView.x + pixelRadius; ++testPoint.x) {\r\n for (testPoint.y = testPointView.y - pixelRadius; testPoint.y <= testPointView.y + pixelRadius; ++testPoint.y) {\r\n const pixel = pixels.getPixel(testPoint.x, testPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId || Id64.isInvalid(pixel.elementId))\r\n continue; // no geometry at this location...\r\n\r\n const distXY = testPointView.distance(testPoint);\r\n if (distXY > pixelRadius)\r\n continue; // ignore corners. it's a locate circle not square...\r\n\r\n const oldPoint = elmHits.get(pixel.elementId);\r\n if (undefined !== oldPoint) {\r\n if (this.comparePixel(pixel, pixels.getPixel(oldPoint.x, oldPoint.y), distXY, testPointView.distance(oldPoint)) < 0)\r\n oldPoint.setFrom(testPoint); // new hit is better, update location...\r\n } else {\r\n elmHits.set(pixel.elementId, testPoint.clone());\r\n }\r\n }\r\n }\r\n if (0 === elmHits.size)\r\n return;\r\n\r\n for (const elmPoint of elmHits.values()) {\r\n const pixel = pixels.getPixel(elmPoint.x, elmPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId)\r\n continue;\r\n\r\n const hitPointWorld = vp.getPixelDataWorldPoint({\r\n pixels,\r\n x: elmPoint.x,\r\n y: elmPoint.y,\r\n preserveModelDisplayTransforms: options.preserveModelDisplayTransforms,\r\n });\r\n\r\n if (!hitPointWorld)\r\n continue;\r\n\r\n const hit = new HitDetail({\r\n ...pixel.toHitProps(vp),\r\n testPoint: pickPointWorld,\r\n viewport: vp,\r\n hitSource: options.hitSource,\r\n hitPoint: hitPointWorld,\r\n distXY: testPointView.distance(elmPoint),\r\n });\r\n\r\n const hitList = expectDefined(this.hitList);\r\n hitList.addHit(hit);\r\n if (hitList.hits.length > options.maxHits)\r\n hitList.hits.length = options.maxHits; // truncate array...\r\n }\r\n\r\n result = expectDefined(this.hitList).length;\r\n };\r\n\r\n const args = {\r\n receiver,\r\n rect,\r\n selector: Pixel.Selector.All,\r\n excludeNonLocatable: !options.allowNonLocatable,\r\n excludedElements,\r\n };\r\n let result: number = 0;\r\n vp.readPixels(args);\r\n\r\n return result;\r\n }\r\n\r\n public testHit(hit: HitDetail, vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions): boolean {\r\n if (0 === this.doPick(vp, pickPointWorld, pickRadiusView, options))\r\n return false;\r\n\r\n return expectDefined(this.hitList).hits.some((thisHit) => hit.isSameHit(thisHit));\r\n }\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class ElementLocateManager {\r\n public hitList?: HitList<HitDetail>;\r\n public currHit?: HitDetail;\r\n public readonly options = new LocateOptions();\r\n public readonly picker = new ElementPicker();\r\n\r\n /** get the full message key for a locate failure */\r\n public static getFailureMessageKey(key: string) { return `LocateFailure.${key}`; }\r\n public onInitialized() { }\r\n public get apertureInches() { return 0.11; }\r\n public get touchApertureInches() { return 0.22; }\r\n\r\n public clear(): void { this.setCurrHit(undefined); }\r\n public setHitList(list?: HitList<HitDetail>) { this.hitList = list; }\r\n public setCurrHit(hit?: HitDetail): void { this.currHit = hit; }\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** return the current path from either the snapping logic or the pre-locating systems. */\r\n public getPreLocatedHit(): HitDetail | undefined {\r\n // NOTE: Check AccuSnap first as Tentative is used to build intersect snap. For normal snaps when a Tentative is active there should be no AccuSnap.\r\n const fromAccuSnap = IModelApp.accuSnap.getHitAndList(this);\r\n const preLocated = fromAccuSnap ?? IModelApp.tentativePoint.getHitAndList(this);\r\n\r\n if (preLocated) {\r\n const excludedElements = (preLocated.isElementHit ? new Set<string>([preLocated.sourceId]) : undefined);\r\n\r\n if (excludedElements || !fromAccuSnap) {\r\n // NOTE: For tentative snap, get new hit list at snap point; want reset to cycle hits using adjusted point location...\r\n const point = (fromAccuSnap ? preLocated.hitPoint : preLocated.getPoint());\r\n const vp = preLocated.viewport;\r\n\r\n this.picker.empty();\r\n this.picker.doPick(vp, point, (vp.pixelsFromInches(this.apertureInches) / 2.0) + 1.5, this.options, excludedElements);\r\n this.setHitList(this.picker.getHitList(true));\r\n\r\n if (excludedElements) {\r\n if (undefined === this.hitList)\r\n this.hitList = new HitList<HitDetail>();\r\n this.hitList.insertHit(0, preLocated);\r\n }\r\n }\r\n }\r\n\r\n if (this.hitList)\r\n this.hitList.resetCurrentHit();\r\n\r\n return preLocated;\r\n }\r\n\r\n public async filterHit(hit: HitDetail, _action: LocateAction, out: LocateResponse): Promise<LocateFilterStatus> {\r\n // Tools must opt-in to locate of transient geometry as it requires special treatment.\r\n if (!this.options.allowDecorations && !hit.isElementHit) {\r\n if (hit.isModelHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"RealityModel\");\r\n else if (hit.isMapHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Map\");\r\n else\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Transient\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n // Tools must opt-in to locate geometry from external iModels.\r\n if (!this.options.allowExternalIModels && hit.isExternalIModelHit) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ExternalIModel\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n if (undefined !== hit.subCategoryId && !hit.isExternalIModelHit) {\r\n const appearance = hit.viewport.getSubCategoryAppearance(hit.subCategoryId);\r\n if (appearance.dontLocate) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"NotLocatableSubCategory\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n }\r\n\r\n const tool = IModelApp.toolAdmin.activeTool;\r\n if (!(tool && tool instanceof InteractiveTool))\r\n return LocateFilterStatus.Accept;\r\n\r\n const status = await tool.filterHit(hit, out);\r\n if (LocateFilterStatus.Reject === status)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ByApp\");\r\n\r\n return status;\r\n }\r\n\r\n public initLocateOptions() { this.options.init(); }\r\n public initToolLocate() {\r\n this.initLocateOptions();\r\n this.clear();\r\n this.picker.empty();\r\n IModelApp.tentativePoint.clear(true);\r\n }\r\n\r\n private async _doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, vp: ScreenViewport | undefined, source: InputSource, filterHits: boolean): Promise<HitDetail | undefined> {\r\n if (!vp)\r\n return;\r\n\r\n // the \"newSearch\" flag indicates whether the caller wants us to conduct a new search at the testPoint, or just continue returning paths from the previous search.\r\n if (newSearch) {\r\n const hit = this.getPreLocatedHit();\r\n\r\n // if we're snapped to something, that path has the highest priority and becomes the active hit.\r\n if (hit) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(hit, LocateAction.Identify, response))\r\n return hit;\r\n\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n this.picker.empty();\r\n this.picker.doPick(vp, testPoint, (vp.pixelsFromInches(InputSource.Touch === source ? this.touchApertureInches : this.apertureInches) / 2.0) + 1.5, this.options);\r\n\r\n const hitList = this.picker.getHitList(true);\r\n this.setHitList(hitList);\r\n }\r\n\r\n let newHit: HitDetail | undefined;\r\n while (undefined !== (newHit = this.getNextHit())) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(newHit, LocateAction.Identify, response))\r\n return newHit;\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public async doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, view: ScreenViewport | undefined, source: InputSource, filterHits = true): Promise<HitDetail | undefined> {\r\n response.reason = ElementLocateManager.getFailureMessageKey(\"NoElements\");\r\n response.explanation = \"\";\r\n\r\n const hit = await this._doLocate(response, newSearch, testPoint, view, source, filterHits);\r\n this.setCurrHit(hit);\r\n\r\n // if we found a hit, remove it from the list of remaining hits near the current search point.\r\n if (hit && this.hitList)\r\n this.hitList.removeHitsFrom(hit.sourceId);\r\n return hit;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EmphasizeElements.d.ts","sourceRoot":"","sources":["../../src/EmphasizeElements.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAA2B,QAAQ,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,mBAAmB,EAAY,MAAM,oBAAoB,CAAC;AACjJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,uBAAuB;IAC/D,OAAO,CAAC,kBAAkB,CAAC,CAAoB;IAC/C,OAAO,CAAC,qBAAqB,CAAC,CAAoB;IAClD,OAAO,CAAC,kBAAkB,CAAC,CAAU;IACrC,OAAO,CAAC,mBAAmB,CAAC,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAoD;IAE1F,4LAA4L;IACrL,YAAY,UAAS;IAE5B;;OAEG;IACI,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,CAAC,SAAS,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI;IA4CrF,gBAAgB;IAChB,SAAS,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB;IAiBjE,oDAAoD;IAC7C,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,GAAG,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;;;;OAQG;IACI,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAE,mBAAmD,EAAE,OAAO,GAAE,OAAe,GAAG,OAAO;IA4CtK;;;;;;;;OAQG;IACI,wBAAwB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAE,mBAAmD,EAAE,OAAO,GAAE,OAAe,EAAE,cAAc,GAAE,OAAc,GAAG,OAAO;IAShM,oFAAoF;IAC7E,QAAQ,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO;IAEtC;;OAEG;IACI,MAAM,CAAC,EAAE,EAAE,QAAQ,GAAG,sBAAsB;IAyCnD;;OAEG;IACI,QAAQ,CAAC,KAAK,EAAE,sBAAsB,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO;IAoCrE,4HAA4H;WAC9G,GAAG,CAAC,EAAE,EAAE,QAAQ,GAAG,iBAAiB,GAAG,SAAS;IAI9D,mIAAmI;WACrH,WAAW,CAAC,EAAE,EAAE,QAAQ,GAAG,iBAAiB;IAU1D,kHAAkH;WACpG,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,YAAY,GAAE,OAAe;CAUhE"}
@@ -25,7 +25,9 @@ export class EmphasizeElements {
25
25
  addFeatureOverrides(overrides, vp) {
26
26
  const emphasizedElements = this.getEmphasizedElements(vp);
27
27
  if (undefined !== emphasizedElements) {
28
- overrides.setDefaultOverrides(this._defaultAppearance);
28
+ if (this._defaultAppearance !== undefined) {
29
+ overrides.setDefaultOverrides(this._defaultAppearance);
30
+ }
29
31
  const appearance = this.wantEmphasis ? this._emphasizedAppearance : FeatureAppearance.defaults;
30
32
  // Avoid creating a new object per-element inside the loop
31
33
  const args = { elementId: "", appearance };
@@ -1 +1 @@
1
- {"version":3,"file":"EmphasizeElements.js","sourceRoot":"","sources":["../../src/EmphasizeElements.ts"],"names":[],"mappings":"AAAA;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AAK,CAAC,YAAY,CAAC;QACjD,IAAI,YAAY,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;YACjC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,4HAA4H;IACrH,MAAM,CAAC,GAAG,CAAC,EAAY;QAC5B,OAAO,EAAE,CAAC,iCAAiC,CAAoB,iBAAiB,CAAC,CAAC;IACpF,CAAC;IAED,mIAAmI;IAC5H,MAAM,CAAC,WAAW,CAAC,EAAY;QACpC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;YACnC,EAAE,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,kHAAkH;IAC3G,MAAM,CAAC,KAAK,CAAC,EAAY,EAAE,eAAwB,KAAK;QAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAI,SAAS,KAAK,QAAQ,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACnE,OAAO;QAET,EAAE,CAAC,eAAe,EAAE,CAAC;QACrB,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64, Id64Arg, Id64Set } from \"@itwin/core-bentley\";\r\nimport { AppearanceOverrideProps, ColorDef, EmphasizeElementsProps, FeatureAppearance, FeatureOverrideType, RgbColor } from \"@itwin/core-common\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { FeatureOverrideProvider } from \"./FeatureOverrideProvider\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/** An implementation of [[FeatureOverrideProvider]] for emphasizing selected elements through simple color/transparency appearance overrides.\r\n * @public\r\n * @extensions\r\n */\r\nexport class EmphasizeElements implements FeatureOverrideProvider {\r\n private _defaultAppearance?: FeatureAppearance;\r\n private _unanimatedAppearance?: FeatureAppearance;\r\n private _emphasizeIsolated?: Id64Set;\r\n private _overrideAppearance?: Map<number, Id64Set>;\r\n private readonly _emphasizedAppearance = FeatureAppearance.fromJSON({ emphasized: true });\r\n\r\n /** If true, all overridden and emphasized elements will also have the \"emphasis\" effect applied to them. This causes them to be hilited using the current [[Viewport.emphasisSettings]]. */\r\n public wantEmphasis = false;\r\n\r\n /** Establish active feature overrides to emphasize elements and apply color/transparency overrides.\r\n * @see [[Viewport.addFeatureOverrideProvider]]\r\n */\r\n public addFeatureOverrides(overrides: FeatureSymbology.Overrides, vp: Viewport): void {\r\n const emphasizedElements = this.getEmphasizedElements(vp);\r\n if (undefined !== emphasizedElements) {\r\n overrides.setDefaultOverrides(this._defaultAppearance!);\r\n const appearance = this.wantEmphasis ? this._emphasizedAppearance : FeatureAppearance.defaults;\r\n\r\n // Avoid creating a new object per-element inside the loop\r\n const args = { elementId: \"\", appearance };\r\n for (const elementId of emphasizedElements) {\r\n args.elementId = elementId;\r\n overrides.override(args);\r\n }\r\n\r\n // Do not apply animation overrides to de-emphasized elements.\r\n overrides.ignoreAnimationOverrides((args) => {\r\n const id = Id64.fromUint32Pair(args.elementId.lower, args.elementId.upper);\r\n return !emphasizedElements.has(id);\r\n });\r\n }\r\n\r\n const overriddenElements = this.getOverriddenElements();\r\n if (undefined !== overriddenElements) {\r\n if (undefined !== this._defaultAppearance)\r\n overrides.setDefaultOverrides(this._defaultAppearance);\r\n\r\n // Avoid creating a new object per-element inside the loop\r\n const args = { elementId: \"\", appearance: FeatureAppearance.defaults };\r\n for (const [key, ids] of overriddenElements) {\r\n args.appearance = this.createAppearanceFromKey(key);\r\n for (const elementId of ids) {\r\n args.elementId = elementId;\r\n overrides.override(args);\r\n }\r\n }\r\n }\r\n\r\n if (this._unanimatedAppearance) {\r\n if (this._unanimatedAppearance.isFullyTransparent)\r\n overrides.neverDrawnAnimationNodes.add(0);\r\n else\r\n overrides.animationNodeOverrides.set(0, this._unanimatedAppearance);\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected createAppearanceFromKey(key: number): FeatureAppearance {\r\n let transparency: number | undefined;\r\n let rgb: RgbColor | undefined;\r\n\r\n if (key < 0) {\r\n transparency = Math.abs(key);\r\n } else {\r\n const color = ColorDef.fromJSON(key);\r\n rgb = RgbColor.fromColorDef(color);\r\n if (0 !== color.getAlpha()) // Fully transparent signifies to use color only...\r\n transparency = color.getTransparency() / 255;\r\n }\r\n\r\n const emphasized = this.wantEmphasis ? true : undefined;\r\n return FeatureAppearance.fromJSON({ rgb, transparency, emphasized });\r\n }\r\n\r\n /** Get override key from color and override type */\r\n public createOverrideKey(color: ColorDef, override: FeatureOverrideType): number | undefined {\r\n const colorValues = color.colors;\r\n switch (override) {\r\n case FeatureOverrideType.ColorAndAlpha:\r\n return 255 === colorValues.t ? undefined : color.tbgr; // Hiding elements should be done using neverDrawn, not transparency...\r\n case FeatureOverrideType.ColorOnly:\r\n return ColorDef.from(colorValues.r, colorValues.g, colorValues.b, 255).tbgr;\r\n case FeatureOverrideType.AlphaOnly:\r\n return -(colorValues.t / 255);\r\n }\r\n }\r\n\r\n /** Get color and override type for the given key. */\r\n public getOverrideFromKey(key: number): { overrideType: FeatureOverrideType, color: ColorDef } {\r\n let overrideType;\r\n let color;\r\n\r\n if (key < 0) {\r\n color = ColorDef.from(0, 0, 0, 255 * Math.abs(key));\r\n overrideType = FeatureOverrideType.AlphaOnly;\r\n } else {\r\n color = ColorDef.fromJSON(key);\r\n if (0 === color.getAlpha()) {\r\n color = color.withAlpha(255);\r\n overrideType = FeatureOverrideType.ColorOnly;\r\n } else {\r\n overrideType = FeatureOverrideType.ColorAndAlpha;\r\n }\r\n }\r\n\r\n return { overrideType, color };\r\n }\r\n\r\n /** Establish a default appearance to apply to elements without overrides. If changing the default appearance\r\n * without also calling overrideElements, an explicit refresh must be requested for the change to take effect.\r\n * @see [[Viewport.setFeatureOverrideProviderChanged]]\r\n */\r\n public get defaultAppearance(): FeatureAppearance | undefined { return this._defaultAppearance; }\r\n public set defaultAppearance(appearance: FeatureAppearance | undefined) { this._defaultAppearance = appearance; }\r\n\r\n /** Establish a default appearance to apply to elements that are not animated by the view's [RenderSchedule.Script]($common).\r\n * @note If this is the only change made to EmphasizeElements, you must call [[Viewport.setFeatureOverrideProviderChanged]] for\r\n * the change to take immediate effect.\r\n * @see [[createDefaultAppearance]] to create an appearance suitable for de-emphasizing the non-animated elements.\r\n */\r\n public get unanimatedAppearance(): FeatureAppearance | undefined {\r\n return this._unanimatedAppearance;\r\n }\r\n public set unanimatedAppearance(appearance: FeatureAppearance | undefined) {\r\n this._unanimatedAppearance = appearance;\r\n }\r\n\r\n /** Create default appearance to use for emphasizeElements when not supplied by caller. */\r\n public createDefaultAppearance(): FeatureAppearance {\r\n return FeatureAppearance.fromJSON({\r\n rgb: new RgbColor(0xe4, 0xe4, 0xe4),\r\n transparency: 0.8,\r\n nonLocatable: true,\r\n });\r\n }\r\n\r\n /** Get the IDs of the currently never drawn elements. */\r\n public getNeverDrawnElements(vp: Viewport): Id64Set | undefined {\r\n return (undefined !== vp.neverDrawn && 0 !== vp.neverDrawn.size ? vp.neverDrawn : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently always drawn elements. */\r\n public getAlwaysDrawnElements(vp: Viewport): Id64Set | undefined {\r\n return (undefined !== vp.alwaysDrawn && 0 !== vp.alwaysDrawn.size ? vp.alwaysDrawn : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently hidden elements. */\r\n public getHiddenElements(vp: Viewport): Id64Set | undefined {\r\n return this.getNeverDrawnElements(vp);\r\n }\r\n\r\n /** Get the IDs of the currently isolated elements. */\r\n public getIsolatedElements(vp: Viewport): Id64Set | undefined {\r\n return (vp.isAlwaysDrawnExclusive ? this.getAlwaysDrawnElements(vp) : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently emphasized isolated elements. */\r\n public getEmphasizedIsolatedElements(): Id64Set | undefined {\r\n return (undefined !== this._defaultAppearance && undefined !== this._emphasizeIsolated && 0 !== this._emphasizeIsolated.size ? this._emphasizeIsolated : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently emphasized elements. */\r\n public getEmphasizedElements(vp: Viewport): Id64Set | undefined {\r\n return (undefined !== this.getEmphasizedIsolatedElements() ? this._emphasizeIsolated : (undefined !== this._defaultAppearance && !vp.isAlwaysDrawnExclusive ? this.getAlwaysDrawnElements(vp) : undefined));\r\n }\r\n\r\n /** Get the map of current elements with color/transparency overrides. */\r\n public getOverriddenElements(): Map<number, Id64Set> | undefined {\r\n return (undefined !== this._overrideAppearance && 0 !== this._overrideAppearance.size ? this._overrideAppearance : undefined);\r\n }\r\n\r\n /** Get the IDs of current elements with the specified color/transparency override. */\r\n public getOverriddenElementsByKey(key: number): Id64Set | undefined {\r\n return (undefined !== this._overrideAppearance ? this._overrideAppearance.get(key) : undefined);\r\n }\r\n\r\n /** Clear never drawn elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearNeverDrawnElements(vp: Viewport): boolean {\r\n if (undefined === this.getNeverDrawnElements(vp))\r\n return false;\r\n vp.clearNeverDrawn();\r\n return true;\r\n }\r\n\r\n /** Clear always drawn elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearAlwaysDrawnElements(vp: Viewport): boolean {\r\n if (undefined === this.getAlwaysDrawnElements(vp))\r\n return false;\r\n vp.clearAlwaysDrawn();\r\n return true;\r\n }\r\n\r\n /** Clear hidden elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearHiddenElements(vp: Viewport): boolean {\r\n return this.clearNeverDrawnElements(vp);\r\n }\r\n\r\n /** Clear isolated elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearIsolatedElements(vp: Viewport): boolean {\r\n if (undefined === this.getIsolatedElements(vp))\r\n return false;\r\n if (this.clearEmphasizedIsolatedElements(vp, true))\r\n return true;\r\n return this.clearAlwaysDrawnElements(vp);\r\n }\r\n\r\n /** Clear emphasized elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearEmphasizedElements(vp: Viewport): boolean {\r\n if (undefined === this.getEmphasizedElements(vp))\r\n return false;\r\n\r\n if (this.clearEmphasizedIsolatedElements(vp, false))\r\n return true;\r\n\r\n if (!this.clearAlwaysDrawnElements(vp))\r\n return false;\r\n\r\n this._defaultAppearance = undefined;\r\n return true;\r\n }\r\n\r\n /** Clear emphasized isolated elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearEmphasizedIsolatedElements(vp: Viewport, setToAlwaysDrawn: boolean): boolean {\r\n const emphasizedIsolated = this.getEmphasizedIsolatedElements();\r\n this._emphasizeIsolated = undefined; // Always clear in case default appearance was unset...\r\n if (undefined === emphasizedIsolated)\r\n return false;\r\n\r\n if (setToAlwaysDrawn && this.setAlwaysDrawnElements(emphasizedIsolated, vp, false))\r\n return true;\r\n\r\n this._defaultAppearance = undefined;\r\n vp.setFeatureOverrideProviderChanged();\r\n return true;\r\n }\r\n\r\n /** Clear color/transparency overrides from elements. Removes all overrides when keyOrIds isn't supplied.\r\n * @param keyOrIds Specify a key value from [[EmphasizeElements.getOverriddenElements]] or [[EmphasizeElements.createOverrideKey]]\r\n * to remove a single color/transparency override for the corresponding elements or specify the IDs of elements to\r\n * remove any color/transparency override from.\r\n * @return false if nothing to clear.\r\n */\r\n public clearOverriddenElements(vp: Viewport, keyOrIds?: number | Id64Arg): boolean {\r\n if (undefined === this._overrideAppearance)\r\n return false;\r\n\r\n if (undefined !== keyOrIds) {\r\n if (typeof keyOrIds === \"number\") {\r\n if (!this._overrideAppearance.delete(keyOrIds))\r\n return false;\r\n } else {\r\n let changed = false;\r\n\r\n for (const [otherKey, otherIds] of this._overrideAppearance) {\r\n const oldSize = otherIds.size;\r\n for (const id of Id64.iterable(keyOrIds))\r\n otherIds.delete(id);\r\n\r\n if (oldSize !== otherIds.size)\r\n changed = true;\r\n\r\n if (0 === otherIds.size)\r\n this._overrideAppearance.delete(otherKey);\r\n }\r\n\r\n if (!changed)\r\n return false;\r\n }\r\n } else {\r\n this._overrideAppearance = undefined;\r\n }\r\n vp.setFeatureOverrideProviderChanged();\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n protected updateIdSet(ids: Id64Arg, replace: boolean, existingIds?: Id64Set): Id64Set | undefined {\r\n const newIds = new Set<string>();\r\n for (const id of Id64.iterable(ids))\r\n newIds.add(id);\r\n\r\n if (0 === newIds.size)\r\n return undefined;\r\n\r\n const oldSize = (!replace && undefined !== existingIds ? existingIds.size : 0);\r\n if (0 !== oldSize && undefined !== existingIds)\r\n for (const id of existingIds)\r\n newIds.add(id);\r\n\r\n if (oldSize === newIds.size)\r\n return undefined;\r\n\r\n return newIds;\r\n }\r\n\r\n /** Set the element IDs to be never drawn.\r\n * @param ids The IDs of the elements to never draw.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently hidden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.neverDrawn]]\r\n * @internal\r\n */\r\n public setNeverDrawnElements(ids: Id64Arg, vp: Viewport, replace: boolean = true): boolean {\r\n const hiddenIds = this.updateIdSet(ids, replace, vp.neverDrawn);\r\n if (undefined === hiddenIds)\r\n return false;\r\n vp.setNeverDrawn(hiddenIds);\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be always drawn.\r\n * @param ids The IDs of the elements to always draw.\r\n * @param vp The viewport.\r\n * @param exclusive If true, *only* the specified elements will be drawn.\r\n * @param replace true to replace currently always drawn elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n * @internal\r\n */\r\n public setAlwaysDrawnElements(ids: Id64Arg, vp: Viewport, exclusive: boolean = true, replace: boolean = true): boolean {\r\n const visibleIds = this.updateIdSet(ids, replace, vp.alwaysDrawn);\r\n if (undefined === visibleIds)\r\n return false;\r\n vp.setAlwaysDrawn(visibleIds, exclusive);\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be never drawn.\r\n * @param ids The IDs of the elements to never draw.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently hidden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.neverDrawn]]\r\n */\r\n public hideElements(ids: Id64Arg, vp: Viewport, replace: boolean = false): boolean {\r\n return this.setNeverDrawnElements(ids, vp, replace);\r\n }\r\n\r\n /** Set the currently selected elements to be never drawn.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently hidden elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.neverDrawn]]\r\n */\r\n public hideSelectedElements(vp: Viewport, replace: boolean = false, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.hideElements(selection.elements, vp, replace))\r\n return false;\r\n if (clearSelection)\r\n selection.emptyAll();\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be always drawn exclusively.\r\n * @param ids The IDs of the elements to always draw.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently isolated elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public isolateElements(ids: Id64Arg, vp: Viewport, replace: boolean = true): boolean {\r\n const wasEmphasized = (undefined !== this.getEmphasizedElements(vp));\r\n if (!this.setAlwaysDrawnElements(ids, vp, true, replace))\r\n return false;\r\n\r\n if (wasEmphasized)\r\n this._defaultAppearance = this._emphasizeIsolated = undefined; // Don't clear defaultAppearance unless it was established by emphasize...\r\n\r\n return true;\r\n }\r\n\r\n /** Set the currently selected elements to be always drawn exclusively.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently isolated elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public isolateSelectedElements(vp: Viewport, replace: boolean = true, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.isolateElements(selection.elements, vp, replace))\r\n return false;\r\n if (clearSelection)\r\n selection.emptyAll();\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be always drawn normally with all other elements in the view overridden to draw using a default appearance.\r\n * @param ids The IDs of the elements to always draw.\r\n * @param vp The viewport.\r\n * @param defaultAppearance Optional default appearance, uses non-locatable transparent grey if not specified.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public emphasizeElements(ids: Id64Arg, vp: Viewport, defaultAppearance?: FeatureAppearance, replace: boolean = true): boolean {\r\n if (undefined !== this.getIsolatedElements(vp)) {\r\n const emphasizeIds = this.updateIdSet(ids, replace, this._emphasizeIsolated);\r\n if (undefined === emphasizeIds)\r\n return false;\r\n\r\n this._emphasizeIsolated = emphasizeIds;\r\n vp.setFeatureOverrideProviderChanged();\r\n } else {\r\n if (!this.setAlwaysDrawnElements(ids, vp, false, replace))\r\n return false;\r\n\r\n this._emphasizeIsolated = undefined;\r\n }\r\n\r\n this._defaultAppearance = (undefined === defaultAppearance ? this.createDefaultAppearance() : defaultAppearance);\r\n return true;\r\n }\r\n\r\n /** Set the currently selected elements to be always drawn normally with all other elements in the view overridden to draw using a default appearance.\r\n * @param vp The viewport.\r\n * @param defaultAppearance Optional default appearance, uses transparent grey if not specified.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public emphasizeSelectedElements(vp: Viewport, defaultAppearance?: FeatureAppearance, replace: boolean = true, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.emphasizeElements(selection.elements, vp, defaultAppearance, replace))\r\n return false;\r\n\r\n if (clearSelection)\r\n selection.emptyAll();\r\n\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to display with a color/transparency override.\r\n * @param ids The IDs of the elements.\r\n * @param vp The viewport.\r\n * @param color ColorDef to specify override rgb and alpha.\r\n * @param override Whether to use color and alpha, only color, or only alpha from the supplied ColorDef.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.addFeatureOverrideProvider]]\r\n */\r\n public overrideElements(ids: Id64Arg, vp: Viewport, color: ColorDef, override: FeatureOverrideType = FeatureOverrideType.ColorOnly, replace: boolean = false): boolean {\r\n const ovrKey = this.createOverrideKey(color, override);\r\n if (undefined === ovrKey)\r\n return false;\r\n\r\n const overrideIds = new Set<string>();\r\n for (const id of Id64.iterable(ids))\r\n overrideIds.add(id);\r\n\r\n if (0 === overrideIds.size)\r\n return false;\r\n\r\n const existingIds = (!replace ? this.getOverriddenElementsByKey(ovrKey) : undefined);\r\n const oldSize = (undefined !== existingIds ? existingIds.size : 0);\r\n if (0 !== oldSize && undefined !== existingIds)\r\n for (const id of existingIds)\r\n overrideIds.add(id);\r\n\r\n if (oldSize === overrideIds.size)\r\n return false;\r\n\r\n if (undefined === this._overrideAppearance) {\r\n this._overrideAppearance = new Map<number, Id64Set>();\r\n } else {\r\n for (const [key, otherIds] of this._overrideAppearance) {\r\n if (key === ovrKey) // Make sure these ids are unique to this color/transparency key...\r\n continue;\r\n\r\n for (const id of Id64.iterable(ids))\r\n otherIds.delete(id);\r\n\r\n if (0 !== otherIds.size)\r\n continue;\r\n\r\n this._overrideAppearance.delete(key);\r\n }\r\n }\r\n\r\n this._overrideAppearance.set(ovrKey, overrideIds);\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n\r\n /** Set the currently selected elements to display with a color/transparency override.\r\n * @param vp The viewport.\r\n * @param color ColorDef to specify override rgb and alpha.\r\n * @param override Whether to use color and alpha, only color, or only alpha from the supplied ColorDef.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.addFeatureOverrideProvider]]\r\n */\r\n public overrideSelectedElements(vp: Viewport, color: ColorDef, override: FeatureOverrideType = FeatureOverrideType.ColorOnly, replace: boolean = false, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.overrideElements(selection.elements, vp, color, override, replace))\r\n return false;\r\n if (clearSelection)\r\n selection.emptyAll();\r\n return true;\r\n }\r\n\r\n /** @return true if provider is currently overriding the display of any elements. */\r\n public isActive(vp: Viewport): boolean { return (undefined !== this.getNeverDrawnElements(vp) || undefined !== this.getAlwaysDrawnElements(vp) || undefined !== this.getOverriddenElements()); }\r\n\r\n /** Serialize to JSON representation.\r\n * @see [[EmphasizeElements.fromJSON]]\r\n */\r\n public toJSON(vp: Viewport): EmphasizeElementsProps {\r\n const props: EmphasizeElementsProps = {};\r\n const neverDrawn = this.getNeverDrawnElements(vp);\r\n if (undefined !== neverDrawn)\r\n props.neverDrawn = [...neverDrawn];\r\n\r\n const alwaysDrawn = this.getAlwaysDrawnElements(vp);\r\n if (undefined !== alwaysDrawn)\r\n props.alwaysDrawn = [...alwaysDrawn];\r\n\r\n if (vp.isAlwaysDrawnExclusive)\r\n props.isAlwaysDrawnExclusive = true; // isolate\r\n\r\n const alwaysDrawnExclusiveEmphasized = this.getEmphasizedIsolatedElements();\r\n if (undefined !== alwaysDrawnExclusiveEmphasized)\r\n props.alwaysDrawnExclusiveEmphasized = [...alwaysDrawnExclusiveEmphasized];\r\n\r\n if (undefined !== this.defaultAppearance)\r\n props.defaultAppearance = this.defaultAppearance; // emphasize (or specifically set for override)\r\n\r\n if (this.unanimatedAppearance)\r\n props.unanimatedAppearance = this.unanimatedAppearance;\r\n\r\n const overriddenElements = this.getOverriddenElements();\r\n if (undefined !== overriddenElements) {\r\n const appearanceOverride: AppearanceOverrideProps[] = [];\r\n for (const [key, ovrIds] of overriddenElements) {\r\n const { color, overrideType } = { ...this.getOverrideFromKey(key) };\r\n const ids = [...ovrIds];\r\n appearanceOverride.push({ overrideType, color: color.toJSON(), ids });\r\n }\r\n\r\n props.appearanceOverride = appearanceOverride;\r\n }\r\n\r\n if (this.wantEmphasis)\r\n props.wantEmphasis = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Initialize from JSON representation.\r\n * @see [[EmphasizeElements.toJSON]]\r\n */\r\n public fromJSON(props: EmphasizeElementsProps, vp: Viewport): boolean {\r\n let changed = false;\r\n if (undefined !== props.neverDrawn && this.setNeverDrawnElements(new Set<string>(props.neverDrawn), vp, true))\r\n changed = true;\r\n\r\n if (undefined !== props.alwaysDrawn && this.setAlwaysDrawnElements(new Set<string>(props.alwaysDrawn), vp, undefined !== props.isAlwaysDrawnExclusive && props.isAlwaysDrawnExclusive))\r\n changed = true;\r\n\r\n if (undefined !== props.alwaysDrawnExclusiveEmphasized)\r\n this._emphasizeIsolated = new Set<string>(props.alwaysDrawnExclusiveEmphasized); // changed status determined by setAlwaysDrawnElements...\r\n\r\n if (undefined !== props.defaultAppearance)\r\n this.defaultAppearance = FeatureAppearance.fromJSON(props.defaultAppearance); // changed status determined by setAlwaysDrawnElements or overrideElements...\r\n\r\n if (props.unanimatedAppearance)\r\n this.unanimatedAppearance = FeatureAppearance.fromJSON(props.unanimatedAppearance);\r\n\r\n if (undefined !== props.appearanceOverride) {\r\n for (const ovrApp of props.appearanceOverride) {\r\n if (undefined === ovrApp.ids)\r\n continue;\r\n\r\n if (this.overrideElements(new Set<string>(ovrApp.ids), vp, ColorDef.fromJSON(ovrApp.color), ovrApp.overrideType, true))\r\n changed = true;\r\n }\r\n }\r\n\r\n const wantEmphasis = true === props.wantEmphasis;\r\n if (wantEmphasis !== this.wantEmphasis) {\r\n this.wantEmphasis = wantEmphasis;\r\n changed = true;\r\n }\r\n\r\n return changed;\r\n }\r\n\r\n /** Return the EmphasizeElements provider currently registered with the specified Viewport, if one is already registered. */\r\n public static get(vp: Viewport): EmphasizeElements | undefined {\r\n return vp.findFeatureOverrideProviderOfType<EmphasizeElements>(EmphasizeElements);\r\n }\r\n\r\n /** Return the EmphasizeElements provider currently registered with the specified Viewport, or register a new one and return it. */\r\n public static getOrCreate(vp: Viewport): EmphasizeElements {\r\n let provider = this.get(vp);\r\n if (!provider) {\r\n provider = new EmphasizeElements();\r\n vp.addFeatureOverrideProvider(provider);\r\n }\r\n\r\n return provider;\r\n }\r\n\r\n /** Drop the EmphasizeElements provider currently registered with the specified Viewport, if any is registered. */\r\n public static clear(vp: Viewport, inactiveOnly: boolean = false) {\r\n const provider = this.get(vp);\r\n\r\n if (undefined === provider || (inactiveOnly && provider.isActive(vp)))\r\n return;\r\n\r\n vp.clearNeverDrawn();\r\n vp.clearAlwaysDrawn();\r\n vp.dropFeatureOverrideProvider(provider);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"EmphasizeElements.js","sourceRoot":"","sources":["../../src/EmphasizeElements.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAoB,MAAM,qBAAqB,CAAC;AAC7D,OAA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AAC;QACjD,IAAI,YAAY,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;YACjC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,4HAA4H;IACrH,MAAM,CAAC,GAAG,CAAC,EAAY;QAC5B,OAAO,EAAE,CAAC,iCAAiC,CAAoB,iBAAiB,CAAC,CAAC;IACpF,CAAC;IAED,mIAAmI;IAC5H,MAAM,CAAC,WAAW,CAAC,EAAY;QACpC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;YACnC,EAAE,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,kHAAkH;IAC3G,MAAM,CAAC,KAAK,CAAC,EAAY,EAAE,eAAwB,KAAK;QAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAI,SAAS,KAAK,QAAQ,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACnE,OAAO;QAET,EAAE,CAAC,eAAe,EAAE,CAAC;QACrB,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64, Id64Arg, Id64Set } from \"@itwin/core-bentley\";\r\nimport { AppearanceOverrideProps, ColorDef, EmphasizeElementsProps, FeatureAppearance, FeatureOverrideType, RgbColor } from \"@itwin/core-common\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { FeatureOverrideProvider } from \"./FeatureOverrideProvider\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/** An implementation of [[FeatureOverrideProvider]] for emphasizing selected elements through simple color/transparency appearance overrides.\r\n * @public\r\n * @extensions\r\n */\r\nexport class EmphasizeElements implements FeatureOverrideProvider {\r\n private _defaultAppearance?: FeatureAppearance;\r\n private _unanimatedAppearance?: FeatureAppearance;\r\n private _emphasizeIsolated?: Id64Set;\r\n private _overrideAppearance?: Map<number, Id64Set>;\r\n private readonly _emphasizedAppearance = FeatureAppearance.fromJSON({ emphasized: true });\r\n\r\n /** If true, all overridden and emphasized elements will also have the \"emphasis\" effect applied to them. This causes them to be hilited using the current [[Viewport.emphasisSettings]]. */\r\n public wantEmphasis = false;\r\n\r\n /** Establish active feature overrides to emphasize elements and apply color/transparency overrides.\r\n * @see [[Viewport.addFeatureOverrideProvider]]\r\n */\r\n public addFeatureOverrides(overrides: FeatureSymbology.Overrides, vp: Viewport): void {\r\n const emphasizedElements = this.getEmphasizedElements(vp);\r\n if (undefined !== emphasizedElements) {\r\n if (this._defaultAppearance !== undefined) {\r\n overrides.setDefaultOverrides(this._defaultAppearance);\r\n }\r\n const appearance = this.wantEmphasis ? this._emphasizedAppearance : FeatureAppearance.defaults;\r\n\r\n // Avoid creating a new object per-element inside the loop\r\n const args = { elementId: \"\", appearance };\r\n for (const elementId of emphasizedElements) {\r\n args.elementId = elementId;\r\n overrides.override(args);\r\n }\r\n\r\n // Do not apply animation overrides to de-emphasized elements.\r\n overrides.ignoreAnimationOverrides((args) => {\r\n const id = Id64.fromUint32Pair(args.elementId.lower, args.elementId.upper);\r\n return !emphasizedElements.has(id);\r\n });\r\n }\r\n\r\n const overriddenElements = this.getOverriddenElements();\r\n if (undefined !== overriddenElements) {\r\n if (undefined !== this._defaultAppearance)\r\n overrides.setDefaultOverrides(this._defaultAppearance);\r\n\r\n // Avoid creating a new object per-element inside the loop\r\n const args = { elementId: \"\", appearance: FeatureAppearance.defaults };\r\n for (const [key, ids] of overriddenElements) {\r\n args.appearance = this.createAppearanceFromKey(key);\r\n for (const elementId of ids) {\r\n args.elementId = elementId;\r\n overrides.override(args);\r\n }\r\n }\r\n }\r\n\r\n if (this._unanimatedAppearance) {\r\n if (this._unanimatedAppearance.isFullyTransparent)\r\n overrides.neverDrawnAnimationNodes.add(0);\r\n else\r\n overrides.animationNodeOverrides.set(0, this._unanimatedAppearance);\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected createAppearanceFromKey(key: number): FeatureAppearance {\r\n let transparency: number | undefined;\r\n let rgb: RgbColor | undefined;\r\n\r\n if (key < 0) {\r\n transparency = Math.abs(key);\r\n } else {\r\n const color = ColorDef.fromJSON(key);\r\n rgb = RgbColor.fromColorDef(color);\r\n if (0 !== color.getAlpha()) // Fully transparent signifies to use color only...\r\n transparency = color.getTransparency() / 255;\r\n }\r\n\r\n const emphasized = this.wantEmphasis ? true : undefined;\r\n return FeatureAppearance.fromJSON({ rgb, transparency, emphasized });\r\n }\r\n\r\n /** Get override key from color and override type */\r\n public createOverrideKey(color: ColorDef, override: FeatureOverrideType): number | undefined {\r\n const colorValues = color.colors;\r\n switch (override) {\r\n case FeatureOverrideType.ColorAndAlpha:\r\n return 255 === colorValues.t ? undefined : color.tbgr; // Hiding elements should be done using neverDrawn, not transparency...\r\n case FeatureOverrideType.ColorOnly:\r\n return ColorDef.from(colorValues.r, colorValues.g, colorValues.b, 255).tbgr;\r\n case FeatureOverrideType.AlphaOnly:\r\n return -(colorValues.t / 255);\r\n }\r\n }\r\n\r\n /** Get color and override type for the given key. */\r\n public getOverrideFromKey(key: number): { overrideType: FeatureOverrideType, color: ColorDef } {\r\n let overrideType;\r\n let color;\r\n\r\n if (key < 0) {\r\n color = ColorDef.from(0, 0, 0, 255 * Math.abs(key));\r\n overrideType = FeatureOverrideType.AlphaOnly;\r\n } else {\r\n color = ColorDef.fromJSON(key);\r\n if (0 === color.getAlpha()) {\r\n color = color.withAlpha(255);\r\n overrideType = FeatureOverrideType.ColorOnly;\r\n } else {\r\n overrideType = FeatureOverrideType.ColorAndAlpha;\r\n }\r\n }\r\n\r\n return { overrideType, color };\r\n }\r\n\r\n /** Establish a default appearance to apply to elements without overrides. If changing the default appearance\r\n * without also calling overrideElements, an explicit refresh must be requested for the change to take effect.\r\n * @see [[Viewport.setFeatureOverrideProviderChanged]]\r\n */\r\n public get defaultAppearance(): FeatureAppearance | undefined { return this._defaultAppearance; }\r\n public set defaultAppearance(appearance: FeatureAppearance | undefined) { this._defaultAppearance = appearance; }\r\n\r\n /** Establish a default appearance to apply to elements that are not animated by the view's [RenderSchedule.Script]($common).\r\n * @note If this is the only change made to EmphasizeElements, you must call [[Viewport.setFeatureOverrideProviderChanged]] for\r\n * the change to take immediate effect.\r\n * @see [[createDefaultAppearance]] to create an appearance suitable for de-emphasizing the non-animated elements.\r\n */\r\n public get unanimatedAppearance(): FeatureAppearance | undefined {\r\n return this._unanimatedAppearance;\r\n }\r\n public set unanimatedAppearance(appearance: FeatureAppearance | undefined) {\r\n this._unanimatedAppearance = appearance;\r\n }\r\n\r\n /** Create default appearance to use for emphasizeElements when not supplied by caller. */\r\n public createDefaultAppearance(): FeatureAppearance {\r\n return FeatureAppearance.fromJSON({\r\n rgb: new RgbColor(0xe4, 0xe4, 0xe4),\r\n transparency: 0.8,\r\n nonLocatable: true,\r\n });\r\n }\r\n\r\n /** Get the IDs of the currently never drawn elements. */\r\n public getNeverDrawnElements(vp: Viewport): Id64Set | undefined {\r\n return (undefined !== vp.neverDrawn && 0 !== vp.neverDrawn.size ? vp.neverDrawn : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently always drawn elements. */\r\n public getAlwaysDrawnElements(vp: Viewport): Id64Set | undefined {\r\n return (undefined !== vp.alwaysDrawn && 0 !== vp.alwaysDrawn.size ? vp.alwaysDrawn : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently hidden elements. */\r\n public getHiddenElements(vp: Viewport): Id64Set | undefined {\r\n return this.getNeverDrawnElements(vp);\r\n }\r\n\r\n /** Get the IDs of the currently isolated elements. */\r\n public getIsolatedElements(vp: Viewport): Id64Set | undefined {\r\n return (vp.isAlwaysDrawnExclusive ? this.getAlwaysDrawnElements(vp) : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently emphasized isolated elements. */\r\n public getEmphasizedIsolatedElements(): Id64Set | undefined {\r\n return (undefined !== this._defaultAppearance && undefined !== this._emphasizeIsolated && 0 !== this._emphasizeIsolated.size ? this._emphasizeIsolated : undefined);\r\n }\r\n\r\n /** Get the IDs of the currently emphasized elements. */\r\n public getEmphasizedElements(vp: Viewport): Id64Set | undefined {\r\n return (undefined !== this.getEmphasizedIsolatedElements() ? this._emphasizeIsolated : (undefined !== this._defaultAppearance && !vp.isAlwaysDrawnExclusive ? this.getAlwaysDrawnElements(vp) : undefined));\r\n }\r\n\r\n /** Get the map of current elements with color/transparency overrides. */\r\n public getOverriddenElements(): Map<number, Id64Set> | undefined {\r\n return (undefined !== this._overrideAppearance && 0 !== this._overrideAppearance.size ? this._overrideAppearance : undefined);\r\n }\r\n\r\n /** Get the IDs of current elements with the specified color/transparency override. */\r\n public getOverriddenElementsByKey(key: number): Id64Set | undefined {\r\n return (undefined !== this._overrideAppearance ? this._overrideAppearance.get(key) : undefined);\r\n }\r\n\r\n /** Clear never drawn elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearNeverDrawnElements(vp: Viewport): boolean {\r\n if (undefined === this.getNeverDrawnElements(vp))\r\n return false;\r\n vp.clearNeverDrawn();\r\n return true;\r\n }\r\n\r\n /** Clear always drawn elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearAlwaysDrawnElements(vp: Viewport): boolean {\r\n if (undefined === this.getAlwaysDrawnElements(vp))\r\n return false;\r\n vp.clearAlwaysDrawn();\r\n return true;\r\n }\r\n\r\n /** Clear hidden elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearHiddenElements(vp: Viewport): boolean {\r\n return this.clearNeverDrawnElements(vp);\r\n }\r\n\r\n /** Clear isolated elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearIsolatedElements(vp: Viewport): boolean {\r\n if (undefined === this.getIsolatedElements(vp))\r\n return false;\r\n if (this.clearEmphasizedIsolatedElements(vp, true))\r\n return true;\r\n return this.clearAlwaysDrawnElements(vp);\r\n }\r\n\r\n /** Clear emphasized elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearEmphasizedElements(vp: Viewport): boolean {\r\n if (undefined === this.getEmphasizedElements(vp))\r\n return false;\r\n\r\n if (this.clearEmphasizedIsolatedElements(vp, false))\r\n return true;\r\n\r\n if (!this.clearAlwaysDrawnElements(vp))\r\n return false;\r\n\r\n this._defaultAppearance = undefined;\r\n return true;\r\n }\r\n\r\n /** Clear emphasized isolated elements.\r\n * @return false if nothing to clear.\r\n */\r\n public clearEmphasizedIsolatedElements(vp: Viewport, setToAlwaysDrawn: boolean): boolean {\r\n const emphasizedIsolated = this.getEmphasizedIsolatedElements();\r\n this._emphasizeIsolated = undefined; // Always clear in case default appearance was unset...\r\n if (undefined === emphasizedIsolated)\r\n return false;\r\n\r\n if (setToAlwaysDrawn && this.setAlwaysDrawnElements(emphasizedIsolated, vp, false))\r\n return true;\r\n\r\n this._defaultAppearance = undefined;\r\n vp.setFeatureOverrideProviderChanged();\r\n return true;\r\n }\r\n\r\n /** Clear color/transparency overrides from elements. Removes all overrides when keyOrIds isn't supplied.\r\n * @param keyOrIds Specify a key value from [[EmphasizeElements.getOverriddenElements]] or [[EmphasizeElements.createOverrideKey]]\r\n * to remove a single color/transparency override for the corresponding elements or specify the IDs of elements to\r\n * remove any color/transparency override from.\r\n * @return false if nothing to clear.\r\n */\r\n public clearOverriddenElements(vp: Viewport, keyOrIds?: number | Id64Arg): boolean {\r\n if (undefined === this._overrideAppearance)\r\n return false;\r\n\r\n if (undefined !== keyOrIds) {\r\n if (typeof keyOrIds === \"number\") {\r\n if (!this._overrideAppearance.delete(keyOrIds))\r\n return false;\r\n } else {\r\n let changed = false;\r\n\r\n for (const [otherKey, otherIds] of this._overrideAppearance) {\r\n const oldSize = otherIds.size;\r\n for (const id of Id64.iterable(keyOrIds))\r\n otherIds.delete(id);\r\n\r\n if (oldSize !== otherIds.size)\r\n changed = true;\r\n\r\n if (0 === otherIds.size)\r\n this._overrideAppearance.delete(otherKey);\r\n }\r\n\r\n if (!changed)\r\n return false;\r\n }\r\n } else {\r\n this._overrideAppearance = undefined;\r\n }\r\n vp.setFeatureOverrideProviderChanged();\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n protected updateIdSet(ids: Id64Arg, replace: boolean, existingIds?: Id64Set): Id64Set | undefined {\r\n const newIds = new Set<string>();\r\n for (const id of Id64.iterable(ids))\r\n newIds.add(id);\r\n\r\n if (0 === newIds.size)\r\n return undefined;\r\n\r\n const oldSize = (!replace && undefined !== existingIds ? existingIds.size : 0);\r\n if (0 !== oldSize && undefined !== existingIds)\r\n for (const id of existingIds)\r\n newIds.add(id);\r\n\r\n if (oldSize === newIds.size)\r\n return undefined;\r\n\r\n return newIds;\r\n }\r\n\r\n /** Set the element IDs to be never drawn.\r\n * @param ids The IDs of the elements to never draw.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently hidden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.neverDrawn]]\r\n * @internal\r\n */\r\n public setNeverDrawnElements(ids: Id64Arg, vp: Viewport, replace: boolean = true): boolean {\r\n const hiddenIds = this.updateIdSet(ids, replace, vp.neverDrawn);\r\n if (undefined === hiddenIds)\r\n return false;\r\n vp.setNeverDrawn(hiddenIds);\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be always drawn.\r\n * @param ids The IDs of the elements to always draw.\r\n * @param vp The viewport.\r\n * @param exclusive If true, *only* the specified elements will be drawn.\r\n * @param replace true to replace currently always drawn elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n * @internal\r\n */\r\n public setAlwaysDrawnElements(ids: Id64Arg, vp: Viewport, exclusive: boolean = true, replace: boolean = true): boolean {\r\n const visibleIds = this.updateIdSet(ids, replace, vp.alwaysDrawn);\r\n if (undefined === visibleIds)\r\n return false;\r\n vp.setAlwaysDrawn(visibleIds, exclusive);\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be never drawn.\r\n * @param ids The IDs of the elements to never draw.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently hidden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.neverDrawn]]\r\n */\r\n public hideElements(ids: Id64Arg, vp: Viewport, replace: boolean = false): boolean {\r\n return this.setNeverDrawnElements(ids, vp, replace);\r\n }\r\n\r\n /** Set the currently selected elements to be never drawn.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently hidden elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.neverDrawn]]\r\n */\r\n public hideSelectedElements(vp: Viewport, replace: boolean = false, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.hideElements(selection.elements, vp, replace))\r\n return false;\r\n if (clearSelection)\r\n selection.emptyAll();\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be always drawn exclusively.\r\n * @param ids The IDs of the elements to always draw.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently isolated elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public isolateElements(ids: Id64Arg, vp: Viewport, replace: boolean = true): boolean {\r\n const wasEmphasized = (undefined !== this.getEmphasizedElements(vp));\r\n if (!this.setAlwaysDrawnElements(ids, vp, true, replace))\r\n return false;\r\n\r\n if (wasEmphasized)\r\n this._defaultAppearance = this._emphasizeIsolated = undefined; // Don't clear defaultAppearance unless it was established by emphasize...\r\n\r\n return true;\r\n }\r\n\r\n /** Set the currently selected elements to be always drawn exclusively.\r\n * @param vp The viewport.\r\n * @param replace true to replace currently isolated elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public isolateSelectedElements(vp: Viewport, replace: boolean = true, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.isolateElements(selection.elements, vp, replace))\r\n return false;\r\n if (clearSelection)\r\n selection.emptyAll();\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to be always drawn normally with all other elements in the view overridden to draw using a default appearance.\r\n * @param ids The IDs of the elements to always draw.\r\n * @param vp The viewport.\r\n * @param defaultAppearance Optional default appearance, uses non-locatable transparent grey if not specified.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public emphasizeElements(ids: Id64Arg, vp: Viewport, defaultAppearance?: FeatureAppearance, replace: boolean = true): boolean {\r\n if (undefined !== this.getIsolatedElements(vp)) {\r\n const emphasizeIds = this.updateIdSet(ids, replace, this._emphasizeIsolated);\r\n if (undefined === emphasizeIds)\r\n return false;\r\n\r\n this._emphasizeIsolated = emphasizeIds;\r\n vp.setFeatureOverrideProviderChanged();\r\n } else {\r\n if (!this.setAlwaysDrawnElements(ids, vp, false, replace))\r\n return false;\r\n\r\n this._emphasizeIsolated = undefined;\r\n }\r\n\r\n this._defaultAppearance = (undefined === defaultAppearance ? this.createDefaultAppearance() : defaultAppearance);\r\n return true;\r\n }\r\n\r\n /** Set the currently selected elements to be always drawn normally with all other elements in the view overridden to draw using a default appearance.\r\n * @param vp The viewport.\r\n * @param defaultAppearance Optional default appearance, uses transparent grey if not specified.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.isAlwaysDrawnExclusive]]\r\n */\r\n public emphasizeSelectedElements(vp: Viewport, defaultAppearance?: FeatureAppearance, replace: boolean = true, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.emphasizeElements(selection.elements, vp, defaultAppearance, replace))\r\n return false;\r\n\r\n if (clearSelection)\r\n selection.emptyAll();\r\n\r\n return true;\r\n }\r\n\r\n /** Set the element IDs to display with a color/transparency override.\r\n * @param ids The IDs of the elements.\r\n * @param vp The viewport.\r\n * @param color ColorDef to specify override rgb and alpha.\r\n * @param override Whether to use color and alpha, only color, or only alpha from the supplied ColorDef.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.addFeatureOverrideProvider]]\r\n */\r\n public overrideElements(ids: Id64Arg, vp: Viewport, color: ColorDef, override: FeatureOverrideType = FeatureOverrideType.ColorOnly, replace: boolean = false): boolean {\r\n const ovrKey = this.createOverrideKey(color, override);\r\n if (undefined === ovrKey)\r\n return false;\r\n\r\n const overrideIds = new Set<string>();\r\n for (const id of Id64.iterable(ids))\r\n overrideIds.add(id);\r\n\r\n if (0 === overrideIds.size)\r\n return false;\r\n\r\n const existingIds = (!replace ? this.getOverriddenElementsByKey(ovrKey) : undefined);\r\n const oldSize = (undefined !== existingIds ? existingIds.size : 0);\r\n if (0 !== oldSize && undefined !== existingIds)\r\n for (const id of existingIds)\r\n overrideIds.add(id);\r\n\r\n if (oldSize === overrideIds.size)\r\n return false;\r\n\r\n if (undefined === this._overrideAppearance) {\r\n this._overrideAppearance = new Map<number, Id64Set>();\r\n } else {\r\n for (const [key, otherIds] of this._overrideAppearance) {\r\n if (key === ovrKey) // Make sure these ids are unique to this color/transparency key...\r\n continue;\r\n\r\n for (const id of Id64.iterable(ids))\r\n otherIds.delete(id);\r\n\r\n if (0 !== otherIds.size)\r\n continue;\r\n\r\n this._overrideAppearance.delete(key);\r\n }\r\n }\r\n\r\n this._overrideAppearance.set(ovrKey, overrideIds);\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n\r\n /** Set the currently selected elements to display with a color/transparency override.\r\n * @param vp The viewport.\r\n * @param color ColorDef to specify override rgb and alpha.\r\n * @param override Whether to use color and alpha, only color, or only alpha from the supplied ColorDef.\r\n * @param replace true to replace currently overridden elements (if any) or false to add to the existing set.\r\n * @param clearSelection true to clear current selection after setting appearance override, false to leave selected.\r\n * @return true if overrides were changed.\r\n * @see [[Viewport.addFeatureOverrideProvider]]\r\n */\r\n public overrideSelectedElements(vp: Viewport, color: ColorDef, override: FeatureOverrideType = FeatureOverrideType.ColorOnly, replace: boolean = false, clearSelection: boolean = true): boolean {\r\n const selection = vp.view.iModel.selectionSet;\r\n if (!selection.isActive || !this.overrideElements(selection.elements, vp, color, override, replace))\r\n return false;\r\n if (clearSelection)\r\n selection.emptyAll();\r\n return true;\r\n }\r\n\r\n /** @return true if provider is currently overriding the display of any elements. */\r\n public isActive(vp: Viewport): boolean { return (undefined !== this.getNeverDrawnElements(vp) || undefined !== this.getAlwaysDrawnElements(vp) || undefined !== this.getOverriddenElements()); }\r\n\r\n /** Serialize to JSON representation.\r\n * @see [[EmphasizeElements.fromJSON]]\r\n */\r\n public toJSON(vp: Viewport): EmphasizeElementsProps {\r\n const props: EmphasizeElementsProps = {};\r\n const neverDrawn = this.getNeverDrawnElements(vp);\r\n if (undefined !== neverDrawn)\r\n props.neverDrawn = [...neverDrawn];\r\n\r\n const alwaysDrawn = this.getAlwaysDrawnElements(vp);\r\n if (undefined !== alwaysDrawn)\r\n props.alwaysDrawn = [...alwaysDrawn];\r\n\r\n if (vp.isAlwaysDrawnExclusive)\r\n props.isAlwaysDrawnExclusive = true; // isolate\r\n\r\n const alwaysDrawnExclusiveEmphasized = this.getEmphasizedIsolatedElements();\r\n if (undefined !== alwaysDrawnExclusiveEmphasized)\r\n props.alwaysDrawnExclusiveEmphasized = [...alwaysDrawnExclusiveEmphasized];\r\n\r\n if (undefined !== this.defaultAppearance)\r\n props.defaultAppearance = this.defaultAppearance; // emphasize (or specifically set for override)\r\n\r\n if (this.unanimatedAppearance)\r\n props.unanimatedAppearance = this.unanimatedAppearance;\r\n\r\n const overriddenElements = this.getOverriddenElements();\r\n if (undefined !== overriddenElements) {\r\n const appearanceOverride: AppearanceOverrideProps[] = [];\r\n for (const [key, ovrIds] of overriddenElements) {\r\n const { color, overrideType } = { ...this.getOverrideFromKey(key) };\r\n const ids = [...ovrIds];\r\n appearanceOverride.push({ overrideType, color: color.toJSON(), ids });\r\n }\r\n\r\n props.appearanceOverride = appearanceOverride;\r\n }\r\n\r\n if (this.wantEmphasis)\r\n props.wantEmphasis = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Initialize from JSON representation.\r\n * @see [[EmphasizeElements.toJSON]]\r\n */\r\n public fromJSON(props: EmphasizeElementsProps, vp: Viewport): boolean {\r\n let changed = false;\r\n if (undefined !== props.neverDrawn && this.setNeverDrawnElements(new Set<string>(props.neverDrawn), vp, true))\r\n changed = true;\r\n\r\n if (undefined !== props.alwaysDrawn && this.setAlwaysDrawnElements(new Set<string>(props.alwaysDrawn), vp, undefined !== props.isAlwaysDrawnExclusive && props.isAlwaysDrawnExclusive))\r\n changed = true;\r\n\r\n if (undefined !== props.alwaysDrawnExclusiveEmphasized)\r\n this._emphasizeIsolated = new Set<string>(props.alwaysDrawnExclusiveEmphasized); // changed status determined by setAlwaysDrawnElements...\r\n\r\n if (undefined !== props.defaultAppearance)\r\n this.defaultAppearance = FeatureAppearance.fromJSON(props.defaultAppearance); // changed status determined by setAlwaysDrawnElements or overrideElements...\r\n\r\n if (props.unanimatedAppearance)\r\n this.unanimatedAppearance = FeatureAppearance.fromJSON(props.unanimatedAppearance);\r\n\r\n if (undefined !== props.appearanceOverride) {\r\n for (const ovrApp of props.appearanceOverride) {\r\n if (undefined === ovrApp.ids)\r\n continue;\r\n\r\n if (this.overrideElements(new Set<string>(ovrApp.ids), vp, ColorDef.fromJSON(ovrApp.color), ovrApp.overrideType, true))\r\n changed = true;\r\n }\r\n }\r\n\r\n const wantEmphasis = true === props.wantEmphasis;\r\n if (wantEmphasis !== this.wantEmphasis) {\r\n this.wantEmphasis = wantEmphasis;\r\n changed = true;\r\n }\r\n\r\n return changed;\r\n }\r\n\r\n /** Return the EmphasizeElements provider currently registered with the specified Viewport, if one is already registered. */\r\n public static get(vp: Viewport): EmphasizeElements | undefined {\r\n return vp.findFeatureOverrideProviderOfType<EmphasizeElements>(EmphasizeElements);\r\n }\r\n\r\n /** Return the EmphasizeElements provider currently registered with the specified Viewport, or register a new one and return it. */\r\n public static getOrCreate(vp: Viewport): EmphasizeElements {\r\n let provider = this.get(vp);\r\n if (!provider) {\r\n provider = new EmphasizeElements();\r\n vp.addFeatureOverrideProvider(provider);\r\n }\r\n\r\n return provider;\r\n }\r\n\r\n /** Drop the EmphasizeElements provider currently registered with the specified Viewport, if any is registered. */\r\n public static clear(vp: Viewport, inactiveOnly: boolean = false) {\r\n const provider = this.get(vp);\r\n\r\n if (undefined === provider || (inactiveOnly && provider.isActive(vp)))\r\n return;\r\n\r\n vp.clearNeverDrawn();\r\n vp.clearAlwaysDrawn();\r\n vp.dropFeatureOverrideProvider(provider);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentDecorations.d.ts","sourceRoot":"","sources":["../../src/EnvironmentDecorations.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACK,WAAW,EAAY,aAAa,EAC/C,MAA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,CAAC,kBAAkB;IAqC1B,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,gBAAgB;IAyExB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,uBAAuB;YAQjB,aAAa;CAM5B"}
@@ -167,8 +167,12 @@ export class EnvironmentDecorations {
167
167
  idToImage.set(spec, image);
168
168
  }
169
169
  const params = new RenderTextureParams(key, RenderTexture.Type.SkyBox);
170
+ // Note: idToImage is populated with all 6 directions. If any are missing, we return false,
171
+ // preventing us from getting here. That makes the following non-null assertions safe.
170
172
  const txImgs = [
173
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
171
174
  idToImage.get(sky.images.front), idToImage.get(sky.images.back), idToImage.get(sky.images.top),
175
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
172
176
  idToImage.get(sky.images.bottom), idToImage.get(sky.images.right), idToImage.get(sky.images.left),
173
177
  ];
174
178
  return undefined !== IModelApp.renderSystem.createTextureFromCubeImages(txImgs[0], txImgs[1], txImgs[2], txImgs[3], txImgs[4], txImgs[5], this._view.iModel, params);