@itwin/core-backend 3.0.0-dev.100

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 (245) hide show
  1. package/CHANGELOG.md +1525 -0
  2. package/LICENSE.md +9 -0
  3. package/README.md +11 -0
  4. package/lib/cjs/AliCloudStorageService.d.ts +12 -0
  5. package/lib/cjs/AliCloudStorageService.d.ts.map +1 -0
  6. package/lib/cjs/AliCloudStorageService.js +70 -0
  7. package/lib/cjs/AliCloudStorageService.js.map +1 -0
  8. package/lib/cjs/BackendHubAccess.d.ts +208 -0
  9. package/lib/cjs/BackendHubAccess.d.ts.map +1 -0
  10. package/lib/cjs/BackendHubAccess.js +42 -0
  11. package/lib/cjs/BackendHubAccess.js.map +1 -0
  12. package/lib/cjs/BackendLoggerCategory.d.ts +83 -0
  13. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -0
  14. package/lib/cjs/BackendLoggerCategory.js +91 -0
  15. package/lib/cjs/BackendLoggerCategory.js.map +1 -0
  16. package/lib/cjs/BisCoreSchema.d.ts +22 -0
  17. package/lib/cjs/BisCoreSchema.d.ts.map +1 -0
  18. package/lib/cjs/BisCoreSchema.js +61 -0
  19. package/lib/cjs/BisCoreSchema.js.map +1 -0
  20. package/lib/cjs/BriefcaseManager.d.ts +167 -0
  21. package/lib/cjs/BriefcaseManager.d.ts.map +1 -0
  22. package/lib/cjs/BriefcaseManager.js +406 -0
  23. package/lib/cjs/BriefcaseManager.js.map +1 -0
  24. package/lib/cjs/Category.d.ts +154 -0
  25. package/lib/cjs/Category.d.ts.map +1 -0
  26. package/lib/cjs/Category.js +244 -0
  27. package/lib/cjs/Category.js.map +1 -0
  28. package/lib/cjs/ChangeSummaryManager.d.ts +188 -0
  29. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -0
  30. package/lib/cjs/ChangeSummaryManager.js +444 -0
  31. package/lib/cjs/ChangeSummaryManager.js.map +1 -0
  32. package/lib/cjs/ChangedElementsDb.d.ts +97 -0
  33. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -0
  34. package/lib/cjs/ChangedElementsDb.js +166 -0
  35. package/lib/cjs/ChangedElementsDb.js.map +1 -0
  36. package/lib/cjs/ChangedElementsManager.d.ts +40 -0
  37. package/lib/cjs/ChangedElementsManager.d.ts.map +1 -0
  38. package/lib/cjs/ChangedElementsManager.js +89 -0
  39. package/lib/cjs/ChangedElementsManager.js.map +1 -0
  40. package/lib/cjs/CheckpointManager.d.ts +101 -0
  41. package/lib/cjs/CheckpointManager.d.ts.map +1 -0
  42. package/lib/cjs/CheckpointManager.js +257 -0
  43. package/lib/cjs/CheckpointManager.js.map +1 -0
  44. package/lib/cjs/ClassRegistry.d.ts +72 -0
  45. package/lib/cjs/ClassRegistry.d.ts.map +1 -0
  46. package/lib/cjs/ClassRegistry.js +154 -0
  47. package/lib/cjs/ClassRegistry.js.map +1 -0
  48. package/lib/cjs/CloudStorageBackend.d.ts +46 -0
  49. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -0
  50. package/lib/cjs/CloudStorageBackend.js +157 -0
  51. package/lib/cjs/CloudStorageBackend.js.map +1 -0
  52. package/lib/cjs/CodeSpecs.d.ts +51 -0
  53. package/lib/cjs/CodeSpecs.d.ts.map +1 -0
  54. package/lib/cjs/CodeSpecs.js +113 -0
  55. package/lib/cjs/CodeSpecs.js.map +1 -0
  56. package/lib/cjs/ConcurrentQuery.d.ts +12 -0
  57. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -0
  58. package/lib/cjs/ConcurrentQuery.js +24 -0
  59. package/lib/cjs/ConcurrentQuery.js.map +1 -0
  60. package/lib/cjs/DevTools.d.ts +72 -0
  61. package/lib/cjs/DevTools.d.ts.map +1 -0
  62. package/lib/cjs/DevTools.js +155 -0
  63. package/lib/cjs/DevTools.js.map +1 -0
  64. package/lib/cjs/DisplayStyle.d.ts +107 -0
  65. package/lib/cjs/DisplayStyle.d.ts.map +1 -0
  66. package/lib/cjs/DisplayStyle.js +292 -0
  67. package/lib/cjs/DisplayStyle.js.map +1 -0
  68. package/lib/cjs/ECDb.d.ts +196 -0
  69. package/lib/cjs/ECDb.d.ts.map +1 -0
  70. package/lib/cjs/ECDb.js +354 -0
  71. package/lib/cjs/ECDb.js.map +1 -0
  72. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -0
  73. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -0
  74. package/lib/cjs/ECSchemaXmlContext.js +36 -0
  75. package/lib/cjs/ECSchemaXmlContext.js.map +1 -0
  76. package/lib/cjs/ECSqlStatement.d.ts +467 -0
  77. package/lib/cjs/ECSqlStatement.d.ts.map +1 -0
  78. package/lib/cjs/ECSqlStatement.js +783 -0
  79. package/lib/cjs/ECSqlStatement.js.map +1 -0
  80. package/lib/cjs/Element.d.ts +1082 -0
  81. package/lib/cjs/Element.d.ts.map +1 -0
  82. package/lib/cjs/Element.js +1392 -0
  83. package/lib/cjs/Element.js.map +1 -0
  84. package/lib/cjs/ElementAspect.d.ts +157 -0
  85. package/lib/cjs/ElementAspect.d.ts.map +1 -0
  86. package/lib/cjs/ElementAspect.js +179 -0
  87. package/lib/cjs/ElementAspect.js.map +1 -0
  88. package/lib/cjs/ElementGraphics.d.ts +10 -0
  89. package/lib/cjs/ElementGraphics.d.ts.map +1 -0
  90. package/lib/cjs/ElementGraphics.js +42 -0
  91. package/lib/cjs/ElementGraphics.js.map +1 -0
  92. package/lib/cjs/Entity.d.ts +57 -0
  93. package/lib/cjs/Entity.d.ts.map +1 -0
  94. package/lib/cjs/Entity.js +63 -0
  95. package/lib/cjs/Entity.js.map +1 -0
  96. package/lib/cjs/ExportGraphics.d.ts +302 -0
  97. package/lib/cjs/ExportGraphics.d.ts.map +1 -0
  98. package/lib/cjs/ExportGraphics.js +206 -0
  99. package/lib/cjs/ExportGraphics.js.map +1 -0
  100. package/lib/cjs/ExternalSource.d.ts +95 -0
  101. package/lib/cjs/ExternalSource.d.ts.map +1 -0
  102. package/lib/cjs/ExternalSource.js +126 -0
  103. package/lib/cjs/ExternalSource.js.map +1 -0
  104. package/lib/cjs/GeometrySummary.d.ts +5 -0
  105. package/lib/cjs/GeometrySummary.d.ts.map +1 -0
  106. package/lib/cjs/GeometrySummary.js +378 -0
  107. package/lib/cjs/GeometrySummary.js.map +1 -0
  108. package/lib/cjs/IModelCloneContext.d.ts +74 -0
  109. package/lib/cjs/IModelCloneContext.d.ts.map +1 -0
  110. package/lib/cjs/IModelCloneContext.js +130 -0
  111. package/lib/cjs/IModelCloneContext.js.map +1 -0
  112. package/lib/cjs/IModelDb.d.ts +1107 -0
  113. package/lib/cjs/IModelDb.d.ts.map +1 -0
  114. package/lib/cjs/IModelDb.js +2161 -0
  115. package/lib/cjs/IModelDb.js.map +1 -0
  116. package/lib/cjs/IModelHost.d.ts +284 -0
  117. package/lib/cjs/IModelHost.d.ts.map +1 -0
  118. package/lib/cjs/IModelHost.js +411 -0
  119. package/lib/cjs/IModelHost.js.map +1 -0
  120. package/lib/cjs/IModelJsFs.d.ts +63 -0
  121. package/lib/cjs/IModelJsFs.d.ts.map +1 -0
  122. package/lib/cjs/IModelJsFs.js +141 -0
  123. package/lib/cjs/IModelJsFs.js.map +1 -0
  124. package/lib/cjs/IModelSchemaLoader.d.ts +26 -0
  125. package/lib/cjs/IModelSchemaLoader.d.ts.map +1 -0
  126. package/lib/cjs/IModelSchemaLoader.js +95 -0
  127. package/lib/cjs/IModelSchemaLoader.js.map +1 -0
  128. package/lib/cjs/IpcHost.d.ts +99 -0
  129. package/lib/cjs/IpcHost.d.ts.map +1 -0
  130. package/lib/cjs/IpcHost.js +234 -0
  131. package/lib/cjs/IpcHost.js.map +1 -0
  132. package/lib/cjs/LineStyle.d.ts +312 -0
  133. package/lib/cjs/LineStyle.d.ts.map +1 -0
  134. package/lib/cjs/LineStyle.js +296 -0
  135. package/lib/cjs/LineStyle.js.map +1 -0
  136. package/lib/cjs/LocalhostIpcHost.d.ts +19 -0
  137. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -0
  138. package/lib/cjs/LocalhostIpcHost.js +52 -0
  139. package/lib/cjs/LocalhostIpcHost.js.map +1 -0
  140. package/lib/cjs/Material.d.ts +102 -0
  141. package/lib/cjs/Material.d.ts.map +1 -0
  142. package/lib/cjs/Material.js +146 -0
  143. package/lib/cjs/Material.js.map +1 -0
  144. package/lib/cjs/Model.d.ts +387 -0
  145. package/lib/cjs/Model.d.ts.map +1 -0
  146. package/lib/cjs/Model.js +469 -0
  147. package/lib/cjs/Model.js.map +1 -0
  148. package/lib/cjs/NativeAppStorage.d.ts +52 -0
  149. package/lib/cjs/NativeAppStorage.d.ts.map +1 -0
  150. package/lib/cjs/NativeAppStorage.js +203 -0
  151. package/lib/cjs/NativeAppStorage.js.map +1 -0
  152. package/lib/cjs/NativeHost.d.ts +71 -0
  153. package/lib/cjs/NativeHost.d.ts.map +1 -0
  154. package/lib/cjs/NativeHost.js +221 -0
  155. package/lib/cjs/NativeHost.js.map +1 -0
  156. package/lib/cjs/NavigationRelationship.d.ts +157 -0
  157. package/lib/cjs/NavigationRelationship.d.ts.map +1 -0
  158. package/lib/cjs/NavigationRelationship.js +226 -0
  159. package/lib/cjs/NavigationRelationship.js.map +1 -0
  160. package/lib/cjs/PromiseMemoizer.d.ts +52 -0
  161. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -0
  162. package/lib/cjs/PromiseMemoizer.js +93 -0
  163. package/lib/cjs/PromiseMemoizer.js.map +1 -0
  164. package/lib/cjs/Relationship.d.ts +400 -0
  165. package/lib/cjs/Relationship.d.ts.map +1 -0
  166. package/lib/cjs/Relationship.js +460 -0
  167. package/lib/cjs/Relationship.js.map +1 -0
  168. package/lib/cjs/RpcBackend.d.ts +23 -0
  169. package/lib/cjs/RpcBackend.d.ts.map +1 -0
  170. package/lib/cjs/RpcBackend.js +94 -0
  171. package/lib/cjs/RpcBackend.js.map +1 -0
  172. package/lib/cjs/SQLiteDb.d.ts +66 -0
  173. package/lib/cjs/SQLiteDb.d.ts.map +1 -0
  174. package/lib/cjs/SQLiteDb.js +140 -0
  175. package/lib/cjs/SQLiteDb.js.map +1 -0
  176. package/lib/cjs/Schema.d.ts +56 -0
  177. package/lib/cjs/Schema.d.ts.map +1 -0
  178. package/lib/cjs/Schema.js +84 -0
  179. package/lib/cjs/Schema.js.map +1 -0
  180. package/lib/cjs/ServerBasedLocks.d.ts +64 -0
  181. package/lib/cjs/ServerBasedLocks.d.ts.map +1 -0
  182. package/lib/cjs/ServerBasedLocks.js +177 -0
  183. package/lib/cjs/ServerBasedLocks.js.map +1 -0
  184. package/lib/cjs/SqliteStatement.d.ts +264 -0
  185. package/lib/cjs/SqliteStatement.d.ts.map +1 -0
  186. package/lib/cjs/SqliteStatement.js +417 -0
  187. package/lib/cjs/SqliteStatement.js.map +1 -0
  188. package/lib/cjs/Texture.d.ts +59 -0
  189. package/lib/cjs/Texture.d.ts.map +1 -0
  190. package/lib/cjs/Texture.js +83 -0
  191. package/lib/cjs/Texture.js.map +1 -0
  192. package/lib/cjs/TxnManager.d.ts +203 -0
  193. package/lib/cjs/TxnManager.d.ts.map +1 -0
  194. package/lib/cjs/TxnManager.js +354 -0
  195. package/lib/cjs/TxnManager.js.map +1 -0
  196. package/lib/cjs/ViewDefinition.d.ts +432 -0
  197. package/lib/cjs/ViewDefinition.d.ts.map +1 -0
  198. package/lib/cjs/ViewDefinition.js +623 -0
  199. package/lib/cjs/ViewDefinition.js.map +1 -0
  200. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -0
  201. package/lib/cjs/core-backend.d.ts +162 -0
  202. package/lib/cjs/core-backend.d.ts.map +1 -0
  203. package/lib/cjs/core-backend.js +181 -0
  204. package/lib/cjs/core-backend.js.map +1 -0
  205. package/lib/cjs/domains/FunctionalElements.d.ts +102 -0
  206. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -0
  207. package/lib/cjs/domains/FunctionalElements.js +146 -0
  208. package/lib/cjs/domains/FunctionalElements.js.map +1 -0
  209. package/lib/cjs/domains/FunctionalSchema.d.ts +14 -0
  210. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -0
  211. package/lib/cjs/domains/FunctionalSchema.js +41 -0
  212. package/lib/cjs/domains/FunctionalSchema.js.map +1 -0
  213. package/lib/cjs/domains/GenericElements.d.ts +178 -0
  214. package/lib/cjs/domains/GenericElements.d.ts.map +1 -0
  215. package/lib/cjs/domains/GenericElements.js +264 -0
  216. package/lib/cjs/domains/GenericElements.js.map +1 -0
  217. package/lib/cjs/domains/GenericSchema.d.ts +11 -0
  218. package/lib/cjs/domains/GenericSchema.d.ts.map +1 -0
  219. package/lib/cjs/domains/GenericSchema.js +29 -0
  220. package/lib/cjs/domains/GenericSchema.js.map +1 -0
  221. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +16 -0
  222. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts.map +1 -0
  223. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +33 -0
  224. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -0
  225. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +40 -0
  226. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -0
  227. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +207 -0
  228. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -0
  229. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +21 -0
  230. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -0
  231. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +193 -0
  232. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -0
  233. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +37 -0
  234. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -0
  235. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +162 -0
  236. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -0
  237. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +17 -0
  238. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts.map +1 -0
  239. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +44 -0
  240. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -0
  241. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +16 -0
  242. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts.map +1 -0
  243. package/lib/cjs/rpc-impl/WipRpcImpl.js +35 -0
  244. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -0
  245. package/package.json +101 -0
