@itwin/core-backend 5.1.0-dev.9 → 5.2.0-dev.2

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 (441) hide show
  1. package/CHANGELOG.md +117 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +1 -1
  3. package/lib/cjs/BackendHubAccess.js +1 -1
  4. package/lib/cjs/BackendHubAccess.js.map +1 -1
  5. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  6. package/lib/cjs/BisCoreSchema.js +4 -2
  7. package/lib/cjs/BisCoreSchema.js.map +1 -1
  8. package/lib/cjs/BriefcaseManager.d.ts +10 -2
  9. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  10. package/lib/cjs/BriefcaseManager.js +16 -0
  11. package/lib/cjs/BriefcaseManager.js.map +1 -1
  12. package/lib/cjs/Category.d.ts +4 -4
  13. package/lib/cjs/Category.js +4 -4
  14. package/lib/cjs/Category.js.map +1 -1
  15. package/lib/cjs/ChangesetECAdaptor.d.ts +67 -8
  16. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  17. package/lib/cjs/ChangesetECAdaptor.js +248 -33
  18. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  19. package/lib/cjs/ClassRegistry.d.ts +9 -1
  20. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  21. package/lib/cjs/ClassRegistry.js +9 -1
  22. package/lib/cjs/ClassRegistry.js.map +1 -1
  23. package/lib/cjs/CloudSqlite.js +1 -1
  24. package/lib/cjs/CloudSqlite.js.map +1 -1
  25. package/lib/cjs/CodeSpecs.d.ts +1 -1
  26. package/lib/cjs/CodeSpecs.js +1 -1
  27. package/lib/cjs/CodeSpecs.js.map +1 -1
  28. package/lib/cjs/DisplayStyle.d.ts +4 -4
  29. package/lib/cjs/DisplayStyle.js +3 -3
  30. package/lib/cjs/DisplayStyle.js.map +1 -1
  31. package/lib/cjs/ECDb.d.ts +4 -4
  32. package/lib/cjs/ECDb.d.ts.map +1 -1
  33. package/lib/cjs/ECDb.js +4 -4
  34. package/lib/cjs/ECDb.js.map +1 -1
  35. package/lib/cjs/ECSqlStatement.d.ts +15 -6
  36. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  37. package/lib/cjs/ECSqlStatement.js +19 -4
  38. package/lib/cjs/ECSqlStatement.js.map +1 -1
  39. package/lib/cjs/Element.d.ts +54 -51
  40. package/lib/cjs/Element.d.ts.map +1 -1
  41. package/lib/cjs/Element.js +67 -52
  42. package/lib/cjs/Element.js.map +1 -1
  43. package/lib/cjs/ElementAspect.d.ts +8 -8
  44. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  45. package/lib/cjs/ElementAspect.js +8 -8
  46. package/lib/cjs/ElementAspect.js.map +1 -1
  47. package/lib/cjs/Entity.d.ts +10 -7
  48. package/lib/cjs/Entity.d.ts.map +1 -1
  49. package/lib/cjs/Entity.js +35 -13
  50. package/lib/cjs/Entity.js.map +1 -1
  51. package/lib/cjs/ExportGraphics.d.ts +54 -8
  52. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  53. package/lib/cjs/ExportGraphics.js +158 -59
  54. package/lib/cjs/ExportGraphics.js.map +1 -1
  55. package/lib/cjs/GeographicCRSServices.d.ts +6 -2
  56. package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
  57. package/lib/cjs/GeographicCRSServices.js +1 -1
  58. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  59. package/lib/cjs/IModelDb.d.ts +37 -26
  60. package/lib/cjs/IModelDb.d.ts.map +1 -1
  61. package/lib/cjs/IModelDb.js +124 -47
  62. package/lib/cjs/IModelDb.js.map +1 -1
  63. package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
  64. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
  65. package/lib/cjs/IModelElementCloneContext.js +1 -1
  66. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  67. package/lib/cjs/IModelHost.d.ts +2 -3
  68. package/lib/cjs/IModelHost.d.ts.map +1 -1
  69. package/lib/cjs/IModelHost.js +2 -3
  70. package/lib/cjs/IModelHost.js.map +1 -1
  71. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +36 -0
  72. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -0
  73. package/lib/cjs/IModelIncrementalSchemaLocater.js +69 -0
  74. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -0
  75. package/lib/cjs/LocalHub.d.ts.map +1 -1
  76. package/lib/cjs/LocalHub.js +6 -4
  77. package/lib/cjs/LocalHub.js.map +1 -1
  78. package/lib/cjs/Material.d.ts +4 -3
  79. package/lib/cjs/Material.d.ts.map +1 -1
  80. package/lib/cjs/Material.js +5 -5
  81. package/lib/cjs/Material.js.map +1 -1
  82. package/lib/cjs/Model.d.ts +22 -22
  83. package/lib/cjs/Model.js +22 -22
  84. package/lib/cjs/Model.js.map +1 -1
  85. package/lib/cjs/Relationship.d.ts +3 -0
  86. package/lib/cjs/Relationship.d.ts.map +1 -1
  87. package/lib/cjs/Relationship.js +15 -0
  88. package/lib/cjs/Relationship.js.map +1 -1
  89. package/lib/cjs/SQLiteDb.d.ts +1 -1
  90. package/lib/cjs/SQLiteDb.js +1 -1
  91. package/lib/cjs/SQLiteDb.js.map +1 -1
  92. package/lib/cjs/Schema.d.ts +25 -0
  93. package/lib/cjs/Schema.d.ts.map +1 -1
  94. package/lib/cjs/Schema.js +25 -0
  95. package/lib/cjs/Schema.js.map +1 -1
  96. package/lib/cjs/SqliteStatement.d.ts +1 -1
  97. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  98. package/lib/cjs/SqliteStatement.js +1 -1
  99. package/lib/cjs/SqliteStatement.js.map +1 -1
  100. package/lib/cjs/Texture.d.ts +1 -1
  101. package/lib/cjs/Texture.js +1 -1
  102. package/lib/cjs/Texture.js.map +1 -1
  103. package/lib/cjs/TxnManager.d.ts +4 -4
  104. package/lib/cjs/TxnManager.js +1 -1
  105. package/lib/cjs/TxnManager.js.map +1 -1
  106. package/lib/cjs/ViewDefinition.d.ts +40 -14
  107. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  108. package/lib/cjs/ViewDefinition.js +42 -14
  109. package/lib/cjs/ViewDefinition.js.map +1 -1
  110. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  111. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  112. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +110 -0
  113. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  114. package/lib/cjs/annotations/FrameGeometry.d.ts +51 -0
  115. package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -0
  116. package/lib/cjs/annotations/FrameGeometry.js +249 -0
  117. package/lib/cjs/annotations/FrameGeometry.js.map +1 -0
  118. package/lib/cjs/annotations/LeaderGeometry.d.ts +53 -0
  119. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -0
  120. package/lib/cjs/annotations/LeaderGeometry.js +184 -0
  121. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -0
  122. package/lib/cjs/annotations/TextAnnotationElement.d.ts +204 -0
  123. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -0
  124. package/lib/cjs/annotations/TextAnnotationElement.js +411 -0
  125. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -0
  126. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +33 -0
  127. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -0
  128. package/lib/cjs/annotations/TextAnnotationGeometry.js +137 -0
  129. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -0
  130. package/lib/cjs/annotations/TextBlockGeometry.d.ts +16 -0
  131. package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -0
  132. package/lib/cjs/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
  133. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -0
  134. package/lib/cjs/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
  135. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -0
  136. package/lib/cjs/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +174 -49
  137. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -0
  138. package/lib/cjs/core-backend.d.ts +7 -3
  139. package/lib/cjs/core-backend.d.ts.map +1 -1
  140. package/lib/cjs/core-backend.js +27 -6
  141. package/lib/cjs/core-backend.js.map +1 -1
  142. package/lib/cjs/internal/ElementLRUCache.d.ts +23 -0
  143. package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
  144. package/lib/cjs/internal/ElementLRUCache.js +167 -3
  145. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  146. package/lib/cjs/internal/Symbols.d.ts +1 -0
  147. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  148. package/lib/cjs/internal/Symbols.js +2 -1
  149. package/lib/cjs/internal/Symbols.js.map +1 -1
  150. package/lib/cjs/internal/annotations/fields.d.ts +22 -0
  151. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -0
  152. package/lib/cjs/internal/annotations/fields.js +237 -0
  153. package/lib/cjs/internal/annotations/fields.js.map +1 -0
  154. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
  155. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -1
  156. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  157. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
  158. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  159. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
  160. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
  161. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  162. package/lib/cjs/workspace/Workspace.d.ts +0 -1
  163. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  164. package/lib/cjs/workspace/Workspace.js.map +1 -1
  165. package/lib/esm/BackendHubAccess.d.ts +1 -1
  166. package/lib/esm/BackendHubAccess.js +1 -1
  167. package/lib/esm/BackendHubAccess.js.map +1 -1
  168. package/lib/esm/BisCoreSchema.d.ts.map +1 -1
  169. package/lib/esm/BisCoreSchema.js +4 -2
  170. package/lib/esm/BisCoreSchema.js.map +1 -1
  171. package/lib/esm/BriefcaseManager.d.ts +10 -2
  172. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  173. package/lib/esm/BriefcaseManager.js +17 -1
  174. package/lib/esm/BriefcaseManager.js.map +1 -1
  175. package/lib/esm/Category.d.ts +4 -4
  176. package/lib/esm/Category.js +4 -4
  177. package/lib/esm/Category.js.map +1 -1
  178. package/lib/esm/ChangesetECAdaptor.d.ts +67 -8
  179. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  180. package/lib/esm/ChangesetECAdaptor.js +248 -33
  181. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  182. package/lib/esm/ClassRegistry.d.ts +9 -1
  183. package/lib/esm/ClassRegistry.d.ts.map +1 -1
  184. package/lib/esm/ClassRegistry.js +9 -1
  185. package/lib/esm/ClassRegistry.js.map +1 -1
  186. package/lib/esm/CloudSqlite.js +1 -1
  187. package/lib/esm/CloudSqlite.js.map +1 -1
  188. package/lib/esm/CodeSpecs.d.ts +1 -1
  189. package/lib/esm/CodeSpecs.js +1 -1
  190. package/lib/esm/CodeSpecs.js.map +1 -1
  191. package/lib/esm/DisplayStyle.d.ts +4 -4
  192. package/lib/esm/DisplayStyle.js +3 -3
  193. package/lib/esm/DisplayStyle.js.map +1 -1
  194. package/lib/esm/ECDb.d.ts +4 -4
  195. package/lib/esm/ECDb.d.ts.map +1 -1
  196. package/lib/esm/ECDb.js +4 -4
  197. package/lib/esm/ECDb.js.map +1 -1
  198. package/lib/esm/ECSqlStatement.d.ts +15 -6
  199. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  200. package/lib/esm/ECSqlStatement.js +19 -4
  201. package/lib/esm/ECSqlStatement.js.map +1 -1
  202. package/lib/esm/Element.d.ts +54 -51
  203. package/lib/esm/Element.d.ts.map +1 -1
  204. package/lib/esm/Element.js +67 -52
  205. package/lib/esm/Element.js.map +1 -1
  206. package/lib/esm/ElementAspect.d.ts +8 -8
  207. package/lib/esm/ElementAspect.d.ts.map +1 -1
  208. package/lib/esm/ElementAspect.js +8 -8
  209. package/lib/esm/ElementAspect.js.map +1 -1
  210. package/lib/esm/Entity.d.ts +10 -7
  211. package/lib/esm/Entity.d.ts.map +1 -1
  212. package/lib/esm/Entity.js +36 -14
  213. package/lib/esm/Entity.js.map +1 -1
  214. package/lib/esm/ExportGraphics.d.ts +54 -8
  215. package/lib/esm/ExportGraphics.d.ts.map +1 -1
  216. package/lib/esm/ExportGraphics.js +156 -58
  217. package/lib/esm/ExportGraphics.js.map +1 -1
  218. package/lib/esm/GeographicCRSServices.d.ts +6 -2
  219. package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
  220. package/lib/esm/GeographicCRSServices.js +1 -1
  221. package/lib/esm/GeographicCRSServices.js.map +1 -1
  222. package/lib/esm/IModelDb.d.ts +37 -26
  223. package/lib/esm/IModelDb.d.ts.map +1 -1
  224. package/lib/esm/IModelDb.js +128 -51
  225. package/lib/esm/IModelDb.js.map +1 -1
  226. package/lib/esm/IModelElementCloneContext.d.ts +1 -1
  227. package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
  228. package/lib/esm/IModelElementCloneContext.js +1 -1
  229. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  230. package/lib/esm/IModelHost.d.ts +2 -3
  231. package/lib/esm/IModelHost.d.ts.map +1 -1
  232. package/lib/esm/IModelHost.js +2 -3
  233. package/lib/esm/IModelHost.js.map +1 -1
  234. package/lib/esm/IModelIncrementalSchemaLocater.d.ts +36 -0
  235. package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -0
  236. package/lib/esm/IModelIncrementalSchemaLocater.js +65 -0
  237. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -0
  238. package/lib/esm/LocalHub.d.ts.map +1 -1
  239. package/lib/esm/LocalHub.js +6 -4
  240. package/lib/esm/LocalHub.js.map +1 -1
  241. package/lib/esm/Material.d.ts +4 -3
  242. package/lib/esm/Material.d.ts.map +1 -1
  243. package/lib/esm/Material.js +5 -5
  244. package/lib/esm/Material.js.map +1 -1
  245. package/lib/esm/Model.d.ts +22 -22
  246. package/lib/esm/Model.js +22 -22
  247. package/lib/esm/Model.js.map +1 -1
  248. package/lib/esm/Relationship.d.ts +3 -0
  249. package/lib/esm/Relationship.d.ts.map +1 -1
  250. package/lib/esm/Relationship.js +15 -0
  251. package/lib/esm/Relationship.js.map +1 -1
  252. package/lib/esm/SQLiteDb.d.ts +1 -1
  253. package/lib/esm/SQLiteDb.js +1 -1
  254. package/lib/esm/SQLiteDb.js.map +1 -1
  255. package/lib/esm/Schema.d.ts +25 -0
  256. package/lib/esm/Schema.d.ts.map +1 -1
  257. package/lib/esm/Schema.js +25 -0
  258. package/lib/esm/Schema.js.map +1 -1
  259. package/lib/esm/SqliteStatement.d.ts +1 -1
  260. package/lib/esm/SqliteStatement.d.ts.map +1 -1
  261. package/lib/esm/SqliteStatement.js +1 -1
  262. package/lib/esm/SqliteStatement.js.map +1 -1
  263. package/lib/esm/Texture.d.ts +1 -1
  264. package/lib/esm/Texture.js +1 -1
  265. package/lib/esm/Texture.js.map +1 -1
  266. package/lib/esm/TxnManager.d.ts +4 -4
  267. package/lib/esm/TxnManager.js +1 -1
  268. package/lib/esm/TxnManager.js.map +1 -1
  269. package/lib/esm/ViewDefinition.d.ts +40 -14
  270. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  271. package/lib/esm/ViewDefinition.js +42 -14
  272. package/lib/esm/ViewDefinition.js.map +1 -1
  273. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  274. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  275. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +105 -0
  276. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  277. package/lib/esm/annotations/FrameGeometry.d.ts +51 -0
  278. package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -0
  279. package/lib/esm/annotations/FrameGeometry.js +244 -0
  280. package/lib/esm/annotations/FrameGeometry.js.map +1 -0
  281. package/lib/esm/annotations/LeaderGeometry.d.ts +53 -0
  282. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -0
  283. package/lib/esm/annotations/LeaderGeometry.js +179 -0
  284. package/lib/esm/annotations/LeaderGeometry.js.map +1 -0
  285. package/lib/esm/annotations/TextAnnotationElement.d.ts +204 -0
  286. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -0
  287. package/lib/esm/annotations/TextAnnotationElement.js +405 -0
  288. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -0
  289. package/lib/esm/annotations/TextAnnotationGeometry.d.ts +33 -0
  290. package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -0
  291. package/lib/esm/annotations/TextAnnotationGeometry.js +134 -0
  292. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -0
  293. package/lib/esm/annotations/TextBlockGeometry.d.ts +16 -0
  294. package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -0
  295. package/lib/esm/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
  296. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -0
  297. package/lib/esm/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
  298. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -0
  299. package/lib/esm/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +172 -48
  300. package/lib/esm/annotations/TextBlockLayout.js.map +1 -0
  301. package/lib/esm/core-backend.d.ts +7 -3
  302. package/lib/esm/core-backend.d.ts.map +1 -1
  303. package/lib/esm/core-backend.js +27 -3
  304. package/lib/esm/core-backend.js.map +1 -1
  305. package/lib/esm/internal/ElementLRUCache.d.ts +23 -0
  306. package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
  307. package/lib/esm/internal/ElementLRUCache.js +165 -2
  308. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  309. package/lib/esm/internal/Symbols.d.ts +1 -0
  310. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  311. package/lib/esm/internal/Symbols.js +1 -0
  312. package/lib/esm/internal/Symbols.js.map +1 -1
  313. package/lib/esm/internal/annotations/fields.d.ts +22 -0
  314. package/lib/esm/internal/annotations/fields.d.ts.map +1 -0
  315. package/lib/esm/internal/annotations/fields.js +231 -0
  316. package/lib/esm/internal/annotations/fields.js.map +1 -0
  317. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
  318. package/lib/esm/rpc-impl/IModelReadRpcImpl.js +1 -1
  319. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  320. package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
  321. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  322. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
  323. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
  324. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  325. package/lib/esm/test/AnnotationTestUtils.d.ts +15 -0
  326. package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -0
  327. package/lib/esm/test/AnnotationTestUtils.js +41 -0
  328. package/lib/esm/test/AnnotationTestUtils.js.map +1 -0
  329. package/lib/esm/test/ElementLRUCache.test.js +224 -1
  330. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  331. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  332. package/lib/esm/test/IModelTestUtils.js +1 -0
  333. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  334. package/lib/esm/test/TestUtils.d.ts +1 -1
  335. package/lib/esm/test/TestUtils.d.ts.map +1 -1
  336. package/lib/esm/test/TestUtils.js +1 -1
  337. package/lib/esm/test/TestUtils.js.map +1 -1
  338. package/lib/esm/test/annotations/Fields.test.d.ts +2 -0
  339. package/lib/esm/test/annotations/Fields.test.d.ts.map +1 -0
  340. package/lib/esm/test/annotations/Fields.test.js +576 -0
  341. package/lib/esm/test/annotations/Fields.test.js.map +1 -0
  342. package/lib/esm/test/annotations/FrameGeometry.test.d.ts +2 -0
  343. package/lib/esm/test/annotations/FrameGeometry.test.d.ts.map +1 -0
  344. package/lib/esm/test/annotations/FrameGeometry.test.js +86 -0
  345. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -0
  346. package/lib/esm/test/annotations/LeaderGeometry.test.d.ts +2 -0
  347. package/lib/esm/test/annotations/LeaderGeometry.test.d.ts.map +1 -0
  348. package/lib/esm/test/annotations/LeaderGeometry.test.js +256 -0
  349. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -0
  350. package/lib/esm/test/annotations/TextAnnotation.test.js +269 -1047
  351. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  352. package/lib/esm/test/annotations/TextBlock.test.d.ts +2 -0
  353. package/lib/esm/test/annotations/TextBlock.test.d.ts.map +1 -0
  354. package/lib/esm/test/annotations/TextBlock.test.js +1199 -0
  355. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -0
  356. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts +60 -0
  357. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts.map +1 -0
  358. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js +69 -0
  359. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -0
  360. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +1442 -0
  361. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -0
  362. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +817 -0
  363. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -0
  364. package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts +2 -0
  365. package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts.map +1 -0
  366. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +164 -0
  367. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -0
  368. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +22 -32
  369. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  370. package/lib/esm/test/ecdb/ECDb.test.js +29 -8
  371. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  372. package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -55
  373. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  374. package/lib/esm/test/ecdb/ECSqlStatement.test.js +192 -0
  375. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  376. package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts +2 -0
  377. package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts.map +1 -0
  378. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +86 -0
  379. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -0
  380. package/lib/esm/test/imodel/IModel.test.js +313 -5
  381. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  382. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts +2 -0
  383. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts.map +1 -0
  384. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +343 -0
  385. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -0
  386. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts +2 -0
  387. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts.map +1 -0
  388. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +207 -0
  389. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -0
  390. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +11 -0
  391. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +1 -0
  392. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +36 -0
  393. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -0
  394. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +17 -0
  395. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +1 -0
  396. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +116 -0
  397. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -0
  398. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +9 -0
  399. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -0
  400. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +20 -0
  401. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -0
  402. package/lib/esm/test/misc/GeoServices.test.js +36 -10
  403. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  404. package/lib/esm/test/schema/ClassRegistry.test.js +104 -2
  405. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  406. package/lib/esm/test/standalone/ChangesetReader.test.js +547 -136
  407. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  408. package/lib/esm/test/standalone/ExportGraphics.test.js +53 -1
  409. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  410. package/lib/esm/test/standalone/GeometryStream.test.js +49 -1
  411. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  412. package/lib/esm/test/standalone/IModelLimits.test.d.ts +2 -0
  413. package/lib/esm/test/standalone/IModelLimits.test.d.ts.map +1 -0
  414. package/lib/esm/test/standalone/IModelLimits.test.js +103 -0
  415. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -0
  416. package/lib/esm/test/standalone/RenderMaterialElement.test.js +24 -1
  417. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  418. package/lib/esm/test/standalone/SnapshotDb.test.js +19 -1
  419. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  420. package/lib/esm/workspace/Workspace.d.ts +0 -1
  421. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  422. package/lib/esm/workspace/Workspace.js.map +1 -1
  423. package/package.json +22 -16
  424. package/lib/cjs/TextAnnotationElement.d.ts +0 -54
  425. package/lib/cjs/TextAnnotationElement.d.ts.map +0 -1
  426. package/lib/cjs/TextAnnotationElement.js +0 -94
  427. package/lib/cjs/TextAnnotationElement.js.map +0 -1
  428. package/lib/cjs/TextAnnotationGeometry.d.ts +0 -32
  429. package/lib/cjs/TextAnnotationGeometry.d.ts.map +0 -1
  430. package/lib/cjs/TextAnnotationGeometry.js.map +0 -1
  431. package/lib/cjs/TextAnnotationLayout.d.ts.map +0 -1
  432. package/lib/cjs/TextAnnotationLayout.js.map +0 -1
  433. package/lib/esm/TextAnnotationElement.d.ts +0 -54
  434. package/lib/esm/TextAnnotationElement.d.ts.map +0 -1
  435. package/lib/esm/TextAnnotationElement.js +0 -89
  436. package/lib/esm/TextAnnotationElement.js.map +0 -1
  437. package/lib/esm/TextAnnotationGeometry.d.ts +0 -32
  438. package/lib/esm/TextAnnotationGeometry.d.ts.map +0 -1
  439. package/lib/esm/TextAnnotationGeometry.js.map +0 -1
  440. package/lib/esm/TextAnnotationLayout.d.ts.map +0 -1
  441. package/lib/esm/TextAnnotationLayout.js.map +0 -1
