@itwin/frontend-tiles 4.8.0-dev.3 → 4.8.0-dev.32

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 (74) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/lib/cjs/BatchedModels.d.ts +1 -0
  3. package/lib/cjs/BatchedModels.d.ts.map +1 -1
  4. package/lib/cjs/BatchedModels.js +3 -0
  5. package/lib/cjs/BatchedModels.js.map +1 -1
  6. package/lib/cjs/BatchedSpatialTileTreeRefs.d.ts +1 -1
  7. package/lib/cjs/BatchedSpatialTileTreeRefs.d.ts.map +1 -1
  8. package/lib/cjs/BatchedSpatialTileTreeRefs.js +83 -4
  9. package/lib/cjs/BatchedSpatialTileTreeRefs.js.map +1 -1
  10. package/lib/cjs/BatchedTileTreeReference.d.ts +2 -0
  11. package/lib/cjs/BatchedTileTreeReference.d.ts.map +1 -1
  12. package/lib/cjs/BatchedTileTreeReference.js +3 -0
  13. package/lib/cjs/BatchedTileTreeReference.js.map +1 -1
  14. package/lib/cjs/FrontendTiles.d.ts +10 -15
  15. package/lib/cjs/FrontendTiles.d.ts.map +1 -1
  16. package/lib/cjs/FrontendTiles.js +36 -69
  17. package/lib/cjs/FrontendTiles.js.map +1 -1
  18. package/lib/cjs/GraphicsProvider/GraphicRepresentationProvider.d.ts +124 -0
  19. package/lib/cjs/GraphicsProvider/GraphicRepresentationProvider.d.ts.map +1 -0
  20. package/lib/cjs/GraphicsProvider/GraphicRepresentationProvider.js +122 -0
  21. package/lib/cjs/GraphicsProvider/GraphicRepresentationProvider.js.map +1 -0
  22. package/lib/cjs/GraphicsProvider/GraphicsProvider.d.ts +27 -0
  23. package/lib/cjs/GraphicsProvider/GraphicsProvider.d.ts.map +1 -0
  24. package/lib/cjs/GraphicsProvider/GraphicsProvider.js +44 -0
  25. package/lib/cjs/GraphicsProvider/GraphicsProvider.js.map +1 -0
  26. package/lib/cjs/GraphicsProvider/tileset-creators/GeoscienceTileset.d.ts +11 -0
  27. package/lib/cjs/GraphicsProvider/tileset-creators/GeoscienceTileset.d.ts.map +1 -0
  28. package/lib/cjs/GraphicsProvider/tileset-creators/GeoscienceTileset.js +37 -0
  29. package/lib/cjs/GraphicsProvider/tileset-creators/GeoscienceTileset.js.map +1 -0
  30. package/lib/cjs/GraphicsProvider/url-providers/GeoscienceUrlProvider.d.ts +46 -0
  31. package/lib/cjs/GraphicsProvider/url-providers/GeoscienceUrlProvider.d.ts.map +1 -0
  32. package/lib/cjs/GraphicsProvider/url-providers/GeoscienceUrlProvider.js +35 -0
  33. package/lib/cjs/GraphicsProvider/url-providers/GeoscienceUrlProvider.js.map +1 -0
  34. package/lib/cjs/frontend-tiles.d.ts +4 -0
  35. package/lib/cjs/frontend-tiles.d.ts.map +1 -1
  36. package/lib/cjs/frontend-tiles.js +4 -0
  37. package/lib/cjs/frontend-tiles.js.map +1 -1
  38. package/lib/esm/BatchedModels.d.ts +1 -0
  39. package/lib/esm/BatchedModels.d.ts.map +1 -1
  40. package/lib/esm/BatchedModels.js +3 -0
  41. package/lib/esm/BatchedModels.js.map +1 -1
  42. package/lib/esm/BatchedSpatialTileTreeRefs.d.ts +1 -1
  43. package/lib/esm/BatchedSpatialTileTreeRefs.d.ts.map +1 -1
  44. package/lib/esm/BatchedSpatialTileTreeRefs.js +83 -4
  45. package/lib/esm/BatchedSpatialTileTreeRefs.js.map +1 -1
  46. package/lib/esm/BatchedTileTreeReference.d.ts +2 -0
  47. package/lib/esm/BatchedTileTreeReference.d.ts.map +1 -1
  48. package/lib/esm/BatchedTileTreeReference.js +3 -0
  49. package/lib/esm/BatchedTileTreeReference.js.map +1 -1
  50. package/lib/esm/FrontendTiles.d.ts +10 -15
  51. package/lib/esm/FrontendTiles.d.ts.map +1 -1
  52. package/lib/esm/FrontendTiles.js +36 -69
  53. package/lib/esm/FrontendTiles.js.map +1 -1
  54. package/lib/esm/GraphicsProvider/GraphicRepresentationProvider.d.ts +124 -0
  55. package/lib/esm/GraphicsProvider/GraphicRepresentationProvider.d.ts.map +1 -0
  56. package/lib/esm/GraphicsProvider/GraphicRepresentationProvider.js +117 -0
  57. package/lib/esm/GraphicsProvider/GraphicRepresentationProvider.js.map +1 -0
  58. package/lib/esm/GraphicsProvider/GraphicsProvider.d.ts +27 -0
  59. package/lib/esm/GraphicsProvider/GraphicsProvider.d.ts.map +1 -0
  60. package/lib/esm/GraphicsProvider/GraphicsProvider.js +40 -0
  61. package/lib/esm/GraphicsProvider/GraphicsProvider.js.map +1 -0
  62. package/lib/esm/GraphicsProvider/tileset-creators/GeoscienceTileset.d.ts +11 -0
  63. package/lib/esm/GraphicsProvider/tileset-creators/GeoscienceTileset.d.ts.map +1 -0
  64. package/lib/esm/GraphicsProvider/tileset-creators/GeoscienceTileset.js +33 -0
  65. package/lib/esm/GraphicsProvider/tileset-creators/GeoscienceTileset.js.map +1 -0
  66. package/lib/esm/GraphicsProvider/url-providers/GeoscienceUrlProvider.d.ts +46 -0
  67. package/lib/esm/GraphicsProvider/url-providers/GeoscienceUrlProvider.d.ts.map +1 -0
  68. package/lib/esm/GraphicsProvider/url-providers/GeoscienceUrlProvider.js +31 -0
  69. package/lib/esm/GraphicsProvider/url-providers/GeoscienceUrlProvider.js.map +1 -0
  70. package/lib/esm/frontend-tiles.d.ts +4 -0
  71. package/lib/esm/frontend-tiles.d.ts.map +1 -1
  72. package/lib/esm/frontend-tiles.js +4 -0
  73. package/lib/esm/frontend-tiles.js.map +1 -1
  74. package/package.json +11 -11
@@ -5,52 +5,49 @@
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.initializeFrontendTiles = exports.frontendTilesOptions = exports.obtainMeshExportTilesetUrl = exports.queryMeshExports = void 0;
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
8
  const core_frontend_1 = require("@itwin/core-frontend");
10
- const LoggerCategory_1 = require("./LoggerCategory");
11
9
  const BatchedSpatialTileTreeRefs_1 = require("./BatchedSpatialTileTreeRefs");
12
- function createMeshExportServiceQueryUrl(args) {
13
- const prefix = args.urlPrefix ?? "";
14
- let url = `https://${prefix}api.bentley.com/mesh-export/?iModelId=${args.iModelId}&$orderBy=date:desc`;
15
- if (args.changesetId)
16
- url = `${url}&changesetId=${args.changesetId}`;
17
- if (args.enableCDN)
18
- url = `${url}&cdn=1`;
19
- url = `${url}&tileVersion=1&exportType=IMODEL`;
20
- return url;
21
- }
10
+ const GraphicRepresentationProvider_1 = require("./GraphicsProvider/GraphicRepresentationProvider");
11
+ const GraphicsProvider_1 = require("./GraphicsProvider/GraphicsProvider");
22
12
  /** Query the [mesh export service](https://developer.bentley.com/apis/mesh-export/operations/get-exports/) for exports of type "IMODEL" matching
23
13
  * the specified criteria.
24
14
  * The exports are sorted from most-recently- to least-recently-produced.
25
15
  * @beta
26
16
  */
