@itwin/core-common 5.0.0-dev.56 → 5.0.0-dev.57

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 (471) hide show
  1. package/lib/cjs/AmbientOcclusion.js +17 -9
  2. package/lib/cjs/AmbientOcclusion.js.map +1 -1
  3. package/lib/cjs/AnalysisStyle.js +20 -1
  4. package/lib/cjs/AnalysisStyle.js.map +1 -1
  5. package/lib/cjs/Atmosphere.js +30 -10
  6. package/lib/cjs/Atmosphere.js.map +1 -1
  7. package/lib/cjs/BackgroundMapProvider.js +4 -0
  8. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  9. package/lib/cjs/BackgroundMapSettings.js +19 -0
  10. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  11. package/lib/cjs/BlobReader.js +8 -6
  12. package/lib/cjs/BlobReader.js.map +1 -1
  13. package/lib/cjs/Camera.js +3 -0
  14. package/lib/cjs/Camera.js.map +1 -1
  15. package/lib/cjs/ClipStyle.js +29 -3
  16. package/lib/cjs/ClipStyle.js.map +1 -1
  17. package/lib/cjs/Code.js +16 -0
  18. package/lib/cjs/Code.js.map +1 -1
  19. package/lib/cjs/ColorDef.js +6 -5
  20. package/lib/cjs/ColorDef.js.map +1 -1
  21. package/lib/cjs/ConcurrentQuery.js +5 -3
  22. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  23. package/lib/cjs/ContextRealityModel.js +53 -27
  24. package/lib/cjs/ContextRealityModel.js.map +1 -1
  25. package/lib/cjs/ContourDisplay.js +37 -2
  26. package/lib/cjs/ContourDisplay.js.map +1 -1
  27. package/lib/cjs/DisplayStyleSettings.js +95 -63
  28. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  29. package/lib/cjs/ECSqlReader.js +52 -49
  30. package/lib/cjs/ECSqlReader.js.map +1 -1
  31. package/lib/cjs/ElementProps.js +5 -1
  32. package/lib/cjs/ElementProps.js.map +1 -1
  33. package/lib/cjs/EntityProps.js +31 -0
  34. package/lib/cjs/EntityProps.js.map +1 -1
  35. package/lib/cjs/Environment.js +24 -1
  36. package/lib/cjs/Environment.js.map +1 -1
  37. package/lib/cjs/FeatureIndex.js +15 -6
  38. package/lib/cjs/FeatureIndex.js.map +1 -1
  39. package/lib/cjs/FeatureSymbology.js +82 -49
  40. package/lib/cjs/FeatureSymbology.js.map +1 -1
  41. package/lib/cjs/FeatureTable.js +5 -0
  42. package/lib/cjs/FeatureTable.js.map +1 -1
  43. package/lib/cjs/Fonts.js +1 -1
  44. package/lib/cjs/Fonts.js.map +1 -1
  45. package/lib/cjs/Frustum.js +2 -2
  46. package/lib/cjs/Frustum.js.map +1 -1
  47. package/lib/cjs/GeometryParams.js +58 -0
  48. package/lib/cjs/GeometryParams.js.map +1 -1
  49. package/lib/cjs/Gradient.js +12 -9
  50. package/lib/cjs/Gradient.js.map +1 -1
  51. package/lib/cjs/GraphicParams.js +14 -12
  52. package/lib/cjs/GraphicParams.js.map +1 -1
  53. package/lib/cjs/GroundPlane.js +7 -1
  54. package/lib/cjs/GroundPlane.js.map +1 -1
  55. package/lib/cjs/HSLColor.js +6 -0
  56. package/lib/cjs/HSLColor.js.map +1 -1
  57. package/lib/cjs/HSVColor.js +6 -0
  58. package/lib/cjs/HSVColor.js.map +1 -1
  59. package/lib/cjs/HiddenLine.js +23 -3
  60. package/lib/cjs/HiddenLine.js.map +1 -1
  61. package/lib/cjs/Hilite.js +10 -0
  62. package/lib/cjs/Hilite.js.map +1 -1
  63. package/lib/cjs/IModel.js +44 -20
  64. package/lib/cjs/IModel.js.map +1 -1
  65. package/lib/cjs/IModelError.js +2 -0
  66. package/lib/cjs/IModelError.js.map +1 -1
  67. package/lib/cjs/IModelVersion.js +4 -0
  68. package/lib/cjs/IModelVersion.js.map +1 -1
  69. package/lib/cjs/Image.js +10 -0
  70. package/lib/cjs/Image.js.map +1 -1
  71. package/lib/cjs/LightSettings.js +39 -1
  72. package/lib/cjs/LightSettings.js.map +1 -1
  73. package/lib/cjs/MapImagerySettings.js +3 -2
  74. package/lib/cjs/MapImagerySettings.js.map +1 -1
  75. package/lib/cjs/MapLayerSettings.js +33 -0
  76. package/lib/cjs/MapLayerSettings.js.map +1 -1
  77. package/lib/cjs/ModelClipGroup.js +6 -0
  78. package/lib/cjs/ModelClipGroup.js.map +1 -1
  79. package/lib/cjs/OctEncodedNormal.js +4 -0
  80. package/lib/cjs/OctEncodedNormal.js.map +1 -1
  81. package/lib/cjs/PlanProjectionSettings.js +8 -0
  82. package/lib/cjs/PlanProjectionSettings.js.map +1 -1
  83. package/lib/cjs/PlanarClipMask.js +23 -1
  84. package/lib/cjs/PlanarClipMask.js.map +1 -1
  85. package/lib/cjs/QPoint.js +32 -24
  86. package/lib/cjs/QPoint.js.map +1 -1
  87. package/lib/cjs/RealityModelDisplaySettings.js +79 -2
  88. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  89. package/lib/cjs/RenderMaterial.js +34 -17
  90. package/lib/cjs/RenderMaterial.js.map +1 -1
  91. package/lib/cjs/RenderSchedule.d.ts +1 -2
  92. package/lib/cjs/RenderSchedule.d.ts.map +1 -1
  93. package/lib/cjs/RenderSchedule.js +138 -11
  94. package/lib/cjs/RenderSchedule.js.map +1 -1
  95. package/lib/cjs/RenderTexture.js +14 -0
  96. package/lib/cjs/RenderTexture.js.map +1 -1
  97. package/lib/cjs/RgbColor.js +3 -0
  98. package/lib/cjs/RgbColor.js.map +1 -1
  99. package/lib/cjs/RpcInterface.d.ts.map +1 -1
  100. package/lib/cjs/RpcInterface.js +6 -0
  101. package/lib/cjs/RpcInterface.js.map +1 -1
  102. package/lib/cjs/SkyBox.js +15 -2
  103. package/lib/cjs/SkyBox.js.map +1 -1
  104. package/lib/cjs/SolarShadows.js +5 -1
  105. package/lib/cjs/SolarShadows.js.map +1 -1
  106. package/lib/cjs/SpatialClassification.js +19 -1
  107. package/lib/cjs/SpatialClassification.js.map +1 -1
  108. package/lib/cjs/SubCategoryAppearance.js +35 -1
  109. package/lib/cjs/SubCategoryAppearance.js.map +1 -1
  110. package/lib/cjs/SubCategoryOverride.js +15 -1
  111. package/lib/cjs/SubCategoryOverride.js.map +1 -1
  112. package/lib/cjs/TerrainSettings.js +19 -0
  113. package/lib/cjs/TerrainSettings.js.map +1 -1
  114. package/lib/cjs/TextureMapping.js +24 -1
  115. package/lib/cjs/TextureMapping.js.map +1 -1
  116. package/lib/cjs/ThematicDisplay.js +53 -2
  117. package/lib/cjs/ThematicDisplay.js.map +1 -1
  118. package/lib/cjs/Tween.js +28 -19
  119. package/lib/cjs/Tween.js.map +1 -1
  120. package/lib/cjs/ViewDetails.js +9 -5
  121. package/lib/cjs/ViewDetails.js.map +1 -1
  122. package/lib/cjs/ViewFlags.js +84 -1
  123. package/lib/cjs/ViewFlags.js.map +1 -1
  124. package/lib/cjs/WhiteOnWhiteReversalSettings.js +7 -2
  125. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  126. package/lib/cjs/annotation/TextAnnotation.js +10 -0
  127. package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
  128. package/lib/cjs/annotation/TextBlock.js +27 -6
  129. package/lib/cjs/annotation/TextBlock.js.map +1 -1
  130. package/lib/cjs/annotation/TextStyle.js +49 -3
  131. package/lib/cjs/annotation/TextStyle.js.map +1 -1
  132. package/lib/cjs/geometry/AdditionalTransform.js +12 -0
  133. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  134. package/lib/cjs/geometry/AreaPattern.js +17 -0
  135. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  136. package/lib/cjs/geometry/BoundingSphere.js +4 -0
  137. package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
  138. package/lib/cjs/geometry/Cartographic.js +23 -20
  139. package/lib/cjs/geometry/Cartographic.js.map +1 -1
  140. package/lib/cjs/geometry/CoordinateReferenceSystem.js +62 -0
  141. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  142. package/lib/cjs/geometry/ElementGeometry.js +26 -8
  143. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  144. package/lib/cjs/geometry/ElementGeometryFB.js +54 -108
  145. package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
  146. package/lib/cjs/geometry/FrustumPlanes.js +1 -0
  147. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  148. package/lib/cjs/geometry/GeodeticDatum.js +100 -0
  149. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  150. package/lib/cjs/geometry/GeodeticEllipsoid.js +16 -0
  151. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  152. package/lib/cjs/geometry/GeometryStream.js +19 -6
  153. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  154. package/lib/cjs/geometry/ImageGraphic.js +10 -0
  155. package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
  156. package/lib/cjs/geometry/LineStyle.js +14 -0
  157. package/lib/cjs/geometry/LineStyle.js.map +1 -1
  158. package/lib/cjs/geometry/Placement.js +6 -0
  159. package/lib/cjs/geometry/Placement.js.map +1 -1
  160. package/lib/cjs/geometry/Projection.js +75 -0
  161. package/lib/cjs/geometry/Projection.js.map +1 -1
  162. package/lib/cjs/geometry/TextString.js +18 -0
  163. package/lib/cjs/geometry/TextString.js.map +1 -1
  164. package/lib/cjs/internal/PackedFeatureTable.js +10 -0
  165. package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
  166. package/lib/cjs/internal/RenderMesh.js +10 -7
  167. package/lib/cjs/internal/RenderMesh.js.map +1 -1
  168. package/lib/cjs/ipc/IpcSession.js +1 -0
  169. package/lib/cjs/ipc/IpcSession.js.map +1 -1
  170. package/lib/cjs/ipc/IpcWebSocket.js +7 -6
  171. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  172. package/lib/cjs/ipc/IpcWebSocketTransport.js +8 -7
  173. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  174. package/lib/cjs/rpc/DevToolsRpcInterface.js +2 -2
  175. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  176. package/lib/cjs/rpc/IModelReadRpcInterface.js +4 -7
  177. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  178. package/lib/cjs/rpc/IModelTileRpcInterface.js +2 -2
  179. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  180. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +2 -2
  181. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  182. package/lib/cjs/rpc/TestRpcManager.js +1 -4
  183. package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
  184. package/lib/cjs/rpc/core/RpcConfiguration.js +25 -36
  185. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  186. package/lib/cjs/rpc/core/RpcControl.js +28 -30
  187. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  188. package/lib/cjs/rpc/core/RpcInvocation.js +17 -9
  189. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  190. package/lib/cjs/rpc/core/RpcOperation.js +28 -30
  191. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  192. package/lib/cjs/rpc/core/RpcPendingQueue.js +17 -16
  193. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  194. package/lib/cjs/rpc/core/RpcProtocol.js +30 -28
  195. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  196. package/lib/cjs/rpc/core/RpcPush.js +13 -6
  197. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  198. package/lib/cjs/rpc/core/RpcRegistry.js +10 -9
  199. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  200. package/lib/cjs/rpc/core/RpcRequest.js +45 -23
  201. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  202. package/lib/cjs/rpc/core/RpcRoutingToken.js +4 -2
  203. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  204. package/lib/cjs/rpc/core/RpcSessionInvocation.js +5 -10
  205. package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
  206. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +7 -13
  207. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  208. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +16 -19
  209. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  210. package/lib/cjs/rpc/web/OpenAPI.js +2 -0
  211. package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
  212. package/lib/cjs/rpc/web/RpcMultipart.js +2 -2
  213. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  214. package/lib/cjs/rpc/web/WebAppRpcProtocol.js +6 -6
  215. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  216. package/lib/cjs/rpc/web/WebAppRpcRequest.js +12 -10
  217. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  218. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +14 -0
  219. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  220. package/lib/cjs/tile/B3dmTileIO.js +7 -0
  221. package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
  222. package/lib/cjs/tile/CompositeTileIO.js +3 -0
  223. package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
  224. package/lib/cjs/tile/GltfTileIO.js +4 -3
  225. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  226. package/lib/cjs/tile/I3dmTileIO.js +8 -0
  227. package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
  228. package/lib/cjs/tile/IModelTileIO.js +24 -1
  229. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  230. package/lib/cjs/tile/PntsTileIO.js +5 -0
  231. package/lib/cjs/tile/PntsTileIO.js.map +1 -1
  232. package/lib/cjs/tile/TileIO.js +2 -0
  233. package/lib/cjs/tile/TileIO.js.map +1 -1
  234. package/lib/cjs/tile/TileMetadata.js +9 -1
  235. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  236. package/lib/esm/AmbientOcclusion.js +17 -9
  237. package/lib/esm/AmbientOcclusion.js.map +1 -1
  238. package/lib/esm/AnalysisStyle.js +20 -1
  239. package/lib/esm/AnalysisStyle.js.map +1 -1
  240. package/lib/esm/Atmosphere.js +30 -10
  241. package/lib/esm/Atmosphere.js.map +1 -1
  242. package/lib/esm/BackgroundMapProvider.js +4 -0
  243. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  244. package/lib/esm/BackgroundMapSettings.js +19 -0
  245. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  246. package/lib/esm/BlobReader.js +8 -6
  247. package/lib/esm/BlobReader.js.map +1 -1
  248. package/lib/esm/Camera.js +3 -0
  249. package/lib/esm/Camera.js.map +1 -1
  250. package/lib/esm/ClipStyle.js +29 -3
  251. package/lib/esm/ClipStyle.js.map +1 -1
  252. package/lib/esm/Code.js +16 -0
  253. package/lib/esm/Code.js.map +1 -1
  254. package/lib/esm/ColorDef.js +6 -5
  255. package/lib/esm/ColorDef.js.map +1 -1
  256. package/lib/esm/ConcurrentQuery.js +5 -3
  257. package/lib/esm/ConcurrentQuery.js.map +1 -1
  258. package/lib/esm/ContextRealityModel.js +53 -27
  259. package/lib/esm/ContextRealityModel.js.map +1 -1
  260. package/lib/esm/ContourDisplay.js +37 -2
  261. package/lib/esm/ContourDisplay.js.map +1 -1
  262. package/lib/esm/DisplayStyleSettings.js +95 -63
  263. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  264. package/lib/esm/ECSqlReader.js +52 -49
  265. package/lib/esm/ECSqlReader.js.map +1 -1
  266. package/lib/esm/ElementProps.js +5 -1
  267. package/lib/esm/ElementProps.js.map +1 -1
  268. package/lib/esm/EntityProps.js +31 -0
  269. package/lib/esm/EntityProps.js.map +1 -1
  270. package/lib/esm/Environment.js +24 -1
  271. package/lib/esm/Environment.js.map +1 -1
  272. package/lib/esm/FeatureIndex.js +15 -6
  273. package/lib/esm/FeatureIndex.js.map +1 -1
  274. package/lib/esm/FeatureSymbology.js +82 -49
  275. package/lib/esm/FeatureSymbology.js.map +1 -1
  276. package/lib/esm/FeatureTable.js +5 -0
  277. package/lib/esm/FeatureTable.js.map +1 -1
  278. package/lib/esm/Fonts.js +1 -1
  279. package/lib/esm/Fonts.js.map +1 -1
  280. package/lib/esm/Frustum.js +2 -2
  281. package/lib/esm/Frustum.js.map +1 -1
  282. package/lib/esm/GeometryParams.js +58 -0
  283. package/lib/esm/GeometryParams.js.map +1 -1
  284. package/lib/esm/Gradient.js +12 -9
  285. package/lib/esm/Gradient.js.map +1 -1
  286. package/lib/esm/GraphicParams.js +14 -12
  287. package/lib/esm/GraphicParams.js.map +1 -1
  288. package/lib/esm/GroundPlane.js +7 -1
  289. package/lib/esm/GroundPlane.js.map +1 -1
  290. package/lib/esm/HSLColor.js +6 -0
  291. package/lib/esm/HSLColor.js.map +1 -1
  292. package/lib/esm/HSVColor.js +6 -0
  293. package/lib/esm/HSVColor.js.map +1 -1
  294. package/lib/esm/HiddenLine.js +23 -3
  295. package/lib/esm/HiddenLine.js.map +1 -1
  296. package/lib/esm/Hilite.js +10 -0
  297. package/lib/esm/Hilite.js.map +1 -1
  298. package/lib/esm/IModel.js +44 -20
  299. package/lib/esm/IModel.js.map +1 -1
  300. package/lib/esm/IModelError.js +2 -0
  301. package/lib/esm/IModelError.js.map +1 -1
  302. package/lib/esm/IModelVersion.js +4 -0
  303. package/lib/esm/IModelVersion.js.map +1 -1
  304. package/lib/esm/Image.js +10 -0
  305. package/lib/esm/Image.js.map +1 -1
  306. package/lib/esm/LightSettings.js +39 -1
  307. package/lib/esm/LightSettings.js.map +1 -1
  308. package/lib/esm/MapImagerySettings.js +3 -2
  309. package/lib/esm/MapImagerySettings.js.map +1 -1
  310. package/lib/esm/MapLayerSettings.js +33 -0
  311. package/lib/esm/MapLayerSettings.js.map +1 -1
  312. package/lib/esm/ModelClipGroup.js +6 -0
  313. package/lib/esm/ModelClipGroup.js.map +1 -1
  314. package/lib/esm/OctEncodedNormal.js +4 -0
  315. package/lib/esm/OctEncodedNormal.js.map +1 -1
  316. package/lib/esm/PlanProjectionSettings.js +8 -0
  317. package/lib/esm/PlanProjectionSettings.js.map +1 -1
  318. package/lib/esm/PlanarClipMask.js +23 -1
  319. package/lib/esm/PlanarClipMask.js.map +1 -1
  320. package/lib/esm/QPoint.js +32 -24
  321. package/lib/esm/QPoint.js.map +1 -1
  322. package/lib/esm/RealityModelDisplaySettings.js +79 -2
  323. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  324. package/lib/esm/RenderMaterial.js +34 -17
  325. package/lib/esm/RenderMaterial.js.map +1 -1
  326. package/lib/esm/RenderSchedule.d.ts +1 -2
  327. package/lib/esm/RenderSchedule.d.ts.map +1 -1
  328. package/lib/esm/RenderSchedule.js +138 -11
  329. package/lib/esm/RenderSchedule.js.map +1 -1
  330. package/lib/esm/RenderTexture.js +14 -0
  331. package/lib/esm/RenderTexture.js.map +1 -1
  332. package/lib/esm/RgbColor.js +3 -0
  333. package/lib/esm/RgbColor.js.map +1 -1
  334. package/lib/esm/RpcInterface.d.ts.map +1 -1
  335. package/lib/esm/RpcInterface.js +6 -0
  336. package/lib/esm/RpcInterface.js.map +1 -1
  337. package/lib/esm/SkyBox.js +15 -2
  338. package/lib/esm/SkyBox.js.map +1 -1
  339. package/lib/esm/SolarShadows.js +5 -1
  340. package/lib/esm/SolarShadows.js.map +1 -1
  341. package/lib/esm/SpatialClassification.js +19 -1
  342. package/lib/esm/SpatialClassification.js.map +1 -1
  343. package/lib/esm/SubCategoryAppearance.js +35 -1
  344. package/lib/esm/SubCategoryAppearance.js.map +1 -1
  345. package/lib/esm/SubCategoryOverride.js +15 -1
  346. package/lib/esm/SubCategoryOverride.js.map +1 -1
  347. package/lib/esm/TerrainSettings.js +19 -0
  348. package/lib/esm/TerrainSettings.js.map +1 -1
  349. package/lib/esm/TextureMapping.js +24 -1
  350. package/lib/esm/TextureMapping.js.map +1 -1
  351. package/lib/esm/ThematicDisplay.js +53 -2
  352. package/lib/esm/ThematicDisplay.js.map +1 -1
  353. package/lib/esm/Tween.js +28 -19
  354. package/lib/esm/Tween.js.map +1 -1
  355. package/lib/esm/ViewDetails.js +9 -5
  356. package/lib/esm/ViewDetails.js.map +1 -1
  357. package/lib/esm/ViewFlags.js +84 -1
  358. package/lib/esm/ViewFlags.js.map +1 -1
  359. package/lib/esm/WhiteOnWhiteReversalSettings.js +7 -2
  360. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  361. package/lib/esm/annotation/TextAnnotation.js +10 -0
  362. package/lib/esm/annotation/TextAnnotation.js.map +1 -1
  363. package/lib/esm/annotation/TextBlock.js +27 -6
  364. package/lib/esm/annotation/TextBlock.js.map +1 -1
  365. package/lib/esm/annotation/TextStyle.js +49 -3
  366. package/lib/esm/annotation/TextStyle.js.map +1 -1
  367. package/lib/esm/geometry/AdditionalTransform.js +12 -0
  368. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  369. package/lib/esm/geometry/AreaPattern.js +17 -0
  370. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  371. package/lib/esm/geometry/BoundingSphere.js +4 -0
  372. package/lib/esm/geometry/BoundingSphere.js.map +1 -1
  373. package/lib/esm/geometry/Cartographic.js +23 -20
  374. package/lib/esm/geometry/Cartographic.js.map +1 -1
  375. package/lib/esm/geometry/CoordinateReferenceSystem.js +62 -0
  376. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  377. package/lib/esm/geometry/ElementGeometry.js +26 -8
  378. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  379. package/lib/esm/geometry/ElementGeometryFB.js +54 -108
  380. package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
  381. package/lib/esm/geometry/FrustumPlanes.js +1 -0
  382. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  383. package/lib/esm/geometry/GeodeticDatum.js +100 -0
  384. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  385. package/lib/esm/geometry/GeodeticEllipsoid.js +16 -0
  386. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  387. package/lib/esm/geometry/GeometryStream.js +19 -6
  388. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  389. package/lib/esm/geometry/ImageGraphic.js +10 -0
  390. package/lib/esm/geometry/ImageGraphic.js.map +1 -1
  391. package/lib/esm/geometry/LineStyle.js +14 -0
  392. package/lib/esm/geometry/LineStyle.js.map +1 -1
  393. package/lib/esm/geometry/Placement.js +6 -0
  394. package/lib/esm/geometry/Placement.js.map +1 -1
  395. package/lib/esm/geometry/Projection.js +75 -0
  396. package/lib/esm/geometry/Projection.js.map +1 -1
  397. package/lib/esm/geometry/TextString.js +18 -0
  398. package/lib/esm/geometry/TextString.js.map +1 -1
  399. package/lib/esm/internal/PackedFeatureTable.js +10 -0
  400. package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
  401. package/lib/esm/internal/RenderMesh.js +10 -7
  402. package/lib/esm/internal/RenderMesh.js.map +1 -1
  403. package/lib/esm/ipc/IpcSession.js +1 -0
  404. package/lib/esm/ipc/IpcSession.js.map +1 -1
  405. package/lib/esm/ipc/IpcWebSocket.js +7 -6
  406. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  407. package/lib/esm/ipc/IpcWebSocketTransport.js +8 -7
  408. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  409. package/lib/esm/rpc/DevToolsRpcInterface.js +2 -2
  410. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  411. package/lib/esm/rpc/IModelReadRpcInterface.js +4 -7
  412. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  413. package/lib/esm/rpc/IModelTileRpcInterface.js +2 -2
  414. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  415. package/lib/esm/rpc/SnapshotIModelRpcInterface.js +2 -2
  416. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  417. package/lib/esm/rpc/TestRpcManager.js +1 -4
  418. package/lib/esm/rpc/TestRpcManager.js.map +1 -1
  419. package/lib/esm/rpc/core/RpcConfiguration.js +25 -36
  420. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  421. package/lib/esm/rpc/core/RpcControl.js +28 -30
  422. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  423. package/lib/esm/rpc/core/RpcInvocation.js +17 -9
  424. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  425. package/lib/esm/rpc/core/RpcOperation.js +28 -30
  426. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  427. package/lib/esm/rpc/core/RpcPendingQueue.js +17 -16
  428. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  429. package/lib/esm/rpc/core/RpcProtocol.js +30 -28
  430. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  431. package/lib/esm/rpc/core/RpcPush.js +13 -6
  432. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  433. package/lib/esm/rpc/core/RpcRegistry.js +10 -9
  434. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  435. package/lib/esm/rpc/core/RpcRequest.js +45 -23
  436. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  437. package/lib/esm/rpc/core/RpcRoutingToken.js +4 -2
  438. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  439. package/lib/esm/rpc/core/RpcSessionInvocation.js +5 -10
  440. package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
  441. package/lib/esm/rpc/web/BentleyCloudRpcManager.js +7 -13
  442. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  443. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +16 -19
  444. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  445. package/lib/esm/rpc/web/OpenAPI.js +2 -0
  446. package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
  447. package/lib/esm/rpc/web/RpcMultipart.js +2 -2
  448. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  449. package/lib/esm/rpc/web/WebAppRpcProtocol.js +6 -6
  450. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  451. package/lib/esm/rpc/web/WebAppRpcRequest.js +12 -10
  452. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  453. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +14 -0
  454. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  455. package/lib/esm/tile/B3dmTileIO.js +7 -0
  456. package/lib/esm/tile/B3dmTileIO.js.map +1 -1
  457. package/lib/esm/tile/CompositeTileIO.js +3 -0
  458. package/lib/esm/tile/CompositeTileIO.js.map +1 -1
  459. package/lib/esm/tile/GltfTileIO.js +4 -3
  460. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  461. package/lib/esm/tile/I3dmTileIO.js +8 -0
  462. package/lib/esm/tile/I3dmTileIO.js.map +1 -1
  463. package/lib/esm/tile/IModelTileIO.js +24 -1
  464. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  465. package/lib/esm/tile/PntsTileIO.js +5 -0
  466. package/lib/esm/tile/PntsTileIO.js.map +1 -1
  467. package/lib/esm/tile/TileIO.js +2 -0
  468. package/lib/esm/tile/TileIO.js.map +1 -1
  469. package/lib/esm/tile/TileMetadata.js +9 -1
  470. package/lib/esm/tile/TileMetadata.js.map +1 -1
  471. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"ViewFlags.js","sourceRoot":"","sources":["../../src/ViewFlags.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qBAAqB;AAErB,OAAO,EAAE,SAAS,EAAoC,MAAM,qBAAqB,CAAC;AAElF;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB;;;;OAIG;IACH,qDAAa,CAAA;IACb;;;;OAI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C,OAAO,KAAK,KAAK,CAAC,OAAO;eAC9B,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;eACpC,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;eACpC,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,gBAAgB,KAAK,KAAK,CAAC,gBAAgB;eAChD,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe;eAC9C,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,mBAAmB,KAAK,KAAK,CAAC,mBAAmB;eACtD,IAAI,CAAC,oBAAoB,KAAK,KAAK,CAAC,oBAAoB,CAAC;IAChE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\n// cspell:ignore ovrs\n\nimport { JsonUtils, Mutable, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\n\n/** Enumerates the available basic rendering modes, as part of a [DisplayStyle]($backend)'s [[ViewFlags]].\n * The rendering mode broadly affects various aspects of the display style - in particular, whether and how surfaces and their edges are drawn.\n * @public\n * @extensions\n */\nexport enum RenderMode {\n /** Renders only the edges of surfaces, with exceptions for planar regions based on their [[FillFlags]].\n * Lighting (and by extension, shadows) is not applied.\n * [[HiddenLine.Settings]] are not applied - edges use the elements' width, style, and color.\n * [[ViewFlags.hiddenEdges]] is ignored - hidden edges are never displayed in wireframe mode.\n */\n Wireframe = 0,\n /** By default, renders surfaces without their edges.\n * Lighting and shadows can be applied using [[ViewFlags.lighting]] and [[ViewFlags.shadows]].\n * Edges can be enabled using [[ViewFlags.visibleEdges]] and [[ViewFlags.hiddenEdges]], and their appearance customized using [[HiddenLine.Settings]].\n * Surfaces can be drawn with transparency, based on [[ViewFlags.transparency]].\n */\n SmoothShade = 6,\n /** Renders surfaces and their edges. By default, edges are drawn in white; this can be overridden using [[HiddenLine.Settings]].\n * All surfaces are rendered opaque. If a surface's transparency is below that specified by [[HiddenLine.Settings.transparencyThreshold]], it is not rendered.\n * Materials and textures are not applied - surfaces are drawn in their actual colors.\n * [[ViewFlags.visibleEdges]] is ignored - visible edges are always drawn. Hidden edges can be enabled using [[ViewFlags.hiddenEdges]].\n * Lighting (and by extension, shadows) is not applied.\n */\n SolidFill = 4,\n /** Identical to [[RenderMode.SolidFill]], except:\n * - Surfaces are drawn using the [DisplayStyle]($backend)'s background color.\n * - Edges are drawn using their surface's colors; this can be overridden using [[HiddenLine.Settings]].\n */\n HiddenLine = 3,\n}\n\n/** JSON representation of [[ViewFlags]].\n * This is a persistence format with some unfortunate quirks that have been retained for backwards compatibility.\n * In particular, it supplies three separate flags intended to control lighting - [[noCameraLights]], [[noSourceLights]], and [[noSolarLight]] -\n * but there exists only a single [[ViewFlags.lighting]] flag. [[ViewFlags.lighting]] is set to true unless all three of the \"no lighting\" flags are true.\n * It also uses awkward negative ([[noConstruct]], [[noTransp]]) and/or abbreviated ([[clipVol]], [[visEdges]]) property names that differ from\n * those of the corresponding [[ViewFlags]] properties, making usage of this type in code error-prone.\n * Prefer to use [[ViewFlagsProperties]] unless you need to work directly with the persistence format.\n * @public\n * @extensions\n */\nexport interface ViewFlagProps {\n /** If true, don't display geometry of class [[GeometryClass.Construction]]. */\n noConstruct?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Dimension]]. */\n noDim?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Pattern]]. */\n noPattern?: boolean;\n /** If true, all lines are drawn with a width of 1 pixel. */\n noWeight?: boolean;\n /** If true, don't apply [[LinePixels]] styles. */\n noStyle?: boolean;\n /** If true, display transparency geometry as opaque. */\n noTransp?: boolean;\n /** If true, don't show filled planar regions, unless they use [[FillFlags.Always]]. */\n noFill?: boolean;\n /** If true, display a grid in the view. */\n grid?: boolean;\n /** If true, display graphics representing the [AuxCoordSystem]($backend). */\n acs?: boolean;\n /** If true, don't apply [[RenderTexture]]s to surfaces. */\n noTexture?: boolean;\n /** If true, don't apply [[RenderMaterial]]s to surfaces. */\n noMaterial?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noCameraLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSourceLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSolarLight?: boolean;\n /** If true, display the edges of surfaces. */\n visEdges?: boolean;\n /** If true, display the edges of surfaces, even if they are behind other geometry. */\n hidEdges?: boolean;\n /** If true, display shadows. */\n shadows?: boolean;\n /** If true, apply the view's clipping volume. Has no effect on other types of clips like [[ModelClipGroups]]. */\n clipVol?: boolean;\n /** If true, apply the view's [[DisplayStyleSettings.monochromeColor]] and [[DisplayStyleSettings.monochromeMode]] to produce a monochrome image. */\n monochrome?: boolean;\n /** The basic rendering mode, which affects the behavior of other flags. */\n renderMode?: RenderMode;\n /** Display a background map. */\n backgroundMap?: boolean;\n /** If true, apply [[AmbientOcclusion]]. */\n ambientOcclusion?: boolean;\n /** If true, apply [[ThematicDisplay]]. */\n thematicDisplay?: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n wiremesh?: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n forceSurfaceDiscard?: boolean;\n /** Disables the \"white-on-white reversal\" employed by some CAD applications.\n * @see [[ViewFlags.whiteOnWhiteReversal]].\n */\n noWhiteOnWhiteReversal?: boolean;\n}\n\nfunction edgesRequired(renderMode: RenderMode, visibleEdges: boolean): boolean {\n return visibleEdges || RenderMode.SmoothShade !== renderMode;\n}\n\n/** Flags controlling how graphics appear within a view.\n * A [[ViewFlags]] object is immutable. There are several ways to produce a modified copy of a ViewFlags object:\n * ```ts\n * // Start with the default values for all properties.\n * let vf = ViewFlags.defaults;\n * // Change a single boolean property:\n * vf = vf.with(\"visibleEdges\", true);\n * // Change only the render mode:\n * vf = vf.withRenderMode(RenderMode.HiddenLine);\n * // Change multiple properties:\n * vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });\n * // Reset multiple properties to their default values:\n * vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });\n *\n * ```\n * [[with]] and [[withRenderMode]] should be preferred if you only need to change a single property, as they will not create a new object unless\n * the new value differs from the current value.\n * [[copy]] and [[override]] should be preferred if you need to change multiple properties, as they will create no more than one new object, vs\n * each call to [[with]] or [[withRenderMode]] potentially creating a new object.\n * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).\n * @public\n */\nexport class ViewFlags {\n /** The basic rendering mode applied to the view. This modulates the behavior of some of the other flags.\n * Default: [[RenderMode.Wireframe]].\n * @see [[RenderMode]] for details.\n */\n public readonly renderMode: RenderMode;\n /** Whether to display geometry of class [[GeometryClass.Dimension]]. Default: true. */\n public readonly dimensions: boolean;\n /** Whether to display geometry of class [[GeometryClass.Pattern]]. Default: true. */\n public readonly patterns: boolean;\n /** Whether to allow lines and edges to draw with width greater than one pixel. Default: true. */\n public readonly weights: boolean;\n /** Whether [[LinePixels]] are allowed to apply patterns to lines and edges. If false, they all draw as solid lines. Default: true. */\n public readonly styles: boolean;\n /** Whether element transparency is applied. If false, transparent geometry is drawn opaque. Default: true.\n * @see [[RenderMode]] for render mode-specific behavior.\n */\n public readonly transparency: boolean;\n /** In [[RenderMode.Wireframe]] only, whether to display the interiors of planar regions with [[FillFlags.ByView]]. Default: true. */\n public readonly fill: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderTexture]]s to surfaces. Default: true. */\n public readonly textures: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderMaterial]]s to surfaces. Default: true. */\n public readonly materials: boolean;\n /** Whether to display a graphical representation of the view's [AuxCoordSystem]($backend). Default: false. */\n public readonly acsTriad: boolean;\n /** Whether to display a grid. Default: false. */\n public readonly grid: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display the edges of surfaces. Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly visibleEdges: boolean;\n /** In any mode except [[RenderMode.Wireframe]], whether to display the edges of surfaces occluded by other geometry.\n * This has no effect unless [[visibleEdges]] is also true.\n * Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly hiddenEdges: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display solar shadows. This has no effect unless [[lighting]] is also true. Default: false.\n * @note Rendering shadows can reduce framerate, particularly on less capable graphics hardware or in complex scenes.\n */\n public readonly shadows: boolean;\n /** Whether to apply the view's clip volume to the geometry in the scene.\n * Default: true, except when using [[fromJSON]].\n * @see [[ViewDetails.clipVector]] to define the view's clip volume.\n */\n public readonly clipVolume: boolean;\n /** Whether to display geometry of class [[GeometryClass.Construction]].\n * Default: false, except when using [[fromJSON]].\n */\n public readonly constructions: boolean;\n /** Whether to produce a monochrome image. Default: false.\n * @see [DisplayStyleSettings.monochromeColor]($common) to define the monochrome color.\n * @see [DisplayStyleSettings.monochromeMode]($common) to define how the monochrome image is produced.\n */\n public readonly monochrome: boolean;\n /** Whether to display background map imagery. Default: false.\n * @see [[DisplayStyleSettings.backgroundMap]] to customize the map settings.\n */\n public readonly backgroundMap: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[AmbientOcclusion]]. Default: false. */\n public readonly ambientOcclusion: boolean;\n /** Whether to apply [[ThematicDisplay]]. Default: false. */\n public readonly thematicDisplay: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n public readonly wiremesh: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n public readonly forceSurfaceDiscard: boolean;\n /** Whether to apply white-on-white reversal.\n * Some CAD applications use this to cause white geometry to be drawn as black if the view's background color is white.\n * When enabled, the [[DisplayStyleSettings]]' [[WhiteOnWhiteReversalSettings]] control how white-on-white reversal is applied.\n * Default: true.\n */\n public readonly whiteOnWhiteReversal: boolean;\n\n /** In [[RenderMode.SmoothShade]], whether to apply lighting to surfaces.\n * Default: false, except when using [[fromJSON]].\n * @see [[DisplayStyleSettings.lights]] to customize the light settings.\n */\n public readonly lighting: boolean;\n\n /** Create a new ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public constructor(flags?: Partial<ViewFlagsProperties>) {\n this.renderMode = flags?.renderMode ?? RenderMode.Wireframe;\n this.dimensions = flags?.dimensions ?? true;\n this.patterns = flags?.patterns ?? true;\n this.weights = flags?.weights ?? true;\n this.styles = flags?.styles ?? true;\n this.transparency = flags?.transparency ?? true;\n this.fill = flags?.fill ?? true;\n this.textures = flags?.textures ?? true;\n this.materials = flags?.materials ?? true;\n this.acsTriad = flags?.acsTriad ?? false;\n this.grid = flags?.grid ?? false;\n this.visibleEdges = flags?.visibleEdges ?? false;\n this.hiddenEdges = flags?.hiddenEdges ?? false;\n this.shadows = flags?.shadows ?? false;\n this.clipVolume = flags?.clipVolume ?? true;\n this.constructions = flags?.constructions ?? false;\n this.monochrome = flags?.monochrome ?? false;\n this.backgroundMap = flags?.backgroundMap ?? false;\n this.ambientOcclusion = flags?.ambientOcclusion ?? false;\n this.thematicDisplay = flags?.thematicDisplay ?? false;\n this.wiremesh = flags?.wiremesh ?? false;\n this.forceSurfaceDiscard = flags?.forceSurfaceDiscard ?? false;\n this.whiteOnWhiteReversal = flags?.whiteOnWhiteReversal ?? true;\n this.lighting = flags?.lighting ?? false;\n }\n\n /** Produce a copy of these ViewFlags with some modified properties. Any properties not explicitly specified by `changedFlags` will retain their current values.\n * @param changedFlags Properties to modify.\n * @returns A copy of these ViewFlags modified according to the supplied properties.\n * @note Any explicitly `undefined` property of `changedFlags` will be set to its default value in the returned ViewFlags.\n * @see [[override]] to have `undefined` properties retain their current values.\n */\n public copy(changedFlags: Partial<ViewFlagsProperties>): ViewFlags {\n return JsonUtils.isNonEmptyObject(changedFlags) ? new ViewFlags({ ...this, ...changedFlags }) : this;\n }\n\n /** Produce a copy of these ViewFlags, overriding some of its properties. Any properties not explicitly specified by `overrides` will retain their current values,\n * as will any property explicitly set to `undefined`.\n * @param overrides The properties to override.\n * @see [[copy]] to have `undefined` properties reset to their default values.\n */\n public override(overrides: Partial<ViewFlagsProperties>): ViewFlags {\n // This method can get called very frequently when a RenderTimeline script is applied to the view. Often `overrides` will be an empty object.\n // To optimize:\n // - Bail as quickly as possible if nothing is actually overridden, without allocating a new ViewFlags.\n // - Only make a copy of the input if at least one property is explicitly `undefined`.\n let copied = false;\n let anyOverridden = false;\n\n for (const propName of Object.keys(overrides)) {\n const key = propName as keyof Partial<ViewFlagsProperties>;\n const overrideValue = overrides[key];\n if (undefined === overrideValue) {\n if (!copied) {\n // Don't modify input...\n overrides = { ...overrides };\n copied = true;\n }\n\n // `undefined` means \"retain existing value\".\n delete overrides[key];\n } else if (overrideValue !== this[key]) {\n anyOverridden = true;\n }\n }\n\n return anyOverridden ? this.copy(overrides) : this;\n }\n\n /** Produce a copy of these ViewFlags with a single boolean property changed.\n * @param flag The name of the property.\n * @param value The value to change the property to.\n * @returns A new ViewFlags with the property changed as specified, or `this` if the property already has the specified value.\n * @see [[withRenderMode]] to change the [[renderMode]] property.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public with(flag: keyof Omit<ViewFlagsProperties, \"renderMode\">, value: boolean): ViewFlags {\n if (this[flag] === value)\n return this;\n\n const props: ViewFlagsProperties = { ...this };\n props[flag] = value;\n return new ViewFlags(props);\n }\n\n /** Produce a copy of these ViewFlags with a different [[renderMode]].\n * @param renderMode The new render mode.\n * @returns A new ViewFlags with the render mode changed as specified, or `this` if the render mode is already set to the requested value.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public withRenderMode(renderMode: RenderMode): ViewFlags {\n return renderMode === this.renderMode ? this : this.copy({ renderMode });\n }\n\n /** Adjust some view flags based on [[renderMode]]. For example, [[transparency]] is always treated as `false` in [[RenderMode.SolidFill]]. */\n public normalize(): ViewFlags {\n switch (this.renderMode) {\n case RenderMode.Wireframe:\n if (this.visibleEdges || this.hiddenEdges)\n return this.copy({ visibleEdges: false, hiddenEdges: false });\n break;\n case RenderMode.SmoothShade:\n if (!this.visibleEdges)\n return this.copy({ hiddenEdges: false });\n break;\n case RenderMode.HiddenLine:\n case RenderMode.SolidFill:\n if (!this.visibleEdges || this.transparency)\n return this.copy({ visibleEdges: true, transparency: false });\n break;\n }\n\n return this;\n }\n\n /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */\n public hiddenEdgesVisible(): boolean {\n switch (this.renderMode) {\n case RenderMode.SolidFill:\n case RenderMode.HiddenLine:\n return this.hiddenEdges;\n case RenderMode.SmoothShade:\n return this.visibleEdges && this.hiddenEdges;\n }\n return true;\n }\n\n /** Returns true if the edges of surfaces should be displayed, based on [[RenderMode]] and the [[visibleEdges]] flag. */\n public edgesRequired(): boolean {\n return edgesRequired(this.renderMode, this.visibleEdges);\n }\n\n /** Convert to JSON representation.\n * Properties are omitted if they match the default values.\n */\n public toJSON(): ViewFlagProps {\n const out: ViewFlagProps = {};\n if (!this.constructions)\n out.noConstruct = true;\n if (!this.dimensions)\n out.noDim = true;\n if (!this.patterns)\n out.noPattern = true;\n if (!this.weights)\n out.noWeight = true;\n if (!this.styles)\n out.noStyle = true;\n if (!this.transparency)\n out.noTransp = true;\n if (!this.fill)\n out.noFill = true;\n if (this.grid)\n out.grid = true;\n if (this.acsTriad)\n out.acs = true;\n if (!this.textures)\n out.noTexture = true;\n if (!this.materials)\n out.noMaterial = true;\n if (!this.lighting)\n out.noCameraLights = out.noSourceLights = out.noSolarLight = true;\n if (this.visibleEdges)\n out.visEdges = true;\n if (this.hiddenEdges)\n out.hidEdges = true;\n if (this.shadows)\n out.shadows = true;\n if (this.clipVolume)\n out.clipVol = true;\n if (this.monochrome)\n out.monochrome = true;\n if (this.backgroundMap)\n out.backgroundMap = true;\n if (this.ambientOcclusion)\n out.ambientOcclusion = true;\n if (this.thematicDisplay)\n out.thematicDisplay = true;\n if (this.wiremesh)\n out.wiremesh = true;\n if (this.forceSurfaceDiscard)\n out.forceSurfaceDiscard = true;\n if (!this.whiteOnWhiteReversal)\n out.noWhiteOnWhiteReversal = true;\n\n out.renderMode = this.renderMode;\n return out;\n }\n\n /** Like [[toJSON]], but no properties are omitted. */\n public toFullyDefinedJSON(): Required<ViewFlagProps> {\n return {\n renderMode: this.renderMode,\n noConstruct: !this.constructions,\n noDim: !this.dimensions,\n noPattern: !this.patterns,\n noWeight: !this.weights,\n noStyle: !this.styles,\n noTransp: !this.transparency,\n noFill: !this.fill,\n grid: this.grid,\n acs: this.acsTriad,\n noTexture: !this.textures,\n noMaterial: !this.materials,\n noCameraLights: !this.lighting,\n noSourceLights: !this.lighting,\n noSolarLight: !this.lighting,\n visEdges: this.visibleEdges,\n hidEdges: this.hiddenEdges,\n shadows: this.shadows,\n clipVol: this.clipVolume,\n monochrome: this.monochrome,\n backgroundMap: this.backgroundMap,\n ambientOcclusion: this.ambientOcclusion,\n thematicDisplay: this.thematicDisplay,\n wiremesh: this.wiremesh,\n forceSurfaceDiscard: this.forceSurfaceDiscard,\n noWhiteOnWhiteReversal: !this.whiteOnWhiteReversal,\n };\n }\n\n /** A ViewFlags object with all properties initialized to their default values. */\n public static readonly defaults = new ViewFlags();\n\n /** Create a ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public static create(flags?: Partial<ViewFlagsProperties>): ViewFlags {\n return flags && !JsonUtils.isEmptyObject(flags) ? new ViewFlags(flags) : this.defaults;\n }\n\n /** Create a ViewFlags from its JSON representation.\n * @note As described in [[ViewFlagProps]], the JSON representation is awkward and error-prone. Prefer to use [[create]] unless you\n * need to deal with the persistence format directly.\n * @note The default values differ slightly from those used by the constructor and [[create]]:\n * - [[clipVolume]] defaults to false.\n * - [[constructions]] defaults to true.\n * - [[lighting]] defaults to true unless all of [[ViewFlagProps.noSolarLight]], [[ViewFlagProps.noCameraLights]], and [[ViewFlagProps.noSourceLights]] are true.\n */\n public static fromJSON(json?: ViewFlagProps): ViewFlags {\n if (!json)\n return this.defaults;\n\n let renderMode: RenderMode;\n const renderModeValue = JsonUtils.asInt(json.renderMode);\n if (renderModeValue < RenderMode.HiddenLine)\n renderMode = RenderMode.Wireframe;\n else if (renderModeValue > RenderMode.SolidFill)\n renderMode = RenderMode.SmoothShade;\n else\n renderMode = renderModeValue;\n\n const lighting = !JsonUtils.asBool(json.noCameraLights) || !JsonUtils.asBool(json.noSourceLights) || !JsonUtils.asBool(json.noSolarLight);\n return new ViewFlags({\n renderMode,\n lighting,\n constructions: !JsonUtils.asBool(json.noConstruct),\n dimensions: !JsonUtils.asBool(json.noDim),\n patterns: !JsonUtils.asBool(json.noPattern),\n weights: !JsonUtils.asBool(json.noWeight),\n styles: !JsonUtils.asBool(json.noStyle),\n transparency: !JsonUtils.asBool(json.noTransp),\n fill: !JsonUtils.asBool(json.noFill),\n grid: JsonUtils.asBool(json.grid),\n acsTriad: JsonUtils.asBool(json.acs),\n textures: !JsonUtils.asBool(json.noTexture),\n materials: !JsonUtils.asBool(json.noMaterial),\n visibleEdges: JsonUtils.asBool(json.visEdges),\n hiddenEdges: JsonUtils.asBool(json.hidEdges),\n shadows: JsonUtils.asBool(json.shadows),\n clipVolume: JsonUtils.asBool(json.clipVol),\n monochrome: JsonUtils.asBool(json.monochrome),\n backgroundMap: JsonUtils.asBool(json.backgroundMap),\n ambientOcclusion: JsonUtils.asBool(json.ambientOcclusion),\n thematicDisplay: JsonUtils.asBool(json.thematicDisplay),\n wiremesh: JsonUtils.asBool(json.wiremesh),\n forceSurfaceDiscard: JsonUtils.asBool(json.forceSurfaceDiscard),\n whiteOnWhiteReversal: !JsonUtils.asBool(json.noWhiteOnWhiteReversal),\n });\n }\n\n /** Returns true if `this` and `other` are equivalent. */\n public equals(other: Readonly<ViewFlagsProperties>): boolean {\n if (this === other)\n return true;\n\n return this.renderMode === other.renderMode\n && this.dimensions === other.dimensions\n && this.patterns === other.patterns\n && this.weights === other.weights\n && this.styles === other.styles\n && this.transparency === other.transparency\n && this.fill === other.fill\n && this.textures === other.textures\n && this.materials === other.materials\n && this.acsTriad === other.acsTriad\n && this.grid === other.grid\n && this.visibleEdges === other.visibleEdges\n && this.hiddenEdges === other.hiddenEdges\n && this.lighting === other.lighting\n && this.shadows === other.shadows\n && this.clipVolume === other.clipVolume\n && this.constructions === other.constructions\n && this.monochrome === other.monochrome\n && this.backgroundMap === other.backgroundMap\n && this.ambientOcclusion === other.ambientOcclusion\n && this.thematicDisplay === other.thematicDisplay\n && this.wiremesh === other.wiremesh\n && this.forceSurfaceDiscard === other.forceSurfaceDiscard\n && this.whiteOnWhiteReversal === other.whiteOnWhiteReversal;\n }\n}\n\n/** A type containing all of the properties of [[ViewFlags]] with none of the methods and with the `readonly` modifiers removed.\n * @see [[ViewFlags.create]], [[ViewFlags.copy]], and [[ViewFlags.override]] for methods accepting an object of this type.\n * @public\n * @extensions\n */\nexport type ViewFlagsProperties = Mutable<NonFunctionPropertiesOf<ViewFlags>>;\n\n/** A type that describes how to override selected properties of a [[ViewFlags]].\n * @see [[ViewFlags.override]] to apply the overrides to a ViewFlags object.\n * @public\n * @extensions\n */\nexport type ViewFlagOverrides = Partial<ViewFlagsProperties>;\n"]}
