@itwin/core-common 4.6.0-dev.22 → 4.6.0-dev.24

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 (423) hide show
  1. package/lib/cjs/AmbientOcclusion.js +1 -1
  2. package/lib/cjs/AmbientOcclusion.js.map +1 -1
  3. package/lib/cjs/AnalysisStyle.js +1 -1
  4. package/lib/cjs/AnalysisStyle.js.map +1 -1
  5. package/lib/cjs/Atmosphere.js +12 -12
  6. package/lib/cjs/Atmosphere.js.map +1 -1
  7. package/lib/cjs/BackgroundMapProvider.js +1 -1
  8. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  9. package/lib/cjs/BackgroundMapSettings.js +1 -1
  10. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  11. package/lib/cjs/Base64EncodedString.js +1 -1
  12. package/lib/cjs/Base64EncodedString.js.map +1 -1
  13. package/lib/cjs/BlobReader.js.map +1 -1
  14. package/lib/cjs/BriefcaseTypes.js +5 -5
  15. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  16. package/lib/cjs/Camera.js.map +1 -1
  17. package/lib/cjs/ChangedElements.js +1 -1
  18. package/lib/cjs/ChangedElements.js.map +1 -1
  19. package/lib/cjs/ChangesetProps.js +1 -1
  20. package/lib/cjs/ChangesetProps.js.map +1 -1
  21. package/lib/cjs/ClipStyle.js +3 -3
  22. package/lib/cjs/ClipStyle.js.map +1 -1
  23. package/lib/cjs/Code.d.ts +1 -0
  24. package/lib/cjs/Code.d.ts.map +1 -1
  25. package/lib/cjs/Code.js +3 -2
  26. package/lib/cjs/Code.js.map +1 -1
  27. package/lib/cjs/ColorDef.js +1 -1
  28. package/lib/cjs/ColorDef.js.map +1 -1
  29. package/lib/cjs/CommonLoggerCategory.js +1 -1
  30. package/lib/cjs/CommonLoggerCategory.js.map +1 -1
  31. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  32. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  33. package/lib/cjs/ConcurrentQuery.js +6 -6
  34. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  35. package/lib/cjs/ContextRealityModel.js +5 -5
  36. package/lib/cjs/ContextRealityModel.js.map +1 -1
  37. package/lib/cjs/DisplayStyleSettings.js +1 -1
  38. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  39. package/lib/cjs/ECSqlReader.js +1 -1
  40. package/lib/cjs/ECSqlReader.js.map +1 -1
  41. package/lib/cjs/ECSqlTypes.js +4 -4
  42. package/lib/cjs/ECSqlTypes.js.map +1 -1
  43. package/lib/cjs/ElementMesh.js.map +1 -1
  44. package/lib/cjs/ElementProps.js +4 -4
  45. package/lib/cjs/ElementProps.js.map +1 -1
  46. package/lib/cjs/EmphasizeElementsProps.js +1 -1
  47. package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
  48. package/lib/cjs/EntityProps.d.ts +5 -2
  49. package/lib/cjs/EntityProps.d.ts.map +1 -1
  50. package/lib/cjs/EntityProps.js +2 -1
  51. package/lib/cjs/EntityProps.js.map +1 -1
  52. package/lib/cjs/EntityReference.js +2 -2
  53. package/lib/cjs/EntityReference.js.map +1 -1
  54. package/lib/cjs/Environment.js +1 -1
  55. package/lib/cjs/Environment.js.map +1 -1
  56. package/lib/cjs/FeatureIndex.js +1 -1
  57. package/lib/cjs/FeatureIndex.js.map +1 -1
  58. package/lib/cjs/FeatureSymbology.js +3 -3
  59. package/lib/cjs/FeatureSymbology.js.map +1 -1
  60. package/lib/cjs/FeatureTable.js +3 -3
  61. package/lib/cjs/FeatureTable.js.map +1 -1
  62. package/lib/cjs/Fonts.js +1 -1
  63. package/lib/cjs/Fonts.js.map +1 -1
  64. package/lib/cjs/Frustum.d.ts.map +1 -1
  65. package/lib/cjs/Frustum.js +3 -1
  66. package/lib/cjs/Frustum.js.map +1 -1
  67. package/lib/cjs/GenericInstanceFilter.js +2 -2
  68. package/lib/cjs/GenericInstanceFilter.js.map +1 -1
  69. package/lib/cjs/GeoCoordinateServices.js +1 -1
  70. package/lib/cjs/GeoCoordinateServices.js.map +1 -1
  71. package/lib/cjs/GeometryParams.js +3 -3
  72. package/lib/cjs/GeometryParams.js.map +1 -1
  73. package/lib/cjs/GeometrySummary.js +1 -1
  74. package/lib/cjs/GeometrySummary.js.map +1 -1
  75. package/lib/cjs/Gradient.js +5 -5
  76. package/lib/cjs/Gradient.js.map +1 -1
  77. package/lib/cjs/GraphicParams.js +1 -1
  78. package/lib/cjs/GraphicParams.js.map +1 -1
  79. package/lib/cjs/GroundPlane.js +1 -1
  80. package/lib/cjs/GroundPlane.js.map +1 -1
  81. package/lib/cjs/HSVColor.js +1 -1
  82. package/lib/cjs/HSVColor.js.map +1 -1
  83. package/lib/cjs/HiddenLine.js +1 -1
  84. package/lib/cjs/HiddenLine.js.map +1 -1
  85. package/lib/cjs/Hilite.js +1 -1
  86. package/lib/cjs/Hilite.js.map +1 -1
  87. package/lib/cjs/IModel.js +1 -1
  88. package/lib/cjs/IModel.js.map +1 -1
  89. package/lib/cjs/IModelVersion.js.map +1 -1
  90. package/lib/cjs/Image.js +2 -2
  91. package/lib/cjs/Image.js.map +1 -1
  92. package/lib/cjs/IpcAppProps.d.ts +24 -2
  93. package/lib/cjs/IpcAppProps.d.ts.map +1 -1
  94. package/lib/cjs/IpcAppProps.js.map +1 -1
  95. package/lib/cjs/LightSettings.js +1 -1
  96. package/lib/cjs/LightSettings.js.map +1 -1
  97. package/lib/cjs/LinePixels.js +1 -1
  98. package/lib/cjs/LinePixels.js.map +1 -1
  99. package/lib/cjs/Localization.js.map +1 -1
  100. package/lib/cjs/MapImagerySettings.js +1 -1
  101. package/lib/cjs/MapImagerySettings.js.map +1 -1
  102. package/lib/cjs/MapLayerSettings.js.map +1 -1
  103. package/lib/cjs/MassProperties.js +1 -1
  104. package/lib/cjs/MassProperties.js.map +1 -1
  105. package/lib/cjs/MaterialProps.js +2 -2
  106. package/lib/cjs/MaterialProps.js.map +1 -1
  107. package/lib/cjs/ModelGeometryChanges.js +2 -2
  108. package/lib/cjs/ModelGeometryChanges.js.map +1 -1
  109. package/lib/cjs/NativeAppProps.js +2 -2
  110. package/lib/cjs/NativeAppProps.js.map +1 -1
  111. package/lib/cjs/OctEncodedNormal.js.map +1 -1
  112. package/lib/cjs/PlanarClipMask.js +3 -3
  113. package/lib/cjs/PlanarClipMask.js.map +1 -1
  114. package/lib/cjs/QPoint.js +3 -3
  115. package/lib/cjs/QPoint.js.map +1 -1
  116. package/lib/cjs/RealityDataAccessProps.d.ts +4 -4
  117. package/lib/cjs/RealityDataAccessProps.d.ts.map +1 -1
  118. package/lib/cjs/RealityDataAccessProps.js +1 -1
  119. package/lib/cjs/RealityDataAccessProps.js.map +1 -1
  120. package/lib/cjs/RealityModelDisplaySettings.js +2 -2
  121. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  122. package/lib/cjs/Render.d.ts +2 -2
  123. package/lib/cjs/Render.d.ts.map +1 -1
  124. package/lib/cjs/Render.js +1 -1
  125. package/lib/cjs/Render.js.map +1 -1
  126. package/lib/cjs/RenderMaterial.js +1 -1
  127. package/lib/cjs/RenderMaterial.js.map +1 -1
  128. package/lib/cjs/RenderSchedule.js +1 -1
  129. package/lib/cjs/RenderSchedule.js.map +1 -1
  130. package/lib/cjs/RenderTexture.js +1 -1
  131. package/lib/cjs/RenderTexture.js.map +1 -1
  132. package/lib/cjs/RgbColor.js.map +1 -1
  133. package/lib/cjs/RpcInterface.js.map +1 -1
  134. package/lib/cjs/SkyBox.js +3 -3
  135. package/lib/cjs/SkyBox.js.map +1 -1
  136. package/lib/cjs/SolarCalculate.js.map +1 -1
  137. package/lib/cjs/SolarShadows.js +1 -1
  138. package/lib/cjs/SolarShadows.js.map +1 -1
  139. package/lib/cjs/SpatialClassification.js +2 -2
  140. package/lib/cjs/SpatialClassification.js.map +1 -1
  141. package/lib/cjs/SubCategoryAppearance.js +1 -1
  142. package/lib/cjs/SubCategoryAppearance.js.map +1 -1
  143. package/lib/cjs/SubCategoryOverride.js +1 -1
  144. package/lib/cjs/SubCategoryOverride.js.map +1 -1
  145. package/lib/cjs/TerrainSettings.js +2 -2
  146. package/lib/cjs/TerrainSettings.js.map +1 -1
  147. package/lib/cjs/TextureMapping.js +1 -1
  148. package/lib/cjs/TextureMapping.js.map +1 -1
  149. package/lib/cjs/TextureProps.js +1 -1
  150. package/lib/cjs/TextureProps.js.map +1 -1
  151. package/lib/cjs/ThematicDisplay.js +5 -5
  152. package/lib/cjs/ThematicDisplay.js.map +1 -1
  153. package/lib/cjs/TileProps.js +1 -1
  154. package/lib/cjs/TileProps.js.map +1 -1
  155. package/lib/cjs/Tween.js.map +1 -1
  156. package/lib/cjs/TxnAction.js +1 -1
  157. package/lib/cjs/TxnAction.js.map +1 -1
  158. package/lib/cjs/ViewDetails.js +2 -2
  159. package/lib/cjs/ViewDetails.js.map +1 -1
  160. package/lib/cjs/ViewFlags.js +2 -2
  161. package/lib/cjs/ViewFlags.js.map +1 -1
  162. package/lib/cjs/ViewProps.js +1 -1
  163. package/lib/cjs/ViewProps.js.map +1 -1
  164. package/lib/cjs/WhiteOnWhiteReversalSettings.js +1 -1
  165. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  166. package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
  167. package/lib/cjs/annotation/TextBlock.js +1 -1
  168. package/lib/cjs/annotation/TextBlock.js.map +1 -1
  169. package/lib/cjs/annotation/TextStyle.js +1 -1
  170. package/lib/cjs/annotation/TextStyle.js.map +1 -1
  171. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  172. package/lib/cjs/geometry/AreaPattern.js +1 -1
  173. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  174. package/lib/cjs/geometry/Cartographic.js +1 -1
  175. package/lib/cjs/geometry/Cartographic.js.map +1 -1
  176. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  177. package/lib/cjs/geometry/ElementGeometry.js +3 -3
  178. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  179. package/lib/cjs/geometry/ElementGeometryFB.js +1 -1
  180. package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
  181. package/lib/cjs/geometry/FrustumPlanes.js +5 -5
  182. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  183. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  184. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  185. package/lib/cjs/geometry/GeometryStream.js +2 -2
  186. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  187. package/lib/cjs/geometry/LineStyle.js +1 -1
  188. package/lib/cjs/geometry/LineStyle.js.map +1 -1
  189. package/lib/cjs/geometry/Projection.js.map +1 -1
  190. package/lib/cjs/geometry/TextString.js.map +1 -1
  191. package/lib/cjs/ipc/IpcWebSocket.js +3 -3
  192. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  193. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  194. package/lib/cjs/rpc/DevToolsRpcInterface.js +2 -2
  195. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  196. package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
  197. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  198. package/lib/cjs/rpc/IModelTileRpcInterface.js +1 -1
  199. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  200. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +1 -1
  201. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  202. package/lib/cjs/rpc/WipRpcInterface.js +1 -1
  203. package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
  204. package/lib/cjs/rpc/core/RpcConfiguration.js +6 -6
  205. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  206. package/lib/cjs/rpc/core/RpcConstants.js +7 -7
  207. package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
  208. package/lib/cjs/rpc/core/RpcControl.js +1 -1
  209. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  210. package/lib/cjs/rpc/core/RpcInvocation.js +3 -3
  211. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  212. package/lib/cjs/rpc/core/RpcMarshaling.js +2 -2
  213. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  214. package/lib/cjs/rpc/core/RpcOperation.js +2 -3
  215. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  216. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  217. package/lib/cjs/rpc/core/RpcProtocol.js +3 -3
  218. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  219. package/lib/cjs/rpc/core/RpcPush.js +2 -2
  220. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  221. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  222. package/lib/cjs/rpc/core/RpcRequest.js +1 -1
  223. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  224. package/lib/cjs/rpc/core/RpcRoutingToken.js +1 -1
  225. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  226. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +1 -1
  227. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  228. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  229. package/lib/cjs/rpc/web/RpcMultipart.js +1 -1
  230. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  231. package/lib/cjs/rpc/web/WebAppRpcLogging.js +8 -8
  232. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  233. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  234. package/lib/cjs/rpc/web/WebAppRpcRequest.js +3 -3
  235. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  236. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  237. package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
  238. package/lib/cjs/tile/GltfTileIO.js +2 -2
  239. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  240. package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
  241. package/lib/cjs/tile/IModelTileIO.js +3 -3
  242. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  243. package/lib/cjs/tile/TileIO.d.ts +6 -6
  244. package/lib/cjs/tile/TileIO.d.ts.map +1 -1
  245. package/lib/cjs/tile/TileIO.js +2 -2
  246. package/lib/cjs/tile/TileIO.js.map +1 -1
  247. package/lib/cjs/tile/TileMetadata.d.ts +3 -3
  248. package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
  249. package/lib/cjs/tile/TileMetadata.js +3 -3
  250. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  251. package/lib/cjs/tile/Tileset3dSchema.d.ts.map +1 -1
  252. package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
  253. package/lib/esm/AnalysisStyle.js +1 -2
  254. package/lib/esm/AnalysisStyle.js.map +1 -1
  255. package/lib/esm/Atmosphere.js +11 -11
  256. package/lib/esm/Atmosphere.js.map +1 -1
  257. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  258. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  259. package/lib/esm/BlobReader.js.map +1 -1
  260. package/lib/esm/Camera.js.map +1 -1
  261. package/lib/esm/ClipStyle.js +3 -6
  262. package/lib/esm/ClipStyle.js.map +1 -1
  263. package/lib/esm/Code.d.ts +1 -0
  264. package/lib/esm/Code.d.ts.map +1 -1
  265. package/lib/esm/Code.js +1 -0
  266. package/lib/esm/Code.js.map +1 -1
  267. package/lib/esm/ColorDef.js +1 -2
  268. package/lib/esm/ColorDef.js.map +1 -1
  269. package/lib/esm/ConcurrentQuery.d.ts +11 -11
  270. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  271. package/lib/esm/ConcurrentQuery.js.map +1 -1
  272. package/lib/esm/ContextRealityModel.js.map +1 -1
  273. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  274. package/lib/esm/ECSqlReader.js +1 -2
  275. package/lib/esm/ECSqlReader.js.map +1 -1
  276. package/lib/esm/ECSqlTypes.js.map +1 -1
  277. package/lib/esm/ElementMesh.js.map +1 -1
  278. package/lib/esm/ElementProps.js +1 -2
  279. package/lib/esm/ElementProps.js.map +1 -1
  280. package/lib/esm/EntityProps.d.ts +5 -2
  281. package/lib/esm/EntityProps.d.ts.map +1 -1
  282. package/lib/esm/EntityProps.js +1 -0
  283. package/lib/esm/EntityProps.js.map +1 -1
  284. package/lib/esm/Environment.js +1 -2
  285. package/lib/esm/Environment.js.map +1 -1
  286. package/lib/esm/FeatureSymbology.js +2 -4
  287. package/lib/esm/FeatureSymbology.js.map +1 -1
  288. package/lib/esm/FeatureTable.js.map +1 -1
  289. package/lib/esm/Frustum.d.ts.map +1 -1
  290. package/lib/esm/Frustum.js +2 -0
  291. package/lib/esm/Frustum.js.map +1 -1
  292. package/lib/esm/GeoCoordinateServices.js.map +1 -1
  293. package/lib/esm/GeometryParams.js.map +1 -1
  294. package/lib/esm/Gradient.js +4 -4
  295. package/lib/esm/Gradient.js.map +1 -1
  296. package/lib/esm/GroundPlane.js +1 -2
  297. package/lib/esm/GroundPlane.js.map +1 -1
  298. package/lib/esm/HSVColor.js.map +1 -1
  299. package/lib/esm/HiddenLine.js.map +1 -1
  300. package/lib/esm/IModel.js +1 -2
  301. package/lib/esm/IModel.js.map +1 -1
  302. package/lib/esm/IModelVersion.js.map +1 -1
  303. package/lib/esm/Image.js.map +1 -1
  304. package/lib/esm/IpcAppProps.d.ts +24 -2
  305. package/lib/esm/IpcAppProps.d.ts.map +1 -1
  306. package/lib/esm/IpcAppProps.js.map +1 -1
  307. package/lib/esm/LightSettings.js +1 -2
  308. package/lib/esm/LightSettings.js.map +1 -1
  309. package/lib/esm/Localization.js.map +1 -1
  310. package/lib/esm/MapImagerySettings.js.map +1 -1
  311. package/lib/esm/MapLayerSettings.js.map +1 -1
  312. package/lib/esm/ModelGeometryChanges.js.map +1 -1
  313. package/lib/esm/OctEncodedNormal.js.map +1 -1
  314. package/lib/esm/PlanarClipMask.js +1 -2
  315. package/lib/esm/PlanarClipMask.js.map +1 -1
  316. package/lib/esm/QPoint.js.map +1 -1
  317. package/lib/esm/RealityDataAccessProps.d.ts +4 -4
  318. package/lib/esm/RealityDataAccessProps.d.ts.map +1 -1
  319. package/lib/esm/RealityModelDisplaySettings.js +2 -4
  320. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  321. package/lib/esm/Render.d.ts +2 -2
  322. package/lib/esm/Render.d.ts.map +1 -1
  323. package/lib/esm/Render.js.map +1 -1
  324. package/lib/esm/RenderSchedule.js.map +1 -1
  325. package/lib/esm/RgbColor.js.map +1 -1
  326. package/lib/esm/RpcInterface.js.map +1 -1
  327. package/lib/esm/SkyBox.js +2 -4
  328. package/lib/esm/SkyBox.js.map +1 -1
  329. package/lib/esm/SolarCalculate.js.map +1 -1
  330. package/lib/esm/SolarShadows.js +1 -2
  331. package/lib/esm/SolarShadows.js.map +1 -1
  332. package/lib/esm/SpatialClassification.js.map +1 -1
  333. package/lib/esm/SubCategoryAppearance.js +1 -2
  334. package/lib/esm/SubCategoryAppearance.js.map +1 -1
  335. package/lib/esm/SubCategoryOverride.js +1 -2
  336. package/lib/esm/SubCategoryOverride.js.map +1 -1
  337. package/lib/esm/TerrainSettings.js.map +1 -1
  338. package/lib/esm/TextureMapping.js.map +1 -1
  339. package/lib/esm/ThematicDisplay.js +1 -2
  340. package/lib/esm/ThematicDisplay.js.map +1 -1
  341. package/lib/esm/Tween.js.map +1 -1
  342. package/lib/esm/ViewDetails.js +1 -2
  343. package/lib/esm/ViewDetails.js.map +1 -1
  344. package/lib/esm/ViewFlags.js +1 -2
  345. package/lib/esm/ViewFlags.js.map +1 -1
  346. package/lib/esm/WhiteOnWhiteReversalSettings.js +1 -2
  347. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  348. package/lib/esm/annotation/TextAnnotation.js.map +1 -1
  349. package/lib/esm/annotation/TextBlock.js.map +1 -1
  350. package/lib/esm/annotation/TextStyle.js +1 -2
  351. package/lib/esm/annotation/TextStyle.js.map +1 -1
  352. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  353. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  354. package/lib/esm/geometry/Cartographic.js +1 -2
  355. package/lib/esm/geometry/Cartographic.js.map +1 -1
  356. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  357. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  358. package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
  359. package/lib/esm/geometry/FrustumPlanes.js +4 -4
  360. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  361. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  362. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  363. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  364. package/lib/esm/geometry/LineStyle.js.map +1 -1
  365. package/lib/esm/geometry/Projection.js.map +1 -1
  366. package/lib/esm/geometry/TextString.js.map +1 -1
  367. package/lib/esm/ipc/IpcWebSocket.js +1 -2
  368. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  369. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  370. package/lib/esm/rpc/DevToolsRpcInterface.js +1 -2
  371. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  372. package/lib/esm/rpc/IModelReadRpcInterface.js +1 -2
  373. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  374. package/lib/esm/rpc/IModelTileRpcInterface.js +1 -2
  375. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  376. package/lib/esm/rpc/SnapshotIModelRpcInterface.js +1 -2
  377. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  378. package/lib/esm/rpc/WipRpcInterface.js +1 -2
  379. package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
  380. package/lib/esm/rpc/core/RpcConfiguration.js +5 -6
  381. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  382. package/lib/esm/rpc/core/RpcControl.js +1 -2
  383. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  384. package/lib/esm/rpc/core/RpcInvocation.js +3 -4
  385. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  386. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  387. package/lib/esm/rpc/core/RpcOperation.js +1 -2
  388. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  389. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  390. package/lib/esm/rpc/core/RpcProtocol.js +1 -2
  391. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  392. package/lib/esm/rpc/core/RpcPush.js +2 -4
  393. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  394. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  395. package/lib/esm/rpc/core/RpcRequest.js +1 -2
  396. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  397. package/lib/esm/rpc/core/RpcRoutingToken.js +1 -2
  398. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  399. package/lib/esm/rpc/web/BentleyCloudRpcManager.js +1 -2
  400. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  401. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  402. package/lib/esm/rpc/web/RpcMultipart.js +1 -2
  403. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  404. package/lib/esm/rpc/web/WebAppRpcLogging.js +8 -8
  405. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  406. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  407. package/lib/esm/rpc/web/WebAppRpcRequest.js +3 -4
  408. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  409. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  410. package/lib/esm/tile/B3dmTileIO.js.map +1 -1
  411. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  412. package/lib/esm/tile/I3dmTileIO.js.map +1 -1
  413. package/lib/esm/tile/IModelTileIO.js +1 -2
  414. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  415. package/lib/esm/tile/TileIO.d.ts +6 -6
  416. package/lib/esm/tile/TileIO.d.ts.map +1 -1
  417. package/lib/esm/tile/TileIO.js.map +1 -1
  418. package/lib/esm/tile/TileMetadata.d.ts +3 -3
  419. package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
  420. package/lib/esm/tile/TileMetadata.js.map +1 -1
  421. package/lib/esm/tile/Tileset3dSchema.d.ts.map +1 -1
  422. package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
  423. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAsDH;;;;;GAKG;AACH,MAAM,OAAgB,kBAAkB;IAItC,gBAAgB;IAChB,YAAsB,KAA8B;QAClD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAW,SAAS,CAAC,SAAiB;QACpC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,cAAc,CAAC,SAAiC;QACzD,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;IAC1C,CAAC;IAED,8EAA8E;IACvE,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AAC,MAAM,EAAE;YAClI,OAAO,KAAK,CAAC;SACd;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChG,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 Annotation\r\n */\r\n\r\nimport { TextStyleSettingsProps } from \"./TextStyle\";\r\n\r\n/** Options supplied to [[TextBlockComponent.applyStyle]] to control how the style is applied to the component and its child components.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface ApplyTextStyleOptions {\r\n /** Controls whether any deviations from the style's settings stored in [[TextBlockComponent.styleOverrides]] are retained.\r\n * By default, all overrides are cleared.\r\n */\r\n preserveOverrides?: boolean;\r\n /** Controls whether the style should be recursively applied to the [[Paragraph]]s belonging to a [[TextBlock]] and the [[Run]]s belonging to a [[Paragraph]].\r\n * By default, the style change propagates to child components.\r\n */\r\n preventPropagation?: boolean;\r\n}\r\n\r\n/** The JSON representation of a [[TextBlockComponent]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextBlockComponentProps {\r\n /** The name of a [[TextStyle]] stored in a [Workspace]($backend) from which the base [[TextStyleSettings]] applied to the component originates. */\r\n styleName: string;\r\n /** Deviations from the base [[TextStyleSettings]] defined by the [[TextStyle]] applied to this component.\r\n * This permits you to, e.g., create a [[TextRun]] using \"Arial\" font and override it to use \"Comic Sans\" instead.\r\n */\r\n styleOverrides?: TextStyleSettingsProps;\r\n}\r\n\r\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextBlockStringifyOptions {\r\n /** A string to insert in between each [[Paragraph]].\r\n * Default: \" \" - a single space.\r\n */\r\n paragraphBreak?: string;\r\n /** A string to insert for each [[LineBreakRun]].\r\n * Default: \" \" - a single space.\r\n */\r\n lineBreak?: string;\r\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\r\n * Default: \"/\"\r\n */\r\n fractionSeparator?: string;\r\n}\r\n\r\n/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.\r\n * Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport abstract class TextBlockComponent {\r\n private _styleName: string;\r\n private _styleOverrides: TextStyleSettingsProps;\r\n\r\n /** @internal */\r\n protected constructor(props: TextBlockComponentProps) {\r\n this._styleName = props.styleName;\r\n this._styleOverrides = { ...props.styleOverrides };\r\n }\r\n\r\n /** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.\r\n * @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of\r\n * the components sub-components and clears any [[styleOverrides]].\r\n */\r\n public get styleName(): string {\r\n return this._styleName;\r\n }\r\n\r\n public set styleName(styleName: string) {\r\n this.applyStyle(styleName);\r\n }\r\n\r\n /** Deviations in individual properties of the [[TextStyle]] specified by [[styleName]].\r\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.fontName` to \"Comic Sans\".\r\n * @see [[clearStyleOverrides]] to reset this to an empty object.\r\n */\r\n public get styleOverrides(): TextStyleSettingsProps {\r\n return this._styleOverrides;\r\n }\r\n\r\n public set styleOverrides(overrides: TextStyleSettingsProps) {\r\n this._styleOverrides = { ...overrides };\r\n }\r\n\r\n /** Reset any [[styleOverrides]] applied to this component's [[TextStyle]]. */\r\n public clearStyleOverrides(): void {\r\n this.styleOverrides = { };\r\n }\r\n\r\n /** Apply the [[TextStyle]] specified by `styleName` to this component, optionally preserving [[styleOverrides]] and/or preventing propagation to sub-components. */\r\n public applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\r\n this._styleName = styleName;\r\n\r\n if (!(options?.preserveOverrides)) {\r\n this.clearStyleOverrides();\r\n }\r\n }\r\n\r\n /** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */\r\n public get overridesStyle(): boolean {\r\n return Object.keys(this.styleOverrides).length > 0;\r\n }\r\n\r\n /** Create a deep copy of this component. */\r\n public abstract clone(): TextBlockComponent;\r\n\r\n /** Compute a string representation of the contents of this component and all of its sub-components. */\r\n public abstract stringify(options?: TextBlockStringifyOptions): string;\r\n\r\n /** Convert this component to its JSON representation. */\r\n public toJSON(): TextBlockComponentProps {\r\n return {\r\n styleName: this.styleName,\r\n styleOverrides: { ...this.styleOverrides },\r\n };\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: TextBlockComponent): boolean {\r\n const myKeys = Object.keys(this.styleOverrides);\r\n const yrKeys = Object.keys(other._styleOverrides);\r\n if (this.styleName !== other.styleName || myKeys.length !== yrKeys.length) {\r\n return false;\r\n }\r\n\r\n for (const name of myKeys) {\r\n const key = name as keyof TextStyleSettingsProps;\r\n if (this.styleOverrides[key] !== other.styleOverrides[key]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type Run = TextRun | FractionRun | LineBreakRun;\r\n\r\n/** The JSON representation of a [[Run]].\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type RunProps = TextRunProps | FractionRunProps | LineBreakRunProps;\r\n\r\n/** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span\r\n * multiple lines, but it will never contain different styling.\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create a run from its JSON representation.\r\n * @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.\r\n */\r\n export function fromJSON(props: RunProps): Run {\r\n switch (props.type) {\r\n case \"text\": return TextRun.create(props);\r\n case \"fraction\": return FractionRun.create(props);\r\n case \"linebreak\": return LineBreakRun.create(props);\r\n }\r\n }\r\n}\r\n\r\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\r\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\r\n * affect how the content is rendered.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\r\n\r\n/** JSON representation of a [[TextRun]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"text\";\r\n /** The characters displayed by the run.\r\n * Default: an empty string.\r\n */\r\n content?: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally.\r\n * Default: \"none\"\r\n */\r\n baselineShift?: BaselineShift;\r\n}\r\n\r\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"text\";\r\n /** The sequence of characters to be displayed by the run. */\r\n public content: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\r\n public baselineShift: BaselineShift;\r\n\r\n private constructor(props: Omit<TextRunProps, \"type\">) {\r\n super(props);\r\n this.content = props.content ?? \"\";\r\n this.baselineShift = props.baselineShift ?? \"none\";\r\n }\r\n\r\n public override clone(): TextRun {\r\n return new TextRun(this.toJSON());\r\n }\r\n\r\n public override toJSON(): TextRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"text\",\r\n content: this.content,\r\n baselineShift: this.baselineShift,\r\n };\r\n }\r\n\r\n public static create(props: Omit<TextRunProps, \"type\">): TextRun {\r\n return new TextRun(props);\r\n }\r\n\r\n /** Simply returns [[content]]. */\r\n public override stringify(): string {\r\n return this.content;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FractionRun]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface FractionRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"fraction\";\r\n /** The text displayed before or above the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\r\n numerator?: string;\r\n /** The text displayed after or below the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\r\n denominator?: string;\r\n}\r\n\r\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\r\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class FractionRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"fraction\";\r\n /** The fraction's numerator. */\r\n public numerator: string;\r\n /** The fraction's denominator. */\r\n public denominator: string;\r\n\r\n private constructor(props: Omit<FractionRunProps, \"type\">) {\r\n super(props);\r\n this.numerator = props.numerator ?? \"\";\r\n this.denominator = props.denominator ?? \"\";\r\n }\r\n\r\n public override toJSON(): FractionRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"fraction\",\r\n numerator: this.numerator,\r\n denominator: this.denominator,\r\n };\r\n }\r\n\r\n public override clone(): FractionRun {\r\n return new FractionRun(this.toJSON());\r\n }\r\n\r\n public static create(props: Omit<FractionRunProps, \"type\">): FractionRun {\r\n return new FractionRun(props);\r\n }\r\n\r\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n const sep = options?.fractionSeparator ?? \"/\";\r\n return `${this.numerator}${sep}${this.denominator}`;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[LineBreakRun]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface LineBreakRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"linebreak\";\r\n}\r\n\r\n/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class LineBreakRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"linebreak\";\r\n\r\n private constructor(props: TextBlockComponentProps) {\r\n super(props);\r\n }\r\n\r\n public override toJSON(): LineBreakRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"linebreak\",\r\n };\r\n }\r\n\r\n public static create(props: TextBlockComponentProps) {\r\n return new LineBreakRun(props);\r\n }\r\n\r\n public override clone(): LineBreakRun {\r\n return new LineBreakRun(this.toJSON());\r\n }\r\n\r\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n return options?.lineBreak ?? \" \";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof LineBreakRun && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[Paragraph]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface ParagraphProps extends TextBlockComponentProps {\r\n /** The collection of [[Run]]s within the paragraph.\r\n * Default: an empty array.\r\n */\r\n runs?: RunProps[];\r\n}\r\n\r\n/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class Paragraph extends TextBlockComponent {\r\n /** The runs within the paragraph. You can modify the contents of this array to change the content of the paragraph. */\r\n public readonly runs: Run[];\r\n\r\n private constructor(props: ParagraphProps) {\r\n super(props);\r\n this.runs = props.runs?.map((run) => Run.fromJSON(run)) ?? [];\r\n }\r\n\r\n public override toJSON(): ParagraphProps {\r\n return {\r\n ...super.toJSON(),\r\n runs: this.runs.map((run) => run.toJSON()),\r\n };\r\n }\r\n\r\n /** Create a paragraph from its JSON representation. */\r\n public static create(props: ParagraphProps): Paragraph {\r\n return new Paragraph(props);\r\n }\r\n\r\n public override clone(): Paragraph {\r\n return new Paragraph(this.toJSON());\r\n }\r\n\r\n /** Apply the specified style to this [[Paragraph]], and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[runs]]. */\r\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\r\n super.applyStyle(styleName, options);\r\n if (!(options?.preventPropagation)) {\r\n for (const run of this.runs) {\r\n run.applyStyle(styleName, options);\r\n }\r\n }\r\n }\r\n\r\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n return this.runs.map((x) => x.stringify(options)).join(\"\");\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof Paragraph)) {\r\n return false;\r\n }\r\n\r\n if (this.runs.length !== other.runs.length || !super.equals(other)) {\r\n return false;\r\n }\r\n\r\n return this.runs.every((run, index) => run.equals(other.runs[index]));\r\n }\r\n}\r\n\r\n/** Describes the relative alignment of the content of a [[TextBlock]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type TextBlockJustification = \"left\" | \"center\" | \"right\";\r\n\r\n/** JSON representation of a [[TextBlock]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextBlockProps extends TextBlockComponentProps {\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n width?: number;\r\n /** The alignment of the document content. Default: \"left\". */\r\n justification?: TextBlockJustification;\r\n /** The paragraphs within the text block. Default: an empty array. */\r\n paragraphs?: ParagraphProps[];\r\n}\r\n\r\n/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content in the form of [[Run]]s.\r\n * You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].\r\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\r\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextBlock extends TextBlockComponent {\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n public width: number;\r\n /** The alignment of the document's content. */\r\n public justification: TextBlockJustification;\r\n /** The ordered list of paragraphs within the document. */\r\n public readonly paragraphs: Paragraph[];\r\n\r\n private constructor(props: TextBlockProps) {\r\n super(props);\r\n this.width = props.width ?? 0;\r\n this.justification = props.justification ?? \"left\";\r\n this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];\r\n }\r\n\r\n public override toJSON(): TextBlockProps {\r\n return {\r\n ...super.toJSON(),\r\n width: this.width,\r\n justification: this.justification,\r\n paragraphs: this.paragraphs.map((x) => x.toJSON()),\r\n };\r\n }\r\n\r\n /** Create a text block from its JSON representation. */\r\n public static create(props: TextBlockProps): TextBlock {\r\n return new TextBlock(props);\r\n }\r\n\r\n /** Create an empty text block containing no [[paragraphs]] and an empty [[styleName]]. */\r\n public static createEmpty(): TextBlock {\r\n return TextBlock.create({ styleName: \"\" });\r\n }\r\n\r\n /** Returns true if every paragraph in this text block is empty. */\r\n public get isEmpty(): boolean {\r\n return this.paragraphs.every((p) => p.runs.length === 0);\r\n }\r\n\r\n public override clone(): TextBlock {\r\n return new TextBlock(this.toJSON());\r\n }\r\n\r\n /** Apply the specified style to this block and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[paragraphs]]. */\r\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\r\n super.applyStyle(styleName, options);\r\n if (!(options?.preventPropagation)) {\r\n for (const paragraph of this.paragraphs) {\r\n paragraph.applyStyle(styleName, options);\r\n }\r\n }\r\n }\r\n\r\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\r\n public stringify(options?: TextBlockStringifyOptions): string {\r\n return this.paragraphs.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \");\r\n }\r\n\r\n /** Add and return a new paragraph.\r\n * If [[paragraphs]] is not empty, the style and overrides of the last [[Paragraph]] in the block will be applied to the new paragraph; otherwise,\r\n * the paragraph will inherit this block's style with no overrides.\r\n */\r\n public appendParagraph(): Paragraph {\r\n const seed = this.paragraphs[0];\r\n const paragraph = Paragraph.create({\r\n styleName: seed?.styleName ?? this.styleName,\r\n styleOverrides: seed?.styleOverrides ?? undefined,\r\n });\r\n\r\n this.paragraphs.push(paragraph);\r\n return paragraph;\r\n }\r\n\r\n /** Append a run to the last [[Paragraph]] in this block.\r\n * If the block contains no [[paragraphs]], a new one will first be created using [[appendParagraph]].\r\n */\r\n public appendRun(run: Run): void {\r\n const paragraph = this.paragraphs[this.paragraphs.length - 1] ?? this.appendParagraph();\r\n paragraph.runs.push(run);\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof TextBlock)) {\r\n return false;\r\n }\r\n\r\n if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {\r\n return false;\r\n }\r\n\r\n return this.paragraphs.every((paragraph, index) => paragraph.equals(other.paragraphs[index]));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAsDH;;;;;GAKG;AACH,MAAM,OAAgB,kBAAkB;IAItC,gBAAgB;IAChB,YAAsB,KAA8B;QAClD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAW,SAAS,CAAC,SAAiB;QACpC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,cAAc,CAAC,SAAiC;QACzD,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;IAC1C,CAAC;IAED,8EAA8E;IACvE,mBAAmB;QACxB,IAAI,CAAC,cAAc,GAAG,EAAG,CAAC;IAC5B,CAAC;IAED,oKAAoK;IAC7J,UAAU,CAAC,SAAiB,EAAE,OAA+B;QAClE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,IAAI,CAAC,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,4GAA4G;IAC5G,IAAW,cAAc;QACvB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,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":["/*---------------------------------------------------------------------------------------------\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 Annotation\r\n */\r\n\r\nimport { TextStyleSettingsProps } from \"./TextStyle\";\r\n\r\n/** Options supplied to [[TextBlockComponent.applyStyle]] to control how the style is applied to the component and its child components.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface ApplyTextStyleOptions {\r\n /** Controls whether any deviations from the style's settings stored in [[TextBlockComponent.styleOverrides]] are retained.\r\n * By default, all overrides are cleared.\r\n */\r\n preserveOverrides?: boolean;\r\n /** Controls whether the style should be recursively applied to the [[Paragraph]]s belonging to a [[TextBlock]] and the [[Run]]s belonging to a [[Paragraph]].\r\n * By default, the style change propagates to child components.\r\n */\r\n preventPropagation?: boolean;\r\n}\r\n\r\n/** The JSON representation of a [[TextBlockComponent]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextBlockComponentProps {\r\n /** The name of a [[TextStyle]] stored in a [Workspace]($backend) from which the base [[TextStyleSettings]] applied to the component originates. */\r\n styleName: string;\r\n /** Deviations from the base [[TextStyleSettings]] defined by the [[TextStyle]] applied to this component.\r\n * This permits you to, e.g., create a [[TextRun]] using \"Arial\" font and override it to use \"Comic Sans\" instead.\r\n */\r\n styleOverrides?: TextStyleSettingsProps;\r\n}\r\n\r\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextBlockStringifyOptions {\r\n /** A string to insert in between each [[Paragraph]].\r\n * Default: \" \" - a single space.\r\n */\r\n paragraphBreak?: string;\r\n /** A string to insert for each [[LineBreakRun]].\r\n * Default: \" \" - a single space.\r\n */\r\n lineBreak?: string;\r\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\r\n * Default: \"/\"\r\n */\r\n fractionSeparator?: string;\r\n}\r\n\r\n/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.\r\n * Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport abstract class TextBlockComponent {\r\n private _styleName: string;\r\n private _styleOverrides: TextStyleSettingsProps;\r\n\r\n /** @internal */\r\n protected constructor(props: TextBlockComponentProps) {\r\n this._styleName = props.styleName;\r\n this._styleOverrides = { ...props.styleOverrides };\r\n }\r\n\r\n /** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.\r\n * @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of\r\n * the components sub-components and clears any [[styleOverrides]].\r\n */\r\n public get styleName(): string {\r\n return this._styleName;\r\n }\r\n\r\n public set styleName(styleName: string) {\r\n this.applyStyle(styleName);\r\n }\r\n\r\n /** Deviations in individual properties of the [[TextStyle]] specified by [[styleName]].\r\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.fontName` to \"Comic Sans\".\r\n * @see [[clearStyleOverrides]] to reset this to an empty object.\r\n */\r\n public get styleOverrides(): TextStyleSettingsProps {\r\n return this._styleOverrides;\r\n }\r\n\r\n public set styleOverrides(overrides: TextStyleSettingsProps) {\r\n this._styleOverrides = { ...overrides };\r\n }\r\n\r\n /** Reset any [[styleOverrides]] applied to this component's [[TextStyle]]. */\r\n public clearStyleOverrides(): void {\r\n this.styleOverrides = { };\r\n }\r\n\r\n /** Apply the [[TextStyle]] specified by `styleName` to this component, optionally preserving [[styleOverrides]] and/or preventing propagation to sub-components. */\r\n public applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\r\n this._styleName = styleName;\r\n\r\n if (!(options?.preserveOverrides)) {\r\n this.clearStyleOverrides();\r\n }\r\n }\r\n\r\n /** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */\r\n public get overridesStyle(): boolean {\r\n return Object.keys(this.styleOverrides).length > 0;\r\n }\r\n\r\n /** Create a deep copy of this component. */\r\n public abstract clone(): TextBlockComponent;\r\n\r\n /** Compute a string representation of the contents of this component and all of its sub-components. */\r\n public abstract stringify(options?: TextBlockStringifyOptions): string;\r\n\r\n /** Convert this component to its JSON representation. */\r\n public toJSON(): TextBlockComponentProps {\r\n return {\r\n styleName: this.styleName,\r\n styleOverrides: { ...this.styleOverrides },\r\n };\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: TextBlockComponent): boolean {\r\n const myKeys = Object.keys(this.styleOverrides);\r\n const yrKeys = Object.keys(other._styleOverrides);\r\n if (this.styleName !== other.styleName || myKeys.length !== yrKeys.length) {\r\n return false;\r\n }\r\n\r\n for (const name of myKeys) {\r\n const key = name as keyof TextStyleSettingsProps;\r\n if (this.styleOverrides[key] !== other.styleOverrides[key]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type Run = TextRun | FractionRun | LineBreakRun;\r\n\r\n/** The JSON representation of a [[Run]].\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type RunProps = TextRunProps | FractionRunProps | LineBreakRunProps;\r\n\r\n/** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span\r\n * multiple lines, but it will never contain different styling.\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create a run from its JSON representation.\r\n * @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.\r\n */\r\n export function fromJSON(props: RunProps): Run {\r\n switch (props.type) {\r\n case \"text\": return TextRun.create(props);\r\n case \"fraction\": return FractionRun.create(props);\r\n case \"linebreak\": return LineBreakRun.create(props);\r\n }\r\n }\r\n}\r\n\r\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\r\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\r\n * affect how the content is rendered.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\r\n\r\n/** JSON representation of a [[TextRun]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"text\";\r\n /** The characters displayed by the run.\r\n * Default: an empty string.\r\n */\r\n content?: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally.\r\n * Default: \"none\"\r\n */\r\n baselineShift?: BaselineShift;\r\n}\r\n\r\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"text\";\r\n /** The sequence of characters to be displayed by the run. */\r\n public content: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\r\n public baselineShift: BaselineShift;\r\n\r\n private constructor(props: Omit<TextRunProps, \"type\">) {\r\n super(props);\r\n this.content = props.content ?? \"\";\r\n this.baselineShift = props.baselineShift ?? \"none\";\r\n }\r\n\r\n public override clone(): TextRun {\r\n return new TextRun(this.toJSON());\r\n }\r\n\r\n public override toJSON(): TextRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"text\",\r\n content: this.content,\r\n baselineShift: this.baselineShift,\r\n };\r\n }\r\n\r\n public static create(props: Omit<TextRunProps, \"type\">): TextRun {\r\n return new TextRun(props);\r\n }\r\n\r\n /** Simply returns [[content]]. */\r\n public override stringify(): string {\r\n return this.content;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FractionRun]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface FractionRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"fraction\";\r\n /** The text displayed before or above the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\r\n numerator?: string;\r\n /** The text displayed after or below the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\r\n denominator?: string;\r\n}\r\n\r\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\r\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class FractionRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"fraction\";\r\n /** The fraction's numerator. */\r\n public numerator: string;\r\n /** The fraction's denominator. */\r\n public denominator: string;\r\n\r\n private constructor(props: Omit<FractionRunProps, \"type\">) {\r\n super(props);\r\n this.numerator = props.numerator ?? \"\";\r\n this.denominator = props.denominator ?? \"\";\r\n }\r\n\r\n public override toJSON(): FractionRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"fraction\",\r\n numerator: this.numerator,\r\n denominator: this.denominator,\r\n };\r\n }\r\n\r\n public override clone(): FractionRun {\r\n return new FractionRun(this.toJSON());\r\n }\r\n\r\n public static create(props: Omit<FractionRunProps, \"type\">): FractionRun {\r\n return new FractionRun(props);\r\n }\r\n\r\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n const sep = options?.fractionSeparator ?? \"/\";\r\n return `${this.numerator}${sep}${this.denominator}`;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[LineBreakRun]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface LineBreakRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"linebreak\";\r\n}\r\n\r\n/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class LineBreakRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"linebreak\";\r\n\r\n private constructor(props: TextBlockComponentProps) {\r\n super(props);\r\n }\r\n\r\n public override toJSON(): LineBreakRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"linebreak\",\r\n };\r\n }\r\n\r\n public static create(props: TextBlockComponentProps) {\r\n return new LineBreakRun(props);\r\n }\r\n\r\n public override clone(): LineBreakRun {\r\n return new LineBreakRun(this.toJSON());\r\n }\r\n\r\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n return options?.lineBreak ?? \" \";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof LineBreakRun && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[Paragraph]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface ParagraphProps extends TextBlockComponentProps {\r\n /** The collection of [[Run]]s within the paragraph.\r\n * Default: an empty array.\r\n */\r\n runs?: RunProps[];\r\n}\r\n\r\n/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class Paragraph extends TextBlockComponent {\r\n /** The runs within the paragraph. You can modify the contents of this array to change the content of the paragraph. */\r\n public readonly runs: Run[];\r\n\r\n private constructor(props: ParagraphProps) {\r\n super(props);\r\n this.runs = props.runs?.map((run) => Run.fromJSON(run)) ?? [];\r\n }\r\n\r\n public override toJSON(): ParagraphProps {\r\n return {\r\n ...super.toJSON(),\r\n runs: this.runs.map((run) => run.toJSON()),\r\n };\r\n }\r\n\r\n /** Create a paragraph from its JSON representation. */\r\n public static create(props: ParagraphProps): Paragraph {\r\n return new Paragraph(props);\r\n }\r\n\r\n public override clone(): Paragraph {\r\n return new Paragraph(this.toJSON());\r\n }\r\n\r\n /** Apply the specified style to this [[Paragraph]], and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[runs]]. */\r\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\r\n super.applyStyle(styleName, options);\r\n if (!(options?.preventPropagation)) {\r\n for (const run of this.runs) {\r\n run.applyStyle(styleName, options);\r\n }\r\n }\r\n }\r\n\r\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n return this.runs.map((x) => x.stringify(options)).join(\"\");\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof Paragraph)) {\r\n return false;\r\n }\r\n\r\n if (this.runs.length !== other.runs.length || !super.equals(other)) {\r\n return false;\r\n }\r\n\r\n return this.runs.every((run, index) => run.equals(other.runs[index]));\r\n }\r\n}\r\n\r\n/** Describes the relative alignment of the content of a [[TextBlock]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type TextBlockJustification = \"left\" | \"center\" | \"right\";\r\n\r\n/** JSON representation of a [[TextBlock]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextBlockProps extends TextBlockComponentProps {\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n width?: number;\r\n /** The alignment of the document content. Default: \"left\". */\r\n justification?: TextBlockJustification;\r\n /** The paragraphs within the text block. Default: an empty array. */\r\n paragraphs?: ParagraphProps[];\r\n}\r\n\r\n/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content in the form of [[Run]]s.\r\n * You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].\r\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\r\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextBlock extends TextBlockComponent {\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n public width: number;\r\n /** The alignment of the document's content. */\r\n public justification: TextBlockJustification;\r\n /** The ordered list of paragraphs within the document. */\r\n public readonly paragraphs: Paragraph[];\r\n\r\n private constructor(props: TextBlockProps) {\r\n super(props);\r\n this.width = props.width ?? 0;\r\n this.justification = props.justification ?? \"left\";\r\n this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];\r\n }\r\n\r\n public override toJSON(): TextBlockProps {\r\n return {\r\n ...super.toJSON(),\r\n width: this.width,\r\n justification: this.justification,\r\n paragraphs: this.paragraphs.map((x) => x.toJSON()),\r\n };\r\n }\r\n\r\n /** Create a text block from its JSON representation. */\r\n public static create(props: TextBlockProps): TextBlock {\r\n return new TextBlock(props);\r\n }\r\n\r\n /** Create an empty text block containing no [[paragraphs]] and an empty [[styleName]]. */\r\n public static createEmpty(): TextBlock {\r\n return TextBlock.create({ styleName: \"\" });\r\n }\r\n\r\n /** Returns true if every paragraph in this text block is empty. */\r\n public get isEmpty(): boolean {\r\n return this.paragraphs.every((p) => p.runs.length === 0);\r\n }\r\n\r\n public override clone(): TextBlock {\r\n return new TextBlock(this.toJSON());\r\n }\r\n\r\n /** Apply the specified style to this block and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[paragraphs]]. */\r\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\r\n super.applyStyle(styleName, options);\r\n if (!(options?.preventPropagation)) {\r\n for (const paragraph of this.paragraphs) {\r\n paragraph.applyStyle(styleName, options);\r\n }\r\n }\r\n }\r\n\r\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\r\n public stringify(options?: TextBlockStringifyOptions): string {\r\n return this.paragraphs.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \");\r\n }\r\n\r\n /** Add and return a new paragraph.\r\n * If [[paragraphs]] is not empty, the style and overrides of the last [[Paragraph]] in the block will be applied to the new paragraph; otherwise,\r\n * the paragraph will inherit this block's style with no overrides.\r\n */\r\n public appendParagraph(): Paragraph {\r\n const seed = this.paragraphs[0];\r\n const paragraph = Paragraph.create({\r\n styleName: seed?.styleName ?? this.styleName,\r\n styleOverrides: seed?.styleOverrides ?? undefined,\r\n });\r\n\r\n this.paragraphs.push(paragraph);\r\n return paragraph;\r\n }\r\n\r\n /** Append a run to the last [[Paragraph]] in this block.\r\n * If the block contains no [[paragraphs]], a new one will first be created using [[appendParagraph]].\r\n */\r\n public appendRun(run: Run): void {\r\n const paragraph = this.paragraphs[this.paragraphs.length - 1] ?? this.appendParagraph();\r\n paragraph.runs.push(run);\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof TextBlock)) {\r\n return false;\r\n }\r\n\r\n if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {\r\n return false;\r\n }\r\n\r\n return this.paragraphs.every((paragraph, index) => paragraph.equals(other.paragraphs[index]));\r\n }\r\n}\r\n"]}
