@itwin/core-backend 3.6.0-dev.51 → 3.6.0-dev.53

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 (252) hide show
  1. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  2. package/lib/cjs/AliCloudStorageService.js +71 -71
  3. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  4. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  5. package/lib/cjs/BackendHubAccess.js +41 -41
  6. package/lib/cjs/BackendHubAccess.js.map +1 -1
  7. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  8. package/lib/cjs/BackendLoggerCategory.js +99 -99
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BisCoreSchema.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  14. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  15. package/lib/cjs/BriefcaseManager.js +414 -413
  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 +447 -447
  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 +121 -121
  30. package/lib/cjs/CheckpointManager.js +349 -349
  31. package/lib/cjs/CheckpointManager.js.map +1 -1
  32. package/lib/cjs/ClassRegistry.d.ts +79 -79
  33. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  34. package/lib/cjs/ClassRegistry.js +250 -249
  35. package/lib/cjs/ClassRegistry.js.map +1 -1
  36. package/lib/cjs/CloudSqlite.d.ts +350 -350
  37. package/lib/cjs/CloudSqlite.js +153 -153
  38. package/lib/cjs/CloudSqlite.js.map +1 -1
  39. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  40. package/lib/cjs/CloudStorageBackend.js +173 -173
  41. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  42. package/lib/cjs/CodeService.d.ts +396 -396
  43. package/lib/cjs/CodeService.js +63 -63
  44. package/lib/cjs/CodeService.js.map +1 -1
  45. package/lib/cjs/CodeSpecs.d.ts +55 -55
  46. package/lib/cjs/CodeSpecs.js +124 -124
  47. package/lib/cjs/CodeSpecs.js.map +1 -1
  48. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  49. package/lib/cjs/ConcurrentQuery.js +36 -36
  50. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  51. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  52. package/lib/cjs/CustomViewState3dCreator.js +81 -81
  53. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  54. package/lib/cjs/DevTools.d.ts +71 -71
  55. package/lib/cjs/DevTools.js +154 -154
  56. package/lib/cjs/DevTools.js.map +1 -1
  57. package/lib/cjs/DisplayStyle.d.ts +106 -106
  58. package/lib/cjs/DisplayStyle.js +256 -256
  59. package/lib/cjs/DisplayStyle.js.map +1 -1
  60. package/lib/cjs/ECDb.d.ts +191 -191
  61. package/lib/cjs/ECDb.js +350 -350
  62. package/lib/cjs/ECDb.js.map +1 -1
  63. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  64. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  65. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  66. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  67. package/lib/cjs/ECSqlStatement.js +791 -791
  68. package/lib/cjs/ECSqlStatement.js.map +1 -1
  69. package/lib/cjs/Element.d.ts +1102 -1102
  70. package/lib/cjs/Element.js +1416 -1416
  71. package/lib/cjs/Element.js.map +1 -1
  72. package/lib/cjs/ElementAspect.d.ts +179 -179
  73. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  74. package/lib/cjs/ElementAspect.js +211 -211
  75. package/lib/cjs/ElementAspect.js.map +1 -1
  76. package/lib/cjs/ElementGraphics.d.ts +9 -9
  77. package/lib/cjs/ElementGraphics.js +41 -41
  78. package/lib/cjs/ElementGraphics.js.map +1 -1
  79. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  80. package/lib/cjs/ElementTreeWalker.js +409 -409
  81. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  82. package/lib/cjs/Entity.d.ts +106 -106
  83. package/lib/cjs/Entity.js +134 -134
  84. package/lib/cjs/Entity.js.map +1 -1
  85. package/lib/cjs/EntityReferences.d.ts +49 -49
  86. package/lib/cjs/EntityReferences.js +95 -95
  87. package/lib/cjs/EntityReferences.js.map +1 -1
  88. package/lib/cjs/ExportGraphics.d.ts +317 -317
  89. package/lib/cjs/ExportGraphics.js +208 -208
  90. package/lib/cjs/ExportGraphics.js.map +1 -1
  91. package/lib/cjs/ExternalSource.d.ts +96 -96
  92. package/lib/cjs/ExternalSource.js +131 -131
  93. package/lib/cjs/ExternalSource.js.map +1 -1
  94. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  95. package/lib/cjs/GeoCoordConfig.js +85 -85
  96. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  97. package/lib/cjs/GeometrySummary.d.ts +4 -4
  98. package/lib/cjs/GeometrySummary.js +380 -380
  99. package/lib/cjs/GeometrySummary.js.map +1 -1
  100. package/lib/cjs/HubMock.d.ts +94 -94
  101. package/lib/cjs/HubMock.js +222 -222
  102. package/lib/cjs/HubMock.js.map +1 -1
  103. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  104. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  105. package/lib/cjs/IModelCloneContext.js +15 -15
  106. package/lib/cjs/IModelCloneContext.js.map +1 -1
  107. package/lib/cjs/IModelDb.d.ts +1192 -1183
  108. package/lib/cjs/IModelDb.d.ts.map +1 -1
  109. package/lib/cjs/IModelDb.js +2388 -2374
  110. package/lib/cjs/IModelDb.js.map +1 -1
  111. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  112. package/lib/cjs/IModelElementCloneContext.js +159 -159
  113. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  114. package/lib/cjs/IModelHost.d.ts +369 -369
  115. package/lib/cjs/IModelHost.d.ts.map +1 -1
  116. package/lib/cjs/IModelHost.js +496 -496
  117. package/lib/cjs/IModelHost.js.map +1 -1
  118. package/lib/cjs/IModelJsFs.d.ts +62 -62
  119. package/lib/cjs/IModelJsFs.js +140 -140
  120. package/lib/cjs/IModelJsFs.js.map +1 -1
  121. package/lib/cjs/IpcHost.d.ts +104 -104
  122. package/lib/cjs/IpcHost.js +278 -278
  123. package/lib/cjs/IpcHost.js.map +1 -1
  124. package/lib/cjs/LineStyle.d.ts +311 -311
  125. package/lib/cjs/LineStyle.js +295 -295
  126. package/lib/cjs/LineStyle.js.map +1 -1
  127. package/lib/cjs/LocalHub.d.ts +162 -162
  128. package/lib/cjs/LocalHub.d.ts.map +1 -1
  129. package/lib/cjs/LocalHub.js +585 -587
  130. package/lib/cjs/LocalHub.js.map +1 -1
  131. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  132. package/lib/cjs/LocalhostIpcHost.js +81 -81
  133. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  134. package/lib/cjs/Material.d.ts +131 -103
  135. package/lib/cjs/Material.d.ts.map +1 -1
  136. package/lib/cjs/Material.js +181 -147
  137. package/lib/cjs/Material.js.map +1 -1
  138. package/lib/cjs/Model.d.ts +392 -392
  139. package/lib/cjs/Model.js +485 -485
  140. package/lib/cjs/Model.js.map +1 -1
  141. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  142. package/lib/cjs/NativeAppStorage.js +202 -202
  143. package/lib/cjs/NativeAppStorage.js.map +1 -1
  144. package/lib/cjs/NativeHost.d.ts +52 -52
  145. package/lib/cjs/NativeHost.js +163 -163
  146. package/lib/cjs/NativeHost.js.map +1 -1
  147. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  148. package/lib/cjs/NavigationRelationship.js +225 -225
  149. package/lib/cjs/NavigationRelationship.js.map +1 -1
  150. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  151. package/lib/cjs/PromiseMemoizer.js +101 -101
  152. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  153. package/lib/cjs/PropertyStore.d.ts +132 -132
  154. package/lib/cjs/PropertyStore.js +11 -11
  155. package/lib/cjs/PropertyStore.js.map +1 -1
  156. package/lib/cjs/Relationship.d.ts +416 -416
  157. package/lib/cjs/Relationship.js +494 -494
  158. package/lib/cjs/Relationship.js.map +1 -1
  159. package/lib/cjs/RpcBackend.d.ts +5 -5
  160. package/lib/cjs/RpcBackend.js +31 -31
  161. package/lib/cjs/RpcBackend.js.map +1 -1
  162. package/lib/cjs/SQLiteDb.d.ts +219 -219
  163. package/lib/cjs/SQLiteDb.js +214 -214
  164. package/lib/cjs/SQLiteDb.js.map +1 -1
  165. package/lib/cjs/Schema.d.ts +55 -55
  166. package/lib/cjs/Schema.js +83 -83
  167. package/lib/cjs/Schema.js.map +1 -1
  168. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  169. package/lib/cjs/ServerBasedLocks.js +168 -168
  170. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  171. package/lib/cjs/SqliteStatement.d.ts +360 -360
  172. package/lib/cjs/SqliteStatement.js +586 -586
  173. package/lib/cjs/SqliteStatement.js.map +1 -1
  174. package/lib/cjs/Texture.d.ts +58 -58
  175. package/lib/cjs/Texture.js +82 -82
  176. package/lib/cjs/Texture.js.map +1 -1
  177. package/lib/cjs/TileStorage.d.ts +18 -18
  178. package/lib/cjs/TileStorage.js +90 -90
  179. package/lib/cjs/TileStorage.js.map +1 -1
  180. package/lib/cjs/TxnManager.d.ts +202 -202
  181. package/lib/cjs/TxnManager.js +356 -356
  182. package/lib/cjs/TxnManager.js.map +1 -1
  183. package/lib/cjs/ViewDefinition.d.ts +439 -439
  184. package/lib/cjs/ViewDefinition.js +646 -646
  185. package/lib/cjs/ViewDefinition.js.map +1 -1
  186. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  187. package/lib/cjs/ViewStateHydrator.js +103 -103
  188. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  189. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  190. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  191. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  192. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  193. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  194. package/lib/cjs/core-backend.d.ts +184 -184
  195. package/lib/cjs/core-backend.js +204 -204
  196. package/lib/cjs/core-backend.js.map +1 -1
  197. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  198. package/lib/cjs/domains/FunctionalElements.js +145 -145
  199. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  200. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  201. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
  202. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  203. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  204. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  205. package/lib/cjs/domains/GenericElements.js +263 -263
  206. package/lib/cjs/domains/GenericElements.js.map +1 -1
  207. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  208. package/lib/cjs/domains/GenericSchema.js +28 -28
  209. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  210. package/lib/cjs/rpc/multipart.d.ts +11 -11
  211. package/lib/cjs/rpc/multipart.js +70 -70
  212. package/lib/cjs/rpc/multipart.js.map +1 -1
  213. package/lib/cjs/rpc/tracing.d.ts +28 -28
  214. package/lib/cjs/rpc/tracing.js +73 -73
  215. package/lib/cjs/rpc/tracing.js.map +1 -1
  216. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  217. package/lib/cjs/rpc/web/logging.js +42 -42
  218. package/lib/cjs/rpc/web/logging.js.map +1 -1
  219. package/lib/cjs/rpc/web/request.d.ts +6 -6
  220. package/lib/cjs/rpc/web/request.js +73 -73
  221. package/lib/cjs/rpc/web/request.js.map +1 -1
  222. package/lib/cjs/rpc/web/response.d.ts +6 -6
  223. package/lib/cjs/rpc/web/response.js +105 -105
  224. package/lib/cjs/rpc/web/response.js.map +1 -1
  225. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  226. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  227. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  228. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  229. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +291 -291
  230. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  231. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  232. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -202
  233. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  234. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  235. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  236. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  237. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  238. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  239. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  240. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  241. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  242. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  243. package/lib/cjs/workspace/Settings.d.ts +186 -186
  244. package/lib/cjs/workspace/Settings.js +155 -155
  245. package/lib/cjs/workspace/Settings.js.map +1 -1
  246. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  247. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  248. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  249. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  250. package/lib/cjs/workspace/Workspace.js +543 -543
  251. package/lib/cjs/workspace/Workspace.js.map +1 -1
  252. package/package.json +12 -12