27
17
  async function* queryMeshExports(args) {
28
- const headers = {
29
- /* eslint-disable-next-line @typescript-eslint/naming-convention */
30
- Authorization: args.accessToken ?? await core_frontend_1.IModelApp.getAccessToken(),
31
- /* eslint-disable-next-line @typescript-eslint/naming-convention */
32
- Accept: "application/vnd.bentley.itwin-platform.v1+json",
33
- /* eslint-disable-next-line @typescript-eslint/naming-convention */
34
- Prefer: "return=representation",
35
- /* eslint-disable-next-line @typescript-eslint/naming-convention */
36
- SessionId: core_frontend_1.IModelApp.sessionId,
18
+ const graphicsArgs = {
19
+ accessToken: args.accessToken,
20
+ sessionId: core_frontend_1.IModelApp.sessionId,
21
+ dataSource: {
22
+ iTwinId: args.iTwinId,
23
+ id: args.iModelId,
24
+ changeId: args.changesetId,
25
+ type: "IMODEL",
26
+ },
27
+ format: "IMDL",
28
+ urlPrefix: args.urlPrefix,
29
+ enableCDN: args.enableCDN,
37
30
  };
38
- let url = createMeshExportServiceQueryUrl(args);
39
- while (url) {
40
- let result;
41
- try {
42
- const response = await fetch(url, { headers });
43
- result = await response.json();
44
- }
45
- catch (err) {
46
- core_bentley_1.Logger.logException(LoggerCategory_1.loggerCategory, err);
47
- core_bentley_1.Logger.logError(LoggerCategory_1.loggerCategory, `Failed loading exports for iModel ${args.iModelId}`);
48
- break;
49
- }
50
- const foundExports = result.exports.filter((x) => x.request.exportType === "IMODEL" && (args.includeIncomplete || x.status === "Complete"));
51
- for (const foundExport of foundExports)
52
- yield foundExport;
53
- url = result._links.next?.href;
31
+ for await (const data of (0, GraphicRepresentationProvider_1.queryGraphicRepresentations)(graphicsArgs)) {
32
+ const meshExport = {
33
+ id: data.representationId,
34
+ displayName: data.displayName,
35
+ status: "Complete",
36
+ request: {
37
+ iModelId: data.dataSource.id,
38
+ changesetId: data.dataSource.changeId ?? "",
39
+ exportType: data.dataSource.type,
40
+ geometryOptions: {},
41
+ viewDefinitionFilter: {},
42
+ },
43
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
44
+ _links: {
45
+ mesh: {
46
+ href: data.url ?? "",
47
+ },
48
+ },
49
+ };
50
+ yield meshExport;
54
51
  }
55
52
  }
56
53
  exports.queryMeshExports = queryMeshExports;
@@ -61,37 +58,7 @@ exports.queryMeshExports = queryMeshExports;
61
58
  * @beta
62
59
  */
63
60
  async function obtainMeshExportTilesetUrl(args) {
64
- if (!args.iModel.iModelId) {
65
- core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, "Cannot obtain exports for an iModel with no iModelId");
66
- return undefined;
67
- }
68
- const queryArgs = {
69
- accessToken: args.accessToken,
70
- iModelId: args.iModel.iModelId,
71
- changesetId: args.iModel.changeset.id,
72
- urlPrefix: args.urlPrefix,
73
- enableCDN: args.enableCDN,
74
- };
75
- let selectedExport;
76
- for await (const exp of queryMeshExports(queryArgs)) {
77
- selectedExport = exp;
78
- break;
79
- }
80
- if (!selectedExport && !args.requireExactChangeset) {
81
- queryArgs.changesetId = undefined;
82
- for await (const exp of queryMeshExports(queryArgs)) {
83
- selectedExport = exp;
84
- core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, `No exports for iModel ${args.iModel.iModelId} for changeset ${args.iModel.changeset.id}; falling back to most recent`);
85
- break;
86
- }
87
- }
88
- if (!selectedExport) {
89
- core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, `No exports available for iModel ${args.iModel.iModelId}`);
90
- return undefined;
91
- }
92
- const url = new URL(selectedExport._links.mesh.href);
93
- url.pathname = `${url.pathname}/tileset.json`;
94
- return url;
61
+ return (0, GraphicsProvider_1.obtainIModelTilesetUrl)(args);
95
62
  }
96
63
  exports.obtainMeshExportTilesetUrl = obtainMeshExportTilesetUrl;