1
+ {"version":3,"file":"ViewFlags.js","sourceRoot":"","sources":["../../src/ViewFlags.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qBAAqB;AAErB,OAAO,EAAE,SAAS,EAAoC,MAAM,qBAAqB,CAAC;AAElF;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB;;;;OAIG;IACH,qDAAa,CAAA;IACb;;;;OAIG;IACH,yDAAe,CAAA;IACf;;;;;OAKG;IACH,qDAAa,CAAA;IACb;;;OAGG;IACH,uDAAc,CAAA;AAChB,CAAC,EAzBW,UAAU,KAAV,UAAU,QAyBrB;AA0ED,SAAS,aAAa,CAAC,UAAsB,EAAE,YAAqB;IAClE,OAAO,YAAY,IAAI,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,SAAS;IACpB;;;OAGG;IACa,UAAU,CAAa;IACvC,uFAAuF;IACvE,UAAU,CAAU;IACpC,qFAAqF;IACrE,QAAQ,CAAU;IAClC,iGAAiG;IACjF,OAAO,CAAU;IACjC,sIAAsI;IACtH,MAAM,CAAU;IAChC;;OAEG;IACa,YAAY,CAAU;IACtC,qIAAqI;IACrH,IAAI,CAAU;IAC9B,qGAAqG;IACrF,QAAQ,CAAU;IAClC,sGAAsG;IACtF,SAAS,CAAU;IACnC,8GAA8G;IAC9F,QAAQ,CAAU;IAClC,iDAAiD;IACjC,IAAI,CAAU;IAC9B;;OAEG;IACa,YAAY,CAAU;IACtC;;;;OAIG;IACa,WAAW,CAAU;IACrC;;O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I,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;eAC9B,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;eACpC,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;eACpC,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,gBAAgB,KAAK,KAAK,CAAC,gBAAgB;eAChD,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe;eAC9C,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,mBAAmB,KAAK,KAAK,CAAC,mBAAmB;eACtD,IAAI,CAAC,oBAAoB,KAAK,KAAK,CAAC,oBAAoB,CAAC;IAChE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\n// cspell:ignore ovrs\n\nimport { JsonUtils, Mutable, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\n\n/** Enumerates the available basic rendering modes, as part of a [DisplayStyle]($backend)'s [[ViewFlags]].\n * The rendering mode broadly affects various aspects of the display style - in particular, whether and how surfaces and their edges are drawn.\n * @public\n * @extensions\n */\nexport enum RenderMode {\n /** Renders only the edges of surfaces, with exceptions for planar regions based on their [[FillFlags]].\n * Lighting (and by extension, shadows) is not applied.\n * [[HiddenLine.Settings]] are not applied - edges use the elements' width, style, and color.\n * [[ViewFlags.hiddenEdges]] is ignored - hidden edges are never displayed in wireframe mode.\n */\n Wireframe = 0,\n /** By default, renders surfaces without their edges.\n * Lighting and shadows can be applied using [[ViewFlags.lighting]] and [[ViewFlags.shadows]].\n * Edges can be enabled using [[ViewFlags.visibleEdges]] and [[ViewFlags.hiddenEdges]], and their appearance customized using [[HiddenLine.Settings]].\n * Surfaces can be drawn with transparency, based on [[ViewFlags.transparency]].\n */\n SmoothShade = 6,\n /** Renders surfaces and their edges. By default, edges are drawn in white; this can be overridden using [[HiddenLine.Settings]].\n * All surfaces are rendered opaque. If a surface's transparency is below that specified by [[HiddenLine.Settings.transparencyThreshold]], it is not rendered.\n * Materials and textures are not applied - surfaces are drawn in their actual colors.\n * [[ViewFlags.visibleEdges]] is ignored - visible edges are always drawn. Hidden edges can be enabled using [[ViewFlags.hiddenEdges]].\n * Lighting (and by extension, shadows) is not applied.\n */\n SolidFill = 4,\n /** Identical to [[RenderMode.SolidFill]], except:\n * - Surfaces are drawn using the [DisplayStyle]($backend)'s background color.\n * - Edges are drawn using their surface's colors; this can be overridden using [[HiddenLine.Settings]].\n */\n HiddenLine = 3,\n}\n\n/** JSON representation of [[ViewFlags]].\n * This is a persistence format with some unfortunate quirks that have been retained for backwards compatibility.\n * In particular, it supplies three separate flags intended to control lighting - [[noCameraLights]], [[noSourceLights]], and [[noSolarLight]] -\n * but there exists only a single [[ViewFlags.lighting]] flag. [[ViewFlags.lighting]] is set to true unless all three of the \"no lighting\" flags are true.\n * It also uses awkward negative ([[noConstruct]], [[noTransp]]) and/or abbreviated ([[clipVol]], [[visEdges]]) property names that differ from\n * those of the corresponding [[ViewFlags]] properties, making usage of this type in code error-prone.\n * Prefer to use [[ViewFlagsProperties]] unless you need to work directly with the persistence format.\n * @public\n * @extensions\n */\nexport interface ViewFlagProps {\n /** If true, don't display geometry of class [[GeometryClass.Construction]]. */\n noConstruct?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Dimension]]. */\n noDim?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Pattern]]. */\n noPattern?: boolean;\n /** If true, all lines are drawn with a width of 1 pixel. */\n noWeight?: boolean;\n /** If true, don't apply [[LinePixels]] styles. */\n noStyle?: boolean;\n /** If true, display transparency geometry as opaque. */\n noTransp?: boolean;\n /** If true, don't show filled planar regions, unless they use [[FillFlags.Always]]. */\n noFill?: boolean;\n /** If true, display a grid in the view. */\n grid?: boolean;\n /** If true, display graphics representing the [AuxCoordSystem]($backend). */\n acs?: boolean;\n /** If true, don't apply [[RenderTexture]]s to surfaces. */\n noTexture?: boolean;\n /** If true, don't apply [[RenderMaterial]]s to surfaces. */\n noMaterial?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noCameraLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSourceLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSolarLight?: boolean;\n /** If true, display the edges of surfaces. */\n visEdges?: boolean;\n /** If true, display the edges of surfaces, even if they are behind other geometry. */\n hidEdges?: boolean;\n /** If true, display shadows. */\n shadows?: boolean;\n /** If true, apply the view's clipping volume. Has no effect on other types of clips like [[ModelClipGroups]]. */\n clipVol?: boolean;\n /** If true, apply the view's [[DisplayStyleSettings.monochromeColor]] and [[DisplayStyleSettings.monochromeMode]] to produce a monochrome image. */\n monochrome?: boolean;\n /** The basic rendering mode, which affects the behavior of other flags. */\n renderMode?: RenderMode;\n /** Display a background map. */\n backgroundMap?: boolean;\n /** If true, apply [[AmbientOcclusion]]. */\n ambientOcclusion?: boolean;\n /** If true, apply [[ThematicDisplay]]. */\n thematicDisplay?: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n wiremesh?: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n forceSurfaceDiscard?: boolean;\n /** Disables the \"white-on-white reversal\" employed by some CAD applications.\n * @see [[ViewFlags.whiteOnWhiteReversal]].\n */\n noWhiteOnWhiteReversal?: boolean;\n}\n\nfunction edgesRequired(renderMode: RenderMode, visibleEdges: boolean): boolean {\n return visibleEdges || RenderMode.SmoothShade !== renderMode;\n}\n\n/** Flags controlling how graphics appear within a view.\n * A [[ViewFlags]] object is immutable. There are several ways to produce a modified copy of a ViewFlags object:\n * ```ts\n * // Start with the default values for all properties.\n * let vf = ViewFlags.defaults;\n * // Change a single boolean property:\n * vf = vf.with(\"visibleEdges\", true);\n * // Change only the render mode:\n * vf = vf.withRenderMode(RenderMode.HiddenLine);\n * // Change multiple properties:\n * vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });\n * // Reset multiple properties to their default values:\n * vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });\n *\n * ```\n * [[with]] and [[withRenderMode]] should be preferred if you only need to change a single property, as they will not create a new object unless\n * the new value differs from the current value.\n * [[copy]] and [[override]] should be preferred if you need to change multiple properties, as they will create no more than one new object, vs\n * each call to [[with]] or [[withRenderMode]] potentially creating a new object.\n * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).\n * @public\n */\nexport class ViewFlags {\n /** The basic rendering mode applied to the view. This modulates the behavior of some of the other flags.\n * Default: [[RenderMode.Wireframe]].\n * @see [[RenderMode]] for details.\n */\n public readonly renderMode: RenderMode;\n /** Whether to display geometry of class [[GeometryClass.Dimension]]. Default: true. */\n public readonly dimensions: boolean;\n /** Whether to display geometry of class [[GeometryClass.Pattern]]. Default: true. */\n public readonly patterns: boolean;\n /** Whether to allow lines and edges to draw with width greater than one pixel. Default: true. */\n public readonly weights: boolean;\n /** Whether [[LinePixels]] are allowed to apply patterns to lines and edges. If false, they all draw as solid lines. Default: true. */\n public readonly styles: boolean;\n /** Whether element transparency is applied. If false, transparent geometry is drawn opaque. Default: true.\n * @see [[RenderMode]] for render mode-specific behavior.\n */\n public readonly transparency: boolean;\n /** In [[RenderMode.Wireframe]] only, whether to display the interiors of planar regions with [[FillFlags.ByView]]. Default: true. */\n public readonly fill: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderTexture]]s to surfaces. Default: true. */\n public readonly textures: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderMaterial]]s to surfaces. Default: true. */\n public readonly materials: boolean;\n /** Whether to display a graphical representation of the view's [AuxCoordSystem]($backend). Default: false. */\n public readonly acsTriad: boolean;\n /** Whether to display a grid. Default: false. */\n public readonly grid: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display the edges of surfaces. Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly visibleEdges: boolean;\n /** In any mode except [[RenderMode.Wireframe]], whether to display the edges of surfaces occluded by other geometry.\n * This has no effect unless [[visibleEdges]] is also true.\n * Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly hiddenEdges: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display solar shadows. This has no effect unless [[lighting]] is also true. Default: false.\n * @note Rendering shadows can reduce framerate, particularly on less capable graphics hardware or in complex scenes.\n */\n public readonly shadows: boolean;\n /** Whether to apply the view's clip volume to the geometry in the scene.\n * Default: true, except when using [[fromJSON]].\n * @see [[ViewDetails.clipVector]] to define the view's clip volume.\n */\n public readonly clipVolume: boolean;\n /** Whether to display geometry of class [[GeometryClass.Construction]].\n * Default: false, except when using [[fromJSON]].\n */\n public readonly constructions: boolean;\n /** Whether to produce a monochrome image. Default: false.\n * @see [DisplayStyleSettings.monochromeColor]($common) to define the monochrome color.\n * @see [DisplayStyleSettings.monochromeMode]($common) to define how the monochrome image is produced.\n */\n public readonly monochrome: boolean;\n /** Whether to display background map imagery. Default: false.\n * @see [[DisplayStyleSettings.backgroundMap]] to customize the map settings.\n */\n public readonly backgroundMap: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[AmbientOcclusion]]. Default: false. */\n public readonly ambientOcclusion: boolean;\n /** Whether to apply [[ThematicDisplay]]. Default: false. */\n public readonly thematicDisplay: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n public readonly wiremesh: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n public readonly forceSurfaceDiscard: boolean;\n /** Whether to apply white-on-white reversal.\n * Some CAD applications use this to cause white geometry to be drawn as black if the view's background color is white.\n * When enabled, the [[DisplayStyleSettings]]' [[WhiteOnWhiteReversalSettings]] control how white-on-white reversal is applied.\n * Default: true.\n */\n public readonly whiteOnWhiteReversal: boolean;\n\n /** In [[RenderMode.SmoothShade]], whether to apply lighting to surfaces.\n * Default: false, except when using [[fromJSON]].\n * @see [[DisplayStyleSettings.lights]] to customize the light settings.\n */\n public readonly lighting: boolean;\n\n /** Create a new ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public constructor(flags?: Partial<ViewFlagsProperties>) {\n this.renderMode = flags?.renderMode ?? RenderMode.Wireframe;\n this.dimensions = flags?.dimensions ?? true;\n this.patterns = flags?.patterns ?? true;\n this.weights = flags?.weights ?? true;\n this.styles = flags?.styles ?? true;\n this.transparency = flags?.transparency ?? true;\n this.fill = flags?.fill ?? true;\n this.textures = flags?.textures ?? true;\n this.materials = flags?.materials ?? true;\n this.acsTriad = flags?.acsTriad ?? false;\n this.grid = flags?.grid ?? false;\n this.visibleEdges = flags?.visibleEdges ?? false;\n this.hiddenEdges = flags?.hiddenEdges ?? false;\n this.shadows = flags?.shadows ?? false;\n this.clipVolume = flags?.clipVolume ?? true;\n this.constructions = flags?.constructions ?? false;\n this.monochrome = flags?.monochrome ?? false;\n this.backgroundMap = flags?.backgroundMap ?? false;\n this.ambientOcclusion = flags?.ambientOcclusion ?? false;\n this.thematicDisplay = flags?.thematicDisplay ?? false;\n this.wiremesh = flags?.wiremesh ?? false;\n this.forceSurfaceDiscard = flags?.forceSurfaceDiscard ?? false;\n this.whiteOnWhiteReversal = flags?.whiteOnWhiteReversal ?? true;\n this.lighting = flags?.lighting ?? false;\n }\n\n /** Produce a copy of these ViewFlags with some modified properties. Any properties not explicitly specified by `changedFlags` will retain their current values.\n * @param changedFlags Properties to modify.\n * @returns A copy of these ViewFlags modified according to the supplied properties.\n * @note Any explicitly `undefined` property of `changedFlags` will be set to its default value in the returned ViewFlags.\n * @see [[override]] to have `undefined` properties retain their current values.\n */\n public copy(changedFlags: Partial<ViewFlagsProperties>): ViewFlags {\n return JsonUtils.isNonEmptyObject(changedFlags) ? new ViewFlags({ ...this, ...changedFlags }) : this;\n }\n\n /** Produce a copy of these ViewFlags, overriding some of its properties. Any properties not explicitly specified by `overrides` will retain their current values,\n * as will any property explicitly set to `undefined`.\n * @param overrides The properties to override.\n * @see [[copy]] to have `undefined` properties reset to their default values.\n */\n public override(overrides: Partial<ViewFlagsProperties>): ViewFlags {\n // This method can get called very frequently when a RenderTimeline script is applied to the view. Often `overrides` will be an empty object.\n // To optimize:\n // - Bail as quickly as possible if nothing is actually overridden, without allocating a new ViewFlags.\n // - Only make a copy of the input if at least one property is explicitly `undefined`.\n let copied = false;\n let anyOverridden = false;\n\n for (const propName of Object.keys(overrides)) {\n const key = propName as keyof Partial<ViewFlagsProperties>;\n const overrideValue = overrides[key];\n if (undefined === overrideValue) {\n if (!copied) {\n // Don't modify input...\n overrides = { ...overrides };\n copied = true;\n }\n\n // `undefined` means \"retain existing value\".\n delete overrides[key];\n } else if (overrideValue !== this[key]) {\n anyOverridden = true;\n }\n }\n\n return anyOverridden ? this.copy(overrides) : this;\n }\n\n /** Produce a copy of these ViewFlags with a single boolean property changed.\n * @param flag The name of the property.\n * @param value The value to change the property to.\n * @returns A new ViewFlags with the property changed as specified, or `this` if the property already has the specified value.\n * @see [[withRenderMode]] to change the [[renderMode]] property.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public with(flag: keyof Omit<ViewFlagsProperties, \"renderMode\">, value: boolean): ViewFlags {\n if (this[flag] === value)\n return this;\n\n const props: ViewFlagsProperties = { ...this };\n props[flag] = value;\n return new ViewFlags(props);\n }\n\n /** Produce a copy of these ViewFlags with a different [[renderMode]].\n * @param renderMode The new render mode.\n * @returns A new ViewFlags with the render mode changed as specified, or `this` if the render mode is already set to the requested value.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public withRenderMode(renderMode: RenderMode): ViewFlags {\n return renderMode === this.renderMode ? this : this.copy({ renderMode });\n }\n\n /** Adjust some view flags based on [[renderMode]]. For example, [[transparency]] is always treated as `false` in [[RenderMode.SolidFill]]. */\n public normalize(): ViewFlags {\n switch (this.renderMode) {\n case RenderMode.Wireframe:\n if (this.visibleEdges || this.hiddenEdges)\n return this.copy({ visibleEdges: false, hiddenEdges: false });\n break;\n case RenderMode.SmoothShade:\n if (!this.visibleEdges)\n return this.copy({ hiddenEdges: false });\n break;\n case RenderMode.HiddenLine:\n case RenderMode.SolidFill:\n if (!this.visibleEdges || this.transparency)\n return this.copy({ visibleEdges: true, transparency: false });\n break;\n }\n\n return this;\n }\n\n /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */\n public hiddenEdgesVisible(): boolean {\n switch (this.renderMode) {\n case RenderMode.SolidFill:\n case RenderMode.HiddenLine:\n return this.hiddenEdges;\n case RenderMode.SmoothShade:\n return this.visibleEdges && this.hiddenEdges;\n }\n return true;\n }\n\n /** Returns true if the edges of surfaces should be displayed, based on [[RenderMode]] and the [[visibleEdges]] flag. */\n public edgesRequired(): boolean {\n return edgesRequired(this.renderMode, this.visibleEdges);\n }\n\n /** Convert to JSON representation.\n * Properties are omitted if they match the default values.\n */\n public toJSON(): ViewFlagProps {\n const out: ViewFlagProps = {};\n if (!this.constructions)\n out.noConstruct = true;\n if (!this.dimensions)\n out.noDim = true;\n if (!this.patterns)\n out.noPattern = true;\n if (!this.weights)\n out.noWeight = true;\n if (!this.styles)\n out.noStyle = true;\n if (!this.transparency)\n out.noTransp = true;\n if (!this.fill)\n out.noFill = true;\n if (this.grid)\n out.grid = true;\n if (this.acsTriad)\n out.acs = true;\n if (!this.textures)\n out.noTexture = true;\n if (!this.materials)\n out.noMaterial = true;\n if (!this.lighting)\n out.noCameraLights = out.noSourceLights = out.noSolarLight = true;\n if (this.visibleEdges)\n out.visEdges = true;\n if (this.hiddenEdges)\n out.hidEdges = true;\n if (this.shadows)\n out.shadows = true;\n if (this.clipVolume)\n out.clipVol = true;\n if (this.monochrome)\n out.monochrome = true;\n if (this.backgroundMap)\n out.backgroundMap = true;\n if (this.ambientOcclusion)\n out.ambientOcclusion = true;\n if (this.thematicDisplay)\n out.thematicDisplay = true;\n if (this.wiremesh)\n out.wiremesh = true;\n if (this.forceSurfaceDiscard)\n out.forceSurfaceDiscard = true;\n if (!this.whiteOnWhiteReversal)\n out.noWhiteOnWhiteReversal = true;\n\n out.renderMode = this.renderMode;\n return out;\n }\n\n /** Like [[toJSON]], but no properties are omitted. */\n public toFullyDefinedJSON(): Required<ViewFlagProps> {\n return {\n renderMode: this.renderMode,\n noConstruct: !this.constructions,\n noDim: !this.dimensions,\n noPattern: !this.patterns,\n noWeight: !this.weights,\n noStyle: !this.styles,\n noTransp: !this.transparency,\n noFill: !this.fill,\n grid: this.grid,\n acs: this.acsTriad,\n noTexture: !this.textures,\n noMaterial: !this.materials,\n noCameraLights: !this.lighting,\n noSourceLights: !this.lighting,\n noSolarLight: !this.lighting,\n visEdges: this.visibleEdges,\n hidEdges: this.hiddenEdges,\n shadows: this.shadows,\n clipVol: this.clipVolume,\n monochrome: this.monochrome,\n backgroundMap: this.backgroundMap,\n ambientOcclusion: this.ambientOcclusion,\n thematicDisplay: this.thematicDisplay,\n wiremesh: this.wiremesh,\n forceSurfaceDiscard: this.forceSurfaceDiscard,\n noWhiteOnWhiteReversal: !this.whiteOnWhiteReversal,\n };\n }\n\n /** A ViewFlags object with all properties initialized to their default values. */\n public static readonly defaults = new ViewFlags();\n\n /** Create a ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public static create(flags?: Partial<ViewFlagsProperties>): ViewFlags {\n return flags && !JsonUtils.isEmptyObject(flags) ? new ViewFlags(flags) : this.defaults;\n }\n\n /** Create a ViewFlags from its JSON representation.\n * @note As described in [[ViewFlagProps]], the JSON representation is awkward and error-prone. Prefer to use [[create]] unless you\n * need to deal with the persistence format directly.\n * @note The default values differ slightly from those used by the constructor and [[create]]:\n * - [[clipVolume]] defaults to false.\n * - [[constructions]] defaults to true.\n * - [[lighting]] defaults to true unless all of [[ViewFlagProps.noSolarLight]], [[ViewFlagProps.noCameraLights]], and [[ViewFlagProps.noSourceLights]] are true.\n */\n public static fromJSON(json?: ViewFlagProps): ViewFlags {\n if (!json)\n return this.defaults;\n\n let renderMode: RenderMode;\n const renderModeValue = JsonUtils.asInt(json.renderMode);\n if (renderModeValue < RenderMode.HiddenLine)\n renderMode = RenderMode.Wireframe;\n else if (renderModeValue > RenderMode.SolidFill)\n renderMode = RenderMode.SmoothShade;\n else\n renderMode = renderModeValue;\n\n const lighting = !JsonUtils.asBool(json.noCameraLights) || !JsonUtils.asBool(json.noSourceLights) || !JsonUtils.asBool(json.noSolarLight);\n return new ViewFlags({\n renderMode,\n lighting,\n constructions: !JsonUtils.asBool(json.noConstruct),\n dimensions: !JsonUtils.asBool(json.noDim),\n patterns: !JsonUtils.asBool(json.noPattern),\n weights: !JsonUtils.asBool(json.noWeight),\n styles: !JsonUtils.asBool(json.noStyle),\n transparency: !JsonUtils.asBool(json.noTransp),\n fill: !JsonUtils.asBool(json.noFill),\n grid: JsonUtils.asBool(json.grid),\n acsTriad: JsonUtils.asBool(json.acs),\n textures: !JsonUtils.asBool(json.noTexture),\n materials: !JsonUtils.asBool(json.noMaterial),\n visibleEdges: JsonUtils.asBool(json.visEdges),\n hiddenEdges: JsonUtils.asBool(json.hidEdges),\n shadows: JsonUtils.asBool(json.shadows),\n clipVolume: JsonUtils.asBool(json.clipVol),\n monochrome: JsonUtils.asBool(json.monochrome),\n backgroundMap: JsonUtils.asBool(json.backgroundMap),\n ambientOcclusion: JsonUtils.asBool(json.ambientOcclusion),\n thematicDisplay: JsonUtils.asBool(json.thematicDisplay),\n wiremesh: JsonUtils.asBool(json.wiremesh),\n forceSurfaceDiscard: JsonUtils.asBool(json.forceSurfaceDiscard),\n whiteOnWhiteReversal: !JsonUtils.asBool(json.noWhiteOnWhiteReversal),\n });\n }\n\n /** Returns true if `this` and `other` are equivalent. */\n public equals(other: Readonly<ViewFlagsProperties>): boolean {\n if (this === other)\n return true;\n\n return this.renderMode === other.renderMode\n && this.dimensions === other.dimensions\n && this.patterns === other.patterns\n && this.weights === other.weights\n && this.styles === other.styles\n && this.transparency === other.transparency\n && this.fill === other.fill\n && this.textures === other.textures\n && this.materials === other.materials\n && this.acsTriad === other.acsTriad\n && this.grid === other.grid\n && this.visibleEdges === other.visibleEdges\n && this.hiddenEdges === other.hiddenEdges\n && this.lighting === other.lighting\n && this.shadows === other.shadows\n && this.clipVolume === other.clipVolume\n && this.constructions === other.constructions\n && this.monochrome === other.monochrome\n && this.backgroundMap === other.backgroundMap\n && this.ambientOcclusion === other.ambientOcclusion\n && this.thematicDisplay === other.thematicDisplay\n && this.wiremesh === other.wiremesh\n && this.forceSurfaceDiscard === other.forceSurfaceDiscard\n && this.whiteOnWhiteReversal === other.whiteOnWhiteReversal;\n }\n}\n\n/** A type containing all of the properties of [[ViewFlags]] with none of the methods and with the `readonly` modifiers removed.\n * @see [[ViewFlags.create]], [[ViewFlags.copy]], and [[ViewFlags.override]] for methods accepting an object of this type.\n * @public\n * @extensions\n */\nexport type ViewFlagsProperties = Mutable<NonFunctionPropertiesOf<ViewFlags>>;\n\n/** A type that describes how to override selected properties of a [[ViewFlags]].\n * @see [[ViewFlags.override]] to apply the overrides to a ViewFlags object.\n * @public\n * @extensions\n */\nexport type ViewFlagOverrides = Partial<ViewFlagsProperties>;\n"]}
@@ -13,11 +13,16 @@
13
13
  * @public
