@itwin/core-frontend 3.4.0-dev.1 → 3.4.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/lib/cjs/IModelConnection.d.ts +9 -2
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +9 -0
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.d.ts +17 -0
- package/lib/cjs/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.js +63 -19
- package/lib/cjs/PerModelCategoryVisibility.js.map +1 -1
- package/lib/cjs/SubCategoriesCache.d.ts +3 -12
- package/lib/cjs/SubCategoriesCache.d.ts.map +1 -1
- package/lib/cjs/SubCategoriesCache.js +14 -37
- package/lib/cjs/SubCategoriesCache.js.map +1 -1
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +6 -6
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/AmbientOcclusion.d.ts.map +1 -1
- package/lib/cjs/render/webgl/glsl/AmbientOcclusion.js +4 -1
- package/lib/cjs/render/webgl/glsl/AmbientOcclusion.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +9 -2
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +9 -0
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.d.ts +17 -0
- package/lib/esm/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.js +63 -19
- package/lib/esm/PerModelCategoryVisibility.js.map +1 -1
- package/lib/esm/SubCategoriesCache.d.ts +3 -12
- package/lib/esm/SubCategoriesCache.d.ts.map +1 -1
- package/lib/esm/SubCategoriesCache.js +16 -39
- package/lib/esm/SubCategoriesCache.js.map +1 -1
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +6 -6
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/render/webgl/glsl/AmbientOcclusion.d.ts.map +1 -1
- package/lib/esm/render/webgl/glsl/AmbientOcclusion.js +4 -1
- package/lib/esm/render/webgl/glsl/AmbientOcclusion.js.map +1 -1
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerModelCategoryVisibility.js","sourceRoot":"","sources":["../../src/PerModelCategoryVisibility.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAAuB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAI7F;;;;;;;;GAQG;AACH,MAAM,KAAW,0BAA0B,CAwC1C;AAxCD,WAAiB,0BAA0B;IACzC,uEAAuE;IACvE,IAAY,QAOX;IAPD,WAAY,QAAQ;QAClB,wIAAwI;QACxI,uCAAI,CAAA;QACJ,gDAAgD;QAChD,uCAAI,CAAA;QACJ,kDAAkD;QAClD,uCAAI,CAAA;IACN,CAAC,EAPW,QAAQ,GAAR,mCAAQ,KAAR,mCAAQ,QAOnB;IA4BD,SAAgB,eAAe,CAAC,QAAkB;QAChD,OAAO,IAAI,mCAAmC,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAFe,0CAAe,kBAE9B,CAAA;AACH,CAAC,EAxCgB,0BAA0B,KAA1B,0BAA0B,QAwC1C;AAED,MAAM,kCAAkC;IAKtC,YAAmB,OAAmB,EAAE,UAAsB,EAAE,OAAgB;QAC9E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,OAAmB,EAAE,UAAsB,EAAE,OAAgB;QACxE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,U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vB,SAAS;YAEX,4HAA4H;YAC5H,4HAA4H;YAC5H,gCAAgC;YAChC;0BACc;YAEd,sFAAsF;YACtF,sCAAsC;YACtC,kDAAkD;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACjD,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAEjD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;gBAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC7C,MAAM,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBACxD,IAAI,GAAG,KAAK,GAAG,CAAC,OAAO,EAAE;oBACvB,oEAAoE;oBACpE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBACvC,IAAI,SAAS,KAAK,KAAK,EAAE;wBACvB,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;qBACnC;oBAED,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;iBAC/B;aACF;SACF;IACH,CAAC;CACF","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 Views\r\n */\r\n\r\nimport { compareStrings, Id64, Id64Arg, Id64String, SortedArray } from \"@itwin/core-bentley\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/** Per-model category visibility permits the visibility of categories within a [[Viewport]] displaying a [[SpatialViewState]] to be overridden in\r\n * the context of individual [[GeometricModelState]]s.\r\n * If a category's visibility is overridden for a given model, then elements belonging to that category within that model will be displayed or hidden regardless of the category's inclusion in the Viewport's [[CategorySelectorState]].\r\n * The override affects geometry on all subcategories belonging to the overridden category. That is, if the category is overridden to be visible, then geometry on all subcategories of the category\r\n * will be visible, regardless of any [SubCategoryOverride]($common)s applied by the view's [[DisplayStyleState]].\r\n * @see [[Viewport.perModelCategoryVisibility]] to define the per-model category visibility for a viewport.\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace PerModelCategoryVisibility {\r\n /** Describes whether and how a category's visibility is overridden. */\r\n export enum Override {\r\n /** The category's visibility is not overridden; its visibility is wholly controlled by the [[Viewport]]'s [[CategorySelectorState]]. */\r\n None,\r\n /** The category is overridden to be visible. */\r\n Show,\r\n /** The category is overridden to be invisible. */\r\n Hide,\r\n }\r\n\r\n /** Describes one visibility override in a [[PerModelCategoryVisibility.Overrides]]. */\r\n export interface OverrideEntry {\r\n /** The Id of the [[GeometricModelState]] in which the override applies. */\r\n readonly modelId: Id64String;\r\n /** The Id of the [SpatialCategory]($backend) whose visibility is overridden. */\r\n readonly categoryId: Id64String;\r\n /** Whether the category is visible in the context of the model. */\r\n readonly visible: boolean;\r\n }\r\n\r\n /** Describes a set of per-model category visibility overrides. Changes to these overrides invoke the [[Viewport.onViewedCategoriesPerModelChanged]] event.\r\n * @see [[Viewport.perModelCategoryVisibility]].\r\n */\r\n export interface Overrides {\r\n /** Returns the override state of the specified category within the specified model. */\r\n getOverride(modelId: Id64String, categoryId: Id64String): Override;\r\n /** Changes the override state of one or more categories for one or more models. */\r\n setOverride(modelIds: Id64Arg, categoryIds: Id64Arg, override: Override): void;\r\n /** Removes all overrides for the specified models, or for all models if `modelIds` is undefined. */\r\n clearOverrides(modelIds?: Id64Arg): void;\r\n /** An iterator over all of the visibility overrides. */\r\n [Symbol.iterator]: () => Iterator<OverrideEntry>;\r\n /** Populate the symbology overrides based on the per-model category visibility. */\r\n addOverrides(fs: FeatureSymbology.Overrides, ovrs: Id64.Uint32Map<Id64.Uint32Set>): void;\r\n }\r\n\r\n export function createOverrides(viewport: Viewport): PerModelCategoryVisibility.Overrides {\r\n return new PerModelCategoryVisibilityOverrides(viewport);\r\n }\r\n}\r\n\r\nclass PerModelCategoryVisibilityOverride {\r\n public modelId: Id64String;\r\n public categoryId: Id64String;\r\n public visible: boolean;\r\n\r\n public constructor(modelId: Id64String, categoryId: Id64String, visible: boolean) {\r\n this.modelId = modelId;\r\n this.categoryId = categoryId;\r\n this.visible = visible;\r\n }\r\n\r\n public reset(modelId: Id64String, categoryId: Id64String, visible: boolean): void {\r\n this.modelId = modelId;\r\n this.categoryId = categoryId;\r\n this.visible = visible;\r\n }\r\n}\r\n\r\nfunction compareCategoryOverrides(lhs: PerModelCategoryVisibilityOverride, rhs: PerModelCategoryVisibilityOverride): number {\r\n const cmp = compareStrings(lhs.modelId, rhs.modelId);\r\n return 0 === cmp ? compareStrings(lhs.categoryId, rhs.categoryId) : cmp;\r\n}\r\n\r\n/** The Viewport-specific implementation of PerModelCategoryVisibility.Overrides. */\r\nclass PerModelCategoryVisibilityOverrides extends SortedArray<PerModelCategoryVisibilityOverride> implements PerModelCategoryVisibility.Overrides {\r\n private readonly _scratch = new PerModelCategoryVisibilityOverride(\"0\", \"0\", false);\r\n private readonly _vp: Viewport;\r\n\r\n public constructor(vp: Viewport) {\r\n super(compareCategoryOverrides);\r\n this._vp = vp;\r\n }\r\n\r\n public getOverride(modelId: Id64String, categoryId: Id64String): PerModelCategoryVisibility.Override {\r\n this._scratch.reset(modelId, categoryId, false);\r\n const ovr = this.findEqual(this._scratch);\r\n if (undefined !== ovr)\r\n return ovr.visible ? PerModelCategoryVisibility.Override.Show : PerModelCategoryVisibility.Override.Hide;\r\n else\r\n return PerModelCategoryVisibility.Override.None;\r\n }\r\n\r\n public setOverride(modelIds: Id64Arg, categoryIds: Id64Arg, override: PerModelCategoryVisibility.Override): void {\r\n const ovr = this._scratch;\r\n let changed = false;\r\n for (const modelId of Id64.iterable(modelIds)) {\r\n for (const categoryId of Id64.iterable(categoryIds)) {\r\n ovr.reset(modelId, categoryId, false);\r\n const index = this.indexOf(ovr);\r\n if (-1 === index) {\r\n if (PerModelCategoryVisibility.Override.None !== override) {\r\n this.insert(new PerModelCategoryVisibilityOverride(modelId, categoryId, PerModelCategoryVisibility.Override.Show === override));\r\n changed = true;\r\n }\r\n } else {\r\n if (PerModelCategoryVisibility.Override.None === override) {\r\n this._array.splice(index, 1);\r\n changed = true;\r\n } else if (this._array[index].visible !== (PerModelCategoryVisibility.Override.Show === override)) {\r\n this._array[index].visible = (PerModelCategoryVisibility.Override.Show === override);\r\n changed = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (changed) {\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n\r\n if (PerModelCategoryVisibility.Override.None !== override) {\r\n // Ensure subcategories loaded.\r\n this._vp.subcategories.push(this._vp.iModel.subcategories, categoryIds, () => this._vp.setViewedCategoriesPerModelChanged());\r\n }\r\n }\r\n }\r\n\r\n public clearOverrides(modelIds?: Id64Arg): void {\r\n if (undefined === modelIds) {\r\n if (0 < this.length) {\r\n this.clear();\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n }\r\n\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this.length;) {\r\n const ovr = this._array[i];\r\n let removed = false;\r\n for (const modelId of Id64.iterable(modelIds)) {\r\n if (modelId === ovr.modelId) {\r\n this._array.splice(i, 1);\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n removed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!removed)\r\n ++i;\r\n }\r\n }\r\n\r\n public addOverrides(fs: FeatureSymbology.Overrides, ovrs: Id64.Uint32Map<Id64.Uint32Set>): void {\r\n const cache = this._vp.iModel.subcategories;\r\n\r\n for (const ovr of this._array) {\r\n const subcats = cache.getSubCategories(ovr.categoryId);\r\n if (undefined === subcats)\r\n continue;\r\n\r\n // It's pointless to override for models which aren't displayed...except if we do this, and then someone enables that model,\r\n // we would need to regenerate our symbology overrides in response. Preferably people wouldn't bother overriding models that\r\n // they don't want us to draw...\r\n /* if (!this._vp.view.viewsModel(ovr.modelId))\r\n continue; */\r\n\r\n // ###TODO: Avoid recomputing upper and lower portions of modelId if modelId repeated.\r\n // (Array is sorted first by modelId).\r\n // Also avoid computing if no effective overrides.\r\n const modelLo = Id64.getLowerUint32(ovr.modelId);\r\n const modelHi = Id64.getUpperUint32(ovr.modelId);\r\n\r\n for (const subcat of subcats) {\r\n const subcatLo = Id64.getLowerUint32(subcat);\r\n const subcatHi = Id64.getUpperUint32(subcat);\r\n const vis = fs.isSubCategoryVisible(subcatLo, subcatHi);\r\n if (vis !== ovr.visible) {\r\n // Only care if visibility differs from that defined for entire view\r\n let entry = ovrs.get(modelLo, modelHi);\r\n if (undefined === entry) {\r\n entry = new Id64.Uint32Set();\r\n ovrs.set(modelLo, modelHi, entry);\r\n }\r\n\r\n entry.add(subcatLo, subcatHi);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"PerModelCategoryVisibility.js","sourceRoot":"","sources":["../../src/PerModelCategoryVisibility.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAAuB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAK7F;;;;;;;;GAQG;AACH,MAAM,KAAW,0BAA0B,CAyD1C;AAzDD,WAAiB,0BAA0B;IACzC,uEAAuE;IACvE,IAAY,QAOX;IAPD,WAAY,QAAQ;QAClB,wIAAwI;QACxI,uCAAI,CAAA;QACJ,gDAAgD;QAChD,uCAAI,CAAA;QACJ,kDAAkD;QAClD,uCAAI,CAAA;IACN,CAAC,EAPW,QAAQ,GAAR,mCAAQ,KAAR,mCAAQ,QAOnB;IA6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D,IAAI,GAAG,KAAK,GAAG,CAAC,OAAO,EAAE;oBACvB,oEAAoE;oBACpE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBACvC,IAAI,SAAS,KAAK,KAAK,EAAE;wBACvB,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;qBACnC;oBAED,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;iBAC/B;aACF;SACF;IACH,CAAC;CACF","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 Views\r\n */\r\n\r\nimport { compareStrings, Id64, Id64Arg, Id64String, SortedArray } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/** Per-model category visibility permits the visibility of categories within a [[Viewport]] displaying a [[SpatialViewState]] to be overridden in\r\n * the context of individual [[GeometricModelState]]s.\r\n * If a category's visibility is overridden for a given model, then elements belonging to that category within that model will be displayed or hidden regardless of the category's inclusion in the Viewport's [[CategorySelectorState]].\r\n * The override affects geometry on all subcategories belonging to the overridden category. That is, if the category is overridden to be visible, then geometry on all subcategories of the category\r\n * will be visible, regardless of any [SubCategoryOverride]($common)s applied by the view's [[DisplayStyleState]].\r\n * @see [[Viewport.perModelCategoryVisibility]] to define the per-model category visibility for a viewport.\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace PerModelCategoryVisibility {\r\n /** Describes whether and how a category's visibility is overridden. */\r\n export enum Override {\r\n /** The category's visibility is not overridden; its visibility is wholly controlled by the [[Viewport]]'s [[CategorySelectorState]]. */\r\n None,\r\n /** The category is overridden to be visible. */\r\n Show,\r\n /** The category is overridden to be invisible. */\r\n Hide,\r\n }\r\n\r\n /** Describes one visibility override in a [[PerModelCategoryVisibility.Overrides]]. */\r\n export interface OverrideEntry {\r\n /** The Id of the [[GeometricModelState]] in which the override applies. */\r\n readonly modelId: Id64String;\r\n /** The Id of the [SpatialCategory]($backend) whose visibility is overridden. */\r\n readonly categoryId: Id64String;\r\n /** Whether the category is visible in the context of the model. */\r\n readonly visible: boolean;\r\n }\r\n\r\n /** Describes a set of per-model category visibility overrides. Changes to these overrides invoke the [[Viewport.onViewedCategoriesPerModelChanged]] event.\r\n * @see [[Viewport.perModelCategoryVisibility]].\r\n */\r\n export interface Overrides {\r\n /** Returns the override state of the specified category within the specified model. */\r\n getOverride(modelId: Id64String, categoryId: Id64String): Override;\r\n /** Changes the override state of one or more categories for one or more models. */\r\n setOverride(modelIds: Id64Arg, categoryIds: Id64Arg, override: Override): void;\r\n /** Changes multiple overrides, given an array of overrides *\r\n * @beta\r\n */\r\n setOverrides(perModelCategoryVisibility: Props[], iModel?: IModelConnection): Promise<void>;\r\n /** Removes all overrides for the specified models, or for all models if `modelIds` is undefined. */\r\n clearOverrides(modelIds?: Id64Arg): void;\r\n /** An iterator over all of the visibility overrides. */\r\n [Symbol.iterator]: () => Iterator<OverrideEntry>;\r\n /** Populate the symbology overrides based on the per-model category visibility. */\r\n addOverrides(fs: FeatureSymbology.Overrides, ovrs: Id64.Uint32Map<Id64.Uint32Set>): void;\r\n }\r\n\r\n /** Describes a set of [[PerModelCategoryVisibility.Overrides]].\r\n * @see [[PerModelCategoryVisibility.Overrides.setOverrides]].\r\n * @beta\r\n */\r\n export interface Props {\r\n /** The id of the model to which the overrides apply. */\r\n modelId: string;\r\n /** The ids of the categories whose visibility are to be overridden within the context of the model. */\r\n categoryIds: Iterable<Id64String>;\r\n /** The visibility to be applied to the specified categories. */\r\n visOverride: PerModelCategoryVisibility.Override;\r\n }\r\n\r\n export function createOverrides(viewport: Viewport): PerModelCategoryVisibility.Overrides {\r\n return new PerModelCategoryVisibilityOverrides(viewport);\r\n }\r\n}\r\n\r\nclass PerModelCategoryVisibilityOverride {\r\n public modelId: Id64String;\r\n public categoryId: Id64String;\r\n public visible: boolean;\r\n\r\n public constructor(modelId: Id64String, categoryId: Id64String, visible: boolean) {\r\n this.modelId = modelId;\r\n this.categoryId = categoryId;\r\n this.visible = visible;\r\n }\r\n\r\n public reset(modelId: Id64String, categoryId: Id64String, visible: boolean): void {\r\n this.modelId = modelId;\r\n this.categoryId = categoryId;\r\n this.visible = visible;\r\n }\r\n}\r\n\r\nfunction compareCategoryOverrides(lhs: PerModelCategoryVisibilityOverride, rhs: PerModelCategoryVisibilityOverride): number {\r\n const cmp = compareStrings(lhs.modelId, rhs.modelId);\r\n return 0 === cmp ? compareStrings(lhs.categoryId, rhs.categoryId) : cmp;\r\n}\r\n\r\n/** The Viewport-specific implementation of PerModelCategoryVisibility.Overrides. */\r\nclass PerModelCategoryVisibilityOverrides extends SortedArray<PerModelCategoryVisibilityOverride> implements PerModelCategoryVisibility.Overrides {\r\n private readonly _scratch = new PerModelCategoryVisibilityOverride(\"0\", \"0\", false);\r\n private readonly _vp: Viewport;\r\n\r\n public constructor(vp: Viewport) {\r\n super(compareCategoryOverrides);\r\n this._vp = vp;\r\n }\r\n\r\n public getOverride(modelId: Id64String, categoryId: Id64String): PerModelCategoryVisibility.Override {\r\n this._scratch.reset(modelId, categoryId, false);\r\n const ovr = this.findEqual(this._scratch);\r\n if (undefined !== ovr)\r\n return ovr.visible ? PerModelCategoryVisibility.Override.Show : PerModelCategoryVisibility.Override.Hide;\r\n else\r\n return PerModelCategoryVisibility.Override.None;\r\n }\r\n\r\n /**\r\n * set the overrides for multiple perModelCategoryVisibility props, loading categoryIds from the iModel if necessary.\r\n * @see [[PerModelCategoryVisibility]]\r\n * @param perModelCategoryVisibility array of model category visibility overrides @see [[PerModelCategoryVisibility.Props]]\r\n * @param iModel Optional param iModel. If no iModel is provided, then the iModel associated with the viewport (used to construct this class) is used.\r\n * This optional iModel param is useful for apps which may show multiple iModels at once. Passing in an iModel ensures that the subcategories cache for the provided iModel\r\n * is populated as opposed to the iModel associated with the viewport which may or may not be an empty iModel.\r\n * @returns a promise that resolves once the overrides have been applied.\r\n */\r\n public async setOverrides(perModelCategoryVisibility: PerModelCategoryVisibility.Props[], iModel?: IModelConnection): Promise<void> {\r\n let anyChanged = false;\r\n const catIdsToLoad: string[] = [];\r\n const iModelToUse = iModel ? iModel : this._vp.iModel;\r\n for (const override of perModelCategoryVisibility) {\r\n const modelId = override.modelId;\r\n // The caller may pass a single categoryId as a string, if we don't convert this to an array we will iterate\r\n // over each individual character of that string, which is not the desired behavior.\r\n const categoryIds = typeof override.categoryIds === \"string\" ? [override.categoryIds] : override.categoryIds;\r\n const visOverride = override.visOverride;\r\n for (const categoryId of categoryIds) {\r\n if (this.findAndUpdateOverrideInArray(modelId, categoryId, visOverride)) {\r\n anyChanged = true;\r\n if (PerModelCategoryVisibility.Override.None !== visOverride) {\r\n catIdsToLoad.push(categoryId);\r\n }\r\n }\r\n }\r\n }\r\n if (anyChanged) {\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n if (catIdsToLoad.length !== 0) {\r\n this._vp.subcategories.push(iModelToUse.subcategories, catIdsToLoad, () => this._vp.setViewedCategoriesPerModelChanged());\r\n }\r\n }\r\n return;\r\n }\r\n\r\n /** Find and update the override in the array of overrides. If override not found, adds it to the array.\r\n * If the array was changed, returns true. */\r\n private findAndUpdateOverrideInArray(modelId: Id64String, categoryId: Id64String, override: PerModelCategoryVisibility.Override): boolean {\r\n const ovr = this._scratch;\r\n ovr.reset(modelId, categoryId, false);\r\n let changed = false;\r\n const index = this.indexOf(ovr);\r\n if (-1 === index) {\r\n if (PerModelCategoryVisibility.Override.None !== override) {\r\n this.insert(new PerModelCategoryVisibilityOverride(modelId, categoryId, PerModelCategoryVisibility.Override.Show === override));\r\n changed = true;\r\n }\r\n } else {\r\n if (PerModelCategoryVisibility.Override.None === override) {\r\n this._array.splice(index, 1);\r\n changed = true;\r\n } else if (this._array[index].visible !== (PerModelCategoryVisibility.Override.Show === override)) {\r\n this._array[index].visible = (PerModelCategoryVisibility.Override.Show === override);\r\n changed = true;\r\n }\r\n }\r\n return changed;\r\n }\r\n\r\n public setOverride(modelIds: Id64Arg, categoryIds: Id64Arg, override: PerModelCategoryVisibility.Override): void {\r\n let changed = false;\r\n for (const modelId of Id64.iterable(modelIds)) {\r\n for (const categoryId of Id64.iterable(categoryIds)) {\r\n if (this.findAndUpdateOverrideInArray(modelId, categoryId, override))\r\n changed = true;\r\n }\r\n }\r\n\r\n if (changed) {\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n\r\n if (PerModelCategoryVisibility.Override.None !== override) {\r\n // Ensure subcategories loaded.\r\n this._vp.subcategories.push(this._vp.iModel.subcategories, categoryIds, () => this._vp.setViewedCategoriesPerModelChanged());\r\n }\r\n }\r\n }\r\n\r\n public clearOverrides(modelIds?: Id64Arg): void {\r\n if (undefined === modelIds) {\r\n if (0 < this.length) {\r\n this.clear();\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n }\r\n\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this.length;) {\r\n const ovr = this._array[i];\r\n let removed = false;\r\n for (const modelId of Id64.iterable(modelIds)) {\r\n if (modelId === ovr.modelId) {\r\n this._array.splice(i, 1);\r\n this._vp.setViewedCategoriesPerModelChanged();\r\n removed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!removed)\r\n ++i;\r\n }\r\n }\r\n\r\n public addOverrides(fs: FeatureSymbology.Overrides, ovrs: Id64.Uint32Map<Id64.Uint32Set>): void {\r\n const cache = this._vp.iModel.subcategories;\r\n\r\n for (const ovr of this._array) {\r\n const subcats = cache.getSubCategories(ovr.categoryId);\r\n if (undefined === subcats)\r\n continue;\r\n\r\n // It's pointless to override for models which aren't displayed...except if we do this, and then someone enables that model,\r\n // we would need to regenerate our symbology overrides in response. Preferably people wouldn't bother overriding models that\r\n // they don't want us to draw...\r\n /* if (!this._vp.view.viewsModel(ovr.modelId))\r\n continue; */\r\n\r\n // ###TODO: Avoid recomputing upper and lower portions of modelId if modelId repeated.\r\n // (Array is sorted first by modelId).\r\n // Also avoid computing if no effective overrides.\r\n const modelLo = Id64.getLowerUint32(ovr.modelId);\r\n const modelHi = Id64.getUpperUint32(ovr.modelId);\r\n\r\n for (const subcat of subcats) {\r\n const subcatLo = Id64.getLowerUint32(subcat);\r\n const subcatHi = Id64.getUpperUint32(subcat);\r\n const vis = fs.isSubCategoryVisible(subcatLo, subcatHi);\r\n if (vis !== ovr.visible) {\r\n // Only care if visibility differs from that defined for entire view\r\n let entry = ovrs.get(modelLo, modelHi);\r\n if (undefined === entry) {\r\n entry = new Id64.Uint32Set();\r\n ovrs.set(modelLo, modelHi, entry);\r\n }\r\n\r\n entry.add(subcatLo, subcatHi);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Id64Arg, Id64Set, Id64String } from "@itwin/core-bentley";
|
|
2
|
-
import {
|
|
2
|
+
import { SubCategoryAppearance, SubCategoryResultRow } from "@itwin/core-common";
|
|
3
3
|
import { IModelConnection } from "./IModelConnection";
|
|
4
4
|
/** A cancelable paginated request for subcategory information.
|
|
5
5
|
* @see SubCategoriesCache
|
|
@@ -34,15 +34,6 @@ export declare class SubCategoriesCache {
|
|
|
34
34
|
* containing the corresponding promise and the set of categories still to be loaded.
|
|
35
35
|
*/
|
|
36
36
|
load(categoryIds: Id64Arg): SubCategoriesRequest | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Populates the notLoadedCategoryIds property of the HydrateViewStateRequestProps.
|
|
39
|
-
* notLoadedCategoryIds is a subset of categoryIds, filtering out any ids which already have an entry in the cache.
|
|
40
|
-
*/
|
|
41
|
-
preload(options: HydrateViewStateRequestProps, categoryIds: Id64Arg): void;
|
|
42
|
-
/**
|
|
43
|
-
* Populates the SubCategoriesCache using the categoryIdsResult of the HydrateViewStateResponseProps
|
|
44
|
-
*/
|
|
45
|
-
postload(options: HydrateViewStateResponseProps): void;
|
|
46
37
|
/** Given categoryIds, return which of these are not cached. */
|
|
47
38
|
private getMissing;
|
|
48
39
|
clear(): void;
|
|
@@ -61,10 +52,10 @@ export declare namespace SubCategoriesCache {
|
|
|
61
52
|
type Result = SubCategoryResultRow[];
|
|
62
53
|
class Request {
|
|
63
54
|
private readonly _imodel;
|
|
64
|
-
private readonly
|
|
55
|
+
private readonly _categoryIds;
|
|
65
56
|
private readonly _result;
|
|
66
57
|
private _canceled;
|
|
67
|
-
private
|
|
58
|
+
private _curCategoryIdsIndex;
|
|
68
59
|
get wasCanceled(): boolean;
|
|
69
60
|
constructor(categoryIds: Set<string>, imodel: IModelConnection, maxCategoriesPerQuery?: number);
|
|
70
61
|
cancel(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubCategoriesCache.d.ts","sourceRoot":"","sources":["../../src/SubCategoriesCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmC,OAAO,EAAE,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"SubCategoriesCache.d.ts","sourceRoot":"","sources":["../../src/SubCategoriesCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAuB,MAAM,qBAAqB,CAAC;AACzH,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,2BAA2B;IAC3B,MAAM,I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AY,CAA2B;QACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;QACtC,OAAO,CAAC,SAAS,CAAS;QAC1B,OAAO,CAAC,oBAAoB,CAAK;QAEjC,IAAW,WAAW,YAAsD;oBAEzD,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,SAAM;QAY3F,MAAM;QAEA,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;KA2BrD;IAED,KAAY,SAAS,GAAG,MAAM,IAAI,CAAC;IAEnC,MAAa,UAAU;QACrB,SAAgB,WAAW,EAAE,OAAO,CAAC;QACrC,SAAgB,KAAK,EAAE,SAAS,EAAE,CAAC;oBAEhB,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;KAIzD;IAED;;;;;OAKG;IACH,MAAa,KAAK;QAEhB,SAAS,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;QAChC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;QAC7B,SAAS,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;QAC1C,SAAS,CAAC,SAAS,UAAS;QAE5B;;WAEG;QACI,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;QASnF,+CAA+C;QACxC,OAAO,IAAI,IAAI;QAWtB,IAAW,OAAO,IAAI,OAAO,CAE5B;QAED,OAAO,CAAC,WAAW;QAgBnB,OAAO,CAAC,cAAc;QAoCtB,OAAO,CAAC,QAAQ;KAgBjB;CACF"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { assert, CompressedId64Set, Id64 } from "@itwin/core-bentley";
|
|
6
|
-
import {
|
|
5
|
+
import { assert, CompressedId64Set, Id64, OrderedId64Iterable } from "@itwin/core-bentley";
|
|
6
|
+
import { SubCategoryAppearance } from "@itwin/core-common";
|
|
7
7
|
const invalidCategoryIdEntry = new Set();
|
|
8
8
|
/** A cache of information about the subcategories contained within an [[IModelConnection]]. It is populated on demand.
|
|
9
9
|
* @internal
|
|
@@ -39,29 +39,6 @@ export class SubCategoriesCache {
|
|
|
39
39
|
cancel: () => request.cancel(),
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Populates the notLoadedCategoryIds property of the HydrateViewStateRequestProps.
|
|
44
|
-
* notLoadedCategoryIds is a subset of categoryIds, filtering out any ids which already have an entry in the cache.
|
|
45
|
-
*/
|
|
46
|
-
preload(options, categoryIds) {
|
|
47
|
-
const missing = this.getMissing(categoryIds);
|
|
48
|
-
if (undefined === missing)
|
|
49
|
-
return;
|
|
50
|
-
this._missingAtTimeOfPreload = missing;
|
|
51
|
-
options.notLoadedCategoryIds = CompressedId64Set.sortAndCompress(missing);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Populates the SubCategoriesCache using the categoryIdsResult of the HydrateViewStateResponseProps
|
|
55
|
-
*/
|
|
56
|
-
postload(options) {
|
|
57
|
-
if (options.categoryIdsResult === undefined)
|
|
58
|
-
return;
|
|
59
|
-
// missingAtTimeOfPreload shouldn't be undefined if options.categoryIdsResult is defined... but just to be safe we'll check
|
|
60
|
-
const missing = this._missingAtTimeOfPreload === undefined ? new Set() : this._missingAtTimeOfPreload;
|
|
61
|
-
this.processResults(options.categoryIdsResult, missing);
|
|
62
|
-
// clear missing
|
|
63
|
-
this._missingAtTimeOfPreload = undefined;
|
|
64
|
-
}
|
|
65
42
|
/** Given categoryIds, return which of these are not cached. */
|
|
66
43
|
getMissing(categoryIds) {
|
|
67
44
|
let missing;
|
|
@@ -143,38 +120,38 @@ export class SubCategoriesCache {
|
|
|
143
120
|
(function (SubCategoriesCache) {
|
|
144
121
|
class Request {
|
|
145
122
|
constructor(categoryIds, imodel, maxCategoriesPerQuery = 200) {
|
|
146
|
-
this.
|
|
123
|
+
this._categoryIds = [];
|
|
147
124
|
this._result = [];
|
|
148
125
|
this._canceled = false;
|
|
149
|
-
this.
|
|
126
|
+
this._curCategoryIdsIndex = 0;
|
|
150
127
|
this._imodel = imodel;
|
|
151
128
|
const catIds = [...categoryIds];
|
|
129
|
+
OrderedId64Iterable.sortArray(catIds); // sort categories, so that given the same set of categoryIds we will always create the same batches.
|
|
152
130
|
while (catIds.length !== 0) {
|
|
153
131
|
const end = (catIds.length > maxCategoriesPerQuery) ? maxCategoriesPerQuery : catIds.length;
|
|
154
|
-
const
|
|
155
|
-
this.
|
|
132
|
+
const compressedIds = CompressedId64Set.compressArray(catIds.splice(0, end));
|
|
133
|
+
this._categoryIds.push(compressedIds);
|
|
156
134
|
}
|
|
157
135
|
}
|
|
158
136
|
get wasCanceled() { return this._canceled || this._imodel.isClosed; }
|
|
159
137
|
cancel() { this._canceled = true; }
|
|
160
138
|
async dispatch() {
|
|
161
|
-
if (this.wasCanceled || this.
|
|
139
|
+
if (this.wasCanceled || this._curCategoryIdsIndex >= this._categoryIds.length) // handle case of empty category Id set...
|
|
162
140
|
return undefined;
|
|
163
141
|
try {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
142
|
+
const catIds = this._categoryIds[this._curCategoryIdsIndex];
|
|
143
|
+
const result = await this._imodel.querySubCategories(catIds);
|
|
144
|
+
this._result.push(...result);
|
|
145
|
+
if (this.wasCanceled)
|
|
146
|
+
return undefined;
|
|
170
147
|
}
|
|
171
148
|
catch {
|
|
172
149
|
// ###TODO: detect cases in which retry is warranted
|
|
173
150
|
// Note that currently, if we succeed in obtaining some pages of results and fail to retrieve another page, we will end up processing the
|
|
174
151
|
// incomplete results. Since we're not retrying, that's the best we can do.
|
|
175
152
|
}
|
|
176
|
-
// Finished with current
|
|
177
|
-
if (++this.
|
|
153
|
+
// Finished with current batch of categoryIds. Dispatch the next batch if one exists.
|
|
154
|
+
if (++this._curCategoryIdsIndex < this._categoryIds.length) {
|
|
178
155
|
if (this.wasCanceled)
|
|
179
156
|
return undefined;
|
|
180
157
|
else
|
|
@@ -249,7 +226,7 @@ export class SubCategoriesCache {
|
|
|
249
226
|
this._request.promise.then((completed) => {
|
|
250
227
|
if (this._disposed)
|
|
251
228
|
return;
|
|
252
|
-
// Invoke all the functions which were awaiting this set of
|
|
229
|
+
// Invoke all the functions which were awaiting this set of IModelConnection.Categories.
|
|
253
230
|
assert(undefined !== this._current);
|
|
254
231
|
if (completed)
|
|
255
232
|
for (const func of this._current.funcs)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubCategoriesCache.js","sourceRoot":"","sources":["../../src/SubCategoriesCache.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAgC,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAA+D,cAAc,EAAE,qBAAqB,EAAwB,MAAM,oBAAoB,CAAC;AAkB9J,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAM7B,YAAmB,MAAwB;QAL1B,kBAAa,GAAG,IAAI,GAAG,EAAmB,CAAC;QAC3C,iBAAY,GAAG,IAAI,GAAG,EAAiC,CAAC;QAI1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAAC,CAAC;IAEvE,wIAAwI;IACjI,gBAAgB,CAAC,UAAkB,IAAyB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAE/G,wHAAwH;IACjH,wBAAwB,CAAC,aAAyB,IAAuC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,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AAC;aAC1C;QACH,CAAC;KACF;IAvGY,wBAAK,QAuGjB,CAAA;AACH,CAAC,EAjLgB,kBAAkB,KAAlB,kBAAkB,QAiLlC","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\r\nimport { assert, CompressedId64Set, Id64, Id64Arg, Id64Set, Id64String } from \"@itwin/core-bentley\";\r\nimport { HydrateViewStateRequestProps, HydrateViewStateResponseProps, QueryRowFormat, SubCategoryAppearance, SubCategoryResultRow } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** A cancelable paginated request for subcategory information.\r\n * @see SubCategoriesCache\r\n * @internal\r\n */\r\nexport interface SubCategoriesRequest {\r\n /** The Ids of any categories which were requested but were not yet loaded. */\r\n readonly missingCategoryIds: Id64Set;\r\n /** A promise which resolves to true when all of the requested categories have been loaded, or to false if not all categories were loaded.\r\n * Categories may fail to load if the request is explicitly canceled or if the IModelConnection is closed before all categories are loaded.\r\n */\r\n readonly promise: Promise<boolean>;\r\n /** Cancels the request. */\r\n cancel(): void;\r\n}\r\n\r\nconst invalidCategoryIdEntry = new Set<string>();\r\n\r\n/** A cache of information about the subcategories contained within an [[IModelConnection]]. It is populated on demand.\r\n * @internal\r\n */\r\nexport class SubCategoriesCache {\r\n private readonly _byCategoryId = new Map<string, Id64Set>();\r\n private readonly _appearances = new Map<string, SubCategoryAppearance>();\r\n private readonly _imodel: IModelConnection;\r\n private _missingAtTimeOfPreload: Id64Set | undefined;\r\n\r\n public constructor(imodel: IModelConnection) { this._imodel = imodel; }\r\n\r\n /** Get the Ids of all subcategories belonging to the category with the specified Id, or undefined if no such information is present. */\r\n public getSubCategories(categoryId: string): Id64Set | undefined { return this._byCategoryId.get(categoryId); }\r\n\r\n /** Get the base appearance of the subcategory with the specified Id, or undefined if no such information is present. */\r\n public getSubCategoryAppearance(subCategoryId: Id64String): SubCategoryAppearance | undefined { return this._appearances.get(subCategoryId.toString()); }\r\n\r\n /** Request that the subcategory information for all of the specified categories is loaded.\r\n * If all such information has already been loaded, returns undefined.\r\n * Otherwise, dispatches an asynchronous request to load those categories which are not already loaded and returns a cancellable request object\r\n * containing the corresponding promise and the set of categories still to be loaded.\r\n */\r\n public load(categoryIds: Id64Arg): SubCategoriesRequest | undefined {\r\n const missing = this.getMissing(categoryIds);\r\n if (undefined === missing)\r\n return undefined;\r\n\r\n const request = new SubCategoriesCache.Request(missing, this._imodel);\r\n const promise = request.dispatch().then((result?: SubCategoriesCache.Result) => {\r\n if (undefined !== result)\r\n this.processResults(result, missing);\r\n\r\n return !request.wasCanceled;\r\n });\r\n\r\n return {\r\n missingCategoryIds: missing,\r\n promise,\r\n cancel: () => request.cancel(),\r\n };\r\n }\r\n\r\n /**\r\n * Populates the notLoadedCategoryIds property of the HydrateViewStateRequestProps.\r\n * notLoadedCategoryIds is a subset of categoryIds, filtering out any ids which already have an entry in the cache.\r\n */\r\n public preload(options: HydrateViewStateRequestProps, categoryIds: Id64Arg): void {\r\n const missing = this.getMissing(categoryIds);\r\n\r\n if (undefined === missing)\r\n return;\r\n\r\n this._missingAtTimeOfPreload = missing;\r\n options.notLoadedCategoryIds = CompressedId64Set.sortAndCompress(missing);\r\n }\r\n\r\n /**\r\n * Populates the SubCategoriesCache using the categoryIdsResult of the HydrateViewStateResponseProps\r\n */\r\n public postload(options: HydrateViewStateResponseProps): void {\r\n if (options.categoryIdsResult === undefined)\r\n return;\r\n\r\n // missingAtTimeOfPreload shouldn't be undefined if options.categoryIdsResult is defined... but just to be safe we'll check\r\n const missing = this._missingAtTimeOfPreload === undefined ? new Set<string>() : this._missingAtTimeOfPreload;\r\n this.processResults(options.categoryIdsResult, missing);\r\n\r\n // clear missing\r\n this._missingAtTimeOfPreload = undefined;\r\n }\r\n\r\n /** Given categoryIds, return which of these are not cached. */\r\n private getMissing(categoryIds: Id64Arg): Id64Set | undefined {\r\n let missing: Id64Set | undefined;\r\n for (const catId of Id64.iterable(categoryIds)) {\r\n if (undefined === this._byCategoryId.get(catId)) {\r\n if (undefined === missing)\r\n missing = new Set<string>();\r\n\r\n missing.add(catId);\r\n }\r\n }\r\n\r\n return missing;\r\n }\r\n\r\n public clear(): void {\r\n this._byCategoryId.clear();\r\n this._appearances.clear();\r\n }\r\n\r\n public onIModelConnectionClose(): void {\r\n this.clear();\r\n }\r\n\r\n private static createSubCategoryAppearance(json?: any) {\r\n let props: SubCategoryAppearance.Props | undefined;\r\n if (\"string\" === typeof json && 0 < json.length)\r\n props = JSON.parse(json);\r\n\r\n return new SubCategoryAppearance(props);\r\n }\r\n\r\n private processResults(result: SubCategoriesCache.Result, missing: Id64Set): void {\r\n for (const row of result)\r\n this.add(row.parentId, row.id, SubCategoriesCache.createSubCategoryAppearance(row.appearance));\r\n\r\n // Ensure that any category Ids which returned no results (e.g., non-existent category, invalid Id, etc) are still recorded so they are not repeatedly re-requested\r\n for (const id of missing)\r\n if (undefined === this._byCategoryId.get(id))\r\n this._byCategoryId.set(id, invalidCategoryIdEntry);\r\n }\r\n\r\n private add(categoryId: string, subCategoryId: string, appearance: SubCategoryAppearance) {\r\n let set = this._byCategoryId.get(categoryId);\r\n if (undefined === set)\r\n this._byCategoryId.set(categoryId, set = new Set<string>());\r\n\r\n set.add(subCategoryId);\r\n this._appearances.set(subCategoryId, appearance);\r\n }\r\n\r\n public async getCategoryInfo(inputCategoryIds: Id64String | Iterable<Id64String>): Promise<Map<Id64String, IModelConnection.Categories.CategoryInfo>> {\r\n // Eliminate duplicates...\r\n const categoryIds = new Set<string>(typeof inputCategoryIds === \"string\" ? [inputCategoryIds] : inputCategoryIds);\r\n const req = this.load(categoryIds);\r\n if (req)\r\n await req.promise;\r\n\r\n const map = new Map<Id64String, IModelConnection.Categories.CategoryInfo>();\r\n for (const categoryId of categoryIds) {\r\n const subCategoryIds = this._byCategoryId.get(categoryId);\r\n if (!subCategoryIds)\r\n continue;\r\n\r\n const subCategories = this.mapSubCategoryInfos(categoryId, subCategoryIds);\r\n map.set(categoryId, { id: categoryId, subCategories });\r\n }\r\n\r\n return map;\r\n }\r\n\r\n public async getSubCategoryInfo(categoryId: Id64String, inputSubCategoryIds: Id64String | Iterable<Id64String>): Promise<Map<Id64String, IModelConnection.Categories.SubCategoryInfo>> {\r\n // Eliminate duplicates...\r\n const subCategoryIds = new Set<string>(typeof inputSubCategoryIds === \"string\" ? [inputSubCategoryIds] : inputSubCategoryIds);\r\n const req = this.load(categoryId);\r\n if (req)\r\n await req.promise;\r\n\r\n return this.mapSubCategoryInfos(categoryId, subCategoryIds);\r\n }\r\n\r\n private mapSubCategoryInfos(categoryId: Id64String, subCategoryIds: Set<Id64String>): Map<Id64String, IModelConnection.Categories.SubCategoryInfo> {\r\n const map = new Map<Id64String, IModelConnection.Categories.SubCategoryInfo>();\r\n for (const id of subCategoryIds) {\r\n const appearance = this._appearances.get(id);\r\n assert(undefined !== appearance);\r\n if (appearance)\r\n map.set(id, { id, categoryId, appearance });\r\n }\r\n\r\n return map;\r\n }\r\n}\r\n\r\n/** This namespace and the types within it are exported strictly for use in tests.\r\n * @internal\r\n */\r\nexport namespace SubCategoriesCache { // eslint-disable-line no-redeclare\r\n export type Result = SubCategoryResultRow[];\r\n\r\n export class Request {\r\n private readonly _imodel: IModelConnection;\r\n private readonly _ecsql: string[] = [];\r\n private readonly _result: Result = [];\r\n private _canceled = false;\r\n private _curECSqlIndex = 0;\r\n\r\n public get wasCanceled() { return this._canceled || this._imodel.isClosed; }\r\n\r\n public constructor(categoryIds: Set<string>, imodel: IModelConnection, maxCategoriesPerQuery = 200) {\r\n this._imodel = imodel;\r\n\r\n const catIds = [...categoryIds];\r\n while (catIds.length !== 0) {\r\n const end = (catIds.length > maxCategoriesPerQuery) ? maxCategoriesPerQuery : catIds.length;\r\n const where = catIds.splice(0, end).join(\",\");\r\n this._ecsql.push(`SELECT ECInstanceId as id, Parent.Id as parentId, Properties as appearance FROM BisCore.SubCategory WHERE Parent.Id IN (${where})`);\r\n }\r\n }\r\n\r\n public cancel() { this._canceled = true; }\r\n\r\n public async dispatch(): Promise<Result | undefined> {\r\n if (this.wasCanceled || this._curECSqlIndex >= this._ecsql.length) // handle case of empty category Id set...\r\n return undefined;\r\n\r\n try {\r\n const ecsql = this._ecsql[this._curECSqlIndex];\r\n for await (const row of this._imodel.query(ecsql, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames })) {\r\n this._result.push(row as SubCategoryResultRow);\r\n if (this.wasCanceled)\r\n return undefined;\r\n }\r\n } catch {\r\n // ###TODO: detect cases in which retry is warranted\r\n // Note that currently, if we succeed in obtaining some pages of results and fail to retrieve another page, we will end up processing the\r\n // incomplete results. Since we're not retrying, that's the best we can do.\r\n }\r\n\r\n // Finished with current ECSql query. Dispatch the next if one exists.\r\n if (++this._curECSqlIndex < this._ecsql.length) {\r\n if (this.wasCanceled)\r\n return undefined;\r\n else\r\n return this.dispatch();\r\n }\r\n\r\n // Even if we were canceled, we've retrieved all the rows. Might as well process them to prevent another request for some of the same rows from being enqueued.\r\n return this._result;\r\n }\r\n }\r\n\r\n export type QueueFunc = () => void;\r\n\r\n export class QueueEntry {\r\n public readonly categoryIds: Id64Set;\r\n public readonly funcs: QueueFunc[];\r\n\r\n public constructor(categoryIds: Id64Set, func: QueueFunc) {\r\n this.categoryIds = categoryIds;\r\n this.funcs = [func];\r\n }\r\n }\r\n\r\n /** A \"queue\" of SubCategoriesRequests, which consists of between 0 and 2 entries. Each entry specifies the set of category IDs to be loaded and a list of functions to be executed\r\n * when loading is completed. This is used to enforce ordering of operations upon subcategories despite the need to asynchronously load them. It incidentally also provides an\r\n * opportunity to reduce the number of backend requests by batching consecutive requests.\r\n * Chiefly used by [[Viewport]].\r\n * @internal\r\n */\r\n export class Queue {\r\n /* NB: Members marked protected for use in tests only. */\r\n protected _current?: QueueEntry;\r\n protected _next?: QueueEntry;\r\n protected _request?: SubCategoriesRequest;\r\n protected _disposed = false;\r\n\r\n /** Push a request onto the queue. The requested categories will be loaded if necessary, and then\r\n * the supplied function will be invoked. Any previously-pushed requests are guaranteed to be processed before this one.\r\n */\r\n public push(cache: SubCategoriesCache, categoryIds: Id64Arg, func: QueueFunc): void {\r\n if (this._disposed)\r\n return;\r\n else if (undefined === this._current)\r\n this.pushCurrent(cache, categoryIds, func);\r\n else\r\n this.pushNext(categoryIds, func);\r\n }\r\n\r\n /** Cancel all requests and empty the queue. */\r\n public dispose(): void {\r\n if (undefined !== this._request) {\r\n assert(undefined !== this._current);\r\n this._request.cancel();\r\n this._request = undefined;\r\n }\r\n\r\n this._current = this._next = undefined;\r\n this._disposed = true;\r\n }\r\n\r\n public get isEmpty(): boolean {\r\n return undefined === this._current && undefined === this._next;\r\n }\r\n\r\n private pushCurrent(cache: SubCategoriesCache, categoryIds: Id64Arg, func: QueueFunc): void {\r\n assert(undefined === this._next);\r\n assert(undefined === this._current);\r\n assert(undefined === this._request);\r\n\r\n this._request = cache.load(categoryIds);\r\n if (undefined === this._request) {\r\n // All requested categories are already loaded.\r\n func();\r\n return;\r\n } else {\r\n // We need to load the requested categories before invoking the function.\r\n this.processCurrent(cache, new QueueEntry(Id64.toIdSet(categoryIds, true), func));\r\n }\r\n }\r\n\r\n private processCurrent(cache: SubCategoriesCache, entry: QueueEntry): void {\r\n assert(undefined !== this._request);\r\n assert(undefined === this._current);\r\n assert(undefined === this._next);\r\n\r\n this._current = entry;\r\n this._request.promise.then((completed: boolean) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (this._disposed)\r\n return;\r\n\r\n // Invoke all the functions which were awaiting this set of categories.\r\n assert(undefined !== this._current);\r\n if (completed)\r\n for (const func of this._current.funcs)\r\n func();\r\n\r\n this._request = undefined;\r\n this._current = undefined;\r\n\r\n // If we have more requests, process them.\r\n const next = this._next;\r\n this._next = undefined;\r\n if (undefined !== next) {\r\n this._request = cache.load(next.categoryIds);\r\n if (undefined === this._request) {\r\n // All categories loaded.\r\n for (const func of next.funcs)\r\n func();\r\n } else {\r\n // We need to load the requested categories before invoking the pending functions.\r\n this.processCurrent(cache, next);\r\n }\r\n }\r\n });\r\n }\r\n\r\n private pushNext(categoryIds: Id64Arg, func: QueueFunc): void {\r\n assert(undefined !== this._current);\r\n assert(undefined !== this._request);\r\n\r\n if (undefined === this._next) {\r\n // We have a request currently in process and none pending.\r\n // We could potentially determine that this request doesn't require any categories that are not already loaded or being loaded by the current request.\r\n // But we will find that out (synchronously) when current request completes, unless more requests come in. Probably not worth it.\r\n this._next = new QueueEntry(Id64.toIdSet(categoryIds, true), func);\r\n } else {\r\n // We have a request currently in process, and one or more pending. Append this one to the pending.\r\n this._next.funcs.push(func);\r\n for (const categoryId of Id64.iterable(categoryIds))\r\n this._next.categoryIds.add(categoryId);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SubCategoriesCache.js","sourceRoot":"","sources":["../../src/SubCategoriesCache.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAgC,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,oBAAoB,CAAC;AAkBjF,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAM7B,YAAmB,MAAwB;QAL1B,kBAAa,GAAG,IAAI,GAAG,EAAmB,CAAC;QAC3C,iBAAY,GAAG,IAAI,GAAG,EAAiC,CAAC;QAI1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAAC,CAAC;IAEvE,wIAAwI;IACjI,gBAAgB,CAAC,UAAkB,IAAyB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAE/G,wHAAwH;IACjH,wBAAwB,CAAC,aAAyB,IAAuC,OAAO,IAAI,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AAC,WAAoB,EAAE,IAAe;YACpD,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC;YACpC,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEpC,IAAI,SAAS,KAAK,IAAI,CAAC,KAAK,EAAE;gBAC5B,2DAA2D;gBAC3D,sJAAsJ;gBACtJ,iIAAiI;gBACjI,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;aACpE;iBAAM;gBACL,mGAAmG;gBACnG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;oBACjD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;aAC1C;QACH,CAAC;KACF;IAvGY,wBAAK,QAuGjB,CAAA;AACH,CAAC,EAjLgB,kBAAkB,KAAlB,kBAAkB,QAiLlC","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\r\nimport { assert, CompressedId64Set, Id64, Id64Arg, Id64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { SubCategoryAppearance, SubCategoryResultRow } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** A cancelable paginated request for subcategory information.\r\n * @see SubCategoriesCache\r\n * @internal\r\n */\r\nexport interface SubCategoriesRequest {\r\n /** The Ids of any categories which were requested but were not yet loaded. */\r\n readonly missingCategoryIds: Id64Set;\r\n /** A promise which resolves to true when all of the requested categories have been loaded, or to false if not all categories were loaded.\r\n * Categories may fail to load if the request is explicitly canceled or if the IModelConnection is closed before all categories are loaded.\r\n */\r\n readonly promise: Promise<boolean>;\r\n /** Cancels the request. */\r\n cancel(): void;\r\n}\r\n\r\nconst invalidCategoryIdEntry = new Set<string>();\r\n\r\n/** A cache of information about the subcategories contained within an [[IModelConnection]]. It is populated on demand.\r\n * @internal\r\n */\r\nexport class SubCategoriesCache {\r\n private readonly _byCategoryId = new Map<string, Id64Set>();\r\n private readonly _appearances = new Map<string, SubCategoryAppearance>();\r\n private readonly _imodel: IModelConnection;\r\n private _missingAtTimeOfPreload: Id64Set | undefined;\r\n\r\n public constructor(imodel: IModelConnection) { this._imodel = imodel; }\r\n\r\n /** Get the Ids of all subcategories belonging to the category with the specified Id, or undefined if no such information is present. */\r\n public getSubCategories(categoryId: string): Id64Set | undefined { return this._byCategoryId.get(categoryId); }\r\n\r\n /** Get the base appearance of the subcategory with the specified Id, or undefined if no such information is present. */\r\n public getSubCategoryAppearance(subCategoryId: Id64String): SubCategoryAppearance | undefined { return this._appearances.get(subCategoryId.toString()); }\r\n\r\n /** Request that the subcategory information for all of the specified categories is loaded.\r\n * If all such information has already been loaded, returns undefined.\r\n * Otherwise, dispatches an asynchronous request to load those categories which are not already loaded and returns a cancellable request object\r\n * containing the corresponding promise and the set of categories still to be loaded.\r\n */\r\n public load(categoryIds: Id64Arg): SubCategoriesRequest | undefined {\r\n const missing = this.getMissing(categoryIds);\r\n if (undefined === missing)\r\n return undefined;\r\n\r\n const request = new SubCategoriesCache.Request(missing, this._imodel);\r\n const promise = request.dispatch().then((result?: SubCategoriesCache.Result) => {\r\n if (undefined !== result)\r\n this.processResults(result, missing);\r\n\r\n return !request.wasCanceled;\r\n });\r\n\r\n return {\r\n missingCategoryIds: missing,\r\n promise,\r\n cancel: () => request.cancel(),\r\n };\r\n }\r\n\r\n /** Given categoryIds, return which of these are not cached. */\r\n private getMissing(categoryIds: Id64Arg): Id64Set | undefined {\r\n let missing: Id64Set | undefined;\r\n for (const catId of Id64.iterable(categoryIds)) {\r\n if (undefined === this._byCategoryId.get(catId)) {\r\n if (undefined === missing)\r\n missing = new Set<string>();\r\n\r\n missing.add(catId);\r\n }\r\n }\r\n\r\n return missing;\r\n }\r\n\r\n public clear(): void {\r\n this._byCategoryId.clear();\r\n this._appearances.clear();\r\n }\r\n\r\n public onIModelConnectionClose(): void {\r\n this.clear();\r\n }\r\n\r\n private static createSubCategoryAppearance(json?: any) {\r\n let props: SubCategoryAppearance.Props | undefined;\r\n if (\"string\" === typeof json && 0 < json.length)\r\n props = JSON.parse(json);\r\n\r\n return new SubCategoryAppearance(props);\r\n }\r\n\r\n private processResults(result: SubCategoriesCache.Result, missing: Id64Set): void {\r\n for (const row of result)\r\n this.add(row.parentId, row.id, SubCategoriesCache.createSubCategoryAppearance(row.appearance));\r\n\r\n // Ensure that any category Ids which returned no results (e.g., non-existent category, invalid Id, etc) are still recorded so they are not repeatedly re-requested\r\n for (const id of missing)\r\n if (undefined === this._byCategoryId.get(id))\r\n this._byCategoryId.set(id, invalidCategoryIdEntry);\r\n }\r\n\r\n private add(categoryId: string, subCategoryId: string, appearance: SubCategoryAppearance) {\r\n let set = this._byCategoryId.get(categoryId);\r\n if (undefined === set)\r\n this._byCategoryId.set(categoryId, set = new Set<string>());\r\n\r\n set.add(subCategoryId);\r\n this._appearances.set(subCategoryId, appearance);\r\n }\r\n\r\n public async getCategoryInfo(inputCategoryIds: Id64String | Iterable<Id64String>): Promise<Map<Id64String, IModelConnection.Categories.CategoryInfo>> {\r\n // Eliminate duplicates...\r\n const categoryIds = new Set<string>(typeof inputCategoryIds === \"string\" ? [inputCategoryIds] : inputCategoryIds);\r\n const req = this.load(categoryIds);\r\n if (req)\r\n await req.promise;\r\n\r\n const map = new Map<Id64String, IModelConnection.Categories.CategoryInfo>();\r\n for (const categoryId of categoryIds) {\r\n const subCategoryIds = this._byCategoryId.get(categoryId);\r\n if (!subCategoryIds)\r\n continue;\r\n\r\n const subCategories = this.mapSubCategoryInfos(categoryId, subCategoryIds);\r\n map.set(categoryId, { id: categoryId, subCategories });\r\n }\r\n\r\n return map;\r\n }\r\n\r\n public async getSubCategoryInfo(categoryId: Id64String, inputSubCategoryIds: Id64String | Iterable<Id64String>): Promise<Map<Id64String, IModelConnection.Categories.SubCategoryInfo>> {\r\n // Eliminate duplicates...\r\n const subCategoryIds = new Set<string>(typeof inputSubCategoryIds === \"string\" ? [inputSubCategoryIds] : inputSubCategoryIds);\r\n const req = this.load(categoryId);\r\n if (req)\r\n await req.promise;\r\n\r\n return this.mapSubCategoryInfos(categoryId, subCategoryIds);\r\n }\r\n\r\n private mapSubCategoryInfos(categoryId: Id64String, subCategoryIds: Set<Id64String>): Map<Id64String, IModelConnection.Categories.SubCategoryInfo> {\r\n const map = new Map<Id64String, IModelConnection.Categories.SubCategoryInfo>();\r\n for (const id of subCategoryIds) {\r\n const appearance = this._appearances.get(id);\r\n assert(undefined !== appearance);\r\n if (appearance)\r\n map.set(id, { id, categoryId, appearance });\r\n }\r\n\r\n return map;\r\n }\r\n}\r\n\r\n/** This namespace and the types within it are exported strictly for use in tests.\r\n * @internal\r\n */\r\nexport namespace SubCategoriesCache { // eslint-disable-line no-redeclare\r\n export type Result = SubCategoryResultRow[];\r\n\r\n export class Request {\r\n private readonly _imodel: IModelConnection;\r\n private readonly _categoryIds: CompressedId64Set[] = [];\r\n private readonly _result: Result = [];\r\n private _canceled = false;\r\n private _curCategoryIdsIndex = 0;\r\n\r\n public get wasCanceled() { return this._canceled || this._imodel.isClosed; }\r\n\r\n public constructor(categoryIds: Set<string>, imodel: IModelConnection, maxCategoriesPerQuery = 200) {\r\n this._imodel = imodel;\r\n\r\n const catIds = [...categoryIds];\r\n OrderedId64Iterable.sortArray(catIds); // sort categories, so that given the same set of categoryIds we will always create the same batches.\r\n while (catIds.length !== 0) {\r\n const end = (catIds.length > maxCategoriesPerQuery) ? maxCategoriesPerQuery : catIds.length;\r\n const compressedIds = CompressedId64Set.compressArray(catIds.splice(0, end));\r\n this._categoryIds.push(compressedIds);\r\n }\r\n }\r\n\r\n public cancel() { this._canceled = true; }\r\n\r\n public async dispatch(): Promise<Result | undefined> {\r\n if (this.wasCanceled || this._curCategoryIdsIndex >= this._categoryIds.length) // handle case of empty category Id set...\r\n return undefined;\r\n\r\n try {\r\n const catIds = this._categoryIds[this._curCategoryIdsIndex];\r\n const result = await this._imodel.querySubCategories(catIds);\r\n this._result.push(...result);\r\n if (this.wasCanceled)\r\n return undefined;\r\n } catch {\r\n // ###TODO: detect cases in which retry is warranted\r\n // Note that currently, if we succeed in obtaining some pages of results and fail to retrieve another page, we will end up processing the\r\n // incomplete results. Since we're not retrying, that's the best we can do.\r\n }\r\n\r\n // Finished with current batch of categoryIds. Dispatch the next batch if one exists.\r\n if (++this._curCategoryIdsIndex < this._categoryIds.length) {\r\n if (this.wasCanceled)\r\n return undefined;\r\n else\r\n return this.dispatch();\r\n }\r\n\r\n // Even if we were canceled, we've retrieved all the rows. Might as well process them to prevent another request for some of the same rows from being enqueued.\r\n return this._result;\r\n }\r\n }\r\n\r\n export type QueueFunc = () => void;\r\n\r\n export class QueueEntry {\r\n public readonly categoryIds: Id64Set;\r\n public readonly funcs: QueueFunc[];\r\n\r\n public constructor(categoryIds: Id64Set, func: QueueFunc) {\r\n this.categoryIds = categoryIds;\r\n this.funcs = [func];\r\n }\r\n }\r\n\r\n /** A \"queue\" of SubCategoriesRequests, which consists of between 0 and 2 entries. Each entry specifies the set of category IDs to be loaded and a list of functions to be executed\r\n * when loading is completed. This is used to enforce ordering of operations upon subcategories despite the need to asynchronously load them. It incidentally also provides an\r\n * opportunity to reduce the number of backend requests by batching consecutive requests.\r\n * Chiefly used by [[Viewport]].\r\n * @internal\r\n */\r\n export class Queue {\r\n /* NB: Members marked protected for use in tests only. */\r\n protected _current?: QueueEntry;\r\n protected _next?: QueueEntry;\r\n protected _request?: SubCategoriesRequest;\r\n protected _disposed = false;\r\n\r\n /** Push a request onto the queue. The requested categories will be loaded if necessary, and then\r\n * the supplied function will be invoked. Any previously-pushed requests are guaranteed to be processed before this one.\r\n */\r\n public push(cache: SubCategoriesCache, categoryIds: Id64Arg, func: QueueFunc): void {\r\n if (this._disposed)\r\n return;\r\n else if (undefined === this._current)\r\n this.pushCurrent(cache, categoryIds, func);\r\n else\r\n this.pushNext(categoryIds, func);\r\n }\r\n\r\n /** Cancel all requests and empty the queue. */\r\n public dispose(): void {\r\n if (undefined !== this._request) {\r\n assert(undefined !== this._current);\r\n this._request.cancel();\r\n this._request = undefined;\r\n }\r\n\r\n this._current = this._next = undefined;\r\n this._disposed = true;\r\n }\r\n\r\n public get isEmpty(): boolean {\r\n return undefined === this._current && undefined === this._next;\r\n }\r\n\r\n private pushCurrent(cache: SubCategoriesCache, categoryIds: Id64Arg, func: QueueFunc): void {\r\n assert(undefined === this._next);\r\n assert(undefined === this._current);\r\n assert(undefined === this._request);\r\n\r\n this._request = cache.load(categoryIds);\r\n if (undefined === this._request) {\r\n // All requested categories are already loaded.\r\n func();\r\n return;\r\n } else {\r\n // We need to load the requested categories before invoking the function.\r\n this.processCurrent(cache, new QueueEntry(Id64.toIdSet(categoryIds, true), func));\r\n }\r\n }\r\n\r\n private processCurrent(cache: SubCategoriesCache, entry: QueueEntry): void {\r\n assert(undefined !== this._request);\r\n assert(undefined === this._current);\r\n assert(undefined === this._next);\r\n\r\n this._current = entry;\r\n this._request.promise.then((completed: boolean) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (this._disposed)\r\n return;\r\n\r\n // Invoke all the functions which were awaiting this set of IModelConnection.Categories.\r\n assert(undefined !== this._current);\r\n if (completed)\r\n for (const func of this._current.funcs)\r\n func();\r\n\r\n this._request = undefined;\r\n this._current = undefined;\r\n\r\n // If we have more requests, process them.\r\n const next = this._next;\r\n this._next = undefined;\r\n if (undefined !== next) {\r\n this._request = cache.load(next.categoryIds);\r\n if (undefined === this._request) {\r\n // All categories loaded.\r\n for (const func of next.funcs)\r\n func();\r\n } else {\r\n // We need to load the requested categories before invoking the pending functions.\r\n this.processCurrent(cache, next);\r\n }\r\n }\r\n });\r\n }\r\n\r\n private pushNext(categoryIds: Id64Arg, func: QueueFunc): void {\r\n assert(undefined !== this._current);\r\n assert(undefined !== this._request);\r\n\r\n if (undefined === this._next) {\r\n // We have a request currently in process and none pending.\r\n // We could potentially determine that this request doesn't require any categories that are not already loaded or being loaded by the current request.\r\n // But we will find that out (synchronously) when current request completes, unless more requests come in. Probably not worth it.\r\n this._next = new QueueEntry(Id64.toIdSet(categoryIds, true), func);\r\n } else {\r\n // We have a request currently in process, and one or more pending. Append this one to the pending.\r\n this._next.funcs.push(func);\r\n for (const categoryId of Id64.iterable(categoryIds))\r\n this._next.categoryIds.add(categoryId);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewState.d.ts","sourceRoot":"","sources":["../../src/ViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAiB,OAAO,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,EAAa,UAAU,EAA+C,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EACzF,OAAO,EAAE,OAAO,EAAW,OAAO,EAAS,SAAS,EAAY,QAAQ,EAAE,KAAK,EAC7G,MAAM,EAAE,GAAG,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAC3H,4BAA4B,EAAE,6BAA6B,EACrC,cAAc,EAAE,mBAAmB,EACzD,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EACzH,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAgD,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAClG,OAA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C/B,SAAS;IACT,UAAU;IACV,WAAW;IACX,UAAU,CAAC,KAAK,EAAE,KAAK;IACvB,SAAS,CAAC,MAAM,EAAE,KAAK;IACvB,WAAW,CAAC,GAAG,EAAE,QAAQ;IACzB,UAAU,CAAC,OAAO,EAAE,UAAU;IAC9B,YAAY,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI;IAM9D,gBAAgB;IACA,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAM1E,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB;CAClE"}
|
package/lib/esm/ViewState.js
CHANGED
|
@@ -194,7 +194,6 @@ export class ViewState extends ElementState {
|
|
|
194
194
|
const acsId = this.getAuxiliaryCoordinateSystemId();
|
|
195
195
|
if (Id64.isValid(acsId))
|
|
196
196
|
hydrateRequest.acsId = acsId;
|
|
197
|
-
this.iModel.subcategories.preload(hydrateRequest, this.categorySelector.categories);
|
|
198
197
|
}
|
|
199
198
|
/** Asynchronously load any required data for this ViewState from the backend.
|
|
200
199
|
* FINAL, No subclass should override load. If additional load behavior is needed, see preload and postload.
|
|
@@ -209,15 +208,16 @@ export class ViewState extends ElementState {
|
|
|
209
208
|
const hydrateRequest = {};
|
|
210
209
|
this.preload(hydrateRequest);
|
|
211
210
|
const promises = [
|
|
212
|
-
IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).hydrateViewState(this.iModel.getRpcProps(), hydrateRequest)
|
|
211
|
+
IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).hydrateViewState(this.iModel.getRpcProps(), hydrateRequest).
|
|
212
|
+
then(async (hydrateResponse) => this.postload(hydrateResponse)),
|
|
213
213
|
this.displayStyle.load(),
|
|
214
214
|
];
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
const subcategories = this.iModel.subcategories.load(this.categorySelector.categories);
|
|
216
|
+
if (undefined !== subcategories)
|
|
217
|
+
promises.push(subcategories.promise.then((_) => { }));
|
|
218
|
+
await Promise.all(promises);
|
|
218
219
|
}
|
|
219
220
|
async postload(hydrateResponse) {
|
|
220
|
-
this.iModel.subcategories.postload(hydrateResponse);
|
|
221
221
|
if (hydrateResponse.acsElementProps)
|
|
222
222
|
this._auxCoordSystem = AuxCoordSystemState.fromProps(hydrateResponse.acsElementProps, this.iModel);
|
|
223
223
|
}
|