@itwin/core-common 4.0.0-dev.4 → 4.0.0-dev.41

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 (258) hide show
  1. package/CHANGELOG.md +35 -17
  2. package/lib/cjs/BackendTypes.d.ts +3 -3
  3. package/lib/cjs/BackendTypes.d.ts.map +1 -1
  4. package/lib/cjs/BackendTypes.js.map +1 -1
  5. package/lib/cjs/BackgroundMapProvider.js +1 -2
  6. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  7. package/lib/cjs/BackgroundMapSettings.js +11 -13
  8. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  9. package/lib/cjs/BriefcaseTypes.d.ts +2 -0
  10. package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
  11. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  12. package/lib/cjs/ClipStyle.js +6 -8
  13. package/lib/cjs/ClipStyle.js.map +1 -1
  14. package/lib/cjs/CloudStorage.d.ts +5 -5
  15. package/lib/cjs/CloudStorage.js +3 -3
  16. package/lib/cjs/CloudStorage.js.map +1 -1
  17. package/lib/cjs/CloudStorageTileCache.d.ts +1 -1
  18. package/lib/cjs/CloudStorageTileCache.js +2 -3
  19. package/lib/cjs/CloudStorageTileCache.js.map +1 -1
  20. package/lib/cjs/Code.d.ts +3 -3
  21. package/lib/cjs/Code.js +4 -5
  22. package/lib/cjs/Code.js.map +1 -1
  23. package/lib/cjs/ColorDef.js +1 -2
  24. package/lib/cjs/ColorDef.js.map +1 -1
  25. package/lib/cjs/ConcurrentQuery.js +1 -1
  26. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  27. package/lib/cjs/ContextRealityModel.js +6 -8
  28. package/lib/cjs/ContextRealityModel.js.map +1 -1
  29. package/lib/cjs/DisplayStyleSettings.js +16 -20
  30. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  31. package/lib/cjs/Environment.js +12 -15
  32. package/lib/cjs/Environment.js.map +1 -1
  33. package/lib/cjs/FeatureSymbology.js +1 -2
  34. package/lib/cjs/FeatureSymbology.js.map +1 -1
  35. package/lib/cjs/FeatureTable.js +1 -1
  36. package/lib/cjs/FeatureTable.js.map +1 -1
  37. package/lib/cjs/Gradient.js +2 -4
  38. package/lib/cjs/Gradient.js.map +1 -1
  39. package/lib/cjs/GraphicParams.js +1 -1
  40. package/lib/cjs/GraphicParams.js.map +1 -1
  41. package/lib/cjs/GroundPlane.js +3 -4
  42. package/lib/cjs/GroundPlane.js.map +1 -1
  43. package/lib/cjs/HSLColor.js +1 -1
  44. package/lib/cjs/HSLColor.js.map +1 -1
  45. package/lib/cjs/HSVColor.js +1 -1
  46. package/lib/cjs/HSVColor.js.map +1 -1
  47. package/lib/cjs/HiddenLine.js +3 -5
  48. package/lib/cjs/HiddenLine.js.map +1 -1
  49. package/lib/cjs/IModel.d.ts +1 -2
  50. package/lib/cjs/IModel.d.ts.map +1 -1
  51. package/lib/cjs/IModel.js +1 -1
  52. package/lib/cjs/IModel.js.map +1 -1
  53. package/lib/cjs/LightSettings.js +18 -23
  54. package/lib/cjs/LightSettings.js.map +1 -1
  55. package/lib/cjs/MapImagerySettings.js +2 -2
  56. package/lib/cjs/MapImagerySettings.js.map +1 -1
  57. package/lib/cjs/MapLayerSettings.js +9 -13
  58. package/lib/cjs/MapLayerSettings.js.map +1 -1
  59. package/lib/cjs/ModelClipGroup.js +3 -5
  60. package/lib/cjs/ModelClipGroup.js.map +1 -1
  61. package/lib/cjs/QPoint.js +5 -7
  62. package/lib/cjs/QPoint.js.map +1 -1
  63. package/lib/cjs/RealityModelDisplaySettings.js +14 -15
  64. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  65. package/lib/cjs/RenderMaterial.js +1 -2
  66. package/lib/cjs/RenderMaterial.js.map +1 -1
  67. package/lib/cjs/RenderSchedule.js +30 -40
  68. package/lib/cjs/RenderSchedule.js.map +1 -1
  69. package/lib/cjs/SkyBox.js +10 -11
  70. package/lib/cjs/SkyBox.js.map +1 -1
  71. package/lib/cjs/SolarShadows.js +1 -2
  72. package/lib/cjs/SolarShadows.js.map +1 -1
  73. package/lib/cjs/SpatialClassification.js +1 -2
  74. package/lib/cjs/SpatialClassification.js.map +1 -1
  75. package/lib/cjs/TerrainSettings.js +7 -9
  76. package/lib/cjs/TerrainSettings.js.map +1 -1
  77. package/lib/cjs/TextureMapping.js +4 -5
  78. package/lib/cjs/TextureMapping.js.map +1 -1
  79. package/lib/cjs/ThematicDisplay.js +1 -2
  80. package/lib/cjs/ThematicDisplay.js.map +1 -1
  81. package/lib/cjs/TileProps.js +1 -1
  82. package/lib/cjs/TileProps.js.map +1 -1
  83. package/lib/cjs/ViewDetails.js +1 -1
  84. package/lib/cjs/ViewDetails.js.map +1 -1
  85. package/lib/cjs/ViewFlags.js +24 -25
  86. package/lib/cjs/ViewFlags.js.map +1 -1
  87. package/lib/cjs/WhiteOnWhiteReversalSettings.js +1 -1
  88. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  89. package/lib/cjs/geometry/AreaPattern.js +1 -2
  90. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  91. package/lib/cjs/geometry/BoundingSphere.js +1 -1
  92. package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
  93. package/lib/cjs/geometry/CoordinateReferenceSystem.js +1 -2
  94. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  95. package/lib/cjs/geometry/ElementGeometry.js +1 -1
  96. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  97. package/lib/cjs/geometry/FrustumPlanes.d.ts.map +1 -1
  98. package/lib/cjs/geometry/FrustumPlanes.js +0 -4
  99. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  100. package/lib/cjs/geometry/GeodeticDatum.js +1 -2
  101. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  102. package/lib/cjs/geometry/GeodeticEllipsoid.js +1 -2
  103. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  104. package/lib/cjs/geometry/GeometryStream.js +5 -6
  105. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  106. package/lib/cjs/ipc/IpcWebSocket.js +1 -2
  107. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  108. package/lib/cjs/rpc/DevToolsRpcInterface.d.ts.map +1 -1
  109. package/lib/cjs/rpc/DevToolsRpcInterface.js +6 -2
  110. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  111. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -1
  112. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  113. package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
  114. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  115. package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +2 -2
  116. package/lib/cjs/rpc/IModelTileRpcInterface.js +2 -2
  117. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  118. package/lib/cjs/rpc/core/RpcControl.js +1 -1
  119. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  120. package/lib/cjs/rpc/core/RpcInvocation.js +3 -5
  121. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  122. package/lib/cjs/rpc/core/RpcPendingQueue.js +1 -2
  123. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  124. package/lib/cjs/rpc/core/RpcRegistry.js +1 -2
  125. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  126. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +2 -4
  127. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  128. package/lib/cjs/tile/TileMetadata.js +1 -2
  129. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  130. package/lib/esm/BackendTypes.d.ts +3 -3
  131. package/lib/esm/BackendTypes.d.ts.map +1 -1
  132. package/lib/esm/BackendTypes.js.map +1 -1
  133. package/lib/esm/BackgroundMapProvider.js +1 -2
  134. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  135. package/lib/esm/BackgroundMapSettings.js +11 -13
  136. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  137. package/lib/esm/BriefcaseTypes.d.ts +2 -0
  138. package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
  139. package/lib/esm/BriefcaseTypes.js.map +1 -1
  140. package/lib/esm/ClipStyle.js +6 -8
  141. package/lib/esm/ClipStyle.js.map +1 -1
  142. package/lib/esm/CloudStorage.d.ts +5 -5
  143. package/lib/esm/CloudStorage.js +3 -3
  144. package/lib/esm/CloudStorage.js.map +1 -1
  145. package/lib/esm/CloudStorageTileCache.d.ts +1 -1
  146. package/lib/esm/CloudStorageTileCache.js +2 -3
  147. package/lib/esm/CloudStorageTileCache.js.map +1 -1
  148. package/lib/esm/Code.d.ts +3 -3
  149. package/lib/esm/Code.js +4 -5
  150. package/lib/esm/Code.js.map +1 -1
  151. package/lib/esm/ColorDef.js +1 -2
  152. package/lib/esm/ColorDef.js.map +1 -1
  153. package/lib/esm/ConcurrentQuery.js +1 -1
  154. package/lib/esm/ConcurrentQuery.js.map +1 -1
  155. package/lib/esm/ContextRealityModel.js +6 -8
  156. package/lib/esm/ContextRealityModel.js.map +1 -1
  157. package/lib/esm/DisplayStyleSettings.js +16 -20
  158. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  159. package/lib/esm/Environment.js +12 -15
  160. package/lib/esm/Environment.js.map +1 -1
  161. package/lib/esm/FeatureSymbology.js +1 -2
  162. package/lib/esm/FeatureSymbology.js.map +1 -1
  163. package/lib/esm/FeatureTable.js +1 -1
  164. package/lib/esm/FeatureTable.js.map +1 -1
  165. package/lib/esm/Gradient.js +2 -4
  166. package/lib/esm/Gradient.js.map +1 -1
  167. package/lib/esm/GraphicParams.js +1 -1
  168. package/lib/esm/GraphicParams.js.map +1 -1
  169. package/lib/esm/GroundPlane.js +3 -4
  170. package/lib/esm/GroundPlane.js.map +1 -1
  171. package/lib/esm/HSLColor.js +1 -1
  172. package/lib/esm/HSLColor.js.map +1 -1
  173. package/lib/esm/HSVColor.js +1 -1
  174. package/lib/esm/HSVColor.js.map +1 -1
  175. package/lib/esm/HiddenLine.js +3 -5
  176. package/lib/esm/HiddenLine.js.map +1 -1
  177. package/lib/esm/IModel.d.ts +1 -2
  178. package/lib/esm/IModel.d.ts.map +1 -1
  179. package/lib/esm/IModel.js +1 -1
  180. package/lib/esm/IModel.js.map +1 -1
  181. package/lib/esm/LightSettings.js +18 -23
  182. package/lib/esm/LightSettings.js.map +1 -1
  183. package/lib/esm/MapImagerySettings.js +2 -2
  184. package/lib/esm/MapImagerySettings.js.map +1 -1
  185. package/lib/esm/MapLayerSettings.js +9 -13
  186. package/lib/esm/MapLayerSettings.js.map +1 -1
  187. package/lib/esm/ModelClipGroup.js +3 -5
  188. package/lib/esm/ModelClipGroup.js.map +1 -1
  189. package/lib/esm/QPoint.js +5 -7
  190. package/lib/esm/QPoint.js.map +1 -1
  191. package/lib/esm/RealityModelDisplaySettings.js +14 -15
  192. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  193. package/lib/esm/RenderMaterial.js +1 -2
  194. package/lib/esm/RenderMaterial.js.map +1 -1
  195. package/lib/esm/RenderSchedule.js +30 -40
  196. package/lib/esm/RenderSchedule.js.map +1 -1
  197. package/lib/esm/SkyBox.js +10 -11
  198. package/lib/esm/SkyBox.js.map +1 -1
  199. package/lib/esm/SolarShadows.js +1 -2
  200. package/lib/esm/SolarShadows.js.map +1 -1
  201. package/lib/esm/SpatialClassification.js +1 -2
  202. package/lib/esm/SpatialClassification.js.map +1 -1
  203. package/lib/esm/TerrainSettings.js +7 -9
  204. package/lib/esm/TerrainSettings.js.map +1 -1
  205. package/lib/esm/TextureMapping.js +4 -5
  206. package/lib/esm/TextureMapping.js.map +1 -1
  207. package/lib/esm/ThematicDisplay.js +1 -2
  208. package/lib/esm/ThematicDisplay.js.map +1 -1
  209. package/lib/esm/TileProps.js +1 -1
  210. package/lib/esm/TileProps.js.map +1 -1
  211. package/lib/esm/ViewDetails.js +1 -1
  212. package/lib/esm/ViewDetails.js.map +1 -1
  213. package/lib/esm/ViewFlags.js +24 -25
  214. package/lib/esm/ViewFlags.js.map +1 -1
  215. package/lib/esm/WhiteOnWhiteReversalSettings.js +1 -1
  216. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  217. package/lib/esm/geometry/AreaPattern.js +1 -2
  218. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  219. package/lib/esm/geometry/BoundingSphere.js +1 -1
  220. package/lib/esm/geometry/BoundingSphere.js.map +1 -1
  221. package/lib/esm/geometry/CoordinateReferenceSystem.js +1 -2
  222. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  223. package/lib/esm/geometry/ElementGeometry.js +1 -1
  224. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  225. package/lib/esm/geometry/FrustumPlanes.d.ts.map +1 -1
  226. package/lib/esm/geometry/FrustumPlanes.js +0 -4
  227. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  228. package/lib/esm/geometry/GeodeticDatum.js +1 -2
  229. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  230. package/lib/esm/geometry/GeodeticEllipsoid.js +1 -2
  231. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  232. package/lib/esm/geometry/GeometryStream.js +5 -6
  233. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  234. package/lib/esm/ipc/IpcWebSocket.js +1 -2
  235. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  236. package/lib/esm/rpc/DevToolsRpcInterface.d.ts.map +1 -1
  237. package/lib/esm/rpc/DevToolsRpcInterface.js +6 -2
  238. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  239. package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -1
  240. package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  241. package/lib/esm/rpc/IModelReadRpcInterface.js +1 -1
  242. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  243. package/lib/esm/rpc/IModelTileRpcInterface.d.ts +2 -2
  244. package/lib/esm/rpc/IModelTileRpcInterface.js +2 -2
  245. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  246. package/lib/esm/rpc/core/RpcControl.js +1 -1
  247. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  248. package/lib/esm/rpc/core/RpcInvocation.js +3 -5
  249. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  250. package/lib/esm/rpc/core/RpcPendingQueue.js +1 -2
  251. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  252. package/lib/esm/rpc/core/RpcRegistry.js +1 -2
  253. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  254. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +2 -4
  255. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  256. package/lib/esm/tile/TileMetadata.js +1 -2
  257. package/lib/esm/tile/TileMetadata.js.map +1 -1
  258. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAC7B,wDAAyD;AACzD,kDAA4C;AAE5C,iDAA+F;AAC/F,qCAAyD;AAEzD,mCAAmC;AAEnC,+DAA+D;AAC/D,IAAU,SAAS,CAElB;AAFD,WAAU,SAAS;IACJ,qCAA2B,GAAG,CAAC,CAAC;AAC/C,CAAC,EAFS,SAAS,KAAT,SAAS,QAElB;AA8CD,gBAAgB;AAChB,IAAiB,WAAW,CA2B3B;AA3BD,WAAiB,WAAW;IAC1B;;;;;OAKG;IACH,SAAgB,sBAAsB,CAAC,MAAc,EAAE,SAAiB;QACtE,MAAM,IAAI,GAAG,+BAA+B,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,YAA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AAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;YAC5C,KAAK,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;CACF;AAzBD,gDAyBC","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 Tile\r\n */\r\n\r\nimport {\r\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStringsOrUndefined, Id64, Id64String,\r\n} from \"@itwin/core-bentley\";\r\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { BatchType } from \"../FeatureTable\";\r\nimport { TileProps } from \"../TileProps\";\r\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\r\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\r\n\r\n// cspell:ignore imdl mult bitfield\r\n\r\n// NB: These constants correspond to those defined in Tile.cpp.\r\nnamespace Constants {\r\n export const minToleranceRatioMultiplier = 2;\r\n}\r\n\r\n/** Describes an iModel tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeMetadata {\r\n readonly modelId: Id64String;\r\n readonly is2d: boolean;\r\n readonly contentRange?: Range3d;\r\n readonly tileScreenSize: number;\r\n}\r\n\r\n/** Describes the contents of an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileContentMetadata {\r\n readonly contentRange: Range3d;\r\n readonly isLeaf: boolean;\r\n readonly sizeMultiplier?: number;\r\n readonly emptySubRangeMask: number;\r\n}\r\n\r\n/** Describes an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileMetadata extends TileContentMetadata {\r\n readonly contentId: string;\r\n readonly range: Range3d;\r\n}\r\n\r\n/** @internal */\r\nexport interface TileOptions {\r\n readonly maximumMajorTileFormatVersion: number;\r\n readonly enableInstancing: boolean;\r\n readonly enableImprovedElision: boolean;\r\n readonly ignoreAreaPatterns: boolean;\r\n readonly enableExternalTextures: boolean;\r\n readonly useProjectExtents: boolean;\r\n readonly optimizeBRepProcessing: boolean;\r\n readonly useLargerTiles: boolean;\r\n readonly disableMagnification: boolean;\r\n readonly alwaysSubdivideIncompleteTiles: boolean;\r\n readonly enableIndexedEdges: boolean;\r\n readonly generateAllPolyfaceEdges: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport namespace TileOptions {\r\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\r\n * compute the [[TileOptions]] that were used to generate the Ids.\r\n * @throws Error if `treeId` or `contentId` are not valid Ids.\r\n * @note `treeId` and `contentId` are assumed to be valid Ids. They are not fully parsed and validated - only the information required by this function is extracted.\r\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\r\n */\r\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\r\n const tree = treeFlagsAndFormatVersionFromId(treeId);\r\n const contentFlags = contentFlagsFromId(contentId);\r\n const edgeOptions = edgeOptionsFromTreeId(treeId);\r\n\r\n return {\r\n maximumMajorTileFormatVersion: tree.version,\r\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\r\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\r\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\r\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\r\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\r\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\r\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: edgeOptions && edgeOptions.indexed,\r\n generateAllPolyfaceEdges: edgeOptions && edgeOptions.smooth,\r\n };\r\n }\r\n}\r\n\r\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\">;\r\ninterface ParsedClassifier {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n}\r\n\r\n/** The result of [[parseTileTreeIdAndContentId]].\r\n * @internal\r\n */\r\nexport interface ParsedTileTreeIdAndContentId {\r\n modelId: Id64String;\r\n treeId: IModelTileTreeId;\r\n contentId: ContentIdSpec;\r\n options: TileOptions;\r\n}\r\n\r\nclass Parser {\r\n public readonly input: string;\r\n public curPos = 0;\r\n\r\n public constructor(input: string) {\r\n this.input = input;\r\n }\r\n\r\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\r\n this.require(this.input.length > 0);\r\n\r\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\r\n while (this.curPos < this.input.length && this.cur() !== \"-\")\r\n this.advance();\r\n\r\n this.eat(\"-\");\r\n this.require(this.curPos < this.input.length);\r\n\r\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\r\n const animationId = this.parseAnimation();\r\n\r\n const primary = classifier ? undefined : this.parsePrimary();\r\n this.require((undefined === classifier) !== (undefined === primary));\r\n\r\n const modelId = this.input.substr(this.curPos);\r\n this.require(Id64.isId64(modelId));\r\n\r\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\r\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\r\n\r\n let parsedContentId: ContentIdSpec;\r\n try {\r\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\r\n } catch (e) {\r\n this.reject(\"Invalid content Id\");\r\n }\r\n\r\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\r\n throw new Error(\"Invalid content Id\");\r\n\r\n let treeId: IModelTileTreeId;\r\n if (classifier) {\r\n treeId = { ...classifier, animationId };\r\n } else {\r\n assert(undefined !== primary);\r\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\r\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority };\r\n }\r\n\r\n return {\r\n contentId: parsedContentId,\r\n modelId,\r\n options,\r\n treeId,\r\n };\r\n }\r\n\r\n private cur(): string {\r\n this.require(this.curPos < this.input.length);\r\n return this.input[this.curPos];\r\n }\r\n\r\n private advance(): void {\r\n this.require(this.curPos < this.input.length);\r\n ++this.curPos;\r\n }\r\n\r\n private eat(expectedChar: string): void {\r\n this.require(this.cur() === expectedChar);\r\n this.advance();\r\n }\r\n\r\n private reject(message = \"Invalid tree Id\"): never {\r\n throw new Error(message);\r\n }\r\n\r\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\r\n if (!condition)\r\n this.reject(message);\r\n }\r\n\r\n private parseClassifier(): ParsedClassifier | undefined {\r\n this.eat(\"C\");\r\n let type = BatchType.VolumeClassifier;\r\n if (this.cur() === \"P\") {\r\n type = BatchType.PlanarClassifier;\r\n this.advance();\r\n }\r\n\r\n this.eat(\":\");\r\n\r\n // C: or CP: is always folowed by expansion then an underscore.\r\n let expansionStr = \"\";\r\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\r\n expansionStr += this.cur();\r\n this.advance();\r\n }\r\n\r\n this.eat(\"_\");\r\n\r\n const expansion = Number.parseFloat(expansionStr);\r\n this.require(!Number.isNaN(expansion));\r\n\r\n return { type, expansion };\r\n }\r\n\r\n private parseAnimation(): Id64String | undefined {\r\n if (this.cur() !== \"A\")\r\n return undefined;\r\n\r\n this.eat(\"A\");\r\n this.eat(\":\");\r\n\r\n const termPos = this.input.indexOf(\"_\", this.curPos);\r\n this.require(termPos > this.curPos);\r\n\r\n const animationId = this.input.substring(this.curPos, termPos);\r\n this.require(Id64.isId64(animationId));\r\n\r\n this.curPos = termPos + 1; // Skip \"_\"\r\n return animationId;\r\n }\r\n\r\n private parsePrimary(): ParsedPrimary {\r\n const edges = this.parseEdges();\r\n const sectionCut = this.parseSectionCut();\r\n return { edges, sectionCut };\r\n }\r\n\r\n private parseEdges(): EdgeOptions | false {\r\n if (\"E\" !== this.cur())\r\n return { indexed: false, smooth: false };\r\n\r\n this.eat(\"E\");\r\n this.eat(\":\");\r\n\r\n const typeStr = this.cur();\r\n this.eat(typeStr);\r\n this.eat(\"_\");\r\n\r\n switch (typeStr) {\r\n case \"0\": return false;\r\n case \"2\": return { indexed: true, smooth: false };\r\n case \"3\": return { indexed: false, smooth: true };\r\n case \"4\": return { indexed: true, smooth: true };\r\n default: this.reject();\r\n }\r\n }\r\n\r\n private parseSectionCut(): string | undefined {\r\n if (\"S\" !== this.cur())\r\n return undefined;\r\n\r\n this.eat(\"S\");\r\n const termPos = this.input.indexOf(\"s\", this.curPos);\r\n this.require(termPos > this.curPos);\r\n\r\n const sectionCut = this.input.substring(this.curPos, termPos);\r\n this.curPos = termPos + 1; // Skip \"_\";\r\n return sectionCut;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\r\n const parser = new Parser(treeId);\r\n return parser.parse(contentId);\r\n}\r\n\r\n/** @internal */\r\nexport const defaultTileOptions: TileOptions = Object.freeze({\r\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\r\n enableInstancing: true,\r\n enableImprovedElision: true,\r\n ignoreAreaPatterns: false,\r\n enableExternalTextures: true,\r\n useProjectExtents: true,\r\n optimizeBRepProcessing: true,\r\n useLargerTiles: true,\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: true,\r\n generateAllPolyfaceEdges: true,\r\n});\r\n\r\nfunction contentFlagsFromId(id: string): ContentFlags {\r\n if (0 === id.length || \"-\" !== id[0])\r\n throw new Error(\"Invalid content Id\");\r\n\r\n // V4: -flags-d-i-j-k-m - version in tree Id\r\n const end = id.indexOf(\"-\", 1);\r\n if (-1 !== end) {\r\n const flags = Number.parseInt(id.substring(1, end), 16);\r\n if (!Number.isNaN(flags))\r\n return flags;\r\n }\r\n\r\n throw new Error(\"Invalid content Id\");\r\n}\r\n\r\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\r\n if (0 === id.length)\r\n throw new Error(\"Invalid tree Id\");\r\n\r\n let parts = id.split(\"-\");\r\n if (parts.length > 0) {\r\n parts = parts[0].split(\"_\");\r\n if (parts.length === 2) {\r\n const version = Number.parseInt(parts[0], 16);\r\n const flags = Number.parseInt(parts[1], 16);\r\n if (!Number.isNaN(version) || !Number.isNaN(flags))\r\n return { version, flags };\r\n }\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\r\n const pos = id.indexOf(\"E:\");\r\n if (pos <= 0)\r\n return { indexed: false, smooth: false };\r\n\r\n switch (id[pos + 2]) {\r\n case \"0\": return { indexed: defaultTileOptions.enableIndexedEdges, smooth: defaultTileOptions.generateAllPolyfaceEdges };\r\n case \"2\": return { indexed: true, smooth: false };\r\n case \"3\": return { indexed: false, smooth: true };\r\n case \"4\": return { indexed: true, smooth: true };\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\n/** @internal */\r\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\r\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\r\n // Ensure we do not request tiles of a newer major version than backend can supply or it can read; and also limit major version\r\n // to that optionally configured by the app.\r\n let majorVersion = maxMajorVersion;\r\n if (undefined !== formatVersion)\r\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\r\n\r\n // Version number less than 1 is invalid - ignore\r\n majorVersion = Math.max(majorVersion, 1);\r\n\r\n // Version number greater than current known version ignored\r\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\r\n\r\n // Version numbers are integers - round down\r\n return Math.max(Math.floor(majorVersion), 1);\r\n}\r\n\r\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\r\n * @alpha\r\n */\r\nexport enum TreeFlags {\r\n None = 0,\r\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\r\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\r\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\r\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\r\n}\r\n\r\n/** Describes how edges should be produced for tiles in a tile tree.\r\n * @internal\r\n */\r\nexport interface EdgeOptions {\r\n /** Generate indexed edges. These use less memory and draw more efficiently than non-indexed edges, but require WebGL 2.\r\n * Generally the display system will determine which to use based on the device's capabilities and application configuration.\r\n */\r\n indexed: boolean;\r\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\r\n smooth: boolean;\r\n}\r\n\r\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\r\n if (typeof a !== typeof b)\r\n return a ? 1 : -1;\r\n\r\n if (typeof a === \"boolean\") {\r\n assert(typeof b === \"boolean\");\r\n return compareBooleans(a, b);\r\n }\r\n\r\n assert(typeof b === \"object\");\r\n let cmp = compareBooleans(a.indexed, b.indexed);\r\n if (0 === cmp)\r\n cmp = compareBooleans(a.smooth, b.smooth);\r\n\r\n return cmp;\r\n}\r\n\r\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\r\n * @internal\r\n */\r\nexport interface PrimaryTileTreeId {\r\n /** Describes the type of tile tree. */\r\n type: BatchType.Primary;\r\n /** The type of edges to include in tile content. */\r\n edges: EdgeOptions | false;\r\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\r\n animationId?: Id64String;\r\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\r\n * for ensuring the graphics display with correct priority.\r\n */\r\n enforceDisplayPriority?: boolean;\r\n /** If defined, the compact string representation of a clip vector applied to the tiles to produce cut geometry at the intersections with the clip planes.\r\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString[($core-geometry).\r\n */\r\n sectionCut?: string;\r\n}\r\n\r\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\r\n * @internal\r\n */\r\nexport interface ClassifierTileTreeId {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n animationId?: Id64String;\r\n}\r\n\r\nfunction animationIdToString(animationId: Id64String): string {\r\n return `A:${animationId}_`;\r\n}\r\n\r\n/** Describes the Id of an iModel tile tree.\r\n * @internal\r\n */\r\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\r\n\r\n/** Convert a tile tree Id to its string representation.\r\n * @internal\r\n */\r\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\r\n let idStr = \"\";\r\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\r\n if (options.optimizeBRepProcessing)\r\n flags |= TreeFlags.OptimizeBRepProcessing;\r\n\r\n if (options.useLargerTiles)\r\n flags |= TreeFlags.UseLargerTiles;\r\n\r\n if (BatchType.Primary === treeId.type) {\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\r\n flags |= TreeFlags.EnforceDisplayPriority;\r\n\r\n let edges;\r\n if (!treeId.edges) {\r\n edges = \"E:0_\";\r\n } else {\r\n if (!treeId.edges.smooth)\r\n edges = treeId.edges.indexed ? \"E:2_\" : \"\";\r\n else\r\n edges = treeId.edges.indexed ? \"E:4_\" : \"E:3_\";\r\n }\r\n\r\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\r\n idStr = `${idStr}${edges}${sectionCut}`;\r\n } else {\r\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\r\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\r\n\r\n if (BatchType.VolumeClassifier === treeId.type)\r\n flags |= TreeFlags.UseProjectExtents;\r\n\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n }\r\n\r\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\r\n if (version >= 4) {\r\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\r\n idStr = prefix + idStr;\r\n }\r\n\r\n return idStr + modelId;\r\n}\r\n\r\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\r\n * @internal\r\n */\r\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\r\n let cmp = compareNumbers(lhs.type, rhs.type);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\r\n\r\n if (0 !== cmp)\r\n return cmp;\r\n\r\n // NB: The redundant checks on BatchType below are to satisfy compiler.\r\n assert(lhs.type === rhs.type);\r\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\r\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\r\n if (0 === cmp) {\r\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\r\n }\r\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\r\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\r\n }\r\n\r\n return cmp;\r\n}\r\n\r\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\r\n * @alpha\r\n */\r\nexport enum ContentFlags {\r\n None = 0,\r\n AllowInstancing = 1 << 0,\r\n ImprovedElision = 1 << 1,\r\n IgnoreAreaPatterns = 1 << 2,\r\n ExternalTextures = 1 << 3,\r\n}\r\n\r\n/** Describes the components of a tile's content Id.\r\n *\r\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\r\n *\r\n * The i, j, and k parameters specify how to subdivide the tile's volume. Each sub-division is performed along the longest axis of the\r\n * volume. The volume is first sub-divided based on `i`, then the result sub-divided based on `j`, and finally that result sub-divided\r\n * based on `k`.\r\n *\r\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\r\n * produce a higher-resolution tile for the same volume.\r\n * @internal\r\n */\r\ninterface ContentIdSpec {\r\n depth: number;\r\n i: number;\r\n j: number;\r\n k: number;\r\n multiplier: number;\r\n}\r\n\r\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\r\n * the major version of the tile format.\r\n * @internal\r\n */\r\nexport abstract class ContentIdProvider {\r\n public readonly majorFormatVersion: number;\r\n public readonly contentFlags: ContentFlags;\r\n\r\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\r\n this.majorFormatVersion = formatVersion;\r\n this.contentFlags = contentFlags;\r\n }\r\n\r\n public get rootContentId(): string {\r\n return this.computeId(0, 0, 0, 0, 1);\r\n }\r\n\r\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\r\n const lastSepPos = parentId.lastIndexOf(this._separator);\r\n assert(-1 !== lastSepPos);\r\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\r\n }\r\n\r\n public specFromId(id: string): ContentIdSpec {\r\n const parts = id.split(this._separator);\r\n const len = parts.length;\r\n assert(len >= 5);\r\n return {\r\n depth: parseInt(parts[len - 5], 16),\r\n i: parseInt(parts[len - 4], 16),\r\n j: parseInt(parts[len - 3], 16),\r\n k: parseInt(parts[len - 2], 16),\r\n multiplier: parseInt(parts[len - 1], 16),\r\n };\r\n }\r\n\r\n public idFromSpec(spec: ContentIdSpec): string {\r\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\r\n }\r\n\r\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\r\n const sep = this._separator;\r\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\r\n }\r\n\r\n protected abstract get _separator(): string;\r\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\r\n\r\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\r\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\r\n * not supply tiles of a format the front-end doesn't recognize.\r\n */\r\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\r\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\r\n assert(majorVersion > 0);\r\n assert(Math.floor(majorVersion) === majorVersion);\r\n switch (majorVersion) {\r\n case 0:\r\n case 1:\r\n return new ContentIdV1Provider(majorVersion);\r\n case 2:\r\n case 3:\r\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\r\n default:\r\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\r\n }\r\n }\r\n}\r\n\r\n/** The original (major version 1) tile format used a content Id scheme of the format\r\n * `depth/i/j/k/multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV1Provider extends ContentIdProvider {\r\n public constructor(majorVersion: number) {\r\n super(majorVersion, ContentFlags.None);\r\n }\r\n\r\n protected get _separator() { return \"/\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\r\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV2Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\r\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"_\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\r\n * Format: `-flags-depth-i-j-k-multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV4Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\r\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n if (options.enableImprovedElision)\r\n flags = flags | ContentFlags.ImprovedElision;\r\n\r\n if (options.ignoreAreaPatterns)\r\n flags = flags | ContentFlags.IgnoreAreaPatterns;\r\n\r\n if (options.enableExternalTextures)\r\n flags = flags | ContentFlags.ExternalTextures;\r\n\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"-\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y && diag.x > diag.z)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else if (diag.y > diag.z)\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n else\r\n pt.z = (range.low.z + range.high.z) / 2.0;\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n}\r\n\r\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\r\n * @internal\r\n */\r\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\r\n const emptyMask = tile.emptySubRangeMask;\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n\r\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n const isEmpty = 0 !== (emptyMask & emptyBit);\r\n\r\n const range = tile.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n ranges.push({ range, isEmpty });\r\n }\r\n }\r\n }\r\n\r\n return ranges;\r\n}\r\n\r\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\r\n * @internal\r\n */\r\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\r\n let numEmpty = 0;\r\n const children: TileProps[] = [];\r\n\r\n // Leaf nodes have no children\r\n if (parent.isLeaf)\r\n return { children, numEmpty };\r\n\r\n // One child, same volume as parent, but higher-resolution.\r\n if (undefined !== parent.sizeMultiplier) {\r\n const sizeMultiplier = parent.sizeMultiplier * 2;\r\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\r\n children.push({\r\n contentId,\r\n range: parent.range,\r\n contentRange: parent.contentRange,\r\n sizeMultiplier,\r\n isLeaf: false,\r\n maximumSize: root.tileScreenSize,\r\n });\r\n\r\n return { children, numEmpty };\r\n }\r\n\r\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\r\n const parentSpec = idProvider.specFromId(parent.contentId);\r\n const childSpec: ContentIdSpec = { ...parentSpec };\r\n childSpec.depth = parentSpec.depth + 1;\r\n\r\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\r\n // Don't bother creating children or requesting content for such empty volumes.\r\n const emptyMask = parent.emptySubRangeMask;\r\n\r\n // Spatial tree range == project extents; content range == model range.\r\n // Trivially reject children whose ranges are entirely outside model range.\r\n let treeContentRange = root.contentRange;\r\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\r\n // Parent is wholly within model range - don't bother testing child ranges against it.\r\n treeContentRange = undefined;\r\n }\r\n\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n if (0 !== (emptyMask & emptyBit)) {\r\n // volume is known to contain no geometry.\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n const range = parent.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\r\n // volume is within project extents but entirely outside model range\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n childSpec.i = parentSpec.i * 2 + i;\r\n childSpec.j = parentSpec.j * 2 + j;\r\n childSpec.k = parentSpec.k * 2 + k;\r\n\r\n const childId = idProvider.idFromSpec(childSpec);\r\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\r\n }\r\n }\r\n }\r\n\r\n return { children, numEmpty };\r\n}\r\n\r\n/** @internal */\r\nexport interface TileContentDescription extends TileContentMetadata {\r\n readonly featureTableStartPos: number;\r\n}\r\n\r\n/** Deserializes tile content metadata.\r\n * @throws [[TileReadError]]\r\n * @internal\r\n */\r\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\r\n stream.reset();\r\n\r\n const header = new ImdlHeader(stream);\r\n if (!header.isValid)\r\n throw new TileReadError(TileReadStatus.InvalidHeader);\r\n else if (!header.isReadableVersion)\r\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\r\n\r\n // Skip the feature table.\r\n const featureTableStartPos = stream.curPos;\r\n const ftHeader = FeatureTableHeader.readFrom(stream);\r\n if (undefined === ftHeader)\r\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\r\n\r\n stream.curPos = featureTableStartPos + ftHeader.length;\r\n\r\n // Determine subdivision based on header data.\r\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\r\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\r\n let isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\r\n if (!isLeaf) {\r\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\r\n // can be adversely affected by quantization issues when zooming in closely.\r\n const maxLeafTolerance = 1.0;\r\n\r\n // Must sub-divide if tile explicitly specifies...\r\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\r\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\r\n canSkipSubdivision = canSkipSubdivision && !is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\r\n // ...or app specifies incomplete tiles must always be sub-divided.\r\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\r\n if (canSkipSubdivision) {\r\n const minElementsPerTile = 100;\r\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\r\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\r\n if (!containsCurves)\r\n isLeaf = true;\r\n else if (undefined === sizeMultiplier)\r\n sizeMultiplier = 1.0;\r\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\r\n sizeMultiplier = 1.0;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n featureTableStartPos,\r\n contentRange: header.contentRange,\r\n isLeaf,\r\n sizeMultiplier,\r\n emptySubRangeMask: header.emptySubRanges,\r\n };\r\n}\r\n\r\nconst scratchRangeDiagonal = new Vector3d();\r\n\r\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\r\n * @internal\r\n */\r\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\r\n if (tile.range.isNull)\r\n return 0;\r\n\r\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\r\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\r\n\r\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\r\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\r\n}\r\n\r\n/** Deserializes tile metadata.\r\n * @internal\r\n */\r\nexport class TileMetadataReader {\r\n private readonly _is2d: boolean;\r\n private readonly _isVolumeClassifier: boolean;\r\n private readonly _options: TileOptions;\r\n\r\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\r\n this._is2d = is2d;\r\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\r\n this._options = options;\r\n }\r\n\r\n /** Produce metadata from the specified tile content.\r\n * @throws [[TileReadError]]\r\n */\r\n public read(stream: ByteStream, props: TileProps): TileMetadata {\r\n const content = readTileContentDescription(stream, props.sizeMultiplier, this._is2d, this._options, this._isVolumeClassifier);\r\n return {\r\n contentRange: content.contentRange,\r\n isLeaf: content.isLeaf,\r\n sizeMultiplier: content.sizeMultiplier,\r\n emptySubRangeMask: content.emptySubRangeMask,\r\n range: Range3d.fromJSON(props.range),\r\n contentId: props.contentId,\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAC7B,wDAAyD;AACzD,kDAA4C;AAE5C,iDAA+F;AAC/F,qCAAyD;AAEzD,mCAAmC;AAEnC,+DAA+D;AAC/D,IAAU,SAAS,CAElB;AAFD,WAAU,SAAS;IACJ,qCAA2B,GAAG,CAAC,CAAC;AAC/C,CAAC,EAFS,SAAS,KAAT,SAAS,QAElB;AA8CD,gBAAgB;AAChB,IAAiB,WAAW,CA2B3B;AA3BD,WAAiB,WAAW;IAC1B;;;;;OAKG;IACH,SAAgB,sBAAsB,CAAC,MAAc,EAAE,SAAiB;QACtE,MAAM,IAAI,GAAG,+BAA+B,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAElD,OAAO;YACL,6BAA6B,EAAE,IAAI,CAAC,OAAO;YAC3C,gBAAgB,EAAE,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC,eAAe,CAAC;YACrE,qBAAqB,EAAE,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC,eAAe,CAAC;YAC1E,kBAAkB,EAAE,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC;YAC1E,sBAAsB,EAAE,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC,gBAAgB,CAAC;YAC5E,iBAAiB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,iBAAiB,CAAC;YACnE,sBAAsB,EAAE,CAAC,KAAK,CAAC,IAAI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AC,2BAA2B,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC;AATD,8DASC;AAED;;GAEG;AACH,MAAa,kBAAkB;IAK7B,YAAmB,IAAe,EAAE,IAAa,EAAE,OAAoB;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,mBAAmB,GAAG,wBAAS,CAAC,gBAAgB,KAAK,IAAI,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAAkB,EAAE,KAAgB;QAC9C,MAAM,OAAO,GAAG,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC9H,OAAO;YACL,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;YAC5C,KAAK,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;CACF;AAzBD,gDAyBC","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 Tile\r\n */\r\n\r\nimport {\r\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStringsOrUndefined, Id64, Id64String,\r\n} from \"@itwin/core-bentley\";\r\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { BatchType } from \"../FeatureTable\";\r\nimport { TileProps } from \"../TileProps\";\r\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\r\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\r\n\r\n// cspell:ignore imdl mult bitfield\r\n\r\n// NB: These constants correspond to those defined in Tile.cpp.\r\nnamespace Constants {\r\n export const minToleranceRatioMultiplier = 2;\r\n}\r\n\r\n/** Describes an iModel tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeMetadata {\r\n readonly modelId: Id64String;\r\n readonly is2d: boolean;\r\n readonly contentRange?: Range3d;\r\n readonly tileScreenSize: number;\r\n}\r\n\r\n/** Describes the contents of an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileContentMetadata {\r\n readonly contentRange: Range3d;\r\n readonly isLeaf: boolean;\r\n readonly sizeMultiplier?: number;\r\n readonly emptySubRangeMask: number;\r\n}\r\n\r\n/** Describes an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileMetadata extends TileContentMetadata {\r\n readonly contentId: string;\r\n readonly range: Range3d;\r\n}\r\n\r\n/** @internal */\r\nexport interface TileOptions {\r\n readonly maximumMajorTileFormatVersion: number;\r\n readonly enableInstancing: boolean;\r\n readonly enableImprovedElision: boolean;\r\n readonly ignoreAreaPatterns: boolean;\r\n readonly enableExternalTextures: boolean;\r\n readonly useProjectExtents: boolean;\r\n readonly optimizeBRepProcessing: boolean;\r\n readonly useLargerTiles: boolean;\r\n readonly disableMagnification: boolean;\r\n readonly alwaysSubdivideIncompleteTiles: boolean;\r\n readonly enableIndexedEdges: boolean;\r\n readonly generateAllPolyfaceEdges: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport namespace TileOptions {\r\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\r\n * compute the [[TileOptions]] that were used to generate the Ids.\r\n * @throws Error if `treeId` or `contentId` are not valid Ids.\r\n * @note `treeId` and `contentId` are assumed to be valid Ids. They are not fully parsed and validated - only the information required by this function is extracted.\r\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\r\n */\r\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\r\n const tree = treeFlagsAndFormatVersionFromId(treeId);\r\n const contentFlags = contentFlagsFromId(contentId);\r\n const edgeOptions = edgeOptionsFromTreeId(treeId);\r\n\r\n return {\r\n maximumMajorTileFormatVersion: tree.version,\r\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\r\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\r\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\r\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\r\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\r\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\r\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: edgeOptions && edgeOptions.indexed,\r\n generateAllPolyfaceEdges: edgeOptions && edgeOptions.smooth,\r\n };\r\n }\r\n}\r\n\r\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\">;\r\ninterface ParsedClassifier {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n}\r\n\r\n/** The result of [[parseTileTreeIdAndContentId]].\r\n * @internal\r\n */\r\nexport interface ParsedTileTreeIdAndContentId {\r\n modelId: Id64String;\r\n treeId: IModelTileTreeId;\r\n contentId: ContentIdSpec;\r\n options: TileOptions;\r\n}\r\n\r\nclass Parser {\r\n public readonly input: string;\r\n public curPos = 0;\r\n\r\n public constructor(input: string) {\r\n this.input = input;\r\n }\r\n\r\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\r\n this.require(this.input.length > 0);\r\n\r\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\r\n while (this.curPos < this.input.length && this.cur() !== \"-\")\r\n this.advance();\r\n\r\n this.eat(\"-\");\r\n this.require(this.curPos < this.input.length);\r\n\r\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\r\n const animationId = this.parseAnimation();\r\n\r\n const primary = classifier ? undefined : this.parsePrimary();\r\n this.require((undefined === classifier) !== (undefined === primary));\r\n\r\n const modelId = this.input.substr(this.curPos);\r\n this.require(Id64.isId64(modelId));\r\n\r\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\r\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\r\n\r\n let parsedContentId: ContentIdSpec;\r\n try {\r\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\r\n } catch (e) {\r\n this.reject(\"Invalid content Id\");\r\n }\r\n\r\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\r\n throw new Error(\"Invalid content Id\");\r\n\r\n let treeId: IModelTileTreeId;\r\n if (classifier) {\r\n treeId = { ...classifier, animationId };\r\n } else {\r\n assert(undefined !== primary);\r\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\r\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority };\r\n }\r\n\r\n return {\r\n contentId: parsedContentId,\r\n modelId,\r\n options,\r\n treeId,\r\n };\r\n }\r\n\r\n private cur(): string {\r\n this.require(this.curPos < this.input.length);\r\n return this.input[this.curPos];\r\n }\r\n\r\n private advance(): void {\r\n this.require(this.curPos < this.input.length);\r\n ++this.curPos;\r\n }\r\n\r\n private eat(expectedChar: string): void {\r\n this.require(this.cur() === expectedChar);\r\n this.advance();\r\n }\r\n\r\n private reject(message = \"Invalid tree Id\"): never {\r\n throw new Error(message);\r\n }\r\n\r\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\r\n if (!condition)\r\n this.reject(message);\r\n }\r\n\r\n private parseClassifier(): ParsedClassifier | undefined {\r\n this.eat(\"C\");\r\n let type = BatchType.VolumeClassifier;\r\n if (this.cur() === \"P\") {\r\n type = BatchType.PlanarClassifier;\r\n this.advance();\r\n }\r\n\r\n this.eat(\":\");\r\n\r\n // C: or CP: is always folowed by expansion then an underscore.\r\n let expansionStr = \"\";\r\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\r\n expansionStr += this.cur();\r\n this.advance();\r\n }\r\n\r\n this.eat(\"_\");\r\n\r\n const expansion = Number.parseFloat(expansionStr);\r\n this.require(!Number.isNaN(expansion));\r\n\r\n return { type, expansion };\r\n }\r\n\r\n private parseAnimation(): Id64String | undefined {\r\n if (this.cur() !== \"A\")\r\n return undefined;\r\n\r\n this.eat(\"A\");\r\n this.eat(\":\");\r\n\r\n const termPos = this.input.indexOf(\"_\", this.curPos);\r\n this.require(termPos > this.curPos);\r\n\r\n const animationId = this.input.substring(this.curPos, termPos);\r\n this.require(Id64.isId64(animationId));\r\n\r\n this.curPos = termPos + 1; // Skip \"_\"\r\n return animationId;\r\n }\r\n\r\n private parsePrimary(): ParsedPrimary {\r\n const edges = this.parseEdges();\r\n const sectionCut = this.parseSectionCut();\r\n return { edges, sectionCut };\r\n }\r\n\r\n private parseEdges(): EdgeOptions | false {\r\n if (\"E\" !== this.cur())\r\n return { indexed: false, smooth: false };\r\n\r\n this.eat(\"E\");\r\n this.eat(\":\");\r\n\r\n const typeStr = this.cur();\r\n this.eat(typeStr);\r\n this.eat(\"_\");\r\n\r\n switch (typeStr) {\r\n case \"0\": return false;\r\n case \"2\": return { indexed: true, smooth: false };\r\n case \"3\": return { indexed: false, smooth: true };\r\n case \"4\": return { indexed: true, smooth: true };\r\n default: this.reject();\r\n }\r\n }\r\n\r\n private parseSectionCut(): string | undefined {\r\n if (\"S\" !== this.cur())\r\n return undefined;\r\n\r\n this.eat(\"S\");\r\n const termPos = this.input.indexOf(\"s\", this.curPos);\r\n this.require(termPos > this.curPos);\r\n\r\n const sectionCut = this.input.substring(this.curPos, termPos);\r\n this.curPos = termPos + 1; // Skip \"_\";\r\n return sectionCut;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\r\n const parser = new Parser(treeId);\r\n return parser.parse(contentId);\r\n}\r\n\r\n/** @internal */\r\nexport const defaultTileOptions: TileOptions = Object.freeze({\r\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\r\n enableInstancing: true,\r\n enableImprovedElision: true,\r\n ignoreAreaPatterns: false,\r\n enableExternalTextures: true,\r\n useProjectExtents: true,\r\n optimizeBRepProcessing: true,\r\n useLargerTiles: true,\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: true,\r\n generateAllPolyfaceEdges: true,\r\n});\r\n\r\nfunction contentFlagsFromId(id: string): ContentFlags {\r\n if (0 === id.length || \"-\" !== id[0])\r\n throw new Error(\"Invalid content Id\");\r\n\r\n // V4: -flags-d-i-j-k-m - version in tree Id\r\n const end = id.indexOf(\"-\", 1);\r\n if (-1 !== end) {\r\n const flags = Number.parseInt(id.substring(1, end), 16);\r\n if (!Number.isNaN(flags))\r\n return flags;\r\n }\r\n\r\n throw new Error(\"Invalid content Id\");\r\n}\r\n\r\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\r\n if (0 === id.length)\r\n throw new Error(\"Invalid tree Id\");\r\n\r\n let parts = id.split(\"-\");\r\n if (parts.length > 0) {\r\n parts = parts[0].split(\"_\");\r\n if (parts.length === 2) {\r\n const version = Number.parseInt(parts[0], 16);\r\n const flags = Number.parseInt(parts[1], 16);\r\n if (!Number.isNaN(version) || !Number.isNaN(flags))\r\n return { version, flags };\r\n }\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\r\n const pos = id.indexOf(\"E:\");\r\n if (pos <= 0)\r\n return { indexed: false, smooth: false };\r\n\r\n switch (id[pos + 2]) {\r\n case \"0\": return { indexed: defaultTileOptions.enableIndexedEdges, smooth: defaultTileOptions.generateAllPolyfaceEdges };\r\n case \"2\": return { indexed: true, smooth: false };\r\n case \"3\": return { indexed: false, smooth: true };\r\n case \"4\": return { indexed: true, smooth: true };\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\n/** @internal */\r\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\r\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\r\n // Ensure we do not request tiles of a newer major version than backend can supply or it can read; and also limit major version\r\n // to that optionally configured by the app.\r\n let majorVersion = maxMajorVersion;\r\n if (undefined !== formatVersion)\r\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\r\n\r\n // Version number less than 1 is invalid - ignore\r\n majorVersion = Math.max(majorVersion, 1);\r\n\r\n // Version number greater than current known version ignored\r\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\r\n\r\n // Version numbers are integers - round down\r\n return Math.max(Math.floor(majorVersion), 1);\r\n}\r\n\r\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\r\n * @alpha\r\n */\r\nexport enum TreeFlags {\r\n None = 0,\r\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\r\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\r\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\r\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\r\n}\r\n\r\n/** Describes how edges should be produced for tiles in a tile tree.\r\n * @internal\r\n */\r\nexport interface EdgeOptions {\r\n /** Generate indexed edges. These use less memory and draw more efficiently than non-indexed edges, but require WebGL 2.\r\n * Generally the display system will determine which to use based on the device's capabilities and application configuration.\r\n */\r\n indexed: boolean;\r\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\r\n smooth: boolean;\r\n}\r\n\r\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\r\n if (typeof a !== typeof b)\r\n return a ? 1 : -1;\r\n\r\n if (typeof a === \"boolean\") {\r\n assert(typeof b === \"boolean\");\r\n return compareBooleans(a, b);\r\n }\r\n\r\n assert(typeof b === \"object\");\r\n let cmp = compareBooleans(a.indexed, b.indexed);\r\n if (0 === cmp)\r\n cmp = compareBooleans(a.smooth, b.smooth);\r\n\r\n return cmp;\r\n}\r\n\r\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\r\n * @internal\r\n */\r\nexport interface PrimaryTileTreeId {\r\n /** Describes the type of tile tree. */\r\n type: BatchType.Primary;\r\n /** The type of edges to include in tile content. */\r\n edges: EdgeOptions | false;\r\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\r\n animationId?: Id64String;\r\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\r\n * for ensuring the graphics display with correct priority.\r\n */\r\n enforceDisplayPriority?: boolean;\r\n /** If defined, the compact string representation of a clip vector applied to the tiles to produce cut geometry at the intersections with the clip planes.\r\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString[($core-geometry).\r\n */\r\n sectionCut?: string;\r\n}\r\n\r\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\r\n * @internal\r\n */\r\nexport interface ClassifierTileTreeId {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n animationId?: Id64String;\r\n}\r\n\r\nfunction animationIdToString(animationId: Id64String): string {\r\n return `A:${animationId}_`;\r\n}\r\n\r\n/** Describes the Id of an iModel tile tree.\r\n * @internal\r\n */\r\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\r\n\r\n/** Convert a tile tree Id to its string representation.\r\n * @internal\r\n */\r\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\r\n let idStr = \"\";\r\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\r\n if (options.optimizeBRepProcessing)\r\n flags |= TreeFlags.OptimizeBRepProcessing;\r\n\r\n if (options.useLargerTiles)\r\n flags |= TreeFlags.UseLargerTiles;\r\n\r\n if (BatchType.Primary === treeId.type) {\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\r\n flags |= TreeFlags.EnforceDisplayPriority;\r\n\r\n let edges;\r\n if (!treeId.edges) {\r\n edges = \"E:0_\";\r\n } else {\r\n if (!treeId.edges.smooth)\r\n edges = treeId.edges.indexed ? \"E:2_\" : \"\";\r\n else\r\n edges = treeId.edges.indexed ? \"E:4_\" : \"E:3_\";\r\n }\r\n\r\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\r\n idStr = `${idStr}${edges}${sectionCut}`;\r\n } else {\r\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\r\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\r\n\r\n if (BatchType.VolumeClassifier === treeId.type)\r\n flags |= TreeFlags.UseProjectExtents;\r\n\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n }\r\n\r\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\r\n if (version >= 4) {\r\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\r\n idStr = prefix + idStr;\r\n }\r\n\r\n return idStr + modelId;\r\n}\r\n\r\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\r\n * @internal\r\n */\r\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\r\n let cmp = compareNumbers(lhs.type, rhs.type);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\r\n\r\n if (0 !== cmp)\r\n return cmp;\r\n\r\n // NB: The redundant checks on BatchType below are to satisfy compiler.\r\n assert(lhs.type === rhs.type);\r\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\r\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\r\n if (0 === cmp) {\r\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\r\n }\r\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\r\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\r\n }\r\n\r\n return cmp;\r\n}\r\n\r\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\r\n * @alpha\r\n */\r\nexport enum ContentFlags {\r\n None = 0,\r\n AllowInstancing = 1 << 0,\r\n ImprovedElision = 1 << 1,\r\n IgnoreAreaPatterns = 1 << 2,\r\n ExternalTextures = 1 << 3,\r\n}\r\n\r\n/** Describes the components of a tile's content Id.\r\n *\r\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\r\n *\r\n * The i, j, and k parameters specify how to subdivide the tile's volume. Each sub-division is performed along the longest axis of the\r\n * volume. The volume is first sub-divided based on `i`, then the result sub-divided based on `j`, and finally that result sub-divided\r\n * based on `k`.\r\n *\r\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\r\n * produce a higher-resolution tile for the same volume.\r\n * @internal\r\n */\r\ninterface ContentIdSpec {\r\n depth: number;\r\n i: number;\r\n j: number;\r\n k: number;\r\n multiplier: number;\r\n}\r\n\r\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\r\n * the major version of the tile format.\r\n * @internal\r\n */\r\nexport abstract class ContentIdProvider {\r\n public readonly majorFormatVersion: number;\r\n public readonly contentFlags: ContentFlags;\r\n\r\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\r\n this.majorFormatVersion = formatVersion;\r\n this.contentFlags = contentFlags;\r\n }\r\n\r\n public get rootContentId(): string {\r\n return this.computeId(0, 0, 0, 0, 1);\r\n }\r\n\r\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\r\n const lastSepPos = parentId.lastIndexOf(this._separator);\r\n assert(-1 !== lastSepPos);\r\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\r\n }\r\n\r\n public specFromId(id: string): ContentIdSpec {\r\n const parts = id.split(this._separator);\r\n const len = parts.length;\r\n assert(len >= 5);\r\n return {\r\n depth: parseInt(parts[len - 5], 16),\r\n i: parseInt(parts[len - 4], 16),\r\n j: parseInt(parts[len - 3], 16),\r\n k: parseInt(parts[len - 2], 16),\r\n multiplier: parseInt(parts[len - 1], 16),\r\n };\r\n }\r\n\r\n public idFromSpec(spec: ContentIdSpec): string {\r\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\r\n }\r\n\r\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\r\n const sep = this._separator;\r\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\r\n }\r\n\r\n protected abstract get _separator(): string;\r\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\r\n\r\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\r\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\r\n * not supply tiles of a format the front-end doesn't recognize.\r\n */\r\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\r\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\r\n assert(majorVersion > 0);\r\n assert(Math.floor(majorVersion) === majorVersion);\r\n switch (majorVersion) {\r\n case 0:\r\n case 1:\r\n return new ContentIdV1Provider(majorVersion);\r\n case 2:\r\n case 3:\r\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\r\n default:\r\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\r\n }\r\n }\r\n}\r\n\r\n/** The original (major version 1) tile format used a content Id scheme of the format\r\n * `depth/i/j/k/multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV1Provider extends ContentIdProvider {\r\n public constructor(majorVersion: number) {\r\n super(majorVersion, ContentFlags.None);\r\n }\r\n\r\n protected get _separator() { return \"/\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\r\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV2Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\r\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"_\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\r\n * Format: `-flags-depth-i-j-k-multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV4Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\r\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n if (options.enableImprovedElision)\r\n flags = flags | ContentFlags.ImprovedElision;\r\n\r\n if (options.ignoreAreaPatterns)\r\n flags = flags | ContentFlags.IgnoreAreaPatterns;\r\n\r\n if (options.enableExternalTextures)\r\n flags = flags | ContentFlags.ExternalTextures;\r\n\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"-\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y && diag.x > diag.z)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else if (diag.y > diag.z)\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n else\r\n pt.z = (range.low.z + range.high.z) / 2.0;\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n}\r\n\r\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\r\n * @internal\r\n */\r\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\r\n const emptyMask = tile.emptySubRangeMask;\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n\r\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n const isEmpty = 0 !== (emptyMask & emptyBit);\r\n\r\n const range = tile.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n ranges.push({ range, isEmpty });\r\n }\r\n }\r\n }\r\n\r\n return ranges;\r\n}\r\n\r\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\r\n * @internal\r\n */\r\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\r\n let numEmpty = 0;\r\n const children: TileProps[] = [];\r\n\r\n // Leaf nodes have no children\r\n if (parent.isLeaf)\r\n return { children, numEmpty };\r\n\r\n // One child, same volume as parent, but higher-resolution.\r\n if (undefined !== parent.sizeMultiplier) {\r\n const sizeMultiplier = parent.sizeMultiplier * 2;\r\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\r\n children.push({\r\n contentId,\r\n range: parent.range,\r\n contentRange: parent.contentRange,\r\n sizeMultiplier,\r\n isLeaf: false,\r\n maximumSize: root.tileScreenSize,\r\n });\r\n\r\n return { children, numEmpty };\r\n }\r\n\r\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\r\n const parentSpec = idProvider.specFromId(parent.contentId);\r\n const childSpec: ContentIdSpec = { ...parentSpec };\r\n childSpec.depth = parentSpec.depth + 1;\r\n\r\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\r\n // Don't bother creating children or requesting content for such empty volumes.\r\n const emptyMask = parent.emptySubRangeMask;\r\n\r\n // Spatial tree range == project extents; content range == model range.\r\n // Trivially reject children whose ranges are entirely outside model range.\r\n let treeContentRange = root.contentRange;\r\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\r\n // Parent is wholly within model range - don't bother testing child ranges against it.\r\n treeContentRange = undefined;\r\n }\r\n\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n if (0 !== (emptyMask & emptyBit)) {\r\n // volume is known to contain no geometry.\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n const range = parent.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\r\n // volume is within project extents but entirely outside model range\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n childSpec.i = parentSpec.i * 2 + i;\r\n childSpec.j = parentSpec.j * 2 + j;\r\n childSpec.k = parentSpec.k * 2 + k;\r\n\r\n const childId = idProvider.idFromSpec(childSpec);\r\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\r\n }\r\n }\r\n }\r\n\r\n return { children, numEmpty };\r\n}\r\n\r\n/** @internal */\r\nexport interface TileContentDescription extends TileContentMetadata {\r\n readonly featureTableStartPos: number;\r\n}\r\n\r\n/** Deserializes tile content metadata.\r\n * @throws [[TileReadError]]\r\n * @internal\r\n */\r\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\r\n stream.reset();\r\n\r\n const header = new ImdlHeader(stream);\r\n if (!header.isValid)\r\n throw new TileReadError(TileReadStatus.InvalidHeader);\r\n else if (!header.isReadableVersion)\r\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\r\n\r\n // Skip the feature table.\r\n const featureTableStartPos = stream.curPos;\r\n const ftHeader = FeatureTableHeader.readFrom(stream);\r\n if (undefined === ftHeader)\r\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\r\n\r\n stream.curPos = featureTableStartPos + ftHeader.length;\r\n\r\n // Determine subdivision based on header data.\r\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\r\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\r\n let isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\r\n if (!isLeaf) {\r\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\r\n // can be adversely affected by quantization issues when zooming in closely.\r\n const maxLeafTolerance = 1.0;\r\n\r\n // Must sub-divide if tile explicitly specifies...\r\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\r\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\r\n canSkipSubdivision = canSkipSubdivision && !is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\r\n // ...or app specifies incomplete tiles must always be sub-divided.\r\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\r\n if (canSkipSubdivision) {\r\n const minElementsPerTile = 100;\r\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\r\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\r\n if (!containsCurves)\r\n isLeaf = true;\r\n else if (undefined === sizeMultiplier)\r\n sizeMultiplier = 1.0;\r\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\r\n sizeMultiplier = 1.0;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n featureTableStartPos,\r\n contentRange: header.contentRange,\r\n isLeaf,\r\n sizeMultiplier,\r\n emptySubRangeMask: header.emptySubRanges,\r\n };\r\n}\r\n\r\nconst scratchRangeDiagonal = new Vector3d();\r\n\r\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\r\n * @internal\r\n */\r\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\r\n if (tile.range.isNull)\r\n return 0;\r\n\r\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\r\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\r\n\r\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\r\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\r\n}\r\n\r\n/** Deserializes tile metadata.\r\n * @internal\r\n */\r\nexport class TileMetadataReader {\r\n private readonly _is2d: boolean;\r\n private readonly _isVolumeClassifier: boolean;\r\n private readonly _options: TileOptions;\r\n\r\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\r\n this._is2d = is2d;\r\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\r\n this._options = options;\r\n }\r\n\r\n /** Produce metadata from the specified tile content.\r\n * @throws [[TileReadError]]\r\n */\r\n public read(stream: ByteStream, props: TileProps): TileMetadata {\r\n const content = readTileContentDescription(stream, props.sizeMultiplier, this._is2d, this._options, this._isVolumeClassifier);\r\n return {\r\n contentRange: content.contentRange,\r\n isLeaf: content.isLeaf,\r\n sizeMultiplier: content.sizeMultiplier,\r\n emptySubRangeMask: content.emptySubRangeMask,\r\n range: Range3d.fromJSON(props.range),\r\n contentId: props.contentId,\r\n };\r\n }\r\n}\r\n"]}
@@ -4,10 +4,10 @@
4
4
  /// <reference types="node" />
5
5
  import type { Readable, Writable } from "stream";
6
6
  import type { Buffer } from "buffer";
7
- /** @public @deprecated in 3.x. */
7
+ /** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */
8
8
  export declare type BackendReadable = Readable;
9
- /** @public @deprecated in 3.x. */
9
+ /** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */
10
10
  export declare type BackendWritable = Writable;
11
- /** @internal @deprecated in 3.x. */
11
+ /** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */
12
12
  export declare type BackendBuffer = Buffer;
13
13
  //# sourceMappingURL=BackendTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendTypes.d.ts","sourceRoot":"","sources":["../../src/BackendTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,kCAAkC;AAClC,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,kCAAkC;AAClC,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,oCAAoC;AACpC,oBAAY,aAAa,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"BackendTypes.d.ts","sourceRoot":"","sources":["../../src/BackendTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,4FAA4F;AAC5F,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,4FAA4F;AAC5F,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,8FAA8F;AAC9F,oBAAY,aAAa,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BackendTypes.js","sourceRoot":"","sources":["../../src/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/** @public @deprecated in 3.x. */\r\nexport type BackendReadable = Readable;\r\n\r\n/** @public @deprecated in 3.x. */\r\nexport type BackendWritable = Writable;\r\n\r\n/** @internal @deprecated in 3.x. */\r\nexport type BackendBuffer = Buffer;\r\n"]}
1
+ {"version":3,"file":"BackendTypes.js","sourceRoot":"","sources":["../../src/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/** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */\r\nexport type BackendReadable = Readable;\r\n\r\n/** @public @deprecated in 3.x. This type was mistakenly made public in the common scope. */\r\nexport type BackendWritable = Writable;\r\n\r\n/** @internal @deprecated in 3.x. This type was mistakenly made public in the common scope. */\r\nexport type BackendBuffer = Buffer;\r\n"]}
@@ -44,9 +44,8 @@ export class BackgroundMapProvider {
44
44
  }
45
45
  /** @internal */
46
46
  static fromBackgroundMapProps(props) {
47
- var _a;
48
47
  // eslint-disable-next-line deprecation/deprecation
49
- return this.fromJSON({ name: props.providerName, type: (_a = props.providerData) === null || _a === void 0 ? void 0 : _a.mapType });
48
+ return this.fromJSON({ name: props.providerName, type: props.providerData?.mapType });
50
49
  }
51
50
  /** Return true if this provider is equivalent to `other`. */
52
51
  equals(other) {
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundMapProvider.js","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"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CAAC;IACrH,CAAC;IAED,6DAA6D;IACtD,MAAM,CAAC,KAA4B;QACxC,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAwC;QACnD,OAAO,qBAAqB,CAAC,QAAQ,CAAC;YACpC,GAAG,IAAI,CAAC,MAAM,EAAE;YAChB,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,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 DisplayStyles\r\n */\r\n\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** Enumerates the types of map imagery that can be supplied by a [[BackgroundMapProvider]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BackgroundMapType {\r\n Street = 1,\r\n Aerial = 2,\r\n Hybrid = 3,\r\n}\r\n\r\n/** Enumerates a set of supported [[BackgroundMapProvider]]s that can provide map imagery.\r\n * @note To access imagery from such a provider, an API key must be supplied via [IModelAppOptions.mapLayerOptions]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport type BackgroundMapProviderName = \"BingProvider\" | \"MapBoxProvider\";\r\n\r\n/** JSON representation of a [[BackgroundMapProvider]].\r\n * @see [[BaseMapLayerProps.provider]].\r\n * @public\r\n */\r\nexport interface BackgroundMapProviderProps {\r\n /** The name of the provider. Default: \"BingProvider\" */\r\n name?: BackgroundMapProviderName;\r\n /** The type of imagery to display. Default: Hybrid. */\r\n type?: BackgroundMapType;\r\n}\r\n\r\n/** Describes one of a small set of standard, known suppliers of background map imagery as part of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport class BackgroundMapProvider {\r\n /** The name of the provider. */\r\n public readonly name: BackgroundMapProviderName;\r\n /** The type of map imagery provided. */\r\n public readonly type: BackgroundMapType;\r\n\r\n private constructor(name: BackgroundMapProviderName, type: BackgroundMapType) {\r\n this.name = name;\r\n this.type = type;\r\n }\r\n\r\n /** Create a provider from its JSON representation. */\r\n public static fromJSON(props: BackgroundMapProviderProps): BackgroundMapProvider {\r\n const name: BackgroundMapProviderName = props.name === \"MapBoxProvider\" ? props.name : \"BingProvider\";\r\n let type;\r\n switch (props.type) {\r\n case BackgroundMapType.Street:\r\n case BackgroundMapType.Aerial:\r\n type = props.type;\r\n break;\r\n default:\r\n type = BackgroundMapType.Hybrid;\r\n break;\r\n }\r\n\r\n return new BackgroundMapProvider(name, type);\r\n }\r\n\r\n /** Convert this provider to its JSON representation. */\r\n public toJSON(): BackgroundMapProviderProps {\r\n return { name: this.name, type: this.type };\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BackgroundMapProvider {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return this.fromJSON({ name: props.providerName as BackgroundMapProviderName, type: props.providerData?.mapType });\r\n }\r\n\r\n /** Return true if this provider is equivalent to `other`. */\r\n public equals(other: BackgroundMapProvider): boolean {\r\n return this.name === other.name && this.type === other.type;\r\n }\r\n\r\n /** Produce a copy of this provider with identical properties except for those explicitly specified by `changedProps`.\r\n * Any properties explicitly set to `undefined` in `changedProps` will be reset to their default values.\r\n */\r\n public clone(changedProps: BackgroundMapProviderProps): BackgroundMapProvider {\r\n return BackgroundMapProvider.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BackgroundMapProvider.js","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,6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AK,KAAK,CAAC,IAAI,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAwC;QACnD,OAAO,qBAAqB,CAAC,QAAQ,CAAC;YACpC,GAAG,IAAI,CAAC,MAAM,EAAE;YAChB,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,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 DisplayStyles\r\n */\r\n\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** Enumerates the types of map imagery that can be supplied by a [[BackgroundMapProvider]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BackgroundMapType {\r\n Street = 1,\r\n Aerial = 2,\r\n Hybrid = 3,\r\n}\r\n\r\n/** Enumerates a set of supported [[BackgroundMapProvider]]s that can provide map imagery.\r\n * @note To access imagery from such a provider, an API key must be supplied via [IModelAppOptions.mapLayerOptions]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport type BackgroundMapProviderName = \"BingProvider\" | \"MapBoxProvider\";\r\n\r\n/** JSON representation of a [[BackgroundMapProvider]].\r\n * @see [[BaseMapLayerProps.provider]].\r\n * @public\r\n */\r\nexport interface BackgroundMapProviderProps {\r\n /** The name of the provider. Default: \"BingProvider\" */\r\n name?: BackgroundMapProviderName;\r\n /** The type of imagery to display. Default: Hybrid. */\r\n type?: BackgroundMapType;\r\n}\r\n\r\n/** Describes one of a small set of standard, known suppliers of background map imagery as part of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport class BackgroundMapProvider {\r\n /** The name of the provider. */\r\n public readonly name: BackgroundMapProviderName;\r\n /** The type of map imagery provided. */\r\n public readonly type: BackgroundMapType;\r\n\r\n private constructor(name: BackgroundMapProviderName, type: BackgroundMapType) {\r\n this.name = name;\r\n this.type = type;\r\n }\r\n\r\n /** Create a provider from its JSON representation. */\r\n public static fromJSON(props: BackgroundMapProviderProps): BackgroundMapProvider {\r\n const name: BackgroundMapProviderName = props.name === \"MapBoxProvider\" ? props.name : \"BingProvider\";\r\n let type;\r\n switch (props.type) {\r\n case BackgroundMapType.Street:\r\n case BackgroundMapType.Aerial:\r\n type = props.type;\r\n break;\r\n default:\r\n type = BackgroundMapType.Hybrid;\r\n break;\r\n }\r\n\r\n return new BackgroundMapProvider(name, type);\r\n }\r\n\r\n /** Convert this provider to its JSON representation. */\r\n public toJSON(): BackgroundMapProviderProps {\r\n return { name: this.name, type: this.type };\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BackgroundMapProvider {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return this.fromJSON({ name: props.providerName as BackgroundMapProviderName, type: props.providerData?.mapType });\r\n }\r\n\r\n /** Return true if this provider is equivalent to `other`. */\r\n public equals(other: BackgroundMapProvider): boolean {\r\n return this.name === other.name && this.type === other.type;\r\n }\r\n\r\n /** Produce a copy of this provider with identical properties except for those explicitly specified by `changedProps`.\r\n * Any properties explicitly set to `undefined` in `changedProps` will be reset to their default values.\r\n */\r\n public clone(changedProps: BackgroundMapProviderProps): BackgroundMapProvider {\r\n return BackgroundMapProvider.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n}\r\n"]}
@@ -36,11 +36,10 @@ function normalizeTransparency(trans) {
36
36
  */
37
37
  export class BackgroundMapSettings {
38
38
  constructor(props) {
39
- var _a, _b, _c;
40
- this.groundBias = (_a = props.groundBias) !== null && _a !== void 0 ? _a : 0;
39
+ this.groundBias = props.groundBias ?? 0;
41
40
  this.transparency = normalizeTransparency(props.transparency);
42
- this.useDepthBuffer = (_b = props.useDepthBuffer) !== null && _b !== void 0 ? _b : false;
43
- this.applyTerrain = (_c = props.applyTerrain) !== null && _c !== void 0 ? _c : false;
41
+ this.useDepthBuffer = props.useDepthBuffer ?? false;
42
+ this.applyTerrain = props.applyTerrain ?? false;
44
43
  this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);
45
44
  this.globeMode = normalizeGlobeMode(props.globeMode);
46
45
  this._locatable = true !== props.nonLocatable;
@@ -64,13 +63,13 @@ export class BackgroundMapSettings {
64
63
  * the iModel - otherwise, prefer [[fromJSON]].
65
64
  */
66
65
  static fromPersistentJSON(json) {
67
- return new this(json !== null && json !== void 0 ? json : {});
66
+ return new this(json ?? {});
68
67
  }
69
68
  /** Construct from JSON, performing validation and applying default values for undefined fields.
70
69
  * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.
71
70
  */
72
71
  static fromJSON(json) {
73
- return new BackgroundMapSettings(json !== null && json !== void 0 ? json : {});
72
+ return new BackgroundMapSettings(json ?? {});
74
73
  }
75
74
  /** Convert these settings to their in-memory JSON representation.
76
75
  * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.
@@ -132,16 +131,15 @@ export class BackgroundMapSettings {
132
131
  * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
133
132
  */
134
133
  clone(changedProps) {
135
- var _a, _b, _c, _d, _e, _f;
136
134
  if (undefined === changedProps)
137
135
  return this;
138
136
  const props = {
139
- groundBias: (_a = changedProps.groundBias) !== null && _a !== void 0 ? _a : this.groundBias,
140
- transparency: (_b = changedProps.transparency) !== null && _b !== void 0 ? _b : this.transparency,
141
- useDepthBuffer: (_c = changedProps.useDepthBuffer) !== null && _c !== void 0 ? _c : this.useDepthBuffer,
142
- globeMode: (_d = changedProps.globeMode) !== null && _d !== void 0 ? _d : this.globeMode,
143
- nonLocatable: (_e = changedProps.nonLocatable) !== null && _e !== void 0 ? _e : !this._locatable,
144
- applyTerrain: (_f = changedProps.applyTerrain) !== null && _f !== void 0 ? _f : this.applyTerrain,
137
+ groundBias: changedProps.groundBias ?? this.groundBias,
138
+ transparency: changedProps.transparency ?? this.transparency,
139
+ useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,
140
+ globeMode: changedProps.globeMode ?? this.globeMode,
141
+ nonLocatable: changedProps.nonLocatable ?? !this._locatable,
142
+ applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,
145
143
  terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),
146
144
  planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),
147
145
  providerName: this._provider.name,
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAuB,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAgB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAgED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB;IACnD,IAAI,QAAQ,KAAK,OAAO,KAAK;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IA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AS,CAAC,IAAI,CAAC;IACpG,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,YAAiC;;QAC5C,IAAI,SAAS,KAAK,YAAY;YAC5B,OAAO,IAAI,CAAC;QAEd,MAAM,KAAK,GAAG;YACZ,UAAU,EAAE,MAAA,YAAY,CAAC,UAAU,mCAAI,IAAI,CAAC,UAAU;YACtD,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,IAAI,CAAC,YAAY;YAC5D,cAAc,EAAE,MAAA,YAAY,CAAC,cAAc,mCAAI,IAAI,CAAC,cAAc;YAClE,SAAS,EAAE,MAAA,YAAY,CAAC,SAAS,mCAAI,IAAI,CAAC,SAAS;YACnD,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,CAAC,IAAI,CAAC,UAAU;YAC3D,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,IAAI,CAAC,YAAY;YAC5D,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,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 DisplayStyles\r\n */\r\n\r\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\r\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\r\n\r\n/** Describes the projection of the background map\r\n * @see [[BackgroundMapProps]]\r\n * @see [[DisplayStyleSettingsProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GlobeMode {\r\n /** Display Earth as 3d ellipsoid */\r\n Ellipsoid = 0,\r\n /** Display Earth as plane. */\r\n Plane = 1,\r\n}\r\n\r\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\r\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BackgroundMapProps {\r\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\r\n groundBias?: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\r\n * Default value: false.\r\n */\r\n transparency?: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n useDepthBuffer?: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n applyTerrain?: boolean;\r\n /** Properties associated with terrain display. */\r\n terrainSettings?: TerrainProps;\r\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\r\n globeMode?: GlobeMode;\r\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n nonLocatable?: boolean;\r\n /** A planar mask applied to the map geometry\r\n * @beta\r\n */\r\n planarClipMask?: PlanarClipMaskProps;\r\n\r\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\r\n providerName?: never;\r\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\r\n providerData?: never;\r\n}\r\n\r\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\r\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\r\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DeprecatedBackgroundMapProps {\r\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\r\n * Default value: \"BingProvider\"\r\n * @deprecated in 3.x. use MapImageryProps.backgroundBase.\r\n */\r\n providerName?: string;\r\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\r\n * @deprecated in 3.x. use MapImageryProps.backgroundBase\r\n */\r\n providerData?: {\r\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\r\n mapType?: BackgroundMapType;\r\n };\r\n}\r\n\r\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\r\n\r\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\r\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\r\n}\r\n\r\nfunction normalizeTransparency(trans?: number | false): number | false {\r\n if (\"number\" === typeof trans)\r\n return Math.min(1, Math.max(0, trans));\r\n\r\n return false;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\r\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\r\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\r\n * @public\r\n */\r\nexport class BackgroundMapSettings {\r\n /** Retained strictly for persistence. */\r\n private readonly _provider: BackgroundMapProvider;\r\n\r\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\r\n public readonly groundBias: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\r\n public readonly transparency: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n public readonly useDepthBuffer: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n public readonly applyTerrain: boolean;\r\n /** Settings associated with terrain display. */\r\n public readonly terrainSettings: TerrainSettings;\r\n /** Globe display mode. */\r\n public readonly globeMode: GlobeMode;\r\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\r\n * @beta\r\n */\r\n public readonly planarClipMask: PlanarClipMaskSettings;\r\n private readonly _locatable: boolean;\r\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n public get locatable(): boolean {\r\n // Handle legacy TerrainProps.nonLocatable:\r\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\r\n // - Otherwise, use BackgroundMapProps.nonLocatable.\r\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\r\n return false;\r\n\r\n return this._locatable;\r\n }\r\n\r\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\r\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\r\n\r\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\r\n this.groundBias = props.groundBias ?? 0;\r\n this.transparency = normalizeTransparency(props.transparency);\r\n this.useDepthBuffer = props.useDepthBuffer ?? false;\r\n this.applyTerrain = props.applyTerrain ?? false;\r\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\r\n this.globeMode = normalizeGlobeMode(props.globeMode);\r\n this._locatable = true !== props.nonLocatable;\r\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\r\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\r\n }\r\n\r\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\r\n * the iModel - otherwise, prefer [[fromJSON]].\r\n */\r\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\r\n return new this(json ?? {});\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields.\r\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\r\n */\r\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\r\n return new BackgroundMapSettings(json ?? {});\r\n }\r\n\r\n /** Convert these settings to their in-memory JSON representation.\r\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\r\n */\r\n public toJSON(): BackgroundMapProps {\r\n const props: BackgroundMapProps = {};\r\n if (0 !== this.groundBias)\r\n props.groundBias = this.groundBias;\r\n if (this.applyTerrain)\r\n props.applyTerrain = true;\r\n if (false !== this.transparency)\r\n props.transparency = this.transparency;\r\n if (GlobeMode.Ellipsoid !== this.globeMode)\r\n props.globeMode = this.globeMode;\r\n if (this.useDepthBuffer)\r\n props.useDepthBuffer = true;\r\n if (!this._locatable)\r\n props.nonLocatable = true;\r\n\r\n const terrainSettings = this.terrainSettings.toJSON();\r\n for (const prop of Object.values(terrainSettings)) {\r\n if (undefined !== prop) {\r\n props.terrainSettings = terrainSettings;\r\n break;\r\n }\r\n }\r\n\r\n if (this.planarClipMask.isValid)\r\n props.planarClipMask = this.planarClipMask.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\r\n * the iModel - otherwise, prefer [[toJSON]].\r\n */\r\n public toPersistentJSON(): PersistentBackgroundMapProps {\r\n const props = this.toJSON() as PersistentBackgroundMapProps;\r\n\r\n // Preserve deprecated imagery provider properties.\r\n if (\"BingProvider\" !== this._provider.name)\r\n props.providerName = this._provider.name; // eslint-disable-line deprecation/deprecation\r\n if (BackgroundMapType.Hybrid !== this._provider.type)\r\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line deprecation/deprecation\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\r\n public equalsJSON(json?: BackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromJSON(json));\r\n }\r\n\r\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\r\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\r\n }\r\n\r\n /** Returns true if these settings are equivalent to `other`. */\r\n public equals(other: BackgroundMapSettings): boolean {\r\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\r\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\r\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\r\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\r\n }\r\n\r\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n groundBias: changedProps.groundBias ?? this.groundBias,\r\n transparency: changedProps.transparency ?? this.transparency,\r\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\r\n globeMode: changedProps.globeMode ?? this.globeMode,\r\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\r\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\r\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\r\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\r\n providerName: this._provider.name,\r\n providerData: { mapType: this._provider.type },\r\n };\r\n\r\n return BackgroundMapSettings.fromPersistentJSON(props);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAuB,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAgB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAgED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB;IACnD,IAAI,QAAQ,KAAK,OAAO,KAAK;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAqChC,YAAoB,KAAwD;QAC1E,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC;QACpD,IAAI,CAAC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CAAC,cAAc;YAClE,SAAS,EAAE,YAAY,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS;YACnD,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,UAAU;YAC3D,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,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 DisplayStyles\r\n */\r\n\r\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\r\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\r\n\r\n/** Describes the projection of the background map\r\n * @see [[BackgroundMapProps]]\r\n * @see [[DisplayStyleSettingsProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GlobeMode {\r\n /** Display Earth as 3d ellipsoid */\r\n Ellipsoid = 0,\r\n /** Display Earth as plane. */\r\n Plane = 1,\r\n}\r\n\r\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\r\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BackgroundMapProps {\r\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\r\n groundBias?: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\r\n * Default value: false.\r\n */\r\n transparency?: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n useDepthBuffer?: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n applyTerrain?: boolean;\r\n /** Properties associated with terrain display. */\r\n terrainSettings?: TerrainProps;\r\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\r\n globeMode?: GlobeMode;\r\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n nonLocatable?: boolean;\r\n /** A planar mask applied to the map geometry\r\n * @beta\r\n */\r\n planarClipMask?: PlanarClipMaskProps;\r\n\r\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\r\n providerName?: never;\r\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\r\n providerData?: never;\r\n}\r\n\r\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\r\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\r\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DeprecatedBackgroundMapProps {\r\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\r\n * Default value: \"BingProvider\"\r\n * @deprecated in 3.x. use MapImageryProps.backgroundBase.\r\n */\r\n providerName?: string;\r\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\r\n * @deprecated in 3.x. use MapImageryProps.backgroundBase\r\n */\r\n providerData?: {\r\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\r\n mapType?: BackgroundMapType;\r\n };\r\n}\r\n\r\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\r\n\r\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\r\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\r\n}\r\n\r\nfunction normalizeTransparency(trans?: number | false): number | false {\r\n if (\"number\" === typeof trans)\r\n return Math.min(1, Math.max(0, trans));\r\n\r\n return false;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\r\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\r\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\r\n * @public\r\n */\r\nexport class BackgroundMapSettings {\r\n /** Retained strictly for persistence. */\r\n private readonly _provider: BackgroundMapProvider;\r\n\r\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\r\n public readonly groundBias: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\r\n public readonly transparency: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n public readonly useDepthBuffer: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n public readonly applyTerrain: boolean;\r\n /** Settings associated with terrain display. */\r\n public readonly terrainSettings: TerrainSettings;\r\n /** Globe display mode. */\r\n public readonly globeMode: GlobeMode;\r\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\r\n * @beta\r\n */\r\n public readonly planarClipMask: PlanarClipMaskSettings;\r\n private readonly _locatable: boolean;\r\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n public get locatable(): boolean {\r\n // Handle legacy TerrainProps.nonLocatable:\r\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\r\n // - Otherwise, use BackgroundMapProps.nonLocatable.\r\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\r\n return false;\r\n\r\n return this._locatable;\r\n }\r\n\r\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\r\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\r\n\r\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\r\n this.groundBias = props.groundBias ?? 0;\r\n this.transparency = normalizeTransparency(props.transparency);\r\n this.useDepthBuffer = props.useDepthBuffer ?? false;\r\n this.applyTerrain = props.applyTerrain ?? false;\r\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\r\n this.globeMode = normalizeGlobeMode(props.globeMode);\r\n this._locatable = true !== props.nonLocatable;\r\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\r\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\r\n }\r\n\r\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\r\n * the iModel - otherwise, prefer [[fromJSON]].\r\n */\r\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\r\n return new this(json ?? {});\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields.\r\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\r\n */\r\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\r\n return new BackgroundMapSettings(json ?? {});\r\n }\r\n\r\n /** Convert these settings to their in-memory JSON representation.\r\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\r\n */\r\n public toJSON(): BackgroundMapProps {\r\n const props: BackgroundMapProps = {};\r\n if (0 !== this.groundBias)\r\n props.groundBias = this.groundBias;\r\n if (this.applyTerrain)\r\n props.applyTerrain = true;\r\n if (false !== this.transparency)\r\n props.transparency = this.transparency;\r\n if (GlobeMode.Ellipsoid !== this.globeMode)\r\n props.globeMode = this.globeMode;\r\n if (this.useDepthBuffer)\r\n props.useDepthBuffer = true;\r\n if (!this._locatable)\r\n props.nonLocatable = true;\r\n\r\n const terrainSettings = this.terrainSettings.toJSON();\r\n for (const prop of Object.values(terrainSettings)) {\r\n if (undefined !== prop) {\r\n props.terrainSettings = terrainSettings;\r\n break;\r\n }\r\n }\r\n\r\n if (this.planarClipMask.isValid)\r\n props.planarClipMask = this.planarClipMask.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\r\n * the iModel - otherwise, prefer [[toJSON]].\r\n */\r\n public toPersistentJSON(): PersistentBackgroundMapProps {\r\n const props = this.toJSON() as PersistentBackgroundMapProps;\r\n\r\n // Preserve deprecated imagery provider properties.\r\n if (\"BingProvider\" !== this._provider.name)\r\n props.providerName = this._provider.name; // eslint-disable-line deprecation/deprecation\r\n if (BackgroundMapType.Hybrid !== this._provider.type)\r\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line deprecation/deprecation\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\r\n public equalsJSON(json?: BackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromJSON(json));\r\n }\r\n\r\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\r\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\r\n }\r\n\r\n /** Returns true if these settings are equivalent to `other`. */\r\n public equals(other: BackgroundMapSettings): boolean {\r\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\r\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\r\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\r\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\r\n }\r\n\r\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n groundBias: changedProps.groundBias ?? this.groundBias,\r\n transparency: changedProps.transparency ?? this.transparency,\r\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\r\n globeMode: changedProps.globeMode ?? this.globeMode,\r\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\r\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\r\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\r\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\r\n providerName: this._provider.name,\r\n providerData: { mapType: this._provider.type },\r\n };\r\n\r\n return BackgroundMapSettings.fromPersistentJSON(props);\r\n }\r\n}\r\n"]}
@@ -166,6 +166,8 @@ export interface UpgradeOptions {
166
166
  readonly domain?: DomainOptions;
167
167
  /** Options that control whether a profile upgrade should be performed when opening a file */
168
168
  readonly profile?: ProfileOptions;
169
+ /** Options that will allow data transform during Profile/Domain schema upgrade */
170
+ readonly schemaLockHeld?: boolean;
169
171
  }
170
172
  /**
171
173
  * The state of the schemas in the Db compared with what the current version of the software expects
@@ -1 +1 @@
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AAgD;IAChD,4DAAa,CAAA;IAEb,gFAAgF;IAChF,mEAAc,CAAA;IAEd,+EAA+E;IAC/E,wEAAqC,CAAA;IAErC;;;;;;;;;;OAUG;IACH,mEAAc,CAAA;AAChB,CAAC,EAzBW,gBAAgB,KAAhB,gBAAgB,QAyB3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,mIAAmI;IACnI,uDAAgB,CAAA;IAChB,0FAA0F;IAC1F,qDAAe,CAAA;IACf,qJAAqJ;IACrJ,+CAAY,CAAA;AACd,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AA6GD;;GAEG;AACH,MAAM,CAAN,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,qJAAqJ;IACrJ,mFAAyB,CAAA;IAEzB,iKAAiK;IACjK,yFAA4B,CAAA;IAE5B,sMAAsM;IACtM,uDAAW,CAAA;IAEX,qFAAqF;IACrF,2DAAa,CAAA;AACf,CAAC,EAZW,aAAa,KAAb,aAAa,QAYxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,0GAA0G;IAC1G,mDAAQ,CAAA;IAER,qDAAqD;IACrD,yDAAW,CAAA;AACb,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAaD;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,sIAAsI;IACtI,qDAAQ,CAAA;IAER;;;OAGG;IACH,mEAAe,CAAA;IAEf,4IAA4I;IAC5I,yEAAkB,CAAA;IAElB,oIAAoI;IACpI,iDAAM,CAAA;IAEN,4FAA4F;IAC5F,iDAAM,CAAA;AACR,CAAC,EAlBW,WAAW,KAAX,WAAW,QAkBtB","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 iModels\r\n */\r\n\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { ChangesetIdWithIndex, LocalFileName } from \"./ChangesetProps\";\r\nimport { IModelEncryptionProps, OpenDbKey } from \"./IModel\";\r\nimport { IModelVersionProps } from \"./IModelVersion\";\r\n\r\n/** The Id assigned to a briefcase by iModelHub, or [[BriefcaseIdValue.Unassigned]] .\r\n * @public\r\n * @extensions\r\n */\r\nexport type BriefcaseId = number;\r\n\r\n/** Values of [[BriefcaseId]] that have special meaning.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BriefcaseIdValue {\r\n /** Indicates an invalid/illegal BriefcaseId */\r\n Illegal = 0xffffffff,\r\n\r\n /** BriefcaseIds must be less than this value */\r\n Max = 1 << 24,\r\n\r\n /** All valid iModelHub issued BriefcaseIds will be equal or higher than this */\r\n FirstValid = 2,\r\n\r\n /** All valid iModelHub issued BriefcaseIds will be equal or lower than this */\r\n LastValid = BriefcaseIdValue.Max - 11,\r\n\r\n /**\r\n * The briefcase has not been assigned a unique Id by iModelHub. Only briefcases that have been assigned a unique BriefcaseId may create changesets,\r\n * because BriefcaseId is used to create unique ElementIds for new elements.\r\n *\r\n * The `Unassigned` briefcaseId is used for several purposes:\r\n * - **Snapshots**. Snapshot files are immutable copies of an iModel for archival or data exchange purposes. They can neither generate nor accept new changesets.\r\n * - **Checkpoints**. Checkpoints are Snapshots that represent a specific version on an iModel's timeline.\r\n * - **PullOnly**. A local briefcase file that may be used to \"slide\" along a timeline by applying incoming changesets.\r\n * They are always opened readonly except to apply changesets.\r\n * - **Standalone**. Standalone iModels are local files that are not connected to iModelHub, and therefore cannot accept or create changesets.\r\n */\r\n Unassigned = 0,\r\n}\r\n\r\n/** Whether a briefcase is editable or may only accept incoming changesets from iModelHub\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SyncMode {\r\n /** Use a fixed version (i.e. a checkpoint). See [CheckpointManager]($backend) for preferred approach to using checkpoint files. */\r\n FixedVersion = 1,\r\n /** A briefcase that can be edited. A unique briefcaseId must be assigned by iModelHub. */\r\n PullAndPush = 2,\r\n /** use [BriefcaseIdValue.Unassigned](%backend). This makes a briefcase that can accept changesets from iModelHub but can never create changesets. */\r\n PullOnly = 3,\r\n}\r\n\r\n/**\r\n * Options to open a previously downloaded briefcase\r\n * @public\r\n */\r\nexport interface OpenBriefcaseOptions {\r\n /** open briefcase Readonly */\r\n readonly openAsReadOnly?: boolean;\r\n}\r\n\r\n/**\r\n * Properties that specify a briefcase within the local briefcase cache.\r\n * @see BriefcaseManager.getFileName\r\n * @public\r\n */\r\nexport interface BriefcaseProps {\r\n /** Id of the iModel */\r\n readonly iModelId: GuidString;\r\n\r\n /** BriefcaseId of the briefcase */\r\n readonly briefcaseId: BriefcaseId;\r\n}\r\n\r\n/** Properties for opening a local briefcase file via [BriefcaseDb.open]($backend)\r\n * @public\r\n */\r\nexport interface OpenBriefcaseProps extends IModelEncryptionProps, OpenDbKey { // eslint-disable-line deprecation/deprecation\r\n /** the full path to the briefcase file */\r\n readonly fileName: LocalFileName;\r\n /** If true, open the briefcase readonly */\r\n readonly readonly?: boolean;\r\n}\r\n\r\n/** Properties of a local briefcase file, returned by [BriefcaseManager.getCachedBriefcases]($backend) and [BriefcaseManager.downloadBriefcase]($backend)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface LocalBriefcaseProps {\r\n /** Full path of local file. */\r\n readonly fileName: LocalFileName;\r\n\r\n /** The iTwin containing the iModel. */\r\n readonly iTwinId: GuidString;\r\n\r\n /** The iModelId. */\r\n readonly iModelId: GuidString;\r\n\r\n /** The briefcaseId. */\r\n readonly briefcaseId: BriefcaseId;\r\n\r\n /** The current changesetId.\r\n * @note ChangeSet Ids are string hash values based on the ChangeSet's content and parent.\r\n */\r\n readonly changeset: ChangesetIdWithIndex;\r\n\r\n /** Size of the briefcase file in bytes */\r\n readonly fileSize: number;\r\n}\r\n\r\n/** Properties for downloading a briefcase to a local file, from iModelHub.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface RequestNewBriefcaseProps {\r\n /** iTwin that the iModel belongs to. */\r\n readonly iTwinId: GuidString;\r\n\r\n /** The iModelId for the new briefcase. */\r\n readonly iModelId: GuidString;\r\n\r\n /** Full path of local file to store the briefcase. If undefined, a file will be created in the briefcase cache, and this member will be filled with the full path to the file.\r\n * Callers can use this to open the briefcase after the download completes.\r\n * @note this member is both an input and an output.\r\n */\r\n readonly fileName?: LocalFileName;\r\n\r\n /**\r\n * The BriefcaseId for the new briefcase. If undefined, a new BriefcaseId will be acquired from iModelHub before the download, and is returned in this member.\r\n * @note To download a briefcase that can accept but not create new changesets (sometimes referred to as \"pull only\" briefcases), set this value to [[BriefcaseIdValue.Unassigned]].\r\n * After downloading, you can merely delete unassigned briefcase files when they are no longer needed. Assigned BriefcaseIds should be released (via [BriefcaseManager.releaseBriefcase]($backend) )\r\n * when you are done with them.\r\n * @note this member is both an input and an output.\r\n *\r\n */\r\n briefcaseId?: BriefcaseId;\r\n\r\n /** Id of the change set of the new briefcase. If undefined, use latest. */\r\n asOf?: IModelVersionProps;\r\n}\r\n\r\n/**\r\n * Manages the download of a briefcase\r\n * @public\r\n */\r\nexport interface BriefcaseDownloader {\r\n /** Id of the briefcase being downloaded */\r\n readonly briefcaseId: BriefcaseId;\r\n\r\n /** the name of the local file for the briefcase */\r\n readonly fileName: LocalFileName;\r\n\r\n /** Promise that resolves when the download completes. await this to complete the download */\r\n readonly downloadPromise: Promise<void>;\r\n\r\n /** Request cancellation of the download */\r\n readonly requestCancel: () => Promise<boolean>;\r\n}\r\n\r\n/** Option to control the validation and upgrade of domain schemas in the Db\r\n * @beta\r\n */\r\nexport enum DomainOptions {\r\n /** Domain schemas will be validated for any required upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\r\n CheckRequiredUpgrades = 0,\r\n\r\n /** Domain schemas will be validated for any required or optional upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\r\n CheckRecommendedUpgrades = 1,\r\n\r\n /** Domain schemas will be upgraded if necessary. However, only compatible schema upgrades will be allowed - these are typically additions of classes, properties, and changes to custom attributes */\r\n Upgrade = 2,\r\n\r\n /** Domain schemas will neither be validated nor be upgraded. Used only internally */\r\n SkipCheck = 3,\r\n}\r\n\r\n/** Options that control whether a profile upgrade should be performed when opening a Db\r\n * @beta\r\n */\r\nexport enum ProfileOptions {\r\n /** No profile upgrade will be performed. If a profile upgrade was required, opening the file will fail */\r\n None = 0,\r\n\r\n /** Profile upgrade will be performed if necessary */\r\n Upgrade = 1,\r\n}\r\n\r\n/** Arguments to validate and update the profile and domain schemas when opening a Db\r\n * @beta\r\n */\r\nexport interface UpgradeOptions {\r\n /** Option to control the validation and upgrade of domain schemas in the Db */\r\n readonly domain?: DomainOptions;\r\n\r\n /** Options that control whether a profile upgrade should be performed when opening a file */\r\n readonly profile?: ProfileOptions;\r\n}\r\n\r\n/**\r\n * The state of the schemas in the Db compared with what the current version of the software expects\r\n * Note: The state may vary depending on whether the Db is to be opened ReadOnly or ReadWrite.\r\n * @beta\r\n */\r\nexport enum SchemaState {\r\n /** The schemas in the Db are up-to-date, and do not need to be upgraded before opening it with the current version of the software */\r\n UpToDate,\r\n\r\n /** It's required that the schemas in the Db be upgraded before it can be opened with the current version of the software.\r\n * This may happen in read-write scenarios where the application requires a newer version of the schemas to be in place before\r\n * it can write data based on that new schema.\r\n */\r\n UpgradeRequired,\r\n\r\n /** It's recommended, but not necessary that the schemas in the Db be upgraded before opening it with the current version of the software */\r\n UpgradeRecommended,\r\n\r\n /** The schemas in the Db are too old to be opened by the current version of the software. Upgrade using the API is not possible. */\r\n TooOld,\r\n\r\n /** The schemas in the Db are too new to be opened by the current version of the software */\r\n TooNew,\r\n}\r\n"]}
1
+ {"version":3,"file":"BriefcaseTypes.js","sourceRoot":"","sources":["../../src/BriefcaseTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAyBX;AAzBD,WAAY,gBAAgB;IAC1B,+CAA+C;IAC/C,sEAAoB,CAAA;IAEpB,gDAAgD;IAChD,4DAAa,CAAA;IAEb,gFAAgF;IAChF,mEAAc,CAAA;IAEd,+EAA+E;IAC/E,wEAAqC,CAAA;IAErC;;;;;;;;;;OAUG;IACH,mEAAc,CAAA;AAChB,CAAC,EAzBW,gBAAgB,KAAhB,gBAAgB,QAyB3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,mIAAmI;IACnI,uDAAgB,CAAA;IAChB,0FAA0F;IAC1F,qDAAe,CAAA;IACf,qJAAqJ;IACrJ,+CAAY,CAAA;AACd,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AA6GD;;GAEG;AACH,MAAM,CAAN,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,qJAAqJ;IACrJ,mFAAyB,CAAA;IAEzB,iKAAiK;IACjK,yFAA4B,CAAA;IAE5B,sMAAsM;IACtM,uDAAW,CAAA;IAEX,qFAAqF;IACrF,2DAAa,CAAA;AACf,CAAC,EAZW,aAAa,KAAb,aAAa,QAYxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,0GAA0G;IAC1G,mDAAQ,CAAA;IAER,qDAAqD;IACrD,yDAAW,CAAA;AACb,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAgBD;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,sIAAsI;IACtI,qDAAQ,CAAA;IAER;;;OAGG;IACH,mEAAe,CAAA;IAEf,4IAA4I;IAC5I,yEAAkB,CAAA;IAElB,oIAAoI;IACpI,iDAAM,CAAA;IAEN,4FAA4F;IAC5F,iDAAM,CAAA;AACR,CAAC,EAlBW,WAAW,KAAX,WAAW,QAkBtB","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 iModels\r\n */\r\n\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { ChangesetIdWithIndex, LocalFileName } from \"./ChangesetProps\";\r\nimport { IModelEncryptionProps, OpenDbKey } from \"./IModel\";\r\nimport { IModelVersionProps } from \"./IModelVersion\";\r\n\r\n/** The Id assigned to a briefcase by iModelHub, or [[BriefcaseIdValue.Unassigned]] .\r\n * @public\r\n * @extensions\r\n */\r\nexport type BriefcaseId = number;\r\n\r\n/** Values of [[BriefcaseId]] that have special meaning.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BriefcaseIdValue {\r\n /** Indicates an invalid/illegal BriefcaseId */\r\n Illegal = 0xffffffff,\r\n\r\n /** BriefcaseIds must be less than this value */\r\n Max = 1 << 24,\r\n\r\n /** All valid iModelHub issued BriefcaseIds will be equal or higher than this */\r\n FirstValid = 2,\r\n\r\n /** All valid iModelHub issued BriefcaseIds will be equal or lower than this */\r\n LastValid = BriefcaseIdValue.Max - 11,\r\n\r\n /**\r\n * The briefcase has not been assigned a unique Id by iModelHub. Only briefcases that have been assigned a unique BriefcaseId may create changesets,\r\n * because BriefcaseId is used to create unique ElementIds for new elements.\r\n *\r\n * The `Unassigned` briefcaseId is used for several purposes:\r\n * - **Snapshots**. Snapshot files are immutable copies of an iModel for archival or data exchange purposes. They can neither generate nor accept new changesets.\r\n * - **Checkpoints**. Checkpoints are Snapshots that represent a specific version on an iModel's timeline.\r\n * - **PullOnly**. A local briefcase file that may be used to \"slide\" along a timeline by applying incoming changesets.\r\n * They are always opened readonly except to apply changesets.\r\n * - **Standalone**. Standalone iModels are local files that are not connected to iModelHub, and therefore cannot accept or create changesets.\r\n */\r\n Unassigned = 0,\r\n}\r\n\r\n/** Whether a briefcase is editable or may only accept incoming changesets from iModelHub\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SyncMode {\r\n /** Use a fixed version (i.e. a checkpoint). See [CheckpointManager]($backend) for preferred approach to using checkpoint files. */\r\n FixedVersion = 1,\r\n /** A briefcase that can be edited. A unique briefcaseId must be assigned by iModelHub. */\r\n PullAndPush = 2,\r\n /** use [BriefcaseIdValue.Unassigned](%backend). This makes a briefcase that can accept changesets from iModelHub but can never create changesets. */\r\n PullOnly = 3,\r\n}\r\n\r\n/**\r\n * Options to open a previously downloaded briefcase\r\n * @public\r\n */\r\nexport interface OpenBriefcaseOptions {\r\n /** open briefcase Readonly */\r\n readonly openAsReadOnly?: boolean;\r\n}\r\n\r\n/**\r\n * Properties that specify a briefcase within the local briefcase cache.\r\n * @see BriefcaseManager.getFileName\r\n * @public\r\n */\r\nexport interface BriefcaseProps {\r\n /** Id of the iModel */\r\n readonly iModelId: GuidString;\r\n\r\n /** BriefcaseId of the briefcase */\r\n readonly briefcaseId: BriefcaseId;\r\n}\r\n\r\n/** Properties for opening a local briefcase file via [BriefcaseDb.open]($backend)\r\n * @public\r\n */\r\nexport interface OpenBriefcaseProps extends IModelEncryptionProps, OpenDbKey { // eslint-disable-line deprecation/deprecation\r\n /** the full path to the briefcase file */\r\n readonly fileName: LocalFileName;\r\n /** If true, open the briefcase readonly */\r\n readonly readonly?: boolean;\r\n}\r\n\r\n/** Properties of a local briefcase file, returned by [BriefcaseManager.getCachedBriefcases]($backend) and [BriefcaseManager.downloadBriefcase]($backend)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface LocalBriefcaseProps {\r\n /** Full path of local file. */\r\n readonly fileName: LocalFileName;\r\n\r\n /** The iTwin containing the iModel. */\r\n readonly iTwinId: GuidString;\r\n\r\n /** The iModelId. */\r\n readonly iModelId: GuidString;\r\n\r\n /** The briefcaseId. */\r\n readonly briefcaseId: BriefcaseId;\r\n\r\n /** The current changesetId.\r\n * @note ChangeSet Ids are string hash values based on the ChangeSet's content and parent.\r\n */\r\n readonly changeset: ChangesetIdWithIndex;\r\n\r\n /** Size of the briefcase file in bytes */\r\n readonly fileSize: number;\r\n}\r\n\r\n/** Properties for downloading a briefcase to a local file, from iModelHub.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface RequestNewBriefcaseProps {\r\n /** iTwin that the iModel belongs to. */\r\n readonly iTwinId: GuidString;\r\n\r\n /** The iModelId for the new briefcase. */\r\n readonly iModelId: GuidString;\r\n\r\n /** Full path of local file to store the briefcase. If undefined, a file will be created in the briefcase cache, and this member will be filled with the full path to the file.\r\n * Callers can use this to open the briefcase after the download completes.\r\n * @note this member is both an input and an output.\r\n */\r\n readonly fileName?: LocalFileName;\r\n\r\n /**\r\n * The BriefcaseId for the new briefcase. If undefined, a new BriefcaseId will be acquired from iModelHub before the download, and is returned in this member.\r\n * @note To download a briefcase that can accept but not create new changesets (sometimes referred to as \"pull only\" briefcases), set this value to [[BriefcaseIdValue.Unassigned]].\r\n * After downloading, you can merely delete unassigned briefcase files when they are no longer needed. Assigned BriefcaseIds should be released (via [BriefcaseManager.releaseBriefcase]($backend) )\r\n * when you are done with them.\r\n * @note this member is both an input and an output.\r\n *\r\n */\r\n briefcaseId?: BriefcaseId;\r\n\r\n /** Id of the change set of the new briefcase. If undefined, use latest. */\r\n asOf?: IModelVersionProps;\r\n}\r\n\r\n/**\r\n * Manages the download of a briefcase\r\n * @public\r\n */\r\nexport interface BriefcaseDownloader {\r\n /** Id of the briefcase being downloaded */\r\n readonly briefcaseId: BriefcaseId;\r\n\r\n /** the name of the local file for the briefcase */\r\n readonly fileName: LocalFileName;\r\n\r\n /** Promise that resolves when the download completes. await this to complete the download */\r\n readonly downloadPromise: Promise<void>;\r\n\r\n /** Request cancellation of the download */\r\n readonly requestCancel: () => Promise<boolean>;\r\n}\r\n\r\n/** Option to control the validation and upgrade of domain schemas in the Db\r\n * @beta\r\n */\r\nexport enum DomainOptions {\r\n /** Domain schemas will be validated for any required upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\r\n CheckRequiredUpgrades = 0,\r\n\r\n /** Domain schemas will be validated for any required or optional upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\r\n CheckRecommendedUpgrades = 1,\r\n\r\n /** Domain schemas will be upgraded if necessary. However, only compatible schema upgrades will be allowed - these are typically additions of classes, properties, and changes to custom attributes */\r\n Upgrade = 2,\r\n\r\n /** Domain schemas will neither be validated nor be upgraded. Used only internally */\r\n SkipCheck = 3,\r\n}\r\n\r\n/** Options that control whether a profile upgrade should be performed when opening a Db\r\n * @beta\r\n */\r\nexport enum ProfileOptions {\r\n /** No profile upgrade will be performed. If a profile upgrade was required, opening the file will fail */\r\n None = 0,\r\n\r\n /** Profile upgrade will be performed if necessary */\r\n Upgrade = 1,\r\n}\r\n\r\n/** Arguments to validate and update the profile and domain schemas when opening a Db\r\n * @beta\r\n */\r\nexport interface UpgradeOptions {\r\n /** Option to control the validation and upgrade of domain schemas in the Db */\r\n readonly domain?: DomainOptions;\r\n\r\n /** Options that control whether a profile upgrade should be performed when opening a file */\r\n readonly profile?: ProfileOptions;\r\n\r\n /** Options that will allow data transform during Profile/Domain schema upgrade */\r\n readonly schemaLockHeld?: boolean;\r\n}\r\n\r\n/**\r\n * The state of the schemas in the Db compared with what the current version of the software expects\r\n * Note: The state may vary depending on whether the Db is to be opened ReadOnly or ReadWrite.\r\n * @beta\r\n */\r\nexport enum SchemaState {\r\n /** The schemas in the Db are up-to-date, and do not need to be upgraded before opening it with the current version of the software */\r\n UpToDate,\r\n\r\n /** It's required that the schemas in the Db be upgraded before it can be opened with the current version of the software.\r\n * This may happen in read-write scenarios where the application requires a newer version of the schemas to be in place before\r\n * it can write data based on that new schema.\r\n */\r\n UpgradeRequired,\r\n\r\n /** It's recommended, but not necessary that the schemas in the Db be upgraded before opening it with the current version of the software */\r\n UpgradeRecommended,\r\n\r\n /** The schemas in the Db are too old to be opened by the current version of the software. Upgrade using the API is not possible. */\r\n TooOld,\r\n\r\n /** The schemas in the Db are too new to be opened by the current version of the software */\r\n TooNew,\r\n}\r\n"]}