@itwin/core-common 4.6.0-dev.9 → 4.7.0-dev.3

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 (480) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/cjs/AmbientOcclusion.js +1 -1
  3. package/lib/cjs/AmbientOcclusion.js.map +1 -1
  4. package/lib/cjs/AnalysisStyle.js +1 -1
  5. package/lib/cjs/AnalysisStyle.js.map +1 -1
  6. package/lib/cjs/Atmosphere.js +12 -12
  7. package/lib/cjs/Atmosphere.js.map +1 -1
  8. package/lib/cjs/BackgroundMapProvider.js +1 -1
  9. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  10. package/lib/cjs/BackgroundMapSettings.js +1 -1
  11. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  12. package/lib/cjs/Base64EncodedString.js +1 -1
  13. package/lib/cjs/Base64EncodedString.js.map +1 -1
  14. package/lib/cjs/BlobReader.js.map +1 -1
  15. package/lib/cjs/BriefcaseTypes.js +5 -5
  16. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  17. package/lib/cjs/Camera.js.map +1 -1
  18. package/lib/cjs/ChangedElements.js +1 -1
  19. package/lib/cjs/ChangedElements.js.map +1 -1
  20. package/lib/cjs/ChangesetProps.js +1 -1
  21. package/lib/cjs/ChangesetProps.js.map +1 -1
  22. package/lib/cjs/ClipStyle.js +3 -3
  23. package/lib/cjs/ClipStyle.js.map +1 -1
  24. package/lib/cjs/Code.d.ts +1 -0
  25. package/lib/cjs/Code.d.ts.map +1 -1
  26. package/lib/cjs/Code.js +3 -2
  27. package/lib/cjs/Code.js.map +1 -1
  28. package/lib/cjs/ColorDef.js +1 -1
  29. package/lib/cjs/ColorDef.js.map +1 -1
  30. package/lib/cjs/CommonLoggerCategory.js +1 -1
  31. package/lib/cjs/CommonLoggerCategory.js.map +1 -1
  32. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  33. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  34. package/lib/cjs/ConcurrentQuery.js +6 -6
  35. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  36. package/lib/cjs/ContextRealityModel.js +5 -5
  37. package/lib/cjs/ContextRealityModel.js.map +1 -1
  38. package/lib/cjs/DisplayStyleSettings.js +1 -1
  39. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  40. package/lib/cjs/ECSqlReader.js +1 -1
  41. package/lib/cjs/ECSqlReader.js.map +1 -1
  42. package/lib/cjs/ECSqlTypes.js +4 -4
  43. package/lib/cjs/ECSqlTypes.js.map +1 -1
  44. package/lib/cjs/ElementMesh.js.map +1 -1
  45. package/lib/cjs/ElementProps.d.ts +23 -0
  46. package/lib/cjs/ElementProps.d.ts.map +1 -1
  47. package/lib/cjs/ElementProps.js +4 -4
  48. package/lib/cjs/ElementProps.js.map +1 -1
  49. package/lib/cjs/EmphasizeElementsProps.js +1 -1
  50. package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
  51. package/lib/cjs/EntityProps.d.ts +5 -2
  52. package/lib/cjs/EntityProps.d.ts.map +1 -1
  53. package/lib/cjs/EntityProps.js +2 -1
  54. package/lib/cjs/EntityProps.js.map +1 -1
  55. package/lib/cjs/EntityReference.js +2 -2
  56. package/lib/cjs/EntityReference.js.map +1 -1
  57. package/lib/cjs/Environment.js +1 -1
  58. package/lib/cjs/Environment.js.map +1 -1
  59. package/lib/cjs/FeatureIndex.js +1 -1
  60. package/lib/cjs/FeatureIndex.js.map +1 -1
  61. package/lib/cjs/FeatureSymbology.d.ts +1 -1
  62. package/lib/cjs/FeatureSymbology.js +3 -3
  63. package/lib/cjs/FeatureSymbology.js.map +1 -1
  64. package/lib/cjs/FeatureTable.js +3 -3
  65. package/lib/cjs/FeatureTable.js.map +1 -1
  66. package/lib/cjs/Fonts.js +1 -1
  67. package/lib/cjs/Fonts.js.map +1 -1
  68. package/lib/cjs/Frustum.d.ts.map +1 -1
  69. package/lib/cjs/Frustum.js +3 -1
  70. package/lib/cjs/Frustum.js.map +1 -1
  71. package/lib/cjs/GenericInstanceFilter.js +2 -2
  72. package/lib/cjs/GenericInstanceFilter.js.map +1 -1
  73. package/lib/cjs/GeoCoordinateServices.js +1 -1
  74. package/lib/cjs/GeoCoordinateServices.js.map +1 -1
  75. package/lib/cjs/GeometryParams.js +3 -3
  76. package/lib/cjs/GeometryParams.js.map +1 -1
  77. package/lib/cjs/GeometrySummary.js +1 -1
  78. package/lib/cjs/GeometrySummary.js.map +1 -1
  79. package/lib/cjs/Gradient.js +5 -5
  80. package/lib/cjs/Gradient.js.map +1 -1
  81. package/lib/cjs/GraphicParams.js +1 -1
  82. package/lib/cjs/GraphicParams.js.map +1 -1
  83. package/lib/cjs/GroundPlane.js +1 -1
  84. package/lib/cjs/GroundPlane.js.map +1 -1
  85. package/lib/cjs/HSVColor.js +1 -1
  86. package/lib/cjs/HSVColor.js.map +1 -1
  87. package/lib/cjs/HiddenLine.js +1 -1
  88. package/lib/cjs/HiddenLine.js.map +1 -1
  89. package/lib/cjs/Hilite.js +1 -1
  90. package/lib/cjs/Hilite.js.map +1 -1
  91. package/lib/cjs/IModel.js +1 -1
  92. package/lib/cjs/IModel.js.map +1 -1
  93. package/lib/cjs/IModelVersion.js.map +1 -1
  94. package/lib/cjs/Image.js +2 -2
  95. package/lib/cjs/Image.js.map +1 -1
  96. package/lib/cjs/IpcAppProps.d.ts +24 -2
  97. package/lib/cjs/IpcAppProps.d.ts.map +1 -1
  98. package/lib/cjs/IpcAppProps.js.map +1 -1
  99. package/lib/cjs/LightSettings.js +1 -1
  100. package/lib/cjs/LightSettings.js.map +1 -1
  101. package/lib/cjs/LinePixels.js +1 -1
  102. package/lib/cjs/LinePixels.js.map +1 -1
  103. package/lib/cjs/Localization.js.map +1 -1
  104. package/lib/cjs/MapImagerySettings.js +1 -1
  105. package/lib/cjs/MapImagerySettings.js.map +1 -1
  106. package/lib/cjs/MapLayerSettings.js.map +1 -1
  107. package/lib/cjs/MassProperties.js +1 -1
  108. package/lib/cjs/MassProperties.js.map +1 -1
  109. package/lib/cjs/MaterialProps.js +2 -2
  110. package/lib/cjs/MaterialProps.js.map +1 -1
  111. package/lib/cjs/ModelGeometryChanges.js +2 -2
  112. package/lib/cjs/ModelGeometryChanges.js.map +1 -1
  113. package/lib/cjs/NativeAppProps.js +2 -2
  114. package/lib/cjs/NativeAppProps.js.map +1 -1
  115. package/lib/cjs/OctEncodedNormal.js.map +1 -1
  116. package/lib/cjs/PlanarClipMask.js +3 -3
  117. package/lib/cjs/PlanarClipMask.js.map +1 -1
  118. package/lib/cjs/QPoint.d.ts +4 -3
  119. package/lib/cjs/QPoint.d.ts.map +1 -1
  120. package/lib/cjs/QPoint.js +5 -4
  121. package/lib/cjs/QPoint.js.map +1 -1
  122. package/lib/cjs/RealityDataAccessProps.d.ts +4 -4
  123. package/lib/cjs/RealityDataAccessProps.d.ts.map +1 -1
  124. package/lib/cjs/RealityDataAccessProps.js +1 -1
  125. package/lib/cjs/RealityDataAccessProps.js.map +1 -1
  126. package/lib/cjs/RealityModelDisplaySettings.js +2 -2
  127. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  128. package/lib/cjs/Render.d.ts +2 -2
  129. package/lib/cjs/Render.d.ts.map +1 -1
  130. package/lib/cjs/Render.js +1 -1
  131. package/lib/cjs/Render.js.map +1 -1
  132. package/lib/cjs/RenderMaterial.js +1 -1
  133. package/lib/cjs/RenderMaterial.js.map +1 -1
  134. package/lib/cjs/RenderSchedule.js +1 -1
  135. package/lib/cjs/RenderSchedule.js.map +1 -1
  136. package/lib/cjs/RenderTexture.js +1 -1
  137. package/lib/cjs/RenderTexture.js.map +1 -1
  138. package/lib/cjs/RgbColor.js.map +1 -1
  139. package/lib/cjs/RpcInterface.js.map +1 -1
  140. package/lib/cjs/SkyBox.js +3 -3
  141. package/lib/cjs/SkyBox.js.map +1 -1
  142. package/lib/cjs/SolarCalculate.js.map +1 -1
  143. package/lib/cjs/SolarShadows.js +1 -1
  144. package/lib/cjs/SolarShadows.js.map +1 -1
  145. package/lib/cjs/SpatialClassification.js +2 -2
  146. package/lib/cjs/SpatialClassification.js.map +1 -1
  147. package/lib/cjs/SubCategoryAppearance.js +1 -1
  148. package/lib/cjs/SubCategoryAppearance.js.map +1 -1
  149. package/lib/cjs/SubCategoryOverride.js +1 -1
  150. package/lib/cjs/SubCategoryOverride.js.map +1 -1
  151. package/lib/cjs/TerrainSettings.js +2 -2
  152. package/lib/cjs/TerrainSettings.js.map +1 -1
  153. package/lib/cjs/TextureMapping.js +1 -1
  154. package/lib/cjs/TextureMapping.js.map +1 -1
  155. package/lib/cjs/TextureProps.js +1 -1
  156. package/lib/cjs/TextureProps.js.map +1 -1
  157. package/lib/cjs/ThematicDisplay.js +5 -5
  158. package/lib/cjs/ThematicDisplay.js.map +1 -1
  159. package/lib/cjs/TileProps.js +1 -1
  160. package/lib/cjs/TileProps.js.map +1 -1
  161. package/lib/cjs/Tween.js.map +1 -1
  162. package/lib/cjs/TxnAction.js +1 -1
  163. package/lib/cjs/TxnAction.js.map +1 -1
  164. package/lib/cjs/ViewDetails.js +2 -2
  165. package/lib/cjs/ViewDetails.js.map +1 -1
  166. package/lib/cjs/ViewFlags.js +2 -2
  167. package/lib/cjs/ViewFlags.js.map +1 -1
  168. package/lib/cjs/ViewProps.js +1 -1
  169. package/lib/cjs/ViewProps.js.map +1 -1
  170. package/lib/cjs/WhiteOnWhiteReversalSettings.js +1 -1
  171. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  172. package/lib/cjs/annotation/TextAnnotation.d.ts +107 -0
  173. package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -0
  174. package/lib/cjs/annotation/TextAnnotation.js +118 -0
  175. package/lib/cjs/annotation/TextAnnotation.js.map +1 -0
  176. package/lib/cjs/annotation/TextBlock.d.ts +276 -0
  177. package/lib/cjs/annotation/TextBlock.d.ts.map +1 -0
  178. package/lib/cjs/annotation/TextBlock.js +324 -0
  179. package/lib/cjs/annotation/TextBlock.js.map +1 -0
  180. package/lib/cjs/annotation/TextBlockGeometryProps.d.ts +40 -0
  181. package/lib/cjs/annotation/TextBlockGeometryProps.d.ts.map +1 -0
  182. package/lib/cjs/annotation/TextBlockGeometryProps.js +10 -0
  183. package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -0
  184. package/lib/cjs/annotation/TextStyle.d.ts +173 -0
  185. package/lib/cjs/annotation/TextStyle.d.ts.map +1 -0
  186. package/lib/cjs/annotation/TextStyle.js +106 -0
  187. package/lib/cjs/annotation/TextStyle.js.map +1 -0
  188. package/lib/cjs/core-common.d.ts +8 -0
  189. package/lib/cjs/core-common.d.ts.map +1 -1
  190. package/lib/cjs/core-common.js +8 -0
  191. package/lib/cjs/core-common.js.map +1 -1
  192. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  193. package/lib/cjs/geometry/AreaPattern.js +1 -1
  194. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  195. package/lib/cjs/geometry/Cartographic.js +1 -1
  196. package/lib/cjs/geometry/Cartographic.js.map +1 -1
  197. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  198. package/lib/cjs/geometry/ElementGeometry.d.ts +5 -0
  199. package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
  200. package/lib/cjs/geometry/ElementGeometry.js +28 -3
  201. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  202. package/lib/cjs/geometry/ElementGeometryFB.js +1 -1
  203. package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
  204. package/lib/cjs/geometry/FrustumPlanes.js +5 -5
  205. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  206. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  207. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  208. package/lib/cjs/geometry/GeometryStream.d.ts +5 -0
  209. package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
  210. package/lib/cjs/geometry/GeometryStream.js +35 -9
  211. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  212. package/lib/cjs/geometry/LineStyle.js +1 -1
  213. package/lib/cjs/geometry/LineStyle.js.map +1 -1
  214. package/lib/cjs/geometry/Projection.js.map +1 -1
  215. package/lib/cjs/geometry/TextString.d.ts.map +1 -1
  216. package/lib/cjs/geometry/TextString.js +16 -13
  217. package/lib/cjs/geometry/TextString.js.map +1 -1
  218. package/lib/cjs/ipc/IpcWebSocket.js +3 -3
  219. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  220. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  221. package/lib/cjs/rpc/DevToolsRpcInterface.js +2 -2
  222. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  223. package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
  224. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  225. package/lib/cjs/rpc/IModelTileRpcInterface.js +1 -1
  226. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  227. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +1 -1
  228. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  229. package/lib/cjs/rpc/WipRpcInterface.js +1 -1
  230. package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
  231. package/lib/cjs/rpc/core/RpcConfiguration.js +6 -6
  232. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  233. package/lib/cjs/rpc/core/RpcConstants.js +7 -7
  234. package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
  235. package/lib/cjs/rpc/core/RpcControl.js +1 -1
  236. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  237. package/lib/cjs/rpc/core/RpcInvocation.js +3 -3
  238. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  239. package/lib/cjs/rpc/core/RpcMarshaling.js +2 -2
  240. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  241. package/lib/cjs/rpc/core/RpcOperation.js +2 -3
  242. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  243. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  244. package/lib/cjs/rpc/core/RpcProtocol.js +3 -3
  245. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  246. package/lib/cjs/rpc/core/RpcPush.js +2 -2
  247. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  248. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  249. package/lib/cjs/rpc/core/RpcRequest.js +1 -1
  250. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  251. package/lib/cjs/rpc/core/RpcRoutingToken.js +1 -1
  252. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  253. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +1 -1
  254. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  255. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  256. package/lib/cjs/rpc/web/RpcMultipart.js +1 -1
  257. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  258. package/lib/cjs/rpc/web/WebAppRpcLogging.js +8 -8
  259. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  260. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  261. package/lib/cjs/rpc/web/WebAppRpcRequest.js +3 -3
  262. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  263. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  264. package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
  265. package/lib/cjs/tile/GltfTileIO.js +2 -2
  266. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  267. package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
  268. package/lib/cjs/tile/IModelTileIO.js +3 -3
  269. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  270. package/lib/cjs/tile/TileIO.d.ts +6 -6
  271. package/lib/cjs/tile/TileIO.d.ts.map +1 -1
  272. package/lib/cjs/tile/TileIO.js +2 -2
  273. package/lib/cjs/tile/TileIO.js.map +1 -1
  274. package/lib/cjs/tile/TileMetadata.d.ts +3 -3
  275. package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
  276. package/lib/cjs/tile/TileMetadata.js +3 -3
  277. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  278. package/lib/cjs/tile/Tileset3dSchema.d.ts.map +1 -1
  279. package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
  280. package/lib/esm/AnalysisStyle.js +1 -2
  281. package/lib/esm/AnalysisStyle.js.map +1 -1
  282. package/lib/esm/Atmosphere.js +11 -11
  283. package/lib/esm/Atmosphere.js.map +1 -1
  284. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  285. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  286. package/lib/esm/BlobReader.js.map +1 -1
  287. package/lib/esm/Camera.js.map +1 -1
  288. package/lib/esm/ClipStyle.js +3 -6
  289. package/lib/esm/ClipStyle.js.map +1 -1
  290. package/lib/esm/Code.d.ts +1 -0
  291. package/lib/esm/Code.d.ts.map +1 -1
  292. package/lib/esm/Code.js +1 -0
  293. package/lib/esm/Code.js.map +1 -1
  294. package/lib/esm/ColorDef.js +1 -2
  295. package/lib/esm/ColorDef.js.map +1 -1
  296. package/lib/esm/ConcurrentQuery.d.ts +11 -11
  297. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  298. package/lib/esm/ConcurrentQuery.js.map +1 -1
  299. package/lib/esm/ContextRealityModel.js.map +1 -1
  300. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  301. package/lib/esm/ECSqlReader.js +1 -2
  302. package/lib/esm/ECSqlReader.js.map +1 -1
  303. package/lib/esm/ECSqlTypes.js.map +1 -1
  304. package/lib/esm/ElementMesh.js.map +1 -1
  305. package/lib/esm/ElementProps.d.ts +23 -0
  306. package/lib/esm/ElementProps.d.ts.map +1 -1
  307. package/lib/esm/ElementProps.js +1 -2
  308. package/lib/esm/ElementProps.js.map +1 -1
  309. package/lib/esm/EntityProps.d.ts +5 -2
  310. package/lib/esm/EntityProps.d.ts.map +1 -1
  311. package/lib/esm/EntityProps.js +1 -0
  312. package/lib/esm/EntityProps.js.map +1 -1
  313. package/lib/esm/Environment.js +1 -2
  314. package/lib/esm/Environment.js.map +1 -1
  315. package/lib/esm/FeatureSymbology.d.ts +1 -1
  316. package/lib/esm/FeatureSymbology.js +2 -4
  317. package/lib/esm/FeatureSymbology.js.map +1 -1
  318. package/lib/esm/FeatureTable.js.map +1 -1
  319. package/lib/esm/Frustum.d.ts.map +1 -1
  320. package/lib/esm/Frustum.js +2 -0
  321. package/lib/esm/Frustum.js.map +1 -1
  322. package/lib/esm/GeoCoordinateServices.js.map +1 -1
  323. package/lib/esm/GeometryParams.js.map +1 -1
  324. package/lib/esm/Gradient.js +4 -4
  325. package/lib/esm/Gradient.js.map +1 -1
  326. package/lib/esm/GroundPlane.js +1 -2
  327. package/lib/esm/GroundPlane.js.map +1 -1
  328. package/lib/esm/HSVColor.js.map +1 -1
  329. package/lib/esm/HiddenLine.js.map +1 -1
  330. package/lib/esm/IModel.js +1 -2
  331. package/lib/esm/IModel.js.map +1 -1
  332. package/lib/esm/IModelVersion.js.map +1 -1
  333. package/lib/esm/Image.js.map +1 -1
  334. package/lib/esm/IpcAppProps.d.ts +24 -2
  335. package/lib/esm/IpcAppProps.d.ts.map +1 -1
  336. package/lib/esm/IpcAppProps.js.map +1 -1
  337. package/lib/esm/LightSettings.js +1 -2
  338. package/lib/esm/LightSettings.js.map +1 -1
  339. package/lib/esm/Localization.js.map +1 -1
  340. package/lib/esm/MapImagerySettings.js.map +1 -1
  341. package/lib/esm/MapLayerSettings.js.map +1 -1
  342. package/lib/esm/ModelGeometryChanges.js.map +1 -1
  343. package/lib/esm/OctEncodedNormal.js.map +1 -1
  344. package/lib/esm/PlanarClipMask.js +1 -2
  345. package/lib/esm/PlanarClipMask.js.map +1 -1
  346. package/lib/esm/QPoint.d.ts +4 -3
  347. package/lib/esm/QPoint.d.ts.map +1 -1
  348. package/lib/esm/QPoint.js +2 -1
  349. package/lib/esm/QPoint.js.map +1 -1
  350. package/lib/esm/RealityDataAccessProps.d.ts +4 -4
  351. package/lib/esm/RealityDataAccessProps.d.ts.map +1 -1
  352. package/lib/esm/RealityModelDisplaySettings.js +2 -4
  353. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  354. package/lib/esm/Render.d.ts +2 -2
  355. package/lib/esm/Render.d.ts.map +1 -1
  356. package/lib/esm/Render.js.map +1 -1
  357. package/lib/esm/RenderSchedule.js.map +1 -1
  358. package/lib/esm/RgbColor.js.map +1 -1
  359. package/lib/esm/RpcInterface.js.map +1 -1
  360. package/lib/esm/SkyBox.js +2 -4
  361. package/lib/esm/SkyBox.js.map +1 -1
  362. package/lib/esm/SolarCalculate.js.map +1 -1
  363. package/lib/esm/SolarShadows.js +1 -2
  364. package/lib/esm/SolarShadows.js.map +1 -1
  365. package/lib/esm/SpatialClassification.js.map +1 -1
  366. package/lib/esm/SubCategoryAppearance.js +1 -2
  367. package/lib/esm/SubCategoryAppearance.js.map +1 -1
  368. package/lib/esm/SubCategoryOverride.js +1 -2
  369. package/lib/esm/SubCategoryOverride.js.map +1 -1
  370. package/lib/esm/TerrainSettings.js.map +1 -1
  371. package/lib/esm/TextureMapping.js.map +1 -1
  372. package/lib/esm/ThematicDisplay.js +1 -2
  373. package/lib/esm/ThematicDisplay.js.map +1 -1
  374. package/lib/esm/Tween.js.map +1 -1
  375. package/lib/esm/ViewDetails.js +1 -2
  376. package/lib/esm/ViewDetails.js.map +1 -1
  377. package/lib/esm/ViewFlags.js +1 -2
  378. package/lib/esm/ViewFlags.js.map +1 -1
  379. package/lib/esm/WhiteOnWhiteReversalSettings.js +1 -2
  380. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  381. package/lib/esm/annotation/TextAnnotation.d.ts +107 -0
  382. package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -0
  383. package/lib/esm/annotation/TextAnnotation.js +114 -0
  384. package/lib/esm/annotation/TextAnnotation.js.map +1 -0
  385. package/lib/esm/annotation/TextBlock.d.ts +276 -0
  386. package/lib/esm/annotation/TextBlock.d.ts.map +1 -0
  387. package/lib/esm/annotation/TextBlock.js +315 -0
  388. package/lib/esm/annotation/TextBlock.js.map +1 -0
  389. package/lib/esm/annotation/TextBlockGeometryProps.d.ts +40 -0
  390. package/lib/esm/annotation/TextBlockGeometryProps.d.ts.map +1 -0
  391. package/lib/esm/annotation/TextBlockGeometryProps.js +9 -0
  392. package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -0
  393. package/lib/esm/annotation/TextStyle.d.ts +173 -0
  394. package/lib/esm/annotation/TextStyle.d.ts.map +1 -0
  395. package/lib/esm/annotation/TextStyle.js +101 -0
  396. package/lib/esm/annotation/TextStyle.js.map +1 -0
  397. package/lib/esm/core-common.d.ts +8 -0
  398. package/lib/esm/core-common.d.ts.map +1 -1
  399. package/lib/esm/core-common.js +8 -0
  400. package/lib/esm/core-common.js.map +1 -1
  401. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  402. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  403. package/lib/esm/geometry/Cartographic.js +1 -2
  404. package/lib/esm/geometry/Cartographic.js.map +1 -1
  405. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  406. package/lib/esm/geometry/ElementGeometry.d.ts +5 -0
  407. package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
  408. package/lib/esm/geometry/ElementGeometry.js +26 -1
  409. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  410. package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
  411. package/lib/esm/geometry/FrustumPlanes.js +4 -4
  412. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  413. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  414. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  415. package/lib/esm/geometry/GeometryStream.d.ts +5 -0
  416. package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
  417. package/lib/esm/geometry/GeometryStream.js +34 -8
  418. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  419. package/lib/esm/geometry/LineStyle.js.map +1 -1
  420. package/lib/esm/geometry/Projection.js.map +1 -1
  421. package/lib/esm/geometry/TextString.d.ts.map +1 -1
  422. package/lib/esm/geometry/TextString.js +16 -13
  423. package/lib/esm/geometry/TextString.js.map +1 -1
  424. package/lib/esm/ipc/IpcWebSocket.js +1 -2
  425. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  426. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  427. package/lib/esm/rpc/DevToolsRpcInterface.js +1 -2
  428. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  429. package/lib/esm/rpc/IModelReadRpcInterface.js +1 -2
  430. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  431. package/lib/esm/rpc/IModelTileRpcInterface.js +1 -2
  432. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  433. package/lib/esm/rpc/SnapshotIModelRpcInterface.js +1 -2
  434. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  435. package/lib/esm/rpc/WipRpcInterface.js +1 -2
  436. package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
  437. package/lib/esm/rpc/core/RpcConfiguration.js +5 -6
  438. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  439. package/lib/esm/rpc/core/RpcControl.js +1 -2
  440. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  441. package/lib/esm/rpc/core/RpcInvocation.js +3 -4
  442. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  443. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  444. package/lib/esm/rpc/core/RpcOperation.js +1 -2
  445. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  446. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  447. package/lib/esm/rpc/core/RpcProtocol.js +1 -2
  448. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  449. package/lib/esm/rpc/core/RpcPush.js +2 -4
  450. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  451. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  452. package/lib/esm/rpc/core/RpcRequest.js +1 -2
  453. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  454. package/lib/esm/rpc/core/RpcRoutingToken.js +1 -2
  455. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  456. package/lib/esm/rpc/web/BentleyCloudRpcManager.js +1 -2
  457. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  458. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  459. package/lib/esm/rpc/web/RpcMultipart.js +1 -2
  460. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  461. package/lib/esm/rpc/web/WebAppRpcLogging.js +8 -8
  462. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  463. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  464. package/lib/esm/rpc/web/WebAppRpcRequest.js +3 -4
  465. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  466. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  467. package/lib/esm/tile/B3dmTileIO.js.map +1 -1
  468. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  469. package/lib/esm/tile/I3dmTileIO.js.map +1 -1
  470. package/lib/esm/tile/IModelTileIO.js +1 -2
  471. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  472. package/lib/esm/tile/TileIO.d.ts +6 -6
  473. package/lib/esm/tile/TileIO.d.ts.map +1 -1
  474. package/lib/esm/tile/TileIO.js.map +1 -1
  475. package/lib/esm/tile/TileMetadata.d.ts +3 -3
  476. package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
  477. package/lib/esm/tile/TileMetadata.js.map +1 -1
  478. package/lib/esm/tile/Tileset3dSchema.d.ts.map +1 -1
  479. package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
  480. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ViewDetails.js","sourceRoot":"","sources":["../../src/ViewDetails.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAmB,QAAQ,EAAS,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAuB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAyBxE;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAWX;AAXD,WAAY,mBAAmB;IAC7B,8BAA8B;IAC9B,6DAAQ,CAAA;IACR,UAAU;IACV,mEAAW,CAAA;IACX,YAAY;IACZ,mEAAW,CAAA;IACX,YAAY;IACZ,mEAAW,CAAA;IACX,mDAAmD;IACnD,qEAAY,CAAA;AACd,CAAC,EAXW,mBAAmB,KAAnB,mBAAmB,QAW9B;AAcD;;;;GAIG;AACH,MAAa,WAAW;IAQtB,gBAAgB;IAChB,YAAmB,cAAkD;QAJrE,0EAA0E;QAC1D,wBAAmB,GAAG,IAAI,OAAO,EAA6C,CAAC;QAI7F,IAAI,CAAC,cAAc,CAAC,WAAW;YAC7B,cAAc,CAAC,WAAW,GAAG,EAAE,CAAC;QAElC,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED,8DAA8D;IAC9D,IAAW,2BAA2B;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,IAAW,2BAA2B,CAAC,EAAc;QACnD,IAAI,CAAC,KAAK,CAA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CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAEjF,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IACD,IAAW,eAAe,CAAC,MAAuB;QAChD,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACa,OAAO;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, BeEvent, Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ClipVector, ClipVectorProps, Geometry, XAndY } from \"@itwin/core-geometry\";\r\nimport { ModelClipGroupProps, ModelClipGroups } from \"./ModelClipGroup\";\r\n\r\n/** Properties of a [[ViewDefinitionProps]] stored as JSON.\r\n * @see [[ViewDefinitionProps.jsonProperties]].\r\n * @see [[ViewDetails3dProps]] for additional properties specific to 3d views.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDetailsProps {\r\n /** Id of the aux coord system. Default: invalid. */\r\n acs?: Id64String;\r\n /** Aspect ratio skew (x/y) used to exaggerate the y axis of the view. Default: 1.0. */\r\n aspectSkew?: number;\r\n /** Grid orientation. Default: WorldXY. */\r\n gridOrient?: GridOrientationType;\r\n /** Default: 10. */\r\n gridPerRef?: number;\r\n /** Default: 1.0. */\r\n gridSpaceX?: number;\r\n /** Default: same as gridSpaceX. */\r\n gridSpaceY?: number;\r\n /** Describes the [ClipVector]($core-geometry) applied to the view. */\r\n clip?: ClipVectorProps;\r\n}\r\n\r\n/** Describes the orientation of the grid displayed within a [Viewport]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GridOrientationType {\r\n /** Oriented with the view. */\r\n View = 0,\r\n /** Top */\r\n WorldXY = 1,\r\n /** Right */\r\n WorldYZ = 2,\r\n /** Front */\r\n WorldXZ = 3,\r\n /** Oriented by the auxiliary coordinate system. */\r\n AuxCoord = 4,\r\n}\r\n\r\n/** Properties of a [[ViewDefinition3dProps]] stored as JSON.\r\n * @see [[ViewDefinition3dProps.jsonProperties]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDetails3dProps extends ViewDetailsProps {\r\n /** Whether viewing tools are prohibited from operating in 3 dimensions on this view. Default: false. */\r\n disable3dManipulations?: boolean;\r\n /** Defines how to clip groups of models. */\r\n modelClipGroups?: ModelClipGroupProps[];\r\n}\r\n\r\n/** Encapsulates access to optional view details stored in JSON properties.\r\n * @see [[ViewDetailsProps]] for the JSON representation.\r\n * @see [ViewDefinition.details]($backend) and [ViewState.details]($frontend).\r\n * @public\r\n */\r\nexport class ViewDetails {\r\n /** @internal */\r\n protected readonly _json: ViewDetailsProps;\r\n private _clipVector?: ClipVector;\r\n\r\n /** Event raised just before assignment to the [[clipVector]] property. */\r\n public readonly onClipVectorChanged = new BeEvent<(newClip: ClipVector | undefined) => void>();\r\n\r\n /** @internal */\r\n public constructor(jsonProperties: { viewDetails?: ViewDetailsProps }) {\r\n if (!jsonProperties.viewDetails)\r\n jsonProperties.viewDetails = {};\r\n\r\n this._json = jsonProperties.viewDetails;\r\n }\r\n\r\n /** The Id of the auxiliary coordinate system for the view. */\r\n public get auxiliaryCoordinateSystemId(): Id64String {\r\n return Id64.fromJSON(this._json.acs);\r\n }\r\n public set auxiliaryCoordinateSystemId(id: Id64String) {\r\n this._json.acs = Id64.isValidId64(id) ? id : undefined;\r\n }\r\n\r\n /** Maximum aspect ratio skew. Apps can override this by changing its value. */\r\n public static maxSkew = 25;\r\n\r\n /** The aspect ratio skew (x/y, usually 1.0) used to exaggerate the y axis of the view. */\r\n public get aspectRatioSkew(): number {\r\n const maxSkew = ViewDetails.maxSkew;\r\n const skew = JsonUtils.asDouble(this._json.aspectSkew, 1.0);\r\n return Geometry.clamp(skew, 1 / maxSkew, maxSkew);\r\n }\r\n public set aspectRatioSkew(skew: number) {\r\n this._json.aspectSkew = 1.0 !== skew ? skew : undefined;\r\n }\r\n\r\n /** The orientation of the view's grid. */\r\n public get gridOrientation(): GridOrientationType {\r\n return JsonUtils.asInt(this._json.gridOrient, GridOrientationType.WorldXY);\r\n }\r\n public set gridOrientation(orientation: GridOrientationType) {\r\n this._json.gridOrient = GridOrientationType.WorldXY === orientation ? undefined : orientation;\r\n }\r\n\r\n /** The number of grids per ref for the view. */\r\n public get gridsPerRef(): number {\r\n return JsonUtils.asInt(this._json.gridPerRef, 10);\r\n }\r\n public set gridsPerRef(gridsPerRef: number) {\r\n this._json.gridPerRef = 10 === gridsPerRef ? undefined : gridsPerRef;\r\n }\r\n\r\n /** The grid spacing for the view. */\r\n public get gridSpacing(): XAndY {\r\n const x = JsonUtils.asDouble(this._json.gridSpaceX, 1.0);\r\n const y = JsonUtils.asDouble(this._json.gridSpaceY, x);\r\n return { x, y };\r\n }\r\n public set gridSpacing(spacing: XAndY) {\r\n this._json.gridSpaceX = 1.0 !== spacing.x ? spacing.x : undefined;\r\n this._json.gridSpaceY = spacing.x !== spacing.y ? spacing.y : undefined;\r\n }\r\n\r\n /** Clipping volume for the view.\r\n * @note Do *not* modify the returned ClipVector. If you wish to change the ClipVector, clone the returned ClipVector, modify it as desired, and pass the clone back to the setter.\r\n */\r\n public get clipVector(): ClipVector | undefined {\r\n if (undefined === this._clipVector) {\r\n const clip = this._json.clip;\r\n this._clipVector = (undefined !== clip ? ClipVector.fromJSON(clip) : ClipVector.createEmpty());\r\n }\r\n\r\n return this._clipVector.isValid ? this._clipVector : undefined;\r\n }\r\n public set clipVector(clip: ClipVector | undefined) {\r\n const curClip = this.clipVector;\r\n if (curClip === clip)\r\n return;\r\n\r\n if (!curClip) {\r\n assert(undefined !== clip);\r\n\r\n // An empty clip is equivalent to no clip.\r\n if (!clip.isValid)\r\n return;\r\n }\r\n\r\n clip = clip ?? ClipVector.createEmpty();\r\n\r\n this.onClipVectorChanged.raiseEvent(clip.isValid ? clip : undefined);\r\n\r\n this._clipVector = clip;\r\n if (clip.isValid)\r\n this._json.clip = clip.toJSON();\r\n else\r\n delete this._json.clip;\r\n }\r\n\r\n /** Returns the internal JSON representation. This is *not* a copy.\r\n * @internal\r\n */\r\n public getJSON(): Readonly<ViewDetailsProps> {\r\n return this._json;\r\n }\r\n}\r\n\r\n/** Encapsulates access to optional 3d view details stored in JSON properties.\r\n * @see [[ViewDetails3dProps]] for the JSON representation.\r\n * @public\r\n */\r\nexport class ViewDetails3d extends ViewDetails {\r\n private _modelClipGroups?: ModelClipGroups;\r\n\r\n private get _json3d(): ViewDetails3dProps {\r\n return this._json as ViewDetails3dProps;\r\n }\r\n\r\n /** Event raised when just before assignment to the [[modelClipGroups]] property. */\r\n public readonly onModelClipGroupsChanged = new BeEvent<(newGroups: ModelClipGroups) => void>();\r\n\r\n /** @internal */\r\n public constructor(jsonProperties: { viewDetails?: ViewDetails3dProps }) {\r\n super(jsonProperties);\r\n }\r\n\r\n /** Controls whether viewing tools are allowed to operate on the view in 3 dimensions. */\r\n public get allow3dManipulations(): boolean {\r\n return !JsonUtils.asBool(this._json3d.disable3dManipulations, false);\r\n }\r\n public set allow3dManipulations(allow: boolean) {\r\n this._json3d.disable3dManipulations = allow ? undefined : true;\r\n }\r\n\r\n /** Groups of models associated with [ClipVector]($core-geometry)s by which those models should be clipped.\r\n * If the view and the model both have a clip vector defined, geometry in the model will be clipped by the intersection of the two clip vectors.\r\n * [[ViewFlags.clipVolume]] has no effect on model clips, only the view clip - model clips are always applied.\r\n * @note Do **not** modify the returned object directly. Instead, clone it, modify the clone, and pass the clone to the property setter.\r\n */\r\n public get modelClipGroups(): ModelClipGroups {\r\n if (!this._modelClipGroups)\r\n this._modelClipGroups = ModelClipGroups.fromJSON(this._json3d.modelClipGroups);\r\n\r\n return this._modelClipGroups;\r\n }\r\n public set modelClipGroups(groups: ModelClipGroups) {\r\n this.onModelClipGroupsChanged.raiseEvent(groups);\r\n this._modelClipGroups = groups;\r\n this._json3d.modelClipGroups = groups.toJSON();\r\n }\r\n\r\n /** Returns the internal JSON representation. This is *not* a copy.\r\n * @internal\r\n */\r\n public override getJSON(): Readonly<ViewDetails3dProps> {\r\n return this._json3d;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewDetails.js","sourceRoot":"","sources":["../../src/ViewDetails.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAmB,QAAQ,EAAS,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAuB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAyBxE;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAWX;AAXD,WAAY,mBAAmB;IAC7B,8BAA8B;IAC9B,6DAAQ,CAAA;IACR,UAAU;IACV,mEAAW,CAAA;IACX,YAAY;IACZ,mEAAW,CAAA;IACX,YAAY;IACZ,mEAAW,CAAA;IACX,mDAAmD;IACnD,qEAAY,CAAA;AACd,CAAC,EAXW,mBAAmB,KAAnB,mBAAmB,QAW9B;AAcD;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAQtB,gBAAgB;IAChB,YAAmB,cAAkD;QAJrE,0EAA0E;QAC1D,wBAAmB,GAAG,IAAI,OAAO,EAA6C,CAAC;QAI7F,IAAI,CAAC,cAAc,CAAC,WAAW;YAC7B,cAAc,CAAC,WAAW,GAAG,EAAE,CAAC;QAElC,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED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sB,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,IAAW,eAAe;QACxB,IAAI,CAAC,IAAI,CAAC,gBAAgB;YACxB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAEjF,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IACD,IAAW,eAAe,CAAC,MAAuB;QAChD,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACa,OAAO;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, BeEvent, Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ClipVector, ClipVectorProps, Geometry, XAndY } from \"@itwin/core-geometry\";\r\nimport { ModelClipGroupProps, ModelClipGroups } from \"./ModelClipGroup\";\r\n\r\n/** Properties of a [[ViewDefinitionProps]] stored as JSON.\r\n * @see [[ViewDefinitionProps.jsonProperties]].\r\n * @see [[ViewDetails3dProps]] for additional properties specific to 3d views.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDetailsProps {\r\n /** Id of the aux coord system. Default: invalid. */\r\n acs?: Id64String;\r\n /** Aspect ratio skew (x/y) used to exaggerate the y axis of the view. Default: 1.0. */\r\n aspectSkew?: number;\r\n /** Grid orientation. Default: WorldXY. */\r\n gridOrient?: GridOrientationType;\r\n /** Default: 10. */\r\n gridPerRef?: number;\r\n /** Default: 1.0. */\r\n gridSpaceX?: number;\r\n /** Default: same as gridSpaceX. */\r\n gridSpaceY?: number;\r\n /** Describes the [ClipVector]($core-geometry) applied to the view. */\r\n clip?: ClipVectorProps;\r\n}\r\n\r\n/** Describes the orientation of the grid displayed within a [Viewport]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GridOrientationType {\r\n /** Oriented with the view. */\r\n View = 0,\r\n /** Top */\r\n WorldXY = 1,\r\n /** Right */\r\n WorldYZ = 2,\r\n /** Front */\r\n WorldXZ = 3,\r\n /** Oriented by the auxiliary coordinate system. */\r\n AuxCoord = 4,\r\n}\r\n\r\n/** Properties of a [[ViewDefinition3dProps]] stored as JSON.\r\n * @see [[ViewDefinition3dProps.jsonProperties]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDetails3dProps extends ViewDetailsProps {\r\n /** Whether viewing tools are prohibited from operating in 3 dimensions on this view. Default: false. */\r\n disable3dManipulations?: boolean;\r\n /** Defines how to clip groups of models. */\r\n modelClipGroups?: ModelClipGroupProps[];\r\n}\r\n\r\n/** Encapsulates access to optional view details stored in JSON properties.\r\n * @see [[ViewDetailsProps]] for the JSON representation.\r\n * @see [ViewDefinition.details]($backend) and [ViewState.details]($frontend).\r\n * @public\r\n */\r\nexport class ViewDetails {\r\n /** @internal */\r\n protected readonly _json: ViewDetailsProps;\r\n private _clipVector?: ClipVector;\r\n\r\n /** Event raised just before assignment to the [[clipVector]] property. */\r\n public readonly onClipVectorChanged = new BeEvent<(newClip: ClipVector | undefined) => void>();\r\n\r\n /** @internal */\r\n public constructor(jsonProperties: { viewDetails?: ViewDetailsProps }) {\r\n if (!jsonProperties.viewDetails)\r\n jsonProperties.viewDetails = {};\r\n\r\n this._json = jsonProperties.viewDetails;\r\n }\r\n\r\n /** The Id of the auxiliary coordinate system for the view. */\r\n public get auxiliaryCoordinateSystemId(): Id64String {\r\n return Id64.fromJSON(this._json.acs);\r\n }\r\n public set auxiliaryCoordinateSystemId(id: Id64String) {\r\n this._json.acs = Id64.isValidId64(id) ? id : undefined;\r\n }\r\n\r\n /** Maximum aspect ratio skew. Apps can override this by changing its value. */\r\n public static maxSkew = 25;\r\n\r\n /** The aspect ratio skew (x/y, usually 1.0) used to exaggerate the y axis of the view. */\r\n public get aspectRatioSkew(): number {\r\n const maxSkew = ViewDetails.maxSkew;\r\n const skew = JsonUtils.asDouble(this._json.aspectSkew, 1.0);\r\n return Geometry.clamp(skew, 1 / maxSkew, maxSkew);\r\n }\r\n public set aspectRatioSkew(skew: number) {\r\n this._json.aspectSkew = 1.0 !== skew ? skew : undefined;\r\n }\r\n\r\n /** The orientation of the view's grid. */\r\n public get gridOrientation(): GridOrientationType {\r\n return JsonUtils.asInt(this._json.gridOrient, GridOrientationType.WorldXY);\r\n }\r\n public set gridOrientation(orientation: GridOrientationType) {\r\n this._json.gridOrient = GridOrientationType.WorldXY === orientation ? undefined : orientation;\r\n }\r\n\r\n /** The number of grids per ref for the view. */\r\n public get gridsPerRef(): number {\r\n return JsonUtils.asInt(this._json.gridPerRef, 10);\r\n }\r\n public set gridsPerRef(gridsPerRef: number) {\r\n this._json.gridPerRef = 10 === gridsPerRef ? undefined : gridsPerRef;\r\n }\r\n\r\n /** The grid spacing for the view. */\r\n public get gridSpacing(): XAndY {\r\n const x = JsonUtils.asDouble(this._json.gridSpaceX, 1.0);\r\n const y = JsonUtils.asDouble(this._json.gridSpaceY, x);\r\n return { x, y };\r\n }\r\n public set gridSpacing(spacing: XAndY) {\r\n this._json.gridSpaceX = 1.0 !== spacing.x ? spacing.x : undefined;\r\n this._json.gridSpaceY = spacing.x !== spacing.y ? spacing.y : undefined;\r\n }\r\n\r\n /** Clipping volume for the view.\r\n * @note Do *not* modify the returned ClipVector. If you wish to change the ClipVector, clone the returned ClipVector, modify it as desired, and pass the clone back to the setter.\r\n */\r\n public get clipVector(): ClipVector | undefined {\r\n if (undefined === this._clipVector) {\r\n const clip = this._json.clip;\r\n this._clipVector = (undefined !== clip ? ClipVector.fromJSON(clip) : ClipVector.createEmpty());\r\n }\r\n\r\n return this._clipVector.isValid ? this._clipVector : undefined;\r\n }\r\n public set clipVector(clip: ClipVector | undefined) {\r\n const curClip = this.clipVector;\r\n if (curClip === clip)\r\n return;\r\n\r\n if (!curClip) {\r\n assert(undefined !== clip);\r\n\r\n // An empty clip is equivalent to no clip.\r\n if (!clip.isValid)\r\n return;\r\n }\r\n\r\n clip = clip ?? ClipVector.createEmpty();\r\n\r\n this.onClipVectorChanged.raiseEvent(clip.isValid ? clip : undefined);\r\n\r\n this._clipVector = clip;\r\n if (clip.isValid)\r\n this._json.clip = clip.toJSON();\r\n else\r\n delete this._json.clip;\r\n }\r\n\r\n /** Returns the internal JSON representation. This is *not* a copy.\r\n * @internal\r\n */\r\n public getJSON(): Readonly<ViewDetailsProps> {\r\n return this._json;\r\n }\r\n}\r\n\r\n/** Encapsulates access to optional 3d view details stored in JSON properties.\r\n * @see [[ViewDetails3dProps]] for the JSON representation.\r\n * @public\r\n */\r\nexport class ViewDetails3d extends ViewDetails {\r\n private _modelClipGroups?: ModelClipGroups;\r\n\r\n private get _json3d(): ViewDetails3dProps {\r\n return this._json as ViewDetails3dProps;\r\n }\r\n\r\n /** Event raised when just before assignment to the [[modelClipGroups]] property. */\r\n public readonly onModelClipGroupsChanged = new BeEvent<(newGroups: ModelClipGroups) => void>();\r\n\r\n /** @internal */\r\n public constructor(jsonProperties: { viewDetails?: ViewDetails3dProps }) {\r\n super(jsonProperties);\r\n }\r\n\r\n /** Controls whether viewing tools are allowed to operate on the view in 3 dimensions. */\r\n public get allow3dManipulations(): boolean {\r\n return !JsonUtils.asBool(this._json3d.disable3dManipulations, false);\r\n }\r\n public set allow3dManipulations(allow: boolean) {\r\n this._json3d.disable3dManipulations = allow ? undefined : true;\r\n }\r\n\r\n /** Groups of models associated with [ClipVector]($core-geometry)s by which those models should be clipped.\r\n * If the view and the model both have a clip vector defined, geometry in the model will be clipped by the intersection of the two clip vectors.\r\n * [[ViewFlags.clipVolume]] has no effect on model clips, only the view clip - model clips are always applied.\r\n * @note Do **not** modify the returned object directly. Instead, clone it, modify the clone, and pass the clone to the property setter.\r\n */\r\n public get modelClipGroups(): ModelClipGroups {\r\n if (!this._modelClipGroups)\r\n this._modelClipGroups = ModelClipGroups.fromJSON(this._json3d.modelClipGroups);\r\n\r\n return this._modelClipGroups;\r\n }\r\n public set modelClipGroups(groups: ModelClipGroups) {\r\n this.onModelClipGroupsChanged.raiseEvent(groups);\r\n this._modelClipGroups = groups;\r\n this._json3d.modelClipGroups = groups.toJSON();\r\n }\r\n\r\n /** Returns the internal JSON representation. This is *not* a copy.\r\n * @internal\r\n */\r\n public override getJSON(): Readonly<ViewDetails3dProps> {\r\n return this._json3d;\r\n }\r\n}\r\n"]}
