@itwin/core-frontend 4.0.0-dev.11 → 4.0.0-dev.15

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.
@@ -1,3 +1,6 @@
1
+ /** @packageDocumentation
2
+ * @module IModelApp
3
+ */
1
4
  import { IModelAppOptions } from "./IModelApp";
2
5
  import { AnimationBranchStates } from "./render/GraphicBranch";
3
6
  import { RenderSystem } from "./render/RenderSystem";
@@ -52,12 +55,16 @@ export declare class NullRenderSystem extends RenderSystem {
52
55
  constructor();
53
56
  createRenderGraphic(): undefined;
54
57
  }
55
- /**
56
- * A class for applications that must run in environments where WebGL is not present.
57
- * This is typically used in tests.
58
- * @internal
58
+ /** A utility class intended for applications (primarily test-runners) that run in environments that lack support for WebGL.
59
+ * It installs a [[RenderSystem]] that produces no graphics.
60
+ * Use [[NoRenderApp.startup]] instead of [[IModelApp.startup]] to initialize your application frontend.
61
+ * You may then use the [[IModelApp]] API as normal.
62
+ * @public
59
63
  */
60
64
  export declare class NoRenderApp {
65
+ /** Initializes [[IModelApp]] with a [[RenderSystem]] that produces no graphics.
66
+ * Use this in place of [[IModelApp.startup]], then proceed to use [[IModelApp]]'s API as normal.
67
+ */
61
68
  static startup(opts?: IModelAppOptions): Promise<void>;
62
69
  }
63
70
  //# sourceMappingURL=NoRenderApp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NoRenderApp.d.ts","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,UAAW,SAAQ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H,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,IAAW,OAAO,IAAI,OAAO,CAAkB;IACxC,UAAU,IAAI,OAAO;IACrB,YAAY;IACZ,qBAAqB;IACrB,aAAa;IACb,iBAAiB;IACjB,mBAAmB;IACnB,WAAW;IACX,OAAO;;IAEE,mBAAmB;CACpC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB;;OAEG;WACiB,OAAO,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOpE"}
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NoRenderApp = exports.NullRenderSystem = exports.NullTarget = void 0;
4
2
  /*---------------------------------------------------------------------------------------------
5
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
7
5
  *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module IModelApp
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.NoRenderApp = exports.NullRenderSystem = exports.NullTarget = void 0;
8
11
  const core_common_1 = require("@itwin/core-common");
9
12
  const IModelApp_1 = require("./IModelApp");
10
13
  const RenderSystem_1 = require("./render/RenderSystem");
@@ -61,12 +64,16 @@ class NullRenderSystem extends RenderSystem_1.RenderSystem {
61
64
  createRenderGraphic() { return undefined; }
62
65
  }
63
66
  exports.NullRenderSystem = NullRenderSystem;
64
- /**
65
- * A class for applications that must run in environments where WebGL is not present.
66
- * This is typically used in tests.
67
- * @internal
67
+ /** A utility class intended for applications (primarily test-runners) that run in environments that lack support for WebGL.
68
+ * It installs a [[RenderSystem]] that produces no graphics.
69
+ * Use [[NoRenderApp.startup]] instead of [[IModelApp.startup]] to initialize your application frontend.
70
+ * You may then use the [[IModelApp]] API as normal.
71
+ * @public
68
72
  */
