@itwin/core-frontend 3.1.0-dev.23 → 3.1.0-dev.27

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.
Files changed (57) hide show
  1. package/lib/cjs/RealityDataSource.d.ts +50 -14
  2. package/lib/cjs/RealityDataSource.d.ts.map +1 -1
  3. package/lib/cjs/RealityDataSource.js +19 -241
  4. package/lib/cjs/RealityDataSource.js.map +1 -1
  5. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +67 -0
  6. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -0
  7. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +166 -0
  8. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -0
  9. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts +83 -0
  10. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts.map +1 -0
  11. package/lib/cjs/RealityDataSourceContextShareImpl.js +234 -0
  12. package/lib/cjs/RealityDataSourceContextShareImpl.js.map +1 -0
  13. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +65 -0
  14. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -0
  15. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +135 -0
  16. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -0
  17. package/lib/cjs/tile/OPCFormatInterpreter.d.ts +21 -0
  18. package/lib/cjs/tile/OPCFormatInterpreter.d.ts.map +1 -0
  19. package/lib/cjs/tile/OPCFormatInterpreter.js +81 -0
  20. package/lib/cjs/tile/OPCFormatInterpreter.js.map +1 -0
  21. package/lib/cjs/tile/ThreeDTileFormatInterpreter.d.ts +51 -0
  22. package/lib/cjs/tile/ThreeDTileFormatInterpreter.d.ts.map +1 -0
  23. package/lib/cjs/tile/ThreeDTileFormatInterpreter.js +160 -0
  24. package/lib/cjs/tile/ThreeDTileFormatInterpreter.js.map +1 -0
  25. package/lib/cjs/tile/internal.d.ts +2 -0
  26. package/lib/cjs/tile/internal.d.ts.map +1 -1
  27. package/lib/cjs/tile/internal.js +2 -0
  28. package/lib/cjs/tile/internal.js.map +1 -1
  29. package/lib/esm/RealityDataSource.d.ts +50 -14
  30. package/lib/esm/RealityDataSource.d.ts.map +1 -1
  31. package/lib/esm/RealityDataSource.js +22 -244
  32. package/lib/esm/RealityDataSource.js.map +1 -1
  33. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +67 -0
  34. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -0
  35. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +162 -0
  36. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -0
  37. package/lib/esm/RealityDataSourceContextShareImpl.d.ts +83 -0
  38. package/lib/esm/RealityDataSourceContextShareImpl.d.ts.map +1 -0
  39. package/lib/esm/RealityDataSourceContextShareImpl.js +230 -0
  40. package/lib/esm/RealityDataSourceContextShareImpl.js.map +1 -0
  41. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +65 -0
  42. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -0
  43. package/lib/esm/RealityDataSourceTilesetUrlImpl.js +131 -0
  44. package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -0
  45. package/lib/esm/tile/OPCFormatInterpreter.d.ts +21 -0
  46. package/lib/esm/tile/OPCFormatInterpreter.d.ts.map +1 -0
  47. package/lib/esm/tile/OPCFormatInterpreter.js +77 -0
  48. package/lib/esm/tile/OPCFormatInterpreter.js.map +1 -0
  49. package/lib/esm/tile/ThreeDTileFormatInterpreter.d.ts +51 -0
  50. package/lib/esm/tile/ThreeDTileFormatInterpreter.d.ts.map +1 -0
  51. package/lib/esm/tile/ThreeDTileFormatInterpreter.js +156 -0
  52. package/lib/esm/tile/ThreeDTileFormatInterpreter.js.map +1 -0
  53. package/lib/esm/tile/internal.d.ts +2 -0
  54. package/lib/esm/tile/internal.d.ts.map +1 -1
  55. package/lib/esm/tile/internal.js +2 -0
  56. package/lib/esm/tile/internal.js.map +1 -1
  57. package/package.json +20 -20
@@ -1,7 +1,36 @@
1
+ /** @packageDocumentation
2
+ * @module Tiles
3
+ */
1
4
  import { GuidString } from "@itwin/core-bentley";
