@itwin/core-frontend 4.5.0-dev.9 → 4.5.0
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 +79 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/AccuDraw.d.ts +6 -0
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +11 -0
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/ContextRealityModelState.d.ts +3 -0
- package/lib/cjs/ContextRealityModelState.d.ts.map +1 -1
- package/lib/cjs/ContextRealityModelState.js +8 -1
- package/lib/cjs/ContextRealityModelState.js.map +1 -1
- package/lib/cjs/IModelApp.js +1 -1
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/ModelState.d.ts +3 -2
- package/lib/cjs/ModelState.d.ts.map +1 -1
- package/lib/cjs/ModelState.js +2 -1
- package/lib/cjs/ModelState.js.map +1 -1
- package/lib/cjs/SpatialClassifiersState.d.ts +55 -0
- package/lib/cjs/SpatialClassifiersState.d.ts.map +1 -0
- package/lib/cjs/SpatialClassifiersState.js +47 -0
- package/lib/cjs/SpatialClassifiersState.js.map +1 -0
- package/lib/cjs/ViewContext.d.ts +3 -2
- package/lib/cjs/ViewContext.d.ts.map +1 -1
- package/lib/cjs/ViewContext.js.map +1 -1
- package/lib/cjs/ViewManager.d.ts.map +1 -1
- package/lib/cjs/ViewManager.js +4 -0
- package/lib/cjs/ViewManager.js.map +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +16 -8
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +2 -0
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +2 -0
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/render/GraphicBuilder.d.ts +2 -0
- package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBuilder.js.map +1 -1
- package/lib/cjs/render/MockRender.d.ts +1 -0
- package/lib/cjs/render/MockRender.d.ts.map +1 -1
- package/lib/cjs/render/MockRender.js +1 -0
- package/lib/cjs/render/MockRender.js.map +1 -1
- package/lib/cjs/render/RenderGraphic.d.ts +7 -0
- package/lib/cjs/render/RenderGraphic.d.ts.map +1 -1
- package/lib/cjs/render/RenderGraphic.js +2 -0
- package/lib/cjs/render/RenderGraphic.js.map +1 -1
- package/lib/cjs/render/RenderTarget.d.ts +3 -2
- package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
- package/lib/cjs/render/RenderTarget.js.map +1 -1
- package/lib/cjs/render/Scene.d.ts +2 -2
- package/lib/cjs/render/Scene.d.ts.map +1 -1
- package/lib/cjs/render/Scene.js.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts +3 -0
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
- package/lib/cjs/render/primitives/mesh/MeshBuilderMap.d.ts +3 -0
- package/lib/cjs/render/primitives/mesh/MeshBuilderMap.d.ts.map +1 -1
- package/lib/cjs/render/primitives/mesh/MeshBuilderMap.js +2 -0
- package/lib/cjs/render/primitives/mesh/MeshBuilderMap.js.map +1 -1
- package/lib/cjs/render/webgl/GLTimer.d.ts.map +1 -1
- package/lib/cjs/render/webgl/GLTimer.js +24 -4
- package/lib/cjs/render/webgl/GLTimer.js.map +1 -1
- package/lib/cjs/render/webgl/Graphic.d.ts +6 -1
- package/lib/cjs/render/webgl/Graphic.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Graphic.js +20 -0
- package/lib/cjs/render/webgl/Graphic.js.map +1 -1
- package/lib/cjs/render/webgl/Layer.d.ts +2 -0
- package/lib/cjs/render/webgl/Layer.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Layer.js +3 -0
- package/lib/cjs/render/webgl/Layer.js.map +1 -1
- package/lib/cjs/render/webgl/Mesh.d.ts +2 -0
- package/lib/cjs/render/webgl/Mesh.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Mesh.js +7 -0
- package/lib/cjs/render/webgl/Mesh.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts +3 -2
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/Primitive.d.ts +2 -0
- package/lib/cjs/render/webgl/Primitive.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Primitive.js +3 -0
- package/lib/cjs/render/webgl/Primitive.js.map +1 -1
- package/lib/cjs/render/webgl/Target.d.ts +4 -3
- package/lib/cjs/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/request/utils.d.ts +5 -0
- package/lib/cjs/request/utils.d.ts.map +1 -1
- package/lib/cjs/request/utils.js +11 -1
- package/lib/cjs/request/utils.js.map +1 -1
- package/lib/cjs/tile/BatchedTileIdMap.d.ts +6 -1
- package/lib/cjs/tile/BatchedTileIdMap.d.ts.map +1 -1
- package/lib/cjs/tile/BatchedTileIdMap.js +9 -0
- package/lib/cjs/tile/BatchedTileIdMap.js.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.d.ts +4 -4
- package/lib/cjs/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.js +11 -6
- package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
- package/lib/cjs/tile/GltfReader.js +1 -1
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.d.ts +1 -0
- package/lib/cjs/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.js +4 -0
- package/lib/cjs/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts +1 -0
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +34 -8
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts +5 -2
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +19 -0
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.d.ts +5 -0
- package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +1 -1
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/RenderGraphicTileTree.d.ts +34 -0
- package/lib/cjs/tile/RenderGraphicTileTree.d.ts.map +1 -0
- package/lib/cjs/tile/RenderGraphicTileTree.js +100 -0
- package/lib/cjs/tile/RenderGraphicTileTree.js.map +1 -0
- package/lib/cjs/tile/TileAdmin.d.ts +24 -1
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +15 -4
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +21 -2
- package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/TileTreeReference.js +26 -1
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/internal.d.ts +1 -0
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +1 -0
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerTileTreeReference.d.ts +1 -0
- package/lib/cjs/tile/map/MapLayerTileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerTileTreeReference.js +4 -0
- package/lib/cjs/tile/map/MapLayerTileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts +1 -0
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +20 -7
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTiledGraphicsProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTiledGraphicsProvider.js +16 -0
- package/lib/cjs/tile/map/MapTiledGraphicsProvider.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +2 -0
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +4 -0
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/AccuDraw.d.ts +6 -0
- package/lib/esm/AccuDraw.d.ts.map +1 -1
- package/lib/esm/AccuDraw.js +11 -0
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/ContextRealityModelState.d.ts +3 -0
- package/lib/esm/ContextRealityModelState.d.ts.map +1 -1
- package/lib/esm/ContextRealityModelState.js +8 -1
- package/lib/esm/ContextRealityModelState.js.map +1 -1
- package/lib/esm/IModelApp.js +1 -1
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/ModelState.d.ts +3 -2
- package/lib/esm/ModelState.d.ts.map +1 -1
- package/lib/esm/ModelState.js +3 -2
- package/lib/esm/ModelState.js.map +1 -1
- package/lib/esm/SpatialClassifiersState.d.ts +55 -0
- package/lib/esm/SpatialClassifiersState.d.ts.map +1 -0
- package/lib/esm/SpatialClassifiersState.js +43 -0
- package/lib/esm/SpatialClassifiersState.js.map +1 -0
- package/lib/esm/ViewContext.d.ts +3 -2
- package/lib/esm/ViewContext.d.ts.map +1 -1
- package/lib/esm/ViewContext.js.map +1 -1
- package/lib/esm/ViewManager.d.ts.map +1 -1
- package/lib/esm/ViewManager.js +4 -0
- package/lib/esm/ViewManager.js.map +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +16 -8
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +2 -0
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +2 -0
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/render/GraphicBuilder.d.ts +2 -0
- package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/esm/render/GraphicBuilder.js.map +1 -1
- package/lib/esm/render/MockRender.d.ts +1 -0
- package/lib/esm/render/MockRender.d.ts.map +1 -1
- package/lib/esm/render/MockRender.js +1 -0
- package/lib/esm/render/MockRender.js.map +1 -1
- package/lib/esm/render/RenderGraphic.d.ts +7 -0
- package/lib/esm/render/RenderGraphic.d.ts.map +1 -1
- package/lib/esm/render/RenderGraphic.js +2 -0
- package/lib/esm/render/RenderGraphic.js.map +1 -1
- package/lib/esm/render/RenderTarget.d.ts +3 -2
- package/lib/esm/render/RenderTarget.d.ts.map +1 -1
- package/lib/esm/render/RenderTarget.js.map +1 -1
- package/lib/esm/render/Scene.d.ts +2 -2
- package/lib/esm/render/Scene.d.ts.map +1 -1
- package/lib/esm/render/Scene.js.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts +3 -0
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
- package/lib/esm/render/primitives/mesh/MeshBuilderMap.d.ts +3 -0
- package/lib/esm/render/primitives/mesh/MeshBuilderMap.d.ts.map +1 -1
- package/lib/esm/render/primitives/mesh/MeshBuilderMap.js +2 -0
- package/lib/esm/render/primitives/mesh/MeshBuilderMap.js.map +1 -1
- package/lib/esm/render/webgl/GLTimer.d.ts.map +1 -1
- package/lib/esm/render/webgl/GLTimer.js +24 -4
- package/lib/esm/render/webgl/GLTimer.js.map +1 -1
- package/lib/esm/render/webgl/Graphic.d.ts +6 -1
- package/lib/esm/render/webgl/Graphic.d.ts.map +1 -1
- package/lib/esm/render/webgl/Graphic.js +21 -1
- package/lib/esm/render/webgl/Graphic.js.map +1 -1
- package/lib/esm/render/webgl/Layer.d.ts +2 -0
- package/lib/esm/render/webgl/Layer.d.ts.map +1 -1
- package/lib/esm/render/webgl/Layer.js +3 -0
- package/lib/esm/render/webgl/Layer.js.map +1 -1
- package/lib/esm/render/webgl/Mesh.d.ts +2 -0
- package/lib/esm/render/webgl/Mesh.d.ts.map +1 -1
- package/lib/esm/render/webgl/Mesh.js +7 -0
- package/lib/esm/render/webgl/Mesh.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts +3 -2
- package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/Primitive.d.ts +2 -0
- package/lib/esm/render/webgl/Primitive.d.ts.map +1 -1
- package/lib/esm/render/webgl/Primitive.js +3 -0
- package/lib/esm/render/webgl/Primitive.js.map +1 -1
- package/lib/esm/render/webgl/Target.d.ts +4 -3
- package/lib/esm/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/request/utils.d.ts +5 -0
- package/lib/esm/request/utils.d.ts.map +1 -1
- package/lib/esm/request/utils.js +9 -0
- package/lib/esm/request/utils.js.map +1 -1
- package/lib/esm/tile/BatchedTileIdMap.d.ts +6 -1
- package/lib/esm/tile/BatchedTileIdMap.d.ts.map +1 -1
- package/lib/esm/tile/BatchedTileIdMap.js +9 -0
- package/lib/esm/tile/BatchedTileIdMap.js.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.d.ts +4 -4
- package/lib/esm/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.js +12 -7
- package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
- package/lib/esm/tile/GltfReader.js +1 -1
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/OrbitGtTileTree.d.ts +1 -0
- package/lib/esm/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/esm/tile/OrbitGtTileTree.js +4 -0
- package/lib/esm/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts +1 -0
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +34 -8
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts +5 -2
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +19 -0
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.d.ts +5 -0
- package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +1 -1
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/RenderGraphicTileTree.d.ts +34 -0
- package/lib/esm/tile/RenderGraphicTileTree.d.ts.map +1 -0
- package/lib/esm/tile/RenderGraphicTileTree.js +96 -0
- package/lib/esm/tile/RenderGraphicTileTree.js.map +1 -0
- package/lib/esm/tile/TileAdmin.d.ts +24 -1
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +15 -4
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +21 -2
- package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/TileTreeReference.js +27 -2
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/internal.d.ts +1 -0
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +1 -0
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/MapLayerTileTreeReference.d.ts +1 -0
- package/lib/esm/tile/map/MapLayerTileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerTileTreeReference.js +4 -0
- package/lib/esm/tile/map/MapLayerTileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts +1 -0
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +20 -7
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTiledGraphicsProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTiledGraphicsProvider.js +17 -1
- package/lib/esm/tile/map/MapTiledGraphicsProvider.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +2 -0
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +4 -0
- package/lib/esm/tools/ToolAdmin.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
|
@@ -5,6 +5,7 @@ import { Id64String } from "@itwin/core-bentley";
|
|
|
5
5
|
import { ContextRealityModel, ContextRealityModelProps, RealityDataSourceKey } from "@itwin/core-common";
|
|
6
6
|
import { DisplayStyleState } from "./DisplayStyleState";
|
|
7
7
|
import { IModelConnection } from "./IModelConnection";
|
|
8
|
+
import { SpatialClassifiersState } from "./SpatialClassifiersState";
|
|
8
9
|
import { TileTreeReference } from "./tile/internal";
|
|
9
10
|
/** A [ContextRealityModel]($common) attached to a [[DisplayStyleState]] supplying a [[TileTreeReference]] used to draw the
|
|
10
11
|
* reality model in a [[Viewport]].
|
|
@@ -24,6 +25,8 @@ export declare class ContextRealityModelState extends ContextRealityModel {
|
|
|
24
25
|
constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState);
|
|
25
26
|
/** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */
|
|
26
27
|
get treeRef(): TileTreeReference;
|
|
28
|
+
/** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */
|
|
29
|
+
get classifiers(): SpatialClassifiersState;
|
|
27
30
|
/** The transient Id assigned to this reality model at run-time. */
|
|
28
31
|
get modelId(): Id64String | undefined;
|
|
29
32
|
/** Whether the reality model spans the entire globe ellipsoid. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextRealityModelState.d.ts","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ContextRealityModelState.d.ts","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAwC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/I,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAwF,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE1I;;;;;;;GAOG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC/D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiC;IAC1D,6DAA6D;IAC7D,SAAgB,MAAM,EAAE,gBAAgB,CAAC;IACzC,8EAA8E;IAC9E,SAAyB,WAAW,EAAE,oBAAoB,CAAC;IAE3D,gBAAgB;gBACG,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB;IAoC7G,6FAA6F;IAC7F,IAAW,OAAO,IAAI,iBAAiB,CAA0B;IAEjE,wGAAwG;IACxG,IAAoB,WAAW,IAAI,uBAAuB,CAGzD;IAED,mEAAmE;IACnE,IAAW,OAAO,IAAI,UAAU,GAAG,SAAS,CAE3C;IAED,kEAAkE;IAClE,IAAW,QAAQ,IAAI,OAAO,CAE7B;CACF"}
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ContextRealityModelState = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
const core_common_1 = require("@itwin/core-common");
|
|
12
13
|
const PlanarClipMaskState_1 = require("./PlanarClipMaskState");
|
|
13
14
|
const RealityDataSource_1 = require("./RealityDataSource");
|
|
15
|
+
const SpatialClassifiersState_1 = require("./SpatialClassifiersState");
|
|
14
16
|
const internal_1 = require("./tile/internal");
|
|
15
17
|
/** A [ContextRealityModel]($common) attached to a [[DisplayStyleState]] supplying a [[TileTreeReference]] used to draw the
|
|
16
18
|
* reality model in a [[Viewport]].
|
|
@@ -23,7 +25,7 @@ const internal_1 = require("./tile/internal");
|
|
|
23
25
|
class ContextRealityModelState extends core_common_1.ContextRealityModel {
|
|
24
26
|
/** @internal */
|
|
25
27
|
constructor(props, iModel, displayStyle) {
|
|
26
|
-
super(props);
|
|
28
|
+
super(props, { createClassifiers: (container) => SpatialClassifiersState_1.SpatialClassifiersState.create(container) });
|
|
27
29
|
this.iModel = iModel;
|
|
28
30
|
this._appearanceOverrides = props.appearanceOverrides ? core_common_1.FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;
|
|
29
31
|
if (undefined === props.orbitGtBlob) {
|
|
@@ -59,6 +61,11 @@ class ContextRealityModelState extends core_common_1.ContextRealityModel {
|
|
|
59
61
|
}
|
|
60
62
|
/** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */
|
|
61
63
|
get treeRef() { return this._treeRef; }
|
|
64
|
+
/** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */
|
|
65
|
+
get classifiers() {
|
|
66
|
+
(0, core_bentley_1.assert)(super.classifiers instanceof SpatialClassifiersState_1.SpatialClassifiersState);
|
|
67
|
+
return super.classifiers;
|
|
68
|
+
}
|
|
62
69
|
/** The transient Id assigned to this reality model at run-time. */
|
|
63
70
|
get modelId() {
|
|
64
71
|
return (this._treeRef instanceof internal_1.RealityModelTileTree.Reference) ? this._treeRef.modelId : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextRealityModelState.js","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"ContextRealityModelState.js","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,oDAA+I;AAG/I,+DAA4D;AAC5D,2DAAwD;AACxD,uEAAoE;AACpE,8CAA0I;AAE1I;;;;;;;GAOG;AACH,MAAa,wBAAyB,SAAQ,iCAAmB;IAO/D,gBAAgB;IAChB,YAAmB,KAA+B,EAAE,MAAwB,EAAE,YAA+B;QAC3G,KAAK,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,iDAAuB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC9F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,+BAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1H,IAAI,SAAS,KAAK,KAAK,CAAC,WAAW,EAAE;YACnC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,qCAAiB,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;SACjH;aAAM;YACL,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,qCAAiB,CAAC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AAK,CAAC,WAAW,YAAY,iDAAuB,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC,WAAW,CAAC;IAC3B,CAAC;IAED,mEAAmE;IACnE,IAAW,OAAO;QAChB,OAAO,CAAC,IAAI,CAAC,QAAQ,YAAY,+BAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,CAAC;IAED,kEAAkE;IAClE,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACF;AA9DD,4DA8DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { ContextRealityModel, ContextRealityModelProps, FeatureAppearance, RealityDataFormat, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"./DisplayStyleState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\nimport { createOrbitGtTileTreeReference, createRealityTileTreeReference, RealityModelTileTree, TileTreeReference } from \"./tile/internal\";\r\n\r\n/** A [ContextRealityModel]($common) attached to a [[DisplayStyleState]] supplying a [[TileTreeReference]] used to draw the\r\n * reality model in a [[Viewport]].\r\n * @see [DisplayStyleSettings.contextRealityModels]($common).\r\n * @see [[DisplayStyleState.contextRealityModelStates]].\r\n * @see [[DisplayStyleState.attachRealityModel]].\r\n * @public\r\n * @extensions\r\n */\r\nexport class ContextRealityModelState extends ContextRealityModel {\r\n private readonly _treeRef: RealityModelTileTree.Reference;\r\n /** The iModel with which the reality model is associated. */\r\n public readonly iModel: IModelConnection;\r\n /** The reality data source key with which the reality model is associated. */\r\n public override readonly rdSourceKey: RealityDataSourceKey;\r\n\r\n /** @internal */\r\n public constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState) {\r\n super(props, { createClassifiers: (container) => SpatialClassifiersState.create(container) });\r\n this.iModel = iModel;\r\n this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;\r\n if (undefined === props.orbitGtBlob) {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromUrl(props.tilesetUrl);\r\n } else {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);\r\n }\r\n const useOrbitGtTileTreeReference = this.rdSourceKey.format === RealityDataFormat.OPC;\r\n this._treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n iModel,\r\n source: displayStyle,\r\n rdSourceKey: this.rdSourceKey,\r\n url: props.tilesetUrl,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n planarClipMask: this.planarClipMaskSettings,\r\n getDisplaySettings: () => this.displaySettings,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n iModel,\r\n orbitGtBlob: props.orbitGtBlob!,\r\n rdSourceKey: this.rdSourceKey,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n source: displayStyle,\r\n getDisplaySettings: () => this.displaySettings,\r\n });\r\n\r\n this.onPlanarClipMaskChanged.addListener((newSettings) => {\r\n this._treeRef.planarClipMask = newSettings ? PlanarClipMaskState.create(newSettings) : undefined;\r\n });\r\n }\r\n\r\n /** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */\r\n public get treeRef(): TileTreeReference { return this._treeRef; }\r\n\r\n /** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */\r\n public override get classifiers(): SpatialClassifiersState {\r\n assert(super.classifiers instanceof SpatialClassifiersState);\r\n return super.classifiers;\r\n }\r\n\r\n /** The transient Id assigned to this reality model at run-time. */\r\n public get modelId(): Id64String | undefined {\r\n return (this._treeRef instanceof RealityModelTileTree.Reference) ? this._treeRef.modelId : undefined;\r\n }\r\n\r\n /** Whether the reality model spans the entire globe ellipsoid. */\r\n public get isGlobal(): boolean {\r\n return this.treeRef.isGlobal;\r\n }\r\n}\r\n"]}
|
package/lib/cjs/IModelApp.js
CHANGED
|
@@ -41,7 +41,7 @@ const package_json_1 = __importDefault(require("../../package.json"));
|
|
|
41
41
|
/** @public */
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
43
43
|
exports.ITWINJS_CORE_VERSION = package_json_1.default.version;
|
|
44
|
-
const COPYRIGHT_NOTICE = 'Copyright © 2017-
|
|
44
|
+
const COPYRIGHT_NOTICE = 'Copyright © 2017-2024 <a href="https://www.bentley.com" target="_blank" rel="noopener noreferrer">Bentley Systems, Inc.</a>';
|
|
45
45
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
46
46
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
47
47
|
const core_common_1 = require("@itwin/core-common");
|
package/lib/cjs/IModelApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelApp.js","sourceRoot":"","sources":["../../src/IModelApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4HAA4H;AAC5H,wDAAwD;AACxD,sEAA6C;AAC7C,cAAc;AACd,8DAA8D;AACjD,QAAA,oBAAoB,GAAG,sBAAW,CAAC,OAAiB,CAAC;AAClE,MAAM,gBAAgB,GAAG,6HAA6H,CAAC;AAEvJ,0DAAgD;AAChD,sDAAoJ;AACpJ,oDAE4B;AAC5B,gDAAqD;AACrD,0DAAyD;AACzD,oEAAoG;AACpG,yCAAsC;AAC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BACV,GAAG,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;SACvE;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,YAAY,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;IACvF,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,qBAAqB;QAClC,MAAM,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;QAC5C,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC/D,OAAO,cAAc,CAAC;IACxB,CAAC;;;AApkBc,sBAAY,GAAG,KAAK,AAAR,CAAS;AAiBrB,wBAAc,GAAG,KAAK,AAAR,CAAS;AACvB,6BAAmB,GAAG,KAAK,AAAR,CAAS;AAC5B,4BAAkB,GAA2B,yBAAU,CAAC,WAAW,CAAC,CAAC,CAAC,AAApD,CAAqD;AAatF,6EAA6E;AACtD,0BAAgB,GAAG,IAAI,sBAAO,EAAc,AAA5B,CAA6B;AAEpE,0DAA0D;AACnC,wBAAc,GAAG,IAAI,sBAAO,EAAc,AAA5B,CAA6B;AAIlE,6CAA6C;AACtB,eAAK,GAAG,IAAI,mBAAY,EAAE,AAArB,CAAsB;AAqElD;;GAEG;AACoB,mBAAS,GAAqB,IAAI,iCAAgB,EAAE,AAA3C,CAA4C;AAE5E,aAAa;AACU,wBAAc,GAAG,EAAI,CAAC,qBAAqB,EAAE,AAA/B,CAAgC;AAErE,gDAAgD;AACjC,wBAAc,GAAG,IAAI,GAAG,EAA8B,AAAxC,CAAyC;AAxH3D,8BAAS","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\n// @ts-expect-error package.json will resolve from the lib/{cjs,esm} dir without copying it into the build output we deliver\r\n// eslint-disable-next-line @itwin/import-within-package\r\nimport packageJson from \"../../package.json\";\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nexport const ITWINJS_CORE_VERSION = packageJson.version as string;\r\nconst COPYRIGHT_NOTICE = 'Copyright © 2017-2023 <a href=\"https://www.bentley.com\" target=\"_blank\" rel=\"noopener noreferrer\">Bentley Systems, Inc.</a>';\r\n\r\nimport { UiAdmin } from \"@itwin/appui-abstract\";\r\nimport { AccessToken, BeDuration, BeEvent, BentleyStatus, DbResult, dispose, Guid, GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n AuthorizationClient, IModelStatus, Localization, RealityDataAccess, RpcConfiguration, RpcInterfaceDefinition, RpcRequest, SerializedRpcActivity,\r\n} from \"@itwin/core-common\";\r\nimport { ITwinLocalization } from \"@itwin/core-i18n\";\r\nimport { TelemetryManager } from \"@itwin/core-telemetry\";\r\nimport { queryRenderCompatibility, WebGLRenderCompatibilityInfo } from \"@itwin/webgl-compatibility\";\r\nimport { AccuDraw } from \"./AccuDraw\";\r\nimport { AccuSnap } from \"./AccuSnap\";\r\nimport * as auxCoordState from \"./AuxCoordSys\";\r\nimport * as categorySelectorState from \"./CategorySelectorState\";\r\nimport { ExtensionAdmin } from \"./extension/ExtensionAdmin\";\r\nimport * as displayStyleState from \"./DisplayStyleState\";\r\nimport * as drawingViewState from \"./DrawingViewState\";\r\nimport { ElementLocateManager } from \"./ElementLocateManager\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { FrontendHubAccess } from \"./FrontendHubAccess\";\r\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\r\nimport * as modelselector from \"./ModelSelectorState\";\r\nimport * as modelState from \"./ModelState\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { QuantityFormatter } from \"./quantity-formatting/QuantityFormatter\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { System } from \"./render/webgl/System\";\r\nimport * as sheetState from \"./SheetViewState\";\r\nimport * as spatialViewState from \"./SpatialViewState\";\r\nimport { TentativePoint } from \"./TentativePoint\";\r\nimport { RealityDataSourceProviderRegistry } from \"./RealityDataSource\";\r\nimport { MapLayerFormatRegistry, MapLayerOptions, TerrainProviderRegistry, TileAdmin } from \"./tile/internal\";\r\nimport * as accudrawTool from \"./tools/AccuDrawTool\";\r\nimport * as clipViewTool from \"./tools/ClipViewTool\";\r\nimport * as idleTool from \"./tools/IdleTool\";\r\nimport * as measureTool from \"./tools/MeasureTool\";\r\nimport * as selectTool from \"./tools/SelectTool\";\r\nimport { ToolRegistry } from \"./tools/Tool\";\r\nimport { ToolAdmin } from \"./tools/ToolAdmin\";\r\nimport * as viewTool from \"./tools/ViewTool\";\r\nimport { UserPreferencesAccess } from \"./UserPreferences\";\r\nimport { ViewManager } from \"./ViewManager\";\r\nimport * as viewState from \"./ViewState\";\r\nimport \"./IModeljs-css\";\r\n\r\n// cSpell:ignore noopener noreferrer gprid forin nbsp csrf xsrf\r\n\r\n/** Options that can be supplied with [[IModelAppOptions]] to customize frontend security.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FrontendSecurityOptions {\r\n /** Configures protection from Cross Site Request Forgery attacks. */\r\n readonly csrfProtection?: {\r\n /** If enabled, IModelApp will extract the CSRF token for the current session from the document's cookies and send it with each request as a header value. */\r\n readonly enabled: boolean;\r\n /** Defaults to XSRF-TOKEN. */\r\n readonly cookieName?: string;\r\n /** Defaults to X-XSRF-TOKEN. */\r\n readonly headerName?: string;\r\n };\r\n}\r\n\r\n/** Options that can be supplied to [[IModelApp.startup]] to customize frontend behavior.\r\n * @public\r\n */\r\nexport interface IModelAppOptions {\r\n /** If present, supplies the [[FrontendHubAccess]] for this session. */\r\n hubAccess?: FrontendHubAccess;\r\n /** If present, supplies the Id of this application. Applications must set this to the Bentley Global Product Registry Id (GPRID) for usage logging. */\r\n applicationId?: string;\r\n /** If present, supplies the version of this application. Must be set for usage logging. */\r\n applicationVersion?: string;\r\n /** If present, supplies the [[UserPreferencesAccess]] for this session.\r\n * @beta\r\n */\r\n userPreferences?: UserPreferencesAccess;\r\n /** If present, supplies the [[ViewManager]] for this session. */\r\n viewManager?: ViewManager;\r\n /** If present, supplies Map Layer Options for this session such as Azure Access Keys\r\n * @beta\r\n */\r\n mapLayerOptions?: MapLayerOptions;\r\n /** If present, supplies the properties with which to initialize the [[TileAdmin]] for this session. */\r\n tileAdmin?: TileAdmin.Props;\r\n /** If present, supplies the [[NotificationManager]] for this session. */\r\n notifications?: NotificationManager;\r\n /** If present, supplies the [[ToolAdmin]] for this session. */\r\n toolAdmin?: ToolAdmin;\r\n /** If present, supplies the [[AccuDraw]] for this session. */\r\n accuDraw?: AccuDraw;\r\n /** If present, supplies the [[AccuSnap]] for this session. */\r\n accuSnap?: AccuSnap;\r\n /** If present, supplies the [[Localization]] for this session. Defaults to [ITwinLocalization]($i18n). */\r\n localization?: Localization;\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n authorizationClient?: AuthorizationClient;\r\n /** If present, supplies security options for the frontend. */\r\n security?: FrontendSecurityOptions;\r\n /** @internal */\r\n sessionId?: GuidString;\r\n /** @internal */\r\n locateManager?: ElementLocateManager;\r\n /** If present, supplies the [[TentativePoint]] for this session. */\r\n tentativePoint?: TentativePoint;\r\n /** @internal */\r\n quantityFormatter?: QuantityFormatter;\r\n /** If present, supplies an implementation of the render system, or options for initializing the default render system. */\r\n renderSys?: RenderSystem | RenderSystem.Options;\r\n /** If present, supplies the [[UiAdmin]] for this session. */\r\n uiAdmin?: UiAdmin;\r\n /** If present, determines whether iModelApp is a NoRenderApp\r\n * @internal\r\n */\r\n noRender?: boolean;\r\n /**\r\n * @deprecated in 3.7. Specify desired RPC interfaces in the platform-specific RPC manager call instead.\r\n * See [[MobileRpcManager.initializeClient]], [[ElectronRpcManager.initializeFrontend]], [[BentleyCloudRpcManager.initializeClient]].\r\n */\r\n rpcInterfaces?: RpcInterfaceDefinition[];\r\n /** @beta */\r\n realityDataAccess?: RealityDataAccess;\r\n /** If present, overrides where public assets are fetched. The default is to fetch assets relative to the current URL.\r\n * The path should always end with a trailing `/`.\r\n * @beta\r\n */\r\n publicPath?: string;\r\n}\r\n\r\n/** Options for [[IModelApp.makeModalDiv]]\r\n * @public\r\n */\r\nexport interface ModalOptions {\r\n /** Width for the Modal dialog box. */\r\n width?: number;\r\n /** The dialog should be dismissed if the user clicks anywhere or hits Enter or Escape on the keyboard. */\r\n autoClose?: boolean;\r\n /** Show an 'x' in the upper right corner to close the dialog */\r\n closeBox?: boolean;\r\n /** The parent for the semi transparent *darkening* div. If not present, use `document.body` */\r\n rootDiv?: HTMLElement;\r\n}\r\n\r\n/** Return type for [[IModelApp.makeModalDiv]]\r\n * @public\r\n */\r\nexport interface ModalReturn {\r\n /** The modal HTMLDivElement created. */\r\n modal: HTMLDivElement;\r\n /** A function that can be set as an event handler to stop the modal dialog. This can be used if [[ModalOptions.autoClose]] or [[IModalOptions.closeBox]]\r\n * were not enabled for the dialog.\r\n */\r\n stop: (_ev: Event) => void;\r\n}\r\n\r\n/** We hang the IModelApp object off the global `window` object in IModelApp.startup for debugging purposes.\r\n * It's removed in IModelApp.shutdown.\r\n */\r\ninterface IModelAppForDebugger {\r\n iModelAppForDebugger?: typeof IModelApp;\r\n}\r\n\r\n/**\r\n * Global singleton that connects the user interface with the iTwin.js services. There can be only one IModelApp active in a session. All\r\n * members of IModelApp are static, and it serves as a singleton object for gaining access to session information.\r\n *\r\n * Before any interactive operations may be performed by the `@itwin/core-frontend package`, [[IModelApp.startup]] must be called and awaited.\r\n * Applications may customize the frontend behavior of iTwin.js by supplying options to [[IModelApp.startup]].\r\n *\r\n * @public\r\n */\r\nexport class IModelApp {\r\n private static _initialized = false;\r\n private static _accuDraw: AccuDraw;\r\n private static _accuSnap: AccuSnap;\r\n private static _applicationId: string;\r\n private static _applicationVersion: string;\r\n private static _localization: Localization;\r\n private static _locateManager: ElementLocateManager;\r\n private static _notifications: NotificationManager;\r\n private static _quantityFormatter: QuantityFormatter;\r\n private static _renderSystem?: RenderSystem;\r\n private static _userPreferences?: UserPreferencesAccess;\r\n private static _tentativePoint: TentativePoint;\r\n private static _tileAdmin: TileAdmin;\r\n private static _toolAdmin: ToolAdmin;\r\n private static _viewManager: ViewManager;\r\n private static _uiAdmin: UiAdmin;\r\n private static _noRender: boolean;\r\n private static _wantEventLoop = false;\r\n private static _animationRequested = false;\r\n private static _animationInterval: BeDuration | undefined = BeDuration.fromSeconds(1);\r\n private static _animationIntervalId?: number;\r\n private static _securityOptions: FrontendSecurityOptions;\r\n private static _mapLayerFormatRegistry: MapLayerFormatRegistry;\r\n private static _terrainProviderRegistry: TerrainProviderRegistry;\r\n private static _realityDataSourceProviders: RealityDataSourceProviderRegistry;\r\n private static _hubAccess?: FrontendHubAccess;\r\n private static _realityDataAccess?: RealityDataAccess;\r\n private static _publicPath: string;\r\n\r\n // No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.\r\n protected constructor() { }\r\n\r\n /** Event raised just before the frontend IModelApp is to be [[shutdown]]. */\r\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\r\n\r\n /** Event raised after IModelApp [[startup]] completes. */\r\n public static readonly onAfterStartup = new BeEvent<() => void>();\r\n\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n public static authorizationClient?: AuthorizationClient;\r\n /** The [[ToolRegistry]] for this session. */\r\n public static readonly tools = new ToolRegistry();\r\n /** A uniqueId for this session */\r\n public static sessionId: GuidString;\r\n /** The [[MapLayerFormatRegistry]] for this session. */\r\n public static get mapLayerFormatRegistry(): MapLayerFormatRegistry { return this._mapLayerFormatRegistry; }\r\n /** The [[TerrainProviderRegistry]] for this session. */\r\n public static get terrainProviderRegistry(): TerrainProviderRegistry { return this._terrainProviderRegistry; }\r\n /** The [[RealityDataSourceProviderRegistry]] for this session.\r\n * @alpha\r\n */\r\n public static get realityDataSourceProviders(): RealityDataSourceProviderRegistry { return this._realityDataSourceProviders; }\r\n /** The [[RenderSystem]] for this session. */\r\n public static get renderSystem(): RenderSystem { return this._renderSystem!; }\r\n /** The [[ViewManager]] for this session. */\r\n public static get viewManager(): ViewManager { return this._viewManager; }\r\n /** The [[NotificationManager]] for this session. */\r\n public static get notifications(): NotificationManager { return this._notifications; }\r\n /** The [[TileAdmin]] for this session. */\r\n public static get tileAdmin(): TileAdmin { return this._tileAdmin; }\r\n /** The [[QuantityFormatter]] for this session. */\r\n public static get quantityFormatter(): QuantityFormatter { return this._quantityFormatter; }\r\n /** The [[ToolAdmin]] for this session. */\r\n public static get toolAdmin(): ToolAdmin { return this._toolAdmin; }\r\n /** The [[AccuDraw]] for this session. */\r\n public static get accuDraw(): AccuDraw { return this._accuDraw; }\r\n /** The [[AccuSnap]] for this session. */\r\n public static get accuSnap(): AccuSnap { return this._accuSnap; }\r\n public static get locateManager(): ElementLocateManager { return this._locateManager; }\r\n /** The [[TentativePoint]] for this session]]. */\r\n public static get tentativePoint(): TentativePoint { return this._tentativePoint; }\r\n /** The [[Localization]] for this session. */\r\n public static get localization(): Localization { return this._localization; }\r\n /** The [[UserPreferencesAccess]] for this session.\r\n * @beta\r\n */\r\n public static get userPreferences(): UserPreferencesAccess | undefined { return this._userPreferences; }\r\n /** The Id of this application. Applications must set this to the Global Product Registry ID (GPRID) for usage logging. */\r\n public static get applicationId(): string { return this._applicationId; }\r\n /** The version of this application. Must be set for usage logging. */\r\n public static get applicationVersion(): string { return this._applicationVersion; }\r\n /** True after [[startup]] has been called, until [[shutdown]] is called. */\r\n public static get initialized() { return this._initialized; }\r\n\r\n /** Provides access to IModelHub services. */\r\n public static get hubAccess(): FrontendHubAccess | undefined { return this._hubAccess; }\r\n\r\n /** Provides access to the RealityData service implementation for this IModelApp\r\n * @beta\r\n */\r\n public static get realityDataAccess(): RealityDataAccess | undefined { return this._realityDataAccess; }\r\n\r\n /** Whether the [renderSystem[]] has been successfully initialized.\r\n * This will always be `false` before calling [[startup]] and after calling [[shutdown]].\r\n * In rare circumstances (e.g., while executing in a headless test environment) it may remain `false` due to a failure to\r\n * obtain a [WebGL rendering context](https://www.google.com/search?channel=fs&client=ubuntu-sn&q=mdn+webglrenderingcontext).\r\n * As long as you have called [[startup]], you can generally assume it to be `true`.\r\n */\r\n public static get hasRenderSystem() {\r\n return this._renderSystem !== undefined && this._renderSystem.isValid;\r\n }\r\n\r\n /** The [[UiAdmin]] for this session. */\r\n public static get uiAdmin() { return this._uiAdmin; }\r\n /** The requested security options for the frontend. */\r\n public static get securityOptions() { return this._securityOptions; }\r\n /** The root URL for the assets 'public' folder.\r\n * @beta\r\n */\r\n public static get publicPath() { return this._publicPath; }\r\n /** The [[TelemetryManager]] for this session\r\n * @internal\r\n */\r\n public static readonly telemetry: TelemetryManager = new TelemetryManager();\r\n\r\n /** @alpha */\r\n public static readonly extensionAdmin = this._createExtensionAdmin();\r\n\r\n /** Map of classFullName to EntityState class */\r\n private static _entityClasses = new Map<string, typeof EntityState>();\r\n\r\n /** Register all of the subclasses of EntityState from a module.\r\n * @internal\r\n */\r\n public static registerModuleEntities(moduleObj: any) {\r\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\r\n const thisEntityState = moduleObj[thisMember];\r\n if (thisEntityState.prototype instanceof EntityState) {\r\n this.registerEntityState(thisEntityState.classFullName, thisEntityState);\r\n }\r\n }\r\n }\r\n\r\n /** Register an EntityState class by its classFullName\r\n * @internal\r\n */\r\n public static registerEntityState(classFullName: string, classType: typeof EntityState) {\r\n const lowerName = classFullName.toLowerCase();\r\n if (this._entityClasses.has(lowerName)) {\r\n const errMsg = `Class ${classFullName} is already registered. Make sure static schemaName and className members are correct on class ${classType.name}`;\r\n Logger.logError(FrontendLoggerCategory.IModelConnection, errMsg);\r\n throw new Error(errMsg);\r\n }\r\n\r\n this._entityClasses.set(lowerName, classType);\r\n }\r\n\r\n /** @internal */\r\n public static lookupEntityClass(classFullName: string) { return this._entityClasses.get(classFullName.toLowerCase()); }\r\n\r\n /**\r\n * Obtain WebGL rendering compatibility information for the client system. This information describes whether the client meets the\r\n * minimum rendering capabilities. It also describes whether the system lacks any optional capabilities that could improve quality\r\n * and/or performance.\r\n * @note As of 4.x, iTwin.js requires WebGL 2. If the client does not support WebGL 2, the `status` field of the returned compatibility info will be [WebGLRenderCompatibilityStatus.CannotCreateContext]($webgl-compatibility).\r\n */\r\n public static queryRenderCompatibility(): WebGLRenderCompatibilityInfo {\r\n return queryRenderCompatibility(true, (canvas, useWebGL2, inputContextAttributes) => System.createContext(canvas, useWebGL2, inputContextAttributes));\r\n }\r\n\r\n /**\r\n * This method must be called before any other `@itwin/core-frontend` methods are used.\r\n * Somewhere in your startup code, call [[IModelApp.startup]]. E.g.:\r\n * ``` ts\r\n * await IModelApp.startup( {applicationId: myAppId} );\r\n * ```\r\n * @param opts The options for configuring IModelApp\r\n */\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n if (this._initialized)\r\n return; // we're already initialized, do nothing.\r\n this._initialized = true;\r\n\r\n opts = opts ?? {};\r\n this._securityOptions = opts.security ?? {};\r\n\r\n if (process.env.NODE_ENV === \"development\") {\r\n // Make IModelApp globally accessible for debugging purposes. We'll remove it on shutdown.\r\n (window as IModelAppForDebugger).iModelAppForDebugger = this;\r\n }\r\n\r\n this.sessionId = opts.sessionId ?? Guid.createValue();\r\n this._applicationId = opts.applicationId ?? \"2686\"; // Default to product id of iTwin.js\r\n this._applicationVersion = opts.applicationVersion ?? \"1.0.0\";\r\n this.authorizationClient = opts.authorizationClient;\r\n this._hubAccess = opts.hubAccess;\r\n this._noRender = opts.noRender ?? false;\r\n\r\n this._setupRpcRequestContext();\r\n\r\n this._localization = opts.localization ?? new ITwinLocalization();\r\n const toolsNs = \"CoreTools\";\r\n await this.localization.initialize([\"iModelJs\", toolsNs]);\r\n [\r\n selectTool,\r\n idleTool,\r\n viewTool,\r\n clipViewTool,\r\n measureTool,\r\n accudrawTool,\r\n ].forEach((tool) => this.tools.registerModule(tool, toolsNs));\r\n\r\n this.registerEntityState(EntityState.classFullName, EntityState);\r\n [\r\n modelState,\r\n sheetState,\r\n viewState,\r\n drawingViewState,\r\n spatialViewState,\r\n displayStyleState,\r\n modelselector,\r\n categorySelectorState,\r\n auxCoordState,\r\n ].forEach((module) => this.registerModuleEntities(module));\r\n\r\n this._renderSystem = (opts.renderSys instanceof RenderSystem) ? opts.renderSys : this.createRenderSys(opts.renderSys);\r\n if (opts.userPreferences)\r\n this._userPreferences = opts.userPreferences;\r\n this._viewManager = opts.viewManager ?? new ViewManager();\r\n this._tileAdmin = await TileAdmin.create(opts.tileAdmin);\r\n this._notifications = opts.notifications ?? new NotificationManager();\r\n this._toolAdmin = opts.toolAdmin ?? new ToolAdmin();\r\n this._accuDraw = opts.accuDraw ?? new AccuDraw();\r\n this._accuSnap = opts.accuSnap ?? new AccuSnap();\r\n this._locateManager = opts.locateManager ?? new ElementLocateManager();\r\n this._tentativePoint = opts.tentativePoint ?? new TentativePoint();\r\n this._quantityFormatter = opts.quantityFormatter ?? new QuantityFormatter();\r\n this._uiAdmin = opts.uiAdmin ?? new UiAdmin();\r\n this._mapLayerFormatRegistry = new MapLayerFormatRegistry(opts.mapLayerOptions);\r\n this._terrainProviderRegistry = new TerrainProviderRegistry();\r\n this._realityDataSourceProviders = new RealityDataSourceProviderRegistry();\r\n this._realityDataAccess = opts.realityDataAccess;\r\n this._publicPath = opts.publicPath ?? \"\";\r\n\r\n [\r\n this.renderSystem,\r\n this.viewManager,\r\n this.toolAdmin,\r\n this.accuDraw,\r\n this.accuSnap,\r\n this.locateManager,\r\n this.tentativePoint,\r\n this.uiAdmin,\r\n ].forEach((sys) => sys.onInitialized());\r\n\r\n await this.quantityFormatter.onInitialized();\r\n this.onAfterStartup.raiseEvent();\r\n }\r\n\r\n /** Must be called before the application exits to release any held resources. */\r\n public static async shutdown() {\r\n if (!this._initialized)\r\n return;\r\n\r\n // notify listeners that this IModelApp is about to be shut down.\r\n this.onBeforeShutdown.raiseEvent();\r\n this.onBeforeShutdown.clear();\r\n\r\n if (process.env.NODE_ENV === \"development\") {\r\n (window as IModelAppForDebugger).iModelAppForDebugger = undefined;\r\n }\r\n\r\n this._wantEventLoop = false;\r\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\r\n this.clearIntervalAnimation();\r\n [this.toolAdmin, this.viewManager, this.tileAdmin].forEach((sys) => sys.onShutDown());\r\n this.tools.shutdown();\r\n this._renderSystem = dispose(this._renderSystem);\r\n this._entityClasses.clear();\r\n this.authorizationClient = undefined;\r\n this._initialized = false;\r\n this.onAfterStartup.clear();\r\n }\r\n\r\n /** Controls how frequently the application polls for changes that may require a new animation frame to be requested.\r\n * Such changes include resizing a Viewport or changing the device pixel ratio by zooming in or out in the browser.\r\n * The default interval is 1 second. It may be desirable to override the default for specific apps and/or devices.\r\n * - Increasing the interval can conserve battery life on battery-powered devices at the expense of slower response to resize events.\r\n * - An application that only displays a single Viewport whose dimensions only change when the dimensions of the application window change, and which does not support changing application zoom level, could disable the interval altogether.\r\n * @param interval The interval at which to poll for changes. If undefined (or negative), the application will never poll. If zero, the application will poll as frequently as possible.\r\n * @beta\r\n */\r\n public static get animationInterval(): BeDuration | undefined { return IModelApp._animationInterval; }\r\n public static set animationInterval(interval: BeDuration | undefined) {\r\n if (undefined !== interval && interval.isTowardsPast)\r\n interval = undefined;\r\n\r\n if (interval !== IModelApp._animationInterval) {\r\n IModelApp._animationInterval = interval;\r\n if (IModelApp._wantEventLoop)\r\n IModelApp.requestIntervalAnimation();\r\n }\r\n }\r\n\r\n /** Request that the event loop execute on the next [animation frame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).\r\n * There is generally no reason for applications to invoke this method directly.\r\n */\r\n public static requestNextAnimation() {\r\n // Only want to call requestAnimationFrame if it is defined. Need to check whether current iModelApp is a NoRenderApp.\r\n if (IModelApp._noRender)\r\n return;\r\n\r\n if (!IModelApp._animationRequested) {\r\n IModelApp._animationRequested = true;\r\n requestAnimationFrame(() => IModelApp.eventLoop());\r\n }\r\n }\r\n\r\n /** @internal */\r\n private static clearIntervalAnimation(): void {\r\n if (undefined !== IModelApp._animationIntervalId) {\r\n window.clearInterval(IModelApp._animationIntervalId);\r\n IModelApp._animationIntervalId = undefined;\r\n }\r\n }\r\n\r\n /** @internal */\r\n private static requestIntervalAnimation(): void {\r\n IModelApp.clearIntervalAnimation();\r\n\r\n if (undefined !== IModelApp.animationInterval)\r\n IModelApp._animationIntervalId = window.setInterval(() => {\r\n IModelApp.requestNextAnimation();\r\n }, IModelApp.animationInterval.milliseconds);\r\n }\r\n\r\n /** @internal */\r\n public static startEventLoop() {\r\n if (!IModelApp._wantEventLoop) {\r\n IModelApp._wantEventLoop = true;\r\n window.addEventListener(\"resize\", () => IModelApp.requestNextAnimation());\r\n IModelApp.requestIntervalAnimation();\r\n IModelApp.requestNextAnimation();\r\n }\r\n }\r\n\r\n /** Strictly for tests. @internal */\r\n public static stopEventLoop() {\r\n this._wantEventLoop = false;\r\n }\r\n\r\n /** The main event processing loop for Tools and rendering. */\r\n private static eventLoop() {\r\n IModelApp._animationRequested = false;\r\n if (!IModelApp._wantEventLoop) // flag turned on at startup\r\n return;\r\n\r\n try {\r\n IModelApp.toolAdmin.processEvent(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n IModelApp.viewManager.renderLoop();\r\n IModelApp.tileAdmin.process();\r\n } catch (exception) {\r\n ToolAdmin.exceptionHandler(exception); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n IModelApp._wantEventLoop = false;\r\n IModelApp._animationRequested = true; // unrecoverable after exception, don't request any further frames.\r\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\r\n }\r\n }\r\n\r\n /** Get the user's access token for this IModelApp, or a blank string if none is available.\r\n * @note Access tokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\r\n * returned by this method may change over time throughout the course of a session.\r\n */\r\n public static async getAccessToken(): Promise<AccessToken> {\r\n try {\r\n return (await this.authorizationClient?.getAccessToken()) ?? \"\";\r\n } catch (e) {\r\n return \"\";\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static createRenderSys(opts?: RenderSystem.Options): RenderSystem { return System.create(opts); }\r\n\r\n private static _setupRpcRequestContext() {\r\n RpcConfiguration.requestContext.getId = (_request: RpcRequest): string => {\r\n return Guid.createValue();\r\n };\r\n\r\n RpcConfiguration.requestContext.serialize = async (_request: RpcRequest): Promise<SerializedRpcActivity> => { // eslint-disable-line deprecation/deprecation\r\n const id = _request.id;\r\n const serialized: SerializedRpcActivity = { // eslint-disable-line deprecation/deprecation\r\n id,\r\n applicationId: this.applicationId,\r\n applicationVersion: this.applicationVersion,\r\n sessionId: this.sessionId,\r\n authorization: ProcessDetector.isMobileAppFrontend ? \"\" : await this.getAccessToken(),\r\n };\r\n\r\n const csrf = IModelApp.securityOptions.csrfProtection;\r\n if (csrf && csrf.enabled) {\r\n const cookieName = csrf.cookieName || \"XSRF-TOKEN\";\r\n const cookieValue = document.cookie.split(\"; \").find((r) => r.startsWith(`${cookieName}=`));\r\n\r\n if (cookieValue) {\r\n const headerName = csrf.headerName || \"X-XSRF-TOKEN\";\r\n const headerValue = cookieValue.split(\"=\")[1];\r\n serialized.csrfToken = { headerName, headerValue };\r\n }\r\n }\r\n\r\n return serialized;\r\n };\r\n }\r\n\r\n /** Shortcut for creating an HTMLElement with optional parent, className, id, innerHTML, innerText. */\r\n public static makeHTMLElement<K extends keyof HTMLElementTagNameMap>(type: K, opt?: {\r\n /** The parent for the new HTMLElement */\r\n parent?: HTMLElement;\r\n /** The className for the new HTMLElement */\r\n className?: string;\r\n /** The Id for the new HTMLElement */\r\n id?: string;\r\n /** innerHTML for the new HTMLElement */\r\n innerHTML?: string;\r\n /** innerText for the new HTMLElement */\r\n innerText?: string;\r\n }) {\r\n const el = document.createElement(type);\r\n if (undefined !== opt) {\r\n if (undefined !== opt.className)\r\n el.className = opt.className;\r\n if (undefined !== opt.id)\r\n el.id = opt.id;\r\n if (undefined !== opt.innerHTML)\r\n el.innerHTML = opt.innerHTML;\r\n if (undefined !== opt.innerText)\r\n el.innerText = opt.innerText;\r\n if (undefined !== opt.parent)\r\n opt.parent.appendChild(el);\r\n }\r\n return el;\r\n }\r\n\r\n /** Shortcut for making a modal dialog on top of the root of the application. The returned HTMLDivElement will be placed topmost, all other application\r\n * windows will be covered with a semi-transparent background that intercepts all key/mouse/touch events until the modal is dismissed.\r\n * @param options The options that describe how the modal should work.\r\n */\r\n public static makeModalDiv(options: ModalOptions): ModalReturn {\r\n const root = options.rootDiv ? options.rootDiv : document.body;\r\n // create the overlay div to \"black out\" the application to indicate everything is inactive until the modal has been dismissed.\r\n const overlay = IModelApp.makeHTMLElement(\"div\", { parent: root, className: \"imodeljs-modal-overlay\" });\r\n overlay.tabIndex = -1; // so we can catch keystroke events\r\n\r\n // function to remove modal dialog\r\n const stop = (ev: Event) => {\r\n root.removeChild(overlay);\r\n ev.stopPropagation();\r\n };\r\n\r\n if (options.autoClose) {\r\n overlay.onclick = overlay.oncontextmenu = stop;\r\n overlay.onkeydown = overlay.onkeyup = (ev: KeyboardEvent) => { // ignore all keystrokes other than enter and escape\r\n switch (ev.key) {\r\n case \"Enter\":\r\n case \"Escape\":\r\n stop(ev);\r\n return;\r\n }\r\n ev.stopPropagation();\r\n };\r\n overlay.focus();\r\n }\r\n\r\n const modal = IModelApp.makeHTMLElement(\"div\", { parent: overlay, className: \"imodeljs-modal\" });\r\n if (undefined !== options.width) {\r\n modal.style.width = `${options.width}px`;\r\n // allow the dialog to be smaller than the width\r\n modal.style.maxWidth = `min(100% - (2 * var(--width-border)), ${options.width}px)`;\r\n }\r\n if (options.closeBox) {\r\n const close = IModelApp.makeHTMLElement(\"p\", { parent: modal, className: \"imodeljs-modal-close\" });\r\n close.innerText = \"\\u00d7\"; // unicode \"times\" symbol\r\n close.onclick = stop;\r\n }\r\n\r\n return { modal, stop };\r\n }\r\n\r\n /** Applications may implement this method to supply a Logo Card.\r\n * @beta\r\n */\r\n public static applicationLogoCard?: () => HTMLTableRowElement;\r\n\r\n /** Make a new Logo Card. Call this method from your implementation of [[IModelApp.applicationLogoCard]]\r\n * @param opts Options for Logo Card\r\n * @beta\r\n */\r\n public static makeLogoCard(\r\n opts: {\r\n /** The heading to be put at the top of this logo card inside an <h2>. May include HTML. */\r\n heading: string | HTMLElement;\r\n /** The URL or HTMLImageElement for the icon on this logo card. */\r\n iconSrc?: string | HTMLImageElement;\r\n /** The width of the icon, if `iconSrc` is a string. Default is 64. */\r\n iconWidth?: number;\r\n /** A *notice* string to be shown on the logo card. May include HTML. */\r\n notice?: string | HTMLElement;\r\n }): HTMLTableRowElement {\r\n const card = IModelApp.makeHTMLElement(\"tr\");\r\n const iconCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-logo\" });\r\n if (undefined !== opts.iconSrc) {\r\n if (typeof opts.iconSrc === \"string\") {\r\n const logo = IModelApp.makeHTMLElement(\"img\");\r\n logo.src = opts.iconSrc;\r\n logo.width = opts.iconWidth ? opts.iconWidth : 64;\r\n opts.iconSrc = logo;\r\n }\r\n iconCell.appendChild(opts.iconSrc);\r\n }\r\n const noticeCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-message\" });\r\n if (undefined !== opts.heading) {\r\n if (typeof opts.heading === \"string\")\r\n IModelApp.makeHTMLElement(\"h2\", { parent: noticeCell, innerHTML: opts.heading, className: \"logo-card-header\" });\r\n else\r\n noticeCell.appendChild(opts.heading);\r\n }\r\n if (undefined !== opts.notice) {\r\n if (typeof opts.notice === \"string\")\r\n IModelApp.makeHTMLElement(\"p\", { parent: noticeCell, innerHTML: opts.notice, className: \"logo-cards\" });\r\n else\r\n noticeCell.appendChild(opts.notice);\r\n }\r\n return card;\r\n }\r\n\r\n /** Make the logo card for the library itself. This card gets placed at the top of the stack.\r\n * @internal\r\n */\r\n public static makeIModelJsLogoCard() {\r\n return this.makeLogoCard({\r\n iconSrc: `${this.publicPath}images/about-imodeljs.svg`,\r\n heading: `<span style=\"font-weight:normal\">${this.localization.getLocalizedString(\"iModelJs:Notices.PoweredBy\")}</span> iTwin.js`,\r\n notice: `${ITWINJS_CORE_VERSION}<br>${COPYRIGHT_NOTICE}`,\r\n });\r\n }\r\n\r\n /** Format the tooltip strings returned by [[IModelConnection.getToolTipMessage]].\r\n * @alpha\r\n */\r\n public static formatElementToolTip(msg: string[]): HTMLElement {\r\n let out = \"\";\r\n msg.forEach((line) => out += `${IModelApp.localization?.getLocalizedKeys(line)}<br>`);\r\n const div = document.createElement(\"div\");\r\n div.innerHTML = out;\r\n return div;\r\n }\r\n\r\n /** Localize an error status\r\n * @param status one of the status values from [BentleyStatus]($core-bentley), [IModelStatus]($core-bentley) or [DbResult]($core-bentley)\r\n * @returns a localized error message\r\n * @beta\r\n */\r\n public static translateStatus(status: number) {\r\n let key: { scope: string, val: string, status?: string };\r\n if (typeof status !== \"number\") {\r\n key = { scope: \"Errors\", val: \"IllegalValue\" };\r\n } else {\r\n key = { scope: \"BentleyStatus\", val: BentleyStatus[status] };\r\n if (!key.val)\r\n key = { scope: \"IModelStatus\", val: IModelStatus[status] };\r\n if (!key.val)\r\n key = { scope: \"DbResult\", val: DbResult[status] };\r\n if (!key.val)\r\n key = { scope: \"Errors\", val: \"Status\", status: status.toString() };\r\n }\r\n\r\n return this.localization.getLocalizedString(`iModelJs:${key.scope}.${key.val}`, key);\r\n }\r\n\r\n /**\r\n * Creates an instance of the ExtensionAdmin\r\n * and registers an event to execute after startup is complete\r\n * @returns an instance of ExtensionAdmin\r\n */\r\n private static _createExtensionAdmin(): ExtensionAdmin {\r\n const extensionAdmin = new ExtensionAdmin();\r\n IModelApp.onAfterStartup.addListener(extensionAdmin.onStartup);\r\n return extensionAdmin;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IModelApp.js","sourceRoot":"","sources":["../../src/IModelAp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;GAEG;AACoB,mBAAS,GAAqB,IAAI,iCAAgB,EAAE,AAA3C,CAA4C;AAE5E,aAAa;AACU,wBAAc,GAAG,EAAI,CAAC,qBAAqB,EAAE,AAA/B,CAAgC;AAErE,gDAAgD;AACjC,wBAAc,GAAG,IAAI,GAAG,EAA8B,AAAxC,CAAyC;AAxH3D,8BAAS","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\n// @ts-expect-error package.json will resolve from the lib/{cjs,esm} dir without copying it into the build output we deliver\r\n// eslint-disable-next-line @itwin/import-within-package\r\nimport packageJson from \"../../package.json\";\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nexport const ITWINJS_CORE_VERSION = packageJson.version as string;\r\nconst COPYRIGHT_NOTICE = 'Copyright © 2017-2024 <a href=\"https://www.bentley.com\" target=\"_blank\" rel=\"noopener noreferrer\">Bentley Systems, Inc.</a>';\r\n\r\nimport { UiAdmin } from \"@itwin/appui-abstract\";\r\nimport { AccessToken, BeDuration, BeEvent, BentleyStatus, DbResult, dispose, Guid, GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n AuthorizationClient, IModelStatus, Localization, RealityDataAccess, RpcConfiguration, RpcInterfaceDefinition, RpcRequest, SerializedRpcActivity,\r\n} from \"@itwin/core-common\";\r\nimport { ITwinLocalization } from \"@itwin/core-i18n\";\r\nimport { TelemetryManager } from \"@itwin/core-telemetry\";\r\nimport { queryRenderCompatibility, WebGLRenderCompatibilityInfo } from \"@itwin/webgl-compatibility\";\r\nimport { AccuDraw } from \"./AccuDraw\";\r\nimport { AccuSnap } from \"./AccuSnap\";\r\nimport * as auxCoordState from \"./AuxCoordSys\";\r\nimport * as categorySelectorState from \"./CategorySelectorState\";\r\nimport { ExtensionAdmin } from \"./extension/ExtensionAdmin\";\r\nimport * as displayStyleState from \"./DisplayStyleState\";\r\nimport * as drawingViewState from \"./DrawingViewState\";\r\nimport { ElementLocateManager } from \"./ElementLocateManager\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { FrontendHubAccess } from \"./FrontendHubAccess\";\r\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\r\nimport * as modelselector from \"./ModelSelectorState\";\r\nimport * as modelState from \"./ModelState\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { QuantityFormatter } from \"./quantity-formatting/QuantityFormatter\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { System } from \"./render/webgl/System\";\r\nimport * as sheetState from \"./SheetViewState\";\r\nimport * as spatialViewState from \"./SpatialViewState\";\r\nimport { TentativePoint } from \"./TentativePoint\";\r\nimport { RealityDataSourceProviderRegistry } from \"./RealityDataSource\";\r\nimport { MapLayerFormatRegistry, MapLayerOptions, TerrainProviderRegistry, TileAdmin } from \"./tile/internal\";\r\nimport * as accudrawTool from \"./tools/AccuDrawTool\";\r\nimport * as clipViewTool from \"./tools/ClipViewTool\";\r\nimport * as idleTool from \"./tools/IdleTool\";\r\nimport * as measureTool from \"./tools/MeasureTool\";\r\nimport * as selectTool from \"./tools/SelectTool\";\r\nimport { ToolRegistry } from \"./tools/Tool\";\r\nimport { ToolAdmin } from \"./tools/ToolAdmin\";\r\nimport * as viewTool from \"./tools/ViewTool\";\r\nimport { UserPreferencesAccess } from \"./UserPreferences\";\r\nimport { ViewManager } from \"./ViewManager\";\r\nimport * as viewState from \"./ViewState\";\r\nimport \"./IModeljs-css\";\r\n\r\n// cSpell:ignore noopener noreferrer gprid forin nbsp csrf xsrf\r\n\r\n/** Options that can be supplied with [[IModelAppOptions]] to customize frontend security.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FrontendSecurityOptions {\r\n /** Configures protection from Cross Site Request Forgery attacks. */\r\n readonly csrfProtection?: {\r\n /** If enabled, IModelApp will extract the CSRF token for the current session from the document's cookies and send it with each request as a header value. */\r\n readonly enabled: boolean;\r\n /** Defaults to XSRF-TOKEN. */\r\n readonly cookieName?: string;\r\n /** Defaults to X-XSRF-TOKEN. */\r\n readonly headerName?: string;\r\n };\r\n}\r\n\r\n/** Options that can be supplied to [[IModelApp.startup]] to customize frontend behavior.\r\n * @public\r\n */\r\nexport interface IModelAppOptions {\r\n /** If present, supplies the [[FrontendHubAccess]] for this session. */\r\n hubAccess?: FrontendHubAccess;\r\n /** If present, supplies the Id of this application. Applications must set this to the Bentley Global Product Registry Id (GPRID) for usage logging. */\r\n applicationId?: string;\r\n /** If present, supplies the version of this application. Must be set for usage logging. */\r\n applicationVersion?: string;\r\n /** If present, supplies the [[UserPreferencesAccess]] for this session.\r\n * @beta\r\n */\r\n userPreferences?: UserPreferencesAccess;\r\n /** If present, supplies the [[ViewManager]] for this session. */\r\n viewManager?: ViewManager;\r\n /** If present, supplies Map Layer Options for this session such as Azure Access Keys\r\n * @beta\r\n */\r\n mapLayerOptions?: MapLayerOptions;\r\n /** If present, supplies the properties with which to initialize the [[TileAdmin]] for this session. */\r\n tileAdmin?: TileAdmin.Props;\r\n /** If present, supplies the [[NotificationManager]] for this session. */\r\n notifications?: NotificationManager;\r\n /** If present, supplies the [[ToolAdmin]] for this session. */\r\n toolAdmin?: ToolAdmin;\r\n /** If present, supplies the [[AccuDraw]] for this session. */\r\n accuDraw?: AccuDraw;\r\n /** If present, supplies the [[AccuSnap]] for this session. */\r\n accuSnap?: AccuSnap;\r\n /** If present, supplies the [[Localization]] for this session. Defaults to [ITwinLocalization]($i18n). */\r\n localization?: Localization;\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n authorizationClient?: AuthorizationClient;\r\n /** If present, supplies security options for the frontend. */\r\n security?: FrontendSecurityOptions;\r\n /** @internal */\r\n sessionId?: GuidString;\r\n /** @internal */\r\n locateManager?: ElementLocateManager;\r\n /** If present, supplies the [[TentativePoint]] for this session. */\r\n tentativePoint?: TentativePoint;\r\n /** @internal */\r\n quantityFormatter?: QuantityFormatter;\r\n /** If present, supplies an implementation of the render system, or options for initializing the default render system. */\r\n renderSys?: RenderSystem | RenderSystem.Options;\r\n /** If present, supplies the [[UiAdmin]] for this session. */\r\n uiAdmin?: UiAdmin;\r\n /** If present, determines whether iModelApp is a NoRenderApp\r\n * @internal\r\n */\r\n noRender?: boolean;\r\n /**\r\n * @deprecated in 3.7. Specify desired RPC interfaces in the platform-specific RPC manager call instead.\r\n * See [[MobileRpcManager.initializeClient]], [[ElectronRpcManager.initializeFrontend]], [[BentleyCloudRpcManager.initializeClient]].\r\n */\r\n rpcInterfaces?: RpcInterfaceDefinition[];\r\n /** @beta */\r\n realityDataAccess?: RealityDataAccess;\r\n /** If present, overrides where public assets are fetched. The default is to fetch assets relative to the current URL.\r\n * The path should always end with a trailing `/`.\r\n * @beta\r\n */\r\n publicPath?: string;\r\n}\r\n\r\n/** Options for [[IModelApp.makeModalDiv]]\r\n * @public\r\n */\r\nexport interface ModalOptions {\r\n /** Width for the Modal dialog box. */\r\n width?: number;\r\n /** The dialog should be dismissed if the user clicks anywhere or hits Enter or Escape on the keyboard. */\r\n autoClose?: boolean;\r\n /** Show an 'x' in the upper right corner to close the dialog */\r\n closeBox?: boolean;\r\n /** The parent for the semi transparent *darkening* div. If not present, use `document.body` */\r\n rootDiv?: HTMLElement;\r\n}\r\n\r\n/** Return type for [[IModelApp.makeModalDiv]]\r\n * @public\r\n */\r\nexport interface ModalReturn {\r\n /** The modal HTMLDivElement created. */\r\n modal: HTMLDivElement;\r\n /** A function that can be set as an event handler to stop the modal dialog. This can be used if [[ModalOptions.autoClose]] or [[IModalOptions.closeBox]]\r\n * were not enabled for the dialog.\r\n */\r\n stop: (_ev: Event) => void;\r\n}\r\n\r\n/** We hang the IModelApp object off the global `window` object in IModelApp.startup for debugging purposes.\r\n * It's removed in IModelApp.shutdown.\r\n */\r\ninterface IModelAppForDebugger {\r\n iModelAppForDebugger?: typeof IModelApp;\r\n}\r\n\r\n/**\r\n * Global singleton that connects the user interface with the iTwin.js services. There can be only one IModelApp active in a session. All\r\n * members of IModelApp are static, and it serves as a singleton object for gaining access to session information.\r\n *\r\n * Before any interactive operations may be performed by the `@itwin/core-frontend package`, [[IModelApp.startup]] must be called and awaited.\r\n * Applications may customize the frontend behavior of iTwin.js by supplying options to [[IModelApp.startup]].\r\n *\r\n * @public\r\n */\r\nexport class IModelApp {\r\n private static _initialized = false;\r\n private static _accuDraw: AccuDraw;\r\n private static _accuSnap: AccuSnap;\r\n private static _applicationId: string;\r\n private static _applicationVersion: string;\r\n private static _localization: Localization;\r\n private static _locateManager: ElementLocateManager;\r\n private static _notifications: NotificationManager;\r\n private static _quantityFormatter: QuantityFormatter;\r\n private static _renderSystem?: RenderSystem;\r\n private static _userPreferences?: UserPreferencesAccess;\r\n private static _tentativePoint: TentativePoint;\r\n private static _tileAdmin: TileAdmin;\r\n private static _toolAdmin: ToolAdmin;\r\n private static _viewManager: ViewManager;\r\n private static _uiAdmin: UiAdmin;\r\n private static _noRender: boolean;\r\n private static _wantEventLoop = false;\r\n private static _animationRequested = false;\r\n private static _animationInterval: BeDuration | undefined = BeDuration.fromSeconds(1);\r\n private static _animationIntervalId?: number;\r\n private static _securityOptions: FrontendSecurityOptions;\r\n private static _mapLayerFormatRegistry: MapLayerFormatRegistry;\r\n private static _terrainProviderRegistry: TerrainProviderRegistry;\r\n private static _realityDataSourceProviders: RealityDataSourceProviderRegistry;\r\n private static _hubAccess?: FrontendHubAccess;\r\n private static _realityDataAccess?: RealityDataAccess;\r\n private static _publicPath: string;\r\n\r\n // No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.\r\n protected constructor() { }\r\n\r\n /** Event raised just before the frontend IModelApp is to be [[shutdown]]. */\r\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\r\n\r\n /** Event raised after IModelApp [[startup]] completes. */\r\n public static readonly onAfterStartup = new BeEvent<() => void>();\r\n\r\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\r\n public static authorizationClient?: AuthorizationClient;\r\n /** The [[ToolRegistry]] for this session. */\r\n public static readonly tools = new ToolRegistry();\r\n /** A uniqueId for this session */\r\n public static sessionId: GuidString;\r\n /** The [[MapLayerFormatRegistry]] for this session. */\r\n public static get mapLayerFormatRegistry(): MapLayerFormatRegistry { return this._mapLayerFormatRegistry; }\r\n /** The [[TerrainProviderRegistry]] for this session. */\r\n public static get terrainProviderRegistry(): TerrainProviderRegistry { return this._terrainProviderRegistry; }\r\n /** The [[RealityDataSourceProviderRegistry]] for this session.\r\n * @alpha\r\n */\r\n public static get realityDataSourceProviders(): RealityDataSourceProviderRegistry { return this._realityDataSourceProviders; }\r\n /** The [[RenderSystem]] for this session. */\r\n public static get renderSystem(): RenderSystem { return this._renderSystem!; }\r\n /** The [[ViewManager]] for this session. */\r\n public static get viewManager(): ViewManager { return this._viewManager; }\r\n /** The [[NotificationManager]] for this session. */\r\n public static get notifications(): NotificationManager { return this._notifications; }\r\n /** The [[TileAdmin]] for this session. */\r\n public static get tileAdmin(): TileAdmin { return this._tileAdmin; }\r\n /** The [[QuantityFormatter]] for this session. */\r\n public static get quantityFormatter(): QuantityFormatter { return this._quantityFormatter; }\r\n /** The [[ToolAdmin]] for this session. */\r\n public static get toolAdmin(): ToolAdmin { return this._toolAdmin; }\r\n /** The [[AccuDraw]] for this session. */\r\n public static get accuDraw(): AccuDraw { return this._accuDraw; }\r\n /** The [[AccuSnap]] for this session. */\r\n public static get accuSnap(): AccuSnap { return this._accuSnap; }\r\n public static get locateManager(): ElementLocateManager { return this._locateManager; }\r\n /** The [[TentativePoint]] for this session]]. */\r\n public static get tentativePoint(): TentativePoint { return this._tentativePoint; }\r\n /** The [[Localization]] for this session. */\r\n public static get localization(): Localization { return this._localization; }\r\n /** The [[UserPreferencesAccess]] for this session.\r\n * @beta\r\n */\r\n public static get userPreferences(): UserPreferencesAccess | undefined { return this._userPreferences; }\r\n /** The Id of this application. Applications must set this to the Global Product Registry ID (GPRID) for usage logging. */\r\n public static get applicationId(): string { return this._applicationId; }\r\n /** The version of this application. Must be set for usage logging. */\r\n public static get applicationVersion(): string { return this._applicationVersion; }\r\n /** True after [[startup]] has been called, until [[shutdown]] is called. */\r\n public static get initialized() { return this._initialized; }\r\n\r\n /** Provides access to IModelHub services. */\r\n public static get hubAccess(): FrontendHubAccess | undefined { return this._hubAccess; }\r\n\r\n /** Provides access to the RealityData service implementation for this IModelApp\r\n * @beta\r\n */\r\n public static get realityDataAccess(): RealityDataAccess | undefined { return this._realityDataAccess; }\r\n\r\n /** Whether the [renderSystem[]] has been successfully initialized.\r\n * This will always be `false` before calling [[startup]] and after calling [[shutdown]].\r\n * In rare circumstances (e.g., while executing in a headless test environment) it may remain `false` due to a failure to\r\n * obtain a [WebGL rendering context](https://www.google.com/search?channel=fs&client=ubuntu-sn&q=mdn+webglrenderingcontext).\r\n * As long as you have called [[startup]], you can generally assume it to be `true`.\r\n */\r\n public static get hasRenderSystem() {\r\n return this._renderSystem !== undefined && this._renderSystem.isValid;\r\n }\r\n\r\n /** The [[UiAdmin]] for this session. */\r\n public static get uiAdmin() { return this._uiAdmin; }\r\n /** The requested security options for the frontend. */\r\n public static get securityOptions() { return this._securityOptions; }\r\n /** The root URL for the assets 'public' folder.\r\n * @beta\r\n */\r\n public static get publicPath() { return this._publicPath; }\r\n /** The [[TelemetryManager]] for this session\r\n * @internal\r\n */\r\n public static readonly telemetry: TelemetryManager = new TelemetryManager();\r\n\r\n /** @alpha */\r\n public static readonly extensionAdmin = this._createExtensionAdmin();\r\n\r\n /** Map of classFullName to EntityState class */\r\n private static _entityClasses = new Map<string, typeof EntityState>();\r\n\r\n /** Register all of the subclasses of EntityState from a module.\r\n * @internal\r\n */\r\n public static registerModuleEntities(moduleObj: any) {\r\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\r\n const thisEntityState = moduleObj[thisMember];\r\n if (thisEntityState.prototype instanceof EntityState) {\r\n this.registerEntityState(thisEntityState.classFullName, thisEntityState);\r\n }\r\n }\r\n }\r\n\r\n /** Register an EntityState class by its classFullName\r\n * @internal\r\n */\r\n public static registerEntityState(classFullName: string, classType: typeof EntityState) {\r\n const lowerName = classFullName.toLowerCase();\r\n if (this._entityClasses.has(lowerName)) {\r\n const errMsg = `Class ${classFullName} is already registered. Make sure static schemaName and className members are correct on class ${classType.name}`;\r\n Logger.logError(FrontendLoggerCategory.IModelConnection, errMsg);\r\n throw new Error(errMsg);\r\n }\r\n\r\n this._entityClasses.set(lowerName, classType);\r\n }\r\n\r\n /** @internal */\r\n public static lookupEntityClass(classFullName: string) { return this._entityClasses.get(classFullName.toLowerCase()); }\r\n\r\n /**\r\n * Obtain WebGL rendering compatibility information for the client system. This information describes whether the client meets the\r\n * minimum rendering capabilities. It also describes whether the system lacks any optional capabilities that could improve quality\r\n * and/or performance.\r\n * @note As of 4.x, iTwin.js requires WebGL 2. If the client does not support WebGL 2, the `status` field of the returned compatibility info will be [WebGLRenderCompatibilityStatus.CannotCreateContext]($webgl-compatibility).\r\n */\r\n public static queryRenderCompatibility(): WebGLRenderCompatibilityInfo {\r\n return queryRenderCompatibility(true, (canvas, useWebGL2, inputContextAttributes) => System.createContext(canvas, useWebGL2, inputContextAttributes));\r\n }\r\n\r\n /**\r\n * This method must be called before any other `@itwin/core-frontend` methods are used.\r\n * Somewhere in your startup code, call [[IModelApp.startup]]. E.g.:\r\n * ``` ts\r\n * await IModelApp.startup( {applicationId: myAppId} );\r\n * ```\r\n * @param opts The options for configuring IModelApp\r\n */\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n if (this._initialized)\r\n return; // we're already initialized, do nothing.\r\n this._initialized = true;\r\n\r\n opts = opts ?? {};\r\n this._securityOptions = opts.security ?? {};\r\n\r\n if (process.env.NODE_ENV === \"development\") {\r\n // Make IModelApp globally accessible for debugging purposes. We'll remove it on shutdown.\r\n (window as IModelAppForDebugger).iModelAppForDebugger = this;\r\n }\r\n\r\n this.sessionId = opts.sessionId ?? Guid.createValue();\r\n this._applicationId = opts.applicationId ?? \"2686\"; // Default to product id of iTwin.js\r\n this._applicationVersion = opts.applicationVersion ?? \"1.0.0\";\r\n this.authorizationClient = opts.authorizationClient;\r\n this._hubAccess = opts.hubAccess;\r\n this._noRender = opts.noRender ?? false;\r\n\r\n this._setupRpcRequestContext();\r\n\r\n this._localization = opts.localization ?? new ITwinLocalization();\r\n const toolsNs = \"CoreTools\";\r\n await this.localization.initialize([\"iModelJs\", toolsNs]);\r\n [\r\n selectTool,\r\n idleTool,\r\n viewTool,\r\n clipViewTool,\r\n measureTool,\r\n accudrawTool,\r\n ].forEach((tool) => this.tools.registerModule(tool, toolsNs));\r\n\r\n this.registerEntityState(EntityState.classFullName, EntityState);\r\n [\r\n modelState,\r\n sheetState,\r\n viewState,\r\n drawingViewState,\r\n spatialViewState,\r\n displayStyleState,\r\n modelselector,\r\n categorySelectorState,\r\n auxCoordState,\r\n ].forEach((module) => this.registerModuleEntities(module));\r\n\r\n this._renderSystem = (opts.renderSys instanceof RenderSystem) ? opts.renderSys : this.createRenderSys(opts.renderSys);\r\n if (opts.userPreferences)\r\n this._userPreferences = opts.userPreferences;\r\n this._viewManager = opts.viewManager ?? new ViewManager();\r\n this._tileAdmin = await TileAdmin.create(opts.tileAdmin);\r\n this._notifications = opts.notifications ?? new NotificationManager();\r\n this._toolAdmin = opts.toolAdmin ?? new ToolAdmin();\r\n this._accuDraw = opts.accuDraw ?? new AccuDraw();\r\n this._accuSnap = opts.accuSnap ?? new AccuSnap();\r\n this._locateManager = opts.locateManager ?? new ElementLocateManager();\r\n this._tentativePoint = opts.tentativePoint ?? new TentativePoint();\r\n this._quantityFormatter = opts.quantityFormatter ?? new QuantityFormatter();\r\n this._uiAdmin = opts.uiAdmin ?? new UiAdmin();\r\n this._mapLayerFormatRegistry = new MapLayerFormatRegistry(opts.mapLayerOptions);\r\n this._terrainProviderRegistry = new TerrainProviderRegistry();\r\n this._realityDataSourceProviders = new RealityDataSourceProviderRegistry();\r\n this._realityDataAccess = opts.realityDataAccess;\r\n this._publicPath = opts.publicPath ?? \"\";\r\n\r\n [\r\n this.renderSystem,\r\n this.viewManager,\r\n this.toolAdmin,\r\n this.accuDraw,\r\n this.accuSnap,\r\n this.locateManager,\r\n this.tentativePoint,\r\n this.uiAdmin,\r\n ].forEach((sys) => sys.onInitialized());\r\n\r\n await this.quantityFormatter.onInitialized();\r\n this.onAfterStartup.raiseEvent();\r\n }\r\n\r\n /** Must be called before the application exits to release any held resources. */\r\n public static async shutdown() {\r\n if (!this._initialized)\r\n return;\r\n\r\n // notify listeners that this IModelApp is about to be shut down.\r\n this.onBeforeShutdown.raiseEvent();\r\n this.onBeforeShutdown.clear();\r\n\r\n if (process.env.NODE_ENV === \"development\") {\r\n (window as IModelAppForDebugger).iModelAppForDebugger = undefined;\r\n }\r\n\r\n this._wantEventLoop = false;\r\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\r\n this.clearIntervalAnimation();\r\n [this.toolAdmin, this.viewManager, this.tileAdmin].forEach((sys) => sys.onShutDown());\r\n this.tools.shutdown();\r\n this._renderSystem = dispose(this._renderSystem);\r\n this._entityClasses.clear();\r\n this.authorizationClient = undefined;\r\n this._initialized = false;\r\n this.onAfterStartup.clear();\r\n }\r\n\r\n /** Controls how frequently the application polls for changes that may require a new animation frame to be requested.\r\n * Such changes include resizing a Viewport or changing the device pixel ratio by zooming in or out in the browser.\r\n * The default interval is 1 second. It may be desirable to override the default for specific apps and/or devices.\r\n * - Increasing the interval can conserve battery life on battery-powered devices at the expense of slower response to resize events.\r\n * - An application that only displays a single Viewport whose dimensions only change when the dimensions of the application window change, and which does not support changing application zoom level, could disable the interval altogether.\r\n * @param interval The interval at which to poll for changes. If undefined (or negative), the application will never poll. If zero, the application will poll as frequently as possible.\r\n * @beta\r\n */\r\n public static get animationInterval(): BeDuration | undefined { return IModelApp._animationInterval; }\r\n public static set animationInterval(interval: BeDuration | undefined) {\r\n if (undefined !== interval && interval.isTowardsPast)\r\n interval = undefined;\r\n\r\n if (interval !== IModelApp._animationInterval) {\r\n IModelApp._animationInterval = interval;\r\n if (IModelApp._wantEventLoop)\r\n IModelApp.requestIntervalAnimation();\r\n }\r\n }\r\n\r\n /** Request that the event loop execute on the next [animation frame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).\r\n * There is generally no reason for applications to invoke this method directly.\r\n */\r\n public static requestNextAnimation() {\r\n // Only want to call requestAnimationFrame if it is defined. Need to check whether current iModelApp is a NoRenderApp.\r\n if (IModelApp._noRender)\r\n return;\r\n\r\n if (!IModelApp._animationRequested) {\r\n IModelApp._animationRequested = true;\r\n requestAnimationFrame(() => IModelApp.eventLoop());\r\n }\r\n }\r\n\r\n /** @internal */\r\n private static clearIntervalAnimation(): void {\r\n if (undefined !== IModelApp._animationIntervalId) {\r\n window.clearInterval(IModelApp._animationIntervalId);\r\n IModelApp._animationIntervalId = undefined;\r\n }\r\n }\r\n\r\n /** @internal */\r\n private static requestIntervalAnimation(): void {\r\n IModelApp.clearIntervalAnimation();\r\n\r\n if (undefined !== IModelApp.animationInterval)\r\n IModelApp._animationIntervalId = window.setInterval(() => {\r\n IModelApp.requestNextAnimation();\r\n }, IModelApp.animationInterval.milliseconds);\r\n }\r\n\r\n /** @internal */\r\n public static startEventLoop() {\r\n if (!IModelApp._wantEventLoop) {\r\n IModelApp._wantEventLoop = true;\r\n window.addEventListener(\"resize\", () => IModelApp.requestNextAnimation());\r\n IModelApp.requestIntervalAnimation();\r\n IModelApp.requestNextAnimation();\r\n }\r\n }\r\n\r\n /** Strictly for tests. @internal */\r\n public static stopEventLoop() {\r\n this._wantEventLoop = false;\r\n }\r\n\r\n /** The main event processing loop for Tools and rendering. */\r\n private static eventLoop() {\r\n IModelApp._animationRequested = false;\r\n if (!IModelApp._wantEventLoop) // flag turned on at startup\r\n return;\r\n\r\n try {\r\n IModelApp.toolAdmin.processEvent(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n IModelApp.viewManager.renderLoop();\r\n IModelApp.tileAdmin.process();\r\n } catch (exception) {\r\n ToolAdmin.exceptionHandler(exception); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n IModelApp._wantEventLoop = false;\r\n IModelApp._animationRequested = true; // unrecoverable after exception, don't request any further frames.\r\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\r\n }\r\n }\r\n\r\n /** Get the user's access token for this IModelApp, or a blank string if none is available.\r\n * @note Access tokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\r\n * returned by this method may change over time throughout the course of a session.\r\n */\r\n public static async getAccessToken(): Promise<AccessToken> {\r\n try {\r\n return (await this.authorizationClient?.getAccessToken()) ?? \"\";\r\n } catch (e) {\r\n return \"\";\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static createRenderSys(opts?: RenderSystem.Options): RenderSystem { return System.create(opts); }\r\n\r\n private static _setupRpcRequestContext() {\r\n RpcConfiguration.requestContext.getId = (_request: RpcRequest): string => {\r\n return Guid.createValue();\r\n };\r\n\r\n RpcConfiguration.requestContext.serialize = async (_request: RpcRequest): Promise<SerializedRpcActivity> => { // eslint-disable-line deprecation/deprecation\r\n const id = _request.id;\r\n const serialized: SerializedRpcActivity = { // eslint-disable-line deprecation/deprecation\r\n id,\r\n applicationId: this.applicationId,\r\n applicationVersion: this.applicationVersion,\r\n sessionId: this.sessionId,\r\n authorization: ProcessDetector.isMobileAppFrontend ? \"\" : await this.getAccessToken(),\r\n };\r\n\r\n const csrf = IModelApp.securityOptions.csrfProtection;\r\n if (csrf && csrf.enabled) {\r\n const cookieName = csrf.cookieName || \"XSRF-TOKEN\";\r\n const cookieValue = document.cookie.split(\"; \").find((r) => r.startsWith(`${cookieName}=`));\r\n\r\n if (cookieValue) {\r\n const headerName = csrf.headerName || \"X-XSRF-TOKEN\";\r\n const headerValue = cookieValue.split(\"=\")[1];\r\n serialized.csrfToken = { headerName, headerValue };\r\n }\r\n }\r\n\r\n return serialized;\r\n };\r\n }\r\n\r\n /** Shortcut for creating an HTMLElement with optional parent, className, id, innerHTML, innerText. */\r\n public static makeHTMLElement<K extends keyof HTMLElementTagNameMap>(type: K, opt?: {\r\n /** The parent for the new HTMLElement */\r\n parent?: HTMLElement;\r\n /** The className for the new HTMLElement */\r\n className?: string;\r\n /** The Id for the new HTMLElement */\r\n id?: string;\r\n /** innerHTML for the new HTMLElement */\r\n innerHTML?: string;\r\n /** innerText for the new HTMLElement */\r\n innerText?: string;\r\n }) {\r\n const el = document.createElement(type);\r\n if (undefined !== opt) {\r\n if (undefined !== opt.className)\r\n el.className = opt.className;\r\n if (undefined !== opt.id)\r\n el.id = opt.id;\r\n if (undefined !== opt.innerHTML)\r\n el.innerHTML = opt.innerHTML;\r\n if (undefined !== opt.innerText)\r\n el.innerText = opt.innerText;\r\n if (undefined !== opt.parent)\r\n opt.parent.appendChild(el);\r\n }\r\n return el;\r\n }\r\n\r\n /** Shortcut for making a modal dialog on top of the root of the application. The returned HTMLDivElement will be placed topmost, all other application\r\n * windows will be covered with a semi-transparent background that intercepts all key/mouse/touch events until the modal is dismissed.\r\n * @param options The options that describe how the modal should work.\r\n */\r\n public static makeModalDiv(options: ModalOptions): ModalReturn {\r\n const root = options.rootDiv ? options.rootDiv : document.body;\r\n // create the overlay div to \"black out\" the application to indicate everything is inactive until the modal has been dismissed.\r\n const overlay = IModelApp.makeHTMLElement(\"div\", { parent: root, className: \"imodeljs-modal-overlay\" });\r\n overlay.tabIndex = -1; // so we can catch keystroke events\r\n\r\n // function to remove modal dialog\r\n const stop = (ev: Event) => {\r\n root.removeChild(overlay);\r\n ev.stopPropagation();\r\n };\r\n\r\n if (options.autoClose) {\r\n overlay.onclick = overlay.oncontextmenu = stop;\r\n overlay.onkeydown = overlay.onkeyup = (ev: KeyboardEvent) => { // ignore all keystrokes other than enter and escape\r\n switch (ev.key) {\r\n case \"Enter\":\r\n case \"Escape\":\r\n stop(ev);\r\n return;\r\n }\r\n ev.stopPropagation();\r\n };\r\n overlay.focus();\r\n }\r\n\r\n const modal = IModelApp.makeHTMLElement(\"div\", { parent: overlay, className: \"imodeljs-modal\" });\r\n if (undefined !== options.width) {\r\n modal.style.width = `${options.width}px`;\r\n // allow the dialog to be smaller than the width\r\n modal.style.maxWidth = `min(100% - (2 * var(--width-border)), ${options.width}px)`;\r\n }\r\n if (options.closeBox) {\r\n const close = IModelApp.makeHTMLElement(\"p\", { parent: modal, className: \"imodeljs-modal-close\" });\r\n close.innerText = \"\\u00d7\"; // unicode \"times\" symbol\r\n close.onclick = stop;\r\n }\r\n\r\n return { modal, stop };\r\n }\r\n\r\n /** Applications may implement this method to supply a Logo Card.\r\n * @beta\r\n */\r\n public static applicationLogoCard?: () => HTMLTableRowElement;\r\n\r\n /** Make a new Logo Card. Call this method from your implementation of [[IModelApp.applicationLogoCard]]\r\n * @param opts Options for Logo Card\r\n * @beta\r\n */\r\n public static makeLogoCard(\r\n opts: {\r\n /** The heading to be put at the top of this logo card inside an <h2>. May include HTML. */\r\n heading: string | HTMLElement;\r\n /** The URL or HTMLImageElement for the icon on this logo card. */\r\n iconSrc?: string | HTMLImageElement;\r\n /** The width of the icon, if `iconSrc` is a string. Default is 64. */\r\n iconWidth?: number;\r\n /** A *notice* string to be shown on the logo card. May include HTML. */\r\n notice?: string | HTMLElement;\r\n }): HTMLTableRowElement {\r\n const card = IModelApp.makeHTMLElement(\"tr\");\r\n const iconCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-logo\" });\r\n if (undefined !== opts.iconSrc) {\r\n if (typeof opts.iconSrc === \"string\") {\r\n const logo = IModelApp.makeHTMLElement(\"img\");\r\n logo.src = opts.iconSrc;\r\n logo.width = opts.iconWidth ? opts.iconWidth : 64;\r\n opts.iconSrc = logo;\r\n }\r\n iconCell.appendChild(opts.iconSrc);\r\n }\r\n const noticeCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-message\" });\r\n if (undefined !== opts.heading) {\r\n if (typeof opts.heading === \"string\")\r\n IModelApp.makeHTMLElement(\"h2\", { parent: noticeCell, innerHTML: opts.heading, className: \"logo-card-header\" });\r\n else\r\n noticeCell.appendChild(opts.heading);\r\n }\r\n if (undefined !== opts.notice) {\r\n if (typeof opts.notice === \"string\")\r\n IModelApp.makeHTMLElement(\"p\", { parent: noticeCell, innerHTML: opts.notice, className: \"logo-cards\" });\r\n else\r\n noticeCell.appendChild(opts.notice);\r\n }\r\n return card;\r\n }\r\n\r\n /** Make the logo card for the library itself. This card gets placed at the top of the stack.\r\n * @internal\r\n */\r\n public static makeIModelJsLogoCard() {\r\n return this.makeLogoCard({\r\n iconSrc: `${this.publicPath}images/about-imodeljs.svg`,\r\n heading: `<span style=\"font-weight:normal\">${this.localization.getLocalizedString(\"iModelJs:Notices.PoweredBy\")}</span> iTwin.js`,\r\n notice: `${ITWINJS_CORE_VERSION}<br>${COPYRIGHT_NOTICE}`,\r\n });\r\n }\r\n\r\n /** Format the tooltip strings returned by [[IModelConnection.getToolTipMessage]].\r\n * @alpha\r\n */\r\n public static formatElementToolTip(msg: string[]): HTMLElement {\r\n let out = \"\";\r\n msg.forEach((line) => out += `${IModelApp.localization?.getLocalizedKeys(line)}<br>`);\r\n const div = document.createElement(\"div\");\r\n div.innerHTML = out;\r\n return div;\r\n }\r\n\r\n /** Localize an error status\r\n * @param status one of the status values from [BentleyStatus]($core-bentley), [IModelStatus]($core-bentley) or [DbResult]($core-bentley)\r\n * @returns a localized error message\r\n * @beta\r\n */\r\n public static translateStatus(status: number) {\r\n let key: { scope: string, val: string, status?: string };\r\n if (typeof status !== \"number\") {\r\n key = { scope: \"Errors\", val: \"IllegalValue\" };\r\n } else {\r\n key = { scope: \"BentleyStatus\", val: BentleyStatus[status] };\r\n if (!key.val)\r\n key = { scope: \"IModelStatus\", val: IModelStatus[status] };\r\n if (!key.val)\r\n key = { scope: \"DbResult\", val: DbResult[status] };\r\n if (!key.val)\r\n key = { scope: \"Errors\", val: \"Status\", status: status.toString() };\r\n }\r\n\r\n return this.localization.getLocalizedString(`iModelJs:${key.scope}.${key.val}`, key);\r\n }\r\n\r\n /**\r\n * Creates an instance of the ExtensionAdmin\r\n * and registers an event to execute after startup is complete\r\n * @returns an instance of ExtensionAdmin\r\n */\r\n private static _createExtensionAdmin(): ExtensionAdmin {\r\n const extensionAdmin = new ExtensionAdmin();\r\n IModelApp.onAfterStartup.addListener(extensionAdmin.onStartup);\r\n return extensionAdmin;\r\n }\r\n}\r\n"]}
|
package/lib/cjs/ModelState.d.ts
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* @module ModelState
|
|
3
3
|
*/
|
|
4
4
|
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RelatedElement
|
|
5
|
+
import { GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RelatedElement } from "@itwin/core-common";
|
|
6
6
|
import { Point2d, Range3d } from "@itwin/core-geometry";
|
|
7
7
|
import { EntityState } from "./EntityState";
|
|
8
8
|
import { HitDetail } from "./HitDetail";
|
|
9
9
|
import { IModelConnection } from "./IModelConnection";
|
|
10
10
|
import { TileTreeReference } from "./tile/internal";
|
|
11
11
|
import { ViewState } from "./ViewState";
|
|
12
|
+
import { SpatialClassifiersState } from "./SpatialClassifiersState";
|
|
12
13
|
/** Represents the front-end state of a [Model]($backend).
|
|
13
14
|
* @public
|
|
14
15
|
* @extensions
|
|
@@ -120,7 +121,7 @@ export declare class SheetModelState extends GeometricModel2dState {
|
|
|
120
121
|
*/
|
|
121
122
|
export declare class SpatialModelState extends GeometricModel3dState {
|
|
122
123
|
/** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */
|
|
123
|
-
readonly classifiers?:
|
|
124
|
+
readonly classifiers?: SpatialClassifiersState;
|
|
124
125
|
static get className(): string;
|
|
125
126
|
/** @internal */
|
|
126
127
|
get asSpatialModel(): SpatialModelState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelState.d.ts","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAwE,cAAc,
|
|
1
|
+
{"version":3,"file":"ModelState.d.ts","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAwE,cAAc,EACpK,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAkG,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpJ,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,UAAW,SAAQ,WAAY,YAAW,UAAU;IAC/D,WAA2B,SAAS,WAAsB;IAC1D,SAAgB,cAAc,EAAE,cAAc,CAAC;IAC/C,SAAgB,IAAI,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,UAAU,CAAC;IAC/B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,UAAU,EAAE,OAAO,CAAC;gBAExB,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,UAAU;IAS3E,qEAAqE;IACrD,MAA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E;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB;IAC9D,WAA2B,SAAS,WAAqC;CAC1E;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAC1D,WAA2B,SAAS,WAA6B;CAClE;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB;IAC7D,WAA2B,SAAS,WAAoC;CACzE"}
|
package/lib/cjs/ModelState.js
CHANGED
|
@@ -14,6 +14,7 @@ const core_geometry_1 = require("@itwin/core-geometry");
|
|
|
14
14
|
const EntityState_1 = require("./EntityState");
|
|
15
15
|
const RealityDataSource_1 = require("./RealityDataSource");
|
|
16
16
|
const internal_1 = require("./tile/internal");
|
|
17
|
+
const SpatialClassifiersState_1 = require("./SpatialClassifiersState");
|
|
17
18
|
/** Represents the front-end state of a [Model]($backend).
|
|
18
19
|
* @public
|
|
19
20
|
* @extensions
|
|
@@ -226,7 +227,7 @@ class SpatialModelState extends GeometricModel3dState {
|
|
|
226
227
|
constructor(props, iModel, state) {
|
|
227
228
|
super(props, iModel, state);
|
|
228
229
|
if (this.isRealityModel)
|
|
229
|
-
this.classifiers =
|
|
230
|
+
this.classifiers = SpatialClassifiersState_1.SpatialClassifiersState.create(this.jsonProperties);
|
|
230
231
|
}
|
|
231
232
|
/** Return true if this is a reality model (represented by a 3d tile set). */
|
|
232
233
|
get isRealityModel() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelState.js","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAE4B;AAC5B,wDAAwD;AACxD,+CAA4C;AAG5C,2DAAwD;AACxD,8CAAoJ;AAGpJ;;;GAGG;AACH,MAAa,UAAW,SAAQ,yBAAW;IAClC,MAAM,KAAc,SAAS,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC;IAO1D,YAAY,KAAiB,EAAE,MAAwB,EA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AC;CACnE;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAFD,8DAEC;AAED;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,qBAAqB;IACnD,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAFD,8CAEC;AAED;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,iBAAiB;IACtD,MAAM,KAAc,SAAS,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC;CACzE;AAFD,4DAEC","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 ModelState\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RealityDataFormat, RealityDataSourceKey, RealityModelDisplaySettings, RelatedElement, SpatialClassifiers,\r\n} from \"@itwin/core-common\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createPrimaryTileTreeReference, createRealityTileTreeReference, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewState } from \"./ViewState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\r\n public static override get className() { return \"Model\"; }\r\n public readonly modeledElement: RelatedElement;\r\n public readonly name: string;\r\n public parentModel: Id64String;\r\n public readonly isPrivate: boolean;\r\n public readonly isTemplate: boolean;\r\n\r\n constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState) {\r\n super(props, iModel, state);\r\n this.modeledElement = RelatedElement.fromJSON(props.modeledElement)!;\r\n this.name = props.name ? props.name : \"\";\r\n this.parentModel = Id64.fromJSON(props.parentModel)!; // NB! Must always match the model of the modeledElement!\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n }\r\n\r\n /** Add all custom-handled properties of a Model to a json object. */\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.modeledElement = this.modeledElement;\r\n val.parentModel = this.parentModel;\r\n val.name = this.name;\r\n if (this.isPrivate)\r\n val.isPrivate = this.isPrivate;\r\n if (this.isTemplate)\r\n val.isTemplate = this.isTemplate;\r\n return val;\r\n }\r\n\r\n /** Determine whether this is a GeometricModel */\r\n public get isGeometricModel(): boolean { return false; }\r\n\r\n /** Attempts to cast this model to a geometric model. */\r\n public get asGeometricModel(): GeometricModelState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 3d geometric model. */\r\n public get asGeometricModel3d(): GeometricModel3dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 2d geometric model. */\r\n public get asGeometricModel2d(): GeometricModel2dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a spatial model. */\r\n public get asSpatialModel(): SpatialModelState | undefined { return undefined; }\r\n\r\n /**\r\n * Return the tool tip for this model. This is called only if the hit does not return a tooltip.\r\n * @internal\r\n */\r\n public getToolTip(_hit: HitDetail): HTMLElement | string | undefined { return undefined; }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel]($backend).\r\n * The contents of a GeometricModelState can be rendered inside a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\r\n public static override get className() { return \"GeometricModel\"; }\r\n /** @internal */\r\n public geometryGuid?: string;\r\n\r\n private _modelRange?: Range3d;\r\n\r\n constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState) {\r\n super(props, iModel, state);\r\n this.geometryGuid = props.geometryGuid;\r\n }\r\n\r\n /** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */\r\n public abstract get is3d(): boolean;\r\n /** @internal */\r\n public override get asGeometricModel(): GeometricModelState { return this; }\r\n /** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */\r\n public get is2d(): boolean { return !this.is3d; }\r\n\r\n /** @internal */\r\n public override get isGeometricModel(): boolean { return true; }\r\n /** @internal */\r\n public get treeModelId(): Id64String { return this.id; }\r\n\r\n /** Query for the union of the ranges of all the elements in this GeometricModel.\r\n * @note This value is cached after the first time it is called.\r\n * @public\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryExtents(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]?.extents);\r\n }\r\n\r\n return this._modelRange;\r\n }\r\n\r\n /** @internal */\r\n public createTileTreeReference(view: ViewState): TileTreeReference {\r\n // If this is a reality model, its tile tree is obtained from reality data service URL.\r\n\r\n const spatialModel = this.asSpatialModel;\r\n const rdSourceKey = this.jsonProperties.rdSourceKey;\r\n const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n const treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // url: tilesetUrl, // If rdSourceKey is defined, url is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // orbitGtBlob: props.orbitGtBlob!, // If rdSourceKey is defined, orbitGtBlob is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n return treeRef;\r\n }\r\n\r\n const orbitGtBlob = this.jsonProperties.orbitGtBlob;\r\n\r\n // If this is an OrbitGt reality model, create it's reference\r\n if(orbitGtBlob) {\r\n let orbitGtName = \"\";\r\n if (orbitGtBlob.blobFileName !== \"\") {\r\n if (orbitGtBlob.blobFileName[0] === \"/\")\r\n orbitGtName = orbitGtBlob.blobFileName.substring(1);\r\n else\r\n orbitGtName = orbitGtBlob.blobFileName;\r\n }\r\n // Create rdSourceKey if not provided\r\n const rdSourceKeyOGT: RealityDataSourceKey = RealityDataSource.createKeyFromOrbitGtBlobProps(orbitGtBlob);\r\n\r\n return createOrbitGtTileTreeReference({\r\n rdSourceKey: rdSourceKeyOGT,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n orbitGtBlob,\r\n name: orbitGtName,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n }\r\n\r\n // If this is a TileTree reality model, create it's reference\r\n const tilesetUrl = this.jsonProperties.tilesetUrl;\r\n\r\n if(tilesetUrl) {\r\n const rdSourceKeyCS = RealityDataSource.createKeyFromUrl(tilesetUrl);\r\n return createRealityTileTreeReference({\r\n rdSourceKey: rdSourceKeyCS,\r\n url : tilesetUrl,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this);\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\r\n public static override get className() { return \"GeometricModel2d\"; }\r\n /** @internal */\r\n public readonly globalOrigin: Point2d;\r\n\r\n constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState) {\r\n super(props, iModel, state);\r\n this.globalOrigin = Point2d.fromJSON(props.globalOrigin);\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return false; }\r\n /** @internal */\r\n public override get asGeometricModel2d(): GeometricModel2dState { return this; }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n val.globalOrigin = this.globalOrigin;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel3d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\r\n public static override get className() { return \"GeometricModel3d\"; }\r\n\r\n constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState) {\r\n super(props, iModel, state);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return true; }\r\n /** @internal */\r\n public override get asGeometricModel3d(): GeometricModel3dState { return this; }\r\n\r\n /** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n}\r\n\r\n/** Represents the front-end state of a [SheetModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\r\n public static override get className() { return \"SheetModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialModelState extends GeometricModel3dState {\r\n /** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */\r\n public readonly classifiers?: SpatialClassifiers;\r\n\r\n public static override get className() { return \"SpatialModel\"; }\r\n\r\n /** @internal */\r\n public override get asSpatialModel(): SpatialModelState { return this; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState) {\r\n super(props, iModel, state);\r\n if (this.isRealityModel)\r\n this.classifiers = new SpatialClassifiers(this.jsonProperties);\r\n }\r\n\r\n /** Return true if this is a reality model (represented by a 3d tile set). */\r\n public get isRealityModel(): boolean {\r\n return !!this.jsonProperties.tilesetUrl || !!this.jsonProperties.rdSourceKey || !!this.jsonProperties.orbitGtBlob;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\r\n public static override get className() { return \"PhysicalModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialLocationModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\r\n public static override get className() { return \"SpatialLocationModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [DrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\r\n public static override get className() { return \"DrawingModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SectionDrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ModelState.js","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAE4B;AAC5B,wDAAwD;AACxD,+CAA4C;AAG5C,2DAAwD;AACxD,8CAAoJ;AAEpJ,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,UAAW,SAAQ,yBAAW;IAClC,MAAM,KAAc,SAAS,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC;IAO1D,YAAY,KAAiB,EAAE,MAAwB,EAAE,KAAkB;QACzE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAE,CAAC;QACrE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,mBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAE,CAAC,CAAC,yDAAyD;QAC/G,IAAI,CAAC,SAAS,GAAG,wBAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,GAAG,wBAAS,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;IAED,qEAAqE;IACrD,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAgB,CAAC;QACzC,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACnC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,IAAI,IAAI,CAAC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,CAAC,WAAW,GAAG,iDAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED,6EAA6E;IAC7E,IAAW,cAAc;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACpH,CAAC;CACF;AAnBD,8CAmBC;AAED;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,iBAAiB;IAChD,MAAM,KAAc,SAAS,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;CACnE;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAFD,8DAEC;AAED;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,qBAAqB;IACnD,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAFD,8CAEC;AAED;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,iBAAiB;IACtD,MAAM,KAAc,SAAS,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC;CACzE;AAFD,4DAEC","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 ModelState\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RealityDataFormat, RealityDataSourceKey, RealityModelDisplaySettings, RelatedElement,\r\n} from \"@itwin/core-common\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createPrimaryTileTreeReference, createRealityTileTreeReference, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\r\n public static override get className() { return \"Model\"; }\r\n public readonly modeledElement: RelatedElement;\r\n public readonly name: string;\r\n public parentModel: Id64String;\r\n public readonly isPrivate: boolean;\r\n public readonly isTemplate: boolean;\r\n\r\n constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState) {\r\n super(props, iModel, state);\r\n this.modeledElement = RelatedElement.fromJSON(props.modeledElement)!;\r\n this.name = props.name ? props.name : \"\";\r\n this.parentModel = Id64.fromJSON(props.parentModel)!; // NB! Must always match the model of the modeledElement!\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n }\r\n\r\n /** Add all custom-handled properties of a Model to a json object. */\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.modeledElement = this.modeledElement;\r\n val.parentModel = this.parentModel;\r\n val.name = this.name;\r\n if (this.isPrivate)\r\n val.isPrivate = this.isPrivate;\r\n if (this.isTemplate)\r\n val.isTemplate = this.isTemplate;\r\n return val;\r\n }\r\n\r\n /** Determine whether this is a GeometricModel */\r\n public get isGeometricModel(): boolean { return false; }\r\n\r\n /** Attempts to cast this model to a geometric model. */\r\n public get asGeometricModel(): GeometricModelState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 3d geometric model. */\r\n public get asGeometricModel3d(): GeometricModel3dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 2d geometric model. */\r\n public get asGeometricModel2d(): GeometricModel2dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a spatial model. */\r\n public get asSpatialModel(): SpatialModelState | undefined { return undefined; }\r\n\r\n /**\r\n * Return the tool tip for this model. This is called only if the hit does not return a tooltip.\r\n * @internal\r\n */\r\n public getToolTip(_hit: HitDetail): HTMLElement | string | undefined { return undefined; }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel]($backend).\r\n * The contents of a GeometricModelState can be rendered inside a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\r\n public static override get className() { return \"GeometricModel\"; }\r\n /** @internal */\r\n public geometryGuid?: string;\r\n\r\n private _modelRange?: Range3d;\r\n\r\n constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState) {\r\n super(props, iModel, state);\r\n this.geometryGuid = props.geometryGuid;\r\n }\r\n\r\n /** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */\r\n public abstract get is3d(): boolean;\r\n /** @internal */\r\n public override get asGeometricModel(): GeometricModelState { return this; }\r\n /** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */\r\n public get is2d(): boolean { return !this.is3d; }\r\n\r\n /** @internal */\r\n public override get isGeometricModel(): boolean { return true; }\r\n /** @internal */\r\n public get treeModelId(): Id64String { return this.id; }\r\n\r\n /** Query for the union of the ranges of all the elements in this GeometricModel.\r\n * @note This value is cached after the first time it is called.\r\n * @public\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryExtents(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]?.extents);\r\n }\r\n\r\n return this._modelRange;\r\n }\r\n\r\n /** @internal */\r\n public createTileTreeReference(view: ViewState): TileTreeReference {\r\n // If this is a reality model, its tile tree is obtained from reality data service URL.\r\n\r\n const spatialModel = this.asSpatialModel;\r\n const rdSourceKey = this.jsonProperties.rdSourceKey;\r\n const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n const treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // url: tilesetUrl, // If rdSourceKey is defined, url is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // orbitGtBlob: props.orbitGtBlob!, // If rdSourceKey is defined, orbitGtBlob is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n return treeRef;\r\n }\r\n\r\n const orbitGtBlob = this.jsonProperties.orbitGtBlob;\r\n\r\n // If this is an OrbitGt reality model, create it's reference\r\n if(orbitGtBlob) {\r\n let orbitGtName = \"\";\r\n if (orbitGtBlob.blobFileName !== \"\") {\r\n if (orbitGtBlob.blobFileName[0] === \"/\")\r\n orbitGtName = orbitGtBlob.blobFileName.substring(1);\r\n else\r\n orbitGtName = orbitGtBlob.blobFileName;\r\n }\r\n // Create rdSourceKey if not provided\r\n const rdSourceKeyOGT: RealityDataSourceKey = RealityDataSource.createKeyFromOrbitGtBlobProps(orbitGtBlob);\r\n\r\n return createOrbitGtTileTreeReference({\r\n rdSourceKey: rdSourceKeyOGT,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n orbitGtBlob,\r\n name: orbitGtName,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n }\r\n\r\n // If this is a TileTree reality model, create it's reference\r\n const tilesetUrl = this.jsonProperties.tilesetUrl;\r\n\r\n if(tilesetUrl) {\r\n const rdSourceKeyCS = RealityDataSource.createKeyFromUrl(tilesetUrl);\r\n return createRealityTileTreeReference({\r\n rdSourceKey: rdSourceKeyCS,\r\n url : tilesetUrl,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this);\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\r\n public static override get className() { return \"GeometricModel2d\"; }\r\n /** @internal */\r\n public readonly globalOrigin: Point2d;\r\n\r\n constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState) {\r\n super(props, iModel, state);\r\n this.globalOrigin = Point2d.fromJSON(props.globalOrigin);\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return false; }\r\n /** @internal */\r\n public override get asGeometricModel2d(): GeometricModel2dState { return this; }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n val.globalOrigin = this.globalOrigin;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel3d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\r\n public static override get className() { return \"GeometricModel3d\"; }\r\n\r\n constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState) {\r\n super(props, iModel, state);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return true; }\r\n /** @internal */\r\n public override get asGeometricModel3d(): GeometricModel3dState { return this; }\r\n\r\n /** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n}\r\n\r\n/** Represents the front-end state of a [SheetModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\r\n public static override get className() { return \"SheetModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialModelState extends GeometricModel3dState {\r\n /** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */\r\n public readonly classifiers?: SpatialClassifiersState;\r\n\r\n public static override get className() { return \"SpatialModel\"; }\r\n\r\n /** @internal */\r\n public override get asSpatialModel(): SpatialModelState { return this; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState) {\r\n super(props, iModel, state);\r\n if (this.isRealityModel)\r\n this.classifiers = SpatialClassifiersState.create(this.jsonProperties);\r\n }\r\n\r\n /** Return true if this is a reality model (represented by a 3d tile set). */\r\n public get isRealityModel(): boolean {\r\n return !!this.jsonProperties.tilesetUrl || !!this.jsonProperties.rdSourceKey || !!this.jsonProperties.orbitGtBlob;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\r\n public static override get className() { return \"PhysicalModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialLocationModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\r\n public static override get className() { return \"SpatialLocationModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [DrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\r\n public static override get className() { return \"DrawingModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SectionDrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Views
|
|
3
|
+
*/
|
|
4
|
+
import { SpatialClassifier, SpatialClassifierFlags, SpatialClassifiers, SpatialClassifiersContainer } from "@itwin/core-common";
|
|
5
|
+
import { TileTreeReference } from "./tile/internal";
|
|
6
|
+
/** A [SpatialClassifier]($common) that uses geoemtry produced at run-time to classify a reality model.
|
|
7
|
+
* The geometry is supplied by a [[TileTreeReference]].
|
|
8
|
+
* A simple example of creating and applying a dynamic classifier:
|
|
9
|
+
* ```ts
|
|
10
|
+
* [[include:TileTreeReference_DynamicClassifier]]
|
|
11
|
+
* ```
|
|
12
|
+
* @see [[SpatialClassifiersState]] to configure a reality model's classifiers.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface DynamicSpatialClassifier {
|
|
16
|
+
/** A reference to the [[TileTree]] that supplies the graphics used to classify the reality model.
|
|
17
|
+
* @see [[TileTreeReference.createFromRenderGraphic]] for one way to produce a tile tree reference.
|
|
18
|
+
*/
|
|
19
|
+
tileTreeReference: TileTreeReference;
|
|
20
|
+
/** Flags controlling how to apply the classifier. */
|
|
21
|
+
flags: SpatialClassifierFlags;
|
|
22
|
+
/** A user-friendly name appropriate for use in a user interface. */
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
/** A [SpatialClassifier]($common) that uses geometry from a persistent [[GeometricModelState]] to classify a reality model.
|
|
26
|
+
* @see [[SpatialClassifiersState]] to configure a reality model's classifiers.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export type PersistentSpatialClassifier = SpatialClassifier & {
|
|
30
|
+
tileTreeReference?: never;
|
|
31
|
+
};
|
|
32
|
+
/** Describes the source of geometry being used to classify a reality model.
|
|
33
|
+
* @see [[SpatialClassifiersState.activeClassifier]] to change the active classifier for a reality model.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export type ActiveSpatialClassifier = DynamicSpatialClassifier | PersistentSpatialClassifier;
|
|
37
|
+
/** The front-end representation of [SpatialClassifiers]($common) that adds support for classifying a reality model using non-persistent
|
|
38
|
+
* geometry via [[DynamicSpatialClassifier]].
|
|
39
|
+
*
|
|
40
|
+
* @see [[ContextRealityModelState.classifiers]] or [[SpatialModelState.classifiers]] to access the classifiers for a particular reality model.
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export declare class SpatialClassifiersState extends SpatialClassifiers {
|
|
44
|
+
private _dynamicClassifier?;
|
|
45
|
+
private constructor();
|
|
46
|
+
/** The classifier currently being used to classify the reality model.
|
|
47
|
+
* This may be either a [SpatialClassifier]($common) already defined in the set of available [SpatialClassifiers]($common), or a [[DynamicSpatialClassifier]].
|
|
48
|
+
* @note Unlike [[PersistentSpatialClassifier]]s, [[DynamicSpatialClassifier]]s are not preserved when saving and recalling a view.
|
|
49
|
+
*/
|
|
50
|
+
get activeClassifier(): ActiveSpatialClassifier | undefined;
|
|
51
|
+
set activeClassifier(active: ActiveSpatialClassifier | undefined);
|
|
52
|
+
/** @internal */
|
|
53
|
+
static create(container: SpatialClassifiersContainer): SpatialClassifiersState;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=SpatialClassifiersState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpatialClassifiersState.d.ts","sourceRoot":"","sources":["../../src/SpatialClassifiersState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,qDAAqD;IACrD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,GAAG;IAAE,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE5F;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,2BAA2B,CAAC;AAE7F;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,OAAO,CAAC,kBAAkB,CAAC,CAA2B;IAEtD,OAAO;IAIP;;;OAGG;IACH,IAAW,gBAAgB,IAAI,uBAAuB,GAAG,SAAS,CAEjE;IAED,IAAW,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,GAAG,SAAS,EAWtE;IAED,gBAAgB;WACF,MAAM,CAAC,SAAS,EAAE,2BAA2B;CAG5D"}
|