@itwin/core-common 4.10.0-dev.9 → 5.0.0-dev.0

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 (319) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/lib/cjs/BackendTypes.d.ts +0 -2
  3. package/lib/cjs/BackendTypes.d.ts.map +1 -1
  4. package/lib/cjs/BackgroundMapProvider.js +1 -1
  5. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  6. package/lib/cjs/BackgroundMapSettings.js +2 -2
  7. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  8. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  9. package/lib/cjs/Code.d.ts +8 -0
  10. package/lib/cjs/Code.d.ts.map +1 -1
  11. package/lib/cjs/Code.js +8 -0
  12. package/lib/cjs/Code.js.map +1 -1
  13. package/lib/cjs/ColorDef.d.ts.map +1 -1
  14. package/lib/cjs/ColorDef.js +0 -3
  15. package/lib/cjs/ColorDef.js.map +1 -1
  16. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  17. package/lib/cjs/ContourDisplay.d.ts +216 -0
  18. package/lib/cjs/ContourDisplay.d.ts.map +1 -0
  19. package/lib/cjs/ContourDisplay.js +300 -0
  20. package/lib/cjs/ContourDisplay.js.map +1 -0
  21. package/lib/cjs/DisplayStyleSettings.d.ts +9 -0
  22. package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
  23. package/lib/cjs/DisplayStyleSettings.js +16 -0
  24. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  25. package/lib/cjs/ECSqlReader.d.ts.map +1 -1
  26. package/lib/cjs/ECSqlReader.js +1 -10
  27. package/lib/cjs/ECSqlReader.js.map +1 -1
  28. package/lib/cjs/ElementMesh.js +2 -3
  29. package/lib/cjs/ElementMesh.js.map +1 -1
  30. package/lib/cjs/ElementProps.d.ts +25 -0
  31. package/lib/cjs/ElementProps.d.ts.map +1 -1
  32. package/lib/cjs/ElementProps.js +3 -3
  33. package/lib/cjs/ElementProps.js.map +1 -1
  34. package/lib/cjs/FeatureSymbology.d.ts +36 -5
  35. package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
  36. package/lib/cjs/FeatureSymbology.js +127 -40
  37. package/lib/cjs/FeatureSymbology.js.map +1 -1
  38. package/lib/cjs/GeoCoordinateServices.js +2 -2
  39. package/lib/cjs/GeoCoordinateServices.js.map +1 -1
  40. package/lib/cjs/IModel.js.map +1 -1
  41. package/lib/cjs/IModelError.d.ts +5 -3
  42. package/lib/cjs/IModelError.d.ts.map +1 -1
  43. package/lib/cjs/IModelError.js +5 -2
  44. package/lib/cjs/IModelError.js.map +1 -1
  45. package/lib/cjs/ITwinError.d.ts +72 -0
  46. package/lib/cjs/ITwinError.d.ts.map +1 -0
  47. package/lib/cjs/ITwinError.js +55 -0
  48. package/lib/cjs/ITwinError.js.map +1 -0
  49. package/lib/cjs/Image.js +4 -4
  50. package/lib/cjs/Image.js.map +1 -1
  51. package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
  52. package/lib/cjs/MapLayerSettings.js +0 -1
  53. package/lib/cjs/MapLayerSettings.js.map +1 -1
  54. package/lib/cjs/QPoint.d.ts +1 -1
  55. package/lib/cjs/RenderMaterial.js +4 -4
  56. package/lib/cjs/RenderMaterial.js.map +1 -1
  57. package/lib/cjs/RenderTexture.js.map +1 -1
  58. package/lib/cjs/RpcInterface.js +1 -1
  59. package/lib/cjs/RpcInterface.js.map +1 -1
  60. package/lib/cjs/RpcManager.d.ts.map +1 -1
  61. package/lib/cjs/RpcManager.js.map +1 -1
  62. package/lib/cjs/SolarCalculate.js +4 -5
  63. package/lib/cjs/SolarCalculate.js.map +1 -1
  64. package/lib/cjs/SpatialClassification.js.map +1 -1
  65. package/lib/cjs/SubCategoryAppearance.js.map +1 -1
  66. package/lib/cjs/TextureMapping.js.map +1 -1
  67. package/lib/cjs/TileProps.js +2 -2
  68. package/lib/cjs/TileProps.js.map +1 -1
  69. package/lib/cjs/Tween.d.ts.map +1 -1
  70. package/lib/cjs/Tween.js +0 -1
  71. package/lib/cjs/Tween.js.map +1 -1
  72. package/lib/cjs/ViewProps.d.ts +1 -1
  73. package/lib/cjs/ViewProps.d.ts.map +1 -1
  74. package/lib/cjs/ViewProps.js.map +1 -1
  75. package/lib/cjs/core-common.d.ts +2 -0
  76. package/lib/cjs/core-common.d.ts.map +1 -1
  77. package/lib/cjs/core-common.js +2 -0
  78. package/lib/cjs/core-common.js.map +1 -1
  79. package/lib/cjs/geometry/ElementGeometry.js +3 -3
  80. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  81. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  82. package/lib/cjs/geometry/GeometryStream.js +2 -2
  83. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  84. package/lib/cjs/geometry/Placement.d.ts +3 -0
  85. package/lib/cjs/geometry/Placement.d.ts.map +1 -1
  86. package/lib/cjs/geometry/Placement.js +3 -0
  87. package/lib/cjs/geometry/Placement.js.map +1 -1
  88. package/lib/cjs/internal/Snapping.d.ts +7 -1
  89. package/lib/cjs/internal/Snapping.d.ts.map +1 -1
  90. package/lib/cjs/internal/Snapping.js.map +1 -1
  91. package/lib/cjs/ipc/IpcSocket.d.ts +15 -2
  92. package/lib/cjs/ipc/IpcSocket.d.ts.map +1 -1
  93. package/lib/cjs/ipc/IpcSocket.js.map +1 -1
  94. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  95. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  96. package/lib/cjs/rpc/IModelReadRpcInterface.js +12 -12
  97. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  98. package/lib/cjs/rpc/IModelTileRpcInterface.js +1 -1
  99. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  100. package/lib/cjs/rpc/SnapshotIModelRpcInterface.d.ts +3 -0
  101. package/lib/cjs/rpc/SnapshotIModelRpcInterface.d.ts.map +1 -1
  102. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +3 -0
  103. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  104. package/lib/cjs/rpc/TestRpcManager.d.ts.map +1 -1
  105. package/lib/cjs/rpc/TestRpcManager.js +0 -1
  106. package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
  107. package/lib/cjs/rpc/WipRpcInterface.js +1 -1
  108. package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
  109. package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
  110. package/lib/cjs/rpc/core/RpcConfiguration.js +1 -1
  111. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  112. package/lib/cjs/rpc/core/RpcConstants.d.ts +1 -1
  113. package/lib/cjs/rpc/core/RpcConstants.d.ts.map +1 -1
  114. package/lib/cjs/rpc/core/RpcConstants.js +1 -1
  115. package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
  116. package/lib/cjs/rpc/core/RpcControl.d.ts.map +1 -1
  117. package/lib/cjs/rpc/core/RpcControl.js +0 -1
  118. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  119. package/lib/cjs/rpc/core/RpcInvocation.js +1 -1
  120. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  121. package/lib/cjs/rpc/core/RpcMarshaling.js +1 -1
  122. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  123. package/lib/cjs/rpc/core/RpcOperation.d.ts.map +1 -1
  124. package/lib/cjs/rpc/core/RpcOperation.js +0 -1
  125. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  126. package/lib/cjs/rpc/core/RpcPendingQueue.js +1 -1
  127. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  128. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  129. package/lib/cjs/rpc/core/RpcPush.d.ts.map +1 -1
  130. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  131. package/lib/cjs/rpc/core/RpcRegistry.d.ts.map +1 -1
  132. package/lib/cjs/rpc/core/RpcRegistry.js +0 -2
  133. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  134. package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
  135. package/lib/cjs/rpc/core/RpcRequest.js +1 -2
  136. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  137. package/lib/cjs/rpc/core/RpcRequestContext.d.ts.map +1 -1
  138. package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
  139. package/lib/cjs/rpc/core/RpcRoutingToken.d.ts.map +1 -1
  140. package/lib/cjs/rpc/core/RpcRoutingToken.js +0 -1
  141. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  142. package/lib/cjs/rpc/core/RpcSessionInvocation.js +1 -1
  143. package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
  144. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  145. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
  146. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +0 -1
  147. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  148. package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
  149. package/lib/cjs/rpc/web/RpcMultipart.d.ts.map +1 -1
  150. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  151. package/lib/cjs/rpc/web/WebAppRpcLogging.js +1 -1
  152. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  153. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +0 -2
  154. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  155. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  156. package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  157. package/lib/cjs/rpc/web/WebAppRpcRequest.js +1 -1
  158. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  159. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
  160. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +0 -1
  161. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  162. package/lib/cjs/tile/TileIO.js +4 -4
  163. package/lib/cjs/tile/TileIO.js.map +1 -1
  164. package/lib/cjs/tile/TileMetadata.js +13 -13
  165. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  166. package/lib/esm/BackendTypes.d.ts +0 -2
  167. package/lib/esm/BackendTypes.d.ts.map +1 -1
  168. package/lib/esm/BackgroundMapProvider.js +1 -1
  169. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  170. package/lib/esm/BackgroundMapSettings.js +2 -2
  171. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  172. package/lib/esm/BriefcaseTypes.js.map +1 -1
  173. package/lib/esm/Code.d.ts +8 -0
  174. package/lib/esm/Code.d.ts.map +1 -1
  175. package/lib/esm/Code.js +8 -0
  176. package/lib/esm/Code.js.map +1 -1
  177. package/lib/esm/ColorDef.d.ts.map +1 -1
  178. package/lib/esm/ColorDef.js +0 -3
  179. package/lib/esm/ColorDef.js.map +1 -1
  180. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  181. package/lib/esm/ContourDisplay.d.ts +216 -0
  182. package/lib/esm/ContourDisplay.d.ts.map +1 -0
  183. package/lib/esm/ContourDisplay.js +293 -0
  184. package/lib/esm/ContourDisplay.js.map +1 -0
  185. package/lib/esm/DisplayStyleSettings.d.ts +9 -0
  186. package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
  187. package/lib/esm/DisplayStyleSettings.js +16 -0
  188. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  189. package/lib/esm/ECSqlReader.d.ts.map +1 -1
  190. package/lib/esm/ECSqlReader.js +1 -10
  191. package/lib/esm/ECSqlReader.js.map +1 -1
  192. package/lib/esm/ElementMesh.js +1 -1
  193. package/lib/esm/ElementMesh.js.map +1 -1
  194. package/lib/esm/ElementProps.d.ts +25 -0
  195. package/lib/esm/ElementProps.d.ts.map +1 -1
  196. package/lib/esm/ElementProps.js.map +1 -1
  197. package/lib/esm/FeatureSymbology.d.ts +36 -5
  198. package/lib/esm/FeatureSymbology.d.ts.map +1 -1
  199. package/lib/esm/FeatureSymbology.js +127 -40
  200. package/lib/esm/FeatureSymbology.js.map +1 -1
  201. package/lib/esm/IModel.js.map +1 -1
  202. package/lib/esm/IModelError.d.ts +5 -3
  203. package/lib/esm/IModelError.d.ts.map +1 -1
  204. package/lib/esm/IModelError.js +5 -2
  205. package/lib/esm/IModelError.js.map +1 -1
  206. package/lib/esm/ITwinError.d.ts +72 -0
  207. package/lib/esm/ITwinError.d.ts.map +1 -0
  208. package/lib/esm/ITwinError.js +52 -0
  209. package/lib/esm/ITwinError.js.map +1 -0
  210. package/lib/esm/MapLayerSettings.d.ts.map +1 -1
  211. package/lib/esm/MapLayerSettings.js +0 -1
  212. package/lib/esm/MapLayerSettings.js.map +1 -1
  213. package/lib/esm/QPoint.d.ts +1 -1
  214. package/lib/esm/RenderMaterial.js +4 -4
  215. package/lib/esm/RenderMaterial.js.map +1 -1
  216. package/lib/esm/RenderTexture.js.map +1 -1
  217. package/lib/esm/RpcInterface.js +1 -1
  218. package/lib/esm/RpcInterface.js.map +1 -1
  219. package/lib/esm/RpcManager.d.ts.map +1 -1
  220. package/lib/esm/RpcManager.js.map +1 -1
  221. package/lib/esm/SpatialClassification.js.map +1 -1
  222. package/lib/esm/SubCategoryAppearance.js.map +1 -1
  223. package/lib/esm/TextureMapping.js.map +1 -1
  224. package/lib/esm/Tween.d.ts.map +1 -1
  225. package/lib/esm/Tween.js +0 -1
  226. package/lib/esm/Tween.js.map +1 -1
  227. package/lib/esm/ViewProps.d.ts +1 -1
  228. package/lib/esm/ViewProps.d.ts.map +1 -1
  229. package/lib/esm/ViewProps.js.map +1 -1
  230. package/lib/esm/core-common.d.ts +2 -0
  231. package/lib/esm/core-common.d.ts.map +1 -1
  232. package/lib/esm/core-common.js +2 -0
  233. package/lib/esm/core-common.js.map +1 -1
  234. package/lib/esm/geometry/ElementGeometry.js +3 -3
  235. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  236. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  237. package/lib/esm/geometry/GeometryStream.js +2 -2
  238. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  239. package/lib/esm/geometry/Placement.d.ts +3 -0
  240. package/lib/esm/geometry/Placement.d.ts.map +1 -1
  241. package/lib/esm/geometry/Placement.js +3 -0
  242. package/lib/esm/geometry/Placement.js.map +1 -1
  243. package/lib/esm/internal/Snapping.d.ts +7 -1
  244. package/lib/esm/internal/Snapping.d.ts.map +1 -1
  245. package/lib/esm/internal/Snapping.js.map +1 -1
  246. package/lib/esm/ipc/IpcSocket.d.ts +15 -2
  247. package/lib/esm/ipc/IpcSocket.d.ts.map +1 -1
  248. package/lib/esm/ipc/IpcSocket.js.map +1 -1
  249. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  250. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  251. package/lib/esm/rpc/IModelReadRpcInterface.js +12 -12
  252. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  253. package/lib/esm/rpc/IModelTileRpcInterface.js +1 -1
  254. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  255. package/lib/esm/rpc/SnapshotIModelRpcInterface.d.ts +3 -0
  256. package/lib/esm/rpc/SnapshotIModelRpcInterface.d.ts.map +1 -1
  257. package/lib/esm/rpc/SnapshotIModelRpcInterface.js +3 -0
  258. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  259. package/lib/esm/rpc/TestRpcManager.d.ts.map +1 -1
  260. package/lib/esm/rpc/TestRpcManager.js +0 -1
  261. package/lib/esm/rpc/TestRpcManager.js.map +1 -1
  262. package/lib/esm/rpc/WipRpcInterface.js +1 -1
  263. package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
  264. package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
  265. package/lib/esm/rpc/core/RpcConfiguration.js +1 -1
  266. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  267. package/lib/esm/rpc/core/RpcConstants.d.ts +1 -1
  268. package/lib/esm/rpc/core/RpcConstants.d.ts.map +1 -1
  269. package/lib/esm/rpc/core/RpcConstants.js +1 -1
  270. package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
  271. package/lib/esm/rpc/core/RpcControl.d.ts.map +1 -1
  272. package/lib/esm/rpc/core/RpcControl.js +0 -1
  273. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  274. package/lib/esm/rpc/core/RpcInvocation.js +1 -1
  275. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  276. package/lib/esm/rpc/core/RpcMarshaling.js +1 -1
  277. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  278. package/lib/esm/rpc/core/RpcOperation.d.ts.map +1 -1
  279. package/lib/esm/rpc/core/RpcOperation.js +0 -1
  280. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  281. package/lib/esm/rpc/core/RpcPendingQueue.js +1 -1
  282. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  283. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  284. package/lib/esm/rpc/core/RpcPush.d.ts.map +1 -1
  285. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  286. package/lib/esm/rpc/core/RpcRegistry.d.ts.map +1 -1
  287. package/lib/esm/rpc/core/RpcRegistry.js +0 -2
  288. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  289. package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
  290. package/lib/esm/rpc/core/RpcRequest.js +1 -2
  291. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  292. package/lib/esm/rpc/core/RpcRequestContext.d.ts.map +1 -1
  293. package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
  294. package/lib/esm/rpc/core/RpcRoutingToken.d.ts.map +1 -1
  295. package/lib/esm/rpc/core/RpcRoutingToken.js +0 -1
  296. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  297. package/lib/esm/rpc/core/RpcSessionInvocation.js +1 -1
  298. package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
  299. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  300. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
  301. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +0 -1
  302. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  303. package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
  304. package/lib/esm/rpc/web/RpcMultipart.d.ts.map +1 -1
  305. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  306. package/lib/esm/rpc/web/WebAppRpcLogging.js +1 -1
  307. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  308. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +0 -2
  309. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  310. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  311. package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  312. package/lib/esm/rpc/web/WebAppRpcRequest.js +1 -1
  313. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  314. package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
  315. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +0 -1
  316. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  317. package/lib/esm/tile/TileMetadata.js +1 -1
  318. package/lib/esm/tile/TileMetadata.js.map +1 -1
  319. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"SolarCalculate.js","sourceRoot":"","sources":["../../src/SolarCalculate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AAG,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAE,SAAS,CAAC,CAAC;IACnE,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,iBAAiB;AACxD,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,IAAU,EAAE,QAAsB,EAAE,OAAgB;IAC3F,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,CAAC;IAC1C,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;AAClK,CAAC;AAND,4DAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nimport { Angle, Vector3d } from \"@itwin/core-geometry\";\r\nimport { Cartographic } from \"./geometry/Cartographic\";\r\n\r\n// cspell:ignore mrad sinm sint aarg\r\n\r\n// Code below loosely translated from https://www.esrl.noaa.gov/gmd/grad/solcalc/\r\nfunction calcTimeJulianCent(jd: number) {\r\n const T = (jd - 2451545.0) / 36525.0;\r\n return T;\r\n}\r\n\r\nfunction radToDeg(angleRad: number) {\r\n return (180.0 * angleRad / Math.PI);\r\n}\r\n\r\nfunction degToRad(angleDeg: number) {\r\n return (Math.PI * angleDeg / 180.0);\r\n}\r\n\r\nfunction calcGeomMeanLongSun(t: number) {\r\n let L0 = 280.46646 + t * (36000.76983 + t * (0.0003032));\r\n while (L0 > 360.0) {\r\n L0 -= 360.0;\r\n }\r\n while (L0 < 0.0) {\r\n L0 += 360.0;\r\n }\r\n return L0;\t\t// in degrees\r\n}\r\n\r\nfunction calcGeomMeanAnomalySun(t: number) {\r\n const M = 357.52911 + t * (35999.05029 - 0.0001537 * t);\r\n return M;\t\t// in degrees\r\n}\r\n\r\nfunction calcEccentricityEarthOrbit(t: number) {\r\n const e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);\r\n return e;\t\t// unitless\r\n}\r\n\r\nfunction calcSunEqOfCenter(t: number) {\r\n const m = calcGeomMeanAnomalySun(t);\r\n const mrad = degToRad(m);\r\n const sinm = Math.sin(mrad);\r\n const sin2m = Math.sin(mrad + mrad);\r\n const sin3m = Math.sin(mrad + mrad + mrad);\r\n const C = sinm * (1.914602 - t * (0.004817 + 0.000014 * t)) + sin2m * (0.019993 - 0.000101 * t) + sin3m * 0.000289;\r\n return C;\t\t// in degrees\r\n}\r\n\r\nfunction calcSunTrueLong(t: number) {\r\n const l0 = calcGeomMeanLongSun(t);\r\n const c = calcSunEqOfCenter(t);\r\n const O = l0 + c;\r\n return O;\t\t// in degrees\r\n}\r\n\r\nfunction calcSunApparentLong(t: number) {\r\n const o = calcSunTrueLong(t);\r\n const omega = 125.04 - 1934.136 * t;\r\n const lambda = o - 0.00569 - 0.00478 * Math.sin(degToRad(omega));\r\n return lambda;\t\t// in degrees\r\n}\r\n\r\nfunction calcMeanObliquityOfEcliptic(t: number) {\r\n const seconds = 21.448 - t * (46.8150 + t * (0.00059 - t * (0.001813)));\r\n const e0 = 23.0 + (26.0 + (seconds / 60.0)) / 60.0;\r\n return e0;\t\t// in degrees\r\n}\r\n\r\nfunction calcObliquityCorrection(t: number) {\r\n const e0 = calcMeanObliquityOfEcliptic(t);\r\n const omega = 125.04 - 1934.136 * t;\r\n const e = e0 + 0.00256 * Math.cos(degToRad(omega));\r\n return e;\t\t// in degrees\r\n}\r\n\r\nfunction calcSunDeclination(t: number) {\r\n const e = calcObliquityCorrection(t);\r\n const lambda = calcSunApparentLong(t);\r\n\r\n const sint = Math.sin(degToRad(e)) * Math.sin(degToRad(lambda));\r\n const theta = radToDeg(Math.asin(sint));\r\n return theta;\t\t// in degrees\r\n}\r\n\r\nfunction calcEquationOfTime(t: number) {\r\n const epsilon = calcObliquityCorrection(t);\r\n const l0 = calcGeomMeanLongSun(t);\r\n const e = calcEccentricityEarthOrbit(t);\r\n const m = calcGeomMeanAnomalySun(t);\r\n\r\n let y = Math.tan(degToRad(epsilon) / 2.0);\r\n y *= y;\r\n\r\n const sin2l0 = Math.sin(2.0 * degToRad(l0));\r\n const sinm = Math.sin(degToRad(m));\r\n const cos2l0 = Math.cos(2.0 * degToRad(l0));\r\n const sin4l0 = Math.sin(4.0 * degToRad(l0));\r\n const sin2m = Math.sin(2.0 * degToRad(m));\r\n\r\n const eTime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;\r\n return radToDeg(eTime) * 4.0;\t// in minutes of time\r\n}\r\n\r\nfunction calcAzEl(t: number, localTime: number, latitude: number, longitude: number, zone: number): { azimuth: number, elevation: number } {\r\n const eqTime = calcEquationOfTime(t);\r\n const theta = calcSunDeclination(t);\r\n const solarTimeFix = eqTime + 4.0 * longitude - 60.0 * zone;\r\n let trueSolarTime = localTime + solarTimeFix;\r\n while (trueSolarTime > 1440)\r\n trueSolarTime -= 1440;\r\n\r\n let hourAngle = trueSolarTime / 4.0 - 180.0;\r\n if (hourAngle < -180) {\r\n hourAngle += 360.0;\r\n }\r\n const haRad = degToRad(hourAngle);\r\n let csz = Math.sin(degToRad(latitude)) * Math.sin(degToRad(theta)) + Math.cos(degToRad(latitude)) * Math.cos(degToRad(theta)) * Math.cos(haRad);\r\n if (csz > 1.0) {\r\n csz = 1.0;\r\n } else if (csz < -1.0) {\r\n csz = -1.0;\r\n }\r\n const zenith = radToDeg(Math.acos(csz));\r\n const azDenom = (Math.cos(degToRad(latitude)) * Math.sin(degToRad(zenith)));\r\n let azimuth;\r\n if (Math.abs(azDenom) > 0.001) {\r\n let azRad = ((Math.sin(degToRad(latitude)) * Math.cos(degToRad(zenith))) - Math.sin(degToRad(theta))) / azDenom;\r\n if (Math.abs(azRad) > 1.0) {\r\n if (azRad < 0) {\r\n azRad = -1.0;\r\n } else {\r\n azRad = 1.0;\r\n }\r\n }\r\n azimuth = 180.0 - radToDeg(Math.acos(azRad));\r\n if (hourAngle > 0.0) {\r\n azimuth = -azimuth;\r\n }\r\n } else {\r\n if (latitude > 0.0) {\r\n azimuth = 180.0;\r\n } else {\r\n azimuth = 0.0;\r\n }\r\n }\r\n if (azimuth < 0.0) {\r\n azimuth += 360.0;\r\n }\r\n return { azimuth, elevation: 90 - zenith };\r\n}\r\n\r\nfunction calculateJulianDay(date: Date) {\r\n return Math.floor(date.getTime() / 86400000) + 2440587.5; // https://stackoverflow.com/questions/11759992/calculating-jdayjulian-day-in-javascript\r\n}\r\n\r\n/** @public\r\n * calculate solar angles (in radians) based at a given date/time and cartographic location.\r\n */\r\nexport function calculateSolarAngles(date: Date, location: Cartographic): { azimuth: number, elevation: number } {\r\n const jDay = calculateJulianDay(date);\r\n const latitude = location.latitudeDegrees;\r\n const longitude = location.longitudeDegrees;\r\n const utcMinutes = date.getUTCHours() * 60 + date.getUTCMinutes() + date.getUTCSeconds() / 60;\r\n const zone = Math.floor(.5 + longitude / 15.0); // date.getTimeZoneOffset mixes in DST.\r\n const localMinutes = utcMinutes + zone * 60;\r\n const jTotal = jDay + utcMinutes / 1440.0;\r\n const T = calcTimeJulianCent(jTotal);\r\n return calcAzEl(T, localMinutes, latitude, longitude, zone);\r\n}\r\n\r\n/** @public\r\n * calculate solar direction based at a given date/time and cartpgrphic location.\r\n */\r\nexport function calculateSolarDirection(date: Date, location: Cartographic): Vector3d {\r\n return calculateSolarDirectionFromAngles(calculateSolarAngles(date, location));\r\n}\r\n\r\n/** @public\r\n * calculate solar direction corresponding to the given azimuth and elevation (altitude) angles in degrees.\r\n */\r\nexport function calculateSolarDirectionFromAngles(azimuthElevation: { azimuth: number, elevation: number }): Vector3d {\r\n const azimuth = Angle.degreesToRadians(azimuthElevation.azimuth);\r\n const elevation = Angle.degreesToRadians(azimuthElevation.elevation);\r\n const cosElevation = Math.cos(elevation);\r\n const sinElevation = Math.sin(elevation);\r\n return Vector3d.create(-Math.sin(azimuth) * cosElevation, -Math.cos(azimuth) * cosElevation, -sinElevation);\r\n}\r\n\r\nfunction dateFromUtcMinutes(date: Date, utcMinutes: number) {\r\n const utcHours = Math.floor(utcMinutes / 60.0);\r\n const output = new Date(date);\r\n output.setUTCHours(utcHours);\r\n output.setUTCMinutes(Math.floor(.5 + utcMinutes - 60.0 * utcHours));\r\n output.setUTCSeconds(0);\r\n return output;\r\n}\r\n\r\nfunction calcSunriseUtcMinutes(rise: boolean, lat: number, longitude: number, jDay: number) {\r\n const t = calcTimeJulianCent(jDay);\r\n const eqTime = calcEquationOfTime(t);\r\n const solarDec = calcSunDeclination(t);\r\n const latRad = degToRad(lat);\r\n const sdRad = degToRad(solarDec);\r\n const hAarg = (Math.cos(degToRad(90.833)) / (Math.cos(latRad) * Math.cos(sdRad)) - Math.tan(latRad) * Math.tan(sdRad));\r\n const hourAngle = Math.acos(hAarg);\r\n const delta = longitude + radToDeg(rise ? hourAngle : - hourAngle);\r\n return 720 - (4.0 * delta) - eqTime;\t// in UTC minutes\r\n}\r\n\r\n/** @public\r\n * calculate solar sunrise or sunset for a given day and cartographic location.\r\n */\r\nexport function calculateSunriseOrSunset(date: Date, location: Cartographic, sunrise: boolean): Date {\r\n const jDay = calculateJulianDay(date);\r\n const longitude = location.longitudeDegrees;\r\n const latitude = location.latitudeDegrees;\r\n const utcMinutes = calcSunriseUtcMinutes(sunrise, latitude, longitude, jDay);\r\n return sunrise ? dateFromUtcMinutes(date, utcMinutes) : dateFromUtcMinutes(date, calcSunriseUtcMinutes(sunrise, latitude, longitude, jDay + utcMinutes / 1440));\r\n}\r\n"]}