97
64
  /** Global configuration initialized by [[initializeFrontendTiles]].
@@ -113,7 +80,7 @@ function initializeFrontendTiles(options) {
113
80
  if (options.useIndexedDBCache)
114
81
  exports.frontendTilesOptions.useIndexedDBCache = true;
115
82
  const computeUrl = options.computeSpatialTilesetBaseUrl ?? (async (iModel) => obtainMeshExportTilesetUrl({ iModel, accessToken: await core_frontend_1.IModelApp.getAccessToken(), enableCDN: options.enableCDN }));
116
- core_frontend_1.SpatialTileTreeReferences.create = (view) => (0, BatchedSpatialTileTreeRefs_1.createBatchedSpatialTileTreeReferences)(view, computeUrl);
83
+ core_frontend_1.SpatialTileTreeReferences.create = (view) => (0, BatchedSpatialTileTreeRefs_1.createBatchedSpatialTileTreeReferences)(view, computeUrl, options.nopFallback ?? false);
117
84
  }
118
85
  exports.initializeFrontendTiles = initializeFrontendTiles;
119
86
  //# sourceMappingURL=FrontendTiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FrontendTiles.js","sourceRoot":"","sources":["../../src/FrontendTiles.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAA0D;AAC1D,wDAAgH;AAChH,qDAAkD;AAClD,6EAAsF;AAUtF,SAAS,+BAA+B,CAAC,IAAyF;IAChI,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;IACpC,IAAI,GAAG,GAAG,WAAW,MAAM,yCAAyC,IAAI,CAAC,QAAQ,qBAAqB,CAAC;IACvG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;AAC1H,CAAC;AAfD,0DAeC","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 { AccessToken, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelApp, IModelConnection, SpatialTileTreeReferences, SpatialViewState } from \"@itwin/core-frontend\";\r\nimport { loggerCategory } from \"./LoggerCategory\";\r\nimport { createBatchedSpatialTileTreeReferences } from \"./BatchedSpatialTileTreeRefs\";\r\n\r\n/** A function that can provide the base URL where a tileset representing all of the spatial models in a given iModel are stored.\r\n * The tileset is expected to reside at \"baseUrl/tileset.json\" and to have been produced by the [mesh export service](https://developer.bentley.com/apis/mesh-export/).\r\n * If no such tileset exists for the given iModel, return `undefined`.\r\n * @see [[FrontendTilesOptions.computeSpatialTilesetBaseUrl]].\r\n * @beta\r\n */\r\nexport type ComputeSpatialTilesetBaseUrl = (iModel: IModelConnection) => Promise<URL | undefined>;\r\n\r\nfunction createMeshExportServiceQueryUrl(args: { iModelId: string, urlPrefix?: string, changesetId?: string, enableCDN?: boolean }): string {\r\n const prefix = args.urlPrefix ?? \"\";\r\n let url = `https://${prefix}api.bentley.com/mesh-export/?iModelId=${args.iModelId}&$orderBy=date:desc`;\r\n if (args.changesetId)\r\n url = `${url}&changesetId=${args.changesetId}`;\r\n\r\n if (args.enableCDN)\r\n url = `${url}&cdn=1`;\r\n\r\n url = `${url}&tileVersion=1&exportType=IMODEL`;\r\n\r\n return url;\r\n}\r\n\r\n/** Represents the result of a [mesh export](https://developer.bentley.com/apis/mesh-export/operations/get-export/#export).\r\n * @see [[queryCompletedMeshExports]].\r\n * @beta\r\n */\r\nexport interface MeshExport {\r\n id: string;\r\n displayName: string;\r\n status: string;\r\n request: {\r\n iModelId: string;\r\n changesetId: string;\r\n exportType: string;\r\n geometryOptions: any;\r\n viewDefinitionFilter: any;\r\n };\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n mesh: {\r\n href: string;\r\n };\r\n };\r\n}\r\n\r\n/** Exposed strictly for tests.\r\n * @internal\r\n */\r\nexport interface MeshExports {\r\n exports: MeshExport[];\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n next?: {\r\n href: string;\r\n };\r\n };\r\n}\r\n\r\n/** Arguments supplied to [[queryMeshExports]].\r\n * @beta\r\n */\r\nexport interface QueryMeshExportsArgs {\r\n /** The token used to access the mesh export service. */\r\n accessToken: AccessToken;\r\n /** The Id of the iModel for which to query exports. */\r\n iModelId: string;\r\n /** If defined, constrains the query to exports produced from the specified changeset. */\r\n changesetId?: string;\r\n /** Chiefly used in testing environments. */\r\n urlPrefix?: string;\r\n /** If true, exports whose status is not \"Complete\" (indicating the export successfully finished) will be included in the results. */\r\n includeIncomplete?: boolean;\r\n /** If true, enables a CDN (content delivery network) to access tiles faster. */\r\n enableCDN?: boolean;\r\n}\r\n\r\n/** Query the [mesh export service](https://developer.bentley.com/apis/mesh-export/operations/get-exports/) for exports of type \"IMODEL\" matching\r\n * the specified criteria.\r\n * The exports are sorted from most-recently- to least-recently-produced.\r\n * @beta\r\n */\r\nexport async function* queryMeshExports(args: QueryMeshExportsArgs): AsyncIterableIterator<MeshExport> {\r\n const headers = {\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n Authorization: args.accessToken ?? await IModelApp.getAccessToken(),\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n Accept: \"application/vnd.bentley.itwin-platform.v1+json\",\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n Prefer: \"return=representation\",\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n SessionId: IModelApp.sessionId,\r\n };\r\n\r\n let url: string | undefined = createMeshExportServiceQueryUrl(args);\r\n while (url) {\r\n let result;\r\n try {\r\n const response = await fetch(url, { headers });\r\n result = await response.json() as MeshExports;\r\n } catch (err) {\r\n Logger.logException(loggerCategory, err);\r\n Logger.logError(loggerCategory, `Failed loading exports for iModel ${args.iModelId}`);\r\n break;\r\n }\r\n\r\n const foundExports = result.exports.filter((x) => x.request.exportType === \"IMODEL\" && (args.includeIncomplete || x.status === \"Complete\"));\r\n for (const foundExport of foundExports)\r\n yield foundExport;\r\n\r\n url = result._links.next?.href;\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[obtainMeshExportTilesetUrl]].\r\n * @beta\r\n */\r\nexport interface ObtainMeshExportTilesetUrlArgs {\r\n /** The iModel for which to obtain a tileset URl. */\r\n iModel: IModelConnection;\r\n /** The token used to access the mesh export service. */\r\n accessToken: AccessToken;\r\n /** Chiefly used in testing environments. */\r\n urlPrefix?: string;\r\n /** If true, only exports produced for `iModel`'s specific changeset will be considered; otherwise, if no exports are found for the changeset,\r\n * the most recent export for any changeset will be used.\r\n */\r\n requireExactChangeset?: boolean;\r\n /** If true, enables a CDN (content delivery network) to access tiles faster. */\r\n enableCDN?: boolean;\r\n}\r\n\r\n/** Obtains a URL pointing to a tileset appropriate for visualizing a specific iModel.\r\n * [[queryCompletedMeshExports]] is used to obtain a list of available exports. By default, the list is sorted from most to least recently-exported.\r\n * The first export matching the iModel's changeset is selected; or, if no such export exists, the first export in the list is selected.\r\n * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.\r\n * @beta\r\n */\r\nexport async function obtainMeshExportTilesetUrl(args: ObtainMeshExportTilesetUrlArgs): Promise<URL | undefined> {\r\n if (!args.iModel.iModelId) {\r\n Logger.logInfo(loggerCategory, \"Cannot obtain exports for an iModel with no iModelId\");\r\n return undefined;\r\n }\r\n\r\n const queryArgs: QueryMeshExportsArgs = {\r\n accessToken: args.accessToken,\r\n iModelId: args.iModel.iModelId,\r\n changesetId: args.iModel.changeset.id,\r\n urlPrefix: args.urlPrefix,\r\n enableCDN: args.enableCDN,\r\n };\r\n\r\n let selectedExport;\r\n for await (const exp of queryMeshExports(queryArgs)) {\r\n selectedExport = exp;\r\n break;\r\n }\r\n\r\n if (!selectedExport && !args.requireExactChangeset) {\r\n queryArgs.changesetId = undefined;\r\n for await (const exp of queryMeshExports(queryArgs)) {\r\n selectedExport = exp;\r\n Logger.logInfo(loggerCategory, `No exports for iModel ${args.iModel.iModelId} for changeset ${args.iModel.changeset.id}; falling back to most recent`);\r\n break;\r\n }\r\n }\r\n\r\n if (!selectedExport) {\r\n Logger.logInfo(loggerCategory, `No exports available for iModel ${args.iModel.iModelId}`);\r\n return undefined;\r\n }\r\n\r\n const url = new URL(selectedExport._links.mesh.href);\r\n url.pathname = `${url.pathname}/tileset.json`;\r\n return url;\r\n}\r\n\r\n/** Options supplied to [[initializeFrontendTiles]].\r\n * @beta\r\n */\r\nexport interface FrontendTilesOptions {\r\n /** Provide the base URL for the pre-published tileset for a given iModel.\r\n * If omitted, [[obtainMeshExportTilesetUrl]] will be invoked with default arguments, using the access token provided by [[IModelApp]].\r\n */\r\n computeSpatialTilesetBaseUrl?: ComputeSpatialTilesetBaseUrl;\r\n /** The maximum number of levels in the tile tree to skip loading if they do not provide the desired level of detail for the current view.\r\n * Default: 4.\r\n * Reducing this value will load more intermediate tiles, which causes more gradual refinement: low-resolution tiles will display quickly, followed more gradually by\r\n * successively higher-resolution ones.\r\n * Increasing the value jumps more directly to tiles of the exact level of detail desired, which may load more, smaller tiles up-front, leaving some areas of the view\r\n * vacant for longer; and when zooming out some newly-exposed areas of the view may remain vacant for longer because no lower-resolution tiles are initially available to\r\n * fill them. However, tiles close to the viewer (and therefore likely of most interest to them) will refine to an appropriate level of detail more quickly.\r\n */\r\n maxLevelsToSkip?: number;\r\n /** Specifies whether to permit the user to enable visible edges or wireframe mode for batched tiles.\r\n * The currently-deployed mesh export service does not produce edges, so this currently defaults to `false` to avoid user confusion.\r\n * Set it to `true` if you are loading tiles created with a version of the exporter that does produce edges.\r\n * ###TODO delete this option once we deploy an edge-producing version of the exporter to production.\r\n * @internal\r\n */\r\n enableEdges?: boolean;\r\n /** Specifies whether to enable a CDN (content delivery network) to access tiles faster.\r\n * This option is only used if computeSpatialTilesetBaseUrl is not defined.\r\n * @beta\r\n */\r\n enableCDN?: boolean;\r\n /** Specifies whether to enable an IndexedDB database for use as a local cache.\r\n * Requested tiles will then first be search for in the database, and if not found, fetched as normal.\r\n * @internal\r\n */\r\n useIndexedDBCache?: boolean;\r\n}\r\n\r\n/** Global configuration initialized by [[initializeFrontendTiles]].\r\n * @internal\r\n */\r\nexport const frontendTilesOptions = {\r\n maxLevelsToSkip: 4,\r\n enableEdges: false,\r\n useIndexedDBCache: false,\r\n};\r\n\r\n/** Initialize the frontend-tiles package to obtain tiles for spatial views.\r\n * @beta\r\n */\r\nexport function initializeFrontendTiles(options: FrontendTilesOptions): void {\r\n if (undefined !== options.maxLevelsToSkip && options.maxLevelsToSkip >= 0)\r\n frontendTilesOptions.maxLevelsToSkip = options.maxLevelsToSkip;\r\n\r\n if (options.enableEdges)\r\n frontendTilesOptions.enableEdges = true;\r\n\r\n if (options.useIndexedDBCache)\r\n frontendTilesOptions.useIndexedDBCache = true;\r\n\r\n const computeUrl = options.computeSpatialTilesetBaseUrl ?? (\r\n async (iModel: IModelConnection) => obtainMeshExportTilesetUrl({ iModel, accessToken: await IModelApp.getAccessToken(), enableCDN: options.enableCDN })\r\n );\r\n\r\n SpatialTileTreeReferences.create = (view: SpatialViewState) => createBatchedSpatialTileTreeReferences(view, computeUrl);\r\n}\r\n"]}
