@itwin/core-backend 3.5.0-dev.12 → 3.5.0-dev.14

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 (223) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  3. package/lib/cjs/AliCloudStorageService.js +71 -71
  4. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  5. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  6. package/lib/cjs/BackendHubAccess.js +41 -41
  7. package/lib/cjs/BackendHubAccess.js.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  9. package/lib/cjs/BackendLoggerCategory.js +99 -99
  10. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  11. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  12. package/lib/cjs/BisCoreSchema.js +60 -60
  13. package/lib/cjs/BisCoreSchema.js.map +1 -1
  14. package/lib/cjs/BriefcaseManager.d.ts +165 -165
  15. package/lib/cjs/BriefcaseManager.js +405 -405
  16. package/lib/cjs/BriefcaseManager.js.map +1 -1
  17. package/lib/cjs/Category.d.ts +153 -153
  18. package/lib/cjs/Category.js +243 -243
  19. package/lib/cjs/Category.js.map +1 -1
  20. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  21. package/lib/cjs/ChangeSummaryManager.js +445 -445
  22. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  23. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  24. package/lib/cjs/ChangedElementsDb.js +165 -165
  25. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  26. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  27. package/lib/cjs/ChangedElementsManager.js +88 -88
  28. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  29. package/lib/cjs/CheckpointManager.d.ts +120 -120
  30. package/lib/cjs/CheckpointManager.js +343 -343
  31. package/lib/cjs/CheckpointManager.js.map +1 -1
  32. package/lib/cjs/ClassRegistry.d.ts +71 -71
  33. package/lib/cjs/ClassRegistry.js +215 -215
  34. package/lib/cjs/ClassRegistry.js.map +1 -1
  35. package/lib/cjs/CloudSqlite.d.ts +349 -349
  36. package/lib/cjs/CloudSqlite.js +151 -151
  37. package/lib/cjs/CloudSqlite.js.map +1 -1
  38. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  39. package/lib/cjs/CloudStorageBackend.js +173 -173
  40. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  41. package/lib/cjs/CodeService.d.ts +396 -396
  42. package/lib/cjs/CodeService.js +63 -63
  43. package/lib/cjs/CodeService.js.map +1 -1
  44. package/lib/cjs/CodeSpecs.d.ts +50 -50
  45. package/lib/cjs/CodeSpecs.js +112 -112
  46. package/lib/cjs/CodeSpecs.js.map +1 -1
  47. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  48. package/lib/cjs/ConcurrentQuery.js +30 -30
  49. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  50. package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
  51. package/lib/cjs/CustomViewState3dCreator.js +113 -113
  52. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  53. package/lib/cjs/DevTools.d.ts +71 -71
  54. package/lib/cjs/DevTools.js +154 -154
  55. package/lib/cjs/DevTools.js.map +1 -1
  56. package/lib/cjs/DisplayStyle.d.ts +106 -106
  57. package/lib/cjs/DisplayStyle.js +256 -256
  58. package/lib/cjs/DisplayStyle.js.map +1 -1
  59. package/lib/cjs/ECDb.d.ts +191 -191
  60. package/lib/cjs/ECDb.js +350 -350
  61. package/lib/cjs/ECDb.js.map +1 -1
  62. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  63. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  64. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  65. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  66. package/lib/cjs/ECSqlStatement.js +791 -791
  67. package/lib/cjs/ECSqlStatement.js.map +1 -1
  68. package/lib/cjs/Element.d.ts +1109 -1109
  69. package/lib/cjs/Element.js +1420 -1420
  70. package/lib/cjs/Element.js.map +1 -1
  71. package/lib/cjs/ElementAspect.d.ts +156 -156
  72. package/lib/cjs/ElementAspect.js +178 -178
  73. package/lib/cjs/ElementAspect.js.map +1 -1
  74. package/lib/cjs/ElementGraphics.d.ts +9 -9
  75. package/lib/cjs/ElementGraphics.js +41 -41
  76. package/lib/cjs/ElementGraphics.js.map +1 -1
  77. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  78. package/lib/cjs/ElementTreeWalker.js +409 -409
  79. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  80. package/lib/cjs/Entity.d.ts +76 -76
  81. package/lib/cjs/Entity.js +82 -82
  82. package/lib/cjs/Entity.js.map +1 -1
  83. package/lib/cjs/ExportGraphics.d.ts +317 -317
  84. package/lib/cjs/ExportGraphics.js +208 -208
  85. package/lib/cjs/ExportGraphics.js.map +1 -1
  86. package/lib/cjs/ExternalSource.d.ts +94 -94
  87. package/lib/cjs/ExternalSource.js +125 -125
  88. package/lib/cjs/ExternalSource.js.map +1 -1
  89. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  90. package/lib/cjs/GeoCoordConfig.js +82 -82
  91. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  92. package/lib/cjs/GeometrySummary.d.ts +4 -4
  93. package/lib/cjs/GeometrySummary.js +380 -380
  94. package/lib/cjs/GeometrySummary.js.map +1 -1
  95. package/lib/cjs/HubMock.d.ts +93 -93
  96. package/lib/cjs/HubMock.js +190 -190
  97. package/lib/cjs/HubMock.js.map +1 -1
  98. package/lib/cjs/IModelCloneContext.d.ts +85 -85
  99. package/lib/cjs/IModelCloneContext.js +150 -150
  100. package/lib/cjs/IModelCloneContext.js.map +1 -1
  101. package/lib/cjs/IModelDb.d.ts +1164 -1164
  102. package/lib/cjs/IModelDb.js +2324 -2324
  103. package/lib/cjs/IModelDb.js.map +1 -1
  104. package/lib/cjs/IModelHost.d.ts +361 -361
  105. package/lib/cjs/IModelHost.js +489 -489
  106. package/lib/cjs/IModelHost.js.map +1 -1
  107. package/lib/cjs/IModelJsFs.d.ts +62 -62
  108. package/lib/cjs/IModelJsFs.js +140 -140
  109. package/lib/cjs/IModelJsFs.js.map +1 -1
  110. package/lib/cjs/IpcHost.d.ts +98 -98
  111. package/lib/cjs/IpcHost.js +234 -234
  112. package/lib/cjs/IpcHost.js.map +1 -1
  113. package/lib/cjs/LineStyle.d.ts +311 -311
  114. package/lib/cjs/LineStyle.js +295 -295
  115. package/lib/cjs/LineStyle.js.map +1 -1
  116. package/lib/cjs/LocalHub.d.ts +162 -162
  117. package/lib/cjs/LocalHub.js +587 -587
  118. package/lib/cjs/LocalHub.js.map +1 -1
  119. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  120. package/lib/cjs/LocalhostIpcHost.js +81 -81
  121. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  122. package/lib/cjs/Material.d.ts +103 -103
  123. package/lib/cjs/Material.js +147 -147
  124. package/lib/cjs/Material.js.map +1 -1
  125. package/lib/cjs/Model.d.ts +386 -386
  126. package/lib/cjs/Model.js +471 -471
  127. package/lib/cjs/Model.js.map +1 -1
  128. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  129. package/lib/cjs/NativeAppStorage.js +202 -202
  130. package/lib/cjs/NativeAppStorage.js.map +1 -1
  131. package/lib/cjs/NativeHost.d.ts +52 -52
  132. package/lib/cjs/NativeHost.js +168 -168
  133. package/lib/cjs/NativeHost.js.map +1 -1
  134. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  135. package/lib/cjs/NavigationRelationship.js +225 -225
  136. package/lib/cjs/NavigationRelationship.js.map +1 -1
  137. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  138. package/lib/cjs/PromiseMemoizer.js +101 -101
  139. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  140. package/lib/cjs/PropertyStore.d.ts +132 -132
  141. package/lib/cjs/PropertyStore.js +11 -11
  142. package/lib/cjs/PropertyStore.js.map +1 -1
  143. package/lib/cjs/Relationship.d.ts +400 -400
  144. package/lib/cjs/Relationship.js +465 -465
  145. package/lib/cjs/Relationship.js.map +1 -1
  146. package/lib/cjs/RpcBackend.d.ts +28 -28
  147. package/lib/cjs/RpcBackend.js +126 -126
  148. package/lib/cjs/RpcBackend.js.map +1 -1
  149. package/lib/cjs/SQLiteDb.d.ts +219 -219
  150. package/lib/cjs/SQLiteDb.js +214 -214
  151. package/lib/cjs/SQLiteDb.js.map +1 -1
  152. package/lib/cjs/Schema.d.ts +55 -55
  153. package/lib/cjs/Schema.js +83 -83
  154. package/lib/cjs/Schema.js.map +1 -1
  155. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  156. package/lib/cjs/ServerBasedLocks.js +168 -168
  157. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  158. package/lib/cjs/SqliteStatement.d.ts +283 -283
  159. package/lib/cjs/SqliteStatement.js +448 -448
  160. package/lib/cjs/SqliteStatement.js.map +1 -1
  161. package/lib/cjs/Texture.d.ts +58 -58
  162. package/lib/cjs/Texture.js +82 -82
  163. package/lib/cjs/Texture.js.map +1 -1
  164. package/lib/cjs/TileStorage.d.ts +18 -18
  165. package/lib/cjs/TileStorage.js +90 -90
  166. package/lib/cjs/TileStorage.js.map +1 -1
  167. package/lib/cjs/TxnManager.d.ts +202 -202
  168. package/lib/cjs/TxnManager.js +356 -356
  169. package/lib/cjs/TxnManager.js.map +1 -1
  170. package/lib/cjs/ViewDefinition.d.ts +435 -435
  171. package/lib/cjs/ViewDefinition.js +635 -635
  172. package/lib/cjs/ViewDefinition.js.map +1 -1
  173. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  174. package/lib/cjs/ViewStateHydrator.js +103 -103
  175. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  176. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  177. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  178. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  179. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  180. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  181. package/lib/cjs/core-backend.d.ts +182 -182
  182. package/lib/cjs/core-backend.js +202 -202
  183. package/lib/cjs/core-backend.js.map +1 -1
  184. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  185. package/lib/cjs/domains/FunctionalElements.js +145 -145
  186. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  187. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  188. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  189. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  190. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  191. package/lib/cjs/domains/GenericElements.js +263 -263
  192. package/lib/cjs/domains/GenericElements.js.map +1 -1
  193. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  194. package/lib/cjs/domains/GenericSchema.js +28 -28
  195. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  196. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  197. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  198. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  199. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
  200. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
  201. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  202. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  203. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +204 -204
  204. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  205. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  206. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  207. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  208. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  209. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  210. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  211. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  212. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  213. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  214. package/lib/cjs/workspace/Settings.d.ts +186 -186
  215. package/lib/cjs/workspace/Settings.js +155 -155
  216. package/lib/cjs/workspace/Settings.js.map +1 -1
  217. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  218. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  219. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  220. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  221. package/lib/cjs/workspace/Workspace.js +543 -543
  222. package/lib/cjs/workspace/Workspace.js.map +1 -1
  223. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"ViewDefinition.js","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH,sDAAoG;AACpG,wDAE8B;AAC9B,oDAI4B;AAC5B,uCAA0F;AAK1F;;;;GAIG;AACH,MAAa,aAAc,SAAQ,2BAAiB;IAMlD,gBAAgB;IAChB,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IATD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAU1E,gBAAgB;IACA,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CA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CAAC,CAAC,CAAC;IALlF,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;CAK3E;AAPD,sCAOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ViewDefinitions\r\n */\r\n\r\nimport { Id64, Id64Array, Id64Set, Id64String, IModelStatus, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Matrix3d, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, BisCodeSpec, Camera,\r\n CategorySelectorProps, Code, CodeScopeProps, CodeSpec, IModelError, LightLocationProps, ModelSelectorProps, RelatedElement,\r\n SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails, ViewDetails3d,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from \"./Element\";\r\nimport { IModelCloneContext } from \"./IModelCloneContext\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from \"./DisplayStyle\";\r\n\r\n/** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.\r\n * @see [ModelSelectorState]($frontend)\r\n * See [how to create a ModelSelector]$(docs/learning/backend/CreateElements.md#ModelSelector).\r\n * @public\r\n */\r\nexport class ModelSelector extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"ModelSelector\"; }\r\n\r\n /** The array of modelIds of the GeometricModels displayed by this ModelSelector */\r\n public models: Id64String[];\r\n /** @internal */\r\n constructor(props: ModelSelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.models = props.models;\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ModelSelectorProps {\r\n const val = super.toJSON() as ModelSelectorProps;\r\n val.models = this.models;\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n protected override collectReferenceIds(referenceIds: Id64Set): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.models.forEach((modelId: Id64String) => referenceIds.add(modelId));\r\n }\r\n\r\n /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.\r\n * @param codeValue The ModelSelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.modelSelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The newly constructed ModelSelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): ModelSelector {\r\n const modelSelectorProps: ModelSelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n models,\r\n isPrivate: false,\r\n };\r\n return new ModelSelector(modelSelectorProps, iModelDb);\r\n }\r\n /**\r\n * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new ModelSelector into this DefinitionModel\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The Id of the newly inserted ModelSelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): Id64String {\r\n const modelSelector = this.create(iModelDb, definitionModelId, name, models);\r\n return iModelDb.elements.insertElement(modelSelector.toJSON());\r\n }\r\n}\r\n\r\n/** Holds a list of Ids of Categories to be displayed in a view.\r\n * @see [CategorySelectorState]($frontend)\r\n * See [how to create a CategorySelector]$(docs/learning/backend/CreateElements.md#CategorySelector).\r\n * @public\r\n */\r\nexport class CategorySelector extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"CategorySelector\"; }\r\n /** The array of element Ids of the Categories selected by this CategorySelector */\r\n public categories: Id64String[];\r\n /** @internal */\r\n constructor(props: CategorySelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.categories = props.categories;\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): CategorySelectorProps {\r\n const val = super.toJSON() as CategorySelectorProps;\r\n val.categories = this.categories;\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n protected override collectReferenceIds(referenceIds: Id64Set): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.categories.forEach((categoryId: Id64String) => referenceIds.add(categoryId));\r\n }\r\n\r\n /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.\r\n * @param codeValue The CategorySelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.categorySelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The newly constructed CategorySelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): CategorySelector {\r\n const categorySelectorProps: CategorySelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n categories,\r\n isPrivate: false,\r\n };\r\n return new CategorySelector(categorySelectorProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new CategorySelector into this DefinitionModel\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The Id of the newly inserted CategorySelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): Id64String {\r\n const categorySelector = this.create(iModelDb, definitionModelId, name, categories);\r\n return iModelDb.elements.insertElement(categorySelector.toJSON());\r\n }\r\n}\r\n\r\n/**\r\n * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,\r\n * plus additional view-specific parameters in their [[Element.jsonProperties]].\r\n *\r\n * Subclasses of ViewDefinition determine which model(s) are viewed.\r\n *\r\n * **Example: Obtaining the background color for a view**\r\n * ``` ts\r\n * [[include:ViewDefinition.getBackgroundColor]]\r\n * ```\r\n *\r\n * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.\r\n * @public\r\n */\r\nexport abstract class ViewDefinition extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"ViewDefinition\"; }\r\n /** The element Id of the [[CategorySelector]] for this ViewDefinition */\r\n public categorySelectorId: Id64String;\r\n /** The element Id of the [[DisplayStyle]] for this ViewDefinition */\r\n public displayStyleId: Id64String;\r\n\r\n /** @internal */\r\n protected constructor(props: ViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n\r\n this.categorySelectorId = Id64.fromJSON(props.categorySelectorId);\r\n if (!Id64.isValid(this.categorySelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `categorySelectorId is invalid`);\r\n\r\n this.displayStyleId = Id64.fromJSON(props.displayStyleId);\r\n if (!Id64.isValid(this.displayStyleId))\r\n throw new IModelError(IModelStatus.BadArg, `displayStyleId is invalid`);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ViewDefinitionProps {\r\n const json = super.toJSON() as ViewDefinitionProps;\r\n json.categorySelectorId = this.categorySelectorId;\r\n json.displayStyleId = this.displayStyleId;\r\n return json;\r\n }\r\n\r\n /** @internal */\r\n protected override collectReferenceIds(referenceIds: Id64Set): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.add(this.categorySelectorId);\r\n referenceIds.add(this.displayStyleId);\r\n const acsId: Id64String = this.getAuxiliaryCoordinateSystemId();\r\n if (Id64.isValidId64(acsId)) {\r\n referenceIds.add(acsId);\r\n }\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"categorySelectorId\", \"displayStyleId\"];\r\n\r\n /** @internal */\r\n protected static override onCloned(context: IModelCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): void {\r\n super.onCloned(context, sourceElementProps, targetElementProps);\r\n if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {\r\n const acsId: Id64String = Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);\r\n if (Id64.isValidId64(acsId)) {\r\n targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);\r\n }\r\n }\r\n }\r\n\r\n /** Type guard for `instanceof ViewDefinition3d` */\r\n public isView3d(): this is ViewDefinition3d { return this instanceof ViewDefinition3d; }\r\n /** Type guard for 'instanceof ViewDefinition2d` */\r\n public isView2d(): this is ViewDefinition2d { return this instanceof ViewDefinition2d; }\r\n /** Type guard for `instanceof SpatialViewDefinition` */\r\n public isSpatialView(): this is SpatialViewDefinition { return this instanceof SpatialViewDefinition; }\r\n /** Type guard for 'instanceof DrawingViewDefinition' */\r\n public isDrawingView(): this is DrawingViewDefinition { return this instanceof DrawingViewDefinition; }\r\n\r\n /** Load this view's DisplayStyle from the IModelDb. */\r\n public loadDisplayStyle(): DisplayStyle { return this.iModel.elements.getElement<DisplayStyle>(this.displayStyleId); }\r\n\r\n /** Load this view's CategorySelector from the IModelDb. */\r\n public loadCategorySelector(): CategorySelector { return this.iModel.elements.getElement<CategorySelector>(this.categorySelectorId); }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public abstract get details(): ViewDetails;\r\n\r\n /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */\r\n public getAuxiliaryCoordinateSystemId(): Id64String {\r\n return this.details.auxiliaryCoordinateSystemId;\r\n }\r\n\r\n /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.\r\n * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.\r\n */\r\n public setAuxiliaryCoordinateSystemId(acsId: Id64String) {\r\n this.details.auxiliaryCoordinateSystemId = acsId;\r\n }\r\n\r\n /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.\r\n * @param codeValue The ViewDefinition name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.viewDefinition);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a view of one or more 3d models.\r\n * @public\r\n */\r\nexport abstract class ViewDefinition3d extends ViewDefinition {\r\n private readonly _details: ViewDetails3d;\r\n /** @internal */\r\n public static override get className(): string { return \"ViewDefinition3d\"; }\r\n /** If true, camera is used. Otherwise, use an orthographic projection. */\r\n public cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n public origin: Point3d;\r\n /** The extent (size) of the view frustum, in meters, along its x,y,z axes. */\r\n public extents: Vector3d;\r\n /** Rotation from world coordinates to view coordinates. */\r\n public angles: YawPitchRollAngles;\r\n /** The camera used for this view, if `cameraOn` is true. */\r\n public camera: Camera;\r\n\r\n /** @internal */\r\n public constructor(props: ViewDefinition3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.cameraOn = JsonUtils.asBool(props.cameraOn);\r\n this.origin = Point3d.fromJSON(props.origin);\r\n this.extents = Vector3d.fromJSON(props.extents);\r\n this.angles = YawPitchRollAngles.fromJSON(props.angles);\r\n this.camera = new Camera(props.camera);\r\n this._details = new ViewDetails3d(this.jsonProperties);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ViewDefinition3dProps {\r\n const val = super.toJSON() as ViewDefinition3dProps;\r\n val.cameraOn = this.cameraOn;\r\n val.origin = this.origin;\r\n val.extents = this.extents;\r\n val.angles = this.angles;\r\n val.camera = this.camera;\r\n return val;\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails3d { return this._details; }\r\n\r\n /** Load this view's DisplayStyle3d from the IModelDb. */\r\n public loadDisplayStyle3d(): DisplayStyle3d { return this.iModel.elements.getElement<DisplayStyle3d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of one or more SpatialModels.\r\n * The list of viewed models is stored by the ModelSelector.\r\n *\r\n * This is how a SpatialViewDefinition selects the elements to display:\r\n *\r\n * SpatialViewDefinition\r\n * * ModelSelector\r\n * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model\r\n * * CategorySelector\r\n * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category\r\n * @public\r\n */\r\nexport class SpatialViewDefinition extends ViewDefinition3d {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialViewDefinition\"; }\r\n /** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */\r\n public modelSelectorId: Id64String;\r\n\r\n /** @internal */\r\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.modelSelectorId = Id64.fromJSON(props.modelSelectorId);\r\n if (!Id64.isValid(this.modelSelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `modelSelectorId is invalid`);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): SpatialViewDefinitionProps {\r\n const json = super.toJSON() as SpatialViewDefinitionProps;\r\n json.modelSelectorId = this.modelSelectorId;\r\n return json;\r\n }\r\n\r\n /** @internal */\r\n protected override collectReferenceIds(referenceIds: Id64Set): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.add(this.modelSelectorId);\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"modelSelectorId\"];\r\n\r\n /** Load this view's ModelSelector from the IModelDb. */\r\n public loadModelSelector(): ModelSelector { return this.iModel.elements.getElement<ModelSelector>(this.modelSelectorId); }\r\n /**\r\n * Create an SpatialViewDefinition with camera.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @param cameraAngle Camera angle in radians.\r\n * @returns The newly constructed OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static createWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): SpatialViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);\r\n const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.\r\n cameraLocation.z += cameraDistance; // Back up by camera distance.\r\n rotation.multiplyTransposeVectorInPlace(cameraLocation);\r\n\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: true,\r\n camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },\r\n };\r\n return new SpatialViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n /**\r\n * Insert an SpatialViewDefinition with camera On\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @param cameraAngle Camera angle in radians.\r\n * @returns The Id of the newly inserted OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insertWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): Id64String {\r\n const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\r\n * See [how to create a OrthographicViewDefinition]$(docs/learning/backend/CreateElements.md#OrthographicViewDefinition).\r\n * @public\r\n */\r\nexport class OrthographicViewDefinition extends SpatialViewDefinition {\r\n /** @internal */\r\n public static override get className(): string { return \"OrthographicViewDefinition\"; }\r\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) { super(props, iModel); }\r\n /**\r\n * Create an OrthographicViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The newly constructed OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): OrthographicViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: false,\r\n camera: new Camera(), // not used when cameraOn === false\r\n };\r\n return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n /**\r\n * Insert an OrthographicViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The Id of the newly inserted OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n /** Set a new viewed range without changing the rotation or any other properties. */\r\n public setRange(range: Range3d): void {\r\n const rotation = this.angles.toMatrix3d();\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n this.origin = Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));\r\n this.extents = rotatedRange.diagonal();\r\n }\r\n}\r\n\r\n/** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.\r\n * @public\r\n */\r\nexport class ViewDefinition2d extends ViewDefinition {\r\n private readonly _details: ViewDetails;\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"ViewDefinition2d\"; }\r\n /** The Id of the Model displayed by this view. */\r\n public baseModelId: Id64String;\r\n /** The lower-left corner of this view in Model coordinates. */\r\n public origin: Point2d;\r\n /** The delta (size) of this view, in meters, aligned with view x,y. */\r\n public delta: Point2d;\r\n /** The rotation of this view. */\r\n public angle: Angle;\r\n\r\n /** @internal */\r\n public constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.baseModelId = Id64.fromJSON(props.baseModelId);\r\n this.origin = Point2d.fromJSON(props.origin);\r\n this.delta = Point2d.fromJSON(props.delta);\r\n this.angle = Angle.fromJSON(props.angle);\r\n this._details = new ViewDetails(this.jsonProperties);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ViewDefinition2dProps {\r\n const val = super.toJSON() as ViewDefinition2dProps;\r\n val.baseModelId = this.baseModelId;\r\n val.origin = this.origin;\r\n val.delta = this.delta;\r\n val.angle = this.angle;\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n protected override collectReferenceIds(referenceIds: Id64Set): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.add(this.baseModelId);\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails { return this._details; }\r\n\r\n /** Load this view's DisplayStyle2d from the IModelDb. */\r\n public loadDisplayStyle2d(): DisplayStyle2d { return this.iModel.elements.getElement<DisplayStyle2d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of a [[DrawingModel]].\r\n * @public\r\n */\r\nexport class DrawingViewDefinition extends ViewDefinition2d {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingViewDefinition\"; }\r\n /** @internal */\r\n public constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a DrawingViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is a problem creating the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): DrawingViewDefinition {\r\n const viewDefinitionProps: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n return new DrawingViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /** Insert a DrawingViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Defines a view of a [[SheetModel]].\r\n * @public\r\n */\r\nexport class SheetViewDefinition extends ViewDefinition2d {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetViewDefinition\"; }\r\n}\r\n\r\n/** A ViewDefinition used to display a 2d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition2d extends ViewDefinition2d {\r\n /** @internal */\r\n public static override get className(): string { return \"TemplateViewDefinition2d\"; }\r\n}\r\n\r\n/** A ViewDefinition used to display a 3d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition3d extends ViewDefinition3d {\r\n /** @internal */\r\n public static override get className(): string { return \"TemplateViewDefinition3d\"; }\r\n}\r\n\r\n/** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show\r\n * coordinate information in different units and/or orientations.\r\n * @public\r\n */\r\nexport abstract class AuxCoordSystem extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"AuxCoordSystem\"; }\r\n public type!: number;\r\n public description?: string;\r\n public constructor(props: AuxCoordSystemProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A 2d auxiliary coordinate system.\r\n * @public\r\n */\r\nexport class AuxCoordSystem2d extends AuxCoordSystem {\r\n /** @internal */\r\n public static override get className(): string { return \"AuxCoordSystem2d\"; }\r\n public origin?: Point2d;\r\n public angle!: number;\r\n public constructor(props: AuxCoordSystem2dProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A 3d auxiliary coordinate system.\r\n * @public\r\n */\r\nexport class AuxCoordSystem3d extends AuxCoordSystem {\r\n /** @internal */\r\n public static override get className(): string { return \"AuxCoordSystem3d\"; }\r\n public origin?: Point3d;\r\n public yaw!: number;\r\n public pitch!: number;\r\n public roll!: number;\r\n public constructor(props: AuxCoordSystem3dProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem3d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem3d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A spatial auxiliary coordinate system.\r\n * @public\r\n */\r\nexport class AuxCoordSystemSpatial extends AuxCoordSystem3d {\r\n /** @internal */\r\n public static override get className(): string { return \"AuxCoordSystemSpatial\"; }\r\n /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystemSpatial name\r\n */\r\n public static override createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystemSpatial);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].\r\n * @public\r\n */\r\nexport class ViewAttachment extends GraphicalElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"ViewAttachment\"; }\r\n public view: RelatedElement;\r\n public constructor(props: ViewAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.view = new RelatedElement(props.view);\r\n // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.\r\n }\r\n /** @internal */\r\n protected override collectReferenceIds(referenceIds: Id64Set): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.add(this.view.id);\r\n }\r\n}\r\n\r\n/** The position in space of a Light.\r\n * @internal\r\n */\r\nexport class LightLocation extends SpatialLocationElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LightLocation\"; }\r\n /** Whether this light is currently turned on. */\r\n public enabled!: boolean;\r\n /** @internal */\r\n constructor(props: LightLocationProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewDefinition.js","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH,sDAAoG;AACpG,wDAE8B;AAC9B,oDAI4B;AAC5B,uCAA0F;AAK1F;;;;GAIG;AACH,MAAa,aAAc,SAAQ,2BAAiB;IAMlD,gBAAgB;IAChB,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IATD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAU1E,gBAAgB;IACA,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,gBAAgB;IACG,mBAAmB,CAAC,YAAqB;QAC1D,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAmB,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,MAAgB,EAAE,YAA4B,EAAE,SAAiB;QACxF,MAAM,QAAQ,GAAa,MAAM,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F,OAAO,IAAI,kBAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AAZD,sDAYC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,4BAAkB;IAIpD,YAAmB,KAA0B,EAAE,MAAgB;QAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,4BAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,0GAA0G;IAC5G,CAAC;IAPD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC;IAO3E,gBAAgB;IACG,mBAAmB,CAAC,YAAqB;QAC1D,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;CACF;AAdD,wCAcC;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,gCAAsB;IAKvD,gBAAgB;IAChB,YAAY,KAAyB,EAAE,MAAgB,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IALlF,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;CAK3E;AAPD,sCAOC","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 ViewDefinitions\n */\n\nimport { Id64, Id64Array, Id64Set, Id64String, IModelStatus, JsonUtils } from \"@itwin/core-bentley\";\nimport {\n Angle, Matrix3d, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Transform, Vector3d, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport {\n AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, BisCodeSpec, Camera,\n CategorySelectorProps, Code, CodeScopeProps, CodeSpec, IModelError, LightLocationProps, ModelSelectorProps, RelatedElement,\n SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails, ViewDetails3d,\n} from \"@itwin/core-common\";\nimport { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from \"./Element\";\nimport { IModelCloneContext } from \"./IModelCloneContext\";\nimport { IModelDb } from \"./IModelDb\";\nimport { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from \"./DisplayStyle\";\n\n/** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.\n * @see [ModelSelectorState]($frontend)\n * See [how to create a ModelSelector]$(docs/learning/backend/CreateElements.md#ModelSelector).\n * @public\n */\nexport class ModelSelector extends DefinitionElement {\n /** @internal */\n public static override get className(): string { return \"ModelSelector\"; }\n\n /** The array of modelIds of the GeometricModels displayed by this ModelSelector */\n public models: Id64String[];\n /** @internal */\n constructor(props: ModelSelectorProps, iModel: IModelDb) {\n super(props, iModel);\n this.models = props.models;\n }\n\n /** @internal */\n public override toJSON(): ModelSelectorProps {\n const val = super.toJSON() as ModelSelectorProps;\n val.models = this.models;\n return val;\n }\n\n /** @internal */\n protected override collectReferenceIds(referenceIds: Id64Set): void {\n super.collectReferenceIds(referenceIds);\n this.models.forEach((modelId: Id64String) => referenceIds.add(modelId));\n }\n\n /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.\n * @param codeValue The ModelSelector name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.modelSelector);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n\n /**\n * Create a ModelSelector to select which Models are displayed by a ViewDefinition.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the ModelSelector\n * @param models Array of models to select for display\n * @returns The newly constructed ModelSelector element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): ModelSelector {\n const modelSelectorProps: ModelSelectorProps = {\n classFullName: this.classFullName,\n code: this.createCode(iModelDb, definitionModelId, name),\n model: definitionModelId,\n models,\n isPrivate: false,\n };\n return new ModelSelector(modelSelectorProps, iModelDb);\n }\n /**\n * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new ModelSelector into this DefinitionModel\n * @param name The name/CodeValue of the ModelSelector\n * @param models Array of models to select for display\n * @returns The Id of the newly inserted ModelSelector element.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): Id64String {\n const modelSelector = this.create(iModelDb, definitionModelId, name, models);\n return iModelDb.elements.insertElement(modelSelector.toJSON());\n }\n}\n\n/** Holds a list of Ids of Categories to be displayed in a view.\n * @see [CategorySelectorState]($frontend)\n * See [how to create a CategorySelector]$(docs/learning/backend/CreateElements.md#CategorySelector).\n * @public\n */\nexport class CategorySelector extends DefinitionElement {\n /** @internal */\n public static override get className(): string { return \"CategorySelector\"; }\n /** The array of element Ids of the Categories selected by this CategorySelector */\n public categories: Id64String[];\n /** @internal */\n constructor(props: CategorySelectorProps, iModel: IModelDb) {\n super(props, iModel);\n this.categories = props.categories;\n }\n\n /** @internal */\n public override toJSON(): CategorySelectorProps {\n const val = super.toJSON() as CategorySelectorProps;\n val.categories = this.categories;\n return val;\n }\n\n /** @internal */\n protected override collectReferenceIds(referenceIds: Id64Set): void {\n super.collectReferenceIds(referenceIds);\n this.categories.forEach((categoryId: Id64String) => referenceIds.add(categoryId));\n }\n\n /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.\n * @param codeValue The CategorySelector name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.categorySelector);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n\n /**\n * Create a CategorySelector to select which categories are displayed by a ViewDefinition.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name of the CategorySelector\n * @param categories Array of categories to select for display\n * @returns The newly constructed CategorySelector element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): CategorySelector {\n const categorySelectorProps: CategorySelectorProps = {\n classFullName: this.classFullName,\n code: this.createCode(iModelDb, definitionModelId, name),\n model: definitionModelId,\n categories,\n isPrivate: false,\n };\n return new CategorySelector(categorySelectorProps, iModelDb);\n }\n\n /**\n * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new CategorySelector into this DefinitionModel\n * @param name The name of the CategorySelector\n * @param categories Array of categories to select for display\n * @returns The Id of the newly inserted CategorySelector element.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): Id64String {\n const categorySelector = this.create(iModelDb, definitionModelId, name, categories);\n return iModelDb.elements.insertElement(categorySelector.toJSON());\n }\n}\n\n/**\n * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,\n * plus additional view-specific parameters in their [[Element.jsonProperties]].\n *\n * Subclasses of ViewDefinition determine which model(s) are viewed.\n *\n * **Example: Obtaining the background color for a view**\n * ``` ts\n * [[include:ViewDefinition.getBackgroundColor]]\n * ```\n *\n * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.\n * @public\n */\nexport abstract class ViewDefinition extends DefinitionElement {\n /** @internal */\n public static override get className(): string { return \"ViewDefinition\"; }\n /** The element Id of the [[CategorySelector]] for this ViewDefinition */\n public categorySelectorId: Id64String;\n /** The element Id of the [[DisplayStyle]] for this ViewDefinition */\n public displayStyleId: Id64String;\n\n /** @internal */\n protected constructor(props: ViewDefinitionProps, iModel: IModelDb) {\n super(props, iModel);\n\n this.categorySelectorId = Id64.fromJSON(props.categorySelectorId);\n if (!Id64.isValid(this.categorySelectorId))\n throw new IModelError(IModelStatus.BadArg, `categorySelectorId is invalid`);\n\n this.displayStyleId = Id64.fromJSON(props.displayStyleId);\n if (!Id64.isValid(this.displayStyleId))\n throw new IModelError(IModelStatus.BadArg, `displayStyleId is invalid`);\n }\n\n /** @internal */\n public override toJSON(): ViewDefinitionProps {\n const json = super.toJSON() as ViewDefinitionProps;\n json.categorySelectorId = this.categorySelectorId;\n json.displayStyleId = this.displayStyleId;\n return json;\n }\n\n /** @internal */\n protected override collectReferenceIds(referenceIds: Id64Set): void {\n super.collectReferenceIds(referenceIds);\n referenceIds.add(this.categorySelectorId);\n referenceIds.add(this.displayStyleId);\n const acsId: Id64String = this.getAuxiliaryCoordinateSystemId();\n if (Id64.isValidId64(acsId)) {\n referenceIds.add(acsId);\n }\n }\n\n /** @beta */\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"categorySelectorId\", \"displayStyleId\"];\n\n /** @internal */\n protected static override onCloned(context: IModelCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): void {\n super.onCloned(context, sourceElementProps, targetElementProps);\n if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {\n const acsId: Id64String = Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);\n if (Id64.isValidId64(acsId)) {\n targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);\n }\n }\n }\n\n /** Type guard for `instanceof ViewDefinition3d` */\n public isView3d(): this is ViewDefinition3d { return this instanceof ViewDefinition3d; }\n /** Type guard for 'instanceof ViewDefinition2d` */\n public isView2d(): this is ViewDefinition2d { return this instanceof ViewDefinition2d; }\n /** Type guard for `instanceof SpatialViewDefinition` */\n public isSpatialView(): this is SpatialViewDefinition { return this instanceof SpatialViewDefinition; }\n /** Type guard for 'instanceof DrawingViewDefinition' */\n public isDrawingView(): this is DrawingViewDefinition { return this instanceof DrawingViewDefinition; }\n\n /** Load this view's DisplayStyle from the IModelDb. */\n public loadDisplayStyle(): DisplayStyle { return this.iModel.elements.getElement<DisplayStyle>(this.displayStyleId); }\n\n /** Load this view's CategorySelector from the IModelDb. */\n public loadCategorySelector(): CategorySelector { return this.iModel.elements.getElement<CategorySelector>(this.categorySelectorId); }\n\n /** Provides access to optional detail settings for this view. */\n public abstract get details(): ViewDetails;\n\n /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */\n public getAuxiliaryCoordinateSystemId(): Id64String {\n return this.details.auxiliaryCoordinateSystemId;\n }\n\n /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.\n * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.\n */\n public setAuxiliaryCoordinateSystemId(acsId: Id64String) {\n this.details.auxiliaryCoordinateSystemId = acsId;\n }\n\n /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.\n * @param codeValue The ViewDefinition name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.viewDefinition);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n}\n\n/** Defines a view of one or more 3d models.\n * @public\n */\nexport abstract class ViewDefinition3d extends ViewDefinition {\n private readonly _details: ViewDetails3d;\n /** @internal */\n public static override get className(): string { return \"ViewDefinition3d\"; }\n /** If true, camera is used. Otherwise, use an orthographic projection. */\n public cameraOn: boolean;\n /** The lower left back corner of the view frustum. */\n public origin: Point3d;\n /** The extent (size) of the view frustum, in meters, along its x,y,z axes. */\n public extents: Vector3d;\n /** Rotation from world coordinates to view coordinates. */\n public angles: YawPitchRollAngles;\n /** The camera used for this view, if `cameraOn` is true. */\n public camera: Camera;\n\n /** @internal */\n public constructor(props: ViewDefinition3dProps, iModel: IModelDb) {\n super(props, iModel);\n this.cameraOn = JsonUtils.asBool(props.cameraOn);\n this.origin = Point3d.fromJSON(props.origin);\n this.extents = Vector3d.fromJSON(props.extents);\n this.angles = YawPitchRollAngles.fromJSON(props.angles);\n this.camera = new Camera(props.camera);\n this._details = new ViewDetails3d(this.jsonProperties);\n }\n\n /** @internal */\n public override toJSON(): ViewDefinition3dProps {\n const val = super.toJSON() as ViewDefinition3dProps;\n val.cameraOn = this.cameraOn;\n val.origin = this.origin;\n val.extents = this.extents;\n val.angles = this.angles;\n val.camera = this.camera;\n return val;\n }\n\n /** Provides access to optional detail settings for this view. */\n public get details(): ViewDetails3d { return this._details; }\n\n /** Load this view's DisplayStyle3d from the IModelDb. */\n public loadDisplayStyle3d(): DisplayStyle3d { return this.iModel.elements.getElement<DisplayStyle3d>(this.displayStyleId); }\n}\n\n/** Defines a view of one or more SpatialModels.\n * The list of viewed models is stored by the ModelSelector.\n *\n * This is how a SpatialViewDefinition selects the elements to display:\n *\n * SpatialViewDefinition\n * * ModelSelector\n * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model\n * * CategorySelector\n * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category\n * @public\n */\nexport class SpatialViewDefinition extends ViewDefinition3d {\n /** @internal */\n public static override get className(): string { return \"SpatialViewDefinition\"; }\n /** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */\n public modelSelectorId: Id64String;\n\n /** @internal */\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) {\n super(props, iModel);\n this.modelSelectorId = Id64.fromJSON(props.modelSelectorId);\n if (!Id64.isValid(this.modelSelectorId))\n throw new IModelError(IModelStatus.BadArg, `modelSelectorId is invalid`);\n }\n\n /** @internal */\n public override toJSON(): SpatialViewDefinitionProps {\n const json = super.toJSON() as SpatialViewDefinitionProps;\n json.modelSelectorId = this.modelSelectorId;\n return json;\n }\n\n /** @internal */\n protected override collectReferenceIds(referenceIds: Id64Set): void {\n super.collectReferenceIds(referenceIds);\n referenceIds.add(this.modelSelectorId);\n }\n\n /** @beta */\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"modelSelectorId\"];\n\n /** Load this view's ModelSelector from the IModelDb. */\n public loadModelSelector(): ModelSelector { return this.iModel.elements.getElement<ModelSelector>(this.modelSelectorId); }\n /**\n * Create an SpatialViewDefinition with camera.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the view\n * @param modelSelectorId The [[ModelSelector]] that this view should use\n * @param categorySelectorId The [[CategorySelector]] that this view should use\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\n * @param range Defines the view origin and extents\n * @param standardView Optionally defines the view's rotation\n * @param cameraAngle Camera angle in radians.\n * @returns The newly constructed OrthographicViewDefinition element\n * @throws [[IModelError]] if there is a problem creating the view\n */\n public static createWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): SpatialViewDefinition {\n const rotation = Matrix3d.createStandardWorldToView(standardView);\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\n const rotatedRange = rotationTransform.multiplyRange(range);\n const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);\n const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.\n cameraLocation.z += cameraDistance; // Back up by camera distance.\n rotation.multiplyTransposeVectorInPlace(cameraLocation);\n\n const viewDefinitionProps: SpatialViewDefinitionProps = {\n classFullName: this.classFullName,\n model: definitionModelId,\n code: this.createCode(iModelDb, definitionModelId, name),\n modelSelectorId,\n categorySelectorId,\n displayStyleId,\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\n extents: rotatedRange.diagonal(),\n angles,\n cameraOn: true,\n camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },\n };\n return new SpatialViewDefinition(viewDefinitionProps, iModelDb);\n }\n /**\n * Insert an SpatialViewDefinition with camera On\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\n * @param name The name/CodeValue of the view\n * @param modelSelectorId The [[ModelSelector]] that this view should use\n * @param categorySelectorId The [[CategorySelector]] that this view should use\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\n * @param range Defines the view origin and extents\n * @param standardView Optionally defines the view's rotation\n * @param cameraAngle Camera angle in radians.\n * @returns The Id of the newly inserted OrthographicViewDefinition element\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insertWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): Id64String {\n const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\n }\n}\n\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\n * See [how to create a OrthographicViewDefinition]$(docs/learning/backend/CreateElements.md#OrthographicViewDefinition).\n * @public\n */\nexport class OrthographicViewDefinition extends SpatialViewDefinition {\n /** @internal */\n public static override get className(): string { return \"OrthographicViewDefinition\"; }\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) { super(props, iModel); }\n /**\n * Create an OrthographicViewDefinition\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the view\n * @param modelSelectorId The [[ModelSelector]] that this view should use\n * @param categorySelectorId The [[CategorySelector]] that this view should use\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\n * @param range Defines the view origin and extents\n * @param standardView Optionally defines the view's rotation\n * @returns The newly constructed OrthographicViewDefinition element\n * @throws [[IModelError]] if there is a problem creating the view\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): OrthographicViewDefinition {\n const rotation = Matrix3d.createStandardWorldToView(standardView);\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\n const rotatedRange = rotationTransform.multiplyRange(range);\n const viewDefinitionProps: SpatialViewDefinitionProps = {\n classFullName: this.classFullName,\n model: definitionModelId,\n code: this.createCode(iModelDb, definitionModelId, name),\n modelSelectorId,\n categorySelectorId,\n displayStyleId,\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\n extents: rotatedRange.diagonal(),\n angles,\n cameraOn: false,\n camera: new Camera(), // not used when cameraOn === false\n };\n return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);\n }\n /**\n * Insert an OrthographicViewDefinition\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\n * @param name The name/CodeValue of the view\n * @param modelSelectorId The [[ModelSelector]] that this view should use\n * @param categorySelectorId The [[CategorySelector]] that this view should use\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\n * @param range Defines the view origin and extents\n * @param standardView Optionally defines the view's rotation\n * @returns The Id of the newly inserted OrthographicViewDefinition element\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {\n const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\n }\n /** Set a new viewed range without changing the rotation or any other properties. */\n public setRange(range: Range3d): void {\n const rotation = this.angles.toMatrix3d();\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\n const rotatedRange = rotationTransform.multiplyRange(range);\n this.origin = Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));\n this.extents = rotatedRange.diagonal();\n }\n}\n\n/** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.\n * @public\n */\nexport class ViewDefinition2d extends ViewDefinition {\n private readonly _details: ViewDetails;\n\n /** @internal */\n public static override get className(): string { return \"ViewDefinition2d\"; }\n /** The Id of the Model displayed by this view. */\n public baseModelId: Id64String;\n /** The lower-left corner of this view in Model coordinates. */\n public origin: Point2d;\n /** The delta (size) of this view, in meters, aligned with view x,y. */\n public delta: Point2d;\n /** The rotation of this view. */\n public angle: Angle;\n\n /** @internal */\n public constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\n super(props, iModel);\n this.baseModelId = Id64.fromJSON(props.baseModelId);\n this.origin = Point2d.fromJSON(props.origin);\n this.delta = Point2d.fromJSON(props.delta);\n this.angle = Angle.fromJSON(props.angle);\n this._details = new ViewDetails(this.jsonProperties);\n }\n\n /** @internal */\n public override toJSON(): ViewDefinition2dProps {\n const val = super.toJSON() as ViewDefinition2dProps;\n val.baseModelId = this.baseModelId;\n val.origin = this.origin;\n val.delta = this.delta;\n val.angle = this.angle;\n return val;\n }\n\n /** @internal */\n protected override collectReferenceIds(referenceIds: Id64Set): void {\n super.collectReferenceIds(referenceIds);\n referenceIds.add(this.baseModelId);\n }\n\n /** Provides access to optional detail settings for this view. */\n public get details(): ViewDetails { return this._details; }\n\n /** Load this view's DisplayStyle2d from the IModelDb. */\n public loadDisplayStyle2d(): DisplayStyle2d { return this.iModel.elements.getElement<DisplayStyle2d>(this.displayStyleId); }\n}\n\n/** Defines a view of a [[DrawingModel]].\n * @public\n */\nexport class DrawingViewDefinition extends ViewDefinition2d {\n /** @internal */\n public static override get className(): string { return \"DrawingViewDefinition\"; }\n /** @internal */\n public constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n /** Create a DrawingViewDefinition\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the view\n * @param baseModelId The base [[DrawingModel]]\n * @param categorySelectorId The [[CategorySelector]] that this view should use\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\n * @param range Defines the view origin and extents\n * @throws [[IModelError]] if there is a problem creating the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): DrawingViewDefinition {\n const viewDefinitionProps: ViewDefinition2dProps = {\n classFullName: this.classFullName,\n model: definitionModelId,\n code: this.createCode(iModelDb, definitionModelId, name),\n baseModelId,\n categorySelectorId,\n displayStyleId,\n origin: { x: range.low.x, y: range.low.y },\n delta: range.diagonal(),\n angle: 0,\n };\n return new DrawingViewDefinition(viewDefinitionProps, iModelDb);\n }\n\n /** Insert a DrawingViewDefinition\n * @param iModelDb Insert into this iModel\n * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]\n * @param name The name/CodeValue of the view\n * @param baseModelId The base [[DrawingModel]]\n * @param categorySelectorId The [[CategorySelector]] that this view should use\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\n * @param range Defines the view origin and extents\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): Id64String {\n const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\n }\n}\n\n/** Defines a view of a [[SheetModel]].\n * @public\n */\nexport class SheetViewDefinition extends ViewDefinition2d {\n /** @internal */\n public static override get className(): string { return \"SheetViewDefinition\"; }\n}\n\n/** A ViewDefinition used to display a 2d template model.\n * @internal\n */\nexport class TemplateViewDefinition2d extends ViewDefinition2d {\n /** @internal */\n public static override get className(): string { return \"TemplateViewDefinition2d\"; }\n}\n\n/** A ViewDefinition used to display a 3d template model.\n * @internal\n */\nexport class TemplateViewDefinition3d extends ViewDefinition3d {\n /** @internal */\n public static override get className(): string { return \"TemplateViewDefinition3d\"; }\n}\n\n/** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show\n * coordinate information in different units and/or orientations.\n * @public\n */\nexport abstract class AuxCoordSystem extends DefinitionElement {\n /** @internal */\n public static override get className(): string { return \"AuxCoordSystem\"; }\n public type!: number;\n public description?: string;\n public constructor(props: AuxCoordSystemProps, iModel: IModelDb) { super(props, iModel); }\n}\n\n/** A 2d auxiliary coordinate system.\n * @public\n */\nexport class AuxCoordSystem2d extends AuxCoordSystem {\n /** @internal */\n public static override get className(): string { return \"AuxCoordSystem2d\"; }\n public origin?: Point2d;\n public angle!: number;\n public constructor(props: AuxCoordSystem2dProps, iModel: IModelDb) { super(props, iModel); }\n\n /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.\n * @param codeValue The AuxCoordSystem2d name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem2d);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n}\n\n/** A 3d auxiliary coordinate system.\n * @public\n */\nexport class AuxCoordSystem3d extends AuxCoordSystem {\n /** @internal */\n public static override get className(): string { return \"AuxCoordSystem3d\"; }\n public origin?: Point3d;\n public yaw!: number;\n public pitch!: number;\n public roll!: number;\n public constructor(props: AuxCoordSystem3dProps, iModel: IModelDb) { super(props, iModel); }\n\n /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.\n * @param codeValue The AuxCoordSystem3d name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem3d);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n}\n\n/** A spatial auxiliary coordinate system.\n * @public\n */\nexport class AuxCoordSystemSpatial extends AuxCoordSystem3d {\n /** @internal */\n public static override get className(): string { return \"AuxCoordSystemSpatial\"; }\n /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.\n * @param codeValue The AuxCoordSystemSpatial name\n */\n public static override createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystemSpatial);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n}\n\n/** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].\n * @public\n */\nexport class ViewAttachment extends GraphicalElement2d {\n /** @internal */\n public static override get className(): string { return \"ViewAttachment\"; }\n public view: RelatedElement;\n public constructor(props: ViewAttachmentProps, iModel: IModelDb) {\n super(props, iModel);\n this.view = new RelatedElement(props.view);\n // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.\n }\n /** @internal */\n protected override collectReferenceIds(referenceIds: Id64Set): void {\n super.collectReferenceIds(referenceIds);\n referenceIds.add(this.view.id);\n }\n}\n\n/** The position in space of a Light.\n * @internal\n */\nexport class LightLocation extends SpatialLocationElement {\n /** @internal */\n public static override get className(): string { return \"LightLocation\"; }\n /** Whether this light is currently turned on. */\n public enabled!: boolean;\n /** @internal */\n constructor(props: LightLocationProps, iModel: IModelDb) { super(props, iModel); }\n}\n"]}