1
+ {"version":3,"file":"SolarCalculate.js","sourceRoot":"","sources":["../../src/SolarCalculate.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAkKH,oDAUC;AAKD,0DAEC;AAKD,8EAMC;AA0BD,4DAMC;AA5ND,wDAAuD;AAGvD,oCAAoC;AAEpC,kFAAkF;AAClF,SAAS,kBAAkB,CAAC,EAAU;IACpC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB;IAChC,OAAO,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB;IAChC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,IAAI,EAAE,GAAG,SAAS,GAAG,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;QAClB,EAAE,IAAI,KAAK,CAAC;IACd,CAAC;IACD,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC;QAChB,EAAE,IAAI,KAAK,CAAC;IACd,CAAC;IACD,OAAO,EAAE,CAAC,CAAE,aAAa;AAC3B,CAAC;AAED,SAAS,sBAAsB,CAAC,CAAS;IACvC,MAAM,CAAC,GAAG,SAAS,GAAG,CAAC,GAAG,CAAC,WAAW,GAAG,SAAS,GAAG,CAAC,CAAC,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CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACvH,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAE,SAAS,CAAC,CAAC;IACnE,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,iBAAiB;AACxD,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,IAAU,EAAE,QAAsB,EAAE,OAAgB;IAC3F,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,CAAC;IAC1C,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;AAClK,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 Utils\r\n */\r\n\r\nimport { Angle, Vector3d } from \"@itwin/core-geometry\";\r\nimport { Cartographic } from \"./geometry/Cartographic\";\r\n\r\n// cspell:ignore mrad sinm sint aarg\r\n\r\n// Code below loosely translated from https://www.esrl.noaa.gov/gmd/grad/solcalc/\r\nfunction calcTimeJulianCent(jd: number) {\r\n const T = (jd - 2451545.0) / 36525.0;\r\n return T;\r\n}\r\n\r\nfunction radToDeg(angleRad: number) {\r\n return (180.0 * angleRad / Math.PI);\r\n}\r\n\r\nfunction degToRad(angleDeg: number) {\r\n return (Math.PI * angleDeg / 180.0);\r\n}\r\n\r\nfunction calcGeomMeanLongSun(t: number) {\r\n let L0 = 280.46646 + t * (36000.76983 + t * (0.0003032));\r\n while (L0 > 360.0) {\r\n L0 -= 360.0;\r\n }\r\n while (L0 < 0.0) {\r\n L0 += 360.0;\r\n }\r\n return L0;\t\t// in degrees\r\n}\r\n\r\nfunction calcGeomMeanAnomalySun(t: number) {\r\n const M = 357.52911 + t * (35999.05029 - 0.0001537 * t);\r\n return M;\t\t// in degrees\r\n}\r\n\r\nfunction calcEccentricityEarthOrbit(t: number) {\r\n const e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);\r\n return e;\t\t// unitless\r\n}\r\n\r\nfunction calcSunEqOfCenter(t: number) {\r\n const m = calcGeomMeanAnomalySun(t);\r\n const mrad = degToRad(m);\r\n const sinm = Math.sin(mrad);\r\n const sin2m = Math.sin(mrad + mrad);\r\n const sin3m = Math.sin(mrad + mrad + mrad);\r\n const C = sinm * (1.914602 - t * (0.004817 + 0.000014 * t)) + sin2m * (0.019993 - 0.000101 * t) + sin3m * 0.000289;\r\n return C;\t\t// in degrees\r\n}\r\n\r\nfunction calcSunTrueLong(t: number) {\r\n const l0 = calcGeomMeanLongSun(t);\r\n const c = calcSunEqOfCenter(t);\r\n const O = l0 + c;\r\n return O;\t\t// in degrees\r\n}\r\n\r\nfunction calcSunApparentLong(t: number) {\r\n const o = calcSunTrueLong(t);\r\n const omega = 125.04 - 1934.136 * t;\r\n const lambda = o - 0.00569 - 0.00478 * Math.sin(degToRad(omega));\r\n return lambda;\t\t// in degrees\r\n}\r\n\r\nfunction calcMeanObliquityOfEcliptic(t: number) {\r\n const seconds = 21.448 - t * (46.8150 + t * (0.00059 - t * (0.001813)));\r\n const e0 = 23.0 + (26.0 + (seconds / 60.0)) / 60.0;\r\n return e0;\t\t// in degrees\r\n}\r\n\r\nfunction calcObliquityCorrection(t: number) {\r\n const e0 = calcMeanObliquityOfEcliptic(t);\r\n const omega = 125.04 - 1934.136 * t;\r\n const e = e0 + 0.00256 * Math.cos(degToRad(omega));\r\n return e;\t\t// in degrees\r\n}\r\n\r\nfunction calcSunDeclination(t: number) {\r\n const e = calcObliquityCorrection(t);\r\n const lambda = calcSunApparentLong(t);\r\n\r\n const sint = Math.sin(degToRad(e)) * Math.sin(degToRad(lambda));\r\n const theta = radToDeg(Math.asin(sint));\r\n return theta;\t\t// in degrees\r\n}\r\n\r\nfunction calcEquationOfTime(t: number) {\r\n const epsilon = calcObliquityCorrection(t);\r\n const l0 = calcGeomMeanLongSun(t);\r\n const e = calcEccentricityEarthOrbit(t);\r\n const m = calcGeomMeanAnomalySun(t);\r\n\r\n let y = Math.tan(degToRad(epsilon) / 2.0);\r\n y *= y;\r\n\r\n const sin2l0 = Math.sin(2.0 * degToRad(l0));\r\n const sinm = Math.sin(degToRad(m));\r\n const cos2l0 = Math.cos(2.0 * degToRad(l0));\r\n const sin4l0 = Math.sin(4.0 * degToRad(l0));\r\n const sin2m = Math.sin(2.0 * degToRad(m));\r\n\r\n const eTime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;\r\n return radToDeg(eTime) * 4.0;\t// in minutes of time\r\n}\r\n\r\nfunction calcAzEl(t: number, localTime: number, latitude: number, longitude: number, zone: number): { azimuth: number, elevation: number } {\r\n const eqTime = calcEquationOfTime(t);\r\n const theta = calcSunDeclination(t);\r\n const solarTimeFix = eqTime + 4.0 * longitude - 60.0 * zone;\r\n let trueSolarTime = localTime + solarTimeFix;\r\n while (trueSolarTime > 1440)\r\n trueSolarTime -= 1440;\r\n\r\n let hourAngle = trueSolarTime / 4.0 - 180.0;\r\n if (hourAngle < -180) {\r\n hourAngle += 360.0;\r\n }\r\n const haRad = degToRad(hourAngle);\r\n let csz = Math.sin(degToRad(latitude)) * Math.sin(degToRad(theta)) + Math.cos(degToRad(latitude)) * Math.cos(degToRad(theta)) * Math.cos(haRad);\r\n if (csz > 1.0) {\r\n csz = 1.0;\r\n } else if (csz < -1.0) {\r\n csz = -1.0;\r\n }\r\n const zenith = radToDeg(Math.acos(csz));\r\n const azDenom = (Math.cos(degToRad(latitude)) * Math.sin(degToRad(zenith)));\r\n let azimuth;\r\n if (Math.abs(azDenom) > 0.001) {\r\n let azRad = ((Math.sin(degToRad(latitude)) * Math.cos(degToRad(zenith))) - Math.sin(degToRad(theta))) / azDenom;\r\n if (Math.abs(azRad) > 1.0) {\r\n if (azRad < 0) {\r\n azRad = -1.0;\r\n } else {\r\n azRad = 1.0;\r\n }\r\n }\r\n azimuth = 180.0 - radToDeg(Math.acos(azRad));\r\n if (hourAngle > 0.0) {\r\n azimuth = -azimuth;\r\n }\r\n } else {\r\n if (latitude > 0.0) {\r\n azimuth = 180.0;\r\n } else {\r\n azimuth = 0.0;\r\n }\r\n }\r\n if (azimuth < 0.0) {\r\n azimuth += 360.0;\r\n }\r\n return { azimuth, elevation: 90 - zenith };\r\n}\r\n\r\nfunction calculateJulianDay(date: Date) {\r\n return Math.floor(date.getTime() / 86400000) + 2440587.5; // https://stackoverflow.com/questions/11759992/calculating-jdayjulian-day-in-javascript\r\n}\r\n\r\n/** @public\r\n * calculate solar angles (in radians) based at a given date/time and cartographic location.\r\n */\r\nexport function calculateSolarAngles(date: Date, location: Cartographic): { azimuth: number, elevation: number } {\r\n const jDay = calculateJulianDay(date);\r\n const latitude = location.latitudeDegrees;\r\n const longitude = location.longitudeDegrees;\r\n const utcMinutes = date.getUTCHours() * 60 + date.getUTCMinutes() + date.getUTCSeconds() / 60;\r\n const zone = Math.floor(.5 + longitude / 15.0); // date.getTimeZoneOffset mixes in DST.\r\n const localMinutes = utcMinutes + zone * 60;\r\n const jTotal = jDay + utcMinutes / 1440.0;\r\n const T = calcTimeJulianCent(jTotal);\r\n return calcAzEl(T, localMinutes, latitude, longitude, zone);\r\n}\r\n\r\n/** @public\r\n * calculate solar direction based at a given date/time and cartpgrphic location.\r\n */\r\nexport function calculateSolarDirection(date: Date, location: Cartographic): Vector3d {\r\n return calculateSolarDirectionFromAngles(calculateSolarAngles(date, location));\r\n}\r\n\r\n/** @public\r\n * calculate solar direction corresponding to the given azimuth and elevation (altitude) angles in degrees.\r\n */\r\nexport function calculateSolarDirectionFromAngles(azimuthElevation: { azimuth: number, elevation: number }): Vector3d {\r\n const azimuth = Angle.degreesToRadians(azimuthElevation.azimuth);\r\n const elevation = Angle.degreesToRadians(azimuthElevation.elevation);\r\n const cosElevation = Math.cos(elevation);\r\n const sinElevation = Math.sin(elevation);\r\n return Vector3d.create(-Math.sin(azimuth) * cosElevation, -Math.cos(azimuth) * cosElevation, -sinElevation);\r\n}\r\n\r\nfunction dateFromUtcMinutes(date: Date, utcMinutes: number) {\r\n const utcHours = Math.floor(utcMinutes / 60.0);\r\n const output = new Date(date);\r\n output.setUTCHours(utcHours);\r\n output.setUTCMinutes(Math.floor(.5 + utcMinutes - 60.0 * utcHours));\r\n output.setUTCSeconds(0);\r\n return output;\r\n}\r\n\r\nfunction calcSunriseUtcMinutes(rise: boolean, lat: number, longitude: number, jDay: number) {\r\n const t = calcTimeJulianCent(jDay);\r\n const eqTime = calcEquationOfTime(t);\r\n const solarDec = calcSunDeclination(t);\r\n const latRad = degToRad(lat);\r\n const sdRad = degToRad(solarDec);\r\n const hAarg = (Math.cos(degToRad(90.833)) / (Math.cos(latRad) * Math.cos(sdRad)) - Math.tan(latRad) * Math.tan(sdRad));\r\n const hourAngle = Math.acos(hAarg);\r\n const delta = longitude + radToDeg(rise ? hourAngle : - hourAngle);\r\n return 720 - (4.0 * delta) - eqTime;\t// in UTC minutes\r\n}\r\n\r\n/** @public\r\n * calculate solar sunrise or sunset for a given day and cartographic location.\r\n */\r\nexport function calculateSunriseOrSunset(date: Date, location: Cartographic, sunrise: boolean): Date {\r\n const jDay = calculateJulianDay(date);\r\n const longitude = location.longitudeDegrees;\r\n const latitude = location.latitudeDegrees;\r\n const utcMinutes = calcSunriseUtcMinutes(sunrise, latitude, longitude, jDay);\r\n return sunrise ? dateFromUtcMinutes(date, utcMinutes) : dateFromUtcMinutes(date, calcSunriseUtcMinutes(sunrise, latitude, longitude, jDay + utcMinutes / 1440));\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialClassification.js","sourceRoot":"","sources":["../../src/SpatialClassification.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAGzD;;;;GAIG;AACH,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC,qCAAqC;IACrC,iFAAO,CAAA;IACP,oDAAoD;IACpD,+EAAM,CAAA;IACN,gCAAgC;IAChC,uFAAU,CAAA;IACV,wEAAwE;IACxE,uFAAU,CAAA;IACV,yEAAyE;IACzE,mGAAgB,CAAA;AAClB,CAAC,EAXW,8BAA8B,8CAA9B,8BAA8B,QAWzC;AAED;;;;GAIG;AACH,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACzC,qCAAqC;IACrC,mFAAO,CAAA;IACP,oDAAoD;IACpD,iFAAM,CAAA;IACN,gCAAgC;IAChC,yFAAU,CAAA;AACZ,CAAC,EAPW,+BAA+B,+CAA/B,+BAA+B,QAO1C;AAeD;;GAEG;AACH,MAAa,sBAAsB;IAQjC,2BAA2B;IAC3B,YAAmB,MAAM,GAAG,8BAA8B,CAAC,YAAY,EAAE,OAAO,GAAG,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,GAAG,KAAK;QACnJ,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CA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AAC,YAAY;YAC9C,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,8BAA8B,CAAC,YAAY,CAAC;IACvD,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,OAAe;IACrC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,+BAA+B,CAAC,GAAG,CAAC;QACzC,KAAK,+BAA+B,CAAC,EAAE,CAAC;QACxC,KAAK,+BAA+B,CAAC,MAAM;YACzC,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,+BAA+B,CAAC,MAAM,CAAC;IAClD,CAAC;AACH,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\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { ModelMapLayerSettings } from \"./MapLayerSettings\";\r\n\r\n/** Describes how a [[SpatialClassifier]] affects the display of classified geometry - that is, geometry intersecting\r\n * the classifier.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SpatialClassifierInsideDisplay {\r\n /** The geometry is not displayed. */\r\n Off = 0,\r\n /** The geometry is displayed without alteration. */\r\n On = 1,\r\n /** The geometry is darkened. */\r\n Dimmed = 2,\r\n /** The geometry is tinted by the [Viewport.hilite]($frontend) color. */\r\n Hilite = 3,\r\n /** The geometry is tinted with the colors of the classifier elements. */\r\n ElementColor = 4,\r\n}\r\n\r\n/** Describes how a [[SpatialClassifier]] affects the display of unclassified geometry - that is, geometry not intersecting\r\n * the classifier.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SpatialClassifierOutsideDisplay {\r\n /** The geometry is not displayed. */\r\n Off = 0,\r\n /** The geometry is displayed without alteration. */\r\n On = 1,\r\n /** The geometry is darkened. */\r\n Dimmed = 2,\r\n}\r\n\r\n/** JSON representation of a [[SpatialClassifierFlags]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialClassifierFlagsProps {\r\n /** See [[SpatialClassifierFlags.inside]]. */\r\n inside: SpatialClassifierInsideDisplay;\r\n /** See [[SpatialClassifierFlags.outside]]. */\r\n outside: SpatialClassifierOutsideDisplay;\r\n /** See [[SpatialClassifierFlags.isVolumeClassifier]]. */\r\n isVolumeClassifier?: boolean;\r\n}\r\n\r\n/** Flags affecting how a [[SpatialClassifier]] is applied.\r\n * @public\r\n */\r\nexport class SpatialClassifierFlags {\r\n /** How geometry intersecting the classifier should be displayed. */\r\n public readonly inside: SpatialClassifierInsideDisplay;\r\n /** How geometry not intersecting the classifier should be displayed. */\r\n public readonly outside: SpatialClassifierOutsideDisplay;\r\n /** True for volume classification; false for planar classification. */\r\n public readonly isVolumeClassifier: boolean;\r\n\r\n /** Construct new flags. */\r\n public constructor(inside = SpatialClassifierInsideDisplay.ElementColor, outside = SpatialClassifierOutsideDisplay.Dimmed, isVolumeClassifier = false) {\r\n this.inside = insideDisplay(inside);\r\n this.outside = outsideDisplay(outside);\r\n this.isVolumeClassifier = isVolumeClassifier;\r\n }\r\n\r\n /** Construct from JSON representation. */\r\n public static fromJSON(props: SpatialClassifierFlagsProps): SpatialClassifierFlags {\r\n return new SpatialClassifierFlags(props.inside, props.outside, true === props.isVolumeClassifier);\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): SpatialClassifierFlagsProps {\r\n const props: SpatialClassifierFlagsProps = {\r\n inside: this.inside,\r\n outside: this.outside,\r\n };\r\n\r\n if (this.isVolumeClassifier)\r\n props.isVolumeClassifier = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Create flags indentical to these ones except for any properties explicitly specified by `changedProps`. */\r\n public clone(changedProps?: Partial<SpatialClassifierFlagsProps>): SpatialClassifierFlags {\r\n if (!changedProps)\r\n return this;\r\n\r\n return SpatialClassifierFlags.fromJSON({ ...this.toJSON(), ...changedProps });\r\n }\r\n\r\n /** Return true if these flags are equivalent to `other`. */\r\n public equals(other: SpatialClassifierFlags): boolean {\r\n if (other === this)\r\n return true;\r\n\r\n return other.inside === this.inside && other.outside === this.outside && other.isVolumeClassifier === this.isVolumeClassifier;\r\n }\r\n\r\n /** Return true if these flags are equivalent to `props`. */\r\n public equalsProps(props: SpatialClassifierFlagsProps): boolean {\r\n return this.inside === props.inside && this.outside === props.outside && this.isVolumeClassifier === (true === props.isVolumeClassifier);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[SpatialClassifier]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialClassifierProps {\r\n /** See [[SpatialClassifier.modelId]]. */\r\n modelId: Id64String;\r\n /** See [[SpatialClassifier.expand]]. */\r\n expand: number;\r\n /** See [[SpatialClassifier.flags]]. */\r\n flags: SpatialClassifierFlagsProps;\r\n /** See [[SpatialClassifier.name]]. */\r\n name: string;\r\n /** Records whether this is the active classifier.\r\n * See [[SpatialClassifier.active]].\r\n */\r\n isActive?: boolean;\r\n}\r\n\r\n/** Describes how to use the geometry of one [GeometricModel]($backend) to classify the contents of other models - most typically, reality models.\r\n * Applying a classifier divides the geometry of the classified model into two groups:\r\n * - Classified (intersecting the classifier); and\r\n * - Unclassified (not intersecting the classifier).\r\n * For example, a model containing the building footprints for a city block could be used to classify a reality mesh captured from photographs of the\r\n * real-world block. Then, buildings within the reality mesh can be selected individually, and present the properties of the classifier geometry (e.g.,\r\n * the address of the building). The appearance of the geometry can also be customized based using [[SpatialClassifierInsideDisplay]] and [[SpatialClassifierOutsideDisplay]].\r\n * Two types of classification are supported:\r\n * - Planar classification, in which the geometry of the classifier model is projected onto a plane to classify geometry within a region extruded perpendicular\r\n * the plane (e.g., the building footprints example); and\r\n * - Volume classification, in which closed, non-intersecting volumes within the classifier classify geometry that intersects (i.e. is contained within) those same volumes (e.g., imagine using boxes instead\r\n * of footprints to classify buildings, or floors of buildings).\r\n * @see this (interactive example)[https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=classifier-sample].\r\n * @see [[SpatialClassifiers]] to define a set of classifiers.\r\n * @see [[ContextRealityModel.classifiers]] to classify a context reality model.\r\n * @see [SpatialModelState.classifiers]($frontend) to classify a persistent reality model.\r\n * @public\r\n */\r\nexport class SpatialClassifier {\r\n /** The Id of the [GeometricModel]($backend) whose geometry is used to produce the classifier. */\r\n public readonly modelId: Id64String;\r\n /** A distance in meters by which to expand the classifier geometry. For example, if line strings are used to represent streets,\r\n * you might expand them to the average width of a street.\r\n */\r\n public readonly expand: number;\r\n /** Flags controlling how to apply the classifier. */\r\n public readonly flags: SpatialClassifierFlags;\r\n /** A user-friendly name, useful for identifying individual classifiers within a [[SpatialClassifiers]]. */\r\n public readonly name: string;\r\n\r\n /** Construct a new classifier. */\r\n public constructor(modelId: Id64String, name: string, flags = new SpatialClassifierFlags(), expand = 0) {\r\n this.modelId = modelId;\r\n this.expand = expand;\r\n this.flags = flags;\r\n this.name = name;\r\n }\r\n\r\n /** Construct from JSON representation. */\r\n public static fromJSON(props: SpatialClassifierProps): SpatialClassifier {\r\n return new SpatialClassifier(props.modelId, props.name, SpatialClassifierFlags.fromJSON(props.flags), props.expand);\r\n }\r\n\r\n /** Convert to JSON representation.\r\n * @note This method always sets the [[SpatialClassifierProps.isActive]] property to `false`.\r\n */\r\n public toJSON(): SpatialClassifierProps {\r\n return {\r\n modelId: this.modelId,\r\n expand: this.expand,\r\n flags: this.flags.toJSON(),\r\n name: this.name,\r\n isActive: false,\r\n };\r\n }\r\n\r\n /** Construct from Model Map Layer.\r\n * @beta\r\n */\r\n public static fromModelMapLayer(mapLayer: ModelMapLayerSettings): SpatialClassifier {\r\n const flags = SpatialClassifierFlags.fromJSON({ inside: SpatialClassifierInsideDisplay.Off, outside: SpatialClassifierOutsideDisplay.Off });\r\n\r\n return new SpatialClassifier(mapLayer.modelId, mapLayer.name, flags);\r\n }\r\n\r\n /** Create a classifier identical to this one except for any properties explicitly specified by `changedProps`. */\r\n public clone(changedProps?: Partial<SpatialClassifierProps>): SpatialClassifier {\r\n if (!changedProps)\r\n return this;\r\n\r\n return SpatialClassifier.fromJSON({ ...this.toJSON(), ...changedProps });\r\n }\r\n\r\n /** Return true if this classifier is equivalent to `other`. */\r\n public equals(other: SpatialClassifier): boolean {\r\n if (other === this)\r\n return true;\r\n\r\n return this.modelId === other.modelId && this.expand === other.expand && this.name === other.name && this.flags.equals(other.flags);\r\n }\r\n\r\n /** Return true if this classifier is equivalent to `props`. */\r\n public equalsProps(props: SpatialClassifierProps): boolean {\r\n return this.modelId === props.modelId && this.expand === props.expand && this.name === props.name && this.flags.equalsProps(props.flags);\r\n }\r\n}\r\n\r\n/** An object that can store the JSON representation of a list of [[SpatialClassifier]]s.\r\n * @see [[SpatialClassifiers]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialClassifiersContainer {\r\n /** The list of classifiers. */\r\n classifiers?: SpatialClassifierProps[];\r\n}\r\n\r\n/** A set of [[SpatialClassifier]]s for a given reality model. At most one of the classifiers can be actively classifying the model at any given time.\r\n * The set of classifiers can be presented to the user, listed by name, so that the active classifier can be changed.\r\n * The set of classifiers is populated from its JSON representation and that representation is kept in sync as the set of classifiers is modified.\r\n * @see this (interactive example)[https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=classifier-sample].\r\n * @see [[SpatialClassifier]] for details on how spatial classification works.\r\n * @see [[ContextRealityModel.classifiers]] to define classifiers for a context reality model.\r\n * @see [SpatialModelState.classifiers]($frontend) to define classifiers for a persistent reality model.\r\n * @public\r\n */\r\nexport class SpatialClassifiers implements Iterable<SpatialClassifier> {\r\n private readonly _json: SpatialClassifiersContainer;\r\n private readonly _classifiers: SpatialClassifier[] = [];\r\n private _active?: SpatialClassifier;\r\n\r\n /** Construct a new set of classifiers from the JSON representation. The set will be initialized from `container.classifiers` and that JSON representation\r\n * will be kept in sync with changes made to the set. The caller should not directly modify `container.classifiers` or its contents as that will cause the set to become out\r\n * of sync with the JSON representation.\r\n * The [[active]] classifier will be determined by the first [[SpatialClassifierProps]] whose `isActive` property is set to `true`, if any.\r\n */\r\n public constructor(container: SpatialClassifiersContainer) {\r\n this._json = container;\r\n\r\n const json = this._array;\r\n if (!json)\r\n return;\r\n\r\n for (const props of json) {\r\n const classifier = SpatialClassifier.fromJSON(props);\r\n this._classifiers.push(classifier);\r\n if (props.isActive) {\r\n if (!this._active)\r\n this._active = classifier;\r\n else\r\n props.isActive = false;\r\n }\r\n }\r\n }\r\n\r\n /** The classifier currently classifying the target reality model. The classifier passed to the setter must be one obtained from this set, or one equivalent to\r\n * one contained in this set; in the latter case, the equivalent classifier contained in this set becomes active.\r\n */\r\n /** The classifier currently classifying the target reality model, if any.\r\n * @see [[setActive]] to change the active classifier.\r\n */\r\n public get active(): SpatialClassifier | undefined {\r\n return this._active;\r\n }\r\n\r\n /** Change the [[active]] classifier. The input must be a classifier belonging to this set, or equivalent to one in the set.\r\n * If no equivalent classifier exists in the set, the active classifier remains unchanged.\r\n * @param The classifier to set as active, or `undefined` to clear the active classifier.\r\n * @returns the active classifier.\r\n */\r\n public setActive(active: SpatialClassifier | undefined): SpatialClassifier | undefined {\r\n const array = this._array;\r\n if (!array)\r\n return this.active;\r\n\r\n if (active) {\r\n active = this.findEquivalent(active);\r\n if (!active)\r\n return this.active;\r\n }\r\n\r\n if (active === this.active)\r\n return this.active;\r\n\r\n let propsIndex = -1;\r\n if (active) {\r\n propsIndex = array.findIndex((x) => active!.equalsProps(x));\r\n if (-1 === propsIndex)\r\n return this.active;\r\n }\r\n\r\n this._active = active;\r\n for (let i = 0; i < array.length; i++)\r\n array[i].isActive = (i === propsIndex);\r\n\r\n return this.active;\r\n }\r\n\r\n /** Obtain an iterator over the classifiers contained in this set. */\r\n public [Symbol.iterator](): Iterator<SpatialClassifier> {\r\n return this._classifiers[Symbol.iterator]();\r\n }\r\n\r\n /** The number of classifiers in this set. */\r\n public get size(): number {\r\n return this._array?.length ?? 0;\r\n }\r\n\r\n /** Returns the first classifier that satisfies `criterion`, or `undefined` if no classifier satisfies it. */\r\n public find(criterion: (classifier: SpatialClassifier) => boolean): SpatialClassifier | undefined {\r\n return this._classifiers.find(criterion);\r\n }\r\n\r\n /** Find the first classifier that is equivalent to the supplied classifier, or `undefined` if no equivalent classifier exists in this set. */\r\n public findEquivalent(classifier: SpatialClassifier): SpatialClassifier | undefined {\r\n return this.find((x) => x.equals(classifier));\r\n }\r\n\r\n /** Return true if the specified classifier or one equivalent to it exists in this set. */\r\n public has(classifier: SpatialClassifier): boolean {\r\n return undefined !== this.findEquivalent(classifier);\r\n }\r\n\r\n /** Add a classifier to this set. If an equivalent classifier already exists, the supplied classifier is not added.\r\n * @param classifier The classifier to add.\r\n * @returns The equivalent pre-existing classifier, if one existed; or the supplied classifier, if it was added to the set.\r\n */\r\n public add(classifier: SpatialClassifier): SpatialClassifier {\r\n const existing = this.findEquivalent(classifier);\r\n if (existing)\r\n return existing;\r\n\r\n let array = this._array;\r\n if (!array)\r\n array = this._json.classifiers = [];\r\n\r\n this._classifiers.push(classifier);\r\n array.push(classifier.toJSON());\r\n return classifier;\r\n }\r\n\r\n /** Replace an existing classifier with a different one.\r\n * @param toReplace The classifier to be replaced.\r\n * @param replacement The classifier to replace `toReplace`.\r\n * @returns true if a classifier equivalent to `toReplace` existed in the set and was replaced by `replacement`.\r\n * @note If `toReplace` was the [[active]] classifier, `replacement` will become active.\r\n */\r\n public replace(toReplace: SpatialClassifier, replacement: SpatialClassifier): boolean {\r\n const list = this._array;\r\n if (!list)\r\n return false;\r\n\r\n const classifierIndex = this._classifiers.findIndex((x) => x.equals(toReplace));\r\n if (-1 === classifierIndex)\r\n return false;\r\n\r\n const propsIndex = list.findIndex((x) => toReplace.equalsProps(x));\r\n assert(propsIndex === classifierIndex);\r\n if (-1 === propsIndex)\r\n return false;\r\n\r\n toReplace = this._classifiers[classifierIndex];\r\n const wasActive = this.active === toReplace;\r\n\r\n this._classifiers[classifierIndex] = replacement;\r\n const props = list[propsIndex] = replacement.toJSON();\r\n\r\n if (wasActive) {\r\n props.isActive = true;\r\n this._active = replacement;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Remove the first classifier equivalent to `classifier` from this set.\r\n * @param classifier The classifier to remove.\r\n * @returns The classifier that was actually removed, or `undefined` if none was removed.\r\n */\r\n public delete(classifier: SpatialClassifier): SpatialClassifier | undefined {\r\n const list = this._array;\r\n if (!list)\r\n return undefined;\r\n\r\n const classifierIndex = this._classifiers.findIndex((x) => x.equals(classifier));\r\n if (-1 === classifierIndex)\r\n return undefined;\r\n\r\n classifier = this._classifiers[classifierIndex];\r\n const propsIndex = list.findIndex((x) => classifier.equalsProps(x));\r\n assert(propsIndex === classifierIndex);\r\n if (-1 === propsIndex)\r\n return undefined;\r\n\r\n list.splice(propsIndex, 1);\r\n this._classifiers.splice(classifierIndex, 1);\r\n if (list.length === 0)\r\n this._json.classifiers = undefined;\r\n\r\n if (classifier === this.active)\r\n this._active = undefined;\r\n\r\n return classifier;\r\n }\r\n\r\n /** Remove all classifiers from this set. */\r\n public clear(): void {\r\n this._classifiers.length = 0;\r\n this._json.classifiers = undefined;\r\n this._active = undefined;\r\n }\r\n\r\n private get _array(): SpatialClassifierProps[] | undefined {\r\n return Array.isArray(this._json.classifiers) ? this._json.classifiers : undefined;\r\n }\r\n}\r\n\r\nfunction insideDisplay(display: number): SpatialClassifierInsideDisplay {\r\n switch (display) {\r\n case SpatialClassifierInsideDisplay.Off:\r\n case SpatialClassifierInsideDisplay.On:\r\n case SpatialClassifierInsideDisplay.Dimmed:\r\n case SpatialClassifierInsideDisplay.Hilite:\r\n case SpatialClassifierInsideDisplay.ElementColor:\r\n return display;\r\n default:\r\n return SpatialClassifierInsideDisplay.ElementColor;\r\n }\r\n}\r\n\r\nfunction outsideDisplay(display: number): SpatialClassifierOutsideDisplay {\r\n switch (display) {\r\n case SpatialClassifierOutsideDisplay.Off:\r\n case SpatialClassifierOutsideDisplay.On:\r\n case SpatialClassifierOutsideDisplay.Dimmed:\r\n return display;\r\n default:\r\n return SpatialClassifierOutsideDisplay.Dimmed;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SpatialClassification.js","sourceRoot":"","sources":["../../src/SpatialClassification.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAGzD;;;;GAIG;AACH,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC,qCAAqC;IACrC,iFAAO,CAAA;IACP,oDAAoD;IACpD,+EAAM,CAAA;IACN,gCAAgC;IAChC,uFAAU,CAAA;IACV,wEAAwE;IACxE,uFAAU,CAAA;IACV,yEAAyE;IACzE,mGAAgB,CAAA;AAClB,CAAC,EAXW,8BAA8B,8CAA9B,8BAA8B,QAWzC;AAED;;;;GAIG;AACH,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACzC,qCAAqC;IACrC,mFAAO,CAAA;IACP,oDAAoD;IACpD,iFAAM,CAAA;IACN,gCAAgC;IAChC,yFAAU,CAAA;AACZ,CAAC,EAPW,+BAA+B,+CAA/B,+BAA+B,QAO1C;AAeD;;GAEG;AACH,MAAa,sBAAsB;IAQjC,2BAA2B;IAC3B,YAAmB,MAAM,GAAG,8BAA8B,CAAC,YAAY,EAAE,OAAO,GAAG,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,GAAG,KAAK;QACnJ,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,0CAA0C;IACnC,MAAM,CAAC,QAAQ,CAAC,KAAkC;QACvD,OAAO,IAAI,sBAAsB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,KAAK,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACpG,CAAC;IAED,sCAAsC;IAC/B,MAAM;QACX,MAAM,KAAK,GAAgC;YACzC,MAAM,EAAE,IAAI,CAAC,M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AI,CAAC,MAAM,KAAK,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;QAErC,IAAI,UAAU,KAAK,IAAI,CAAC,MAAM;YAC5B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QAE3B,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,4CAA4C;IACrC,KAAK;QACV,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;IAED,IAAY,MAAM;QAChB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IACpF,CAAC;CACF;AA7LD,gDA6LC;AAED,SAAS,aAAa,CAAC,OAAe;IACpC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,8BAA8B,CAAC,GAAG,CAAC;QACxC,KAAK,8BAA8B,CAAC,EAAE,CAAC;QACvC,KAAK,8BAA8B,CAAC,MAAM,CAAC;QAC3C,KAAK,8BAA8B,CAAC,MAAM,CAAC;QAC3C,KAAK,8BAA8B,CAAC,YAAY;YAC9C,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,8BAA8B,CAAC,YAAY,CAAC;IACvD,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,OAAe;IACrC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,+BAA+B,CAAC,GAAG,CAAC;QACzC,KAAK,+BAA+B,CAAC,EAAE,CAAC;QACxC,KAAK,+BAA+B,CAAC,MAAM;YACzC,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,+BAA+B,CAAC,MAAM,CAAC;IAClD,CAAC;AACH,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\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { ModelMapLayerSettings } from \"./MapLayerSettings\";\r\n\r\n/** Describes how a [[SpatialClassifier]] affects the display of classified geometry - that is, geometry intersecting\r\n * the classifier.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SpatialClassifierInsideDisplay {\r\n /** The geometry is not displayed. */\r\n Off = 0,\r\n /** The geometry is displayed without alteration. */\r\n On = 1,\r\n /** The geometry is darkened. */\r\n Dimmed = 2,\r\n /** The geometry is tinted by the [Viewport.hilite]($frontend) color. */\r\n Hilite = 3,\r\n /** The geometry is tinted with the colors of the classifier elements. */\r\n ElementColor = 4,\r\n}\r\n\r\n/** Describes how a [[SpatialClassifier]] affects the display of unclassified geometry - that is, geometry not intersecting\r\n * the classifier.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SpatialClassifierOutsideDisplay {\r\n /** The geometry is not displayed. */\r\n Off = 0,\r\n /** The geometry is displayed without alteration. */\r\n On = 1,\r\n /** The geometry is darkened. */\r\n Dimmed = 2,\r\n}\r\n\r\n/** JSON representation of a [[SpatialClassifierFlags]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialClassifierFlagsProps {\r\n /** See [[SpatialClassifierFlags.inside]]. */\r\n inside: SpatialClassifierInsideDisplay;\r\n /** See [[SpatialClassifierFlags.outside]]. */\r\n outside: SpatialClassifierOutsideDisplay;\r\n /** See [[SpatialClassifierFlags.isVolumeClassifier]]. */\r\n isVolumeClassifier?: boolean;\r\n}\r\n\r\n/** Flags affecting how a [[SpatialClassifier]] is applied.\r\n * @public\r\n */\r\nexport class SpatialClassifierFlags {\r\n /** How geometry intersecting the classifier should be displayed. */\r\n public readonly inside: SpatialClassifierInsideDisplay;\r\n /** How geometry not intersecting the classifier should be displayed. */\r\n public readonly outside: SpatialClassifierOutsideDisplay;\r\n /** True for volume classification; false for planar classification. */\r\n public readonly isVolumeClassifier: boolean;\r\n\r\n /** Construct new flags. */\r\n public constructor(inside = SpatialClassifierInsideDisplay.ElementColor, outside = SpatialClassifierOutsideDisplay.Dimmed, isVolumeClassifier = false) {\r\n this.inside = insideDisplay(inside);\r\n this.outside = outsideDisplay(outside);\r\n this.isVolumeClassifier = isVolumeClassifier;\r\n }\r\n\r\n /** Construct from JSON representation. */\r\n public static fromJSON(props: SpatialClassifierFlagsProps): SpatialClassifierFlags {\r\n return new SpatialClassifierFlags(props.inside, props.outside, true === props.isVolumeClassifier);\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): SpatialClassifierFlagsProps {\r\n const props: SpatialClassifierFlagsProps = {\r\n inside: this.inside,\r\n outside: this.outside,\r\n };\r\n\r\n if (this.isVolumeClassifier)\r\n props.isVolumeClassifier = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Create flags indentical to these ones except for any properties explicitly specified by `changedProps`. */\r\n public clone(changedProps?: Partial<SpatialClassifierFlagsProps>): SpatialClassifierFlags {\r\n if (!changedProps)\r\n return this;\r\n\r\n return SpatialClassifierFlags.fromJSON({ ...this.toJSON(), ...changedProps });\r\n }\r\n\r\n /** Return true if these flags are equivalent to `other`. */\r\n public equals(other: SpatialClassifierFlags): boolean {\r\n if (other === this)\r\n return true;\r\n\r\n return other.inside === this.inside && other.outside === this.outside && other.isVolumeClassifier === this.isVolumeClassifier;\r\n }\r\n\r\n /** Return true if these flags are equivalent to `props`. */\r\n public equalsProps(props: SpatialClassifierFlagsProps): boolean {\r\n return this.inside === props.inside && this.outside === props.outside && this.isVolumeClassifier === (true === props.isVolumeClassifier);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[SpatialClassifier]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialClassifierProps {\r\n /** See [[SpatialClassifier.modelId]]. */\r\n modelId: Id64String;\r\n /** See [[SpatialClassifier.expand]]. */\r\n expand: number;\r\n /** See [[SpatialClassifier.flags]]. */\r\n flags: SpatialClassifierFlagsProps;\r\n /** See [[SpatialClassifier.name]]. */\r\n name: string;\r\n /** Records whether this is the active classifier.\r\n * See [[SpatialClassifier.active]].\r\n */\r\n isActive?: boolean;\r\n}\r\n\r\n/** Describes how to use the geometry of one [GeometricModel]($backend) to classify the contents of other models - most typically, reality models.\r\n * Applying a classifier divides the geometry of the classified model into two groups:\r\n * - Classified (intersecting the classifier); and\r\n * - Unclassified (not intersecting the classifier).\r\n * For example, a model containing the building footprints for a city block could be used to classify a reality mesh captured from photographs of the\r\n * real-world block. Then, buildings within the reality mesh can be selected individually, and present the properties of the classifier geometry (e.g.,\r\n * the address of the building). The appearance of the geometry can also be customized based using [[SpatialClassifierInsideDisplay]] and [[SpatialClassifierOutsideDisplay]].\r\n * Two types of classification are supported:\r\n * - Planar classification, in which the geometry of the classifier model is projected onto a plane to classify geometry within a region extruded perpendicular\r\n * the plane (e.g., the building footprints example); and\r\n * - Volume classification, in which closed, non-intersecting volumes within the classifier classify geometry that intersects (i.e. is contained within) those same volumes (e.g., imagine using boxes instead\r\n * of footprints to classify buildings, or floors of buildings).\r\n * @see this (interactive example)[https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=classifier-sample].\r\n * @see [[SpatialClassifiers]] to define a set of classifiers.\r\n * @see [[ContextRealityModel.classifiers]] to classify a context reality model.\r\n * @see [SpatialModelState.classifiers]($frontend) to classify a persistent reality model.\r\n * @public\r\n */\r\nexport class SpatialClassifier {\r\n /** The Id of the [GeometricModel]($backend) whose geometry is used to produce the classifier. */\r\n public readonly modelId: Id64String;\r\n /** A distance in meters by which to expand the classifier geometry. For example, if line strings are used to represent streets,\r\n * you might expand them to the average width of a street.\r\n */\r\n public readonly expand: number;\r\n /** Flags controlling how to apply the classifier. */\r\n public readonly flags: SpatialClassifierFlags;\r\n /** A user-friendly name, useful for identifying individual classifiers within a [[SpatialClassifiers]]. */\r\n public readonly name: string;\r\n\r\n /** Construct a new classifier. */\r\n public constructor(modelId: Id64String, name: string, flags = new SpatialClassifierFlags(), expand = 0) {\r\n this.modelId = modelId;\r\n this.expand = expand;\r\n this.flags = flags;\r\n this.name = name;\r\n }\r\n\r\n /** Construct from JSON representation. */\r\n public static fromJSON(props: SpatialClassifierProps): SpatialClassifier {\r\n return new SpatialClassifier(props.modelId, props.name, SpatialClassifierFlags.fromJSON(props.flags), props.expand);\r\n }\r\n\r\n /** Convert to JSON representation.\r\n * @note This method always sets the [[SpatialClassifierProps.isActive]] property to `false`.\r\n */\r\n public toJSON(): SpatialClassifierProps {\r\n return {\r\n modelId: this.modelId,\r\n expand: this.expand,\r\n flags: this.flags.toJSON(),\r\n name: this.name,\r\n isActive: false,\r\n };\r\n }\r\n\r\n /** Construct from Model Map Layer.\r\n * @beta\r\n */\r\n public static fromModelMapLayer(mapLayer: ModelMapLayerSettings): SpatialClassifier {\r\n const flags = SpatialClassifierFlags.fromJSON({ inside: SpatialClassifierInsideDisplay.Off, outside: SpatialClassifierOutsideDisplay.Off });\r\n\r\n return new SpatialClassifier(mapLayer.modelId, mapLayer.name, flags);\r\n }\r\n\r\n /** Create a classifier identical to this one except for any properties explicitly specified by `changedProps`. */\r\n public clone(changedProps?: Partial<SpatialClassifierProps>): SpatialClassifier {\r\n if (!changedProps)\r\n return this;\r\n\r\n return SpatialClassifier.fromJSON({ ...this.toJSON(), ...changedProps });\r\n }\r\n\r\n /** Return true if this classifier is equivalent to `other`. */\r\n public equals(other: SpatialClassifier): boolean {\r\n if (other === this)\r\n return true;\r\n\r\n return this.modelId === other.modelId && this.expand === other.expand && this.name === other.name && this.flags.equals(other.flags);\r\n }\r\n\r\n /** Return true if this classifier is equivalent to `props`. */\r\n public equalsProps(props: SpatialClassifierProps): boolean {\r\n return this.modelId === props.modelId && this.expand === props.expand && this.name === props.name && this.flags.equalsProps(props.flags);\r\n }\r\n}\r\n\r\n/** An object that can store the JSON representation of a list of [[SpatialClassifier]]s.\r\n * @see [[SpatialClassifiers]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialClassifiersContainer {\r\n /** The list of classifiers. */\r\n classifiers?: SpatialClassifierProps[];\r\n}\r\n\r\n/** A set of [[SpatialClassifier]]s for a given reality model. At most one of the classifiers can be actively classifying the model at any given time.\r\n * The set of classifiers can be presented to the user, listed by name, so that the active classifier can be changed.\r\n * The set of classifiers is populated from its JSON representation and that representation is kept in sync as the set of classifiers is modified.\r\n * @see this (interactive example)[https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=classifier-sample].\r\n * @see [[SpatialClassifier]] for details on how spatial classification works.\r\n * @see [[ContextRealityModel.classifiers]] to define classifiers for a context reality model.\r\n * @see [SpatialModelState.classifiers]($frontend) to define classifiers for a persistent reality model.\r\n * @public\r\n */\r\nexport class SpatialClassifiers implements Iterable<SpatialClassifier> {\r\n private readonly _json: SpatialClassifiersContainer;\r\n private readonly _classifiers: SpatialClassifier[] = [];\r\n private _active?: SpatialClassifier;\r\n\r\n /** Construct a new set of classifiers from the JSON representation. The set will be initialized from `container.classifiers` and that JSON representation\r\n * will be kept in sync with changes made to the set. The caller should not directly modify `container.classifiers` or its contents as that will cause the set to become out\r\n * of sync with the JSON representation.\r\n * The [[active]] classifier will be determined by the first [[SpatialClassifierProps]] whose `isActive` property is set to `true`, if any.\r\n */\r\n public constructor(container: SpatialClassifiersContainer) {\r\n this._json = container;\r\n\r\n const json = this._array;\r\n if (!json)\r\n return;\r\n\r\n for (const props of json) {\r\n const classifier = SpatialClassifier.fromJSON(props);\r\n this._classifiers.push(classifier);\r\n if (props.isActive) {\r\n if (!this._active)\r\n this._active = classifier;\r\n else\r\n props.isActive = false;\r\n }\r\n }\r\n }\r\n\r\n /** The classifier currently classifying the target reality model. The classifier passed to the setter must be one obtained from this set, or one equivalent to\r\n * one contained in this set; in the latter case, the equivalent classifier contained in this set becomes active.\r\n */\r\n /** The classifier currently classifying the target reality model, if any.\r\n * @see [[setActive]] to change the active classifier.\r\n */\r\n public get active(): SpatialClassifier | undefined {\r\n return this._active;\r\n }\r\n\r\n /** Change the [[active]] classifier. The input must be a classifier belonging to this set, or equivalent to one in the set.\r\n * If no equivalent classifier exists in the set, the active classifier remains unchanged.\r\n * @param The classifier to set as active, or `undefined` to clear the active classifier.\r\n * @returns the active classifier.\r\n */\r\n public setActive(active: SpatialClassifier | undefined): SpatialClassifier | undefined {\r\n const array = this._array;\r\n if (!array)\r\n return this.active;\r\n\r\n if (active) {\r\n active = this.findEquivalent(active);\r\n if (!active)\r\n return this.active;\r\n }\r\n\r\n if (active === this.active)\r\n return this.active;\r\n\r\n let propsIndex = -1;\r\n if (active) {\r\n propsIndex = array.findIndex((x) => active.equalsProps(x));\r\n if (-1 === propsIndex)\r\n return this.active;\r\n }\r\n\r\n this._active = active;\r\n for (let i = 0; i < array.length; i++)\r\n array[i].isActive = (i === propsIndex);\r\n\r\n return this.active;\r\n }\r\n\r\n /** Obtain an iterator over the classifiers contained in this set. */\r\n public [Symbol.iterator](): Iterator<SpatialClassifier> {\r\n return this._classifiers[Symbol.iterator]();\r\n }\r\n\r\n /** The number of classifiers in this set. */\r\n public get size(): number {\r\n return this._array?.length ?? 0;\r\n }\r\n\r\n /** Returns the first classifier that satisfies `criterion`, or `undefined` if no classifier satisfies it. */\r\n public find(criterion: (classifier: SpatialClassifier) => boolean): SpatialClassifier | undefined {\r\n return this._classifiers.find(criterion);\r\n }\r\n\r\n /** Find the first classifier that is equivalent to the supplied classifier, or `undefined` if no equivalent classifier exists in this set. */\r\n public findEquivalent(classifier: SpatialClassifier): SpatialClassifier | undefined {\r\n return this.find((x) => x.equals(classifier));\r\n }\r\n\r\n /** Return true if the specified classifier or one equivalent to it exists in this set. */\r\n public has(classifier: SpatialClassifier): boolean {\r\n return undefined !== this.findEquivalent(classifier);\r\n }\r\n\r\n /** Add a classifier to this set. If an equivalent classifier already exists, the supplied classifier is not added.\r\n * @param classifier The classifier to add.\r\n * @returns The equivalent pre-existing classifier, if one existed; or the supplied classifier, if it was added to the set.\r\n */\r\n public add(classifier: SpatialClassifier): SpatialClassifier {\r\n const existing = this.findEquivalent(classifier);\r\n if (existing)\r\n return existing;\r\n\r\n let array = this._array;\r\n if (!array)\r\n array = this._json.classifiers = [];\r\n\r\n this._classifiers.push(classifier);\r\n array.push(classifier.toJSON());\r\n return classifier;\r\n }\r\n\r\n /** Replace an existing classifier with a different one.\r\n * @param toReplace The classifier to be replaced.\r\n * @param replacement The classifier to replace `toReplace`.\r\n * @returns true if a classifier equivalent to `toReplace` existed in the set and was replaced by `replacement`.\r\n * @note If `toReplace` was the [[active]] classifier, `replacement` will become active.\r\n */\r\n public replace(toReplace: SpatialClassifier, replacement: SpatialClassifier): boolean {\r\n const list = this._array;\r\n if (!list)\r\n return false;\r\n\r\n const classifierIndex = this._classifiers.findIndex((x) => x.equals(toReplace));\r\n if (-1 === classifierIndex)\r\n return false;\r\n\r\n const propsIndex = list.findIndex((x) => toReplace.equalsProps(x));\r\n assert(propsIndex === classifierIndex);\r\n if (-1 === propsIndex)\r\n return false;\r\n\r\n toReplace = this._classifiers[classifierIndex];\r\n const wasActive = this.active === toReplace;\r\n\r\n this._classifiers[classifierIndex] = replacement;\r\n const props = list[propsIndex] = replacement.toJSON();\r\n\r\n if (wasActive) {\r\n props.isActive = true;\r\n this._active = replacement;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Remove the first classifier equivalent to `classifier` from this set.\r\n * @param classifier The classifier to remove.\r\n * @returns The classifier that was actually removed, or `undefined` if none was removed.\r\n */\r\n public delete(classifier: SpatialClassifier): SpatialClassifier | undefined {\r\n const list = this._array;\r\n if (!list)\r\n return undefined;\r\n\r\n const classifierIndex = this._classifiers.findIndex((x) => x.equals(classifier));\r\n if (-1 === classifierIndex)\r\n return undefined;\r\n\r\n classifier = this._classifiers[classifierIndex];\r\n const propsIndex = list.findIndex((x) => classifier.equalsProps(x));\r\n assert(propsIndex === classifierIndex);\r\n if (-1 === propsIndex)\r\n return undefined;\r\n\r\n list.splice(propsIndex, 1);\r\n this._classifiers.splice(classifierIndex, 1);\r\n if (list.length === 0)\r\n this._json.classifiers = undefined;\r\n\r\n if (classifier === this.active)\r\n this._active = undefined;\r\n\r\n return classifier;\r\n }\r\n\r\n /** Remove all classifiers from this set. */\r\n public clear(): void {\r\n this._classifiers.length = 0;\r\n this._json.classifiers = undefined;\r\n this._active = undefined;\r\n }\r\n\r\n private get _array(): SpatialClassifierProps[] | undefined {\r\n return Array.isArray(this._json.classifiers) ? this._json.classifiers : undefined;\r\n }\r\n}\r\n\r\nfunction insideDisplay(display: number): SpatialClassifierInsideDisplay {\r\n switch (display) {\r\n case SpatialClassifierInsideDisplay.Off:\r\n case SpatialClassifierInsideDisplay.On:\r\n case SpatialClassifierInsideDisplay.Dimmed:\r\n case SpatialClassifierInsideDisplay.Hilite:\r\n case SpatialClassifierInsideDisplay.ElementColor:\r\n return display;\r\n default:\r\n return SpatialClassifierInsideDisplay.ElementColor;\r\n }\r\n}\r\n\r\nfunction outsideDisplay(display: number): SpatialClassifierOutsideDisplay {\r\n switch (display) {\r\n case SpatialClassifierOutsideDisplay.Off:\r\n case SpatialClassifierOutsideDisplay.On:\r\n case SpatialClassifierOutsideDisplay.Dimmed:\r\n return display;\r\n default:\r\n return SpatialClassifierOutsideDisplay.Dimmed;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SubCategoryAppearance.js","sourceRoot":"","sources":["../../src/SubCategoryAppearance.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,yCAAqD;AAErD;;;;GAIG;AACH,MAAa,qBAAqB;IAoChC;;;OAGG;IACH,IAAW,SAAS,KAAe,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3G,q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AAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;;AA9H5F,sDAiIC;AADe,8BAAQ,GAAG,IAAI,qBAAqB,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 Symbology\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\n\r\n/** Parameters that define the way geometry on a [[SubCategory]] appears.\r\n * SubCategoryAppearance describes the intrinsic appearance of geometry belonging to that SubCategory, independent of a particular [[ViewState]].\r\n * Aspects of a SubCategory's appearance can be overridden in the context of a particular [[ViewState]] through the use of [[SubCategoryOverride]]s.\r\n * @public\r\n */\r\nexport class SubCategoryAppearance {\r\n /** The color of the geometry.\r\n * @note The transparency component of the color is ignored.\r\n * @see [[SubCategoryAppearance.transparency]].\r\n */\r\n public readonly color: ColorDef;\r\n /** The line width, in pixels.\r\n * @note The renderer will clamp values to the integer range [1, 32].\r\n */\r\n public readonly weight: number;\r\n /** The display priority used to control which geometry draws in front of other geometry within a 2D view.\r\n * The priority is a number in the range [-8388576,8388576].\r\n * Where two pieces of geometry overlap, the one with the larger priority value draws on top of the one with the smaller priority.\r\n * If they have equal priorities, the order in which they draw is undefined, and z-fighting may result.\r\n * @note This property has no effect in 3D views unless [[PlanProjectionSettings]] are in effect.\r\n */\r\n public readonly priority: number;\r\n /** A value in the range [0, 1] indicating the transparency of the geometry where 0.0 means \"fully opaque\" and 1.0 means \"fully transparent\". */\r\n public readonly transparency: number;\r\n /** If true, geometry belonging to this SubCategory is not drawn. */\r\n public readonly invisible: boolean;\r\n /** @internal */\r\n public readonly dontPlot: boolean;\r\n /** @internal */\r\n public readonly dontSnap: boolean;\r\n /** @internal */\r\n public readonly dontLocate: boolean;\r\n /** The element ID of the line style used to draw curves, or an invalid ID if no line style is specified. */\r\n public readonly styleId: Id64String;\r\n /** The element ID of the material applied to surfaces, or an invalid ID if no material is specified. */\r\n public readonly materialId: Id64String;\r\n /** @internal */\r\n protected readonly _fillColor?: ColorDef;\r\n /** @internal */\r\n protected readonly _fillTransparency?: number;\r\n\r\n /** The fill color of geometry marked as being filled.\r\n * @note The transparency component of the fill color is ignored.\r\n * @see [[SubCategoryAppearance.fillTransparency]].\r\n */\r\n public get fillColor(): ColorDef { return (undefined !== this._fillColor ? this._fillColor : this.color); }\r\n /** A value in the range [0, 1] indicating the fill transparency of the geometry where 0.0 means \"fully opaque\" and 1.0 means \"fully transparent\". */\r\n public get fillTransparency(): number { return (undefined !== this._fillTransparency ? this._fillTransparency : this.transparency); }\r\n\r\n constructor(props?: SubCategoryAppearance.Props) {\r\n if (!props) {\r\n this.color = ColorDef.black;\r\n this.weight = 0;\r\n this.priority = 0;\r\n this.transparency = 0;\r\n this.invisible = this.dontPlot = this.dontSnap = this.dontLocate = false;\r\n this.styleId = Id64.invalid;\r\n this.materialId = Id64.invalid;\r\n return;\r\n }\r\n\r\n this.invisible = JsonUtils.asBool(props.invisible);\r\n this.dontSnap = JsonUtils.asBool(props.dontSnap);\r\n this.dontLocate = JsonUtils.asBool(props.dontLocate);\r\n this.dontPlot = JsonUtils.asBool(props.dontPlot);\r\n this.color = ColorDef.fromJSON(props.color);\r\n this.weight = JsonUtils.asInt(props.weight);\r\n this.styleId = Id64.fromJSON(props.style);\r\n this.priority = JsonUtils.asInt(props.priority);\r\n this.materialId = Id64.fromJSON(props.material);\r\n this.transparency = JsonUtils.asDouble(props.transp);\r\n if (props.fill)\r\n this._fillColor = ColorDef.fromJSON(props.fill);\r\n if (props.transpFill)\r\n this._fillTransparency = JsonUtils.asDouble(props.transpFill);\r\n }\r\n\r\n public equals(other: SubCategoryAppearance): boolean {\r\n return this.invisible === other.invisible &&\r\n this.dontPlot === other.dontPlot &&\r\n this.dontSnap === other.dontSnap &&\r\n this.dontLocate === other.dontLocate &&\r\n this.color.equals(other.color) &&\r\n this.weight === other.weight &&\r\n this.priority === other.priority &&\r\n this.styleId === other.styleId &&\r\n this.materialId === other.materialId &&\r\n this.transparency === other.transparency &&\r\n this.fillColor.equals(other.fillColor) &&\r\n this.fillTransparency === other.fillTransparency;\r\n }\r\n\r\n /** @internal */\r\n public toJSON(): SubCategoryAppearance.Props {\r\n const val: SubCategoryAppearance.Props = { color: this.color.toJSON() };\r\n if (this.invisible)\r\n val.invisible = true;\r\n\r\n if (this.dontPlot)\r\n val.dontPlot = true;\r\n\r\n if (this.dontSnap)\r\n val.dontSnap = true;\r\n\r\n if (this.dontLocate)\r\n val.dontLocate = true;\r\n\r\n if (0 !== this.weight)\r\n val.weight = this.weight;\r\n\r\n if (0 !== this.priority)\r\n val.priority = this.priority;\r\n\r\n if (Id64.isValid(this.styleId))\r\n val.style = this.styleId;\r\n\r\n if (Id64.isValid(this.materialId))\r\n val.material = this.materialId;\r\n\r\n if (0.0 !== this.transparency)\r\n val.transp = this.transparency;\r\n\r\n if (this._fillColor)\r\n val.fill = this._fillColor.toJSON();\r\n\r\n if (this._fillTransparency)\r\n val.transpFill = this._fillTransparency;\r\n\r\n return val;\r\n }\r\n\r\n public clone(): SubCategoryAppearance { return new SubCategoryAppearance(this.toJSON()); }\r\n\r\n public static defaults = new SubCategoryAppearance();\r\n}\r\n\r\n/** @public */\r\nexport namespace SubCategoryAppearance { // eslint-disable-line no-redeclare\r\n /** Properties used to create a SubCategoryAppearance\r\n * See [[SubCategoryAppearance]]\r\n */\r\n export interface Props {\r\n /** See [[SubCategoryAppearance.color]]. Defaults to black. */\r\n color?: ColorDefProps;\r\n /** See [[SubCategoryAppearance.fillColor]]. Defaults to [[SubCategoryAppearance.color]]. */\r\n fill?: ColorDefProps;\r\n /** See [[SubCategoryAppearance.invisible]]. Defaults to false. */\r\n invisible?: boolean;\r\n /** @internal */\r\n dontPlot?: boolean;\r\n /** @internal */\r\n dontSnap?: boolean;\r\n /** @internal */\r\n dontLocate?: boolean;\r\n /** See [[SubCategoryAppearance.weight]]. Defaults to 0. */\r\n weight?: number;\r\n /** See [[SubCategoryAppearance.styleId]]. Defaults to an invalid ID indicating \"no line style\". */\r\n style?: Id64String;\r\n /** See [[SubCategoryAppearance.priority]]. Defaults to 0. */\r\n priority?: number;\r\n /** See [[SubCategoryAppearance.materialId]]. Defaults to an invalid ID indicating \"no material\". */\r\n material?: Id64String;\r\n /** See [[SubCategoryAppearance.transparency]]. Defaults to 0. */\r\n transp?: number;\r\n /** See [[SubCategoryAppearance.fillTransparency]]. Defaults to [[SubCategoryAppearance.transparency]]. */\r\n transpFill?: number;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SubCategoryAppearance.js","sourceRoot":"","sources":["../../src/SubCategoryAppearance.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,yCAAqD;AAErD;;;;GAIG;AACH,MAAa,qBAAqB;IAoChC;;;OAGG;IACH,IAAW,SAAS,KAAe,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3G,qJAAqJ;IACrJ,IAAW,gBAAgB,KAAa,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAErI,YAAY,KAAmC;QAC7C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,mBAAQ,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;YAClB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAC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IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ;YACrB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE/B,IAAI,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAC5B,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAE3B,IAAI,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;YAC/B,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC;QAEjC,IAAI,GAAG,KAAK,IAAI,CAAC,YAAY;YAC3B,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;QAEjC,IAAI,IAAI,CAAC,UAAU;YACjB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QAEtC,IAAI,IAAI,CAAC,iBAAiB;YACxB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAE1C,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,KAAK,KAA4B,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;;AA9H5F,sDAiIC;AADe,8BAAQ,GAAG,IAAI,qBAAqB,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 Symbology\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\n\r\n/** Parameters that define the way geometry on a [[SubCategory]] appears.\r\n * SubCategoryAppearance describes the intrinsic appearance of geometry belonging to that SubCategory, independent of a particular [[ViewState]].\r\n * Aspects of a SubCategory's appearance can be overridden in the context of a particular [[ViewState]] through the use of [[SubCategoryOverride]]s.\r\n * @public\r\n */\r\nexport class SubCategoryAppearance {\r\n /** The color of the geometry.\r\n * @note The transparency component of the color is ignored.\r\n * @see [[SubCategoryAppearance.transparency]].\r\n */\r\n public readonly color: ColorDef;\r\n /** The line width, in pixels.\r\n * @note The renderer will clamp values to the integer range [1, 32].\r\n */\r\n public readonly weight: number;\r\n /** The display priority used to control which geometry draws in front of other geometry within a 2D view.\r\n * The priority is a number in the range [-8388576,8388576].\r\n * Where two pieces of geometry overlap, the one with the larger priority value draws on top of the one with the smaller priority.\r\n * If they have equal priorities, the order in which they draw is undefined, and z-fighting may result.\r\n * @note This property has no effect in 3D views unless [[PlanProjectionSettings]] are in effect.\r\n */\r\n public readonly priority: number;\r\n /** A value in the range [0, 1] indicating the transparency of the geometry where 0.0 means \"fully opaque\" and 1.0 means \"fully transparent\". */\r\n public readonly transparency: number;\r\n /** If true, geometry belonging to this SubCategory is not drawn. */\r\n public readonly invisible: boolean;\r\n /** @internal */\r\n public readonly dontPlot: boolean;\r\n /** @internal */\r\n public readonly dontSnap: boolean;\r\n /** @internal */\r\n public readonly dontLocate: boolean;\r\n /** The element ID of the line style used to draw curves, or an invalid ID if no line style is specified. */\r\n public readonly styleId: Id64String;\r\n /** The element ID of the material applied to surfaces, or an invalid ID if no material is specified. */\r\n public readonly materialId: Id64String;\r\n /** @internal */\r\n protected readonly _fillColor?: ColorDef;\r\n /** @internal */\r\n protected readonly _fillTransparency?: number;\r\n\r\n /** The fill color of geometry marked as being filled.\r\n * @note The transparency component of the fill color is ignored.\r\n * @see [[SubCategoryAppearance.fillTransparency]].\r\n */\r\n public get fillColor(): ColorDef { return (undefined !== this._fillColor ? this._fillColor : this.color); }\r\n /** A value in the range [0, 1] indicating the fill transparency of the geometry where 0.0 means \"fully opaque\" and 1.0 means \"fully transparent\". */\r\n public get fillTransparency(): number { return (undefined !== this._fillTransparency ? this._fillTransparency : this.transparency); }\r\n\r\n constructor(props?: SubCategoryAppearance.Props) {\r\n if (!props) {\r\n this.color = ColorDef.black;\r\n this.weight = 0;\r\n this.priority = 0;\r\n this.transparency = 0;\r\n this.invisible = this.dontPlot = this.dontSnap = this.dontLocate = false;\r\n this.styleId = Id64.invalid;\r\n this.materialId = Id64.invalid;\r\n return;\r\n }\r\n\r\n this.invisible = JsonUtils.asBool(props.invisible);\r\n this.dontSnap = JsonUtils.asBool(props.dontSnap);\r\n this.dontLocate = JsonUtils.asBool(props.dontLocate);\r\n this.dontPlot = JsonUtils.asBool(props.dontPlot);\r\n this.color = ColorDef.fromJSON(props.color);\r\n this.weight = JsonUtils.asInt(props.weight);\r\n this.styleId = Id64.fromJSON(props.style);\r\n this.priority = JsonUtils.asInt(props.priority);\r\n this.materialId = Id64.fromJSON(props.material);\r\n this.transparency = JsonUtils.asDouble(props.transp);\r\n if (props.fill)\r\n this._fillColor = ColorDef.fromJSON(props.fill);\r\n if (props.transpFill)\r\n this._fillTransparency = JsonUtils.asDouble(props.transpFill);\r\n }\r\n\r\n public equals(other: SubCategoryAppearance): boolean {\r\n return this.invisible === other.invisible &&\r\n this.dontPlot === other.dontPlot &&\r\n this.dontSnap === other.dontSnap &&\r\n this.dontLocate === other.dontLocate &&\r\n this.color.equals(other.color) &&\r\n this.weight === other.weight &&\r\n this.priority === other.priority &&\r\n this.styleId === other.styleId &&\r\n this.materialId === other.materialId &&\r\n this.transparency === other.transparency &&\r\n this.fillColor.equals(other.fillColor) &&\r\n this.fillTransparency === other.fillTransparency;\r\n }\r\n\r\n /** @internal */\r\n public toJSON(): SubCategoryAppearance.Props {\r\n const val: SubCategoryAppearance.Props = { color: this.color.toJSON() };\r\n if (this.invisible)\r\n val.invisible = true;\r\n\r\n if (this.dontPlot)\r\n val.dontPlot = true;\r\n\r\n if (this.dontSnap)\r\n val.dontSnap = true;\r\n\r\n if (this.dontLocate)\r\n val.dontLocate = true;\r\n\r\n if (0 !== this.weight)\r\n val.weight = this.weight;\r\n\r\n if (0 !== this.priority)\r\n val.priority = this.priority;\r\n\r\n if (Id64.isValid(this.styleId))\r\n val.style = this.styleId;\r\n\r\n if (Id64.isValid(this.materialId))\r\n val.material = this.materialId;\r\n\r\n if (0.0 !== this.transparency)\r\n val.transp = this.transparency;\r\n\r\n if (this._fillColor)\r\n val.fill = this._fillColor.toJSON();\r\n\r\n if (this._fillTransparency)\r\n val.transpFill = this._fillTransparency;\r\n\r\n return val;\r\n }\r\n\r\n public clone(): SubCategoryAppearance { return new SubCategoryAppearance(this.toJSON()); }\r\n\r\n public static defaults = new SubCategoryAppearance();\r\n}\r\n\r\n/** @public */\r\nexport namespace SubCategoryAppearance {\r\n /** Properties used to create a SubCategoryAppearance\r\n * See [[SubCategoryAppearance]]\r\n */\r\n export interface Props {\r\n /** See [[SubCategoryAppearance.color]]. Defaults to black. */\r\n color?: ColorDefProps;\r\n /** See [[SubCategoryAppearance.fillColor]]. Defaults to [[SubCategoryAppearance.color]]. */\r\n fill?: ColorDefProps;\r\n /** See [[SubCategoryAppearance.invisible]]. Defaults to false. */\r\n invisible?: boolean;\r\n /** @internal */\r\n dontPlot?: boolean;\r\n /** @internal */\r\n dontSnap?: boolean;\r\n /** @internal */\r\n dontLocate?: boolean;\r\n /** See [[SubCategoryAppearance.weight]]. Defaults to 0. */\r\n weight?: number;\r\n /** See [[SubCategoryAppearance.styleId]]. Defaults to an invalid ID indicating \"no line style\". */\r\n style?: Id64String;\r\n /** See [[SubCategoryAppearance.priority]]. Defaults to 0. */\r\n priority?: number;\r\n /** See [[SubCategoryAppearance.materialId]]. Defaults to an invalid ID indicating \"no material\". */\r\n material?: Id64String;\r\n /** See [[SubCategoryAppearance.transparency]]. Defaults to 0. */\r\n transp?: number;\r\n /** See [[SubCategoryAppearance.fillTransparency]]. Defaults to [[SubCategoryAppearance.transparency]]. */\r\n transpFill?: number;\r\n }\r\n}\r\n"]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CAAC,uBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACxF,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,+HAA+H;QACvH,6BAA6B,CAAC,OAA+B,EAAE,WAAsB,EAAE,iBAA6B;YAC1H,MAAM,MAAM,GAAc,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC;gBAE/D,IAAI,iBAAiB,KAAK,SAAS;oBACjC,iBAAiB,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAElD,MAAM,CAAC,IAAI,CAAC,uBAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KACF;IAtJY,qBAAM,SAsJlB,CAAA;AACH,CAAC,EAjRgB,cAAc,8BAAd,cAAc,QAiR9B;AAED,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { IndexedPolyfaceVisitor, Matrix3d, Point2d, Point3d, PolyfaceVisitor, Transform, Vector3d, XAndY } from \"@itwin/core-geometry\";\r\nimport { RenderTexture } from \"./RenderTexture\";\r\nimport { compareBooleans, compareBooleansOrUndefined, compareNumbers, compareNumbersOrUndefined, comparePossiblyUndefined } from \"@itwin/core-bentley\";\r\n\r\n/** Defines normal map parameters.\r\n * @beta\r\n */\r\nexport interface NormalMapParams {\r\n /** The texture to use as a normal map. If not present then the pattern map texture will be used as a normal map. */\r\n normalMap?: RenderTexture;\r\n /** True if the Y component stored in the green channel should be negated. By default, positive Y points downward, but some\r\n * normal maps are created with positive Y pointing upward.\r\n */\r\n greenUp?: boolean;\r\n /** Scale factor by which to multiply the components of the normal extracted from [[normalMap]]. */\r\n scale?: number;\r\n /** True if want to use constant LOD texture mapping for the normal map texture. */\r\n useConstantLod?: boolean;\r\n}\r\n\r\nfunction compareNormalMapParams(lhs: NormalMapParams, rhs: NormalMapParams): number {\r\n return comparePossiblyUndefined((lh, rh) => lh.compare(rh), lhs.normalMap, rhs.normalMap)\r\n || compareBooleansOrUndefined(lhs.greenUp, rhs.greenUp) || compareNumbersOrUndefined(lhs.scale, rhs.scale)\r\n || compareBooleansOrUndefined(lhs.useConstantLod, rhs.useConstantLod);\r\n}\r\n\r\n/** Describes how to map a [[RenderTexture]]'s image onto a surface as part of a [[RenderMaterial]].\r\n * @public\r\n */\r\nexport class TextureMapping {\r\n /** The texture to be mapped to the surface. If normalMapParams is present but does not contain a normal map, then texture is used as a normal map rather than a pattern map. */\r\n public readonly texture: RenderTexture;\r\n /** The parameters for normal mapping.\r\n * @beta\r\n */\r\n public normalMapParams?: NormalMapParams;\r\n /** The parameters describing how the textures are mapped to the surface. */\r\n public readonly params: TextureMapping.Params;\r\n\r\n public constructor(tx: RenderTexture, params: TextureMapping.Params) {\r\n this.texture = tx;\r\n this.params = params;\r\n }\r\n\r\n /** @internal */\r\n public computeUVParams(visitor: PolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined {\r\n return this.params.computeUVParams(visitor as IndexedPolyfaceVisitor, transformToImodel);\r\n }\r\n\r\n /** An [OrderedComparator]($bentley) that compares this mapping against `other`. */\r\n public compare(other: TextureMapping): number {\r\n if (this === other) {\r\n return 0;\r\n }\r\n\r\n return this.texture.compare(other.texture) || this.params.compare(other.params)\r\n || comparePossiblyUndefined((lh, rh) => compareNormalMapParams(lh, rh), this.normalMapParams, other.normalMapParams);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace TextureMapping { // eslint-disable-line no-redeclare\r\n /** Enumerates the possible texture mapping modes. */\r\n export enum Mode {\r\n None = -1,\r\n Parametric = 0,\r\n ElevationDrape = 1,\r\n Planar = 2,\r\n /** @internal */\r\n DirectionalDrape = 3,\r\n /** @internal */\r\n Cubic = 4,\r\n /** @internal */\r\n Spherical = 5,\r\n /** @internal */\r\n Cylindrical = 6,\r\n /** @internal */\r\n Solid = 7,\r\n /** @internal Only valid for lights */\r\n FrontProject = 8,\r\n }\r\n\r\n /** A 2x3 matrix for mapping a texture image to a surface. */\r\n export class Trans2x3 {\r\n /** The 3x4 transform produced from the 2x3 matrix. */\r\n public readonly transform: Transform;\r\n\r\n /** Construct from the two rows of the matrix:\r\n * ```\r\n * | m00 m01 originX |\r\n * | m10 m11 originY |\r\n * ```\r\n * Producing the [Transform]($core-geometry):\r\n * ```\r\n * | m00 m01 0 originX |\r\n * | m10 m11 0 originY |\r\n * | 0 0 1 0 |\r\n * ```\r\n */\r\n public constructor(m00 = 1, m01 = 0, originX = 0, m10 = 0, m11 = 1, originY = 0) {\r\n const origin = new Point3d(originX, originY, 0);\r\n const matrix = Matrix3d.createRowValues(m00, m01, 0, m10, m11, 0, 0, 0, 1);\r\n this.transform = Transform.createRefs(origin, matrix);\r\n }\r\n\r\n /** An immutable 2x3 identity matrix. */\r\n public static readonly identity = new Trans2x3();\r\n\r\n /** An [OrderedComparator]($bentley) that compares this Trans2x3 against `other`. */\r\n public compare(other: Trans2x3): number {\r\n if (this === other) {\r\n return 0;\r\n }\r\n\r\n const originDiff = compareNumbers(this.transform.origin.x, other.transform.origin.x) || compareNumbers(this.transform.origin.y, other.transform.origin.y);\r\n if (originDiff !== 0) {\r\n return originDiff;\r\n }\r\n\r\n for (const i of [0, 1, 3, 4]) {\r\n const matDiff = compareNumbers(this.transform.matrix.coffs[i], other.transform.matrix.coffs[i]);\r\n if (matDiff !== 0) {\r\n return matDiff;\r\n }\r\n }\r\n\r\n return 0;\r\n }\r\n }\r\n\r\n /** Properties used to construct a [[TextureMapping.ConstantLodParams]]. */\r\n export interface ConstantLodParamProps {\r\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1. */\r\n repetitions?: number;\r\n /** An offset in world units used to shift the texture. Defaults to (0, 0). */\r\n offset?: XAndY;\r\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. Defaults to 1.*/\r\n minDistClamp?: number;\r\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. Defaults to 2^32. */\r\n maxDistClamp?: number;\r\n }\r\n\r\n /** Parameters to define constant level of detail mapping mode, a mode of texture coordinate generation which dynamically creates\r\n * texture cooprdinates so that the level of detail of the texture in the rendered image remains somewhat constant. */\r\n export interface ConstantLodParams {\r\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. */\r\n repetitions: number;\r\n /** An offset in world units used to shift the texture. */\r\n offset: XAndY;\r\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. */\r\n minDistClamp: number;\r\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. */\r\n maxDistClamp: number;\r\n }\r\n\r\n function compareConstantLodParams(lhs: ConstantLodParams, rhs: ConstantLodParams): number {\r\n return compareNumbers(lhs.repetitions, rhs.repetitions) || compareNumbers(lhs.offset.x, rhs.offset.x) || compareNumbers(lhs.offset.y, rhs.offset.y)\r\n || compareNumbers(lhs.minDistClamp, rhs.minDistClamp) || compareNumbers(lhs.maxDistClamp, rhs.maxDistClamp);\r\n }\r\n\r\n /** Properties used to construct a [[TextureMapping.Params]]. */\r\n export interface ParamProps {\r\n /** The matrix used to map the image to a surface. */\r\n textureMat2x3?: TextureMapping.Trans2x3;\r\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the surface's color.\r\n * A value of 0.0 uses only the surface color. A value of 1.0 uses only the texture color. A value of 0.5 uses an even mix of both.\r\n * @note This affects only the red, green, and blue components of the color. The alpha sampled from the texture is always multiplied by the surface color's alpha.\r\n * @note Defaults to 1.0\r\n */\r\n textureWeight?: number;\r\n /** The mode by which to map the image to a surface.\r\n * @note Defaults to [[TextureMapping.Mode.Parametric]].\r\n */\r\n mapMode?: TextureMapping.Mode;\r\n /** @internal */\r\n worldMapping?: boolean;\r\n /** True if want to use constant LOD texture mapping for the surface texture. */\r\n useConstantLod?: boolean;\r\n /** Parameters for constantLod mapping mode. */\r\n constantLodProps?: ConstantLodParamProps;\r\n }\r\n\r\n /** Parameters describing how a [[RenderTexture]]'s image is mapped to a surface. */\r\n export class Params {\r\n /** The matrix used to map the image to a surface. */\r\n public textureMatrix: TextureMapping.Trans2x3;\r\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the element's color.\r\n * A value of 0.0 uses only the element color. A value of 1.0 uses only the texture color.\r\n */\r\n public weight: number;\r\n /** The mode by which to map the image to a surface. */\r\n public mode: TextureMapping.Mode;\r\n /** @internal */\r\n public worldMapping: boolean;\r\n /** True if want to use constant LOD texture mapping for the surface texture. */\r\n public useConstantLod: boolean;\r\n /** Parameters for constantLod mapping mode. */\r\n public constantLodParams: ConstantLodParams;\r\n\r\n public constructor(props?: TextureMapping.ParamProps) {\r\n this.textureMatrix = props?.textureMat2x3 ?? Trans2x3.identity;\r\n this.weight = props?.textureWeight ?? 1;\r\n this.mode = props?.mapMode ?? Mode.Parametric;\r\n this.worldMapping = props?.worldMapping ?? false;\r\n this.useConstantLod = props?.useConstantLod ?? false;\r\n this.constantLodParams = {\r\n repetitions: props?.constantLodProps?.repetitions ?? 1,\r\n offset: props?.constantLodProps?.offset ?? { x: 0, y: 0 },\r\n minDistClamp: props?.constantLodProps?.minDistClamp ?? 1,\r\n maxDistClamp: props?.constantLodProps?.maxDistClamp ?? 4096 * 1024 * 1024,\r\n };\r\n }\r\n\r\n /** An [OrderedComparator]($bentley) that compares these Params against `other`. */\r\n public compare(other: Params): number {\r\n if (this === other) {\r\n return 0;\r\n }\r\n\r\n return compareNumbers(this.weight, other.weight) || compareNumbers(this.mode, other.mode) || compareBooleans(this.worldMapping, other.worldMapping)\r\n || compareBooleans(this.useConstantLod, other.useConstantLod) || this.textureMatrix.compare(other.textureMatrix)\r\n || compareConstantLodParams(this.constantLodParams, other.constantLodParams);\r\n }\r\n\r\n /**\r\n * Generates UV parameters for textured surfaces. Returns undefined on failure.\r\n * @internal\r\n */\r\n public computeUVParams(visitor: IndexedPolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined {\r\n switch (this.mode) {\r\n default: // Fall through to parametric in default case\r\n case TextureMapping.Mode.Parametric: {\r\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\r\n }\r\n case TextureMapping.Mode.Planar: {\r\n const normalIndices = visitor.normalIndex;\r\n if (!normalIndices)\r\n return undefined;\r\n\r\n // Ignore planar mode unless master or sub units for scaleMode and facet is planar\r\n if (!this.worldMapping || (visitor.normalIndex !== undefined && (normalIndices[0] !== normalIndices[1] || normalIndices[0] !== normalIndices[2]))) {\r\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\r\n } else {\r\n return this.computePlanarUVParams(visitor, this.textureMatrix.transform);\r\n }\r\n }\r\n case TextureMapping.Mode.ElevationDrape: {\r\n return this.computeElevationDrapeUVParams(visitor, this.textureMatrix.transform, transformToImodel);\r\n }\r\n }\r\n }\r\n\r\n /** Computes UV parameters given a texture mapping mode of parametric. */\r\n private computeParametricUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, isRelativeUnits: boolean): Point2d[] {\r\n const params: Point2d[] = [];\r\n for (let i = 0; i < visitor.numEdgesThisFacet; i++) {\r\n let param = Point2d.create();\r\n\r\n if (isRelativeUnits || !visitor.tryGetDistanceParameter(i, param)) {\r\n if (!visitor.tryGetNormalizedParameter(i, param)) {\r\n // If mesh does not have facetFaceData, we still want to use the texture coordinates if they are present\r\n param = visitor.getParam(i)!;\r\n }\r\n }\r\n\r\n params.push(uvTransform.multiplyPoint2d(param));\r\n }\r\n return params;\r\n }\r\n\r\n /** Computes UV parameters given a texture mapping mode of planar. The result is stored in the Point2d array given. */\r\n private computePlanarUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform): Point2d[] | undefined {\r\n const params: Point2d[] = [];\r\n const points = visitor.point;\r\n let normal: Vector3d;\r\n\r\n if (visitor.normal === undefined)\r\n normal = points.getPoint3dAtUncheckedPointIndex(0).crossProductToPoints(points.getPoint3dAtUncheckedPointIndex(1), points.getPoint3dAtUncheckedPointIndex(2));\r\n else\r\n normal = visitor.normal.getVector3dAtCheckedVectorIndex(0)!;\r\n\r\n if (!normal.normalize(normal))\r\n return undefined;\r\n\r\n // adjust U texture coordinate to be a continuous length starting at the\r\n // origin. V coordinate stays the same. This mode assumes Z is up vector\r\n\r\n // Flipping normal puts us in a planar coordinate system consistent with MicroStation's display system\r\n normal.scale(-1.0, normal);\r\n\r\n // pick the first vertex normal\r\n const sideVector = Vector3d.create(normal.y, -normal.x, 0.0);\r\n\r\n // if the magnitude of the normal is near zero, the real normal points\r\n // almost straighten up.. In this case, use Y as the up vector to match QV\r\n\r\n const magnitude = sideVector.magnitude();\r\n sideVector.normalize(sideVector); // won't remain undefined if failed due to following check..\r\n\r\n if (magnitude < 1e-3) {\r\n normal.set(0, 0, -1);\r\n sideVector.set(1, 0, 0);\r\n }\r\n\r\n const upVector = sideVector.crossProduct(normal).normalize();\r\n if (!upVector)\r\n return undefined;\r\n\r\n const numEdges = visitor.numEdgesThisFacet;\r\n for (let i = 0; i < numEdges; i++) {\r\n const vector = Vector3d.createFrom(points.getPoint3dAtUncheckedPointIndex(i));\r\n\r\n params.push(Point2d.create(vector.dotProduct(sideVector), vector.dotProduct(upVector)));\r\n uvTransform.multiplyPoint2d(params[i], params[i]);\r\n }\r\n return params;\r\n }\r\n\r\n /** Computes UV parameters given a texture mapping mode of elevation drape. The result is stored in the Point2d array given. */\r\n private computeElevationDrapeUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, transformToIModel?: Transform): Point2d[] {\r\n const params: Point2d[] = [];\r\n const numEdges = visitor.numEdgesThisFacet;\r\n for (let i = 0; i < numEdges; i++) {\r\n const point = visitor.point.getPoint3dAtUncheckedPointIndex(i);\r\n\r\n if (transformToIModel !== undefined)\r\n transformToIModel.multiplyPoint3d(point, point);\r\n\r\n params.push(Point2d.createFrom(point));\r\n uvTransform.multiplyPoint2d(params[i], params[i]);\r\n }\r\n return params;\r\n }\r\n }\r\n}\r\n\r\nObject.freeze(TextureMapping.Trans2x3.identity);\r\n"]}
1
+ {"version":3,"file":"TextureMapping.js","sourceRoot":"","sources":["../../src/TextureMapping.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAuI;AAEvI,sDAAuJ;AAkBvJ,SAAS,sBAAsB,CAAC,GAAoB,EAAE,GAAoB;IACxE,OAAO,IAAA,uCAAwB,EAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC;WACpF,IAAA,yCAA0B,EAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,IAAA,wCAAyB,EAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC;WACvG,IAAA,yCAA0B,EAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;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CAAC;gBAE/D,IAAI,iBAAiB,KAAK,SAAS;oBACjC,iBAAiB,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAElD,MAAM,CAAC,IAAI,CAAC,uBAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KACF;IAtJY,qBAAM,SAsJlB,CAAA;AACH,CAAC,EAjRgB,cAAc,8BAAd,cAAc,QAiR9B;AAED,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { IndexedPolyfaceVisitor, Matrix3d, Point2d, Point3d, PolyfaceVisitor, Transform, Vector3d, XAndY } from \"@itwin/core-geometry\";\r\nimport { RenderTexture } from \"./RenderTexture\";\r\nimport { compareBooleans, compareBooleansOrUndefined, compareNumbers, compareNumbersOrUndefined, comparePossiblyUndefined } from \"@itwin/core-bentley\";\r\n\r\n/** Defines normal map parameters.\r\n * @beta\r\n */\r\nexport interface NormalMapParams {\r\n /** The texture to use as a normal map. If not present then the pattern map texture will be used as a normal map. */\r\n normalMap?: RenderTexture;\r\n /** True if the Y component stored in the green channel should be negated. By default, positive Y points downward, but some\r\n * normal maps are created with positive Y pointing upward.\r\n */\r\n greenUp?: boolean;\r\n /** Scale factor by which to multiply the components of the normal extracted from [[normalMap]]. */\r\n scale?: number;\r\n /** True if want to use constant LOD texture mapping for the normal map texture. */\r\n useConstantLod?: boolean;\r\n}\r\n\r\nfunction compareNormalMapParams(lhs: NormalMapParams, rhs: NormalMapParams): number {\r\n return comparePossiblyUndefined((lh, rh) => lh.compare(rh), lhs.normalMap, rhs.normalMap)\r\n || compareBooleansOrUndefined(lhs.greenUp, rhs.greenUp) || compareNumbersOrUndefined(lhs.scale, rhs.scale)\r\n || compareBooleansOrUndefined(lhs.useConstantLod, rhs.useConstantLod);\r\n}\r\n\r\n/** Describes how to map a [[RenderTexture]]'s image onto a surface as part of a [[RenderMaterial]].\r\n * @public\r\n */\r\nexport class TextureMapping {\r\n /** The texture to be mapped to the surface. If normalMapParams is present but does not contain a normal map, then texture is used as a normal map rather than a pattern map. */\r\n public readonly texture: RenderTexture;\r\n /** The parameters for normal mapping.\r\n * @beta\r\n */\r\n public normalMapParams?: NormalMapParams;\r\n /** The parameters describing how the textures are mapped to the surface. */\r\n public readonly params: TextureMapping.Params;\r\n\r\n public constructor(tx: RenderTexture, params: TextureMapping.Params) {\r\n this.texture = tx;\r\n this.params = params;\r\n }\r\n\r\n /** @internal */\r\n public computeUVParams(visitor: PolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined {\r\n return this.params.computeUVParams(visitor as IndexedPolyfaceVisitor, transformToImodel);\r\n }\r\n\r\n /** An [OrderedComparator]($bentley) that compares this mapping against `other`. */\r\n public compare(other: TextureMapping): number {\r\n if (this === other) {\r\n return 0;\r\n }\r\n\r\n return this.texture.compare(other.texture) || this.params.compare(other.params)\r\n || comparePossiblyUndefined((lh, rh) => compareNormalMapParams(lh, rh), this.normalMapParams, other.normalMapParams);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace TextureMapping {\r\n /** Enumerates the possible texture mapping modes. */\r\n export enum Mode {\r\n None = -1,\r\n Parametric = 0,\r\n ElevationDrape = 1,\r\n Planar = 2,\r\n /** @internal */\r\n DirectionalDrape = 3,\r\n /** @internal */\r\n Cubic = 4,\r\n /** @internal */\r\n Spherical = 5,\r\n /** @internal */\r\n Cylindrical = 6,\r\n /** @internal */\r\n Solid = 7,\r\n /** @internal Only valid for lights */\r\n FrontProject = 8,\r\n }\r\n\r\n /** A 2x3 matrix for mapping a texture image to a surface. */\r\n export class Trans2x3 {\r\n /** The 3x4 transform produced from the 2x3 matrix. */\r\n public readonly transform: Transform;\r\n\r\n /** Construct from the two rows of the matrix:\r\n * ```\r\n * | m00 m01 originX |\r\n * | m10 m11 originY |\r\n * ```\r\n * Producing the [Transform]($core-geometry):\r\n * ```\r\n * | m00 m01 0 originX |\r\n * | m10 m11 0 originY |\r\n * | 0 0 1 0 |\r\n * ```\r\n */\r\n public constructor(m00 = 1, m01 = 0, originX = 0, m10 = 0, m11 = 1, originY = 0) {\r\n const origin = new Point3d(originX, originY, 0);\r\n const matrix = Matrix3d.createRowValues(m00, m01, 0, m10, m11, 0, 0, 0, 1);\r\n this.transform = Transform.createRefs(origin, matrix);\r\n }\r\n\r\n /** An immutable 2x3 identity matrix. */\r\n public static readonly identity = new Trans2x3();\r\n\r\n /** An [OrderedComparator]($bentley) that compares this Trans2x3 against `other`. */\r\n public compare(other: Trans2x3): number {\r\n if (this === other) {\r\n return 0;\r\n }\r\n\r\n const originDiff = compareNumbers(this.transform.origin.x, other.transform.origin.x) || compareNumbers(this.transform.origin.y, other.transform.origin.y);\r\n if (originDiff !== 0) {\r\n return originDiff;\r\n }\r\n\r\n for (const i of [0, 1, 3, 4]) {\r\n const matDiff = compareNumbers(this.transform.matrix.coffs[i], other.transform.matrix.coffs[i]);\r\n if (matDiff !== 0) {\r\n return matDiff;\r\n }\r\n }\r\n\r\n return 0;\r\n }\r\n }\r\n\r\n /** Properties used to construct a [[TextureMapping.ConstantLodParams]]. */\r\n export interface ConstantLodParamProps {\r\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1. */\r\n repetitions?: number;\r\n /** An offset in world units used to shift the texture. Defaults to (0, 0). */\r\n offset?: XAndY;\r\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. Defaults to 1.*/\r\n minDistClamp?: number;\r\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. Defaults to 2^32. */\r\n maxDistClamp?: number;\r\n }\r\n\r\n /** Parameters to define constant level of detail mapping mode, a mode of texture coordinate generation which dynamically creates\r\n * texture cooprdinates so that the level of detail of the texture in the rendered image remains somewhat constant. */\r\n export interface ConstantLodParams {\r\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. */\r\n repetitions: number;\r\n /** An offset in world units used to shift the texture. */\r\n offset: XAndY;\r\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. */\r\n minDistClamp: number;\r\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. */\r\n maxDistClamp: number;\r\n }\r\n\r\n function compareConstantLodParams(lhs: ConstantLodParams, rhs: ConstantLodParams): number {\r\n return compareNumbers(lhs.repetitions, rhs.repetitions) || compareNumbers(lhs.offset.x, rhs.offset.x) || compareNumbers(lhs.offset.y, rhs.offset.y)\r\n || compareNumbers(lhs.minDistClamp, rhs.minDistClamp) || compareNumbers(lhs.maxDistClamp, rhs.maxDistClamp);\r\n }\r\n\r\n /** Properties used to construct a [[TextureMapping.Params]]. */\r\n export interface ParamProps {\r\n /** The matrix used to map the image to a surface. */\r\n textureMat2x3?: TextureMapping.Trans2x3;\r\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the surface's color.\r\n * A value of 0.0 uses only the surface color. A value of 1.0 uses only the texture color. A value of 0.5 uses an even mix of both.\r\n * @note This affects only the red, green, and blue components of the color. The alpha sampled from the texture is always multiplied by the surface color's alpha.\r\n * @note Defaults to 1.0\r\n */\r\n textureWeight?: number;\r\n /** The mode by which to map the image to a surface.\r\n * @note Defaults to [[TextureMapping.Mode.Parametric]].\r\n */\r\n mapMode?: TextureMapping.Mode;\r\n /** @internal */\r\n worldMapping?: boolean;\r\n /** True if want to use constant LOD texture mapping for the surface texture. */\r\n useConstantLod?: boolean;\r\n /** Parameters for constantLod mapping mode. */\r\n constantLodProps?: ConstantLodParamProps;\r\n }\r\n\r\n /** Parameters describing how a [[RenderTexture]]'s image is mapped to a surface. */\r\n export class Params {\r\n /** The matrix used to map the image to a surface. */\r\n public textureMatrix: TextureMapping.Trans2x3;\r\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the element's color.\r\n * A value of 0.0 uses only the element color. A value of 1.0 uses only the texture color.\r\n */\r\n public weight: number;\r\n /** The mode by which to map the image to a surface. */\r\n public mode: TextureMapping.Mode;\r\n /** @internal */\r\n public worldMapping: boolean;\r\n /** True if want to use constant LOD texture mapping for the surface texture. */\r\n public useConstantLod: boolean;\r\n /** Parameters for constantLod mapping mode. */\r\n public constantLodParams: ConstantLodParams;\r\n\r\n public constructor(props?: TextureMapping.ParamProps) {\r\n this.textureMatrix = props?.textureMat2x3 ?? Trans2x3.identity;\r\n this.weight = props?.textureWeight ?? 1;\r\n this.mode = props?.mapMode ?? Mode.Parametric;\r\n this.worldMapping = props?.worldMapping ?? false;\r\n this.useConstantLod = props?.useConstantLod ?? false;\r\n this.constantLodParams = {\r\n repetitions: props?.constantLodProps?.repetitions ?? 1,\r\n offset: props?.constantLodProps?.offset ?? { x: 0, y: 0 },\r\n minDistClamp: props?.constantLodProps?.minDistClamp ?? 1,\r\n maxDistClamp: props?.constantLodProps?.maxDistClamp ?? 4096 * 1024 * 1024,\r\n };\r\n }\r\n\r\n /** An [OrderedComparator]($bentley) that compares these Params against `other`. */\r\n public compare(other: Params): number {\r\n if (this === other) {\r\n return 0;\r\n }\r\n\r\n return compareNumbers(this.weight, other.weight) || compareNumbers(this.mode, other.mode) || compareBooleans(this.worldMapping, other.worldMapping)\r\n || compareBooleans(this.useConstantLod, other.useConstantLod) || this.textureMatrix.compare(other.textureMatrix)\r\n || compareConstantLodParams(this.constantLodParams, other.constantLodParams);\r\n }\r\n\r\n /**\r\n * Generates UV parameters for textured surfaces. Returns undefined on failure.\r\n * @internal\r\n */\r\n public computeUVParams(visitor: IndexedPolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined {\r\n switch (this.mode) {\r\n default: // Fall through to parametric in default case\r\n case TextureMapping.Mode.Parametric: {\r\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\r\n }\r\n case TextureMapping.Mode.Planar: {\r\n const normalIndices = visitor.normalIndex;\r\n if (!normalIndices)\r\n return undefined;\r\n\r\n // Ignore planar mode unless master or sub units for scaleMode and facet is planar\r\n if (!this.worldMapping || (visitor.normalIndex !== undefined && (normalIndices[0] !== normalIndices[1] || normalIndices[0] !== normalIndices[2]))) {\r\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\r\n } else {\r\n return this.computePlanarUVParams(visitor, this.textureMatrix.transform);\r\n }\r\n }\r\n case TextureMapping.Mode.ElevationDrape: {\r\n return this.computeElevationDrapeUVParams(visitor, this.textureMatrix.transform, transformToImodel);\r\n }\r\n }\r\n }\r\n\r\n /** Computes UV parameters given a texture mapping mode of parametric. */\r\n private computeParametricUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, isRelativeUnits: boolean): Point2d[] {\r\n const params: Point2d[] = [];\r\n for (let i = 0; i < visitor.numEdgesThisFacet; i++) {\r\n let param = Point2d.create();\r\n\r\n if (isRelativeUnits || !visitor.tryGetDistanceParameter(i, param)) {\r\n if (!visitor.tryGetNormalizedParameter(i, param)) {\r\n // If mesh does not have facetFaceData, we still want to use the texture coordinates if they are present\r\n param = visitor.getParam(i)!;\r\n }\r\n }\r\n\r\n params.push(uvTransform.multiplyPoint2d(param));\r\n }\r\n return params;\r\n }\r\n\r\n /** Computes UV parameters given a texture mapping mode of planar. The result is stored in the Point2d array given. */\r\n private computePlanarUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform): Point2d[] | undefined {\r\n const params: Point2d[] = [];\r\n const points = visitor.point;\r\n let normal: Vector3d;\r\n\r\n if (visitor.normal === undefined)\r\n normal = points.getPoint3dAtUncheckedPointIndex(0).crossProductToPoints(points.getPoint3dAtUncheckedPointIndex(1), points.getPoint3dAtUncheckedPointIndex(2));\r\n else\r\n normal = visitor.normal.getVector3dAtCheckedVectorIndex(0)!;\r\n\r\n if (!normal.normalize(normal))\r\n return undefined;\r\n\r\n // adjust U texture coordinate to be a continuous length starting at the\r\n // origin. V coordinate stays the same. This mode assumes Z is up vector\r\n\r\n // Flipping normal puts us in a planar coordinate system consistent with MicroStation's display system\r\n normal.scale(-1.0, normal);\r\n\r\n // pick the first vertex normal\r\n const sideVector = Vector3d.create(normal.y, -normal.x, 0.0);\r\n\r\n // if the magnitude of the normal is near zero, the real normal points\r\n // almost straighten up.. In this case, use Y as the up vector to match QV\r\n\r\n const magnitude = sideVector.magnitude();\r\n sideVector.normalize(sideVector); // won't remain undefined if failed due to following check..\r\n\r\n if (magnitude < 1e-3) {\r\n normal.set(0, 0, -1);\r\n sideVector.set(1, 0, 0);\r\n }\r\n\r\n const upVector = sideVector.crossProduct(normal).normalize();\r\n if (!upVector)\r\n return undefined;\r\n\r\n const numEdges = visitor.numEdgesThisFacet;\r\n for (let i = 0; i < numEdges; i++) {\r\n const vector = Vector3d.createFrom(points.getPoint3dAtUncheckedPointIndex(i));\r\n\r\n params.push(Point2d.create(vector.dotProduct(sideVector), vector.dotProduct(upVector)));\r\n uvTransform.multiplyPoint2d(params[i], params[i]);\r\n }\r\n return params;\r\n }\r\n\r\n /** Computes UV parameters given a texture mapping mode of elevation drape. The result is stored in the Point2d array given. */\r\n private computeElevationDrapeUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, transformToIModel?: Transform): Point2d[] {\r\n const params: Point2d[] = [];\r\n const numEdges = visitor.numEdgesThisFacet;\r\n for (let i = 0; i < numEdges; i++) {\r\n const point = visitor.point.getPoint3dAtUncheckedPointIndex(i);\r\n\r\n if (transformToIModel !== undefined)\r\n transformToIModel.multiplyPoint3d(point, point);\r\n\r\n params.push(Point2d.createFrom(point));\r\n uvTransform.multiplyPoint2d(params[i], params[i]);\r\n }\r\n return params;\r\n }\r\n }\r\n}\r\n\r\nObject.freeze(TextureMapping.Trans2x3.identity);\r\n"]}
@@ -7,7 +7,8 @@
7
7
  * @module Tile
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.getTileObjectReference = exports.TileContentSource = void 0;
10
+ exports.TileContentSource = void 0;
11
+ exports.getTileObjectReference = getTileObjectReference;
11
12
  /**
12
13
  * @internal
13
14
  */
@@ -26,5 +27,4 @@ function getTileObjectReference(iModelId, changesetId, treeId, contentId, guid)
26
27
  objectName: contentId,
27
28
  };
28
29
  }
29
- exports.getTileObjectReference = getTileObjectReference;
30
30
  //# sourceMappingURL=TileProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TileProps.js","sourceRoot":"","sources":["../../src/TileProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAgFH;;GAEG;AACH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,2EAAiB,CAAA;AACnB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,QAAgB,EAAE,WAAmB,EAAE,MAAc,EAAE,SAAiB,EAAE,IAAa;IAC5H,OAAO;QACL,aAAa,EAAE,QAAQ;QACvB,iBAAiB,EAAE,SAAS,MAAM,IAAI,IAAI,IAAI,WAAW,EAAE;QAC3D,UAAU,EAAE,SAAS;KACtB,CAAC;AACJ,CAAC;AAND,wDAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport type { ObjectReference } from \"@itwin/object-storage-core/lib/common\";\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { Range3dProps, TransformProps } from \"@itwin/core-geometry\";\r\n\r\n/** @beta */\r\nexport interface TileContentIdentifier {\r\n treeId: string;\r\n contentId: string;\r\n guid: string | undefined;\r\n}\r\n\r\n/** Wire format describing an [IModelTile]($frontend)\r\n * @internal\r\n */\r\nexport interface TileProps {\r\n /** The unique identifier of the tile's content */\r\n contentId: string;\r\n /** The volume of space represented by this tile. */\r\n range: Range3dProps;\r\n /** Optional volume within the tile's range which more tightly encloses the tile geometry */\r\n contentRange?: Range3dProps;\r\n /** The maximum size in pixels at which the tile should be drawn on the screen. Excludes the optional sizeMultiplier which is applied separately. 0.0 indicates this tile is not displayable. */\r\n maximumSize: number;\r\n /** Optional scaling factor applied to this tile's maximum size. Defaults to 1.0 if undefined. */\r\n sizeMultiplier?: number;\r\n /** Optional boolean indicating this tile has no children. Defaults to false if undefined. */\r\n isLeaf?: boolean;\r\n}\r\n\r\n/** Wire format describing a [TileTree]($frontend)\r\n * @internal\r\n */\r\nexport interface TileTreeProps {\r\n /** The unique identifier of this TileTree within the iModel */\r\n id: string;\r\n /** Metadata describing the tree's root Tile. */\r\n rootTile: TileProps;\r\n /** Transform tile coordinates to iModel world coordinates. */\r\n location: TransformProps;\r\n /** If defined, limits the number of child tiles which can be skipped in selecting tiles of appropriate LOD */\r\n maxTilesToSkip?: number;\r\n /** Optional volume within which content of all tiles' contents are guaranteed to be contained - never larger than `rootTile.range` and sometimes much smaller. */\r\n contentRange?: Range3dProps;\r\n}\r\n\r\n/** Wire format describing an [IModelTileTree]($frontend).\r\n * @internal\r\n */\r\nexport interface IModelTileTreeProps extends TileTreeProps {\r\n /** Optional namespace applied to tile content Ids for tiles belonging to this tree. */\r\n contentIdQualifier?: string;\r\n /** The geometry guid used as a baseline for tile content. May not match the model's current geometry guid during a [GraphicalEditingScope]($frontend). */\r\n geometryGuid?: GuidString;\r\n /** If defined, specifies the number of levels of the tile tree that can be skipped when selecting tiles. */\r\n maxInitialTilesToSkip?: number;\r\n /** Optionally specifies the maximum tile format version supported. */\r\n formatVersion?: number;\r\n /** Size of each tile in pixels. Defaults to 512. Will be 2048 if TileAdmin.useLargerTiles is true. */\r\n tileScreenSize?: number;\r\n /** For a tile tree produced for a [[RenderTimeline.Script]], the bounding ranges for each transform node in the script. */\r\n transformNodeRanges?: Array<Range3dProps & { id: number }>;\r\n}\r\n\r\n/** Metadata describing the version/format of the tiles supplied by the backend.\r\n * @see [[TileAdmin.queryVersionInfo]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TileVersionInfo {\r\n /** The exact version of the \"iMdl\" tile format used by the backend when generating tile content.\r\n * Newer versions of the tile format remain backwards-compatible, but may fix bugs from previous versions and add new features.\r\n * A frontend can request tiles of an earlier version than this, but should not of newer versions.\r\n * @note The version is represented as a 32-bit integer combining the 16-bit major and minor version numbers.\r\n * @see [[CurrentImdlVersion]] to obtain the current version used by the frontend or backend.\r\n */\r\n formatVersion: number;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport enum TileContentSource {\r\n Backend = 0,\r\n ExternalCache = 1,\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function getTileObjectReference(iModelId: string, changesetId: string, treeId: string, contentId: string, guid?: string): ObjectReference {\r\n return {\r\n baseDirectory: iModelId,\r\n relativeDirectory: `tiles/${treeId}/${guid ?? changesetId}`,\r\n objectName: contentId,\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"TileProps.js","sourceRoot":"","sources":["../../src/TileProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA2FH,wDAMC;AAjBD;;GAEG;AACH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,2EAAiB,CAAA;AACnB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,QAAgB,EAAE,WAAmB,EAAE,MAAc,EAAE,SAAiB,EAAE,IAAa;IAC5H,OAAO;QACL,aAAa,EAAE,QAAQ;QACvB,iBAAiB,EAAE,SAAS,MAAM,IAAI,IAAI,IAAI,WAAW,EAAE;QAC3D,UAAU,EAAE,SAAS;KACtB,CAAC;AACJ,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 Tile\r\n */\r\n\r\nimport type { ObjectReference } from \"@itwin/object-storage-core/lib/common\";\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { Range3dProps, TransformProps } from \"@itwin/core-geometry\";\r\n\r\n/** @beta */\r\nexport interface TileContentIdentifier {\r\n treeId: string;\r\n contentId: string;\r\n guid: string | undefined;\r\n}\r\n\r\n/** Wire format describing an [IModelTile]($frontend)\r\n * @internal\r\n */\r\nexport interface TileProps {\r\n /** The unique identifier of the tile's content */\r\n contentId: string;\r\n /** The volume of space represented by this tile. */\r\n range: Range3dProps;\r\n /** Optional volume within the tile's range which more tightly encloses the tile geometry */\r\n contentRange?: Range3dProps;\r\n /** The maximum size in pixels at which the tile should be drawn on the screen. Excludes the optional sizeMultiplier which is applied separately. 0.0 indicates this tile is not displayable. */\r\n maximumSize: number;\r\n /** Optional scaling factor applied to this tile's maximum size. Defaults to 1.0 if undefined. */\r\n sizeMultiplier?: number;\r\n /** Optional boolean indicating this tile has no children. Defaults to false if undefined. */\r\n isLeaf?: boolean;\r\n}\r\n\r\n/** Wire format describing a [TileTree]($frontend)\r\n * @internal\r\n */\r\nexport interface TileTreeProps {\r\n /** The unique identifier of this TileTree within the iModel */\r\n id: string;\r\n /** Metadata describing the tree's root Tile. */\r\n rootTile: TileProps;\r\n /** Transform tile coordinates to iModel world coordinates. */\r\n location: TransformProps;\r\n /** If defined, limits the number of child tiles which can be skipped in selecting tiles of appropriate LOD */\r\n maxTilesToSkip?: number;\r\n /** Optional volume within which content of all tiles' contents are guaranteed to be contained - never larger than `rootTile.range` and sometimes much smaller. */\r\n contentRange?: Range3dProps;\r\n}\r\n\r\n/** Wire format describing an [IModelTileTree]($frontend).\r\n * @internal\r\n */\r\nexport interface IModelTileTreeProps extends TileTreeProps {\r\n /** Optional namespace applied to tile content Ids for tiles belonging to this tree. */\r\n contentIdQualifier?: string;\r\n /** The geometry guid used as a baseline for tile content. May not match the model's current geometry guid during a [GraphicalEditingScope]($frontend). */\r\n geometryGuid?: GuidString;\r\n /** If defined, specifies the number of levels of the tile tree that can be skipped when selecting tiles. */\r\n maxInitialTilesToSkip?: number;\r\n /** Optionally specifies the maximum tile format version supported. */\r\n formatVersion?: number;\r\n /** Size of each tile in pixels. Defaults to 512. Will be 2048 if TileAdmin.useLargerTiles is true. */\r\n tileScreenSize?: number;\r\n /** For a tile tree produced for a [[RenderTimeline.Script]], the bounding ranges for each transform node in the script. */\r\n transformNodeRanges?: Array<Range3dProps & { id: number }>;\r\n}\r\n\r\n/** Metadata describing the version/format of the tiles supplied by the backend.\r\n * @see [[TileAdmin.queryVersionInfo]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TileVersionInfo {\r\n /** The exact version of the \"iMdl\" tile format used by the backend when generating tile content.\r\n * Newer versions of the tile format remain backwards-compatible, but may fix bugs from previous versions and add new features.\r\n * A frontend can request tiles of an earlier version than this, but should not of newer versions.\r\n * @note The version is represented as a 32-bit integer combining the 16-bit major and minor version numbers.\r\n * @see [[CurrentImdlVersion]] to obtain the current version used by the frontend or backend.\r\n */\r\n formatVersion: number;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport enum TileContentSource {\r\n Backend = 0,\r\n ExternalCache = 1,\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function getTileObjectReference(iModelId: string, changesetId: string, treeId: string, contentId: string, guid?: string): ObjectReference {\r\n return {\r\n baseDirectory: iModelId,\r\n relativeDirectory: `tiles/${treeId}/${guid ?? changesetId}`,\r\n objectName: contentId,\r\n };\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tween.d.ts","sourceRoot":"","sources":["../../src/Tween.ts"],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AAK,MAAM;uBAI3B,MAAM,KAAK,MAAM;uBAOnB,MAAM;yBAeF,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK,MAAM;;CAQzE,CAAC"}
package/lib/cjs/Tween.js CHANGED
@@ -20,7 +20,6 @@ exports.Interpolation = exports.Easing = exports.Tween = exports.Tweens = void 0
20
20
  */
21
21
  // cSpell:ignore tweens yoyo catmull
22
22
  /* eslint-disable guard-for-in */
23
- /* eslint-disable @typescript-eslint/prefer-for-of */
24
23
  /* eslint-disable @typescript-eslint/naming-convention */
25
24
  /** A group of `Tween`s. This class is called `Group` in the tween.js library.
26
25
  * @note Unlike tween.js, we do NOT create any global instances of this class