2
- import { OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from "@itwin/core-common";
3
- /**
4
- * This interface provide methods used to access a reality data from a reality data provider
5
+ import { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from "@itwin/core-common";
6
+ import { Range3d } from "@itwin/core-geometry";
7
+ /** This interface provide spatial location and volume of interest, in meters, centered around `spatial location`
8
+ * @alpha
9
+ */
10
+ export interface SpatialLocationAndExtents {
11
+ /** location of the point at the center of the reaity data */
12
+ location: Cartographic | EcefLocation;
13
+ /** extents of the volume around location */
14
+ worldRange: Range3d;
15
+ /** true if this reality data is geolocated
16
+ * A reality data is geolocated when we can compute a valid position relative to the earth surface.
17
+ * Note that some reality data contains custom coordinate system without any information on the relative position on earth.
18
+ * These reality data will have a location and worldRange but will be identified by the isGeoLocated set to false.
19
+ */
20
+ isGeolocated: boolean;
21
+ }
22
+ /** This interface provides information to identify the product and engine that create this reality data
23
+ * @alpha
24
+ */
25
+ export interface PublisherProductInfo {
26
+ /** product that create this reality data */
27
+ product: string;
28
+ /** engine that create this reality data */
29
+ engine: string;
30
+ /** the version of the engine that create this reality data */
31
+ version: string;
32
+ }
33
+ /** This interface provide methods used to access a reality data from a reality data provider
5
34
  * @beta
6
35
  */
7
36
  export interface RealityDataSource {
@@ -12,39 +41,46 @@ export interface RealityDataSource {
12
41
  readonly realityData: RealityData | undefined;
13
42
  /** The reality data type (e.g.: "RealityMesh3DTiles", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/
14
43
  readonly realityDataType: string | undefined;
15
- /**
16
- * This method returns the URL to obtain the Reality Data properties.
44
+ /** This method returns the URL to obtain the Reality Data properties.
17
45
  * @param iTwinId id of associated iTwin project
18
46
  * @returns string containing the URL to reality data.
19
47
  */
20
48
  getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;
21
- /**
22
- * Gets a reality data root document json
49
+ /** Gets a reality data root document json
23
50
  * @returns tile data json
24
51
  * @internal
25
52
  */
26
53
  getRootDocument(iTwinId: GuidString | undefined): Promise<any>;
27
- /**
28
- * Gets tile content
54
+ /** Gets tile content
29
55
  * @param name name or path of tile
30
56
  * @returns array buffer of tile content
31
57
  * @internal
32
58
  */
33
59
  getTileContent(name: string): Promise<any>;
34
- /**
35
- * Gets a tileset's app data json
60
+ /** Gets a tileset's app data json
36
61
  * @param name name or path of tile
37
62
  * @returns app data json object
38
63
  * @internal
39
64
  */
40
65
  getTileJson(name: string): Promise<any>;
66
+ /** Gets spatial location and extents of this reality data source.
67
+ * Will return undefined if cannot be resolved or is unbounded (cover entire earth eg: Open Street Map Building from Ion Asset)
68
+ * @returns spatial location and extents
69
+ * @alpha
70
+ */
71
+ getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;
72
+ /** Gets information to identify the product and engine that create this reality data
73
+ * Will return undefined if cannot be resolved
74
+ * @returns information to identify the product and engine that create this reality data
75
+ * @alpha
76
+ */
77
+ getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;
41
78
  }
42
79
  /** Utility functions for RealityDataSource
43
80
  * @beta
44
81
  */
45
82
  export declare namespace RealityDataSource {
46
- /**
47
- * Create a RealityDataSourceKey from a tilesetUrl.
83
+ /** Create a RealityDataSourceKey from a tilesetUrl.
48
84
  * @param tilesetUrl the reality data attachment url
49
85
  * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl
50
86
  * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl
@@ -61,7 +97,7 @@ export declare namespace RealityDataSource {
61
97
  function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey;
62
98
  /** Return an instance of a RealityDataSource from a source key.
63
99
  * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.
64
- * @internal
100
+ * @alpha
65
101
  */
66
102
  function fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
67
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RealityDataSource.d.ts","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAQA,OAAO,EAA8B,UAAU,EAAU,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAe,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAA0B,MAAM,oBAAoB,CAAC;AAKtK;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9C,kGAAkG;IAClG,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE5E;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/D;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACzC;AACD;;GAEG;AACH,yBAAiB,iBAAiB,CAAC;IACjC;;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AAM,EAAE,aAAa,CAAC,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAsB/I;IACD,gHAAgH;IAChH,SAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAMhJ;IACD,yCAAyC;IACzC,SAAgB,6BAA6B,CAAC,WAAW,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAUvK;IACD,yCAAyC;IACzC,SAAgB,6BAA6B,CAAC,WAAW,EAAE,oBAAoB,GAAG,gBAAgB,GAAG,SAAS,CAa7G;IACD,4DAA4D;IAC5D,SAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAGpG;IACD;;;OAGG;IACH,SAAsB,OAAO,CAAC,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAcxI;CACF"}
@@ -5,19 +5,20 @@
5
5
  /** @packageDocumentation
6
6
  * @module Tiles
7
7
  */
8
- import { request } from "./request/Request";
9
- import { BentleyStatus, Logger } from "@itwin/core-bentley";
10
- import { IModelError, RealityDataFormat, RealityDataProvider } from "@itwin/core-common";
8
+ import { Logger } from "@itwin/core-bentley";
9
+ import { RealityDataFormat, RealityDataProvider } from "@itwin/core-common";
11
10
  import { FrontendLoggerCategory } from "./FrontendLoggerCategory";
12
- import { IModelApp } from "./IModelApp";
13
- import { CesiumIonAssetProvider, ContextShareProvider, getCesiumAccessTokenAndEndpointUrl, getCesiumAssetUrl, getCesiumOSMBuildingsUrl } from "./tile/internal";
11
+ import { CesiumIonAssetProvider, ContextShareProvider, getCesiumAssetUrl } from "./tile/internal";
12
+ import { RealityDataSourceTilesetUrlImpl } from "./RealityDataSourceTilesetUrlImpl";
13
+ import { RealityDataSourceContextShareImpl } from "./RealityDataSourceContextShareImpl";
14
+ import { RealityDataSourceCesiumIonAssetImpl } from "./RealityDataSourceCesiumIonAssetImpl";
15
+ const loggerCategory = FrontendLoggerCategory.RealityData;
14
16
  /** Utility functions for RealityDataSource
15
17
  * @beta
16
18
  */
17
19
  export var RealityDataSource;
18
20
  (function (RealityDataSource) {
19
- /**
20
- * Create a RealityDataSourceKey from a tilesetUrl.
21
+ /** Create a RealityDataSourceKey from a tilesetUrl.
21
22
  * @param tilesetUrl the reality data attachment url
22
23
  * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl
23
24
  * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl
@@ -92,246 +93,23 @@ export var RealityDataSource;
92
93
  RealityDataSource.createCesiumIonAssetKey = createCesiumIonAssetKey;
93
94
  /** Return an instance of a RealityDataSource from a source key.
94
95
  * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.
95
- * @internal
96
+ * @alpha
96
97
  */
97
98
  async function fromKey(rdSourceKey, iTwinId) {
98
- return RealityDataSourceImpl.fromKey(rdSourceKey, iTwinId);
99
+ switch (rdSourceKey.provider) {
100
+ case RealityDataProvider.CesiumIonAsset:
101
+ return RealityDataSourceCesiumIonAssetImpl.createFromKey(rdSourceKey, iTwinId);
102
+ case RealityDataProvider.TilesetUrl:
103
+ return RealityDataSourceTilesetUrlImpl.createFromKey(rdSourceKey, iTwinId);
104
+ case RealityDataProvider.ContextShare:
105
+ return RealityDataSourceContextShareImpl.createFromKey(rdSourceKey, iTwinId);
106
+ case RealityDataProvider.OrbitGtBlob:
107
+ return RealityDataSourceTilesetUrlImpl.createFromKey(rdSourceKey, iTwinId);
108
+ default:
109
+ Logger.logError(loggerCategory, `Error realityModelFromJson - region undefined`);
110
+ }
111
+ return undefined;
99
112
  }
100
113
  RealityDataSource.fromKey = fromKey;
101
114
  })(RealityDataSource || (RealityDataSource = {}));
102
- /** This class provides access to the reality data provider services.
103
- * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
104
- * The key provided at the creation determines if this is ProjectWise Context Share reference.
105
- * If not then it is considered local (ex: C:\temp\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)
106
- * There is a one to one relationship between a reality data and the instances of present class.
107
- * @beta
108
- */
109
- class RealityDataSourceImpl {
110
- /** Construct a new reality data source.
111
- * @param props JSON representation of the reality data source
112
- */
113
- constructor(props) {
114
- this._isUrlResolved = false;
115
- /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/
116
- this._baseUrl = "";
117
- this.key = props.sourceKey;
118
- this._isUrlResolved = false;
119
- }
120
- /** Construct a new reality data source.
121
- * @param props JSON representation of the reality data source
122
- */
123
- static fromProps(props) {
124
- return new RealityDataSourceImpl(props);
125
- }
126
- /**
127
- * Create an instance of this class from a source key and iTwin context/
128
- */
129
- static async createFromKey(sourceKey, iTwinId) {
130
- const rdSource = new RealityDataSourceImpl({ sourceKey });
131
- let tilesetUrl;
132
- try {
133
- await rdSource.queryRealityData(iTwinId);
134
- tilesetUrl = await rdSource.getServiceUrl(iTwinId);
135
- }
136
- catch (e) {
137
- }
138
- return (tilesetUrl !== undefined) ? rdSource : undefined;
139
- }
140
- /** Return an instance of a RealityDataSource from a source key.
141
- */
142
- static async fromKey(rdSourceKey, iTwinId) {
143
- return RealityDataSourceImpl.createFromKey(rdSourceKey, iTwinId);
144
- }
145
- get isContextShare() {
146
- return (this.key.provider === RealityDataProvider.ContextShare);
147
- }
148
- /**
149
- * Returns Reality Data if available
150
- */
151
- get realityData() {
152
- return this._rd;
153
- }
154
- get realityDataId() {
155
- const realityDataId = this.isContextShare ? this.key.id : undefined;
156
- return realityDataId;
157
- }
158
- /**
159
- * Returns Reality Data type if available
160
- */
161
- get realityDataType() {
162
- var _a;
163
- return (_a = this._rd) === null || _a === void 0 ? void 0 : _a.type;
164
- }
165
- get iTwinId() {
166
- return this.key.iTwinId;
167
- }
168
- /**
169
- * Query Reality Data from provider
170
- */
171
- async queryRealityData(iTwinId) {
172
- var _a;
173
- if (this.isContextShare && !this._rd) {
174
- const token = await IModelApp.getAccessToken();
175
- if (token && this.realityDataId) {
176
- if (undefined === IModelApp.realityDataAccess)
177
- 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.");
178
- this._rd = await IModelApp.realityDataAccess.getRealityData(token, iTwinId, this.realityDataId);
179
- // A reality data that has not root document set should not be considered.
180
- const rootDocument = (_a = this._rd.rootDocument) !== null && _a !== void 0 ? _a : "";
181
- this.setBaseUrl(rootDocument);
182
- }
183
- }
184
- }
185
- // This is to set the root url from the provided root document path.
186
- // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,
187
- // otherwise the full path to root document is given.
188
- // The base URL contains the base URL from which tile relative path are constructed.
189
- // The tile's path root will need to be reinserted for child tiles to return a 200
190
- setBaseUrl(url) {
191
- const urlParts = url.split("/");
192
- urlParts.pop();
193
- if (urlParts.length === 0)
194
- this._baseUrl = "";
195
- else
196
- this._baseUrl = `${urlParts.join("/")}/`;
197
- }
198
- async _doRequest(url, responseType) {
199
- let options = {
200
- method: "GET",
201
- responseType,
202
- };
203
- const authToken = this._requestAuthorization;
204
- if (authToken) {
205
- options = {
206
- ...options,
207
- headers: {
208
- authorization: authToken,
209
- },
210
- };
211
- }
212
- const data = await request(url, options);
213
- return data.body;
214
- }
215
- /**
216
- * Gets a tileset's app data json
217
- * @param name name or path of tile
218
- * @returns app data json object
219
- * @internal
220
- */
221
- async getRealityDataTileJson(accessToken, name, realityData) {
222
- const url = await realityData.getBlobUrl(accessToken, name);
223
- const data = await request(url.toString(), {
224
- method: "GET",
225
- responseType: "json",
226
- });
227
- return data.body;
228
- }
229
- /**
230
- * This method returns the URL to access the actual 3d tiles from the service provider.
231
- * @returns string containing the URL to reality data.
232
- */
233
- async getServiceUrl(iTwinId) {
234
- // If url was not resolved - resolve it
235
- if (this.isContextShare && !this._isUrlResolved) {
236
- const rdSourceKey = this.key;
237
- // we need to resolve tilesetURl from realityDataId and iTwinId
238
- if (undefined === IModelApp.realityDataAccess)
239
- 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.");
240
- try {
241
- const resolvedITwinId = iTwinId ? iTwinId : rdSourceKey.iTwinId;
242
- this._tilesetUrl = await IModelApp.realityDataAccess.getRealityDataUrl(resolvedITwinId, rdSourceKey.id);
243
- this._isUrlResolved = true;
244
- }
245
- catch (e) {
246
- const errMsg = `Error getting URL from ContextShare using realityDataId=${rdSourceKey.id} and iTwinId=${iTwinId}`;
247
- Logger.logError(FrontendLoggerCategory.RealityData, errMsg);
248
- }
249
- }
250
- else if (this.key.provider === RealityDataProvider.TilesetUrl) {
251
- this._tilesetUrl = this.key.id;
252
- }
253
- else if (this.key.provider === RealityDataProvider.CesiumIonAsset) {
254
- this._tilesetUrl = this.key.id;
255
- if (this.key.id === CesiumIonAssetProvider.osmBuildingId) {
256
- this._tilesetUrl = getCesiumOSMBuildingsUrl();
257
- this._isUrlResolved = true;
258
- }
259
- else {
260
- const parsedId = CesiumIonAssetProvider.parseCesiumUrl(this.key.id);
261
- if (parsedId) {
262
- this._tilesetUrl = getCesiumAssetUrl(parsedId.id, parsedId.key);
263
- this._isUrlResolved = true;
264
- }
265
- }
266
- }
267
- return this._tilesetUrl;
268
- }
269
- /** TODO: This probably required three different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium */
270
- async getRootDocument(iTwinId) {
271
- const token = await IModelApp.getAccessToken();
272
- if (this.isContextShare && token) {
273
- const realityData = this.realityData;
274
- if (!realityData)
275
- throw new Error(`Reality Data not defined`);
276
- if (!realityData.rootDocument)
277
- throw new Error(`Root document not defined for reality data: ${realityData.id}`);
278
- return this.getRealityDataTileJson(token, realityData.rootDocument, realityData);
279
- }
280
- let url = await this.getServiceUrl(iTwinId);
281
- if (!url)
282
- throw new IModelError(BentleyStatus.ERROR, "Unable to get service url");
283
- // The following is only if the reality data is not stored on PW Context Share.
284
- const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(url);
285
- if (cesiumAsset) {
286
- const tokenAndUrl = await getCesiumAccessTokenAndEndpointUrl(cesiumAsset.id, cesiumAsset.key);
287
- if (tokenAndUrl.url && tokenAndUrl.token) {
288
- url = tokenAndUrl.url;
289
- this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;
290
- }
291
- }
292
- // The following is only if the reality data is not stored on PW Context Share.
293
- this.setBaseUrl(url);
294
- return this._doRequest(url, "json");
295
- }
296
- /**
297
- * Gets tile content
298
- * @param name name or path of tile
299
- * @returns array buffer of tile content
300
- */
301
- async getRealityDataTileContent(accessToken, name, realityData) {
302
- const url = await realityData.getBlobUrl(accessToken, name);
303
- const options = {
304
- method: "GET",
305
- responseType: "arraybuffer",
306
- };
307
- const data = await request(url.toString(), options);
308
- return data.body;
309
- }
310
- /**
311
- * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium
312
- * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
313
- */
314
- async getTileContent(name) {
315
- const token = await IModelApp.getAccessToken();
316
- const useRds = this.isContextShare && token !== undefined;
317
- const tileUrl = this._baseUrl + name;
318
- if (useRds && this.realityData) {
319
- return this.getRealityDataTileContent(token, tileUrl, this.realityData);
320
- }
321
- return this._doRequest(tileUrl, "arraybuffer");
322
- }
323
- /**
324
- * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium
325
- * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.
326
- */
327
- async getTileJson(name) {
328
- const token = await IModelApp.getAccessToken();
329
- const useRds = this.isContextShare && token !== undefined;
330
- const tileUrl = this._baseUrl + name;
331
- if (useRds && this.realityData) {
332
- return this.getRealityDataTileJson(token, tileUrl, this.realityData);
333
- }
334
- return this._doRequest(tileUrl, "json");
335
- }
336
- }
337
115
  //# sourceMappingURL=RealityDataSource.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAkB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAiC,iBAAiB,EAAE,mBAAmB,EAAgD,MAAM,oBAAoB,CAAC;AACtK,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AA0ChK;;GAEG;AACH,MAAM,KAAW,iBAAiB,CA8EjC;AA9ED,WAAiB,iBAAiB;IAChC;;;;;;OAMG;IACH,SAAgB,gBAAgB,CAAC,UAAkB,EAAE,aAAmC,EAAE,WAA+B;QACvH,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,sBAAsB,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;YACpD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,cAAc,CAAC;YACpD,qCAAqC;YACrC,MAAM,iBAAiB,GAAyB,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,sBAAsB,CAAC,aAAa,EAAE,CAAC;YAC/G,OAAO,iBAAiB,CAAC;SAC1B;QAED,oFAAoF;QACpF,IAAI,oBAAoB,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;YAClD,MAAM,IAAI,GAAG,oBAAoB,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,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,IAAI,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE;YAC9B,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACzE;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,IAAY;QACnC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,cAAc,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,IAAI,KAAK,KAAK,SAAS,CAAC;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,IAAI,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE;YAC9B,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACtE;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\nimport { request, RequestOptions } from \"./request/Request\";\r\nimport { AccessToken, BentleyStatus, GuidString, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelError, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\nimport { FrontendLoggerCategory } from \"./FrontendLoggerCategory\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAccessTokenAndEndpointUrl, getCesiumAssetUrl, getCesiumOSMBuildingsUrl } from \"./tile/internal\";\r\n\r\n/**\r\n * This interface provide methods used to access a reality data from a reality data provider\r\n * @beta\r\n */\r\nexport interface RealityDataSource {\r\n readonly key: RealityDataSourceKey;\r\n readonly isContextShare: boolean;\r\n readonly realityDataId: string | undefined;\r\n /** Metatdata 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 /**\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 * Gets a reality data root document json\r\n * @returns tile data json\r\n * @internal\r\n */\r\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\r\n /**\r\n * Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n * @internal\r\n */\r\n getTileContent(name: string): Promise<any>;\r\n /**\r\n * Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n getTileJson(name: string): Promise<any>;\r\n}\r\n/** Utility functions for RealityDataSource\r\n * @beta\r\n */\r\nexport namespace RealityDataSource {\r\n /**\r\n * Create a RealityDataSourceKey from a tilesetUrl.\r\n * @param tilesetUrl the reality data attachment url\r\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\r\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\r\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\r\n */\r\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\r\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\r\n const provider = RealityDataProvider.CesiumIonAsset;\r\n // Keep url hidden and use a dummy id\r\n const cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId };\r\n return cesiumIonAssetKey;\r\n }\r\n\r\n // Try to extract realityDataId from URL and if not possible, use the url as the key\r\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\r\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n format = inputFormat ? inputFormat : info.format;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\r\n return contextShareKey;\r\n }\r\n\r\n // default to tileSetUrl\r\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\r\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\r\n return urlKey;\r\n }\r\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\r\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\r\n const format = inputFormat ? inputFormat : info.format;\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\r\n return contextShareKey;\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\r\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\r\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\r\n } else if (orbitGtBlob.rdsUrl) {\r\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\r\n }\r\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\r\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\r\n return { provider, format, id };\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\r\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\r\n return undefined;\r\n const splitIds = rdSourceKey.id.split(\":\");\r\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\r\n const sasToken = rdSourceKey.id.substr(sasTokenIndex + 2);\r\n const orbitGtBlob: OrbitGtBlobProps = {\r\n accountName: splitIds[0],\r\n containerName: splitIds[1],\r\n blobFileName: splitIds[2],\r\n sasToken,\r\n };\r\n return orbitGtBlob;\r\n }\r\n /** @internal - Is used by \"fdt attach cesium asset\" keyin*/\r\n export function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey {\r\n const id = getCesiumAssetUrl(osmAssetId,requestKey);\r\n return {provider: RealityDataProvider.CesiumIonAsset, format: RealityDataFormat.ThreeDTile, id};\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\r\n * @internal\r\n */\r\n export async function fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n return RealityDataSourceImpl.fromKey(rdSourceKey, iTwinId);\r\n }\r\n}\r\n\r\n/** This class provides access to the reality data provider services.\r\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\r\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\r\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\r\n * There is a one to one relationship between a reality data and the instances of present class.\r\n* @beta\r\n*/\r\nclass RealityDataSourceImpl implements RealityDataSource {\r\n public readonly key: RealityDataSourceKey;\r\n /** The URL that supplies the 3d tiles for displaying the reality model. */\r\n private _tilesetUrl: string | undefined;\r\n private _isUrlResolved: boolean = false;\r\n private _rd: RealityData | undefined;\r\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\r\n private _baseUrl: string = \"\";\r\n /** Request authorization for non PW ContextShare requests.*/\r\n private _requestAuthorization?: string;\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n protected constructor(props: RealityDataSourceProps) {\r\n this.key = props.sourceKey;\r\n this._isUrlResolved = false;\r\n }\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n public static fromProps(props: RealityDataSourceProps): RealityDataSource {\r\n return new RealityDataSourceImpl(props);\r\n }\r\n /**\r\n * Create an instance of this class from a source key and iTwin context/\r\n */\r\n public static async createFromKey(sourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n const rdSource = new RealityDataSourceImpl({ sourceKey });\r\n let tilesetUrl: string | undefined;\r\n try {\r\n await rdSource.queryRealityData(iTwinId);\r\n tilesetUrl = await rdSource.getServiceUrl(iTwinId);\r\n } catch (e) {\r\n }\r\n\r\n return (tilesetUrl !== undefined) ? rdSource : undefined;\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n */\r\n public static async fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n return RealityDataSourceImpl.createFromKey(rdSourceKey, iTwinId);\r\n }\r\n public get isContextShare(): boolean {\r\n return (this.key.provider === RealityDataProvider.ContextShare);\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 public get realityDataId(): string | undefined {\r\n const realityDataId = this.isContextShare ? this.key.id : undefined;\r\n return realityDataId;\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 public get iTwinId(): string | undefined {\r\n return this.key.iTwinId;\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.isContextShare && !this._rd) {\r\n const token = await IModelApp.getAccessToken();\r\n if (token && this.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.realityDataId);\r\n // A reality data that has not root document set should not be considered.\r\n const rootDocument: string = this._rd.rootDocument ?? \"\";\r\n this.setBaseUrl(rootDocument);\r\n }\r\n }\r\n }\r\n // This is to set the root url from the provided root document path.\r\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\r\n // otherwise the full path to root document is given.\r\n // The base URL contains the base URL from which tile relative path are constructed.\r\n // The tile's path root will need to be reinserted for child tiles to return a 200\r\n private setBaseUrl(url: string): void {\r\n const urlParts = url.split(\"/\");\r\n urlParts.pop();\r\n if (urlParts.length === 0)\r\n this._baseUrl = \"\";\r\n else\r\n this._baseUrl = `${urlParts.join(\"/\")}/`;\r\n }\r\n private async _doRequest(url: string, responseType: string): Promise<any> {\r\n let options: RequestOptions = {\r\n method: \"GET\",\r\n responseType,\r\n };\r\n\r\n const authToken = this._requestAuthorization;\r\n if (authToken) {\r\n options = {\r\n ...options,\r\n headers: {\r\n authorization: authToken,\r\n },\r\n };\r\n }\r\n\r\n const data = await request(url, options);\r\n return data.body;\r\n }\r\n /**\r\n * Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n public async getRealityDataTileJson(accessToken: AccessToken, name: string, realityData: RealityData): Promise<any> {\r\n const url = await realityData.getBlobUrl(accessToken, name);\r\n\r\n const data = await request(url.toString(), {\r\n method: \"GET\",\r\n responseType: \"json\",\r\n });\r\n return data.body;\r\n }\r\n\r\n /**\r\n * This method returns the URL to access the actual 3d tiles from the service provider.\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 // If url was not resolved - resolve it\r\n if (this.isContextShare && !this._isUrlResolved) {\r\n const rdSourceKey = this.key;\r\n // we need to resolve tilesetURl from realityDataId and iTwinId\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 try {\r\n const resolvedITwinId = iTwinId ? iTwinId : rdSourceKey.iTwinId;\r\n\r\n this._tilesetUrl = await IModelApp.realityDataAccess.getRealityDataUrl(resolvedITwinId, rdSourceKey.id);\r\n this._isUrlResolved = true;\r\n } catch (e) {\r\n const errMsg = `Error getting URL from ContextShare using realityDataId=${rdSourceKey.id} and iTwinId=${iTwinId}`;\r\n Logger.logError(FrontendLoggerCategory.RealityData, errMsg);\r\n }\r\n } else if (this.key.provider === RealityDataProvider.TilesetUrl) {\r\n this._tilesetUrl = this.key.id;\r\n } else if (this.key.provider === RealityDataProvider.CesiumIonAsset) {\r\n this._tilesetUrl = this.key.id;\r\n if (this.key.id === CesiumIonAssetProvider.osmBuildingId) {\r\n this._tilesetUrl = getCesiumOSMBuildingsUrl();\r\n this._isUrlResolved = true;\r\n } else {\r\n const parsedId = CesiumIonAssetProvider.parseCesiumUrl(this.key.id);\r\n if (parsedId) {\r\n this._tilesetUrl = getCesiumAssetUrl(parsedId.id, parsedId.key);\r\n this._isUrlResolved = true;\r\n }\r\n }\r\n }\r\n return this._tilesetUrl;\r\n }\r\n /** TODO: This probably required three different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium */\r\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n if (this.isContextShare && token) {\r\n const realityData = this.realityData;\r\n\r\n if (!realityData)\r\n throw new Error(`Reality Data not defined`);\r\n\r\n if (!realityData.rootDocument)\r\n throw new Error(`Root document not defined for reality data: ${realityData.id}`);\r\n\r\n return this.getRealityDataTileJson(token, realityData.rootDocument, realityData);\r\n }\r\n\r\n let url = await this.getServiceUrl(iTwinId);\r\n if (!url)\r\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(url);\r\n if (cesiumAsset) {\r\n const tokenAndUrl = await getCesiumAccessTokenAndEndpointUrl(cesiumAsset.id, cesiumAsset.key);\r\n if (tokenAndUrl.url && tokenAndUrl.token) {\r\n url = tokenAndUrl.url;\r\n this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;\r\n }\r\n }\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n this.setBaseUrl(url);\r\n return this._doRequest(url, \"json\");\r\n }\r\n\r\n /**\r\n * Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n */\r\n public async getRealityDataTileContent(accessToken: AccessToken, name: string, realityData: RealityData): Promise<any> {\r\n const url = await realityData.getBlobUrl(accessToken, name);\r\n const options: RequestOptions = {\r\n method: \"GET\",\r\n responseType: \"arraybuffer\",\r\n };\r\n const data = await request(url.toString(), options);\r\n return data.body;\r\n }\r\n\r\n /**\r\n * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium\r\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileContent(name: string): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n const useRds = this.isContextShare && token !== undefined;\r\n const tileUrl = this._baseUrl + name;\r\n\r\n if (useRds && this.realityData) {\r\n return this.getRealityDataTileContent(token, tileUrl, this.realityData);\r\n }\r\n\r\n return this._doRequest(tileUrl, \"arraybuffer\");\r\n }\r\n\r\n /**\r\n * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium\r\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileJson(name: string): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n const useRds = this.isContextShare && token !== undefined;\r\n const tileUrl = this._baseUrl + name;\r\n\r\n if (useRds && this.realityData) {\r\n return this.getRealityDataTileJson(token, tileUrl, this.realityData);\r\n }\r\n\r\n return this._doRequest(tileUrl, \"json\");\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAA6D,iBAAiB,EAAE,mBAAmB,EAAwB,MAAM,oBAAoB,CAAC;AAC7J,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAG5F,MAAM,cAAc,GAAW,sBAAsB,CAAC,WAAW,CAAC;AA6ElE;;GAEG;AACH,MAAM,KAAW,iBAAiB,CAyFjC;AAzFD,WAAiB,iBAAiB;IAChC;;;;;OAKG;IACH,SAAgB,gBAAgB,CAAC,UAAkB,EAAE,aAAmC,EAAE,WAA+B;QACvH,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,sBAAsB,CAAC,aAAa,CAAC,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mBAAmB,CAAC,WAAW;gBAClC,OAAO,+BAA+B,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAC7E;gBACE,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,+CAA+C,CAAC,CAAC;SACpF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAdqB,yBAAO,UAc5B,CAAA;AACH,CAAC,EAzFgB,iBAAiB,KAAjB,iBAAiB,QAyFjC","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 Tiles\r\n */\r\nimport { GuidString, Logger } from \"@itwin/core-bentley\";\r\nimport { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { FrontendLoggerCategory } from \"./FrontendLoggerCategory\";\r\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAssetUrl } from \"./tile/internal\";\r\nimport { RealityDataSourceTilesetUrlImpl } from \"./RealityDataSourceTilesetUrlImpl\";\r\nimport { RealityDataSourceContextShareImpl } from \"./RealityDataSourceContextShareImpl\";\r\nimport { RealityDataSourceCesiumIonAssetImpl } from \"./RealityDataSourceCesiumIonAssetImpl\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\n\r\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\r\n\r\n/** This interface provide spatial location and volume of interest, in meters, centered around `spatial location`\r\n * @alpha\r\n */\r\nexport interface SpatialLocationAndExtents {\r\n /** location of the point at the center of the reaity data */\r\n location: Cartographic | EcefLocation;\r\n /** extents of the volume around location */\r\n worldRange: Range3d;\r\n /** true if this reality data is geolocated\r\n * A reality data is geolocated when we can compute a valid position relative to the earth surface.\r\n * Note that some reality data contains custom coordinate system without any information on the relative position on earth.\r\n * These reality data will have a location and worldRange but will be identified by the isGeoLocated set to false.\r\n */\r\n isGeolocated: boolean;\r\n}\r\n\r\n/** This interface provides information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\nexport interface PublisherProductInfo {\r\n /** product that create this reality data */\r\n product: string;\r\n /** engine that create this reality data */\r\n engine: string;\r\n /** the version of the engine that create this reality data */\r\n version: string;\r\n}\r\n\r\n/** This interface provide methods used to access a reality data from a reality data provider\r\n * @beta\r\n */\r\nexport interface RealityDataSource {\r\n readonly key: RealityDataSourceKey;\r\n readonly isContextShare: boolean;\r\n readonly realityDataId: string | undefined;\r\n /** Metatdata 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 /** 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 /** Gets a reality data root document json\r\n * @returns tile data json\r\n * @internal\r\n */\r\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\r\n /** Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n * @internal\r\n */\r\n getTileContent(name: string): Promise<any>;\r\n /** Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n getTileJson(name: string): Promise<any>;\r\n /** Gets spatial location and extents of this reality data source.\r\n * Will return undefined if cannot be resolved or is unbounded (cover entire earth eg: Open Street Map Building from Ion Asset)\r\n * @returns spatial location and extents\r\n * @alpha\r\n */\r\n getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;\r\n /** Gets information to identify the product and engine that create this reality data\r\n * Will return undefined if cannot be resolved\r\n * @returns information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\n getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;\r\n}\r\n/** Utility functions for RealityDataSource\r\n * @beta\r\n */\r\nexport namespace RealityDataSource {\r\n /** Create a RealityDataSourceKey from a tilesetUrl.\r\n * @param tilesetUrl the reality data attachment url\r\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\r\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\r\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\r\n */\r\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\r\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\r\n const provider = RealityDataProvider.CesiumIonAsset;\r\n // Keep url hidden and use a dummy id\r\n const cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId };\r\n return cesiumIonAssetKey;\r\n }\r\n\r\n // Try to extract realityDataId from URL and if not possible, use the url as the key\r\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\r\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n format = inputFormat ? inputFormat : info.format;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\r\n return contextShareKey;\r\n }\r\n\r\n // default to tileSetUrl\r\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\r\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\r\n return urlKey;\r\n }\r\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\r\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\r\n const format = inputFormat ? inputFormat : info.format;\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\r\n return contextShareKey;\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\r\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\r\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\r\n } else if (orbitGtBlob.rdsUrl) {\r\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\r\n }\r\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\r\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\r\n return { provider, format, id };\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\r\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\r\n return undefined;\r\n const splitIds = rdSourceKey.id.split(\":\");\r\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\r\n const sasToken = rdSourceKey.id.substr(sasTokenIndex + 2);\r\n const orbitGtBlob: OrbitGtBlobProps = {\r\n accountName: splitIds[0],\r\n containerName: splitIds[1],\r\n blobFileName: splitIds[2],\r\n sasToken,\r\n };\r\n return orbitGtBlob;\r\n }\r\n /** @internal - Is used by \"fdt attach cesium asset\" keyin*/\r\n export function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey {\r\n const id = getCesiumAssetUrl(osmAssetId,requestKey);\r\n return {provider: RealityDataProvider.CesiumIonAsset, format: RealityDataFormat.ThreeDTile, id};\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\r\n * @alpha\r\n */\r\n export async function fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n switch(rdSourceKey.provider) {\r\n case RealityDataProvider.CesiumIonAsset:\r\n return RealityDataSourceCesiumIonAssetImpl.createFromKey(rdSourceKey, iTwinId);\r\n case RealityDataProvider.TilesetUrl:\r\n return RealityDataSourceTilesetUrlImpl.createFromKey(rdSourceKey, iTwinId);\r\n case RealityDataProvider.ContextShare:\r\n return RealityDataSourceContextShareImpl.createFromKey(rdSourceKey, iTwinId);\r\n case RealityDataProvider.OrbitGtBlob:\r\n return RealityDataSourceTilesetUrlImpl.createFromKey(rdSourceKey, iTwinId);\r\n default:\r\n Logger.logError(loggerCategory, `Error realityModelFromJson - region undefined`);\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n"]}
@@ -0,0 +1,67 @@
1
+ import { GuidString } from "@itwin/core-bentley";
2
+ import { RealityData, RealityDataSourceKey, RealityDataSourceProps } from "@itwin/core-common";
3
+ import { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from "./RealityDataSource";
4
+ /** This class provides access to the reality data provider services.
5
+ * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
6
+ * The key provided at the creation determines if this is ProjectWise Context Share reference.
7
+ * If not then it is considered local (ex: C:\temp\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)
8
+ * There is a one to one relationship between a reality data and the instances of present class.
9
+ * @internal
10
+ */
11
+ export declare class RealityDataSourceCesiumIonAssetImpl implements RealityDataSource {
12
+ readonly key: RealityDataSourceKey;
13
+ /** The URL that supplies the 3d tiles for displaying the reality model. */
14
+ private _tilesetUrl;
15
+ /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/
16
+ private _baseUrl;
17
+ /** Request authorization for non PW ContextShare requests.*/
18
+ private _requestAuthorization?;
19
+ /** Construct a new reality data source.
20
+ * @param props JSON representation of the reality data source
21
+ */
22
+ protected constructor(props: RealityDataSourceProps);
23
+ /**
24
+ * Create an instance of this class from a source key and iTwin context/
25
+ */
26
+ static createFromKey(sourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
27
+ get isContextShare(): boolean;
28
+ /**
29
+ * Returns Reality Data if available
30
+ */
31
+ get realityData(): RealityData | undefined;
32
+ get realityDataId(): string | undefined;
33
+ /**
34
+ * Returns Reality Data type if available
35
+ */
36
+ get realityDataType(): string | undefined;
37
+ private setBaseUrl;
38
+ private _doRequest;
39
+ /**
40
+ * This method returns the URL to access the actual 3d tiles from the service provider.
41
+ * @returns string containing the URL to reality data.
42
+ */
43
+ getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined>;
44
+ getRootDocument(iTwinId: GuidString | undefined): Promise<any>;
45
+ /**
46
+ * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
47
+ */
48
+ getTileContent(name: string): Promise<any>;
49
+ /**
50
+ * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.
51
+ */
52
+ getTileJson(name: string): Promise<any>;
53
+ /**
54
+ * Gets spatial location and extents of this reality data source
55
+ * @returns spatial location and extents
56
+ * @internal
57
+ */
58
+ getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;
59
+ /**
60
+ * Gets information to identify the product and engine that create this reality data
61
+ * Will return undefined if cannot be resolved
62
+ * @returns information to identify the product and engine that create this reality data
63
+ * @alpha
64
+ */
65
+ getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;
66
+ }
67
+ //# sourceMappingURL=RealityDataSourceCesiumIonAssetImpl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RealityDataSourceCesiumIonAssetImpl.d.ts","sourceRoot":"","sources":["../../src/RealityDataSourceCesiumIonAssetImpl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAyB,UAAU,EAAE,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