@@ -76,105 +76,122 @@ export class ExportGraphicsMeshVisitor extends PolyfaceData {
76
76
  _nextFacetIndex;
77
77
  _numWrap;
78
78
  _polyface;
79
- // to be called from static factory method that validates the polyface ...
80
79
  constructor(facets, numWrap) {
81
80
  super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);
82
81
  this._polyface = facets;
83
82
  this._numWrap = numWrap;
84
83
  this._nextFacetIndex = 0;
85
84
  this._currentFacetIndex = -1;
86
- this.twoSided = facets.isTwoSided;
87
85
  this.reset();
88
86
  }
89
87
  /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays
90
88
  * Typical wrap counts are:
91
- * * 0 -- leave the point arrays with "missing final edge"
89
+ * * 0 -- leave the point arrays with "missing final edge" (default)
92
90
  * * 1 -- add point 0 as closure point
93
91
  * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.
94
92
  */
95
- static create(polyface, numWrap) {
93
+ static create(polyface, numWrap = 0) {
96
94
  return new ExportGraphicsMeshVisitor(polyface, numWrap);
97
95
  }
98
- /** Reset the iterator to start at the first facet of the polyface. */
96
+ /** Restart the visitor at the first facet. */
99
97
  reset() {
100
98
  this.moveToReadIndex(0);
101
- this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.
99
+ this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here
102
100
  }
103
101
  /** Select a facet by simple index. */
104
102
  moveToReadIndex(facetIndex) {
105
103
  if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)
106
104
  return false;
107
- this._currentFacetIndex = facetIndex;
108
- this._nextFacetIndex = facetIndex + 1;
109
- this.point.length = 0;
110
- const points = this.point;
111
- points.length = 0;
112
- this.pointIndex.length = 0;
113
- this.point.length = 0;
114
- this.edgeVisible.length = 0;
115
- const sourcePoints = this._polyface.points;
116
- const indices = this._polyface.indices;
117
- const i0 = 3 * facetIndex;
118
- for (let i = i0; i < i0 + 3; i++) {
119
- const k = 3 * indices[i];
120
- this.pointIndex.push(indices[i]);
121
- this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
122
- this.edgeVisible.push(true);
123
- }
124
- for (let i = 0; i < this._numWrap; i++) {
125
- this.point.pushFromGrowableXYZArray(this.point, i);
126
- }
127
- const sourceParams = this._polyface.params;
128
- if (sourceParams.length > 0 && this.paramIndex && this.param) {
129
- this.paramIndex.length = 0;
130
- this.param.length = 0;
105
+ if (this._currentFacetIndex !== facetIndex || 3 + this._numWrap !== this.point.length) {
106
+ this._currentFacetIndex = facetIndex;
107
+ this.point.length = 0;
108
+ this.pointIndex.length = 0;
109
+ this.edgeVisible.length = 0;
110
+ const sourcePoints = this._polyface.points;
111
+ const indices = this._polyface.indices;
112
+ const i0 = 3 * facetIndex;
131
113
  for (let i = i0; i < i0 + 3; i++) {
132
- const k = 2 * indices[i];
133
- this.paramIndex.push(indices[i]);
134
- this.param.pushXY(sourceParams[k], sourceParams[k + 1]);
114
+ const k = 3 * indices[i];
115
+ this.pointIndex.push(indices[i]);
116
+ this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
117
+ this.edgeVisible.push(true);
135
118
  }
136
119
  for (let i = 0; i < this._numWrap; i++) {
137
- this.param.pushFromGrowableXYArray(this.param, i);
120
+ this.point.pushFromGrowableXYZArray(this.point, i);
138
121
  }
139
- }
140
- const sourceNormals = this._polyface.normals;
141
- if (sourceNormals.length > 0 && this.normalIndex && this.normal) {
142
- this.normalIndex.length = 0;
143
- this.normal.length = 0;
144
- for (let i = i0; i < i0 + 3; i++) {
145
- const k = 3 * indices[i];
146
- this.normalIndex.push(indices[i]);
147
- this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);
122
+ const sourceParams = this._polyface.params;
123
+ if (sourceParams.length > 0 && this.paramIndex && this.param) {
124
+ this.paramIndex.length = 0;
125
+ this.param.length = 0;
126
+ for (let i = i0; i < i0 + 3; i++) {
127
+ const k = 2 * indices[i];
128
+ this.paramIndex.push(indices[i]);
129
+ this.param.pushXY(sourceParams[k], sourceParams[k + 1]);
130
+ }
131
+ for (let i = 0; i < this._numWrap; i++) {
132
+ this.param.pushFromGrowableXYArray(this.param, i);
133
+ }
148
134
  }
149
- for (let i = 0; i < this._numWrap; i++) {
150
- this.normal.pushFromGrowableXYZArray(this.normal, i);
135
+ const sourceNormals = this._polyface.normals;
136
+ if (sourceNormals.length > 0 && this.normalIndex && this.normal) {
137
+ this.normalIndex.length = 0;
138
+ this.normal.length = 0;
139
+ for (let i = i0; i < i0 + 3; i++) {
140
+ const k = 3 * indices[i];
141
+ this.normalIndex.push(indices[i]);
142
+ this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);
143
+ }
144
+ for (let i = 0; i < this._numWrap; i++) {
145
+ this.normal.pushFromGrowableXYZArray(this.normal, i);
146
+ }
151
147
  }
152
148
  }
149
+ this._nextFacetIndex = facetIndex + 1;
153
150
  return true;
154
151
  }
152
+ /** Load data for the next facet. */
155
153
  moveToNextFacet() {
156
- return this.moveToReadIndex(this._nextFacetIndex);
154
+ if (this._nextFacetIndex !== this._currentFacetIndex)
155
+ return this.moveToReadIndex(this._nextFacetIndex);
156
+ this._nextFacetIndex++;
157
+ return true;
157
158
  }
158
159
  /** Set the number of vertices to replicate in visitor arrays. */
159
- setNumWrap(numWrap) { this._numWrap = numWrap; }
160
+ setNumWrap(numWrap) {
161
+ this._numWrap = numWrap;
162
+ }
160
163
  /** Return the index (in the client polyface) of the current facet */
161
- currentReadIndex() { return this._currentFacetIndex; }
164
+ currentReadIndex() {
165
+ return this._currentFacetIndex;
166
+ }
162
167
  /** Return the point index of vertex i within the currently loaded facet */
163
- clientPointIndex(i) { return this.pointIndex[i]; }
168
+ clientPointIndex(i) {
169
+ return this.pointIndex[i];
170
+ }
164
171
  /** Return the param index of vertex i within the currently loaded facet.
165
172
  * Use the artificial paramIndex, which matches pointIndex.
166
173
  */
167
- clientParamIndex(i) { return this.paramIndex ? this.paramIndex[i] : -1; }
174
+ clientParamIndex(i) {
175
+ return this.paramIndex ? this.paramIndex[i] : -1;
176
+ }
168
177
  /** Return the normal index of vertex i within the currently loaded facet.
169
178
  * Use the artificial paramIndex, which matches pointIndex.
170
179
  */
171
- clientNormalIndex(i) { return this.normalIndex ? this.normalIndex[i] : -1; }
172
- /** Return the color index of vertex i within the currently loaded facet */
173
- clientColorIndex(_i) { return 1; }
174
- /** Return the aux data index of vertex i within the currently loaded facet */
175
- clientAuxIndex(_i) { return -1; }
180
+ clientNormalIndex(i) {
181
+ return this.normalIndex ? this.normalIndex[i] : -1;
182
+ }
183
+ /** Always returns -1 since we never have colors. */
184
+ clientColorIndex(_i) {
185
+ return -1;
186
+ }
187
+ /** Always returns -1 since we never have auxiliary data. */
188
+ clientAuxIndex(_i) {
189
+ return -1;
190
+ }
176
191
  /** return the client polyface */
177
- clientPolyface() { return undefined; }
192
+ clientPolyface() {
193
+ return undefined;
194
+ }
178
195
  /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */
179
196
  clearArrays() {
180
197
  if (this.point !== undefined)
@@ -198,12 +215,93 @@ export class ExportGraphicsMeshVisitor extends PolyfaceData {
198
215
  /** transfer data from a specified index of the other visitor as new data in this visitor. */
199
216
  pushDataFrom(other, index) {
200
217
  this.point.pushFromGrowableXYZArray(other.point, index);
201
- if (this.color && other.color && index < other.color.length)
202
- this.color.push(other.color[index]);
203
218
  if (this.param && other.param && index < other.param.length)
204
219
  this.param.pushFromGrowableXYArray(other.param, index);
205
220
  if (this.normal && other.normal && index < other.normal.length)
206
221
  this.normal.pushFromGrowableXYZArray(other.normal, index);
222
+ // ignore color and aux -- they never exist.
223
+ }
224
+ /** Return the number of facets this visitor is able to visit */
225
+ getVisitableFacetCount() {
226
+ return Math.floor(this._polyface.indices.length / 3);
227
+ }
228
+ /** Create a visitor for a subset of the facets visitable by the instance. */
229
+ createSubsetVisitor(facetIndices, numWrap = 0) {
230
+ return ExportGraphicsMeshSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);
231
+ }
232
+ }
233
+ /**
234
+ * An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.
235
+ * * The subset is defined by an array of facet indices provided when this visitor is created.
236
+ * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.
237
+ * @public
238
+ */
239
+ export class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {
240
+ _facetIndices;
241
+ _currentSubsetIndex; // index within _facetIndices
242
+ _nextSubsetIndex; // index within _facetIndices
243
+ constructor(polyface, facetIndices, numWrap) {
244
+ super(polyface, numWrap);
245
+ this._facetIndices = facetIndices.slice();
246
+ this._currentSubsetIndex = -1;
247
+ this._nextSubsetIndex = 0;
248
+ this.reset();
249
+ }
250
+ isValidSubsetIndex(index) {
251
+ return index >= 0 && index < this._facetIndices.length;
252
+ }
253
+ /**
254
+ * Create a visitor for iterating a subset of the facets of `polyface`.
255
+ * @param polyface reference to the client polyface, supplying facets
256
+ * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
257
+ * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
258
+ */
259
+ static createSubsetVisitor(polyface, facetIndices, numWrap = 0) {
260
+ return new ExportGraphicsMeshSubsetVisitor(polyface, facetIndices, numWrap);
261
+ }
262
+ /**
263
+ * Advance the iterator to a particular facet in the subset of client polyface facets.
264
+ * @param subsetIndex index into the subset array, not to be confused with the client facet index.
265
+ * @return whether the iterator was successfully moved.
266
+ */
267
+ moveToReadIndex(subsetIndex) {
268
+ if (this.isValidSubsetIndex(subsetIndex)) {
269
+ this._currentSubsetIndex = subsetIndex;
270
+ this._nextSubsetIndex = subsetIndex + 1;
271
+ return super.moveToReadIndex(this._facetIndices[subsetIndex]);
272
+ }
273
+ return false;
274
+ }
275
+ /**
276
+ * Advance the iterator to the next facet in the subset of client polyface facets.
277
+ * @return whether the iterator was successfully moved.
278
+ */
279
+ moveToNextFacet() {
280
+ if (this._nextSubsetIndex !== this._currentSubsetIndex)
281
+ return this.moveToReadIndex(this._nextSubsetIndex);
282
+ this._nextSubsetIndex++;
283
+ return true;
284
+ }
285
+ /** Restart the visitor at the first facet. */
286
+ reset() {
287
+ if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized
288
+ this.moveToReadIndex(0);
289
+ this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here
290
+ }
291
+ }
292
+ /**
293
+ * Return the client polyface facet index (aka "readIndex") for the given subset index.
294
+ * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
295
+ * @return valid client polyface facet index, or `undefined` if invalid subset index.
296
+ */
297
+ parentFacetIndex(subsetIndex) {
298
+ if (undefined === subsetIndex)
299
+ subsetIndex = this._currentSubsetIndex;
300
+ return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;
301
+ }
302
+ /** Return the number of facets this visitor is able to visit. */
303
+ getVisitableFacetCount() {
304
+ return this._facetIndices.length;
207
305
  }
208
306
  }
