@itwin/core-backend 3.4.0-dev.61 → 3.4.0-dev.63
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.
- package/CHANGELOG.md +23 -1
- package/lib/cjs/AliCloudStorageService.d.ts +23 -23
- package/lib/cjs/AliCloudStorageService.js +71 -71
- package/lib/cjs/AliCloudStorageService.js.map +1 -1
- package/lib/cjs/BackendHubAccess.d.ts +224 -224
- package/lib/cjs/BackendHubAccess.js +41 -41
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
- package/lib/cjs/BackendLoggerCategory.js +99 -99
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts +21 -21
- package/lib/cjs/BisCoreSchema.js +60 -60
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +165 -165
- package/lib/cjs/BriefcaseManager.js +405 -405
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +153 -153
- package/lib/cjs/Category.js +243 -243
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
- package/lib/cjs/ChangeSummaryManager.js +445 -445
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts +99 -99
- package/lib/cjs/ChangedElementsDb.js +165 -165
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.d.ts +39 -39
- package/lib/cjs/ChangedElementsManager.js +88 -88
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts +120 -120
- package/lib/cjs/CheckpointManager.js +343 -343
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +71 -71
- package/lib/cjs/ClassRegistry.js +215 -215
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +349 -349
- package/lib/cjs/CloudSqlite.js +151 -151
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CloudStorageBackend.d.ts +58 -58
- package/lib/cjs/CloudStorageBackend.js +173 -173
- package/lib/cjs/CloudStorageBackend.js.map +1 -1
- package/lib/cjs/CodeService.d.ts +396 -396
- package/lib/cjs/CodeService.js +63 -63
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +50 -50
- package/lib/cjs/CodeSpecs.js +112 -112
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +11 -11
- package/lib/cjs/ConcurrentQuery.js +30 -30
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
- package/lib/cjs/CustomViewState3dCreator.js +113 -113
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.d.ts +71 -71
- package/lib/cjs/DevTools.js +154 -154
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +106 -106
- package/lib/cjs/DisplayStyle.js +256 -256
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +191 -191
- package/lib/cjs/ECDb.js +350 -350
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
- package/lib/cjs/ECSchemaXmlContext.js +41 -41
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +466 -466
- package/lib/cjs/ECSqlStatement.js +791 -791
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +1109 -1109
- package/lib/cjs/Element.js +1420 -1420
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +156 -156
- package/lib/cjs/ElementAspect.js +178 -178
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts +9 -9
- package/lib/cjs/ElementGraphics.js +41 -41
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +162 -162
- package/lib/cjs/ElementTreeWalker.js +409 -409
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.d.ts +76 -76
- package/lib/cjs/Entity.js +82 -82
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +317 -317
- package/lib/cjs/ExportGraphics.js +208 -208
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +94 -94
- package/lib/cjs/ExternalSource.js +125 -125
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts +19 -19
- package/lib/cjs/GeoCoordConfig.js +82 -82
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeometrySummary.d.ts +4 -4
- package/lib/cjs/GeometrySummary.js +380 -380
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.d.ts +93 -93
- package/lib/cjs/HubMock.js +190 -190
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.d.ts +85 -85
- package/lib/cjs/IModelCloneContext.js +150 -150
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +1164 -1164
- package/lib/cjs/IModelDb.js +2324 -2324
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +361 -361
- package/lib/cjs/IModelHost.js +489 -489
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.d.ts +62 -62
- package/lib/cjs/IModelJsFs.js +140 -140
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts +98 -98
- package/lib/cjs/IpcHost.js +234 -234
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +311 -311
- package/lib/cjs/LineStyle.js +295 -295
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts +162 -162
- package/lib/cjs/LocalHub.js +587 -587
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
- package/lib/cjs/LocalhostIpcHost.js +81 -81
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/Material.d.ts +103 -103
- package/lib/cjs/Material.js +147 -147
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +386 -386
- package/lib/cjs/Model.js +471 -471
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.d.ts +51 -51
- package/lib/cjs/NativeAppStorage.js +202 -202
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.d.ts +52 -52
- package/lib/cjs/NativeHost.js +168 -168
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.d.ts +156 -156
- package/lib/cjs/NavigationRelationship.js +225 -225
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.d.ts +51 -51
- package/lib/cjs/PromiseMemoizer.js +101 -101
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.d.ts +132 -132
- package/lib/cjs/PropertyStore.js +11 -11
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +400 -400
- package/lib/cjs/Relationship.js +465 -465
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.d.ts +28 -28
- package/lib/cjs/RpcBackend.js +126 -126
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +219 -219
- package/lib/cjs/SQLiteDb.js +214 -214
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.d.ts +55 -55
- package/lib/cjs/Schema.js +83 -83
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/ServerBasedLocks.d.ts +57 -57
- package/lib/cjs/ServerBasedLocks.js +168 -168
- package/lib/cjs/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +283 -283
- package/lib/cjs/SqliteStatement.js +448 -448
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +58 -58
- package/lib/cjs/Texture.js +82 -82
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.d.ts +18 -18
- package/lib/cjs/TileStorage.js +90 -90
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +202 -202
- package/lib/cjs/TxnManager.js +356 -356
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +435 -435
- package/lib/cjs/ViewDefinition.js +635 -635
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.d.ts +13 -13
- package/lib/cjs/ViewStateHydrator.js +103 -103
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
- package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
- package/lib/cjs/core-backend.d.ts +182 -182
- package/lib/cjs/core-backend.js +202 -202
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
- package/lib/cjs/domains/FunctionalElements.js +145 -145
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
- package/lib/cjs/domains/FunctionalSchema.js +40 -40
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +177 -177
- package/lib/cjs/domains/GenericElements.js +263 -263
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.d.ts +10 -10
- package/lib/cjs/domains/GenericSchema.js +28 -28
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +204 -204
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
- package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +186 -186
- package/lib/cjs/workspace/Settings.js +155 -155
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
- package/lib/cjs/workspace/SettingsSchemas.js +191 -191
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +414 -414
- package/lib/cjs/workspace/Workspace.js +543 -543
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +12 -12
package/lib/cjs/CodeSpecs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeSpecs.js","sourceRoot":"","sources":["../../src/CodeSpecs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+E;AAC/E,oDAA0E;AAI1E;;GAEG;AACH,MAAa,SAAS;IAIpB,YAAY,MAAgB;QAFpB,qBAAgB,GAAe,EAAE,CAAC;QAGxC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,MAAM,CAAC,aAAa,EAAE,EAAE;YAC1B,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC/E;IACH,CAAC;IAED,8DAA8D;IACvD,OAAO,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,4DAA4D,EAAE,CAAC,IAAoB,EAAE,EAAE;YAC/H,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC9B,IAAI,uBAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,IAAI,EAAE;gBACxC,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACvF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,UAAsB;QACnC,IAAI,mBAAI,CAAC,SAAS,CAAC,UAAU,CAAC;YAC5B,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,EAAE,CAAC;YAC/B,OAAO,sBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxHD,8BAwHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"CodeSpecs.js","sourceRoot":"","sources":["../../src/CodeSpecs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+E;AAC/E,oDAA0E;AAI1E;;GAEG;AACH,MAAa,SAAS;IAIpB,YAAY,MAAgB;QAFpB,qBAAgB,GAAe,EAAE,CAAC;QAGxC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,MAAM,CAAC,aAAa,EAAE,EAAE;YAC1B,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC/E;IACH,CAAC;IAED,8DAA8D;IACvD,OAAO,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,4DAA4D,EAAE,CAAC,IAAoB,EAAE,EAAE;YAC/H,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC9B,IAAI,uBAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,IAAI,EAAE;gBACxC,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACvF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IAC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C,SAAS,EAAE,oBAAoB,CAAC,CAAC;YAEtE,MAAM,GAAG,GAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,sBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxHD,8BAwHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Codes\n */\n\nimport { DbResult, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { CodeScopeSpec, CodeSpec, IModelError } from \"@itwin/core-common\";\nimport { ECSqlStatement } from \"./ECSqlStatement\";\nimport { IModelDb } from \"./IModelDb\";\n\n/** Manages [CodeSpecs]($docs/BIS/guide/fundamentals/element-fundamentals.md#codespec) within an [[IModelDb]]\n * @public\n */\nexport class CodeSpecs {\n private _imodel: IModelDb;\n private _loadedCodeSpecs: CodeSpec[] = [];\n\n constructor(imodel: IModelDb) {\n this._imodel = imodel;\n if (imodel.isBriefcaseDb()) {\n imodel.onChangesetApplied.addListener(() => this._loadedCodeSpecs.length = 0);\n }\n }\n\n /** Look up the Id of the CodeSpec with the specified name. */\n public queryId(name: string): Id64String {\n return this._imodel.withPreparedStatement(\"SELECT ECInstanceId FROM BisCore.CodeSpec WHERE Name=:name\", (stmt: ECSqlStatement) => {\n stmt.bindString(\"name\", name);\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\n throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\", () => ({ name }));\n return stmt.getValue(0).getId();\n });\n }\n\n /** Look up a CodeSpec by Id. The CodeSpec will be loaded from the database if necessary.\n * @param codeSpecId The Id of the CodeSpec to load\n * @returns The CodeSpec with the specified Id\n * @throws [[IModelError]] if the Id is invalid or if no CodeSpec with that Id could be found.\n */\n public getById(codeSpecId: Id64String): CodeSpec {\n if (Id64.isInvalid(codeSpecId))\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\n\n // good chance it is already loaded - check there before running a query\n const found = this._loadedCodeSpecs.find((codeSpec) => codeSpec.id === codeSpecId);\n if (found !== undefined)\n return found;\n\n // must load this codespec\n const loadedCodeSpec = this.load(codeSpecId);\n this._loadedCodeSpecs.push(loadedCodeSpec);\n return loadedCodeSpec;\n }\n\n /** Returns true if the IModelDb has a CodeSpec of the specified Id. */\n public hasId(codeSpecId: Id64String): boolean {\n try {\n return undefined !== this.getById(codeSpecId);\n } catch (error) {\n return false;\n }\n }\n\n /** Look up a CodeSpec by name. The CodeSpec will be loaded from the database if necessary.\n * @param name The name of the CodeSpec to load\n * @returns The CodeSpec with the specified name\n * @throws [[IModelError]] if no CodeSpec with the specified name could be found.\n */\n public getByName(name: string): CodeSpec {\n // good chance it is already loaded - check there before running a query\n const found: CodeSpec | undefined = this._loadedCodeSpecs.find((codeSpec) => codeSpec.name === name);\n if (found !== undefined)\n return found;\n const codeSpecId = this.queryId(name);\n if (codeSpecId === undefined)\n throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\", () => ({ name }));\n return this.getById(codeSpecId);\n }\n\n /** Returns true if the IModelDb has a CodeSpec of the specified name. */\n public hasName(name: string): boolean {\n try {\n return undefined !== this.getByName(name);\n } catch (error) {\n return false;\n }\n }\n\n /** Add a new CodeSpec to the iModel.\n * @param codeSpec The CodeSpec to insert\n * @returns The Id of the persistent CodeSpec.\n * @note If successful, this method will assign a valid CodeSpecId to the supplied CodeSpec\n * @throws IModelError if the insertion fails\n */\n public insert(codeSpec: CodeSpec): Id64String;\n /** Add a new CodeSpec to the IModelDb.\n * @param name The name for the new CodeSpec.\n * @param scopeType The scope type\n * @returns The Id of the persistent CodeSpec.\n * @throws IModelError if the insertion fails\n */\n public insert(name: string, scopeType: CodeScopeSpec.Type): Id64String;\n public insert(codeSpecOrName: CodeSpec | string, scopeType?: CodeScopeSpec.Type): Id64String {\n if (codeSpecOrName instanceof CodeSpec) {\n const codeSpec = codeSpecOrName;\n const id: Id64String = this._imodel.insertCodeSpec(codeSpec);\n codeSpec.id = id;\n return id;\n }\n if (typeof codeSpecOrName === \"string\") {\n const name = codeSpecOrName;\n if (scopeType)\n return this._imodel.insertCodeSpec(CodeSpec.create(this._imodel, name, scopeType));\n }\n throw new IModelError(IModelStatus.BadArg, \"Invalid argument\");\n }\n\n /** Load a CodeSpec from the iModel\n * @param id The persistent Id of the CodeSpec to load\n */\n public load(id: Id64String): CodeSpec {\n if (Id64.isInvalid(id))\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\n\n return this._imodel.withPreparedStatement(\"SELECT name,jsonProperties FROM BisCore.CodeSpec WHERE ECInstanceId=?\", (stmt: ECSqlStatement) => {\n stmt.bindId(1, id);\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\n\n const row: any = stmt.getRow();\n return CodeSpec.createFromJson(this._imodel, id, row.name, JSON.parse(row.jsonProperties));\n });\n }\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IModelJsNative } from "@bentley/imodeljs-native";
|
|
2
|
-
import { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse } from "@itwin/core-common";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare type OnResponse = (response: Response) => void;
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare class ConcurrentQuery {
|
|
7
|
-
/** @internal */
|
|
8
|
-
static executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse>;
|
|
9
|
-
/** @internal */
|
|
10
|
-
static executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse>;
|
|
11
|
-
}
|
|
1
|
+
import { IModelJsNative } from "@bentley/imodeljs-native";
|
|
2
|
+
import { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse } from "@itwin/core-common";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare type OnResponse = (response: Response) => void;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare class ConcurrentQuery {
|
|
7
|
+
/** @internal */
|
|
8
|
+
static executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse>;
|
|
9
|
+
/** @internal */
|
|
10
|
+
static executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse>;
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=ConcurrentQuery.d.ts.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConcurrentQuery = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const core_common_1 = require("@itwin/core-common");
|
|
9
|
-
/** @internal */
|
|
10
|
-
class ConcurrentQuery {
|
|
11
|
-
/** @internal */
|
|
12
|
-
static async executeQueryRequest(conn, request) {
|
|
13
|
-
return new Promise((resolve) => {
|
|
14
|
-
request.kind = core_common_1.DbRequestKind.ECSql;
|
|
15
|
-
conn.concurrentQueryExecute(request, (response) => {
|
|
16
|
-
resolve(response);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
/** @internal */
|
|
21
|
-
static async executeBlobRequest(conn, request) {
|
|
22
|
-
return new Promise((resolve) => {
|
|
23
|
-
request.kind = core_common_1.DbRequestKind.BlobIO;
|
|
24
|
-
conn.concurrentQueryExecute(request, (response) => {
|
|
25
|
-
resolve(response);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.ConcurrentQuery = ConcurrentQuery;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConcurrentQuery = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const core_common_1 = require("@itwin/core-common");
|
|
9
|
+
/** @internal */
|
|
10
|
+
class ConcurrentQuery {
|
|
11
|
+
/** @internal */
|
|
12
|
+
static async executeQueryRequest(conn, request) {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
request.kind = core_common_1.DbRequestKind.ECSql;
|
|
15
|
+
conn.concurrentQueryExecute(request, (response) => {
|
|
16
|
+
resolve(response);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
static async executeBlobRequest(conn, request) {
|
|
22
|
+
return new Promise((resolve) => {
|
|
23
|
+
request.kind = core_common_1.DbRequestKind.BlobIO;
|
|
24
|
+
conn.concurrentQueryExecute(request, (response) => {
|
|
25
|
+
resolve(response);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ConcurrentQuery = ConcurrentQuery;
|
|
31
31
|
//# sourceMappingURL=ConcurrentQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AACA;;;+FAG+F;AAC/F,oDAAmH;AAKnH,gBAAgB;AAChB,MAAa,eAAe;IAC1B,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAgD,EAAE,OAAuB;QAC/G,OAAO,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,EAAE;YAC9C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,KAAK,CAAC;YACnC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA2B,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAgD,EAAE,OAAsB;QAC7G,OAAO,IAAI,OAAO,CAAiB,CAAC,OAAO,EAAE,EAAE;YAC7C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA0B,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,0CAmBC","sourcesContent":["import { IModelJsNative } from \"@bentley/imodeljs-native\";\
|
|
1
|
+
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AACA;;;+FAG+F;AAC/F,oDAAmH;AAKnH,gBAAgB;AAChB,MAAa,eAAe;IAC1B,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAgD,EAAE,OAAuB;QAC/G,OAAO,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,EAAE;YAC9C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,KAAK,CAAC;YACnC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA2B,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAgD,EAAE,OAAsB;QAC7G,OAAO,IAAI,OAAO,CAAiB,CAAC,OAAO,EAAE,EAAE;YAC7C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA0B,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,0CAmBC","sourcesContent":["import { IModelJsNative } from \"@bentley/imodeljs-native\";\n/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse, DbRequestKind } from \"@itwin/core-common\";\n\n/** @internal */\nexport type OnResponse = (response: Response) => void;\n\n/** @internal */\nexport class ConcurrentQuery {\n /** @internal */\n public static async executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse> {\n return new Promise<DbQueryResponse>((resolve) => {\n request.kind = DbRequestKind.ECSql;\n conn.concurrentQueryExecute(request as any, (response: any) => {\n resolve(response as DbQueryResponse);\n });\n });\n }\n /** @internal */\n public static async executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse> {\n return new Promise<DbBlobResponse>((resolve) => {\n request.kind = DbRequestKind.BlobIO;\n conn.concurrentQueryExecute(request as any, (response: any) => {\n resolve(response as DbBlobResponse);\n });\n });\n }\n}\n"]}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { CustomViewState3dCreatorOptions, CustomViewState3dProps } from "@itwin/core-common";
|
|
2
|
-
import { IModelDb } from "./IModelDb";
|
|
3
|
-
/**
|
|
4
|
-
* Class which helps to generate a custom ViewState3d.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class CustomViewState3dCreator {
|
|
8
|
-
private _imodel;
|
|
9
|
-
constructor(iModel: IModelDb);
|
|
10
|
-
/**
|
|
11
|
-
* Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
|
|
12
|
-
* @param [modelIds] Ids of models to display in the view.
|
|
13
|
-
* @throws [IModelError]($common) If no 3d models are found in the iModel.
|
|
14
|
-
* @returns CustomViewState3dProps
|
|
15
|
-
*/
|
|
16
|
-
getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps>;
|
|
17
|
-
private _getAllCategories;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.
|
|
20
|
-
* @param modelIdsList array of modelIds to get extents for
|
|
21
|
-
* @returns Range3d, the union of the extents of each model id
|
|
22
|
-
*/
|
|
23
|
-
private _getModelExtents;
|
|
24
|
-
/**
|
|
25
|
-
* Get all PhysicalModel ids in the iModel
|
|
26
|
-
*/
|
|
27
|
-
private _getAllModels;
|
|
28
|
-
/**
|
|
29
|
-
* Helper function to execute ECSql queries.
|
|
30
|
-
*/
|
|
31
|
-
private _executeQuery;
|
|
32
|
-
}
|
|
1
|
+
import { CustomViewState3dCreatorOptions, CustomViewState3dProps } from "@itwin/core-common";
|
|
2
|
+
import { IModelDb } from "./IModelDb";
|
|
3
|
+
/**
|
|
4
|
+
* Class which helps to generate a custom ViewState3d.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class CustomViewState3dCreator {
|
|
8
|
+
private _imodel;
|
|
9
|
+
constructor(iModel: IModelDb);
|
|
10
|
+
/**
|
|
11
|
+
* Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
|
|
12
|
+
* @param [modelIds] Ids of models to display in the view.
|
|
13
|
+
* @throws [IModelError]($common) If no 3d models are found in the iModel.
|
|
14
|
+
* @returns CustomViewState3dProps
|
|
15
|
+
*/
|
|
16
|
+
getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps>;
|
|
17
|
+
private _getAllCategories;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.
|
|
20
|
+
* @param modelIdsList array of modelIds to get extents for
|
|
21
|
+
* @returns Range3d, the union of the extents of each model id
|
|
22
|
+
*/
|
|
23
|
+
private _getModelExtents;
|
|
24
|
+
/**
|
|
25
|
+
* Get all PhysicalModel ids in the iModel
|
|
26
|
+
*/
|
|
27
|
+
private _getAllModels;
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to execute ECSql queries.
|
|
30
|
+
*/
|
|
31
|
+
private _executeQuery;
|
|
32
|
+
}
|
|
33
33
|
//# sourceMappingURL=CustomViewState3dCreator.d.ts.map
|
|
@@ -1,114 +1,114 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.CustomViewState3dCreator = void 0;
|
|
8
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
-
const core_common_1 = require("@itwin/core-common");
|
|
10
|
-
const core_geometry_1 = require("@itwin/core-geometry");
|
|
11
|
-
const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
|
|
12
|
-
const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.CustomViewState3dCreator;
|
|
13
|
-
/**
|
|
14
|
-
* Class which helps to generate a custom ViewState3d.
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
class CustomViewState3dCreator {
|
|
18
|
-
constructor(iModel) {
|
|
19
|
-
/**
|
|
20
|
-
* Helper function to execute ECSql queries.
|
|
21
|
-
*/
|
|
22
|
-
this._executeQuery = async (query) => {
|
|
23
|
-
const rows = [];
|
|
24
|
-
for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
|
|
25
|
-
rows.push(row.id);
|
|
26
|
-
return rows;
|
|
27
|
-
};
|
|
28
|
-
this._imodel = iModel;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
|
|
32
|
-
* @param [modelIds] Ids of models to display in the view.
|
|
33
|
-
* @throws [IModelError]($common) If no 3d models are found in the iModel.
|
|
34
|
-
* @returns CustomViewState3dProps
|
|
35
|
-
*/
|
|
36
|
-
async getCustomViewState3dData(options) {
|
|
37
|
-
let decompressedModelIds;
|
|
38
|
-
if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
|
|
39
|
-
decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
|
|
40
|
-
const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
|
|
41
|
-
const categories = await this._getAllCategories();
|
|
42
|
-
const modelExtents = await this._getModelExtents(models);
|
|
43
|
-
return {
|
|
44
|
-
modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
|
|
45
|
-
categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
|
|
46
|
-
modelExtents: modelExtents.toJSON(),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
async _getAllCategories() {
|
|
50
|
-
// Only use categories with elements in them
|
|
51
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllCategories query.");
|
|
52
|
-
const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
|
|
53
|
-
const categories = await this._executeQuery(query);
|
|
54
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllCategories query.");
|
|
55
|
-
return categories;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.
|
|
59
|
-
* @param modelIdsList array of modelIds to get extents for
|
|
60
|
-
* @returns Range3d, the union of the extents of each model id
|
|
61
|
-
*/
|
|
62
|
-
async _getModelExtents(modelIdsList) {
|
|
63
|
-
const modelExtents = new core_geometry_1.Range3d();
|
|
64
|
-
if (modelIdsList.length === 0)
|
|
65
|
-
return modelExtents;
|
|
66
|
-
const modelIds = new Set(modelIdsList);
|
|
67
|
-
for (const id of modelIds) {
|
|
68
|
-
const modelExtentsStopWatch = new core_bentley_1.StopWatch("getModelExtents query", false);
|
|
69
|
-
try {
|
|
70
|
-
await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.
|
|
71
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Starting getModelExtents query.", { modelId: id });
|
|
72
|
-
modelExtentsStopWatch.start();
|
|
73
|
-
const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;
|
|
74
|
-
modelExtentsStopWatch.stop();
|
|
75
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
|
|
76
|
-
modelExtents.union(core_geometry_1.Range3d.fromJSON(props), modelExtents);
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
modelExtentsStopWatch.stop();
|
|
80
|
-
if (err.errorNumber === core_common_1.IModelStatus.NoGeometry) { // if there was no geometry, just return null range
|
|
81
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with NoGeometry error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err === null || err === void 0 ? void 0 : err.message, errorNumber: err === null || err === void 0 ? void 0 : err.errorNumber });
|
|
85
|
-
if (modelIds.size === 1)
|
|
86
|
-
throw err; // if they're asking for more than one model, don't throw on error.
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return modelExtents;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get all PhysicalModel ids in the iModel
|
|
94
|
-
*/
|
|
95
|
-
async _getAllModels() {
|
|
96
|
-
// Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
|
|
97
|
-
// If the iModel has an earlier version, the statement will throw because the property does not exist.
|
|
98
|
-
// If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.
|
|
99
|
-
const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
|
|
100
|
-
const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
|
|
101
|
-
let models = [];
|
|
102
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllModels query.");
|
|
103
|
-
try {
|
|
104
|
-
models = await this._executeQuery(`${select} ${spatialCriterion}`);
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
models = await this._executeQuery(select);
|
|
108
|
-
}
|
|
109
|
-
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllModels query.");
|
|
110
|
-
return models;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.CustomViewState3dCreator = CustomViewState3dCreator;
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.CustomViewState3dCreator = void 0;
|
|
8
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
+
const core_common_1 = require("@itwin/core-common");
|
|
10
|
+
const core_geometry_1 = require("@itwin/core-geometry");
|
|
11
|
+
const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
|
|
12
|
+
const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.CustomViewState3dCreator;
|
|
13
|
+
/**
|
|
14
|
+
* Class which helps to generate a custom ViewState3d.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
class CustomViewState3dCreator {
|
|
18
|
+
constructor(iModel) {
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to execute ECSql queries.
|
|
21
|
+
*/
|
|
22
|
+
this._executeQuery = async (query) => {
|
|
23
|
+
const rows = [];
|
|
24
|
+
for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
|
|
25
|
+
rows.push(row.id);
|
|
26
|
+
return rows;
|
|
27
|
+
};
|
|
28
|
+
this._imodel = iModel;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
|
|
32
|
+
* @param [modelIds] Ids of models to display in the view.
|
|
33
|
+
* @throws [IModelError]($common) If no 3d models are found in the iModel.
|
|
34
|
+
* @returns CustomViewState3dProps
|
|
35
|
+
*/
|
|
36
|
+
async getCustomViewState3dData(options) {
|
|
37
|
+
let decompressedModelIds;
|
|
38
|
+
if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
|
|
39
|
+
decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
|
|
40
|
+
const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
|
|
41
|
+
const categories = await this._getAllCategories();
|
|
42
|
+
const modelExtents = await this._getModelExtents(models);
|
|
43
|
+
return {
|
|
44
|
+
modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
|
|
45
|
+
categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
|
|
46
|
+
modelExtents: modelExtents.toJSON(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async _getAllCategories() {
|
|
50
|
+
// Only use categories with elements in them
|
|
51
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllCategories query.");
|
|
52
|
+
const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
|
|
53
|
+
const categories = await this._executeQuery(query);
|
|
54
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllCategories query.");
|
|
55
|
+
return categories;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.
|
|
59
|
+
* @param modelIdsList array of modelIds to get extents for
|
|
60
|
+
* @returns Range3d, the union of the extents of each model id
|
|
61
|
+
*/
|
|
62
|
+
async _getModelExtents(modelIdsList) {
|
|
63
|
+
const modelExtents = new core_geometry_1.Range3d();
|
|
64
|
+
if (modelIdsList.length === 0)
|
|
65
|
+
return modelExtents;
|
|
66
|
+
const modelIds = new Set(modelIdsList);
|
|
67
|
+
for (const id of modelIds) {
|
|
68
|
+
const modelExtentsStopWatch = new core_bentley_1.StopWatch("getModelExtents query", false);
|
|
69
|
+
try {
|
|
70
|
+
await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.
|
|
71
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Starting getModelExtents query.", { modelId: id });
|
|
72
|
+
modelExtentsStopWatch.start();
|
|
73
|
+
const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;
|
|
74
|
+
modelExtentsStopWatch.stop();
|
|
75
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
|
|
76
|
+
modelExtents.union(core_geometry_1.Range3d.fromJSON(props), modelExtents);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
modelExtentsStopWatch.stop();
|
|
80
|
+
if (err.errorNumber === core_common_1.IModelStatus.NoGeometry) { // if there was no geometry, just return null range
|
|
81
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with NoGeometry error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err === null || err === void 0 ? void 0 : err.message, errorNumber: err === null || err === void 0 ? void 0 : err.errorNumber });
|
|
85
|
+
if (modelIds.size === 1)
|
|
86
|
+
throw err; // if they're asking for more than one model, don't throw on error.
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return modelExtents;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get all PhysicalModel ids in the iModel
|
|
94
|
+
*/
|
|
95
|
+
async _getAllModels() {
|
|
96
|
+
// Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
|
|
97
|
+
// If the iModel has an earlier version, the statement will throw because the property does not exist.
|
|
98
|
+
// If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.
|
|
99
|
+
const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
|
|
100
|
+
const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
|
|
101
|
+
let models = [];
|
|
102
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllModels query.");
|
|
103
|
+
try {
|
|
104
|
+
models = await this._executeQuery(`${select} ${spatialCriterion}`);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
models = await this._executeQuery(select);
|
|
108
|
+
}
|
|
109
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllModels query.");
|
|
110
|
+
return models;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.CustomViewState3dCreator = CustomViewState3dCreator;
|
|
114
114
|
//# sourceMappingURL=CustomViewState3dCreator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAClG,oDAAwI;AACxI,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAuFnC;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,4BAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QA/FA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,wBAAw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AE,WAAW,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,EAAC,CAAC,CAAC;gBAErM,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;oBACrB,MAAM,GAAG,CAAC,CAAC,mEAAmE;gBAChF,SAAS;aACV;SACF;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CAWF;AAnGD,4DAmGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAClG,oDAAwI;AACxI,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAuFnC;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,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AAM,CAAC,OAAO,CAAC,cAAc,EAAE,uDAAuD,EAAE,EAAC,aAAa,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;oBACrJ,SAAS;iBACV;gBACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,4CAA4C,EAAE,EAAC,aAAa,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE,WAAW,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,EAAC,CAAC,CAAC;gBAErM,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;oBACrB,MAAM,GAAG,CAAC,CAAC,mEAAmE;gBAChF,SAAS;aACV;SACF;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CAWF;AAnGD,4DAmGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { CompressedId64Set, Id64Array, Id64String, Logger, StopWatch } from \"@itwin/core-bentley\";\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, IModelError, IModelStatus, QueryRowFormat } from \"@itwin/core-common\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { IModelDb } from \"./IModelDb\";\n\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\n\n/**\n * Class which helps to generate a custom ViewState3d.\n * @internal\n */\nexport class CustomViewState3dCreator {\n private _imodel: IModelDb;\n public constructor(iModel: IModelDb) {\n this._imodel = iModel;\n }\n /**\n * Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\n * @param [modelIds] Ids of models to display in the view.\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\n * @returns CustomViewState3dProps\n */\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\n let decompressedModelIds;\n if (options?.modelIds !== undefined)\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\n const categories: Id64Array = await this._getAllCategories();\n const modelExtents: Range3d = await this._getModelExtents(models);\n return {\n modelIds: CompressedId64Set.sortAndCompress(models),\n categoryIds: CompressedId64Set.sortAndCompress(categories),\n modelExtents: modelExtents.toJSON(),\n };\n }\n\n private async _getAllCategories(): Promise<Id64Array> {\n // Only use categories with elements in them\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\n const categories: Id64Array = await this._executeQuery(query);\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\n return categories;\n }\n\n /**\n * Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.\n * @param modelIdsList array of modelIds to get extents for\n * @returns Range3d, the union of the extents of each model id\n */\n private async _getModelExtents(modelIdsList: Id64String[]): Promise<Range3d> {\n const modelExtents = new Range3d();\n if (modelIdsList.length === 0)\n return modelExtents;\n const modelIds = new Set(modelIdsList);\n for (const id of modelIds) {\n const modelExtentsStopWatch = new StopWatch(\"getModelExtents query\", false);\n try {\n await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.\n Logger.logInfo(loggerCategory, \"Starting getModelExtents query.\", {modelId: id});\n modelExtentsStopWatch.start();\n const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;\n modelExtentsStopWatch.stop();\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id});\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\n } catch (err: any) {\n modelExtentsStopWatch.stop();\n if ((err as IModelError).errorNumber === IModelStatus.NoGeometry) { // if there was no geometry, just return null range\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query with NoGeometry error.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id});\n continue;\n }\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query with error.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err?.message, errorNumber: err?.errorNumber});\n\n if (modelIds.size === 1)\n throw err; // if they're asking for more than one model, don't throw on error.\n continue;\n }\n }\n return modelExtents;\n }\n\n /**\n * Get all PhysicalModel ids in the iModel\n */\n private async _getAllModels(): Promise<Id64Array> {\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\n let models = [];\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\n try {\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\n } catch {\n models = await this._executeQuery(select);\n }\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\n return models;\n }\n /**\n * Helper function to execute ECSql queries.\n */\n private _executeQuery = async (query: string) => {\n const rows = [];\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\n rows.push(row.id);\n\n return rows;\n };\n}\n"]}
|