@@ -1,1417 +1,1417 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Elements
8
- */
9
- var _a, _b;
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.FolderLink = exports.UrlLink = exports.LinkElement = exports.GroupInformationElement = exports.SpatialLocationPartition = exports.PhysicalPartition = exports.LinkPartition = exports.InformationRecordPartition = exports.GraphicalPartition3d = exports.GroupInformationPartition = exports.DocumentPartition = exports.DefinitionPartition = exports.InformationPartitionElement = exports.TemplateRecipe2d = exports.GraphicalType2d = exports.TemplateRecipe3d = exports.SpatialLocationType = exports.PhysicalType = exports.RecipeDefinitionElement = exports.TypeDefinitionElement = exports.DefinitionGroup = exports.DefinitionContainer = exports.DefinitionSet = exports.DefinitionElement = exports.InformationRecordElement = exports.Sheet = exports.SheetTemplate = exports.SheetBorderTemplate = exports.SectionDrawing = exports.Drawing = exports.Document = exports.Subject = exports.InformationReferenceElement = exports.DriverBundleElement = exports.InformationContentElement = exports.SectionDrawingLocation = exports.VolumeElement = exports.SpatialLocationElement = exports.PhysicalElement = exports.SpatialElement = exports.TextAnnotation3d = exports.TextAnnotation2d = exports.DrawingGraphic = exports.AnnotationElement2d = exports.GraphicalElement2d = exports.GeometricElement2d = exports.GraphicalElement3d = exports.GeometricElement3d = exports.GeometricElement = exports.Element = void 0;
12
- exports.RenderTimeline = exports.LineStyle = exports.GeometryPart = exports.RoleElement = exports.EmbeddedFileLink = exports.RepositoryLink = void 0;
13
- const core_bentley_1 = require("@itwin/core-bentley");
14
- const core_common_1 = require("@itwin/core-common");
15
- const core_geometry_1 = require("@itwin/core-geometry");
16
- const Entity_1 = require("./Entity");
17
- const Model_1 = require("./Model");
18
- const NavigationRelationship_1 = require("./NavigationRelationship");
19
- /** Elements are the smallest individually identifiable building blocks for modeling the real world in an iModel.
20
- * Each element represents an entity in the real world. Sets of Elements (contained in [[Model]]s) are used to model
21
- * other Elements that represent larger scale real world entities. Using this recursive modeling strategy,
22
- * Elements can represent entities at any scale. Elements can represent physical things or abstract concepts
23
- * or simply be information records.
24
- *
25
- * Every Element has a 64-bit id (inherited from Entity) that uniquely identifies it within an iModel. Every Element also
26
- * has a "code" that identifies its meaning in the real world. Additionally, Elements may have a "federationGuid"
27
- * to hold a GUID, if the element was assigned that GUID by some other federated database. The iModel database enforces
28
- * uniqueness of id, code, and federationGuid.
29
- *
30
- * See:
31
- * * [Element Fundamentals]($docs/bis/guide/fundamentals/element-fundamentals.md)
32
- * * [Working with schemas and elements in TypeScript]($docs/learning/backend/SchemasAndElementsInTypeScript.md)
33
- * * [Creating elements]($docs/learning/backend/CreateElements.md)
34
- * @public
35
- */
36
- class Element extends Entity_1.Entity {
37
- /** constructor for Element.
38
- * @internal
39
- */
40
- constructor(props, iModel) {
41
- super(props, iModel);
42
- this.code = core_common_1.Code.fromJSON(props.code); // TODO: Validate props.code - don't silently fail if it is the wrong type
43
- this.model = core_common_1.RelatedElement.idFromJson(props.model);
44
- this.parent = core_common_1.RelatedElement.fromJSON(props.parent);
45
- this.federationGuid = props.federationGuid;
46
- this.userLabel = props.userLabel;
47
- this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy
48
- }
49
- /** @internal */
50
- static get className() { return "Element"; }
51
- /** @internal */
52
- static get protectedOperations() { return ["onInsert", "onUpdate", "onDelete"]; }
53
- /** Called before a new Element is inserted.
54
- * @note throw an exception to disallow the insert
55
- * @note If you override this method, you must call super.
56
- * @note `this` is the class of the Element to be inserted
57
- * @beta
58
- */
59
- static onInsert(arg) {
60
- var _c;
61
- const { iModel, props } = arg;
62
- iModel.locks.checkSharedLock(props.model, "model", "insert"); // inserting requires shared lock on model
63
- if (props.parent) // inserting requires shared lock on parent, if present
64
- iModel.locks.checkSharedLock(props.parent.id, "parent", "insert");
65
- (_c = iModel.codeService) === null || _c === void 0 ? void 0 : _c.verifyCode(arg);
66
- }
67
- /** Called after a new Element was inserted.
68
- * @note If you override this method, you must call super.
69
- * @note `this` is the class of the Element that was inserted
70
- * @beta
71
- */
72
- static onInserted(arg) {
73
- arg.iModel.locks.elementWasCreated(arg.id);
74
- }
75
- /** Called before an Element is updated.
76
- * @note throw an exception to disallow the update
77
- * @note If you override this method, you must call super.
78
- * @note `this` is the class of the Element to be updated
79
- * @beta
80
- */
81
- static onUpdate(arg) {
82
- var _c;
83
- arg.iModel.locks.checkExclusiveLock(arg.props.id, "element", "update"); // eslint-disable-line @typescript-eslint/no-non-null-assertion
84
- (_c = arg.iModel.codeService) === null || _c === void 0 ? void 0 : _c.verifyCode(arg);
85
- }
86
- /** Called after an Element was updated.
87
- * @note If you override this method, you must call super.
88
- * @note `this` is the class of the Element that was updated
89
- * @beta
90
- */
91
- static onUpdated(_arg) { }
92
- /** Called before an Element is deleted.
93
- * @note throw an exception to disallow the delete
94
- * @note If you override this method, you must call super.
95
- * @note `this` is the class of the Element to be deleted
96
- * @beta
97
- */
98
- static onDelete(arg) {
99
- arg.iModel.locks.checkExclusiveLock(arg.id, "element", "delete");
100
- }
101
- /** Called after an Element was deleted.
102
- * @note If you override this method, you must call super.
103
- * @note `this` is the class of the Element that was deleted
104
- * @beta
105
- */
106
- static onDeleted(_arg) { }
107
- /** Called when an element with an instance of this class as its parent is about to be deleted.
108
- * @note throw an exception if the element should not be deleted
109
- * @note implementers should not presume that the element was deleted if this method does not throw,
110
- * since the delete may fail for other reasons. Instead, rely on [[onChildDeleted]] for that purpose.
111
- * @note `this` is the class of the parent Element whose child will be deleted
112
- * @beta
113
- */
114
- static onChildDelete(_arg) { }
115
- /** Called after an element with an instance of this class as its parent was successfully deleted.
116
- * @note `this` is the class of the parent Element whose child was deleted
117
- * @beta
118
- */
119
- static onChildDeleted(_arg) { }
120
- /** Called when a *new element* with an instance of this class as its parent is about to be inserted.
121
- * @note throw an exception if the element should not be inserted
122
- * @note `this` is the class of the prospective parent Element.
123
- * @beta
124
- */
125
- static onChildInsert(_arg) { }
126
- /** Called after a *new element* with an instance of this class as its parent was inserted.
127
- * @note `this` is the class of the parent Element.
128
- * @beta
129
- */
130
- static onChildInserted(_arg) { }
131
- /** Called when an element with an instance of this class as its parent is about to be updated.
132
- * @note throw an exception if the element should not be updated
133
- * @note `this` is the class of the parent Element.
134
- * @beta
135
- */
136
- static onChildUpdate(_arg) { }
137
- /** Called after an element with an instance of this the class as its parent was updated.
138
- * @note `this` is the class of the parent Element.
139
- * @beta
140
- */
141
- static onChildUpdated(_arg) { }
142
- /** Called when an *existing element* is about to be updated so that an instance of this class will become its new parent.
143
- * @note throw an exception if the element should not be added
144
- * @note `this` is the class of the prospective parent Element.
145
- * @beta
146
- */
147
- static onChildAdd(_arg) { }
148
- /** Called after an *existing element* has been updated so that an instance of this class is its new parent.
149
- * @note `this` is the class of the new parent Element.
150
- * @beta
151
- */
152
- static onChildAdded(_arg) { }
153
- /** Called when an element with an instance of this class as its parent is about to be updated change to a different parent.
154
- * @note throw an exception if the element should not be dropped
155
- * @note `this` is the class of the parent Element.
156
- * @beta
157
- */
158
- static onChildDrop(_arg) { }
159
- /** Called after an element with an instance of this class as its previous parent was updated to have a new parent.
160
- * @note `this` is the class of the previous parent Element.
161
- * @beta
162
- */
163
- static onChildDropped(_arg) { }
164
- /** Called when an instance of this class is being *sub-modeled* by a new Model.
165
- * @note throw an exception if model should not be inserted
166
- * @note `this` is the class of Element to be sub-modeled.
167
- * @beta
168
- */
169
- static onSubModelInsert(_arg) { }
170
- /** Called after an instance of this class was *sub-modeled* by a new Model.
171
- * @note `this` is the class of Element that is now sub-modeled.
172
- * @beta
173
- */
174
- static onSubModelInserted(_arg) { }
175
- /** Called when a sub-model of an instance of this class is being deleted.
176
- * @note throw an exception if model should not be deleted
177
- * @note `this` is the class of Element that is sub-modeled.
178
- * @beta
179
- */
180
- static onSubModelDelete(_arg) { }
181
- /** Called after a sub-model of an instance of this class was deleted.
182
- * @note `this` is the class of Element that was sub-modeled.
183
- * @beta
184
- */
185
- static onSubModelDeleted(_arg) { }
186
- /** Called during the iModel transformation process after an Element from the source iModel was *cloned* for the target iModel.
187
- * The transformation process automatically handles remapping BisCore properties and those that are properly described in ECSchema.
188
- * This callback is only meant to be overridden if there are other Ids in non-standard locations that need to be remapped or other data that needs to be fixed up after the clone.
189
- * @param _context The context that persists any remapping between the source iModel and target iModel.
190
- * @param _sourceProps The ElementProps for the source Element that was cloned.
191
- * @param _targetProps The ElementProps that are a result of the clone. These can be further modified.
192
- * @note If you override this method, you must call super.
193
- * @beta
194
- */
195
- static onCloned(_context, _sourceProps, _targetProps) { }
196
- /** Called when a *root* element in a subgraph is changed and before its outputs are processed.
197
- * This special callback is made when:
198
- * * the element is part of an [[ElementDrivesElement]] graph, and
199
- * * the element has no inputs, and
200
- * * none of the element's outputs have been processed.
201
- * @see [[ElementDrivesElement]] for more on element dependency graphs.
202
- * @beta
203
- */
204
- static onBeforeOutputsHandled(_id, _iModel) { }
205
- /** Called on an element in a graph after all of its inputs have been processed and before its outputs are processed.
206
- * This callback is made when:
207
- * * the specified element is part of an [[ElementDrivesElement]] graph, and
208
- * * there was a direct change to some element upstream in the dependency graph.
209
- * * all upstream elements in the graph have been processed.
210
- * * none of the downstream elements have been processed.
211
- * This method is not called if none of the element's inputs were changed.
212
- * @see [[ElementDrivesElement]] for more on element dependency graphs.
213
- * @beta
214
- */
215
- static onAllInputsHandled(_id, _iModel) { }
216
- /** Save this Element's properties to an object for serializing to JSON.
217
- * @internal
218
- */
219
- toJSON() {
220
- const val = super.toJSON();
221
- if (core_common_1.Code.isValid(this.code))
222
- val.code = this.code;
223
- val.model = this.model;
224
- val.userLabel = this.userLabel;
225
- val.federationGuid = this.federationGuid;
226
- if (this.parent)
227
- val.parent = this.parent;
228
- if (Object.keys(this.jsonProperties).length > 0)
229
- val.jsonProperties = this.jsonProperties;
230
- return val;
231
- }
232
- /** Collect the Ids of this element's *references* at this level of the class hierarchy.
233
- * @deprecated use [[collectReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles
234
- * @beta
235
- */
236
- collectPredecessorIds(predecessorIds) {
237
- return this.collectReferenceIds(predecessorIds);
238
- }
239
- /** @internal */
240
- collectReferenceConcreteIds(referenceIds) {
241
- super.collectReferenceConcreteIds(referenceIds);
242
- referenceIds.addModel(this.model); // The modeledElement is a reference
243
- if (this.code.scope && core_bentley_1.Id64.isValidId64(this.code.scope))
244
- referenceIds.addElement(this.code.scope); // The element that scopes the code is a reference
245
- if (this.parent)
246
- referenceIds.addElement(this.parent.id); // A parent element is a reference
247
- }
248
- /** Get the Ids of this element's *references*. A *reference* is any element whose id is stored in the EC data of this element
249
- * This is important for cloning operations but can be useful in other situations as well.
250
- * @beta
251
- * @deprecated use [[getReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles
252
- */
253
- getPredecessorIds() {
254
- return this.getReferenceIds();
255
- }
256
- /** Get the class metadata for this element. */
257
- getClassMetaData() { return this.iModel.classMetaDataRegistry.find(this.classFullName); }
258
- getAllUserProperties() {
259
- if (!this.jsonProperties.UserProps)
260
- this.jsonProperties.UserProps = new Object();
261
- return this.jsonProperties.UserProps;
262
- }
263
- /** Get a set of JSON user properties by namespace */
264
- getUserProperties(namespace) { return this.getAllUserProperties()[namespace]; }
265
- /** Change a set of user JSON properties of this Element by namespace. */
266
- setUserProperties(nameSpace, value) { this.getAllUserProperties()[nameSpace] = value; }
267
- /** Remove a set of JSON user properties, specified by namespace, from this Element */
268
- removeUserProperties(nameSpace) { delete this.getAllUserProperties()[nameSpace]; }
269
- /** Get a JSON property of this element, by namespace */
270
- getJsonProperty(nameSpace) { return this.jsonProperties[nameSpace]; }
271
- setJsonProperty(nameSpace, value) { this.jsonProperties[nameSpace] = value; }
272
- /** Get a display label for this Element. By default returns userLabel if present, otherwise code value. */
273
- getDisplayLabel() { var _c; return (_c = this.userLabel) !== null && _c !== void 0 ? _c : this.code.value; }
274
- /** Get a list of HTML strings that describe this Element for the tooltip. Strings will be listed on separate lines in the tooltip.
275
- * Any instances of the pattern `%{tag}` will be replaced by the localized value of tag.
276
- */
277
- getToolTipMessage() {
278
- const addKey = (key) => `<b>%{iModelJs:Element.${key}}:</b> `; // %{iModelJs:Element.xxx} is replaced with localized value of xxx in frontend.
279
- const msg = [];
280
- const display = this.getDisplayLabel();
281
- msg.push(display ? display : `${addKey("Id") + this.id}, ${addKey("Type")}${this.className}`);
282
- if (this instanceof GeometricElement)
283
- msg.push(addKey("Category") + this.iModel.elements.getElement(this.category).getDisplayLabel());
284
- msg.push(addKey("Model") + this.iModel.elements.getElement(this.model).getDisplayLabel());
285
- return msg;
286
- }
287
- /** Insert this Element into the iModel. */
288
- insert() { return this.id = this.iModel.elements.insertElement(this.toJSON()); }
289
- /** Update this Element in the iModel. */
290
- update() { this.iModel.elements.updateElement(this.toJSON()); }
291
- /** Delete this Element from the iModel. */
292
- delete() { this.iModel.elements.deleteElement(this.id); }
293
- }
294
- exports.Element = Element;
295
- /** A *required reference* is an element that had to be inserted before this element could have been inserted.
296
- * This is the list of property keys on this element that store references to those elements
297
- * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.
298
- * @note any property listed here must be added to the reference ids in [[collectReferenceIds]]
299
- * @beta
300
- */
301
- Element.requiredReferenceKeys = ["parent", "model"];
302
- /** A map of every [[requiredReferenceKeys]] on this class to their entity type.
303
- * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.
304
- * @alpha
305
- */
306
- Element.requiredReferenceKeyTypeMap = {
307
- parent: core_common_1.ConcreteEntityTypes.Element,
308
- model: core_common_1.ConcreteEntityTypes.Model,
309
- };
310
- /** An abstract base class to model real world entities that intrinsically have geometry.
311
- * @public
312
- */
313
- class GeometricElement extends (_b = Element) {
314
- /** @internal */
315
- constructor(props, iModel) {
316
- super(props, iModel);
317
- this.category = core_bentley_1.Id64.fromJSON(props.category);
318
- this.geom = props.geom;
319
- }
320
- /** @internal */
321
- static get className() { return "GeometricElement"; }
322
- /** Type guard for instanceof [[GeometricElement3d]] */
323
- is3d() { return this instanceof GeometricElement3d; }
324
- /** Type guard for instanceof [[GeometricElement2d]] */
325
- is2d() { return this instanceof GeometricElement2d; }
326
- /** Get the [Transform]($geometry) from the Placement of this GeometricElement */
327
- getPlacementTransform() { return this.placement.transform; }
328
- calculateRange3d() { return this.placement.calculateRange(); }
329
- /** Obtain the JSON representation of this element. */
330
- toJSON() {
331
- const val = super.toJSON();
332
- val.category = this.category;
333
- if (this.geom)
334
- val.geom = this.geom;
335
- return val;
336
- }
337
- /** @internal */
338
- collectReferenceConcreteIds(referenceIds) {
339
- super.collectReferenceConcreteIds(referenceIds);
340
- referenceIds.addElement(this.category);
341
- // TODO: GeometryPartIds?
342
- }
343
- }
344
- exports.GeometricElement = GeometricElement;
345
- _a = GeometricElement;
346
- /** @beta */
347
- GeometricElement.requiredReferenceKeys = [...Reflect.get(_b, "requiredReferenceKeys", _a), "category"];
348
- /** @alpha */
349
- GeometricElement.requiredReferenceKeyTypeMap = {
350
- ...Reflect.get(_b, "requiredReferenceKeyTypeMap", _a),
351
- category: core_common_1.ConcreteEntityTypes.Element,
352
- };
353
- /** An abstract base class to model real world entities that intrinsically have 3d geometry.
354
- * See [how to create a GeometricElement3d]($docs/learning/backend/CreateElements.md#GeometricElement3d).
355
- * @public
356
- */
357
- class GeometricElement3d extends GeometricElement {
358
- /** @internal */
359
- constructor(props, iModel) {
360
- super(props, iModel);
361
- this.placement = core_common_1.Placement3d.fromJSON(props.placement);
362
- if (props.typeDefinition)
363
- this.typeDefinition = core_common_1.TypeDefinition.fromJSON(props.typeDefinition);
364
- }
365
- /** @internal */
366
- static get className() { return "GeometricElement3d"; }
367
- /** @internal */
368
- toJSON() {
369
- const val = super.toJSON();
370
- val.placement = this.placement;
371
- if (undefined !== this.typeDefinition)
372
- val.typeDefinition = this.typeDefinition;
373
- return val;
374
- }
375
- /** @internal */
376
- collectReferenceConcreteIds(referenceIds) {
377
- super.collectReferenceConcreteIds(referenceIds);
378
- if (undefined !== this.typeDefinition)
379
- referenceIds.addElement(this.typeDefinition.id);
380
- }
381
- }
382
- exports.GeometricElement3d = GeometricElement3d;
383
- /** A 3d Graphical Element
384
- * @public
385
- */
386
- class GraphicalElement3d extends GeometricElement3d {
387
- /** @internal */
388
- static get className() { return "GraphicalElement3d"; }
389
- /** @internal */
390
- constructor(props, iModel) { super(props, iModel); }
391
- }
392
- exports.GraphicalElement3d = GraphicalElement3d;
393
- /** An abstract base class to model information entities that intrinsically have 2d geometry.
394
- * @public
395
- */
396
- class GeometricElement2d extends GeometricElement {
397
- /** @internal */
398
- constructor(props, iModel) {
399
- super(props, iModel);
400
- this.placement = core_common_1.Placement2d.fromJSON(props.placement);
401
- if (props.typeDefinition)
402
- this.typeDefinition = core_common_1.TypeDefinition.fromJSON(props.typeDefinition);
403
- }
404
- /** @internal */
405
- static get className() { return "GeometricElement2d"; }
406
- /** @internal */
407
- toJSON() {
408
- const val = super.toJSON();
409
- val.placement = this.placement;
410
- if (undefined !== this.typeDefinition)
411
- val.typeDefinition = this.typeDefinition;
412
- return val;
413
- }
414
- /** @internal */
415
- collectReferenceConcreteIds(referenceIds) {
416
- super.collectReferenceConcreteIds(referenceIds);
417
- if (undefined !== this.typeDefinition)
418
- referenceIds.addElement(this.typeDefinition.id);
419
- }
420
- }
421
- exports.GeometricElement2d = GeometricElement2d;
422
- /** An abstract base class for 2d Geometric Elements that are used to convey information within graphical presentations (like drawings).
423
- * @public
424
- */
425
- class GraphicalElement2d extends GeometricElement2d {
426
- /** @internal */
427
- static get className() { return "GraphicalElement2d"; }
428
- /** @internal */
429
- constructor(props, iModel) { super(props, iModel); }
430
- }
431
- exports.GraphicalElement2d = GraphicalElement2d;
432
- /** 2d element used to annotate drawings and sheets.
433
- * @public
434
- */
435
- class AnnotationElement2d extends GraphicalElement2d {
436
- /** @internal */
437
- static get className() { return "AnnotationElement2d"; }
438
- /** @internal */
439
- constructor(props, iModel) { super(props, iModel); }
440
- }
441
- exports.AnnotationElement2d = AnnotationElement2d;
442
- /** 2d element used to persist graphics for use in drawings.
443
- * @public
444
- */
445
- class DrawingGraphic extends GraphicalElement2d {
446
- /** @internal */
447
- static get className() { return "DrawingGraphic"; }
448
- /** @internal */
449
- constructor(props, iModel) { super(props, iModel); }
450
- }
451
- exports.DrawingGraphic = DrawingGraphic;
452
- /** 2D Text Annotation
453
- * @public
454
- */
455
- class TextAnnotation2d extends AnnotationElement2d {
456
- /** @internal */
457
- static get className() { return "TextAnnotation2d"; }
458
- /** @internal */
459
- constructor(props, iModel) { super(props, iModel); }
460
- }
461
- exports.TextAnnotation2d = TextAnnotation2d;
462
- /** 3D Text Annotation
463
- * @public
464
- */
465
- class TextAnnotation3d extends GraphicalElement3d {
466
- /** @internal */
467
- static get className() { return "TextAnnotation3d"; }
468
- /** @internal */
469
- constructor(props, iModel) { super(props, iModel); }
470
- }
471
- exports.TextAnnotation3d = TextAnnotation3d;
472
- /** An Element that occupies real world space. Its coordinates are in the project space of its iModel.
473
- * @public
474
- */
475
- class SpatialElement extends GeometricElement3d {
476
- /** @internal */
477
- static get className() { return "SpatialElement"; }
478
- /** @internal */
479
- constructor(props, iModel) { super(props, iModel); }
480
- }
481
- exports.SpatialElement = SpatialElement;
482
- /** An Element that is spatially located, has mass, and can be *touched*.
483
- * @public
484
- */
485
- class PhysicalElement extends SpatialElement {
486
- /** @internal */
487
- constructor(props, iModel) {
488
- super(props, iModel);
489
- this.physicalMaterial = core_common_1.RelatedElement.fromJSON(props.physicalMaterial);
490
- }
491
- /** @internal */
492
- static get className() { return "PhysicalElement"; }
493
- /** @internal */
494
- toJSON() {
495
- var _c;
496
- const val = super.toJSON();
497
- val.physicalMaterial = (_c = this.physicalMaterial) === null || _c === void 0 ? void 0 : _c.toJSON();
498
- return val;
499
- }
500
- }
501
- exports.PhysicalElement = PhysicalElement;
502
- /** Identifies a *tracked* real world location but has no mass and cannot be *touched*.
503
- * @public
504
- */
505
- class SpatialLocationElement extends SpatialElement {
506
- /** @internal */
507
- static get className() { return "SpatialLocationElement"; }
508
- /** @internal */
509
- constructor(props, iModel) { super(props, iModel); }
510
- }
511
- exports.SpatialLocationElement = SpatialLocationElement;
512
- /** A Volume Element is a Spatial Location Element that is restricted to defining a volume.
513
- * @public
514
- */
515
- class VolumeElement extends SpatialLocationElement {
516
- /** @internal */
517
- static get className() { return "VolumeElement"; }
518
- /** @internal */
519
- constructor(props, iModel) { super(props, iModel); }
520
- }
521
- exports.VolumeElement = VolumeElement;
522
- /** A SectionDrawingLocation element identifies the location of a [[SectionDrawing]] in the context of a [[SpatialModel]],
523
- * enabling [HyperModeling]($hypermodeling).
524
- * @note The associated ECClass was added to the BisCore schema in version 1.0.11.
525
- * @public
526
- */
527
- class SectionDrawingLocation extends SpatialLocationElement {
528
- constructor(props, iModel) {
529
- var _c;
530
- super(props, iModel);
531
- this.sectionView = (_c = core_common_1.RelatedElement.fromJSON(props.sectionView)) !== null && _c !== void 0 ? _c : core_common_1.RelatedElement.none;
532
- }
533
- /** @internal */
534
- static get className() { return "SectionDrawingLocation"; }
535
- /** @internal */
536
- toJSON() {
537
- return {
538
- ...super.toJSON(),
539
- sectionView: this.sectionView.toJSON(),
540
- };
541
- }
542
- }
543
- exports.SectionDrawingLocation = SectionDrawingLocation;
544
- /** Information Content Element is an abstract base class for modeling pure information entities. Only the
545
- * core framework should directly subclass from Information Content Element. Domain and application developers
546
- * should start with the most appropriate subclass of Information Content Element.
547
- * @public
548
- */
549
- class InformationContentElement extends Element {
550
- /** @internal */
551
- static get className() { return "InformationContentElement"; }
552
- /** @internal */
553
- constructor(props, iModel) { super(props, iModel); }
554
- }
555
- exports.InformationContentElement = InformationContentElement;
556
- /** Element used in conjunction with bis:ElementDrivesElement relationships to bundle multiple inputs before
557
- * driving the output element.
558
- * @beta
559
- */
560
- class DriverBundleElement extends InformationContentElement {
561
- /** @internal */
562
- static get className() { return "DriverBundleElement"; }
563
- /** @internal */
564
- constructor(props, iModel) { super(props, iModel); }
565
- }
566
- exports.DriverBundleElement = DriverBundleElement;
567
- /** Information Reference is an abstract base class for modeling entities whose main purpose is to reference something else.
568
- * @public
569
- */
570
- class InformationReferenceElement extends InformationContentElement {
571
- /** @internal */
572
- static get className() { return "InformationReferenceElement"; }
573
- /** @internal */
574
- constructor(props, iModel) { super(props, iModel); }
575
- }
576
- exports.InformationReferenceElement = InformationReferenceElement;
577
- /** A Subject is an information element that describes what this repository (or part thereof) is about.
578
- * See [how to create a Subject element]$(docs/learning/backend/CreateElements.md#Subject).
579
- * @public
580
- */
581
- class Subject extends InformationReferenceElement {
582
- /** @internal */
583
- constructor(props, iModel) { super(props, iModel); }
584
- /** @internal */
585
- static get className() { return "Subject"; }
586
- /** @internal */
587
- toJSON() {
588
- return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
589
- }
590
- /** Create a Code for a Subject given a name that is meant to be unique within the scope of its parent Subject.
591
- * @param iModelDb The IModelDb
592
- * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child Subjects.
593
- * @param codeValue The child Subject name
594
- */
595
- static createCode(iModelDb, parentSubjectId, codeValue) {
596
- const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.subject);
597
- return new core_common_1.Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });
598
- }
599
- /** Create a Subject
600
- * @param iModelDb The IModelDb
601
- * @param parentSubjectId The new Subject will be a child of this Subject
602
- * @param name The name (codeValue) of the Subject
603
- * @param description The optional description of the Subject
604
- * @returns The newly constructed Subject
605
- * @throws [[IModelError]] if there is a problem creating the Subject
606
- */
607
- static create(iModelDb, parentSubjectId, name, description) {
608
- const subjectProps = {
609
- classFullName: this.classFullName,
610
- model: core_common_1.IModel.repositoryModelId,
611
- parent: new NavigationRelationship_1.SubjectOwnsSubjects(parentSubjectId),
612
- code: this.createCode(iModelDb, parentSubjectId, name),
613
- description,
614
- };
615
- return new Subject(subjectProps, iModelDb);
616
- }
617
- /** Insert a Subject
618
- * @param iModelDb Insert into this IModelDb
619
- * @param parentSubjectId The new Subject will be inserted as a child of this Subject
620
- * @param name The name (codeValue) of the Subject
621
- * @param description The optional description of the Subject
622
- * @returns The Id of the newly inserted Subject
623
- * @throws [[IModelError]] if there is a problem inserting the Subject
624
- */
625
- static insert(iModelDb, parentSubjectId, name, description) {
626
- const subject = this.create(iModelDb, parentSubjectId, name, description);
627
- return iModelDb.elements.insertElement(subject.toJSON());
628
- }
629
- }
630
- exports.Subject = Subject;
631
- /** An InformationContentElement that identifies the content of a document.
632
- * The realized form of a document is called a DocumentCarrier (different class than Document).
633
- * For example, a will is a legal document. The will published into a PDF file is an ElectronicDocumentCopy.
634
- * The will printed onto paper is a PrintedDocumentCopy.
635
- * In this example, the Document only identifies, names, and tracks the content of the will.
636
- * @public
637
- */
638
- class Document extends InformationContentElement {
639
- /** @internal */
640
- static get className() { return "Document"; }
641
- /** @internal */
642
- constructor(props, iModel) { super(props, iModel); }
643
- }
644
- exports.Document = Document;
645
- /** A document that represents a drawing, that is, a two-dimensional graphical representation of engineering data. A Drawing element is usually modelled by a [[DrawingModel]].
646
- * @public
647
- */
648
- class Drawing extends Document {
649
- /** @internal */
650
- static get className() { return "Drawing"; }
651
- /** @internal */
652
- constructor(props, iModel) { super(props, iModel); }
653
- /** Create a Code for a Drawing given a name that is meant to be unique within the scope of the specified DocumentListModel.
654
- * @param iModel The IModelDb
655
- * @param scopeModelId The Id of the DocumentListModel that contains the Drawing and provides the scope for its name.
656
- * @param codeValue The Drawing name
657
- */
658
- static createCode(iModel, scopeModelId, codeValue) {
659
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.drawing);
660
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
661
- }
662
- /** Insert a Drawing element and a DrawingModel that breaks it down.
663
- * @param iModelDb Insert into this iModel
664
- * @param documentListModelId Insert the new Drawing into this DocumentListModel
665
- * @param name The name of the Drawing.
666
- * @returns The Id of the newly inserted Drawing element and the DrawingModel that breaks it down (same value).
667
- * @throws [[IModelError]] if unable to insert the element.
668
- */
669
- static insert(iModelDb, documentListModelId, name) {
670
- const drawingProps = {
671
- classFullName: this.classFullName,
672
- model: documentListModelId,
673
- code: this.createCode(iModelDb, documentListModelId, name),
674
- };
675
- const drawingId = iModelDb.elements.insertElement(drawingProps);
676
- const model = iModelDb.models.createModel({
677
- classFullName: Model_1.DrawingModel.classFullName,
678
- modeledElement: { id: drawingId },
679
- });
680
- return iModelDb.models.insertModel(model.toJSON());
681
- }
682
- }
683
- exports.Drawing = Drawing;
684
- /** A document that represents a section drawing, that is, a graphical documentation derived from a planar
685
- * section of a spatial view. A SectionDrawing element is modelled by a [[SectionDrawingModel]] or a [[GraphicalModel3d]].
686
- * A [[SectionDrawingLocation]] can associate the drawing with a spatial location, enabling [HyperModeling]($hypermodeling).
687
- * @public
688
- */
689
- class SectionDrawing extends Drawing {
690
- /** @internal */
691
- constructor(props, iModel) {
692
- var _c, _d;
693
- super(props, iModel);
694
- this.sectionType = core_bentley_1.JsonUtils.asInt(props.sectionType, core_common_1.SectionType.Section);
695
- this.spatialView = (_c = core_common_1.RelatedElement.fromJSON(props.spatialView)) !== null && _c !== void 0 ? _c : core_common_1.RelatedElement.none;
696
- this.displaySpatialView = core_bentley_1.JsonUtils.asBool((_d = props.jsonProperties) === null || _d === void 0 ? void 0 : _d.displaySpatialView);
697
- const json = props.jsonProperties;
698
- if (!json)
699
- return;
700
- if (json.drawingToSpatialTransform)
701
- this.drawingToSpatialTransform = core_geometry_1.Transform.fromJSON(json.drawingToSpatialTransform);
702
- if (json.sheetToSpatialTransform)
703
- this.sheetToSpatialTransform = core_geometry_1.Transform.fromJSON(json.sheetToSpatialTransform);
704
- if (json.drawingBoundaryClip)
705
- this.drawingBoundaryClip = core_geometry_1.ClipVector.fromJSON(json.drawingBoundaryClip);
706
- }
707
- /** @internal */
708
- static get className() { return "SectionDrawing"; }
709
- /** Convert to JSON representation. */
710
- toJSON() {
711
- var _c, _d, _e;
712
- const props = {
713
- ...super.toJSON(),
714
- sectionType: this.sectionType,
715
- spatialView: this.spatialView.toJSON(),
716
- };
717
- if (!props.jsonProperties)
718
- props.jsonProperties = {};
719
- props.jsonProperties.displaySpatialView = this.displaySpatialView ? true : undefined;
720
- props.jsonProperties.drawingToSpatialTransform = (_c = this.drawingToSpatialTransform) === null || _c === void 0 ? void 0 : _c.toJSON();
721
- props.jsonProperties.sheetToSpatialTransform = (_d = this.sheetToSpatialTransform) === null || _d === void 0 ? void 0 : _d.toJSON();
722
- props.jsonProperties.drawingBoundaryClip = (_e = this.drawingBoundaryClip) === null || _e === void 0 ? void 0 : _e.toJSON();
723
- return props;
724
- }
725
- }
726
- exports.SectionDrawing = SectionDrawing;
727
- /** The template for a SheetBorder
728
- * @public
729
- */
730
- class SheetBorderTemplate extends Document {
731
- /** @internal */
732
- constructor(props, iModel) { super(props, iModel); }
733
- /** @internal */
734
- static get className() { return "SheetBorderTemplate"; }
735
- }
736
- exports.SheetBorderTemplate = SheetBorderTemplate;
737
- /** The template for a [[Sheet]]
738
- * @public
739
- */
740
- class SheetTemplate extends Document {
741
- /** @internal */
742
- constructor(props, iModel) { super(props, iModel); }
743
- /** @internal */
744
- static get className() { return "SheetTemplate"; }
745
- /** @internal */
746
- collectReferenceConcreteIds(referenceIds) {
747
- super.collectReferenceConcreteIds(referenceIds);
748
- if (undefined !== this.border)
749
- referenceIds.addElement(this.border);
750
- }
751
- }
752
- exports.SheetTemplate = SheetTemplate;
753
- /** A digital representation of a *sheet of paper*. Modeled by a [[SheetModel]].
754
- * @public
755
- */
756
- class Sheet extends Document {
757
- /** @internal */
758
- constructor(props, iModel) {
759
- super(props, iModel);
760
- this.height = core_bentley_1.JsonUtils.asDouble(props.height);
761
- this.width = core_bentley_1.JsonUtils.asDouble(props.width);
762
- this.scale = props.scale;
763
- this.sheetTemplate = props.sheetTemplate ? core_bentley_1.Id64.fromJSON(props.sheetTemplate) : undefined;
764
- }
765
- /** @internal */
766
- static get className() { return "Sheet"; }
767
- /** @internal */
768
- collectReferenceConcreteIds(referenceIds) {
769
- super.collectReferenceConcreteIds(referenceIds);
770
- if (undefined !== this.sheetTemplate)
771
- referenceIds.addElement(this.sheetTemplate);
772
- }
773
- /** Create a Code for a Sheet given a name that is meant to be unique within the scope of the specified DocumentListModel.
774
- * @param iModel The IModelDb
775
- * @param scopeModelId The Id of the DocumentListModel that contains the Sheet and provides the scope for its name.
776
- * @param codeValue The Sheet name
777
- */
778
- static createCode(iModel, scopeModelId, codeValue) {
779
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.sheet);
780
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
781
- }
782
- }
783
- exports.Sheet = Sheet;
784
- /** Information Record Element is an abstract base class for modeling information records. Information Record
785
- * Element is the default choice if no other subclass of Information Content Element makes sense.
786
- * @public
787
- */
788
- class InformationRecordElement extends InformationContentElement {
789
- /** @internal */
790
- static get className() { return "InformationRecordElement"; }
791
- /** @internal */
792
- constructor(props, iModel) { super(props, iModel); }
793
- }
794
- exports.InformationRecordElement = InformationRecordElement;
795
- /** A Definition Element holds configuration-related information that is meant to be referenced / shared.
796
- * @public
797
- */
798
- class DefinitionElement extends InformationContentElement {
799
- /** @internal */
800
- constructor(props, iModel) {
801
- super(props, iModel);
802
- this.isPrivate = true === props.isPrivate;
803
- }
804
- /** @internal */
805
- static get className() { return "DefinitionElement"; }
806
- /** @internal */
807
- toJSON() {
808
- const val = super.toJSON();
809
- val.isPrivate = this.isPrivate;
810
- return val;
811
- }
812
- }
813
- exports.DefinitionElement = DefinitionElement;
814
- /** This abstract class unifies DefinitionGroup and DefinitionContainer for relationship endpoint purposes.
815
- * @note The associated ECClass was added to the BisCore schema in version 1.0.10
816
- * @public
817
- */
818
- class DefinitionSet extends DefinitionElement {
819
- /** @internal */
820
- static get className() { return "DefinitionSet"; }
821
- }
822
- exports.DefinitionSet = DefinitionSet;
823
- /** A DefinitionContainer exclusively owns a set of DefinitionElements contained within its sub-model (of type DefinitionModel).
824
- * @note The associated ECClass was added to the BisCore schema in version 1.0.10
825
- * @public
826
- */
827
- class DefinitionContainer extends DefinitionSet {
828
- /** @internal */
829
- static get className() { return "DefinitionContainer"; }
830
- /** Create a DefinitionContainer
831
- * @param iModelDb The IModelDb
832
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.
833
- * @param code The Code for this DefinitionContainer.
834
- * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.
835
- * @returns The newly constructed DefinitionContainer
836
- * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.
837
- * @throws [[IModelError]] if there is a problem creating the DefinitionContainer
838
- */
839
- static create(iModelDb, definitionModelId, code, isPrivate) {
840
- const elementProps = {
841
- classFullName: this.classFullName,
842
- model: definitionModelId,
843
- code,
844
- isPrivate,
845
- };
846
- return new DefinitionContainer(elementProps, iModelDb);
847
- }
848
- /** Insert a DefinitionContainer and its sub-model.
849
- * @param iModelDb Insert into this IModelDb
850
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.
851
- * @param code The Code for this DefinitionContainer.
852
- * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.
853
- * @returns The Id of the newly inserted DefinitionContainer and its newly inserted sub-model (of type DefinitionModel).
854
- * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.
855
- * @throws [[IModelError]] if there is a problem inserting the DefinitionContainer
856
- */
857
- static insert(iModelDb, definitionModelId, code, isPrivate) {
858
- const containerElement = this.create(iModelDb, definitionModelId, code, isPrivate);
859
- const containerElementId = iModelDb.elements.insertElement(containerElement.toJSON());
860
- const containerSubModelProps = {
861
- classFullName: Model_1.DefinitionModel.classFullName,
862
- modeledElement: { id: containerElementId },
863
- isPrivate,
864
- };
865
- iModelDb.models.insertModel(containerSubModelProps);
866
- return containerElementId;
867
- }
868
- }
869
- exports.DefinitionContainer = DefinitionContainer;
870
- /** A non-exclusive set of DefinitionElements grouped using the DefinitionGroupGroupsDefinitions relationship.
871
- * @note The associated ECClass was added to the BisCore schema in version 1.0.10
872
- * @public
873
- */
874
- class DefinitionGroup extends DefinitionSet {
875
- /** @internal */
876
- static get className() { return "DefinitionGroup"; }
877
- /** Create a DefinitionGroup
878
- * @param iModelDb The IModelDb
879
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionGroup element.
880
- * @param code The Code for this DefinitionGroup
881
- * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.
882
- * @returns The newly constructed DefinitionGroup
883
- * @note There is not a predefined CodeSpec for DefinitionGroup elements, so it is the responsibility of the domain or application to create one.
884
- * @throws [[IModelError]] if there is a problem creating the DefinitionGroup
885
- */
886
- static create(iModelDb, definitionModelId, code, isPrivate) {
887
- const elementProps = {
888
- classFullName: this.classFullName,
889
- model: definitionModelId,
890
- code,
891
- isPrivate,
892
- };
893
- return new DefinitionGroup(elementProps, iModelDb);
894
- }
895
- }
896
- exports.DefinitionGroup = DefinitionGroup;
897
- /** Defines a set of properties (the *type*) that may be associated with an element.
898
- * @public
899
- */
900
- class TypeDefinitionElement extends DefinitionElement {
901
- /** @internal */
902
- constructor(props, iModel) { super(props, iModel); }
903
- /** @internal */
904
- static get className() { return "TypeDefinitionElement"; }
905
- /** @internal */
906
- collectReferenceConcreteIds(referenceIds) {
907
- super.collectReferenceConcreteIds(referenceIds);
908
- if (undefined !== this.recipe)
909
- referenceIds.addElement(this.recipe.id);
910
- }
911
- }
912
- exports.TypeDefinitionElement = TypeDefinitionElement;
913
- /** Defines a recipe for generating instances from a definition.
914
- * @beta
915
- */
916
- class RecipeDefinitionElement extends DefinitionElement {
917
- /** @internal */
918
- static get className() { return "RecipeDefinitionElement"; }
919
- /** @internal */
920
- constructor(props, iModel) { super(props, iModel); }
921
- }
922
- exports.RecipeDefinitionElement = RecipeDefinitionElement;
923
- /** Defines a set of properties (the *type*) that can be associated with a Physical Element. A Physical
924
- * Type has a strong correlation with something that can be ordered from a catalog since all instances
925
- * share a common set of properties.
926
- * @public
927
- */
928
- class PhysicalType extends TypeDefinitionElement {
929
- /** @internal */
930
- constructor(props, iModel) {
931
- super(props, iModel);
932
- this.physicalMaterial = core_common_1.RelatedElement.fromJSON(props.physicalMaterial);
933
- }
934
- /** @internal */
935
- static get className() { return "PhysicalType"; }
936
- /** @internal */
937
- toJSON() {
938
- var _c;
939
- const val = super.toJSON();
940
- val.physicalMaterial = (_c = this.physicalMaterial) === null || _c === void 0 ? void 0 : _c.toJSON();
941
- return val;
942
- }
943
- /** Create a Code for a PhysicalType element given a name that is meant to be unique within the scope of the specified DefinitionModel.
944
- * @param iModel The IModelDb
945
- * @param scopeModelId The Id of the DefinitionModel that contains the PhysicalType element and provides the scope for its name.
946
- * @param codeValue The PhysicalType name
947
- */
948
- static createCode(iModel, scopeModelId, codeValue) {
949
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.physicalType);
950
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
951
- }
952
- }
953
- exports.PhysicalType = PhysicalType;
954
- /** Defines a set of properties (the *type*) that can be associated with a spatial location.
955
- * @public
956
- */
957
- class SpatialLocationType extends TypeDefinitionElement {
958
- /** @internal */
959
- static get className() { return "SpatialLocationType"; }
960
- /** @internal */
961
- constructor(props, iModel) { super(props, iModel); }
962
- /** Create a Code for a SpatialLocationType element given a name that is meant to be unique within the scope of the specified DefinitionModel.
963
- * @param iModel The IModelDb
964
- * @param scopeModelId The Id of the DefinitionModel that contains the SpatialLocationType element and provides the scope for its name.
965
- * @param codeValue The SpatialLocationType name
966
- */
967
- static createCode(iModel, scopeModelId, codeValue) {
968
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.spatialLocationType);
969
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
970
- }
971
- }
972
- exports.SpatialLocationType = SpatialLocationType;
973
- /** A TemplateRecipe3d is a DefinitionElement that has a sub-model that contains the 3d template elements.
974
- * @beta
975
- */
976
- class TemplateRecipe3d extends RecipeDefinitionElement {
977
- /** @internal */
978
- static get className() { return "TemplateRecipe3d"; }
979
- /** @internal */
980
- constructor(props, iModel) { super(props, iModel); }
981
- /** Create a Code for a TemplateRecipe3d given a name that is meant to be unique within the scope of its Model.
982
- * @param iModelDb The IModelDb
983
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.
984
- * @param codeValue The name of the TemplateRecipe3d element.
985
- */
986
- static createCode(iModelDb, definitionModelId, codeValue) {
987
- const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.templateRecipe3d);
988
- return new core_common_1.Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });
989
- }
990
- /** Create a TemplateRecipe3d
991
- * @param iModelDb The IModelDb
992
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.
993
- * @param name The name (Code.value) of the TemplateRecipe3d
994
- * @returns The newly constructed TemplateRecipe3d
995
- * @throws [[IModelError]] if there is a problem creating the TemplateRecipe3d
996
- */
997
- static create(iModelDb, definitionModelId, name, isPrivate) {
998
- const elementProps = {
999
- classFullName: this.classFullName,
1000
- model: definitionModelId,
1001
- code: this.createCode(iModelDb, definitionModelId, name),
1002
- isPrivate,
1003
- };
1004
- return new TemplateRecipe3d(elementProps, iModelDb);
1005
- }
1006
- /** Insert a TemplateRecipe3d and a PhysicalModel (sub-model) that will contain the 3d template elements.
1007
- * @param iModelDb The IModelDb
1008
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.
1009
- * @param name The name (Code.value) of the TemplateRecipe3d
1010
- * @returns The Id of the newly inserted TemplateRecipe3d and the PhysicalModel that sub-models it.
1011
- * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe3d or its sub-model.
1012
- */
1013
- static insert(iModelDb, definitionModelId, name, isPrivate) {
1014
- const element = this.create(iModelDb, definitionModelId, name, isPrivate);
1015
- const modeledElementId = iModelDb.elements.insertElement(element.toJSON());
1016
- const modelProps = {
1017
- classFullName: Model_1.PhysicalModel.classFullName,
1018
- modeledElement: { id: modeledElementId },
1019
- isTemplate: true,
1020
- };
1021
- return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId
1022
- }
1023
- }
1024
- exports.TemplateRecipe3d = TemplateRecipe3d;
1025
- /** Defines a set of properties (the *type*) that can be associated with a 2D Graphical Element.
1026
- * @public
1027
- */
1028
- class GraphicalType2d extends TypeDefinitionElement {
1029
- /** @internal */
1030
- static get className() { return "GraphicalType2d"; }
1031
- /** @internal */
1032
- constructor(props, iModel) { super(props, iModel); }
1033
- /** Create a Code for a GraphicalType2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
1034
- * @param iModel The IModelDb
1035
- * @param scopeModelId The Id of the DefinitionModel that contains the GraphicalType2d element and provides the scope for its name.
1036
- * @param codeValue The GraphicalType2d name
1037
- */
1038
- static createCode(iModel, scopeModelId, codeValue) {
1039
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.graphicalType2d);
1040
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
1041
- }
1042
- }
1043
- exports.GraphicalType2d = GraphicalType2d;
1044
- /** A recipe that uses a 2D template for creating new instances.
1045
- * @beta
1046
- */
1047
- class TemplateRecipe2d extends RecipeDefinitionElement {
1048
- /** @internal */
1049
- static get className() { return "TemplateRecipe2d"; }
1050
- /** @internal */
1051
- constructor(props, iModel) { super(props, iModel); }
1052
- /** Create a Code for a TemplateRecipe2d given a name that is meant to be unique within the scope of its Model.
1053
- * @param iModelDb The IModelDb
1054
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.
1055
- * @param codeValue The name of the TemplateRecipe2d element.
1056
- */
1057
- static createCode(iModelDb, definitionModelId, codeValue) {
1058
- const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.templateRecipe2d);
1059
- return new core_common_1.Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });
1060
- }
1061
- /** Create a TemplateRecipe2d
1062
- * @param iModelDb The IModelDb
1063
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.
1064
- * @param name The name (Code.value) of the TemplateRecipe2d
1065
- * @returns The newly constructed TemplateRecipe2d
1066
- * @throws [[IModelError]] if there is a problem creating the TemplateRecipe2d
1067
- */
1068
- static create(iModelDb, definitionModelId, name, isPrivate) {
1069
- const elementProps = {
1070
- classFullName: this.classFullName,
1071
- model: definitionModelId,
1072
- code: this.createCode(iModelDb, definitionModelId, name),
1073
- isPrivate,
1074
- };
1075
- return new TemplateRecipe2d(elementProps, iModelDb);
1076
- }
1077
- /** Insert a TemplateRecipe2d and a DrawingModel (sub-model) that will contain the 2d template elements.
1078
- * @param iModelDb The IModelDb
1079
- * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.
1080
- * @param name The name (Code.value) of the TemplateRecipe2d
1081
- * @returns The Id of the newly inserted TemplateRecipe2d and the PhysicalModel that sub-models it.
1082
- * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe2d or its sub-model.
1083
- */
1084
- static insert(iModelDb, definitionModelId, name, isPrivate) {
1085
- const element = this.create(iModelDb, definitionModelId, name, isPrivate);
1086
- const modeledElementId = iModelDb.elements.insertElement(element.toJSON());
1087
- const modelProps = {
1088
- classFullName: Model_1.DrawingModel.classFullName,
1089
- modeledElement: { id: modeledElementId },
1090
- isTemplate: true,
1091
- };
1092
- return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId
1093
- }
1094
- }
1095
- exports.TemplateRecipe2d = TemplateRecipe2d;
1096
- /** An abstract base class for elements that establishes a particular modeling perspective for its parent Subject.
1097
- * Instances are always sub-modeled by a specialization of Model of the appropriate modeling perspective.
1098
- * @see [iModel Information Hierarchy]($docs/bis/guide/data-organization/top-of-the-world), [[Subject]], [[Model]]
1099
- * @public
1100
- */
1101
- class InformationPartitionElement extends InformationContentElement {
1102
- /** @internal */
1103
- constructor(props, iModel) { super(props, iModel); }
1104
- /** @internal */
1105
- static get className() { return "InformationPartitionElement"; }
1106
- /** @internal */
1107
- toJSON() {
1108
- return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
1109
- }
1110
- /** Create a code that can be used for any subclass of InformationPartitionElement.
1111
- * @param iModelDb The IModelDb
1112
- * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child InformationPartitionElements.
1113
- * @param codeValue The InformationPartitionElement name
1114
- */
1115
- static createCode(iModel, parentSubjectId, codeValue) {
1116
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.informationPartitionElement);
1117
- return new core_common_1.Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });
1118
- }
1119
- }
1120
- exports.InformationPartitionElement = InformationPartitionElement;
1121
- /** A DefinitionPartition element establishes a *Definition* modeling perspective for its parent Subject.
1122
- * A DefinitionPartition is always sub-modeled by a DefinitionModel.
1123
- * @see [[DefinitionModel]]
1124
- * @public
1125
- */
1126
- class DefinitionPartition extends InformationPartitionElement {
1127
- /** @internal */
1128
- static get className() { return "DefinitionPartition"; }
1129
- }
1130
- exports.DefinitionPartition = DefinitionPartition;
1131
- /** A DocumentPartition element establishes a *Document* modeling perspective for its parent Subject.
1132
- * A DocumentPartition is always sub-modeled by a DocumentListModel.
1133
- * @see [[DocumentListModel]]
1134
- * @public
1135
- */
1136
- class DocumentPartition extends InformationPartitionElement {
1137
- /** @internal */
1138
- static get className() { return "DocumentPartition"; }
1139
- }
1140
- exports.DocumentPartition = DocumentPartition;
1141
- /** A GroupInformationPartition element establishes a *Group Information* modeling perspective for its parent Subject.
1142
- * A GroupInformationPartition is always sub-modeled by a GroupInformationModel.
1143
- * @see [[GroupInformationModel]]
1144
- * @public
1145
- */
1146
- class GroupInformationPartition extends InformationPartitionElement {
1147
- /** @internal */
1148
- static get className() { return "GroupInformationPartition"; }
1149
- }
1150
- exports.GroupInformationPartition = GroupInformationPartition;
1151
- /** A GraphicalPartition3d element establishes a *3D Graphical* modeling perspective for its parent Subject.
1152
- * A GraphicalPartition3d is always sub-modeled by a GraphicalModel3d.
1153
- * @note The associated ECClass was added to the BisCore schema in version 1.0.8
1154
- * @see [[GraphicalModel3d]]
1155
- * @public
1156
- */
1157
- class GraphicalPartition3d extends InformationPartitionElement {
1158
- /** @internal */
1159
- static get className() { return "GraphicalPartition3d"; }
1160
- }
1161
- exports.GraphicalPartition3d = GraphicalPartition3d;
1162
- /** An InformationRecordPartition element establishes a *Information Record* modeling perspective for its parent Subject.
1163
- * A InformationRecordPartition is always sub-modeled by an InformationRecordModel.
1164
- * @see [[InformationRecordModel]]
1165
- * @public
1166
- */
1167
- class InformationRecordPartition extends InformationPartitionElement {
1168
- /** @internal */
1169
- static get className() { return "InformationRecordPartition"; }
1170
- }
1171
- exports.InformationRecordPartition = InformationRecordPartition;
1172
- /** A LinkPartition element establishes a *Link* modeling perspective for its parent Subject. A LinkPartition is always sub-modeled by a LinkModel.
1173
- * @see [[LinkModel]]
1174
- * @public
1175
- */
1176
- class LinkPartition extends InformationPartitionElement {
1177
- /** @internal */
1178
- static get className() { return "LinkPartition"; }
1179
- }
1180
- exports.LinkPartition = LinkPartition;
1181
- /** A PhysicalPartition element establishes a *Physical* modeling perspective for its parent Subject. A PhysicalPartition is always sub-modeled by a PhysicalModel.
1182
- * @see [[PhysicalModel]]
1183
- * @public
1184
- */
1185
- class PhysicalPartition extends InformationPartitionElement {
1186
- /** @internal */
1187
- static get className() { return "PhysicalPartition"; }
1188
- }
1189
- exports.PhysicalPartition = PhysicalPartition;
1190
- /** A SpatialLocationPartition element establishes a *SpatialLocation* modeling perspective for its parent Subject.
1191
- * A SpatialLocationPartition is always sub-modeled by a SpatialLocationModel.
1192
- * @see [[SpatialLocationModel]]
1193
- * @public
1194
- */
1195
- class SpatialLocationPartition extends InformationPartitionElement {
1196
- /** @internal */
1197
- static get className() { return "SpatialLocationPartition"; }
1198
- }
1199
- exports.SpatialLocationPartition = SpatialLocationPartition;
1200
- /** Group Information is an abstract base class for modeling entities whose main purpose is to reference a group of related elements.
1201
- * @public
1202
- */
1203
- class GroupInformationElement extends InformationReferenceElement {
1204
- /** @internal */
1205
- static get className() { return "GroupInformationElement"; }
1206
- }
1207
- exports.GroupInformationElement = GroupInformationElement;
1208
- /** An information element that specifies a link.
1209
- * @public
1210
- */
1211
- class LinkElement extends InformationReferenceElement {
1212
- /** @internal */
1213
- static get className() { return "LinkElement"; }
1214
- /** Create a Code for a LinkElement given a name that is meant to be unique within the scope of the specified Model.
1215
- * @param iModel The IModelDb
1216
- * @param scopeModelId The Id of the Model that contains the LinkElement and provides the scope for its name.
1217
- * @param codeValue The LinkElement name
1218
- */
1219
- static createCode(iModel, scopeModelId, codeValue) {
1220
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.linkElement);
1221
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
1222
- }
1223
- }
1224
- exports.LinkElement = LinkElement;
1225
- /** An information element that specifies a URL link.
1226
- * @public
1227
- */
1228
- class UrlLink extends LinkElement {
1229
- /** @internal */
1230
- constructor(props, iModel) {
1231
- super(props, iModel);
1232
- this.description = props.description;
1233
- this.url = props.url;
1234
- }
1235
- /** @internal */
1236
- static get className() { return "UrlLink"; }
1237
- /** @internal */
1238
- toJSON() {
1239
- const val = super.toJSON();
1240
- val.description = this.description;
1241
- val.url = this.url;
1242
- return val;
1243
- }
1244
- }
1245
- exports.UrlLink = UrlLink;
1246
- /** Represents a folder-like structure that organizes repositories (typically files) in an external system.
1247
- * @note The associated ECClass was added to the BisCore schema in version 1.0.13
1248
- * @alpha
1249
- */
1250
- class FolderLink extends UrlLink {
1251
- /** @internal */
1252
- static get className() { return "FolderLink"; }
1253
- }
1254
- exports.FolderLink = FolderLink;
1255
- /** An information element that links to a repository.
1256
- * @public
1257
- */
1258
- class RepositoryLink extends UrlLink {
1259
- /** @internal */
1260
- constructor(props, iModel) {
1261
- super(props, iModel);
1262
- this.repositoryGuid = props.repositoryGuid;
1263
- this.format = props.format;
1264
- }
1265
- /** @internal */
1266
- static get className() { return "RepositoryLink"; }
1267
- /** @internal */
1268
- toJSON() {
1269
- const val = super.toJSON();
1270
- val.repositoryGuid = this.repositoryGuid;
1271
- val.format = this.format;
1272
- return val;
1273
- }
1274
- }
1275
- exports.RepositoryLink = RepositoryLink;
1276
- /** An information element that links to an embedded file.
1277
- * @public
1278
- */
1279
- class EmbeddedFileLink extends LinkElement {
1280
- /** @internal */
1281
- static get className() { return "EmbeddedFileLink"; }
1282
- }
1283
- exports.EmbeddedFileLink = EmbeddedFileLink;
1284
- /** A real world entity is modeled as a Role Element when a set of external circumstances define an important
1285
- * role (one that is worth tracking) that is not intrinsic to the entity playing the role. For example,
1286
- * a person can play the role of a teacher or a rock can play the role of a boundary marker.
1287
- * @public
1288
- */
1289
- class RoleElement extends Element {
1290
- /** @internal */
1291
- static get className() { return "RoleElement"; }
1292
- }
1293
- exports.RoleElement = RoleElement;
1294
- /** A Definition Element that specifies a collection of geometry that is meant to be reused across Geometric
1295
- * Element instances. Leveraging Geometry Parts can help reduce file size and improve display performance.
1296
- * @public
1297
- */
1298
- class GeometryPart extends DefinitionElement {
1299
- /** @internal */
1300
- constructor(props, iModel) {
1301
- super(props, iModel);
1302
- this.geom = props.geom;
1303
- this.bbox = core_geometry_1.Range3d.fromJSON(props.bbox);
1304
- }
1305
- /** @internal */
1306
- static get className() { return "GeometryPart"; }
1307
- /** @internal */
1308
- toJSON() {
1309
- const val = super.toJSON();
1310
- val.geom = this.geom;
1311
- val.bbox = this.bbox;
1312
- return val;
1313
- }
1314
- /** Create a Code for a GeometryPart element given a name that is meant to be unique within the scope of the specified DefinitionModel.
1315
- * @param iModel The IModelDb
1316
- * @param scopeModelId The Id of the DefinitionModel that contains the GeometryPart element and provides the scope for its name.
1317
- * @param codeValue The GeometryPart name
1318
- * @note GeometryPart elements are not required to be named (have a non-empty Code).
1319
- */
1320
- static createCode(iModel, scopeModelId, codeValue) {
1321
- const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.geometryPart);
1322
- return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
1323
- }
1324
- }
1325
- exports.GeometryPart = GeometryPart;
1326
- /** The definition element for a line style
1327
- * @public
1328
- */
1329
- class LineStyle extends DefinitionElement {
1330
- /** @internal */
1331
- constructor(props, iModel) { super(props, iModel); }
1332
- /** @internal */
1333
- static get className() { return "LineStyle"; }
1334
- /** Create a Code for a LineStyle definition given a name that is meant to be unique within the scope of the specified model.
1335
- * @param iModel The IModel
1336
- * @param scopeModelId The Id of the DefinitionModel that contains the LineStyle and provides the scope for its name.
1337
- * @param codeValue The name of the LineStyle
1338
- * @returns A LineStyle Code
1339
- */
1340
- static createCode(iModel, scopeModelId, codeValue) {
1341
- return new core_common_1.Code({ spec: iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.lineStyle).id, scope: scopeModelId, value: codeValue });
1342
- }
1343
- }
1344
- exports.LineStyle = LineStyle;
1345
- /** Describes how to animate a view of a [[GeometricModel]] to show change over time using a [RenderSchedule.Script]($common).
1346
- * @note This class was introduced in version 01.00.13 of the BisCore ECSchema. It should only be used with [[IModelDb]]s containing that version or newer.
1347
- * @public
1348
- */
1349
- class RenderTimeline extends InformationRecordElement {
1350
- /** @internal */
1351
- constructor(props, iModel) {
1352
- var _c;
1353
- super(props, iModel);
1354
- this.description = (_c = props.description) !== null && _c !== void 0 ? _c : "";
1355
- this.scriptProps = RenderTimeline.parseScriptProps(props.script);
1356
- }
1357
- /** @internal */
1358
- static get className() { return "RenderTimeline"; }
1359
- static fromJSON(props, iModel) {
1360
- return new RenderTimeline(props, iModel);
1361
- }
1362
- toJSON() {
1363
- const props = super.toJSON();
1364
- if (this.description.length > 0)
1365
- props.description = this.description;
1366
- props.script = JSON.stringify(this.scriptProps);
1367
- return props;
1368
- }
1369
- static parseScriptProps(json) {
1370
- try {
1371
- return JSON.parse(json);
1372
- }
1373
- catch {
1374
- return [];
1375
- }
1376
- }
1377
- /** @internal */
1378
- collectReferenceConcreteIds(ids) {
1379
- super.collectReferenceConcreteIds(ids);
1380
- const script = core_common_1.RenderSchedule.Script.fromJSON(this.scriptProps);
1381
- script === null || script === void 0 ? void 0 : script.discloseIds(ids); // eslint-disable-line deprecation/deprecation
1382
- }
1383
- /** @alpha */
1384
- static onCloned(context, sourceProps, targetProps) {
1385
- super.onCloned(context, sourceProps, targetProps);
1386
- if (context.isBetweenIModels)
1387
- targetProps.script = JSON.stringify(this.remapScript(context, this.parseScriptProps(targetProps.script)));
1388
- }
1389
- /** Remap Ids when cloning a RenderSchedule.Script between iModels on a DisplayStyle or RenderTimeline.
1390
- * @internal
1391
- */
1392
- static remapScript(context, input) {
1393
- const scriptProps = [];
1394
- if (!Array.isArray(input))
1395
- return scriptProps;
1396
- const elementIds = new core_bentley_1.OrderedId64Array();
1397
- for (const model of input) {
1398
- const modelId = context.findTargetElementId(model.modelId);
1399
- if (!core_bentley_1.Id64.isValid(modelId))
1400
- continue;
1401
- model.modelId = modelId;
1402
- scriptProps.push(model);
1403
- for (const element of model.elementTimelines) {
1404
- elementIds.clear();
1405
- for (const sourceId of core_common_1.RenderSchedule.ElementTimeline.getElementIds(element.elementIds)) {
1406
- const targetId = context.findTargetElementId(sourceId);
1407
- if (core_bentley_1.Id64.isValid(targetId))
1408
- elementIds.insert(targetId);
1409
- }
1410
- element.elementIds = core_bentley_1.CompressedId64Set.compressIds(elementIds);
1411
- }
1412
- }
1413
- return scriptProps;
1414
- }
1415
- }
1416
- exports.RenderTimeline = RenderTimeline;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Elements
8
+ */
9
+ var _a, _b;
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.FolderLink = exports.UrlLink = exports.LinkElement = exports.GroupInformationElement = exports.SpatialLocationPartition = exports.PhysicalPartition = exports.LinkPartition = exports.InformationRecordPartition = exports.GraphicalPartition3d = exports.GroupInformationPartition = exports.DocumentPartition = exports.DefinitionPartition = exports.InformationPartitionElement = exports.TemplateRecipe2d = exports.GraphicalType2d = exports.TemplateRecipe3d = exports.SpatialLocationType = exports.PhysicalType = exports.RecipeDefinitionElement = exports.TypeDefinitionElement = exports.DefinitionGroup = exports.DefinitionContainer = exports.DefinitionSet = exports.DefinitionElement = exports.InformationRecordElement = exports.Sheet = exports.SheetTemplate = exports.SheetBorderTemplate = exports.SectionDrawing = exports.Drawing = exports.Document = exports.Subject = exports.InformationReferenceElement = exports.DriverBundleElement = exports.InformationContentElement = exports.SectionDrawingLocation = exports.VolumeElement = exports.SpatialLocationElement = exports.PhysicalElement = exports.SpatialElement = exports.TextAnnotation3d = exports.TextAnnotation2d = exports.DrawingGraphic = exports.AnnotationElement2d = exports.GraphicalElement2d = exports.GeometricElement2d = exports.GraphicalElement3d = exports.GeometricElement3d = exports.GeometricElement = exports.Element = void 0;
12
+ exports.RenderTimeline = exports.LineStyle = exports.GeometryPart = exports.RoleElement = exports.EmbeddedFileLink = exports.RepositoryLink = void 0;
13
+ const core_bentley_1 = require("@itwin/core-bentley");
14
+ const core_common_1 = require("@itwin/core-common");
15
+ const core_geometry_1 = require("@itwin/core-geometry");
16
+ const Entity_1 = require("./Entity");
17
+ const Model_1 = require("./Model");
18
+ const NavigationRelationship_1 = require("./NavigationRelationship");
19
+ /** Elements are the smallest individually identifiable building blocks for modeling the real world in an iModel.
20
+ * Each element represents an entity in the real world. Sets of Elements (contained in [[Model]]s) are used to model
21
+ * other Elements that represent larger scale real world entities. Using this recursive modeling strategy,
22
+ * Elements can represent entities at any scale. Elements can represent physical things or abstract concepts
23
+ * or simply be information records.
24
+ *
25
+ * Every Element has a 64-bit id (inherited from Entity) that uniquely identifies it within an iModel. Every Element also
26
+ * has a "code" that identifies its meaning in the real world. Additionally, Elements may have a "federationGuid"
27
+ * to hold a GUID, if the element was assigned that GUID by some other federated database. The iModel database enforces
28
+ * uniqueness of id, code, and federationGuid.
29
+ *
30
+ * See:
31
+ * * [Element Fundamentals]($docs/bis/guide/fundamentals/element-fundamentals.md)
32
+ * * [Working with schemas and elements in TypeScript]($docs/learning/backend/SchemasAndElementsInTypeScript.md)
33
+ * * [Creating elements]($docs/learning/backend/CreateElements.md)
34
+ * @public
35
+ */
36
+ class Element extends Entity_1.Entity {
37
+ /** constructor for Element.
38
+ * @internal
39
+ */
40
+ constructor(props, iModel) {
41
+ super(props, iModel);
42
+ this.code = core_common_1.Code.fromJSON(props.code); // TODO: Validate props.code - don't silently fail if it is the wrong type
43
+ this.model = core_common_1.RelatedElement.idFromJson(props.model);
44
+ this.parent = core_common_1.RelatedElement.fromJSON(props.parent);
45
+ this.federationGuid = props.federationGuid;
46
+ this.userLabel = props.userLabel;
47
+ this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy
48
+ }
49
+ /** @internal */
50
+ static get className() { return "Element"; }
51
+ /** @internal */
52
+ static get protectedOperations() { return ["onInsert", "onUpdate", "onDelete"]; }
53
+ /** Called before a new Element is inserted.
54
+ * @note throw an exception to disallow the insert
55
+ * @note If you override this method, you must call super.
56
+ * @note `this` is the class of the Element to be inserted
57
+ * @beta
58
+ */
59
+ static onInsert(arg) {
60
+ var _c;
61
+ const { iModel, props } = arg;
62
+ iModel.locks.checkSharedLock(props.model, "model", "insert"); // inserting requires shared lock on model
63
+ if (props.parent) // inserting requires shared lock on parent, if present
64
+ iModel.locks.checkSharedLock(props.parent.id, "parent", "insert");
65
+ (_c = iModel.codeService) === null || _c === void 0 ? void 0 : _c.verifyCode(arg);
66
+ }
67
+ /** Called after a new Element was inserted.
68
+ * @note If you override this method, you must call super.
69
+ * @note `this` is the class of the Element that was inserted
70
+ * @beta
71
+ */
72
+ static onInserted(arg) {
73
+ arg.iModel.locks.elementWasCreated(arg.id);
74
+ }
75
+ /** Called before an Element is updated.
76
+ * @note throw an exception to disallow the update
77
+ * @note If you override this method, you must call super.
78
+ * @note `this` is the class of the Element to be updated
79
+ * @beta
80
+ */
81
+ static onUpdate(arg) {
82
+ var _c;
83
+ arg.iModel.locks.checkExclusiveLock(arg.props.id, "element", "update"); // eslint-disable-line @typescript-eslint/no-non-null-assertion
84
+ (_c = arg.iModel.codeService) === null || _c === void 0 ? void 0 : _c.verifyCode(arg);
85
+ }
86
+ /** Called after an Element was updated.
87
+ * @note If you override this method, you must call super.
88
+ * @note `this` is the class of the Element that was updated
89
+ * @beta
90
+ */
91
+ static onUpdated(_arg) { }
92
+ /** Called before an Element is deleted.
93
+ * @note throw an exception to disallow the delete
94
+ * @note If you override this method, you must call super.
95
+ * @note `this` is the class of the Element to be deleted
96
+ * @beta
97
+ */
98
+ static onDelete(arg) {
99
+ arg.iModel.locks.checkExclusiveLock(arg.id, "element", "delete");
100
+ }
101
+ /** Called after an Element was deleted.
102
+ * @note If you override this method, you must call super.
103
+ * @note `this` is the class of the Element that was deleted
104
+ * @beta
105
+ */
106
+ static onDeleted(_arg) { }
107
+ /** Called when an element with an instance of this class as its parent is about to be deleted.
108
+ * @note throw an exception if the element should not be deleted
109
+ * @note implementers should not presume that the element was deleted if this method does not throw,
110
+ * since the delete may fail for other reasons. Instead, rely on [[onChildDeleted]] for that purpose.
111
+ * @note `this` is the class of the parent Element whose child will be deleted
112
+ * @beta
113
+ */
114
+ static onChildDelete(_arg) { }
115
+ /** Called after an element with an instance of this class as its parent was successfully deleted.
116
+ * @note `this` is the class of the parent Element whose child was deleted
117
+ * @beta
118
+ */
119
+ static onChildDeleted(_arg) { }
120
+ /** Called when a *new element* with an instance of this class as its parent is about to be inserted.
121
+ * @note throw an exception if the element should not be inserted
122
+ * @note `this` is the class of the prospective parent Element.
123
+ * @beta
124
+ */
125
+ static onChildInsert(_arg) { }
126
+ /** Called after a *new element* with an instance of this class as its parent was inserted.
127
+ * @note `this` is the class of the parent Element.
128
+ * @beta
129
+ */
130
+ static onChildInserted(_arg) { }
131
+ /** Called when an element with an instance of this class as its parent is about to be updated.
132
+ * @note throw an exception if the element should not be updated
133
+ * @note `this` is the class of the parent Element.
134
+ * @beta
135
+ */
136
+ static onChildUpdate(_arg) { }
137
+ /** Called after an element with an instance of this the class as its parent was updated.
138
+ * @note `this` is the class of the parent Element.
139
+ * @beta
140
+ */
141
+ static onChildUpdated(_arg) { }
142
+ /** Called when an *existing element* is about to be updated so that an instance of this class will become its new parent.
143
+ * @note throw an exception if the element should not be added
144
+ * @note `this` is the class of the prospective parent Element.
145
+ * @beta
146
+ */
147
+ static onChildAdd(_arg) { }
148
+ /** Called after an *existing element* has been updated so that an instance of this class is its new parent.
149
+ * @note `this` is the class of the new parent Element.
150
+ * @beta
151
+ */
152
+ static onChildAdded(_arg) { }
153
+ /** Called when an element with an instance of this class as its parent is about to be updated change to a different parent.
154
+ * @note throw an exception if the element should not be dropped
155
+ * @note `this` is the class of the parent Element.
156
+ * @beta
157
+ */
158
+ static onChildDrop(_arg) { }
159
+ /** Called after an element with an instance of this class as its previous parent was updated to have a new parent.
160
+ * @note `this` is the class of the previous parent Element.
161
+ * @beta
162
+ */
163
+ static onChildDropped(_arg) { }
164
+ /** Called when an instance of this class is being *sub-modeled* by a new Model.
165
+ * @note throw an exception if model should not be inserted
166
+ * @note `this` is the class of Element to be sub-modeled.
167
+ * @beta
168
+ */
169
+ static onSubModelInsert(_arg) { }
170
+ /** Called after an instance of this class was *sub-modeled* by a new Model.
171
+ * @note `this` is the class of Element that is now sub-modeled.
172
+ * @beta
173
+ */
174
+ static onSubModelInserted(_arg) { }
175
+ /** Called when a sub-model of an instance of this class is being deleted.
176
+ * @note throw an exception if model should not be deleted
177
+ * @note `this` is the class of Element that is sub-modeled.
178
+ * @beta
179
+ */
180
+ static onSubModelDelete(_arg) { }
181
+ /** Called after a sub-model of an instance of this class was deleted.
182
+ * @note `this` is the class of Element that was sub-modeled.
183
+ * @beta
184
+ */
185
+ static onSubModelDeleted(_arg) { }
186
+ /** Called during the iModel transformation process after an Element from the source iModel was *cloned* for the target iModel.
187
+ * The transformation process automatically handles remapping BisCore properties and those that are properly described in ECSchema.
188
+ * This callback is only meant to be overridden if there are other Ids in non-standard locations that need to be remapped or other data that needs to be fixed up after the clone.
189
+ * @param _context The context that persists any remapping between the source iModel and target iModel.
190
+ * @param _sourceProps The ElementProps for the source Element that was cloned.
191
+ * @param _targetProps The ElementProps that are a result of the clone. These can be further modified.
192
+ * @note If you override this method, you must call super.
193
+ * @beta
194
+ */
195
+ static onCloned(_context, _sourceProps, _targetProps) { }
196
+ /** Called when a *root* element in a subgraph is changed and before its outputs are processed.
197
+ * This special callback is made when:
198
+ * * the element is part of an [[ElementDrivesElement]] graph, and
199
+ * * the element has no inputs, and
200
+ * * none of the element's outputs have been processed.
201
+ * @see [[ElementDrivesElement]] for more on element dependency graphs.
202
+ * @beta
203
+ */
204
+ static onBeforeOutputsHandled(_id, _iModel) { }
205
+ /** Called on an element in a graph after all of its inputs have been processed and before its outputs are processed.
206
+ * This callback is made when:
207
+ * * the specified element is part of an [[ElementDrivesElement]] graph, and
208
+ * * there was a direct change to some element upstream in the dependency graph.
209
+ * * all upstream elements in the graph have been processed.
210
+ * * none of the downstream elements have been processed.
211
+ * This method is not called if none of the element's inputs were changed.
212
+ * @see [[ElementDrivesElement]] for more on element dependency graphs.
213
+ * @beta
214
+ */
215
+ static onAllInputsHandled(_id, _iModel) { }
216
+ /** Save this Element's properties to an object for serializing to JSON.
217
+ * @internal
218
+ */
219
+ toJSON() {
220
+ const val = super.toJSON();
221
+ if (core_common_1.Code.isValid(this.code))
222
+ val.code = this.code;
223
+ val.model = this.model;
224
+ val.userLabel = this.userLabel;
225
+ val.federationGuid = this.federationGuid;
226
+ if (this.parent)
227
+ val.parent = this.parent;
228
+ if (Object.keys(this.jsonProperties).length > 0)
229
+ val.jsonProperties = this.jsonProperties;
230
+ return val;
231
+ }
232
+ /** Collect the Ids of this element's *references* at this level of the class hierarchy.
233
+ * @deprecated in 3.x. use [[collectReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles
234
+ * @beta
235
+ */
236
+ collectPredecessorIds(predecessorIds) {
237
+ return this.collectReferenceIds(predecessorIds);
238
+ }
239
+ /** @internal */
240
+ collectReferenceConcreteIds(referenceIds) {
241
+ super.collectReferenceConcreteIds(referenceIds);
242
+ referenceIds.addModel(this.model); // The modeledElement is a reference
243
+ if (this.code.scope && core_bentley_1.Id64.isValidId64(this.code.scope))
244
+ referenceIds.addElement(this.code.scope); // The element that scopes the code is a reference
245
+ if (this.parent)
246
+ referenceIds.addElement(this.parent.id); // A parent element is a reference
247
+ }
248
+ /** Get the Ids of this element's *references*. A *reference* is any element whose id is stored in the EC data of this element
249
+ * This is important for cloning operations but can be useful in other situations as well.
250
+ * @beta
251
+ * @deprecated in 3.x. use [[getReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles
252
+ */
253
+ getPredecessorIds() {
254
+ return this.getReferenceIds();
255
+ }
256
+ /** Get the class metadata for this element. */
257
+ getClassMetaData() { return this.iModel.classMetaDataRegistry.find(this.classFullName); }
258
+ getAllUserProperties() {
259
+ if (!this.jsonProperties.UserProps)
260
+ this.jsonProperties.UserProps = new Object();
261
+ return this.jsonProperties.UserProps;
262
+ }
263
+ /** Get a set of JSON user properties by namespace */
264
+ getUserProperties(namespace) { return this.getAllUserProperties()[namespace]; }
265
+ /** Change a set of user JSON properties of this Element by namespace. */
266
+ setUserProperties(nameSpace, value) { this.getAllUserProperties()[nameSpace] = value; }
267
+ /** Remove a set of JSON user properties, specified by namespace, from this Element */
268
+ removeUserProperties(nameSpace) { delete this.getAllUserProperties()[nameSpace]; }
269
+ /** Get a JSON property of this element, by namespace */
270
+ getJsonProperty(nameSpace) { return this.jsonProperties[nameSpace]; }
271
+ setJsonProperty(nameSpace, value) { this.jsonProperties[nameSpace] = value; }
272
+ /** Get a display label for this Element. By default returns userLabel if present, otherwise code value. */
273
+ getDisplayLabel() { var _c; return (_c = this.userLabel) !== null && _c !== void 0 ? _c : this.code.value; }
274
+ /** Get a list of HTML strings that describe this Element for the tooltip. Strings will be listed on separate lines in the tooltip.
275
+ * Any instances of the pattern `%{tag}` will be replaced by the localized value of tag.
276
+ */
277
+ getToolTipMessage() {
278
+ const addKey = (key) => `<b>%{iModelJs:Element.${key}}:</b> `; // %{iModelJs:Element.xxx} is replaced with localized value of xxx in frontend.
279
+ const msg = [];
280
+ const display = this.getDisplayLabel();
281
+ msg.push(display ? display : `${addKey("Id") + this.id}, ${addKey("Type")}${this.className}`);
282
+ if (this instanceof GeometricElement)
283
+ msg.push(addKey("Category") + this.iModel.elements.getElement(this.category).getDisplayLabel());
284
+ msg.push(addKey("Model") + this.iModel.elements.getElement(this.model).getDisplayLabel());
285
+ return msg;
286
+ }
287
+ /** Insert this Element into the iModel. */
288
+ insert() { return this.id = this.iModel.elements.insertElement(this.toJSON()); }
289
+ /** Update this Element in the iModel. */
290
+ update() { this.iModel.elements.updateElement(this.toJSON()); }
291
+ /** Delete this Element from the iModel. */
292
+ delete() { this.iModel.elements.deleteElement(this.id); }
293
+ }
294
+ exports.Element = Element;
295
+ /** A *required reference* is an element that had to be inserted before this element could have been inserted.
296
+ * This is the list of property keys on this element that store references to those elements
297
+ * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.
298
+ * @note any property listed here must be added to the reference ids in [[collectReferenceIds]]
299
+ * @beta
300
+ */
301
+ Element.requiredReferenceKeys = ["parent", "model"];
302
+ /** A map of every [[requiredReferenceKeys]] on this class to their entity type.
303
+ * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.
304
+ * @alpha
305
+ */
306
+ Element.requiredReferenceKeyTypeMap = {
307
+ parent: core_common_1.ConcreteEntityTypes.Element,
308
+ model: core_common_1.ConcreteEntityTypes.Model,
309
+ };
310
+ /** An abstract base class to model real world entities that intrinsically have geometry.
311
+ * @public
312
+ */
313
+ class GeometricElement extends (_b = Element) {
314
+ /** @internal */
315
+ constructor(props, iModel) {
316
+ super(props, iModel);
317
+ this.category = core_bentley_1.Id64.fromJSON(props.category);
318
+ this.geom = props.geom;
319
+ }
320
+ /** @internal */
321
+ static get className() { return "GeometricElement"; }
322
+ /** Type guard for instanceof [[GeometricElement3d]] */
323
+ is3d() { return this instanceof GeometricElement3d; }
324
+ /** Type guard for instanceof [[GeometricElement2d]] */
325
+ is2d() { return this instanceof GeometricElement2d; }
326
+ /** Get the [Transform]($geometry) from the Placement of this GeometricElement */
327
+ getPlacementTransform() { return this.placement.transform; }
328
+ calculateRange3d() { return this.placement.calculateRange(); }
329
+ /** Obtain the JSON representation of this element. */
330
+ toJSON() {
331
+ const val = super.toJSON();
332
+ val.category = this.category;
333
+ if (this.geom)
334
+ val.geom = this.geom;
335
+ return val;
336
+ }
337
+ /** @internal */
338
+ collectReferenceConcreteIds(referenceIds) {
339
+ super.collectReferenceConcreteIds(referenceIds);
340
+ referenceIds.addElement(this.category);
341
+ // TODO: GeometryPartIds?
342
+ }
343
+ }
344
+ exports.GeometricElement = GeometricElement;
345
+ _a = GeometricElement;
346
+ /** @beta */
347
+ GeometricElement.requiredReferenceKeys = [...Reflect.get(_b, "requiredReferenceKeys", _a), "category"];
348
+ /** @alpha */
349
+ GeometricElement.requiredReferenceKeyTypeMap = {
350
+ ...Reflect.get(_b, "requiredReferenceKeyTypeMap", _a),
351
+ category: core_common_1.ConcreteEntityTypes.Element,
352
+ };
353
+ /** An abstract base class to model real world entities that intrinsically have 3d geometry.
354
+ * See [how to create a GeometricElement3d]($docs/learning/backend/CreateElements.md#GeometricElement3d).
355
+ * @public
356
+ */
357
+ class GeometricElement3d extends GeometricElement {
358
+ /** @internal */
359
+ constructor(props, iModel) {
360
+ super(props, iModel);
361
+ this.placement = core_common_1.Placement3d.fromJSON(props.placement);
362
+ if (props.typeDefinition)
363
+ this.typeDefinition = core_common_1.TypeDefinition.fromJSON(props.typeDefinition);
364
+ }
365
+ /** @internal */
366
+ static get className() { return "GeometricElement3d"; }
367
+ /** @internal */
368
+ toJSON() {
369
+ const val = super.toJSON();
370
+ val.placement = this.placement;
371
+ if (undefined !== this.typeDefinition)
372
+ val.typeDefinition = this.typeDefinition;
373
+ return val;
374
+ }
375
+ /** @internal */
376
+ collectReferenceConcreteIds(referenceIds) {
377
+ super.collectReferenceConcreteIds(referenceIds);
378
+ if (undefined !== this.typeDefinition)
379
+ referenceIds.addElement(this.typeDefinition.id);
380
+ }
381
+ }
382
+ exports.GeometricElement3d = GeometricElement3d;
383
+ /** A 3d Graphical Element
384
+ * @public
385
+ */
386
+ class GraphicalElement3d extends GeometricElement3d {
387
+ /** @internal */
388
+ static get className() { return "GraphicalElement3d"; }
389
+ /** @internal */
390
+ constructor(props, iModel) { super(props, iModel); }
391
+ }
392
+ exports.GraphicalElement3d = GraphicalElement3d;
393
+ /** An abstract base class to model information entities that intrinsically have 2d geometry.
394
+ * @public
395
+ */
396
+ class GeometricElement2d extends GeometricElement {
397
+ /** @internal */
398
+ constructor(props, iModel) {
399
+ super(props, iModel);
400
+ this.placement = core_common_1.Placement2d.fromJSON(props.placement);
401
+ if (props.typeDefinition)
402
+ this.typeDefinition = core_common_1.TypeDefinition.fromJSON(props.typeDefinition);
403
+ }
404
+ /** @internal */
405
+ static get className() { return "GeometricElement2d"; }
406
+ /** @internal */
407
+ toJSON() {
408
+ const val = super.toJSON();
409
+ val.placement = this.placement;
410
+ if (undefined !== this.typeDefinition)
411
+ val.typeDefinition = this.typeDefinition;
412
+ return val;
413
+ }
414
+ /** @internal */
415
+ collectReferenceConcreteIds(referenceIds) {
416
+ super.collectReferenceConcreteIds(referenceIds);
417
+ if (undefined !== this.typeDefinition)
418
+ referenceIds.addElement(this.typeDefinition.id);
419
+ }
420
+ }
421
+ exports.GeometricElement2d = GeometricElement2d;
422
+ /** An abstract base class for 2d Geometric Elements that are used to convey information within graphical presentations (like drawings).
423
+ * @public
424
+ */
425
+ class GraphicalElement2d extends GeometricElement2d {
426
+ /** @internal */
427
+ static get className() { return "GraphicalElement2d"; }
428
+ /** @internal */
429
+ constructor(props, iModel) { super(props, iModel); }
430
+ }
431
+ exports.GraphicalElement2d = GraphicalElement2d;
432
+ /** 2d element used to annotate drawings and sheets.
433
+ * @public
434
+ */
435
+ class AnnotationElement2d extends GraphicalElement2d {
436
+ /** @internal */
437
+ static get className() { return "AnnotationElement2d"; }
438
+ /** @internal */
439
+ constructor(props, iModel) { super(props, iModel); }
440
+ }
441
+ exports.AnnotationElement2d = AnnotationElement2d;
442
+ /** 2d element used to persist graphics for use in drawings.
443
+ * @public
444
+ */
445
+ class DrawingGraphic extends GraphicalElement2d {
446
+ /** @internal */
447
+ static get className() { return "DrawingGraphic"; }
448
+ /** @internal */
449
+ constructor(props, iModel) { super(props, iModel); }
450
+ }
451
+ exports.DrawingGraphic = DrawingGraphic;
452
+ /** 2D Text Annotation
453
+ * @public
454
+ */
455
+ class TextAnnotation2d extends AnnotationElement2d {
456
+ /** @internal */
457
+ static get className() { return "TextAnnotation2d"; }
458
+ /** @internal */
459
+ constructor(props, iModel) { super(props, iModel); }
460
+ }
461
+ exports.TextAnnotation2d = TextAnnotation2d;
462
+ /** 3D Text Annotation
463
+ * @public
464
+ */
465
+ class TextAnnotation3d extends GraphicalElement3d {
466
+ /** @internal */
467
+ static get className() { return "TextAnnotation3d"; }
468
+ /** @internal */
469
+ constructor(props, iModel) { super(props, iModel); }
470
+ }
471
+ exports.TextAnnotation3d = TextAnnotation3d;
472
+ /** An Element that occupies real world space. Its coordinates are in the project space of its iModel.
473
+ * @public
474
+ */
475
+ class SpatialElement extends GeometricElement3d {
476
+ /** @internal */
477
+ static get className() { return "SpatialElement"; }
478
+ /** @internal */
479
+ constructor(props, iModel) { super(props, iModel); }
480
+ }
481
+ exports.SpatialElement = SpatialElement;
482
+ /** An Element that is spatially located, has mass, and can be *touched*.
483
+ * @public
484
+ */
485
+ class PhysicalElement extends SpatialElement {
486
+ /** @internal */
487
+ constructor(props, iModel) {
488
+ super(props, iModel);
489
+ this.physicalMaterial = core_common_1.RelatedElement.fromJSON(props.physicalMaterial);
490
+ }
491
+ /** @internal */
492
+ static get className() { return "PhysicalElement"; }
493
+ /** @internal */
494
+ toJSON() {
495
+ var _c;
496
+ const val = super.toJSON();
497
+ val.physicalMaterial = (_c = this.physicalMaterial) === null || _c === void 0 ? void 0 : _c.toJSON();
498
+ return val;
499
+ }
500
+ }
501
+ exports.PhysicalElement = PhysicalElement;
502
+ /** Identifies a *tracked* real world location but has no mass and cannot be *touched*.
503
+ * @public
504
+ */
505
+ class SpatialLocationElement extends SpatialElement {
506
+ /** @internal */
507
+ static get className() { return "SpatialLocationElement"; }
508
+ /** @internal */
509
+ constructor(props, iModel) { super(props, iModel); }
510
+ }
511
+ exports.SpatialLocationElement = SpatialLocationElement;
512
+ /** A Volume Element is a Spatial Location Element that is restricted to defining a volume.
513
+ * @public
514
+ */
515
+ class VolumeElement extends SpatialLocationElement {
516
+ /** @internal */
517
+ static get className() { return "VolumeElement"; }
518
+ /** @internal */
519
+ constructor(props, iModel) { super(props, iModel); }
520
+ }
521
+ exports.VolumeElement = VolumeElement;
522
+ /** A SectionDrawingLocation element identifies the location of a [[SectionDrawing]] in the context of a [[SpatialModel]],
523
+ * enabling [HyperModeling]($hypermodeling).
524
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.11.
525
+ * @public
526
+ */
527
+ class SectionDrawingLocation extends SpatialLocationElement {
528
+ constructor(props, iModel) {
529
+ var _c;
530
+ super(props, iModel);
531
+ this.sectionView = (_c = core_common_1.RelatedElement.fromJSON(props.sectionView)) !== null && _c !== void 0 ? _c : core_common_1.RelatedElement.none;
532
+ }
533
+ /** @internal */
534
+ static get className() { return "SectionDrawingLocation"; }
535
+ /** @internal */
536
+ toJSON() {
537
+ return {
538
+ ...super.toJSON(),
539
+ sectionView: this.sectionView.toJSON(),
540
+ };
541
+ }
542
+ }
543
+ exports.SectionDrawingLocation = SectionDrawingLocation;
544
+ /** Information Content Element is an abstract base class for modeling pure information entities. Only the
545
+ * core framework should directly subclass from Information Content Element. Domain and application developers
546
+ * should start with the most appropriate subclass of Information Content Element.
547
+ * @public
548
+ */
549
+ class InformationContentElement extends Element {
550
+ /** @internal */
551
+ static get className() { return "InformationContentElement"; }
552
+ /** @internal */
553
+ constructor(props, iModel) { super(props, iModel); }
554
+ }
555
+ exports.InformationContentElement = InformationContentElement;
556
+ /** Element used in conjunction with bis:ElementDrivesElement relationships to bundle multiple inputs before
557
+ * driving the output element.
558
+ * @beta
559
+ */
560
+ class DriverBundleElement extends InformationContentElement {
561
+ /** @internal */
562
+ static get className() { return "DriverBundleElement"; }
563
+ /** @internal */
564
+ constructor(props, iModel) { super(props, iModel); }
565
+ }
566
+ exports.DriverBundleElement = DriverBundleElement;
567
+ /** Information Reference is an abstract base class for modeling entities whose main purpose is to reference something else.
568
+ * @public
569
+ */
570
+ class InformationReferenceElement extends InformationContentElement {
571
+ /** @internal */
572
+ static get className() { return "InformationReferenceElement"; }
573
+ /** @internal */
574
+ constructor(props, iModel) { super(props, iModel); }
575
+ }
576
+ exports.InformationReferenceElement = InformationReferenceElement;
577
+ /** A Subject is an information element that describes what this repository (or part thereof) is about.
578
+ * See [how to create a Subject element]$(docs/learning/backend/CreateElements.md#Subject).
579
+ * @public
580
+ */
581
+ class Subject extends InformationReferenceElement {
582
+ /** @internal */
583
+ constructor(props, iModel) { super(props, iModel); }
584
+ /** @internal */
585
+ static get className() { return "Subject"; }
586
+ /** @internal */
587
+ toJSON() {
588
+ return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
589
+ }
590
+ /** Create a Code for a Subject given a name that is meant to be unique within the scope of its parent Subject.
591
+ * @param iModelDb The IModelDb
592
+ * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child Subjects.
593
+ * @param codeValue The child Subject name
594
+ */
595
+ static createCode(iModelDb, parentSubjectId, codeValue) {
596
+ const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.subject);
597
+ return new core_common_1.Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });
598
+ }
599
+ /** Create a Subject
600
+ * @param iModelDb The IModelDb
601
+ * @param parentSubjectId The new Subject will be a child of this Subject
602
+ * @param name The name (codeValue) of the Subject
603
+ * @param description The optional description of the Subject
604
+ * @returns The newly constructed Subject
605
+ * @throws [[IModelError]] if there is a problem creating the Subject
606
+ */
607
+ static create(iModelDb, parentSubjectId, name, description) {
608
+ const subjectProps = {
609
+ classFullName: this.classFullName,
610
+ model: core_common_1.IModel.repositoryModelId,
611
+ parent: new NavigationRelationship_1.SubjectOwnsSubjects(parentSubjectId),
612
+ code: this.createCode(iModelDb, parentSubjectId, name),
613
+ description,
614
+ };
615
+ return new Subject(subjectProps, iModelDb);
616
+ }
617
+ /** Insert a Subject
618
+ * @param iModelDb Insert into this IModelDb
619
+ * @param parentSubjectId The new Subject will be inserted as a child of this Subject
620
+ * @param name The name (codeValue) of the Subject
621
+ * @param description The optional description of the Subject
622
+ * @returns The Id of the newly inserted Subject
623
+ * @throws [[IModelError]] if there is a problem inserting the Subject
624
+ */
625
+ static insert(iModelDb, parentSubjectId, name, description) {
626
+ const subject = this.create(iModelDb, parentSubjectId, name, description);
627
+ return iModelDb.elements.insertElement(subject.toJSON());
628
+ }
629
+ }
630
+ exports.Subject = Subject;
631
+ /** An InformationContentElement that identifies the content of a document.
632
+ * The realized form of a document is called a DocumentCarrier (different class than Document).
633
+ * For example, a will is a legal document. The will published into a PDF file is an ElectronicDocumentCopy.
634
+ * The will printed onto paper is a PrintedDocumentCopy.
635
+ * In this example, the Document only identifies, names, and tracks the content of the will.
636
+ * @public
637
+ */
638
+ class Document extends InformationContentElement {
639
+ /** @internal */
640
+ static get className() { return "Document"; }
641
+ /** @internal */
642
+ constructor(props, iModel) { super(props, iModel); }
643
+ }
644
+ exports.Document = Document;
645
+ /** A document that represents a drawing, that is, a two-dimensional graphical representation of engineering data. A Drawing element is usually modelled by a [[DrawingModel]].
646
+ * @public
647
+ */
648
+ class Drawing extends Document {
649
+ /** @internal */
650
+ static get className() { return "Drawing"; }
651
+ /** @internal */
652
+ constructor(props, iModel) { super(props, iModel); }
653
+ /** Create a Code for a Drawing given a name that is meant to be unique within the scope of the specified DocumentListModel.
654
+ * @param iModel The IModelDb
655
+ * @param scopeModelId The Id of the DocumentListModel that contains the Drawing and provides the scope for its name.
656
+ * @param codeValue The Drawing name
657
+ */
658
+ static createCode(iModel, scopeModelId, codeValue) {
659
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.drawing);
660
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
661
+ }
662
+ /** Insert a Drawing element and a DrawingModel that breaks it down.
663
+ * @param iModelDb Insert into this iModel
664
+ * @param documentListModelId Insert the new Drawing into this DocumentListModel
665
+ * @param name The name of the Drawing.
666
+ * @returns The Id of the newly inserted Drawing element and the DrawingModel that breaks it down (same value).
667
+ * @throws [[IModelError]] if unable to insert the element.
668
+ */
669
+ static insert(iModelDb, documentListModelId, name) {
670
+ const drawingProps = {
671
+ classFullName: this.classFullName,
672
+ model: documentListModelId,
673
+ code: this.createCode(iModelDb, documentListModelId, name),
674
+ };
675
+ const drawingId = iModelDb.elements.insertElement(drawingProps);
676
+ const model = iModelDb.models.createModel({
677
+ classFullName: Model_1.DrawingModel.classFullName,
678
+ modeledElement: { id: drawingId },
679
+ });
680
+ return iModelDb.models.insertModel(model.toJSON());
681
+ }
682
+ }
683
+ exports.Drawing = Drawing;
684
+ /** A document that represents a section drawing, that is, a graphical documentation derived from a planar
685
+ * section of a spatial view. A SectionDrawing element is modelled by a [[SectionDrawingModel]] or a [[GraphicalModel3d]].
686
+ * A [[SectionDrawingLocation]] can associate the drawing with a spatial location, enabling [HyperModeling]($hypermodeling).
687
+ * @public
688
+ */
689
+ class SectionDrawing extends Drawing {
690
+ /** @internal */
691
+ constructor(props, iModel) {
692
+ var _c, _d;
693
+ super(props, iModel);
694
+ this.sectionType = core_bentley_1.JsonUtils.asInt(props.sectionType, core_common_1.SectionType.Section);
695
+ this.spatialView = (_c = core_common_1.RelatedElement.fromJSON(props.spatialView)) !== null && _c !== void 0 ? _c : core_common_1.RelatedElement.none;
696
+ this.displaySpatialView = core_bentley_1.JsonUtils.asBool((_d = props.jsonProperties) === null || _d === void 0 ? void 0 : _d.displaySpatialView);
697
+ const json = props.jsonProperties;
698
+ if (!json)
699
+ return;
700
+ if (json.drawingToSpatialTransform)
701
+ this.drawingToSpatialTransform = core_geometry_1.Transform.fromJSON(json.drawingToSpatialTransform);
702
+ if (json.sheetToSpatialTransform)
703
+ this.sheetToSpatialTransform = core_geometry_1.Transform.fromJSON(json.sheetToSpatialTransform);
704
+ if (json.drawingBoundaryClip)
705
+ this.drawingBoundaryClip = core_geometry_1.ClipVector.fromJSON(json.drawingBoundaryClip);
706
+ }
707
+ /** @internal */
708
+ static get className() { return "SectionDrawing"; }
709
+ /** Convert to JSON representation. */
710
+ toJSON() {
711
+ var _c, _d, _e;
712
+ const props = {
713
+ ...super.toJSON(),
714
+ sectionType: this.sectionType,
715
+ spatialView: this.spatialView.toJSON(),
716
+ };
717
+ if (!props.jsonProperties)
718
+ props.jsonProperties = {};
719
+ props.jsonProperties.displaySpatialView = this.displaySpatialView ? true : undefined;
720
+ props.jsonProperties.drawingToSpatialTransform = (_c = this.drawingToSpatialTransform) === null || _c === void 0 ? void 0 : _c.toJSON();
721
+ props.jsonProperties.sheetToSpatialTransform = (_d = this.sheetToSpatialTransform) === null || _d === void 0 ? void 0 : _d.toJSON();
722
+ props.jsonProperties.drawingBoundaryClip = (_e = this.drawingBoundaryClip) === null || _e === void 0 ? void 0 : _e.toJSON();
723
+ return props;
724
+ }
725
+ }
726
+ exports.SectionDrawing = SectionDrawing;
727
+ /** The template for a SheetBorder
728
+ * @public
729
+ */
730
+ class SheetBorderTemplate extends Document {
731
+ /** @internal */
732
+ constructor(props, iModel) { super(props, iModel); }
733
+ /** @internal */
734
+ static get className() { return "SheetBorderTemplate"; }
735
+ }
736
+ exports.SheetBorderTemplate = SheetBorderTemplate;
737
+ /** The template for a [[Sheet]]
738
+ * @public
739
+ */
740
+ class SheetTemplate extends Document {
741
+ /** @internal */
742
+ constructor(props, iModel) { super(props, iModel); }
743
+ /** @internal */
744
+ static get className() { return "SheetTemplate"; }
745
+ /** @internal */
746
+ collectReferenceConcreteIds(referenceIds) {
747
+ super.collectReferenceConcreteIds(referenceIds);
748
+ if (undefined !== this.border)
749
+ referenceIds.addElement(this.border);
750
+ }
751
+ }
752
+ exports.SheetTemplate = SheetTemplate;
753
+ /** A digital representation of a *sheet of paper*. Modeled by a [[SheetModel]].
754
+ * @public
755
+ */
756
+ class Sheet extends Document {
757
+ /** @internal */
758
+ constructor(props, iModel) {
759
+ super(props, iModel);
760
+ this.height = core_bentley_1.JsonUtils.asDouble(props.height);
761
+ this.width = core_bentley_1.JsonUtils.asDouble(props.width);
762
+ this.scale = props.scale;
763
+ this.sheetTemplate = props.sheetTemplate ? core_bentley_1.Id64.fromJSON(props.sheetTemplate) : undefined;
764
+ }
765
+ /** @internal */
766
+ static get className() { return "Sheet"; }
767
+ /** @internal */
768
+ collectReferenceConcreteIds(referenceIds) {
769
+ super.collectReferenceConcreteIds(referenceIds);
770
+ if (undefined !== this.sheetTemplate)
771
+ referenceIds.addElement(this.sheetTemplate);
772
+ }
773
+ /** Create a Code for a Sheet given a name that is meant to be unique within the scope of the specified DocumentListModel.
774
+ * @param iModel The IModelDb
775
+ * @param scopeModelId The Id of the DocumentListModel that contains the Sheet and provides the scope for its name.
776
+ * @param codeValue The Sheet name
777
+ */
778
+ static createCode(iModel, scopeModelId, codeValue) {
779
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.sheet);
780
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
781
+ }
782
+ }
783
+ exports.Sheet = Sheet;
784
+ /** Information Record Element is an abstract base class for modeling information records. Information Record
785
+ * Element is the default choice if no other subclass of Information Content Element makes sense.
786
+ * @public
787
+ */
788
+ class InformationRecordElement extends InformationContentElement {
789
+ /** @internal */
790
+ static get className() { return "InformationRecordElement"; }
791
+ /** @internal */
792
+ constructor(props, iModel) { super(props, iModel); }
793
+ }
794
+ exports.InformationRecordElement = InformationRecordElement;
795
+ /** A Definition Element holds configuration-related information that is meant to be referenced / shared.
796
+ * @public
797
+ */
798
+ class DefinitionElement extends InformationContentElement {
799
+ /** @internal */
800
+ constructor(props, iModel) {
801
+ super(props, iModel);
802
+ this.isPrivate = true === props.isPrivate;
803
+ }
804
+ /** @internal */
805
+ static get className() { return "DefinitionElement"; }
806
+ /** @internal */
807
+ toJSON() {
808
+ const val = super.toJSON();
809
+ val.isPrivate = this.isPrivate;
810
+ return val;
811
+ }
812
+ }
813
+ exports.DefinitionElement = DefinitionElement;
814
+ /** This abstract class unifies DefinitionGroup and DefinitionContainer for relationship endpoint purposes.
815
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.10
816
+ * @public
817
+ */
818
+ class DefinitionSet extends DefinitionElement {
819
+ /** @internal */
820
+ static get className() { return "DefinitionSet"; }
821
+ }
822
+ exports.DefinitionSet = DefinitionSet;
823
+ /** A DefinitionContainer exclusively owns a set of DefinitionElements contained within its sub-model (of type DefinitionModel).
824
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.10
825
+ * @public
826
+ */
827
+ class DefinitionContainer extends DefinitionSet {
828
+ /** @internal */
829
+ static get className() { return "DefinitionContainer"; }
830
+ /** Create a DefinitionContainer
831
+ * @param iModelDb The IModelDb
832
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.
833
+ * @param code The Code for this DefinitionContainer.
834
+ * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.
835
+ * @returns The newly constructed DefinitionContainer
836
+ * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.
837
+ * @throws [[IModelError]] if there is a problem creating the DefinitionContainer
838
+ */
839
+ static create(iModelDb, definitionModelId, code, isPrivate) {
840
+ const elementProps = {
841
+ classFullName: this.classFullName,
842
+ model: definitionModelId,
843
+ code,
844
+ isPrivate,
845
+ };
846
+ return new DefinitionContainer(elementProps, iModelDb);
847
+ }
848
+ /** Insert a DefinitionContainer and its sub-model.
849
+ * @param iModelDb Insert into this IModelDb
850
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.
851
+ * @param code The Code for this DefinitionContainer.
852
+ * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.
853
+ * @returns The Id of the newly inserted DefinitionContainer and its newly inserted sub-model (of type DefinitionModel).
854
+ * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.
855
+ * @throws [[IModelError]] if there is a problem inserting the DefinitionContainer
856
+ */
857
+ static insert(iModelDb, definitionModelId, code, isPrivate) {
858
+ const containerElement = this.create(iModelDb, definitionModelId, code, isPrivate);
859
+ const containerElementId = iModelDb.elements.insertElement(containerElement.toJSON());
860
+ const containerSubModelProps = {
861
+ classFullName: Model_1.DefinitionModel.classFullName,
862
+ modeledElement: { id: containerElementId },
863
+ isPrivate,
864
+ };
865
+ iModelDb.models.insertModel(containerSubModelProps);
866
+ return containerElementId;
867
+ }
868
+ }
869
+ exports.DefinitionContainer = DefinitionContainer;
870
+ /** A non-exclusive set of DefinitionElements grouped using the DefinitionGroupGroupsDefinitions relationship.
871
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.10
872
+ * @public
873
+ */
874
+ class DefinitionGroup extends DefinitionSet {
875
+ /** @internal */
876
+ static get className() { return "DefinitionGroup"; }
877
+ /** Create a DefinitionGroup
878
+ * @param iModelDb The IModelDb
879
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionGroup element.
880
+ * @param code The Code for this DefinitionGroup
881
+ * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.
882
+ * @returns The newly constructed DefinitionGroup
883
+ * @note There is not a predefined CodeSpec for DefinitionGroup elements, so it is the responsibility of the domain or application to create one.
884
+ * @throws [[IModelError]] if there is a problem creating the DefinitionGroup
885
+ */
886
+ static create(iModelDb, definitionModelId, code, isPrivate) {
887
+ const elementProps = {
888
+ classFullName: this.classFullName,
889
+ model: definitionModelId,
890
+ code,
891
+ isPrivate,
892
+ };
893
+ return new DefinitionGroup(elementProps, iModelDb);
894
+ }
895
+ }
896
+ exports.DefinitionGroup = DefinitionGroup;
897
+ /** Defines a set of properties (the *type*) that may be associated with an element.
898
+ * @public
899
+ */
900
+ class TypeDefinitionElement extends DefinitionElement {
901
+ /** @internal */
902
+ constructor(props, iModel) { super(props, iModel); }
903
+ /** @internal */
904
+ static get className() { return "TypeDefinitionElement"; }
905
+ /** @internal */
906
+ collectReferenceConcreteIds(referenceIds) {
907
+ super.collectReferenceConcreteIds(referenceIds);
908
+ if (undefined !== this.recipe)
909
+ referenceIds.addElement(this.recipe.id);
910
+ }
911
+ }
912
+ exports.TypeDefinitionElement = TypeDefinitionElement;
913
+ /** Defines a recipe for generating instances from a definition.
914
+ * @beta
915
+ */
916
+ class RecipeDefinitionElement extends DefinitionElement {
917
+ /** @internal */
918
+ static get className() { return "RecipeDefinitionElement"; }
919
+ /** @internal */
920
+ constructor(props, iModel) { super(props, iModel); }
921
+ }
922
+ exports.RecipeDefinitionElement = RecipeDefinitionElement;
923
+ /** Defines a set of properties (the *type*) that can be associated with a Physical Element. A Physical
924
+ * Type has a strong correlation with something that can be ordered from a catalog since all instances
925
+ * share a common set of properties.
926
+ * @public
927
+ */
928
+ class PhysicalType extends TypeDefinitionElement {
929
+ /** @internal */
930
+ constructor(props, iModel) {
931
+ super(props, iModel);
932
+ this.physicalMaterial = core_common_1.RelatedElement.fromJSON(props.physicalMaterial);
933
+ }
934
+ /** @internal */
935
+ static get className() { return "PhysicalType"; }
936
+ /** @internal */
937
+ toJSON() {
938
+ var _c;
939
+ const val = super.toJSON();
940
+ val.physicalMaterial = (_c = this.physicalMaterial) === null || _c === void 0 ? void 0 : _c.toJSON();
941
+ return val;
942
+ }
943
+ /** Create a Code for a PhysicalType element given a name that is meant to be unique within the scope of the specified DefinitionModel.
944
+ * @param iModel The IModelDb
945
+ * @param scopeModelId The Id of the DefinitionModel that contains the PhysicalType element and provides the scope for its name.
946
+ * @param codeValue The PhysicalType name
947
+ */
948
+ static createCode(iModel, scopeModelId, codeValue) {
949
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.physicalType);
950
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
951
+ }
952
+ }
953
+ exports.PhysicalType = PhysicalType;
954
+ /** Defines a set of properties (the *type*) that can be associated with a spatial location.
955
+ * @public
956
+ */
957
+ class SpatialLocationType extends TypeDefinitionElement {
958
+ /** @internal */
959
+ static get className() { return "SpatialLocationType"; }
960
+ /** @internal */
961
+ constructor(props, iModel) { super(props, iModel); }
962
+ /** Create a Code for a SpatialLocationType element given a name that is meant to be unique within the scope of the specified DefinitionModel.
963
+ * @param iModel The IModelDb
964
+ * @param scopeModelId The Id of the DefinitionModel that contains the SpatialLocationType element and provides the scope for its name.
965
+ * @param codeValue The SpatialLocationType name
966
+ */
967
+ static createCode(iModel, scopeModelId, codeValue) {
968
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.spatialLocationType);
969
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
970
+ }
971
+ }
972
+ exports.SpatialLocationType = SpatialLocationType;
973
+ /** A TemplateRecipe3d is a DefinitionElement that has a sub-model that contains the 3d template elements.
974
+ * @beta
975
+ */
976
+ class TemplateRecipe3d extends RecipeDefinitionElement {
977
+ /** @internal */
978
+ static get className() { return "TemplateRecipe3d"; }
979
+ /** @internal */
980
+ constructor(props, iModel) { super(props, iModel); }
981
+ /** Create a Code for a TemplateRecipe3d given a name that is meant to be unique within the scope of its Model.
982
+ * @param iModelDb The IModelDb
983
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.
984
+ * @param codeValue The name of the TemplateRecipe3d element.
985
+ */
986
+ static createCode(iModelDb, definitionModelId, codeValue) {
987
+ const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.templateRecipe3d);
988
+ return new core_common_1.Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });
989
+ }
990
+ /** Create a TemplateRecipe3d
991
+ * @param iModelDb The IModelDb
992
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.
993
+ * @param name The name (Code.value) of the TemplateRecipe3d
994
+ * @returns The newly constructed TemplateRecipe3d
995
+ * @throws [[IModelError]] if there is a problem creating the TemplateRecipe3d
996
+ */
997
+ static create(iModelDb, definitionModelId, name, isPrivate) {
998
+ const elementProps = {
999
+ classFullName: this.classFullName,
1000
+ model: definitionModelId,
1001
+ code: this.createCode(iModelDb, definitionModelId, name),
1002
+ isPrivate,
1003
+ };
1004
+ return new TemplateRecipe3d(elementProps, iModelDb);
1005
+ }
1006
+ /** Insert a TemplateRecipe3d and a PhysicalModel (sub-model) that will contain the 3d template elements.
1007
+ * @param iModelDb The IModelDb
1008
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.
1009
+ * @param name The name (Code.value) of the TemplateRecipe3d
1010
+ * @returns The Id of the newly inserted TemplateRecipe3d and the PhysicalModel that sub-models it.
1011
+ * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe3d or its sub-model.
1012
+ */
1013
+ static insert(iModelDb, definitionModelId, name, isPrivate) {
1014
+ const element = this.create(iModelDb, definitionModelId, name, isPrivate);
1015
+ const modeledElementId = iModelDb.elements.insertElement(element.toJSON());
1016
+ const modelProps = {
1017
+ classFullName: Model_1.PhysicalModel.classFullName,
1018
+ modeledElement: { id: modeledElementId },
1019
+ isTemplate: true,
1020
+ };
1021
+ return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId
1022
+ }
1023
+ }
1024
+ exports.TemplateRecipe3d = TemplateRecipe3d;
1025
+ /** Defines a set of properties (the *type*) that can be associated with a 2D Graphical Element.
1026
+ * @public
1027
+ */
1028
+ class GraphicalType2d extends TypeDefinitionElement {
1029
+ /** @internal */
1030
+ static get className() { return "GraphicalType2d"; }
1031
+ /** @internal */
1032
+ constructor(props, iModel) { super(props, iModel); }
1033
+ /** Create a Code for a GraphicalType2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
1034
+ * @param iModel The IModelDb
1035
+ * @param scopeModelId The Id of the DefinitionModel that contains the GraphicalType2d element and provides the scope for its name.
1036
+ * @param codeValue The GraphicalType2d name
1037
+ */
1038
+ static createCode(iModel, scopeModelId, codeValue) {
1039
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.graphicalType2d);
1040
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
1041
+ }
1042
+ }
1043
+ exports.GraphicalType2d = GraphicalType2d;
1044
+ /** A recipe that uses a 2D template for creating new instances.
1045
+ * @beta
1046
+ */
1047
+ class TemplateRecipe2d extends RecipeDefinitionElement {
1048
+ /** @internal */
1049
+ static get className() { return "TemplateRecipe2d"; }
1050
+ /** @internal */
1051
+ constructor(props, iModel) { super(props, iModel); }
1052
+ /** Create a Code for a TemplateRecipe2d given a name that is meant to be unique within the scope of its Model.
1053
+ * @param iModelDb The IModelDb
1054
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.
1055
+ * @param codeValue The name of the TemplateRecipe2d element.
1056
+ */
1057
+ static createCode(iModelDb, definitionModelId, codeValue) {
1058
+ const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.templateRecipe2d);
1059
+ return new core_common_1.Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });
1060
+ }
1061
+ /** Create a TemplateRecipe2d
1062
+ * @param iModelDb The IModelDb
1063
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.
1064
+ * @param name The name (Code.value) of the TemplateRecipe2d
1065
+ * @returns The newly constructed TemplateRecipe2d
1066
+ * @throws [[IModelError]] if there is a problem creating the TemplateRecipe2d
1067
+ */
1068
+ static create(iModelDb, definitionModelId, name, isPrivate) {
1069
+ const elementProps = {
1070
+ classFullName: this.classFullName,
1071
+ model: definitionModelId,
1072
+ code: this.createCode(iModelDb, definitionModelId, name),
1073
+ isPrivate,
1074
+ };
1075
+ return new TemplateRecipe2d(elementProps, iModelDb);
1076
+ }
1077
+ /** Insert a TemplateRecipe2d and a DrawingModel (sub-model) that will contain the 2d template elements.
1078
+ * @param iModelDb The IModelDb
1079
+ * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.
1080
+ * @param name The name (Code.value) of the TemplateRecipe2d
1081
+ * @returns The Id of the newly inserted TemplateRecipe2d and the PhysicalModel that sub-models it.
1082
+ * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe2d or its sub-model.
1083
+ */
1084
+ static insert(iModelDb, definitionModelId, name, isPrivate) {
1085
+ const element = this.create(iModelDb, definitionModelId, name, isPrivate);
1086
+ const modeledElementId = iModelDb.elements.insertElement(element.toJSON());
1087
+ const modelProps = {
1088
+ classFullName: Model_1.DrawingModel.classFullName,
1089
+ modeledElement: { id: modeledElementId },
1090
+ isTemplate: true,
1091
+ };
1092
+ return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId
1093
+ }
1094
+ }
1095
+ exports.TemplateRecipe2d = TemplateRecipe2d;
1096
+ /** An abstract base class for elements that establishes a particular modeling perspective for its parent Subject.
1097
+ * Instances are always sub-modeled by a specialization of Model of the appropriate modeling perspective.
1098
+ * @see [iModel Information Hierarchy]($docs/bis/guide/data-organization/top-of-the-world), [[Subject]], [[Model]]
1099
+ * @public
1100
+ */
1101
+ class InformationPartitionElement extends InformationContentElement {
1102
+ /** @internal */
1103
+ constructor(props, iModel) { super(props, iModel); }
1104
+ /** @internal */
1105
+ static get className() { return "InformationPartitionElement"; }
1106
+ /** @internal */
1107
+ toJSON() {
1108
+ return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
1109
+ }
1110
+ /** Create a code that can be used for any subclass of InformationPartitionElement.
1111
+ * @param iModelDb The IModelDb
1112
+ * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child InformationPartitionElements.
1113
+ * @param codeValue The InformationPartitionElement name
1114
+ */
1115
+ static createCode(iModel, parentSubjectId, codeValue) {
1116
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.informationPartitionElement);
1117
+ return new core_common_1.Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });
1118
+ }
1119
+ }
1120
+ exports.InformationPartitionElement = InformationPartitionElement;
1121
+ /** A DefinitionPartition element establishes a *Definition* modeling perspective for its parent Subject.
1122
+ * A DefinitionPartition is always sub-modeled by a DefinitionModel.
1123
+ * @see [[DefinitionModel]]
1124
+ * @public
1125
+ */
1126
+ class DefinitionPartition extends InformationPartitionElement {
1127
+ /** @internal */
1128
+ static get className() { return "DefinitionPartition"; }
1129
+ }
1130
+ exports.DefinitionPartition = DefinitionPartition;
1131
+ /** A DocumentPartition element establishes a *Document* modeling perspective for its parent Subject.
1132
+ * A DocumentPartition is always sub-modeled by a DocumentListModel.
1133
+ * @see [[DocumentListModel]]
1134
+ * @public
1135
+ */
1136
+ class DocumentPartition extends InformationPartitionElement {
1137
+ /** @internal */
1138
+ static get className() { return "DocumentPartition"; }
1139
+ }
1140
+ exports.DocumentPartition = DocumentPartition;
1141
+ /** A GroupInformationPartition element establishes a *Group Information* modeling perspective for its parent Subject.
1142
+ * A GroupInformationPartition is always sub-modeled by a GroupInformationModel.
1143
+ * @see [[GroupInformationModel]]
1144
+ * @public
1145
+ */
1146
+ class GroupInformationPartition extends InformationPartitionElement {
1147
+ /** @internal */
1148
+ static get className() { return "GroupInformationPartition"; }
1149
+ }
1150
+ exports.GroupInformationPartition = GroupInformationPartition;
1151
+ /** A GraphicalPartition3d element establishes a *3D Graphical* modeling perspective for its parent Subject.
1152
+ * A GraphicalPartition3d is always sub-modeled by a GraphicalModel3d.
1153
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.8
1154
+ * @see [[GraphicalModel3d]]
1155
+ * @public
1156
+ */
1157
+ class GraphicalPartition3d extends InformationPartitionElement {
1158
+ /** @internal */
1159
+ static get className() { return "GraphicalPartition3d"; }
1160
+ }
1161
+ exports.GraphicalPartition3d = GraphicalPartition3d;
1162
+ /** An InformationRecordPartition element establishes a *Information Record* modeling perspective for its parent Subject.
1163
+ * A InformationRecordPartition is always sub-modeled by an InformationRecordModel.
1164
+ * @see [[InformationRecordModel]]
1165
+ * @public
1166
+ */
1167
+ class InformationRecordPartition extends InformationPartitionElement {
1168
+ /** @internal */
1169
+ static get className() { return "InformationRecordPartition"; }
1170
+ }
1171
+ exports.InformationRecordPartition = InformationRecordPartition;
1172
+ /** A LinkPartition element establishes a *Link* modeling perspective for its parent Subject. A LinkPartition is always sub-modeled by a LinkModel.
1173
+ * @see [[LinkModel]]
1174
+ * @public
1175
+ */
1176
+ class LinkPartition extends InformationPartitionElement {
1177
+ /** @internal */
1178
+ static get className() { return "LinkPartition"; }
1179
+ }
1180
+ exports.LinkPartition = LinkPartition;
1181
+ /** A PhysicalPartition element establishes a *Physical* modeling perspective for its parent Subject. A PhysicalPartition is always sub-modeled by a PhysicalModel.
1182
+ * @see [[PhysicalModel]]
1183
+ * @public
1184
+ */
1185
+ class PhysicalPartition extends InformationPartitionElement {
1186
+ /** @internal */
1187
+ static get className() { return "PhysicalPartition"; }
1188
+ }
1189
+ exports.PhysicalPartition = PhysicalPartition;
1190
+ /** A SpatialLocationPartition element establishes a *SpatialLocation* modeling perspective for its parent Subject.
1191
+ * A SpatialLocationPartition is always sub-modeled by a SpatialLocationModel.
1192
+ * @see [[SpatialLocationModel]]
1193
+ * @public
1194
+ */
1195
+ class SpatialLocationPartition extends InformationPartitionElement {
1196
+ /** @internal */
1197
+ static get className() { return "SpatialLocationPartition"; }
1198
+ }
1199
+ exports.SpatialLocationPartition = SpatialLocationPartition;
1200
+ /** Group Information is an abstract base class for modeling entities whose main purpose is to reference a group of related elements.
1201
+ * @public
1202
+ */
1203
+ class GroupInformationElement extends InformationReferenceElement {
1204
+ /** @internal */
1205
+ static get className() { return "GroupInformationElement"; }
1206
+ }
1207
+ exports.GroupInformationElement = GroupInformationElement;
1208
+ /** An information element that specifies a link.
1209
+ * @public
1210
+ */
1211
+ class LinkElement extends InformationReferenceElement {
1212
+ /** @internal */
1213
+ static get className() { return "LinkElement"; }
1214
+ /** Create a Code for a LinkElement given a name that is meant to be unique within the scope of the specified Model.
1215
+ * @param iModel The IModelDb
1216
+ * @param scopeModelId The Id of the Model that contains the LinkElement and provides the scope for its name.
1217
+ * @param codeValue The LinkElement name
1218
+ */
1219
+ static createCode(iModel, scopeModelId, codeValue) {
1220
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.linkElement);
1221
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
1222
+ }
1223
+ }
1224
+ exports.LinkElement = LinkElement;
1225
+ /** An information element that specifies a URL link.
1226
+ * @public
1227
+ */
1228
+ class UrlLink extends LinkElement {
1229
+ /** @internal */
1230
+ constructor(props, iModel) {
1231
+ super(props, iModel);
1232
+ this.description = props.description;
1233
+ this.url = props.url;
1234
+ }
1235
+ /** @internal */
1236
+ static get className() { return "UrlLink"; }
1237
+ /** @internal */
1238
+ toJSON() {
1239
+ const val = super.toJSON();
1240
+ val.description = this.description;
1241
+ val.url = this.url;
1242
+ return val;
1243
+ }
1244
+ }
1245
+ exports.UrlLink = UrlLink;
1246
+ /** Represents a folder-like structure that organizes repositories (typically files) in an external system.
1247
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.13
1248
+ * @alpha
1249
+ */
1250
+ class FolderLink extends UrlLink {
1251
+ /** @internal */
1252
+ static get className() { return "FolderLink"; }
1253
+ }
1254
+ exports.FolderLink = FolderLink;
1255
+ /** An information element that links to a repository.
1256
+ * @public
1257
+ */
1258
+ class RepositoryLink extends UrlLink {
1259
+ /** @internal */
1260
+ constructor(props, iModel) {
1261
+ super(props, iModel);
1262
+ this.repositoryGuid = props.repositoryGuid;
1263
+ this.format = props.format;
1264
+ }
1265
+ /** @internal */
1266
+ static get className() { return "RepositoryLink"; }
1267
+ /** @internal */
1268
+ toJSON() {
1269
+ const val = super.toJSON();
1270
+ val.repositoryGuid = this.repositoryGuid;
1271
+ val.format = this.format;
1272
+ return val;
1273
+ }
1274
+ }
1275
+ exports.RepositoryLink = RepositoryLink;
1276
+ /** An information element that links to an embedded file.
1277
+ * @public
1278
+ */
1279
+ class EmbeddedFileLink extends LinkElement {
1280
+ /** @internal */
1281
+ static get className() { return "EmbeddedFileLink"; }
1282
+ }
1283
+ exports.EmbeddedFileLink = EmbeddedFileLink;
1284
+ /** A real world entity is modeled as a Role Element when a set of external circumstances define an important
1285
+ * role (one that is worth tracking) that is not intrinsic to the entity playing the role. For example,
1286
+ * a person can play the role of a teacher or a rock can play the role of a boundary marker.
1287
+ * @public
1288
+ */
1289
+ class RoleElement extends Element {
1290
+ /** @internal */
1291
+ static get className() { return "RoleElement"; }
1292
+ }
1293
+ exports.RoleElement = RoleElement;
1294
+ /** A Definition Element that specifies a collection of geometry that is meant to be reused across Geometric
1295
+ * Element instances. Leveraging Geometry Parts can help reduce file size and improve display performance.
1296
+ * @public
1297
+ */
1298
+ class GeometryPart extends DefinitionElement {
1299
+ /** @internal */
1300
+ constructor(props, iModel) {
1301
+ super(props, iModel);
1302
+ this.geom = props.geom;
1303
+ this.bbox = core_geometry_1.Range3d.fromJSON(props.bbox);
1304
+ }
1305
+ /** @internal */
1306
+ static get className() { return "GeometryPart"; }
1307
+ /** @internal */
1308
+ toJSON() {
1309
+ const val = super.toJSON();
1310
+ val.geom = this.geom;
1311
+ val.bbox = this.bbox;
1312
+ return val;
1313
+ }
1314
+ /** Create a Code for a GeometryPart element given a name that is meant to be unique within the scope of the specified DefinitionModel.
1315
+ * @param iModel The IModelDb
1316
+ * @param scopeModelId The Id of the DefinitionModel that contains the GeometryPart element and provides the scope for its name.
1317
+ * @param codeValue The GeometryPart name
1318
+ * @note GeometryPart elements are not required to be named (have a non-empty Code).
1319
+ */
1320
+ static createCode(iModel, scopeModelId, codeValue) {
1321
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.geometryPart);
1322
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
1323
+ }
1324
+ }
1325
+ exports.GeometryPart = GeometryPart;
1326
+ /** The definition element for a line style
1327
+ * @public
1328
+ */
1329
+ class LineStyle extends DefinitionElement {
1330
+ /** @internal */
1331
+ constructor(props, iModel) { super(props, iModel); }
1332
+ /** @internal */
1333
+ static get className() { return "LineStyle"; }
1334
+ /** Create a Code for a LineStyle definition given a name that is meant to be unique within the scope of the specified model.
1335
+ * @param iModel The IModel
1336
+ * @param scopeModelId The Id of the DefinitionModel that contains the LineStyle and provides the scope for its name.
1337
+ * @param codeValue The name of the LineStyle
1338
+ * @returns A LineStyle Code
1339
+ */
1340
+ static createCode(iModel, scopeModelId, codeValue) {
1341
+ return new core_common_1.Code({ spec: iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.lineStyle).id, scope: scopeModelId, value: codeValue });
1342
+ }
1343
+ }
1344
+ exports.LineStyle = LineStyle;
1345
+ /** Describes how to animate a view of a [[GeometricModel]] to show change over time using a [RenderSchedule.Script]($common).
1346
+ * @note This class was introduced in version 01.00.13 of the BisCore ECSchema. It should only be used with [[IModelDb]]s containing that version or newer.
1347
+ * @public
1348
+ */
1349
+ class RenderTimeline extends InformationRecordElement {
1350
+ /** @internal */
1351
+ constructor(props, iModel) {
1352
+ var _c;
1353
+ super(props, iModel);
1354
+ this.description = (_c = props.description) !== null && _c !== void 0 ? _c : "";
1355
+ this.scriptProps = RenderTimeline.parseScriptProps(props.script);
1356
+ }
1357
+ /** @internal */
1358
+ static get className() { return "RenderTimeline"; }
1359
+ static fromJSON(props, iModel) {
1360
+ return new RenderTimeline(props, iModel);
1361
+ }
1362
+ toJSON() {
1363
+ const props = super.toJSON();
1364
+ if (this.description.length > 0)
1365
+ props.description = this.description;
1366
+ props.script = JSON.stringify(this.scriptProps);
1367
+ return props;
1368
+ }
1369
+ static parseScriptProps(json) {
1370
+ try {
1371
+ return JSON.parse(json);
1372
+ }
1373
+ catch {
1374
+ return [];
1375
+ }
1376
+ }
1377
+ /** @internal */
1378
+ collectReferenceConcreteIds(ids) {
1379
+ super.collectReferenceConcreteIds(ids);
1380
+ const script = core_common_1.RenderSchedule.Script.fromJSON(this.scriptProps);
1381
+ script === null || script === void 0 ? void 0 : script.discloseIds(ids); // eslint-disable-line deprecation/deprecation
1382
+ }
1383
+ /** @alpha */
1384
+ static onCloned(context, sourceProps, targetProps) {
1385
+ super.onCloned(context, sourceProps, targetProps);
1386
+ if (context.isBetweenIModels)
1387
+ targetProps.script = JSON.stringify(this.remapScript(context, this.parseScriptProps(targetProps.script)));
1388
+ }
1389
+ /** Remap Ids when cloning a RenderSchedule.Script between iModels on a DisplayStyle or RenderTimeline.
1390
+ * @internal
1391
+ */
1392
+ static remapScript(context, input) {
1393
+ const scriptProps = [];
1394
+ if (!Array.isArray(input))
1395
+ return scriptProps;
1396
+ const elementIds = new core_bentley_1.OrderedId64Array();
1397
+ for (const model of input) {
1398
+ const modelId = context.findTargetElementId(model.modelId);
1399
+ if (!core_bentley_1.Id64.isValid(modelId))
1400
+ continue;
1401
+ model.modelId = modelId;
1402
+ scriptProps.push(model);
1403
+ for (const element of model.elementTimelines) {
1404
+ elementIds.clear();
1405
+ for (const sourceId of core_common_1.RenderSchedule.ElementTimeline.getElementIds(element.elementIds)) {
1406
+ const targetId = context.findTargetElementId(sourceId);
1407
+ if (core_bentley_1.Id64.isValid(targetId))
1408
+ elementIds.insert(targetId);
1409
+ }
1410
+ element.elementIds = core_bentley_1.CompressedId64Set.compressIds(elementIds);
1411
+ }
1412
+ }
1413
+ return scriptProps;
1414
+ }
1415
+ }
1416
+ exports.RenderTimeline = RenderTimeline;
1417
1417
  //# sourceMappingURL=Element.js.map