209
307
  //# sourceMappingURL=ExportGraphics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAyB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAY,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AAkQhG;;GAEG;AACH,MAAM,KAAW,cAAc,CAuD9B;AAvDD,WAAiB,cAAc;IAC7B;;OAEG;IACH,SAAgB,wBAAwB,CAAC,GAA0B,EAAE,GAA0B;QAC7F,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC,aAAa;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CA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AK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM;YAC5D,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ExportGraphics\n */\n\nimport { assert, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\nimport { ColorDefProps, GeometryClass } from \"@itwin/core-common\";\n\n/** A collection of line segments, suitable for direct use with graphics APIs.\n * The structure of this data matches GL_LINES in OpenGL.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsLines {\n /** Zero-based vertex indices, every two indices represent a line segment */\n indices: Int32Array;\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\n points: Float64Array;\n}\n\n/** Info provided to ExportLinesFunction about linework graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportLinesInfo {\n /** The element ID for the element the graphics originated from */\n elementId: Id64String;\n /** ID for the [SubCategory]($core-backend) for these graphics */\n subCategory: Id64String;\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** The linework for these graphics */\n lines: ExportGraphicsLines;\n}\n\n/** A callback function that receives generated line graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\n\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsMesh {\n /** Zero-based vertex indices, every three indices represent a triangle */\n indices: Int32Array;\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\n points: Float64Array;\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\n normals: Float32Array;\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\n params: Float32Array;\n /** If true, clients should assume both sides of the mesh are visible and not cull backfaces. */\n isTwoSided: boolean;\n}\n\n/** Info provided to ExportGraphicsFunction about graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsInfo {\n /** The element ID for the element the graphics originated from */\n elementId: Id64String;\n /** ID for the [SubCategory]($core-backend) for these graphics */\n subCategory: Id64String;\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\n materialId?: Id64String;\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\n textureId?: Id64String;\n /** The mesh for these graphics */\n mesh: ExportGraphicsMesh;\n}\n\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\n * same graphics (with a different transform).\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\n * graphics.\n * @public\n */\nexport interface ExportPartDisplayInfo {\n categoryId: Id64String;\n subCategoryId: Id64String;\n geometryClass: GeometryClass;\n materialId: Id64String;\n elmTransparency: number;\n lineColor: number;\n}\n\n/** Information about references to [GeometryPart]($core-backend) elements found during\n * a call to [IModelDb.exportGraphics]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\n * @public\n */\nexport interface ExportPartInstanceInfo {\n /** ID for the [GeometryPart]($core-backend) */\n partId: Id64String;\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\n partInstanceId: Id64String;\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\n displayProps: ExportPartDisplayInfo;\n /** A row-major storage 4x3 transform for this instance.\n * See export-gltf under test-apps in the iTwin.js monorepo for a working reference.\n */\n transform?: Float64Array;\n}\n\n/** A callback function that receives generated graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\n\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsOptions {\n /** The source elements for the exported graphics */\n elementIdArray: Id64Array;\n /** A function to call for each unique element ID, color and texture combination */\n onGraphics: ExportGraphicsFunction;\n /** An optional function to call if line graphics are desired. */\n onLineGraphics?: ExportLinesFunction;\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\n * recorded in this array. In this case, graphics that would result from the GeometryPart\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\n */\n partInstanceArray?: ExportPartInstanceInfo[];\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\n */\n chordTol?: number;\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to PI/12 (15 degrees).\n */\n angleTol?: number;\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry).\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\n * that it's necessary, it's almost certainly not!)\n */\n maxEdgeLength?: number;\n /** The longest dimension of a line style's largest component must be at least this size in order for\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\n * line strings.\n */\n minLineStyleComponentSize?: number;\n /** Max distance between mesh vertices for them to be collapsed.\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\n * anomalies so it is important to choose an appropriate setting for your use case.\n */\n decimationTol?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n}\n\n/** Info provided to ExportPartFunction about graphics.\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartInfo {\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\n materialId?: Id64String;\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\n textureId?: Id64String;\n /** The mesh for these graphics */\n mesh: ExportGraphicsMesh;\n}\n\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\n\n/** Info provided to ExportPartFunction about line graphics.\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartLinesInfo {\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** The linework for these graphics */\n lines: ExportGraphicsLines;\n}\n\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\n\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartGraphicsOptions {\n /** The ID for the source [GeometryPart]($core-backend) */\n elementId: Id64String;\n /** The base display properties to use for generating the graphics. This should come from an\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\n */\n displayProps: ExportPartDisplayInfo;\n /** A function to call for each unique color and texture combination. */\n onPartGraphics: ExportPartFunction;\n /** An optional function to call if line graphics are desired. */\n onPartLineGraphics?: ExportPartLinesFunction;\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\n */\n chordTol?: number;\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to PI/12 (15 degrees).\n */\n angleTol?: number;\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry)\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\n * that it's necessary, it's almost certainly not!)\n */\n maxEdgeLength?: number;\n /** The longest dimension of a line style's largest component must be at least this size in order for\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\n * line strings.\n */\n minLineStyleComponentSize?: number;\n /** Max distance between mesh vertices for them to be collapsed.\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\n * anomalies so it is important to choose an appropriate setting for your use case.\n */\n decimationTol?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n}\n\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport namespace ExportGraphics {\n /** Test if ExportPartDisplayInfos have exactly the same values.\n * @public\n */\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\n if (lhs.categoryId !== rhs.categoryId)\n return false;\n if (lhs.subCategoryId !== rhs.subCategoryId)\n return false;\n if (lhs.materialId !== rhs.materialId)\n return false;\n if (lhs.elmTransparency !== rhs.elmTransparency)\n return false;\n if (lhs.lineColor !== rhs.lineColor)\n return false;\n return true;\n }\n\n /**\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\n * @public\n */\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\n\n const p: Float64Array = mesh.points;\n for (let i = 0; i < p.length; i += 3)\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\n\n const n: Float32Array = mesh.normals;\n assert(undefined !== polyface.data.normal);\n for (let i = 0; i < n.length; i += 3)\n polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);\n\n const uv: Float32Array = mesh.params;\n assert(undefined !== polyface.data.param);\n for (let i = 0; i < uv.length; i += 2)\n polyface.data.param.pushXY(uv[i], uv[i + 1]);\n\n const indices = mesh.indices;\n const addIndex = (idx: number) => {\n polyface.addPointIndex(idx, true);\n polyface.addNormalIndex(idx);\n polyface.addParamIndex(idx);\n };\n for (let i = 0; i < indices.length; i += 3) {\n addIndex(indices[i]);\n addIndex(indices[i + 1]);\n addIndex(indices[i + 2]);\n polyface.terminateFacet(false);\n }\n\n return polyface;\n }\n}\n/**\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\n * * Because the ExportGraphicsMesh has limited data:\n * * There is no auxData in this visitor.\n * * There is no color in this visitor.\n * * All edgeVisible are true.\n * @public\n */\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\n private _currentFacetIndex: number;\n private _nextFacetIndex: number;\n private _numWrap: number;\n private _polyface: ExportGraphicsMesh;\n // to be called from static factory method that validates the polyface ...\n private constructor(facets: ExportGraphicsMesh, numWrap: number) {\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\n this._polyface = facets;\n this._numWrap = numWrap;\n\n this._nextFacetIndex = 0;\n this._currentFacetIndex = -1;\n this.twoSided = facets.isTwoSided;\n this.reset();\n }\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\n * Typical wrap counts are:\n * * 0 -- leave the point arrays with \"missing final edge\"\n * * 1 -- add point 0 as closure point\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\n */\n public static create(polyface: ExportGraphicsMesh, numWrap: number): ExportGraphicsMeshVisitor {\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\n }\n /** Reset the iterator to start at the first facet of the polyface. */\n public reset(): void {\n this.moveToReadIndex(0);\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\n }\n /** Select a facet by simple index. */\n public moveToReadIndex(facetIndex: number): boolean {\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\n return false;\n this._currentFacetIndex = facetIndex;\n this._nextFacetIndex = facetIndex + 1;\n this.point.length = 0;\n const points = this.point;\n points.length = 0;\n this.pointIndex.length = 0;\n this.point.length = 0;\n this.edgeVisible.length = 0;\n const sourcePoints = this._polyface.points;\n const indices = this._polyface.indices;\n const i0 = 3 * facetIndex;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 3 * indices[i];\n this.pointIndex.push(indices[i]);\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\n this.edgeVisible.push(true);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.point.pushFromGrowableXYZArray(this.point, i);\n }\n\n const sourceParams = this._polyface.params;\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\n this.paramIndex.length = 0;\n this.param.length = 0;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 2 * indices[i];\n this.paramIndex.push(indices[i]);\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.param.pushFromGrowableXYArray(this.param, i);\n }\n }\n\n const sourceNormals = this._polyface.normals;\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\n this.normalIndex.length = 0;\n this.normal.length = 0;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 3 * indices[i];\n this.normalIndex.push(indices[i]);\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.normal.pushFromGrowableXYZArray(this.normal, i);\n }\n }\n return true;\n }\n public moveToNextFacet(): boolean {\n return this.moveToReadIndex(this._nextFacetIndex);\n }\n /** Set the number of vertices to replicate in visitor arrays. */\n public setNumWrap(numWrap: number): void { this._numWrap = numWrap; }\n\n /** Return the index (in the client polyface) of the current facet */\n public currentReadIndex(): number { return this._currentFacetIndex; }\n /** Return the point index of vertex i within the currently loaded facet */\n public clientPointIndex(i: number): number { return this.pointIndex[i]; }\n /** Return the param index of vertex i within the currently loaded facet.\n * Use the artificial paramIndex, which matches pointIndex.\n */\n public clientParamIndex(i: number): number { return this.paramIndex ? this.paramIndex[i] : -1; }\n /** Return the normal index of vertex i within the currently loaded facet.\n * Use the artificial paramIndex, which matches pointIndex.\n */\n public clientNormalIndex(i: number): number { return this.normalIndex ? this.normalIndex[i] : -1; }\n /** Return the color index of vertex i within the currently loaded facet */\n public clientColorIndex(_i: number): number { return 1; }\n /** Return the aux data index of vertex i within the currently loaded facet */\n public clientAuxIndex(_i: number): number { return -1; }\n\n /** return the client polyface */\n public clientPolyface(): Polyface { return (undefined as unknown) as Polyface; }\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\n public clearArrays(): void {\n if (this.point !== undefined)\n this.point.length = 0;\n if (this.param !== undefined)\n this.param.length = 0;\n if (this.normal !== undefined)\n this.normal.length = 0;\n // ignore color and aux -- they never exist.\n }\n /** transfer interpolated data from the other visitor.\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\n */\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\n }\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\n this.point.pushFromGrowableXYZArray(other.point, index);\n if (this.color && other.color && index < other.color.length)\n this.color.push(other.color[index]);\n if (this.param && other.param && index < other.param.length)\n this.param.pushFromGrowableXYArray(other.param, index);\n if (this.normal && other.normal && index < other.normal.length)\n this.normal.pushFromGrowableXYZArray(other.normal, index);\n }\n\n}\n"]}
