@itwin/core-backend 5.1.0-dev.20 → 5.1.0-dev.25

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.
@@ -2,8 +2,8 @@
2
2
  * @module iModels
3
3
  */
4
4
  import { AccessToken, BeDuration, GuidString, Optional } from "@itwin/core-bentley";
5
- import { BriefcaseId, BriefcaseProps, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, LocalBriefcaseProps, LocalDirName, LocalFileName, RequestNewBriefcaseProps } from "@itwin/core-common";
6
- import { AcquireNewBriefcaseIdArg, IModelNameArg } from "./BackendHubAccess";
5
+ import { BriefcaseId, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, LocalBriefcaseProps, LocalDirName, LocalFileName, RequestNewBriefcaseProps } from "@itwin/core-common";
6
+ import { AcquireNewBriefcaseIdArg, DownloadChangesetArg, DownloadChangesetRangeArg, IModelNameArg } from "./BackendHubAccess";
7
7
  import { ProgressFunction } from "./CheckpointManager";
8
8
  import { BriefcaseDb, IModelDb, TokenArg } from "./IModelDb";
9
9
  /** The argument for [[BriefcaseManager.downloadBriefcase]]
@@ -174,6 +174,14 @@ export declare class BriefcaseManager {
174
174
  * - returns true if the delete was successful.
175
175
  */
176
176
  private static deleteFolderContents;
177
+ /** Download all the changesets in the specified range.
178
+ * @beta
179
+ */
180
+ static downloadChangesets(arg: DownloadChangesetRangeArg): Promise<ChangesetFileProps[]>;
181
+ /** Download a single changeset.
182
+ * @beta
183
+ */
184
+ static downloadChangeset(arg: DownloadChangesetArg): Promise<ChangesetFileProps>;
177
185
  /** Query the hub for the properties for a ChangesetIndex or ChangesetId */
