@itwin/core-backend 3.5.0-dev.4 → 3.5.0-dev.7

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 (222) 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 +165 -165
  14. package/lib/cjs/BriefcaseManager.js +405 -405
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +153 -153
  17. package/lib/cjs/Category.js +243 -243
  18. package/lib/cjs/Category.js.map +1 -1
  19. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  20. package/lib/cjs/ChangeSummaryManager.js +445 -445
  21. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  22. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  23. package/lib/cjs/ChangedElementsDb.js +165 -165
  24. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  25. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  26. package/lib/cjs/ChangedElementsManager.js +88 -88
  27. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  28. package/lib/cjs/CheckpointManager.d.ts +120 -120
  29. package/lib/cjs/CheckpointManager.js +343 -343
  30. package/lib/cjs/CheckpointManager.js.map +1 -1
  31. package/lib/cjs/ClassRegistry.d.ts +71 -71
  32. package/lib/cjs/ClassRegistry.js +215 -215
  33. package/lib/cjs/ClassRegistry.js.map +1 -1
  34. package/lib/cjs/CloudSqlite.d.ts +349 -349
  35. package/lib/cjs/CloudSqlite.js +151 -151
  36. package/lib/cjs/CloudSqlite.js.map +1 -1
  37. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  38. package/lib/cjs/CloudStorageBackend.js +173 -173
  39. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  40. package/lib/cjs/CodeService.d.ts +396 -396
  41. package/lib/cjs/CodeService.js +63 -63
  42. package/lib/cjs/CodeService.js.map +1 -1
  43. package/lib/cjs/CodeSpecs.d.ts +50 -50
  44. package/lib/cjs/CodeSpecs.js +112 -112
  45. package/lib/cjs/CodeSpecs.js.map +1 -1
  46. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  47. package/lib/cjs/ConcurrentQuery.js +30 -30
  48. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  49. package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
  50. package/lib/cjs/CustomViewState3dCreator.js +113 -113
  51. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  52. package/lib/cjs/DevTools.d.ts +71 -71
  53. package/lib/cjs/DevTools.js +154 -154
  54. package/lib/cjs/DevTools.js.map +1 -1
  55. package/lib/cjs/DisplayStyle.d.ts +106 -106
  56. package/lib/cjs/DisplayStyle.js +256 -256
  57. package/lib/cjs/DisplayStyle.js.map +1 -1
  58. package/lib/cjs/ECDb.d.ts +191 -191
  59. package/lib/cjs/ECDb.js +350 -350
  60. package/lib/cjs/ECDb.js.map +1 -1
  61. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  62. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  63. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  64. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  65. package/lib/cjs/ECSqlStatement.js +791 -791
  66. package/lib/cjs/ECSqlStatement.js.map +1 -1
  67. package/lib/cjs/Element.d.ts +1109 -1109
  68. package/lib/cjs/Element.js +1420 -1420
  69. package/lib/cjs/Element.js.map +1 -1
  70. package/lib/cjs/ElementAspect.d.ts +156 -156
  71. package/lib/cjs/ElementAspect.js +178 -178
  72. package/lib/cjs/ElementAspect.js.map +1 -1
  73. package/lib/cjs/ElementGraphics.d.ts +9 -9
  74. package/lib/cjs/ElementGraphics.js +41 -41
  75. package/lib/cjs/ElementGraphics.js.map +1 -1
  76. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  77. package/lib/cjs/ElementTreeWalker.js +409 -409
  78. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  79. package/lib/cjs/Entity.d.ts +76 -76
  80. package/lib/cjs/Entity.js +82 -82
  81. package/lib/cjs/Entity.js.map +1 -1
  82. package/lib/cjs/ExportGraphics.d.ts +317 -317
  83. package/lib/cjs/ExportGraphics.js +208 -208
  84. package/lib/cjs/ExportGraphics.js.map +1 -1
  85. package/lib/cjs/ExternalSource.d.ts +94 -94
  86. package/lib/cjs/ExternalSource.js +125 -125
  87. package/lib/cjs/ExternalSource.js.map +1 -1
  88. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  89. package/lib/cjs/GeoCoordConfig.js +82 -82
  90. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  91. package/lib/cjs/GeometrySummary.d.ts +4 -4
  92. package/lib/cjs/GeometrySummary.js +380 -380
  93. package/lib/cjs/GeometrySummary.js.map +1 -1
  94. package/lib/cjs/HubMock.d.ts +93 -93
  95. package/lib/cjs/HubMock.js +190 -190
  96. package/lib/cjs/HubMock.js.map +1 -1
  97. package/lib/cjs/IModelCloneContext.d.ts +85 -85
  98. package/lib/cjs/IModelCloneContext.js +150 -150
  99. package/lib/cjs/IModelCloneContext.js.map +1 -1
  100. package/lib/cjs/IModelDb.d.ts +1164 -1164
  101. package/lib/cjs/IModelDb.js +2324 -2324
  102. package/lib/cjs/IModelDb.js.map +1 -1
  103. package/lib/cjs/IModelHost.d.ts +361 -361
  104. package/lib/cjs/IModelHost.js +489 -489
  105. package/lib/cjs/IModelHost.js.map +1 -1
  106. package/lib/cjs/IModelJsFs.d.ts +62 -62
  107. package/lib/cjs/IModelJsFs.js +140 -140
  108. package/lib/cjs/IModelJsFs.js.map +1 -1
  109. package/lib/cjs/IpcHost.d.ts +98 -98
  110. package/lib/cjs/IpcHost.js +234 -234
  111. package/lib/cjs/IpcHost.js.map +1 -1
  112. package/lib/cjs/LineStyle.d.ts +311 -311
  113. package/lib/cjs/LineStyle.js +295 -295
  114. package/lib/cjs/LineStyle.js.map +1 -1
  115. package/lib/cjs/LocalHub.d.ts +162 -162
  116. package/lib/cjs/LocalHub.js +587 -587
  117. package/lib/cjs/LocalHub.js.map +1 -1
  118. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  119. package/lib/cjs/LocalhostIpcHost.js +81 -81
  120. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  121. package/lib/cjs/Material.d.ts +103 -103
  122. package/lib/cjs/Material.js +147 -147
  123. package/lib/cjs/Material.js.map +1 -1
  124. package/lib/cjs/Model.d.ts +386 -386
  125. package/lib/cjs/Model.js +471 -471
  126. package/lib/cjs/Model.js.map +1 -1
  127. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  128. package/lib/cjs/NativeAppStorage.js +202 -202
  129. package/lib/cjs/NativeAppStorage.js.map +1 -1
  130. package/lib/cjs/NativeHost.d.ts +52 -52
  131. package/lib/cjs/NativeHost.js +168 -168
  132. package/lib/cjs/NativeHost.js.map +1 -1
  133. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  134. package/lib/cjs/NavigationRelationship.js +225 -225
  135. package/lib/cjs/NavigationRelationship.js.map +1 -1
  136. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  137. package/lib/cjs/PromiseMemoizer.js +101 -101
  138. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  139. package/lib/cjs/PropertyStore.d.ts +132 -132
  140. package/lib/cjs/PropertyStore.js +11 -11
  141. package/lib/cjs/PropertyStore.js.map +1 -1
  142. package/lib/cjs/Relationship.d.ts +400 -400
  143. package/lib/cjs/Relationship.js +465 -465
  144. package/lib/cjs/Relationship.js.map +1 -1
  145. package/lib/cjs/RpcBackend.d.ts +28 -28
  146. package/lib/cjs/RpcBackend.js +126 -126
  147. package/lib/cjs/RpcBackend.js.map +1 -1
  148. package/lib/cjs/SQLiteDb.d.ts +219 -219
  149. package/lib/cjs/SQLiteDb.js +214 -214
  150. package/lib/cjs/SQLiteDb.js.map +1 -1
  151. package/lib/cjs/Schema.d.ts +55 -55
  152. package/lib/cjs/Schema.js +83 -83
  153. package/lib/cjs/Schema.js.map +1 -1
  154. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  155. package/lib/cjs/ServerBasedLocks.js +168 -168
  156. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  157. package/lib/cjs/SqliteStatement.d.ts +283 -283
  158. package/lib/cjs/SqliteStatement.js +448 -448
  159. package/lib/cjs/SqliteStatement.js.map +1 -1
  160. package/lib/cjs/Texture.d.ts +58 -58
  161. package/lib/cjs/Texture.js +82 -82
  162. package/lib/cjs/Texture.js.map +1 -1
  163. package/lib/cjs/TileStorage.d.ts +18 -18
  164. package/lib/cjs/TileStorage.js +90 -90
  165. package/lib/cjs/TileStorage.js.map +1 -1
  166. package/lib/cjs/TxnManager.d.ts +202 -202
  167. package/lib/cjs/TxnManager.js +356 -356
  168. package/lib/cjs/TxnManager.js.map +1 -1
  169. package/lib/cjs/ViewDefinition.d.ts +435 -435
  170. package/lib/cjs/ViewDefinition.js +635 -635
  171. package/lib/cjs/ViewDefinition.js.map +1 -1
  172. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  173. package/lib/cjs/ViewStateHydrator.js +103 -103
  174. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  175. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  176. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  177. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  178. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  179. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  180. package/lib/cjs/core-backend.d.ts +182 -182
  181. package/lib/cjs/core-backend.js +202 -202
  182. package/lib/cjs/core-backend.js.map +1 -1
  183. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  184. package/lib/cjs/domains/FunctionalElements.js +145 -145
  185. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  186. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  187. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  188. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  189. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  190. package/lib/cjs/domains/GenericElements.js +263 -263
  191. package/lib/cjs/domains/GenericElements.js.map +1 -1
  192. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  193. package/lib/cjs/domains/GenericSchema.js +28 -28
  194. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  195. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  196. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  197. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  198. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
  199. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
  200. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  201. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  202. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +204 -204
  203. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  204. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  205. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  206. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  207. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  208. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  209. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  210. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  211. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  212. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  213. package/lib/cjs/workspace/Settings.d.ts +186 -186
  214. package/lib/cjs/workspace/Settings.js +155 -155
  215. package/lib/cjs/workspace/Settings.js.map +1 -1
  216. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  217. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  218. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  219. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  220. package/lib/cjs/workspace/Workspace.js +543 -543
  221. package/lib/cjs/workspace/Workspace.js.map +1 -1
  222. package/package.json +11 -11