1
+ {"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAyB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAY,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AAkQhG;;GAEG;AACH,MAAM,KAAW,cAAc,CAuD9B;AAvDD,WAAiB,cAAc;IAC7B;;OAEG;IACH,SAAgB,wBAAwB,CAAC,GAA0B,EAAE,GAA0B;QAC7F,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAA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,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,CAAC;IACD,iEAAiE;IACjD,sBAAsB;QACpC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;IACnC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ExportGraphics\n */\n\nimport { assert, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\nimport { ColorDefProps, GeometryClass } from \"@itwin/core-common\";\n\n/** A collection of line segments, suitable for direct use with graphics APIs.\n * The structure of this data matches GL_LINES in OpenGL.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsLines {\n /** Zero-based vertex indices, every two indices represent a line segment */\n indices: Int32Array;\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\n points: Float64Array;\n}\n\n/** Info provided to ExportLinesFunction about linework graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportLinesInfo {\n /** The element ID for the element the graphics originated from */\n elementId: Id64String;\n /** ID for the [SubCategory]($core-backend) for these graphics */\n subCategory: Id64String;\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** The linework for these graphics */\n lines: ExportGraphicsLines;\n}\n\n/** A callback function that receives generated line graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\n\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsMesh {\n /** Zero-based vertex indices, every three indices represent a triangle */\n indices: Int32Array;\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\n points: Float64Array;\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\n normals: Float32Array;\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\n params: Float32Array;\n /** If true, clients should assume both sides of the mesh are visible and not cull back faces. */\n isTwoSided: boolean;\n}\n\n/** Info provided to ExportGraphicsFunction about graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsInfo {\n /** The element ID for the element the graphics originated from */\n elementId: Id64String;\n /** ID for the [SubCategory]($core-backend) for these graphics */\n subCategory: Id64String;\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\n materialId?: Id64String;\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\n textureId?: Id64String;\n /** The mesh for these graphics */\n mesh: ExportGraphicsMesh;\n}\n\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\n * same graphics (with a different transform).\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\n * graphics.\n * @public\n */\nexport interface ExportPartDisplayInfo {\n categoryId: Id64String;\n subCategoryId: Id64String;\n geometryClass: GeometryClass;\n materialId: Id64String;\n elmTransparency: number;\n lineColor: number;\n}\n\n/** Information about references to [GeometryPart]($core-backend) elements found during\n * a call to [IModelDb.exportGraphics]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\n * @public\n */\nexport interface ExportPartInstanceInfo {\n /** ID for the [GeometryPart]($core-backend) */\n partId: Id64String;\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\n partInstanceId: Id64String;\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\n displayProps: ExportPartDisplayInfo;\n /** A row-major storage 4x3 transform for this instance.\n * See export-gltf under test-apps in the iTwin.js monorepo for a working reference.\n */\n transform?: Float64Array;\n}\n\n/** A callback function that receives generated graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\n\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsOptions {\n /** The source elements for the exported graphics */\n elementIdArray: Id64Array;\n /** A function to call for each unique element ID, color and texture combination */\n onGraphics: ExportGraphicsFunction;\n /** An optional function to call if line graphics are desired. */\n onLineGraphics?: ExportLinesFunction;\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\n * recorded in this array. In this case, graphics that would result from the GeometryPart\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\n */\n partInstanceArray?: ExportPartInstanceInfo[];\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\n */\n chordTol?: number;\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to PI/12 (15 degrees).\n */\n angleTol?: number;\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry).\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\n * that it's necessary, it's almost certainly not!)\n */\n maxEdgeLength?: number;\n /** The longest dimension of a line style's largest component must be at least this size in order for\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\n * line strings.\n */\n minLineStyleComponentSize?: number;\n /** Max distance between mesh vertices for them to be collapsed.\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\n * anomalies so it is important to choose an appropriate setting for your use case.\n */\n decimationTol?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n}\n\n/** Info provided to ExportPartFunction about graphics.\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartInfo {\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\n materialId?: Id64String;\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\n textureId?: Id64String;\n /** The mesh for these graphics */\n mesh: ExportGraphicsMesh;\n}\n\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\n\n/** Info provided to ExportPartFunction about line graphics.\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartLinesInfo {\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** The linework for these graphics */\n lines: ExportGraphicsLines;\n}\n\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\n\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartGraphicsOptions {\n /** The ID for the source [GeometryPart]($core-backend) */\n elementId: Id64String;\n /** The base display properties to use for generating the graphics. This should come from an\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\n */\n displayProps: ExportPartDisplayInfo;\n /** A function to call for each unique color and texture combination. */\n onPartGraphics: ExportPartFunction;\n /** An optional function to call if line graphics are desired. */\n onPartLineGraphics?: ExportPartLinesFunction;\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\n */\n chordTol?: number;\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to PI/12 (15 degrees).\n */\n angleTol?: number;\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry)\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\n * that it's necessary, it's almost certainly not!)\n */\n maxEdgeLength?: number;\n /** The longest dimension of a line style's largest component must be at least this size in order for\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\n * line strings.\n */\n minLineStyleComponentSize?: number;\n /** Max distance between mesh vertices for them to be collapsed.\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\n * anomalies so it is important to choose an appropriate setting for your use case.\n */\n decimationTol?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n}\n\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport namespace ExportGraphics {\n /** Test if ExportPartDisplayInfos have exactly the same values.\n * @public\n */\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\n if (lhs.categoryId !== rhs.categoryId)\n return false;\n if (lhs.subCategoryId !== rhs.subCategoryId)\n return false;\n if (lhs.materialId !== rhs.materialId)\n return false;\n if (lhs.elmTransparency !== rhs.elmTransparency)\n return false;\n if (lhs.lineColor !== rhs.lineColor)\n return false;\n return true;\n }\n\n /**\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\n * @public\n */\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\n\n const p: Float64Array = mesh.points;\n for (let i = 0; i < p.length; i += 3)\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\n\n const n: Float32Array = mesh.normals;\n assert(undefined !== polyface.data.normal);\n for (let i = 0; i < n.length; i += 3)\n polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);\n\n const uv: Float32Array = mesh.params;\n assert(undefined !== polyface.data.param);\n for (let i = 0; i < uv.length; i += 2)\n polyface.data.param.pushXY(uv[i], uv[i + 1]);\n\n const indices = mesh.indices;\n const addIndex = (idx: number) => {\n polyface.addPointIndex(idx, true);\n polyface.addNormalIndex(idx);\n polyface.addParamIndex(idx);\n };\n for (let i = 0; i < indices.length; i += 3) {\n addIndex(indices[i]);\n addIndex(indices[i + 1]);\n addIndex(indices[i + 2]);\n polyface.terminateFacet(false);\n }\n\n return polyface;\n }\n}\n/**\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\n * * Because the ExportGraphicsMesh has limited data:\n * * There is no auxData in this visitor.\n * * There is no color in this visitor.\n * * All edgeVisible are true.\n * @public\n */\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\n private _currentFacetIndex: number;\n private _nextFacetIndex: number;\n private _numWrap: number;\n private _polyface: ExportGraphicsMesh;\n protected constructor(facets: ExportGraphicsMesh, numWrap: number) {\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\n this._polyface = facets;\n this._numWrap = numWrap;\n this._nextFacetIndex = 0;\n this._currentFacetIndex = -1;\n this.reset();\n }\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\n * Typical wrap counts are:\n * * 0 -- leave the point arrays with \"missing final edge\" (default)\n * * 1 -- add point 0 as closure point\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\n */\n public static create(polyface: ExportGraphicsMesh, numWrap: number = 0): ExportGraphicsMeshVisitor {\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\n }\n /** Restart the visitor at the first facet. */\n public reset(): void {\n this.moveToReadIndex(0);\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here\n }\n /** Select a facet by simple index. */\n public moveToReadIndex(facetIndex: number): boolean {\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\n return false;\n if (this._currentFacetIndex !== facetIndex || 3 + this._numWrap !== this.point.length) {\n this._currentFacetIndex = facetIndex;\n this.point.length = 0;\n this.pointIndex.length = 0;\n this.edgeVisible.length = 0;\n const sourcePoints = this._polyface.points;\n const indices = this._polyface.indices;\n const i0 = 3 * facetIndex;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 3 * indices[i];\n this.pointIndex.push(indices[i]);\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\n this.edgeVisible.push(true);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.point.pushFromGrowableXYZArray(this.point, i);\n }\n\n const sourceParams = this._polyface.params;\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\n this.paramIndex.length = 0;\n this.param.length = 0;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 2 * indices[i];\n this.paramIndex.push(indices[i]);\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.param.pushFromGrowableXYArray(this.param, i);\n }\n }\n\n const sourceNormals = this._polyface.normals;\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\n this.normalIndex.length = 0;\n this.normal.length = 0;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 3 * indices[i];\n this.normalIndex.push(indices[i]);\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.normal.pushFromGrowableXYZArray(this.normal, i);\n }\n }\n }\n this._nextFacetIndex = facetIndex + 1;\n return true;\n }\n /** Load data for the next facet. */\n public moveToNextFacet(): boolean {\n if (this._nextFacetIndex !== this._currentFacetIndex)\n return this.moveToReadIndex(this._nextFacetIndex);\n this._nextFacetIndex++;\n return true;\n }\n /** Set the number of vertices to replicate in visitor arrays. */\n public setNumWrap(numWrap: number): void {\n this._numWrap = numWrap;\n }\n\n /** Return the index (in the client polyface) of the current facet */\n public currentReadIndex(): number {\n return this._currentFacetIndex;\n }\n /** Return the point index of vertex i within the currently loaded facet */\n public clientPointIndex(i: number): number {\n return this.pointIndex[i];\n }\n /** Return the param index of vertex i within the currently loaded facet.\n * Use the artificial paramIndex, which matches pointIndex.\n */\n public clientParamIndex(i: number): number {\n return this.paramIndex ? this.paramIndex[i] : -1;\n }\n /** Return the normal index of vertex i within the currently loaded facet.\n * Use the artificial paramIndex, which matches pointIndex.\n */\n public clientNormalIndex(i: number): number {\n return this.normalIndex ? this.normalIndex[i] : -1;\n }\n /** Always returns -1 since we never have colors. */\n public clientColorIndex(_i: number): number {\n return -1;\n }\n /** Always returns -1 since we never have auxiliary data. */\n public clientAuxIndex(_i: number): number {\n return -1;\n }\n /** return the client polyface */\n public clientPolyface(): Polyface | undefined {\n return undefined;\n }\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\n public clearArrays(): void {\n if (this.point !== undefined)\n this.point.length = 0;\n if (this.param !== undefined)\n this.param.length = 0;\n if (this.normal !== undefined)\n this.normal.length = 0;\n // ignore color and aux -- they never exist.\n }\n /** transfer interpolated data from the other visitor.\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\n */\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\n }\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\n this.point.pushFromGrowableXYZArray(other.point, index);\n if (this.param && other.param && index < other.param.length)\n this.param.pushFromGrowableXYArray(other.param, index);\n if (this.normal && other.normal && index < other.normal.length)\n this.normal.pushFromGrowableXYZArray(other.normal, index);\n // ignore color and aux -- they never exist.\n }\n /** Return the number of facets this visitor is able to visit */\n public getVisitableFacetCount(): number {\n return Math.floor(this._polyface.indices.length / 3);\n }\n /** Create a visitor for a subset of the facets visitable by the instance. */\n public createSubsetVisitor(facetIndices: number[], numWrap: number = 0): ExportGraphicsMeshSubsetVisitor {\n return ExportGraphicsMeshSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);\n }\n}\n\n/**\n * An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.\n * * The subset is defined by an array of facet indices provided when this visitor is created.\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\n * @public\n */\nexport class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {\n private _facetIndices: number[];\n private _currentSubsetIndex: number; // index within _facetIndices\n private _nextSubsetIndex: number; // index within _facetIndices\n\n private constructor(polyface: ExportGraphicsMesh, facetIndices: number[], numWrap: number) {\n super(polyface, numWrap);\n this._facetIndices = facetIndices.slice();\n this._currentSubsetIndex = -1;\n this._nextSubsetIndex = 0;\n this.reset();\n }\n private isValidSubsetIndex(index: number): boolean {\n return index >= 0 && index < this._facetIndices.length;\n }\n /**\n * Create a visitor for iterating a subset of the facets of `polyface`.\n * @param polyface reference to the client polyface, supplying facets\n * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\n */\n public static createSubsetVisitor(\n polyface: ExportGraphicsMesh, facetIndices: number[], numWrap: number = 0,\n ): ExportGraphicsMeshSubsetVisitor {\n return new ExportGraphicsMeshSubsetVisitor(polyface, facetIndices, numWrap);\n }\n /**\n * Advance the iterator to a particular facet in the subset of client polyface facets.\n * @param subsetIndex index into the subset array, not to be confused with the client facet index.\n * @return whether the iterator was successfully moved.\n */\n public override moveToReadIndex(subsetIndex: number): boolean {\n if (this.isValidSubsetIndex(subsetIndex)) {\n this._currentSubsetIndex = subsetIndex;\n this._nextSubsetIndex = subsetIndex + 1;\n return super.moveToReadIndex(this._facetIndices[subsetIndex]);\n }\n return false;\n }\n /**\n * Advance the iterator to the next facet in the subset of client polyface facets.\n * @return whether the iterator was successfully moved.\n */\n public override moveToNextFacet(): boolean {\n if (this._nextSubsetIndex !== this._currentSubsetIndex)\n return this.moveToReadIndex(this._nextSubsetIndex);\n this._nextSubsetIndex++;\n return true;\n }\n /** Restart the visitor at the first facet. */\n public override reset(): void {\n if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized\n this.moveToReadIndex(0);\n this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here\n }\n }\n /**\n * Return the client polyface facet index (aka \"readIndex\") for the given subset index.\n * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.\n * @return valid client polyface facet index, or `undefined` if invalid subset index.\n */\n public parentFacetIndex(subsetIndex?: number): number | undefined {\n if (undefined === subsetIndex)\n subsetIndex = this._currentSubsetIndex;\n return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;\n }\n /** Return the number of facets this visitor is able to visit. */\n public override getVisitableFacetCount(): number {\n return this._facetIndices.length;\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @module iModels
3
3
  */
4
4
  import { Range2dProps } from "@itwin/core-geometry";
5
- /** Describes a geographic coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].
5
+ /** Describes a coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].
6
6
  * @beta
7
7
  */
8
8
  export interface AvailableCoordinateReferenceSystemProps {
@@ -26,10 +26,14 @@ export interface AvailableCoordinateReferenceSystemProps {
26
26
  * @beta
27
27
  */
28
28
  export interface GetAvailableCoordinateReferenceSystemsArgs {
29
- /** If provided, only return CRS's that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.
29
+ /** If provided, only return coordinate reference systems that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.
30
30
  * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.
31
31
  */
32
32
  extent?: Range2dProps;
33
+ /** If true, returns additional coordinate reference systems with extents spanning the entire Earth's surface.
34
+ * @default false
35
+ */
36
+ includeWorld?: boolean;
33
37
  }
34
38
  /** Get a list of Geographic Coordinate Reference Systems.
35
39
  * @param options Specifies the parameters to filter the returned list.
@@ -1 +1 @@
1
- {"version":3,"file":"GeographicCRSServices.d.ts","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACtD,mJAAmJ;IACnJ,IAAI,EAAE,MAAM,CAAC;IACb,8JAA8J;IAC9J,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,0CAA0C;IACzD;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAsB,sCAAsC,CAAC,IAAI,EAAE,0CAA0C,GAAG,OAAO,CAAC,uCAAuC,EAAE,CAAC,CAEjK"}
1
+ {"version":3,"file":"GeographicCRSServices.d.ts","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACtD,mJAAmJ;IACnJ,IAAI,EAAE,MAAM,CAAC;IACb,8JAA8J;IAC9J,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,0CAA0C;IACzD;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAsB,sCAAsC,CAAC,IAAI,EAAE,0CAA0C,GAAG,OAAO,CAAC,uCAAuC,EAAE,CAAC,CAEjK"}
@@ -12,6 +12,6 @@ import { IModelNative } from "./internal/NativePlatform";
12
12
  * @beta
13
13
  */
14
14
  export async function getAvailableCoordinateReferenceSystems(args) {
15
- return IModelNative.platform.GeoServices.getListOfCRS(args.extent);
15
+ return IModelNative.platform.GeoServices.getListOfCRS(args.extent, args.includeWorld);
16
16
  }
17
17
  //# sourceMappingURL=GeographicCRSServices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAiCzD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAAC,IAAgD;IAC3G,OAAO,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { Range2dProps } from \"@itwin/core-geometry\";\nimport { IModelNative } from \"./internal/NativePlatform\";\n\n/** Describes a geographic coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].\n * @beta\n */\nexport interface AvailableCoordinateReferenceSystemProps {\n /** The name of the coordinate reference system. It can be presented to the user in the UI as an identifier for the coordinate reference system. */\n name: string;\n /** The description of the coordinate reference system. It can be presented to the user in the UI as extra information for the coordinate reference system. */\n description: string;\n /** Indicate if the coordinate reference system is deprecated. A coordinate reference system is deprecated if it is no longer recommended for use.\n * A deprecated coordinate reference system can usually be substituted by a more accurate one. It is possible that an existing project uses a deprecated coordinate reference system.\n * However, for new projects, it is recommended to use a non-deprecated coordinate reference system.\n */\n deprecated: boolean;\n /** Extent of the coordinate reference system. This is the area where the coordinate reference system can be used.\n * Outside of this area, the coordinate reference system may not be accurate. The extent is defined by a range of longitude and latitude values.\n * Minimum longitude and latitude correspond to crsExtent.low.x and crsExtent.low.y, respectively.\n * Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.\n */\n crsExtent: Range2dProps;\n}\n\n/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].\n * @beta\n */\nexport interface GetAvailableCoordinateReferenceSystemsArgs {\n /** If provided, only return CRS's that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.\n * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.\n */\n extent?: Range2dProps;\n}\n\n/** Get a list of Geographic Coordinate Reference Systems.\n * @param options Specifies the parameters to filter the returned list.\n * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.\n * @beta\n */\nexport async function getAvailableCoordinateReferenceSystems(args: GetAvailableCoordinateReferenceSystemsArgs): Promise<AvailableCoordinateReferenceSystemProps[]> {\n return IModelNative.platform.GeoServices.getListOfCRS(args.extent);\n}\n"]}
1
+ {"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAqCzD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAAC,IAAgD;IAC3G,OAAO,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;AACxF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { Range2dProps } from \"@itwin/core-geometry\";\nimport { IModelNative } from \"./internal/NativePlatform\";\n\n/** Describes a coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].\n * @beta\n */\nexport interface AvailableCoordinateReferenceSystemProps {\n /** The name of the coordinate reference system. It can be presented to the user in the UI as an identifier for the coordinate reference system. */\n name: string;\n /** The description of the coordinate reference system. It can be presented to the user in the UI as extra information for the coordinate reference system. */\n description: string;\n /** Indicate if the coordinate reference system is deprecated. A coordinate reference system is deprecated if it is no longer recommended for use.\n * A deprecated coordinate reference system can usually be substituted by a more accurate one. It is possible that an existing project uses a deprecated coordinate reference system.\n * However, for new projects, it is recommended to use a non-deprecated coordinate reference system.\n */\n deprecated: boolean;\n /** Extent of the coordinate reference system. This is the area where the coordinate reference system can be used.\n * Outside of this area, the coordinate reference system may not be accurate. The extent is defined by a range of longitude and latitude values.\n * Minimum longitude and latitude correspond to crsExtent.low.x and crsExtent.low.y, respectively.\n * Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.\n */\n crsExtent: Range2dProps;\n}\n\n/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].\n * @beta\n */\nexport interface GetAvailableCoordinateReferenceSystemsArgs {\n /** If provided, only return coordinate reference systems that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.\n * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.\n */\n extent?: Range2dProps;\n /** If true, returns additional coordinate reference systems with extents spanning the entire Earth's surface.\n * @default false\n */\n includeWorld?: boolean\n}\n\n/** Get a list of Geographic Coordinate Reference Systems.\n * @param options Specifies the parameters to filter the returned list.\n * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.\n * @beta\n */\nexport async function getAvailableCoordinateReferenceSystems(args: GetAvailableCoordinateReferenceSystemsArgs): Promise<AvailableCoordinateReferenceSystemProps[]> {\n return IModelNative.platform.GeoServices.getListOfCRS(args.extent, args.includeWorld);\n}\n"]}