178
186
  static queryChangeset(arg: {
179
187
  iModelId: GuidString;
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseManager.d.ts","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAC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UAAU,CAAC;QAAC,SAAS,EAAE,kBAAkB,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAIzH,gFAAgF;WAC5D,eAAe,CAAC,GAAG,EAAE;QAAE,QAAQ,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAIpH,wEAAwE;WACpD,kBAAkB,CAAC,GAAG,EAAE;QAAE,QAAQ,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAI9F;;;OAGG;WACiB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAI1F;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;mBAajB,oBAAoB;IAWzC,gBAAgB;WACI,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoD9F,gBAAgB;WACI,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IA8E7F,4EAA4E;mBACvD,WAAW;IA4ChC;;OAEG;WACiB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBxF"}
@@ -303,6 +303,18 @@ class BriefcaseManager {
303
303
  }
304
304
  return status;
305
305
  }
306
+ /** Download all the changesets in the specified range.
307
+ * @beta
308
+ */
309
+ static async downloadChangesets(arg) {
310
+ return IModelHost_1.IModelHost[Symbols_1._hubAccess].downloadChangesets(arg);
311
+ }
312
+ /** Download a single changeset.
313
+ * @beta
314
+ */
315
+ static async downloadChangeset(arg) {
316
+ return IModelHost_1.IModelHost[Symbols_1._hubAccess].downloadChangeset(arg);
317
+ }
306
318
  /** Query the hub for the properties for a ChangesetIndex or ChangesetId */
307
319
  static async queryChangeset(arg) {
308
320
  return IModelHost_1.IModelHost[Symbols_1._hubAccess].queryChangeset({ ...arg, accessToken: await IModelHost_1.IModelHost.getAccessToken() });
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseManager.js","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qCAAqC;AAErC,6BAA6B;AAC7B,sDAE6B;AAC7B,oDAG4B;AAE5B,mEAAgE;AAChE,2DAA2F;AAC3F,yCAA6D;AAC7D,6CAA0C;AAC1C,6CAA0C;AAC1C,6CAA0C;AAC1C,gDAA6E;AAC7E,8DAAyD;AAEzD,MAAM,cAAc,GAAG,6CAAqB,CAAC,QAAQ,CAAC;AA0EtD;;GAEG;AACH,MAAa,gBAAgB;IAC3B,wFAAwF;IACjF,MAAM,CAAC,aAAa,CAAC,QAAoB,IAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/G,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAAC,QAAoB,IAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAErI,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,QAAoB,IAAmB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhK,gBAAgB;IACT,MAAM,CAAC,0BAA0B,CAAC,QAAoB,IAAmB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAExJ,MAAM,CAAC,gBAA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,CAAC;gBACZ,CAAC;YACH,CAAC;oBAAS,CAAC;gBACT,uBAAU,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAe,EAAE,GAAoB;QACrE,IAAI,UAAU,GAAG,GAAG,CAAC,eAAe,IAAI,CAAC,CAAC;QAC1C,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;gBACvD,IAAI,CAAC,EAAE,CAAC,4BAA4B;oBAClC,MAAM,uBAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC5B,OAAO,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YACrD,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,IAAI,UAAU,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,8BAAe,CAAC,cAAc;oBACzE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,MAAM,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;;AAhiBH,4CAkiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\n// cspell:ignore cset csets ecchanges\r\n\r\nimport * as path from \"path\";\r\nimport {\r\n AccessToken, BeDuration, ChangeSetStatus, GuidString, IModelHubStatus, IModelStatus, Logger, OpenMode, Optional, StopWatch,\r\n} from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseId, BriefcaseIdValue, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, ChangesetType, IModelError, IModelVersion, LocalBriefcaseProps,\r\n LocalDirName, LocalFileName, RequestNewBriefcaseProps,\r\n} from \"@itwin/core-common\";\r\nimport { AcquireNewBriefcaseIdArg, IModelNameArg } from \"./BackendHubAccess\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { CheckpointManager, CheckpointProps, ProgressFunction } from \"./CheckpointManager\";\r\nimport { BriefcaseDb, IModelDb, TokenArg } from \"./IModelDb\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\nimport { SchemaSync } from \"./SchemaSync\";\r\nimport { _hubAccess, _nativeDb, _releaseAllLocks } from \"./internal/Symbols\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.IModelDb;\r\n\r\n/** The argument for [[BriefcaseManager.downloadBriefcase]]\r\n * @public\r\n*/\r\nexport interface RequestNewBriefcaseArg extends TokenArg, RequestNewBriefcaseProps {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n}\r\n\r\n/**\r\n * Parameters for pushing changesets to iModelHub\r\n * @public\r\n */\r\nexport interface PushChangesArgs extends TokenArg {\r\n /** A description of the changes. This is visible on the iModel's timeline. */\r\n description: string;\r\n /** if present, the locks are retained after the operation. Otherwise, *all* locks are released after the changeset is successfully pushed. */\r\n retainLocks?: true;\r\n /** number of times to retry pull/merge if other users are pushing at the same time. Default is 5 */\r\n mergeRetryCount?: number;\r\n /** delay to wait between pull/merge retry attempts. Default is 3 seconds */\r\n mergeRetryDelay?: BeDuration;\r\n /** the number of time to attempt to retry to push the changeset upon failure. Default is 3 */\r\n pushRetryCount?: number;\r\n /** The delay to wait between retry attempts on failed pushes. Default is 3 seconds. */\r\n pushRetryDelay?: BeDuration;\r\n /**\r\n * For testing purpose\r\n * @internal\r\n */\r\n noFastForward?: true;\r\n}\r\n\r\n/**\r\n * Specifies a specific index for pulling changes.\r\n * @public\r\n */\r\nexport interface ToChangesetArgs extends TokenArg {\r\n /** The last ChangesetIndex to pull. If not present, pull *all* newer changesets. */\r\n toIndex?: ChangesetIndex;\r\n}\r\n\r\n/** Arguments for [[BriefcaseManager.pullAndApplyChangesets]]\r\n * @public\r\n */\r\nexport type PullChangesArgs = ToChangesetArgs & {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n /**\r\n * For testing purpose\r\n * @internal\r\n */\r\n noFastForward?: true;\r\n};\r\n\r\n/** Arguments for [[BriefcaseManager.revertTimelineChanges]]\r\n * @public\r\n */\r\nexport type RevertChangesArgs = Optional<PushChangesArgs, \"description\"> & {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n /** The index of the changeset to revert to */\r\n toIndex: ChangesetIndex;\r\n /** If present, schema changes are skipped during the revert operation. */\r\n skipSchemaChanges?: true;\r\n};\r\n\r\n/** Manages downloading Briefcases and downloading and uploading changesets.\r\n * @public\r\n */\r\nexport class BriefcaseManager {\r\n /** Get the local path of the folder storing files that are associated with an imodel */\r\n public static getIModelPath(iModelId: GuidString): LocalDirName { return path.join(this._cacheDir, iModelId); }\r\n\r\n /** @internal */\r\n public static getChangeSetsPath(iModelId: GuidString): LocalDirName { return path.join(this.getIModelPath(iModelId), \"changesets\"); }\r\n\r\n /** @internal */\r\n public static getChangeCachePathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.ecchanges\")); }\r\n\r\n /** @internal */\r\n public static getChangedElementsPathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.elems\")); }\r\n\r\n private static _briefcaseSubDir = \"briefcases\";\r\n /** Get the local path of the folder storing briefcases associated with the specified iModel. */\r\n public static getBriefcaseBasePath(iModelId: GuidString): LocalDirName {\r\n return path.join(this.getIModelPath(iModelId), this._briefcaseSubDir);\r\n }\r\n\r\n /** Get the name of the local file that holds, or will hold, a local briefcase in the briefcase cache.\r\n * @note The briefcase cache is a local directory established in the call to [[BriefcaseManager.initialize]].\r\n * @param briefcase the iModelId and BriefcaseId for the filename\r\n * @see getIModelPath\r\n */\r\n public static getFileName(briefcase: BriefcaseProps): LocalFileName {\r\n return path.join(this.getBriefcaseBasePath(briefcase.iModelId), `${briefcase.briefcaseId}.bim`);\r\n }\r\n\r\n private static setupCacheDir(cacheRootDir: LocalDirName) {\r\n this._cacheDir = cacheRootDir;\r\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\r\n }\r\n\r\n private static _initialized?: boolean;\r\n /** Initialize BriefcaseManager\r\n * @param cacheRootDir The root directory for storing a cache of downloaded briefcase files on the local computer.\r\n * Briefcases are stored relative to this path in sub-folders organized by IModelId.\r\n * @note It is perfectly valid for applications to store briefcases in locations they manage, outside of `cacheRootDir`.\r\n */\r\n public static initialize(cacheRootDir: LocalDirName) {\r\n if (this._initialized)\r\n return;\r\n this.setupCacheDir(cacheRootDir);\r\n IModelHost.onBeforeShutdown.addOnce(() => this.finalize());\r\n this._initialized = true;\r\n }\r\n\r\n private static finalize() {\r\n this._initialized = false;\r\n }\r\n\r\n /** Get a list of the local briefcase held in the briefcase cache, optionally for a single iModelId\r\n * @param iModelId if present, only briefcases for this iModelId are returned, otherwise all briefcases for all\r\n * iModels in the briefcase cache are returned.\r\n * @note usually there should only be one briefcase per iModel.\r\n */\r\n public static getCachedBriefcases(iModelId?: GuidString): LocalBriefcaseProps[] {\r\n const briefcaseList: LocalBriefcaseProps[] = [];\r\n const iModelDirs = IModelJsFs.readdirSync(this._cacheDir);\r\n for (const iModelDir of iModelDirs) {\r\n if (iModelId && iModelId !== iModelDir)\r\n continue;\r\n const bcPath = path.join(this._cacheDir, iModelDir, this._briefcaseSubDir);\r\n try {\r\n if (!IModelJsFs.lstatSync(bcPath)?.isDirectory)\r\n continue;\r\n } catch {\r\n continue;\r\n }\r\n\r\n const briefcases = IModelJsFs.readdirSync(bcPath);\r\n for (const briefcaseName of briefcases) {\r\n if (briefcaseName.endsWith(\".bim\")) {\r\n try {\r\n const fileName = path.join(bcPath, briefcaseName);\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const db = IModelDb.openDgnDb({ path: fileName }, OpenMode.Readonly);\r\n briefcaseList.push({ fileName, iTwinId: db.getITwinId(), iModelId: db.getIModelId(), briefcaseId: db.getBriefcaseId(), changeset: db.getCurrentChangeset(), fileSize });\r\n db.closeFile();\r\n } catch { }\r\n }\r\n }\r\n }\r\n return briefcaseList;\r\n }\r\n\r\n private static _cacheDir: LocalDirName;\r\n /** Get the root directory for the briefcase cache */\r\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\r\n\r\n /** Determine whether the supplied briefcaseId is in the range of assigned BriefcaseIds issued by iModelHub\r\n * @note this does check whether the id was actually acquired by the caller.\r\n */\r\n public static isValidBriefcaseId(id: BriefcaseId) {\r\n return id >= BriefcaseIdValue.FirstValid && id <= BriefcaseIdValue.LastValid;\r\n }\r\n\r\n /** Acquire a new briefcaseId from iModelHub for the supplied iModelId\r\n * @note usually there should only be one briefcase per iModel per user. If a single user acquires more than one briefcaseId,\r\n * it's a good idea to supply different aliases for each of them.\r\n */\r\n public static async acquireNewBriefcaseId(arg: AcquireNewBriefcaseIdArg): Promise<BriefcaseId> {\r\n return IModelHost[_hubAccess].acquireNewBriefcaseId(arg);\r\n }\r\n\r\n /**\r\n * Download a new briefcase from iModelHub for the supplied iModelId.\r\n *\r\n * Briefcases are local files holding a copy of an iModel.\r\n * Briefcases may either be specific to an individual user (so that it can be modified to create changesets), or it can be readonly so it can accept but not create changesets.\r\n * Every briefcase internally holds its [[BriefcaseId]]. Writeable briefcases have a `BriefcaseId` \"assigned\" to them by iModelHub. No two users will ever have the same BriefcaseId.\r\n * Readonly briefcases are \"unassigned\" with the special value [[BriefcaseId.Unassigned]].\r\n *\r\n * Typically a given user will have only one briefcase on their machine for a given iModelId. Rarely, it may be necessary to use more than one\r\n * briefcase to make isolated independent sets of changes, but that is exceedingly complicated and rare.\r\n *\r\n * Callers of this method may supply a BriefcaseId, or if none is supplied, a new one is acquired from iModelHub.\r\n *\r\n * @param arg The arguments that specify the briefcase file to be downloaded.\r\n * @returns The properties of the local briefcase in a Promise that is resolved after the briefcase is fully downloaded and the briefcase file is ready for use via [BriefcaseDb.open]($backend).\r\n * @note The location of the local file to hold the briefcase is arbitrary and may be any valid *local* path on your machine. If you don't supply\r\n * a filename, the local briefcase cache is used by creating a file with the briefcaseId as its name in the `briefcases` folder below the folder named\r\n * for the IModelId.\r\n * @note *It is invalid to edit briefcases on a shared network drive* and that is a sure way to corrupt your briefcase (see https://www.sqlite.org/howtocorrupt.html)\r\n */\r\n public static async downloadBriefcase(arg: RequestNewBriefcaseArg): Promise<LocalBriefcaseProps> {\r\n const briefcaseId = arg.briefcaseId ?? await this.acquireNewBriefcaseId(arg);\r\n const fileName = arg.fileName ?? this.getFileName({ ...arg, briefcaseId });\r\n\r\n if (IModelJsFs.existsSync(fileName))\r\n throw new IModelError(IModelStatus.FileAlreadyExists, `Briefcase \"${fileName}\" already exists`);\r\n\r\n const asOf = arg.asOf ?? IModelVersion.latest().toJSON();\r\n const changeset = await IModelHost[_hubAccess].getChangesetFromVersion({ ...arg, version: IModelVersion.fromJSON(asOf) });\r\n const checkpoint: CheckpointProps = { ...arg, changeset };\r\n\r\n try {\r\n await CheckpointManager.downloadCheckpoint({ localFile: fileName, checkpoint, onProgress: arg.onProgress });\r\n } catch (error: unknown) {\r\n const errorMessage = `Failed to download briefcase to ${fileName}, errorMessage: ${(error as Error).message}`;\r\n if (arg.accessToken && arg.briefcaseId === undefined) {\r\n Logger.logInfo(loggerCategory, `${errorMessage}, releasing the briefcaseId...`);\r\n await this.releaseBriefcase(arg.accessToken, { briefcaseId, iModelId: arg.iModelId });\r\n }\r\n if (IModelJsFs.existsSync(fileName)) {\r\n if (arg.accessToken && arg.briefcaseId === undefined)\r\n Logger.logTrace(loggerCategory, `Deleting the file: ${fileName}...`);\r\n else\r\n Logger.logInfo(loggerCategory, `${errorMessage}, deleting the file...`);\r\n try {\r\n IModelJsFs.unlinkSync(fileName);\r\n Logger.logInfo(loggerCategory, `Deleted ${fileName}`);\r\n } catch (deleteError: unknown) {\r\n Logger.logWarning(loggerCategory, `Failed to delete ${fileName}. errorMessage: ${(deleteError as Error).message}`);\r\n }\r\n }\r\n throw error;\r\n }\r\n\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const response: LocalBriefcaseProps = {\r\n fileName,\r\n briefcaseId,\r\n iModelId: arg.iModelId,\r\n iTwinId: arg.iTwinId,\r\n changeset: checkpoint.changeset,\r\n fileSize,\r\n };\r\n\r\n // now open the downloaded checkpoint and reset its BriefcaseId\r\n const nativeDb = new IModelNative.platform.DgnDb();\r\n try {\r\n nativeDb.openIModel(fileName, OpenMode.ReadWrite);\r\n } catch (err: any) {\r\n throw new IModelError(err.errorNumber, `Could not open downloaded briefcase for write access: ${fileName}, err=${err.message}`);\r\n }\r\n try {\r\n nativeDb.enableWalMode(); // local briefcases should use WAL journal mode\r\n nativeDb.resetBriefcaseId(briefcaseId);\r\n if (nativeDb.getCurrentChangeset().id !== checkpoint.changeset.id)\r\n throw new IModelError(IModelStatus.InvalidId, `Downloaded briefcase has wrong changesetId: ${fileName}`);\r\n } finally {\r\n nativeDb.saveChanges();\r\n nativeDb.closeFile();\r\n }\r\n return response;\r\n }\r\n\r\n /** Deletes change sets of an iModel from local disk\r\n * @internal\r\n */\r\n public static deleteChangeSetsFromLocalDisk(iModelId: string) {\r\n const changesetsPath = BriefcaseManager.getChangeSetsPath(iModelId);\r\n BriefcaseManager.deleteFolderAndContents(changesetsPath);\r\n }\r\n\r\n /** Releases a briefcaseId from iModelHub. After this call it is illegal to generate changesets for the released briefcaseId.\r\n * @note generally, this method should not be called directly. Instead use [[deleteBriefcaseFiles]].\r\n * @see deleteBriefcaseFiles\r\n */\r\n public static async releaseBriefcase(accessToken: AccessToken, briefcase: BriefcaseProps): Promise<void> {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId))\r\n return IModelHost[_hubAccess].releaseBriefcase({ accessToken, iModelId: briefcase.iModelId, briefcaseId: briefcase.briefcaseId });\r\n }\r\n\r\n /**\r\n * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.\r\n * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and\r\n * associated files (that is, all files in the same directory that start with the briefcase name).\r\n * @param filePath the full file name of the Briefcase to delete\r\n * @param accessToken for releasing the briefcaseId\r\n */\r\n public static async deleteBriefcaseFiles(filePath: LocalFileName, accessToken?: AccessToken): Promise<void> {\r\n try {\r\n const db = IModelDb.openDgnDb({ path: filePath }, OpenMode.Readonly);\r\n const briefcase: BriefcaseProps = {\r\n iModelId: db.getIModelId(),\r\n briefcaseId: db.getBriefcaseId(),\r\n };\r\n db.closeFile();\r\n\r\n if (accessToken) {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId)) {\r\n await BriefcaseManager.releaseBriefcase(accessToken, briefcase);\r\n }\r\n }\r\n } catch { }\r\n\r\n // first try to delete the briefcase file\r\n try {\r\n if (IModelJsFs.existsSync(filePath))\r\n IModelJsFs.unlinkSync(filePath);\r\n } catch (err) {\r\n throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${err}`);\r\n }\r\n\r\n // next, delete all files that start with the briefcase's filePath (e.g. \"a.bim-locks\", \"a.bim-journal\", etc.)\r\n try {\r\n const dirName = path.dirname(filePath);\r\n const fileName = path.basename(filePath);\r\n const files = IModelJsFs.readdirSync(dirName);\r\n for (const file of files) {\r\n if (file.startsWith(fileName))\r\n this.deleteFile(path.join(dirName, file)); // don't throw on error\r\n }\r\n } catch { }\r\n }\r\n\r\n /** Deletes a file\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFile(pathname: LocalFileName): boolean {\r\n try {\r\n IModelJsFs.unlinkSync(pathname);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${error}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes a folder, checking if it's empty\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFolderIfEmpty(folderPathname: LocalDirName): boolean {\r\n try {\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n if (files.length > 0)\r\n return false;\r\n\r\n IModelJsFs.rmdirSync(folderPathname);\r\n } catch {\r\n Logger.logError(loggerCategory, `Cannot delete folder: ${folderPathname}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes the contents of a folder, but not the folder itself\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return false;\r\n\r\n let status = true;\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n for (const file of files) {\r\n const curPath = path.join(folderPathname, file);\r\n const locStatus = (IModelJsFs.lstatSync(curPath)?.isDirectory) ? BriefcaseManager.deleteFolderAndContents(curPath) : BriefcaseManager.deleteFile(curPath);\r\n if (!locStatus)\r\n status = false;\r\n }\r\n return status;\r\n }\r\n\r\n /** Query the hub for the properties for a ChangesetIndex or ChangesetId */\r\n public static async queryChangeset(arg: { iModelId: GuidString, changeset: ChangesetIndexOrId }): Promise<ChangesetProps> {\r\n return IModelHost[_hubAccess].queryChangeset({ ...arg, accessToken: await IModelHost.getAccessToken() });\r\n }\r\n\r\n /** Query the hub for an array of changeset properties given a ChangesetRange */\r\n public static async queryChangesets(arg: { iModelId: GuidString, range: ChangesetRange }): Promise<ChangesetProps[]> {\r\n return IModelHost[_hubAccess].queryChangesets({ ...arg, accessToken: await IModelHost.getAccessToken() });\r\n }\r\n\r\n /** Query the hub for the ChangesetProps of the most recent changeset */\r\n public static async getLatestChangeset(arg: { iModelId: GuidString }): Promise<ChangesetProps> {\r\n return IModelHost[_hubAccess].getLatestChangeset({ ...arg, accessToken: await IModelHost.getAccessToken() });\r\n }\r\n\r\n /** Query the Id of an iModel by name.\r\n * @param arg Identifies the iModel of interest\r\n * @returns the Id of the corresponding iModel, or `undefined` if no such iModel exists.\r\n */\r\n public static async queryIModelByName(arg: IModelNameArg): Promise<GuidString | undefined> {\r\n return IModelHost[_hubAccess].queryIModelByName(arg);\r\n }\r\n\r\n /** Deletes a folder and all it's contents.\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderAndContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return true;\r\n\r\n let status = false;\r\n status = BriefcaseManager.deleteFolderContents(folderPathname);\r\n if (!status)\r\n return false;\r\n\r\n status = BriefcaseManager.deleteFolderIfEmpty(folderPathname);\r\n return status;\r\n }\r\n\r\n private static async applySingleChangeset(db: IModelDb, changesetFile: ChangesetFileProps, fastForward: boolean) {\r\n if (changesetFile.changesType === ChangesetType.Schema || changesetFile.changesType === ChangesetType.SchemaSync)\r\n db.clearCaches(); // for schema changesets, statement caches may become invalid. Do this *before* applying, in case db needs to be closed (open statements hold db open.)\r\n\r\n db[_nativeDb].applyChangeset(changesetFile, fastForward);\r\n db.changeset = db[_nativeDb].getCurrentChangeset();\r\n\r\n // we're done with this changeset, delete it\r\n IModelJsFs.removeSync(changesetFile.pathname);\r\n }\r\n\r\n /** @internal */\r\n public static async revertTimelineChanges(db: IModelDb, arg: RevertChangesArgs): Promise<void> {\r\n if (!db.isOpen || db[_nativeDb].isReadonly())\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to revert timeline changes\");\r\n\r\n let currentIndex = db.changeset.index;\r\n if (currentIndex === undefined)\r\n currentIndex = (await IModelHost[_hubAccess].queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\r\n\r\n if (!arg.toIndex) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"toIndex must be specified to revert changesets\");\r\n }\r\n if (arg.toIndex > currentIndex) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"toIndex must be less than or equal to the current index\");\r\n }\r\n if (!db.holdsSchemaLock) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Cannot revert timeline changesets without holding a schema lock\");\r\n }\r\n\r\n // Download change sets\r\n const changesets = await IModelHost[_hubAccess].downloadChangesets({\r\n accessToken: arg.accessToken,\r\n iModelId: db.iModelId,\r\n range: { first: arg.toIndex, end: currentIndex },\r\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\r\n progressCallback: arg.onProgress,\r\n });\r\n\r\n if (changesets.length === 0)\r\n return;\r\n\r\n changesets.reverse();\r\n db.clearCaches();\r\n\r\n const stopwatch = new StopWatch(`Reverting changes`, true);\r\n Logger.logInfo(loggerCategory, `Starting reverting timeline changes from ${arg.toIndex} to ${currentIndex}`);\r\n\r\n /**\r\n * Revert timeline changes from the current index to the specified index.\r\n * It does not change parent of the current changeset.\r\n * All changes during revert operation are stored in a new changeset.\r\n * Revert operation require schema lock as we do not acquire individual locks for each element.\r\n * Optionally schema changes can be skipped (required for schema sync case).\r\n */\r\n db[_nativeDb].revertTimelineChanges(changesets, arg.skipSchemaChanges ?? false);\r\n Logger.logInfo(loggerCategory, `Reverted timeline changes from ${arg.toIndex} to ${currentIndex} (${stopwatch.elapsedSeconds} seconds)`);\r\n\r\n changesets.forEach((changeset) => {\r\n IModelJsFs.removeSync(changeset.pathname);\r\n });\r\n db.notifyChangesetApplied();\r\n }\r\n\r\n /** @internal */\r\n public static async pullAndApplyChangesets(db: IModelDb, arg: PullChangesArgs): Promise<void> {\r\n if (!db.isOpen || db[_nativeDb].isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to process change sets\");\r\n\r\n let currentIndex = db.changeset.index;\r\n if (currentIndex === undefined)\r\n currentIndex = (await IModelHost[_hubAccess].queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\r\n\r\n const reverse = (arg.toIndex && arg.toIndex < currentIndex) ? true : false;\r\n\r\n if (db[_nativeDb].hasPendingTxns() && reverse) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Cannot reverse changesets when there are pending changes\");\r\n }\r\n\r\n // Download change sets\r\n const changesets = await IModelHost[_hubAccess].downloadChangesets({\r\n accessToken: arg.accessToken,\r\n iModelId: db.iModelId,\r\n range: { first: reverse ? arg.toIndex! + 1 : currentIndex + 1, end: reverse ? currentIndex : arg.toIndex }, // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\r\n progressCallback: arg.onProgress,\r\n });\r\n\r\n if (changesets.length === 0)\r\n return; // nothing to apply\r\n\r\n if (reverse)\r\n changesets.reverse();\r\n\r\n\r\n let appliedChangesets = -1;\r\n if (db[_nativeDb].hasPendingTxns() && !reverse && !arg.noFastForward) {\r\n // attempt to perform fast forward\r\n for (const changeset of changesets) {\r\n // do not waste time on schema changesets. They cannot be fastforwarded.\r\n if (changeset.changesType === ChangesetType.Schema || changeset.changesType === ChangesetType.SchemaSync)\r\n break;\r\n\r\n try {\r\n const stopwatch = new StopWatch(`[${changeset.id}]`, true);\r\n Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description} using fast forward method`);\r\n await this.applySingleChangeset(db, changeset, true);\r\n Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);\r\n appliedChangesets++;\r\n db.saveChanges();\r\n } catch {\r\n db.abandonChanges();\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (appliedChangesets < changesets.length - 1) {\r\n db[_nativeDb].pullMergeBegin();\r\n for (const changeset of changesets.filter((_, index) => index > appliedChangesets)) {\r\n const stopwatch = new StopWatch(`[${changeset.id}]`, true);\r\n Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description}`);\r\n try {\r\n await this.applySingleChangeset(db, changeset, false);\r\n Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);\r\n } catch (err: any) {\r\n if (err instanceof Error) {\r\n Logger.logError(loggerCategory, `Error applying changeset with id ${stopwatch.description}: ${err.message}`);\r\n }\r\n db.abandonChanges();\r\n db[_nativeDb].pullMergeEnd();\r\n throw err;\r\n }\r\n }\r\n db[_nativeDb].pullMergeEnd();\r\n if (!db.isReadonly) {\r\n db.saveChanges(\"Merge.\");\r\n }\r\n }\r\n\r\n // notify listeners\r\n db.notifyChangesetApplied();\r\n }\r\n /** create a changeset from the current changes, and push it to iModelHub */\r\n private static async pushChanges(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n const changesetProps = db[_nativeDb].startCreateChangeset() as ChangesetFileProps;\r\n changesetProps.briefcaseId = db.briefcaseId;\r\n changesetProps.description = arg.description;\r\n const fileSize = IModelJsFs.lstatSync(changesetProps.pathname)?.size;\r\n if (!fileSize) // either undefined or 0 means error\r\n throw new IModelError(IModelStatus.NoContent, \"error creating changeset\");\r\n\r\n changesetProps.size = fileSize;\r\n\r\n let retryCount = arg.pushRetryCount ?? 3;\r\n while (true) {\r\n try {\r\n const accessToken = await IModelHost.getAccessToken();\r\n const index = await IModelHost[_hubAccess].pushChangeset({ accessToken, iModelId: db.iModelId, changesetProps });\r\n db[_nativeDb].completeCreateChangeset({ index });\r\n db.changeset = db[_nativeDb].getCurrentChangeset();\r\n if (!arg.retainLocks)\r\n await db.locks[_releaseAllLocks]();\r\n\r\n return;\r\n } catch (err: any) {\r\n const shouldRetry = () => {\r\n if (retryCount-- <= 0)\r\n return false;\r\n switch (err.errorNumber) {\r\n case IModelHubStatus.AnotherUserPushing:\r\n case IModelHubStatus.DatabaseTemporarilyLocked:\r\n case IModelHubStatus.OperationFailed:\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n if (!shouldRetry()) {\r\n db[_nativeDb].abandonCreateChangeset();\r\n throw err;\r\n }\r\n } finally {\r\n IModelJsFs.removeSync(changesetProps.pathname);\r\n }\r\n }\r\n }\r\n\r\n /** Pull/merge (if necessary), then push all local changes as a changeset. Called by [[BriefcaseDb.pushChanges]]\r\n * @internal\r\n */\r\n public static async pullMergePush(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n let retryCount = arg.mergeRetryCount ?? 5;\r\n while (true) {\r\n try {\r\n await BriefcaseManager.pullAndApplyChangesets(db, arg);\r\n if (!db.skipSyncSchemasOnPullAndPush)\r\n await SchemaSync.pull(db);\r\n return await BriefcaseManager.pushChanges(db, arg);\r\n } catch (err: any) {\r\n if (retryCount-- <= 0 || err.errorNumber !== IModelHubStatus.PullIsRequired)\r\n throw (err);\r\n await (arg.mergeRetryDelay ?? BeDuration.fromSeconds(3)).wait();\r\n }\r\n }\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"BriefcaseManager.js","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qCAAqC;AAErC,6BAA6B;AAC7B,sDAE6B;AAC7B,oDAG4B;AAE5B,mEAAgE;AAChE,2DAA2F;AAC3F,yCAA6D;AAC7D,6CAA0C;AAC1C,6CAA0C;AAC1C,6CAA0C;AAC1C,gDAA6E;AAC7E,8DAAyD;AAEzD,MAAM,cAAc,GAAG,6CAAqB,CAAC,QAAQ,CAAC;AA0EtD;;GAEG;AACH,MAAa,gBAAgB;IAC3B,wFAAwF;IAC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,IAAI,UAAU,GAAG,GAAG,CAAC,eAAe,IAAI,CAAC,CAAC;QAC1C,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;gBACvD,IAAI,CAAC,EAAE,CAAC,4BAA4B;oBAClC,MAAM,uBAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC5B,OAAO,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YACrD,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,IAAI,UAAU,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,8BAAe,CAAC,cAAc;oBACzE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,MAAM,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;;AA9iBH,4CAgjBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\n// cspell:ignore cset csets ecchanges\r\n\r\nimport * as path from \"path\";\r\nimport {\r\n AccessToken, BeDuration, ChangeSetStatus, GuidString, IModelHubStatus, IModelStatus, Logger, OpenMode, Optional, StopWatch,\r\n} from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseId, BriefcaseIdValue, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, ChangesetType, IModelError, IModelVersion, LocalBriefcaseProps,\r\n LocalDirName, LocalFileName, RequestNewBriefcaseProps,\r\n} from \"@itwin/core-common\";\r\nimport { AcquireNewBriefcaseIdArg, DownloadChangesetArg, DownloadChangesetRangeArg, IModelNameArg } from \"./BackendHubAccess\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { CheckpointManager, CheckpointProps, ProgressFunction } from \"./CheckpointManager\";\r\nimport { BriefcaseDb, IModelDb, TokenArg } from \"./IModelDb\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\nimport { SchemaSync } from \"./SchemaSync\";\r\nimport { _hubAccess, _nativeDb, _releaseAllLocks } from \"./internal/Symbols\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.IModelDb;\r\n\r\n/** The argument for [[BriefcaseManager.downloadBriefcase]]\r\n * @public\r\n*/\r\nexport interface RequestNewBriefcaseArg extends TokenArg, RequestNewBriefcaseProps {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n}\r\n\r\n/**\r\n * Parameters for pushing changesets to iModelHub\r\n * @public\r\n */\r\nexport interface PushChangesArgs extends TokenArg {\r\n /** A description of the changes. This is visible on the iModel's timeline. */\r\n description: string;\r\n /** if present, the locks are retained after the operation. Otherwise, *all* locks are released after the changeset is successfully pushed. */\r\n retainLocks?: true;\r\n /** number of times to retry pull/merge if other users are pushing at the same time. Default is 5 */\r\n mergeRetryCount?: number;\r\n /** delay to wait between pull/merge retry attempts. Default is 3 seconds */\r\n mergeRetryDelay?: BeDuration;\r\n /** the number of time to attempt to retry to push the changeset upon failure. Default is 3 */\r\n pushRetryCount?: number;\r\n /** The delay to wait between retry attempts on failed pushes. Default is 3 seconds. */\r\n pushRetryDelay?: BeDuration;\r\n /**\r\n * For testing purpose\r\n * @internal\r\n */\r\n noFastForward?: true;\r\n}\r\n\r\n/**\r\n * Specifies a specific index for pulling changes.\r\n * @public\r\n */\r\nexport interface ToChangesetArgs extends TokenArg {\r\n /** The last ChangesetIndex to pull. If not present, pull *all* newer changesets. */\r\n toIndex?: ChangesetIndex;\r\n}\r\n\r\n/** Arguments for [[BriefcaseManager.pullAndApplyChangesets]]\r\n * @public\r\n */\r\nexport type PullChangesArgs = ToChangesetArgs & {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n /**\r\n * For testing purpose\r\n * @internal\r\n */\r\n noFastForward?: true;\r\n};\r\n\r\n/** Arguments for [[BriefcaseManager.revertTimelineChanges]]\r\n * @public\r\n */\r\nexport type RevertChangesArgs = Optional<PushChangesArgs, \"description\"> & {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n /** The index of the changeset to revert to */\r\n toIndex: ChangesetIndex;\r\n /** If present, schema changes are skipped during the revert operation. */\r\n skipSchemaChanges?: true;\r\n};\r\n\r\n/** Manages downloading Briefcases and downloading and uploading changesets.\r\n * @public\r\n */\r\nexport class BriefcaseManager {\r\n /** Get the local path of the folder storing files that are associated with an imodel */\r\n public static getIModelPath(iModelId: GuidString): LocalDirName { return path.join(this._cacheDir, iModelId); }\r\n\r\n /** @internal */\r\n public static getChangeSetsPath(iModelId: GuidString): LocalDirName { return path.join(this.getIModelPath(iModelId), \"changesets\"); }\r\n\r\n /** @internal */\r\n public static getChangeCachePathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.ecchanges\")); }\r\n\r\n /** @internal */\r\n public static getChangedElementsPathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.elems\")); }\r\n\r\n private static _briefcaseSubDir = \"briefcases\";\r\n /** Get the local path of the folder storing briefcases associated with the specified iModel. */\r\n public static getBriefcaseBasePath(iModelId: GuidString): LocalDirName {\r\n return path.join(this.getIModelPath(iModelId), this._briefcaseSubDir);\r\n }\r\n\r\n /** Get the name of the local file that holds, or will hold, a local briefcase in the briefcase cache.\r\n * @note The briefcase cache is a local directory established in the call to [[BriefcaseManager.initialize]].\r\n * @param briefcase the iModelId and BriefcaseId for the filename\r\n * @see getIModelPath\r\n */\r\n public static getFileName(briefcase: BriefcaseProps): LocalFileName {\r\n return path.join(this.getBriefcaseBasePath(briefcase.iModelId), `${briefcase.briefcaseId}.bim`);\r\n }\r\n\r\n private static setupCacheDir(cacheRootDir: LocalDirName) {\r\n this._cacheDir = cacheRootDir;\r\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\r\n }\r\n\r\n private static _initialized?: boolean;\r\n /** Initialize BriefcaseManager\r\n * @param cacheRootDir The root directory for storing a cache of downloaded briefcase files on the local computer.\r\n * Briefcases are stored relative to this path in sub-folders organized by IModelId.\r\n * @note It is perfectly valid for applications to store briefcases in locations they manage, outside of `cacheRootDir`.\r\n */\r\n public static initialize(cacheRootDir: LocalDirName) {\r\n if (this._initialized)\r\n return;\r\n this.setupCacheDir(cacheRootDir);\r\n IModelHost.onBeforeShutdown.addOnce(() => this.finalize());\r\n this._initialized = true;\r\n }\r\n\r\n private static finalize() {\r\n this._initialized = false;\r\n }\r\n\r\n /** Get a list of the local briefcase held in the briefcase cache, optionally for a single iModelId\r\n * @param iModelId if present, only briefcases for this iModelId are returned, otherwise all briefcases for all\r\n * iModels in the briefcase cache are returned.\r\n * @note usually there should only be one briefcase per iModel.\r\n */\r\n public static getCachedBriefcases(iModelId?: GuidString): LocalBriefcaseProps[] {\r\n const briefcaseList: LocalBriefcaseProps[] = [];\r\n const iModelDirs = IModelJsFs.readdirSync(this._cacheDir);\r\n for (const iModelDir of iModelDirs) {\r\n if (iModelId && iModelId !== iModelDir)\r\n continue;\r\n const bcPath = path.join(this._cacheDir, iModelDir, this._briefcaseSubDir);\r\n try {\r\n if (!IModelJsFs.lstatSync(bcPath)?.isDirectory)\r\n continue;\r\n } catch {\r\n continue;\r\n }\r\n\r\n const briefcases = IModelJsFs.readdirSync(bcPath);\r\n for (const briefcaseName of briefcases) {\r\n if (briefcaseName.endsWith(\".bim\")) {\r\n try {\r\n const fileName = path.join(bcPath, briefcaseName);\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const db = IModelDb.openDgnDb({ path: fileName }, OpenMode.Readonly);\r\n briefcaseList.push({ fileName, iTwinId: db.getITwinId(), iModelId: db.getIModelId(), briefcaseId: db.getBriefcaseId(), changeset: db.getCurrentChangeset(), fileSize });\r\n db.closeFile();\r\n } catch { }\r\n }\r\n }\r\n }\r\n return briefcaseList;\r\n }\r\n\r\n private static _cacheDir: LocalDirName;\r\n /** Get the root directory for the briefcase cache */\r\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\r\n\r\n /** Determine whether the supplied briefcaseId is in the range of assigned BriefcaseIds issued by iModelHub\r\n * @note this does check whether the id was actually acquired by the caller.\r\n */\r\n public static isValidBriefcaseId(id: BriefcaseId) {\r\n return id >= BriefcaseIdValue.FirstValid && id <= BriefcaseIdValue.LastValid;\r\n }\r\n\r\n /** Acquire a new briefcaseId from iModelHub for the supplied iModelId\r\n * @note usually there should only be one briefcase per iModel per user. If a single user acquires more than one briefcaseId,\r\n * it's a good idea to supply different aliases for each of them.\r\n */\r\n public static async acquireNewBriefcaseId(arg: AcquireNewBriefcaseIdArg): Promise<BriefcaseId> {\r\n return IModelHost[_hubAccess].acquireNewBriefcaseId(arg);\r\n }\r\n\r\n /**\r\n * Download a new briefcase from iModelHub for the supplied iModelId.\r\n *\r\n * Briefcases are local files holding a copy of an iModel.\r\n * Briefcases may either be specific to an individual user (so that it can be modified to create changesets), or it can be readonly so it can accept but not create changesets.\r\n * Every briefcase internally holds its [[BriefcaseId]]. Writeable briefcases have a `BriefcaseId` \"assigned\" to them by iModelHub. No two users will ever have the same BriefcaseId.\r\n * Readonly briefcases are \"unassigned\" with the special value [[BriefcaseId.Unassigned]].\r\n *\r\n * Typically a given user will have only one briefcase on their machine for a given iModelId. Rarely, it may be necessary to use more than one\r\n * briefcase to make isolated independent sets of changes, but that is exceedingly complicated and rare.\r\n *\r\n * Callers of this method may supply a BriefcaseId, or if none is supplied, a new one is acquired from iModelHub.\r\n *\r\n * @param arg The arguments that specify the briefcase file to be downloaded.\r\n * @returns The properties of the local briefcase in a Promise that is resolved after the briefcase is fully downloaded and the briefcase file is ready for use via [BriefcaseDb.open]($backend).\r\n * @note The location of the local file to hold the briefcase is arbitrary and may be any valid *local* path on your machine. If you don't supply\r\n * a filename, the local briefcase cache is used by creating a file with the briefcaseId as its name in the `briefcases` folder below the folder named\r\n * for the IModelId.\r\n * @note *It is invalid to edit briefcases on a shared network drive* and that is a sure way to corrupt your briefcase (see https://www.sqlite.org/howtocorrupt.html)\r\n */\r\n public static async downloadBriefcase(arg: RequestNewBriefcaseArg): Promise<LocalBriefcaseProps> {\r\n const briefcaseId = arg.briefcaseId ?? await this.acquireNewBriefcaseId(arg);\r\n const fileName = arg.fileName ?? this.getFileName({ ...arg, briefcaseId });\r\n\r\n if (IModelJsFs.existsSync(fileName))\r\n throw new IModelError(IModelStatus.FileAlreadyExists, `Briefcase \"${fileName}\" already exists`);\r\n\r\n const asOf = arg.asOf ?? IModelVersion.latest().toJSON();\r\n const changeset = await IModelHost[_hubAccess].getChangesetFromVersion({ ...arg, version: IModelVersion.fromJSON(asOf) });\r\n const checkpoint: CheckpointProps = { ...arg, changeset };\r\n\r\n try {\r\n await CheckpointManager.downloadCheckpoint({ localFile: fileName, checkpoint, onProgress: arg.onProgress });\r\n } catch (error: unknown) {\r\n const errorMessage = `Failed to download briefcase to ${fileName}, errorMessage: ${(error as Error).message}`;\r\n if (arg.accessToken && arg.briefcaseId === undefined) {\r\n Logger.logInfo(loggerCategory, `${errorMessage}, releasing the briefcaseId...`);\r\n await this.releaseBriefcase(arg.accessToken, { briefcaseId, iModelId: arg.iModelId });\r\n }\r\n if (IModelJsFs.existsSync(fileName)) {\r\n if (arg.accessToken && arg.briefcaseId === undefined)\r\n Logger.logTrace(loggerCategory, `Deleting the file: ${fileName}...`);\r\n else\r\n Logger.logInfo(loggerCategory, `${errorMessage}, deleting the file...`);\r\n try {\r\n IModelJsFs.unlinkSync(fileName);\r\n Logger.logInfo(loggerCategory, `Deleted ${fileName}`);\r\n } catch (deleteError: unknown) {\r\n Logger.logWarning(loggerCategory, `Failed to delete ${fileName}. errorMessage: ${(deleteError as Error).message}`);\r\n }\r\n }\r\n throw error;\r\n }\r\n\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const response: LocalBriefcaseProps = {\r\n fileName,\r\n briefcaseId,\r\n iModelId: arg.iModelId,\r\n iTwinId: arg.iTwinId,\r\n changeset: checkpoint.changeset,\r\n fileSize,\r\n };\r\n\r\n // now open the downloaded checkpoint and reset its BriefcaseId\r\n const nativeDb = new IModelNative.platform.DgnDb();\r\n try {\r\n nativeDb.openIModel(fileName, OpenMode.ReadWrite);\r\n } catch (err: any) {\r\n throw new IModelError(err.errorNumber, `Could not open downloaded briefcase for write access: ${fileName}, err=${err.message}`);\r\n }\r\n try {\r\n nativeDb.enableWalMode(); // local briefcases should use WAL journal mode\r\n nativeDb.resetBriefcaseId(briefcaseId);\r\n if (nativeDb.getCurrentChangeset().id !== checkpoint.changeset.id)\r\n throw new IModelError(IModelStatus.InvalidId, `Downloaded briefcase has wrong changesetId: ${fileName}`);\r\n } finally {\r\n nativeDb.saveChanges();\r\n nativeDb.closeFile();\r\n }\r\n return response;\r\n }\r\n\r\n /** Deletes change sets of an iModel from local disk\r\n * @internal\r\n */\r\n public static deleteChangeSetsFromLocalDisk(iModelId: string) {\r\n const changesetsPath = BriefcaseManager.getChangeSetsPath(iModelId);\r\n BriefcaseManager.deleteFolderAndContents(changesetsPath);\r\n }\r\n\r\n /** Releases a briefcaseId from iModelHub. After this call it is illegal to generate changesets for the released briefcaseId.\r\n * @note generally, this method should not be called directly. Instead use [[deleteBriefcaseFiles]].\r\n * @see deleteBriefcaseFiles\r\n */\r\n public static async releaseBriefcase(accessToken: AccessToken, briefcase: BriefcaseProps): Promise<void> {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId))\r\n return IModelHost[_hubAccess].releaseBriefcase({ accessToken, iModelId: briefcase.iModelId, briefcaseId: briefcase.briefcaseId });\r\n }\r\n\r\n /**\r\n * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.\r\n * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and\r\n * associated files (that is, all files in the same directory that start with the briefcase name).\r\n * @param filePath the full file name of the Briefcase to delete\r\n * @param accessToken for releasing the briefcaseId\r\n */\r\n public static async deleteBriefcaseFiles(filePath: LocalFileName, accessToken?: AccessToken): Promise<void> {\r\n try {\r\n const db = IModelDb.openDgnDb({ path: filePath }, OpenMode.Readonly);\r\n const briefcase: BriefcaseProps = {\r\n iModelId: db.getIModelId(),\r\n briefcaseId: db.getBriefcaseId(),\r\n };\r\n db.closeFile();\r\n\r\n if (accessToken) {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId)) {\r\n await BriefcaseManager.releaseBriefcase(accessToken, briefcase);\r\n }\r\n }\r\n } catch { }\r\n\r\n // first try to delete the briefcase file\r\n try {\r\n if (IModelJsFs.existsSync(filePath))\r\n IModelJsFs.unlinkSync(filePath);\r\n } catch (err) {\r\n throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${err}`);\r\n }\r\n\r\n // next, delete all files that start with the briefcase's filePath (e.g. \"a.bim-locks\", \"a.bim-journal\", etc.)\r\n try {\r\n const dirName = path.dirname(filePath);\r\n const fileName = path.basename(filePath);\r\n const files = IModelJsFs.readdirSync(dirName);\r\n for (const file of files) {\r\n if (file.startsWith(fileName))\r\n this.deleteFile(path.join(dirName, file)); // don't throw on error\r\n }\r\n } catch { }\r\n }\r\n\r\n /** Deletes a file\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFile(pathname: LocalFileName): boolean {\r\n try {\r\n IModelJsFs.unlinkSync(pathname);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${error}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes a folder, checking if it's empty\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFolderIfEmpty(folderPathname: LocalDirName): boolean {\r\n try {\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n if (files.length > 0)\r\n return false;\r\n\r\n IModelJsFs.rmdirSync(folderPathname);\r\n } catch {\r\n Logger.logError(loggerCategory, `Cannot delete folder: ${folderPathname}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes the contents of a folder, but not the folder itself\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return false;\r\n\r\n let status = true;\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n for (const file of files) {\r\n const curPath = path.join(folderPathname, file);\r\n const locStatus = (IModelJsFs.lstatSync(curPath)?.isDirectory) ? BriefcaseManager.deleteFolderAndContents(curPath) : BriefcaseManager.deleteFile(curPath);\r\n if (!locStatus)\r\n status = false;\r\n }\r\n return status;\r\n }\r\n\r\n /** Download all the changesets in the specified range.\r\n * @beta\r\n */\r\n public static async downloadChangesets(arg: DownloadChangesetRangeArg): Promise<ChangesetFileProps[]> {\r\n return IModelHost[_hubAccess].downloadChangesets(arg);\r\n }\r\n\r\n /** Download a single changeset.\r\n * @beta\r\n */\r\n public static async downloadChangeset(arg: DownloadChangesetArg): Promise<ChangesetFileProps> {\r\n return IModelHost[_hubAccess].downloadChangeset(arg);\r\n }\r\n\r\n /** Query the hub for the properties for a ChangesetIndex or ChangesetId */\r\n public static async queryChangeset(arg: { iModelId: GuidString, changeset: ChangesetIndexOrId }): Promise<ChangesetProps> {\r\n return IModelHost[_hubAccess].queryChangeset({ ...arg, accessToken: await IModelHost.getAccessToken() });\r\n }\r\n\r\n /** Query the hub for an array of changeset properties given a ChangesetRange */\r\n public static async queryChangesets(arg: { iModelId: GuidString, range: ChangesetRange }): Promise<ChangesetProps[]> {\r\n return IModelHost[_hubAccess].queryChangesets({ ...arg, accessToken: await IModelHost.getAccessToken() });\r\n }\r\n\r\n /** Query the hub for the ChangesetProps of the most recent changeset */\r\n public static async getLatestChangeset(arg: { iModelId: GuidString }): Promise<ChangesetProps> {\r\n return IModelHost[_hubAccess].getLatestChangeset({ ...arg, accessToken: await IModelHost.getAccessToken() });\r\n }\r\n\r\n /** Query the Id of an iModel by name.\r\n * @param arg Identifies the iModel of interest\r\n * @returns the Id of the corresponding iModel, or `undefined` if no such iModel exists.\r\n */\r\n public static async queryIModelByName(arg: IModelNameArg): Promise<GuidString | undefined> {\r\n return IModelHost[_hubAccess].queryIModelByName(arg);\r\n }\r\n\r\n /** Deletes a folder and all it's contents.\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderAndContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return true;\r\n\r\n let status = false;\r\n status = BriefcaseManager.deleteFolderContents(folderPathname);\r\n if (!status)\r\n return false;\r\n\r\n status = BriefcaseManager.deleteFolderIfEmpty(folderPathname);\r\n return status;\r\n }\r\n\r\n private static async applySingleChangeset(db: IModelDb, changesetFile: ChangesetFileProps, fastForward: boolean) {\r\n if (changesetFile.changesType === ChangesetType.Schema || changesetFile.changesType === ChangesetType.SchemaSync)\r\n db.clearCaches(); // for schema changesets, statement caches may become invalid. Do this *before* applying, in case db needs to be closed (open statements hold db open.)\r\n\r\n db[_nativeDb].applyChangeset(changesetFile, fastForward);\r\n db.changeset = db[_nativeDb].getCurrentChangeset();\r\n\r\n // we're done with this changeset, delete it\r\n IModelJsFs.removeSync(changesetFile.pathname);\r\n }\r\n\r\n /** @internal */\r\n public static async revertTimelineChanges(db: IModelDb, arg: RevertChangesArgs): Promise<void> {\r\n if (!db.isOpen || db[_nativeDb].isReadonly())\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to revert timeline changes\");\r\n\r\n let currentIndex = db.changeset.index;\r\n if (currentIndex === undefined)\r\n currentIndex = (await IModelHost[_hubAccess].queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\r\n\r\n if (!arg.toIndex) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"toIndex must be specified to revert changesets\");\r\n }\r\n if (arg.toIndex > currentIndex) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"toIndex must be less than or equal to the current index\");\r\n }\r\n if (!db.holdsSchemaLock) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Cannot revert timeline changesets without holding a schema lock\");\r\n }\r\n\r\n // Download change sets\r\n const changesets = await IModelHost[_hubAccess].downloadChangesets({\r\n accessToken: arg.accessToken,\r\n iModelId: db.iModelId,\r\n range: { first: arg.toIndex, end: currentIndex },\r\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\r\n progressCallback: arg.onProgress,\r\n });\r\n\r\n if (changesets.length === 0)\r\n return;\r\n\r\n changesets.reverse();\r\n db.clearCaches();\r\n\r\n const stopwatch = new StopWatch(`Reverting changes`, true);\r\n Logger.logInfo(loggerCategory, `Starting reverting timeline changes from ${arg.toIndex} to ${currentIndex}`);\r\n\r\n /**\r\n * Revert timeline changes from the current index to the specified index.\r\n * It does not change parent of the current changeset.\r\n * All changes during revert operation are stored in a new changeset.\r\n * Revert operation require schema lock as we do not acquire individual locks for each element.\r\n * Optionally schema changes can be skipped (required for schema sync case).\r\n */\r\n db[_nativeDb].revertTimelineChanges(changesets, arg.skipSchemaChanges ?? false);\r\n Logger.logInfo(loggerCategory, `Reverted timeline changes from ${arg.toIndex} to ${currentIndex} (${stopwatch.elapsedSeconds} seconds)`);\r\n\r\n changesets.forEach((changeset) => {\r\n IModelJsFs.removeSync(changeset.pathname);\r\n });\r\n db.notifyChangesetApplied();\r\n }\r\n\r\n /** @internal */\r\n public static async pullAndApplyChangesets(db: IModelDb, arg: PullChangesArgs): Promise<void> {\r\n if (!db.isOpen || db[_nativeDb].isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to process change sets\");\r\n\r\n let currentIndex = db.changeset.index;\r\n if (currentIndex === undefined)\r\n currentIndex = (await IModelHost[_hubAccess].queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\r\n\r\n const reverse = (arg.toIndex && arg.toIndex < currentIndex) ? true : false;\r\n\r\n if (db[_nativeDb].hasPendingTxns() && reverse) {\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Cannot reverse changesets when there are pending changes\");\r\n }\r\n\r\n // Download change sets\r\n const changesets = await IModelHost[_hubAccess].downloadChangesets({\r\n accessToken: arg.accessToken,\r\n iModelId: db.iModelId,\r\n range: { first: reverse ? arg.toIndex! + 1 : currentIndex + 1, end: reverse ? currentIndex : arg.toIndex }, // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\r\n progressCallback: arg.onProgress,\r\n });\r\n\r\n if (changesets.length === 0)\r\n return; // nothing to apply\r\n\r\n if (reverse)\r\n changesets.reverse();\r\n\r\n\r\n let appliedChangesets = -1;\r\n if (db[_nativeDb].hasPendingTxns() && !reverse && !arg.noFastForward) {\r\n // attempt to perform fast forward\r\n for (const changeset of changesets) {\r\n // do not waste time on schema changesets. They cannot be fastforwarded.\r\n if (changeset.changesType === ChangesetType.Schema || changeset.changesType === ChangesetType.SchemaSync)\r\n break;\r\n\r\n try {\r\n const stopwatch = new StopWatch(`[${changeset.id}]`, true);\r\n Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description} using fast forward method`);\r\n await this.applySingleChangeset(db, changeset, true);\r\n Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);\r\n appliedChangesets++;\r\n db.saveChanges();\r\n } catch {\r\n db.abandonChanges();\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (appliedChangesets < changesets.length - 1) {\r\n db[_nativeDb].pullMergeBegin();\r\n for (const changeset of changesets.filter((_, index) => index > appliedChangesets)) {\r\n const stopwatch = new StopWatch(`[${changeset.id}]`, true);\r\n Logger.logInfo(loggerCategory, `Starting application of changeset with id ${stopwatch.description}`);\r\n try {\r\n await this.applySingleChangeset(db, changeset, false);\r\n Logger.logInfo(loggerCategory, `Applied changeset with id ${stopwatch.description} (${stopwatch.elapsedSeconds} seconds)`);\r\n } catch (err: any) {\r\n if (err instanceof Error) {\r\n Logger.logError(loggerCategory, `Error applying changeset with id ${stopwatch.description}: ${err.message}`);\r\n }\r\n db.abandonChanges();\r\n db[_nativeDb].pullMergeEnd();\r\n throw err;\r\n }\r\n }\r\n db[_nativeDb].pullMergeEnd();\r\n if (!db.isReadonly) {\r\n db.saveChanges(\"Merge.\");\r\n }\r\n }\r\n\r\n // notify listeners\r\n db.notifyChangesetApplied();\r\n }\r\n /** create a changeset from the current changes, and push it to iModelHub */\r\n private static async pushChanges(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n const changesetProps = db[_nativeDb].startCreateChangeset() as ChangesetFileProps;\r\n changesetProps.briefcaseId = db.briefcaseId;\r\n changesetProps.description = arg.description;\r\n const fileSize = IModelJsFs.lstatSync(changesetProps.pathname)?.size;\r\n if (!fileSize) // either undefined or 0 means error\r\n throw new IModelError(IModelStatus.NoContent, \"error creating changeset\");\r\n\r\n changesetProps.size = fileSize;\r\n\r\n let retryCount = arg.pushRetryCount ?? 3;\r\n while (true) {\r\n try {\r\n const accessToken = await IModelHost.getAccessToken();\r\n const index = await IModelHost[_hubAccess].pushChangeset({ accessToken, iModelId: db.iModelId, changesetProps });\r\n db[_nativeDb].completeCreateChangeset({ index });\r\n db.changeset = db[_nativeDb].getCurrentChangeset();\r\n if (!arg.retainLocks)\r\n await db.locks[_releaseAllLocks]();\r\n\r\n return;\r\n } catch (err: any) {\r\n const shouldRetry = () => {\r\n if (retryCount-- <= 0)\r\n return false;\r\n switch (err.errorNumber) {\r\n case IModelHubStatus.AnotherUserPushing:\r\n case IModelHubStatus.DatabaseTemporarilyLocked:\r\n case IModelHubStatus.OperationFailed:\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n if (!shouldRetry()) {\r\n db[_nativeDb].abandonCreateChangeset();\r\n throw err;\r\n }\r\n } finally {\r\n IModelJsFs.removeSync(changesetProps.pathname);\r\n }\r\n }\r\n }\r\n\r\n /** Pull/merge (if necessary), then push all local changes as a changeset. Called by [[BriefcaseDb.pushChanges]]\r\n * @internal\r\n */\r\n public static async pullMergePush(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n let retryCount = arg.mergeRetryCount ?? 5;\r\n while (true) {\r\n try {\r\n await BriefcaseManager.pullAndApplyChangesets(db, arg);\r\n if (!db.skipSyncSchemasOnPullAndPush)\r\n await SchemaSync.pull(db);\r\n return await BriefcaseManager.pushChanges(db, arg);\r\n } catch (err: any) {\r\n if (retryCount-- <= 0 || err.errorNumber !== IModelHubStatus.PullIsRequired)\r\n throw (err);\r\n await (arg.mergeRetryDelay ?? BeDuration.fromSeconds(3)).wait();\r\n }\r\n }\r\n }\r\n\r\n}\r\n"]}
@@ -242,8 +242,8 @@ exports.ExportGraphicsMeshVisitor = ExportGraphicsMeshVisitor;
242
242
  */
243
243
  class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {
244
244
  _facetIndices;
245
- _currentSubsetIndex; // index within _parentFacetIndices, or -1 after construction
246
- _nextSubsetIndex; // index within _parentFacetIndices
245
+ _currentSubsetIndex; // index within _facetIndices
246
+ _nextSubsetIndex; // index within _facetIndices
247
247
  constructor(polyface, facetIndices, numWrap) {
248
248
  super(polyface, numWrap);
249
249
  this._facetIndices = facetIndices.slice();
@@ -1 +1 @@
1
- {"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AACpE,wDAAgG;AAkQhG;;GAEG;AACH,IAAiB,cAAc,CAuD9B;AAvDD,WAAiB,cAAc;IAC7B;;OAEG;IACH,SAAgB,wBAAwB,CAAC,GAA0B,EAAE,GAA0B;QAC7F,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC,aAAa;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,eAAe,KAAK,GAAG,CAAC,eAAe;YAC7C,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS;YACjC,OAAO,KAAK,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAZe,uCAAwB,2BAYvC,CAAA;IAED;;;;OAIG;IACH,SAAgB,wBAAwB,CAAC,IAAwB;QAC/D,MAAM,QAAQ,GAAG,+BAAe,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAE5E,MAAM,CAAC,GAAiB,IAAI,CAAC,MAAM,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CA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C,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,8CAA8C;IAC9B,KAAK;QACnB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,+DAA+D;YACvF,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,0CAA0C;QACvE,CAAC;IACH,CAAC;IACD;;;;OAIG;IACI,gBAAgB,CAAC,WAAoB;QAC1C,IAAI,SAAS,KAAK,WAAW;YAC3B,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5F,CAAC;IACD,iEAAiE;IACjD,sBAAsB;QACpC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;IACnC,CAAC;CACF;AAtED,0EAsEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ExportGraphics\r\n */\r\n\r\nimport { assert, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\r\nimport { ColorDefProps, GeometryClass } from \"@itwin/core-common\";\r\n\r\n/** A collection of line segments, suitable for direct use with graphics APIs.\r\n * The structure of this data matches GL_LINES in OpenGL.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsLines {\r\n /** Zero-based vertex indices, every two indices represent a line segment */\r\n indices: Int32Array;\r\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n}\r\n\r\n/** Info provided to ExportLinesFunction about linework graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportLinesInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\r\n\r\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsMesh {\r\n /** Zero-based vertex indices, every three indices represent a triangle */\r\n indices: Int32Array;\r\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\r\n normals: Float32Array;\r\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\r\n params: Float32Array;\r\n /** If true, clients should assume both sides of the mesh are visible and not cull back faces. */\r\n isTwoSided: boolean;\r\n}\r\n\r\n/** Info provided to ExportGraphicsFunction about graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\r\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\r\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\r\n * same graphics (with a different transform).\r\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\r\n * graphics.\r\n * @public\r\n */\r\nexport interface ExportPartDisplayInfo {\r\n categoryId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n materialId: Id64String;\r\n elmTransparency: number;\r\n lineColor: number;\r\n}\r\n\r\n/** Information about references to [GeometryPart]($core-backend) elements found during\r\n * a call to [IModelDb.exportGraphics]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\r\n * @public\r\n */\r\nexport interface ExportPartInstanceInfo {\r\n /** ID for the [GeometryPart]($core-backend) */\r\n partId: Id64String;\r\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\r\n partInstanceId: Id64String;\r\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A row-major storage 4x3 transform for this instance.\r\n * See export-gltf under test-apps in the iTwin.js monorepo for a working reference.\r\n */\r\n transform?: Float64Array;\r\n}\r\n\r\n/** A callback function that receives generated graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsOptions {\r\n /** The source elements for the exported graphics */\r\n elementIdArray: Id64Array;\r\n /** A function to call for each unique element ID, color and texture combination */\r\n onGraphics: ExportGraphicsFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onLineGraphics?: ExportLinesFunction;\r\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\r\n * recorded in this array. In this case, graphics that would result from the GeometryPart\r\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\r\n */\r\n partInstanceArray?: ExportPartInstanceInfo[];\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\r\n */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry).\r\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\r\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\r\n * that it's necessary, it's almost certainly not!)\r\n */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Info provided to ExportPartFunction about graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartInfo {\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\r\n\r\n/** Info provided to ExportPartFunction about line graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartLinesInfo {\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartGraphicsOptions {\r\n /** The ID for the source [GeometryPart]($core-backend) */\r\n elementId: Id64String;\r\n /** The base display properties to use for generating the graphics. This should come from an\r\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\r\n */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A function to call for each unique color and texture combination. */\r\n onPartGraphics: ExportPartFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onPartLineGraphics?: ExportPartLinesFunction;\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\r\n */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry)\r\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\r\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\r\n * that it's necessary, it's almost certainly not!)\r\n */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport namespace ExportGraphics {\r\n /** Test if ExportPartDisplayInfos have exactly the same values.\r\n * @public\r\n */\r\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\r\n if (lhs.categoryId !== rhs.categoryId)\r\n return false;\r\n if (lhs.subCategoryId !== rhs.subCategoryId)\r\n return false;\r\n if (lhs.materialId !== rhs.materialId)\r\n return false;\r\n if (lhs.elmTransparency !== rhs.elmTransparency)\r\n return false;\r\n if (lhs.lineColor !== rhs.lineColor)\r\n return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\r\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\r\n * @public\r\n */\r\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\r\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\r\n\r\n const p: Float64Array = mesh.points;\r\n for (let i = 0; i < p.length; i += 3)\r\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\r\n\r\n const n: Float32Array = mesh.normals;\r\n assert(undefined !== polyface.data.normal);\r\n for (let i = 0; i < n.length; i += 3)\r\n polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);\r\n\r\n const uv: Float32Array = mesh.params;\r\n assert(undefined !== polyface.data.param);\r\n for (let i = 0; i < uv.length; i += 2)\r\n polyface.data.param.pushXY(uv[i], uv[i + 1]);\r\n\r\n const indices = mesh.indices;\r\n const addIndex = (idx: number) => {\r\n polyface.addPointIndex(idx, true);\r\n polyface.addNormalIndex(idx);\r\n polyface.addParamIndex(idx);\r\n };\r\n for (let i = 0; i < indices.length; i += 3) {\r\n addIndex(indices[i]);\r\n addIndex(indices[i + 1]);\r\n addIndex(indices[i + 2]);\r\n polyface.terminateFacet(false);\r\n }\r\n\r\n return polyface;\r\n }\r\n}\r\n/**\r\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\r\n * * Because the ExportGraphicsMesh has limited data:\r\n * * There is no auxData in this visitor.\r\n * * There is no color in this visitor.\r\n * * All edgeVisible are true.\r\n * @public\r\n */\r\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _polyface: ExportGraphicsMesh;\r\n protected constructor(facets: ExportGraphicsMesh, numWrap: number) {\r\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\r\n this._polyface = facets;\r\n this._numWrap = numWrap;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n this.reset();\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\" (default)\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n */\r\n public static create(polyface: ExportGraphicsMesh, numWrap: number = 0): ExportGraphicsMeshVisitor {\r\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\r\n }\r\n /** Restart the visitor at the first facet. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here\r\n }\r\n /** Select a facet by simple index. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\r\n return false;\r\n if (this._currentFacetIndex !== facetIndex || 3 + this._numWrap !== this.point.length) {\r\n this._currentFacetIndex = facetIndex;\r\n this.point.length = 0;\r\n this.pointIndex.length = 0;\r\n this.edgeVisible.length = 0;\r\n const sourcePoints = this._polyface.points;\r\n const indices = this._polyface.indices;\r\n const i0 = 3 * facetIndex;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.pointIndex.push(indices[i]);\r\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\r\n this.edgeVisible.push(true);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.point.pushFromGrowableXYZArray(this.point, i);\r\n }\r\n\r\n const sourceParams = this._polyface.params;\r\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\r\n this.paramIndex.length = 0;\r\n this.param.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 2 * indices[i];\r\n this.paramIndex.push(indices[i]);\r\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.param.pushFromGrowableXYArray(this.param, i);\r\n }\r\n }\r\n\r\n const sourceNormals = this._polyface.normals;\r\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\r\n this.normalIndex.length = 0;\r\n this.normal.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.normalIndex.push(indices[i]);\r\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.normal.pushFromGrowableXYZArray(this.normal, i);\r\n }\r\n }\r\n }\r\n this._nextFacetIndex = facetIndex + 1;\r\n return true;\r\n }\r\n /** Load data for the next facet. */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n /** Set the number of vertices to replicate in visitor arrays. */\r\n public setNumWrap(numWrap: number): void {\r\n this._numWrap = numWrap;\r\n }\r\n\r\n /** Return the index (in the client polyface) of the current facet */\r\n public currentReadIndex(): number {\r\n return this._currentFacetIndex;\r\n }\r\n /** Return the point index of vertex i within the currently loaded facet */\r\n public clientPointIndex(i: number): number {\r\n return this.pointIndex[i];\r\n }\r\n /** Return the param index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientParamIndex(i: number): number {\r\n return this.paramIndex ? this.paramIndex[i] : -1;\r\n }\r\n /** Return the normal index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientNormalIndex(i: number): number {\r\n return this.normalIndex ? this.normalIndex[i] : -1;\r\n }\r\n /** Always returns -1 since we never have colors. */\r\n public clientColorIndex(_i: number): number {\r\n return -1;\r\n }\r\n /** Always returns -1 since we never have auxiliary data. */\r\n public clientAuxIndex(_i: number): number {\r\n return -1;\r\n }\r\n /** return the client polyface */\r\n public clientPolyface(): Polyface | undefined {\r\n return undefined;\r\n }\r\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\r\n public clearArrays(): void {\r\n if (this.point !== undefined)\r\n this.point.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n // ignore color and aux -- they never exist.\r\n }\r\n /** transfer interpolated data from the other visitor.\r\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n }\r\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n // ignore color and aux -- they never exist.\r\n }\r\n /** Return the number of facets this visitor is able to visit */\r\n public getVisitableFacetCount(): number {\r\n return Math.floor(this._polyface.indices.length / 3);\r\n }\r\n /** Create a visitor for a subset of the facets visitable by the instance. */\r\n public createSubsetVisitor(facetIndices: number[], numWrap: number = 0): ExportGraphicsMeshSubsetVisitor {\r\n return ExportGraphicsMeshSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);\r\n }\r\n}\r\n\r\n/**\r\n * An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\r\n * @public\r\n */\r\nexport class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {\r\n private _facetIndices: number[];\r\n private _currentSubsetIndex: number; // index within _parentFacetIndices, or -1 after construction\r\n private _nextSubsetIndex: number; // index within _parentFacetIndices\r\n\r\n private constructor(polyface: ExportGraphicsMesh, facetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._facetIndices = facetIndices.slice();\r\n this._currentSubsetIndex = -1;\r\n this._nextSubsetIndex = 0;\r\n this.reset();\r\n }\r\n private isValidSubsetIndex(index: number): boolean {\r\n return index >= 0 && index < this._facetIndices.length;\r\n }\r\n /**\r\n * Create a visitor for iterating a subset of the facets of `polyface`.\r\n * @param polyface reference to the client polyface, supplying facets\r\n * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.\r\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\r\n */\r\n public static createSubsetVisitor(\r\n polyface: ExportGraphicsMesh, facetIndices: number[], numWrap: number = 0,\r\n ): ExportGraphicsMeshSubsetVisitor {\r\n return new ExportGraphicsMeshSubsetVisitor(polyface, facetIndices, numWrap);\r\n }\r\n /**\r\n * Advance the iterator to a particular facet in the subset of client polyface facets.\r\n * @param subsetIndex index into the subset array, not to be confused with the client facet index.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToReadIndex(subsetIndex: number): boolean {\r\n if (this.isValidSubsetIndex(subsetIndex)) {\r\n this._currentSubsetIndex = subsetIndex;\r\n this._nextSubsetIndex = subsetIndex + 1;\r\n return super.moveToReadIndex(this._facetIndices[subsetIndex]);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Advance the iterator to the next facet in the subset of client polyface facets.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextSubsetIndex !== this._currentSubsetIndex)\r\n return this.moveToReadIndex(this._nextSubsetIndex);\r\n this._nextSubsetIndex++;\r\n return true;\r\n }\r\n /** Restart the visitor at the first facet. */\r\n public override reset(): void {\r\n if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized\r\n this.moveToReadIndex(0);\r\n this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here\r\n }\r\n }\r\n /**\r\n * Return the client polyface facet index (aka \"readIndex\") for the given subset index.\r\n * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.\r\n * @return valid client polyface facet index, or `undefined` if invalid subset index.\r\n */\r\n public parentFacetIndex(subsetIndex?: number): number | undefined {\r\n if (undefined === subsetIndex)\r\n subsetIndex = this._currentSubsetIndex;\r\n return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public override getVisitableFacetCount(): number {\r\n return this._facetIndices.length;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AACpE,wDAAgG;AAkQhG;;GAEG;AACH,IAAiB,cAAc,CAuD9B;AAvDD,WAAiB,cAAc;IAC7B;;OAEG;IACH,SAAgB,wBAAwB,CAAC,GAA0B,EAAE,GAA0B;QAC7F,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC,aAAa;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,eAAe,KAAK,GAAG,CAAC,eAAe;YAC7C,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,SA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,MAAM,CAAC;IACnC,CAAC;CACF;AAtED,0EAsEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ExportGraphics\r\n */\r\n\r\nimport { assert, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\r\nimport { ColorDefProps, GeometryClass } from \"@itwin/core-common\";\r\n\r\n/** A collection of line segments, suitable for direct use with graphics APIs.\r\n * The structure of this data matches GL_LINES in OpenGL.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsLines {\r\n /** Zero-based vertex indices, every two indices represent a line segment */\r\n indices: Int32Array;\r\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n}\r\n\r\n/** Info provided to ExportLinesFunction about linework graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportLinesInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\r\n\r\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsMesh {\r\n /** Zero-based vertex indices, every three indices represent a triangle */\r\n indices: Int32Array;\r\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\r\n normals: Float32Array;\r\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\r\n params: Float32Array;\r\n /** If true, clients should assume both sides of the mesh are visible and not cull back faces. */\r\n isTwoSided: boolean;\r\n}\r\n\r\n/** Info provided to ExportGraphicsFunction about graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\r\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\r\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\r\n * same graphics (with a different transform).\r\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\r\n * graphics.\r\n * @public\r\n */\r\nexport interface ExportPartDisplayInfo {\r\n categoryId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n materialId: Id64String;\r\n elmTransparency: number;\r\n lineColor: number;\r\n}\r\n\r\n/** Information about references to [GeometryPart]($core-backend) elements found during\r\n * a call to [IModelDb.exportGraphics]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\r\n * @public\r\n */\r\nexport interface ExportPartInstanceInfo {\r\n /** ID for the [GeometryPart]($core-backend) */\r\n partId: Id64String;\r\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\r\n partInstanceId: Id64String;\r\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A row-major storage 4x3 transform for this instance.\r\n * See export-gltf under test-apps in the iTwin.js monorepo for a working reference.\r\n */\r\n transform?: Float64Array;\r\n}\r\n\r\n/** A callback function that receives generated graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsOptions {\r\n /** The source elements for the exported graphics */\r\n elementIdArray: Id64Array;\r\n /** A function to call for each unique element ID, color and texture combination */\r\n onGraphics: ExportGraphicsFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onLineGraphics?: ExportLinesFunction;\r\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\r\n * recorded in this array. In this case, graphics that would result from the GeometryPart\r\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\r\n */\r\n partInstanceArray?: ExportPartInstanceInfo[];\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\r\n */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry).\r\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\r\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\r\n * that it's necessary, it's almost certainly not!)\r\n */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Info provided to ExportPartFunction about graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartInfo {\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\r\n\r\n/** Info provided to ExportPartFunction about line graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartLinesInfo {\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartGraphicsOptions {\r\n /** The ID for the source [GeometryPart]($core-backend) */\r\n elementId: Id64String;\r\n /** The base display properties to use for generating the graphics. This should come from an\r\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\r\n */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A function to call for each unique color and texture combination. */\r\n onPartGraphics: ExportPartFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onPartLineGraphics?: ExportPartLinesFunction;\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\r\n */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry)\r\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\r\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\r\n * that it's necessary, it's almost certainly not!)\r\n */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport namespace ExportGraphics {\r\n /** Test if ExportPartDisplayInfos have exactly the same values.\r\n * @public\r\n */\r\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\r\n if (lhs.categoryId !== rhs.categoryId)\r\n return false;\r\n if (lhs.subCategoryId !== rhs.subCategoryId)\r\n return false;\r\n if (lhs.materialId !== rhs.materialId)\r\n return false;\r\n if (lhs.elmTransparency !== rhs.elmTransparency)\r\n return false;\r\n if (lhs.lineColor !== rhs.lineColor)\r\n return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\r\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\r\n * @public\r\n */\r\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\r\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\r\n\r\n const p: Float64Array = mesh.points;\r\n for (let i = 0; i < p.length; i += 3)\r\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\r\n\r\n const n: Float32Array = mesh.normals;\r\n assert(undefined !== polyface.data.normal);\r\n for (let i = 0; i < n.length; i += 3)\r\n polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);\r\n\r\n const uv: Float32Array = mesh.params;\r\n assert(undefined !== polyface.data.param);\r\n for (let i = 0; i < uv.length; i += 2)\r\n polyface.data.param.pushXY(uv[i], uv[i + 1]);\r\n\r\n const indices = mesh.indices;\r\n const addIndex = (idx: number) => {\r\n polyface.addPointIndex(idx, true);\r\n polyface.addNormalIndex(idx);\r\n polyface.addParamIndex(idx);\r\n };\r\n for (let i = 0; i < indices.length; i += 3) {\r\n addIndex(indices[i]);\r\n addIndex(indices[i + 1]);\r\n addIndex(indices[i + 2]);\r\n polyface.terminateFacet(false);\r\n }\r\n\r\n return polyface;\r\n }\r\n}\r\n/**\r\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\r\n * * Because the ExportGraphicsMesh has limited data:\r\n * * There is no auxData in this visitor.\r\n * * There is no color in this visitor.\r\n * * All edgeVisible are true.\r\n * @public\r\n */\r\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _polyface: ExportGraphicsMesh;\r\n protected constructor(facets: ExportGraphicsMesh, numWrap: number) {\r\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\r\n this._polyface = facets;\r\n this._numWrap = numWrap;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n this.reset();\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\" (default)\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n */\r\n public static create(polyface: ExportGraphicsMesh, numWrap: number = 0): ExportGraphicsMeshVisitor {\r\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\r\n }\r\n /** Restart the visitor at the first facet. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here\r\n }\r\n /** Select a facet by simple index. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\r\n return false;\r\n if (this._currentFacetIndex !== facetIndex || 3 + this._numWrap !== this.point.length) {\r\n this._currentFacetIndex = facetIndex;\r\n this.point.length = 0;\r\n this.pointIndex.length = 0;\r\n this.edgeVisible.length = 0;\r\n const sourcePoints = this._polyface.points;\r\n const indices = this._polyface.indices;\r\n const i0 = 3 * facetIndex;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.pointIndex.push(indices[i]);\r\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\r\n this.edgeVisible.push(true);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.point.pushFromGrowableXYZArray(this.point, i);\r\n }\r\n\r\n const sourceParams = this._polyface.params;\r\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\r\n this.paramIndex.length = 0;\r\n this.param.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 2 * indices[i];\r\n this.paramIndex.push(indices[i]);\r\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.param.pushFromGrowableXYArray(this.param, i);\r\n }\r\n }\r\n\r\n const sourceNormals = this._polyface.normals;\r\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\r\n this.normalIndex.length = 0;\r\n this.normal.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.normalIndex.push(indices[i]);\r\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.normal.pushFromGrowableXYZArray(this.normal, i);\r\n }\r\n }\r\n }\r\n this._nextFacetIndex = facetIndex + 1;\r\n return true;\r\n }\r\n /** Load data for the next facet. */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n /** Set the number of vertices to replicate in visitor arrays. */\r\n public setNumWrap(numWrap: number): void {\r\n this._numWrap = numWrap;\r\n }\r\n\r\n /** Return the index (in the client polyface) of the current facet */\r\n public currentReadIndex(): number {\r\n return this._currentFacetIndex;\r\n }\r\n /** Return the point index of vertex i within the currently loaded facet */\r\n public clientPointIndex(i: number): number {\r\n return this.pointIndex[i];\r\n }\r\n /** Return the param index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientParamIndex(i: number): number {\r\n return this.paramIndex ? this.paramIndex[i] : -1;\r\n }\r\n /** Return the normal index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientNormalIndex(i: number): number {\r\n return this.normalIndex ? this.normalIndex[i] : -1;\r\n }\r\n /** Always returns -1 since we never have colors. */\r\n public clientColorIndex(_i: number): number {\r\n return -1;\r\n }\r\n /** Always returns -1 since we never have auxiliary data. */\r\n public clientAuxIndex(_i: number): number {\r\n return -1;\r\n }\r\n /** return the client polyface */\r\n public clientPolyface(): Polyface | undefined {\r\n return undefined;\r\n }\r\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\r\n public clearArrays(): void {\r\n if (this.point !== undefined)\r\n this.point.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n // ignore color and aux -- they never exist.\r\n }\r\n /** transfer interpolated data from the other visitor.\r\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n }\r\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n // ignore color and aux -- they never exist.\r\n }\r\n /** Return the number of facets this visitor is able to visit */\r\n public getVisitableFacetCount(): number {\r\n return Math.floor(this._polyface.indices.length / 3);\r\n }\r\n /** Create a visitor for a subset of the facets visitable by the instance. */\r\n public createSubsetVisitor(facetIndices: number[], numWrap: number = 0): ExportGraphicsMeshSubsetVisitor {\r\n return ExportGraphicsMeshSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);\r\n }\r\n}\r\n\r\n/**\r\n * An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\r\n * @public\r\n */\r\nexport class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {\r\n private _facetIndices: number[];\r\n private _currentSubsetIndex: number; // index within _facetIndices\r\n private _nextSubsetIndex: number; // index within _facetIndices\r\n\r\n private constructor(polyface: ExportGraphicsMesh, facetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._facetIndices = facetIndices.slice();\r\n this._currentSubsetIndex = -1;\r\n this._nextSubsetIndex = 0;\r\n this.reset();\r\n }\r\n private isValidSubsetIndex(index: number): boolean {\r\n return index >= 0 && index < this._facetIndices.length;\r\n }\r\n /**\r\n * Create a visitor for iterating a subset of the facets of `polyface`.\r\n * @param polyface reference to the client polyface, supplying facets\r\n * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.\r\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\r\n */\r\n public static createSubsetVisitor(\r\n polyface: ExportGraphicsMesh, facetIndices: number[], numWrap: number = 0,\r\n ): ExportGraphicsMeshSubsetVisitor {\r\n return new ExportGraphicsMeshSubsetVisitor(polyface, facetIndices, numWrap);\r\n }\r\n /**\r\n * Advance the iterator to a particular facet in the subset of client polyface facets.\r\n * @param subsetIndex index into the subset array, not to be confused with the client facet index.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToReadIndex(subsetIndex: number): boolean {\r\n if (this.isValidSubsetIndex(subsetIndex)) {\r\n this._currentSubsetIndex = subsetIndex;\r\n this._nextSubsetIndex = subsetIndex + 1;\r\n return super.moveToReadIndex(this._facetIndices[subsetIndex]);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Advance the iterator to the next facet in the subset of client polyface facets.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextSubsetIndex !== this._currentSubsetIndex)\r\n return this.moveToReadIndex(this._nextSubsetIndex);\r\n this._nextSubsetIndex++;\r\n return true;\r\n }\r\n /** Restart the visitor at the first facet. */\r\n public override reset(): void {\r\n if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized\r\n this.moveToReadIndex(0);\r\n this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here\r\n }\r\n }\r\n /**\r\n * Return the client polyface facet index (aka \"readIndex\") for the given subset index.\r\n * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.\r\n * @return valid client polyface facet index, or `undefined` if invalid subset index.\r\n */\r\n public parentFacetIndex(subsetIndex?: number): number | undefined {\r\n if (undefined === subsetIndex)\r\n subsetIndex = this._currentSubsetIndex;\r\n return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public override getVisitableFacetCount(): number {\r\n return this._facetIndices.length;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IModelD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,SAAS;IAK1E;;;OAGG;WACW,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,gCAAgC,GAAG,YAAY;IAgBxG;;;;;;OAMG;WACW,wBAAwB,CAAC,QAAQ,EAAE,aAAa;IAS9D;;;;;OAKG;IACI,gBAAgB,IAAI,IAAI;IAQ/B;;;;;OAKG;WACW,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,GAAE,QAA6B,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,YAAY;IAiBpI;;;;OAIG;WACW,mBAAmB,CAAC,cAAc,EAAE,aAAa,GAAG,IAAI;CAWvE"}
@@ -650,6 +650,9 @@ class IModelDb extends core_common_1.IModel {
650
650
  performCheckpoint() {
651
651
  if (!this.isReadonly) {
652
652
  this.saveChanges();
653
+ this.clearCaches();
654
+ this[Symbols_1._nativeDb].concurrentQueryShutdown();
655
+ this[Symbols_1._nativeDb].clearECDbCache();
653
656
  this[Symbols_1._nativeDb].performCheckpoint();
654
657
  }
655
658
  }