@@ -64,7 +64,7 @@ function edgesRequired(renderMode, visibleEdges) {
64
64
  * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).
65
65
  * @public
66
66
  */
67
- class ViewFlags {
67
+ export class ViewFlags {
68
68
  /** Create a new ViewFlags.
69
69
  * @param flags The properties to initialize. Any properties not specified are initialized to their default values.
70
70
  */
@@ -361,5 +361,4 @@ class ViewFlags {
361
361
  }
362
362
  /** A ViewFlags object with all properties initialized to their default values. */
363
363
  ViewFlags.defaults = new ViewFlags();
364
- export { ViewFlags };
365
364
  //# sourceMappingURL=ViewFlags.js.map
@@ -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;;;;OAIG;IAC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AAC,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;;AAzFD,kFAAkF;AAC3D,kBAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;SAzTvC,SAAS","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\n// cspell:ignore ovrs\r\n\r\nimport { JsonUtils, Mutable, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\r\n\r\n/** Enumerates the available basic rendering modes, as part of a [DisplayStyle]($backend)'s [[ViewFlags]].\r\n * The rendering mode broadly affects various aspects of the display style - in particular, whether and how surfaces and their edges are drawn.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum RenderMode {\r\n /** Renders only the edges of surfaces, with exceptions for planar regions based on their [[FillFlags]].\r\n * Lighting (and by extension, shadows) is not applied.\r\n * [[HiddenLine.Settings]] are not applied - edges use the elements' width, style, and color.\r\n * [[ViewFlags.hiddenEdges]] is ignored - hidden edges are never displayed in wireframe mode.\r\n */\r\n Wireframe = 0,\r\n /** By default, renders surfaces without their edges.\r\n * Lighting and shadows can be applied using [[ViewFlags.lighting]] and [[ViewFlags.shadows]].\r\n * Edges can be enabled using [[ViewFlags.visibleEdges]] and [[ViewFlags.hiddenEdges]], and their appearance customized using [[HiddenLine.Settings]].\r\n * Surfaces can be drawn with transparency, based on [[ViewFlags.transparency]].\r\n */\r\n SmoothShade = 6,\r\n /** Renders surfaces and their edges. By default, edges are drawn in white; this can be overridden using [[HiddenLine.Settings]].\r\n * All surfaces are rendered opaque. If a surface's transparency is below that specified by [[HiddenLine.Settings.transparencyThreshold]], it is not rendered.\r\n * Materials and textures are not applied - surfaces are drawn in their actual colors.\r\n * [[ViewFlags.visibleEdges]] is ignored - visible edges are always drawn. Hidden edges can be enabled using [[ViewFlags.hiddenEdges]].\r\n * Lighting (and by extension, shadows) is not applied.\r\n */\r\n SolidFill = 4,\r\n /** Identical to [[RenderMode.SolidFill]], except:\r\n * - Surfaces are drawn using the [DisplayStyle]($backend)'s background color.\r\n * - Edges are drawn using their surface's colors; this can be overridden using [[HiddenLine.Settings]].\r\n */\r\n HiddenLine = 3,\r\n}\r\n\r\n/** JSON representation of [[ViewFlags]].\r\n * This is a persistence format with some unfortunate quirks that have been retained for backwards compatibility.\r\n * In particular, it supplies three separate flags intended to control lighting - [[noCameraLights]], [[noSourceLights]], and [[noSolarLight]] -\r\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.\r\n * It also uses awkward negative ([[noConstruct]], [[noTransp]]) and/or abbreviated ([[clipVol]], [[visEdges]]) property names that differ from\r\n * those of the corresponding [[ViewFlags]] properties, making usage of this type in code error-prone.\r\n * Prefer to use [[ViewFlagsProperties]] unless you need to work directly with the persistence format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewFlagProps {\r\n /** If true, don't display geometry of class [[GeometryClass.Construction]]. */\r\n noConstruct?: boolean;\r\n /** If true, don't display geometry of class [[GeometryClass.Dimension]]. */\r\n noDim?: boolean;\r\n /** If true, don't display geometry of class [[GeometryClass.Pattern]]. */\r\n noPattern?: boolean;\r\n /** If true, all lines are drawn with a width of 1 pixel. */\r\n noWeight?: boolean;\r\n /** If true, don't apply [[LinePixels]] styles. */\r\n noStyle?: boolean;\r\n /** If true, display transparency geometry as opaque. */\r\n noTransp?: boolean;\r\n /** If true, don't show filled planar regions, unless they use [[FillFlags.Always]]. */\r\n noFill?: boolean;\r\n /** If true, display a grid in the view. */\r\n grid?: boolean;\r\n /** If true, display graphics representing the [AuxCoordSystem]($backend). */\r\n acs?: boolean;\r\n /** If true, don't apply [[RenderTexture]]s to surfaces. */\r\n noTexture?: boolean;\r\n /** If true, don't apply [[RenderMaterial]]s to surfaces. */\r\n noMaterial?: boolean;\r\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\r\n noCameraLights?: boolean;\r\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\r\n noSourceLights?: boolean;\r\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\r\n noSolarLight?: boolean;\r\n /** If true, display the edges of surfaces. */\r\n visEdges?: boolean;\r\n /** If true, display the edges of surfaces, even if they are behind other geometry. */\r\n hidEdges?: boolean;\r\n /** If true, display shadows. */\r\n shadows?: boolean;\r\n /** If true, apply the view's clipping volume. Has no effect on other types of clips like [[ModelClipGroups]]. */\r\n clipVol?: boolean;\r\n /** If true, apply the view's [[DisplayStyleSettings.monochromeColor]] and [[DisplayStyleSettings.monochromeMode]] to produce a monochrome image. */\r\n monochrome?: boolean;\r\n /** The basic rendering mode, which affects the behavior of other flags. */\r\n renderMode?: RenderMode;\r\n /** Display a background map. */\r\n backgroundMap?: boolean;\r\n /** If true, apply [[AmbientOcclusion]]. */\r\n ambientOcclusion?: boolean;\r\n /** If true, apply [[ThematicDisplay]]. */\r\n thematicDisplay?: boolean;\r\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\r\n wiremesh?: boolean;\r\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\r\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\r\n * non-planar surfaces always draw in front of those non-planar surfaces.\r\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),\r\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.\r\n */\r\n forceSurfaceDiscard?: boolean;\r\n /** Disables the \"white-on-white reversal\" employed by some CAD applications.\r\n * @see [[ViewFlags.whiteOnWhiteReversal]].\r\n */\r\n noWhiteOnWhiteReversal?: boolean;\r\n}\r\n\r\nfunction edgesRequired(renderMode: RenderMode, visibleEdges: boolean): boolean {\r\n return visibleEdges || RenderMode.SmoothShade !== renderMode;\r\n}\r\n\r\n/** Flags controlling how graphics appear within a view.\r\n * A [[ViewFlags]] object is immutable. There are several ways to produce a modified copy of a ViewFlags object:\r\n * ```ts\r\n * // Start with the default values for all properties.\r\n * let vf = ViewFlags.defaults;\r\n * // Change a single boolean property:\r\n * vf = vf.with(\"visibleEdges\", true);\r\n * // Change only the render mode:\r\n * vf = vf.withRenderMode(RenderMode.HiddenLine);\r\n * // Change multiple properties:\r\n * vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });\r\n * // Reset multiple properties to their default values:\r\n * vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });\r\n *\r\n * ```\r\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\r\n * the new value differs from the current value.\r\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\r\n * each call to [[with]] or [[withRenderMode]] potentially creating a new object.\r\n * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).\r\n * @public\r\n */\r\nexport class ViewFlags {\r\n /** The basic rendering mode applied to the view. This modulates the behavior of some of the other flags.\r\n * Default: [[RenderMode.Wireframe]].\r\n * @see [[RenderMode]] for details.\r\n */\r\n public readonly renderMode: RenderMode;\r\n /** Whether to display geometry of class [[GeometryClass.Dimension]]. Default: true. */\r\n public readonly dimensions: boolean;\r\n /** Whether to display geometry of class [[GeometryClass.Pattern]]. Default: true. */\r\n public readonly patterns: boolean;\r\n /** Whether to allow lines and edges to draw with width greater than one pixel. Default: true. */\r\n public readonly weights: boolean;\r\n /** Whether [[LinePixels]] are allowed to apply patterns to lines and edges. If false, they all draw as solid lines. Default: true. */\r\n public readonly styles: boolean;\r\n /** Whether element transparency is applied. If false, transparent geometry is drawn opaque. Default: true.\r\n * @see [[RenderMode]] for render mode-specific behavior.\r\n */\r\n public readonly transparency: boolean;\r\n /** In [[RenderMode.Wireframe]] only, whether to display the interiors of planar regions with [[FillFlags.ByView]]. Default: true. */\r\n public readonly fill: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderTexture]]s to surfaces. Default: true. */\r\n public readonly textures: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderMaterial]]s to surfaces. Default: true. */\r\n public readonly materials: boolean;\r\n /** Whether to display a graphical representation of the view's [AuxCoordSystem]($backend). Default: false. */\r\n public readonly acsTriad: boolean;\r\n /** Whether to display a grid. Default: false. */\r\n public readonly grid: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to display the edges of surfaces. Default: false.\r\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\r\n */\r\n public readonly visibleEdges: boolean;\r\n /** In any mode except [[RenderMode.Wireframe]], whether to display the edges of surfaces occluded by other geometry.\r\n * This has no effect unless [[visibleEdges]] is also true.\r\n * Default: false.\r\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\r\n */\r\n public readonly hiddenEdges: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to display solar shadows. This has no effect unless [[lighting]] is also true. Default: false.\r\n * @note Rendering shadows can reduce framerate, particularly on less capable graphics hardware or in complex scenes.\r\n */\r\n public readonly shadows: boolean;\r\n /** Whether to apply the view's clip volume to the geometry in the scene.\r\n * Default: true, except when using [[fromJSON]].\r\n * @see [[ViewDetails.clipVector]] to define the view's clip volume.\r\n */\r\n public readonly clipVolume: boolean;\r\n /** Whether to display geometry of class [[GeometryClass.Construction]].\r\n * Default: false, except when using [[fromJSON]].\r\n */\r\n public readonly constructions: boolean;\r\n /** Whether to produce a monochrome image. Default: false.\r\n * @see [DisplayStyleSettings.monochromeColor]($common) to define the monochrome color.\r\n * @see [DisplayStyleSettings.monochromeMode]($common) to define how the monochrome image is produced.\r\n */\r\n public readonly monochrome: boolean;\r\n /** Whether to display background map imagery. Default: false.\r\n * @see [[DisplayStyleSettings.backgroundMap]] to customize the map settings.\r\n */\r\n public readonly backgroundMap: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to apply [[AmbientOcclusion]]. Default: false. */\r\n public readonly ambientOcclusion: boolean;\r\n /** Whether to apply [[ThematicDisplay]]. Default: false. */\r\n public readonly thematicDisplay: boolean;\r\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\r\n public readonly wiremesh: boolean;\r\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\r\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\r\n * non-planar surfaces always draw in front of those non-planar surfaces.\r\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),\r\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.\r\n */\r\n public readonly forceSurfaceDiscard: boolean;\r\n /** Whether to apply white-on-white reversal.\r\n * Some CAD applications use this to cause white geometry to be drawn as black if the view's background color is white.\r\n * When enabled, the [[DisplayStyleSettings]]' [[WhiteOnWhiteReversalSettings]] control how white-on-white reversal is applied.\r\n * Default: true.\r\n */\r\n public readonly whiteOnWhiteReversal: boolean;\r\n\r\n /** In [[RenderMode.SmoothShade]], whether to apply lighting to surfaces.\r\n * Default: false, except when using [[fromJSON]].\r\n * @see [[DisplayStyleSettings.lights]] to customize the light settings.\r\n */\r\n public readonly lighting: boolean;\r\n\r\n /** Create a new ViewFlags.\r\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\r\n */\r\n public constructor(flags?: Partial<ViewFlagsProperties>) {\r\n this.renderMode = flags?.renderMode ?? RenderMode.Wireframe;\r\n this.dimensions = flags?.dimensions ?? true;\r\n this.patterns = flags?.patterns ?? true;\r\n this.weights = flags?.weights ?? true;\r\n this.styles = flags?.styles ?? true;\r\n this.transparency = flags?.transparency ?? true;\r\n this.fill = flags?.fill ?? true;\r\n this.textures = flags?.textures ?? true;\r\n this.materials = flags?.materials ?? true;\r\n this.acsTriad = flags?.acsTriad ?? false;\r\n this.grid = flags?.grid ?? false;\r\n this.visibleEdges = flags?.visibleEdges ?? false;\r\n this.hiddenEdges = flags?.hiddenEdges ?? false;\r\n this.shadows = flags?.shadows ?? false;\r\n this.clipVolume = flags?.clipVolume ?? true;\r\n this.constructions = flags?.constructions ?? false;\r\n this.monochrome = flags?.monochrome ?? false;\r\n this.backgroundMap = flags?.backgroundMap ?? false;\r\n this.ambientOcclusion = flags?.ambientOcclusion ?? false;\r\n this.thematicDisplay = flags?.thematicDisplay ?? false;\r\n this.wiremesh = flags?.wiremesh ?? false;\r\n this.forceSurfaceDiscard = flags?.forceSurfaceDiscard ?? false;\r\n this.whiteOnWhiteReversal = flags?.whiteOnWhiteReversal ?? true;\r\n this.lighting = flags?.lighting ?? false;\r\n }\r\n\r\n /** Produce a copy of these ViewFlags with some modified properties. Any properties not explicitly specified by `changedFlags` will retain their current values.\r\n * @param changedFlags Properties to modify.\r\n * @returns A copy of these ViewFlags modified according to the supplied properties.\r\n * @note Any explicitly `undefined` property of `changedFlags` will be set to its default value in the returned ViewFlags.\r\n * @see [[override]] to have `undefined` properties retain their current values.\r\n */\r\n public copy(changedFlags: Partial<ViewFlagsProperties>): ViewFlags {\r\n return JsonUtils.isNonEmptyObject(changedFlags) ? new ViewFlags({ ...this, ...changedFlags }) : this;\r\n }\r\n\r\n /** Produce a copy of these ViewFlags, overriding some of its properties. Any properties not explicitly specified by `overrides` will retain their current values,\r\n * as will any property explicitly set to `undefined`.\r\n * @param overrides The properties to override.\r\n * @see [[copy]] to have `undefined` properties reset to their default values.\r\n */\r\n public override(overrides: Partial<ViewFlagsProperties>): ViewFlags {\r\n // This method can get called very frequently when a RenderTimeline script is applied to the view. Often `overrides` will be an empty object.\r\n // To optimize:\r\n // - Bail as quickly as possible if nothing is actually overridden, without allocating a new ViewFlags.\r\n // - Only make a copy of the input if at least one property is explicitly `undefined`.\r\n let copied = false;\r\n let anyOverridden = false;\r\n\r\n for (const propName of Object.keys(overrides)) {\r\n const key = propName as keyof Partial<ViewFlagsProperties>;\r\n const overrideValue = overrides[key];\r\n if (undefined === overrideValue) {\r\n if (!copied) {\r\n // Don't modify input...\r\n overrides = { ...overrides };\r\n copied = true;\r\n }\r\n\r\n // `undefined` means \"retain existing value\".\r\n delete overrides[key];\r\n } else if (overrideValue !== this[key]) {\r\n anyOverridden = true;\r\n }\r\n }\r\n\r\n return anyOverridden ? this.copy(overrides) : this;\r\n }\r\n\r\n /** Produce a copy of these ViewFlags with a single boolean property changed.\r\n * @param flag The name of the property.\r\n * @param value The value to change the property to.\r\n * @returns A new ViewFlags with the property changed as specified, or `this` if the property already has the specified value.\r\n * @see [[withRenderMode]] to change the [[renderMode]] property.\r\n * @see [[copy]] and [[override]] to change multiple properties.\r\n */\r\n public with(flag: keyof Omit<ViewFlagsProperties, \"renderMode\">, value: boolean): ViewFlags {\r\n if (this[flag] === value)\r\n return this;\r\n\r\n const props: ViewFlagsProperties = { ...this };\r\n props[flag] = value;\r\n return new ViewFlags(props);\r\n }\r\n\r\n /** Produce a copy of these ViewFlags with a different [[renderMode]].\r\n * @param renderMode The new render mode.\r\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.\r\n * @see [[copy]] and [[override]] to change multiple properties.\r\n */\r\n public withRenderMode(renderMode: RenderMode): ViewFlags {\r\n return renderMode === this.renderMode ? this : this.copy({ renderMode });\r\n }\r\n\r\n /** Adjust view flags for renderer.\r\n * @internal\r\n */\r\n public normalize(): ViewFlags {\r\n switch (this.renderMode) {\r\n case RenderMode.Wireframe:\r\n if (this.visibleEdges || this.hiddenEdges)\r\n return this.copy({ visibleEdges: false, hiddenEdges: false });\r\n break;\r\n case RenderMode.SmoothShade:\r\n if (!this.visibleEdges)\r\n return this.copy({ hiddenEdges: false });\r\n break;\r\n case RenderMode.HiddenLine:\r\n case RenderMode.SolidFill:\r\n if (!this.visibleEdges || this.transparency)\r\n return this.copy({ visibleEdges: true, transparency: false });\r\n break;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */\r\n public hiddenEdgesVisible(): boolean {\r\n switch (this.renderMode) {\r\n case RenderMode.SolidFill:\r\n case RenderMode.HiddenLine:\r\n return this.hiddenEdges;\r\n case RenderMode.SmoothShade:\r\n return this.visibleEdges && this.hiddenEdges;\r\n }\r\n return true;\r\n }\r\n\r\n /** Returns true if the edges of surfaces should be displayed, based on [[RenderMode]] and the [[visibleEdges]] flag. */\r\n public edgesRequired(): boolean {\r\n return edgesRequired(this.renderMode, this.visibleEdges);\r\n }\r\n\r\n /** Convert to JSON representation.\r\n * Properties are omitted if they match the default values.\r\n */\r\n public toJSON(): ViewFlagProps {\r\n const out: ViewFlagProps = {};\r\n if (!this.constructions)\r\n out.noConstruct = true;\r\n if (!this.dimensions)\r\n out.noDim = true;\r\n if (!this.patterns)\r\n out.noPattern = true;\r\n if (!this.weights)\r\n out.noWeight = true;\r\n if (!this.styles)\r\n out.noStyle = true;\r\n if (!this.transparency)\r\n out.noTransp = true;\r\n if (!this.fill)\r\n out.noFill = true;\r\n if (this.grid)\r\n out.grid = true;\r\n if (this.acsTriad)\r\n out.acs = true;\r\n if (!this.textures)\r\n out.noTexture = true;\r\n if (!this.materials)\r\n out.noMaterial = true;\r\n if (!this.lighting)\r\n out.noCameraLights = out.noSourceLights = out.noSolarLight = true;\r\n if (this.visibleEdges)\r\n out.visEdges = true;\r\n if (this.hiddenEdges)\r\n out.hidEdges = true;\r\n if (this.shadows)\r\n out.shadows = true;\r\n if (this.clipVolume)\r\n out.clipVol = true;\r\n if (this.monochrome)\r\n out.monochrome = true;\r\n if (this.backgroundMap)\r\n out.backgroundMap = true;\r\n if (this.ambientOcclusion)\r\n out.ambientOcclusion = true;\r\n if (this.thematicDisplay)\r\n out.thematicDisplay = true;\r\n if (this.wiremesh)\r\n out.wiremesh = true;\r\n if (this.forceSurfaceDiscard)\r\n out.forceSurfaceDiscard = true;\r\n if (!this.whiteOnWhiteReversal)\r\n out.noWhiteOnWhiteReversal = true;\r\n\r\n out.renderMode = this.renderMode;\r\n return out;\r\n }\r\n\r\n /** Like [[toJSON]], but no properties are omitted. */\r\n public toFullyDefinedJSON(): Required<ViewFlagProps> {\r\n return {\r\n renderMode: this.renderMode,\r\n noConstruct: !this.constructions,\r\n noDim: !this.dimensions,\r\n noPattern: !this.patterns,\r\n noWeight: !this.weights,\r\n noStyle: !this.styles,\r\n noTransp: !this.transparency,\r\n noFill: !this.fill,\r\n grid: this.grid,\r\n acs: this.acsTriad,\r\n noTexture: !this.textures,\r\n noMaterial: !this.materials,\r\n noCameraLights: !this.lighting,\r\n noSourceLights: !this.lighting,\r\n noSolarLight: !this.lighting,\r\n visEdges: this.visibleEdges,\r\n hidEdges: this.hiddenEdges,\r\n shadows: this.shadows,\r\n clipVol: this.clipVolume,\r\n monochrome: this.monochrome,\r\n backgroundMap: this.backgroundMap,\r\n ambientOcclusion: this.ambientOcclusion,\r\n thematicDisplay: this.thematicDisplay,\r\n wiremesh: this.wiremesh,\r\n forceSurfaceDiscard: this.forceSurfaceDiscard,\r\n noWhiteOnWhiteReversal: !this.whiteOnWhiteReversal,\r\n };\r\n }\r\n\r\n /** A ViewFlags object with all properties initialized to their default values. */\r\n public static readonly defaults = new ViewFlags();\r\n\r\n /** Create a ViewFlags.\r\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\r\n */\r\n public static create(flags?: Partial<ViewFlagsProperties>): ViewFlags {\r\n return flags && !JsonUtils.isEmptyObject(flags) ? new ViewFlags(flags) : this.defaults;\r\n }\r\n\r\n /** Create a ViewFlags from its JSON representation.\r\n * @note As described in [[ViewFlagProps]], the JSON representation is awkward and error-prone. Prefer to use [[create]] unless you\r\n * need to deal with the persistence format directly.\r\n * @note The default values differ slightly from those used by the constructor and [[create]]:\r\n * - [[clipVolume]] defaults to false.\r\n * - [[constructions]] defaults to true.\r\n * - [[lighting]] defaults to true unless all of [[ViewFlagProps.noSolarLight]], [[ViewFlagProps.noCameraLights]], and [[ViewFlagProps.noSourceLights]] are true.\r\n */\r\n public static fromJSON(json?: ViewFlagProps): ViewFlags {\r\n if (!json)\r\n return this.defaults;\r\n\r\n let renderMode: RenderMode;\r\n const renderModeValue = JsonUtils.asInt(json.renderMode);\r\n if (renderModeValue < RenderMode.HiddenLine)\r\n renderMode = RenderMode.Wireframe;\r\n else if (renderModeValue > RenderMode.SolidFill)\r\n renderMode = RenderMode.SmoothShade;\r\n else\r\n renderMode = renderModeValue;\r\n\r\n const lighting = !JsonUtils.asBool(json.noCameraLights) || !JsonUtils.asBool(json.noSourceLights) || !JsonUtils.asBool(json.noSolarLight);\r\n return new ViewFlags({\r\n renderMode,\r\n lighting,\r\n constructions: !JsonUtils.asBool(json.noConstruct),\r\n dimensions: !JsonUtils.asBool(json.noDim),\r\n patterns: !JsonUtils.asBool(json.noPattern),\r\n weights: !JsonUtils.asBool(json.noWeight),\r\n styles: !JsonUtils.asBool(json.noStyle),\r\n transparency: !JsonUtils.asBool(json.noTransp),\r\n fill: !JsonUtils.asBool(json.noFill),\r\n grid: JsonUtils.asBool(json.grid),\r\n acsTriad: JsonUtils.asBool(json.acs),\r\n textures: !JsonUtils.asBool(json.noTexture),\r\n materials: !JsonUtils.asBool(json.noMaterial),\r\n visibleEdges: JsonUtils.asBool(json.visEdges),\r\n hiddenEdges: JsonUtils.asBool(json.hidEdges),\r\n shadows: JsonUtils.asBool(json.shadows),\r\n clipVolume: JsonUtils.asBool(json.clipVol),\r\n monochrome: JsonUtils.asBool(json.monochrome),\r\n backgroundMap: JsonUtils.asBool(json.backgroundMap),\r\n ambientOcclusion: JsonUtils.asBool(json.ambientOcclusion),\r\n thematicDisplay: JsonUtils.asBool(json.thematicDisplay),\r\n wiremesh: JsonUtils.asBool(json.wiremesh),\r\n forceSurfaceDiscard: JsonUtils.asBool(json.forceSurfaceDiscard),\r\n whiteOnWhiteReversal: !JsonUtils.asBool(json.noWhiteOnWhiteReversal),\r\n });\r\n }\r\n\r\n /** Returns true if `this` and `other` are equivalent. */\r\n public equals(other: Readonly<ViewFlagsProperties>): boolean {\r\n if (this === other)\r\n return true;\r\n\r\n return this.renderMode === other.renderMode\r\n && this.dimensions === other.dimensions\r\n && this.patterns === other.patterns\r\n && this.weights === other.weights\r\n && this.styles === other.styles\r\n && this.transparency === other.transparency\r\n && this.fill === other.fill\r\n && this.textures === other.textures\r\n && this.materials === other.materials\r\n && this.acsTriad === other.acsTriad\r\n && this.grid === other.grid\r\n && this.visibleEdges === other.visibleEdges\r\n && this.hiddenEdges === other.hiddenEdges\r\n && this.lighting === other.lighting\r\n && this.shadows === other.shadows\r\n && this.clipVolume === other.clipVolume\r\n && this.constructions === other.constructions\r\n && this.monochrome === other.monochrome\r\n && this.backgroundMap === other.backgroundMap\r\n && this.ambientOcclusion === other.ambientOcclusion\r\n && this.thematicDisplay === other.thematicDisplay\r\n && this.wiremesh === other.wiremesh\r\n && this.forceSurfaceDiscard === other.forceSurfaceDiscard\r\n && this.whiteOnWhiteReversal === other.whiteOnWhiteReversal;\r\n }\r\n}\r\n\r\n/** A type containing all of the properties of [[ViewFlags]] with none of the methods and with the `readonly` modifiers removed.\r\n * @see [[ViewFlags.create]], [[ViewFlags.copy]], and [[ViewFlags.override]] for methods accepting an object of this type.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ViewFlagsProperties = Mutable<NonFunctionPropertiesOf<ViewFlags>>;\r\n\r\n/** A type that describes how to override selected properties of a [[ViewFlags]].\r\n * @see [[ViewFlags.override]] to apply the overrides to a ViewFlags object.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ViewFlagOverrides = Partial<ViewFlagsProperties>;\r\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;IAsFpB;;OAEG;IACH,YAAmB,KAAoC;QACrD,IAAI,CAAC,UAAU,GAAG,KAAK,EAAE,UAAU,IAAI,UAAU,CAAC,SAAS,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,KAAK,EAAE,UAAU,IAAI,IAAI,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,IAAI,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,IAAI,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,KAAK,EAAE,YA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AY,KAAK,KAAK,CAAC,YAAY;eACxC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;eACxB,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS;eAClC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;eACxB,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY;eACxC,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;eACtC,IAAI,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;;AAzFD,kFAAkF;AAC3D,kBAAQ,GAAG,IAAI,SAAS,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\n// cspell:ignore ovrs\r\n\r\nimport { JsonUtils, Mutable, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\r\n\r\n/** Enumerates the available basic rendering modes, as part of a [DisplayStyle]($backend)'s [[ViewFlags]].\r\n * The rendering mode broadly affects various aspects of the display style - in particular, whether and how surfaces and their edges are drawn.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum RenderMode {\r\n /** Renders only the edges of surfaces, with exceptions for planar regions based on their [[FillFlags]].\r\n * Lighting (and by extension, shadows) is not applied.\r\n * [[HiddenLine.Settings]] are not applied - edges use the elements' width, style, and color.\r\n * [[ViewFlags.hiddenEdges]] is ignored - hidden edges are never displayed in wireframe mode.\r\n */\r\n Wireframe = 0,\r\n /** By default, renders surfaces without their edges.\r\n * Lighting and shadows can be applied using [[ViewFlags.lighting]] and [[ViewFlags.shadows]].\r\n * Edges can be enabled using [[ViewFlags.visibleEdges]] and [[ViewFlags.hiddenEdges]], and their appearance customized using [[HiddenLine.Settings]].\r\n * Surfaces can be drawn with transparency, based on [[ViewFlags.transparency]].\r\n */\r\n SmoothShade = 6,\r\n /** Renders surfaces and their edges. By default, edges are drawn in white; this can be overridden using [[HiddenLine.Settings]].\r\n * All surfaces are rendered opaque. If a surface's transparency is below that specified by [[HiddenLine.Settings.transparencyThreshold]], it is not rendered.\r\n * Materials and textures are not applied - surfaces are drawn in their actual colors.\r\n * [[ViewFlags.visibleEdges]] is ignored - visible edges are always drawn. Hidden edges can be enabled using [[ViewFlags.hiddenEdges]].\r\n * Lighting (and by extension, shadows) is not applied.\r\n */\r\n SolidFill = 4,\r\n /** Identical to [[RenderMode.SolidFill]], except:\r\n * - Surfaces are drawn using the [DisplayStyle]($backend)'s background color.\r\n * - Edges are drawn using their surface's colors; this can be overridden using [[HiddenLine.Settings]].\r\n */\r\n HiddenLine = 3,\r\n}\r\n\r\n/** JSON representation of [[ViewFlags]].\r\n * This is a persistence format with some unfortunate quirks that have been retained for backwards compatibility.\r\n * In particular, it supplies three separate flags intended to control lighting - [[noCameraLights]], [[noSourceLights]], and [[noSolarLight]] -\r\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.\r\n * It also uses awkward negative ([[noConstruct]], [[noTransp]]) and/or abbreviated ([[clipVol]], [[visEdges]]) property names that differ from\r\n * those of the corresponding [[ViewFlags]] properties, making usage of this type in code error-prone.\r\n * Prefer to use [[ViewFlagsProperties]] unless you need to work directly with the persistence format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewFlagProps {\r\n /** If true, don't display geometry of class [[GeometryClass.Construction]]. */\r\n noConstruct?: boolean;\r\n /** If true, don't display geometry of class [[GeometryClass.Dimension]]. */\r\n noDim?: boolean;\r\n /** If true, don't display geometry of class [[GeometryClass.Pattern]]. */\r\n noPattern?: boolean;\r\n /** If true, all lines are drawn with a width of 1 pixel. */\r\n noWeight?: boolean;\r\n /** If true, don't apply [[LinePixels]] styles. */\r\n noStyle?: boolean;\r\n /** If true, display transparency geometry as opaque. */\r\n noTransp?: boolean;\r\n /** If true, don't show filled planar regions, unless they use [[FillFlags.Always]]. */\r\n noFill?: boolean;\r\n /** If true, display a grid in the view. */\r\n grid?: boolean;\r\n /** If true, display graphics representing the [AuxCoordSystem]($backend). */\r\n acs?: boolean;\r\n /** If true, don't apply [[RenderTexture]]s to surfaces. */\r\n noTexture?: boolean;\r\n /** If true, don't apply [[RenderMaterial]]s to surfaces. */\r\n noMaterial?: boolean;\r\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\r\n noCameraLights?: boolean;\r\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\r\n noSourceLights?: boolean;\r\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\r\n noSolarLight?: boolean;\r\n /** If true, display the edges of surfaces. */\r\n visEdges?: boolean;\r\n /** If true, display the edges of surfaces, even if they are behind other geometry. */\r\n hidEdges?: boolean;\r\n /** If true, display shadows. */\r\n shadows?: boolean;\r\n /** If true, apply the view's clipping volume. Has no effect on other types of clips like [[ModelClipGroups]]. */\r\n clipVol?: boolean;\r\n /** If true, apply the view's [[DisplayStyleSettings.monochromeColor]] and [[DisplayStyleSettings.monochromeMode]] to produce a monochrome image. */\r\n monochrome?: boolean;\r\n /** The basic rendering mode, which affects the behavior of other flags. */\r\n renderMode?: RenderMode;\r\n /** Display a background map. */\r\n backgroundMap?: boolean;\r\n /** If true, apply [[AmbientOcclusion]]. */\r\n ambientOcclusion?: boolean;\r\n /** If true, apply [[ThematicDisplay]]. */\r\n thematicDisplay?: boolean;\r\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\r\n wiremesh?: boolean;\r\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\r\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\r\n * non-planar surfaces always draw in front of those non-planar surfaces.\r\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),\r\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.\r\n */\r\n forceSurfaceDiscard?: boolean;\r\n /** Disables the \"white-on-white reversal\" employed by some CAD applications.\r\n * @see [[ViewFlags.whiteOnWhiteReversal]].\r\n */\r\n noWhiteOnWhiteReversal?: boolean;\r\n}\r\n\r\nfunction edgesRequired(renderMode: RenderMode, visibleEdges: boolean): boolean {\r\n return visibleEdges || RenderMode.SmoothShade !== renderMode;\r\n}\r\n\r\n/** Flags controlling how graphics appear within a view.\r\n * A [[ViewFlags]] object is immutable. There are several ways to produce a modified copy of a ViewFlags object:\r\n * ```ts\r\n * // Start with the default values for all properties.\r\n * let vf = ViewFlags.defaults;\r\n * // Change a single boolean property:\r\n * vf = vf.with(\"visibleEdges\", true);\r\n * // Change only the render mode:\r\n * vf = vf.withRenderMode(RenderMode.HiddenLine);\r\n * // Change multiple properties:\r\n * vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });\r\n * // Reset multiple properties to their default values:\r\n * vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });\r\n *\r\n * ```\r\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\r\n * the new value differs from the current value.\r\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\r\n * each call to [[with]] or [[withRenderMode]] potentially creating a new object.\r\n * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).\r\n * @public\r\n */\r\nexport class ViewFlags {\r\n /** The basic rendering mode applied to the view. This modulates the behavior of some of the other flags.\r\n * Default: [[RenderMode.Wireframe]].\r\n * @see [[RenderMode]] for details.\r\n */\r\n public readonly renderMode: RenderMode;\r\n /** Whether to display geometry of class [[GeometryClass.Dimension]]. Default: true. */\r\n public readonly dimensions: boolean;\r\n /** Whether to display geometry of class [[GeometryClass.Pattern]]. Default: true. */\r\n public readonly patterns: boolean;\r\n /** Whether to allow lines and edges to draw with width greater than one pixel. Default: true. */\r\n public readonly weights: boolean;\r\n /** Whether [[LinePixels]] are allowed to apply patterns to lines and edges. If false, they all draw as solid lines. Default: true. */\r\n public readonly styles: boolean;\r\n /** Whether element transparency is applied. If false, transparent geometry is drawn opaque. Default: true.\r\n * @see [[RenderMode]] for render mode-specific behavior.\r\n */\r\n public readonly transparency: boolean;\r\n /** In [[RenderMode.Wireframe]] only, whether to display the interiors of planar regions with [[FillFlags.ByView]]. Default: true. */\r\n public readonly fill: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderTexture]]s to surfaces. Default: true. */\r\n public readonly textures: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderMaterial]]s to surfaces. Default: true. */\r\n public readonly materials: boolean;\r\n /** Whether to display a graphical representation of the view's [AuxCoordSystem]($backend). Default: false. */\r\n public readonly acsTriad: boolean;\r\n /** Whether to display a grid. Default: false. */\r\n public readonly grid: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to display the edges of surfaces. Default: false.\r\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\r\n */\r\n public readonly visibleEdges: boolean;\r\n /** In any mode except [[RenderMode.Wireframe]], whether to display the edges of surfaces occluded by other geometry.\r\n * This has no effect unless [[visibleEdges]] is also true.\r\n * Default: false.\r\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\r\n */\r\n public readonly hiddenEdges: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to display solar shadows. This has no effect unless [[lighting]] is also true. Default: false.\r\n * @note Rendering shadows can reduce framerate, particularly on less capable graphics hardware or in complex scenes.\r\n */\r\n public readonly shadows: boolean;\r\n /** Whether to apply the view's clip volume to the geometry in the scene.\r\n * Default: true, except when using [[fromJSON]].\r\n * @see [[ViewDetails.clipVector]] to define the view's clip volume.\r\n */\r\n public readonly clipVolume: boolean;\r\n /** Whether to display geometry of class [[GeometryClass.Construction]].\r\n * Default: false, except when using [[fromJSON]].\r\n */\r\n public readonly constructions: boolean;\r\n /** Whether to produce a monochrome image. Default: false.\r\n * @see [DisplayStyleSettings.monochromeColor]($common) to define the monochrome color.\r\n * @see [DisplayStyleSettings.monochromeMode]($common) to define how the monochrome image is produced.\r\n */\r\n public readonly monochrome: boolean;\r\n /** Whether to display background map imagery. Default: false.\r\n * @see [[DisplayStyleSettings.backgroundMap]] to customize the map settings.\r\n */\r\n public readonly backgroundMap: boolean;\r\n /** In [[RenderMode.SmoothShade]], whether to apply [[AmbientOcclusion]]. Default: false. */\r\n public readonly ambientOcclusion: boolean;\r\n /** Whether to apply [[ThematicDisplay]]. Default: false. */\r\n public readonly thematicDisplay: boolean;\r\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\r\n public readonly wiremesh: boolean;\r\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\r\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\r\n * non-planar surfaces always draw in front of those non-planar surfaces.\r\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),\r\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.\r\n */\r\n public readonly forceSurfaceDiscard: boolean;\r\n /** Whether to apply white-on-white reversal.\r\n * Some CAD applications use this to cause white geometry to be drawn as black if the view's background color is white.\r\n * When enabled, the [[DisplayStyleSettings]]' [[WhiteOnWhiteReversalSettings]] control how white-on-white reversal is applied.\r\n * Default: true.\r\n */\r\n public readonly whiteOnWhiteReversal: boolean;\r\n\r\n /** In [[RenderMode.SmoothShade]], whether to apply lighting to surfaces.\r\n * Default: false, except when using [[fromJSON]].\r\n * @see [[DisplayStyleSettings.lights]] to customize the light settings.\r\n */\r\n public readonly lighting: boolean;\r\n\r\n /** Create a new ViewFlags.\r\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\r\n */\r\n public constructor(flags?: Partial<ViewFlagsProperties>) {\r\n this.renderMode = flags?.renderMode ?? RenderMode.Wireframe;\r\n this.dimensions = flags?.dimensions ?? true;\r\n this.patterns = flags?.patterns ?? true;\r\n this.weights = flags?.weights ?? true;\r\n this.styles = flags?.styles ?? true;\r\n this.transparency = flags?.transparency ?? true;\r\n this.fill = flags?.fill ?? true;\r\n this.textures = flags?.textures ?? true;\r\n this.materials = flags?.materials ?? true;\r\n this.acsTriad = flags?.acsTriad ?? false;\r\n this.grid = flags?.grid ?? false;\r\n this.visibleEdges = flags?.visibleEdges ?? false;\r\n this.hiddenEdges = flags?.hiddenEdges ?? false;\r\n this.shadows = flags?.shadows ?? false;\r\n this.clipVolume = flags?.clipVolume ?? true;\r\n this.constructions = flags?.constructions ?? false;\r\n this.monochrome = flags?.monochrome ?? false;\r\n this.backgroundMap = flags?.backgroundMap ?? false;\r\n this.ambientOcclusion = flags?.ambientOcclusion ?? false;\r\n this.thematicDisplay = flags?.thematicDisplay ?? false;\r\n this.wiremesh = flags?.wiremesh ?? false;\r\n this.forceSurfaceDiscard = flags?.forceSurfaceDiscard ?? false;\r\n this.whiteOnWhiteReversal = flags?.whiteOnWhiteReversal ?? true;\r\n this.lighting = flags?.lighting ?? false;\r\n }\r\n\r\n /** Produce a copy of these ViewFlags with some modified properties. Any properties not explicitly specified by `changedFlags` will retain their current values.\r\n * @param changedFlags Properties to modify.\r\n * @returns A copy of these ViewFlags modified according to the supplied properties.\r\n * @note Any explicitly `undefined` property of `changedFlags` will be set to its default value in the returned ViewFlags.\r\n * @see [[override]] to have `undefined` properties retain their current values.\r\n */\r\n public copy(changedFlags: Partial<ViewFlagsProperties>): ViewFlags {\r\n return JsonUtils.isNonEmptyObject(changedFlags) ? new ViewFlags({ ...this, ...changedFlags }) : this;\r\n }\r\n\r\n /** Produce a copy of these ViewFlags, overriding some of its properties. Any properties not explicitly specified by `overrides` will retain their current values,\r\n * as will any property explicitly set to `undefined`.\r\n * @param overrides The properties to override.\r\n * @see [[copy]] to have `undefined` properties reset to their default values.\r\n */\r\n public override(overrides: Partial<ViewFlagsProperties>): ViewFlags {\r\n // This method can get called very frequently when a RenderTimeline script is applied to the view. Often `overrides` will be an empty object.\r\n // To optimize:\r\n // - Bail as quickly as possible if nothing is actually overridden, without allocating a new ViewFlags.\r\n // - Only make a copy of the input if at least one property is explicitly `undefined`.\r\n let copied = false;\r\n let anyOverridden = false;\r\n\r\n for (const propName of Object.keys(overrides)) {\r\n const key = propName as keyof Partial<ViewFlagsProperties>;\r\n const overrideValue = overrides[key];\r\n if (undefined === overrideValue) {\r\n if (!copied) {\r\n // Don't modify input...\r\n overrides = { ...overrides };\r\n copied = true;\r\n }\r\n\r\n // `undefined` means \"retain existing value\".\r\n delete overrides[key];\r\n } else if (overrideValue !== this[key]) {\r\n anyOverridden = true;\r\n }\r\n }\r\n\r\n return anyOverridden ? this.copy(overrides) : this;\r\n }\r\n\r\n /** Produce a copy of these ViewFlags with a single boolean property changed.\r\n * @param flag The name of the property.\r\n * @param value The value to change the property to.\r\n * @returns A new ViewFlags with the property changed as specified, or `this` if the property already has the specified value.\r\n * @see [[withRenderMode]] to change the [[renderMode]] property.\r\n * @see [[copy]] and [[override]] to change multiple properties.\r\n */\r\n public with(flag: keyof Omit<ViewFlagsProperties, \"renderMode\">, value: boolean): ViewFlags {\r\n if (this[flag] === value)\r\n return this;\r\n\r\n const props: ViewFlagsProperties = { ...this };\r\n props[flag] = value;\r\n return new ViewFlags(props);\r\n }\r\n\r\n /** Produce a copy of these ViewFlags with a different [[renderMode]].\r\n * @param renderMode The new render mode.\r\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.\r\n * @see [[copy]] and [[override]] to change multiple properties.\r\n */\r\n public withRenderMode(renderMode: RenderMode): ViewFlags {\r\n return renderMode === this.renderMode ? this : this.copy({ renderMode });\r\n }\r\n\r\n /** Adjust view flags for renderer.\r\n * @internal\r\n */\r\n public normalize(): ViewFlags {\r\n switch (this.renderMode) {\r\n case RenderMode.Wireframe:\r\n if (this.visibleEdges || this.hiddenEdges)\r\n return this.copy({ visibleEdges: false, hiddenEdges: false });\r\n break;\r\n case RenderMode.SmoothShade:\r\n if (!this.visibleEdges)\r\n return this.copy({ hiddenEdges: false });\r\n break;\r\n case RenderMode.HiddenLine:\r\n case RenderMode.SolidFill:\r\n if (!this.visibleEdges || this.transparency)\r\n return this.copy({ visibleEdges: true, transparency: false });\r\n break;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */\r\n public hiddenEdgesVisible(): boolean {\r\n switch (this.renderMode) {\r\n case RenderMode.SolidFill:\r\n case RenderMode.HiddenLine:\r\n return this.hiddenEdges;\r\n case RenderMode.SmoothShade:\r\n return this.visibleEdges && this.hiddenEdges;\r\n }\r\n return true;\r\n }\r\n\r\n /** Returns true if the edges of surfaces should be displayed, based on [[RenderMode]] and the [[visibleEdges]] flag. */\r\n public edgesRequired(): boolean {\r\n return edgesRequired(this.renderMode, this.visibleEdges);\r\n }\r\n\r\n /** Convert to JSON representation.\r\n * Properties are omitted if they match the default values.\r\n */\r\n public toJSON(): ViewFlagProps {\r\n const out: ViewFlagProps = {};\r\n if (!this.constructions)\r\n out.noConstruct = true;\r\n if (!this.dimensions)\r\n out.noDim = true;\r\n if (!this.patterns)\r\n out.noPattern = true;\r\n if (!this.weights)\r\n out.noWeight = true;\r\n if (!this.styles)\r\n out.noStyle = true;\r\n if (!this.transparency)\r\n out.noTransp = true;\r\n if (!this.fill)\r\n out.noFill = true;\r\n if (this.grid)\r\n out.grid = true;\r\n if (this.acsTriad)\r\n out.acs = true;\r\n if (!this.textures)\r\n out.noTexture = true;\r\n if (!this.materials)\r\n out.noMaterial = true;\r\n if (!this.lighting)\r\n out.noCameraLights = out.noSourceLights = out.noSolarLight = true;\r\n if (this.visibleEdges)\r\n out.visEdges = true;\r\n if (this.hiddenEdges)\r\n out.hidEdges = true;\r\n if (this.shadows)\r\n out.shadows = true;\r\n if (this.clipVolume)\r\n out.clipVol = true;\r\n if (this.monochrome)\r\n out.monochrome = true;\r\n if (this.backgroundMap)\r\n out.backgroundMap = true;\r\n if (this.ambientOcclusion)\r\n out.ambientOcclusion = true;\r\n if (this.thematicDisplay)\r\n out.thematicDisplay = true;\r\n if (this.wiremesh)\r\n out.wiremesh = true;\r\n if (this.forceSurfaceDiscard)\r\n out.forceSurfaceDiscard = true;\r\n if (!this.whiteOnWhiteReversal)\r\n out.noWhiteOnWhiteReversal = true;\r\n\r\n out.renderMode = this.renderMode;\r\n return out;\r\n }\r\n\r\n /** Like [[toJSON]], but no properties are omitted. */\r\n public toFullyDefinedJSON(): Required<ViewFlagProps> {\r\n return {\r\n renderMode: this.renderMode,\r\n noConstruct: !this.constructions,\r\n noDim: !this.dimensions,\r\n noPattern: !this.patterns,\r\n noWeight: !this.weights,\r\n noStyle: !this.styles,\r\n noTransp: !this.transparency,\r\n noFill: !this.fill,\r\n grid: this.grid,\r\n acs: this.acsTriad,\r\n noTexture: !this.textures,\r\n noMaterial: !this.materials,\r\n noCameraLights: !this.lighting,\r\n noSourceLights: !this.lighting,\r\n noSolarLight: !this.lighting,\r\n visEdges: this.visibleEdges,\r\n hidEdges: this.hiddenEdges,\r\n shadows: this.shadows,\r\n clipVol: this.clipVolume,\r\n monochrome: this.monochrome,\r\n backgroundMap: this.backgroundMap,\r\n ambientOcclusion: this.ambientOcclusion,\r\n thematicDisplay: this.thematicDisplay,\r\n wiremesh: this.wiremesh,\r\n forceSurfaceDiscard: this.forceSurfaceDiscard,\r\n noWhiteOnWhiteReversal: !this.whiteOnWhiteReversal,\r\n };\r\n }\r\n\r\n /** A ViewFlags object with all properties initialized to their default values. */\r\n public static readonly defaults = new ViewFlags();\r\n\r\n /** Create a ViewFlags.\r\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\r\n */\r\n public static create(flags?: Partial<ViewFlagsProperties>): ViewFlags {\r\n return flags && !JsonUtils.isEmptyObject(flags) ? new ViewFlags(flags) : this.defaults;\r\n }\r\n\r\n /** Create a ViewFlags from its JSON representation.\r\n * @note As described in [[ViewFlagProps]], the JSON representation is awkward and error-prone. Prefer to use [[create]] unless you\r\n * need to deal with the persistence format directly.\r\n * @note The default values differ slightly from those used by the constructor and [[create]]:\r\n * - [[clipVolume]] defaults to false.\r\n * - [[constructions]] defaults to true.\r\n * - [[lighting]] defaults to true unless all of [[ViewFlagProps.noSolarLight]], [[ViewFlagProps.noCameraLights]], and [[ViewFlagProps.noSourceLights]] are true.\r\n */\r\n public static fromJSON(json?: ViewFlagProps): ViewFlags {\r\n if (!json)\r\n return this.defaults;\r\n\r\n let renderMode: RenderMode;\r\n const renderModeValue = JsonUtils.asInt(json.renderMode);\r\n if (renderModeValue < RenderMode.HiddenLine)\r\n renderMode = RenderMode.Wireframe;\r\n else if (renderModeValue > RenderMode.SolidFill)\r\n renderMode = RenderMode.SmoothShade;\r\n else\r\n renderMode = renderModeValue;\r\n\r\n const lighting = !JsonUtils.asBool(json.noCameraLights) || !JsonUtils.asBool(json.noSourceLights) || !JsonUtils.asBool(json.noSolarLight);\r\n return new ViewFlags({\r\n renderMode,\r\n lighting,\r\n constructions: !JsonUtils.asBool(json.noConstruct),\r\n dimensions: !JsonUtils.asBool(json.noDim),\r\n patterns: !JsonUtils.asBool(json.noPattern),\r\n weights: !JsonUtils.asBool(json.noWeight),\r\n styles: !JsonUtils.asBool(json.noStyle),\r\n transparency: !JsonUtils.asBool(json.noTransp),\r\n fill: !JsonUtils.asBool(json.noFill),\r\n grid: JsonUtils.asBool(json.grid),\r\n acsTriad: JsonUtils.asBool(json.acs),\r\n textures: !JsonUtils.asBool(json.noTexture),\r\n materials: !JsonUtils.asBool(json.noMaterial),\r\n visibleEdges: JsonUtils.asBool(json.visEdges),\r\n hiddenEdges: JsonUtils.asBool(json.hidEdges),\r\n shadows: JsonUtils.asBool(json.shadows),\r\n clipVolume: JsonUtils.asBool(json.clipVol),\r\n monochrome: JsonUtils.asBool(json.monochrome),\r\n backgroundMap: JsonUtils.asBool(json.backgroundMap),\r\n ambientOcclusion: JsonUtils.asBool(json.ambientOcclusion),\r\n thematicDisplay: JsonUtils.asBool(json.thematicDisplay),\r\n wiremesh: JsonUtils.asBool(json.wiremesh),\r\n forceSurfaceDiscard: JsonUtils.asBool(json.forceSurfaceDiscard),\r\n whiteOnWhiteReversal: !JsonUtils.asBool(json.noWhiteOnWhiteReversal),\r\n });\r\n }\r\n\r\n /** Returns true if `this` and `other` are equivalent. */\r\n public equals(other: Readonly<ViewFlagsProperties>): boolean {\r\n if (this === other)\r\n return true;\r\n\r\n return this.renderMode === other.renderMode\r\n && this.dimensions === other.dimensions\r\n && this.patterns === other.patterns\r\n && this.weights === other.weights\r\n && this.styles === other.styles\r\n && this.transparency === other.transparency\r\n && this.fill === other.fill\r\n && this.textures === other.textures\r\n && this.materials === other.materials\r\n && this.acsTriad === other.acsTriad\r\n && this.grid === other.grid\r\n && this.visibleEdges === other.visibleEdges\r\n && this.hiddenEdges === other.hiddenEdges\r\n && this.lighting === other.lighting\r\n && this.shadows === other.shadows\r\n && this.clipVolume === other.clipVolume\r\n && this.constructions === other.constructions\r\n && this.monochrome === other.monochrome\r\n && this.backgroundMap === other.backgroundMap\r\n && this.ambientOcclusion === other.ambientOcclusion\r\n && this.thematicDisplay === other.thematicDisplay\r\n && this.wiremesh === other.wiremesh\r\n && this.forceSurfaceDiscard === other.forceSurfaceDiscard\r\n && this.whiteOnWhiteReversal === other.whiteOnWhiteReversal;\r\n }\r\n}\r\n\r\n/** A type containing all of the properties of [[ViewFlags]] with none of the methods and with the `readonly` modifiers removed.\r\n * @see [[ViewFlags.create]], [[ViewFlags.copy]], and [[ViewFlags.override]] for methods accepting an object of this type.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ViewFlagsProperties = Mutable<NonFunctionPropertiesOf<ViewFlags>>;\r\n\r\n/** A type that describes how to override selected properties of a [[ViewFlags]].\r\n * @see [[ViewFlags.override]] to apply the overrides to a ViewFlags object.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ViewFlagOverrides = Partial<ViewFlagsProperties>;\r\n"]}
@@ -12,7 +12,7 @@
12
12
  * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.
13
13
  * @public
14
14
  */
15
- class WhiteOnWhiteReversalSettings {
15
+ export class WhiteOnWhiteReversalSettings {
16
16
  constructor(ignoreBackground) {
17
17
  this.ignoreBackgroundColor = ignoreBackground;
18
18
  }
@@ -31,5 +31,4 @@ class WhiteOnWhiteReversalSettings {
31
31
  }
32
32
  WhiteOnWhiteReversalSettings._noIgnore = new WhiteOnWhiteReversalSettings(true);
33
33
  WhiteOnWhiteReversalSettings._ignore = new WhiteOnWhiteReversalSettings(false);
34
- export { WhiteOnWhiteReversalSettings };
35
34
  //# sourceMappingURL=WhiteOnWhiteReversalSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WhiteOnWhiteReversalSettings.js","sourceRoot":"","sources":["../../src/WhiteOnWhiteReversalSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;;;;;GAMG;AACH,MAAa,4BAA4B;IAOvC,YAAoB,gBAAyB;QAC3C,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;IAChD,CAAC;IAKD,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;;AAhBc,sCAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;AACnD,oCAAO,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC;SAZtD,4BAA4B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\n/** JSON representation of a [[WhiteOnWhiteReversalSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface WhiteOnWhiteReversalProps {\r\n /** Default: false.\r\n * @see [[WhiteOnWhiteReversalSettings.ignoreBackgroundColor]].\r\n */\r\n ignoreBackgroundColor?: boolean;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more\r\n * visible in the view.\r\n * By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.\r\n * These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.\r\n * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.\r\n * @public\r\n */\r\nexport class WhiteOnWhiteReversalSettings {\r\n /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only\r\n * if the background color is pure white.\r\n * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.\r\n */\r\n public readonly ignoreBackgroundColor: boolean;\r\n\r\n private constructor(ignoreBackground: boolean) {\r\n this.ignoreBackgroundColor = ignoreBackground;\r\n }\r\n\r\n private static _noIgnore = new WhiteOnWhiteReversalSettings(true);\r\n private static _ignore = new WhiteOnWhiteReversalSettings(false);\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props?: WhiteOnWhiteReversalProps): WhiteOnWhiteReversalSettings {\r\n return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;\r\n }\r\n\r\n /** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */\r\n public toJSON(): WhiteOnWhiteReversalProps | undefined {\r\n return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: WhiteOnWhiteReversalSettings): boolean {\r\n return this === other;\r\n }\r\n}\r\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;IAOvC,YAAoB,gBAAyB;QAC3C,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;IAChD,CAAC;IAKD,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;;AAhBc,sCAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;AACnD,oCAAO,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\n/** JSON representation of a [[WhiteOnWhiteReversalSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface WhiteOnWhiteReversalProps {\r\n /** Default: false.\r\n * @see [[WhiteOnWhiteReversalSettings.ignoreBackgroundColor]].\r\n */\r\n ignoreBackgroundColor?: boolean;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more\r\n * visible in the view.\r\n * By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.\r\n * These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.\r\n * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.\r\n * @public\r\n */\r\nexport class WhiteOnWhiteReversalSettings {\r\n /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only\r\n * if the background color is pure white.\r\n * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.\r\n */\r\n public readonly ignoreBackgroundColor: boolean;\r\n\r\n private constructor(ignoreBackground: boolean) {\r\n this.ignoreBackgroundColor = ignoreBackground;\r\n }\r\n\r\n private static _noIgnore = new WhiteOnWhiteReversalSettings(true);\r\n private static _ignore = new WhiteOnWhiteReversalSettings(false);\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props?: WhiteOnWhiteReversalProps): WhiteOnWhiteReversalSettings {\r\n return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;\r\n }\r\n\r\n /** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */\r\n public toJSON(): WhiteOnWhiteReversalProps | undefined {\r\n return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: WhiteOnWhiteReversalSettings): boolean {\r\n return this === other;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,107 @@
1
+ /** @packageDocumentation
2
+ * @module Annotation
3
+ */
4
+ import { Point3d, Transform, XAndY, XYZProps, YawPitchRollAngles, YawPitchRollProps } from "@itwin/core-geometry";
5
+ import { TextBlock, TextBlockProps } from "./TextBlock";
6
+ /** Describes how to compute the "anchor point" for a [[TextAnnotation]].
7
+ * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].
8
+ * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point
9
+ * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).
10
+ * @see [[TextAnnotation]] for a description of how the anchor point is computed.
11
+ * @beta
12
+ */
13
+ export interface TextAnnotationAnchor {
14
+ /**
15
+ * The vertical alignment of the anchor point.
16
+ * "top" aligns the anchor point with the top of the text's bounding box.
17
+ * "middle" aligns the anchor point with the middle of the text's bounding box.
18
+ * "bottom" aligns the anchor point with the bottom of the text's bounding box.
19
+ */
20
+ vertical: "top" | "middle" | "bottom";
21
+ /**
22
+ * The horizontal alignment of the anchor point.
23
+ * "left" aligns the anchor point with left side of the text's bounding box.
24
+ * "center" aligns the anchor point with center of the text with's bounding box.
25
+ * "right" aligns the anchor point with right side of the text's bounding box.
26
+ */
27
+ horizontal: "left" | "center" | "right";
28
+ }
29
+ /**
30
+ * JSON representation of a [[TextAnnotation]].
31
+ * @beta
32
+ */
33
+ export interface TextAnnotationProps {
34
+ /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */
35
+ offset?: XYZProps;
36
+ /** See [[TextAnnotation.orientation]]. Default: no rotation. */
37
+ orientation?: YawPitchRollProps;
38
+ /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */
39
+ textBlock?: TextBlockProps;
40
+ /** See [[TextAnnotation.anchor]]. Default: top-left. */
41
+ anchor?: TextAnnotationAnchor;
42
+ }
43
+ /** Arguments supplied to [[TextAnnotation.create]].
44
+ * @beta
45
+ */
46
+ export interface TextAnnotationCreateArgs {
47
+ /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */
48
+ offset?: Point3d;
49
+ /** See [[TextAnnotation.orientation]]. Default: no rotation. */
50
+ orientation?: YawPitchRollAngles;
51
+ /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */
52
+ textBlock?: TextBlock;
53
+ /** See [[TextAnnotation.anchor]]. Default: top-left. */
54
+ anchor?: TextAnnotationAnchor;
55
+ }
56
+ /**
57
+ * Represents a formatted block of text positioned in 2d or 3d space.
58
+ * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.
59
+ * Other types of elements may store multiple TextAnnotations, positioned relative to one another.
60
+ * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:
61
+ * - First, the width and height of a box enclosing the contents of the [[textBlock]] must be computed using [computeTextBlockExtents]($backend). This yields a box with the top-left
62
+ * corner at (0, 0) and the bottom-right corner at (width, -height).
63
+ * - Then, an "anchor point" is computed based on the text box and the [[anchor]] property. For example, if the annotation is anchored at the center-left, the anchor point will be (width/2, -height).
64
+ * - The [[orientation]] is applied to rotate the box around the anchor point.
65
+ * - Finally, the [[offset]] is added to the anchor point to apply translation.
66
+ * @see [produceTextAnnotationGeometry]($backend) to decompose the annotation into a set of geometric primitives suitable for use with [[GeometryStreamBuilder.appendTextBlock]].
67
+ * @beta
68
+ */
69
+ export declare class TextAnnotation {
70
+ /** The rotation of the annotation.
71
+ * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.
72
+ */
73
+ orientation: YawPitchRollAngles;
74
+ /** The formatted document. */
75
+ textBlock: TextBlock;
76
+ /** Describes how to compute the [[textBlock]]'s anchor point. */
77
+ anchor: TextAnnotationAnchor;
78
+ /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */
79
+ offset: Point3d;
80
+ private constructor();
81
+ /** Creates a new TextAnnotation. */
82
+ static create(args?: TextAnnotationCreateArgs): TextAnnotation;
83
+ /**
84
+ * Creates a new TextAnnotation instance from its JSON representation.
85
+ */
86
+ static fromJSON(props: TextAnnotationProps | undefined): TextAnnotation;
87
+ /**
88
+ * Converts this annotation to its JSON representation.
89
+ */
90
+ toJSON(): TextAnnotationProps;
91
+ /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.
92
+ * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored
93
+ * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.
94
+ * The text block will be rotated around the fixed anchor point according to [[orientation]], then the anchor point will be translated by [[offset]].
95
+ * @param textBlockDimensions The width and height of the bounding box containing the text block. You can compute this using [computeTextBlockExtents]($common).
96
+ * @see [[computeAnchorPoint]] to compute the transform's anchor point.
97
+ */
98
+ computeTransform(textBlockDimensions: XAndY): Transform;
99
+ /** Compute the anchor point of this annotation as specified by [[anchor]].
100
+ * @param textBlockDimensions The width and height of the bounding box containing the [[textBlock]]. You can compute this using [computeTextBlockExtents]($common).
101
+ * @see [[computeTransform]] to compute the transform relative to the anchor point.
102
+ */
103
+ computeAnchorPoint(textBlockDimensions: XAndY): Point3d;
104
+ /** Returns true if this annotation is logically equivalent to `other`. */
105
+ equals(other: TextAnnotation): boolean;
106
+ }
107
+ //# sourceMappingURL=TextAnnotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnnotation.d.ts","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAEtC;;;;;OAKG;IACH,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,gEAAgE;IAChE,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,sEAAsE;IACtE,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,sEAAsE;IACtE,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACI,WAAW,EAAE,kBAAkB,CAAC;IACvC,8BAA8B;IACvB,SAAS,EAAE,SAAS,CAAC;IAC5B,iEAAiE;IAC1D,MAAM,EAAE,oBAAoB,CAAC;IACpC,8IAA8I;IACvI,MAAM,EAAE,OAAO,CAAC;IAEvB,OAAO;IAOP,oCAAoC;WACtB,MAAM,CAAC,IAAI,CAAC,EAAE,wBAAwB,GAAG,cAAc;IASrE;;OAEG;WACW,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,GAAG,cAAc;IAS9E;;OAEG;IACI,MAAM,IAAI,mBAAmB;IAsBpC;;;;;;OAMG;IACI,gBAAgB,CAAC,mBAAmB,EAAE,KAAK,GAAG,SAAS;IAS9D;;;OAGG;IACI,kBAAkB,CAAC,mBAAmB,EAAE,KAAK,GAAG,OAAO;IAyB9D,0EAA0E;IACnE,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;CAK9C"}
@@ -0,0 +1,114 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Annotation
7
+ */
8
+ import { Point3d, Transform, YawPitchRollAngles } from "@itwin/core-geometry";
9
+ import { TextBlock } from "./TextBlock";
10
+ /**
11
+ * Represents a formatted block of text positioned in 2d or 3d space.
12
+ * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.
13
+ * Other types of elements may store multiple TextAnnotations, positioned relative to one another.
14
+ * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:
15
+ * - First, the width and height of a box enclosing the contents of the [[textBlock]] must be computed using [computeTextBlockExtents]($backend). This yields a box with the top-left
16
+ * corner at (0, 0) and the bottom-right corner at (width, -height).
17
+ * - Then, an "anchor point" is computed based on the text box and the [[anchor]] property. For example, if the annotation is anchored at the center-left, the anchor point will be (width/2, -height).
18
+ * - The [[orientation]] is applied to rotate the box around the anchor point.
19
+ * - Finally, the [[offset]] is added to the anchor point to apply translation.
20
+ * @see [produceTextAnnotationGeometry]($backend) to decompose the annotation into a set of geometric primitives suitable for use with [[GeometryStreamBuilder.appendTextBlock]].
21
+ * @beta
22
+ */
23
+ export class TextAnnotation {
24
+ constructor(offset, angles, textBlock, anchor) {
25
+ this.offset = offset;
26
+ this.orientation = angles;
27
+ this.textBlock = textBlock;
28
+ this.anchor = anchor;
29
+ }
30
+ /** Creates a new TextAnnotation. */
31
+ static create(args) {
32
+ const offset = args?.offset ?? new Point3d();
33
+ const angles = args?.orientation ?? new YawPitchRollAngles();
34
+ const textBlock = args?.textBlock ?? TextBlock.createEmpty();
35
+ const anchor = args?.anchor ?? { vertical: "top", horizontal: "left" };
36
+ return new TextAnnotation(offset, angles, textBlock, anchor);
37
+ }
38
+ /**
39
+ * Creates a new TextAnnotation instance from its JSON representation.
40
+ */
41
+ static fromJSON(props) {
42
+ return TextAnnotation.create({
43
+ offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,
44
+ orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,
45
+ textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,
46
+ anchor: props?.anchor ? { ...props.anchor } : undefined,
47
+ });
48
+ }
49
+ /**
50
+ * Converts this annotation to its JSON representation.
51
+ */
52
+ toJSON() {
53
+ const props = {};
54
+ // Even if the text block is empty, we want to record its style name and overrides, e.g.,
55
+ // so the user can pick up where they left off editing it next time.
56
+ props.textBlock = this.textBlock.toJSON();
57
+ if (!this.offset.isZero) {
58
+ props.offset = this.offset.toJSON();
59
+ }
60
+ if (!this.orientation.isIdentity()) {
61
+ props.orientation = this.orientation.toJSON();
62
+ }
63
+ if (this.anchor.vertical !== "top" || this.anchor.horizontal !== "left") {
64
+ props.anchor = { ...this.anchor };
65
+ }
66
+ return props;
67
+ }
68
+ /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.
69
+ * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored
70
+ * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.
71
+ * The text block will be rotated around the fixed anchor point according to [[orientation]], then the anchor point will be translated by [[offset]].
72
+ * @param textBlockDimensions The width and height of the bounding box containing the text block. You can compute this using [computeTextBlockExtents]($common).
73
+ * @see [[computeAnchorPoint]] to compute the transform's anchor point.
74
+ */
75
+ computeTransform(textBlockDimensions) {
76
+ const anchorPt = this.computeAnchorPoint(textBlockDimensions);
77
+ const matrix = this.orientation.toMatrix3d();
78
+ const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);
79
+ const translation = Transform.createTranslation(this.offset);
80
+ return translation.multiplyTransformTransform(rotation, rotation);
81
+ }
82
+ /** Compute the anchor point of this annotation as specified by [[anchor]].
83
+ * @param textBlockDimensions The width and height of the bounding box containing the [[textBlock]]. You can compute this using [computeTextBlockExtents]($common).
84
+ * @see [[computeTransform]] to compute the transform relative to the anchor point.
85
+ */
86
+ computeAnchorPoint(textBlockDimensions) {
87
+ let x = 0;
88
+ let y = 0;
89
+ switch (this.anchor.horizontal) {
90
+ case "center":
91
+ x += textBlockDimensions.x / 2;
92
+ break;
93
+ case "right":
94
+ x += textBlockDimensions.x;
95
+ break;
96
+ }
97
+ switch (this.anchor.vertical) {
98
+ case "middle":
99
+ y -= textBlockDimensions.y / 2;
100
+ break;
101
+ case "bottom":
102
+ y -= textBlockDimensions.y;
103
+ break;
104
+ }
105
+ return new Point3d(x, y, 0);
106
+ }
107
+ /** Returns true if this annotation is logically equivalent to `other`. */
108
+ equals(other) {
109
+ return this.anchor.horizontal === other.anchor.horizontal && this.anchor.vertical === other.anchor.vertical
110
+ && this.orientation.isAlmostEqual(other.orientation) && this.offset.isAlmostEqual(other.offset)
111
+ && this.textBlock.equals(other.textBlock);
112
+ }
113
+ }
114
+ //# sourceMappingURL=TextAnnotation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnnotation.js","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C,KAAK,CAAC,MAAM,CAAC;eAC5F,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Annotation\r\n */\r\n\r\nimport { Point3d, Transform, XAndY, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\r\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\r\n\r\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\r\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\r\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\r\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\r\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\r\n * @beta\r\n */\r\nexport interface TextAnnotationAnchor {\r\n /**\r\n * The vertical alignment of the anchor point.\r\n * \"top\" aligns the anchor point with the top of the text's bounding box.\r\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\r\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\r\n */\r\n vertical: \"top\" | \"middle\" | \"bottom\";\r\n\r\n /**\r\n * The horizontal alignment of the anchor point.\r\n * \"left\" aligns the anchor point with left side of the text's bounding box.\r\n * \"center\" aligns the anchor point with center of the text with's bounding box.\r\n * \"right\" aligns the anchor point with right side of the text's bounding box.\r\n */\r\n horizontal: \"left\" | \"center\" | \"right\";\r\n}\r\n\r\n/**\r\n * JSON representation of a [[TextAnnotation]].\r\n * @beta\r\n */\r\nexport interface TextAnnotationProps {\r\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\r\n offset?: XYZProps;\r\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\r\n orientation?: YawPitchRollProps;\r\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\r\n textBlock?: TextBlockProps;\r\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\r\n anchor?: TextAnnotationAnchor;\r\n}\r\n\r\n/** Arguments supplied to [[TextAnnotation.create]].\r\n * @beta\r\n */\r\nexport interface TextAnnotationCreateArgs {\r\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\r\n offset?: Point3d;\r\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\r\n orientation?: YawPitchRollAngles;\r\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\r\n textBlock?: TextBlock;\r\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\r\n anchor?: TextAnnotationAnchor;\r\n}\r\n\r\n/**\r\n * Represents a formatted block of text positioned in 2d or 3d space.\r\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\r\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\r\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\r\n * - First, the width and height of a box enclosing the contents of the [[textBlock]] must be computed using [computeTextBlockExtents]($backend). This yields a box with the top-left\r\n * corner at (0, 0) and the bottom-right corner at (width, -height).\r\n * - Then, an \"anchor point\" is computed based on the text box and the [[anchor]] property. For example, if the annotation is anchored at the center-left, the anchor point will be (width/2, -height).\r\n * - The [[orientation]] is applied to rotate the box around the anchor point.\r\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\r\n * @see [produceTextAnnotationGeometry]($backend) to decompose the annotation into a set of geometric primitives suitable for use with [[GeometryStreamBuilder.appendTextBlock]].\r\n * @beta\r\n */\r\nexport class TextAnnotation {\r\n /** The rotation of the annotation.\r\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\r\n */\r\n public orientation: YawPitchRollAngles;\r\n /** The formatted document. */\r\n public textBlock: TextBlock;\r\n /** Describes how to compute the [[textBlock]]'s anchor point. */\r\n public anchor: TextAnnotationAnchor;\r\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\r\n public offset: Point3d;\r\n\r\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor) {\r\n this.offset = offset;\r\n this.orientation = angles;\r\n this.textBlock = textBlock;\r\n this.anchor = anchor;\r\n }\r\n\r\n /** Creates a new TextAnnotation. */\r\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\r\n const offset = args?.offset ?? new Point3d();\r\n const angles = args?.orientation ?? new YawPitchRollAngles();\r\n const textBlock = args?.textBlock ?? TextBlock.createEmpty();\r\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\r\n\r\n return new TextAnnotation(offset, angles, textBlock, anchor);\r\n }\r\n\r\n /**\r\n * Creates a new TextAnnotation instance from its JSON representation.\r\n */\r\n public static fromJSON(props: TextAnnotationProps | undefined): TextAnnotation {\r\n return TextAnnotation.create({\r\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\r\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\r\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\r\n anchor: props?.anchor ? { ...props.anchor } : undefined,\r\n });\r\n }\r\n\r\n /**\r\n * Converts this annotation to its JSON representation.\r\n */\r\n public toJSON(): TextAnnotationProps {\r\n const props: TextAnnotationProps = {};\r\n\r\n // Even if the text block is empty, we want to record its style name and overrides, e.g.,\r\n // so the user can pick up where they left off editing it next time.\r\n props.textBlock = this.textBlock.toJSON();\r\n\r\n if (!this.offset.isZero) {\r\n props.offset = this.offset.toJSON();\r\n }\r\n\r\n if (!this.orientation.isIdentity()) {\r\n props.orientation = this.orientation.toJSON();\r\n }\r\n\r\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\r\n props.anchor = { ...this.anchor };\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\r\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\r\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\r\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then the anchor point will be translated by [[offset]].\r\n * @param textBlockDimensions The width and height of the bounding box containing the text block. You can compute this using [computeTextBlockExtents]($common).\r\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\r\n */\r\n public computeTransform(textBlockDimensions: XAndY): Transform {\r\n const anchorPt = this.computeAnchorPoint(textBlockDimensions);\r\n const matrix = this.orientation.toMatrix3d();\r\n\r\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\r\n const translation = Transform.createTranslation(this.offset);\r\n return translation.multiplyTransformTransform(rotation, rotation);\r\n }\r\n\r\n /** Compute the anchor point of this annotation as specified by [[anchor]].\r\n * @param textBlockDimensions The width and height of the bounding box containing the [[textBlock]]. You can compute this using [computeTextBlockExtents]($common).\r\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\r\n */\r\n public computeAnchorPoint(textBlockDimensions: XAndY): Point3d {\r\n let x = 0;\r\n let y = 0;\r\n\r\n switch (this.anchor.horizontal) {\r\n case \"center\":\r\n x += textBlockDimensions.x / 2;\r\n break;\r\n case \"right\":\r\n x += textBlockDimensions.x;\r\n break;\r\n }\r\n\r\n switch (this.anchor.vertical) {\r\n case \"middle\":\r\n y -= textBlockDimensions.y / 2;\r\n break;\r\n case \"bottom\":\r\n y -= textBlockDimensions.y;\r\n break;\r\n }\r\n\r\n return new Point3d(x, y, 0);\r\n }\r\n\r\n /** Returns true if this annotation is logically equivalent to `other`. */\r\n public equals(other: TextAnnotation): boolean {\r\n return this.anchor.horizontal === other.anchor.horizontal && this.anchor.vertical === other.anchor.vertical\r\n && this.orientation.isAlmostEqual(other.orientation) && this.offset.isAlmostEqual(other.offset)\r\n && this.textBlock.equals(other.textBlock);\r\n }\r\n}\r\n"]}