@@ -1,14 +1,14 @@
1
- import { HydrateViewStateRequestProps, HydrateViewStateResponseProps } from "@itwin/core-common";
2
- import { IModelDb } from "./IModelDb";
3
- export declare class ViewStateHydrator {
4
- private _imodel;
5
- constructor(iModel: IModelDb);
6
- getHydrateResponseProps(options: HydrateViewStateRequestProps): Promise<HydrateViewStateResponseProps>;
7
- private handleCategoryIds;
8
- private handleBaseModelId;
9
- private handleModelSelectorStateModels;
10
- private handleSpatialViewId;
11
- private handleAcsId;
12
- private handleSheetViewAttachmentIds;
13
- }
1
+ import { HydrateViewStateRequestProps, HydrateViewStateResponseProps } from "@itwin/core-common";
2
+ import { IModelDb } from "./IModelDb";
3
+ export declare class ViewStateHydrator {
4
+ private _imodel;
5
+ constructor(iModel: IModelDb);
6
+ getHydrateResponseProps(options: HydrateViewStateRequestProps): Promise<HydrateViewStateResponseProps>;
7
+ private handleCategoryIds;
8
+ private handleBaseModelId;
9
+ private handleModelSelectorStateModels;
10
+ private handleSpatialViewId;
11
+ private handleAcsId;
12
+ private handleSheetViewAttachmentIds;
13
+ }
14
14
  //# sourceMappingURL=ViewStateHydrator.d.ts.map
