@itwin/core-common 5.12.0-dev.9 → 5.13.0-dev.1

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 (380) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/AmbientOcclusion.js.map +1 -1
  3. package/lib/cjs/AnalysisStyle.js.map +1 -1
  4. package/lib/cjs/Atmosphere.js.map +1 -1
  5. package/lib/cjs/AuthorizationClient.js.map +1 -1
  6. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  7. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  8. package/lib/cjs/Base64EncodedString.js.map +1 -1
  9. package/lib/cjs/BlobReader.js.map +1 -1
  10. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  11. package/lib/cjs/Camera.js.map +1 -1
  12. package/lib/cjs/CatalogIModel.js.map +1 -1
  13. package/lib/cjs/CesiumIonAssets.js.map +1 -1
  14. package/lib/cjs/ChangedElements.js.map +1 -1
  15. package/lib/cjs/ChangedEntities.js.map +1 -1
  16. package/lib/cjs/ChangesetProps.js.map +1 -1
  17. package/lib/cjs/ClipStyle.js.map +1 -1
  18. package/lib/cjs/Code.js.map +1 -1
  19. package/lib/cjs/ColorByName.js.map +1 -1
  20. package/lib/cjs/ColorDef.js.map +1 -1
  21. package/lib/cjs/CommonLoggerCategory.js.map +1 -1
  22. package/lib/cjs/ConcurrentQuery.d.ts +14 -1
  23. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  24. package/lib/cjs/ConcurrentQuery.js +28 -6
  25. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  26. package/lib/cjs/ContextRealityModel.js.map +1 -1
  27. package/lib/cjs/ContourDisplay.js.map +1 -1
  28. package/lib/cjs/DbCloudContainerInfo.js.map +1 -1
  29. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  30. package/lib/cjs/ECSchemaProps.js.map +1 -1
  31. package/lib/cjs/ECSqlReader.js.map +1 -1
  32. package/lib/cjs/ECSqlReaderBase.js.map +1 -1
  33. package/lib/cjs/ECSqlTypes.js.map +1 -1
  34. package/lib/cjs/ElementMesh.js.map +1 -1
  35. package/lib/cjs/ElementProps.js.map +1 -1
  36. package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
  37. package/lib/cjs/EntityProps.js.map +1 -1
  38. package/lib/cjs/EntityReference.js.map +1 -1
  39. package/lib/cjs/Environment.js.map +1 -1
  40. package/lib/cjs/FeatureIndex.js.map +1 -1
  41. package/lib/cjs/FeatureSymbology.js.map +1 -1
  42. package/lib/cjs/FeatureTable.js.map +1 -1
  43. package/lib/cjs/Fonts.js.map +1 -1
  44. package/lib/cjs/Frustum.js.map +1 -1
  45. package/lib/cjs/GenericInstanceFilter.js.map +1 -1
  46. package/lib/cjs/GeoCoordinateServices.js.map +1 -1
  47. package/lib/cjs/GeometryContainment.js.map +1 -1
  48. package/lib/cjs/GeometryParams.js.map +1 -1
  49. package/lib/cjs/GeometrySummary.js.map +1 -1
  50. package/lib/cjs/Gradient.js.map +1 -1
  51. package/lib/cjs/GraphicParams.js.map +1 -1
  52. package/lib/cjs/GroundPlane.js.map +1 -1
  53. package/lib/cjs/HSLColor.js.map +1 -1
  54. package/lib/cjs/HSVColor.js.map +1 -1
  55. package/lib/cjs/HiddenLine.js.map +1 -1
  56. package/lib/cjs/Hilite.js.map +1 -1
  57. package/lib/cjs/IModel.js.map +1 -1
  58. package/lib/cjs/IModelError.js.map +1 -1
  59. package/lib/cjs/IModelVersion.js.map +1 -1
  60. package/lib/cjs/ITwinCoreErrors.js.map +1 -1
  61. package/lib/cjs/Image.js.map +1 -1
  62. package/lib/cjs/IpcAppProps.js.map +1 -1
  63. package/lib/cjs/LightSettings.js.map +1 -1
  64. package/lib/cjs/LinePixels.js.map +1 -1
  65. package/lib/cjs/Localization.js.map +1 -1
  66. package/lib/cjs/MapImagerySettings.js.map +1 -1
  67. package/lib/cjs/MapLayerSettings.js.map +1 -1
  68. package/lib/cjs/MassProperties.js.map +1 -1
  69. package/lib/cjs/MaterialProps.js.map +1 -1
  70. package/lib/cjs/ModelClipGroup.js.map +1 -1
  71. package/lib/cjs/ModelGeometryChanges.js.map +1 -1
  72. package/lib/cjs/ModelProps.js.map +1 -1
  73. package/lib/cjs/NativeAppProps.js.map +1 -1
  74. package/lib/cjs/OctEncodedNormal.js.map +1 -1
  75. package/lib/cjs/PlanProjectionSettings.js.map +1 -1
  76. package/lib/cjs/PlanarClipMask.js.map +1 -1
  77. package/lib/cjs/QPoint.js.map +1 -1
  78. package/lib/cjs/RealityDataAccessProps.js.map +1 -1
  79. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  80. package/lib/cjs/RenderMaterial.js.map +1 -1
  81. package/lib/cjs/RenderPolyline.js.map +1 -1
  82. package/lib/cjs/RenderTexture.js.map +1 -1
  83. package/lib/cjs/RgbColor.js.map +1 -1
  84. package/lib/cjs/RpcInterface.js.map +1 -1
  85. package/lib/cjs/RpcManager.js.map +1 -1
  86. package/lib/cjs/SessionProps.js.map +1 -1
  87. package/lib/cjs/SkyBox.js.map +1 -1
  88. package/lib/cjs/SolarCalculate.js.map +1 -1
  89. package/lib/cjs/SolarShadows.js.map +1 -1
  90. package/lib/cjs/SpatialClassification.js.map +1 -1
  91. package/lib/cjs/SubCategoryAppearance.js.map +1 -1
  92. package/lib/cjs/SubCategoryOverride.js.map +1 -1
  93. package/lib/cjs/TerrainSettings.js.map +1 -1
  94. package/lib/cjs/TextureMapping.js.map +1 -1
  95. package/lib/cjs/TextureProps.js.map +1 -1
  96. package/lib/cjs/ThematicDisplay.js.map +1 -1
  97. package/lib/cjs/Thumbnail.js.map +1 -1
  98. package/lib/cjs/TileProps.js.map +1 -1
  99. package/lib/cjs/Tween.js.map +1 -1
  100. package/lib/cjs/TxnAction.js.map +1 -1
  101. package/lib/cjs/TxnProps.js.map +1 -1
  102. package/lib/cjs/ViewDetails.js.map +1 -1
  103. package/lib/cjs/ViewFlags.js.map +1 -1
  104. package/lib/cjs/ViewProps.js.map +1 -1
  105. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  106. package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
  107. package/lib/cjs/annotation/TextBlock.js.map +1 -1
  108. package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
  109. package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
  110. package/lib/cjs/annotation/TextField.js.map +1 -1
  111. package/lib/cjs/annotation/TextStyle.js.map +1 -1
  112. package/lib/cjs/core-common.d.ts +2 -0
  113. package/lib/cjs/core-common.d.ts.map +1 -1
  114. package/lib/cjs/core-common.js +2 -0
  115. package/lib/cjs/core-common.js.map +1 -1
  116. package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
  117. package/lib/cjs/domains/GenericElementProps.js.map +1 -1
  118. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  119. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  120. package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
  121. package/lib/cjs/geometry/Cartographic.js.map +1 -1
  122. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  123. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  124. package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
  125. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  126. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  127. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  128. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  129. package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
  130. package/lib/cjs/geometry/LineStyle.js.map +1 -1
  131. package/lib/cjs/geometry/Placement.js.map +1 -1
  132. package/lib/cjs/geometry/Projection.js.map +1 -1
  133. package/lib/cjs/geometry/TextString.js.map +1 -1
  134. package/lib/cjs/internal/BackendTypes.js.map +1 -1
  135. package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
  136. package/lib/cjs/internal/RenderMaterialParams.js.map +1 -1
  137. package/lib/cjs/internal/RenderMesh.js.map +1 -1
  138. package/lib/cjs/internal/RenderTextureParams.js.map +1 -1
  139. package/lib/cjs/internal/Snapping.js.map +1 -1
  140. package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -1
  141. package/lib/cjs/internal/cross-package.js.map +1 -1
  142. package/lib/cjs/ipc/IpcErrors.d.ts +34 -0
  143. package/lib/cjs/ipc/IpcErrors.d.ts.map +1 -0
  144. package/lib/cjs/ipc/IpcErrors.js +167 -0
  145. package/lib/cjs/ipc/IpcErrors.js.map +1 -0
  146. package/lib/cjs/ipc/IpcInvoke.d.ts +44 -0
  147. package/lib/cjs/ipc/IpcInvoke.d.ts.map +1 -0
  148. package/lib/cjs/ipc/IpcInvoke.js +83 -0
  149. package/lib/cjs/ipc/IpcInvoke.js.map +1 -0
  150. package/lib/cjs/ipc/IpcSession.js.map +1 -1
  151. package/lib/cjs/ipc/IpcSocket.js.map +1 -1
  152. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  153. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  154. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  155. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  156. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  157. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  158. package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
  159. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  160. package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
  161. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  162. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  163. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  164. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  165. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  166. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  167. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  168. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  169. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  170. package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
  171. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  172. package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
  173. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  174. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  175. package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
  176. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  177. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  178. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  179. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  180. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  181. package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
  182. package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
  183. package/lib/cjs/tile/ElementGraphics.js.map +1 -1
  184. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  185. package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
  186. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  187. package/lib/cjs/tile/PntsTileIO.js.map +1 -1
  188. package/lib/cjs/tile/TileIO.js.map +1 -1
  189. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  190. package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
  191. package/lib/esm/AmbientOcclusion.js.map +1 -1
  192. package/lib/esm/AnalysisStyle.js.map +1 -1
  193. package/lib/esm/Atmosphere.js.map +1 -1
  194. package/lib/esm/AuthorizationClient.js.map +1 -1
  195. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  196. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  197. package/lib/esm/Base64EncodedString.js.map +1 -1
  198. package/lib/esm/BlobReader.js.map +1 -1
  199. package/lib/esm/BriefcaseTypes.js.map +1 -1
  200. package/lib/esm/Camera.js.map +1 -1
  201. package/lib/esm/CatalogIModel.js.map +1 -1
  202. package/lib/esm/CesiumIonAssets.js.map +1 -1
  203. package/lib/esm/ChangedElements.js.map +1 -1
  204. package/lib/esm/ChangedEntities.js.map +1 -1
  205. package/lib/esm/ChangesetProps.js.map +1 -1
  206. package/lib/esm/ClipStyle.js.map +1 -1
  207. package/lib/esm/Code.js.map +1 -1
  208. package/lib/esm/ColorByName.js.map +1 -1
  209. package/lib/esm/ColorDef.js.map +1 -1
  210. package/lib/esm/CommonLoggerCategory.js.map +1 -1
  211. package/lib/esm/ConcurrentQuery.d.ts +14 -1
  212. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  213. package/lib/esm/ConcurrentQuery.js +28 -6
  214. package/lib/esm/ConcurrentQuery.js.map +1 -1
  215. package/lib/esm/ContextRealityModel.js.map +1 -1
  216. package/lib/esm/ContourDisplay.js.map +1 -1
  217. package/lib/esm/DbCloudContainerInfo.js.map +1 -1
  218. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  219. package/lib/esm/ECSchemaProps.js.map +1 -1
  220. package/lib/esm/ECSqlReader.js.map +1 -1
  221. package/lib/esm/ECSqlReaderBase.js.map +1 -1
  222. package/lib/esm/ECSqlTypes.js.map +1 -1
  223. package/lib/esm/ElementMesh.js.map +1 -1
  224. package/lib/esm/ElementProps.js.map +1 -1
  225. package/lib/esm/EmphasizeElementsProps.js.map +1 -1
  226. package/lib/esm/EntityProps.js.map +1 -1
  227. package/lib/esm/EntityReference.js.map +1 -1
  228. package/lib/esm/Environment.js.map +1 -1
  229. package/lib/esm/FeatureIndex.js.map +1 -1
  230. package/lib/esm/FeatureSymbology.js.map +1 -1
  231. package/lib/esm/FeatureTable.js.map +1 -1
  232. package/lib/esm/Fonts.js.map +1 -1
  233. package/lib/esm/Frustum.js.map +1 -1
  234. package/lib/esm/GenericInstanceFilter.js.map +1 -1
  235. package/lib/esm/GeoCoordinateServices.js.map +1 -1
  236. package/lib/esm/GeometryContainment.js.map +1 -1
  237. package/lib/esm/GeometryParams.js.map +1 -1
  238. package/lib/esm/GeometrySummary.js.map +1 -1
  239. package/lib/esm/Gradient.js.map +1 -1
  240. package/lib/esm/GraphicParams.js.map +1 -1
  241. package/lib/esm/GroundPlane.js.map +1 -1
  242. package/lib/esm/HSLColor.js.map +1 -1
  243. package/lib/esm/HSVColor.js.map +1 -1
  244. package/lib/esm/HiddenLine.js.map +1 -1
  245. package/lib/esm/Hilite.js.map +1 -1
  246. package/lib/esm/IModel.js.map +1 -1
  247. package/lib/esm/IModelError.js.map +1 -1
  248. package/lib/esm/IModelVersion.js.map +1 -1
  249. package/lib/esm/ITwinCoreErrors.js.map +1 -1
  250. package/lib/esm/Image.js.map +1 -1
  251. package/lib/esm/IpcAppProps.js.map +1 -1
  252. package/lib/esm/LightSettings.js.map +1 -1
  253. package/lib/esm/LinePixels.js.map +1 -1
  254. package/lib/esm/Localization.js.map +1 -1
  255. package/lib/esm/MapImagerySettings.js.map +1 -1
  256. package/lib/esm/MapLayerSettings.js.map +1 -1
  257. package/lib/esm/MassProperties.js.map +1 -1
  258. package/lib/esm/MaterialProps.js.map +1 -1
  259. package/lib/esm/ModelClipGroup.js.map +1 -1
  260. package/lib/esm/ModelGeometryChanges.js.map +1 -1
  261. package/lib/esm/ModelProps.js.map +1 -1
  262. package/lib/esm/NativeAppProps.js.map +1 -1
  263. package/lib/esm/OctEncodedNormal.js.map +1 -1
  264. package/lib/esm/PlanProjectionSettings.js.map +1 -1
  265. package/lib/esm/PlanarClipMask.js.map +1 -1
  266. package/lib/esm/QPoint.js.map +1 -1
  267. package/lib/esm/RealityDataAccessProps.js.map +1 -1
  268. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  269. package/lib/esm/RenderMaterial.js.map +1 -1
  270. package/lib/esm/RenderPolyline.js.map +1 -1
  271. package/lib/esm/RenderTexture.js.map +1 -1
  272. package/lib/esm/RgbColor.js.map +1 -1
  273. package/lib/esm/RpcInterface.js.map +1 -1
  274. package/lib/esm/RpcManager.js.map +1 -1
  275. package/lib/esm/SessionProps.js.map +1 -1
  276. package/lib/esm/SkyBox.js.map +1 -1
  277. package/lib/esm/SolarCalculate.js.map +1 -1
  278. package/lib/esm/SolarShadows.js.map +1 -1
  279. package/lib/esm/SpatialClassification.js.map +1 -1
  280. package/lib/esm/SubCategoryAppearance.js.map +1 -1
  281. package/lib/esm/SubCategoryOverride.js.map +1 -1
  282. package/lib/esm/TerrainSettings.js.map +1 -1
  283. package/lib/esm/TextureMapping.js.map +1 -1
  284. package/lib/esm/TextureProps.js.map +1 -1
  285. package/lib/esm/ThematicDisplay.js.map +1 -1
  286. package/lib/esm/Thumbnail.js.map +1 -1
  287. package/lib/esm/TileProps.js.map +1 -1
  288. package/lib/esm/Tween.js.map +1 -1
  289. package/lib/esm/TxnAction.js.map +1 -1
  290. package/lib/esm/TxnProps.js.map +1 -1
  291. package/lib/esm/ViewDetails.js.map +1 -1
  292. package/lib/esm/ViewFlags.js.map +1 -1
  293. package/lib/esm/ViewProps.js.map +1 -1
  294. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  295. package/lib/esm/annotation/TextAnnotation.js.map +1 -1
  296. package/lib/esm/annotation/TextBlock.js.map +1 -1
  297. package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
  298. package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
  299. package/lib/esm/annotation/TextField.js.map +1 -1
  300. package/lib/esm/annotation/TextStyle.js.map +1 -1
  301. package/lib/esm/core-common.d.ts +2 -0
  302. package/lib/esm/core-common.d.ts.map +1 -1
  303. package/lib/esm/core-common.js +2 -0
  304. package/lib/esm/core-common.js.map +1 -1
  305. package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
  306. package/lib/esm/domains/GenericElementProps.js.map +1 -1
  307. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  308. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  309. package/lib/esm/geometry/BoundingSphere.js.map +1 -1
  310. package/lib/esm/geometry/Cartographic.js.map +1 -1
  311. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  312. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  313. package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
  314. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  315. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  316. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  317. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  318. package/lib/esm/geometry/ImageGraphic.js.map +1 -1
  319. package/lib/esm/geometry/LineStyle.js.map +1 -1
  320. package/lib/esm/geometry/Placement.js.map +1 -1
  321. package/lib/esm/geometry/Projection.js.map +1 -1
  322. package/lib/esm/geometry/TextString.js.map +1 -1
  323. package/lib/esm/internal/BackendTypes.js.map +1 -1
  324. package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
  325. package/lib/esm/internal/RenderMaterialParams.js.map +1 -1
  326. package/lib/esm/internal/RenderMesh.js.map +1 -1
  327. package/lib/esm/internal/RenderTextureParams.js.map +1 -1
  328. package/lib/esm/internal/Snapping.js.map +1 -1
  329. package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -1
  330. package/lib/esm/internal/cross-package.js.map +1 -1
  331. package/lib/esm/ipc/IpcErrors.d.ts +34 -0
  332. package/lib/esm/ipc/IpcErrors.d.ts.map +1 -0
  333. package/lib/esm/ipc/IpcErrors.js +163 -0
  334. package/lib/esm/ipc/IpcErrors.js.map +1 -0
  335. package/lib/esm/ipc/IpcInvoke.d.ts +44 -0
  336. package/lib/esm/ipc/IpcInvoke.d.ts.map +1 -0
  337. package/lib/esm/ipc/IpcInvoke.js +78 -0
  338. package/lib/esm/ipc/IpcInvoke.js.map +1 -0
  339. package/lib/esm/ipc/IpcSession.js.map +1 -1
  340. package/lib/esm/ipc/IpcSocket.js.map +1 -1
  341. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  342. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  343. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  344. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  345. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  346. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  347. package/lib/esm/rpc/TestRpcManager.js.map +1 -1
  348. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  349. package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
  350. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  351. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  352. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  353. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  354. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  355. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  356. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  357. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  358. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  359. package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
  360. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  361. package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
  362. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  363. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  364. package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
  365. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  366. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  367. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  368. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  369. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  370. package/lib/esm/tile/B3dmTileIO.js.map +1 -1
  371. package/lib/esm/tile/CompositeTileIO.js.map +1 -1
  372. package/lib/esm/tile/ElementGraphics.js.map +1 -1
  373. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  374. package/lib/esm/tile/I3dmTileIO.js.map +1 -1
  375. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  376. package/lib/esm/tile/PntsTileIO.js.map +1 -1
  377. package/lib/esm/tile/TileIO.js.map +1 -1
  378. package/lib/esm/tile/TileMetadata.js.map +1 -1
  379. package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
  380. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"TextString.js","sourceRoot":"","sources":["../../../src/geometry/TextString.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAW,OAAO,EAAsB,QAAQ,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAuCvI;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACrB,kBAAkB;IACX,IAAI,CAAS;IACpB,6FAA6F;IACtF,IAAI,CAAS;IACpB,4BAA4B;IACrB,MAAM,CAAS;IACtB,2CAA2C;IACpC,WAAW,CAAU;IAC5B,kCAAkC;IAC3B,IAAI,CAAW;IACtB,oCAAoC;IAC7B,MAAM,CAAW;IACxB,uCAAuC;IAChC,SAAS,CAAW;IAC3B,+CAA+C;IAC/B,MAAM,CAAU;IAChC,+CAA+C;IAC/B,QAAQ,CAAqB;IAC7C,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAExF,YAAmB,KAAsB;QACvC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC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Ae,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;QACnF,MAAM,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,MAAM,WAAW,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/E,IAAI,SAAS,KAAK,WAAW;YAC3B,OAAO,KAAK,CAAC;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,GAAG,OAAO,IAAI,QAAQ,GAAG,OAAO;YAC3C,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC;IACd,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 Geometry\r\n */\r\n\r\nimport { Point2d, Point3d, Range2d, Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\r\nimport { FontId } from \"../Fonts\";\r\n\r\n/**\r\n * Optional cached text layout information used to support legacy proxy graphics.\r\n * @beta\r\n */\r\nexport interface TextStringGlyphData {\r\n glyphIds: number[];\r\n glyphOrigins: Point2d[];\r\n range: Range2d;\r\n}\r\n\r\n/** Properties for a TextString class.\r\n * @see [[GeometryStreamEntryProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TextStringProps {\r\n /** text string */\r\n text: string;\r\n /** FontId for the TextString. FontIds are mapped to font names and types via the FontMap */\r\n font: FontId;\r\n /* text height */\r\n height: number;\r\n /* width / height ratio. Default is 1.0 */\r\n widthFactor?: number;\r\n /** bold text. Default is false */\r\n bold?: boolean;\r\n /** italic text. Default is false */\r\n italic?: boolean;\r\n /** underline text. Default is false */\r\n underline?: boolean;\r\n /** Optional position relative to element's placement. Default is 0,0,0 */\r\n origin?: XYZProps;\r\n /** Optional rotation relative to element's placement. Default is identity matrix */\r\n rotation?: YawPitchRollProps;\r\n}\r\n\r\n/** A single line of text, all with the same font, styles (underline, bold, italic), and size.\r\n * This class also holds the origin and direction for the text.\r\n * A paragraph is composed of one or more instances of TextStrings.\r\n * @public\r\n */\r\nexport class TextString {\r\n /** Text string */\r\n public text: string;\r\n /** FontId for this TextString. FontIds are mapped to font names and types via the FontMap */\r\n public font: FontId;\r\n /* text height, in meters */\r\n public height: number;\r\n /* width / height ratio. Default is 1.0 */\r\n public widthFactor?: number;\r\n /** bold text. Default is false */\r\n public bold?: boolean;\r\n /** italic text. Default is false */\r\n public italic?: boolean;\r\n /** underline text. Default is false */\r\n public underline?: boolean;\r\n /** position relative to element's placement */\r\n public readonly origin: Point3d;\r\n /** Rotation relative to element's placement */\r\n public readonly rotation: YawPitchRollAngles;\r\n public get width() { return this.height * (this.widthFactor ? this.widthFactor : 1.0); }\r\n\r\n public constructor(props: TextStringProps) {\r\n this.text = props.text;\r\n this.font = props.font;\r\n this.height = props.height;\r\n this.widthFactor = props.widthFactor;\r\n this.bold = props.bold;\r\n this.italic = props.italic;\r\n this.underline = props.underline;\r\n this.origin = Point3d.fromJSON(props.origin);\r\n this.rotation = YawPitchRollAngles.fromJSON(props.rotation);\r\n }\r\n\r\n public toJSON(): TextStringProps {\r\n const props: TextStringProps = {\r\n text: this.text,\r\n font: this.font,\r\n height: this.height,\r\n widthFactor: this.widthFactor,\r\n bold: this.bold,\r\n italic: this.italic,\r\n underline: this.underline,\r\n };\r\n\r\n if (!this.origin.isAlmostZero) {\r\n props.origin = this.origin.toJSON();\r\n }\r\n\r\n if (!this.rotation.isIdentity()) {\r\n props.rotation = this.rotation.toJSON();\r\n }\r\n\r\n return props;\r\n }\r\n\r\n public transformInPlace(transform: Transform): boolean {\r\n const newOrigin = transform.multiplyPoint3d(this.origin, this.origin);\r\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\r\n const scales = new Vector3d();\r\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\r\n return false;\r\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\r\n if (undefined === newRotation)\r\n return false;\r\n const newHeight = this.height * scales.y;\r\n const newWidth = this.width * scales.x;\r\n if (newHeight < 1.0e-10 || newWidth < 1.0e-10)\r\n return false;\r\n this.origin.setFrom(newOrigin);\r\n this.rotation.setFrom(newRotation);\r\n this.height = newHeight;\r\n this.widthFactor = (newHeight === newWidth ? undefined : (newWidth / newHeight));\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"TextString.js","sourceRoot":"","sources":["../../../src/geometry/TextString.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAW,OAAO,EAAsB,QAAQ,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAuCvI;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACrB,kBAAkB;IACX,IAAI,CAAS;IACpB,6FAA6F;IACtF,IAAI,CAAS;IACp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WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { Point2d, Point3d, Range2d, Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { FontId } from \"../Fonts\";\n\n/**\n * Optional cached text layout information used to support legacy proxy graphics.\n * @beta\n */\nexport interface TextStringGlyphData {\n glyphIds: number[];\n glyphOrigins: Point2d[];\n range: Range2d;\n}\n\n/** Properties for a TextString class.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface TextStringProps {\n /** text string */\n text: string;\n /** FontId for the TextString. FontIds are mapped to font names and types via the FontMap */\n font: FontId;\n /* text height */\n height: number;\n /* width / height ratio. Default is 1.0 */\n widthFactor?: number;\n /** bold text. Default is false */\n bold?: boolean;\n /** italic text. Default is false */\n italic?: boolean;\n /** underline text. Default is false */\n underline?: boolean;\n /** Optional position relative to element's placement. Default is 0,0,0 */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement. Default is identity matrix */\n rotation?: YawPitchRollProps;\n}\n\n/** A single line of text, all with the same font, styles (underline, bold, italic), and size.\n * This class also holds the origin and direction for the text.\n * A paragraph is composed of one or more instances of TextStrings.\n * @public\n */\nexport class TextString {\n /** Text string */\n public text: string;\n /** FontId for this TextString. FontIds are mapped to font names and types via the FontMap */\n public font: FontId;\n /* text height, in meters */\n public height: number;\n /* width / height ratio. Default is 1.0 */\n public widthFactor?: number;\n /** bold text. Default is false */\n public bold?: boolean;\n /** italic text. Default is false */\n public italic?: boolean;\n /** underline text. Default is false */\n public underline?: boolean;\n /** position relative to element's placement */\n public readonly origin: Point3d;\n /** Rotation relative to element's placement */\n public readonly rotation: YawPitchRollAngles;\n public get width() { return this.height * (this.widthFactor ? this.widthFactor : 1.0); }\n\n public constructor(props: TextStringProps) {\n this.text = props.text;\n this.font = props.font;\n this.height = props.height;\n this.widthFactor = props.widthFactor;\n this.bold = props.bold;\n this.italic = props.italic;\n this.underline = props.underline;\n this.origin = Point3d.fromJSON(props.origin);\n this.rotation = YawPitchRollAngles.fromJSON(props.rotation);\n }\n\n public toJSON(): TextStringProps {\n const props: TextStringProps = {\n text: this.text,\n font: this.font,\n height: this.height,\n widthFactor: this.widthFactor,\n bold: this.bold,\n italic: this.italic,\n underline: this.underline,\n };\n\n if (!this.origin.isAlmostZero) {\n props.origin = this.origin.toJSON();\n }\n\n if (!this.rotation.isIdentity()) {\n props.rotation = this.rotation.toJSON();\n }\n\n return props;\n }\n\n public transformInPlace(transform: Transform): boolean {\n const newOrigin = transform.multiplyPoint3d(this.origin, this.origin);\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\n const scales = new Vector3d();\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\n if (undefined === newRotation)\n return false;\n const newHeight = this.height * scales.y;\n const newWidth = this.width * scales.x;\n if (newHeight < 1.0e-10 || newWidth < 1.0e-10)\n return false;\n this.origin.setFrom(newOrigin);\n this.rotation.setFrom(newRotation);\n this.height = newHeight;\n this.widthFactor = (newHeight === newWidth ? undefined : (newWidth / newHeight));\n return true;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BackendTypes.js","sourceRoot":"","sources":["../../../src/internal/BackendTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 Utils\r\n */\r\n\r\nimport type { Readable, Writable } from \"stream\"; // Must be \"import type\" to avoid webpack polyfill errors\r\nimport type { Buffer } from \"buffer\"; // Must be \"import type\" to avoid webpack polyfill errors\r\n\r\n/*\r\nIMPORTANT:\r\nThis is a temporary source file for backwards compatibility only.\r\nDo not add any new types to this file.\r\nAll types here will be removed in 4.0\r\n*/\r\n\r\n/** BackendReadable and BackendWritable are not tagged internal for deprecated public RPC APIs which reference these types. */\r\n/** @public @deprecated in 3.4.5 - might be removed in next major version. This type was mistakenly made public in the common scope. */\r\nexport type BackendReadable = Readable;\r\n\r\n/** @public @deprecated in 3.4.5 - might be removed in next major version. This type was mistakenly made public in the common scope. */\r\nexport type BackendWritable = Writable;\r\n\r\n/** @internal @deprecated in 3.4.5 - might be removed in next major version. This type was mistakenly made public in the common scope. */\r\nexport type BackendBuffer = Buffer;\r\n"]}
1
+ {"version":3,"file":"BackendTypes.js","sourceRoot":"","sources":["../../../src/internal/BackendTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\nimport type { Readable, Writable } from \"stream\"; // Must be \"import type\" to avoid webpack polyfill errors\nimport type { Buffer } from \"buffer\"; // Must be \"import type\" to avoid webpack polyfill errors\n\n/*\nIMPORTANT:\nThis is a temporary source file for backwards compatibility only.\nDo not add any new types to this file.\nAll types here will be removed in 4.0\n*/\n\n/** BackendReadable and BackendWritable are not tagged internal for deprecated public RPC APIs which reference these types. */\n/** @public @deprecated in 3.4.5 - might be removed in next major version. This type was mistakenly made public in the common scope. */\nexport type BackendReadable = Readable;\n\n/** @public @deprecated in 3.4.5 - might be removed in next major version. This type was mistakenly made public in the common scope. */\nexport type BackendWritable = Writable;\n\n/** @internal @deprecated in 3.4.5 - might be removed in next major version. This type was mistakenly made public in the common scope. */\nexport type BackendBuffer = Buffer;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PackedFeatureTable.js","sourceRoot":"","sources":["../../../src/internal/PackedFeatureTable.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,MAAM,EAAE,aAAa,EAAE,IAAI,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAiB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAA8C,MAAM,iBAAiB,CAAC;AAC3J,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACb,IAAI,CAAc;IAClB,YAAY,CAAa;IACzB,gBAAgB,CAAkB;IAClC,WAAW,CAAS;IACpB,UAAU,CAAU;IACpB,IAAI,CAAY;IACzB,gBAAgB,CAAa;IAEpC,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAEhE;;;OAGG;IACH,YAAmB,IAAiB,EAAE,OAAmB,EAAE,WAAmB,EAAE,IAAe,EAAE,gBAA4B;QAC3H,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,QAAQ,IAAI,CAAC,WAAW,EA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IAAI,EAAE;QACtB,aAAa,EAAE,EAAE,GAAG,IAAI,EAAE;QAC1B,aAAa,EAAE,aAAa,CAAC,OAAO;QACpC,eAAe,EAAE,CAAC;KACnB,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,mBAAmB,EAAE,CAAC;AAEnD,SAAS,wBAAwB,CAAC,KAAyB,EAAE,aAA4B,EAAE,SAAiB;IAC1G,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAEtB,IAAI,OAAO,CAAC;IACZ,MAAM,aAAa,GAAG,aAAa,CAAC,eAAe,EAAE,CAAC;IACtD,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC;gBAC/B,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7H,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","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 {\r\n assert, expectDefined, Id64, Id64String, UintArray,\r\n} from \"@itwin/core-bentley\";\r\nimport { BatchType, ComputeNodeId, Feature, FeatureTable, ModelFeature, PackedFeature, PackedFeatureWithIndex, RenderFeatureTable } from \"../FeatureTable\";\r\nimport { GeometryClass } from \"../GeometryParams\";\r\n\r\n/**\r\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\r\n * wherein each feature occupies 3 32-bit integers.\r\n * @internal\r\n */\r\nexport class PackedFeatureTable implements RenderFeatureTable {\r\n public readonly data: Uint32Array;\r\n public readonly batchModelId: Id64String;\r\n public readonly batchModelIdPair: Id64.Uint32Pair;\r\n public readonly numFeatures: number;\r\n public readonly anyDefined: boolean;\r\n public readonly type: BatchType;\r\n public animationNodeIds?: UintArray;\r\n\r\n public get byteLength(): number { return this.data.byteLength; }\r\n\r\n /** Construct a PackedFeatureTable from the packed binary data.\r\n * This is used internally when deserializing Tiles in iMdl format.\r\n * @internal\r\n */\r\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\r\n this.data = data;\r\n this.batchModelId = modelId;\r\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\r\n this.numFeatures = numFeatures;\r\n this.type = type;\r\n this.animationNodeIds = animationNodeIds;\r\n\r\n switch (this.numFeatures) {\r\n case 0:\r\n this.anyDefined = false;\r\n break;\r\n case 1:\r\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\r\n break;\r\n default:\r\n this.anyDefined = true;\r\n break;\r\n }\r\n\r\n assert(this.data.length >= this._subCategoriesOffset);\r\n assert(undefined === this.animationNodeIds || this.animationNodeIds.length === this.numFeatures);\r\n }\r\n\r\n /** Create a packed feature table from a [[FeatureTable]]. */\r\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\r\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\r\n // the array cannot be resized after it is created.\r\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\r\n // back-end arrive within tiles already in the packed format.\r\n const subcategories = new Map<string, number>();\r\n for (const iv of featureTable.getArray()) {\r\n const found = subcategories.get(iv.value.subCategoryId.toString());\r\n if (undefined === found)\r\n subcategories.set(iv.value.subCategoryId, subcategories.size);\r\n }\r\n\r\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\r\n const subCategoriesOffset = 3 * featureTable.length;\r\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\r\n const uint32s = new Uint32Array(nUint32s);\r\n\r\n for (const iv of featureTable.getArray()) {\r\n const feature = iv.value;\r\n const index = iv.index * 3;\r\n\r\n let subCategoryIndex = expectDefined(subcategories.get(feature.subCategoryId));\r\n assert(undefined !== subCategoryIndex); // we inserted it above...\r\n subCategoryIndex |= (feature.geometryClass << 24);\r\n\r\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\r\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\r\n uint32s[index + 2] = subCategoryIndex;\r\n }\r\n\r\n subcategories.forEach((index: number, id: string, _map) => {\r\n const index32 = subCategoriesOffset + 2 * index;\r\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\r\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\r\n });\r\n\r\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\r\n }\r\n\r\n /** Retrieve the Feature associated with the specified index. */\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result, this.batchModelId);\r\n }\r\n\r\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n out = out ?? { lower: 0, upper: 0 };\r\n assert(featureIndex < this.numFeatures);\r\n const offset = 3 * featureIndex;\r\n out.lower = this.data[offset];\r\n out.upper = this.data[offset + 1];\r\n return out;\r\n }\r\n\r\n /** @internal */\r\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\r\n const index = 3 * featureIndex;\r\n let subCatIndex = this.data[index + 2];\r\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n return { lower: this.data[subCatIndex], upper: this.data[subCatIndex + 1] };\r\n }\r\n\r\n /** @internal */\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return undefined !== this.animationNodeIds && featureIndex < this.numFeatures ? this.animationNodeIds[featureIndex] : 0;\r\n }\r\n\r\n /** @internal */\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n assert(featureIndex < this.numFeatures);\r\n\r\n const index32 = 3 * featureIndex;\r\n result.elementId.lower = this.data[index32];\r\n result.elementId.upper = this.data[index32 + 1];\r\n\r\n const subCatIndexAndClass = this.data[index32 + 2];\r\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\r\n\r\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n result.subCategoryId.lower = this.data[subCatIndex];\r\n result.subCategoryId.upper = this.data[subCatIndex + 1];\r\n\r\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\r\n result.modelId.lower = this.batchModelIdPair.lower;\r\n result.modelId.upper = this.batchModelIdPair.upper;\r\n\r\n return result;\r\n }\r\n\r\n public getModelIdPair(_featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n out.lower = this.batchModelIdPair.lower;\r\n out.upper = this.batchModelIdPair.upper;\r\n return out;\r\n }\r\n\r\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n if (featureIndex >= this.numFeatures)\r\n return undefined;\r\n else\r\n return this.readId(3 * featureIndex);\r\n }\r\n\r\n /** Return true if this table contains exactly 1 feature. */\r\n public get isUniform(): boolean { return 1 === this.numFeatures; }\r\n\r\n /** If this table contains exactly 1 feature, return it. */\r\n public getUniform(result: ModelFeature): ModelFeature | undefined {\r\n return this.isUniform ? this.getFeature(0, result) : undefined;\r\n }\r\n\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\r\n\r\n /** Unpack the features into a [[FeatureTable]]. */\r\n public unpack(): FeatureTable {\r\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\r\n const feature = ModelFeature.create();\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getFeature(i, feature);\r\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\r\n }\r\n\r\n return table;\r\n }\r\n\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n assert(undefined === this.animationNodeIds);\r\n this.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getPackedFeature(i, output);\r\n output.index = i;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\r\n\r\n private readId(offset32: number): Id64String {\r\n return Id64.fromUint32Pair(this.data[offset32], this.data[offset32 + 1]);\r\n }\r\n}\r\n\r\ninterface PackedFeatureModelEntry {\r\n lastFeatureIndex: number;\r\n idLower: number;\r\n idUpper: number;\r\n}\r\n\r\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\r\n\r\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\r\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\r\n * The model table itself consists of one entry per model, where each entry looks like:\r\n * indexOfLastFeatureInModel: u32\r\n * modelId: u64\r\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\r\n * This lookup can be optimized using binary search.\r\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\r\n * @internal\r\n */\r\nexport class PackedFeatureModelTable {\r\n private readonly _data: Uint32Array;\r\n\r\n public constructor(data: Uint32Array) {\r\n this._data = data;\r\n assert(this._data.length % 3 === 0);\r\n }\r\n\r\n /** The number of models in the table. */\r\n public get length(): number {\r\n return this._data.length / 3;\r\n }\r\n\r\n public get byteLength(): number {\r\n return this._data.byteLength;\r\n }\r\n\r\n private getLastFeatureIndex(modelIndex: number): number {\r\n return this._data[modelIndex * 3];\r\n }\r\n\r\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\r\n if (modelIndex >= this.length) {\r\n result.idLower = result.idUpper = 0;\r\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\r\n return result;\r\n }\r\n\r\n const index = modelIndex * 3;\r\n result.lastFeatureIndex = this._data[index + 0];\r\n result.idLower = this._data[index + 1];\r\n result.idUpper = this._data[index + 2];\r\n return result;\r\n }\r\n\r\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\r\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n if (!result)\r\n result = { lower: 0, upper: 0 };\r\n else\r\n result.lower = result.upper = 0;\r\n\r\n let first = 0;\r\n const last = this.length;\r\n let count = last;\r\n while (count > 0) {\r\n const step = Math.floor(count / 2);\r\n const mid = first + step;\r\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\r\n if (featureIndex > lastFeatureIndex) {\r\n first = mid + 1;\r\n count -= step + 1;\r\n } else {\r\n count = step;\r\n }\r\n }\r\n\r\n if (first < last) {\r\n result.lower = this._data[first * 3 + 1];\r\n result.upper = this._data[first * 3 + 2];\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\r\n * @internal\r\n */\r\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\r\n private readonly _features: PackedFeatureTable;\r\n private readonly _models: PackedFeatureModelTable;\r\n\r\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\r\n this._features = features;\r\n this._models = models;\r\n }\r\n\r\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\r\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\r\n const featureData = data.subarray(0, modelTableOffset);\r\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\r\n\r\n const modelData = data.subarray(modelTableOffset);\r\n const models = new PackedFeatureModelTable(modelData);\r\n\r\n return new MultiModelPackedFeatureTable(features, models);\r\n }\r\n\r\n public get batchModelId() { return this._features.batchModelId; }\r\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\r\n public get numFeatures() { return this._features.numFeatures; }\r\n public get type() { return this._features.type; }\r\n public get animationNodeIds(): UintArray | undefined { return this._features.animationNodeIds; }\r\n public set animationNodeIds(ids: UintArray | undefined) { this._features.animationNodeIds = ids; }\r\n\r\n public get byteLength() {\r\n return this._features.byteLength + this._models.byteLength;\r\n }\r\n\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n this._features.getPackedFeature(featureIndex, result);\r\n this._models.getModelIdPair(featureIndex, result.modelId);\r\n return result;\r\n }\r\n\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result);\r\n }\r\n\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n return this._features.getElementIdPair(featureIndex, out);\r\n }\r\n\r\n public getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n this._models.getModelIdPair(featureIndex, out);\r\n return out;\r\n }\r\n\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n return this._features.findElementId(featureIndex);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\r\n let modelIndex = 0;\r\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\r\n\r\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\r\n if (featureIndex > modelEntry.lastFeatureIndex)\r\n this._models.getEntry(++modelIndex, modelEntry);\r\n\r\n this._features.getPackedFeature(featureIndex, output);\r\n output.modelId.lower = modelEntry.idLower;\r\n output.modelId.upper = modelEntry.idUpper;\r\n output.index = featureIndex;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return this._features.getAnimationNodeId(featureIndex);\r\n }\r\n\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n this._features.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\r\n }\r\n}\r\n\r\nexport function createPackedFeature(): PackedFeature {\r\n const pair = { upper: 0, lower: 0 };\r\n return {\r\n modelId: { ...pair },\r\n elementId: { ...pair },\r\n subCategoryId: { ...pair },\r\n geometryClass: GeometryClass.Primary,\r\n animationNodeId: 0,\r\n };\r\n}\r\n\r\nconst scratchPackedFeature = createPackedFeature();\r\n\r\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\r\n assert(maxNodeId > 0);\r\n\r\n let nodeIds;\r\n const outputFeature = PackedFeature.createWithIndex();\r\n for (const feature of table.iterable(outputFeature)) {\r\n const nodeId = computeNodeId(feature);\r\n assert(nodeId <= maxNodeId);\r\n if (0 !== nodeId) {\r\n if (!nodeIds) {\r\n const size = table.numFeatures;\r\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\r\n }\r\n\r\n nodeIds[feature.index] = nodeId;\r\n }\r\n }\r\n\r\n return nodeIds;\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"PackedFeatureTable.js","sourceRoot":"","sources":["../../../src/internal/PackedFeatureTable.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,MAAM,EAAE,aAAa,EAAE,IAAI,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAiB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAA8C,MAAM,iBAAiB,CAAC;AAC3J,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACb,IAAI,CAAc;IAClB,YAAY,CAAa;IACzB,gBAAgB,CAAkB;IAClC,WAAW,CAAS;IACpB,UAAU,CAAU;IACpB,IAAI,CAAY;IACzB,gBAAgB,CAAa;IAEpC,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE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CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7H,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport {\n assert, expectDefined, Id64, Id64String, UintArray,\n} from \"@itwin/core-bentley\";\nimport { BatchType, ComputeNodeId, Feature, FeatureTable, ModelFeature, PackedFeature, PackedFeatureWithIndex, RenderFeatureTable } from \"../FeatureTable\";\nimport { GeometryClass } from \"../GeometryParams\";\n\n/**\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\n * wherein each feature occupies 3 32-bit integers.\n * @internal\n */\nexport class PackedFeatureTable implements RenderFeatureTable {\n public readonly data: Uint32Array;\n public readonly batchModelId: Id64String;\n public readonly batchModelIdPair: Id64.Uint32Pair;\n public readonly numFeatures: number;\n public readonly anyDefined: boolean;\n public readonly type: BatchType;\n public animationNodeIds?: UintArray;\n\n public get byteLength(): number { return this.data.byteLength; }\n\n /** Construct a PackedFeatureTable from the packed binary data.\n * This is used internally when deserializing Tiles in iMdl format.\n * @internal\n */\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\n this.data = data;\n this.batchModelId = modelId;\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\n this.numFeatures = numFeatures;\n this.type = type;\n this.animationNodeIds = animationNodeIds;\n\n switch (this.numFeatures) {\n case 0:\n this.anyDefined = false;\n break;\n case 1:\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\n break;\n default:\n this.anyDefined = true;\n break;\n }\n\n assert(this.data.length >= this._subCategoriesOffset);\n assert(undefined === this.animationNodeIds || this.animationNodeIds.length === this.numFeatures);\n }\n\n /** Create a packed feature table from a [[FeatureTable]]. */\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\n // the array cannot be resized after it is created.\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\n // back-end arrive within tiles already in the packed format.\n const subcategories = new Map<string, number>();\n for (const iv of featureTable.getArray()) {\n const found = subcategories.get(iv.value.subCategoryId.toString());\n if (undefined === found)\n subcategories.set(iv.value.subCategoryId, subcategories.size);\n }\n\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\n const subCategoriesOffset = 3 * featureTable.length;\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\n const uint32s = new Uint32Array(nUint32s);\n\n for (const iv of featureTable.getArray()) {\n const feature = iv.value;\n const index = iv.index * 3;\n\n let subCategoryIndex = expectDefined(subcategories.get(feature.subCategoryId));\n assert(undefined !== subCategoryIndex); // we inserted it above...\n subCategoryIndex |= (feature.geometryClass << 24);\n\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\n uint32s[index + 2] = subCategoryIndex;\n }\n\n subcategories.forEach((index: number, id: string, _map) => {\n const index32 = subCategoriesOffset + 2 * index;\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\n });\n\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\n }\n\n /** Retrieve the Feature associated with the specified index. */\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result, this.batchModelId);\n }\n\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n /** @internal */\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\n out = out ?? { lower: 0, upper: 0 };\n assert(featureIndex < this.numFeatures);\n const offset = 3 * featureIndex;\n out.lower = this.data[offset];\n out.upper = this.data[offset + 1];\n return out;\n }\n\n /** @internal */\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\n const index = 3 * featureIndex;\n let subCatIndex = this.data[index + 2];\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n return { lower: this.data[subCatIndex], upper: this.data[subCatIndex + 1] };\n }\n\n /** @internal */\n public getAnimationNodeId(featureIndex: number): number {\n return undefined !== this.animationNodeIds && featureIndex < this.numFeatures ? this.animationNodeIds[featureIndex] : 0;\n }\n\n /** @internal */\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n assert(featureIndex < this.numFeatures);\n\n const index32 = 3 * featureIndex;\n result.elementId.lower = this.data[index32];\n result.elementId.upper = this.data[index32 + 1];\n\n const subCatIndexAndClass = this.data[index32 + 2];\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\n\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n result.subCategoryId.lower = this.data[subCatIndex];\n result.subCategoryId.upper = this.data[subCatIndex + 1];\n\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\n result.modelId.lower = this.batchModelIdPair.lower;\n result.modelId.upper = this.batchModelIdPair.upper;\n\n return result;\n }\n\n public getModelIdPair(_featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n out.lower = this.batchModelIdPair.lower;\n out.upper = this.batchModelIdPair.upper;\n return out;\n }\n\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\n public findElementId(featureIndex: number): Id64String | undefined {\n if (featureIndex >= this.numFeatures)\n return undefined;\n else\n return this.readId(3 * featureIndex);\n }\n\n /** Return true if this table contains exactly 1 feature. */\n public get isUniform(): boolean { return 1 === this.numFeatures; }\n\n /** If this table contains exactly 1 feature, return it. */\n public getUniform(result: ModelFeature): ModelFeature | undefined {\n return this.isUniform ? this.getFeature(0, result) : undefined;\n }\n\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\n\n /** Unpack the features into a [[FeatureTable]]. */\n public unpack(): FeatureTable {\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\n const feature = ModelFeature.create();\n for (let i = 0; i < this.numFeatures; i++) {\n this.getFeature(i, feature);\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\n }\n\n return table;\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n assert(undefined === this.animationNodeIds);\n this.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n for (let i = 0; i < this.numFeatures; i++) {\n this.getPackedFeature(i, output);\n output.index = i;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\n\n private readId(offset32: number): Id64String {\n return Id64.fromUint32Pair(this.data[offset32], this.data[offset32 + 1]);\n }\n}\n\ninterface PackedFeatureModelEntry {\n lastFeatureIndex: number;\n idLower: number;\n idUpper: number;\n}\n\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\n\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\n * The model table itself consists of one entry per model, where each entry looks like:\n * indexOfLastFeatureInModel: u32\n * modelId: u64\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\n * This lookup can be optimized using binary search.\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\n * @internal\n */\nexport class PackedFeatureModelTable {\n private readonly _data: Uint32Array;\n\n public constructor(data: Uint32Array) {\n this._data = data;\n assert(this._data.length % 3 === 0);\n }\n\n /** The number of models in the table. */\n public get length(): number {\n return this._data.length / 3;\n }\n\n public get byteLength(): number {\n return this._data.byteLength;\n }\n\n private getLastFeatureIndex(modelIndex: number): number {\n return this._data[modelIndex * 3];\n }\n\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\n if (modelIndex >= this.length) {\n result.idLower = result.idUpper = 0;\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\n return result;\n }\n\n const index = modelIndex * 3;\n result.lastFeatureIndex = this._data[index + 0];\n result.idLower = this._data[index + 1];\n result.idUpper = this._data[index + 2];\n return result;\n }\n\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\n if (!result)\n result = { lower: 0, upper: 0 };\n else\n result.lower = result.upper = 0;\n\n let first = 0;\n const last = this.length;\n let count = last;\n while (count > 0) {\n const step = Math.floor(count / 2);\n const mid = first + step;\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\n if (featureIndex > lastFeatureIndex) {\n first = mid + 1;\n count -= step + 1;\n } else {\n count = step;\n }\n }\n\n if (first < last) {\n result.lower = this._data[first * 3 + 1];\n result.upper = this._data[first * 3 + 2];\n }\n\n return result;\n }\n}\n\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\n * @internal\n */\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\n private readonly _features: PackedFeatureTable;\n private readonly _models: PackedFeatureModelTable;\n\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\n this._features = features;\n this._models = models;\n }\n\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\n const featureData = data.subarray(0, modelTableOffset);\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\n\n const modelData = data.subarray(modelTableOffset);\n const models = new PackedFeatureModelTable(modelData);\n\n return new MultiModelPackedFeatureTable(features, models);\n }\n\n public get batchModelId() { return this._features.batchModelId; }\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\n public get numFeatures() { return this._features.numFeatures; }\n public get type() { return this._features.type; }\n public get animationNodeIds(): UintArray | undefined { return this._features.animationNodeIds; }\n public set animationNodeIds(ids: UintArray | undefined) { this._features.animationNodeIds = ids; }\n\n public get byteLength() {\n return this._features.byteLength + this._models.byteLength;\n }\n\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n this._features.getPackedFeature(featureIndex, result);\n this._models.getModelIdPair(featureIndex, result.modelId);\n return result;\n }\n\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result);\n }\n\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n return this._features.getElementIdPair(featureIndex, out);\n }\n\n public getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n this._models.getModelIdPair(featureIndex, out);\n return out;\n }\n\n public findElementId(featureIndex: number): Id64String | undefined {\n return this._features.findElementId(featureIndex);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\n let modelIndex = 0;\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\n\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\n if (featureIndex > modelEntry.lastFeatureIndex)\n this._models.getEntry(++modelIndex, modelEntry);\n\n this._features.getPackedFeature(featureIndex, output);\n output.modelId.lower = modelEntry.idLower;\n output.modelId.upper = modelEntry.idUpper;\n output.index = featureIndex;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n public getAnimationNodeId(featureIndex: number): number {\n return this._features.getAnimationNodeId(featureIndex);\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n this._features.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n}\n\nexport function createPackedFeature(): PackedFeature {\n const pair = { upper: 0, lower: 0 };\n return {\n modelId: { ...pair },\n elementId: { ...pair },\n subCategoryId: { ...pair },\n geometryClass: GeometryClass.Primary,\n animationNodeId: 0,\n };\n}\n\nconst scratchPackedFeature = createPackedFeature();\n\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\n assert(maxNodeId > 0);\n\n let nodeIds;\n const outputFeature = PackedFeature.createWithIndex();\n for (const feature of table.iterable(outputFeature)) {\n const nodeId = computeNodeId(feature);\n assert(nodeId <= maxNodeId);\n if (0 !== nodeId) {\n if (!nodeIds) {\n const size = table.numFeatures;\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\n }\n\n nodeIds[feature.index] = nodeId;\n }\n }\n\n return nodeIds;\n}\n\n"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AC;IAChF,CAAC;IAED,6HAA6H;IACtH,MAAM,CAAC,UAAU,CAAC,GAAY,EAAE,YAAuB,EAAE,aAAwB,EAAE,aAAwB,EAAE,YAAuB,EAAE,UAA2B;QACtK,MAAM,cAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAClD,cAAc,CAAC,GAAG,GAAG,GAAG,CAAC;QACzB,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;QAC3C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;QAC3C,cAAc,CAAC,cAAc,GAAG,UAAU,CAAC;QAC3C,OAAO,cAAc,CAAC;IACxB,CAAC;;AAGH,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC","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 { ColorDef } from \"../ColorDef\";\r\nimport { TextureMapping } from \"../TextureMapping\";\r\n\r\nfunction clampToNormalizedRange(value: number): number {\r\n return Math.max(0.0, Math.min(1.0, value));\r\n}\r\n\r\n/** Params for use in old CreateMaterial functions. Use [CreateRenderMaterialArgs]($frontend) instead.\r\n * @internal\r\n*/\r\nexport class RenderMaterialParams {\r\n /** If the material originates from a Material element in the [[IModel]], the Id of that element. */\r\n public key?: string;\r\n /** Diffuse color, or undefined if this material does not override the surface's own color. */\r\n public diffuseColor?: ColorDef;\r\n /** Specular color. Defaults to white if undefined. */\r\n public specularColor?: ColorDef;\r\n /** Currently unused. @alpha */\r\n public emissiveColor?: ColorDef;\r\n /** Currently unused. @alpha */\r\n public reflectColor?: ColorDef;\r\n /** Optional pattern mapping applied to the surface. */\r\n public textureMapping?: TextureMapping;\r\n /** Diffuse weight in [0..1] */\r\n public diffuse: number = 0.6;\r\n /** Specular weight in [0..1] */\r\n public specular: number = 0.4;\r\n public specularExponent: number = 13.5;\r\n /** Currently unused. @alpha */\r\n public reflect: number = 0.0;\r\n /** Currently unused. @alpha */\r\n public refract: number = 1.0;\r\n /** Currently unused. @alpha */\r\n public ambient: number = .3;\r\n /** Currently unused. @alpha */\r\n public shadows = true;\r\n private _alpha?: number;\r\n\r\n public constructor(key?: string) { this.key = key; }\r\n\r\n /** Obtain an immutable instance of a RenderMaterial with all default properties. */\r\n public static readonly defaults = new RenderMaterialParams();\r\n\r\n /** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied;\r\n * or undefined if this material does not override surface transparency.\r\n */\r\n public get alpha(): number | undefined { return this._alpha; }\r\n public set alpha(alpha: number | undefined) {\r\n this._alpha = undefined !== alpha ? clampToNormalizedRange(alpha) : undefined;\r\n }\r\n\r\n /** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */\r\n public static fromColors(key?: string, diffuseColor?: ColorDef, specularColor?: ColorDef, emissiveColor?: ColorDef, reflectColor?: ColorDef, textureMap?: TextureMapping): RenderMaterialParams {\r\n const materialParams = new RenderMaterialParams();\r\n materialParams.key = key;\r\n materialParams.diffuseColor = diffuseColor;\r\n materialParams.specularColor = specularColor;\r\n materialParams.emissiveColor = emissiveColor;\r\n materialParams.reflectColor = reflectColor;\r\n materialParams.textureMapping = textureMap;\r\n return materialParams;\r\n }\r\n}\r\n\r\nObject.freeze(RenderMaterialParams.defaults);\r\n"]}
1
+ {"version":3,"file":"RenderMaterialParams.js","sourceRoot":"","sources":["../../../src/internal/RenderMaterialParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EA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AAG,YAAY,CAAC;QAC3C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;QAC3C,cAAc,CAAC,cAAc,GAAG,UAAU,CAAC;QAC3C,OAAO,cAAc,CAAC;IACxB,CAAC;;AAGH,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { ColorDef } from \"../ColorDef\";\nimport { TextureMapping } from \"../TextureMapping\";\n\nfunction clampToNormalizedRange(value: number): number {\n return Math.max(0.0, Math.min(1.0, value));\n}\n\n/** Params for use in old CreateMaterial functions. Use [CreateRenderMaterialArgs]($frontend) instead.\n * @internal\n*/\nexport class RenderMaterialParams {\n /** If the material originates from a Material element in the [[IModel]], the Id of that element. */\n public key?: string;\n /** Diffuse color, or undefined if this material does not override the surface's own color. */\n public diffuseColor?: ColorDef;\n /** Specular color. Defaults to white if undefined. */\n public specularColor?: ColorDef;\n /** Currently unused. @alpha */\n public emissiveColor?: ColorDef;\n /** Currently unused. @alpha */\n public reflectColor?: ColorDef;\n /** Optional pattern mapping applied to the surface. */\n public textureMapping?: TextureMapping;\n /** Diffuse weight in [0..1] */\n public diffuse: number = 0.6;\n /** Specular weight in [0..1] */\n public specular: number = 0.4;\n public specularExponent: number = 13.5;\n /** Currently unused. @alpha */\n public reflect: number = 0.0;\n /** Currently unused. @alpha */\n public refract: number = 1.0;\n /** Currently unused. @alpha */\n public ambient: number = .3;\n /** Currently unused. @alpha */\n public shadows = true;\n private _alpha?: number;\n\n public constructor(key?: string) { this.key = key; }\n\n /** Obtain an immutable instance of a RenderMaterial with all default properties. */\n public static readonly defaults = new RenderMaterialParams();\n\n /** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied;\n * or undefined if this material does not override surface transparency.\n */\n public get alpha(): number | undefined { return this._alpha; }\n public set alpha(alpha: number | undefined) {\n this._alpha = undefined !== alpha ? clampToNormalizedRange(alpha) : undefined;\n }\n\n /** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */\n public static fromColors(key?: string, diffuseColor?: ColorDef, specularColor?: ColorDef, emissiveColor?: ColorDef, reflectColor?: ColorDef, textureMap?: TextureMapping): RenderMaterialParams {\n const materialParams = new RenderMaterialParams();\n materialParams.key = key;\n materialParams.diffuseColor = diffuseColor;\n materialParams.specularColor = specularColor;\n materialParams.emissiveColor = emissiveColor;\n materialParams.reflectColor = reflectColor;\n materialParams.textureMapping = textureMap;\n return materialParams;\n }\n}\n\nObject.freeze(RenderMaterialParams.defaults);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderMesh.js","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH,gBAAgB;AAChB,MAAM,OAAO,YAAY;IACP,OAAO,CAAkB;IAEzC,YAAmB,UAA2B,EAAE;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,QAAQ,CAAC,KAAa;QAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACzB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK;YAC/D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAEM,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;CAC5C;AAKD,gBAAgB;AAChB,MAAM,OAAO,QAAQ;IACZ,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W,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5C,KAAK,KAAK,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC5C","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 { ColorDef } from \"../ColorDef\";\r\nimport { LinePixels } from \"../LinePixels\";\r\nimport { OctEncodedNormalPair } from \"../OctEncodedNormal\";\r\nimport { PolylineIndices } from \"../RenderPolyline\";\r\n\r\n/** @internal */\r\nexport class MeshPolyline {\r\n public readonly indices: PolylineIndices;\r\n\r\n public constructor(indices: PolylineIndices = []) {\r\n this.indices = indices.slice();\r\n }\r\n\r\n public addIndex(index: number) {\r\n const { indices } = this;\r\n if (indices.length === 0 || indices[indices.length - 1] !== index)\r\n indices.push(index);\r\n }\r\n\r\n public clear() { this.indices.length = 0; }\r\n}\r\n\r\n/** @internal */\r\nexport type MeshPolylineList = MeshPolyline[];\r\n\r\n/** @internal */\r\nexport class MeshEdge {\r\n public indices = [0, 0];\r\n\r\n public constructor(index0?: number, index1?: number) {\r\n if (undefined === index0 || undefined === index1)\r\n return;\r\n if (index0 < index1) {\r\n this.indices[0] = index0;\r\n this.indices[1] = index1;\r\n } else {\r\n this.indices[0] = index1;\r\n this.indices[1] = index0;\r\n }\r\n }\r\n\r\n public compareTo(other: MeshEdge): number {\r\n let diff = this.indices[0] - other.indices[0];\r\n if (0 === diff)\r\n diff = this.indices[1] - other.indices[1];\r\n\r\n return diff;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface EdgeAppearanceOverrides {\r\n color?: ColorDef;\r\n linePixels?: LinePixels;\r\n width?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface MeshPolylineGroup {\r\n polylines: MeshPolyline[];\r\n appearance?: EdgeAppearanceOverrides;\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdges {\r\n public visible: MeshEdge[] = [];\r\n public silhouette: MeshEdge[] = [];\r\n public appearance?: EdgeAppearanceOverrides;\r\n public polylineGroups: MeshPolylineGroup[] = [];\r\n public silhouetteNormals: OctEncodedNormalPair[] = [];\r\n public constructor() { }\r\n}\r\n\r\n/** @internal */\r\nexport class EdgeArgs {\r\n public edges?: MeshEdge[];\r\n\r\n public init(meshEdges?: MeshEdges): boolean {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\r\n this.edges = meshEdges.visible;\r\n\r\n return this.isValid;\r\n }\r\n\r\n public clear(): void { this.edges = undefined; }\r\n public get isValid(): boolean { return 0 < this.numEdges; }\r\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class SilhouetteEdgeArgs extends EdgeArgs {\r\n public normals?: OctEncodedNormalPair[];\r\n\r\n public override init(meshEdges?: MeshEdges) {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\r\n this.edges = meshEdges.silhouette;\r\n this.normals = meshEdges.silhouetteNormals;\r\n }\r\n\r\n return this.isValid;\r\n }\r\n\r\n public override clear() {\r\n this.normals = undefined;\r\n super.clear();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PolylineEdgeArgs {\r\n public groups?: MeshPolylineGroup[];\r\n\r\n public constructor(groups?: MeshPolylineGroup[]) {\r\n this.init(groups);\r\n }\r\n\r\n public init(groups?: MeshPolylineGroup[]): boolean {\r\n this.groups = groups?.filter((group) => group.polylines.length > 0);\r\n return this.isValid;\r\n }\r\n\r\n public get numGroups() { return this.groups?.length ?? 0; }\r\n public get isValid() { return this.numGroups > 0; }\r\n public clear() { this.groups =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CAAC,MAAM,EAAE,CAAC;YAC/D,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC;YAClC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAC7C,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEe,KAAK;QACnB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,OAAO,gBAAgB;IACpB,MAAM,CAAuB;IAEpC,YAAmB,MAA4B;QAC7C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAEM,IAAI,CAAC,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5C,KAAK,KAAK,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC5C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { ColorDef } from \"../ColorDef\";\nimport { LinePixels } from \"../LinePixels\";\nimport { OctEncodedNormalPair } from \"../OctEncodedNormal\";\nimport { PolylineIndices } from \"../RenderPolyline\";\n\n/** @internal */\nexport class MeshPolyline {\n public readonly indices: PolylineIndices;\n\n public constructor(indices: PolylineIndices = []) {\n this.indices = indices.slice();\n }\n\n public addIndex(index: number) {\n const { indices } = this;\n if (indices.length === 0 || indices[indices.length - 1] !== index)\n indices.push(index);\n }\n\n public clear() { this.indices.length = 0; }\n}\n\n/** @internal */\nexport type MeshPolylineList = MeshPolyline[];\n\n/** @internal */\nexport class MeshEdge {\n public indices = [0, 0];\n\n public constructor(index0?: number, index1?: number) {\n if (undefined === index0 || undefined === index1)\n return;\n if (index0 < index1) {\n this.indices[0] = index0;\n this.indices[1] = index1;\n } else {\n this.indices[0] = index1;\n this.indices[1] = index0;\n }\n }\n\n public compareTo(other: MeshEdge): number {\n let diff = this.indices[0] - other.indices[0];\n if (0 === diff)\n diff = this.indices[1] - other.indices[1];\n\n return diff;\n }\n}\n\n/** @internal */\nexport interface EdgeAppearanceOverrides {\n color?: ColorDef;\n linePixels?: LinePixels;\n width?: number;\n}\n\n/** @internal */\nexport interface MeshPolylineGroup {\n polylines: MeshPolyline[];\n appearance?: EdgeAppearanceOverrides;\n}\n\n/** @internal */\nexport class MeshEdges {\n public visible: MeshEdge[] = [];\n public silhouette: MeshEdge[] = [];\n public appearance?: EdgeAppearanceOverrides;\n public polylineGroups: MeshPolylineGroup[] = [];\n public silhouetteNormals: OctEncodedNormalPair[] = [];\n public constructor() { }\n}\n\n/** @internal */\nexport class EdgeArgs {\n public edges?: MeshEdge[];\n\n public init(meshEdges?: MeshEdges): boolean {\n this.clear();\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\n this.edges = meshEdges.visible;\n\n return this.isValid;\n }\n\n public clear(): void { this.edges = undefined; }\n public get isValid(): boolean { return 0 < this.numEdges; }\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\n}\n\n/** @internal */\nexport class SilhouetteEdgeArgs extends EdgeArgs {\n public normals?: OctEncodedNormalPair[];\n\n public override init(meshEdges?: MeshEdges) {\n this.clear();\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\n this.edges = meshEdges.silhouette;\n this.normals = meshEdges.silhouetteNormals;\n }\n\n return this.isValid;\n }\n\n public override clear() {\n this.normals = undefined;\n super.clear();\n }\n}\n\n/** @internal */\nexport class PolylineEdgeArgs {\n public groups?: MeshPolylineGroup[];\n\n public constructor(groups?: MeshPolylineGroup[]) {\n this.init(groups);\n }\n\n public init(groups?: MeshPolylineGroup[]): boolean {\n this.groups = groups?.filter((group) => group.polylines.length > 0);\n return this.isValid;\n }\n\n public get numGroups() { return this.groups?.length ?? 0; }\n public get isValid() { return this.numGroups > 0; }\n public clear() { this.groups = undefined; }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderTextureParams.js","sourceRoot":"","sources":["../../../src/internal/RenderTextureParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAC9B;;MAEE;IACc,GAAG,CAAU;IAC7B,qCAAqC;IACrB,IAAI,CAAqB;IACzC;;OAEG;IACa,OAAO,CAAU;IAEjC,YAAmB,GAAY,EAAE,OAA2B,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,UAAmB,KAAK;QAC7G,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;CACnF","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\nimport { RenderTexture } from \"../RenderTexture\";\r\n\r\n/** Parameters used to construct a [[RenderTexture]] in old RenderTexture functions.\r\n * Use RenderSystem.createTexture and CreateTextureArgs instead.\r\n * @internal\r\n */\r\nexport class RenderTextureParams {\r\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\r\n * Textures created on the front-end generally have no key.\r\n */\r\n public readonly key?: string;\r\n /** Indicates the type of texture. */\r\n public readonly type: RenderTexture.Type;\r\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\r\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\r\n */\r\n public readonly isOwned: boolean;\r\n\r\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\r\n this.key = key;\r\n this.type = type;\r\n this.isOwned = isOwned;\r\n }\r\n\r\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\r\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\r\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\r\n}"]}
1
+ {"version":3,"file":"RenderTextureParams.js","sourceRoot":"","sources":["../../../src/internal/RenderTextureParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAC9B;;MAEE;IACc,GAAG,CAAU;IAC7B,qCAAqC;IACrB,IAAI,CAAqB;IACzC;;OAEG;IACa,OAAO,CAAU;IAEjC,YAAmB,GAAY,EAAE,OAA2B,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,UAAmB,KAAK;QAC7G,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;CACnF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\nimport { RenderTexture } from \"../RenderTexture\";\n\n/** Parameters used to construct a [[RenderTexture]] in old RenderTexture functions.\n * Use RenderSystem.createTexture and CreateTextureArgs instead.\n * @internal\n */\nexport class RenderTextureParams {\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\n * Textures created on the front-end generally have no key.\n */\n public readonly key?: string;\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\n */\n public readonly isOwned: boolean;\n\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\n this.key = key;\n this.type = type;\n this.isOwned = isOwned;\n }\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Snapping.js","sourceRoot":"","sources":["../../../src/internal/Snapping.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 Geometry\r\n */\r\n\r\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { Matrix4dProps, TransformProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { GeometryStreamProps } from \"../geometry/GeometryStream\";\r\nimport { GeometryClass } from \"../GeometryParams\";\r\nimport { ViewFlagProps } from \"../ViewFlags\";\r\n\r\n/** Information required to request a *snap* to a pickable decoration from the front end to the back end.\r\n * @internal RPC glue.\r\n */\r\nexport interface DecorationGeometryProps {\r\n readonly id: Id64String;\r\n readonly geometryStream: GeometryStreamProps;\r\n}\r\n\r\n/** Information required to request a *snap* to an element from the front end to the back end.\r\n * Includes the viewing parameters so that snap can be relative to the view direction, viewing mode, etc.\r\n * @internal RPC glue.\r\n */\r\nexport interface SnapRequestProps {\r\n id: Id64String;\r\n testPoint: XYZProps;\r\n closePoint: XYZProps;\r\n worldToView: Matrix4dProps;\r\n viewFlags?: ViewFlagProps;\r\n snapModes?: number[];\r\n snapAperture?: number;\r\n snapDivisor?: number;\r\n subCategoryId?: Id64String;\r\n geometryClass?: GeometryClass;\r\n intersectCandidates?: Id64Array;\r\n decorationGeometry?: DecorationGeometryProps[];\r\n /** A transform to be applied to the snap geometry.\r\n * testPoint, closePoint, and worldToView are in \"world\" coordinates (the coordinates of the viewport's iModel).\r\n * The snap geometry is in \"model\" coordinates (the coordinates of the iModel to which we're snapping).\r\n * In normal cases these are the same iModel. They may differ when people draw multiple iModels into the same viewport.\r\n */\r\n modelToWorld?: TransformProps;\r\n}\r\n\r\n/** Information returned from the back end to the front end holding the result of a *snap* operation.\r\n * @internal RPC glue.\r\n */\r\nexport interface SnapResponseProps {\r\n status: number;\r\n snapMode?: number;\r\n heat?: number;\r\n geomType?: number;\r\n parentGeomType?: number;\r\n hitPoint?: XYZProps;\r\n snapPoint?: XYZProps;\r\n normal?: XYZProps;\r\n curve?: any;\r\n intersectCurve?: any;\r\n intersectId?: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"Snapping.js","sourceRoot":"","sources":["../../../src/internal/Snapping.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4dProps, TransformProps, XYZProps } from \"@itwin/core-geometry\";\nimport { GeometryStreamProps } from \"../geometry/GeometryStream\";\nimport { GeometryClass } from \"../GeometryParams\";\nimport { ViewFlagProps } from \"../ViewFlags\";\n\n/** Information required to request a *snap* to a pickable decoration from the front end to the back end.\n * @internal RPC glue.\n */\nexport interface DecorationGeometryProps {\n readonly id: Id64String;\n readonly geometryStream: GeometryStreamProps;\n}\n\n/** Information required to request a *snap* to an element from the front end to the back end.\n * Includes the viewing parameters so that snap can be relative to the view direction, viewing mode, etc.\n * @internal RPC glue.\n */\nexport interface SnapRequestProps {\n id: Id64String;\n testPoint: XYZProps;\n closePoint: XYZProps;\n worldToView: Matrix4dProps;\n viewFlags?: ViewFlagProps;\n snapModes?: number[];\n snapAperture?: number;\n snapDivisor?: number;\n subCategoryId?: Id64String;\n geometryClass?: GeometryClass;\n intersectCandidates?: Id64Array;\n decorationGeometry?: DecorationGeometryProps[];\n /** A transform to be applied to the snap geometry.\n * testPoint, closePoint, and worldToView are in \"world\" coordinates (the coordinates of the viewport's iModel).\n * The snap geometry is in \"model\" coordinates (the coordinates of the iModel to which we're snapping).\n * In normal cases these are the same iModel. They may differ when people draw multiple iModels into the same viewport.\n */\n modelToWorld?: TransformProps;\n}\n\n/** Information returned from the back end to the front end holding the result of a *snap* operation.\n * @internal RPC glue.\n */\nexport interface SnapResponseProps {\n status: number;\n snapMode?: number;\n heat?: number;\n geomType?: number;\n parentGeomType?: number;\n hitPoint?: XYZProps;\n snapPoint?: XYZProps;\n normal?: XYZProps;\n curve?: any;\n intersectCurve?: any;\n intersectId?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldFormatter.js","sourceRoot":"","sources":["../../../../src/internal/annotations/FieldFormatter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAoB/F,MAAM,UAAU,GAAmD;IACjE,gEAAgE;IAChE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEjD,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAErE,gEAAgE;IAChE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEnD,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5D,gEAAgE;IAChE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAClD,gEAAgE;IAChE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAA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BACpG,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;YACnE,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,mEAAmE;AACnE,SAAS,gBAAgB,CAAC,CAAsB;IAC9C,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,GAAI,CAAS,CAAC,CAAC,CAAC;QACvB,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;QAED,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,KAAiB,EAAE,OAAuC;IACzF,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO,IAAI,IAAI,UAAU,CAAC;AAC5B,CAAC","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\r\nimport { XAndY, XYAndZ } from \"@itwin/core-geometry\";\r\nimport { DateTimeFieldFormatOptions, FieldFormatOptions, FieldPropertyType } from \"../../annotation/TextField\";\r\n\r\n/** A FieldPropertyPath must ultimately resolve to one of these primitive types.\r\n * @internal\r\n */\r\nexport type FieldPrimitiveValue = boolean | number | string | Date | XAndY | XYAndZ | Uint8Array;\r\n\r\n/** Resolved value of a field.\r\n * @internal\r\n */\r\nexport interface FieldValue {\r\n value: FieldPrimitiveValue;\r\n type: FieldPropertyType;\r\n}\r\n\r\ntype FieldFormatter = (value: FieldPrimitiveValue, options: FieldFormatOptions | undefined) => string | undefined;\r\n\r\nconst formatters: { [type: string]: FieldFormatter | undefined } = {\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n \"string\": (v, o) => formatString(v.toString(), o),\r\n\r\n \"datetime\": (v, o) => formatString(formatDateTime(v, o?.dateTime), o),\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n \"quantity\": (v, o) => formatString(v.toString(), o),\r\n \r\n \"coordinate\": (v, o) => formatString(formatPointBasic(v), o),\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n \"boolean\": (v, o) => formatString(v.toString(), o),\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n \"int-enum\": (v, o) => formatString(v.toString(), o),\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n \"string-enum\": (v, o) => formatString(v.toString(), o),\r\n};\r\n\r\nfunction formatString(s: string | undefined, o?: FieldFormatOptions): string | undefined {\r\n if (undefined === s || !o) {\r\n return s;\r\n }\r\n\r\n switch (o.case) {\r\n case \"upper\":\r\n s = s.toUpperCase();\r\n break;\r\n case \"lower\":\r\n s = s.toLowerCase();\r\n break;\r\n }\r\n\r\n if (o.prefix || o.suffix) {\r\n s = `${o.prefix ?? \"\"}${s}${o.suffix ?? \"\"}`;\r\n }\r\n\r\n return s;\r\n}\r\n\r\nfunction formatDateTime(v: FieldPrimitiveValue, o?: DateTimeFieldFormatOptions): string | undefined {\r\n if (!(v instanceof Date))\r\n return undefined;\r\n\r\n if (!isNaN(v.getTime())) {\r\n if (o?.formatOptions) {\r\n const locale = o.locale ?? \"en-US\";\r\n if (!Intl.DateTimeFormat.supportedLocalesOf([locale], { localeMatcher: \"lookup\" }).includes(locale)) {\r\n return undefined;\r\n }\r\n\r\n const formatter = new Intl.DateTimeFormat(locale, o.formatOptions);\r\n return formatter.format(v);\r\n }\r\n return v.toString();\r\n }\r\n return undefined;\r\n}\r\n\r\n// ###TODO replace this with actual quantity coordinate formatting.\r\nfunction formatPointBasic(v: FieldPrimitiveValue): string | undefined {\r\n if (typeof v === \"object\" && \"x\" in v && \"y\" in v) {\r\n const parts = [v.x, v.y];\r\n const z = (v as any).z;\r\n if (undefined !== z) {\r\n parts.push(z);\r\n }\r\n\r\n return `(${parts.join(\", \")})`;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/** @internal */\r\nexport function formatFieldValue(value: FieldValue, options: FieldFormatOptions | undefined): string | undefined {\r\n const formatter = formatters[value.type];\r\n return formatter ? formatter(value.value, options) : undefined;\r\n}\r\n\r\n/** @internal */\r\nexport function isKnownFieldPropertyType(type: string): type is FieldPropertyType {\r\n return type in formatters;\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"FieldFormatter.js","sourceRoot":"","sources":["../../../../src/internal/annotations/FieldFormatter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAoB/F,MAAM,UAAU,GAAmD;IACjE,gEAAgE;IAChE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEjD,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,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AAC;AAED,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,KAAiB,EAAE,OAAuC;IACzF,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO,IAAI,IAAI,UAAU,CAAC;AAC5B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport { DateTimeFieldFormatOptions, FieldFormatOptions, FieldPropertyType } from \"../../annotation/TextField\";\n\n/** A FieldPropertyPath must ultimately resolve to one of these primitive types.\n * @internal\n */\nexport type FieldPrimitiveValue = boolean | number | string | Date | XAndY | XYAndZ | Uint8Array;\n\n/** Resolved value of a field.\n * @internal\n */\nexport interface FieldValue {\n value: FieldPrimitiveValue;\n type: FieldPropertyType;\n}\n\ntype FieldFormatter = (value: FieldPrimitiveValue, options: FieldFormatOptions | undefined) => string | undefined;\n\nconst formatters: { [type: string]: FieldFormatter | undefined } = {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"string\": (v, o) => formatString(v.toString(), o),\n\n \"datetime\": (v, o) => formatString(formatDateTime(v, o?.dateTime), o),\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"quantity\": (v, o) => formatString(v.toString(), o),\n \n \"coordinate\": (v, o) => formatString(formatPointBasic(v), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"boolean\": (v, o) => formatString(v.toString(), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"int-enum\": (v, o) => formatString(v.toString(), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"string-enum\": (v, o) => formatString(v.toString(), o),\n};\n\nfunction formatString(s: string | undefined, o?: FieldFormatOptions): string | undefined {\n if (undefined === s || !o) {\n return s;\n }\n\n switch (o.case) {\n case \"upper\":\n s = s.toUpperCase();\n break;\n case \"lower\":\n s = s.toLowerCase();\n break;\n }\n\n if (o.prefix || o.suffix) {\n s = `${o.prefix ?? \"\"}${s}${o.suffix ?? \"\"}`;\n }\n\n return s;\n}\n\nfunction formatDateTime(v: FieldPrimitiveValue, o?: DateTimeFieldFormatOptions): string | undefined {\n if (!(v instanceof Date))\n return undefined;\n\n if (!isNaN(v.getTime())) {\n if (o?.formatOptions) {\n const locale = o.locale ?? \"en-US\";\n if (!Intl.DateTimeFormat.supportedLocalesOf([locale], { localeMatcher: \"lookup\" }).includes(locale)) {\n return undefined;\n }\n\n const formatter = new Intl.DateTimeFormat(locale, o.formatOptions);\n return formatter.format(v);\n }\n return v.toString();\n }\n return undefined;\n}\n\n// ###TODO replace this with actual quantity coordinate formatting.\nfunction formatPointBasic(v: FieldPrimitiveValue): string | undefined {\n if (typeof v === \"object\" && \"x\" in v && \"y\" in v) {\n const parts = [v.x, v.y];\n const z = (v as any).z;\n if (undefined !== z) {\n parts.push(z);\n }\n\n return `(${parts.join(\", \")})`;\n }\n\n return undefined;\n}\n\n/** @internal */\nexport function formatFieldValue(value: FieldValue, options: FieldFormatOptions | undefined): string | undefined {\n const formatter = formatters[value.type];\n return formatter ? formatter(value.value, options) : undefined;\n}\n\n/** @internal */\nexport function isKnownFieldPropertyType(type: string): type is FieldPropertyType {\n return type in formatters;\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EACyB,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAyB,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAA6C,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC","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\r\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\r\nexport {\r\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\r\n} from \"./RenderMesh\";\r\nexport {\r\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\r\n} from \"./PackedFeatureTable\";\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\r\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\r\nexport { RenderTextureParams } from \"./RenderTextureParams\";\r\nexport { type FieldPrimitiveValue, type FieldValue, formatFieldValue, isKnownFieldPropertyType } from \"./annotations/FieldFormatter\";\r\n"]}
1
+ {"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EACyB,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAyB,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAA6C,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\nexport { RenderTextureParams } from \"./RenderTextureParams\";\nexport { type FieldPrimitiveValue, type FieldValue, formatFieldValue, isKnownFieldPropertyType } from \"./annotations/FieldFormatter\";\n"]}
@@ -0,0 +1,34 @@
1
+ /** @packageDocumentation
2
+ * @module IpcSocket
3
+ */
4
+ import { LoggingMetaData } from "@itwin/core-bentley";
5
+ import { IpcInvokeReturn } from "./IpcSocket";
6
+ /**
7
+ * Serialize a value thrown by an Ipc handler into the [[IpcInvokeReturn]] `error` envelope so it can be
8
+ * transmitted across an Ipc socket via structured clone or JSON, depending on the transport.
9
+ *
10
+ * Hardens against values that can't be cloned: copies `Error`'s non-enumerable `message`/`stack`/`cause`,
11
+ * preserves `BentleyError` identity (`iTwinErrorId` and logging metadata, normalized to a JSON-safe form),
12
+ * recurses into nested `Error`s and plain objects, strips functions and class instances, and guards against cycles.
13
+ * @param err The thrown value to serialize.
14
+ * @param includeStack Whether to include `Error.stack` in the serialized output.
15
+ * @returns An [[IpcInvokeReturn]] holding the serialized `error`.
16
+ * @internal
17
+ */
18
+ export declare function serializeIpcError(err: unknown, includeStack: boolean): IpcInvokeReturn;
19
+ /**
20
+ * Reconstruct an `Error` from the serialized `error` produced by [[serializeIpcError]], so the Ipc caller can
21
+ * `throw` it.
22
+ *
23
+ * By default, rebuilds a plain `Error` following the `ITwinError` paradigm (identify via
24
+ * [ITwinError.isError]($bentley), since `instanceof` cannot survive marshalling across the Ipc boundary). Pass
25
+ * `typedErrorClass` for backwards compatibility to rebuild a legacy typed `BentleyError` subclass instead — the
26
+ * frontend uses this to keep rethrowing [BackendError]($common).
27
+ * @param err The serialized error object (must be an object; callers should forward non-object values as-is).
28
+ * @param typedErrorClass Optional constructor for a legacy typed error (e.g. [BackendError]($common)). Omit for
29
+ * the ITwinError paradigm.
30
+ * @returns The reconstructed `Error` to throw.
31
+ * @internal
32
+ */
33
+ export declare function rebuildIpcError(err: any, typedErrorClass?: new (errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) => Error): Error;
34
+ //# sourceMappingURL=IpcErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IpcErrors.d.ts","sourceRoot":"","sources":["../../../src/ipc/IpcErrors.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA2B,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,eAAe,CA0HtF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,EACR,eAAe,CAAC,EAAE,KAAK,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,KAAK,KAAK,GACjH,KAAK,CAaP"}
@@ -0,0 +1,163 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module IpcSocket
7
+ */
8
+ import { BentleyError, JsonUtils } from "@itwin/core-bentley";
9
+ /**
10
+ * Serialize a value thrown by an Ipc handler into the [[IpcInvokeReturn]] `error` envelope so it can be
11
+ * transmitted across an Ipc socket via structured clone or JSON, depending on the transport.
12
+ *
13
+ * Hardens against values that can't be cloned: copies `Error`'s non-enumerable `message`/`stack`/`cause`,
14
+ * preserves `BentleyError` identity (`iTwinErrorId` and logging metadata, normalized to a JSON-safe form),
15
+ * recurses into nested `Error`s and plain objects, strips functions and class instances, and guards against cycles.
16
+ * @param err The thrown value to serialize.
17
+ * @param includeStack Whether to include `Error.stack` in the serialized output.
18
+ * @returns An [[IpcInvokeReturn]] holding the serialized `error`.
19
+ * @internal
20
+ */
21
+ export function serializeIpcError(err, includeStack) {
22
+ if (!JsonUtils.isObject(err))
23
+ return { error: err };
24
+ const serialize = (e, visited = new WeakSet()) => {
25
+ if (visited.has(e))
26
+ return undefined;
27
+ visited.add(e);
28
+ try {
29
+ const serialized = { ...e };
30
+ for (const sym of Object.getOwnPropertySymbols(serialized))
31
+ delete serialized[sym]; // symbol-keyed properties cannot be structured-cloned
32
+ // `iTwinErrorId`/`loggingMetadata` are prototype getters, so `Object.keys`/spread never pick them up; resolve
33
+ // them explicitly. Shared by the top-level and metadata-nested paths below so they can't drift apart again.
34
+ const applyBentleyErrorIdentity = (be, out, sanitize) => {
35
+ out.iTwinErrorId = be.iTwinErrorId;
36
+ if (be.hasMetaData)
37
+ out.loggingMetadata = sanitize(be.loggingMetadata);
38
+ delete out._metaData;
39
+ };
40
+ if (e instanceof Error) {
41
+ serialized.message = e.message; // NB: .message and .stack are non-enumerable on Error instances
42
+ if (includeStack)
43
+ serialized.stack = e.stack;
44
+ // Error.cause is typically non-enumerable and must be copied explicitly.
45
+ if (Object.prototype.hasOwnProperty.call(e, "cause"))
46
+ serialized.cause = e.cause;
47
+ }
48
+ if (e instanceof BentleyError)
49
+ applyBentleyErrorIdentity(e, serialized, (v) => v); // loggingMetadata is sanitized once, below
50
+ // Only recurse into Error instances and plain objects — not class instances like Date or Buffer.
51
+ const shouldRecurse = (val) => val instanceof Error || (JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype);
52
+ const isSerializableLeaf = (val) => {
53
+ const t = typeof val;
54
+ return val === null || val === undefined || val instanceof Date
55
+ || t === "string" || t === "number" || t === "boolean";
56
+ };
57
+ // Recurse into arrays, Errors, and plain objects; strip anything else non-cloneable (functions, RegExp,
58
+ // Map, Set, typed arrays, other class instances) to `undefined`.
59
+ const serializeValue = (val) => {
60
+ if (Array.isArray(val)) {
61
+ // Arrays need their own cycle guard: they never pass through `serialize` below, so a self-referencing
62
+ // array would otherwise recurse via `map` forever.
63
+ if (visited.has(val))
64
+ return undefined;
65
+ visited.add(val);
66
+ try {
67
+ return val.map((item) => serializeValue(item));
68
+ }
69
+ finally {
70
+ visited.delete(val);
71
+ }
72
+ }
73
+ if (shouldRecurse(val))
74
+ return serialize(val, visited);
75
+ return isSerializableLeaf(val) ? val : undefined;
76
+ };
77
+ // `loggingMetadata` can be any shape (e.g. a `Map`/`Set` from a `GetMetaDataFunction`). Normalize it to a
78
+ // JSON-safe form so it survives every transport — raw `Map`/`Set` clone fine over Electron's structured
79
+ // clone but collapse to `{}` over the WebSocket transport, which uses `JSON.stringify`.
80
+ const sanitizeMetadataValue = (val) => {
81
+ if (val === null || val === undefined || val instanceof Date || typeof val === "string" || typeof val === "number" || typeof val === "boolean")
82
+ return val;
83
+ if (typeof val !== "object" || visited.has(val))
84
+ return undefined; // functions, symbols, or an already-visited (cyclic) value
85
+ visited.add(val);
86
+ try {
87
+ if (val instanceof Map) {
88
+ // String(k) can collide (e.g. two object keys); suffix with "#n" so entries aren't silently dropped.
89
+ const out = {};
90
+ const keyCounts = new Map();
91
+ for (const [k, v] of val) {
92
+ const baseKey = String(k);
93
+ const count = keyCounts.get(baseKey) ?? 0;
94
+ keyCounts.set(baseKey, count + 1);
95
+ out[count === 0 ? baseKey : `${baseKey}#${count}`] = sanitizeMetadataValue(v);
96
+ }
97
+ return out;
98
+ }
99
+ if (val instanceof Set)
100
+ return [...val].map(sanitizeMetadataValue);
101
+ if (Array.isArray(val))
102
+ return val.map(sanitizeMetadataValue);
103
+ if (val instanceof Error || (JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype)) {
104
+ const out = {};
105
+ for (const key of Object.keys(val))
106
+ out[key] = sanitizeMetadataValue(val[key]);
107
+ if (val instanceof Error)
108
+ out.message = val.message;
109
+ if (val instanceof BentleyError)
110
+ applyBentleyErrorIdentity(val, out, sanitizeMetadataValue);
111
+ return out;
112
+ }
113
+ return undefined; // other class instances: not cloneable across every transport
114
+ }
115
+ finally {
116
+ visited.delete(val);
117
+ }
118
+ };
119
+ if (serialized.loggingMetadata !== undefined)
120
+ serialized.loggingMetadata = sanitizeMetadataValue(serialized.loggingMetadata);
121
+ const genericStripExcludedKeys = new Set(["loggingMetadata"]);
122
+ for (const key of Object.keys(serialized)) {
123
+ if (genericStripExcludedKeys.has(key))
124
+ continue;
125
+ serialized[key] = serializeValue(serialized[key]);
126
+ }
127
+ return serialized;
128
+ }
129
+ finally {
130
+ // Remove from the stack so a sibling branch can still serialize this object.
131
+ visited.delete(e);
132
+ }
133
+ };
134
+ return { error: serialize(err) };
135
+ }
136
+ /**
137
+ * Reconstruct an `Error` from the serialized `error` produced by [[serializeIpcError]], so the Ipc caller can
138
+ * `throw` it.
139
+ *
140
+ * By default, rebuilds a plain `Error` following the `ITwinError` paradigm (identify via
141
+ * [ITwinError.isError]($bentley), since `instanceof` cannot survive marshalling across the Ipc boundary). Pass
142
+ * `typedErrorClass` for backwards compatibility to rebuild a legacy typed `BentleyError` subclass instead — the
143
+ * frontend uses this to keep rethrowing [BackendError]($common).
144
+ * @param err The serialized error object (must be an object; callers should forward non-object values as-is).
145
+ * @param typedErrorClass Optional constructor for a legacy typed error (e.g. [BackendError]($common)). Omit for
146
+ * the ITwinError paradigm.
147
+ * @returns The reconstructed `Error` to throw.
148
+ * @internal
149
+ */
150
+ export function rebuildIpcError(err, typedErrorClass) {
151
+ if (typedErrorClass === undefined || !BentleyError.isError(err)) {
152
+ const rebuilt = Object.assign(new Error(), err);
153
+ // Object.assign above re-copies `err`'s own `message` (even a non-string one, e.g. `throw { message: 123 }`),
154
+ // so guard/normalize the final message *after* the assign rather than before, or this would be silently overwritten.
155
+ rebuilt.message = typeof err.message === "string" ? err.message : "unknown error";
156
+ return rebuilt;
157
+ }
158
+ const trimErr = { ...err };
159
+ delete trimErr.iTwinErrorId; // getter on the typed error; assigning would throw
160
+ delete trimErr.loggingMetadata; // getter on the typed error; assigning would throw
161
+ return Object.assign(new typedErrorClass(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);
162
+ }
163
+ //# sourceMappingURL=IpcErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IpcErrors.js","sourceRoot":"","sources":["../../../src/ipc/IpcErrors.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAmB,MAAM,qBAAqB,CAAC;AAG/E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAY,EAAE,YAAqB;IACnE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAExB,MAAM,SAAS,GAAG,CAAC,CAAM,EAAE,UAAU,IAAI,OAAO,EAAU,EAAO,EAAE;QACjE,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YA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CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAQ,EACR,eAAkH;IAElH,IAAI,eAAe,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAChE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;QAChD,8GAA8G;QAC9G,qHAAqH;QACrH,OAAO,CAAC,OAAO,GAAG,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QAClF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,OAAO,GAAQ,EAAE,GAAG,GAAG,EAAE,CAAC;IAChC,OAAO,OAAO,CAAC,YAAY,CAAC,CAAI,mDAAmD;IACnF,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC,mDAAmD;IACnF,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9H,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IpcSocket\n */\n\nimport { BentleyError, JsonUtils, LoggingMetaData } from \"@itwin/core-bentley\";\nimport { IpcInvokeReturn } from \"./IpcSocket\";\n\n/**\n * Serialize a value thrown by an Ipc handler into the [[IpcInvokeReturn]] `error` envelope so it can be\n * transmitted across an Ipc socket via structured clone or JSON, depending on the transport.\n *\n * Hardens against values that can't be cloned: copies `Error`'s non-enumerable `message`/`stack`/`cause`,\n * preserves `BentleyError` identity (`iTwinErrorId` and logging metadata, normalized to a JSON-safe form),\n * recurses into nested `Error`s and plain objects, strips functions and class instances, and guards against cycles.\n * @param err The thrown value to serialize.\n * @param includeStack Whether to include `Error.stack` in the serialized output.\n * @returns An [[IpcInvokeReturn]] holding the serialized `error`.\n * @internal\n */\nexport function serializeIpcError(err: unknown, includeStack: boolean): IpcInvokeReturn {\n if (!JsonUtils.isObject(err))\n return { error: err };\n\n const serialize = (e: any, visited = new WeakSet<object>()): any => {\n if (visited.has(e))\n return undefined;\n visited.add(e);\n try {\n const serialized: any = { ...e };\n\n for (const sym of Object.getOwnPropertySymbols(serialized))\n delete serialized[sym]; // symbol-keyed properties cannot be structured-cloned\n\n // `iTwinErrorId`/`loggingMetadata` are prototype getters, so `Object.keys`/spread never pick them up; resolve\n // them explicitly. Shared by the top-level and metadata-nested paths below so they can't drift apart again.\n const applyBentleyErrorIdentity = (be: BentleyError, out: any, sanitize: (v: unknown) => unknown): void => {\n out.iTwinErrorId = be.iTwinErrorId;\n if (be.hasMetaData)\n out.loggingMetadata = sanitize(be.loggingMetadata);\n delete out._metaData;\n };\n\n if (e instanceof Error) {\n serialized.message = e.message; // NB: .message and .stack are non-enumerable on Error instances\n if (includeStack)\n serialized.stack = e.stack;\n\n // Error.cause is typically non-enumerable and must be copied explicitly.\n if (Object.prototype.hasOwnProperty.call(e, \"cause\"))\n serialized.cause = (e as { cause?: unknown }).cause;\n }\n\n if (e instanceof BentleyError)\n applyBentleyErrorIdentity(e, serialized, (v) => v); // loggingMetadata is sanitized once, below\n\n // Only recurse into Error instances and plain objects — not class instances like Date or Buffer.\n const shouldRecurse = (val: any) => val instanceof Error || (JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype);\n const isSerializableLeaf = (val: unknown): boolean => {\n const t = typeof val;\n return val === null || val === undefined || val instanceof Date\n || t === \"string\" || t === \"number\" || t === \"boolean\";\n };\n // Recurse into arrays, Errors, and plain objects; strip anything else non-cloneable (functions, RegExp,\n // Map, Set, typed arrays, other class instances) to `undefined`.\n const serializeValue = (val: any): any => {\n if (Array.isArray(val)) {\n // Arrays need their own cycle guard: they never pass through `serialize` below, so a self-referencing\n // array would otherwise recurse via `map` forever.\n if (visited.has(val))\n return undefined;\n visited.add(val);\n try {\n return val.map((item) => serializeValue(item));\n } finally {\n visited.delete(val);\n }\n }\n if (shouldRecurse(val))\n return serialize(val, visited);\n return isSerializableLeaf(val) ? val : undefined;\n };\n // `loggingMetadata` can be any shape (e.g. a `Map`/`Set` from a `GetMetaDataFunction`). Normalize it to a\n // JSON-safe form so it survives every transport — raw `Map`/`Set` clone fine over Electron's structured\n // clone but collapse to `{}` over the WebSocket transport, which uses `JSON.stringify`.\n const sanitizeMetadataValue = (val: any): any => {\n if (val === null || val === undefined || val instanceof Date || typeof val === \"string\" || typeof val === \"number\" || typeof val === \"boolean\")\n return val;\n if (typeof val !== \"object\" || visited.has(val))\n return undefined; // functions, symbols, or an already-visited (cyclic) value\n\n visited.add(val);\n try {\n if (val instanceof Map) {\n // String(k) can collide (e.g. two object keys); suffix with \"#n\" so entries aren't silently dropped.\n const out: any = {};\n const keyCounts = new Map<string, number>();\n for (const [k, v] of val) {\n const baseKey = String(k);\n const count = keyCounts.get(baseKey) ?? 0;\n keyCounts.set(baseKey, count + 1);\n out[count === 0 ? baseKey : `${baseKey}#${count}`] = sanitizeMetadataValue(v);\n }\n return out;\n }\n if (val instanceof Set)\n return [...val].map(sanitizeMetadataValue);\n if (Array.isArray(val))\n return val.map(sanitizeMetadataValue);\n if (val instanceof Error || (JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype)) {\n const out: any = {};\n for (const key of Object.keys(val))\n out[key] = sanitizeMetadataValue((val as any)[key]);\n if (val instanceof Error)\n out.message = val.message;\n if (val instanceof BentleyError)\n applyBentleyErrorIdentity(val, out, sanitizeMetadataValue);\n return out;\n }\n return undefined; // other class instances: not cloneable across every transport\n } finally {\n visited.delete(val);\n }\n };\n if (serialized.loggingMetadata !== undefined)\n serialized.loggingMetadata = sanitizeMetadataValue(serialized.loggingMetadata);\n\n const genericStripExcludedKeys = new Set([\"loggingMetadata\"]);\n for (const key of Object.keys(serialized)) {\n if (genericStripExcludedKeys.has(key))\n continue;\n serialized[key] = serializeValue(serialized[key]);\n }\n\n return serialized;\n } finally {\n // Remove from the stack so a sibling branch can still serialize this object.\n visited.delete(e);\n }\n };\n\n return { error: serialize(err) };\n}\n\n/**\n * Reconstruct an `Error` from the serialized `error` produced by [[serializeIpcError]], so the Ipc caller can\n * `throw` it.\n *\n * By default, rebuilds a plain `Error` following the `ITwinError` paradigm (identify via\n * [ITwinError.isError]($bentley), since `instanceof` cannot survive marshalling across the Ipc boundary). Pass\n * `typedErrorClass` for backwards compatibility to rebuild a legacy typed `BentleyError` subclass instead — the\n * frontend uses this to keep rethrowing [BackendError]($common).\n * @param err The serialized error object (must be an object; callers should forward non-object values as-is).\n * @param typedErrorClass Optional constructor for a legacy typed error (e.g. [BackendError]($common)). Omit for\n * the ITwinError paradigm.\n * @returns The reconstructed `Error` to throw.\n * @internal\n */\nexport function rebuildIpcError(\n err: any,\n typedErrorClass?: new (errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) => Error,\n): Error {\n if (typedErrorClass === undefined || !BentleyError.isError(err)) {\n const rebuilt = Object.assign(new Error(), err);\n // Object.assign above re-copies `err`'s own `message` (even a non-string one, e.g. `throw { message: 123 }`),\n // so guard/normalize the final message *after* the assign rather than before, or this would be silently overwritten.\n rebuilt.message = typeof err.message === \"string\" ? err.message : \"unknown error\";\n return rebuilt;\n }\n\n const trimErr: any = { ...err };\n delete trimErr.iTwinErrorId; // getter on the typed error; assigning would throw\n delete trimErr.loggingMetadata; // getter on the typed error; assigning would throw\n return Object.assign(new typedErrorClass(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n}\n"]}