package/lib/cjs/Model.js CHANGED
@@ -1,472 +1,472 @@
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 Models
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.WebMercatorModel = exports.DictionaryModel = exports.LinkModel = exports.DocumentListModel = exports.RepositoryModel = exports.DefinitionModel = exports.InformationRecordModel = exports.GroupInformationModel = exports.InformationModel = exports.RoleModel = exports.SheetModel = exports.SectionDrawingModel = exports.DrawingModel = exports.SpatialLocationModel = exports.PhysicalModel = exports.SpatialModel = exports.GraphicalModel3d = exports.GraphicalModel2d = exports.GeometricModel2d = exports.GeometricModel3d = exports.GeometricModel = exports.Model = void 0;
11
- // cspell:ignore elid
12
- const core_bentley_1 = require("@itwin/core-bentley");
13
- const core_geometry_1 = require("@itwin/core-geometry");
14
- const core_common_1 = require("@itwin/core-common");
15
- const Element_1 = require("./Element");
16
- const Entity_1 = require("./Entity");
17
- const NavigationRelationship_1 = require("./NavigationRelationship");
18
- /** A Model is a container for persisting a collection of related elements within an iModel.
19
- * See [[IModelDb.Models]] for how to query and manage the Models in an IModelDb.
20
- * See [Creating models]($docs/learning/backend/CreateModels.md)
21
- * @public
22
- */
23
- class Model extends Entity_1.Entity {
24
- /** @internal */
25
- constructor(props, iModel) {
26
- super(props, iModel);
27
- this.name = props.name ? props.name : ""; // NB this isn't really a property of Model (it's the code.value of the modeled element), but it comes in ModelProps because it's often needed
28
- this.isPrivate = core_bentley_1.JsonUtils.asBool(props.isPrivate);
29
- this.isTemplate = core_bentley_1.JsonUtils.asBool(props.isTemplate);
30
- this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy
31
- }
32
- /** @internal */
33
- static get className() { return "Model"; }
34
- /** @internal */
35
- static get protectedOperations() { return ["onInsert", "onUpdate", "onDelete"]; }
36
- /** Add all properties of a Model to a json object.
37
- * @internal
38
- */
39
- toJSON() {
40
- const val = super.toJSON();
41
- val.name = this.name; // for cloning
42
- return val;
43
- }
44
- /** Called before a new Model is inserted.
45
- * @note throw an exception to disallow the insert
46
- * @note If you override this method, you must call super.
47
- * @note `this` is the class of the Model to be inserted
48
- * @beta
49
- */
50
- static onInsert(arg) {
51
- const { props } = arg;
52
- if (props.parentModel) // inserting requires shared lock on parent, if present
53
- arg.iModel.locks.checkSharedLock(props.parentModel, "parent model", "insert");
54
- }
55
- /** Called after a new Model is inserted.
56
- * @note If you override this method, you must call super.
57
- * @note `this` is the class of the Model that was inserted
58
- * @beta
59
- */
60
- static onInserted(_arg) {
61
- // we don't need to tell LockControl about models being created - their ModeledElement does that
62
- }
63
- /** Called before a Model is updated.
64
- * @note throw an exception to disallow the update
65
- * @note If you override this method, you must call super.
66
- * @note `this` is the class of the Model to be updated
67
- * @beta
68
- */
69
- static onUpdate(arg) {
70
- arg.iModel.locks.checkExclusiveLock(arg.props.id, "model", "update"); // eslint-disable-line @typescript-eslint/no-non-null-assertion
71
- }
72
- /** Called after a Model is updated.
73
- * @note If you override this method, you must call super.
74
- * @note `this` is the class of the Model that was updated.
75
- * @beta
76
- */
77
- static onUpdated(_arg) {
78
- }
79
- /** Called before a Model is deleted.
80
- * @note throw an exception to disallow the delete
81
- * @note If you override this method, you must call super.
82
- * @note `this` is the class of the Model to be deleted
83
- * @beta
84
- */
85
- static onDelete(arg) {
86
- arg.iModel.locks.checkExclusiveLock(arg.id, "model", "delete");
87
- }
88
- /** Called after a Model was deleted.
89
- * @note If you override this method, you must call super.
90
- * @note `this` is the class of the Model that was deleted
91
- * @beta
92
- */
93
- static onDeleted(_arg) { }
94
- /** Called before a prospective Element is to be inserted into an instance of a Model of this class.
95
- * @note throw an exception to disallow the insert
96
- * @note If you override this method, you must call super.
97
- * @note `this` is the class of the Model to hold the element
98
- * @beta
99
- */
100
- static onInsertElement(_arg) { }
101
- /** Called after an Element has been inserted into an instance of a Model of this class.
102
- * @note If you override this method, you must call super.
103
- * @note `this` is the class of the Model holding the element
104
- * @beta
105
- */
106
- static onInsertedElement(_arg) { }
107
- /** Called when an Element in an instance of a Model of this class is about to be updated.
108
- * @note throw an exception to disallow the update
109
- * @note If you override this method, you must call super.
110
- * @note `this` is the class of the Model holding the element
111
- * @beta
112
- */
113
- static onUpdateElement(_arg) { }
114
- /** Called after an Element in an instance of a Model of this class has been updated.
115
- * @note If you override this method, you must call super.
116
- * @note `this` is the class of the Model holding the element
117
- * @beta
118
- */
119
- static onUpdatedElement(_arg) { }
120
- /** Called when an Element in an instance of a Model of this class is about to be deleted.
121
- * @note throw an exception to disallow the delete
122
- * @note If you override this method, you must call super.
123
- * @note `this` is the class of the Model holding the element
124
- * @beta
125
- */
126
- static onDeleteElement(_arg) { }
127
- /** Called after an Element in an instance of a Model of this class has been deleted.
128
- * @note If you override this method, you must call super.
129
- * @note `this` is the class of the Model that held the element
130
- * @beta
131
- */
132
- static onDeletedElement(_arg) { }
133
- getAllUserProperties() {
134
- if (!this.jsonProperties.UserProps)
135
- this.jsonProperties.UserProps = new Object();
136
- return this.jsonProperties.UserProps;
137
- }
138
- /** Get a set of JSON user properties by namespace */
139
- getUserProperties(namespace) { return this.getAllUserProperties()[namespace]; }
140
- /** Change a set of user JSON properties of this Element by namespace. */
141
- setUserProperties(nameSpace, value) { this.getAllUserProperties()[nameSpace] = value; }
142
- /** Remove a set of JSON user properties, specified by namespace, from this Element */
143
- removeUserProperties(nameSpace) { delete this.getAllUserProperties()[nameSpace]; }
144
- getJsonProperty(name) { return this.jsonProperties[name]; }
145
- setJsonProperty(name, value) { this.jsonProperties[name] = value; }
146
- /** Insert this Model in the iModel */
147
- insert() { return this.id = this.iModel.models.insertModel(this.toJSON()); }
148
- /** Update this Model in the iModel. */
149
- update() { this.iModel.models.updateModel(this.toJSON()); }
150
- /** Delete this Model from the iModel. */
151
- delete() { this.iModel.models.deleteModel(this.id); }
152
- }
153
- exports.Model = Model;
154
- /** A container for persisting geometric elements.
155
- * @public
156
- */
157
- class GeometricModel extends Model {
158
- /** @internal */
159
- constructor(props, iModel) { super(props, iModel); }
160
- /** @internal */
161
- static get className() { return "GeometricModel"; }
162
- /** Query for the union of the extents of the elements contained by this model. */
163
- queryExtents() {
164
- const extents = this.iModel.nativeDb.queryModelExtents({ id: this.id }).modelExtents;
165
- return core_geometry_1.Range3d.fromJSON(extents);
166
- }
167
- }
168
- exports.GeometricModel = GeometricModel;
169
- /** A container for persisting 3d geometric elements.
170
- * @public
171
- */
172
- class GeometricModel3d extends GeometricModel {
173
- /** @internal */
174
- constructor(props, iModel) {
175
- super(props, iModel);
176
- this.isNotSpatiallyLocated = core_bentley_1.JsonUtils.asBool(props.isNotSpatiallyLocated);
177
- this.isPlanProjection = core_bentley_1.JsonUtils.asBool(props.isPlanProjection);
178
- }
179
- /** If true, then the elements in this GeometricModel3d are in real-world coordinates and will be in the spatial index. */
180
- get isSpatiallyLocated() { return !this.isNotSpatiallyLocated; }
181
- /** @internal */
182
- static get className() { return "GeometricModel3d"; }
183
- /** @internal */
184
- toJSON() {
185
- const val = super.toJSON();
186
- if (this.isNotSpatiallyLocated)
187
- val.isNotSpatiallyLocated = true;
188
- if (this.isPlanProjection)
189
- val.isPlanProjection = true;
190
- return val;
191
- }
192
- }
193
- exports.GeometricModel3d = GeometricModel3d;
194
- /** A container for persisting 2d geometric elements.
195
- * @public
196
- */
197
- class GeometricModel2d extends GeometricModel {
198
- /** @internal */
199
- constructor(props, iModel) { super(props, iModel); }
200
- /** @internal */
201
- static get className() { return "GeometricModel2d"; }
202
- /** @internal */
203
- toJSON() {
204
- const val = super.toJSON();
205
- if (undefined !== this.globalOrigin)
206
- val.globalOrigin = core_geometry_1.Point2d.fromJSON(this.globalOrigin);
207
- return val;
208
- }
209
- }
210
- exports.GeometricModel2d = GeometricModel2d;
211
- /** A container for persisting 2d graphical elements.
212
- * @public
213
- */
214
- class GraphicalModel2d extends GeometricModel2d {
215
- /** @internal */
216
- static get className() { return "GraphicalModel2d"; }
217
- }
218
- exports.GraphicalModel2d = GraphicalModel2d;
219
- /** A container for persisting GraphicalElement3d instances.
220
- * @note The associated ECClass was added to the BisCore schema in version 1.0.8
221
- * @see [[GraphicalPartition3d]]
222
- * @public
223
- */
224
- class GraphicalModel3d extends GeometricModel3d {
225
- /** @internal */
226
- static get className() { return "GraphicalModel3d"; }
227
- }
228
- exports.GraphicalModel3d = GraphicalModel3d;
229
- /** A container for persisting 3d geometric elements that are spatially located.
230
- * @public
231
- */
232
- class SpatialModel extends GeometricModel3d {
233
- /** @internal */
234
- static get className() { return "SpatialModel"; }
235
- }
236
- exports.SpatialModel = SpatialModel;
237
- /** A container for persisting physical elements that model physical space.
238
- * @see [[PhysicalPartition]]
239
- * @public
240
- */
241
- class PhysicalModel extends SpatialModel {
242
- /** @internal */
243
- static get className() { return "PhysicalModel"; }
244
- /** Insert a PhysicalPartition and a PhysicalModel that sub-models it.
245
- * @param iModelDb Insert into this iModel
246
- * @param parentSubjectId The PhysicalPartition will be inserted as a child of this Subject element.
247
- * @param name The name of the PhysicalPartition that the new PhysicalModel will sub-model.
248
- * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.
249
- * @returns The Id of the newly inserted PhysicalPartition and PhysicalModel (same value).
250
- * @throws [[IModelError]] if there is an insert problem.
251
- */
252
- static insert(iModelDb, parentSubjectId, name, isPlanProjection) {
253
- const partitionProps = {
254
- classFullName: Element_1.PhysicalPartition.classFullName,
255
- model: core_common_1.IModel.repositoryModelId,
256
- parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
257
- code: Element_1.PhysicalPartition.createCode(iModelDb, parentSubjectId, name),
258
- };
259
- const partitionId = iModelDb.elements.insertElement(partitionProps);
260
- const modelProps = {
261
- classFullName: this.classFullName,
262
- modeledElement: { id: partitionId },
263
- isPlanProjection,
264
- };
265
- return iModelDb.models.insertModel(modelProps);
266
- }
267
- }
268
- exports.PhysicalModel = PhysicalModel;
269
- /** A container for persisting spatial location elements.
270
- * @see [[SpatialLocationPartition]]
271
- * @public
272
- */
273
- class SpatialLocationModel extends SpatialModel {
274
- /** @internal */
275
- static get className() { return "SpatialLocationModel"; }
276
- /** Insert a SpatialLocationPartition and a SpatialLocationModel that sub-models it.
277
- * @param iModelDb Insert into this iModel
278
- * @param parentSubjectId The SpatialLocationPartition will be inserted as a child of this Subject element.
279
- * @param name The name of the SpatialLocationPartition that the new SpatialLocationModel will sub-model.
280
- * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.
281
- * @returns The Id of the newly inserted SpatialLocationPartition and SpatialLocationModel (same value).
282
- * @throws [[IModelError]] if there is an insert problem.
283
- */
284
- static insert(iModelDb, parentSubjectId, name, isPlanProjection) {
285
- const partitionProps = {
286
- classFullName: Element_1.SpatialLocationPartition.classFullName,
287
- model: core_common_1.IModel.repositoryModelId,
288
- parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
289
- code: Element_1.SpatialLocationPartition.createCode(iModelDb, parentSubjectId, name),
290
- };
291
- const partitionId = iModelDb.elements.insertElement(partitionProps);
292
- const modelProps = {
293
- classFullName: this.classFullName,
294
- modeledElement: { id: partitionId },
295
- isPlanProjection,
296
- };
297
- return iModelDb.models.insertModel(modelProps);
298
- }
299
- }
300
- exports.SpatialLocationModel = SpatialLocationModel;
301
- /** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.
302
- * @public
303
- */
304
- class DrawingModel extends GraphicalModel2d {
305
- /** @internal */
306
- static get className() { return "DrawingModel"; }
307
- }
308
- exports.DrawingModel = DrawingModel;
309
- /** A container for persisting section [[DrawingGraphic]]s.
310
- * @public
311
- */
312
- class SectionDrawingModel extends DrawingModel {
313
- /** @internal */
314
- static get className() { return "SectionDrawingModel"; }
315
- }
316
- exports.SectionDrawingModel = SectionDrawingModel;
317
- /** A container for persisting [[ViewAttachment]]s and [[DrawingGraphic]]s.
318
- * A SheetModel is a digital representation of a *sheet of paper*. SheetModels are 2d models in bounded paper coordinates.
319
- * SheetModels may contain annotation Elements as well as references to 2d or 3d Views.
320
- * @public
321
- */
322
- class SheetModel extends GraphicalModel2d {
323
- /** @internal */
324
- static get className() { return "SheetModel"; }
325
- }
326
- exports.SheetModel = SheetModel;
327
- /** A container for persisting role elements.
328
- * @public
329
- */
330
- class RoleModel extends Model {
331
- /** @internal */
332
- static get className() { return "RoleModel"; }
333
- }
334
- exports.RoleModel = RoleModel;
335
- /** A container for persisting information elements.
336
- * @public
337
- */
338
- class InformationModel extends Model {
339
- /** @internal */
340
- static get className() { return "InformationModel"; }
341
- }
342
- exports.InformationModel = InformationModel;
343
- /** A container for persisting group information elements.
344
- * @see [[GroupInformationPartition]]
345
- * @public
346
- */
347
- class GroupInformationModel extends InformationModel {
348
- /** @internal */
349
- static get className() { return "GroupInformationModel"; }
350
- }
351
- exports.GroupInformationModel = GroupInformationModel;
352
- /** A container for persisting Information Record Elements
353
- * @see [[InformationRecordPartition]]
354
- * @public
355
- */
356
- class InformationRecordModel extends InformationModel {
357
- /** @internal */
358
- static get className() { return "InformationRecordModel"; }
359
- /** Insert a InformationRecordPartition and a InformationRecordModel that sub-models it.
360
- * @param iModelDb Insert into this iModel
361
- * @param parentSubjectId The InformationRecordPartition will be inserted as a child of this Subject element.
362
- * @param name The name of the InformationRecordPartition that the new InformationRecordModel will sub-model.
363
- * @returns The Id of the newly inserted InformationRecordModel.
364
- * @throws [[IModelError]] if there is an insert problem.
365
- */
366
- static insert(iModelDb, parentSubjectId, name) {
367
- const partitionProps = {
368
- classFullName: Element_1.InformationRecordPartition.classFullName,
369
- model: core_common_1.IModel.repositoryModelId,
370
- parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
371
- code: Element_1.InformationRecordPartition.createCode(iModelDb, parentSubjectId, name),
372
- };
373
- const partitionId = iModelDb.elements.insertElement(partitionProps);
374
- return iModelDb.models.insertModel({
375
- classFullName: this.classFullName,
376
- modeledElement: { id: partitionId },
377
- });
378
- }
379
- }
380
- exports.InformationRecordModel = InformationRecordModel;
381
- /** A container for persisting definition elements.
382
- * @see [[DefinitionPartition]]
383
- * @public
384
- */
385
- class DefinitionModel extends InformationModel {
386
- /** @internal */
387
- static get className() { return "DefinitionModel"; }
388
- /** Insert a DefinitionPartition and a DefinitionModel that sub-models it.
389
- * @param iModelDb Insert into this iModel
390
- * @param parentSubjectId The DefinitionPartition will be inserted as a child of this Subject element.
391
- * @param name The name of the DefinitionPartition that the new DefinitionModel will sub-model.
392
- * @returns The Id of the newly inserted DefinitionModel.
393
- * @throws [[IModelError]] if there is an insert problem.
394
- */
395
- static insert(iModelDb, parentSubjectId, name) {
396
- const partitionProps = {
397
- classFullName: Element_1.DefinitionPartition.classFullName,
398
- model: core_common_1.IModel.repositoryModelId,
399
- parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
400
- code: Element_1.DefinitionPartition.createCode(iModelDb, parentSubjectId, name),
401
- };
402
- const partitionId = iModelDb.elements.insertElement(partitionProps);
403
- return iModelDb.models.insertModel({
404
- classFullName: this.classFullName,
405
- modeledElement: { id: partitionId },
406
- });
407
- }
408
- }
409
- exports.DefinitionModel = DefinitionModel;
410
- /** The singleton container of repository-related information elements.
411
- * @public
412
- */
413
- class RepositoryModel extends DefinitionModel {
414
- /** @internal */
415
- static get className() { return "RepositoryModel"; }
416
- }
417
- exports.RepositoryModel = RepositoryModel;
418
- /** Contains a list of document elements.
419
- * @see [[DocumentPartition]]
420
- * @public
421
- */
422
- class DocumentListModel extends InformationModel {
423
- /** @internal */
424
- static get className() { return "DocumentListModel"; }
425
- /** Insert a DocumentPartition and a DocumentListModel that sub-models it.
426
- * @param iModelDb Insert into this iModel
427
- * @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.
428
- * @param name The name of the DocumentPartition that the new DocumentListModel will sub-model.
429
- * @returns The Id of the newly inserted DocumentPartition and DocumentListModel (same value)
430
- * @throws [[IModelError]] if there is an insert problem.
431
- */
432
- static insert(iModelDb, parentSubjectId, name) {
433
- const partitionProps = {
434
- classFullName: Element_1.DocumentPartition.classFullName,
435
- model: core_common_1.IModel.repositoryModelId,
436
- parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
437
- code: Element_1.DocumentPartition.createCode(iModelDb, parentSubjectId, name),
438
- };
439
- const partitionId = iModelDb.elements.insertElement(partitionProps);
440
- return iModelDb.models.insertModel({
441
- classFullName: this.classFullName,
442
- modeledElement: { id: partitionId },
443
- });
444
- }
445
- }
446
- exports.DocumentListModel = DocumentListModel;
447
- /** A container for persisting link elements.
448
- * @see [[LinkPartition]]
449
- * @public
450
- */
451
- class LinkModel extends InformationModel {
452
- /** @internal */
453
- static get className() { return "LinkModel"; }
454
- }
455
- exports.LinkModel = LinkModel;
456
- /** The singleton container for repository-specific definition elements.
457
- * @public
458
- */
459
- class DictionaryModel extends DefinitionModel {
460
- /** @internal */
461
- static get className() { return "DictionaryModel"; }
462
- }
463
- exports.DictionaryModel = DictionaryModel;
464
- /** Obtains and displays multi-resolution tiled raster organized according to the WebMercator tiling system.
465
- * @public
466
- */
467
- class WebMercatorModel extends SpatialModel {
468
- /** @internal */
469
- static get className() { return "WebMercatorModel"; }
470
- }
471
- exports.WebMercatorModel = WebMercatorModel;
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 Models
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.WebMercatorModel = exports.DictionaryModel = exports.LinkModel = exports.DocumentListModel = exports.RepositoryModel = exports.DefinitionModel = exports.InformationRecordModel = exports.GroupInformationModel = exports.InformationModel = exports.RoleModel = exports.SheetModel = exports.SectionDrawingModel = exports.DrawingModel = exports.SpatialLocationModel = exports.PhysicalModel = exports.SpatialModel = exports.GraphicalModel3d = exports.GraphicalModel2d = exports.GeometricModel2d = exports.GeometricModel3d = exports.GeometricModel = exports.Model = void 0;
11
+ // cspell:ignore elid
12
+ const core_bentley_1 = require("@itwin/core-bentley");
13
+ const core_geometry_1 = require("@itwin/core-geometry");
14
+ const core_common_1 = require("@itwin/core-common");
15
+ const Element_1 = require("./Element");
16
+ const Entity_1 = require("./Entity");
17
+ const NavigationRelationship_1 = require("./NavigationRelationship");
18
+ /** A Model is a container for persisting a collection of related elements within an iModel.
19
+ * See [[IModelDb.Models]] for how to query and manage the Models in an IModelDb.
20
+ * See [Creating models]($docs/learning/backend/CreateModels.md)
21
+ * @public
22
+ */
23
+ class Model extends Entity_1.Entity {
24
+ /** @internal */
25
+ constructor(props, iModel) {
26
+ super(props, iModel);
27
+ this.name = props.name ? props.name : ""; // NB this isn't really a property of Model (it's the code.value of the modeled element), but it comes in ModelProps because it's often needed
28
+ this.isPrivate = core_bentley_1.JsonUtils.asBool(props.isPrivate);
29
+ this.isTemplate = core_bentley_1.JsonUtils.asBool(props.isTemplate);
30
+ this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy
31
+ }
32
+ /** @internal */
33
+ static get className() { return "Model"; }
34
+ /** @internal */
35
+ static get protectedOperations() { return ["onInsert", "onUpdate", "onDelete"]; }
36
+ /** Add all properties of a Model to a json object.
37
+ * @internal
38
+ */
39
+ toJSON() {
40
+ const val = super.toJSON();
41
+ val.name = this.name; // for cloning
42
+ return val;
43
+ }
44
+ /** Called before a new Model is inserted.
45
+ * @note throw an exception to disallow the insert
46
+ * @note If you override this method, you must call super.
47
+ * @note `this` is the class of the Model to be inserted
48
+ * @beta
49
+ */
50
+ static onInsert(arg) {
51
+ const { props } = arg;
52
+ if (props.parentModel) // inserting requires shared lock on parent, if present
53
+ arg.iModel.locks.checkSharedLock(props.parentModel, "parent model", "insert");
54
+ }
55
+ /** Called after a new Model is inserted.
56
+ * @note If you override this method, you must call super.
57
+ * @note `this` is the class of the Model that was inserted
58
+ * @beta
59
+ */
60
+ static onInserted(_arg) {
61
+ // we don't need to tell LockControl about models being created - their ModeledElement does that
62
+ }
63
+ /** Called before a Model is updated.
64
+ * @note throw an exception to disallow the update
65
+ * @note If you override this method, you must call super.
66
+ * @note `this` is the class of the Model to be updated
67
+ * @beta
68
+ */
69
+ static onUpdate(arg) {
70
+ arg.iModel.locks.checkExclusiveLock(arg.props.id, "model", "update"); // eslint-disable-line @typescript-eslint/no-non-null-assertion
71
+ }
72
+ /** Called after a Model is updated.
73
+ * @note If you override this method, you must call super.
74
+ * @note `this` is the class of the Model that was updated.
75
+ * @beta
76
+ */
77
+ static onUpdated(_arg) {
78
+ }
79
+ /** Called before a Model is deleted.
80
+ * @note throw an exception to disallow the delete
81
+ * @note If you override this method, you must call super.
82
+ * @note `this` is the class of the Model to be deleted
83
+ * @beta
84
+ */
85
+ static onDelete(arg) {
86
+ arg.iModel.locks.checkExclusiveLock(arg.id, "model", "delete");
87
+ }
88
+ /** Called after a Model was deleted.
89
+ * @note If you override this method, you must call super.
90
+ * @note `this` is the class of the Model that was deleted
91
+ * @beta
92
+ */
93
+ static onDeleted(_arg) { }
94
+ /** Called before a prospective Element is to be inserted into an instance of a Model of this class.
95
+ * @note throw an exception to disallow the insert
96
+ * @note If you override this method, you must call super.
97
+ * @note `this` is the class of the Model to hold the element
98
+ * @beta
99
+ */
100
+ static onInsertElement(_arg) { }
101
+ /** Called after an Element has been inserted into an instance of a Model of this class.
102
+ * @note If you override this method, you must call super.
103
+ * @note `this` is the class of the Model holding the element
104
+ * @beta
105
+ */
106
+ static onInsertedElement(_arg) { }
107
+ /** Called when an Element in an instance of a Model of this class is about to be updated.
108
+ * @note throw an exception to disallow the update
109
+ * @note If you override this method, you must call super.
110
+ * @note `this` is the class of the Model holding the element
111
+ * @beta
112
+ */
113
+ static onUpdateElement(_arg) { }
114
+ /** Called after an Element in an instance of a Model of this class has been updated.
115
+ * @note If you override this method, you must call super.
116
+ * @note `this` is the class of the Model holding the element
117
+ * @beta
118
+ */
119
+ static onUpdatedElement(_arg) { }
120
+ /** Called when an Element in an instance of a Model of this class is about to be deleted.
121
+ * @note throw an exception to disallow the delete
122
+ * @note If you override this method, you must call super.
123
+ * @note `this` is the class of the Model holding the element
124
+ * @beta
125
+ */
126
+ static onDeleteElement(_arg) { }
127
+ /** Called after an Element in an instance of a Model of this class has been deleted.
128
+ * @note If you override this method, you must call super.
129
+ * @note `this` is the class of the Model that held the element
130
+ * @beta
131
+ */
132
+ static onDeletedElement(_arg) { }
133
+ getAllUserProperties() {
134
+ if (!this.jsonProperties.UserProps)
135
+ this.jsonProperties.UserProps = new Object();
136
+ return this.jsonProperties.UserProps;
137
+ }
138
+ /** Get a set of JSON user properties by namespace */
139
+ getUserProperties(namespace) { return this.getAllUserProperties()[namespace]; }
140
+ /** Change a set of user JSON properties of this Element by namespace. */
141
+ setUserProperties(nameSpace, value) { this.getAllUserProperties()[nameSpace] = value; }
142
+ /** Remove a set of JSON user properties, specified by namespace, from this Element */
143
+ removeUserProperties(nameSpace) { delete this.getAllUserProperties()[nameSpace]; }
144
+ getJsonProperty(name) { return this.jsonProperties[name]; }
145
+ setJsonProperty(name, value) { this.jsonProperties[name] = value; }
146
+ /** Insert this Model in the iModel */
147
+ insert() { return this.id = this.iModel.models.insertModel(this.toJSON()); }
148
+ /** Update this Model in the iModel. */
149
+ update() { this.iModel.models.updateModel(this.toJSON()); }
150
+ /** Delete this Model from the iModel. */
151
+ delete() { this.iModel.models.deleteModel(this.id); }
152
+ }
153
+ exports.Model = Model;
154
+ /** A container for persisting geometric elements.
155
+ * @public
156
+ */
157
+ class GeometricModel extends Model {
158
+ /** @internal */
159
+ constructor(props, iModel) { super(props, iModel); }
160
+ /** @internal */
161
+ static get className() { return "GeometricModel"; }
162
+ /** Query for the union of the extents of the elements contained by this model. */
163
+ queryExtents() {
164
+ const extents = this.iModel.nativeDb.queryModelExtents({ id: this.id }).modelExtents;
165
+ return core_geometry_1.Range3d.fromJSON(extents);
166
+ }
167
+ }
168
+ exports.GeometricModel = GeometricModel;
169
+ /** A container for persisting 3d geometric elements.
170
+ * @public
171
+ */
172
+ class GeometricModel3d extends GeometricModel {
173
+ /** @internal */
174
+ constructor(props, iModel) {
175
+ super(props, iModel);
176
+ this.isNotSpatiallyLocated = core_bentley_1.JsonUtils.asBool(props.isNotSpatiallyLocated);
177
+ this.isPlanProjection = core_bentley_1.JsonUtils.asBool(props.isPlanProjection);
178
+ }
179
+ /** If true, then the elements in this GeometricModel3d are in real-world coordinates and will be in the spatial index. */
180
+ get isSpatiallyLocated() { return !this.isNotSpatiallyLocated; }
181
+ /** @internal */
182
+ static get className() { return "GeometricModel3d"; }
183
+ /** @internal */
184
+ toJSON() {
185
+ const val = super.toJSON();
186
+ if (this.isNotSpatiallyLocated)
187
+ val.isNotSpatiallyLocated = true;
188
+ if (this.isPlanProjection)
189
+ val.isPlanProjection = true;
190
+ return val;
191
+ }
192
+ }
193
+ exports.GeometricModel3d = GeometricModel3d;
194
+ /** A container for persisting 2d geometric elements.
195
+ * @public
196
+ */
197
+ class GeometricModel2d extends GeometricModel {
198
+ /** @internal */
199
+ constructor(props, iModel) { super(props, iModel); }
200
+ /** @internal */
201
+ static get className() { return "GeometricModel2d"; }
202
+ /** @internal */
203
+ toJSON() {
204
+ const val = super.toJSON();
205
+ if (undefined !== this.globalOrigin)
206
+ val.globalOrigin = core_geometry_1.Point2d.fromJSON(this.globalOrigin);
207
+ return val;
208
+ }
209
+ }
210
+ exports.GeometricModel2d = GeometricModel2d;
211
+ /** A container for persisting 2d graphical elements.
212
+ * @public
213
+ */
214
+ class GraphicalModel2d extends GeometricModel2d {
215
+ /** @internal */
216
+ static get className() { return "GraphicalModel2d"; }
217
+ }
218
+ exports.GraphicalModel2d = GraphicalModel2d;
219
+ /** A container for persisting GraphicalElement3d instances.
220
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.8
221
+ * @see [[GraphicalPartition3d]]
222
+ * @public
223
+ */
224
+ class GraphicalModel3d extends GeometricModel3d {
225
+ /** @internal */
226
+ static get className() { return "GraphicalModel3d"; }
227
+ }
228
+ exports.GraphicalModel3d = GraphicalModel3d;
229
+ /** A container for persisting 3d geometric elements that are spatially located.
230
+ * @public
231
+ */
232
+ class SpatialModel extends GeometricModel3d {
233
+ /** @internal */
234
+ static get className() { return "SpatialModel"; }
235
+ }
236
+ exports.SpatialModel = SpatialModel;
237
+ /** A container for persisting physical elements that model physical space.
238
+ * @see [[PhysicalPartition]]
239
+ * @public
240
+ */
241
+ class PhysicalModel extends SpatialModel {
242
+ /** @internal */
243
+ static get className() { return "PhysicalModel"; }
244
+ /** Insert a PhysicalPartition and a PhysicalModel that sub-models it.
245
+ * @param iModelDb Insert into this iModel
246
+ * @param parentSubjectId The PhysicalPartition will be inserted as a child of this Subject element.
247
+ * @param name The name of the PhysicalPartition that the new PhysicalModel will sub-model.
248
+ * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.
249
+ * @returns The Id of the newly inserted PhysicalPartition and PhysicalModel (same value).
250
+ * @throws [[IModelError]] if there is an insert problem.
251
+ */
252
+ static insert(iModelDb, parentSubjectId, name, isPlanProjection) {
253
+ const partitionProps = {
254
+ classFullName: Element_1.PhysicalPartition.classFullName,
255
+ model: core_common_1.IModel.repositoryModelId,
256
+ parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
257
+ code: Element_1.PhysicalPartition.createCode(iModelDb, parentSubjectId, name),
258
+ };
259
+ const partitionId = iModelDb.elements.insertElement(partitionProps);
260
+ const modelProps = {
261
+ classFullName: this.classFullName,
262
+ modeledElement: { id: partitionId },
263
+ isPlanProjection,
264
+ };
265
+ return iModelDb.models.insertModel(modelProps);
266
+ }
267
+ }
268
+ exports.PhysicalModel = PhysicalModel;
269
+ /** A container for persisting spatial location elements.
270
+ * @see [[SpatialLocationPartition]]
271
+ * @public
272
+ */
273
+ class SpatialLocationModel extends SpatialModel {
274
+ /** @internal */
275
+ static get className() { return "SpatialLocationModel"; }
276
+ /** Insert a SpatialLocationPartition and a SpatialLocationModel that sub-models it.
277
+ * @param iModelDb Insert into this iModel
278
+ * @param parentSubjectId The SpatialLocationPartition will be inserted as a child of this Subject element.
279
+ * @param name The name of the SpatialLocationPartition that the new SpatialLocationModel will sub-model.
280
+ * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.
281
+ * @returns The Id of the newly inserted SpatialLocationPartition and SpatialLocationModel (same value).
282
+ * @throws [[IModelError]] if there is an insert problem.
283
+ */
284
+ static insert(iModelDb, parentSubjectId, name, isPlanProjection) {
285
+ const partitionProps = {
286
+ classFullName: Element_1.SpatialLocationPartition.classFullName,
287
+ model: core_common_1.IModel.repositoryModelId,
288
+ parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
289
+ code: Element_1.SpatialLocationPartition.createCode(iModelDb, parentSubjectId, name),
290
+ };
291
+ const partitionId = iModelDb.elements.insertElement(partitionProps);
292
+ const modelProps = {
293
+ classFullName: this.classFullName,
294
+ modeledElement: { id: partitionId },
295
+ isPlanProjection,
296
+ };
297
+ return iModelDb.models.insertModel(modelProps);
298
+ }
299
+ }
300
+ exports.SpatialLocationModel = SpatialLocationModel;
301
+ /** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.
302
+ * @public
303
+ */
304
+ class DrawingModel extends GraphicalModel2d {
305
+ /** @internal */
306
+ static get className() { return "DrawingModel"; }
307
+ }
308
+ exports.DrawingModel = DrawingModel;
309
+ /** A container for persisting section [[DrawingGraphic]]s.
310
+ * @public
311
+ */
312
+ class SectionDrawingModel extends DrawingModel {
313
+ /** @internal */
314
+ static get className() { return "SectionDrawingModel"; }
315
+ }
316
+ exports.SectionDrawingModel = SectionDrawingModel;
317
+ /** A container for persisting [[ViewAttachment]]s and [[DrawingGraphic]]s.
318
+ * A SheetModel is a digital representation of a *sheet of paper*. SheetModels are 2d models in bounded paper coordinates.
319
+ * SheetModels may contain annotation Elements as well as references to 2d or 3d Views.
320
+ * @public
321
+ */
322
+ class SheetModel extends GraphicalModel2d {
323
+ /** @internal */
324
+ static get className() { return "SheetModel"; }
325
+ }
326
+ exports.SheetModel = SheetModel;
327
+ /** A container for persisting role elements.
328
+ * @public
329
+ */
330
+ class RoleModel extends Model {
331
+ /** @internal */
332
+ static get className() { return "RoleModel"; }
333
+ }
334
+ exports.RoleModel = RoleModel;
335
+ /** A container for persisting information elements.
336
+ * @public
337
+ */
338
+ class InformationModel extends Model {
339
+ /** @internal */
340
+ static get className() { return "InformationModel"; }
341
+ }
342
+ exports.InformationModel = InformationModel;
343
+ /** A container for persisting group information elements.
344
+ * @see [[GroupInformationPartition]]
345
+ * @public
346
+ */
347
+ class GroupInformationModel extends InformationModel {
348
+ /** @internal */
349
+ static get className() { return "GroupInformationModel"; }
350
+ }
351
+ exports.GroupInformationModel = GroupInformationModel;
352
+ /** A container for persisting Information Record Elements
353
+ * @see [[InformationRecordPartition]]
354
+ * @public
355
+ */
356
+ class InformationRecordModel extends InformationModel {
357
+ /** @internal */
358
+ static get className() { return "InformationRecordModel"; }
359
+ /** Insert a InformationRecordPartition and a InformationRecordModel that sub-models it.
360
+ * @param iModelDb Insert into this iModel
361
+ * @param parentSubjectId The InformationRecordPartition will be inserted as a child of this Subject element.
362
+ * @param name The name of the InformationRecordPartition that the new InformationRecordModel will sub-model.
363
+ * @returns The Id of the newly inserted InformationRecordModel.
364
+ * @throws [[IModelError]] if there is an insert problem.
365
+ */
366
+ static insert(iModelDb, parentSubjectId, name) {
367
+ const partitionProps = {
368
+ classFullName: Element_1.InformationRecordPartition.classFullName,
369
+ model: core_common_1.IModel.repositoryModelId,
370
+ parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
371
+ code: Element_1.InformationRecordPartition.createCode(iModelDb, parentSubjectId, name),
372
+ };
373
+ const partitionId = iModelDb.elements.insertElement(partitionProps);
374
+ return iModelDb.models.insertModel({
375
+ classFullName: this.classFullName,
376
+ modeledElement: { id: partitionId },
377
+ });
378
+ }
379
+ }
380
+ exports.InformationRecordModel = InformationRecordModel;
381
+ /** A container for persisting definition elements.
382
+ * @see [[DefinitionPartition]]
383
+ * @public
384
+ */
385
+ class DefinitionModel extends InformationModel {
386
+ /** @internal */
387
+ static get className() { return "DefinitionModel"; }
388
+ /** Insert a DefinitionPartition and a DefinitionModel that sub-models it.
389
+ * @param iModelDb Insert into this iModel
390
+ * @param parentSubjectId The DefinitionPartition will be inserted as a child of this Subject element.
391
+ * @param name The name of the DefinitionPartition that the new DefinitionModel will sub-model.
392
+ * @returns The Id of the newly inserted DefinitionModel.
393
+ * @throws [[IModelError]] if there is an insert problem.
394
+ */
395
+ static insert(iModelDb, parentSubjectId, name) {
396
+ const partitionProps = {
397
+ classFullName: Element_1.DefinitionPartition.classFullName,
398
+ model: core_common_1.IModel.repositoryModelId,
399
+ parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
400
+ code: Element_1.DefinitionPartition.createCode(iModelDb, parentSubjectId, name),
401
+ };
402
+ const partitionId = iModelDb.elements.insertElement(partitionProps);
403
+ return iModelDb.models.insertModel({
404
+ classFullName: this.classFullName,
405
+ modeledElement: { id: partitionId },
406
+ });
407
+ }
408
+ }
409
+ exports.DefinitionModel = DefinitionModel;
410
+ /** The singleton container of repository-related information elements.
411
+ * @public
412
+ */
413
+ class RepositoryModel extends DefinitionModel {
414
+ /** @internal */
415
+ static get className() { return "RepositoryModel"; }
416
+ }
417
+ exports.RepositoryModel = RepositoryModel;
418
+ /** Contains a list of document elements.
419
+ * @see [[DocumentPartition]]
420
+ * @public
421
+ */
422
+ class DocumentListModel extends InformationModel {
423
+ /** @internal */
424
+ static get className() { return "DocumentListModel"; }
425
+ /** Insert a DocumentPartition and a DocumentListModel that sub-models it.
426
+ * @param iModelDb Insert into this iModel
427
+ * @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.
428
+ * @param name The name of the DocumentPartition that the new DocumentListModel will sub-model.
429
+ * @returns The Id of the newly inserted DocumentPartition and DocumentListModel (same value)
430
+ * @throws [[IModelError]] if there is an insert problem.
431
+ */
432
+ static insert(iModelDb, parentSubjectId, name) {
433
+ const partitionProps = {
434
+ classFullName: Element_1.DocumentPartition.classFullName,
435
+ model: core_common_1.IModel.repositoryModelId,
436
+ parent: new NavigationRelationship_1.SubjectOwnsPartitionElements(parentSubjectId),
437
+ code: Element_1.DocumentPartition.createCode(iModelDb, parentSubjectId, name),
438
+ };
439
+ const partitionId = iModelDb.elements.insertElement(partitionProps);
440
+ return iModelDb.models.insertModel({
441
+ classFullName: this.classFullName,
442
+ modeledElement: { id: partitionId },
443
+ });
444
+ }
445
+ }
446
+ exports.DocumentListModel = DocumentListModel;
447
+ /** A container for persisting link elements.
448
+ * @see [[LinkPartition]]
449
+ * @public
450
+ */
451
+ class LinkModel extends InformationModel {
452
+ /** @internal */
453
+ static get className() { return "LinkModel"; }
454
+ }
455
+ exports.LinkModel = LinkModel;
456
+ /** The singleton container for repository-specific definition elements.
457
+ * @public
458
+ */
459
+ class DictionaryModel extends DefinitionModel {
460
+ /** @internal */
461
+ static get className() { return "DictionaryModel"; }
462
+ }
463
+ exports.DictionaryModel = DictionaryModel;
464
+ /** Obtains and displays multi-resolution tiled raster organized according to the WebMercator tiling system.
465
+ * @public
466
+ */
467
+ class WebMercatorModel extends SpatialModel {
468
+ /** @internal */
469
+ static get className() { return "WebMercatorModel"; }
470
+ }
471
+ exports.WebMercatorModel = WebMercatorModel;
472
472
  //# sourceMappingURL=Model.js.map