1
+ {"version":3,"file":"FrontendTiles.js","sourceRoot":"","sources":["../../src/FrontendTiles.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,wDAAgH;AAChH,6EAAsF;AACtF,oGAA+F;AAE/F,0EAAwG;AAoExG;;;;GAIG;AACI,KAAK,SAAS,CAAC,CAAC,gBAAgB,CAAC,IAA0B;IAChE,MAAM,YAAY,GAAG;QACnB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,yBAAS,CAAC,SAAS;QAC9B,UAA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eAAe,IAAI,OAAO,CAAC,eAAe,IAAI,CAAC;QACvE,4BAAoB,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAEjE,IAAI,OAAO,CAAC,WAAW;QACrB,4BAAoB,CAAC,WAAW,GAAG,IAAI,CAAC;IAE1C,IAAI,OAAO,CAAC,iBAAiB;QAC3B,4BAAoB,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAEhD,MAAM,UAAU,GAAG,OAAO,CAAC,4BAA4B,IAAI,CACzD,KAAK,EAAE,MAAwB,EAAE,EAAE,CAAC,0BAA0B,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAS,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CACxJ,CAAC;IAEF,yCAAyB,CAAC,MAAM,GAAG,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAA,mEAAsC,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC;AACxJ,CAAC;AAfD,0DAeC","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 { IModelApp, IModelConnection, SpatialTileTreeReferences, SpatialViewState } from \"@itwin/core-frontend\";\r\nimport { createBatchedSpatialTileTreeReferences } from \"./BatchedSpatialTileTreeRefs\";\r\nimport { queryGraphicRepresentations } from \"./GraphicsProvider/GraphicRepresentationProvider\";\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\nimport { obtainIModelTilesetUrl, ObtainIModelTilesetUrlArgs} from \"./GraphicsProvider/GraphicsProvider\";\r\n\r\n/** A function that can provide the base URL where a tileset representing all of the spatial models in a given iModel are stored.\r\n * The tileset is expected to reside at \"baseUrl/tileset.json\" and to have been produced by the [mesh export service](https://developer.bentley.com/apis/mesh-export/).\r\n * If no such tileset exists for the given iModel, return `undefined`.\r\n * @see [[FrontendTilesOptions.computeSpatialTilesetBaseUrl]].\r\n * @beta\r\n */\r\nexport type ComputeSpatialTilesetBaseUrl = (iModel: IModelConnection) => Promise<URL | undefined>;\r\n\r\n/** Represents the result of a [mesh export](https://developer.bentley.com/apis/mesh-export/operations/get-export/#export).\r\n * @see [[queryCompletedMeshExports]].\r\n * @beta\r\n */\r\nexport interface MeshExport {\r\n id: string;\r\n displayName: string;\r\n status: string;\r\n request: {\r\n iModelId: string;\r\n changesetId: string;\r\n exportType: string;\r\n geometryOptions: any;\r\n viewDefinitionFilter: any;\r\n };\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n mesh: {\r\n href: string;\r\n };\r\n };\r\n}\r\n\r\n/** Exposed strictly for tests.\r\n * @internal\r\n */\r\nexport interface MeshExports {\r\n exports: MeshExport[];\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n next?: {\r\n href: string;\r\n };\r\n };\r\n}\r\n\r\n/** Arguments supplied to [[queryMeshExports]].\r\n * @beta\r\n */\r\nexport interface QueryMeshExportsArgs {\r\n /** The token used to access the mesh export service. */\r\n accessToken: AccessToken;\r\n /** The iTwinId associated with the Mesh Export */\r\n iTwinId: string;\r\n /** The Id of the iModel for which to query exports. */\r\n iModelId: string;\r\n /** If defined, constrains the query to exports produced from the specified changeset. */\r\n changesetId?: string;\r\n /** Chiefly used in testing environments. */\r\n urlPrefix?: string;\r\n /** If true, exports whose status is not \"Complete\" (indicating the export successfully finished) will be included in the results. */\r\n includeIncomplete?: boolean;\r\n /** If true, enables a CDN (content delivery network) to access tiles faster. */\r\n enableCDN?: boolean;\r\n}\r\n\r\n/** Query the [mesh export service](https://developer.bentley.com/apis/mesh-export/operations/get-exports/) for exports of type \"IMODEL\" matching\r\n * the specified criteria.\r\n * The exports are sorted from most-recently- to least-recently-produced.\r\n * @beta\r\n */\r\nexport async function* queryMeshExports(args: QueryMeshExportsArgs): AsyncIterableIterator<MeshExport> {\r\n const graphicsArgs = {\r\n accessToken: args.accessToken,\r\n sessionId: IModelApp.sessionId,\r\n dataSource: {\r\n iTwinId: args.iTwinId,\r\n id: args.iModelId,\r\n changeId: args.changesetId,\r\n type: \"IMODEL\",\r\n },\r\n format: \"IMDL\",\r\n urlPrefix: args.urlPrefix,\r\n enableCDN: args.enableCDN,\r\n };\r\n\r\n for await (const data of queryGraphicRepresentations(graphicsArgs)){\r\n const meshExport = {\r\n id: data.representationId,\r\n displayName: data.displayName,\r\n status: \"Complete\",\r\n request: {\r\n iModelId: data.dataSource.id,\r\n changesetId: data.dataSource.changeId ?? \"\",\r\n exportType: data.dataSource.type,\r\n geometryOptions: {},\r\n viewDefinitionFilter: {},\r\n },\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n mesh: {\r\n href: data.url ?? \"\",\r\n },\r\n },\r\n };\r\n\r\n yield meshExport;\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[obtainMeshExportTilesetUrl]].\r\n * @beta\r\n */\r\nexport type ObtainMeshExportTilesetUrlArgs = ObtainIModelTilesetUrlArgs;\r\n\r\n/** Obtains a URL pointing to a tileset appropriate for visualizing a specific iModel.\r\n * [[queryCompletedMeshExports]] is used to obtain a list of available exports. By default, the list is sorted from most to least recently-exported.\r\n * The first export matching the iModel's changeset is selected; or, if no such export exists, the first export in the list is selected.\r\n * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.\r\n * @beta\r\n */\r\nexport async function obtainMeshExportTilesetUrl(args: ObtainMeshExportTilesetUrlArgs): Promise<URL | undefined> {\r\n return obtainIModelTilesetUrl(args);\r\n}\r\n/** Options supplied to [[initializeFrontendTiles]].\r\n * @beta\r\n */\r\nexport interface FrontendTilesOptions {\r\n /** Provide the base URL for the pre-published tileset for a given iModel.\r\n * If omitted, [[obtainMeshExportTilesetUrl]] will be invoked with default arguments, using the access token provided by [[IModelApp]].\r\n */\r\n computeSpatialTilesetBaseUrl?: ComputeSpatialTilesetBaseUrl;\r\n /** The maximum number of levels in the tile tree to skip loading if they do not provide the desired level of detail for the current view.\r\n * Default: 4.\r\n * Reducing this value will load more intermediate tiles, which causes more gradual refinement: low-resolution tiles will display quickly, followed more gradually by\r\n * successively higher-resolution ones.\r\n * Increasing the value jumps more directly to tiles of the exact level of detail desired, which may load more, smaller tiles up-front, leaving some areas of the view\r\n * vacant for longer; and when zooming out some newly-exposed areas of the view may remain vacant for longer because no lower-resolution tiles are initially available to\r\n * fill them. However, tiles close to the viewer (and therefore likely of most interest to them) will refine to an appropriate level of detail more quickly.\r\n */\r\n maxLevelsToSkip?: number;\r\n /** Specifies whether to permit the user to enable visible edges or wireframe mode for batched tiles.\r\n * The currently-deployed mesh export service does not produce edges, so this currently defaults to `false` to avoid user confusion.\r\n * Set it to `true` if you are loading tiles created with a version of the exporter that does produce edges.\r\n * ###TODO delete this option once we deploy an edge-producing version of the exporter to production.\r\n * @internal\r\n */\r\n enableEdges?: boolean;\r\n /** Specifies whether to enable a CDN (content delivery network) to access tiles faster.\r\n * This option is only used if computeSpatialTilesetBaseUrl is not defined.\r\n * @beta\r\n */\r\n enableCDN?: boolean;\r\n /** Specifies whether to enable an IndexedDB database for use as a local cache.\r\n * Requested tiles will then first be search for in the database, and if not found, fetched as normal.\r\n * @internal\r\n */\r\n useIndexedDBCache?: boolean;\r\n\r\n /** If true, an empty tile tree will be used as fallback if the tileset is not found or invalid.\r\n * If false or not defined, the default tiles will be used as a fallback.\r\n * @internal\r\n */\r\n nopFallback?: boolean;\r\n}\r\n\r\n/** Global configuration initialized by [[initializeFrontendTiles]].\r\n * @internal\r\n */\r\nexport const frontendTilesOptions = {\r\n maxLevelsToSkip: 4,\r\n enableEdges: false,\r\n useIndexedDBCache: false,\r\n};\r\n\r\n/** Initialize the frontend-tiles package to obtain tiles for spatial views.\r\n * @beta\r\n */\r\nexport function initializeFrontendTiles(options: FrontendTilesOptions): void {\r\n if (undefined !== options.maxLevelsToSkip && options.maxLevelsToSkip >= 0)\r\n frontendTilesOptions.maxLevelsToSkip = options.maxLevelsToSkip;\r\n\r\n if (options.enableEdges)\r\n frontendTilesOptions.enableEdges = true;\r\n\r\n if (options.useIndexedDBCache)\r\n frontendTilesOptions.useIndexedDBCache = true;\r\n\r\n const computeUrl = options.computeSpatialTilesetBaseUrl ?? (\r\n async (iModel: IModelConnection) => obtainMeshExportTilesetUrl({ iModel, accessToken: await IModelApp.getAccessToken(), enableCDN: options.enableCDN })\r\n );\r\n\r\n SpatialTileTreeReferences.create = (view: SpatialViewState) => createBatchedSpatialTileTreeReferences(view, computeUrl, options.nopFallback ?? false);\r\n}\r\n"]}
@@ -0,0 +1,124 @@
1
+ import { AccessToken } from "@itwin/core-bentley";
2
+ /** The expected format of the Graphic Representation
3
+ * @beta
4
+ */
5
+ export type GraphicRepresentationFormat = "IMDL" | "3DTILES" | string;
6
+ /** Graphic representations are generated from Data Sources.
7
+ * The status of a Graphic Representation indicates the progress of that generation process.
8
+ * @beta
9
+ */
10
+ export declare enum GraphicRepresentationStatus {
11
+ InProgress = "In progress",
12
+ Complete = "Complete",
13
+ NotStarted = "Not started",
14
+ Failed = "Failed"
15
+ }
16
+ /**
17
+ * Represents a data source for a graphic representation.
18
+ * A data source is usually higher-fidelity and contains more information, but may not be as well suited for visualization
19
+ * as a graphic representation.
20
+ * @beta
21
+ */
22
+ export interface DataSource {
23
+ /** The iTwinId associated with the DataSource */
24
+ iTwinId: string;
25
+ /** The unique identifier of a DataSource.
26
+ * For example, a DataSource of type "IMODEL" has an iModelId which would be attributed to this value.
27
+ */
28
+ id: string;
29
+ /** The unique identifier for a specific version of a DataSource.
30
+ * For example, if a specific version of an iModel is desired, the iModel's changesetId would be attributed to this value.
31
+ */
32
+ changeId?: string;
33
+ /** The type of the data source. For example, a DataSource can be of type "IMODEL" or "RealityData" */
34
+ type: string;
35
+ }
36
+ /** Represents a visual representation of a data source, for example a 3d tileset.
37
+ * A data source can be an iModel, reality data, or other kind of graphical data.
38
+ * @see [[queryGraphicRepresentations]] for its construction as a representation of the data produced by a query of data sources.
39
+ * @beta
40
+ */
41
+ export type GraphicRepresentation = {
42
+ /** The display name of the Graphic Representation */
43
+ displayName: string;
44
+ /** The unique identifier for the Graphic Representation */
45
+ representationId: string;
46
+ /** The status of the generation of the Graphic Representation from its Data Source.
47
+ * @see [[GraphicRepresentationStatus]] for possible values.
48
+ */
49
+ status: GraphicRepresentationStatus;
50
+ /** The expected format of the Graphic Representation
51
+ * @see [[GraphicRepresentationFormat]] for possible values.
52
+ */
53
+ format: GraphicRepresentationFormat;
54
+ /** The data source that the representation originates from.
55
+ * For example, a GraphicRepresentation in the 3D Tiles format might have a dataSource that is a specific iModel changeset.
56
+ */
57
+ dataSource: DataSource;
58
+ } & ({
59
+ status: Omit<GraphicRepresentationStatus, GraphicRepresentationStatus.Complete>;
60
+ url?: string;
61
+ } | {
62
+ status: GraphicRepresentationStatus.Complete;
63
+ url: string;
64
+ });
65
+ /** Arguments supplied to [[queryGraphicRepresentations]].
66
+ * @beta
67
+ */
68
+ export interface QueryGraphicRepresentationsArgs {
69
+ /** The token used to access the data source provider. */
70
+ accessToken: AccessToken;
71
+ /** The unique identifier for the session in which this data source was queried.
72
+ * A possible value is IModelApp.sessionId.
73
+ */
74
+ sessionId: string;
75
+ /** The Data Source for which to query the graphic representations */
76
+ dataSource: DataSource;
77
+ /** The expected format of the graphic representations
78
+ * @see [[GraphicRepresentationFormat]] for possible values.
79
+ */
80
+ format: GraphicRepresentationFormat;
81
+ /** Chiefly used in testing environments. */
82
+ urlPrefix?: string;
83
+ /** If true, exports whose status is not "Complete" (indicating the export successfully finished) will be included in the results */
84
+ includeIncomplete?: boolean;
85
+ /** If true, enables a CDN (content delivery network) to access tiles faster. */
86
+ enableCDN?: boolean;
87
+ }
88
+ /** Query Graphic Representations matching the specified criteria, sorted from most-recently- to least-recently-produced.
89
+ * @beta
90
+ */
91
+ export declare function queryGraphicRepresentations(args: QueryGraphicRepresentationsArgs): AsyncIterableIterator<GraphicRepresentation>;
92
+ /** Arguments supplied to [[obtainGraphicRepresentationUrl]].
93
+ * @beta
94
+ */
95
+ export interface ObtainGraphicRepresentationUrlArgs {
96
+ /** The token used to access the mesh export service. */
97
+ accessToken: AccessToken;
98
+ /** The unique identifier for the session in which this data source was queried.
99
+ * A possible value is IModelApp.sessionId.
100
+ */
101
+ sessionId: string;
102
+ /** The data source for which to query the graphic representations */
103
+ dataSource: DataSource;
104
+ /** The expected format of the graphic representations
105
+ * @see [[GraphicRepresentationFormat]] for possible values.
106
+ */
107
+ format: GraphicRepresentationFormat;
108
+ /** Chiefly used in testing environments. */
109
+ urlPrefix?: string;
110
+ /** If true, only data produced for a specific data source version will be considered;
111
+ * otherwise, if no data sources are found with the specified version,the most recent data source version will be used.
112
+ */
113
+ requireExactVersion?: boolean;
114
+ /** If true, enables a CDN (content delivery network) to access tiles faster. */
115
+ enableCDN?: boolean;
116
+ }
117
+ /** Obtains a URL pointing to a Graphic Representation.
118
+ * [[queryGraphicRepresentations]] is used to obtain a list of available representations. By default, the list is sorted from most to least recently-created.
119
+ * The first representation matching the source version is selected; or, if no such representation exists, the first representation in the list is selected.
120
+ * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.
121
+ * @beta
122
+ */
123
+ export declare function obtainGraphicRepresentationUrl(args: ObtainGraphicRepresentationUrlArgs): Promise<URL | undefined>;
124
+ //# sourceMappingURL=GraphicRepresentationProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphicRepresentationProvider.d.ts","sourceRoot":"","sources":["../../../src/GraphicsProvider/GraphicRepresentationProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAS,MAAM,qBAAqB,CAAC;AAIzD;;GAEG;AAEH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtE;;;GAGG;AACH,oBAAY,2BAA2B;IACrC,U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EAAE,+BAA+B,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,CA4EtI;AAED;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,wDAAwD;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,MAAM,EAAG,2BAA2B,CAAC;IACrC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gFAAgF;IAChF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAAC,IAAI,EAAE,kCAAkC,GAAG,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,CAsCvH"}
@@ -0,0 +1,122 @@
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.obtainGraphicRepresentationUrl = exports.queryGraphicRepresentations = exports.GraphicRepresentationStatus = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const LoggerCategory_1 = require("../LoggerCategory");
10
+ const core_frontend_1 = require("@itwin/core-frontend");
11
+ /** Graphic representations are generated from Data Sources.
12
+ * The status of a Graphic Representation indicates the progress of that generation process.
13
+ * @beta
14
+ */
15
+ var GraphicRepresentationStatus;
16
+ (function (GraphicRepresentationStatus) {
17
+ GraphicRepresentationStatus["InProgress"] = "In progress";
18
+ GraphicRepresentationStatus["Complete"] = "Complete";
19
+ GraphicRepresentationStatus["NotStarted"] = "Not started";
20
+ GraphicRepresentationStatus["Failed"] = "Failed";
21
+ })(GraphicRepresentationStatus || (exports.GraphicRepresentationStatus = GraphicRepresentationStatus = {}));
22
+ /** Creates a URL used to query for Graphic Representations */
23
+ function createGraphicRepresentationsQueryUrl(args) {
24
+ const prefix = args.urlPrefix ?? "";
25
+ let url = `https://${prefix}api.bentley.com/mesh-export/?iModelId=${args.sourceId}&$orderBy=date:desc`;
26
+ if (args.changeId)
27
+ url = `${url}&changesetId=${args.changeId}`;
28
+ if (args.enableCDN)
29
+ url = `${url}&cdn=1`;
30
+ const tileVersion = core_frontend_1.IModelApp.tileAdmin.maximumMajorTileFormatVersion.toString();
31
+ url = `${url}&tileVersion=${tileVersion}&iTwinJS=${core_frontend_1.ITWINJS_CORE_VERSION}&exportType=${args.sourceType}`;
32
+ return url;
33
+ }
34
+ /** Query Graphic Representations matching the specified criteria, sorted from most-recently- to least-recently-produced.
35
+ * @beta
36
+ */
37
+ async function* queryGraphicRepresentations(args) {
38
+ const headers = {
39
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
40
+ Authorization: args.accessToken,
41
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
42
+ Accept: "application/vnd.bentley.itwin-platform.v1+json",
43
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
44
+ Prefer: "return=representation",
45
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
46
+ SessionId: args.sessionId,
47
+ };
48
+ let url = createGraphicRepresentationsQueryUrl({ sourceId: args.dataSource.id, sourceType: args.dataSource.type, urlPrefix: args.urlPrefix, changeId: args.dataSource.changeId, enableCDN: args.enableCDN });
49
+ while (url) {
50
+ let result;
51
+ try {
52
+ const response = await fetch(url, { headers });
53
+ result = await response.json();
54
+ }
55
+ catch (err) {
56
+ core_bentley_1.Logger.logException(LoggerCategory_1.loggerCategory, err);
57
+ core_bentley_1.Logger.logError(LoggerCategory_1.loggerCategory, `Failed loading Graphics Data for Source ${args.dataSource.id}`);
58
+ break;
59
+ }
60
+ const foundSources = result.exports.filter((x) => x.request.exportType === args.dataSource.type && (args.includeIncomplete || x.status === GraphicRepresentationStatus.Complete));
61
+ for (const foundSource of foundSources) {
62
+ const graphicRepresentation = {
63
+ displayName: foundSource.displayName,
64
+ representationId: foundSource.id,
65
+ status: foundSource.status,
66
+ format: args.format,
67
+ url: foundSource._links.mesh.href,
68
+ dataSource: {
69
+ iTwinId: args.dataSource.iTwinId,
70
+ id: foundSource.request.iModelId,
71
+ versionId: foundSource.request.changesetId,
72
+ type: foundSource.request.exportType,
73
+ },
74
+ };
75
+ yield graphicRepresentation;
76
+ }
77
+ url = result._links.next?.href;
78
+ }
79
+ }
80
+ exports.queryGraphicRepresentations = queryGraphicRepresentations;
81
+ /** Obtains a URL pointing to a Graphic Representation.
82
+ * [[queryGraphicRepresentations]] is used to obtain a list of available representations. By default, the list is sorted from most to least recently-created.
83
+ * The first representation matching the source version is selected; or, if no such representation exists, the first representation in the list is selected.
84
+ * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.
85
+ * @beta
86
+ */
87
+ async function obtainGraphicRepresentationUrl(args) {
88
+ if (!args.dataSource.id) {
89
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, "Cannot obtain Graphics Data from a source without an Id");
90
+ return undefined;
91
+ }
92
+ const queryArgs = {
93
+ accessToken: args.accessToken,
94
+ sessionId: args.sessionId,
95
+ dataSource: args.dataSource,
96
+ format: args.format,
97
+ urlPrefix: args.urlPrefix,
98
+ enableCDN: args.enableCDN,
99
+ };
100
+ let selectedData;
101
+ for await (const data of queryGraphicRepresentations(queryArgs)) {
102
+ selectedData = data;
103
+ break;
104
+ }
105
+ if (!selectedData && !args.requireExactVersion) {
106
+ queryArgs.dataSource.changeId = undefined;
107
+ for await (const data of queryGraphicRepresentations(queryArgs)) {
108
+ selectedData = data;
109
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, `No data for Data Source ${args.dataSource.id} for version ${args.dataSource.changeId}; falling back to most recent`);
110
+ break;
111
+ }
112
+ }
113
+ if ((!selectedData) || (!selectedData.url)) {
114
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, `No data available for Data Source ${args.dataSource.id}`);
115
+ return undefined;
116
+ }
117
+ const url = new URL(selectedData.url);
118
+ url.pathname = `${url.pathname}/tileset.json`;
119
+ return url;
120
+ }
121
+ exports.obtainGraphicRepresentationUrl = obtainGraphicRepresentationUrl;
122
+ //# sourceMappingURL=GraphicRepresentationProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphicRepresentationProvider.js","sourceRoot":"","sources":["../../../src/GraphicsProvider/GraphicRepresentationProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAAyD;AACzD,sDAAkD;AAClD,wDAAuE;AAQvE;;;GAGG;AACH,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACrC,yDAA0B,CAAA;IAC1B,oDAAqB,CAAA;IACrB,yDAA0B,CAAA;IAC1B,gDAAiB,CAAA;AACnB,CAAC,EALW,2BAA2B,2CAA3B,2BAA2B,QAKtC;AAyDD,8DAA8D;AAC9D,SAAS,oCAAoC,CAAC,IAA0G;IACtJ,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;IACpC,IAAI,GAAG,GAAG,WAAW,MAAM,yCAAyC,IAAI,CAAC,QAAQ,qBAAqB,CAAC;IACvG,IAAI,IAAI,CAAC,QAAQ;QACf,GAAG,GAAG,GAAG,GAAG,gBAAgB,IAAI,CAAC,QAAQ,EAAE,CAAC;IAE9C,IAAI,IAAI,CAAC,SAAS;QAChB,GAAG,GAAG,GAAG,GAAG,QAAQ,CAAC;IAEvB,MAAM,WAAW,GAAG,yBAAS,CAAC,SAAS,CAAC,6BAA6B,CAAC,QAAQ,EAAE,CAAC;IACjF,GAAG,GAAG,GAAG,GAAG,gBAAgB,WAAW,YAAY,oCAAoB,eAAe,IAAI,CAAC,UAAU,EAAE,CAAC;IAExG,OAAO,GAAG,CAAC;AACb,CAAC;AA0BD;;GAEG;AACI,KAAK,SAAS,CAAC,CAAC,2B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AAC;QAChE,YAAY,GAAG,IAAI,CAAC;QACpB,MAAM;IACR,CAAC;IAED,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/C,SAAS,CAAC,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1C,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,2BAA2B,CAAC,SAAS,CAAC,EAAE,CAAC;YAChE,YAAY,GAAG,IAAI,CAAC;YACpB,qBAAM,CAAC,OAAO,CAAC,+BAAc,EAAE,2BAA2B,IAAI,CAAC,UAAU,CAAC,EAAE,gBAAgB,IAAI,CAAC,UAAU,CAAC,QAAQ,+BAA+B,CAAC,CAAC;YACrJ,MAAM;QACR,CAAC;IACH,CAAC;IAED,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,qBAAM,CAAC,OAAO,CAAC,+BAAc,EAAE,qCAAqC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1F,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACtC,GAAG,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,QAAQ,eAAe,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC;AAtCD,wEAsCC","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 { AccessToken, Logger} from \"@itwin/core-bentley\";\r\nimport { loggerCategory} from \"../LoggerCategory\";\r\nimport { IModelApp, ITWINJS_CORE_VERSION } from \"@itwin/core-frontend\";\r\n\r\n/** The expected format of the Graphic Representation\r\n * @beta\r\n */\r\n/* eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents */\r\nexport type GraphicRepresentationFormat = \"IMDL\" | \"3DTILES\" | string;\r\n\r\n/** Graphic representations are generated from Data Sources.\r\n * The status of a Graphic Representation indicates the progress of that generation process.\r\n * @beta\r\n */\r\nexport enum GraphicRepresentationStatus {\r\n InProgress = \"In progress\",\r\n Complete = \"Complete\",\r\n NotStarted = \"Not started\",\r\n Failed = \"Failed\",\r\n}\r\n\r\n/**\r\n * Represents a data source for a graphic representation.\r\n * A data source is usually higher-fidelity and contains more information, but may not be as well suited for visualization\r\n * as a graphic representation.\r\n * @beta\r\n */\r\nexport interface DataSource {\r\n /** The iTwinId associated with the DataSource */\r\n iTwinId: string;\r\n /** The unique identifier of a DataSource.\r\n * For example, a DataSource of type \"IMODEL\" has an iModelId which would be attributed to this value.\r\n */\r\n id: string;\r\n /** The unique identifier for a specific version of a DataSource.\r\n * For example, if a specific version of an iModel is desired, the iModel's changesetId would be attributed to this value.\r\n */\r\n changeId?: string;\r\n /** The type of the data source. For example, a DataSource can be of type \"IMODEL\" or \"RealityData\" */\r\n type: string;\r\n}\r\n\r\n/** Represents a visual representation of a data source, for example a 3d tileset.\r\n * A data source can be an iModel, reality data, or other kind of graphical data.\r\n * @see [[queryGraphicRepresentations]] for its construction as a representation of the data produced by a query of data sources.\r\n * @beta\r\n */\r\nexport type GraphicRepresentation = {\r\n /** The display name of the Graphic Representation */\r\n displayName: string;\r\n /** The unique identifier for the Graphic Representation */\r\n representationId: string;\r\n /** The status of the generation of the Graphic Representation from its Data Source.\r\n * @see [[GraphicRepresentationStatus]] for possible values.\r\n */\r\n status: GraphicRepresentationStatus;\r\n /** The expected format of the Graphic Representation\r\n * @see [[GraphicRepresentationFormat]] for possible values.\r\n */\r\n format: GraphicRepresentationFormat;\r\n /** The data source that the representation originates from.\r\n * For example, a GraphicRepresentation in the 3D Tiles format might have a dataSource that is a specific iModel changeset.\r\n */\r\n dataSource: DataSource;\r\n /** The url of the graphic representation\r\n * @note The url can only be guaranteed to be valid if the status is complete.\r\n * Therefore, the url is optional if the status is not complete, and required if the status is complete.\r\n */\r\n} & ({\r\n status: Omit<GraphicRepresentationStatus, GraphicRepresentationStatus.Complete>;\r\n url?: string;\r\n} | {\r\n status: GraphicRepresentationStatus.Complete;\r\n url: string;\r\n});\r\n\r\n/** Creates a URL used to query for Graphic Representations */\r\nfunction createGraphicRepresentationsQueryUrl(args: { sourceId: string, sourceType: string, urlPrefix?: string, changeId?: string, enableCDN?: boolean }): string {\r\n const prefix = args.urlPrefix ?? \"\";\r\n let url = `https://${prefix}api.bentley.com/mesh-export/?iModelId=${args.sourceId}&$orderBy=date:desc`;\r\n if (args.changeId)\r\n url = `${url}&changesetId=${args.changeId}`;\r\n\r\n if (args.enableCDN)\r\n url = `${url}&cdn=1`;\r\n\r\n const tileVersion = IModelApp.tileAdmin.maximumMajorTileFormatVersion.toString();\r\n url = `${url}&tileVersion=${tileVersion}&iTwinJS=${ITWINJS_CORE_VERSION}&exportType=${args.sourceType}`;\r\n\r\n return url;\r\n}\r\n\r\n/** Arguments supplied to [[queryGraphicRepresentations]].\r\n * @beta\r\n */\r\nexport interface QueryGraphicRepresentationsArgs {\r\n /** The token used to access the data source provider. */\r\n accessToken: AccessToken;\r\n /** The unique identifier for the session in which this data source was queried.\r\n * A possible value is IModelApp.sessionId.\r\n */\r\n sessionId: string;\r\n /** The Data Source for which to query the graphic representations */\r\n dataSource: DataSource;\r\n /** The expected format of the graphic representations\r\n * @see [[GraphicRepresentationFormat]] for possible values.\r\n */\r\n format: GraphicRepresentationFormat;\r\n /** Chiefly used in testing environments. */\r\n urlPrefix?: string;\r\n /** If true, exports whose status is not \"Complete\" (indicating the export successfully finished) will be included in the results */\r\n includeIncomplete?: boolean;\r\n /** If true, enables a CDN (content delivery network) to access tiles faster. */\r\n enableCDN?: boolean;\r\n}\r\n\r\n/** Query Graphic Representations matching the specified criteria, sorted from most-recently- to least-recently-produced.\r\n * @beta\r\n */\r\nexport async function* queryGraphicRepresentations(args: QueryGraphicRepresentationsArgs): AsyncIterableIterator<GraphicRepresentation> {\r\n interface ServiceJsonResponse {\r\n id: string;\r\n displayName: string;\r\n status: GraphicRepresentationStatus;\r\n request: {\r\n iModelId: string;\r\n changesetId: string;\r\n exportType: string;\r\n geometryOptions: any;\r\n viewDefinitionFilter: any;\r\n };\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n mesh: {\r\n href: string;\r\n };\r\n };\r\n }\r\n\r\n interface ServiceJsonResponses {\r\n exports: ServiceJsonResponse[];\r\n\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n _links: {\r\n next?: {\r\n href: string;\r\n };\r\n };\r\n }\r\n\r\n const headers = {\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n Authorization: args.accessToken,\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n Accept: \"application/vnd.bentley.itwin-platform.v1+json\",\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n Prefer: \"return=representation\",\r\n /* eslint-disable-next-line @typescript-eslint/naming-convention */\r\n SessionId: args.sessionId,\r\n };\r\n\r\n let url: string | undefined = createGraphicRepresentationsQueryUrl({ sourceId: args.dataSource.id, sourceType: args.dataSource.type, urlPrefix: args.urlPrefix, changeId: args.dataSource.changeId, enableCDN: args.enableCDN });\r\n while (url) {\r\n let result;\r\n try {\r\n const response = await fetch(url, { headers });\r\n result = await response.json() as ServiceJsonResponses;\r\n } catch (err) {\r\n Logger.logException(loggerCategory, err);\r\n Logger.logError(loggerCategory, `Failed loading Graphics Data for Source ${args.dataSource.id}`);\r\n break;\r\n }\r\n\r\n const foundSources = result.exports.filter((x) => x.request.exportType === args.dataSource.type && (args.includeIncomplete || x.status === GraphicRepresentationStatus.Complete));\r\n for (const foundSource of foundSources) {\r\n const graphicRepresentation = {\r\n displayName: foundSource.displayName,\r\n representationId: foundSource.id,\r\n status: foundSource.status,\r\n format: args.format,\r\n url: foundSource._links.mesh.href,\r\n dataSource: {\r\n iTwinId: args.dataSource.iTwinId,\r\n id: foundSource.request.iModelId,\r\n versionId: foundSource.request.changesetId,\r\n type: foundSource.request.exportType,\r\n },\r\n };\r\n\r\n yield graphicRepresentation;\r\n }\r\n\r\n url = result._links.next?.href;\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[obtainGraphicRepresentationUrl]].\r\n * @beta\r\n */\r\nexport interface ObtainGraphicRepresentationUrlArgs {\r\n /** The token used to access the mesh export service. */\r\n accessToken: AccessToken;\r\n /** The unique identifier for the session in which this data source was queried.\r\n * A possible value is IModelApp.sessionId.\r\n */\r\n sessionId: string;\r\n /** The data source for which to query the graphic representations */\r\n dataSource: DataSource;\r\n /** The expected format of the graphic representations\r\n * @see [[GraphicRepresentationFormat]] for possible values.\r\n */\r\n format: GraphicRepresentationFormat;\r\n /** Chiefly used in testing environments. */\r\n urlPrefix?: string;\r\n /** If true, only data produced for a specific data source version will be considered;\r\n * otherwise, if no data sources are found with the specified version,the most recent data source version will be used.\r\n */\r\n requireExactVersion?: boolean;\r\n /** If true, enables a CDN (content delivery network) to access tiles faster. */\r\n enableCDN?: boolean;\r\n}\r\n\r\n/** Obtains a URL pointing to a Graphic Representation.\r\n * [[queryGraphicRepresentations]] is used to obtain a list of available representations. By default, the list is sorted from most to least recently-created.\r\n * The first representation matching the source version is selected; or, if no such representation exists, the first representation in the list is selected.\r\n * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.\r\n * @beta\r\n */\r\nexport async function obtainGraphicRepresentationUrl(args: ObtainGraphicRepresentationUrlArgs): Promise<URL | undefined> {\r\n if (!args.dataSource.id) {\r\n Logger.logInfo(loggerCategory, \"Cannot obtain Graphics Data from a source without an Id\");\r\n return undefined;\r\n }\r\n\r\n const queryArgs: QueryGraphicRepresentationsArgs = {\r\n accessToken: args.accessToken,\r\n sessionId: args.sessionId,\r\n dataSource: args.dataSource,\r\n format: args.format,\r\n urlPrefix: args.urlPrefix,\r\n enableCDN: args.enableCDN,\r\n };\r\n\r\n let selectedData;\r\n for await (const data of queryGraphicRepresentations(queryArgs)) {\r\n selectedData = data;\r\n break;\r\n }\r\n\r\n if (!selectedData && !args.requireExactVersion) {\r\n queryArgs.dataSource.changeId = undefined;\r\n for await (const data of queryGraphicRepresentations(queryArgs)) {\r\n selectedData = data;\r\n Logger.logInfo(loggerCategory, `No data for Data Source ${args.dataSource.id} for version ${args.dataSource.changeId}; falling back to most recent`);\r\n break;\r\n }\r\n }\r\n\r\n if ((!selectedData) || (!selectedData.url)) {\r\n Logger.logInfo(loggerCategory, `No data available for Data Source ${args.dataSource.id}`);\r\n return undefined;\r\n }\r\n\r\n const url = new URL(selectedData.url);\r\n url.pathname = `${url.pathname}/tileset.json`;\r\n return url;\r\n}\r\n"]}
@@ -0,0 +1,27 @@
1
+ import { AccessToken } from "@itwin/core-bentley";
2
+ import { IModelConnection } from "@itwin/core-frontend";
3
+ /** Arguments supplied to [[obtainMeshExportTilesetUrl]].
4
+ * @beta
5
+ */
6
+ export interface ObtainIModelTilesetUrlArgs {
7
+ /** The iModel for which to obtain a tileset URl. */
8
+ iModel: IModelConnection;
9
+ /** The token used to access the mesh export service. */
10
+ accessToken: AccessToken;
11
+ /** Chiefly used in testing environments. */
12
+ urlPrefix?: string;
13
+ /** If true, only exports produced for `iModel`'s specific changeset will be considered; otherwise, if no exports are found for the changeset,
14
+ * the most recent export for any changeset will be used.
15
+ */
16
+ requireExactChangeset?: boolean;
17
+ /** If true, enables a CDN (content delivery network) to access tiles faster. */
18
+ enableCDN?: boolean;
19
+ }
20
+ /** Obtains a URL pointing to a tileset appropriate for visualizing a specific iModel.
21
+ * [[queryCompletedMeshExports]] is used to obtain a list of available exports. By default, the list is sorted from most to least recently-exported.
22
+ * The first export matching the iModel's changeset is selected; or, if no such export exists, the first export in the list is selected.
23
+ * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.
24
+ * @beta
25
+ */
26
+ export declare function obtainIModelTilesetUrl(args: ObtainIModelTilesetUrlArgs): Promise<URL | undefined>;
27
+ //# sourceMappingURL=GraphicsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphicsProvider.d.ts","sourceRoot":"","sources":["../../../src/GraphicsProvider/GraphicsProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAS,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAa,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAIlE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,MAAM,EAAE,gBAAgB,CAAC;IACzB,wDAAwD;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gFAAgF;IAChF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,0BAA0B,GAC7E,OAAO,CAAC,GAAG,GAAC,SAAS,CAAC,CA2BrB"}
@@ -0,0 +1,44 @@
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.obtainIModelTilesetUrl = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_frontend_1 = require("@itwin/core-frontend");
10
+ const GraphicRepresentationProvider_1 = require("./GraphicRepresentationProvider");
11
+ const LoggerCategory_1 = require("../LoggerCategory");
12
+ /** Obtains a URL pointing to a tileset appropriate for visualizing a specific iModel.
13
+ * [[queryCompletedMeshExports]] is used to obtain a list of available exports. By default, the list is sorted from most to least recently-exported.
14
+ * The first export matching the iModel's changeset is selected; or, if no such export exists, the first export in the list is selected.
15
+ * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.
16
+ * @beta
17
+ */
18
+ async function obtainIModelTilesetUrl(args) {
19
+ if (!args.iModel.iModelId) {
20
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, "Cannot obtain Graphics Data for an iModel with no iModelId");
21
+ return undefined;
22
+ }
23
+ if (!args.iModel.iTwinId) {
24
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, "Cannot obtain Graphics Data for an iModel with no iTwinId");
25
+ return undefined;
26
+ }
27
+ const graphicsArgs = {
28
+ accessToken: args.accessToken,
29
+ sessionId: core_frontend_1.IModelApp.sessionId,
30
+ dataSource: {
31
+ iTwinId: args.iModel.iTwinId,
32
+ id: args.iModel.iModelId,
33
+ changeId: args.iModel.changeset.id,
34
+ type: "IMODEL",
35
+ },
36
+ format: "IMDL",
37
+ urlPrefix: args.urlPrefix,
38
+ requireExactVersion: args.requireExactChangeset,
39
+ enableCDN: args.enableCDN,
40
+ };
41
+ return (0, GraphicRepresentationProvider_1.obtainGraphicRepresentationUrl)(graphicsArgs);
42
+ }
43
+ exports.obtainIModelTilesetUrl = obtainIModelTilesetUrl;
44
+ //# sourceMappingURL=GraphicsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphicsProvider.js","sourceRoot":"","sources":["../../../src/GraphicsProvider/GraphicsProvider.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,sDAAyD;AACzD,wDAAkE;AAClE,mFAAgF;AAChF,sDAAkD;AAoBlD;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAAC,IAAgC;IAE3E,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC1B,qBAAM,CAAC,OAAO,CAAC,+BAAc,EAAE,4DAA4D,CAAC,CAAC;QAC7F,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACzB,qBAAM,CAAC,OAAO,CAAC,+BAAc,EAAE,2DAA2D,CAAC,CAAC;QAC5F,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,YAAY,GAAG;QACnB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,yBAAS,CAAC,SAAS;QAC9B,UAAU,EAAE;YACV,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YACxB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YAClC,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,mBAAmB,EAAE,IAAI,CAAC,qBAAqB;QAC/C,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC;IAEF,OAAO,IAAA,8DAA8B,EAAC,YAAY,CAAC,CAAC;AACtD,CAAC;AA5BD,wDA4BC","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 { AccessToken, Logger} from \"@itwin/core-bentley\";\r\nimport { IModelApp, IModelConnection} from \"@itwin/core-frontend\";\r\nimport { obtainGraphicRepresentationUrl} from \"./GraphicRepresentationProvider\";\r\nimport { loggerCategory} from \"../LoggerCategory\";\r\n\r\n/** Arguments supplied to [[obtainMeshExportTilesetUrl]].\r\n * @beta\r\n */\r\nexport interface ObtainIModelTilesetUrlArgs {\r\n /** The iModel for which to obtain a tileset URl. */\r\n iModel: IModelConnection;\r\n /** The token used to access the mesh export service. */\r\n accessToken: AccessToken;\r\n /** Chiefly used in testing environments. */\r\n urlPrefix?: string;\r\n /** If true, only exports produced for `iModel`'s specific changeset will be considered; otherwise, if no exports are found for the changeset,\r\n * the most recent export for any changeset will be used.\r\n */\r\n requireExactChangeset?: boolean;\r\n /** If true, enables a CDN (content delivery network) to access tiles faster. */\r\n enableCDN?: boolean;\r\n}\r\n\r\n/** Obtains a URL pointing to a tileset appropriate for visualizing a specific iModel.\r\n * [[queryCompletedMeshExports]] is used to obtain a list of available exports. By default, the list is sorted from most to least recently-exported.\r\n * The first export matching the iModel's changeset is selected; or, if no such export exists, the first export in the list is selected.\r\n * @returns A URL from which the tileset can be loaded, or `undefined` if no appropriate URL could be obtained.\r\n * @beta\r\n */\r\nexport async function obtainIModelTilesetUrl(args: ObtainIModelTilesetUrlArgs):\r\nPromise<URL|undefined> {\r\n if (!args.iModel.iModelId) {\r\n Logger.logInfo(loggerCategory, \"Cannot obtain Graphics Data for an iModel with no iModelId\");\r\n return undefined;\r\n }\r\n\r\n if (!args.iModel.iTwinId) {\r\n Logger.logInfo(loggerCategory, \"Cannot obtain Graphics Data for an iModel with no iTwinId\");\r\n return undefined;\r\n }\r\n\r\n const graphicsArgs = {\r\n accessToken: args.accessToken,\r\n sessionId: IModelApp.sessionId,\r\n dataSource: {\r\n iTwinId: args.iModel.iTwinId,\r\n id: args.iModel.iModelId,\r\n changeId: args.iModel.changeset.id,\r\n type: \"IMODEL\",\r\n },\r\n format: \"IMDL\",\r\n urlPrefix: args.urlPrefix,\r\n requireExactVersion: args.requireExactChangeset,\r\n enableCDN: args.enableCDN,\r\n };\r\n\r\n return obtainGraphicRepresentationUrl(graphicsArgs);\r\n}\r\n"]}
@@ -0,0 +1,11 @@
1
+ import { BaseGeoscienceArgs } from "../url-providers/GeoscienceUrlProvider";
2
+ /**
3
+ * Represents the arguments required to initialize geoscience tileset.
4
+ * @alpha
5
+ */
6
+ export type AttachGeoscienceTilesetArgs = BaseGeoscienceArgs;
7
+ /** Initialize the geoscience tileset by attaching it as a Reality Model.
8
+ * @alpha
9
+ */
10
+ export declare function attachGeoscienceTileset(args: AttachGeoscienceTilesetArgs): Promise<void>;
11
+ //# sourceMappingURL=GeoscienceTileset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeoscienceTileset.d.ts","sourceRoot":"","sources":["../../../../src/GraphicsProvider/tileset-creators/GeoscienceTileset.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAA2B,MAAM,wCAAwC,CAAC;AAErG;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,kBAAkB,CAAC;AAE7D;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB9F"}
@@ -0,0 +1,37 @@
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.attachGeoscienceTileset = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_frontend_1 = require("@itwin/core-frontend");
10
+ const LoggerCategory_1 = require("../../LoggerCategory");
11
+ const GeoscienceUrlProvider_1 = require("../url-providers/GeoscienceUrlProvider");
12
+ /** Initialize the geoscience tileset by attaching it as a Reality Model.
13
+ * @alpha
14
+ */
15
+ async function attachGeoscienceTileset(args) {
16
+ try {
17
+ const url = await (0, GeoscienceUrlProvider_1.getGeoscienceTilesetUrl)(args);
18
+ if (!url) {
19
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, `No data available for Geoscience Object ${args.geoscienceObjectId}`);
20
+ return;
21
+ }
22
+ else {
23
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
24
+ if (!vp) {
25
+ core_bentley_1.Logger.logInfo(LoggerCategory_1.loggerCategory, "Reality Model not successfully attached.");
26
+ return;
27
+ }
28
+ vp.displayStyle.attachRealityModel({ tilesetUrl: url });
29
+ return;
30
+ }
31
+ }
32
+ catch (error) {
33
+ throw error;
34
+ }
35
+ }
36
+ exports.attachGeoscienceTileset = attachGeoscienceTileset;
37
+ //# sourceMappingURL=GeoscienceTileset.js.map