@@ -1,104 +1,104 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ViewStateHydrator = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
- const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
10
- class ViewStateHydrator {
11
- constructor(iModel) {
12
- this._imodel = iModel;
13
- }
14
- async getHydrateResponseProps(options) {
15
- const response = {};
16
- const promises = [];
17
- if (options.acsId)
18
- promises.push(this.handleAcsId(response, options.acsId));
19
- if (options.sheetViewAttachmentIds)
20
- promises.push(this.handleSheetViewAttachmentIds(response, options.sheetViewAttachmentIds, options.viewStateLoadProps));
21
- // eslint-disable-next-line deprecation/deprecation
22
- if (options.notLoadedCategoryIds) {
23
- // eslint-disable-next-line deprecation/deprecation
24
- promises.push(this.handleCategoryIds(response, options.notLoadedCategoryIds));
25
- }
26
- if (options.spatialViewId)
27
- promises.push(this.handleSpatialViewId(response, options.spatialViewId, options.viewStateLoadProps));
28
- if (options.notLoadedModelSelectorStateModels)
29
- promises.push(this.handleModelSelectorStateModels(response, options.notLoadedModelSelectorStateModels));
30
- if (options.baseModelId)
31
- promises.push(this.handleBaseModelId(response, options.baseModelId));
32
- await Promise.all(promises);
33
- return response;
34
- }
35
- async handleCategoryIds(response, categoryIds) {
36
- const decompressedIds = core_bentley_1.CompressedId64Set.decompressArray(categoryIds);
37
- const results = await this._imodel.querySubCategories(decompressedIds);
38
- // eslint-disable-next-line deprecation/deprecation
39
- response.categoryIdsResult = results;
40
- }
41
- async handleBaseModelId(response, baseModelId) {
42
- let modelProps;
43
- try {
44
- modelProps = this._imodel.models.getModelJson({ id: baseModelId });
45
- }
46
- catch (err) {
47
- core_bentley_1.Logger.logError(BackendLoggerCategory_1.BackendLoggerCategory.ViewStateHydrator, `Error getting modelProps for baseModelId: ${baseModelId}`, () => ({ error: core_bentley_1.BentleyError.getErrorProps(err) }));
48
- }
49
- response.baseModelProps = modelProps;
50
- }
51
- async handleModelSelectorStateModels(response, models) {
52
- const decompressedModelIds = core_bentley_1.CompressedId64Set.decompressSet(models);
53
- const modelJsonArray = [];
54
- for (const id of decompressedModelIds) {
55
- try {
56
- const modelProps = this._imodel.models.getModelJson({ id });
57
- modelJsonArray.push(modelProps);
58
- }
59
- catch (error) {
60
- }
61
- }
62
- response.modelSelectorStateModels = modelJsonArray;
63
- }
64
- async handleSpatialViewId(response, spatialViewId, viewStateLoadProps) {
65
- response.spatialViewProps = this._imodel.views.getViewStateData(spatialViewId, viewStateLoadProps);
66
- }
67
- async handleAcsId(response, acsId) {
68
- try {
69
- const props = this._imodel.elements.getElementProps(acsId);
70
- response.acsElementProps = props;
71
- }
72
- catch { }
73
- }
74
- async handleSheetViewAttachmentIds(response, sheetViewAttachmentIds, viewStateLoadProps) {
75
- const decompressedIds = core_bentley_1.CompressedId64Set.decompressSet(sheetViewAttachmentIds);
76
- const attachmentProps = [];
77
- for (const id of decompressedIds) {
78
- try {
79
- attachmentProps.push(this._imodel.elements.getElementJson({ id }));
80
- }
81
- catch (error) {
82
- }
83
- }
84
- const promises = [];
85
- for (const attachment of attachmentProps) {
86
- const loadView = async () => {
87
- try {
88
- const view = this._imodel.views.getViewStateData(attachment.view.id, viewStateLoadProps);
89
- return view;
90
- }
91
- catch {
92
- return undefined;
93
- }
94
- };
95
- promises.push(loadView());
96
- }
97
- const views = await Promise.all(promises);
98
- response.sheetViewViews = views;
99
- response.sheetViewAttachmentProps = attachmentProps;
100
- return;
101
- }
102
- }
103
- exports.ViewStateHydrator = ViewStateHydrator;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ViewStateHydrator = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
10
+ class ViewStateHydrator {
11
+ constructor(iModel) {
12
+ this._imodel = iModel;
13
+ }
14
+ async getHydrateResponseProps(options) {
15
+ const response = {};
16
+ const promises = [];
17
+ if (options.acsId)
18
+ promises.push(this.handleAcsId(response, options.acsId));
19
+ if (options.sheetViewAttachmentIds)
20
+ promises.push(this.handleSheetViewAttachmentIds(response, options.sheetViewAttachmentIds, options.viewStateLoadProps));
21
+ // eslint-disable-next-line deprecation/deprecation
22
+ if (options.notLoadedCategoryIds) {
23
+ // eslint-disable-next-line deprecation/deprecation
24
+ promises.push(this.handleCategoryIds(response, options.notLoadedCategoryIds));
25
+ }
26
+ if (options.spatialViewId)
27
+ promises.push(this.handleSpatialViewId(response, options.spatialViewId, options.viewStateLoadProps));
28
+ if (options.notLoadedModelSelectorStateModels)
29
+ promises.push(this.handleModelSelectorStateModels(response, options.notLoadedModelSelectorStateModels));
30
+ if (options.baseModelId)
31
+ promises.push(this.handleBaseModelId(response, options.baseModelId));
32
+ await Promise.all(promises);
33
+ return response;
34
+ }
35
+ async handleCategoryIds(response, categoryIds) {
36
+ const decompressedIds = core_bentley_1.CompressedId64Set.decompressArray(categoryIds);
37
+ const results = await this._imodel.querySubCategories(decompressedIds);
38
+ // eslint-disable-next-line deprecation/deprecation
39
+ response.categoryIdsResult = results;
40
+ }
41
+ async handleBaseModelId(response, baseModelId) {
42
+ let modelProps;
43
+ try {
44
+ modelProps = this._imodel.models.getModelJson({ id: baseModelId });
45
+ }
46
+ catch (err) {
47
+ core_bentley_1.Logger.logError(BackendLoggerCategory_1.BackendLoggerCategory.ViewStateHydrator, `Error getting modelProps for baseModelId: ${baseModelId}`, () => ({ error: core_bentley_1.BentleyError.getErrorProps(err) }));
48
+ }
49
+ response.baseModelProps = modelProps;
50
+ }
51
+ async handleModelSelectorStateModels(response, models) {
52
+ const decompressedModelIds = core_bentley_1.CompressedId64Set.decompressSet(models);
53
+ const modelJsonArray = [];
54
+ for (const id of decompressedModelIds) {
55
+ try {
56
+ const modelProps = this._imodel.models.getModelJson({ id });
57
+ modelJsonArray.push(modelProps);
58
+ }
59
+ catch (error) {
60
+ }
61
+ }
62
+ response.modelSelectorStateModels = modelJsonArray;
63
+ }
64
+ async handleSpatialViewId(response, spatialViewId, viewStateLoadProps) {
65
+ response.spatialViewProps = this._imodel.views.getViewStateData(spatialViewId, viewStateLoadProps);
66
+ }
67
+ async handleAcsId(response, acsId) {
68
+ try {
69
+ const props = this._imodel.elements.getElementProps(acsId);
70
+ response.acsElementProps = props;
71
+ }
72
+ catch { }
73
+ }
74
+ async handleSheetViewAttachmentIds(response, sheetViewAttachmentIds, viewStateLoadProps) {
75
+ const decompressedIds = core_bentley_1.CompressedId64Set.decompressSet(sheetViewAttachmentIds);
76
+ const attachmentProps = [];
77
+ for (const id of decompressedIds) {
78
+ try {
79
+ attachmentProps.push(this._imodel.elements.getElementJson({ id }));
80
+ }
81
+ catch (error) {
82
+ }
83
+ }
84
+ const promises = [];
85
+ for (const attachment of attachmentProps) {
86
+ const loadView = async () => {
87
+ try {
88
+ const view = this._imodel.views.getViewStateData(attachment.view.id, viewStateLoadProps);
89
+ return view;
90
+ }
91
+ catch {
92
+ return undefined;
93
+ }
94
+ };
95
+ promises.push(loadView());
96
+ }
97
+ const views = await Promise.all(promises);
98
+ response.sheetViewViews = views;
99
+ response.sheetViewAttachmentProps = attachmentProps;
100
+ return;
101
+ }
102
+ }
103
+ exports.ViewStateHydrator = ViewStateHydrator;
104
104
  //# sourceMappingURL=ViewStateHydrator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewStateHydrator.js","sourceRoot":"","sources":["../../src/ViewStateHydrator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA0F;AAE1F,mEAAgE;AAG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AC3B;QACD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1C,QAAQ,CAAC,cAAc,GAAG,KAAK,CAAC;QAChC,QAAQ,CAAC,wBAAwB,GAAG,eAAe,CAAC;QAEpD,OAAO;IACT,CAAC;CAEF;AAtGD,8CAsGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { BentleyError, CompressedId64Set, Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { HydrateViewStateRequestProps, HydrateViewStateResponseProps, ModelProps, SubCategoryResultRow, ViewAttachmentProps, ViewStateLoadProps } from \"@itwin/core-common\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nexport class ViewStateHydrator {\r\n private _imodel: IModelDb;\r\n public constructor(iModel: IModelDb) {\r\n this._imodel = iModel;\r\n }\r\n\r\n public async getHydrateResponseProps(options: HydrateViewStateRequestProps): Promise<HydrateViewStateResponseProps> {\r\n const response: HydrateViewStateResponseProps = {};\r\n const promises = [];\r\n if (options.acsId)\r\n promises.push(this.handleAcsId(response, options.acsId));\r\n if (options.sheetViewAttachmentIds)\r\n promises.push(this.handleSheetViewAttachmentIds(response, options.sheetViewAttachmentIds, options.viewStateLoadProps));\r\n // eslint-disable-next-line deprecation/deprecation\r\n if (options.notLoadedCategoryIds) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n promises.push(this.handleCategoryIds(response, options.notLoadedCategoryIds));\r\n }\r\n if (options.spatialViewId)\r\n promises.push(this.handleSpatialViewId(response, options.spatialViewId, options.viewStateLoadProps));\r\n if (options.notLoadedModelSelectorStateModels)\r\n promises.push(this.handleModelSelectorStateModels(response, options.notLoadedModelSelectorStateModels));\r\n if (options.baseModelId)\r\n promises.push(this.handleBaseModelId(response, options.baseModelId));\r\n await Promise.all(promises);\r\n return response;\r\n }\r\n\r\n private async handleCategoryIds(response: HydrateViewStateResponseProps, categoryIds: CompressedId64Set) {\r\n const decompressedIds = CompressedId64Set.decompressArray(categoryIds);\r\n const results: SubCategoryResultRow[] = await this._imodel.querySubCategories(decompressedIds);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n response.categoryIdsResult = results;\r\n }\r\n\r\n private async handleBaseModelId(response: HydrateViewStateResponseProps, baseModelId: Id64String) {\r\n let modelProps;\r\n try {\r\n modelProps = this._imodel.models.getModelJson({ id: baseModelId });\r\n } catch (err) {\r\n Logger.logError(BackendLoggerCategory.ViewStateHydrator, `Error getting modelProps for baseModelId: ${baseModelId}`, () => ({error: BentleyError.getErrorProps(err)}));\r\n }\r\n response.baseModelProps = modelProps;\r\n }\r\n\r\n private async handleModelSelectorStateModels(response: HydrateViewStateResponseProps, models: CompressedId64Set) {\r\n const decompressedModelIds = CompressedId64Set.decompressSet(models);\r\n\r\n const modelJsonArray: ModelProps[] = [];\r\n for (const id of decompressedModelIds) {\r\n try {\r\n const modelProps = this._imodel.models.getModelJson({ id });\r\n modelJsonArray.push(modelProps);\r\n } catch (error) {\r\n }\r\n }\r\n\r\n response.modelSelectorStateModels = modelJsonArray;\r\n }\r\n\r\n private async handleSpatialViewId(response: HydrateViewStateResponseProps, spatialViewId: Id64String, viewStateLoadProps?: ViewStateLoadProps) {\r\n response.spatialViewProps = this._imodel.views.getViewStateData(spatialViewId, viewStateLoadProps);\r\n }\r\n\r\n private async handleAcsId(response: HydrateViewStateResponseProps, acsId: string) {\r\n try {\r\n const props = this._imodel.elements.getElementProps(acsId);\r\n response.acsElementProps = props;\r\n } catch { }\r\n }\r\n\r\n private async handleSheetViewAttachmentIds(response: HydrateViewStateResponseProps, sheetViewAttachmentIds: CompressedId64Set, viewStateLoadProps?: ViewStateLoadProps) {\r\n const decompressedIds = CompressedId64Set.decompressSet(sheetViewAttachmentIds);\r\n const attachmentProps: ViewAttachmentProps[] = [];\r\n for (const id of decompressedIds) {\r\n try {\r\n attachmentProps.push(this._imodel.elements.getElementJson({ id }) );\r\n } catch (error) {\r\n }\r\n }\r\n\r\n const promises = [];\r\n for (const attachment of attachmentProps) {\r\n const loadView = async () => {\r\n try {\r\n const view = this._imodel.views.getViewStateData(attachment.view.id, viewStateLoadProps);\r\n return view;\r\n } catch {\r\n return undefined;\r\n }\r\n };\r\n\r\n promises.push(loadView());\r\n }\r\n const views = await Promise.all(promises);\r\n response.sheetViewViews = views;\r\n response.sheetViewAttachmentProps = attachmentProps;\r\n\r\n return;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewStateHydrator.js","sourceRoot":"","sources":["../../src/ViewStateHydrator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA0F;AAE1F,mEAAgE;AAGhE,MAAa,iBAAiB;IAE5B,YAAmB,MAAgB;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,OAAqC;QACxE,MAAM,QAAQ,GAAkC,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,KAAK;YACf,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,sBAAsB;YAChC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,QAAQ,EAAE,OAAO,CAAC,sBAAsB,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACzH,mDAAmD;QACnD,IAAI,OAAO,CAAC,oBAAoB,EAAE;YAChC,mDAAmD;YACnD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;SAC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I,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAE,CAAC;aACrE;YAAC,OAAO,KAAK,EAAE;aACf;SACF;QAED,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE;YACxC,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;gBAC1B,IAAI;oBACF,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;oBACzF,OAAO,IAAI,CAAC;iBACb;gBAAC,MAAM;oBACN,OAAO,SAAS,CAAC;iBAClB;YACH,CAAC,CAAC;YAEF,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC3B;QACD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1C,QAAQ,CAAC,cAAc,GAAG,KAAK,CAAC;QAChC,QAAQ,CAAC,wBAAwB,GAAG,eAAe,CAAC;QAEpD,OAAO;IACT,CAAC;CAEF;AAtGD,8CAsGC","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*--------------------------------------------------------------------------------------------*/\nimport { BentleyError, CompressedId64Set, Id64String, Logger } from \"@itwin/core-bentley\";\nimport { HydrateViewStateRequestProps, HydrateViewStateResponseProps, ModelProps, SubCategoryResultRow, ViewAttachmentProps, ViewStateLoadProps } from \"@itwin/core-common\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { IModelDb } from \"./IModelDb\";\n\nexport class ViewStateHydrator {\n private _imodel: IModelDb;\n public constructor(iModel: IModelDb) {\n this._imodel = iModel;\n }\n\n public async getHydrateResponseProps(options: HydrateViewStateRequestProps): Promise<HydrateViewStateResponseProps> {\n const response: HydrateViewStateResponseProps = {};\n const promises = [];\n if (options.acsId)\n promises.push(this.handleAcsId(response, options.acsId));\n if (options.sheetViewAttachmentIds)\n promises.push(this.handleSheetViewAttachmentIds(response, options.sheetViewAttachmentIds, options.viewStateLoadProps));\n // eslint-disable-next-line deprecation/deprecation\n if (options.notLoadedCategoryIds) {\n // eslint-disable-next-line deprecation/deprecation\n promises.push(this.handleCategoryIds(response, options.notLoadedCategoryIds));\n }\n if (options.spatialViewId)\n promises.push(this.handleSpatialViewId(response, options.spatialViewId, options.viewStateLoadProps));\n if (options.notLoadedModelSelectorStateModels)\n promises.push(this.handleModelSelectorStateModels(response, options.notLoadedModelSelectorStateModels));\n if (options.baseModelId)\n promises.push(this.handleBaseModelId(response, options.baseModelId));\n await Promise.all(promises);\n return response;\n }\n\n private async handleCategoryIds(response: HydrateViewStateResponseProps, categoryIds: CompressedId64Set) {\n const decompressedIds = CompressedId64Set.decompressArray(categoryIds);\n const results: SubCategoryResultRow[] = await this._imodel.querySubCategories(decompressedIds);\n\n // eslint-disable-next-line deprecation/deprecation\n response.categoryIdsResult = results;\n }\n\n private async handleBaseModelId(response: HydrateViewStateResponseProps, baseModelId: Id64String) {\n let modelProps;\n try {\n modelProps = this._imodel.models.getModelJson({ id: baseModelId });\n } catch (err) {\n Logger.logError(BackendLoggerCategory.ViewStateHydrator, `Error getting modelProps for baseModelId: ${baseModelId}`, () => ({error: BentleyError.getErrorProps(err)}));\n }\n response.baseModelProps = modelProps;\n }\n\n private async handleModelSelectorStateModels(response: HydrateViewStateResponseProps, models: CompressedId64Set) {\n const decompressedModelIds = CompressedId64Set.decompressSet(models);\n\n const modelJsonArray: ModelProps[] = [];\n for (const id of decompressedModelIds) {\n try {\n const modelProps = this._imodel.models.getModelJson({ id });\n modelJsonArray.push(modelProps);\n } catch (error) {\n }\n }\n\n response.modelSelectorStateModels = modelJsonArray;\n }\n\n private async handleSpatialViewId(response: HydrateViewStateResponseProps, spatialViewId: Id64String, viewStateLoadProps?: ViewStateLoadProps) {\n response.spatialViewProps = this._imodel.views.getViewStateData(spatialViewId, viewStateLoadProps);\n }\n\n private async handleAcsId(response: HydrateViewStateResponseProps, acsId: string) {\n try {\n const props = this._imodel.elements.getElementProps(acsId);\n response.acsElementProps = props;\n } catch { }\n }\n\n private async handleSheetViewAttachmentIds(response: HydrateViewStateResponseProps, sheetViewAttachmentIds: CompressedId64Set, viewStateLoadProps?: ViewStateLoadProps) {\n const decompressedIds = CompressedId64Set.decompressSet(sheetViewAttachmentIds);\n const attachmentProps: ViewAttachmentProps[] = [];\n for (const id of decompressedIds) {\n try {\n attachmentProps.push(this._imodel.elements.getElementJson({ id }) );\n } catch (error) {\n }\n }\n\n const promises = [];\n for (const attachment of attachmentProps) {\n const loadView = async () => {\n try {\n const view = this._imodel.views.getViewStateData(attachment.view.id, viewStateLoadProps);\n return view;\n } catch {\n return undefined;\n }\n };\n\n promises.push(loadView());\n }\n const views = await Promise.all(promises);\n response.sheetViewViews = views;\n response.sheetViewAttachmentProps = attachmentProps;\n\n return;\n }\n\n}\n"]}