@itwin/core-frontend 3.0.0-dev.102 → 3.0.0-dev.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/ApproximateTerrainHeights.js +3 -3
- package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
- package/lib/cjs/ContextRealityModelState.js +1 -1
- package/lib/cjs/ContextRealityModelState.js.map +1 -1
- package/lib/cjs/ElementLocateManager.d.ts +5 -0
- package/lib/cjs/ElementLocateManager.d.ts.map +1 -1
- package/lib/cjs/ElementLocateManager.js +12 -2
- package/lib/cjs/ElementLocateManager.js.map +1 -1
- package/lib/cjs/ModelState.js +1 -1
- package/lib/cjs/ModelState.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts +53 -29
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +245 -91
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/TwoWayViewportSync.d.ts +35 -6
- package/lib/cjs/TwoWayViewportSync.d.ts.map +1 -1
- package/lib/cjs/TwoWayViewportSync.js +51 -11
- package/lib/cjs/TwoWayViewportSync.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +23 -5
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +13 -9
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +0 -1
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +0 -1
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +4 -2
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.d.ts.map +1 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.js +10 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/cjs/tile/CesiumAssetProvider.d.ts +13 -0
- package/lib/cjs/tile/CesiumAssetProvider.d.ts.map +1 -0
- package/lib/cjs/tile/CesiumAssetProvider.js +34 -0
- package/lib/cjs/tile/CesiumAssetProvider.js.map +1 -0
- package/lib/cjs/tile/ContextShareProvider.d.ts +22 -0
- package/lib/cjs/tile/ContextShareProvider.d.ts.map +1 -0
- package/lib/cjs/tile/ContextShareProvider.js +110 -0
- package/lib/cjs/tile/ContextShareProvider.js.map +1 -0
- package/lib/cjs/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.js +8 -5
- package/lib/cjs/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts +1 -54
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +24 -217
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/internal.d.ts +3 -0
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +3 -0
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts +22 -0
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -0
- package/lib/cjs/tile/map/ArcGISTileMap.js +173 -0
- package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -0
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +5 -4
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +18 -40
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +6 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +63 -21
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +4 -4
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +20 -24
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +17 -6
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +9 -4
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +22 -4
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTile.js +4 -3
- package/lib/cjs/tile/map/MapTile.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +1 -1
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.d.ts +7 -2
- package/lib/cjs/tile/map/MapTilingScheme.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js +21 -8
- package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/cjs/tile/map/QuadId.d.ts +1 -0
- package/lib/cjs/tile/map/QuadId.d.ts.map +1 -1
- package/lib/cjs/tile/map/QuadId.js +2 -1
- package/lib/cjs/tile/map/QuadId.js.map +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.d.ts +7 -0
- package/lib/cjs/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.js +16 -2
- package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +2 -10
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.js +3 -3
- package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
- package/lib/esm/ContextRealityModelState.js +1 -1
- package/lib/esm/ContextRealityModelState.js.map +1 -1
- package/lib/esm/ElementLocateManager.d.ts +5 -0
- package/lib/esm/ElementLocateManager.d.ts.map +1 -1
- package/lib/esm/ElementLocateManager.js +12 -2
- package/lib/esm/ElementLocateManager.js.map +1 -1
- package/lib/esm/ModelState.js +1 -1
- package/lib/esm/ModelState.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts +53 -29
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +246 -90
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/TwoWayViewportSync.d.ts +35 -6
- package/lib/esm/TwoWayViewportSync.d.ts.map +1 -1
- package/lib/esm/TwoWayViewportSync.js +49 -10
- package/lib/esm/TwoWayViewportSync.js.map +1 -1
- package/lib/esm/Viewport.d.ts +23 -5
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +13 -9
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +0 -1
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +0 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +4 -2
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.d.ts.map +1 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.js +10 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/esm/tile/CesiumAssetProvider.d.ts +13 -0
- package/lib/esm/tile/CesiumAssetProvider.d.ts.map +1 -0
- package/lib/esm/tile/CesiumAssetProvider.js +30 -0
- package/lib/esm/tile/CesiumAssetProvider.js.map +1 -0
- package/lib/esm/tile/ContextShareProvider.d.ts +22 -0
- package/lib/esm/tile/ContextShareProvider.d.ts.map +1 -0
- package/lib/esm/tile/ContextShareProvider.js +106 -0
- package/lib/esm/tile/ContextShareProvider.js.map +1 -0
- package/lib/esm/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/esm/tile/OrbitGtTileTree.js +8 -5
- package/lib/esm/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts +1 -54
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +26 -218
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/internal.d.ts +3 -0
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +3 -0
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.d.ts +22 -0
- package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -0
- package/lib/esm/tile/map/ArcGISTileMap.js +169 -0
- package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -0
- package/lib/esm/tile/map/CesiumTerrainProvider.js +5 -4
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +19 -41
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +6 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +63 -21
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +4 -4
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +21 -25
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +17 -6
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +9 -4
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +22 -4
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTile.js +4 -3
- package/lib/esm/tile/map/MapTile.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +1 -1
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.d.ts +7 -2
- package/lib/esm/tile/map/MapTilingScheme.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js +22 -9
- package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/esm/tile/map/QuadId.d.ts +1 -0
- package/lib/esm/tile/map/QuadId.d.ts.map +1 -1
- package/lib/esm/tile/map/QuadId.js +2 -1
- package/lib/esm/tile/map/QuadId.js.map +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.d.ts +7 -0
- package/lib/esm/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.js +16 -2
- package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +2 -10
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/package.json +24 -24
- package/lib/cjs/RealityDataConnection.d.ts +0 -31
- package/lib/cjs/RealityDataConnection.d.ts.map +0 -1
- package/lib/cjs/RealityDataConnection.js +0 -101
- package/lib/cjs/RealityDataConnection.js.map +0 -1
- package/lib/esm/RealityDataConnection.d.ts +0 -31
- package/lib/esm/RealityDataConnection.d.ts.map +0 -1
- package/lib/esm/RealityDataConnection.js +0 -98
- package/lib/esm/RealityDataConnection.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-frontend",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.106",
|
|
4
4
|
"description": "iTwin.js frontend components",
|
|
5
5
|
"main": "lib/cjs/core-frontend.js",
|
|
6
6
|
"module": "lib/esm/core-frontend.js",
|
|
@@ -23,33 +23,33 @@
|
|
|
23
23
|
"url": "http://www.bentley.com"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@itwin/core-bentley": "^3.0.0-dev.
|
|
27
|
-
"@itwin/core-geometry": "^3.0.0-dev.
|
|
28
|
-
"@itwin/core-common": "^3.0.0-dev.
|
|
29
|
-
"@itwin/core-quantity": "^3.0.0-dev.
|
|
30
|
-
"@bentley/itwin-client": "^3.0.0-dev.
|
|
31
|
-
"@itwin/core-orbitgt": "^3.0.0-dev.
|
|
32
|
-
"@bentley/product-settings-client": "^3.0.0-dev.
|
|
33
|
-
"@itwin/appui-abstract": "^3.0.0-dev.
|
|
34
|
-
"@itwin/webgl-compatibility": "^3.0.0-dev.
|
|
26
|
+
"@itwin/core-bentley": "^3.0.0-dev.106",
|
|
27
|
+
"@itwin/core-geometry": "^3.0.0-dev.106",
|
|
28
|
+
"@itwin/core-common": "^3.0.0-dev.106",
|
|
29
|
+
"@itwin/core-quantity": "^3.0.0-dev.106",
|
|
30
|
+
"@bentley/itwin-client": "^3.0.0-dev.106",
|
|
31
|
+
"@itwin/core-orbitgt": "^3.0.0-dev.106",
|
|
32
|
+
"@bentley/product-settings-client": "^3.0.0-dev.106",
|
|
33
|
+
"@itwin/appui-abstract": "^3.0.0-dev.106",
|
|
34
|
+
"@itwin/webgl-compatibility": "^3.0.0-dev.106"
|
|
35
35
|
},
|
|
36
36
|
"//devDependencies": [
|
|
37
37
|
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
|
|
38
38
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
39
39
|
],
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@itwin/core-bentley": "3.0.0-dev.
|
|
42
|
-
"@itwin/build-tools": "3.0.0-dev.
|
|
43
|
-
"@itwin/certa": "3.0.0-dev.
|
|
44
|
-
"@itwin/eslint-plugin": "3.0.0-dev.
|
|
45
|
-
"@itwin/core-geometry": "3.0.0-dev.
|
|
46
|
-
"@itwin/core-common": "3.0.0-dev.
|
|
47
|
-
"@itwin/core-quantity": "3.0.0-dev.
|
|
48
|
-
"@bentley/itwin-client": "3.0.0-dev.
|
|
49
|
-
"@itwin/core-orbitgt": "3.0.0-dev.
|
|
50
|
-
"@bentley/product-settings-client": "3.0.0-dev.
|
|
51
|
-
"@itwin/appui-abstract": "3.0.0-dev.
|
|
52
|
-
"@itwin/webgl-compatibility": "3.0.0-dev.
|
|
41
|
+
"@itwin/core-bentley": "3.0.0-dev.106",
|
|
42
|
+
"@itwin/build-tools": "3.0.0-dev.106",
|
|
43
|
+
"@itwin/certa": "3.0.0-dev.106",
|
|
44
|
+
"@itwin/eslint-plugin": "3.0.0-dev.106",
|
|
45
|
+
"@itwin/core-geometry": "3.0.0-dev.106",
|
|
46
|
+
"@itwin/core-common": "3.0.0-dev.106",
|
|
47
|
+
"@itwin/core-quantity": "3.0.0-dev.106",
|
|
48
|
+
"@bentley/itwin-client": "3.0.0-dev.106",
|
|
49
|
+
"@itwin/core-orbitgt": "3.0.0-dev.106",
|
|
50
|
+
"@bentley/product-settings-client": "3.0.0-dev.106",
|
|
51
|
+
"@itwin/appui-abstract": "3.0.0-dev.106",
|
|
52
|
+
"@itwin/webgl-compatibility": "3.0.0-dev.106",
|
|
53
53
|
"@types/chai": "^4.1.4",
|
|
54
54
|
"@types/chai-as-promised": "^7",
|
|
55
55
|
"@types/mocha": "^8.2.2",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@bentley/telemetry-client": "3.0.0-dev.
|
|
78
|
-
"@itwin/core-i18n": "3.0.0-dev.
|
|
77
|
+
"@bentley/telemetry-client": "3.0.0-dev.106",
|
|
78
|
+
"@itwin/core-i18n": "3.0.0-dev.106",
|
|
79
79
|
"fuse.js": "^3.3.0",
|
|
80
80
|
"semver": "^5.5.0",
|
|
81
81
|
"wms-capabilities": "0.4.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { GuidString } from "@itwin/core-bentley";
|
|
2
|
-
import { RealityDataSourceKey } from "@itwin/core-common";
|
|
3
|
-
import { RealityData } from "./RealityDataAccessProps";
|
|
4
|
-
import { RealityDataSource } from "./RealityDataSource";
|
|
5
|
-
/**
|
|
6
|
-
* This interface provide methods used to access a reality data from ContextShare
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export interface RealityDataConnection {
|
|
10
|
-
/** Metadata on the reality data source */
|
|
11
|
-
readonly realityData: RealityData | undefined;
|
|
12
|
-
/** The reality data type (e.g.: "RealityMesh3DTiles", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/
|
|
13
|
-
readonly realityDataType: string | undefined;
|
|
14
|
-
/** The source provides access to the reality data provider services.*/
|
|
15
|
-
readonly source: RealityDataSource;
|
|
16
|
-
/**
|
|
17
|
-
* This method returns the URL to obtain the Reality Data properties.
|
|
18
|
-
* @param iTwinId id of associated iTwin project
|
|
19
|
-
* @returns string containing the URL to reality data.
|
|
20
|
-
*/
|
|
21
|
-
getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;
|
|
22
|
-
}
|
|
23
|
-
/** @internal */
|
|
24
|
-
export declare namespace RealityDataConnection {
|
|
25
|
-
/** Return an instance of a RealityDataConnection from a source key.
|
|
26
|
-
* There will always be only one reality data connection for a corresponding reality data source key.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
function fromSourceKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined>;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=RealityDataConnection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataConnection.d.ts","sourceRoot":"","sources":["../../src/RealityDataConnection.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAA0B,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAgC,MAAM,qBAAqB,CAAC;AAEtF;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9C,kGAAkG;IAClG,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC7E;AAED,gBAAgB;AAChB,yBAAiB,qBAAqB,CAAC;IACrC;;;OAGG;IACH,SAAsB,aAAa,CAAC,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAElJ;CACF"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.RealityDataConnection = void 0;
|
|
8
|
-
const IModelApp_1 = require("./IModelApp");
|
|
9
|
-
const RealityDataSource_1 = require("./RealityDataSource");
|
|
10
|
-
/** @internal */
|
|
11
|
-
var RealityDataConnection;
|
|
12
|
-
(function (RealityDataConnection) {
|
|
13
|
-
/** Return an instance of a RealityDataConnection from a source key.
|
|
14
|
-
* There will always be only one reality data connection for a corresponding reality data source key.
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
async function fromSourceKey(rdSourceKey, iTwinId) {
|
|
18
|
-
return RealityDataConnectionImpl.fromSourceKey(rdSourceKey, iTwinId);
|
|
19
|
-
}
|
|
20
|
-
RealityDataConnection.fromSourceKey = fromSourceKey;
|
|
21
|
-
})(RealityDataConnection = exports.RealityDataConnection || (exports.RealityDataConnection = {}));
|
|
22
|
-
/**
|
|
23
|
-
* This class encapsulates access to a reality data from ContextShare
|
|
24
|
-
* There is a one to one relationship between a reality data and the instances of present class.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
class RealityDataConnectionImpl {
|
|
28
|
-
constructor(props) {
|
|
29
|
-
this._rdSource = RealityDataSource_1.RealityDataSource.fromProps(props);
|
|
30
|
-
}
|
|
31
|
-
static async fromSourceKey(rdSourceKey, iTwinId) {
|
|
32
|
-
// search to see if it was already created
|
|
33
|
-
const rdSourceKeyString = (0, RealityDataSource_1.realityDataSourceKeyToString)(rdSourceKey);
|
|
34
|
-
let rdConnection = RealityDataConnectionImpl._realityDataConnections.get(rdSourceKeyString);
|
|
35
|
-
if (rdConnection)
|
|
36
|
-
return rdConnection;
|
|
37
|
-
// If not already in our list, create and add it to our list before returning it.
|
|
38
|
-
rdConnection = await RealityDataConnectionImpl.createFromSourceKey(rdSourceKey, iTwinId);
|
|
39
|
-
if (rdConnection)
|
|
40
|
-
RealityDataConnectionImpl._realityDataConnections.set(rdSourceKeyString, rdConnection);
|
|
41
|
-
return rdConnection;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Create an instance of this class from a source key and iTwin context/
|
|
45
|
-
* @alpha
|
|
46
|
-
*/
|
|
47
|
-
static async createFromSourceKey(sk, iTwinId) {
|
|
48
|
-
const props = { sourceKey: sk };
|
|
49
|
-
const rdConnection = new RealityDataConnectionImpl(props);
|
|
50
|
-
let tilesetUrl;
|
|
51
|
-
try {
|
|
52
|
-
await rdConnection.queryRealityData(iTwinId);
|
|
53
|
-
tilesetUrl = await rdConnection._rdSource.getServiceUrl(iTwinId);
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
}
|
|
57
|
-
return (tilesetUrl !== undefined) ? rdConnection : undefined;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Query Reality Data from provider
|
|
61
|
-
*/
|
|
62
|
-
async queryRealityData(iTwinId) {
|
|
63
|
-
if (this._rdSource.isContextShare && !this._rd) {
|
|
64
|
-
const token = await IModelApp_1.IModelApp.getAccessToken();
|
|
65
|
-
if (token && this._rdSource.realityDataId) {
|
|
66
|
-
if (undefined === IModelApp_1.IModelApp.realityDataAccess)
|
|
67
|
-
throw new Error("Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.");
|
|
68
|
-
this._rd = await IModelApp_1.IModelApp.realityDataAccess.getRealityData(token, iTwinId, this._rdSource.realityDataId);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns Reality Data if available
|
|
74
|
-
*/
|
|
75
|
-
get realityData() {
|
|
76
|
-
return this._rd;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Returns Reality Data type if available
|
|
80
|
-
*/
|
|
81
|
-
get realityDataType() {
|
|
82
|
-
var _a;
|
|
83
|
-
return (_a = this._rd) === null || _a === void 0 ? void 0 : _a.type;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* This method returns the URL to obtain the Reality Data details.
|
|
87
|
-
* @param iTwinId id of associated iTwin project
|
|
88
|
-
* @returns string containing the URL to reality data.
|
|
89
|
-
*/
|
|
90
|
-
async getServiceUrl(iTwinId) {
|
|
91
|
-
return this._rdSource.getServiceUrl(iTwinId);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Returns the source implementation associated to this reality data connection
|
|
95
|
-
*/
|
|
96
|
-
get source() {
|
|
97
|
-
return this._rdSource;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
RealityDataConnectionImpl._realityDataConnections = new Map();
|
|
101
|
-
//# sourceMappingURL=RealityDataConnection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataConnection.js","sourceRoot":"","sources":["../../src/RealityDataConnection.ts"],"names":[],"mappings":"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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { RealityData } from \"./RealityDataAccessProps\";\r\nimport { RealityDataSource, realityDataSourceKeyToString } from \"./RealityDataSource\";\r\n\r\n/**\r\n * This interface provide methods used to access a reality data from ContextShare\r\n * @internal\r\n */\r\nexport interface RealityDataConnection {\r\n /** Metadata on the reality data source */\r\n readonly realityData: RealityData | undefined;\r\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\r\n readonly realityDataType: string | undefined;\r\n /** The source provides access to the reality data provider services.*/\r\n readonly source: RealityDataSource;\r\n /**\r\n * This method returns the URL to obtain the Reality Data properties.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\r\n}\r\n\r\n/** @internal */\r\nexport namespace RealityDataConnection {\r\n /** Return an instance of a RealityDataConnection from a source key.\r\n * There will always be only one reality data connection for a corresponding reality data source key.\r\n * @internal\r\n */\r\n export async function fromSourceKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined> {\r\n return RealityDataConnectionImpl.fromSourceKey(rdSourceKey, iTwinId);\r\n }\r\n}\r\n\r\n/**\r\n * This class encapsulates access to a reality data from ContextShare\r\n * There is a one to one relationship between a reality data and the instances of present class.\r\n * @internal\r\n */\r\nclass RealityDataConnectionImpl implements RealityDataConnection {\r\n private static _realityDataConnections = new Map<string, RealityDataConnection>();\r\n private _rd: RealityData | undefined;\r\n private _rdSource: RealityDataSource;\r\n\r\n private constructor(props: RealityDataSourceProps) {\r\n this._rdSource = RealityDataSource.fromProps(props);\r\n }\r\n public static async fromSourceKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined> {\r\n // search to see if it was already created\r\n const rdSourceKeyString = realityDataSourceKeyToString(rdSourceKey);\r\n let rdConnection = RealityDataConnectionImpl._realityDataConnections.get(rdSourceKeyString);\r\n if (rdConnection)\r\n return rdConnection;\r\n // If not already in our list, create and add it to our list before returning it.\r\n rdConnection = await RealityDataConnectionImpl.createFromSourceKey(rdSourceKey, iTwinId);\r\n if (rdConnection)\r\n RealityDataConnectionImpl._realityDataConnections.set(rdSourceKeyString,rdConnection);\r\n return rdConnection;\r\n }\r\n /**\r\n * Create an instance of this class from a source key and iTwin context/\r\n * @alpha\r\n */\r\n public static async createFromSourceKey(sk: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined> {\r\n const props: RealityDataSourceProps = {sourceKey: sk};\r\n const rdConnection = new RealityDataConnectionImpl(props);\r\n let tilesetUrl: string | undefined;\r\n try {\r\n await rdConnection.queryRealityData(iTwinId);\r\n tilesetUrl = await rdConnection._rdSource.getServiceUrl(iTwinId);\r\n } catch (e) {\r\n }\r\n\r\n return (tilesetUrl !== undefined) ? rdConnection : undefined;\r\n }\r\n /**\r\n * Query Reality Data from provider\r\n */\r\n private async queryRealityData(iTwinId: GuidString | undefined) {\r\n if (this._rdSource.isContextShare && !this._rd) {\r\n const token = await IModelApp.getAccessToken();\r\n if (token && this._rdSource.realityDataId) {\r\n if (undefined === IModelApp.realityDataAccess)\r\n throw new Error(\"Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.\");\r\n this._rd = await IModelApp.realityDataAccess.getRealityData(token, iTwinId, this._rdSource.realityDataId);\r\n }\r\n }\r\n }\r\n /**\r\n * Returns Reality Data if available\r\n */\r\n public get realityData(): RealityData | undefined {\r\n return this._rd;\r\n }\r\n /**\r\n * Returns Reality Data type if available\r\n */\r\n public get realityDataType(): string | undefined {\r\n return this._rd?.type;\r\n }\r\n /**\r\n * This method returns the URL to obtain the Reality Data details.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n public async getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined> {\r\n return this._rdSource.getServiceUrl(iTwinId);\r\n }\r\n /**\r\n * Returns the source implementation associated to this reality data connection\r\n */\r\n public get source(): RealityDataSource {\r\n return this._rdSource;\r\n }\r\n}\r\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { GuidString } from "@itwin/core-bentley";
|
|
2
|
-
import { RealityDataSourceKey } from "@itwin/core-common";
|
|
3
|
-
import { RealityData } from "./RealityDataAccessProps";
|
|
4
|
-
import { RealityDataSource } from "./RealityDataSource";
|
|
5
|
-
/**
|
|
6
|
-
* This interface provide methods used to access a reality data from ContextShare
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export interface RealityDataConnection {
|
|
10
|
-
/** Metadata on the reality data source */
|
|
11
|
-
readonly realityData: RealityData | undefined;
|
|
12
|
-
/** The reality data type (e.g.: "RealityMesh3DTiles", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/
|
|
13
|
-
readonly realityDataType: string | undefined;
|
|
14
|
-
/** The source provides access to the reality data provider services.*/
|
|
15
|
-
readonly source: RealityDataSource;
|
|
16
|
-
/**
|
|
17
|
-
* This method returns the URL to obtain the Reality Data properties.
|
|
18
|
-
* @param iTwinId id of associated iTwin project
|
|
19
|
-
* @returns string containing the URL to reality data.
|
|
20
|
-
*/
|
|
21
|
-
getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;
|
|
22
|
-
}
|
|
23
|
-
/** @internal */
|
|
24
|
-
export declare namespace RealityDataConnection {
|
|
25
|
-
/** Return an instance of a RealityDataConnection from a source key.
|
|
26
|
-
* There will always be only one reality data connection for a corresponding reality data source key.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
function fromSourceKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined>;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=RealityDataConnection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataConnection.d.ts","sourceRoot":"","sources":["../../src/RealityDataConnection.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAA0B,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAgC,MAAM,qBAAqB,CAAC;AAEtF;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9C,kGAAkG;IAClG,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC7E;AAED,gBAAgB;AAChB,yBAAiB,qBAAqB,CAAC;IACrC;;;OAGG;IACH,SAAsB,aAAa,CAAC,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAElJ;CACF"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { IModelApp } from "./IModelApp";
|
|
6
|
-
import { RealityDataSource, realityDataSourceKeyToString } from "./RealityDataSource";
|
|
7
|
-
/** @internal */
|
|
8
|
-
export var RealityDataConnection;
|
|
9
|
-
(function (RealityDataConnection) {
|
|
10
|
-
/** Return an instance of a RealityDataConnection from a source key.
|
|
11
|
-
* There will always be only one reality data connection for a corresponding reality data source key.
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
async function fromSourceKey(rdSourceKey, iTwinId) {
|
|
15
|
-
return RealityDataConnectionImpl.fromSourceKey(rdSourceKey, iTwinId);
|
|
16
|
-
}
|
|
17
|
-
RealityDataConnection.fromSourceKey = fromSourceKey;
|
|
18
|
-
})(RealityDataConnection || (RealityDataConnection = {}));
|
|
19
|
-
/**
|
|
20
|
-
* This class encapsulates access to a reality data from ContextShare
|
|
21
|
-
* There is a one to one relationship between a reality data and the instances of present class.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
class RealityDataConnectionImpl {
|
|
25
|
-
constructor(props) {
|
|
26
|
-
this._rdSource = RealityDataSource.fromProps(props);
|
|
27
|
-
}
|
|
28
|
-
static async fromSourceKey(rdSourceKey, iTwinId) {
|
|
29
|
-
// search to see if it was already created
|
|
30
|
-
const rdSourceKeyString = realityDataSourceKeyToString(rdSourceKey);
|
|
31
|
-
let rdConnection = RealityDataConnectionImpl._realityDataConnections.get(rdSourceKeyString);
|
|
32
|
-
if (rdConnection)
|
|
33
|
-
return rdConnection;
|
|
34
|
-
// If not already in our list, create and add it to our list before returning it.
|
|
35
|
-
rdConnection = await RealityDataConnectionImpl.createFromSourceKey(rdSourceKey, iTwinId);
|
|
36
|
-
if (rdConnection)
|
|
37
|
-
RealityDataConnectionImpl._realityDataConnections.set(rdSourceKeyString, rdConnection);
|
|
38
|
-
return rdConnection;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Create an instance of this class from a source key and iTwin context/
|
|
42
|
-
* @alpha
|
|
43
|
-
*/
|
|
44
|
-
static async createFromSourceKey(sk, iTwinId) {
|
|
45
|
-
const props = { sourceKey: sk };
|
|
46
|
-
const rdConnection = new RealityDataConnectionImpl(props);
|
|
47
|
-
let tilesetUrl;
|
|
48
|
-
try {
|
|
49
|
-
await rdConnection.queryRealityData(iTwinId);
|
|
50
|
-
tilesetUrl = await rdConnection._rdSource.getServiceUrl(iTwinId);
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
}
|
|
54
|
-
return (tilesetUrl !== undefined) ? rdConnection : undefined;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Query Reality Data from provider
|
|
58
|
-
*/
|
|
59
|
-
async queryRealityData(iTwinId) {
|
|
60
|
-
if (this._rdSource.isContextShare && !this._rd) {
|
|
61
|
-
const token = await IModelApp.getAccessToken();
|
|
62
|
-
if (token && this._rdSource.realityDataId) {
|
|
63
|
-
if (undefined === IModelApp.realityDataAccess)
|
|
64
|
-
throw new Error("Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.");
|
|
65
|
-
this._rd = await IModelApp.realityDataAccess.getRealityData(token, iTwinId, this._rdSource.realityDataId);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Returns Reality Data if available
|
|
71
|
-
*/
|
|
72
|
-
get realityData() {
|
|
73
|
-
return this._rd;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Returns Reality Data type if available
|
|
77
|
-
*/
|
|
78
|
-
get realityDataType() {
|
|
79
|
-
var _a;
|
|
80
|
-
return (_a = this._rd) === null || _a === void 0 ? void 0 : _a.type;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* This method returns the URL to obtain the Reality Data details.
|
|
84
|
-
* @param iTwinId id of associated iTwin project
|
|
85
|
-
* @returns string containing the URL to reality data.
|
|
86
|
-
*/
|
|
87
|
-
async getServiceUrl(iTwinId) {
|
|
88
|
-
return this._rdSource.getServiceUrl(iTwinId);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Returns the source implementation associated to this reality data connection
|
|
92
|
-
*/
|
|
93
|
-
get source() {
|
|
94
|
-
return this._rdSource;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
RealityDataConnectionImpl._realityDataConnections = new Map();
|
|
98
|
-
//# sourceMappingURL=RealityDataConnection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataConnection.js","sourceRoot":"","sources":["../../src/RealityDataConnection.ts"],"names":[],"mappings":"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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { RealityData } from \"./RealityDataAccessProps\";\r\nimport { RealityDataSource, realityDataSourceKeyToString } from \"./RealityDataSource\";\r\n\r\n/**\r\n * This interface provide methods used to access a reality data from ContextShare\r\n * @internal\r\n */\r\nexport interface RealityDataConnection {\r\n /** Metadata on the reality data source */\r\n readonly realityData: RealityData | undefined;\r\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\r\n readonly realityDataType: string | undefined;\r\n /** The source provides access to the reality data provider services.*/\r\n readonly source: RealityDataSource;\r\n /**\r\n * This method returns the URL to obtain the Reality Data properties.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\r\n}\r\n\r\n/** @internal */\r\nexport namespace RealityDataConnection {\r\n /** Return an instance of a RealityDataConnection from a source key.\r\n * There will always be only one reality data connection for a corresponding reality data source key.\r\n * @internal\r\n */\r\n export async function fromSourceKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined> {\r\n return RealityDataConnectionImpl.fromSourceKey(rdSourceKey, iTwinId);\r\n }\r\n}\r\n\r\n/**\r\n * This class encapsulates access to a reality data from ContextShare\r\n * There is a one to one relationship between a reality data and the instances of present class.\r\n * @internal\r\n */\r\nclass RealityDataConnectionImpl implements RealityDataConnection {\r\n private static _realityDataConnections = new Map<string, RealityDataConnection>();\r\n private _rd: RealityData | undefined;\r\n private _rdSource: RealityDataSource;\r\n\r\n private constructor(props: RealityDataSourceProps) {\r\n this._rdSource = RealityDataSource.fromProps(props);\r\n }\r\n public static async fromSourceKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined> {\r\n // search to see if it was already created\r\n const rdSourceKeyString = realityDataSourceKeyToString(rdSourceKey);\r\n let rdConnection = RealityDataConnectionImpl._realityDataConnections.get(rdSourceKeyString);\r\n if (rdConnection)\r\n return rdConnection;\r\n // If not already in our list, create and add it to our list before returning it.\r\n rdConnection = await RealityDataConnectionImpl.createFromSourceKey(rdSourceKey, iTwinId);\r\n if (rdConnection)\r\n RealityDataConnectionImpl._realityDataConnections.set(rdSourceKeyString,rdConnection);\r\n return rdConnection;\r\n }\r\n /**\r\n * Create an instance of this class from a source key and iTwin context/\r\n * @alpha\r\n */\r\n public static async createFromSourceKey(sk: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataConnection | undefined> {\r\n const props: RealityDataSourceProps = {sourceKey: sk};\r\n const rdConnection = new RealityDataConnectionImpl(props);\r\n let tilesetUrl: string | undefined;\r\n try {\r\n await rdConnection.queryRealityData(iTwinId);\r\n tilesetUrl = await rdConnection._rdSource.getServiceUrl(iTwinId);\r\n } catch (e) {\r\n }\r\n\r\n return (tilesetUrl !== undefined) ? rdConnection : undefined;\r\n }\r\n /**\r\n * Query Reality Data from provider\r\n */\r\n private async queryRealityData(iTwinId: GuidString | undefined) {\r\n if (this._rdSource.isContextShare && !this._rd) {\r\n const token = await IModelApp.getAccessToken();\r\n if (token && this._rdSource.realityDataId) {\r\n if (undefined === IModelApp.realityDataAccess)\r\n throw new Error(\"Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.\");\r\n this._rd = await IModelApp.realityDataAccess.getRealityData(token, iTwinId, this._rdSource.realityDataId);\r\n }\r\n }\r\n }\r\n /**\r\n * Returns Reality Data if available\r\n */\r\n public get realityData(): RealityData | undefined {\r\n return this._rd;\r\n }\r\n /**\r\n * Returns Reality Data type if available\r\n */\r\n public get realityDataType(): string | undefined {\r\n return this._rd?.type;\r\n }\r\n /**\r\n * This method returns the URL to obtain the Reality Data details.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n public async getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined> {\r\n return this._rdSource.getServiceUrl(iTwinId);\r\n }\r\n /**\r\n * Returns the source implementation associated to this reality data connection\r\n */\r\n public get source(): RealityDataSource {\r\n return this._rdSource;\r\n }\r\n}\r\n"]}
|