@@ -0,0 +1,623 @@
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 ViewDefinitions
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LightLocation = exports.ViewAttachment = exports.AuxCoordSystemSpatial = exports.AuxCoordSystem3d = exports.AuxCoordSystem2d = exports.AuxCoordSystem = exports.TemplateViewDefinition3d = exports.TemplateViewDefinition2d = exports.SheetViewDefinition = exports.DrawingViewDefinition = exports.ViewDefinition2d = exports.OrthographicViewDefinition = exports.SpatialViewDefinition = exports.ViewDefinition3d = exports.ViewDefinition = exports.CategorySelector = exports.ModelSelector = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const core_geometry_1 = require("@itwin/core-geometry");
13
+ const core_common_1 = require("@itwin/core-common");
14
+ const Element_1 = require("./Element");
15
+ /** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.
16
+ * @see [ModelSelectorState]($frontend)
17
+ * See [how to create a ModelSelector]$(docs/learning/backend/CreateElements.md#ModelSelector).
18
+ * @public
19
+ */
20
+ class ModelSelector extends Element_1.DefinitionElement {
21
+ /** @internal */
22
+ constructor(props, iModel) { super(props, iModel); this.models = props.models; }
23
+ /** @internal */
24
+ static get className() { return "ModelSelector"; }
25
+ /** @internal */
26
+ toJSON() {
27
+ const val = super.toJSON();
28
+ val.models = this.models;
29
+ return val;
30
+ }
31
+ /** @internal */
32
+ collectPredecessorIds(predecessorIds) {
33
+ super.collectPredecessorIds(predecessorIds);
34
+ this.models.forEach((modelId) => predecessorIds.add(modelId));
35
+ }
36
+ /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.
37
+ * @param iModel The IModelDb
38
+ * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.
39
+ * @param codeValue The ModelSelector name
40
+ */
41
+ static createCode(iModel, scopeModelId, codeValue) {
42
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.modelSelector);
43
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
44
+ }
45
+ /**
46
+ * Create a ModelSelector to select which Models are displayed by a ViewDefinition.
47
+ * @param iModelDb The iModel
48
+ * @param definitionModelId The [[DefinitionModel]]
49
+ * @param name The name/CodeValue of the ModelSelector
50
+ * @param models Array of models to select for display
51
+ * @returns The newly constructed ModelSelector element.
52
+ * @throws [[IModelError]] if unable to create the element.
53
+ */
54
+ static create(iModelDb, definitionModelId, name, models) {
55
+ const modelSelectorProps = {
56
+ classFullName: this.classFullName,
57
+ code: this.createCode(iModelDb, definitionModelId, name),
58
+ model: definitionModelId,
59
+ models,
60
+ isPrivate: false,
61
+ };
62
+ return new ModelSelector(modelSelectorProps, iModelDb);
63
+ }
64
+ /**
65
+ * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.
66
+ * @param iModelDb Insert into this iModel
67
+ * @param definitionModelId Insert the new ModelSelector into this DefinitionModel
68
+ * @param name The name/CodeValue of the ModelSelector
69
+ * @param models Array of models to select for display
70
+ * @returns The Id of the newly inserted ModelSelector element.
71
+ * @throws [[IModelError]] if unable to insert the element.
72
+ */
73
+ static insert(iModelDb, definitionModelId, name, models) {
74
+ const modelSelector = this.create(iModelDb, definitionModelId, name, models);
75
+ return iModelDb.elements.insertElement(modelSelector);
76
+ }
77
+ }
78
+ exports.ModelSelector = ModelSelector;
79
+ /** Holds a list of Ids of Categories to be displayed in a view.
80
+ * @see [CategorySelectorState]($frontend)
81
+ * See [how to create a CategorySelector]$(docs/learning/backend/CreateElements.md#CategorySelector).
82
+ * @public
83
+ */
84
+ class CategorySelector extends Element_1.DefinitionElement {
85
+ /** @internal */
86
+ constructor(props, iModel) { super(props, iModel); this.categories = props.categories; }
87
+ /** @internal */
88
+ static get className() { return "CategorySelector"; }
89
+ /** @internal */
90
+ toJSON() {
91
+ const val = super.toJSON();
92
+ val.categories = this.categories;
93
+ return val;
94
+ }
95
+ /** @internal */
96
+ collectPredecessorIds(predecessorIds) {
97
+ super.collectPredecessorIds(predecessorIds);
98
+ this.categories.forEach((categoryId) => predecessorIds.add(categoryId));
99
+ }
100
+ /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.
101
+ * @param iModel The IModelDb
102
+ * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.
103
+ * @param codeValue The CategorySelector name
104
+ */
105
+ static createCode(iModel, scopeModelId, codeValue) {
106
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.categorySelector);
107
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
108
+ }
109
+ /**
110
+ * Create a CategorySelector to select which categories are displayed by a ViewDefinition.
111
+ * @param iModelDb The iModel
112
+ * @param definitionModelId The [[DefinitionModel]]
113
+ * @param name The name of the CategorySelector
114
+ * @param categories Array of categories to select for display
115
+ * @returns The newly constructed CategorySelector element.
116
+ * @throws [[IModelError]] if unable to create the element.
117
+ */
118
+ static create(iModelDb, definitionModelId, name, categories) {
119
+ const categorySelectorProps = {
120
+ classFullName: this.classFullName,
121
+ code: this.createCode(iModelDb, definitionModelId, name),
122
+ model: definitionModelId,
123
+ categories,
124
+ isPrivate: false,
125
+ };
126
+ return new CategorySelector(categorySelectorProps, iModelDb);
127
+ }
128
+ /**
129
+ * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.
130
+ * @param iModelDb Insert into this iModel
131
+ * @param definitionModelId Insert the new CategorySelector into this DefinitionModel
132
+ * @param name The name of the CategorySelector
133
+ * @param categories Array of categories to select for display
134
+ * @returns The Id of the newly inserted CategorySelector element.
135
+ * @throws [[IModelError]] if unable to insert the element.
136
+ */
137
+ static insert(iModelDb, definitionModelId, name, categories) {
138
+ const categorySelector = this.create(iModelDb, definitionModelId, name, categories);
139
+ return iModelDb.elements.insertElement(categorySelector);
140
+ }
141
+ }
142
+ exports.CategorySelector = CategorySelector;
143
+ /**
144
+ * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,
145
+ * plus additional view-specific parameters in their [[Element.jsonProperties]].
146
+ *
147
+ * Subclasses of ViewDefinition determine which model(s) are viewed.
148
+ *
149
+ * **Example: Obtaining the background color for a view**
150
+ * ``` ts
151
+ * [[include:ViewDefinition.getBackgroundColor]]
152
+ * ```
153
+ *
154
+ * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.
155
+ * @public
156
+ */
157
+ class ViewDefinition extends Element_1.DefinitionElement {
158
+ /** @internal */
159
+ constructor(props, iModel) {
160
+ super(props, iModel);
161
+ this.categorySelectorId = core_bentley_1.Id64.fromJSON(props.categorySelectorId);
162
+ if (!core_bentley_1.Id64.isValid(this.categorySelectorId))
163
+ throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, `categorySelectorId is invalid`);
164
+ this.displayStyleId = core_bentley_1.Id64.fromJSON(props.displayStyleId);
165
+ if (!core_bentley_1.Id64.isValid(this.displayStyleId))
166
+ throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, `displayStyleId is invalid`);
167
+ }
168
+ /** @internal */
169
+ static get className() { return "ViewDefinition"; }
170
+ /** @internal */
171
+ toJSON() {
172
+ const json = super.toJSON();
173
+ json.categorySelectorId = this.categorySelectorId;
174
+ json.displayStyleId = this.displayStyleId;
175
+ return json;
176
+ }
177
+ /** @internal */
178
+ collectPredecessorIds(predecessorIds) {
179
+ super.collectPredecessorIds(predecessorIds);
180
+ predecessorIds.add(this.categorySelectorId);
181
+ predecessorIds.add(this.displayStyleId);
182
+ const acsId = this.getAuxiliaryCoordinateSystemId();
183
+ if (core_bentley_1.Id64.isValidId64(acsId)) {
184
+ predecessorIds.add(acsId);
185
+ }
186
+ }
187
+ /** @internal */
188
+ static onCloned(context, sourceElementProps, targetElementProps) {
189
+ super.onCloned(context, sourceElementProps, targetElementProps);
190
+ if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {
191
+ const acsId = core_bentley_1.Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);
192
+ if (core_bentley_1.Id64.isValidId64(acsId)) {
193
+ targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);
194
+ }
195
+ }
196
+ }
197
+ /** Type guard for `instanceof ViewDefinition3d` */
198
+ isView3d() { return this instanceof ViewDefinition3d; }
199
+ /** Type guard for 'instanceof ViewDefinition2d` */
200
+ isView2d() { return this instanceof ViewDefinition2d; }
201
+ /** Type guard for `instanceof SpatialViewDefinition` */
202
+ isSpatialView() { return this instanceof SpatialViewDefinition; }
203
+ /** Type guard for 'instanceof DrawingViewDefinition' */
204
+ isDrawingView() { return this instanceof DrawingViewDefinition; }
205
+ /** Load this view's DisplayStyle from the IModelDb. */
206
+ loadDisplayStyle() { return this.iModel.elements.getElement(this.displayStyleId); }
207
+ /** Load this view's CategorySelector from the IModelDb. */
208
+ loadCategorySelector() { return this.iModel.elements.getElement(this.categorySelectorId); }
209
+ /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */
210
+ getAuxiliaryCoordinateSystemId() {
211
+ return this.details.auxiliaryCoordinateSystemId;
212
+ }
213
+ /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.
214
+ * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.
215
+ */
216
+ setAuxiliaryCoordinateSystemId(acsId) {
217
+ this.details.auxiliaryCoordinateSystemId = acsId;
218
+ }
219
+ /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.
220
+ * @param iModel The IModelDb
221
+ * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.
222
+ * @param codeValue The ViewDefinition name
223
+ */
224
+ static createCode(iModel, scopeModelId, codeValue) {
225
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.viewDefinition);
226
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
227
+ }
228
+ }
229
+ exports.ViewDefinition = ViewDefinition;
230
+ /** Defines a view of one or more 3d models.
231
+ * @public
232
+ */
233
+ class ViewDefinition3d extends ViewDefinition {
234
+ /** @internal */
235
+ constructor(props, iModel) {
236
+ super(props, iModel);
237
+ this.cameraOn = core_bentley_1.JsonUtils.asBool(props.cameraOn);
238
+ this.origin = core_geometry_1.Point3d.fromJSON(props.origin);
239
+ this.extents = core_geometry_1.Vector3d.fromJSON(props.extents);
240
+ this.angles = core_geometry_1.YawPitchRollAngles.fromJSON(props.angles);
241
+ this.camera = new core_common_1.Camera(props.camera);
242
+ this._details = new core_common_1.ViewDetails3d(this.jsonProperties);
243
+ }
244
+ /** @internal */
245
+ static get className() { return "ViewDefinition3d"; }
246
+ /** @internal */
247
+ toJSON() {
248
+ const val = super.toJSON();
249
+ val.cameraOn = this.cameraOn;
250
+ val.origin = this.origin;
251
+ val.extents = this.extents;
252
+ val.angles = this.angles;
253
+ val.camera = this.camera;
254
+ return val;
255
+ }
256
+ /** Provides access to optional detail settings for this view. */
257
+ get details() { return this._details; }
258
+ /** Load this view's DisplayStyle3d from the IModelDb. */
259
+ loadDisplayStyle3d() { return this.iModel.elements.getElement(this.displayStyleId); }
260
+ }
261
+ exports.ViewDefinition3d = ViewDefinition3d;
262
+ /** Defines a view of one or more SpatialModels.
263
+ * The list of viewed models is stored by the ModelSelector.
264
+ *
265
+ * This is how a SpatialViewDefinition selects the elements to display:
266
+ *
267
+ * SpatialViewDefinition
268
+ * * ModelSelector
269
+ * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model
270
+ * * CategorySelector
271
+ * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category
272
+ * @public
273
+ */
274
+ class SpatialViewDefinition extends ViewDefinition3d {
275
+ /** @internal */
276
+ constructor(props, iModel) {
277
+ super(props, iModel);
278
+ this.modelSelectorId = core_bentley_1.Id64.fromJSON(props.modelSelectorId);
279
+ if (!core_bentley_1.Id64.isValid(this.modelSelectorId))
280
+ throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, `modelSelectorId is invalid`);
281
+ }
282
+ /** @internal */
283
+ static get className() { return "SpatialViewDefinition"; }
284
+ /** @internal */
285
+ toJSON() {
286
+ const json = super.toJSON();
287
+ json.modelSelectorId = this.modelSelectorId;
288
+ return json;
289
+ }
290
+ /** @internal */
291
+ collectPredecessorIds(predecessorIds) {
292
+ super.collectPredecessorIds(predecessorIds);
293
+ predecessorIds.add(this.modelSelectorId);
294
+ }
295
+ /** Load this view's ModelSelector from the IModelDb. */
296
+ loadModelSelector() { return this.iModel.elements.getElement(this.modelSelectorId); }
297
+ /**
298
+ * Create an SpatialViewDefinition with camera.
299
+ * @param iModelDb The iModel
300
+ * @param definitionModelId The [[DefinitionModel]]
301
+ * @param name The name/CodeValue of the view
302
+ * @param modelSelectorId The [[ModelSelector]] that this view should use
303
+ * @param categorySelectorId The [[CategorySelector]] that this view should use
304
+ * @param displayStyleId The [[DisplayStyle3d]] that this view should use
305
+ * @param range Defines the view origin and extents
306
+ * @param standardView Optionally defines the view's rotation
307
+ * @param cameraAngle Camera angle in radians.
308
+ * @returns The newly constructed OrthographicViewDefinition element
309
+ * @throws [[IModelError]] if there is a problem creating the view
310
+ */
311
+ static createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView = core_geometry_1.StandardViewIndex.Iso, cameraAngle = core_geometry_1.Angle.piOver2Radians) {
312
+ const rotation = core_geometry_1.Matrix3d.createStandardWorldToView(standardView);
313
+ const angles = core_geometry_1.YawPitchRollAngles.createFromMatrix3d(rotation);
314
+ const rotationTransform = core_geometry_1.Transform.createOriginAndMatrix(undefined, rotation);
315
+ const rotatedRange = rotationTransform.multiplyRange(range);
316
+ const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);
317
+ const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.
318
+ cameraLocation.z += cameraDistance; // Back up by camera distance.
319
+ rotation.multiplyTransposeVectorInPlace(cameraLocation);
320
+ const viewDefinitionProps = {
321
+ classFullName: this.classFullName,
322
+ model: definitionModelId,
323
+ code: this.createCode(iModelDb, definitionModelId, name),
324
+ modelSelectorId,
325
+ categorySelectorId,
326
+ displayStyleId,
327
+ origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),
328
+ extents: rotatedRange.diagonal(),
329
+ angles,
330
+ cameraOn: true,
331
+ camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },
332
+ };
333
+ return new SpatialViewDefinition(viewDefinitionProps, iModelDb);
334
+ }
335
+ /**
336
+ * Insert an SpatialViewDefinition with camera On
337
+ * @param iModelDb Insert into this iModel
338
+ * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel
339
+ * @param name The name/CodeValue of the view
340
+ * @param modelSelectorId The [[ModelSelector]] that this view should use
341
+ * @param categorySelectorId The [[CategorySelector]] that this view should use
342
+ * @param displayStyleId The [[DisplayStyle3d]] that this view should use
343
+ * @param range Defines the view origin and extents
344
+ * @param standardView Optionally defines the view's rotation
345
+ * @param cameraAngle Camera angle in radians.
346
+ * @returns The Id of the newly inserted OrthographicViewDefinition element
347
+ * @throws [[IModelError]] if there is an insert problem.
348
+ */
349
+ static insertWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView = core_geometry_1.StandardViewIndex.Iso, cameraAngle = core_geometry_1.Angle.piOver2Radians) {
350
+ const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);
351
+ return iModelDb.elements.insertElement(viewDefinition);
352
+ }
353
+ }
354
+ exports.SpatialViewDefinition = SpatialViewDefinition;
355
+ /** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.
356
+ * See [how to create a OrthographicViewDefinition]$(docs/learning/backend/CreateElements.md#OrthographicViewDefinition).
357
+ * @public
358
+ */
359
+ class OrthographicViewDefinition extends SpatialViewDefinition {
360
+ /** @internal */
361
+ static get className() { return "OrthographicViewDefinition"; }
362
+ constructor(props, iModel) { super(props, iModel); }
363
+ /**
364
+ * Create an OrthographicViewDefinition
365
+ * @param iModelDb The iModel
366
+ * @param definitionModelId The [[DefinitionModel]]
367
+ * @param name The name/CodeValue of the view
368
+ * @param modelSelectorId The [[ModelSelector]] that this view should use
369
+ * @param categorySelectorId The [[CategorySelector]] that this view should use
370
+ * @param displayStyleId The [[DisplayStyle3d]] that this view should use
371
+ * @param range Defines the view origin and extents
372
+ * @param standardView Optionally defines the view's rotation
373
+ * @returns The newly constructed OrthographicViewDefinition element
374
+ * @throws [[IModelError]] if there is a problem creating the view
375
+ */
376
+ static create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView = core_geometry_1.StandardViewIndex.Iso) {
377
+ const rotation = core_geometry_1.Matrix3d.createStandardWorldToView(standardView);
378
+ const angles = core_geometry_1.YawPitchRollAngles.createFromMatrix3d(rotation);
379
+ const rotationTransform = core_geometry_1.Transform.createOriginAndMatrix(undefined, rotation);
380
+ const rotatedRange = rotationTransform.multiplyRange(range);
381
+ const viewDefinitionProps = {
382
+ classFullName: this.classFullName,
383
+ model: definitionModelId,
384
+ code: this.createCode(iModelDb, definitionModelId, name),
385
+ modelSelectorId,
386
+ categorySelectorId,
387
+ displayStyleId,
388
+ origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),
389
+ extents: rotatedRange.diagonal(),
390
+ angles,
391
+ cameraOn: false,
392
+ camera: new core_common_1.Camera(), // not used when cameraOn === false
393
+ };
394
+ return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);
395
+ }
396
+ /**
397
+ * Insert an OrthographicViewDefinition
398
+ * @param iModelDb Insert into this iModel
399
+ * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel
400
+ * @param name The name/CodeValue of the view
401
+ * @param modelSelectorId The [[ModelSelector]] that this view should use
402
+ * @param categorySelectorId The [[CategorySelector]] that this view should use
403
+ * @param displayStyleId The [[DisplayStyle3d]] that this view should use
404
+ * @param range Defines the view origin and extents
405
+ * @param standardView Optionally defines the view's rotation
406
+ * @returns The Id of the newly inserted OrthographicViewDefinition element
407
+ * @throws [[IModelError]] if there is an insert problem.
408
+ */
409
+ static insert(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView = core_geometry_1.StandardViewIndex.Iso) {
410
+ const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);
411
+ return iModelDb.elements.insertElement(viewDefinition);
412
+ }
413
+ /** Set a new viewed range without changing the rotation or any other properties. */
414
+ setRange(range) {
415
+ const rotation = this.angles.toMatrix3d();
416
+ const rotationTransform = core_geometry_1.Transform.createOriginAndMatrix(undefined, rotation);
417
+ const rotatedRange = rotationTransform.multiplyRange(range);
418
+ this.origin = core_geometry_1.Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));
419
+ this.extents = rotatedRange.diagonal();
420
+ }
421
+ }
422
+ exports.OrthographicViewDefinition = OrthographicViewDefinition;
423
+ /** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.
424
+ * @public
425
+ */
426
+ class ViewDefinition2d extends ViewDefinition {
427
+ /** @internal */
428
+ constructor(props, iModel) {
429
+ super(props, iModel);
430
+ this.baseModelId = core_bentley_1.Id64.fromJSON(props.baseModelId);
431
+ this.origin = core_geometry_1.Point2d.fromJSON(props.origin);
432
+ this.delta = core_geometry_1.Point2d.fromJSON(props.delta);
433
+ this.angle = core_geometry_1.Angle.fromJSON(props.angle);
434
+ this._details = new core_common_1.ViewDetails(this.jsonProperties);
435
+ }
436
+ /** @internal */
437
+ static get className() { return "ViewDefinition2d"; }
438
+ /** @internal */
439
+ toJSON() {
440
+ const val = super.toJSON();
441
+ val.baseModelId = this.baseModelId;
442
+ val.origin = this.origin;
443
+ val.delta = this.delta;
444
+ val.angle = this.angle;
445
+ return val;
446
+ }
447
+ /** @internal */
448
+ collectPredecessorIds(predecessorIds) {
449
+ super.collectPredecessorIds(predecessorIds);
450
+ predecessorIds.add(this.baseModelId);
451
+ }
452
+ /** Provides access to optional detail settings for this view. */
453
+ get details() { return this._details; }
454
+ /** Load this view's DisplayStyle2d from the IModelDb. */
455
+ loadDisplayStyle2d() { return this.iModel.elements.getElement(this.displayStyleId); }
456
+ }
457
+ exports.ViewDefinition2d = ViewDefinition2d;
458
+ /** Defines a view of a [[DrawingModel]].
459
+ * @public
460
+ */
461
+ class DrawingViewDefinition extends ViewDefinition2d {
462
+ /** @internal */
463
+ static get className() { return "DrawingViewDefinition"; }
464
+ /** @internal */
465
+ constructor(props, iModel) {
466
+ super(props, iModel);
467
+ }
468
+ /** Create a DrawingViewDefinition
469
+ * @param iModelDb The iModel
470
+ * @param definitionModelId The [[DefinitionModel]]
471
+ * @param name The name/CodeValue of the view
472
+ * @param baseModelId The base [[DrawingModel]]
473
+ * @param categorySelectorId The [[CategorySelector]] that this view should use
474
+ * @param displayStyleId The [[DisplayStyle2d]] that this view should use
475
+ * @param range Defines the view origin and extents
476
+ * @throws [[IModelError]] if there is a problem creating the element.
477
+ */
478
+ static create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range) {
479
+ const viewDefinitionProps = {
480
+ classFullName: this.classFullName,
481
+ model: definitionModelId,
482
+ code: this.createCode(iModelDb, definitionModelId, name),
483
+ baseModelId,
484
+ categorySelectorId,
485
+ displayStyleId,
486
+ origin: { x: range.low.x, y: range.low.y },
487
+ delta: range.diagonal(),
488
+ angle: 0,
489
+ };
490
+ return new DrawingViewDefinition(viewDefinitionProps, iModelDb);
491
+ }
492
+ /** Insert a DrawingViewDefinition
493
+ * @param iModelDb Insert into this iModel
494
+ * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]
495
+ * @param name The name/CodeValue of the view
496
+ * @param baseModelId The base [[DrawingModel]]
497
+ * @param categorySelectorId The [[CategorySelector]] that this view should use
498
+ * @param displayStyleId The [[DisplayStyle2d]] that this view should use
499
+ * @param range Defines the view origin and extents
500
+ * @throws [[IModelError]] if there is an insert problem.
501
+ */
502
+ static insert(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range) {
503
+ const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);
504
+ return iModelDb.elements.insertElement(viewDefinition);
505
+ }
506
+ }
507
+ exports.DrawingViewDefinition = DrawingViewDefinition;
508
+ /** Defines a view of a [[SheetModel]].
509
+ * @public
510
+ */
511
+ class SheetViewDefinition extends ViewDefinition2d {
512
+ /** @internal */
513
+ static get className() { return "SheetViewDefinition"; }
514
+ }
515
+ exports.SheetViewDefinition = SheetViewDefinition;
516
+ /** A ViewDefinition used to display a 2d template model.
517
+ * @internal
518
+ */
519
+ class TemplateViewDefinition2d extends ViewDefinition2d {
520
+ /** @internal */
521
+ static get className() { return "TemplateViewDefinition2d"; }
522
+ }
523
+ exports.TemplateViewDefinition2d = TemplateViewDefinition2d;
524
+ /** A ViewDefinition used to display a 3d template model.
525
+ * @internal
526
+ */
527
+ class TemplateViewDefinition3d extends ViewDefinition3d {
528
+ /** @internal */
529
+ static get className() { return "TemplateViewDefinition3d"; }
530
+ }
531
+ exports.TemplateViewDefinition3d = TemplateViewDefinition3d;
532
+ /** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show
533
+ * coordinate information in different units and/or orientations.
534
+ * @public
535
+ */
536
+ class AuxCoordSystem extends Element_1.DefinitionElement {
537
+ constructor(props, iModel) { super(props, iModel); }
538
+ /** @internal */
539
+ static get className() { return "AuxCoordSystem"; }
540
+ }
541
+ exports.AuxCoordSystem = AuxCoordSystem;
542
+ /** A 2d auxiliary coordinate system.
543
+ * @public
544
+ */
545
+ class AuxCoordSystem2d extends AuxCoordSystem {
546
+ constructor(props, iModel) { super(props, iModel); }
547
+ /** @internal */
548
+ static get className() { return "AuxCoordSystem2d"; }
549
+ /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
550
+ * @param iModel The IModelDb
551
+ * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.
552
+ * @param codeValue The AuxCoordSystem2d name
553
+ */
554
+ static createCode(iModel, scopeModelId, codeValue) {
555
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.auxCoordSystem2d);
556
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
557
+ }
558
+ }
559
+ exports.AuxCoordSystem2d = AuxCoordSystem2d;
560
+ /** A 3d auxiliary coordinate system.
561
+ * @public
562
+ */
563
+ class AuxCoordSystem3d extends AuxCoordSystem {
564
+ constructor(props, iModel) { super(props, iModel); }
565
+ /** @internal */
566
+ static get className() { return "AuxCoordSystem3d"; }
567
+ /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
568
+ * @param iModel The IModelDb
569
+ * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.
570
+ * @param codeValue The AuxCoordSystem3d name
571
+ */
572
+ static createCode(iModel, scopeModelId, codeValue) {
573
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.auxCoordSystem3d);
574
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
575
+ }
576
+ }
577
+ exports.AuxCoordSystem3d = AuxCoordSystem3d;
578
+ /** A spatial auxiliary coordinate system.
579
+ * @public
580
+ */
581
+ class AuxCoordSystemSpatial extends AuxCoordSystem3d {
582
+ /** @internal */
583
+ static get className() { return "AuxCoordSystemSpatial"; }
584
+ /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.
585
+ * @param iModel The IModelDb
586
+ * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.
587
+ * @param codeValue The AuxCoordSystemSpatial name
588
+ */
589
+ static createCode(iModel, scopeModelId, codeValue) {
590
+ const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.auxCoordSystemSpatial);
591
+ return new core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
592
+ }
593
+ }
594
+ exports.AuxCoordSystemSpatial = AuxCoordSystemSpatial;
595
+ /** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].
596
+ * @public
597
+ */
598
+ class ViewAttachment extends Element_1.GraphicalElement2d {
599
+ constructor(props, iModel) {
600
+ super(props, iModel);
601
+ this.view = new core_common_1.RelatedElement(props.view);
602
+ // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.
603
+ }
604
+ /** @internal */
605
+ static get className() { return "ViewAttachment"; }
606
+ /** @internal */
607
+ collectPredecessorIds(predecessorIds) {
608
+ super.collectPredecessorIds(predecessorIds);
609
+ predecessorIds.add(this.view.id);
610
+ }
611
+ }
612
+ exports.ViewAttachment = ViewAttachment;
613
+ /** The position in space of a Light.
614
+ * @internal
615
+ */
616
+ class LightLocation extends Element_1.SpatialLocationElement {
617
+ /** @internal */
618
+ constructor(props, iModel) { super(props, iModel); }
619
+ /** @internal */
620
+ static get className() { return "LightLocation"; }
621
+ }
622
+ exports.LightLocation = LightLocation;
623
+ //# sourceMappingURL=ViewDefinition.js.map