69
73
  class NoRenderApp {
74
+ /** Initializes [[IModelApp]] with a [[RenderSystem]] that produces no graphics.
75
+ * Use this in place of [[IModelApp.startup]], then proceed to use [[IModelApp]]'s API as normal.
76
+ */
70
77
  static async startup(opts) {
71
78
  var _a;
72
79
  opts = opts ? opts : {};
@@ -1 +1 @@
1
- {"version":3,"file":"NoRenderApp.js","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,oDAAuD;AACvD,2CAA0D;AAE1D,wDAAqD;AACrD,wDAAqD;AACrD,yCAAsC;AAEtC;;;;GAIG;AACH,MAAa,UAAW,SAAQ,2BAAY;IAC1C,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,IAAW,gBAAgB,CAAC,SAAiB,IAAI,CAAC;IAClD,IAAW,YAAY,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IACtD,IAAW,QAAQ,KAAe,OAAO,IAAI,mBAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,IAAW,yBAAyB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACjE,IAAoB,iBAAiB,KAAwC,OAAO,SAAS,CAAC,CAAC,CAAC;IAChG,IAAoB,iBAAiB,CAAC,SAA4C,IAAI,CAAC;IAChF,SAAS,KAAW,CAAC;IACZ,KAAK,KAAW,CAAC;IAC1B,WAAW,KAAW,CAAC;IACvB,cAAc,KAAW,CAAC;IAC1B,iBAAiB,KAAW,CAAC;IAC7B,gBAAgB,KAAW,CAAC;IAC5B,SAAS,CAAC,mBAA4B,IAAU,CAAC;IACxC,wBAAwB,KAAW,CAAC;IACpC,YAAY,KAAW,CAAC;IACxB,UAAU,KAAW,CAAC;IAC/B,WAAW,KAAW,CAAC;IACd,SAAS,KAAW,CAAC;IACrB,OAAO,KAAW,CAAC;IAC5B,cAAc,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAC3C,UAAU,KAAW,CAAC;IAC7B,IAAW,kBAAkB,KAAuB,OAAO,EAAE,CAAC,CAAC,CAAC;IAChE,IAAW,kBAAkB,CAAC,QAA0B,IAAI,CAAC;CAC9D;AAzBD,gCAyBC;AAED;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,2BAAY;IAChD,IAAW,OAAO,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACxC,UAAU,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACvC,YAAY,KAAK,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3C,qBAAqB,KAAK,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC;IACpD,aAAa,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAC5C,iBAAiB,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAChD,mBAAmB,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAClD,WAAW,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC;IACpB,gBAAuB,KAAK,EAAE,CAAC,CAAC,CAAC;IACjB,mBAAmB,KAAK,OAAO,SAAS,CAAC,CAAC,CAAC;CAC5D;AAZD,4CAYC;AAED;;;;GAIG;AACH,MAAa,WAAW;IACf,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAuB;;QACjD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,YAAY,mCAAI,IAAI,+BAAiB,EAAE,CAAC;QACjE,MAAM,qBAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AARD,kCAQC","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\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\nimport { AnimationBranchStates } from \"./render/GraphicBranch\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/**\r\n * A RenderTarget for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullTarget extends RenderTarget {\r\n public get analysisFraction(): number { return 0; }\r\n public set analysisFraction(_fraction: number) { }\r\n public get renderSystem() { return undefined as any; }\r\n public get viewRect(): ViewRect { return new ViewRect(); }\r\n public get wantInvertBlackBackground(): boolean { return false; }\r\n public override get animationBranches(): AnimationBranchStates | undefined { return undefined; }\r\n public override set animationBranches(_branches: AnimationBranchStates | undefined) { }\r\n public onDestroy(): void { }\r\n public override reset(): void { }\r\n public changeScene(): void { }\r\n public changeDynamics(): void { }\r\n public changeDecorations(): void { }\r\n public changeRenderPlan(): void { }\r\n public drawFrame(_sceneMilSecElapsed?: number): void { }\r\n public override overrideFeatureSymbology(): void { }\r\n public override setHiliteSet(): void { }\r\n public override setFlashed(): void { }\r\n public setViewRect(): void { }\r\n public override onResized(): void { }\r\n public override dispose(): void { }\r\n public updateViewRect(): boolean { return false; }\r\n public readPixels(): void { }\r\n public get screenSpaceEffects(): Iterable<string> { return []; }\r\n public set screenSpaceEffects(_effects: Iterable<string>) { }\r\n}\r\n\r\n/**\r\n * A RenderSystem for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullRenderSystem extends RenderSystem {\r\n public get isValid(): boolean { return false; }\r\n public doIdleWork(): boolean { return false; }\r\n public createTarget() { return new NullTarget(); }\r\n public createOffscreenTarget() { return new NullTarget(); }\r\n public createGraphic() { return undefined as any; }\r\n public createGraphicList() { return undefined as any; }\r\n public createGraphicBranch() { return undefined as any; }\r\n public createBatch() { return undefined as any; }\r\n public dispose() { }\r\n public constructor() { super(); }\r\n public override createRenderGraphic() { return undefined; }\r\n}\r\n\r\n/**\r\n * A class for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NoRenderApp {\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n opts = opts ? opts : {};\r\n opts.renderSys = new NullRenderSystem();\r\n opts.noRender = true;\r\n opts.localization = opts.localization ?? new EmptyLocalization();\r\n await IModelApp.startup(opts);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NoRenderApp.js","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAuD;AACvD,2CAA0D;AAE1D,wDAAqD;AACrD,wDAAqD;AACrD,yCAAsC;AAEtC;;;;GAIG;AACH,MAAa,UAAW,SAAQ,2BAAY;IAC1C,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,IAAW,gBAAgB,CAAC,SAAiB,IAAI,CAAC;IAClD,IAAW,YAAY,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IACtD,IAAW,QAAQ,KAAe,OAAO,IAAI,mBAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,IAAW,yBAAyB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACjE,IAAoB,iBAAiB,KAAwC,OAAO,SAAS,CAAC,CAAC,CAAC;IAChG,IAAoB,iBAAiB,CAAC,SAA4C,IAAI,CAAC;IAChF,SAAS,KAAW,CAAC;IACZ,KAAK,KAAW,CAAC;IAC1B,WAAW,KAAW,CAAC;IACvB,cAAc,KAAW,CAAC;IAC1B,iBAAiB,KAAW,CAAC;IAC7B,gBAAgB,KAAW,CAAC;IAC5B,SAAS,CAAC,mBAA4B,IAAU,CAAC;IACxC,wBAAwB,KAAW,CAAC;IACpC,YAAY,KAAW,CAAC;IACxB,UAAU,KAAW,CAA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AI,+BAAiB,EAAE,CAAC;QACjE,MAAM,qBAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAXD,kCAWC","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 IModelApp\r\n */\r\n\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\nimport { AnimationBranchStates } from \"./render/GraphicBranch\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/**\r\n * A RenderTarget for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullTarget extends RenderTarget {\r\n public get analysisFraction(): number { return 0; }\r\n public set analysisFraction(_fraction: number) { }\r\n public get renderSystem() { return undefined as any; }\r\n public get viewRect(): ViewRect { return new ViewRect(); }\r\n public get wantInvertBlackBackground(): boolean { return false; }\r\n public override get animationBranches(): AnimationBranchStates | undefined { return undefined; }\r\n public override set animationBranches(_branches: AnimationBranchStates | undefined) { }\r\n public onDestroy(): void { }\r\n public override reset(): void { }\r\n public changeScene(): void { }\r\n public changeDynamics(): void { }\r\n public changeDecorations(): void { }\r\n public changeRenderPlan(): void { }\r\n public drawFrame(_sceneMilSecElapsed?: number): void { }\r\n public override overrideFeatureSymbology(): void { }\r\n public override setHiliteSet(): void { }\r\n public override setFlashed(): void { }\r\n public setViewRect(): void { }\r\n public override onResized(): void { }\r\n public override dispose(): void { }\r\n public updateViewRect(): boolean { return false; }\r\n public readPixels(): void { }\r\n public get screenSpaceEffects(): Iterable<string> { return []; }\r\n public set screenSpaceEffects(_effects: Iterable<string>) { }\r\n}\r\n\r\n/**\r\n * A RenderSystem for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullRenderSystem extends RenderSystem {\r\n public get isValid(): boolean { return false; }\r\n public doIdleWork(): boolean { return false; }\r\n public createTarget() { return new NullTarget(); }\r\n public createOffscreenTarget() { return new NullTarget(); }\r\n public createGraphic() { return undefined as any; }\r\n public createGraphicList() { return undefined as any; }\r\n public createGraphicBranch() { return undefined as any; }\r\n public createBatch() { return undefined as any; }\r\n public dispose() { }\r\n public constructor() { super(); }\r\n public override createRenderGraphic() { return undefined; }\r\n}\r\n\r\n/** A utility class intended for applications (primarily test-runners) that run in environments that lack support for WebGL.\r\n * It installs a [[RenderSystem]] that produces no graphics.\r\n * Use [[NoRenderApp.startup]] instead of [[IModelApp.startup]] to initialize your application frontend.\r\n * You may then use the [[IModelApp]] API as normal.\r\n * @public\r\n */\r\nexport class NoRenderApp {\r\n /** Initializes [[IModelApp]] with a [[RenderSystem]] that produces no graphics.\r\n * Use this in place of [[IModelApp.startup]], then proceed to use [[IModelApp]]'s API as normal.\r\n */\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n opts = opts ? opts : {};\r\n opts.renderSys = new NullRenderSystem();\r\n opts.noRender = true;\r\n opts.localization = opts.localization ?? new EmptyLocalization();\r\n await IModelApp.startup(opts);\r\n }\r\n}\r\n"]}
@@ -122,7 +122,6 @@ export declare class HiliteSet {
122
122
  /** Construct a HiliteSet
123
123
  * @param iModel The iModel containing the entities to be hilited.
124
124
  * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].
125
- * @internal
126
125
  */
127
126
  constructor(iModel: IModelConnection, syncWithSelectionSet?: boolean);
128
127
  /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionSet.d.ts","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,OAAO,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AG,IAAI;CAarD;AAED;;;;;GAKG;AACH,qBAAa,YAAY;IAWG,MAAM,EAAE,gBAAgB;IAVlD,OAAO,CAAC,SAAS,CAAqB;IAEtC;;OAEG;IACH,IAAW,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,CAA2B;IAE7D,2EAA2E;IAC3E,SAAgB,SAAS,eAAoB,iBAAiB,KAAK,IAAI,EAAI;gBAEjD,MAAM,EAAE,gBAAgB;IAElD,OAAO,CAAC,gBAAgB;IAKxB,uDAAuD;IACvD,IAAW,IAAI,WAAiC;IAEhD,qDAAqD;IACrD,IAAW,QAAQ,YAA8B;IAEjD;;OAEG;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM;IAE1B;;OAEG;IACI,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO;IAE/C;;OAEG;IACI,QAAQ,IAAI,IAAI;IASvB;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAIlC,OAAO,CAAC,IAAI;IAYZ;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAIrC,OAAO,CAAC,OAAO;IAYf;;;OAGG;IACI,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO;IAc7D,2DAA2D;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAarC,0DAA0D;IACnD,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAiBpC"}
@@ -119,7 +119,6 @@ class HiliteSet {
119
119
  /** Construct a HiliteSet
120
120
  * @param iModel The iModel containing the entities to be hilited.
121
121
  * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].
122
- * @internal
123
122
  */
124
123
  constructor(iModel, syncWithSelectionSet = true) {
125
124
  this.iModel = iModel;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../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,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEvB,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,MAAM,EAAE,IAAI,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACpC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACtB;SACF;QAED,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;CACF;AA1ID,oCA0IC;AAED,SAAS,QAAQ,CAAC,GAAgB,EAAE,GAAY;IAC9C,wDAAwD;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACpB,GAAG,GAAG,mBAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1B,IAAI,GAAG,CAAC,IAAI,KAAK,mBAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/B,OAAO,KAAK,CAAC;IAEf,KAAK,MAAM,EAAE,IAAI,mBAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,KAAK,CAAC;IAEjB,OAAO,IAAI,CAAC;AACd,CAAC","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 SelectionSet\r\n */\r\nimport { BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SelectionSetEventType {\r\n /** Elements have been added to the set. */\r\n Add,\r\n /** Elements have been removed from the set. */\r\n Remove,\r\n /** Some elements have been added to the set and others have been removed. */\r\n Replace,\r\n /** All elements are about to be removed from the set. */\r\n Clear,\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are added to the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectAddEvent {\r\n type: SelectionSetEventType.Add;\r\n /** The Ids of the elements added to the set. */\r\n added: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectRemoveEvent {\r\n /** The type of operation that produced this event. */\r\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are simultaneously added to and removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectReplaceEvent {\r\n type: SelectionSetEventType.Replace;\r\n /** The element Ids added to the set. */\r\n added: Id64Arg;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\r\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\r\n * ```ts\r\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\r\n * console.log(\"Added \" + ev.added.size + \" elements\");\r\n *\r\n * if (SelectionSetEventType.Add !== ev.type)\r\n * console.log(\"Removed \" + ev.removed.size + \" elements\");\r\n * }\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\r\n\r\n/** Tracks a set of hilited entities. When the set changes, notifies ViewManager so that symbology overrides can be updated in active Viewports.\r\n * @internal\r\n */\r\nclass HilitedIds extends Id64.Uint32Set {\r\n protected _iModel: IModelConnection;\r\n protected _changing = false;\r\n\r\n public constructor(iModel: IModelConnection) {\r\n super();\r\n this._iModel = iModel;\r\n }\r\n\r\n public override add(low: number, high: number) {\r\n super.add(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override delete(low: number, high: number) {\r\n super.delete(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override clear() {\r\n super.clear();\r\n this.onChanged();\r\n }\r\n\r\n public override addIds(ids: Id64Arg) {\r\n this.change(() => super.addIds(ids));\r\n }\r\n\r\n public override deleteIds(ids: Id64Arg) {\r\n this.change(() => super.deleteIds(ids));\r\n }\r\n\r\n protected onChanged() {\r\n if (!this._changing)\r\n IModelApp.viewManager.onSelectionSetChanged(this._iModel);\r\n }\r\n\r\n protected change(func: () => void) {\r\n const changing = this._changing;\r\n this._changing = false;\r\n func();\r\n this._changing = changing;\r\n this.onChanged();\r\n }\r\n}\r\n\r\n/** Keeps the set of hilited elements in sync with the selection set.\r\n * @internal\r\n */\r\nclass HilitedElementIds extends HilitedIds {\r\n private _removeListener?: () => void;\r\n\r\n public constructor(iModel: IModelConnection, syncWithSelectionSet = true) {\r\n super(iModel);\r\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\r\n }\r\n\r\n public get wantSyncWithSelectionSet(): boolean { return undefined !== this._removeListener; }\r\n public set wantSyncWithSelectionSet(want: boolean) {\r\n if (want === this.wantSyncWithSelectionSet)\r\n return;\r\n\r\n if (want) {\r\n const set = this._iModel.selectionSet;\r\n this._removeListener = set.onChanged.addListener((ev) => this.change(() => this.processSelectionSetEvent(ev)));\r\n this.processSelectionSetEvent({\r\n set,\r\n type: SelectionSetEventType.Add,\r\n added: set.elements,\r\n });\r\n } else {\r\n this._removeListener!();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n private processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n if (SelectionSetEventType.Add !== ev.type)\r\n this.deleteIds(ev.removed);\r\n\r\n if (ev.type === SelectionSetEventType.Add || ev.type === SelectionSetEventType.Replace)\r\n this.addIds(ev.added);\r\n }\r\n}\r\n\r\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\r\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\r\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\r\n *\r\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\r\n * @public\r\n */\r\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\r\n\r\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\r\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\r\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\r\n *\r\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\r\n * features belonging to different subcategories.\r\n *\r\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\r\n *\r\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\r\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\r\n * are also responsible for removing them as appropriate.\r\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class HiliteSet {\r\n private readonly _elements: HilitedElementIds;\r\n private _mode: ModelSubCategoryHiliteMode = \"union\";\r\n\r\n /** The set of hilited subcategories.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\r\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\r\n */\r\n public readonly subcategories: Id64.Uint32Set;\r\n\r\n /** The set of hilited [[GeometricModelState]]s.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\r\n */\r\n public readonly models: Id64.Uint32Set;\r\n\r\n /** The set of hilited elements. */\r\n public get elements(): Id64.Uint32Set { return this._elements; }\r\n\r\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\r\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\r\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\r\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\r\n * [[elements]] is always hilited regardless of its model or subcategories.\r\n */\r\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\r\n return this._mode;\r\n }\r\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\r\n if (mode === this._mode)\r\n return;\r\n\r\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\r\n this._mode = mode;\r\n }\r\n\r\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\r\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\r\n\r\n /** Construct a HiliteSet\r\n * @param iModel The iModel containing the entities to be hilited.\r\n * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].\r\n * @internal\r\n */\r\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\r\n this._elements = new HilitedElementIds(iModel, syncWithSelectionSet);\r\n this.subcategories = new HilitedIds(iModel);\r\n this.models = new HilitedIds(iModel);\r\n }\r\n\r\n /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].\r\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\r\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\r\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\r\n */\r\n public get wantSyncWithSelectionSet(): boolean { return this._elements.wantSyncWithSelectionSet; }\r\n public set wantSyncWithSelectionSet(want: boolean) { this._elements.wantSyncWithSelectionSet = want; }\r\n\r\n /** Remove all elements from the hilited set. */\r\n public clear() {\r\n this.elements.clear();\r\n this.subcategories.clear();\r\n this.models.clear();\r\n }\r\n\r\n /** Returns true if nothing is hilited. */\r\n public get isEmpty(): boolean { return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty; }\r\n\r\n /** Toggle the hilited state of one or more elements.\r\n * @param arg the ID(s) of the elements whose state is to be toggled.\r\n * @param onOff True to add the elements to the hilited set, false to remove them.\r\n */\r\n public setHilite(arg: Id64Arg, onOff: boolean): void {\r\n const oldSize = this.elements.size;\r\n\r\n for (const id of Id64.iterable(arg)) {\r\n if (onOff)\r\n this.elements.addId(id);\r\n else\r\n this.elements.deleteId(id);\r\n }\r\n\r\n if (oldSize !== this.elements.size)\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n }\r\n}\r\n\r\n/** A set of *currently selected* elements for an IModelConnection.\r\n * Selected elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class SelectionSet {\r\n private _elements = new Set<string>();\r\n\r\n /** The IDs of the selected elements.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get elements(): Set<string> { return this._elements; }\r\n\r\n /** Called whenever elements are added or removed from this SelectionSet */\r\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\r\n\r\n public constructor(public iModel: IModelConnection) { }\r\n\r\n private sendChangedEvent(ev: SelectionSetEvent) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n this.onChanged.raiseEvent(ev);\r\n }\r\n\r\n /** Get the number of entries in this selection set. */\r\n public get size() { return this.elements.size; }\r\n\r\n /** Check whether there are any selected elements. */\r\n public get isActive() { return this.size !== 0; }\r\n\r\n /** Return true if elemId is in this SelectionSet.\r\n * @see [[isSelected]]\r\n */\r\n public has(elemId?: string) { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Query whether an Id is in the selection set.\r\n * @see [[has]]\r\n */\r\n public isSelected(elemId?: Id64String): boolean { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Clear current selection set.\r\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\r\n */\r\n public emptyAll(): void {\r\n if (!this.isActive)\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this.sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removed });\r\n }\r\n\r\n /**\r\n * Add one or more Ids to the current selection set.\r\n * @param elem The set of Ids to add.\r\n * @returns true if any elements were added.\r\n */\r\n public add(elem: Id64Arg): boolean {\r\n return this._add(elem);\r\n }\r\n\r\n private _add(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.add(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Remove one or more Ids from the current selection set.\r\n * @param elem The set of Ids to remove.\r\n * @returns true if any elements were removed.\r\n */\r\n public remove(elem: Id64Arg): boolean {\r\n return this._remove(elem);\r\n }\r\n\r\n private _remove(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.delete(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\r\n * @returns True if any Ids were either added or removed.\r\n */\r\n public addAndRemove(adds: Id64Arg, removes: Id64Arg): boolean {\r\n const added = this._add(adds, false);\r\n const removed = this._remove(removes, false);\r\n\r\n if (added && removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: adds, removed: removes });\r\n else if (added)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: adds });\r\n else if (removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: removes });\r\n\r\n return (added || removed);\r\n }\r\n\r\n /** Invert the state of a set of Ids in the SelectionSet */\r\n public invert(elem: Id64Arg): boolean {\r\n const elementsToAdd = new Set<string>();\r\n const elementsToRemove = new Set<string>();\r\n for (const id of Id64.iterable(elem)) {\r\n if (this.elements.has(id))\r\n elementsToRemove.add(id);\r\n else\r\n elementsToAdd.add(id);\r\n }\r\n\r\n return this.addAndRemove(elementsToAdd, elementsToRemove);\r\n }\r\n\r\n /** Change selection set to be the supplied set of Ids. */\r\n public replace(elem: Id64Arg): void {\r\n if (areEqual(this.elements, elem))\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this._add(elem, false);\r\n\r\n if (0 < removed.size) {\r\n for (const id of Id64.iterable(elem)) {\r\n if (removed.has(id))\r\n removed.delete(id);\r\n }\r\n }\r\n\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: elem, removed });\r\n }\r\n}\r\n\r\nfunction areEqual(lhs: Set<string>, rhs: Id64Arg): boolean {\r\n // Size is unreliable if input can contain duplicates...\r\n if (Array.isArray(rhs))\r\n rhs = Id64.toIdSet(rhs);\r\n\r\n if (lhs.size !== Id64.sizeOf(rhs))\r\n return false;\r\n\r\n for (const id of Id64.iterable(rhs))\r\n if (!lhs.has(id))\r\n return false;\r\n\r\n return true;\r\n}\r\n"]}
1
+ {"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAyE;AACzE,2CAAwC;AAGxC;;;GAGG;AACH,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,2CAA2C;IAC3C,+DAAG,CAAA;IACH,+CAA+C;IAC/C,qEAAM,CAAA;IACN,6EAA6E;IAC7E,uEAAO,CAAA;IACP,yDAAyD;IACzD,mEAAK,CAAA;AACP,CAAC,EATW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAShC;AAyDD;;GAEG;AACH,MAAM,UAAW,SAAQ,mBAAI,CAAC,SAAS;IAIrC,YAAmB,MAAwB;QACzC,KAAK,EAAE,CAAC;QAHA,cAAS,GAAG,KAAK,CAAC;QAI1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEe,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAW,EAAE,IAAY;QAC9C,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,KAAK;QACnB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAY;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,CAAC;IAEe,SAAS,CAAC,GAAY;QACpC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC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;QAET,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEvB,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,MAAM,EAAE,IAAI,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACpC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACtB;SACF;QAED,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;CACF;AA1ID,oCA0IC;AAED,SAAS,QAAQ,CAAC,GAAgB,EAAE,GAAY;IAC9C,wDAAwD;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACpB,GAAG,GAAG,mBAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1B,IAAI,GAAG,CAAC,IAAI,KAAK,mBAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/B,OAAO,KAAK,CAAC;IAEf,KAAK,MAAM,EAAE,IAAI,mBAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,KAAK,CAAC;IAEjB,OAAO,IAAI,CAAC;AACd,CAAC","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 SelectionSet\r\n */\r\nimport { BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SelectionSetEventType {\r\n /** Elements have been added to the set. */\r\n Add,\r\n /** Elements have been removed from the set. */\r\n Remove,\r\n /** Some elements have been added to the set and others have been removed. */\r\n Replace,\r\n /** All elements are about to be removed from the set. */\r\n Clear,\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are added to the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectAddEvent {\r\n type: SelectionSetEventType.Add;\r\n /** The Ids of the elements added to the set. */\r\n added: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectRemoveEvent {\r\n /** The type of operation that produced this event. */\r\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are simultaneously added to and removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectReplaceEvent {\r\n type: SelectionSetEventType.Replace;\r\n /** The element Ids added to the set. */\r\n added: Id64Arg;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\r\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\r\n * ```ts\r\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\r\n * console.log(\"Added \" + ev.added.size + \" elements\");\r\n *\r\n * if (SelectionSetEventType.Add !== ev.type)\r\n * console.log(\"Removed \" + ev.removed.size + \" elements\");\r\n * }\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\r\n\r\n/** Tracks a set of hilited entities. When the set changes, notifies ViewManager so that symbology overrides can be updated in active Viewports.\r\n * @internal\r\n */\r\nclass HilitedIds extends Id64.Uint32Set {\r\n protected _iModel: IModelConnection;\r\n protected _changing = false;\r\n\r\n public constructor(iModel: IModelConnection) {\r\n super();\r\n this._iModel = iModel;\r\n }\r\n\r\n public override add(low: number, high: number) {\r\n super.add(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override delete(low: number, high: number) {\r\n super.delete(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override clear() {\r\n super.clear();\r\n this.onChanged();\r\n }\r\n\r\n public override addIds(ids: Id64Arg) {\r\n this.change(() => super.addIds(ids));\r\n }\r\n\r\n public override deleteIds(ids: Id64Arg) {\r\n this.change(() => super.deleteIds(ids));\r\n }\r\n\r\n protected onChanged() {\r\n if (!this._changing)\r\n IModelApp.viewManager.onSelectionSetChanged(this._iModel);\r\n }\r\n\r\n protected change(func: () => void) {\r\n const changing = this._changing;\r\n this._changing = false;\r\n func();\r\n this._changing = changing;\r\n this.onChanged();\r\n }\r\n}\r\n\r\n/** Keeps the set of hilited elements in sync with the selection set.\r\n * @internal\r\n */\r\nclass HilitedElementIds extends HilitedIds {\r\n private _removeListener?: () => void;\r\n\r\n public constructor(iModel: IModelConnection, syncWithSelectionSet = true) {\r\n super(iModel);\r\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\r\n }\r\n\r\n public get wantSyncWithSelectionSet(): boolean { return undefined !== this._removeListener; }\r\n public set wantSyncWithSelectionSet(want: boolean) {\r\n if (want === this.wantSyncWithSelectionSet)\r\n return;\r\n\r\n if (want) {\r\n const set = this._iModel.selectionSet;\r\n this._removeListener = set.onChanged.addListener((ev) => this.change(() => this.processSelectionSetEvent(ev)));\r\n this.processSelectionSetEvent({\r\n set,\r\n type: SelectionSetEventType.Add,\r\n added: set.elements,\r\n });\r\n } else {\r\n this._removeListener!();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n private processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n if (SelectionSetEventType.Add !== ev.type)\r\n this.deleteIds(ev.removed);\r\n\r\n if (ev.type === SelectionSetEventType.Add || ev.type === SelectionSetEventType.Replace)\r\n this.addIds(ev.added);\r\n }\r\n}\r\n\r\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\r\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\r\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\r\n *\r\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\r\n * @public\r\n */\r\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\r\n\r\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\r\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\r\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\r\n *\r\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\r\n * features belonging to different subcategories.\r\n *\r\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\r\n *\r\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\r\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\r\n * are also responsible for removing them as appropriate.\r\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class HiliteSet {\r\n private readonly _elements: HilitedElementIds;\r\n private _mode: ModelSubCategoryHiliteMode = \"union\";\r\n\r\n /** The set of hilited subcategories.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\r\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\r\n */\r\n public readonly subcategories: Id64.Uint32Set;\r\n\r\n /** The set of hilited [[GeometricModelState]]s.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\r\n */\r\n public readonly models: Id64.Uint32Set;\r\n\r\n /** The set of hilited elements. */\r\n public get elements(): Id64.Uint32Set { return this._elements; }\r\n\r\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\r\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\r\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\r\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\r\n * [[elements]] is always hilited regardless of its model or subcategories.\r\n */\r\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\r\n return this._mode;\r\n }\r\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\r\n if (mode === this._mode)\r\n return;\r\n\r\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\r\n this._mode = mode;\r\n }\r\n\r\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\r\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\r\n\r\n /** Construct a HiliteSet\r\n * @param iModel The iModel containing the entities to be hilited.\r\n * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].\r\n */\r\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\r\n this._elements = new HilitedElementIds(iModel, syncWithSelectionSet);\r\n this.subcategories = new HilitedIds(iModel);\r\n this.models = new HilitedIds(iModel);\r\n }\r\n\r\n /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].\r\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\r\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\r\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\r\n */\r\n public get wantSyncWithSelectionSet(): boolean { return this._elements.wantSyncWithSelectionSet; }\r\n public set wantSyncWithSelectionSet(want: boolean) { this._elements.wantSyncWithSelectionSet = want; }\r\n\r\n /** Remove all elements from the hilited set. */\r\n public clear() {\r\n this.elements.clear();\r\n this.subcategories.clear();\r\n this.models.clear();\r\n }\r\n\r\n /** Returns true if nothing is hilited. */\r\n public get isEmpty(): boolean { return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty; }\r\n\r\n /** Toggle the hilited state of one or more elements.\r\n * @param arg the ID(s) of the elements whose state is to be toggled.\r\n * @param onOff True to add the elements to the hilited set, false to remove them.\r\n */\r\n public setHilite(arg: Id64Arg, onOff: boolean): void {\r\n const oldSize = this.elements.size;\r\n\r\n for (const id of Id64.iterable(arg)) {\r\n if (onOff)\r\n this.elements.addId(id);\r\n else\r\n this.elements.deleteId(id);\r\n }\r\n\r\n if (oldSize !== this.elements.size)\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n }\r\n}\r\n\r\n/** A set of *currently selected* elements for an IModelConnection.\r\n * Selected elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class SelectionSet {\r\n private _elements = new Set<string>();\r\n\r\n /** The IDs of the selected elements.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get elements(): Set<string> { return this._elements; }\r\n\r\n /** Called whenever elements are added or removed from this SelectionSet */\r\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\r\n\r\n public constructor(public iModel: IModelConnection) { }\r\n\r\n private sendChangedEvent(ev: SelectionSetEvent) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n this.onChanged.raiseEvent(ev);\r\n }\r\n\r\n /** Get the number of entries in this selection set. */\r\n public get size() { return this.elements.size; }\r\n\r\n /** Check whether there are any selected elements. */\r\n public get isActive() { return this.size !== 0; }\r\n\r\n /** Return true if elemId is in this SelectionSet.\r\n * @see [[isSelected]]\r\n */\r\n public has(elemId?: string) { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Query whether an Id is in the selection set.\r\n * @see [[has]]\r\n */\r\n public isSelected(elemId?: Id64String): boolean { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Clear current selection set.\r\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\r\n */\r\n public emptyAll(): void {\r\n if (!this.isActive)\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this.sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removed });\r\n }\r\n\r\n /**\r\n * Add one or more Ids to the current selection set.\r\n * @param elem The set of Ids to add.\r\n * @returns true if any elements were added.\r\n */\r\n public add(elem: Id64Arg): boolean {\r\n return this._add(elem);\r\n }\r\n\r\n private _add(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.add(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Remove one or more Ids from the current selection set.\r\n * @param elem The set of Ids to remove.\r\n * @returns true if any elements were removed.\r\n */\r\n public remove(elem: Id64Arg): boolean {\r\n return this._remove(elem);\r\n }\r\n\r\n private _remove(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.delete(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\r\n * @returns True if any Ids were either added or removed.\r\n */\r\n public addAndRemove(adds: Id64Arg, removes: Id64Arg): boolean {\r\n const added = this._add(adds, false);\r\n const removed = this._remove(removes, false);\r\n\r\n if (added && removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: adds, removed: removes });\r\n else if (added)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: adds });\r\n else if (removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: removes });\r\n\r\n return (added || removed);\r\n }\r\n\r\n /** Invert the state of a set of Ids in the SelectionSet */\r\n public invert(elem: Id64Arg): boolean {\r\n const elementsToAdd = new Set<string>();\r\n const elementsToRemove = new Set<string>();\r\n for (const id of Id64.iterable(elem)) {\r\n if (this.elements.has(id))\r\n elementsToRemove.add(id);\r\n else\r\n elementsToAdd.add(id);\r\n }\r\n\r\n return this.addAndRemove(elementsToAdd, elementsToRemove);\r\n }\r\n\r\n /** Change selection set to be the supplied set of Ids. */\r\n public replace(elem: Id64Arg): void {\r\n if (areEqual(this.elements, elem))\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this._add(elem, false);\r\n\r\n if (0 < removed.size) {\r\n for (const id of Id64.iterable(elem)) {\r\n if (removed.has(id))\r\n removed.delete(id);\r\n }\r\n }\r\n\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: elem, removed });\r\n }\r\n}\r\n\r\nfunction areEqual(lhs: Set<string>, rhs: Id64Arg): boolean {\r\n // Size is unreliable if input can contain duplicates...\r\n if (Array.isArray(rhs))\r\n rhs = Id64.toIdSet(rhs);\r\n\r\n if (lhs.size !== Id64.sizeOf(rhs))\r\n return false;\r\n\r\n for (const id of Id64.iterable(rhs))\r\n if (!lhs.has(id))\r\n return false;\r\n\r\n return true;\r\n}\r\n"]}
@@ -1,3 +1,6 @@
1
+ /** @packageDocumentation
2
+ * @module IModelApp
3
+ */
1
4
  import { IModelAppOptions } from "./IModelApp";
2
5
  import { AnimationBranchStates } from "./render/GraphicBranch";
3
6
  import { RenderSystem } from "./render/RenderSystem";
@@ -52,12 +55,16 @@ export declare class NullRenderSystem extends RenderSystem {
52
55
  constructor();
53
56
  createRenderGraphic(): undefined;
54
57
  }
55
- /**
56
- * A class for applications that must run in environments where WebGL is not present.
57
- * This is typically used in tests.
58
- * @internal
58
+ /** A utility class intended for applications (primarily test-runners) that run in environments that lack support for WebGL.
59
+ * It installs a [[RenderSystem]] that produces no graphics.
60
+ * Use [[NoRenderApp.startup]] instead of [[IModelApp.startup]] to initialize your application frontend.
61
+ * You may then use the [[IModelApp]] API as normal.
62
+ * @public
59
63
  */
60
64
  export declare class NoRenderApp {
65
+ /** Initializes [[IModelApp]] with a [[RenderSystem]] that produces no graphics.
66
+ * Use this in place of [[IModelApp.startup]], then proceed to use [[IModelApp]]'s API as normal.
67
+ */
61
68
  static startup(opts?: IModelAppOptions): Promise<void>;
62
69
  }
63
70
  //# sourceMappingURL=NoRenderApp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NoRenderApp.d.ts","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YA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,CAAC,MAAM,CAAC,EAAK;CAC9D;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,IAAW,OAAO,IAAI,OAAO,CAAkB;IACxC,UAAU,IAAI,OAAO;IACrB,YAAY;IACZ,qBAAqB;IACrB,aAAa;IACb,iBAAiB;IACjB,mBAAmB;IACnB,WAAW;IACX,OAAO;;IAEE,mBAAmB;CACpC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB;;OAEG;WACiB,OAAO,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOpE"}
@@ -2,6 +2,9 @@
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
+ /** @packageDocumentation
6
+ * @module IModelApp
7
+ */
5
8
  import { EmptyLocalization } from "@itwin/core-common";
6
9
  import { IModelApp } from "./IModelApp";
7
10
  import { RenderSystem } from "./render/RenderSystem";
@@ -56,12 +59,16 @@ export class NullRenderSystem extends RenderSystem {
56
59
  constructor() { super(); }
57
60
  createRenderGraphic() { return undefined; }
58
61
  }
59
- /**
60
- * A class for applications that must run in environments where WebGL is not present.
61
- * This is typically used in tests.
62
- * @internal
62
+ /** A utility class intended for applications (primarily test-runners) that run in environments that lack support for WebGL.
63
+ * It installs a [[RenderSystem]] that produces no graphics.
64
+ * Use [[NoRenderApp.startup]] instead of [[IModelApp.startup]] to initialize your application frontend.
65
+ * You may then use the [[IModelApp]] API as normal.
66
+ * @public
63
67
  */
64
68
  export class NoRenderApp {
69
+ /** Initializes [[IModelApp]] with a [[RenderSystem]] that produces no graphics.
70
+ * Use this in place of [[IModelApp.startup]], then proceed to use [[IModelApp]]'s API as normal.
71
+ */
65
72
  static async startup(opts) {
66
73
  var _a;
67
74
  opts = opts ? opts : {};
@@ -1 +1 @@
1
- {"version":3,"file":"NoRenderApp.js","sourceRoot":"","sources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AW,kBAAkB,CAAC,QAA0B,IAAI,CAAC;CAC9D;AAED;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAChD,IAAW,OAAO,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACxC,UAAU,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACvC,YAAY,KAAK,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3C,qBAAqB,KAAK,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC;IACpD,aAAa,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAC5C,iBAAiB,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAChD,mBAAmB,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAClD,WAAW,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC;IACpB,gBAAuB,KAAK,EAAE,CAAC,CAAC,CAAC;IACjB,mBAAmB,KAAK,OAAO,SAAS,CAAC,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACf,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAuB;;QACjD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,YAAY,mCAAI,IAAI,iBAAiB,EAAE,CAAC;QACjE,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,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\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\nimport { AnimationBranchStates } from \"./render/GraphicBranch\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/**\r\n * A RenderTarget for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullTarget extends RenderTarget {\r\n public get analysisFraction(): number { return 0; }\r\n public set analysisFraction(_fraction: number) { }\r\n public get renderSystem() { return undefined as any; }\r\n public get viewRect(): ViewRect { return new ViewRect(); }\r\n public get wantInvertBlackBackground(): boolean { return false; }\r\n public override get animationBranches(): AnimationBranchStates | undefined { return undefined; }\r\n public override set animationBranches(_branches: AnimationBranchStates | undefined) { }\r\n public onDestroy(): void { }\r\n public override reset(): void { }\r\n public changeScene(): void { }\r\n public changeDynamics(): void { }\r\n public changeDecorations(): void { }\r\n public changeRenderPlan(): void { }\r\n public drawFrame(_sceneMilSecElapsed?: number): void { }\r\n public override overrideFeatureSymbology(): void { }\r\n public override setHiliteSet(): void { }\r\n public override setFlashed(): void { }\r\n public setViewRect(): void { }\r\n public override onResized(): void { }\r\n public override dispose(): void { }\r\n public updateViewRect(): boolean { return false; }\r\n public readPixels(): void { }\r\n public get screenSpaceEffects(): Iterable<string> { return []; }\r\n public set screenSpaceEffects(_effects: Iterable<string>) { }\r\n}\r\n\r\n/**\r\n * A RenderSystem for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullRenderSystem extends RenderSystem {\r\n public get isValid(): boolean { return false; }\r\n public doIdleWork(): boolean { return false; }\r\n public createTarget() { return new NullTarget(); }\r\n public createOffscreenTarget() { return new NullTarget(); }\r\n public createGraphic() { return undefined as any; }\r\n public createGraphicList() { return undefined as any; }\r\n public createGraphicBranch() { return undefined as any; }\r\n public createBatch() { return undefined as any; }\r\n public dispose() { }\r\n public constructor() { super(); }\r\n public override createRenderGraphic() { return undefined; }\r\n}\r\n\r\n/**\r\n * A class for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NoRenderApp {\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n opts = opts ? opts : {};\r\n opts.renderSys = new NullRenderSystem();\r\n opts.noRender = true;\r\n opts.localization = opts.localization ?? new EmptyLocalization();\r\n await IModelApp.startup(opts);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NoRenderApp.js","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAC1C,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,IAAW,gBAAgB,CAAC,SAAiB,IAAI,CAAC;IAClD,IAAW,YAAY,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IACtD,IAAW,QAAQ,KAAe,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,IAAW,yBAAyB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACjE,IAAoB,iBAAiB,KAAwC,OAAO,SAAS,CAAC,CAAC,CAAC;IAChG,IAAoB,iBAAiB,CAAC,SAA4C,IAAI,CAAC;IAChF,SAAS,KAAW,CAAC;IACZ,KAAK,KAAW,CAAC;IAC1B,WAAW,KAAW,CAAC;IACvB,cAAc,KAAW,CAAC;IAC1B,iBAAiB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,IAAI,gBAAgB,EAAE,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,YAAY,mCAAI,IAAI,iBAAiB,EAAE,CAAC;QACjE,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,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 IModelApp\r\n */\r\n\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\nimport { AnimationBranchStates } from \"./render/GraphicBranch\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/**\r\n * A RenderTarget for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullTarget extends RenderTarget {\r\n public get analysisFraction(): number { return 0; }\r\n public set analysisFraction(_fraction: number) { }\r\n public get renderSystem() { return undefined as any; }\r\n public get viewRect(): ViewRect { return new ViewRect(); }\r\n public get wantInvertBlackBackground(): boolean { return false; }\r\n public override get animationBranches(): AnimationBranchStates | undefined { return undefined; }\r\n public override set animationBranches(_branches: AnimationBranchStates | undefined) { }\r\n public onDestroy(): void { }\r\n public override reset(): void { }\r\n public changeScene(): void { }\r\n public changeDynamics(): void { }\r\n public changeDecorations(): void { }\r\n public changeRenderPlan(): void { }\r\n public drawFrame(_sceneMilSecElapsed?: number): void { }\r\n public override overrideFeatureSymbology(): void { }\r\n public override setHiliteSet(): void { }\r\n public override setFlashed(): void { }\r\n public setViewRect(): void { }\r\n public override onResized(): void { }\r\n public override dispose(): void { }\r\n public updateViewRect(): boolean { return false; }\r\n public readPixels(): void { }\r\n public get screenSpaceEffects(): Iterable<string> { return []; }\r\n public set screenSpaceEffects(_effects: Iterable<string>) { }\r\n}\r\n\r\n/**\r\n * A RenderSystem for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullRenderSystem extends RenderSystem {\r\n public get isValid(): boolean { return false; }\r\n public doIdleWork(): boolean { return false; }\r\n public createTarget() { return new NullTarget(); }\r\n public createOffscreenTarget() { return new NullTarget(); }\r\n public createGraphic() { return undefined as any; }\r\n public createGraphicList() { return undefined as any; }\r\n public createGraphicBranch() { return undefined as any; }\r\n public createBatch() { return undefined as any; }\r\n public dispose() { }\r\n public constructor() { super(); }\r\n public override createRenderGraphic() { return undefined; }\r\n}\r\n\r\n/** A utility class intended for applications (primarily test-runners) that run in environments that lack support for WebGL.\r\n * It installs a [[RenderSystem]] that produces no graphics.\r\n * Use [[NoRenderApp.startup]] instead of [[IModelApp.startup]] to initialize your application frontend.\r\n * You may then use the [[IModelApp]] API as normal.\r\n * @public\r\n */\r\nexport class NoRenderApp {\r\n /** Initializes [[IModelApp]] with a [[RenderSystem]] that produces no graphics.\r\n * Use this in place of [[IModelApp.startup]], then proceed to use [[IModelApp]]'s API as normal.\r\n */\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n opts = opts ? opts : {};\r\n opts.renderSys = new NullRenderSystem();\r\n opts.noRender = true;\r\n opts.localization = opts.localization ?? new EmptyLocalization();\r\n await IModelApp.startup(opts);\r\n }\r\n}\r\n"]}
@@ -122,7 +122,6 @@ export declare class HiliteSet {
122
122
  /** Construct a HiliteSet
123
123
  * @param iModel The iModel containing the entities to be hilited.
124
124
  * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].
125
- * @internal
126
125
  */
127
126
  constructor(iModel: IModelConnection, syncWithSelectionSet?: boolean);
128
127
  /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].
@@ -1 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A0C;IAC1C,IAAW,OAAO,IAAI,OAAO,CAAuF;IAEpH;;;OAGG;IACI,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;CAarD;AAED;;;;;GAKG;AACH,qBAAa,YAAY;IAWG,MAAM,EAAE,gBAAgB;IAVlD,OAAO,CAAC,SAAS,CAAqB;IAEtC;;OAEG;IACH,IAAW,QAAQ,IAAI,GAAG,CAAC,MAAM,CAAC,CAA2B;IAE7D,2EAA2E;IAC3E,SAAgB,SAAS,eAAoB,iBAAiB,KAAK,IAAI,EAAI;gBAEjD,MAAM,EAAE,gBAAgB;IAElD,OAAO,CAAC,gBAAgB;IAKxB,uDAAuD;IACvD,IAAW,IAAI,WAAiC;IAEhD,qDAAqD;IACrD,IAAW,QAAQ,YAA8B;IAEjD;;OAEG;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM;IAE1B;;OAEG;IACI,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO;IAE/C;;OAEG;IACI,QAAQ,IAAI,IAAI;IASvB;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAIlC,OAAO,CAAC,IAAI;IAYZ;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAIrC,OAAO,CAAC,OAAO;IAYf;;;OAGG;IACI,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO;IAc7D,2DAA2D;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAarC,0DAA0D;IACnD,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAiBpC"}
@@ -116,7 +116,6 @@ export class HiliteSet {
116
116
  /** Construct a HiliteSet
117
117
  * @param iModel The iModel containing the entities to be hilited.
118
118
  * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].
119
- * @internal
120
119
  */
121
120
  constructor(iModel, syncWithSelectionSet = true) {
122
121
  this.iModel = iModel;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAuB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,2CAA2C;IAC3C,+DAAG,CAAA;IACH,+CAA+C;IAC/C,qEAAM,CAAA;IACN,6EAA6E;IAC7E,uEAAO,CAAA;IACP,yDAAyD;IACzD,mEAAK,CAAA;AACP,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAyDD;;GAEG;AACH,MAAM,UAAW,SAAQ,IAAI,CAAC,SAAS;IAIrC,YAAmB,MAAwB;QACzC,KAAK,EAAE,CAAC;QAHA,cAAS,GAAG,KAAK,CAAC;QAI1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEe,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAW,EAAE,IAAY;QAC9C,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,KAAK;QACnB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAY;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;I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B,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;YAC/B,OAAO;QAET,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEvB,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACpC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACtB;SACF;QAED,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,GAAgB,EAAE,GAAY;IAC9C,wDAAwD;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACpB,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/B,OAAO,KAAK,CAAC;IAEf,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,KAAK,CAAC;IAEjB,OAAO,IAAI,CAAC;AACd,CAAC","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 SelectionSet\r\n */\r\nimport { BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SelectionSetEventType {\r\n /** Elements have been added to the set. */\r\n Add,\r\n /** Elements have been removed from the set. */\r\n Remove,\r\n /** Some elements have been added to the set and others have been removed. */\r\n Replace,\r\n /** All elements are about to be removed from the set. */\r\n Clear,\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are added to the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectAddEvent {\r\n type: SelectionSetEventType.Add;\r\n /** The Ids of the elements added to the set. */\r\n added: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectRemoveEvent {\r\n /** The type of operation that produced this event. */\r\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are simultaneously added to and removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectReplaceEvent {\r\n type: SelectionSetEventType.Replace;\r\n /** The element Ids added to the set. */\r\n added: Id64Arg;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\r\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\r\n * ```ts\r\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\r\n * console.log(\"Added \" + ev.added.size + \" elements\");\r\n *\r\n * if (SelectionSetEventType.Add !== ev.type)\r\n * console.log(\"Removed \" + ev.removed.size + \" elements\");\r\n * }\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\r\n\r\n/** Tracks a set of hilited entities. When the set changes, notifies ViewManager so that symbology overrides can be updated in active Viewports.\r\n * @internal\r\n */\r\nclass HilitedIds extends Id64.Uint32Set {\r\n protected _iModel: IModelConnection;\r\n protected _changing = false;\r\n\r\n public constructor(iModel: IModelConnection) {\r\n super();\r\n this._iModel = iModel;\r\n }\r\n\r\n public override add(low: number, high: number) {\r\n super.add(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override delete(low: number, high: number) {\r\n super.delete(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override clear() {\r\n super.clear();\r\n this.onChanged();\r\n }\r\n\r\n public override addIds(ids: Id64Arg) {\r\n this.change(() => super.addIds(ids));\r\n }\r\n\r\n public override deleteIds(ids: Id64Arg) {\r\n this.change(() => super.deleteIds(ids));\r\n }\r\n\r\n protected onChanged() {\r\n if (!this._changing)\r\n IModelApp.viewManager.onSelectionSetChanged(this._iModel);\r\n }\r\n\r\n protected change(func: () => void) {\r\n const changing = this._changing;\r\n this._changing = false;\r\n func();\r\n this._changing = changing;\r\n this.onChanged();\r\n }\r\n}\r\n\r\n/** Keeps the set of hilited elements in sync with the selection set.\r\n * @internal\r\n */\r\nclass HilitedElementIds extends HilitedIds {\r\n private _removeListener?: () => void;\r\n\r\n public constructor(iModel: IModelConnection, syncWithSelectionSet = true) {\r\n super(iModel);\r\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\r\n }\r\n\r\n public get wantSyncWithSelectionSet(): boolean { return undefined !== this._removeListener; }\r\n public set wantSyncWithSelectionSet(want: boolean) {\r\n if (want === this.wantSyncWithSelectionSet)\r\n return;\r\n\r\n if (want) {\r\n const set = this._iModel.selectionSet;\r\n this._removeListener = set.onChanged.addListener((ev) => this.change(() => this.processSelectionSetEvent(ev)));\r\n this.processSelectionSetEvent({\r\n set,\r\n type: SelectionSetEventType.Add,\r\n added: set.elements,\r\n });\r\n } else {\r\n this._removeListener!();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n private processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n if (SelectionSetEventType.Add !== ev.type)\r\n this.deleteIds(ev.removed);\r\n\r\n if (ev.type === SelectionSetEventType.Add || ev.type === SelectionSetEventType.Replace)\r\n this.addIds(ev.added);\r\n }\r\n}\r\n\r\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\r\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\r\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\r\n *\r\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\r\n * @public\r\n */\r\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\r\n\r\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\r\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\r\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\r\n *\r\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\r\n * features belonging to different subcategories.\r\n *\r\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\r\n *\r\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\r\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\r\n * are also responsible for removing them as appropriate.\r\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class HiliteSet {\r\n private readonly _elements: HilitedElementIds;\r\n private _mode: ModelSubCategoryHiliteMode = \"union\";\r\n\r\n /** The set of hilited subcategories.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\r\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\r\n */\r\n public readonly subcategories: Id64.Uint32Set;\r\n\r\n /** The set of hilited [[GeometricModelState]]s.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\r\n */\r\n public readonly models: Id64.Uint32Set;\r\n\r\n /** The set of hilited elements. */\r\n public get elements(): Id64.Uint32Set { return this._elements; }\r\n\r\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\r\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\r\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\r\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\r\n * [[elements]] is always hilited regardless of its model or subcategories.\r\n */\r\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\r\n return this._mode;\r\n }\r\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\r\n if (mode === this._mode)\r\n return;\r\n\r\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\r\n this._mode = mode;\r\n }\r\n\r\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\r\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\r\n\r\n /** Construct a HiliteSet\r\n * @param iModel The iModel containing the entities to be hilited.\r\n * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].\r\n * @internal\r\n */\r\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\r\n this._elements = new HilitedElementIds(iModel, syncWithSelectionSet);\r\n this.subcategories = new HilitedIds(iModel);\r\n this.models = new HilitedIds(iModel);\r\n }\r\n\r\n /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].\r\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\r\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\r\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\r\n */\r\n public get wantSyncWithSelectionSet(): boolean { return this._elements.wantSyncWithSelectionSet; }\r\n public set wantSyncWithSelectionSet(want: boolean) { this._elements.wantSyncWithSelectionSet = want; }\r\n\r\n /** Remove all elements from the hilited set. */\r\n public clear() {\r\n this.elements.clear();\r\n this.subcategories.clear();\r\n this.models.clear();\r\n }\r\n\r\n /** Returns true if nothing is hilited. */\r\n public get isEmpty(): boolean { return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty; }\r\n\r\n /** Toggle the hilited state of one or more elements.\r\n * @param arg the ID(s) of the elements whose state is to be toggled.\r\n * @param onOff True to add the elements to the hilited set, false to remove them.\r\n */\r\n public setHilite(arg: Id64Arg, onOff: boolean): void {\r\n const oldSize = this.elements.size;\r\n\r\n for (const id of Id64.iterable(arg)) {\r\n if (onOff)\r\n this.elements.addId(id);\r\n else\r\n this.elements.deleteId(id);\r\n }\r\n\r\n if (oldSize !== this.elements.size)\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n }\r\n}\r\n\r\n/** A set of *currently selected* elements for an IModelConnection.\r\n * Selected elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class SelectionSet {\r\n private _elements = new Set<string>();\r\n\r\n /** The IDs of the selected elements.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get elements(): Set<string> { return this._elements; }\r\n\r\n /** Called whenever elements are added or removed from this SelectionSet */\r\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\r\n\r\n public constructor(public iModel: IModelConnection) { }\r\n\r\n private sendChangedEvent(ev: SelectionSetEvent) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n this.onChanged.raiseEvent(ev);\r\n }\r\n\r\n /** Get the number of entries in this selection set. */\r\n public get size() { return this.elements.size; }\r\n\r\n /** Check whether there are any selected elements. */\r\n public get isActive() { return this.size !== 0; }\r\n\r\n /** Return true if elemId is in this SelectionSet.\r\n * @see [[isSelected]]\r\n */\r\n public has(elemId?: string) { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Query whether an Id is in the selection set.\r\n * @see [[has]]\r\n */\r\n public isSelected(elemId?: Id64String): boolean { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Clear current selection set.\r\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\r\n */\r\n public emptyAll(): void {\r\n if (!this.isActive)\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this.sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removed });\r\n }\r\n\r\n /**\r\n * Add one or more Ids to the current selection set.\r\n * @param elem The set of Ids to add.\r\n * @returns true if any elements were added.\r\n */\r\n public add(elem: Id64Arg): boolean {\r\n return this._add(elem);\r\n }\r\n\r\n private _add(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.add(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Remove one or more Ids from the current selection set.\r\n * @param elem The set of Ids to remove.\r\n * @returns true if any elements were removed.\r\n */\r\n public remove(elem: Id64Arg): boolean {\r\n return this._remove(elem);\r\n }\r\n\r\n private _remove(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.delete(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\r\n * @returns True if any Ids were either added or removed.\r\n */\r\n public addAndRemove(adds: Id64Arg, removes: Id64Arg): boolean {\r\n const added = this._add(adds, false);\r\n const removed = this._remove(removes, false);\r\n\r\n if (added && removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: adds, removed: removes });\r\n else if (added)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: adds });\r\n else if (removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: removes });\r\n\r\n return (added || removed);\r\n }\r\n\r\n /** Invert the state of a set of Ids in the SelectionSet */\r\n public invert(elem: Id64Arg): boolean {\r\n const elementsToAdd = new Set<string>();\r\n const elementsToRemove = new Set<string>();\r\n for (const id of Id64.iterable(elem)) {\r\n if (this.elements.has(id))\r\n elementsToRemove.add(id);\r\n else\r\n elementsToAdd.add(id);\r\n }\r\n\r\n return this.addAndRemove(elementsToAdd, elementsToRemove);\r\n }\r\n\r\n /** Change selection set to be the supplied set of Ids. */\r\n public replace(elem: Id64Arg): void {\r\n if (areEqual(this.elements, elem))\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this._add(elem, false);\r\n\r\n if (0 < removed.size) {\r\n for (const id of Id64.iterable(elem)) {\r\n if (removed.has(id))\r\n removed.delete(id);\r\n }\r\n }\r\n\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: elem, removed });\r\n }\r\n}\r\n\r\nfunction areEqual(lhs: Set<string>, rhs: Id64Arg): boolean {\r\n // Size is unreliable if input can contain duplicates...\r\n if (Array.isArray(rhs))\r\n rhs = Id64.toIdSet(rhs);\r\n\r\n if (lhs.size !== Id64.sizeOf(rhs))\r\n return false;\r\n\r\n for (const id of Id64.iterable(rhs))\r\n if (!lhs.has(id))\r\n return false;\r\n\r\n return true;\r\n}\r\n"]}
1
+ {"version":3,"file":"SelectionSet.js","sourceRoot":"","sources":["../../src/SelectionSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAuB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,2CAA2C;IAC3C,+DAAG,CAAA;IACH,+CAA+C;IAC/C,qEAAM,CAAA;IACN,6EAA6E;IAC7E,uEAAO,CAAA;IACP,yDAAyD;IACzD,mEAAK,CAAA;AACP,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAyDD;;GAEG;AACH,MAAM,UAAW,SAAQ,IAAI,CAAC,SAAS;IAIrC,YAAmB,MAAwB;QACzC,KAAK,EAAE,CAAC;QAHA,cAAS,GAAG,KAAK,CAAC;QAI1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEe,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,MAAM,CAAC,GAAW,EAAE,IAAY;QAC9C,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEe,KAAK;QACnB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAA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C","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 SelectionSet\r\n */\r\nimport { BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\n\r\n/** Identifies the type of changes made to the [[SelectionSet]] to produce a [[SelectionSetEvent]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum SelectionSetEventType {\r\n /** Elements have been added to the set. */\r\n Add,\r\n /** Elements have been removed from the set. */\r\n Remove,\r\n /** Some elements have been added to the set and others have been removed. */\r\n Replace,\r\n /** All elements are about to be removed from the set. */\r\n Clear,\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are added to the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectAddEvent {\r\n type: SelectionSetEventType.Add;\r\n /** The Ids of the elements added to the set. */\r\n added: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectRemoveEvent {\r\n /** The type of operation that produced this event. */\r\n type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Passed to [[SelectionSet.onChanged]] event listeners when elements are simultaneously added to and removed from the selection set.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectReplaceEvent {\r\n type: SelectionSetEventType.Replace;\r\n /** The element Ids added to the set. */\r\n added: Id64Arg;\r\n /** The element Ids removed from the set. */\r\n removed: Id64Arg;\r\n /** The affected SelectionSet. */\r\n set: SelectionSet;\r\n}\r\n\r\n/** Payload sent to [[SelectionSet.onChanged]] event listeners to describe how the contents of the set have changed.\r\n * The `type` property of the event serves as a type assertion. For example, the following code will output the added and/or removed Ids:\r\n * ```ts\r\n * processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n * if (SelectionSetEventType.Add === ev.type || SelectionSetEventType.Replace === ev.type)\r\n * console.log(\"Added \" + ev.added.size + \" elements\");\r\n *\r\n * if (SelectionSetEventType.Add !== ev.type)\r\n * console.log(\"Removed \" + ev.removed.size + \" elements\");\r\n * }\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport type SelectionSetEvent = SelectAddEvent | SelectRemoveEvent | SelectReplaceEvent;\r\n\r\n/** Tracks a set of hilited entities. When the set changes, notifies ViewManager so that symbology overrides can be updated in active Viewports.\r\n * @internal\r\n */\r\nclass HilitedIds extends Id64.Uint32Set {\r\n protected _iModel: IModelConnection;\r\n protected _changing = false;\r\n\r\n public constructor(iModel: IModelConnection) {\r\n super();\r\n this._iModel = iModel;\r\n }\r\n\r\n public override add(low: number, high: number) {\r\n super.add(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override delete(low: number, high: number) {\r\n super.delete(low, high);\r\n this.onChanged();\r\n }\r\n\r\n public override clear() {\r\n super.clear();\r\n this.onChanged();\r\n }\r\n\r\n public override addIds(ids: Id64Arg) {\r\n this.change(() => super.addIds(ids));\r\n }\r\n\r\n public override deleteIds(ids: Id64Arg) {\r\n this.change(() => super.deleteIds(ids));\r\n }\r\n\r\n protected onChanged() {\r\n if (!this._changing)\r\n IModelApp.viewManager.onSelectionSetChanged(this._iModel);\r\n }\r\n\r\n protected change(func: () => void) {\r\n const changing = this._changing;\r\n this._changing = false;\r\n func();\r\n this._changing = changing;\r\n this.onChanged();\r\n }\r\n}\r\n\r\n/** Keeps the set of hilited elements in sync with the selection set.\r\n * @internal\r\n */\r\nclass HilitedElementIds extends HilitedIds {\r\n private _removeListener?: () => void;\r\n\r\n public constructor(iModel: IModelConnection, syncWithSelectionSet = true) {\r\n super(iModel);\r\n this.wantSyncWithSelectionSet = syncWithSelectionSet;\r\n }\r\n\r\n public get wantSyncWithSelectionSet(): boolean { return undefined !== this._removeListener; }\r\n public set wantSyncWithSelectionSet(want: boolean) {\r\n if (want === this.wantSyncWithSelectionSet)\r\n return;\r\n\r\n if (want) {\r\n const set = this._iModel.selectionSet;\r\n this._removeListener = set.onChanged.addListener((ev) => this.change(() => this.processSelectionSetEvent(ev)));\r\n this.processSelectionSetEvent({\r\n set,\r\n type: SelectionSetEventType.Add,\r\n added: set.elements,\r\n });\r\n } else {\r\n this._removeListener!();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n private processSelectionSetEvent(ev: SelectionSetEvent): void {\r\n if (SelectionSetEventType.Add !== ev.type)\r\n this.deleteIds(ev.removed);\r\n\r\n if (ev.type === SelectionSetEventType.Add || ev.type === SelectionSetEventType.Replace)\r\n this.addIds(ev.added);\r\n }\r\n}\r\n\r\n/** Describes how the sets of hilited models and subcategories in a [[HiliteSet]] interact.\r\n * - \"union\" indicates a [Feature]($common) will be hilited if either its model **or** its subcategory is present in the HiliteSet.\r\n * - \"intersection\" indicates a [Feature]($common) will be hilited only if both its model **and** its subcategory are present in the HiliteSet.\r\n *\r\n * @see [[HiliteSet.modelSubCategoryMode]] to change the mode for a HiliteSet.\r\n * @public\r\n */\r\nexport type ModelSubCategoryHiliteMode = \"union\" | \"intersection\";\r\n\r\n/** A set of *hilited* elements for an [[IModelConnection]], by element id.\r\n * Hilited elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * The set exposes 3 types of elements in 3 separate collections: [GeometricElement]($backend), [GeometricModel]($backend), and [SubCategory]($backend).\r\n * The [[models]] and [[subcategories]] can be hilited independently or as an intersection of the two sets, as specified by [[modelSubCategoryMode]].\r\n *\r\n * Technically, the hilite effect is applied to [Feature]($common)s, not [Element]($backend)s. An element's geometry stream can contain multiple\r\n * features belonging to different subcategories.\r\n *\r\n * Because Javascript lacks efficient support for 64-bit integers, the Ids are stored as pairs of 32-bit integers via [Id64.Uint32Set]($bentley).\r\n *\r\n * @note Typically, elements are hilited by virtue of their presence in the IModelConnection's [[SelectionSet]]. The HiliteSet allows additional\r\n * elements to be displayed with the hilite effect without adding them to the [[SelectionSet]]. If you add elements to the HiliteSet directly, you\r\n * are also responsible for removing them as appropriate.\r\n * @see [[IModelConnection.hilited]] for the HiliteSet associated with an iModel.\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class HiliteSet {\r\n private readonly _elements: HilitedElementIds;\r\n private _mode: ModelSubCategoryHiliteMode = \"union\";\r\n\r\n /** The set of hilited subcategories.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[models]].\r\n * @see [[IModelConnection.Categories]] to obtain the set of subcategories associated with one or more [Category]($backend)'s.\r\n */\r\n public readonly subcategories: Id64.Uint32Set;\r\n\r\n /** The set of hilited [[GeometricModelState]]s.\r\n * @see [[modelSubCategoryMode]] to control how this set interacts with the set of hilited [[subcategories]].\r\n */\r\n public readonly models: Id64.Uint32Set;\r\n\r\n /** The set of hilited elements. */\r\n public get elements(): Id64.Uint32Set { return this._elements; }\r\n\r\n /** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.\r\n * By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.\r\n * This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.\r\n * @note The sets of hilited models and subcategories are independent of the set of hilited [[elements]] - an element whose Id is present in\r\n * [[elements]] is always hilited regardless of its model or subcategories.\r\n */\r\n public get modelSubCategoryMode(): ModelSubCategoryHiliteMode {\r\n return this._mode;\r\n }\r\n public set modelSubCategoryMode(mode: ModelSubCategoryHiliteMode) {\r\n if (mode === this._mode)\r\n return;\r\n\r\n this.onModelSubCategoryModeChanged.raiseEvent(mode);\r\n this._mode = mode;\r\n }\r\n\r\n /** Event raised just before changing the value of [[modelSubCategoryMode]]. */\r\n public readonly onModelSubCategoryModeChanged = new BeEvent<(newMode: ModelSubCategoryHiliteMode) => void>();\r\n\r\n /** Construct a HiliteSet\r\n * @param iModel The iModel containing the entities to be hilited.\r\n * @param syncWithSelectionSet If true, the contents of the `elements` set will be synchronized with those in the `iModel`'s [[SelectionSet]].\r\n */\r\n public constructor(public iModel: IModelConnection, syncWithSelectionSet = true) {\r\n this._elements = new HilitedElementIds(iModel, syncWithSelectionSet);\r\n this.subcategories = new HilitedIds(iModel);\r\n this.models = new HilitedIds(iModel);\r\n }\r\n\r\n /** Control whether the hilited elements will be synchronized with the contents of the [[SelectionSet]].\r\n * By default they are synchronized. Applications that override this take responsibility for managing the set of hilited entities.\r\n * When turning synchronization off, the contents of the HiliteSet will remain unchanged.\r\n * When turning synchronization on, the current contents of the HiliteSet will be preserved, and the contents of the selection set will be added to them.\r\n */\r\n public get wantSyncWithSelectionSet(): boolean { return this._elements.wantSyncWithSelectionSet; }\r\n public set wantSyncWithSelectionSet(want: boolean) { this._elements.wantSyncWithSelectionSet = want; }\r\n\r\n /** Remove all elements from the hilited set. */\r\n public clear() {\r\n this.elements.clear();\r\n this.subcategories.clear();\r\n this.models.clear();\r\n }\r\n\r\n /** Returns true if nothing is hilited. */\r\n public get isEmpty(): boolean { return this.elements.isEmpty && this.subcategories.isEmpty && this.models.isEmpty; }\r\n\r\n /** Toggle the hilited state of one or more elements.\r\n * @param arg the ID(s) of the elements whose state is to be toggled.\r\n * @param onOff True to add the elements to the hilited set, false to remove them.\r\n */\r\n public setHilite(arg: Id64Arg, onOff: boolean): void {\r\n const oldSize = this.elements.size;\r\n\r\n for (const id of Id64.iterable(arg)) {\r\n if (onOff)\r\n this.elements.addId(id);\r\n else\r\n this.elements.deleteId(id);\r\n }\r\n\r\n if (oldSize !== this.elements.size)\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n }\r\n}\r\n\r\n/** A set of *currently selected* elements for an IModelConnection.\r\n * Selected elements are displayed with a customizable hilite effect within a [[Viewport]].\r\n * @see [Hilite.Settings]($common) for customization of the hilite effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport class SelectionSet {\r\n private _elements = new Set<string>();\r\n\r\n /** The IDs of the selected elements.\r\n * @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].\r\n */\r\n public get elements(): Set<string> { return this._elements; }\r\n\r\n /** Called whenever elements are added or removed from this SelectionSet */\r\n public readonly onChanged = new BeEvent<(ev: SelectionSetEvent) => void>();\r\n\r\n public constructor(public iModel: IModelConnection) { }\r\n\r\n private sendChangedEvent(ev: SelectionSetEvent) {\r\n IModelApp.viewManager.onSelectionSetChanged(this.iModel);\r\n this.onChanged.raiseEvent(ev);\r\n }\r\n\r\n /** Get the number of entries in this selection set. */\r\n public get size() { return this.elements.size; }\r\n\r\n /** Check whether there are any selected elements. */\r\n public get isActive() { return this.size !== 0; }\r\n\r\n /** Return true if elemId is in this SelectionSet.\r\n * @see [[isSelected]]\r\n */\r\n public has(elemId?: string) { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Query whether an Id is in the selection set.\r\n * @see [[has]]\r\n */\r\n public isSelected(elemId?: Id64String): boolean { return !!elemId && this.elements.has(elemId); }\r\n\r\n /** Clear current selection set.\r\n * @note raises the [[onChanged]] event with [[SelectionSetEventType.Clear]].\r\n */\r\n public emptyAll(): void {\r\n if (!this.isActive)\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this.sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removed });\r\n }\r\n\r\n /**\r\n * Add one or more Ids to the current selection set.\r\n * @param elem The set of Ids to add.\r\n * @returns true if any elements were added.\r\n */\r\n public add(elem: Id64Arg): boolean {\r\n return this._add(elem);\r\n }\r\n\r\n private _add(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.add(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Remove one or more Ids from the current selection set.\r\n * @param elem The set of Ids to remove.\r\n * @returns true if any elements were removed.\r\n */\r\n public remove(elem: Id64Arg): boolean {\r\n return this._remove(elem);\r\n }\r\n\r\n private _remove(elem: Id64Arg, sendEvent = true): boolean {\r\n const oldSize = this.elements.size;\r\n for (const id of Id64.iterable(elem))\r\n this.elements.delete(id);\r\n\r\n const changed = oldSize !== this.elements.size;\r\n if (sendEvent && changed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: elem });\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.\r\n * @returns True if any Ids were either added or removed.\r\n */\r\n public addAndRemove(adds: Id64Arg, removes: Id64Arg): boolean {\r\n const added = this._add(adds, false);\r\n const removed = this._remove(removes, false);\r\n\r\n if (added && removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: adds, removed: removes });\r\n else if (added)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Add, set: this, added: adds });\r\n else if (removed)\r\n this.sendChangedEvent({ type: SelectionSetEventType.Remove, set: this, removed: removes });\r\n\r\n return (added || removed);\r\n }\r\n\r\n /** Invert the state of a set of Ids in the SelectionSet */\r\n public invert(elem: Id64Arg): boolean {\r\n const elementsToAdd = new Set<string>();\r\n const elementsToRemove = new Set<string>();\r\n for (const id of Id64.iterable(elem)) {\r\n if (this.elements.has(id))\r\n elementsToRemove.add(id);\r\n else\r\n elementsToAdd.add(id);\r\n }\r\n\r\n return this.addAndRemove(elementsToAdd, elementsToRemove);\r\n }\r\n\r\n /** Change selection set to be the supplied set of Ids. */\r\n public replace(elem: Id64Arg): void {\r\n if (areEqual(this.elements, elem))\r\n return;\r\n\r\n const removed = this._elements;\r\n this._elements = new Set<string>();\r\n this._add(elem, false);\r\n\r\n if (0 < removed.size) {\r\n for (const id of Id64.iterable(elem)) {\r\n if (removed.has(id))\r\n removed.delete(id);\r\n }\r\n }\r\n\r\n this.sendChangedEvent({ type: SelectionSetEventType.Replace, set: this, added: elem, removed });\r\n }\r\n}\r\n\r\nfunction areEqual(lhs: Set<string>, rhs: Id64Arg): boolean {\r\n // Size is unreliable if input can contain duplicates...\r\n if (Array.isArray(rhs))\r\n rhs = Id64.toIdSet(rhs);\r\n\r\n if (lhs.size !== Id64.sizeOf(rhs))\r\n return false;\r\n\r\n for (const id of Id64.iterable(rhs))\r\n if (!lhs.has(id))\r\n return false;\r\n\r\n return true;\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-frontend",
3
- "version": "4.0.0-dev.11",
3
+ "version": "4.0.0-dev.15",
4
4
  "description": "iTwin.js frontend components",
5
5
  "main": "lib/cjs/core-frontend.js",
6
6
  "module": "lib/esm/core-frontend.js",
@@ -23,11 +23,11 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@itwin/appui-abstract": "^4.0.0-dev.8",
26
- "@itwin/core-bentley": "^4.0.0-dev.11",
27
- "@itwin/core-common": "^4.0.0-dev.11",
28
- "@itwin/core-geometry": "^4.0.0-dev.11",
29
- "@itwin/core-orbitgt": "^4.0.0-dev.11",
30
- "@itwin/core-quantity": "^4.0.0-dev.11"
26
+ "@itwin/core-bentley": "^4.0.0-dev.15",
27
+ "@itwin/core-common": "^4.0.0-dev.15",
28
+ "@itwin/core-geometry": "^4.0.0-dev.15",
29
+ "@itwin/core-orbitgt": "^4.0.0-dev.15",
30
+ "@itwin/core-quantity": "^4.0.0-dev.15"
31
31
  },
32
32
  "//devDependencies": [
33
33
  "NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
@@ -35,15 +35,15 @@
35
35
  ],
36
36
  "devDependencies": {
37
37
  "@itwin/appui-abstract": "4.0.0-dev.8",
38
- "@itwin/build-tools": "4.0.0-dev.11",
39
- "@itwin/core-bentley": "4.0.0-dev.11",
40
- "@itwin/core-common": "4.0.0-dev.11",
41
- "@itwin/core-geometry": "4.0.0-dev.11",
42
- "@itwin/core-orbitgt": "4.0.0-dev.11",
43
- "@itwin/core-quantity": "4.0.0-dev.11",
44
- "@itwin/certa": "4.0.0-dev.11",
45
- "@itwin/eslint-plugin": "4.0.0-dev.11",
46
- "@itwin/webgl-compatibility": "4.0.0-dev.11",
38
+ "@itwin/build-tools": "4.0.0-dev.15",
39
+ "@itwin/core-bentley": "4.0.0-dev.15",
40
+ "@itwin/core-common": "4.0.0-dev.15",
41
+ "@itwin/core-geometry": "4.0.0-dev.15",
42
+ "@itwin/core-orbitgt": "4.0.0-dev.15",
43
+ "@itwin/core-quantity": "4.0.0-dev.15",
44
+ "@itwin/certa": "4.0.0-dev.15",
45
+ "@itwin/eslint-plugin": "4.0.0-dev.15",
46
+ "@itwin/webgl-compatibility": "4.0.0-dev.15",
47
47
  "@types/chai": "4.3.1",
48
48
  "@types/chai-as-promised": "^7",
49
49
  "@types/deep-assign": "^0.1.0",
@@ -77,9 +77,9 @@
77
77
  "@itwin/object-storage-azure": "~1.4.0",
78
78
  "@itwin/cloud-agnostic-core": "~1.4.0",
79
79
  "@itwin/object-storage-core": "~1.4.0",
80
- "@itwin/core-i18n": "4.0.0-dev.11",
81
- "@itwin/core-telemetry": "4.0.0-dev.11",
82
- "@itwin/webgl-compatibility": "4.0.0-dev.11",
80
+ "@itwin/core-i18n": "4.0.0-dev.15",
81
+ "@itwin/core-telemetry": "4.0.0-dev.15",
82
+ "@itwin/webgl-compatibility": "4.0.0-dev.15",
83
83
  "@loaders.gl/core": "^3.1.6",
84
84
  "@loaders.gl/draco": "^3.1.6",
85
85
  "deep-assign": "^2.0.0",