@@ -13,7 +13,7 @@
13
13
  * @preview
14
14
  * @extensions
15
15
  */
16
- class TextStyleSettings {
16
+ export class TextStyleSettings {
17
17
  constructor(props, defaults) {
18
18
  if (!defaults) {
19
19
  defaults = TextStyleSettings.defaultProps;
@@ -72,7 +72,6 @@ TextStyleSettings.defaultProps = {
72
72
  };
73
73
  /** Settings initialized to all default values. */
74
74
  TextStyleSettings.defaults = new TextStyleSettings({});
75
- export { TextStyleSettings };
76
75
  Object.freeze(TextStyleSettings.defaultProps);
77
76
  Object.freeze(TextStyleSettings.defaults);
78
77
  /** A named, immutable [[TextStyleSettings]] stored in a [Workspace]($backend).
@@ -1 +1 @@
1
- {"version":3,"file":"TextStyle.js","sourceRoot":"","sources":["../../../src/annotation/TextStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AA4FH;;;;;;;GAOG;AACH,MAAa,iBAAiB;IAmE5B,YAAoB,KAA6B,EAAE,QAA2C;QAC5F,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,iBAAiB,CAAC,YAAY,CAAC;SAC3C;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC;QAC1D,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,IAAI,QAAQ,CAAC,iBAAiB,CAAC;QAC/E,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC;QAChE,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,IAAI,QAAQ,CAAC,oBAAoB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C;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,mDAAmD;IAC5C,MAAM,CAAC,QAAQ,CAAC,IAAoB;QACzC,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,0BAA0B;IACnB,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,QAA2B;QAC5D,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,sIAAsI;IAC/H,KAAK,CAAC,eAAuC;QAClD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEM,MAAM,CAAC,KAAgB;QAC5B,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1E,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 Annotation\r\n */\r\n\r\nimport { ColorDefProps } from \"../ColorDef\";\r\n\r\n/** Specifies how to separate the numerator and denominator of a [[FractionRun]], by either a horizontal or diagonal bar.\r\n * @see [[TextStyleSettingsProps.stackedFractionType]] and [[TextStyleSettings.stackedFractionType]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type StackedFractionType = \"horizontal\" | \"diagonal\";\r\n\r\n/** Describes the color in which to draw the text in a [[TextRun]].\r\n * \"subcategory\" indicates that the text should be drawn using the color of the [SubCategory]($backend) specified by the [GeometryStream]($docs/learning/common/GeometryStream.md) hosting the\r\n * text.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type TextStyleColor = ColorDefProps | \"subcategory\";\r\n\r\n/** Serves both as the JSON representation of a [[TextStyleSettings]], and a way for a [[TextBlockComponent]] to selectively override aspects of a [[TextStyle]]'s properties.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextStyleSettingsProps {\r\n /** The color of the text.\r\n * Default: \"subcategory\".\r\n */\r\n color?: TextStyleColor;\r\n /** The name of a font stored in a [Workspace]($backend), used to draw the contents of a [[TextRun]].\r\n * Default: \"\" (an invalid font name).\r\n */\r\n fontName?: string;\r\n /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.\r\n * For example, the height and offset from baseline of a subscript [[TextRun]] are compuated as lineHeight * [[subScriptScale]] and\r\n * lineHeight * [[subScriptOffsetFactor]], respectively.\r\n * Default: 1.0. */\r\n lineHeight?: number;\r\n /** Multiplier used to compute the vertical distance between two lines of text.\r\n * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].\r\n * Default: 0.5.\r\n */\r\n lineSpacingFactor?: number;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**.\r\n * Default: false.\r\n */\r\n isBold?: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*.\r\n * Default: false.\r\n */\r\n isItalic?: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be underlined.\r\n * Default: false.\r\n */\r\n isUnderlined?: boolean;\r\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\r\n * The height is computed in meters as stackedFractionScale * [[lineHeight]].\r\n * Default: 0.7.\r\n */\r\n stackedFractionScale?: number;\r\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]].\r\n * Default: \"horizontal\".\r\n */\r\n stackedFractionType?: StackedFractionType;\r\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\r\n * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].\r\n * Default: -0.15.\r\n */\r\n subScriptOffsetFactor?: number;\r\n /** Multiplier used to compute the height of a subscript [[TextRun]].\r\n * The height is computed as subScriptScale * [[lineHeight]].\r\n * Default: 2/3\r\n */\r\n subScriptScale?: number;\r\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\r\n * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].\r\n * Default: -0.5.\r\n */\r\n superScriptOffsetFactor?: number;\r\n /** Multiplier used to compute the height of a superscript [[TextRun]].\r\n * The height is computed as superScriptScale * [[lineHeight]].\r\n * Default: 2/3\r\n */\r\n superScriptScale?: number;\r\n /** A scale applied to the width of each glyph.\r\n * Default: 1.0\r\n */\r\n widthFactor?: number;\r\n}\r\n\r\n/** A description of the formatting to be applied to a [[TextBlockComponent]].\r\n * Named instances of these settings can be stored as [[TextStyle]]s in a [Workspace]($backend).\r\n * @note This is an immutable type. Use [[clone]] to create a modified copy.\r\n * @see [[TextStyleSettingsProps]] for documentation of each of the settings.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextStyleSettings {\r\n /** The color of the text. */\r\n public readonly color: TextStyleColor;\r\n /** The name of a font stored in a [Workspace]($backend), used to draw the contents of a [[TextRun]].\r\n */\r\n public readonly fontName: string;\r\n /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.\r\n * For example, the height and offset from baseline of a subscript [[TextRun]] are compuated as lineHeight * [[subScriptScale]] and\r\n * lineHeight * [[subScriptOffsetFactor]], respectively.\r\n */\r\n public readonly lineHeight: number;\r\n /** Multiplier used to compute the vertical distance between two lines of text.\r\n * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].\r\n */\r\n public readonly lineSpacingFactor: number;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**. */\r\n public readonly isBold: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*. */\r\n public readonly isItalic: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be underlined. */\r\n public readonly isUnderlined: boolean;\r\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\r\n * The height is computed in meters as stackedFractionScale * [[lineHeight]].\r\n */\r\n public readonly stackedFractionScale: number;\r\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]]. */\r\n public readonly stackedFractionType: StackedFractionType;\r\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\r\n * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].\r\n */\r\n public readonly subScriptOffsetFactor: number;\r\n /** Multiplier used to compute the height of a subscript [[TextRun]].\r\n * The height is computed as subScriptScale * [[lineHeight]].\r\n */\r\n public readonly subScriptScale: number;\r\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\r\n * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].\r\n */\r\n public readonly superScriptOffsetFactor: number;\r\n /** Multiplier used to compute the height of a superscript [[TextRun]].\r\n * The height is computed as superScriptScale * [[lineHeight]].\r\n */\r\n public readonly superScriptScale: number;\r\n /** Multiplier used to compute the width of each glyph, relative to [[lineHeight]]. */\r\n public readonly widthFactor: number;\r\n\r\n /** A fully-populated JSON representation of the default settings. */\r\n public static defaultProps: Readonly<Required<TextStyleSettingsProps>> = {\r\n color: \"subcategory\",\r\n fontName: \"\",\r\n lineHeight: 1,\r\n lineSpacingFactor: 0.5,\r\n isBold: false,\r\n isItalic: false,\r\n isUnderlined: false,\r\n stackedFractionScale: 0.7,\r\n stackedFractionType: \"horizontal\",\r\n subScriptOffsetFactor: -0.15,\r\n subScriptScale: 2 / 3,\r\n superScriptOffsetFactor: 0.5,\r\n superScriptScale: 2 / 3,\r\n widthFactor: 1,\r\n };\r\n\r\n /** Settings initialized to all default values. */\r\n public static defaults: TextStyleSettings = new TextStyleSettings({ });\r\n\r\n private constructor(props: TextStyleSettingsProps, defaults?: Required<TextStyleSettingsProps>) {\r\n if (!defaults) {\r\n defaults = TextStyleSettings.defaultProps;\r\n }\r\n\r\n this.color = props.color ?? defaults.color;\r\n this.fontName = props.fontName ?? defaults.fontName;\r\n this.lineHeight = props.lineHeight ?? defaults.lineHeight;\r\n this.lineSpacingFactor = props.lineSpacingFactor ?? defaults.lineSpacingFactor;\r\n this.isBold = props.isBold ?? defaults.isBold;\r\n this.isItalic = props.isItalic ?? defaults.isItalic;\r\n this.isUnderlined = props.isUnderlined ?? defaults.isUnderlined;\r\n this.stackedFractionScale = props.stackedFractionScale ?? defaults.stackedFractionScale;\r\n this.stackedFractionType = props.stackedFractionType ?? defaults.stackedFractionType;\r\n this.subScriptOffsetFactor = props.subScriptOffsetFactor ?? defaults.subScriptOffsetFactor;\r\n this.subScriptScale = props.subScriptScale ?? defaults.subScriptScale;\r\n this.superScriptOffsetFactor = props.superScriptOffsetFactor ?? defaults.superScriptOffsetFactor;\r\n this.superScriptScale = props.superScriptScale ?? defaults.superScriptScale;\r\n this.widthFactor = props.widthFactor ?? defaults.widthFactor;\r\n }\r\n\r\n /** Create a copy of these settings, modified according to the properties defined by `alteredProps`. */\r\n public clone(alteredProps?: TextStyleSettingsProps): TextStyleSettings {\r\n return alteredProps ? new TextStyleSettings(alteredProps, this) : this;\r\n }\r\n\r\n /** Create settings from their JSON representation. */\r\n public static fromJSON(props?: TextStyleSettingsProps): TextStyleSettings {\r\n return props ? new TextStyleSettings(props) : TextStyleSettings.defaults;\r\n }\r\n\r\n public toJSON(): TextStyleSettingsProps {\r\n return { ...this };\r\n }\r\n\r\n public equals(other: TextStyleSettings): boolean {\r\n return this.color === other.color && this.fontName === other.fontName\r\n && this.lineHeight === other.lineHeight && this.lineSpacingFactor === other.lineSpacingFactor && this.widthFactor === other.widthFactor\r\n && this.isBold === other.isBold && this.isItalic === other.isItalic && this.isUnderlined === other.isUnderlined\r\n && this.stackedFractionType === other.stackedFractionType && this.stackedFractionScale === other.stackedFractionScale\r\n && this.subScriptOffsetFactor === other.subScriptOffsetFactor && this.subScriptScale === other.subScriptScale\r\n && this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale;\r\n }\r\n}\r\n\r\nObject.freeze(TextStyleSettings.defaultProps);\r\nObject.freeze(TextStyleSettings.defaults);\r\n\r\n/** The JSON representation of a [[TextStyle]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextStyleProps {\r\n /** The name of the style. */\r\n name: string;\r\n /** The settings defined for the style. Any omitted properties will use their default values, as described by [[TextStyleSettingsProps]]. */\r\n settings?: TextStyleSettingsProps;\r\n}\r\n\r\n/** A named, immutable [[TextStyleSettings]] stored in a [Workspace]($backend).\r\n * @see [[TextBlockComponent.styleName]] to define the text style for a component of a [[TextBlock]].\r\n * @note This is an immutable type. Use [[clone]] to create a modified copy.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextStyle {\r\n public readonly name: string;\r\n public readonly settings: TextStyleSettings;\r\n\r\n private constructor(name: string, settings: TextStyleSettings) {\r\n this.name = name;\r\n this.settings = settings;\r\n }\r\n\r\n /** Create a style from its JSON representation. */\r\n public static fromJSON(json: TextStyleProps): TextStyle {\r\n return TextStyle.create(json.name, TextStyleSettings.fromJSON(json.settings));\r\n }\r\n\r\n /** Create a new style. */\r\n public static create(name: string, settings: TextStyleSettings): TextStyle {\r\n return new TextStyle(name, settings);\r\n }\r\n\r\n /** Create a copy of this style with the same name, and settings modified according to the properties defined by `alteredSettings`. */\r\n public clone(alteredSettings: TextStyleSettingsProps): TextStyle {\r\n return TextStyle.create(this.name, this.settings.clone(alteredSettings));\r\n }\r\n\r\n public equals(other: TextStyle): boolean {\r\n return this.name === other.name && this.settings.equals(other.settings);\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"TextStyle.js","sourceRoot":"","sources":["../../../src/annotation/TextStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AA4FH;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAiB;IAmE5B,YAAoB,KAA6B,EAAE,QAA2C;QAC5F,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CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEM,MAAM,CAAC,KAAgB;QAC5B,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1E,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 Annotation\r\n */\r\n\r\nimport { ColorDefProps } from \"../ColorDef\";\r\n\r\n/** Specifies how to separate the numerator and denominator of a [[FractionRun]], by either a horizontal or diagonal bar.\r\n * @see [[TextStyleSettingsProps.stackedFractionType]] and [[TextStyleSettings.stackedFractionType]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type StackedFractionType = \"horizontal\" | \"diagonal\";\r\n\r\n/** Describes the color in which to draw the text in a [[TextRun]].\r\n * \"subcategory\" indicates that the text should be drawn using the color of the [SubCategory]($backend) specified by the [GeometryStream]($docs/learning/common/GeometryStream.md) hosting the\r\n * text.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport type TextStyleColor = ColorDefProps | \"subcategory\";\r\n\r\n/** Serves both as the JSON representation of a [[TextStyleSettings]], and a way for a [[TextBlockComponent]] to selectively override aspects of a [[TextStyle]]'s properties.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextStyleSettingsProps {\r\n /** The color of the text.\r\n * Default: \"subcategory\".\r\n */\r\n color?: TextStyleColor;\r\n /** The name of a font stored in a [Workspace]($backend), used to draw the contents of a [[TextRun]].\r\n * Default: \"\" (an invalid font name).\r\n */\r\n fontName?: string;\r\n /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.\r\n * For example, the height and offset from baseline of a subscript [[TextRun]] are compuated as lineHeight * [[subScriptScale]] and\r\n * lineHeight * [[subScriptOffsetFactor]], respectively.\r\n * Default: 1.0. */\r\n lineHeight?: number;\r\n /** Multiplier used to compute the vertical distance between two lines of text.\r\n * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].\r\n * Default: 0.5.\r\n */\r\n lineSpacingFactor?: number;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**.\r\n * Default: false.\r\n */\r\n isBold?: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*.\r\n * Default: false.\r\n */\r\n isItalic?: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be underlined.\r\n * Default: false.\r\n */\r\n isUnderlined?: boolean;\r\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\r\n * The height is computed in meters as stackedFractionScale * [[lineHeight]].\r\n * Default: 0.7.\r\n */\r\n stackedFractionScale?: number;\r\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]].\r\n * Default: \"horizontal\".\r\n */\r\n stackedFractionType?: StackedFractionType;\r\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\r\n * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].\r\n * Default: -0.15.\r\n */\r\n subScriptOffsetFactor?: number;\r\n /** Multiplier used to compute the height of a subscript [[TextRun]].\r\n * The height is computed as subScriptScale * [[lineHeight]].\r\n * Default: 2/3\r\n */\r\n subScriptScale?: number;\r\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\r\n * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].\r\n * Default: -0.5.\r\n */\r\n superScriptOffsetFactor?: number;\r\n /** Multiplier used to compute the height of a superscript [[TextRun]].\r\n * The height is computed as superScriptScale * [[lineHeight]].\r\n * Default: 2/3\r\n */\r\n superScriptScale?: number;\r\n /** A scale applied to the width of each glyph.\r\n * Default: 1.0\r\n */\r\n widthFactor?: number;\r\n}\r\n\r\n/** A description of the formatting to be applied to a [[TextBlockComponent]].\r\n * Named instances of these settings can be stored as [[TextStyle]]s in a [Workspace]($backend).\r\n * @note This is an immutable type. Use [[clone]] to create a modified copy.\r\n * @see [[TextStyleSettingsProps]] for documentation of each of the settings.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextStyleSettings {\r\n /** The color of the text. */\r\n public readonly color: TextStyleColor;\r\n /** The name of a font stored in a [Workspace]($backend), used to draw the contents of a [[TextRun]].\r\n */\r\n public readonly fontName: string;\r\n /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.\r\n * For example, the height and offset from baseline of a subscript [[TextRun]] are compuated as lineHeight * [[subScriptScale]] and\r\n * lineHeight * [[subScriptOffsetFactor]], respectively.\r\n */\r\n public readonly lineHeight: number;\r\n /** Multiplier used to compute the vertical distance between two lines of text.\r\n * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].\r\n */\r\n public readonly lineSpacingFactor: number;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**. */\r\n public readonly isBold: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*. */\r\n public readonly isItalic: boolean;\r\n /** Specifies whether the content of a [[TextRun]] should be underlined. */\r\n public readonly isUnderlined: boolean;\r\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\r\n * The height is computed in meters as stackedFractionScale * [[lineHeight]].\r\n */\r\n public readonly stackedFractionScale: number;\r\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]]. */\r\n public readonly stackedFractionType: StackedFractionType;\r\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\r\n * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].\r\n */\r\n public readonly subScriptOffsetFactor: number;\r\n /** Multiplier used to compute the height of a subscript [[TextRun]].\r\n * The height is computed as subScriptScale * [[lineHeight]].\r\n */\r\n public readonly subScriptScale: number;\r\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\r\n * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].\r\n */\r\n public readonly superScriptOffsetFactor: number;\r\n /** Multiplier used to compute the height of a superscript [[TextRun]].\r\n * The height is computed as superScriptScale * [[lineHeight]].\r\n */\r\n public readonly superScriptScale: number;\r\n /** Multiplier used to compute the width of each glyph, relative to [[lineHeight]]. */\r\n public readonly widthFactor: number;\r\n\r\n /** A fully-populated JSON representation of the default settings. */\r\n public static defaultProps: Readonly<Required<TextStyleSettingsProps>> = {\r\n color: \"subcategory\",\r\n fontName: \"\",\r\n lineHeight: 1,\r\n lineSpacingFactor: 0.5,\r\n isBold: false,\r\n isItalic: false,\r\n isUnderlined: false,\r\n stackedFractionScale: 0.7,\r\n stackedFractionType: \"horizontal\",\r\n subScriptOffsetFactor: -0.15,\r\n subScriptScale: 2 / 3,\r\n superScriptOffsetFactor: 0.5,\r\n superScriptScale: 2 / 3,\r\n widthFactor: 1,\r\n };\r\n\r\n /** Settings initialized to all default values. */\r\n public static defaults: TextStyleSettings = new TextStyleSettings({ });\r\n\r\n private constructor(props: TextStyleSettingsProps, defaults?: Required<TextStyleSettingsProps>) {\r\n if (!defaults) {\r\n defaults = TextStyleSettings.defaultProps;\r\n }\r\n\r\n this.color = props.color ?? defaults.color;\r\n this.fontName = props.fontName ?? defaults.fontName;\r\n this.lineHeight = props.lineHeight ?? defaults.lineHeight;\r\n this.lineSpacingFactor = props.lineSpacingFactor ?? defaults.lineSpacingFactor;\r\n this.isBold = props.isBold ?? defaults.isBold;\r\n this.isItalic = props.isItalic ?? defaults.isItalic;\r\n this.isUnderlined = props.isUnderlined ?? defaults.isUnderlined;\r\n this.stackedFractionScale = props.stackedFractionScale ?? defaults.stackedFractionScale;\r\n this.stackedFractionType = props.stackedFractionType ?? defaults.stackedFractionType;\r\n this.subScriptOffsetFactor = props.subScriptOffsetFactor ?? defaults.subScriptOffsetFactor;\r\n this.subScriptScale = props.subScriptScale ?? defaults.subScriptScale;\r\n this.superScriptOffsetFactor = props.superScriptOffsetFactor ?? defaults.superScriptOffsetFactor;\r\n this.superScriptScale = props.superScriptScale ?? defaults.superScriptScale;\r\n this.widthFactor = props.widthFactor ?? defaults.widthFactor;\r\n }\r\n\r\n /** Create a copy of these settings, modified according to the properties defined by `alteredProps`. */\r\n public clone(alteredProps?: TextStyleSettingsProps): TextStyleSettings {\r\n return alteredProps ? new TextStyleSettings(alteredProps, this) : this;\r\n }\r\n\r\n /** Create settings from their JSON representation. */\r\n public static fromJSON(props?: TextStyleSettingsProps): TextStyleSettings {\r\n return props ? new TextStyleSettings(props) : TextStyleSettings.defaults;\r\n }\r\n\r\n public toJSON(): TextStyleSettingsProps {\r\n return { ...this };\r\n }\r\n\r\n public equals(other: TextStyleSettings): boolean {\r\n return this.color === other.color && this.fontName === other.fontName\r\n && this.lineHeight === other.lineHeight && this.lineSpacingFactor === other.lineSpacingFactor && this.widthFactor === other.widthFactor\r\n && this.isBold === other.isBold && this.isItalic === other.isItalic && this.isUnderlined === other.isUnderlined\r\n && this.stackedFractionType === other.stackedFractionType && this.stackedFractionScale === other.stackedFractionScale\r\n && this.subScriptOffsetFactor === other.subScriptOffsetFactor && this.subScriptScale === other.subScriptScale\r\n && this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale;\r\n }\r\n}\r\n\r\nObject.freeze(TextStyleSettings.defaultProps);\r\nObject.freeze(TextStyleSettings.defaults);\r\n\r\n/** The JSON representation of a [[TextStyle]].\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport interface TextStyleProps {\r\n /** The name of the style. */\r\n name: string;\r\n /** The settings defined for the style. Any omitted properties will use their default values, as described by [[TextStyleSettingsProps]]. */\r\n settings?: TextStyleSettingsProps;\r\n}\r\n\r\n/** A named, immutable [[TextStyleSettings]] stored in a [Workspace]($backend).\r\n * @see [[TextBlockComponent.styleName]] to define the text style for a component of a [[TextBlock]].\r\n * @note This is an immutable type. Use [[clone]] to create a modified copy.\r\n * @beta\r\n * @preview\r\n * @extensions\r\n */\r\nexport class TextStyle {\r\n public readonly name: string;\r\n public readonly settings: TextStyleSettings;\r\n\r\n private constructor(name: string, settings: TextStyleSettings) {\r\n this.name = name;\r\n this.settings = settings;\r\n }\r\n\r\n /** Create a style from its JSON representation. */\r\n public static fromJSON(json: TextStyleProps): TextStyle {\r\n return TextStyle.create(json.name, TextStyleSettings.fromJSON(json.settings));\r\n }\r\n\r\n /** Create a new style. */\r\n public static create(name: string, settings: TextStyleSettings): TextStyle {\r\n return new TextStyle(name, settings);\r\n }\r\n\r\n /** Create a copy of this style with the same name, and settings modified according to the properties defined by `alteredSettings`. */\r\n public clone(alteredSettings: TextStyleSettingsProps): TextStyle {\r\n return TextStyle.create(this.name, this.settings.clone(alteredSettings));\r\n }\r\n\r\n public equals(other: TextStyle): boolean {\r\n return this.name === other.name && this.settings.equals(other.settings);\r\n }\r\n}\r\n\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalTransform.js","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,wBAAwB;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwBhD;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IAY/B,YAAY,IAAgC;QAC1C,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SACzB;IACH,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA+B;QACpD,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;iBACa;IACN,MA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AAE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7D,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,CAAC;YAC1F,OAAO,KAAK,CAAC;QAEf,IAAI,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAqB,CAAC;YAC7F,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n// cspell:ignore Helmert\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\n\r\n/** An affine transformation with an additional Z Offset.\r\n * The equations are:\r\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\r\n * X = a * x - b * y + translationX\r\n * Y = b * x + a * y + translationY\r\n * Z = z + translationZ\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Helmert2DWithZOffsetProps {\r\n /** The X post translation */\r\n translationX: number;\r\n /** The Y post-translation */\r\n translationY: number;\r\n /** The Z post-translation or Z offset*/\r\n translationZ: number;\r\n /** The rotation in the trigonometric (CCW) direction in degrees. */\r\n rotDeg: number;\r\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\r\n scale: number;\r\n}\r\n\r\n/** An affine transformation with an additional Z Offset.\r\n * The equations are:\r\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\r\n * X = a * x - b * y + translationX\r\n * Y = b * x + a * y + translationY\r\n * Z = z + translationZ\r\n *\r\n * Note that the class only implements the definition and not the operation.\r\n * @public\r\n */\r\nexport class Helmert2DWithZOffset implements Helmert2DWithZOffsetProps {\r\n /** The X post translation */\r\n public translationX!: number;\r\n /** The Y post-translation */\r\n public translationY!: number;\r\n /** The Z post-translation or Z offset*/\r\n public translationZ!: number;\r\n /** The rotation in the trigonometric (CCW) direction in degrees. */\r\n public rotDeg!: number;\r\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\r\n public scale!: number;\r\n\r\n constructor(data?: Helmert2DWithZOffsetProps) {\r\n if (data) {\r\n this.translationX = data.translationX;\r\n this.translationY = data.translationY;\r\n this.translationZ = data.translationZ;\r\n this.rotDeg = data.rotDeg;\r\n this.scale = data.scale;\r\n }\r\n }\r\n\r\n /** Creates an Helmert Transform from JSON representation.\r\n * @public */\r\n public static fromJSON(data: Helmert2DWithZOffsetProps): Helmert2DWithZOffset {\r\n return new Helmert2DWithZOffset(data);\r\n }\r\n\r\n /** Creates a JSON from the Helmert Transform definition\r\n * @public */\r\n public toJSON(): Helmert2DWithZOffsetProps {\r\n return { translationX: this.translationX, translationY: this.translationY, translationZ: this.translationZ, rotDeg: this.rotDeg, scale: this.scale };\r\n }\r\n\r\n /** Compares two Helmert2DWithZOffset objects applying a minuscule tolerance.\r\n * @public */\r\n public equals(other: Helmert2DWithZOffset): boolean {\r\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\r\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\r\n Math.abs(this.translationZ - other.translationZ) < Geometry.smallMetricDistance &&\r\n Math.abs(this.rotDeg - other.rotDeg) < Geometry.smallAngleDegrees &&\r\n Math.abs(this.scale - other.scale) < Geometry.smallFraction);\r\n }\r\n}\r\n\r\n/** Additional Transform definition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AdditionalTransformProps {\r\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\r\n helmert2DWithZOffset?: Helmert2DWithZOffsetProps;\r\n}\r\n\r\n/** Additional Transform implementation.\r\n * An additional transform is a transformation that can apply to either the horizontal or vertical coordinates of a\r\n * geographic CRS. The transformation is applied after the latitude/longitude have been projected thus the process\r\n * is applied to the result Cartesian coordinates of the projection process.\r\n * @public\r\n*/\r\nexport class AdditionalTransform implements AdditionalTransformProps {\r\n\r\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\r\n public readonly helmert2DWithZOffset?: Helmert2DWithZOffset;\r\n\r\n public constructor(data?: AdditionalTransformProps) {\r\n if (data)\r\n this.helmert2DWithZOffset = data.helmert2DWithZOffset ? Helmert2DWithZOffset.fromJSON(data.helmert2DWithZOffset) : undefined;\r\n }\r\n\r\n /** Creates an Additional Transform from JSON representation.\r\n * @public */\r\n public static fromJSON(data: AdditionalTransformProps): AdditionalTransform {\r\n return new AdditionalTransform(data);\r\n }\r\n\r\n /** Creates a JSON from the Additional Transform definition\r\n * @public */\r\n public toJSON(): AdditionalTransformProps {\r\n return { helmert2DWithZOffset: this.helmert2DWithZOffset };\r\n }\r\n\r\n /** Compares two additional transforms applying a minuscule tolerance to comparing numbers.\r\n * @public */\r\n public equals(other: AdditionalTransform): boolean {\r\n if ((this.helmert2DWithZOffset === undefined) !== (other.helmert2DWithZOffset === undefined))\r\n return false;\r\n\r\n if (this.helmert2DWithZOffset && !this.helmert2DWithZOffset.equals(other.helmert2DWithZOffset!))\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"AdditionalTransform.js","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,wBAAwB;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwBhD;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IAY/B,YAAY,IAAgC;QAC1C,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,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AAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjI,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA8B;QACnD,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7D,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,CAAC;YAC1F,OAAO,KAAK,CAAC;QAEf,IAAI,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAqB,CAAC;YAC7F,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n// cspell:ignore Helmert\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\n\r\n/** An affine transformation with an additional Z Offset.\r\n * The equations are:\r\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\r\n * X = a * x - b * y + translationX\r\n * Y = b * x + a * y + translationY\r\n * Z = z + translationZ\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Helmert2DWithZOffsetProps {\r\n /** The X post translation */\r\n translationX: number;\r\n /** The Y post-translation */\r\n translationY: number;\r\n /** The Z post-translation or Z offset*/\r\n translationZ: number;\r\n /** The rotation in the trigonometric (CCW) direction in degrees. */\r\n rotDeg: number;\r\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\r\n scale: number;\r\n}\r\n\r\n/** An affine transformation with an additional Z Offset.\r\n * The equations are:\r\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\r\n * X = a * x - b * y + translationX\r\n * Y = b * x + a * y + translationY\r\n * Z = z + translationZ\r\n *\r\n * Note that the class only implements the definition and not the operation.\r\n * @public\r\n */\r\nexport class Helmert2DWithZOffset implements Helmert2DWithZOffsetProps {\r\n /** The X post translation */\r\n public translationX!: number;\r\n /** The Y post-translation */\r\n public translationY!: number;\r\n /** The Z post-translation or Z offset*/\r\n public translationZ!: number;\r\n /** The rotation in the trigonometric (CCW) direction in degrees. */\r\n public rotDeg!: number;\r\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\r\n public scale!: number;\r\n\r\n constructor(data?: Helmert2DWithZOffsetProps) {\r\n if (data) {\r\n this.translationX = data.translationX;\r\n this.translationY = data.translationY;\r\n this.translationZ = data.translationZ;\r\n this.rotDeg = data.rotDeg;\r\n this.scale = data.scale;\r\n }\r\n }\r\n\r\n /** Creates an Helmert Transform from JSON representation.\r\n * @public */\r\n public static fromJSON(data: Helmert2DWithZOffsetProps): Helmert2DWithZOffset {\r\n return new Helmert2DWithZOffset(data);\r\n }\r\n\r\n /** Creates a JSON from the Helmert Transform definition\r\n * @public */\r\n public toJSON(): Helmert2DWithZOffsetProps {\r\n return { translationX: this.translationX, translationY: this.translationY, translationZ: this.translationZ, rotDeg: this.rotDeg, scale: this.scale };\r\n }\r\n\r\n /** Compares two Helmert2DWithZOffset objects applying a minuscule tolerance.\r\n * @public */\r\n public equals(other: Helmert2DWithZOffset): boolean {\r\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\r\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\r\n Math.abs(this.translationZ - other.translationZ) < Geometry.smallMetricDistance &&\r\n Math.abs(this.rotDeg - other.rotDeg) < Geometry.smallAngleDegrees &&\r\n Math.abs(this.scale - other.scale) < Geometry.smallFraction);\r\n }\r\n}\r\n\r\n/** Additional Transform definition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AdditionalTransformProps {\r\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\r\n helmert2DWithZOffset?: Helmert2DWithZOffsetProps;\r\n}\r\n\r\n/** Additional Transform implementation.\r\n * An additional transform is a transformation that can apply to either the horizontal or vertical coordinates of a\r\n * geographic CRS. The transformation is applied after the latitude/longitude have been projected thus the process\r\n * is applied to the result Cartesian coordinates of the projection process.\r\n * @public\r\n*/\r\nexport class AdditionalTransform implements AdditionalTransformProps {\r\n\r\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\r\n public readonly helmert2DWithZOffset?: Helmert2DWithZOffset;\r\n\r\n public constructor(data?: AdditionalTransformProps) {\r\n if (data)\r\n this.helmert2DWithZOffset = data.helmert2DWithZOffset ? Helmert2DWithZOffset.fromJSON(data.helmert2DWithZOffset) : undefined;\r\n }\r\n\r\n /** Creates an Additional Transform from JSON representation.\r\n * @public */\r\n public static fromJSON(data: AdditionalTransformProps): AdditionalTransform {\r\n return new AdditionalTransform(data);\r\n }\r\n\r\n /** Creates a JSON from the Additional Transform definition\r\n * @public */\r\n public toJSON(): AdditionalTransformProps {\r\n return { helmert2DWithZOffset: this.helmert2DWithZOffset };\r\n }\r\n\r\n /** Compares two additional transforms applying a minuscule tolerance to comparing numbers.\r\n * @public */\r\n public equals(other: AdditionalTransform): boolean {\r\n if ((this.helmert2DWithZOffset === undefined) !== (other.helmert2DWithZOffset === undefined))\r\n return false;\r\n\r\n if (this.helmert2DWithZOffset && !this.helmert2DWithZOffset.equals(other.helmert2DWithZOffset!))\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AreaPattern.js","sourceRoot":"","sources":["../../../src/geometry/AreaPattern.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;G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CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC7G,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;oBAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;aAC5F;YAED,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC3C,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,CAAC,UAAU;gBACb,OAAO,KAAK,CAAC;YACf,MAAM,WAAW,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;YACtE,IAAI,SAAS,KAAK,WAAW;gBAC3B,OAAO,KAAK,CAAC;YACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAzMY,kBAAM,SAyMlB,CAAA;AACH,CAAC,EA1QgB,WAAW,KAAX,WAAW,QA0Q3B","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 Symbology\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, AngleProps, Geometry, Matrix3d, Point2d, Point3d, Transform, XYProps, XYZProps, YawPitchRollAngles, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\r\n\r\n/** @public */\r\nexport namespace AreaPattern {\r\n /** Single hatch line definition */\r\n export interface HatchDefLineProps {\r\n /** Angle of hatch line, 0.0 if undefined */\r\n angle?: AngleProps;\r\n /** Origin point (relative to placement) the hatch passes through, 0.0,0.0 if undefined */\r\n through?: XYProps;\r\n /** Offset of successive lines. X offset staggers dashes (ignored for solid lines) and Y offset controls the distance between both solid and dashed lines, 0.0,0.0 if undefined */\r\n offset?: XYProps;\r\n /** Array of gap and dash lengths for creating non-solid hatch lines, max of 20. A positive value denotes dash, a negative value a gap, solid line if undefined */\r\n dashes?: number[];\r\n }\r\n\r\n export class HatchDefLine implements HatchDefLineProps {\r\n public angle?: Angle;\r\n public through?: Point2d;\r\n public offset?: Point2d;\r\n public dashes?: number[];\r\n\r\n public constructor(json: HatchDefLineProps) {\r\n this.angle = json.angle ? Angle.fromJSON(json.angle) : undefined;\r\n this.through = json.through ? Point2d.fromJSON(json.through) : undefined;\r\n this.offset = json.offset ? Point2d.fromJSON(json.offset) : undefined;\r\n if (json.dashes) {\r\n const dashes: number[] = [];\r\n json.dashes.forEach((dash) => dashes.push(dash));\r\n this.dashes = dashes;\r\n }\r\n }\r\n }\r\n\r\n /** Definition of a hatch, cross-hatch, or area pattern that can be applied to the interior of a planar region.\r\n * @see [[GeometryStreamEntryProps]]\r\n */\r\n export interface ParamsProps {\r\n /** Pattern offset (relative to placement), 0.0,0.0,0.0 if undefined */\r\n origin?: XYZProps;\r\n /** Pattern orientation (relative to placement), 0.0,0.0,0.0 if undefined */\r\n rotation?: YawPitchRollProps;\r\n /** Spacing of first set of parallel lines in a hatch pattern, or row spacing between area pattern tiles, 0.0 if undefined */\r\n space1?: number;\r\n /** Spacing of second set of parallel lines in a cross-hatch (leave undefined or 0 for a hatch), or column spacing between area pattern tiles, 0.0 if undefined */\r\n space2?: number;\r\n /** Angle of first set of parallel lines in a hatch pattern or area pattern tile direction, 0.0 if undefined */\r\n angle1?: AngleProps;\r\n /** Angle of second set of parallel lines in a cross-hatch, 0.0 if undefined */\r\n angle2?: AngleProps;\r\n /** Scale to apply to area pattern symbol, 1.0 if undefined */\r\n scale?: number;\r\n /** Pattern color, leave undefined to inherit color from parent element. For area patterns, does not override explicit colors stored in symbol */\r\n color?: ColorDefProps;\r\n /** Pattern weight, leave undefined to inherit weight from parent element. For area patterns, does not override explicit weights stored in symbol */\r\n weight?: number;\r\n /** Set to inhibit display of pattern boundary, not applicable when boundary is also filled, false if undefined */\r\n invisibleBoundary?: boolean;\r\n /** Set to allow snapping to pattern geometry, false if undefined */\r\n snappable?: boolean;\r\n /** [[GeometryPart]] id to use for tiled area pattern display */\r\n symbolId?: Id64String;\r\n /** Define an area pattern by supplying hatch line definitions instead of using a [[GeometryPart]] */\r\n defLines?: HatchDefLineProps[];\r\n }\r\n\r\n /** Defines a hatch, cross hatch, or area pattern. */\r\n export class Params {\r\n public origin?: Point3d;\r\n public rotation?: YawPitchRollAngles;\r\n public space1?: number;\r\n public space2?: number;\r\n public angle1?: Angle;\r\n public angle2?: Angle;\r\n public scale?: number;\r\n public color?: ColorDef;\r\n public weight?: number;\r\n public invisibleBoundary?: boolean;\r\n public snappable?: boolean;\r\n public symbolId?: Id64String;\r\n public defLines?: HatchDefLine[];\r\n\r\n /** create an AreaPattern.Params from a json object. */\r\n public static fromJSON(json?: ParamsProps) {\r\n const result = new Params();\r\n if (!json)\r\n return result;\r\n result.origin = json.origin ? Point3d.fromJSON(json.origin) : undefined;\r\n result.rotation = json.rotation ? YawPitchRollAngles.fromJSON(json.rotation) : undefined;\r\n result.space1 = json.space1;\r\n result.space2 = json.space2;\r\n result.angle1 = json.angle1 ? Angle.fromJSON(json.angle1) : undefined;\r\n result.angle2 = json.angle2 ? Angle.fromJSON(json.angle2) : undefined;\r\n result.scale = json.scale;\r\n result.color = json.color ? ColorDef.fromJSON(json.color) : undefined;\r\n result.weight = json.weight;\r\n result.invisibleBoundary = json.invisibleBoundary;\r\n result.snappable = json.snappable;\r\n result.symbolId = json.symbolId ? Id64.fromJSON(json.symbolId) : undefined;\r\n if (!json.defLines)\r\n return result;\r\n const defLines: HatchDefLine[] = [];\r\n json.defLines.forEach((defLine) => defLines.push(new HatchDefLine(defLine)));\r\n result.defLines = defLines;\r\n return result;\r\n }\r\n\r\n public toJSON(): ParamsProps {\r\n return {\r\n ...this,\r\n color: this.color?.toJSON(),\r\n };\r\n }\r\n\r\n public clone(): Params {\r\n return Params.fromJSON(this.toJSON());\r\n }\r\n\r\n public equals(other: Params): boolean {\r\n if (this === other)\r\n return true; // Same pointer\r\n\r\n if (this.scale !== other.scale ||\r\n this.space1 !== other.space1 ||\r\n this.space2 !== other.space2 ||\r\n this.weight !== other.weight ||\r\n this.invisibleBoundary !== other.invisibleBoundary ||\r\n this.snappable !== other.snappable)\r\n return false;\r\n\r\n if ((this.color === undefined) !== (other.color === undefined))\r\n return false;\r\n if (this.color && !this.color.equals(other.color!))\r\n return false;\r\n\r\n if ((this.angle1 === undefined) !== (other.angle1 === undefined))\r\n return false;\r\n if (this.angle1 && !this.angle1.isAlmostEqualNoPeriodShift(other.angle1!))\r\n return false;\r\n\r\n if ((this.angle2 === undefined) !== (other.angle2 === undefined))\r\n return false;\r\n if (this.angle2 && !this.angle2.isAlmostEqualNoPeriodShift(other.angle2!))\r\n return false;\r\n\r\n if ((this.origin === undefined) !== (other.origin === undefined))\r\n return false;\r\n if (this.origin && !this.origin.isAlmostEqual(other.origin!))\r\n return false;\r\n\r\n if ((this.rotation === undefined) !== (other.rotation === undefined))\r\n return false;\r\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\r\n return false;\r\n\r\n if ((this.symbolId === undefined) !== (other.symbolId === undefined))\r\n return false;\r\n if (this.symbolId && !(this.symbolId === other.symbolId!))\r\n return false;\r\n\r\n if ((this.defLines === undefined) !== (other.defLines === undefined))\r\n return false;\r\n if (this.defLines) {\r\n if (this.defLines.length !== other.defLines!.length)\r\n return false;\r\n\r\n for (let i = 0; i < this.defLines.length; ++i) {\r\n const otherLine = other.defLines![i];\r\n const thisLine = this.defLines[i];\r\n\r\n if ((thisLine.angle === undefined) !== (otherLine.angle === undefined))\r\n return false;\r\n if (thisLine.angle && !thisLine.angle.isAlmostEqualNoPeriodShift(otherLine.angle!))\r\n return false;\r\n\r\n if ((thisLine.through === undefined) !== (otherLine.through === undefined))\r\n return false;\r\n if (thisLine.through && !thisLine.through.isAlmostEqual(otherLine.through!))\r\n return false;\r\n\r\n if ((thisLine.offset === undefined) !== (otherLine.offset === undefined))\r\n return false;\r\n if (thisLine.offset && !thisLine.offset.isAlmostEqual(otherLine.offset!))\r\n return false;\r\n\r\n if ((thisLine.dashes === undefined) !== (otherLine.dashes === undefined))\r\n return false;\r\n if (thisLine.dashes && thisLine.dashes.length !== otherLine.dashes!.length)\r\n return false;\r\n if (thisLine.dashes) {\r\n for (let dash = 0; dash < thisLine.dashes.length; ++dash) {\r\n if (!Geometry.isSameCoordinate(thisLine.dashes[dash], otherLine.dashes![dash]))\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public static transformPatternSpace(transform: Transform, oldSpace: number, patRot: Matrix3d, angle?: Angle): number {\r\n let tmpRot: Matrix3d;\r\n if (angle && !angle.isAlmostZero) {\r\n const yprTriple = new YawPitchRollAngles(angle);\r\n const angRot = yprTriple.toMatrix3d();\r\n tmpRot = patRot.multiplyMatrixMatrix(angRot);\r\n } else {\r\n tmpRot = patRot;\r\n }\r\n const yDir = tmpRot.getColumn(1);\r\n yDir.scale(oldSpace, yDir);\r\n transform.multiplyVector(yDir, yDir);\r\n return yDir.magnitude();\r\n }\r\n\r\n public static getTransformPatternScale(transform: Transform): number {\r\n const xDir = transform.matrix.getColumn(0);\r\n const mag = xDir.magnitude();\r\n return (mag > 1.0e-10) ? mag : 1.0;\r\n }\r\n\r\n public applyTransform(transform: Transform): boolean {\r\n if (transform.isIdentity)\r\n return true;\r\n let origin = this.origin ? this.origin : Point3d.createZero();\r\n const rMatrix = this.rotation ? this.rotation.toMatrix3d() : Matrix3d.createIdentity();\r\n if (this.symbolId !== undefined) {\r\n this.space1 = Params.transformPatternSpace(transform, this.space1 ? this.space1 : 0.0, rMatrix, this.angle1);\r\n this.space2 = Params.transformPatternSpace(transform, this.space2 ? this.space2 : 0.0, rMatrix, this.angle2);\r\n const scale = Params.getTransformPatternScale(transform);\r\n this.scale = this.scale ? this.scale * scale : scale;\r\n } else if (this.defLines) {\r\n const scale = Params.getTransformPatternScale(transform);\r\n if (!Geometry.isSameCoordinate(scale, 1.0)) {\r\n this.scale = this.scale ? this.scale * scale : scale;\r\n for (const line of this.defLines) {\r\n if (line.through) {\r\n line.through.x *= scale;\r\n line.through.y *= scale;\r\n }\r\n if (line.offset) {\r\n line.offset.x *= scale;\r\n line.offset.y *= scale;\r\n }\r\n if (line.dashes) {\r\n for (let iDash = 0; iDash < line.dashes.length; iDash++)\r\n line.dashes[iDash] *= scale;\r\n }\r\n }\r\n }\r\n } else {\r\n this.space1 = Params.transformPatternSpace(transform, this.space1 ? this.space1 : 0.0, rMatrix, this.angle1);\r\n if (this.space2 && 0 !== this.space2)\r\n this.space2 = Params.transformPatternSpace(transform, this.space2, rMatrix, this.angle2);\r\n }\r\n\r\n origin = transform.multiplyPoint3d(origin);\r\n rMatrix.multiplyMatrixMatrix(transform.matrix, rMatrix);\r\n const normalized = Matrix3d.createRigidFromMatrix3d(rMatrix);\r\n if (!normalized)\r\n return false;\r\n const newRotation = YawPitchRollAngles.createFromMatrix3d(normalized);\r\n if (undefined === newRotation)\r\n return false;\r\n this.origin = origin;\r\n this.rotation = newRotation;\r\n return true;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AreaPattern.js","sourceRoot":"","sources":["../../../src/geometry/AreaPattern.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,KAAK,EAAc,QAAQ,EAAE,QAAQ,EAAE,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SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC7G,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;oBAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7F,CAAC;YAED,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC3C,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,CAAC,UAAU;gBACb,OAAO,KAAK,CAAC;YACf,MAAM,WAAW,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;YACtE,IAAI,SAAS,KAAK,WAAW;gBAC3B,OAAO,KAAK,CAAC;YACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAzMY,kBAAM,SAyMlB,CAAA;AACH,CAAC,EA1QgB,WAAW,KAAX,WAAW,QA0Q3B","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 Symbology\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, AngleProps, Geometry, Matrix3d, Point2d, Point3d, Transform, XYProps, XYZProps, YawPitchRollAngles, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\r\n\r\n/** @public */\r\nexport namespace AreaPattern {\r\n /** Single hatch line definition */\r\n export interface HatchDefLineProps {\r\n /** Angle of hatch line, 0.0 if undefined */\r\n angle?: AngleProps;\r\n /** Origin point (relative to placement) the hatch passes through, 0.0,0.0 if undefined */\r\n through?: XYProps;\r\n /** Offset of successive lines. X offset staggers dashes (ignored for solid lines) and Y offset controls the distance between both solid and dashed lines, 0.0,0.0 if undefined */\r\n offset?: XYProps;\r\n /** Array of gap and dash lengths for creating non-solid hatch lines, max of 20. A positive value denotes dash, a negative value a gap, solid line if undefined */\r\n dashes?: number[];\r\n }\r\n\r\n export class HatchDefLine implements HatchDefLineProps {\r\n public angle?: Angle;\r\n public through?: Point2d;\r\n public offset?: Point2d;\r\n public dashes?: number[];\r\n\r\n public constructor(json: HatchDefLineProps) {\r\n this.angle = json.angle ? Angle.fromJSON(json.angle) : undefined;\r\n this.through = json.through ? Point2d.fromJSON(json.through) : undefined;\r\n this.offset = json.offset ? Point2d.fromJSON(json.offset) : undefined;\r\n if (json.dashes) {\r\n const dashes: number[] = [];\r\n json.dashes.forEach((dash) => dashes.push(dash));\r\n this.dashes = dashes;\r\n }\r\n }\r\n }\r\n\r\n /** Definition of a hatch, cross-hatch, or area pattern that can be applied to the interior of a planar region.\r\n * @see [[GeometryStreamEntryProps]]\r\n */\r\n export interface ParamsProps {\r\n /** Pattern offset (relative to placement), 0.0,0.0,0.0 if undefined */\r\n origin?: XYZProps;\r\n /** Pattern orientation (relative to placement), 0.0,0.0,0.0 if undefined */\r\n rotation?: YawPitchRollProps;\r\n /** Spacing of first set of parallel lines in a hatch pattern, or row spacing between area pattern tiles, 0.0 if undefined */\r\n space1?: number;\r\n /** Spacing of second set of parallel lines in a cross-hatch (leave undefined or 0 for a hatch), or column spacing between area pattern tiles, 0.0 if undefined */\r\n space2?: number;\r\n /** Angle of first set of parallel lines in a hatch pattern or area pattern tile direction, 0.0 if undefined */\r\n angle1?: AngleProps;\r\n /** Angle of second set of parallel lines in a cross-hatch, 0.0 if undefined */\r\n angle2?: AngleProps;\r\n /** Scale to apply to area pattern symbol, 1.0 if undefined */\r\n scale?: number;\r\n /** Pattern color, leave undefined to inherit color from parent element. For area patterns, does not override explicit colors stored in symbol */\r\n color?: ColorDefProps;\r\n /** Pattern weight, leave undefined to inherit weight from parent element. For area patterns, does not override explicit weights stored in symbol */\r\n weight?: number;\r\n /** Set to inhibit display of pattern boundary, not applicable when boundary is also filled, false if undefined */\r\n invisibleBoundary?: boolean;\r\n /** Set to allow snapping to pattern geometry, false if undefined */\r\n snappable?: boolean;\r\n /** [[GeometryPart]] id to use for tiled area pattern display */\r\n symbolId?: Id64String;\r\n /** Define an area pattern by supplying hatch line definitions instead of using a [[GeometryPart]] */\r\n defLines?: HatchDefLineProps[];\r\n }\r\n\r\n /** Defines a hatch, cross hatch, or area pattern. */\r\n export class Params {\r\n public origin?: Point3d;\r\n public rotation?: YawPitchRollAngles;\r\n public space1?: number;\r\n public space2?: number;\r\n public angle1?: Angle;\r\n public angle2?: Angle;\r\n public scale?: number;\r\n public color?: ColorDef;\r\n public weight?: number;\r\n public invisibleBoundary?: boolean;\r\n public snappable?: boolean;\r\n public symbolId?: Id64String;\r\n public defLines?: HatchDefLine[];\r\n\r\n /** create an AreaPattern.Params from a json object. */\r\n public static fromJSON(json?: ParamsProps) {\r\n const result = new Params();\r\n if (!json)\r\n return result;\r\n result.origin = json.origin ? Point3d.fromJSON(json.origin) : undefined;\r\n result.rotation = json.rotation ? YawPitchRollAngles.fromJSON(json.rotation) : undefined;\r\n result.space1 = json.space1;\r\n result.space2 = json.space2;\r\n result.angle1 = json.angle1 ? Angle.fromJSON(json.angle1) : undefined;\r\n result.angle2 = json.angle2 ? Angle.fromJSON(json.angle2) : undefined;\r\n result.scale = json.scale;\r\n result.color = json.color ? ColorDef.fromJSON(json.color) : undefined;\r\n result.weight = json.weight;\r\n result.invisibleBoundary = json.invisibleBoundary;\r\n result.snappable = json.snappable;\r\n result.symbolId = json.symbolId ? Id64.fromJSON(json.symbolId) : undefined;\r\n if (!json.defLines)\r\n return result;\r\n const defLines: HatchDefLine[] = [];\r\n json.defLines.forEach((defLine) => defLines.push(new HatchDefLine(defLine)));\r\n result.defLines = defLines;\r\n return result;\r\n }\r\n\r\n public toJSON(): ParamsProps {\r\n return {\r\n ...this,\r\n color: this.color?.toJSON(),\r\n };\r\n }\r\n\r\n public clone(): Params {\r\n return Params.fromJSON(this.toJSON());\r\n }\r\n\r\n public equals(other: Params): boolean {\r\n if (this === other)\r\n return true; // Same pointer\r\n\r\n if (this.scale !== other.scale ||\r\n this.space1 !== other.space1 ||\r\n this.space2 !== other.space2 ||\r\n this.weight !== other.weight ||\r\n this.invisibleBoundary !== other.invisibleBoundary ||\r\n this.snappable !== other.snappable)\r\n return false;\r\n\r\n if ((this.color === undefined) !== (other.color === undefined))\r\n return false;\r\n if (this.color && !this.color.equals(other.color!))\r\n return false;\r\n\r\n if ((this.angle1 === undefined) !== (other.angle1 === undefined))\r\n return false;\r\n if (this.angle1 && !this.angle1.isAlmostEqualNoPeriodShift(other.angle1!))\r\n return false;\r\n\r\n if ((this.angle2 === undefined) !== (other.angle2 === undefined))\r\n return false;\r\n if (this.angle2 && !this.angle2.isAlmostEqualNoPeriodShift(other.angle2!))\r\n return false;\r\n\r\n if ((this.origin === undefined) !== (other.origin === undefined))\r\n return false;\r\n if (this.origin && !this.origin.isAlmostEqual(other.origin!))\r\n return false;\r\n\r\n if ((this.rotation === undefined) !== (other.rotation === undefined))\r\n return false;\r\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\r\n return false;\r\n\r\n if ((this.symbolId === undefined) !== (other.symbolId === undefined))\r\n return false;\r\n if (this.symbolId && !(this.symbolId === other.symbolId!))\r\n return false;\r\n\r\n if ((this.defLines === undefined) !== (other.defLines === undefined))\r\n return false;\r\n if (this.defLines) {\r\n if (this.defLines.length !== other.defLines!.length)\r\n return false;\r\n\r\n for (let i = 0; i < this.defLines.length; ++i) {\r\n const otherLine = other.defLines![i];\r\n const thisLine = this.defLines[i];\r\n\r\n if ((thisLine.angle === undefined) !== (otherLine.angle === undefined))\r\n return false;\r\n if (thisLine.angle && !thisLine.angle.isAlmostEqualNoPeriodShift(otherLine.angle!))\r\n return false;\r\n\r\n if ((thisLine.through === undefined) !== (otherLine.through === undefined))\r\n return false;\r\n if (thisLine.through && !thisLine.through.isAlmostEqual(otherLine.through!))\r\n return false;\r\n\r\n if ((thisLine.offset === undefined) !== (otherLine.offset === undefined))\r\n return false;\r\n if (thisLine.offset && !thisLine.offset.isAlmostEqual(otherLine.offset!))\r\n return false;\r\n\r\n if ((thisLine.dashes === undefined) !== (otherLine.dashes === undefined))\r\n return false;\r\n if (thisLine.dashes && thisLine.dashes.length !== otherLine.dashes!.length)\r\n return false;\r\n if (thisLine.dashes) {\r\n for (let dash = 0; dash < thisLine.dashes.length; ++dash) {\r\n if (!Geometry.isSameCoordinate(thisLine.dashes[dash], otherLine.dashes![dash]))\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public static transformPatternSpace(transform: Transform, oldSpace: number, patRot: Matrix3d, angle?: Angle): number {\r\n let tmpRot: Matrix3d;\r\n if (angle && !angle.isAlmostZero) {\r\n const yprTriple = new YawPitchRollAngles(angle);\r\n const angRot = yprTriple.toMatrix3d();\r\n tmpRot = patRot.multiplyMatrixMatrix(angRot);\r\n } else {\r\n tmpRot = patRot;\r\n }\r\n const yDir = tmpRot.getColumn(1);\r\n yDir.scale(oldSpace, yDir);\r\n transform.multiplyVector(yDir, yDir);\r\n return yDir.magnitude();\r\n }\r\n\r\n public static getTransformPatternScale(transform: Transform): number {\r\n const xDir = transform.matrix.getColumn(0);\r\n const mag = xDir.magnitude();\r\n return (mag > 1.0e-10) ? mag : 1.0;\r\n }\r\n\r\n public applyTransform(transform: Transform): boolean {\r\n if (transform.isIdentity)\r\n return true;\r\n let origin = this.origin ? this.origin : Point3d.createZero();\r\n const rMatrix = this.rotation ? this.rotation.toMatrix3d() : Matrix3d.createIdentity();\r\n if (this.symbolId !== undefined) {\r\n this.space1 = Params.transformPatternSpace(transform, this.space1 ? this.space1 : 0.0, rMatrix, this.angle1);\r\n this.space2 = Params.transformPatternSpace(transform, this.space2 ? this.space2 : 0.0, rMatrix, this.angle2);\r\n const scale = Params.getTransformPatternScale(transform);\r\n this.scale = this.scale ? this.scale * scale : scale;\r\n } else if (this.defLines) {\r\n const scale = Params.getTransformPatternScale(transform);\r\n if (!Geometry.isSameCoordinate(scale, 1.0)) {\r\n this.scale = this.scale ? this.scale * scale : scale;\r\n for (const line of this.defLines) {\r\n if (line.through) {\r\n line.through.x *= scale;\r\n line.through.y *= scale;\r\n }\r\n if (line.offset) {\r\n line.offset.x *= scale;\r\n line.offset.y *= scale;\r\n }\r\n if (line.dashes) {\r\n for (let iDash = 0; iDash < line.dashes.length; iDash++)\r\n line.dashes[iDash] *= scale;\r\n }\r\n }\r\n }\r\n } else {\r\n this.space1 = Params.transformPatternSpace(transform, this.space1 ? this.space1 : 0.0, rMatrix, this.angle1);\r\n if (this.space2 && 0 !== this.space2)\r\n this.space2 = Params.transformPatternSpace(transform, this.space2, rMatrix, this.angle2);\r\n }\r\n\r\n origin = transform.multiplyPoint3d(origin);\r\n rMatrix.multiplyMatrixMatrix(transform.matrix, rMatrix);\r\n const normalized = Matrix3d.createRigidFromMatrix3d(rMatrix);\r\n if (!normalized)\r\n return false;\r\n const newRotation = YawPitchRollAngles.createFromMatrix3d(normalized);\r\n if (undefined === newRotation)\r\n return false;\r\n this.origin = origin;\r\n this.rotation = newRotation;\r\n return true;\r\n }\r\n }\r\n}\r\n"]}
@@ -10,7 +10,7 @@ import { assert } from "@itwin/core-bentley";
10
10
  /** A position on the earth defined by longitude, latitude, and height above the [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System) ellipsoid.
11
11
  * @public
12
12
  */
13
- class Cartographic {
13
+ export class Cartographic {
14
14
  /**
15
15
  * @param longitude longitude, in radians.
16
16
  * @param latitude latitude, in radians.
@@ -264,7 +264,6 @@ Cartographic._scratchN = new Vector3d();
264
264
  Cartographic._scratchK = new Vector3d();
265
265
  Cartographic._scaleToGeodeticSurfaceIntersection = new Point3d();
266
266
  Cartographic._scaleToGeodeticSurfaceGradient = new Point3d();
267
- export { Cartographic };
268
267
  /** A cartographic range representing a rectangular region if low longitude/latitude > high then area crossing seam is indicated.
269
268
  * @public
270
269
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Cartographic.js","sourceRoot":"","sources":["../../../src/geometry/Cartographic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAsB,QAAQ,EAAe,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAiB7C;;GAEG;AACH,MAAa,YAAY;IACvB;;;;OAIG;IACH,YAA2B,YAAoB,CAAC,EAAS,WAAmB,CAAC,EAAS,SAAiB,CAAC;QAA7E,cAAS,GAAT,SAAS,CAAY;QAAS,aAAQ,GAAR,QAAQ,CAAY;QAAS,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE7G,iFAAiF;IAC1E,MAAM,CAAC,UAAU;QACtB,OAAO,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,IAA8D,EAAE,MAAqB;QAC7G,IAAI,CAAC,MAAM;YACT,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAEtE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,CAAC,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CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACvG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;aACpH;iBAAM;gBACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;aACtH;SACF;IACH,CAAC;IAEM,eAAe,CAAC,KAAwB;QAC7C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO;YAC9B,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,OAAO;gBACpC,IAAI,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC;oBACnC,OAAO,IAAI,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;OAOG;IACI,+BAA+B;QACpC,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1G,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { Angle, Constant, Point3d, Range1d, Range2d, Range3d, Transform, Vector3d, XYAndZ, XYZ } from \"@itwin/core-geometry\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\n\r\n// portions adapted from Cesium.js Copyright 2011 - 2017 Cesium Contributors\r\n\r\n/** The JSON representation of a Cartographic object.\r\n * @public\r\n * @extensions\r\n **/\r\nexport interface CartographicProps {\r\n /** The longitude, specified in radians. */\r\n longitude: number;\r\n /** The latitude, specified in radians. */\r\n latitude: number;\r\n /** The height, specified in meters above the ellipsoid. */\r\n height: number;\r\n}\r\n\r\n/** A position on the earth defined by longitude, latitude, and height above the [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System) ellipsoid.\r\n * @public\r\n */\r\nexport class Cartographic implements CartographicProps {\r\n /**\r\n * @param longitude longitude, in radians.\r\n * @param latitude latitude, in radians.\r\n * @param height The height, in meters, above the ellipsoid.\r\n */\r\n private constructor(public longitude: number = 0, public latitude: number = 0, public height: number = 0) { }\r\n\r\n /** Create a Cartographic object with longitude, latitude, and height of zero. */\r\n public static createZero() {\r\n return new Cartographic(0, 0, 0);\r\n }\r\n\r\n /** Create a new Cartographic from longitude and latitude specified in radians.\r\n * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are numbers specified in radians. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero.\r\n * @param result The object onto which to store the result.\r\n */\r\n public static fromRadians(args: { longitude: number, latitude: number, height?: number }, result?: Cartographic) {\r\n if (!result)\r\n return new Cartographic(args.longitude, args.latitude, args.height);\r\n\r\n result.longitude = args.longitude;\r\n result.latitude = args.latitude;\r\n result.height = args.height !== undefined ? args.height : 0;\r\n return result;\r\n }\r\n\r\n /** Create a JSON representation of a Cartographic object. */\r\n public toJSON(): CartographicProps {\r\n return {\r\n latitude: this.latitude,\r\n longitude: this.longitude,\r\n height: this.height,\r\n };\r\n }\r\n\r\n /** Freeze this Cartographic */\r\n public freeze(): Readonly<this> {\r\n return Object.freeze(this);\r\n }\r\n\r\n /** longitude, in degrees */\r\n public get longitudeDegrees() {\r\n return Angle.radiansToDegrees(this.longitude);\r\n }\r\n\r\n /** latitude, in degrees */\r\n public get latitudeDegrees() {\r\n return Angle.radiansToDegrees(this.latitude);\r\n }\r\n\r\n private static _oneMinusF = 1 - (Constant.earthRadiusWGS84.equator - Constant.earthRadiusWGS84.polar) / Constant.earthRadiusWGS84.equator;\r\n private static _equatorOverPolar = Constant.earthRadiusWGS84.equator / Constant.earthRadiusWGS84.polar;\r\n /** return the geocentric latitude angle for the input geodetic latitude angle (both in radians).\r\n * @param geodeticLatitude geodetic latitude angle in radians\r\n */\r\n public static geocentricLatitudeFromGeodeticLatitude(geodeticLatitude: number): number {\r\n return Math.atan(Cartographic._oneMinusF * Cartographic._oneMinusF * Math.tan(geodeticLatitude));\r\n }\r\n /** return the parametric latitude angle for the input geodetic latitude angle (both in radians). The parametric latitude\r\n * is appropriate for input to the Ellipsoid methods.\r\n * @param geodeticLatitude geodetic latitude angle in radians\r\n */\r\n public static parametricLatitudeFromGeodeticLatitude(geodeticLatitude: number): number {\r\n return Math.atan(Cartographic._oneMinusF * Cartographic._oneMinusF * Cartographic._equatorOverPolar * Math.tan(geodeticLatitude));\r\n }\r\n\r\n /** Create a new Cartographic from longitude and latitude specified in degrees. The values in the resulting object will be in radians.\r\n * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are numbers specified in degrees. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero.\r\n * @param result The object onto which to store the result.\r\n */\r\n public static fromDegrees(args: { longitude: number, latitude: number, height?: number }, result?: Cartographic) {\r\n return Cartographic.fromRadians({ longitude: Angle.degreesToRadians(args.longitude), latitude: Angle.degreesToRadians(args.latitude), height: args.height }, result);\r\n }\r\n\r\n /** Create a new Cartographic from longitude and latitude in [Angle]($geometry)s. The values in the resulting object will be in radians.\r\n * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are Angle objects. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero.\r\n * @param result The object into which to store the result (optional)\r\n */\r\n public static fromAngles(args: { longitude: Angle, latitude: Angle, height?: number }, result?: Cartographic) {\r\n return Cartographic.fromRadians({ longitude: args.longitude.radians, latitude: args.latitude.radians, height: args.height }, result);\r\n }\r\n\r\n private static _cartesianToCartographicN = new Point3d();\r\n private static _cartesianToCartographicP = new Point3d();\r\n private static _cartesianToCartographicH = new Vector3d();\r\n private static _wgs84OneOverRadii = new Point3d(1.0 / 6378137.0, 1.0 / 6378137.0, 1.0 / 6356752.3142451793);\r\n private static _wgs84OneOverRadiiSquared = new Point3d(1.0 / (6378137.0 * 6378137.0), 1.0 / (6378137.0 * 6378137.0), 1.0 / (6356752.3142451793 * 6356752.3142451793));\r\n private static _wgs84RadiiSquared = new Point3d(6378137.0 * 6378137.0, 6378137.0 * 6378137.0, 6356752.3142451793 * 6356752.3142451793);\r\n private static _wgs84CenterToleranceSquared = 0.1;\r\n private static _scratchN = new Vector3d();\r\n private static _scratchK = new Vector3d();\r\n\r\n /** Creates a new Cartographic from an [ECEF](https://en.wikipedia.org/wiki/ECEF) position.\r\n * @param cartesian The position, in ECEF, to convert to cartographic representation.\r\n * @param [result] The object onto which to store the result.\r\n * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\r\n */\r\n public static fromEcef(cartesian: Point3d, result?: Cartographic): Cartographic | undefined {\r\n const oneOverRadiiSquared = Cartographic._wgs84OneOverRadiiSquared;\r\n const p = Cartographic.scalePointToGeodeticSurface(cartesian, Cartographic._cartesianToCartographicP);\r\n\r\n if (!p)\r\n return undefined;\r\n\r\n const n = Cartographic._cartesianToCartographicN;\r\n Cartographic.multiplyComponents(p, oneOverRadiiSquared, n);\r\n Cartographic.normalize(n, n);\r\n\r\n const h = p.vectorTo(cartesian, Cartographic._cartesianToCartographicH);\r\n const longitude = Math.atan2(n.y, n.x);\r\n const latitude = Math.asin(n.z);\r\n const height = Math.sign(h.dotProduct(cartesian)) * h.magnitude();\r\n\r\n if (!result)\r\n return new Cartographic(longitude, latitude, height);\r\n\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n }\r\n\r\n /** Scale point to geodetic surface\r\n * @param point in ECEF to scale to the surface\r\n * @param [result] The object onto which to store the result.\r\n * @returns a point on the geodetic surface\r\n */\r\n public static scalePointToGeodeticSurface(point: Point3d, result?: Point3d): Point3d | undefined {\r\n const oneOverRadii = Cartographic._wgs84OneOverRadii;\r\n const oneOverRadiiSquared = Cartographic._wgs84OneOverRadiiSquared;\r\n const centerToleranceSquared = Cartographic._wgs84CenterToleranceSquared;\r\n return Cartographic._scaleToGeodeticSurface(point, oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, result);\r\n }\r\n\r\n /** Duplicates a Cartographic. */\r\n public clone(result?: Cartographic): Cartographic {\r\n if (!result)\r\n return new Cartographic(this.longitude, this.latitude, this.height);\r\n\r\n result.longitude = this.longitude;\r\n result.latitude = this.latitude;\r\n result.height = this.height;\r\n return result;\r\n }\r\n\r\n /** Return true if this Cartographic is the same as right */\r\n public equals(right: CartographicProps): boolean {\r\n return (this === right) ||\r\n ((this.longitude === right.longitude) &&\r\n (this.latitude === right.latitude) &&\r\n (this.height === right.height));\r\n }\r\n\r\n /** Compares this Cartographic component-wise and returns true if they are within the provided epsilon, */\r\n public equalsEpsilon(right: CartographicProps, epsilon: number): boolean {\r\n return (this === right) ||\r\n ((Math.abs(this.longitude - right.longitude) <= epsilon) &&\r\n (Math.abs(this.latitude - right.latitude) <= epsilon) &&\r\n (Math.abs(this.height - right.height) <= epsilon));\r\n }\r\n\r\n private static normalize(cartesian: XYZ, result: XYZ) {\r\n const magnitude = cartesian.magnitude();\r\n result.x = cartesian.x / magnitude;\r\n result.y = cartesian.y / magnitude;\r\n result.z = cartesian.z / magnitude;\r\n }\r\n\r\n private static multiplyComponents(left: XYAndZ, right: XYAndZ, result: XYZ) {\r\n result.x = left.x * right.x;\r\n result.y = left.y * right.y;\r\n result.z = left.z * right.z;\r\n }\r\n\r\n private static scalePoint(cartesian: XYAndZ, scalar: number, result: XYZ) {\r\n result.x = cartesian.x * scalar;\r\n result.y = cartesian.y * scalar;\r\n result.z = cartesian.z * scalar;\r\n }\r\n\r\n private static addPoints(left: XYAndZ, right: XYAndZ, result: XYZ) {\r\n result.x = left.x + right.x;\r\n result.y = left.y + right.y;\r\n result.z = left.z + right.z;\r\n }\r\n\r\n /** Create a string representing this cartographic in the format '(longitude, latitude, height)'. */\r\n public toString(): string { return `(${this.longitude}, ${this.latitude}, ${this.height})`; }\r\n\r\n private static _scaleToGeodeticSurfaceIntersection = new Point3d();\r\n private static _scaleToGeodeticSurfaceGradient = new Point3d();\r\n private static _scaleToGeodeticSurface(cartesian: Point3d, oneOverRadii: XYAndZ, oneOverRadiiSquared: XYAndZ, centerToleranceSquared: number, result?: Point3d) {\r\n const positionX = cartesian.x;\r\n const positionY = cartesian.y;\r\n const positionZ = cartesian.z;\r\n\r\n const oneOverRadiiX = oneOverRadii.x;\r\n const oneOverRadiiY = oneOverRadii.y;\r\n const oneOverRadiiZ = oneOverRadii.z;\r\n\r\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\r\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\r\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\r\n\r\n // Compute the squared ellipsoid norm.\r\n const squaredNorm = x2 + y2 + z2;\r\n const ratio = Math.sqrt(1.0 / squaredNorm);\r\n\r\n // As an initial approximation, assume that the radial intersection is the projection point.\r\n const intersection = Cartographic._scaleToGeodeticSurfaceIntersection;\r\n Cartographic.scalePoint(cartesian, ratio, intersection);\r\n\r\n // If the position is near the center, the iteration will not converge.\r\n if (squaredNorm < centerToleranceSquared) {\r\n return !isFinite(ratio) ? undefined : Point3d.createFrom(intersection, result);\r\n }\r\n\r\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\r\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\r\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\r\n\r\n // Use the gradient at the intersection point in place of the true unit normal.\r\n // The difference in magnitude will be absorbed in the multiplier.\r\n const gradient = Cartographic._scaleToGeodeticSurfaceGradient;\r\n gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\r\n gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\r\n gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\r\n\r\n // Compute the initial guess at the normal vector multiplier, lambda.\r\n let lambda = (1.0 - ratio) * cartesian.magnitude() / (0.5 * gradient.magnitude());\r\n let correction = 0.0;\r\n let func;\r\n let denominator;\r\n let xMultiplier;\r\n let yMultiplier;\r\n let zMultiplier;\r\n let xMultiplier2;\r\n let yMultiplier2;\r\n let zMultiplier2;\r\n let xMultiplier3;\r\n let yMultiplier3;\r\n let zMultiplier3;\r\n\r\n do {\r\n lambda -= correction;\r\n\r\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\r\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\r\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\r\n\r\n xMultiplier2 = xMultiplier * xMultiplier;\r\n yMultiplier2 = yMultiplier * yMultiplier;\r\n zMultiplier2 = zMultiplier * zMultiplier;\r\n\r\n xMultiplier3 = xMultiplier2 * xMultiplier;\r\n yMultiplier3 = yMultiplier2 * yMultiplier;\r\n zMultiplier3 = zMultiplier2 * zMultiplier;\r\n\r\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\r\n\r\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\r\n // computations in the sections to follow.\r\n denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;\r\n\r\n const derivative = -2.0 * denominator;\r\n\r\n correction = func / derivative;\r\n } while (Math.abs(func) > 0.01);\r\n\r\n if (!result)\r\n return new Point3d(positionX * xMultiplier, positionY * yMultiplier, positionZ * zMultiplier);\r\n\r\n result.x = positionX * xMultiplier;\r\n result.y = positionY * yMultiplier;\r\n result.z = positionZ * zMultiplier;\r\n return result;\r\n }\r\n\r\n /** Return an ECEF point from a Cartographic point */\r\n public toEcef(result?: Point3d): Point3d {\r\n const cosLatitude = Math.cos(this.latitude);\r\n const scratchN = Cartographic._scratchN;\r\n const scratchK = Cartographic._scratchK;\r\n scratchN.x = cosLatitude * Math.cos(this.longitude);\r\n scratchN.y = cosLatitude * Math.sin(this.longitude);\r\n scratchN.z = Math.sin(this.latitude);\r\n Cartographic.normalize(scratchN, scratchN);\r\n\r\n Cartographic.multiplyComponents(Cartographic._wgs84RadiiSquared, scratchN, scratchK);\r\n const gamma = Math.sqrt(scratchN.dotProduct(scratchK));\r\n Cartographic.scalePoint(scratchK, 1.0 / gamma, scratchK);\r\n Cartographic.scalePoint(scratchN, this.height, scratchN);\r\n\r\n result = result ? result : new Point3d();\r\n Cartographic.addPoints(scratchK, scratchN, result);\r\n return result;\r\n }\r\n}\r\n/** A cartographic range representing a rectangular region if low longitude/latitude > high then area crossing seam is indicated.\r\n * @public\r\n */\r\nexport class CartographicRange {\r\n private _ranges: Range2d[] = [];\r\n\r\n // These following are used to preserve the min/max latitude and longitudes.\r\n // The longitudes are raw values and may cross over the -PI or 2PI boundaries.\r\n private _minLongitude = 0;\r\n private _maxLongitude = 0;\r\n private _minLatitude = 0;\r\n private _maxLatitude = 0;\r\n constructor(spatialRange: Range3d, spatialToEcef: Transform) {\r\n // Compute 8 corners in spatial coordinate system before converting to ECEF\r\n // We want a box oriented in the spatial coordinate system and not in the ECEF coordinate system\r\n const spatialCorners = spatialRange.corners();\r\n const ecefCorners = spatialToEcef.multiplyPoint3dArray(spatialCorners);\r\n let low: Cartographic | undefined, high: Cartographic | undefined;\r\n\r\n for (const ecefCorner of ecefCorners) {\r\n const geoPt = Cartographic.fromEcef(ecefCorner);\r\n if (!geoPt)\r\n continue;\r\n if (undefined === low || undefined === high) {\r\n low = geoPt;\r\n high = geoPt.clone();\r\n continue;\r\n }\r\n low.latitude = Math.min(low.latitude, geoPt.latitude);\r\n low.longitude = Math.min(low.longitude, geoPt.longitude);\r\n high.latitude = Math.max(high.latitude, geoPt.latitude);\r\n high.longitude = Math.max(high.longitude, geoPt.longitude);\r\n }\r\n\r\n if (!low || !high) {\r\n assert(false);\r\n return;\r\n }\r\n\r\n const longitudeRanges = [];\r\n this._minLongitude = Math.min(low.longitude, high.longitude), this._maxLongitude = Math.max(low.longitude, high.longitude);\r\n if (this._maxLongitude - this._minLongitude > Angle.piRadians) {\r\n longitudeRanges.push(Range1d.createXX(0.0, this._minLongitude));\r\n longitudeRanges.push(Range1d.createXX(this._maxLongitude, Angle.pi2Radians));\r\n } else {\r\n longitudeRanges.push(Range1d.createXX(this._minLongitude, this._maxLongitude));\r\n }\r\n\r\n for (const longitudeRange of longitudeRanges) {\r\n this._minLatitude = Math.min(low.latitude, high.latitude), this._maxLatitude = Math.max(low.latitude, high.latitude);\r\n if (this._maxLatitude - this._minLatitude > Angle.piOver2Radians) {\r\n this._ranges.push(Range2d.createXYXY(longitudeRange.low, 0.0, longitudeRange.high, this._minLatitude));\r\n this._ranges.push(Range2d.createXYXY(longitudeRange.low, this._maxLatitude, longitudeRange.high, Angle.piRadians));\r\n } else {\r\n this._ranges.push(Range2d.createXYXY(longitudeRange.low, this._minLatitude, longitudeRange.high, this._maxLatitude));\r\n }\r\n }\r\n }\r\n\r\n public intersectsRange(other: CartographicRange): boolean {\r\n for (const range of this._ranges)\r\n for (const otherRange of other._ranges)\r\n if (range.intersectsRange(otherRange))\r\n return true;\r\n return false;\r\n }\r\n\r\n /** This method returns the raw latitude / longitude for the range in a Range2d object.\r\n * The X value represents the longitude and the Y value the latitudes.\r\n * Y values are kept between -PI and +PI while\r\n * longitude values can be expressed in any range between -2PI to +2PI\r\n * given the minimum longitude is always smaller numerically than the maximum longitude.\r\n * Note that usually the longitudes are usually by convention in the range of -PI to PI except\r\n * for ranges that overlap the -PI/+PI frontier in which case either representation is acceptable.\r\n */\r\n public getLongitudeLatitudeBoundingBox(): Range2d {\r\n return Range2d.createXYXY(this._minLongitude, this._minLatitude, this._maxLongitude, this._maxLatitude);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Cartographic.js","sourceRoot":"","sources":["../../../src/geometry/Cartographic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAsB,QAAQ,EAAe,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAiB7C;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB;;;;OAIG;IACH,YAA2B,YAAoB,CAAC,EAAS,WAAmB,CAAC,EAAS,SAAiB,CAAC;QAA7E,cAAS,GAAT,SAAS,CAAY;QAAS,aAAQ,GAAR,QAAQ,CAAY;QAAS,WAAM,GAAN,MAAM,CAAY;IAAI,CAAC;IAE7G,iFAAiF;IAC1E,MAAM,CAAC,UAAU;QACtB,OAAO,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,IAA8D,EAAE,MAAqB;QAC7G,IAAI,CAAC,MAAM;YACT,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAEtE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAChC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB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,YAAY,CAAC,CAAC,CAAC;gBACvG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YACrH,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YACvH,CAAC;QACH,CAAC;IACH,CAAC;IAEM,eAAe,CAAC,KAAwB;QAC7C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO;YAC9B,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,OAAO;gBACpC,IAAI,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC;oBACnC,OAAO,IAAI,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;OAOG;IACI,+BAA+B;QACpC,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1G,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { Angle, Constant, Point3d, Range1d, Range2d, Range3d, Transform, Vector3d, XYAndZ, XYZ } from \"@itwin/core-geometry\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\n\r\n// portions adapted from Cesium.js Copyright 2011 - 2017 Cesium Contributors\r\n\r\n/** The JSON representation of a Cartographic object.\r\n * @public\r\n * @extensions\r\n **/\r\nexport interface CartographicProps {\r\n /** The longitude, specified in radians. */\r\n longitude: number;\r\n /** The latitude, specified in radians. */\r\n latitude: number;\r\n /** The height, specified in meters above the ellipsoid. */\r\n height: number;\r\n}\r\n\r\n/** A position on the earth defined by longitude, latitude, and height above the [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System) ellipsoid.\r\n * @public\r\n */\r\nexport class Cartographic implements CartographicProps {\r\n /**\r\n * @param longitude longitude, in radians.\r\n * @param latitude latitude, in radians.\r\n * @param height The height, in meters, above the ellipsoid.\r\n */\r\n private constructor(public longitude: number = 0, public latitude: number = 0, public height: number = 0) { }\r\n\r\n /** Create a Cartographic object with longitude, latitude, and height of zero. */\r\n public static createZero() {\r\n return new Cartographic(0, 0, 0);\r\n }\r\n\r\n /** Create a new Cartographic from longitude and latitude specified in radians.\r\n * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are numbers specified in radians. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero.\r\n * @param result The object onto which to store the result.\r\n */\r\n public static fromRadians(args: { longitude: number, latitude: number, height?: number }, result?: Cartographic) {\r\n if (!result)\r\n return new Cartographic(args.longitude, args.latitude, args.height);\r\n\r\n result.longitude = args.longitude;\r\n result.latitude = args.latitude;\r\n result.height = args.height !== undefined ? args.height : 0;\r\n return result;\r\n }\r\n\r\n /** Create a JSON representation of a Cartographic object. */\r\n public toJSON(): CartographicProps {\r\n return {\r\n latitude: this.latitude,\r\n longitude: this.longitude,\r\n height: this.height,\r\n };\r\n }\r\n\r\n /** Freeze this Cartographic */\r\n public freeze(): Readonly<this> {\r\n return Object.freeze(this);\r\n }\r\n\r\n /** longitude, in degrees */\r\n public get longitudeDegrees() {\r\n return Angle.radiansToDegrees(this.longitude);\r\n }\r\n\r\n /** latitude, in degrees */\r\n public get latitudeDegrees() {\r\n return Angle.radiansToDegrees(this.latitude);\r\n }\r\n\r\n private static _oneMinusF = 1 - (Constant.earthRadiusWGS84.equator - Constant.earthRadiusWGS84.polar) / Constant.earthRadiusWGS84.equator;\r\n private static _equatorOverPolar = Constant.earthRadiusWGS84.equator / Constant.earthRadiusWGS84.polar;\r\n /** return the geocentric latitude angle for the input geodetic latitude angle (both in radians).\r\n * @param geodeticLatitude geodetic latitude angle in radians\r\n */\r\n public static geocentricLatitudeFromGeodeticLatitude(geodeticLatitude: number): number {\r\n return Math.atan(Cartographic._oneMinusF * Cartographic._oneMinusF * Math.tan(geodeticLatitude));\r\n }\r\n /** return the parametric latitude angle for the input geodetic latitude angle (both in radians). The parametric latitude\r\n * is appropriate for input to the Ellipsoid methods.\r\n * @param geodeticLatitude geodetic latitude angle in radians\r\n */\r\n public static parametricLatitudeFromGeodeticLatitude(geodeticLatitude: number): number {\r\n return Math.atan(Cartographic._oneMinusF * Cartographic._oneMinusF * Cartographic._equatorOverPolar * Math.tan(geodeticLatitude));\r\n }\r\n\r\n /** Create a new Cartographic from longitude and latitude specified in degrees. The values in the resulting object will be in radians.\r\n * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are numbers specified in degrees. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero.\r\n * @param result The object onto which to store the result.\r\n */\r\n public static fromDegrees(args: { longitude: number, latitude: number, height?: number }, result?: Cartographic) {\r\n return Cartographic.fromRadians({ longitude: Angle.degreesToRadians(args.longitude), latitude: Angle.degreesToRadians(args.latitude), height: args.height }, result);\r\n }\r\n\r\n /** Create a new Cartographic from longitude and latitude in [Angle]($geometry)s. The values in the resulting object will be in radians.\r\n * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are Angle objects. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero.\r\n * @param result The object into which to store the result (optional)\r\n */\r\n public static fromAngles(args: { longitude: Angle, latitude: Angle, height?: number }, result?: Cartographic) {\r\n return Cartographic.fromRadians({ longitude: args.longitude.radians, latitude: args.latitude.radians, height: args.height }, result);\r\n }\r\n\r\n private static _cartesianToCartographicN = new Point3d();\r\n private static _cartesianToCartographicP = new Point3d();\r\n private static _cartesianToCartographicH = new Vector3d();\r\n private static _wgs84OneOverRadii = new Point3d(1.0 / 6378137.0, 1.0 / 6378137.0, 1.0 / 6356752.3142451793);\r\n private static _wgs84OneOverRadiiSquared = new Point3d(1.0 / (6378137.0 * 6378137.0), 1.0 / (6378137.0 * 6378137.0), 1.0 / (6356752.3142451793 * 6356752.3142451793));\r\n private static _wgs84RadiiSquared = new Point3d(6378137.0 * 6378137.0, 6378137.0 * 6378137.0, 6356752.3142451793 * 6356752.3142451793);\r\n private static _wgs84CenterToleranceSquared = 0.1;\r\n private static _scratchN = new Vector3d();\r\n private static _scratchK = new Vector3d();\r\n\r\n /** Creates a new Cartographic from an [ECEF](https://en.wikipedia.org/wiki/ECEF) position.\r\n * @param cartesian The position, in ECEF, to convert to cartographic representation.\r\n * @param [result] The object onto which to store the result.\r\n * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\r\n */\r\n public static fromEcef(cartesian: Point3d, result?: Cartographic): Cartographic | undefined {\r\n const oneOverRadiiSquared = Cartographic._wgs84OneOverRadiiSquared;\r\n const p = Cartographic.scalePointToGeodeticSurface(cartesian, Cartographic._cartesianToCartographicP);\r\n\r\n if (!p)\r\n return undefined;\r\n\r\n const n = Cartographic._cartesianToCartographicN;\r\n Cartographic.multiplyComponents(p, oneOverRadiiSquared, n);\r\n Cartographic.normalize(n, n);\r\n\r\n const h = p.vectorTo(cartesian, Cartographic._cartesianToCartographicH);\r\n const longitude = Math.atan2(n.y, n.x);\r\n const latitude = Math.asin(n.z);\r\n const height = Math.sign(h.dotProduct(cartesian)) * h.magnitude();\r\n\r\n if (!result)\r\n return new Cartographic(longitude, latitude, height);\r\n\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n }\r\n\r\n /** Scale point to geodetic surface\r\n * @param point in ECEF to scale to the surface\r\n * @param [result] The object onto which to store the result.\r\n * @returns a point on the geodetic surface\r\n */\r\n public static scalePointToGeodeticSurface(point: Point3d, result?: Point3d): Point3d | undefined {\r\n const oneOverRadii = Cartographic._wgs84OneOverRadii;\r\n const oneOverRadiiSquared = Cartographic._wgs84OneOverRadiiSquared;\r\n const centerToleranceSquared = Cartographic._wgs84CenterToleranceSquared;\r\n return Cartographic._scaleToGeodeticSurface(point, oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, result);\r\n }\r\n\r\n /** Duplicates a Cartographic. */\r\n public clone(result?: Cartographic): Cartographic {\r\n if (!result)\r\n return new Cartographic(this.longitude, this.latitude, this.height);\r\n\r\n result.longitude = this.longitude;\r\n result.latitude = this.latitude;\r\n result.height = this.height;\r\n return result;\r\n }\r\n\r\n /** Return true if this Cartographic is the same as right */\r\n public equals(right: CartographicProps): boolean {\r\n return (this === right) ||\r\n ((this.longitude === right.longitude) &&\r\n (this.latitude === right.latitude) &&\r\n (this.height === right.height));\r\n }\r\n\r\n /** Compares this Cartographic component-wise and returns true if they are within the provided epsilon, */\r\n public equalsEpsilon(right: CartographicProps, epsilon: number): boolean {\r\n return (this === right) ||\r\n ((Math.abs(this.longitude - right.longitude) <= epsilon) &&\r\n (Math.abs(this.latitude - right.latitude) <= epsilon) &&\r\n (Math.abs(this.height - right.height) <= epsilon));\r\n }\r\n\r\n private static normalize(cartesian: XYZ, result: XYZ) {\r\n const magnitude = cartesian.magnitude();\r\n result.x = cartesian.x / magnitude;\r\n result.y = cartesian.y / magnitude;\r\n result.z = cartesian.z / magnitude;\r\n }\r\n\r\n private static multiplyComponents(left: XYAndZ, right: XYAndZ, result: XYZ) {\r\n result.x = left.x * right.x;\r\n result.y = left.y * right.y;\r\n result.z = left.z * right.z;\r\n }\r\n\r\n private static scalePoint(cartesian: XYAndZ, scalar: number, result: XYZ) {\r\n result.x = cartesian.x * scalar;\r\n result.y = cartesian.y * scalar;\r\n result.z = cartesian.z * scalar;\r\n }\r\n\r\n private static addPoints(left: XYAndZ, right: XYAndZ, result: XYZ) {\r\n result.x = left.x + right.x;\r\n result.y = left.y + right.y;\r\n result.z = left.z + right.z;\r\n }\r\n\r\n /** Create a string representing this cartographic in the format '(longitude, latitude, height)'. */\r\n public toString(): string { return `(${this.longitude}, ${this.latitude}, ${this.height})`; }\r\n\r\n private static _scaleToGeodeticSurfaceIntersection = new Point3d();\r\n private static _scaleToGeodeticSurfaceGradient = new Point3d();\r\n private static _scaleToGeodeticSurface(cartesian: Point3d, oneOverRadii: XYAndZ, oneOverRadiiSquared: XYAndZ, centerToleranceSquared: number, result?: Point3d) {\r\n const positionX = cartesian.x;\r\n const positionY = cartesian.y;\r\n const positionZ = cartesian.z;\r\n\r\n const oneOverRadiiX = oneOverRadii.x;\r\n const oneOverRadiiY = oneOverRadii.y;\r\n const oneOverRadiiZ = oneOverRadii.z;\r\n\r\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\r\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\r\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\r\n\r\n // Compute the squared ellipsoid norm.\r\n const squaredNorm = x2 + y2 + z2;\r\n const ratio = Math.sqrt(1.0 / squaredNorm);\r\n\r\n // As an initial approximation, assume that the radial intersection is the projection point.\r\n const intersection = Cartographic._scaleToGeodeticSurfaceIntersection;\r\n Cartographic.scalePoint(cartesian, ratio, intersection);\r\n\r\n // If the position is near the center, the iteration will not converge.\r\n if (squaredNorm < centerToleranceSquared) {\r\n return !isFinite(ratio) ? undefined : Point3d.createFrom(intersection, result);\r\n }\r\n\r\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\r\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\r\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\r\n\r\n // Use the gradient at the intersection point in place of the true unit normal.\r\n // The difference in magnitude will be absorbed in the multiplier.\r\n const gradient = Cartographic._scaleToGeodeticSurfaceGradient;\r\n gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\r\n gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\r\n gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\r\n\r\n // Compute the initial guess at the normal vector multiplier, lambda.\r\n let lambda = (1.0 - ratio) * cartesian.magnitude() / (0.5 * gradient.magnitude());\r\n let correction = 0.0;\r\n let func;\r\n let denominator;\r\n let xMultiplier;\r\n let yMultiplier;\r\n let zMultiplier;\r\n let xMultiplier2;\r\n let yMultiplier2;\r\n let zMultiplier2;\r\n let xMultiplier3;\r\n let yMultiplier3;\r\n let zMultiplier3;\r\n\r\n do {\r\n lambda -= correction;\r\n\r\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\r\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\r\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\r\n\r\n xMultiplier2 = xMultiplier * xMultiplier;\r\n yMultiplier2 = yMultiplier * yMultiplier;\r\n zMultiplier2 = zMultiplier * zMultiplier;\r\n\r\n xMultiplier3 = xMultiplier2 * xMultiplier;\r\n yMultiplier3 = yMultiplier2 * yMultiplier;\r\n zMultiplier3 = zMultiplier2 * zMultiplier;\r\n\r\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\r\n\r\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\r\n // computations in the sections to follow.\r\n denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;\r\n\r\n const derivative = -2.0 * denominator;\r\n\r\n correction = func / derivative;\r\n } while (Math.abs(func) > 0.01);\r\n\r\n if (!result)\r\n return new Point3d(positionX * xMultiplier, positionY * yMultiplier, positionZ * zMultiplier);\r\n\r\n result.x = positionX * xMultiplier;\r\n result.y = positionY * yMultiplier;\r\n result.z = positionZ * zMultiplier;\r\n return result;\r\n }\r\n\r\n /** Return an ECEF point from a Cartographic point */\r\n public toEcef(result?: Point3d): Point3d {\r\n const cosLatitude = Math.cos(this.latitude);\r\n const scratchN = Cartographic._scratchN;\r\n const scratchK = Cartographic._scratchK;\r\n scratchN.x = cosLatitude * Math.cos(this.longitude);\r\n scratchN.y = cosLatitude * Math.sin(this.longitude);\r\n scratchN.z = Math.sin(this.latitude);\r\n Cartographic.normalize(scratchN, scratchN);\r\n\r\n Cartographic.multiplyComponents(Cartographic._wgs84RadiiSquared, scratchN, scratchK);\r\n const gamma = Math.sqrt(scratchN.dotProduct(scratchK));\r\n Cartographic.scalePoint(scratchK, 1.0 / gamma, scratchK);\r\n Cartographic.scalePoint(scratchN, this.height, scratchN);\r\n\r\n result = result ? result : new Point3d();\r\n Cartographic.addPoints(scratchK, scratchN, result);\r\n return result;\r\n }\r\n}\r\n/** A cartographic range representing a rectangular region if low longitude/latitude > high then area crossing seam is indicated.\r\n * @public\r\n */\r\nexport class CartographicRange {\r\n private _ranges: Range2d[] = [];\r\n\r\n // These following are used to preserve the min/max latitude and longitudes.\r\n // The longitudes are raw values and may cross over the -PI or 2PI boundaries.\r\n private _minLongitude = 0;\r\n private _maxLongitude = 0;\r\n private _minLatitude = 0;\r\n private _maxLatitude = 0;\r\n constructor(spatialRange: Range3d, spatialToEcef: Transform) {\r\n // Compute 8 corners in spatial coordinate system before converting to ECEF\r\n // We want a box oriented in the spatial coordinate system and not in the ECEF coordinate system\r\n const spatialCorners = spatialRange.corners();\r\n const ecefCorners = spatialToEcef.multiplyPoint3dArray(spatialCorners);\r\n let low: Cartographic | undefined, high: Cartographic | undefined;\r\n\r\n for (const ecefCorner of ecefCorners) {\r\n const geoPt = Cartographic.fromEcef(ecefCorner);\r\n if (!geoPt)\r\n continue;\r\n if (undefined === low || undefined === high) {\r\n low = geoPt;\r\n high = geoPt.clone();\r\n continue;\r\n }\r\n low.latitude = Math.min(low.latitude, geoPt.latitude);\r\n low.longitude = Math.min(low.longitude, geoPt.longitude);\r\n high.latitude = Math.max(high.latitude, geoPt.latitude);\r\n high.longitude = Math.max(high.longitude, geoPt.longitude);\r\n }\r\n\r\n if (!low || !high) {\r\n assert(false);\r\n return;\r\n }\r\n\r\n const longitudeRanges = [];\r\n this._minLongitude = Math.min(low.longitude, high.longitude), this._maxLongitude = Math.max(low.longitude, high.longitude);\r\n if (this._maxLongitude - this._minLongitude > Angle.piRadians) {\r\n longitudeRanges.push(Range1d.createXX(0.0, this._minLongitude));\r\n longitudeRanges.push(Range1d.createXX(this._maxLongitude, Angle.pi2Radians));\r\n } else {\r\n longitudeRanges.push(Range1d.createXX(this._minLongitude, this._maxLongitude));\r\n }\r\n\r\n for (const longitudeRange of longitudeRanges) {\r\n this._minLatitude = Math.min(low.latitude, high.latitude), this._maxLatitude = Math.max(low.latitude, high.latitude);\r\n if (this._maxLatitude - this._minLatitude > Angle.piOver2Radians) {\r\n this._ranges.push(Range2d.createXYXY(longitudeRange.low, 0.0, longitudeRange.high, this._minLatitude));\r\n this._ranges.push(Range2d.createXYXY(longitudeRange.low, this._maxLatitude, longitudeRange.high, Angle.piRadians));\r\n } else {\r\n this._ranges.push(Range2d.createXYXY(longitudeRange.low, this._minLatitude, longitudeRange.high, this._maxLatitude));\r\n }\r\n }\r\n }\r\n\r\n public intersectsRange(other: CartographicRange): boolean {\r\n for (const range of this._ranges)\r\n for (const otherRange of other._ranges)\r\n if (range.intersectsRange(otherRange))\r\n return true;\r\n return false;\r\n }\r\n\r\n /** This method returns the raw latitude / longitude for the range in a Range2d object.\r\n * The X value represents the longitude and the Y value the latitudes.\r\n * Y values are kept between -PI and +PI while\r\n * longitude values can be expressed in any range between -2PI to +2PI\r\n * given the minimum longitude is always smaller numerically than the maximum longitude.\r\n * Note that usually the longitudes are usually by convention in the range of -PI to PI except\r\n * for ranges that overlap the -PI/+PI frontier in which case either representation is acceptable.\r\n */\r\n public getLongitudeLatitudeBoundingBox(): Range2d {\r\n return Range2d.createXYXY(this._minLongitude, this._minLatitude, this._maxLongitude, this._maxLatitude);\r\n }\r\n}\r\n"]}