@itwin/core-frontend 5.0.0-dev.32 → 5.0.0-dev.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/AccuDraw.js +1 -1
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/ApproximateTerrainHeights.js +1 -1
- package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
- package/lib/cjs/BackgroundMapGeometry.js +5 -5
- package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
- package/lib/cjs/DrawingViewState.js +9 -9
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/GraphicalEditingScope.js +4 -4
- package/lib/cjs/GraphicalEditingScope.js.map +1 -1
- package/lib/cjs/IModelApp.js +61 -63
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.js +10 -10
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/IModelRoutingContext.js +1 -1
- package/lib/cjs/IModelRoutingContext.js.map +1 -1
- package/lib/cjs/IpcApp.js +2 -2
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/LocalhostIpcApp.js +1 -1
- package/lib/cjs/LocalhostIpcApp.js.map +1 -1
- package/lib/cjs/NativeApp.js +15 -17
- package/lib/cjs/NativeApp.js.map +1 -1
- package/lib/cjs/NativeAppLogger.js +1 -1
- package/lib/cjs/NativeAppLogger.js.map +1 -1
- package/lib/cjs/NoRenderApp.js +1 -1
- package/lib/cjs/NoRenderApp.js.map +1 -1
- package/lib/cjs/SelectionSet.js +148 -156
- package/lib/cjs/SelectionSet.js.map +1 -1
- package/lib/cjs/Sprites.js +1 -1
- package/lib/cjs/Sprites.js.map +1 -1
- package/lib/cjs/ViewCreator2d.js +3 -3
- package/lib/cjs/ViewCreator2d.js.map +1 -1
- package/lib/cjs/ViewGlobalLocation.js +5 -5
- package/lib/cjs/ViewGlobalLocation.js.map +1 -1
- package/lib/cjs/ViewState.js +2 -2
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/ViewingSpace.js +9 -9
- package/lib/cjs/ViewingSpace.js.map +1 -1
- package/lib/cjs/Viewport.js +41 -41
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/common/internal/render/DisplayParams.js +1 -1
- package/lib/cjs/common/internal/render/DisplayParams.js.map +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionContextImpl.js +1 -1
- package/lib/cjs/common/internal/render/GraphicDescriptionContextImpl.js.map +1 -1
- package/lib/cjs/internal/render/PrimitiveBuilder.js +1 -1
- package/lib/cjs/internal/render/PrimitiveBuilder.js.map +1 -1
- package/lib/cjs/internal/render/RenderInstancesParamsImpl.js +1 -1
- package/lib/cjs/internal/render/RenderInstancesParamsImpl.js.map +1 -1
- package/lib/cjs/render/MockRender.js +3 -3
- package/lib/cjs/render/MockRender.js.map +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/cjs/render/webgl/BatchState.js +1 -1
- package/lib/cjs/render/webgl/BatchState.js.map +1 -1
- package/lib/cjs/render/webgl/ColorInfo.js +2 -2
- package/lib/cjs/render/webgl/ColorInfo.js.map +1 -1
- package/lib/cjs/render/webgl/Diagnostics.js +4 -4
- package/lib/cjs/render/webgl/Diagnostics.js.map +1 -1
- package/lib/cjs/render/webgl/DrawCommand.js +4 -4
- package/lib/cjs/render/webgl/DrawCommand.js.map +1 -1
- package/lib/cjs/render/webgl/IModelFrameLifecycle.js +4 -4
- package/lib/cjs/render/webgl/IModelFrameLifecycle.js.map +1 -1
- package/lib/cjs/render/webgl/InstancedGeometry.js +3 -3
- package/lib/cjs/render/webgl/InstancedGeometry.js.map +1 -1
- package/lib/cjs/render/webgl/Material.js +4 -4
- package/lib/cjs/render/webgl/Material.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/cjs/render/webgl/RenderState.js +1 -1
- package/lib/cjs/render/webgl/RenderState.js.map +1 -1
- package/lib/cjs/render/webgl/Target.js +1 -1
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/render/webgl/Technique.js +39 -39
- package/lib/cjs/render/webgl/Technique.js.map +1 -1
- package/lib/cjs/render/webgl/TechniqueFlags.js +1 -1
- package/lib/cjs/render/webgl/TechniqueFlags.js.map +1 -1
- package/lib/cjs/render/webgl/Texture.js +3 -3
- package/lib/cjs/render/webgl/Texture.js.map +1 -1
- package/lib/cjs/tile/CesiumAssetProvider.js +1 -1
- package/lib/cjs/tile/CesiumAssetProvider.js.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.js +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.js +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +6 -6
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +7 -7
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapTile.js +8 -8
- package/lib/cjs/tile/map/MapTile.js.map +1 -1
- package/lib/cjs/tile/map/MapTileAvailability.js +1 -1
- package/lib/cjs/tile/map/MapTileAvailability.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +9 -9
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/cjs/tile/map/WmsCapabilities.js +2 -2
- package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.js +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/cjs/tools/AccuDrawTool.js +21 -21
- package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
- package/lib/cjs/tools/ClipViewTool.js +32 -32
- package/lib/cjs/tools/ClipViewTool.js.map +1 -1
- package/lib/cjs/tools/EditManipulator.js +2 -2
- package/lib/cjs/tools/EditManipulator.js.map +1 -1
- package/lib/cjs/tools/IdleTool.js +2 -2
- package/lib/cjs/tools/IdleTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTool.js +34 -34
- package/lib/cjs/tools/MeasureTool.js.map +1 -1
- package/lib/cjs/tools/SelectTool.js +5 -5
- package/lib/cjs/tools/SelectTool.js.map +1 -1
- package/lib/cjs/tools/Tool.js +10 -10
- package/lib/cjs/tools/Tool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +19 -19
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ToolAssistance.js +19 -19
- package/lib/cjs/tools/ToolAssistance.js.map +1 -1
- package/lib/cjs/tools/ToolSettings.js +63 -63
- package/lib/cjs/tools/ToolSettings.js.map +1 -1
- package/lib/cjs/tools/ViewTool.js +37 -37
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuDraw.js +1 -1
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.js +1 -1
- package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
- package/lib/esm/BackgroundMapGeometry.js +5 -5
- package/lib/esm/BackgroundMapGeometry.js.map +1 -1
- package/lib/esm/DrawingViewState.js +9 -9
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/GraphicalEditingScope.js +4 -4
- package/lib/esm/GraphicalEditingScope.js.map +1 -1
- package/lib/esm/IModelApp.js +61 -63
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.js +10 -10
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/IModelRoutingContext.js +1 -1
- package/lib/esm/IModelRoutingContext.js.map +1 -1
- package/lib/esm/IpcApp.js +2 -2
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/LocalhostIpcApp.js +1 -1
- package/lib/esm/LocalhostIpcApp.js.map +1 -1
- package/lib/esm/NativeApp.js +15 -17
- package/lib/esm/NativeApp.js.map +1 -1
- package/lib/esm/NativeAppLogger.js +1 -1
- package/lib/esm/NativeAppLogger.js.map +1 -1
- package/lib/esm/NoRenderApp.js +1 -1
- package/lib/esm/NoRenderApp.js.map +1 -1
- package/lib/esm/SelectionSet.js +148 -156
- package/lib/esm/SelectionSet.js.map +1 -1
- package/lib/esm/Sprites.js +1 -1
- package/lib/esm/Sprites.js.map +1 -1
- package/lib/esm/ViewCreator2d.js +3 -3
- package/lib/esm/ViewCreator2d.js.map +1 -1
- package/lib/esm/ViewGlobalLocation.js +5 -5
- package/lib/esm/ViewGlobalLocation.js.map +1 -1
- package/lib/esm/ViewState.js +2 -2
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/ViewingSpace.js +9 -9
- package/lib/esm/ViewingSpace.js.map +1 -1
- package/lib/esm/Viewport.js +41 -41
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/common/internal/render/DisplayParams.js +1 -1
- package/lib/esm/common/internal/render/DisplayParams.js.map +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionContextImpl.js +1 -1
- package/lib/esm/common/internal/render/GraphicDescriptionContextImpl.js.map +1 -1
- package/lib/esm/internal/render/PrimitiveBuilder.js +1 -1
- package/lib/esm/internal/render/PrimitiveBuilder.js.map +1 -1
- package/lib/esm/internal/render/RenderInstancesParamsImpl.js +1 -1
- package/lib/esm/internal/render/RenderInstancesParamsImpl.js.map +1 -1
- package/lib/esm/render/MockRender.js +3 -3
- package/lib/esm/render/MockRender.js.map +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/esm/render/webgl/BatchState.js +1 -1
- package/lib/esm/render/webgl/BatchState.js.map +1 -1
- package/lib/esm/render/webgl/ColorInfo.js +2 -2
- package/lib/esm/render/webgl/ColorInfo.js.map +1 -1
- package/lib/esm/render/webgl/Diagnostics.js +4 -4
- package/lib/esm/render/webgl/Diagnostics.js.map +1 -1
- package/lib/esm/render/webgl/DrawCommand.js +4 -4
- package/lib/esm/render/webgl/DrawCommand.js.map +1 -1
- package/lib/esm/render/webgl/IModelFrameLifecycle.js +4 -4
- package/lib/esm/render/webgl/IModelFrameLifecycle.js.map +1 -1
- package/lib/esm/render/webgl/InstancedGeometry.js +3 -3
- package/lib/esm/render/webgl/InstancedGeometry.js.map +1 -1
- package/lib/esm/render/webgl/Material.js +4 -4
- package/lib/esm/render/webgl/Material.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/esm/render/webgl/RenderState.js +1 -1
- package/lib/esm/render/webgl/RenderState.js.map +1 -1
- package/lib/esm/render/webgl/Target.js +1 -1
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/render/webgl/Technique.js +39 -39
- package/lib/esm/render/webgl/Technique.js.map +1 -1
- package/lib/esm/render/webgl/TechniqueFlags.js +1 -1
- package/lib/esm/render/webgl/TechniqueFlags.js.map +1 -1
- package/lib/esm/render/webgl/Texture.js +3 -3
- package/lib/esm/render/webgl/Texture.js.map +1 -1
- package/lib/esm/tile/CesiumAssetProvider.js +1 -1
- package/lib/esm/tile/CesiumAssetProvider.js.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.js +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.js +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +6 -6
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +2 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +7 -7
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapTile.js +8 -8
- package/lib/esm/tile/map/MapTile.js.map +1 -1
- package/lib/esm/tile/map/MapTileAvailability.js +1 -1
- package/lib/esm/tile/map/MapTileAvailability.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +9 -9
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/esm/tile/map/WmsCapabilities.js +2 -2
- package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.js +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/esm/tools/AccuDrawTool.js +21 -21
- package/lib/esm/tools/AccuDrawTool.js.map +1 -1
- package/lib/esm/tools/ClipViewTool.js +32 -32
- package/lib/esm/tools/ClipViewTool.js.map +1 -1
- package/lib/esm/tools/EditManipulator.js +2 -2
- package/lib/esm/tools/EditManipulator.js.map +1 -1
- package/lib/esm/tools/IdleTool.js +2 -2
- package/lib/esm/tools/IdleTool.js.map +1 -1
- package/lib/esm/tools/MeasureTool.js +34 -34
- package/lib/esm/tools/MeasureTool.js.map +1 -1
- package/lib/esm/tools/SelectTool.js +5 -5
- package/lib/esm/tools/SelectTool.js.map +1 -1
- package/lib/esm/tools/Tool.js +10 -10
- package/lib/esm/tools/Tool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +19 -19
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ToolAssistance.js +19 -19
- package/lib/esm/tools/ToolAssistance.js.map +1 -1
- package/lib/esm/tools/ToolSettings.js +63 -63
- package/lib/esm/tools/ToolSettings.js.map +1 -1
- package/lib/esm/tools/ViewTool.js +37 -37
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +18 -18
package/lib/cjs/SelectionSet.js
CHANGED
|
@@ -3,18 +3,6 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
9
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10
|
-
};
|
|
11
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
-
};
|
|
17
|
-
var _HiliteSet_instances, _HiliteSet_mode, _HiliteSet_selectionChangesListener, _HiliteSet_changing, _HiliteSet_onChanged, _HiliteSet_change, _HiliteSet_processSelectionSetEvent, _SelectionSet_instances, _SelectionSet_selection, _SelectionSet_sendChangedEvent, _SelectionSet_add, _SelectionSet_remove;
|
|
18
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
7
|
exports.SelectionSet = exports.HiliteSet = exports.SelectionSetEventType = void 0;
|
|
20
8
|
/** @packageDocumentation
|
|
@@ -81,6 +69,9 @@ class HilitedIds extends core_bentley_1.Id64.Uint32Set {
|
|
|
81
69
|
* @extensions
|
|
82
70
|
*/
|
|
83
71
|
class HiliteSet {
|
|
72
|
+
#mode;
|
|
73
|
+
#selectionChangesListener;
|
|
74
|
+
#changing;
|
|
84
75
|
/** Controls how the sets of hilited [[models]] and [[subcategories]] interact with one another.
|
|
85
76
|
* By default they are treated as a union: a [Feature]($common) is hilited if either its model **or** its subcategory is hilited.
|
|
86
77
|
* This can be changed to an intersection such that a [Feature]($common) is hilited only if both its model **and** subcategory are hilited.
|
|
@@ -88,30 +79,28 @@ class HiliteSet {
|
|
|
88
79
|
* [[elements]] is always hilited regardless of its model or subcategories.
|
|
89
80
|
*/
|
|
90
81
|
get modelSubCategoryMode() {
|
|
91
|
-
return
|
|
82
|
+
return this.#mode;
|
|
92
83
|
}
|
|
93
84
|
set modelSubCategoryMode(mode) {
|
|
94
|
-
if (mode ===
|
|
85
|
+
if (mode === this.#mode) {
|
|
95
86
|
return;
|
|
96
87
|
}
|
|
97
88
|
this.onModelSubCategoryModeChanged.raiseEvent(mode);
|
|
98
|
-
|
|
89
|
+
this.#mode = mode;
|
|
99
90
|
}
|
|
100
91
|
/** Construct a HiliteSet
|
|
101
92
|
* @param iModel The iModel containing the entities to be hilited.
|
|
102
93
|
* @param syncWithSelectionSet If true, the hilite set contents will be synchronized with those in the `iModel`'s [[SelectionSet]].
|
|
103
94
|
*/
|
|
104
95
|
constructor(iModel, syncWithSelectionSet = true) {
|
|
105
|
-
_HiliteSet_instances.add(this);
|
|
106
96
|
this.iModel = iModel;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
_HiliteSet_changing.set(this, false);
|
|
97
|
+
this.#mode = "union";
|
|
98
|
+
this.#changing = false;
|
|
110
99
|
/** Event raised just before changing the value of [[modelSubCategoryMode]]. */
|
|
111
100
|
this.onModelSubCategoryModeChanged = new core_bentley_1.BeEvent();
|
|
112
|
-
this.elements = new HilitedIds((func) =>
|
|
113
|
-
this.subcategories = new HilitedIds((func) =>
|
|
114
|
-
this.models = new HilitedIds((func) =>
|
|
101
|
+
this.elements = new HilitedIds((func) => this.#change(func));
|
|
102
|
+
this.subcategories = new HilitedIds((func) => this.#change(func));
|
|
103
|
+
this.models = new HilitedIds((func) => this.#change(func));
|
|
115
104
|
this.wantSyncWithSelectionSet = syncWithSelectionSet;
|
|
116
105
|
}
|
|
117
106
|
/** Control whether the hilite set will be synchronized with the contents of the [[SelectionSet]].
|
|
@@ -120,7 +109,7 @@ class HiliteSet {
|
|
|
120
109
|
* 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.
|
|
121
110
|
*/
|
|
122
111
|
get wantSyncWithSelectionSet() {
|
|
123
|
-
return !!
|
|
112
|
+
return !!this.#selectionChangesListener;
|
|
124
113
|
}
|
|
125
114
|
set wantSyncWithSelectionSet(want) {
|
|
126
115
|
if (want === this.wantSyncWithSelectionSet) {
|
|
@@ -128,17 +117,47 @@ class HiliteSet {
|
|
|
128
117
|
}
|
|
129
118
|
if (want) {
|
|
130
119
|
const set = this.iModel.selectionSet;
|
|
131
|
-
|
|
120
|
+
this.#selectionChangesListener = set.onChanged.addListener((ev) => this.#processSelectionSetEvent(ev));
|
|
132
121
|
this.add(set.active);
|
|
133
122
|
}
|
|
134
123
|
else {
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
this.#selectionChangesListener();
|
|
125
|
+
this.#selectionChangesListener = undefined;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
#onChanged() {
|
|
129
|
+
if (!this.#changing) {
|
|
130
|
+
IModelApp_1.IModelApp.viewManager.onSelectionSetChanged(this.iModel);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
#change(func) {
|
|
134
|
+
const changing = this.#changing;
|
|
135
|
+
this.#changing = true;
|
|
136
|
+
try {
|
|
137
|
+
func();
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
this.#changing = changing;
|
|
141
|
+
}
|
|
142
|
+
this.#onChanged();
|
|
143
|
+
}
|
|
144
|
+
#processSelectionSetEvent(ev) {
|
|
145
|
+
switch (ev.type) {
|
|
146
|
+
case SelectionSetEventType.Add:
|
|
147
|
+
return this.add(ev.additions);
|
|
148
|
+
case SelectionSetEventType.Replace:
|
|
149
|
+
return this.#change(() => {
|
|
150
|
+
this.add(ev.additions);
|
|
151
|
+
this.remove(ev.removals);
|
|
152
|
+
});
|
|
153
|
+
case SelectionSetEventType.Remove:
|
|
154
|
+
case SelectionSetEventType.Clear:
|
|
155
|
+
return this.remove(ev.removals);
|
|
137
156
|
}
|
|
138
157
|
}
|
|
139
158
|
/** Adds a collection of geometric element, model and subcategory ids to this hilite set. */
|
|
140
159
|
add(additions) {
|
|
141
|
-
|
|
160
|
+
this.#change(() => {
|
|
142
161
|
additions.elements && this.elements.addIds(additions.elements);
|
|
143
162
|
additions.models && this.models.addIds(additions.models);
|
|
144
163
|
additions.subcategories && this.subcategories.addIds(additions.subcategories);
|
|
@@ -146,7 +165,7 @@ class HiliteSet {
|
|
|
146
165
|
}
|
|
147
166
|
/** Removes a collection of geometric element, model and subcategory ids from this hilite set. */
|
|
148
167
|
remove(removals) {
|
|
149
|
-
|
|
168
|
+
this.#change(() => {
|
|
150
169
|
removals.elements && this.elements.deleteIds(removals.elements);
|
|
151
170
|
removals.models && this.models.deleteIds(removals.models);
|
|
152
171
|
removals.subcategories && this.subcategories.deleteIds(removals.subcategories);
|
|
@@ -154,14 +173,14 @@ class HiliteSet {
|
|
|
154
173
|
}
|
|
155
174
|
/** Replaces ids currently in the hilite set with the given collection. */
|
|
156
175
|
replace(ids) {
|
|
157
|
-
|
|
176
|
+
this.#change(() => {
|
|
158
177
|
this.clear();
|
|
159
178
|
this.add(ids);
|
|
160
179
|
});
|
|
161
180
|
}
|
|
162
181
|
/** Remove all elements from the hilited set. */
|
|
163
182
|
clear() {
|
|
164
|
-
|
|
183
|
+
this.#change(() => {
|
|
165
184
|
this.elements.clear();
|
|
166
185
|
this.models.clear();
|
|
167
186
|
this.subcategories.clear();
|
|
@@ -186,34 +205,6 @@ class HiliteSet {
|
|
|
186
205
|
}
|
|
187
206
|
}
|
|
188
207
|
exports.HiliteSet = HiliteSet;
|
|
189
|
-
_HiliteSet_mode = new WeakMap(), _HiliteSet_selectionChangesListener = new WeakMap(), _HiliteSet_changing = new WeakMap(), _HiliteSet_instances = new WeakSet(), _HiliteSet_onChanged = function _HiliteSet_onChanged() {
|
|
190
|
-
if (!__classPrivateFieldGet(this, _HiliteSet_changing, "f")) {
|
|
191
|
-
IModelApp_1.IModelApp.viewManager.onSelectionSetChanged(this.iModel);
|
|
192
|
-
}
|
|
193
|
-
}, _HiliteSet_change = function _HiliteSet_change(func) {
|
|
194
|
-
const changing = __classPrivateFieldGet(this, _HiliteSet_changing, "f");
|
|
195
|
-
__classPrivateFieldSet(this, _HiliteSet_changing, true, "f");
|
|
196
|
-
try {
|
|
197
|
-
func();
|
|
198
|
-
}
|
|
199
|
-
finally {
|
|
200
|
-
__classPrivateFieldSet(this, _HiliteSet_changing, changing, "f");
|
|
201
|
-
}
|
|
202
|
-
__classPrivateFieldGet(this, _HiliteSet_instances, "m", _HiliteSet_onChanged).call(this);
|
|
203
|
-
}, _HiliteSet_processSelectionSetEvent = function _HiliteSet_processSelectionSetEvent(ev) {
|
|
204
|
-
switch (ev.type) {
|
|
205
|
-
case SelectionSetEventType.Add:
|
|
206
|
-
return this.add(ev.additions);
|
|
207
|
-
case SelectionSetEventType.Replace:
|
|
208
|
-
return __classPrivateFieldGet(this, _HiliteSet_instances, "m", _HiliteSet_change).call(this, () => {
|
|
209
|
-
this.add(ev.additions);
|
|
210
|
-
this.remove(ev.removals);
|
|
211
|
-
});
|
|
212
|
-
case SelectionSetEventType.Remove:
|
|
213
|
-
case SelectionSetEventType.Clear:
|
|
214
|
-
return this.remove(ev.removals);
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
208
|
/** A set of *currently selected* geometric elements, models and subcategories for an `IModelConnection`.
|
|
218
209
|
* Generally, selected elements are displayed with a customizable hilite effect within a [[Viewport]], see [[HiliteSet]].
|
|
219
210
|
* @see [Hilite.Settings]($common) for customization of the hilite effect.
|
|
@@ -221,41 +212,44 @@ _HiliteSet_mode = new WeakMap(), _HiliteSet_selectionChangesListener = new WeakM
|
|
|
221
212
|
* @extensions
|
|
222
213
|
*/
|
|
223
214
|
class SelectionSet {
|
|
215
|
+
#selection;
|
|
224
216
|
/** The IDs of the selected elements.
|
|
225
217
|
* @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].
|
|
226
218
|
*/
|
|
227
219
|
get elements() {
|
|
228
|
-
return
|
|
220
|
+
return this.#selection.elements;
|
|
229
221
|
}
|
|
230
222
|
/** The IDs of the selected models.
|
|
231
223
|
* @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].
|
|
232
224
|
*/
|
|
233
225
|
get models() {
|
|
234
|
-
return
|
|
226
|
+
return this.#selection.models;
|
|
235
227
|
}
|
|
236
228
|
/** The IDs of the selected subcategories.
|
|
237
229
|
* @note Do not modify this set directly. Instead, use methods like [[SelectionSet.add]].
|
|
238
230
|
*/
|
|
239
231
|
get subcategories() {
|
|
240
|
-
return
|
|
232
|
+
return this.#selection.subcategories;
|
|
241
233
|
}
|
|
242
234
|
/** Get the active selection as a collection of geometric element, model and subcategory ids.
|
|
243
235
|
* @note Do not modify the sets in returned collection directly. Instead, use methods like [[SelectionSet.add]].
|
|
244
236
|
*/
|
|
245
237
|
get active() {
|
|
246
|
-
return { ...
|
|
238
|
+
return { ...this.#selection };
|
|
247
239
|
}
|
|
248
240
|
constructor(iModel) {
|
|
249
|
-
_SelectionSet_instances.add(this);
|
|
250
241
|
this.iModel = iModel;
|
|
251
|
-
_SelectionSet_selection.set(this, void 0);
|
|
252
242
|
/** Called whenever ids are added or removed from this `SelectionSet` */
|
|
253
243
|
this.onChanged = new core_bentley_1.BeEvent();
|
|
254
|
-
|
|
244
|
+
this.#selection = {
|
|
255
245
|
elements: new Set(),
|
|
256
246
|
models: new Set(),
|
|
257
247
|
subcategories: new Set(),
|
|
258
|
-
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
#sendChangedEvent(ev) {
|
|
251
|
+
IModelApp_1.IModelApp.viewManager.onSelectionSetChanged(this.iModel);
|
|
252
|
+
this.onChanged.raiseEvent(ev);
|
|
259
253
|
}
|
|
260
254
|
/** Get the number of entries in this selection set. */
|
|
261
255
|
get size() {
|
|
@@ -286,13 +280,13 @@ class SelectionSet {
|
|
|
286
280
|
if (!this.isActive) {
|
|
287
281
|
return;
|
|
288
282
|
}
|
|
289
|
-
const removals =
|
|
290
|
-
|
|
283
|
+
const removals = this.#selection;
|
|
284
|
+
this.#selection = {
|
|
291
285
|
elements: new Set(),
|
|
292
286
|
models: new Set(),
|
|
293
287
|
subcategories: new Set(),
|
|
294
|
-
}
|
|
295
|
-
|
|
288
|
+
};
|
|
289
|
+
this.#sendChangedEvent({ set: this, type: SelectionSetEventType.Clear, removals, removed: removals.elements });
|
|
296
290
|
}
|
|
297
291
|
/**
|
|
298
292
|
* Add one or more Ids to the current selection set.
|
|
@@ -300,7 +294,42 @@ class SelectionSet {
|
|
|
300
294
|
* @returns true if any elements were added.
|
|
301
295
|
*/
|
|
302
296
|
add(adds) {
|
|
303
|
-
return !!
|
|
297
|
+
return !!this.#add(adds);
|
|
298
|
+
}
|
|
299
|
+
#add(adds, sendEvent = true) {
|
|
300
|
+
const oldSize = this.size;
|
|
301
|
+
const additions = {};
|
|
302
|
+
forEachSelectableType({
|
|
303
|
+
ids: adds,
|
|
304
|
+
elements: (elementIds) => addIds({
|
|
305
|
+
target: this.#selection.elements,
|
|
306
|
+
ids: elementIds,
|
|
307
|
+
onAdd: (id) => (additions.elements ??= []).push(id),
|
|
308
|
+
}),
|
|
309
|
+
models: (modelIds) => addIds({
|
|
310
|
+
target: this.#selection.models,
|
|
311
|
+
ids: modelIds,
|
|
312
|
+
onAdd: (id) => (additions.models ??= []).push(id),
|
|
313
|
+
}),
|
|
314
|
+
subcategories: (subcategoryIds) => addIds({
|
|
315
|
+
target: this.#selection.subcategories,
|
|
316
|
+
ids: subcategoryIds,
|
|
317
|
+
onAdd: (id) => (additions.subcategories ??= []).push(id),
|
|
318
|
+
}),
|
|
319
|
+
});
|
|
320
|
+
const changed = oldSize !== this.size;
|
|
321
|
+
if (!changed) {
|
|
322
|
+
return undefined;
|
|
323
|
+
}
|
|
324
|
+
if (sendEvent) {
|
|
325
|
+
this.#sendChangedEvent({
|
|
326
|
+
type: SelectionSetEventType.Add,
|
|
327
|
+
set: this,
|
|
328
|
+
additions,
|
|
329
|
+
added: additions.elements ?? [],
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
return additions;
|
|
304
333
|
}
|
|
305
334
|
/**
|
|
306
335
|
* Remove one or more Ids from the current selection set.
|
|
@@ -308,19 +337,54 @@ class SelectionSet {
|
|
|
308
337
|
* @returns true if any elements were removed.
|
|
309
338
|
*/
|
|
310
339
|
remove(removes) {
|
|
311
|
-
return !!
|
|
340
|
+
return !!this.#remove(removes);
|
|
341
|
+
}
|
|
342
|
+
#remove(removes, sendEvent = true) {
|
|
343
|
+
const oldSize = this.size;
|
|
344
|
+
const removals = {};
|
|
345
|
+
forEachSelectableType({
|
|
346
|
+
ids: removes,
|
|
347
|
+
elements: (elementIds) => removeIds({
|
|
348
|
+
target: this.#selection.elements,
|
|
349
|
+
ids: elementIds,
|
|
350
|
+
onRemove: (id) => (removals.elements ??= []).push(id),
|
|
351
|
+
}),
|
|
352
|
+
models: (modelIds) => removeIds({
|
|
353
|
+
target: this.#selection.models,
|
|
354
|
+
ids: modelIds,
|
|
355
|
+
onRemove: (id) => (removals.models ??= []).push(id),
|
|
356
|
+
}),
|
|
357
|
+
subcategories: (subcategoryIds) => removeIds({
|
|
358
|
+
target: this.#selection.subcategories,
|
|
359
|
+
ids: subcategoryIds,
|
|
360
|
+
onRemove: (id) => (removals.subcategories ??= []).push(id),
|
|
361
|
+
}),
|
|
362
|
+
});
|
|
363
|
+
const changed = oldSize !== this.size;
|
|
364
|
+
if (!changed) {
|
|
365
|
+
return undefined;
|
|
366
|
+
}
|
|
367
|
+
if (sendEvent) {
|
|
368
|
+
this.#sendChangedEvent({
|
|
369
|
+
type: SelectionSetEventType.Remove,
|
|
370
|
+
set: this,
|
|
371
|
+
removals,
|
|
372
|
+
removed: removals.elements ?? [],
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return removals;
|
|
312
376
|
}
|
|
313
377
|
/**
|
|
314
378
|
* Add one set of Ids, and remove another set of Ids. Any Ids that are in both sets are removed.
|
|
315
379
|
* @returns True if any Ids were either added or removed.
|
|
316
380
|
*/
|
|
317
381
|
addAndRemove(adds, removes) {
|
|
318
|
-
const additions =
|
|
319
|
-
const removals =
|
|
382
|
+
const additions = this.#add(adds, false);
|
|
383
|
+
const removals = this.#remove(removes, false);
|
|
320
384
|
const addedElements = additions?.elements ?? [];
|
|
321
385
|
const removedElements = removals?.elements ?? [];
|
|
322
386
|
if (additions && removals) {
|
|
323
|
-
|
|
387
|
+
this.#sendChangedEvent({
|
|
324
388
|
type: SelectionSetEventType.Replace,
|
|
325
389
|
set: this,
|
|
326
390
|
additions,
|
|
@@ -330,7 +394,7 @@ class SelectionSet {
|
|
|
330
394
|
});
|
|
331
395
|
}
|
|
332
396
|
else if (additions) {
|
|
333
|
-
|
|
397
|
+
this.#sendChangedEvent({
|
|
334
398
|
type: SelectionSetEventType.Add,
|
|
335
399
|
set: this,
|
|
336
400
|
additions,
|
|
@@ -338,7 +402,7 @@ class SelectionSet {
|
|
|
338
402
|
});
|
|
339
403
|
}
|
|
340
404
|
else if (removals) {
|
|
341
|
-
|
|
405
|
+
this.#sendChangedEvent({
|
|
342
406
|
type: SelectionSetEventType.Remove,
|
|
343
407
|
set: this,
|
|
344
408
|
removals,
|
|
@@ -373,20 +437,20 @@ class SelectionSet {
|
|
|
373
437
|
}
|
|
374
438
|
/** Change selection set to be the supplied set of Ids. */
|
|
375
439
|
replace(ids) {
|
|
376
|
-
if (areEqual(
|
|
440
|
+
if (areEqual(this.#selection, ids)) {
|
|
377
441
|
return false;
|
|
378
442
|
}
|
|
379
|
-
const previousSelection =
|
|
380
|
-
|
|
443
|
+
const previousSelection = this.#selection;
|
|
444
|
+
this.#selection = {
|
|
381
445
|
elements: new Set(),
|
|
382
446
|
models: new Set(),
|
|
383
447
|
subcategories: new Set(),
|
|
384
|
-
}
|
|
385
|
-
|
|
448
|
+
};
|
|
449
|
+
this.#add(ids, false);
|
|
386
450
|
const additions = {};
|
|
387
451
|
const removals = {};
|
|
388
452
|
forEachSelectableType({
|
|
389
|
-
ids:
|
|
453
|
+
ids: this.#selection,
|
|
390
454
|
elements: (elementIds) => {
|
|
391
455
|
removeIds({
|
|
392
456
|
target: previousSelection.elements,
|
|
@@ -418,7 +482,7 @@ class SelectionSet {
|
|
|
418
482
|
}
|
|
419
483
|
},
|
|
420
484
|
});
|
|
421
|
-
|
|
485
|
+
this.#sendChangedEvent({
|
|
422
486
|
type: SelectionSetEventType.Replace,
|
|
423
487
|
set: this,
|
|
424
488
|
additions,
|
|
@@ -430,78 +494,6 @@ class SelectionSet {
|
|
|
430
494
|
}
|
|
431
495
|
}
|
|
432
496
|
exports.SelectionSet = SelectionSet;
|
|
433
|
-
_SelectionSet_selection = new WeakMap(), _SelectionSet_instances = new WeakSet(), _SelectionSet_sendChangedEvent = function _SelectionSet_sendChangedEvent(ev) {
|
|
434
|
-
IModelApp_1.IModelApp.viewManager.onSelectionSetChanged(this.iModel);
|
|
435
|
-
this.onChanged.raiseEvent(ev);
|
|
436
|
-
}, _SelectionSet_add = function _SelectionSet_add(adds, sendEvent = true) {
|
|
437
|
-
const oldSize = this.size;
|
|
438
|
-
const additions = {};
|
|
439
|
-
forEachSelectableType({
|
|
440
|
-
ids: adds,
|
|
441
|
-
elements: (elementIds) => addIds({
|
|
442
|
-
target: __classPrivateFieldGet(this, _SelectionSet_selection, "f").elements,
|
|
443
|
-
ids: elementIds,
|
|
444
|
-
onAdd: (id) => (additions.elements ??= []).push(id),
|
|
445
|
-
}),
|
|
446
|
-
models: (modelIds) => addIds({
|
|
447
|
-
target: __classPrivateFieldGet(this, _SelectionSet_selection, "f").models,
|
|
448
|
-
ids: modelIds,
|
|
449
|
-
onAdd: (id) => (additions.models ??= []).push(id),
|
|
450
|
-
}),
|
|
451
|
-
subcategories: (subcategoryIds) => addIds({
|
|
452
|
-
target: __classPrivateFieldGet(this, _SelectionSet_selection, "f").subcategories,
|
|
453
|
-
ids: subcategoryIds,
|
|
454
|
-
onAdd: (id) => (additions.subcategories ??= []).push(id),
|
|
455
|
-
}),
|
|
456
|
-
});
|
|
457
|
-
const changed = oldSize !== this.size;
|
|
458
|
-
if (!changed) {
|
|
459
|
-
return undefined;
|
|
460
|
-
}
|
|
461
|
-
if (sendEvent) {
|
|
462
|
-
__classPrivateFieldGet(this, _SelectionSet_instances, "m", _SelectionSet_sendChangedEvent).call(this, {
|
|
463
|
-
type: SelectionSetEventType.Add,
|
|
464
|
-
set: this,
|
|
465
|
-
additions,
|
|
466
|
-
added: additions.elements ?? [],
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
return additions;
|
|
470
|
-
}, _SelectionSet_remove = function _SelectionSet_remove(removes, sendEvent = true) {
|
|
471
|
-
const oldSize = this.size;
|
|
472
|
-
const removals = {};
|
|
473
|
-
forEachSelectableType({
|
|
474
|
-
ids: removes,
|
|
475
|
-
elements: (elementIds) => removeIds({
|
|
476
|
-
target: __classPrivateFieldGet(this, _SelectionSet_selection, "f").elements,
|
|
477
|
-
ids: elementIds,
|
|
478
|
-
onRemove: (id) => (removals.elements ??= []).push(id),
|
|
479
|
-
}),
|
|
480
|
-
models: (modelIds) => removeIds({
|
|
481
|
-
target: __classPrivateFieldGet(this, _SelectionSet_selection, "f").models,
|
|
482
|
-
ids: modelIds,
|
|
483
|
-
onRemove: (id) => (removals.models ??= []).push(id),
|
|
484
|
-
}),
|
|
485
|
-
subcategories: (subcategoryIds) => removeIds({
|
|
486
|
-
target: __classPrivateFieldGet(this, _SelectionSet_selection, "f").subcategories,
|
|
487
|
-
ids: subcategoryIds,
|
|
488
|
-
onRemove: (id) => (removals.subcategories ??= []).push(id),
|
|
489
|
-
}),
|
|
490
|
-
});
|
|
491
|
-
const changed = oldSize !== this.size;
|
|
492
|
-
if (!changed) {
|
|
493
|
-
return undefined;
|
|
494
|
-
}
|
|
495
|
-
if (sendEvent) {
|
|
496
|
-
__classPrivateFieldGet(this, _SelectionSet_instances, "m", _SelectionSet_sendChangedEvent).call(this, {
|
|
497
|
-
type: SelectionSetEventType.Remove,
|
|
498
|
-
set: this,
|
|
499
|
-
removals,
|
|
500
|
-
removed: removals.elements ?? [],
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
return removals;
|
|
504
|
-
};
|
|
505
497
|
function forEachSelectableType({ ids, elements, models, subcategories, }) {
|
|
506
498
|
if (typeof ids === "string" || Array.isArray(ids) || ids instanceof Set) {
|
|
507
499
|
elements(ids);
|