14
14
  */
15
15
  export class WhiteOnWhiteReversalSettings {
16
+ /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only
17
+ * if the background color is pure white.
18
+ * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.
19
+ */
20
+ ignoreBackgroundColor;
16
21
  constructor(ignoreBackground) {
17
22
  this.ignoreBackgroundColor = ignoreBackground;
18
23
  }
19
- static { this._noIgnore = new WhiteOnWhiteReversalSettings(true); }
20
- static { this._ignore = new WhiteOnWhiteReversalSettings(false); }
24
+ static _noIgnore = new WhiteOnWhiteReversalSettings(true);
25
+ static _ignore = new WhiteOnWhiteReversalSettings(false);
21
26
  /** Create from JSON representation. */
22
27
  static fromJSON(props) {
23
28
  return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;
@@ -1 +1 @@
1
- {"version":3,"file":"WhiteOnWhiteReversalSettings.js","sourceRoot":"","sources":["../../src/WhiteOnWhiteReversalSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IAOvC,YAAoB,gBAAyB;QAC3C,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;IAChD,CAAC;aAEc,cAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;aACnD,YAAO,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEjE,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,OAAO,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACtE,CAAC;IAED,mHAAmH;IAC5G,MAAM;QACX,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;IAED,uDAAuD;IAChD,MAAM,CAAC,KAAmC;QAC/C,OAAO,IAAI,KAAK,KAAK,CAAC;IACxB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\n/** JSON representation of a [[WhiteOnWhiteReversalSettings]].\n * @public\n * @extensions\n */\nexport interface WhiteOnWhiteReversalProps {\n /** Default: false.\n * @see [[WhiteOnWhiteReversalSettings.ignoreBackgroundColor]].\n */\n ignoreBackgroundColor?: boolean;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more\n * visible in the view.\n * By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.\n * These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.\n * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.\n * @public\n */\nexport class WhiteOnWhiteReversalSettings {\n /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only\n * if the background color is pure white.\n * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.\n */\n public readonly ignoreBackgroundColor: boolean;\n\n private constructor(ignoreBackground: boolean) {\n this.ignoreBackgroundColor = ignoreBackground;\n }\n\n private static _noIgnore = new WhiteOnWhiteReversalSettings(true);\n private static _ignore = new WhiteOnWhiteReversalSettings(false);\n\n /** Create from JSON representation. */\n public static fromJSON(props?: WhiteOnWhiteReversalProps): WhiteOnWhiteReversalSettings {\n return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;\n }\n\n /** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */\n public toJSON(): WhiteOnWhiteReversalProps | undefined {\n return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: WhiteOnWhiteReversalSettings): boolean {\n return this === other;\n }\n}\n"]}
1
+ {"version":3,"file":"WhiteOnWhiteReversalSettings.js","sourceRoot":"","sources":["../../src/WhiteOnWhiteReversalSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IACvC;;;OAGG;IACa,qBAAqB,CAAU;IAE/C,YAAoB,gBAAyB;QAC3C,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;IAChD,CAAC;IAEO,MAAM,CAAC,SAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEjE,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,OAAO,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACtE,CAAC;IAED,mHAAmH;IAC5G,MAAM;QACX,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;IAED,uDAAuD;IAChD,MAAM,CAAC,KAAmC;QAC/C,OAAO,IAAI,KAAK,KAAK,CAAC;IACxB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\n/** JSON representation of a [[WhiteOnWhiteReversalSettings]].\n * @public\n * @extensions\n */\nexport interface WhiteOnWhiteReversalProps {\n /** Default: false.\n * @see [[WhiteOnWhiteReversalSettings.ignoreBackgroundColor]].\n */\n ignoreBackgroundColor?: boolean;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more\n * visible in the view.\n * By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.\n * These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.\n * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.\n * @public\n */\nexport class WhiteOnWhiteReversalSettings {\n /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only\n * if the background color is pure white.\n * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.\n */\n public readonly ignoreBackgroundColor: boolean;\n\n private constructor(ignoreBackground: boolean) {\n this.ignoreBackgroundColor = ignoreBackground;\n }\n\n private static _noIgnore = new WhiteOnWhiteReversalSettings(true);\n private static _ignore = new WhiteOnWhiteReversalSettings(false);\n\n /** Create from JSON representation. */\n public static fromJSON(props?: WhiteOnWhiteReversalProps): WhiteOnWhiteReversalSettings {\n return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;\n }\n\n /** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */\n public toJSON(): WhiteOnWhiteReversalProps | undefined {\n return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: WhiteOnWhiteReversalSettings): boolean {\n return this === other;\n }\n}\n"]}
@@ -21,6 +21,16 @@ import { TextBlock } from "./TextBlock";
21
21
  * @beta
22
22
  */
23
23
  export class TextAnnotation {
24
+ /** The rotation of the annotation.
25
+ * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.
26
+ */
27
+ orientation;
28
+ /** The formatted document. */
29
+ textBlock;
30
+ /** Describes how to compute the [[textBlock]]'s anchor point. */
31
+ anchor;
32
+ /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */
33
+ offset;
24
34
  constructor(offset, angles, textBlock, anchor) {
25
35
  this.offset = offset;
26
36
  this.orientation = angles;
@@ -1 +1 @@
1
- {"version":3,"file":"TextAnnotation.js","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAW,SAAS,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAyDxD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IAYzB,YAAoB,MAAe,EAAE,MAA0B,EAAE,SAAoB,EAAE,MAA4B;QACjH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,oCAAoC;IAC7B,MAAM,CAAC,MAAM,CAAC,IAA+B;QAClD,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,IAAI,EAAE,WAAW,IAAI,IAAI,kBAAkB,EAAE,CAAC;QAC7D,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;QAC7D,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QAEvE,OAAO,IAAI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AAC;gBAC3B,MAAM;QACV,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAqB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ;eACtG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;eAC5F,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { Point3d, Range2d, Transform, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\n\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\n * [[TextAnnotation.computeTransform]] will align the anchor point with (0, 0).\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\n * @beta\n */\nexport interface TextAnnotationAnchor {\n /**\n * The vertical alignment of the anchor point.\n * \"top\" aligns the anchor point with the top of the text's bounding box.\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\n */\n vertical: \"top\" | \"middle\" | \"bottom\";\n\n /**\n * The horizontal alignment of the anchor point.\n * \"left\" aligns the anchor point with left side of the text's bounding box.\n * \"center\" aligns the anchor point with center of the text with's bounding box.\n * \"right\" aligns the anchor point with right side of the text's bounding box.\n */\n horizontal: \"left\" | \"center\" | \"right\";\n}\n\n/**\n * JSON representation of a [[TextAnnotation]].\n * @beta\n */\nexport interface TextAnnotationProps {\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\n offset?: XYZProps;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollProps;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlockProps;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n}\n\n/** Arguments supplied to [[TextAnnotation.create]].\n * @beta\n */\nexport interface TextAnnotationCreateArgs {\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\n offset?: Point3d;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollAngles;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlock;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n}\n\n/**\n * Represents a formatted block of text positioned in 2d or 3d space.\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\n * - First, a bounding box is computed enclosing the contents of the [[textBlock].\n * - Then, an \"anchor point\" is computed based on the bounding box and the [[anchor]] property. The anchor point can be at one of the four corners of the box, in the middle of one of its four\n * edges, or in the center of the box.\n * - The [[orientation]] is applied to rotate the box around the anchor point.\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\n * @see [produceTextAnnotationGeometry]($backend) to decompose the annotation into a set of geometric primitives suitable for use with [[GeometryStreamBuilder.appendTextBlock]].\n * @beta\n */\nexport class TextAnnotation {\n /** The rotation of the annotation.\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\n */\n public orientation: YawPitchRollAngles;\n /** The formatted document. */\n public textBlock: TextBlock;\n /** Describes how to compute the [[textBlock]]'s anchor point. */\n public anchor: TextAnnotationAnchor;\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\n public offset: Point3d;\n\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor) {\n this.offset = offset;\n this.orientation = angles;\n this.textBlock = textBlock;\n this.anchor = anchor;\n }\n\n /** Creates a new TextAnnotation. */\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\n const offset = args?.offset ?? new Point3d();\n const angles = args?.orientation ?? new YawPitchRollAngles();\n const textBlock = args?.textBlock ?? TextBlock.createEmpty();\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\n\n return new TextAnnotation(offset, angles, textBlock, anchor);\n }\n\n /**\n * Creates a new TextAnnotation instance from its JSON representation.\n */\n public static fromJSON(props: TextAnnotationProps | undefined): TextAnnotation {\n return TextAnnotation.create({\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\n anchor: props?.anchor ? { ...props.anchor } : undefined,\n });\n }\n\n /**\n * Converts this annotation to its JSON representation.\n */\n public toJSON(): TextAnnotationProps {\n const props: TextAnnotationProps = {};\n\n // Even if the text block is empty, we want to record its style name and overrides, e.g.,\n // so the user can pick up where they left off editing it next time.\n props.textBlock = this.textBlock.toJSON();\n\n if (!this.offset.isZero) {\n props.offset = this.offset.toJSON();\n }\n\n if (!this.orientation.isIdentity()) {\n props.orientation = this.orientation.toJSON();\n }\n\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\n props.anchor = { ...this.anchor };\n }\n\n return props;\n }\n\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].\n * The anchor point will coincide with (0, 0, 0).\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\n */\n public computeTransform(boundingBox: Range2d): Transform {\n const anchorPt = this.computeAnchorPoint(boundingBox);\n const matrix = this.orientation.toMatrix3d();\n\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\n const translation = Transform.createTranslation(this.offset.minus(anchorPt));\n return translation.multiplyTransformTransform(rotation, rotation);\n }\n\n /** Compute the anchor point of this annotation as specified by [[anchor]].\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\n */\n public computeAnchorPoint(boundingBox: Range2d): Point3d {\n let x = boundingBox.low.x;\n let y = boundingBox.high.y;\n\n switch (this.anchor.horizontal) {\n case \"center\":\n x += boundingBox.xLength() / 2;\n break;\n case \"right\":\n x += boundingBox.xLength();\n break;\n }\n\n switch (this.anchor.vertical) {\n case \"middle\":\n y -= boundingBox.yLength() / 2;\n break;\n case \"bottom\":\n y -= boundingBox.yLength();\n break;\n }\n\n return new Point3d(x, y, 0);\n }\n\n /** Returns true if this annotation is logically equivalent to `other`. */\n public equals(other: TextAnnotation): boolean {\n return this.anchor.horizontal === other.anchor.horizontal && this.anchor.vertical === other.anchor.vertical\n && this.orientation.isAlmostEqual(other.orientation) && this.offset.isAlmostEqual(other.offset)\n && this.textBlock.equals(other.textBlock);\n }\n}\n"]}
1
+ {"version":3,"file":"TextAnnotation.js","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"AA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,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ;eACtG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;eAC5F,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { Point3d, Range2d, Transform, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\n\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\n * [[TextAnnotation.computeTransform]] will align the anchor point with (0, 0).\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\n * @beta\n */\nexport interface TextAnnotationAnchor {\n /**\n * The vertical alignment of the anchor point.\n * \"top\" aligns the anchor point with the top of the text's bounding box.\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\n */\n vertical: \"top\" | \"middle\" | \"bottom\";\n\n /**\n * The horizontal alignment of the anchor point.\n * \"left\" aligns the anchor point with left side of the text's bounding box.\n * \"center\" aligns the anchor point with center of the text with's bounding box.\n * \"right\" aligns the anchor point with right side of the text's bounding box.\n */\n horizontal: \"left\" | \"center\" | \"right\";\n}\n\n/**\n * JSON representation of a [[TextAnnotation]].\n * @beta\n */\nexport interface TextAnnotationProps {\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\n offset?: XYZProps;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollProps;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlockProps;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n}\n\n/** Arguments supplied to [[TextAnnotation.create]].\n * @beta\n */\nexport interface TextAnnotationCreateArgs {\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\n offset?: Point3d;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollAngles;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlock;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n}\n\n/**\n * Represents a formatted block of text positioned in 2d or 3d space.\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\n * - First, a bounding box is computed enclosing the contents of the [[textBlock].\n * - Then, an \"anchor point\" is computed based on the bounding box and the [[anchor]] property. The anchor point can be at one of the four corners of the box, in the middle of one of its four\n * edges, or in the center of the box.\n * - The [[orientation]] is applied to rotate the box around the anchor point.\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\n * @see [produceTextAnnotationGeometry]($backend) to decompose the annotation into a set of geometric primitives suitable for use with [[GeometryStreamBuilder.appendTextBlock]].\n * @beta\n */\nexport class TextAnnotation {\n /** The rotation of the annotation.\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\n */\n public orientation: YawPitchRollAngles;\n /** The formatted document. */\n public textBlock: TextBlock;\n /** Describes how to compute the [[textBlock]]'s anchor point. */\n public anchor: TextAnnotationAnchor;\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\n public offset: Point3d;\n\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor) {\n this.offset = offset;\n this.orientation = angles;\n this.textBlock = textBlock;\n this.anchor = anchor;\n }\n\n /** Creates a new TextAnnotation. */\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\n const offset = args?.offset ?? new Point3d();\n const angles = args?.orientation ?? new YawPitchRollAngles();\n const textBlock = args?.textBlock ?? TextBlock.createEmpty();\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\n\n return new TextAnnotation(offset, angles, textBlock, anchor);\n }\n\n /**\n * Creates a new TextAnnotation instance from its JSON representation.\n */\n public static fromJSON(props: TextAnnotationProps | undefined): TextAnnotation {\n return TextAnnotation.create({\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\n anchor: props?.anchor ? { ...props.anchor } : undefined,\n });\n }\n\n /**\n * Converts this annotation to its JSON representation.\n */\n public toJSON(): TextAnnotationProps {\n const props: TextAnnotationProps = {};\n\n // Even if the text block is empty, we want to record its style name and overrides, e.g.,\n // so the user can pick up where they left off editing it next time.\n props.textBlock = this.textBlock.toJSON();\n\n if (!this.offset.isZero) {\n props.offset = this.offset.toJSON();\n }\n\n if (!this.orientation.isIdentity()) {\n props.orientation = this.orientation.toJSON();\n }\n\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\n props.anchor = { ...this.anchor };\n }\n\n return props;\n }\n\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].\n * The anchor point will coincide with (0, 0, 0).\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\n */\n public computeTransform(boundingBox: Range2d): Transform {\n const anchorPt = this.computeAnchorPoint(boundingBox);\n const matrix = this.orientation.toMatrix3d();\n\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\n const translation = Transform.createTranslation(this.offset.minus(anchorPt));\n return translation.multiplyTransformTransform(rotation, rotation);\n }\n\n /** Compute the anchor point of this annotation as specified by [[anchor]].\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\n */\n public computeAnchorPoint(boundingBox: Range2d): Point3d {\n let x = boundingBox.low.x;\n let y = boundingBox.high.y;\n\n switch (this.anchor.horizontal) {\n case \"center\":\n x += boundingBox.xLength() / 2;\n break;\n case \"right\":\n x += boundingBox.xLength();\n break;\n }\n\n switch (this.anchor.vertical) {\n case \"middle\":\n y -= boundingBox.yLength() / 2;\n break;\n case \"bottom\":\n y -= boundingBox.yLength();\n break;\n }\n\n return new Point3d(x, y, 0);\n }\n\n /** Returns true if this annotation is logically equivalent to `other`. */\n public equals(other: TextAnnotation): boolean {\n return this.anchor.horizontal === other.anchor.horizontal && this.anchor.vertical === other.anchor.vertical\n && this.orientation.isAlmostEqual(other.orientation) && this.offset.isAlmostEqual(other.offset)\n && this.textBlock.equals(other.textBlock);\n }\n}\n"]}
@@ -10,6 +10,8 @@
10
10
  * @beta
11
11
  */
12
12
  export class TextBlockComponent {
13
+ _styleName;
14
+ _styleOverrides;
13
15
  /** @internal */
14
16
  constructor(props) {
15
17
  this._styleName = props.styleName;
@@ -96,10 +98,14 @@ export var Run;
96
98
  * @beta
97
99
  */
98
100
  export class TextRun extends TextBlockComponent {
101
+ /** Discriminator field for the [[Run]] union. */
102
+ type = "text";
103
+ /** The sequence of characters to be displayed by the run. */
104
+ content;
105
+ /** Whether to display [[content]] as a subscript, superscript, or normally. */
106
+ baselineShift;
99
107
  constructor(props) {
100
108
  super(props);
101
- /** Discriminator field for the [[Run]] union. */
102
- this.type = "text";
103
109
  this.content = props.content ?? "";
104
110
  this.baselineShift = props.baselineShift ?? "none";
105
111
  }
@@ -130,10 +136,14 @@ export class TextRun extends TextBlockComponent {
130
136
  * @beta
131
137
  */
132
138
  export class FractionRun extends TextBlockComponent {
139
+ /** Discriminator field for the [[Run]] union. */
140
+ type = "fraction";
141
+ /** The fraction's numerator. */
142
+ numerator;
143
+ /** The fraction's denominator. */
144
+ denominator;
133
145
  constructor(props) {
134
146
  super(props);
135
- /** Discriminator field for the [[Run]] union. */
136
- this.type = "fraction";
137
147
  this.numerator = props.numerator ?? "";
138
148
  this.denominator = props.denominator ?? "";
139
149
  }
@@ -164,10 +174,10 @@ export class FractionRun extends TextBlockComponent {
164
174
  * @beta
165
175
  */
166
176
  export class LineBreakRun extends TextBlockComponent {
177
+ /** Discriminator field for the [[Run]] union. */
178
+ type = "linebreak";
167
179
  constructor(props) {
168
180
  super(props);
169
- /** Discriminator field for the [[Run]] union. */
170
- this.type = "linebreak";
171
181
  }
172
182
  toJSON() {
173
183
  return {
@@ -193,6 +203,8 @@ export class LineBreakRun extends TextBlockComponent {
193
203
  * @beta
194
204
  */
195
205
  export class Paragraph extends TextBlockComponent {
206
+ /** The runs within the paragraph. You can modify the contents of this array to change the content of the paragraph. */
207
+ runs;
196
208
  constructor(props) {
197
209
  super(props);
198
210
  this.runs = props.runs?.map((run) => Run.fromJSON(run)) ?? [];
@@ -240,6 +252,15 @@ export class Paragraph extends TextBlockComponent {
240
252
  * @beta
241
253
  */
242
254
  export class TextBlock extends TextBlockComponent {
255
+ /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.
256
+ * A value less than or equal to zero indicates no wrapping is to be applied.
257
+ * Default: 0
258
+ */
259
+ width;
260
+ /** The alignment of the document's content. */
261
+ justification;
262
+ /** The ordered list of paragraphs within the document. */
263
+ paragraphs;
243
264
  constructor(props) {
244
265
  super(props);
245
266
  this.width = props.width ?? 0;
@@ -1 +1 @@
1
- {"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAgDH;;;GAGG;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,CAAC,CAAC;IACrD,CAAC;IAQD,yDAAyD;IAClD,MAAM;QACX,OAAO;YACL,SAAS,EAAE,IAAI,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;OAGG;IACI,eAAe;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC;YACjC,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,IAAI,CAAC,SAAS;YAC5C,cAAc,EAAE,IAAI,EAAE,cAAc,IAAI,SAAS;SAClD,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,GAAQ;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACxF,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAEe,MAAM,CAAC,KAAyB;QAC9C,IAAI,CAAC,CAAC,KAAK,YAAY,SAAS,CAAC,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YACnI,OAAO,KAAK,CAAC;QACf,CAAC;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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { TextStyleSettingsProps } from \"./TextStyle\";\n\n/** Options supplied to [[TextBlockComponent.applyStyle]] to control how the style is applied to the component and its child components.\n * @beta\n */\nexport interface ApplyTextStyleOptions {\n /** Controls whether any deviations from the style's settings stored in [[TextBlockComponent.styleOverrides]] are retained.\n * By default, all overrides are cleared.\n */\n preserveOverrides?: boolean;\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]].\n * By default, the style change propagates to child components.\n */\n preventPropagation?: boolean;\n}\n\n/** The JSON representation of a [[TextBlockComponent]].\n * @beta\n */\nexport interface TextBlockComponentProps {\n /** The name of a [[TextStyle]] stored in a [Workspace]($backend) from which the base [[TextStyleSettings]] applied to the component originates. */\n styleName: string;\n /** Deviations from the base [[TextStyleSettings]] defined by the [[TextStyle]] applied to this component.\n * This permits you to, e.g., create a [[TextRun]] using \"Arial\" font and override it to use \"Comic Sans\" instead.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\n * @beta\n */\nexport interface TextBlockStringifyOptions {\n /** A string to insert in between each [[Paragraph]].\n * Default: \" \" - a single space.\n */\n paragraphBreak?: string;\n /** A string to insert for each [[LineBreakRun]].\n * Default: \" \" - a single space.\n */\n lineBreak?: string;\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\n * Default: \"/\"\n */\n fractionSeparator?: string;\n}\n\n/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.\n * Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.\n * @beta\n */\nexport abstract class TextBlockComponent {\n private _styleName: string;\n private _styleOverrides: TextStyleSettingsProps;\n\n /** @internal */\n protected constructor(props: TextBlockComponentProps) {\n this._styleName = props.styleName;\n this._styleOverrides = { ...props.styleOverrides };\n }\n\n /** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.\n * @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of\n * the components sub-components and clears any [[styleOverrides]].\n */\n public get styleName(): string {\n return this._styleName;\n }\n\n public set styleName(styleName: string) {\n this.applyStyle(styleName);\n }\n\n /** Deviations in individual properties of the [[TextStyle]] specified by [[styleName]].\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.fontName` to \"Comic Sans\".\n * @see [[clearStyleOverrides]] to reset this to an empty object.\n */\n public get styleOverrides(): TextStyleSettingsProps {\n return this._styleOverrides;\n }\n\n public set styleOverrides(overrides: TextStyleSettingsProps) {\n this._styleOverrides = { ...overrides };\n }\n\n /** Reset any [[styleOverrides]] applied to this component's [[TextStyle]]. */\n public clearStyleOverrides(): void {\n this.styleOverrides = { };\n }\n\n /** Apply the [[TextStyle]] specified by `styleName` to this component, optionally preserving [[styleOverrides]] and/or preventing propagation to sub-components. */\n public applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\n this._styleName = styleName;\n\n if (!(options?.preserveOverrides)) {\n this.clearStyleOverrides();\n }\n }\n\n /** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */\n public get overridesStyle(): boolean {\n return Object.keys(this.styleOverrides).length > 0;\n }\n\n /** Create a deep copy of this component. */\n public abstract clone(): TextBlockComponent;\n\n /** Compute a string representation of the contents of this component and all of its sub-components. */\n public abstract stringify(options?: TextBlockStringifyOptions): string;\n\n /** Convert this component to its JSON representation. */\n public toJSON(): TextBlockComponentProps {\n return {\n styleName: this.styleName,\n styleOverrides: { ...this.styleOverrides },\n };\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: TextBlockComponent): boolean {\n const myKeys = Object.keys(this.styleOverrides);\n const yrKeys = Object.keys(other._styleOverrides);\n if (this.styleName !== other.styleName || myKeys.length !== yrKeys.length) {\n return false;\n }\n\n for (const name of myKeys) {\n const key = name as keyof TextStyleSettingsProps;\n if (this.styleOverrides[key] !== other.styleOverrides[key]) {\n return false;\n }\n }\n\n return true;\n }\n}\n\n/**\n * @beta\n */\nexport type Run = TextRun | FractionRun | LineBreakRun;\n\n/** The JSON representation of a [[Run]].\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport type RunProps = TextRunProps | FractionRunProps | LineBreakRunProps;\n\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\n * multiple lines, but it will never contain different styling.\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Create a run from its JSON representation.\n * @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.\n */\n export function fromJSON(props: RunProps): Run {\n switch (props.type) {\n case \"text\": return TextRun.create(props);\n case \"fraction\": return FractionRun.create(props);\n case \"linebreak\": return LineBreakRun.create(props);\n }\n }\n}\n\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\n * affect how the content is rendered.\n * @beta\n */\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\n\n/** JSON representation of a [[TextRun]].\n * @beta\n */\nexport interface TextRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"text\";\n /** The characters displayed by the run.\n * Default: an empty string.\n */\n content?: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally.\n * Default: \"none\"\n */\n baselineShift?: BaselineShift;\n}\n\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\n * @beta\n */\nexport class TextRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"text\";\n /** The sequence of characters to be displayed by the run. */\n public content: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\n public baselineShift: BaselineShift;\n\n private constructor(props: Omit<TextRunProps, \"type\">) {\n super(props);\n this.content = props.content ?? \"\";\n this.baselineShift = props.baselineShift ?? \"none\";\n }\n\n public override clone(): TextRun {\n return new TextRun(this.toJSON());\n }\n\n public override toJSON(): TextRunProps {\n return {\n ...super.toJSON(),\n type: \"text\",\n content: this.content,\n baselineShift: this.baselineShift,\n };\n }\n\n public static create(props: Omit<TextRunProps, \"type\">): TextRun {\n return new TextRun(props);\n }\n\n /** Simply returns [[content]]. */\n public override stringify(): string {\n return this.content;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\n }\n}\n\n/** JSON representation of a [[FractionRun]].\n * @beta\n */\nexport interface FractionRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"fraction\";\n /** The text displayed before or above the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\n numerator?: string;\n /** The text displayed after or below the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\n denominator?: string;\n}\n\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\n * @beta\n */\nexport class FractionRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"fraction\";\n /** The fraction's numerator. */\n public numerator: string;\n /** The fraction's denominator. */\n public denominator: string;\n\n private constructor(props: Omit<FractionRunProps, \"type\">) {\n super(props);\n this.numerator = props.numerator ?? \"\";\n this.denominator = props.denominator ?? \"\";\n }\n\n public override toJSON(): FractionRunProps {\n return {\n ...super.toJSON(),\n type: \"fraction\",\n numerator: this.numerator,\n denominator: this.denominator,\n };\n }\n\n public override clone(): FractionRun {\n return new FractionRun(this.toJSON());\n }\n\n public static create(props: Omit<FractionRunProps, \"type\">): FractionRun {\n return new FractionRun(props);\n }\n\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n const sep = options?.fractionSeparator ?? \"/\";\n return `${this.numerator}${sep}${this.denominator}`;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\n }\n}\n\n/** JSON representation of a [[LineBreakRun]].\n * @beta\n */\nexport interface LineBreakRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"linebreak\";\n}\n\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.\n * @beta\n */\nexport class LineBreakRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"linebreak\";\n\n private constructor(props: TextBlockComponentProps) {\n super(props);\n }\n\n public override toJSON(): LineBreakRunProps {\n return {\n ...super.toJSON(),\n type: \"linebreak\",\n };\n }\n\n public static create(props: TextBlockComponentProps) {\n return new LineBreakRun(props);\n }\n\n public override clone(): LineBreakRun {\n return new LineBreakRun(this.toJSON());\n }\n\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n return options?.lineBreak ?? \" \";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof LineBreakRun && super.equals(other);\n }\n}\n\n/** JSON representation of a [[Paragraph]].\n * @beta\n */\nexport interface ParagraphProps extends TextBlockComponentProps {\n /** The collection of [[Run]]s within the paragraph.\n * Default: an empty array.\n */\n runs?: RunProps[];\n}\n\n/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.\n * @beta\n */\nexport class Paragraph extends TextBlockComponent {\n /** The runs within the paragraph. You can modify the contents of this array to change the content of the paragraph. */\n public readonly runs: Run[];\n\n private constructor(props: ParagraphProps) {\n super(props);\n this.runs = props.runs?.map((run) => Run.fromJSON(run)) ?? [];\n }\n\n public override toJSON(): ParagraphProps {\n return {\n ...super.toJSON(),\n runs: this.runs.map((run) => run.toJSON()),\n };\n }\n\n /** Create a paragraph from its JSON representation. */\n public static create(props: ParagraphProps): Paragraph {\n return new Paragraph(props);\n }\n\n public override clone(): Paragraph {\n return new Paragraph(this.toJSON());\n }\n\n /** Apply the specified style to this [[Paragraph]], and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[runs]]. */\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\n super.applyStyle(styleName, options);\n if (!(options?.preventPropagation)) {\n for (const run of this.runs) {\n run.applyStyle(styleName, options);\n }\n }\n }\n\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n return this.runs.map((x) => x.stringify(options)).join(\"\");\n }\n\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof Paragraph)) {\n return false;\n }\n\n if (this.runs.length !== other.runs.length || !super.equals(other)) {\n return false;\n }\n\n return this.runs.every((run, index) => run.equals(other.runs[index]));\n }\n}\n\n/** Describes the relative alignment of the content of a [[TextBlock]].\n * @beta\n */\nexport type TextBlockJustification = \"left\" | \"center\" | \"right\";\n\n/** JSON representation of a [[TextBlock]].\n * @beta\n */\nexport interface TextBlockProps extends TextBlockComponentProps {\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n width?: number;\n /** The alignment of the document content. Default: \"left\". */\n justification?: TextBlockJustification;\n /** The paragraphs within the text block. Default: an empty array. */\n paragraphs?: ParagraphProps[];\n}\n\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.\n * You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\n * @beta\n */\nexport class TextBlock extends TextBlockComponent {\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n public width: number;\n /** The alignment of the document's content. */\n public justification: TextBlockJustification;\n /** The ordered list of paragraphs within the document. */\n public readonly paragraphs: Paragraph[];\n\n private constructor(props: TextBlockProps) {\n super(props);\n this.width = props.width ?? 0;\n this.justification = props.justification ?? \"left\";\n this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];\n }\n\n public override toJSON(): TextBlockProps {\n return {\n ...super.toJSON(),\n width: this.width,\n justification: this.justification,\n paragraphs: this.paragraphs.map((x) => x.toJSON()),\n };\n }\n\n /** Create a text block from its JSON representation. */\n public static create(props: TextBlockProps): TextBlock {\n return new TextBlock(props);\n }\n\n /** Create an empty text block containing no [[paragraphs]] and an empty [[styleName]]. */\n public static createEmpty(): TextBlock {\n return TextBlock.create({ styleName: \"\" });\n }\n\n /** Returns true if every paragraph in this text block is empty. */\n public get isEmpty(): boolean {\n return this.paragraphs.every((p) => p.runs.length === 0);\n }\n\n public override clone(): TextBlock {\n return new TextBlock(this.toJSON());\n }\n\n /** Apply the specified style to this block and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[paragraphs]]. */\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\n super.applyStyle(styleName, options);\n if (!(options?.preventPropagation)) {\n for (const paragraph of this.paragraphs) {\n paragraph.applyStyle(styleName, options);\n }\n }\n }\n\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\n public stringify(options?: TextBlockStringifyOptions): string {\n return this.paragraphs.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \");\n }\n\n /** Add and return a new paragraph.\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,\n * the paragraph will inherit this block's style with no overrides.\n */\n public appendParagraph(): Paragraph {\n const seed = this.paragraphs[0];\n const paragraph = Paragraph.create({\n styleName: seed?.styleName ?? this.styleName,\n styleOverrides: seed?.styleOverrides ?? undefined,\n });\n\n this.paragraphs.push(paragraph);\n return paragraph;\n }\n\n /** Append a run to the last [[Paragraph]] in this block.\n * If the block contains no [[paragraphs]], a new one will first be created using [[appendParagraph]].\n */\n public appendRun(run: Run): void {\n const paragraph = this.paragraphs[this.paragraphs.length - 1] ?? this.appendParagraph();\n paragraph.runs.push(run);\n }\n\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof TextBlock)) {\n return false;\n }\n\n if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {\n return false;\n }\n\n return this.paragraphs.every((paragraph, index) => paragraph.equals(other.paragraphs[index]));\n }\n}\n"]}
1
+ {"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAgDH;;;GAGG;AACH,MAAM,OAAgB,kBAAkB;IAC9B,UAAU,CAAS;IACnB,eAAe,CAAyB;IAEhD,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,c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,CAAC,GAAQ;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACxF,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAEe,MAAM,CAAC,KAAyB;QAC9C,IAAI,CAAC,CAAC,KAAK,YAAY,SAAS,CAAC,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YACnI,OAAO,KAAK,CAAC;QACf,CAAC;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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { TextStyleSettingsProps } from \"./TextStyle\";\n\n/** Options supplied to [[TextBlockComponent.applyStyle]] to control how the style is applied to the component and its child components.\n * @beta\n */\nexport interface ApplyTextStyleOptions {\n /** Controls whether any deviations from the style's settings stored in [[TextBlockComponent.styleOverrides]] are retained.\n * By default, all overrides are cleared.\n */\n preserveOverrides?: boolean;\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]].\n * By default, the style change propagates to child components.\n */\n preventPropagation?: boolean;\n}\n\n/** The JSON representation of a [[TextBlockComponent]].\n * @beta\n */\nexport interface TextBlockComponentProps {\n /** The name of a [[TextStyle]] stored in a [Workspace]($backend) from which the base [[TextStyleSettings]] applied to the component originates. */\n styleName: string;\n /** Deviations from the base [[TextStyleSettings]] defined by the [[TextStyle]] applied to this component.\n * This permits you to, e.g., create a [[TextRun]] using \"Arial\" font and override it to use \"Comic Sans\" instead.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\n * @beta\n */\nexport interface TextBlockStringifyOptions {\n /** A string to insert in between each [[Paragraph]].\n * Default: \" \" - a single space.\n */\n paragraphBreak?: string;\n /** A string to insert for each [[LineBreakRun]].\n * Default: \" \" - a single space.\n */\n lineBreak?: string;\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\n * Default: \"/\"\n */\n fractionSeparator?: string;\n}\n\n/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.\n * Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.\n * @beta\n */\nexport abstract class TextBlockComponent {\n private _styleName: string;\n private _styleOverrides: TextStyleSettingsProps;\n\n /** @internal */\n protected constructor(props: TextBlockComponentProps) {\n this._styleName = props.styleName;\n this._styleOverrides = { ...props.styleOverrides };\n }\n\n /** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.\n * @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of\n * the components sub-components and clears any [[styleOverrides]].\n */\n public get styleName(): string {\n return this._styleName;\n }\n\n public set styleName(styleName: string) {\n this.applyStyle(styleName);\n }\n\n /** Deviations in individual properties of the [[TextStyle]] specified by [[styleName]].\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.fontName` to \"Comic Sans\".\n * @see [[clearStyleOverrides]] to reset this to an empty object.\n */\n public get styleOverrides(): TextStyleSettingsProps {\n return this._styleOverrides;\n }\n\n public set styleOverrides(overrides: TextStyleSettingsProps) {\n this._styleOverrides = { ...overrides };\n }\n\n /** Reset any [[styleOverrides]] applied to this component's [[TextStyle]]. */\n public clearStyleOverrides(): void {\n this.styleOverrides = { };\n }\n\n /** Apply the [[TextStyle]] specified by `styleName` to this component, optionally preserving [[styleOverrides]] and/or preventing propagation to sub-components. */\n public applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\n this._styleName = styleName;\n\n if (!(options?.preserveOverrides)) {\n this.clearStyleOverrides();\n }\n }\n\n /** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */\n public get overridesStyle(): boolean {\n return Object.keys(this.styleOverrides).length > 0;\n }\n\n /** Create a deep copy of this component. */\n public abstract clone(): TextBlockComponent;\n\n /** Compute a string representation of the contents of this component and all of its sub-components. */\n public abstract stringify(options?: TextBlockStringifyOptions): string;\n\n /** Convert this component to its JSON representation. */\n public toJSON(): TextBlockComponentProps {\n return {\n styleName: this.styleName,\n styleOverrides: { ...this.styleOverrides },\n };\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: TextBlockComponent): boolean {\n const myKeys = Object.keys(this.styleOverrides);\n const yrKeys = Object.keys(other._styleOverrides);\n if (this.styleName !== other.styleName || myKeys.length !== yrKeys.length) {\n return false;\n }\n\n for (const name of myKeys) {\n const key = name as keyof TextStyleSettingsProps;\n if (this.styleOverrides[key] !== other.styleOverrides[key]) {\n return false;\n }\n }\n\n return true;\n }\n}\n\n/**\n * @beta\n */\nexport type Run = TextRun | FractionRun | LineBreakRun;\n\n/** The JSON representation of a [[Run]].\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport type RunProps = TextRunProps | FractionRunProps | LineBreakRunProps;\n\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\n * multiple lines, but it will never contain different styling.\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Create a run from its JSON representation.\n * @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.\n */\n export function fromJSON(props: RunProps): Run {\n switch (props.type) {\n case \"text\": return TextRun.create(props);\n case \"fraction\": return FractionRun.create(props);\n case \"linebreak\": return LineBreakRun.create(props);\n }\n }\n}\n\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\n * affect how the content is rendered.\n * @beta\n */\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\n\n/** JSON representation of a [[TextRun]].\n * @beta\n */\nexport interface TextRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"text\";\n /** The characters displayed by the run.\n * Default: an empty string.\n */\n content?: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally.\n * Default: \"none\"\n */\n baselineShift?: BaselineShift;\n}\n\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\n * @beta\n */\nexport class TextRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"text\";\n /** The sequence of characters to be displayed by the run. */\n public content: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\n public baselineShift: BaselineShift;\n\n private constructor(props: Omit<TextRunProps, \"type\">) {\n super(props);\n this.content = props.content ?? \"\";\n this.baselineShift = props.baselineShift ?? \"none\";\n }\n\n public override clone(): TextRun {\n return new TextRun(this.toJSON());\n }\n\n public override toJSON(): TextRunProps {\n return {\n ...super.toJSON(),\n type: \"text\",\n content: this.content,\n baselineShift: this.baselineShift,\n };\n }\n\n public static create(props: Omit<TextRunProps, \"type\">): TextRun {\n return new TextRun(props);\n }\n\n /** Simply returns [[content]]. */\n public override stringify(): string {\n return this.content;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\n }\n}\n\n/** JSON representation of a [[FractionRun]].\n * @beta\n */\nexport interface FractionRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"fraction\";\n /** The text displayed before or above the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\n numerator?: string;\n /** The text displayed after or below the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */\n denominator?: string;\n}\n\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\n * @beta\n */\nexport class FractionRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"fraction\";\n /** The fraction's numerator. */\n public numerator: string;\n /** The fraction's denominator. */\n public denominator: string;\n\n private constructor(props: Omit<FractionRunProps, \"type\">) {\n super(props);\n this.numerator = props.numerator ?? \"\";\n this.denominator = props.denominator ?? \"\";\n }\n\n public override toJSON(): FractionRunProps {\n return {\n ...super.toJSON(),\n type: \"fraction\",\n numerator: this.numerator,\n denominator: this.denominator,\n };\n }\n\n public override clone(): FractionRun {\n return new FractionRun(this.toJSON());\n }\n\n public static create(props: Omit<FractionRunProps, \"type\">): FractionRun {\n return new FractionRun(props);\n }\n\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n const sep = options?.fractionSeparator ?? \"/\";\n return `${this.numerator}${sep}${this.denominator}`;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\n }\n}\n\n/** JSON representation of a [[LineBreakRun]].\n * @beta\n */\nexport interface LineBreakRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"linebreak\";\n}\n\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.\n * @beta\n */\nexport class LineBreakRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"linebreak\";\n\n private constructor(props: TextBlockComponentProps) {\n super(props);\n }\n\n public override toJSON(): LineBreakRunProps {\n return {\n ...super.toJSON(),\n type: \"linebreak\",\n };\n }\n\n public static create(props: TextBlockComponentProps) {\n return new LineBreakRun(props);\n }\n\n public override clone(): LineBreakRun {\n return new LineBreakRun(this.toJSON());\n }\n\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n return options?.lineBreak ?? \" \";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof LineBreakRun && super.equals(other);\n }\n}\n\n/** JSON representation of a [[Paragraph]].\n * @beta\n */\nexport interface ParagraphProps extends TextBlockComponentProps {\n /** The collection of [[Run]]s within the paragraph.\n * Default: an empty array.\n */\n runs?: RunProps[];\n}\n\n/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.\n * @beta\n */\nexport class Paragraph extends TextBlockComponent {\n /** The runs within the paragraph. You can modify the contents of this array to change the content of the paragraph. */\n public readonly runs: Run[];\n\n private constructor(props: ParagraphProps) {\n super(props);\n this.runs = props.runs?.map((run) => Run.fromJSON(run)) ?? [];\n }\n\n public override toJSON(): ParagraphProps {\n return {\n ...super.toJSON(),\n runs: this.runs.map((run) => run.toJSON()),\n };\n }\n\n /** Create a paragraph from its JSON representation. */\n public static create(props: ParagraphProps): Paragraph {\n return new Paragraph(props);\n }\n\n public override clone(): Paragraph {\n return new Paragraph(this.toJSON());\n }\n\n /** Apply the specified style to this [[Paragraph]], and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[runs]]. */\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\n super.applyStyle(styleName, options);\n if (!(options?.preventPropagation)) {\n for (const run of this.runs) {\n run.applyStyle(styleName, options);\n }\n }\n }\n\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n return this.runs.map((x) => x.stringify(options)).join(\"\");\n }\n\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof Paragraph)) {\n return false;\n }\n\n if (this.runs.length !== other.runs.length || !super.equals(other)) {\n return false;\n }\n\n return this.runs.every((run, index) => run.equals(other.runs[index]));\n }\n}\n\n/** Describes the relative alignment of the content of a [[TextBlock]].\n * @beta\n */\nexport type TextBlockJustification = \"left\" | \"center\" | \"right\";\n\n/** JSON representation of a [[TextBlock]].\n * @beta\n */\nexport interface TextBlockProps extends TextBlockComponentProps {\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n width?: number;\n /** The alignment of the document content. Default: \"left\". */\n justification?: TextBlockJustification;\n /** The paragraphs within the text block. Default: an empty array. */\n paragraphs?: ParagraphProps[];\n}\n\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.\n * You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\n * @beta\n */\nexport class TextBlock extends TextBlockComponent {\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n public width: number;\n /** The alignment of the document's content. */\n public justification: TextBlockJustification;\n /** The ordered list of paragraphs within the document. */\n public readonly paragraphs: Paragraph[];\n\n private constructor(props: TextBlockProps) {\n super(props);\n this.width = props.width ?? 0;\n this.justification = props.justification ?? \"left\";\n this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];\n }\n\n public override toJSON(): TextBlockProps {\n return {\n ...super.toJSON(),\n width: this.width,\n justification: this.justification,\n paragraphs: this.paragraphs.map((x) => x.toJSON()),\n };\n }\n\n /** Create a text block from its JSON representation. */\n public static create(props: TextBlockProps): TextBlock {\n return new TextBlock(props);\n }\n\n /** Create an empty text block containing no [[paragraphs]] and an empty [[styleName]]. */\n public static createEmpty(): TextBlock {\n return TextBlock.create({ styleName: \"\" });\n }\n\n /** Returns true if every paragraph in this text block is empty. */\n public get isEmpty(): boolean {\n return this.paragraphs.every((p) => p.runs.length === 0);\n }\n\n public override clone(): TextBlock {\n return new TextBlock(this.toJSON());\n }\n\n /** Apply the specified style to this block and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[paragraphs]]. */\n public override applyStyle(styleName: string, options?: ApplyTextStyleOptions): void {\n super.applyStyle(styleName, options);\n if (!(options?.preventPropagation)) {\n for (const paragraph of this.paragraphs) {\n paragraph.applyStyle(styleName, options);\n }\n }\n }\n\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\n public stringify(options?: TextBlockStringifyOptions): string {\n return this.paragraphs.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \");\n }\n\n /** Add and return a new paragraph.\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,\n * the paragraph will inherit this block's style with no overrides.\n */\n public appendParagraph(): Paragraph {\n const seed = this.paragraphs[0];\n const paragraph = Paragraph.create({\n styleName: seed?.styleName ?? this.styleName,\n styleOverrides: seed?.styleOverrides ?? undefined,\n });\n\n this.paragraphs.push(paragraph);\n return paragraph;\n }\n\n /** Append a run to the last [[Paragraph]] in this block.\n * If the block contains no [[paragraphs]], a new one will first be created using [[appendParagraph]].\n */\n public appendRun(run: Run): void {\n const paragraph = this.paragraphs[this.paragraphs.length - 1] ?? this.appendParagraph();\n paragraph.runs.push(run);\n }\n\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof TextBlock)) {\n return false;\n }\n\n if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {\n return false;\n }\n\n return this.paragraphs.every((paragraph, index) => paragraph.equals(other.paragraphs[index]));\n }\n}\n"]}
@@ -12,8 +12,52 @@
12
12
  * @beta
13
13
  */
14
14
  export class TextStyleSettings {
15
+ /** The color of the text. */
16
+ color;
17
+ /** The name of a font stored in a [Workspace]($backend), used to draw the contents of a [[TextRun]].
18
+ */
19
+ fontName;
20
+ /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.
21
+ * For example, the height and offset from baseline of a subscript [[TextRun]] are compuated as lineHeight * [[subScriptScale]] and
22
+ * lineHeight * [[subScriptOffsetFactor]], respectively.
23
+ */
24
+ lineHeight;
25
+ /** Multiplier used to compute the vertical distance between two lines of text.
26
+ * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].
27
+ */
28
+ lineSpacingFactor;
29
+ /** Specifies whether the content of a [[TextRun]] should be rendered **bold**. */
30
+ isBold;
31
+ /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*. */
32
+ isItalic;
33
+ /** Specifies whether the content of a [[TextRun]] should be underlined. */
34
+ isUnderlined;
35
+ /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].
36
+ * The height is computed in meters as stackedFractionScale * [[lineHeight]].
37
+ */
38
+ stackedFractionScale;
39
+ /** Specifies how to separate the numerator and denominator of a [[FractionRun]]. */
40
+ stackedFractionType;
41
+ /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].
42
+ * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].
43
+ */
44
+ subScriptOffsetFactor;
45
+ /** Multiplier used to compute the height of a subscript [[TextRun]].
46
+ * The height is computed as subScriptScale * [[lineHeight]].
47
+ */
48
+ subScriptScale;
49
+ /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].
50
+ * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].
51
+ */
52
+ superScriptOffsetFactor;
53
+ /** Multiplier used to compute the height of a superscript [[TextRun]].
54
+ * The height is computed as superScriptScale * [[lineHeight]].
55
+ */
56
+ superScriptScale;
57
+ /** Multiplier used to compute the width of each glyph, relative to [[lineHeight]]. */
58
+ widthFactor;
15
59
  /** A fully-populated JSON representation of the default settings. */
16
- static { this.defaultProps = {
60
+ static defaultProps = {
17
61
  color: "subcategory",
18
62
  fontName: "",
19
63
  lineHeight: 1,
@@ -28,9 +72,9 @@ export class TextStyleSettings {
28
72
  superScriptOffsetFactor: 0.5,
29
73
  superScriptScale: 2 / 3,
30
74
  widthFactor: 1,
31
- }; }
75
+ };
32
76
  /** Settings initialized to all default values. */
33
- static { this.defaults = new TextStyleSettings({}); }
77
+ static defaults = new TextStyleSettings({});
34
78
  constructor(props, defaults) {
35
79
  if (!defaults) {
36
80
  defaults = TextStyleSettings.defaultProps;
@@ -78,6 +122,8 @@ Object.freeze(TextStyleSettings.defaults);
78
122
  * @beta
79
123
  */
80
124
  export class TextStyle {
125
+ name;
126
+ settings;
81
127
  constructor(name, settings) {
82
128
  this.name = name;
83
129
  this.settings = settings;