@itwin/core-frontend 5.9.0-dev.8 → 5.10.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/lib/cjs/BriefcaseTxns.d.ts +58 -1
- package/lib/cjs/BriefcaseTxns.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTxns.js +65 -0
- package/lib/cjs/BriefcaseTxns.js.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.js +83 -81
- package/lib/cjs/PerModelCategoryVisibility.js.map +1 -1
- package/lib/cjs/SpatialViewState.d.ts.map +1 -1
- package/lib/cjs/SpatialViewState.js +3 -1
- package/lib/cjs/SpatialViewState.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +32 -0
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +41 -4
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +119 -22
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +261 -59
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +20 -1
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +75 -7
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ToolSettings.d.ts +4 -0
- package/lib/cjs/tools/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/tools/ToolSettings.js +4 -0
- package/lib/cjs/tools/ToolSettings.js.map +1 -1
- package/lib/esm/BriefcaseTxns.d.ts +58 -1
- package/lib/esm/BriefcaseTxns.d.ts.map +1 -1
- package/lib/esm/BriefcaseTxns.js +65 -0
- package/lib/esm/BriefcaseTxns.js.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.js +84 -82
- package/lib/esm/PerModelCategoryVisibility.js.map +1 -1
- package/lib/esm/SpatialViewState.d.ts.map +1 -1
- package/lib/esm/SpatialViewState.js +3 -1
- package/lib/esm/SpatialViewState.js.map +1 -1
- package/lib/esm/ViewState.d.ts +32 -0
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +42 -5
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +119 -22
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +263 -61
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +20 -1
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +77 -9
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ToolSettings.d.ts +4 -0
- package/lib/esm/tools/ToolSettings.d.ts.map +1 -1
- package/lib/esm/tools/ToolSettings.js +4 -0
- package/lib/esm/tools/ToolSettings.js.map +1 -1
- package/lib/public/locales/en/iModelJs.json +1 -0
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -20
package/lib/esm/ViewState.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { assert, BeEvent, dispose, expectDefined, Id64, JsonUtils } from "@itwin/core-bentley";
|
|
9
9
|
import { Angle, AxisOrder, Constant, Geometry, Map4d, Matrix3d, Plane3dByOriginAndUnitNormal, Point2d, Point3d, Range2d, Range3d, Ray3d, Transform, Vector2d, Vector3d, YawPitchRollAngles, } from "@itwin/core-geometry";
|
|
10
|
-
import { Camera, Cartographic, Frustum, GlobeMode, GridOrientationType, IModelReadRpcInterface, Npc, ViewDetails, ViewDetails3d, } from "@itwin/core-common";
|
|
10
|
+
import { Camera, Cartographic, Frustum, GlobeMode, GridOrientationType, IModelReadRpcInterface, Npc, resolveNavPropId, ViewDetails, ViewDetails3d, } from "@itwin/core-common";
|
|
11
11
|
import { AuxCoordSystem2dState, AuxCoordSystem3dState, AuxCoordSystemState } from "./AuxCoordSys";
|
|
12
12
|
import { DisplayStyle3dState } from "./DisplayStyleState";
|
|
13
13
|
import { ElementState } from "./EntityState";
|
|
@@ -175,8 +175,12 @@ export class ViewState extends ElementState {
|
|
|
175
175
|
/** Convert to JSON representation. */
|
|
176
176
|
toJSON() {
|
|
177
177
|
const json = super.toJSON();
|
|
178
|
-
json.
|
|
179
|
-
|
|
178
|
+
json.categorySelector = { id: this.categorySelector.id };
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
180
|
+
json.categorySelectorId = this.categorySelector.id; // for backward compatibility
|
|
181
|
+
json.displayStyle = { id: this.displayStyle.id };
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
183
|
+
json.displayStyleId = this.displayStyle.id; // for backward compatibility
|
|
180
184
|
json.isPrivate = this.isPrivate;
|
|
181
185
|
json.description = this.description;
|
|
182
186
|
return json;
|
|
@@ -283,10 +287,40 @@ export class ViewState extends ElementState {
|
|
|
283
287
|
func(ref);
|
|
284
288
|
}
|
|
285
289
|
}
|
|
290
|
+
/** Iterate all [[TileTreeReference]]s associated with this view.
|
|
291
|
+
* This is a superset of [[getRealityModelTreeRefs]], it includes non-reality models as well.
|
|
292
|
+
* @see [[getRealityModelTreeRefs]] for only reality model tile tree references.
|
|
293
|
+
*/
|
|
286
294
|
*getTileTreeRefs() {
|
|
287
295
|
yield* this.getModelTreeRefs();
|
|
288
296
|
yield* this.displayStyle.getTileTreeRefs();
|
|
289
297
|
}
|
|
298
|
+
/** Iterate the reality models in this view, including both context reality models attached to the
|
|
299
|
+
* [[DisplayStyleState]] and persistent reality models. Each yielded [[ViewRealityModel]] provides the
|
|
300
|
+
* [[TileTreeReference]] along with a display name and description when available.
|
|
301
|
+
*
|
|
302
|
+
* Context reality models that are marked invisible are excluded. Persistent reality models whose
|
|
303
|
+
* tile trees have not yet loaded are also excluded.
|
|
304
|
+
* @see [[DisplayStyleState.realityModels]] for context reality models only.
|
|
305
|
+
* @see [[getTileTreeRefs]] for all tile tree references in this view.
|
|
306
|
+
* @beta
|
|
307
|
+
*/
|
|
308
|
+
*getRealityModelTreeRefs() {
|
|
309
|
+
// Yield visible context reality models from the display style.
|
|
310
|
+
for (const model of this.displayStyle.realityModels) {
|
|
311
|
+
if (!model.invisible)
|
|
312
|
+
yield { treeRef: model.treeRef, name: model.name, description: model.description };
|
|
313
|
+
}
|
|
314
|
+
// Yield persistent reality models (e.g., ScalableMeshModel) from the model selector.
|
|
315
|
+
for (const ref of this.getModelTreeRefs()) {
|
|
316
|
+
const modelId = ref.treeOwner.tileTree?.modelId;
|
|
317
|
+
if (modelId !== undefined) {
|
|
318
|
+
const loadedModel = this.iModel.models.getLoaded(modelId);
|
|
319
|
+
if (loadedModel?.asSpatialModel?.isRealityModel)
|
|
320
|
+
yield { treeRef: ref, name: loadedModel.name, description: undefined };
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
290
324
|
/** Disclose *all* TileTrees currently in use by this view. This set may include trees not reported by [[forEachTileTreeRef]] - e.g., those used by view attachments, map-draped terrain, etc.
|
|
291
325
|
* @internal
|
|
292
326
|
*/
|
|
@@ -1799,7 +1833,8 @@ export class ViewState2d extends ViewState {
|
|
|
1799
1833
|
this.origin = Point2d.fromJSON(props.origin);
|
|
1800
1834
|
this.delta = Point2d.fromJSON(props.delta);
|
|
1801
1835
|
this.angle = Angle.fromJSON(props.angle);
|
|
1802
|
-
|
|
1836
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1837
|
+
this._baseModelId = Id64.fromJSON(resolveNavPropId(props.baseModel, props.baseModelId));
|
|
1803
1838
|
this._details = new ViewDetails(this.jsonProperties);
|
|
1804
1839
|
}
|
|
1805
1840
|
toJSON() {
|
|
@@ -1807,7 +1842,9 @@ export class ViewState2d extends ViewState {
|
|
|
1807
1842
|
val.origin = this.origin;
|
|
1808
1843
|
val.delta = this.delta;
|
|
1809
1844
|
val.angle = this.angle;
|
|
1810
|
-
val.
|
|
1845
|
+
val.baseModel = { id: this.baseModelId };
|
|
1846
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1847
|
+
val.baseModelId = this.baseModelId; // for backward compatibility
|
|
1811
1848
|
return val;
|
|
1812
1849
|
}
|
|
1813
1850
|
/** See [[ViewState.is3d]]. */
|