@itwin/core-frontend 4.7.4 → 4.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/lib/cjs/PlanarClipMaskState.d.ts +3 -1
- package/lib/cjs/PlanarClipMaskState.d.ts.map +1 -1
- package/lib/cjs/PlanarClipMaskState.js +14 -7
- package/lib/cjs/PlanarClipMaskState.js.map +1 -1
- package/lib/cjs/SpatialViewState.d.ts +2 -1
- package/lib/cjs/SpatialViewState.d.ts.map +1 -1
- package/lib/cjs/SpatialViewState.js +3 -2
- package/lib/cjs/SpatialViewState.js.map +1 -1
- package/lib/cjs/render/GraphicBuilder.d.ts +4 -0
- package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBuilder.js +49 -0
- package/lib/cjs/render/GraphicBuilder.js.map +1 -1
- package/lib/cjs/render/RenderTarget.d.ts +1 -0
- package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
- package/lib/cjs/render/RenderTarget.js.map +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +17 -9
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts +3 -3
- package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js +53 -19
- package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/cjs/render/webgl/SolarShadowMap.js +2 -2
- package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/cjs/render/webgl/Target.d.ts +1 -0
- package/lib/cjs/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Target.js +1 -0
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts +2 -2
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +8 -3
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.d.ts +1 -0
- package/lib/cjs/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/cjs/tile/map/ArcGisUtilities.js +5 -3
- package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js +7 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/PlanarClipMaskState.d.ts +3 -1
- package/lib/esm/PlanarClipMaskState.d.ts.map +1 -1
- package/lib/esm/PlanarClipMaskState.js +14 -7
- package/lib/esm/PlanarClipMaskState.js.map +1 -1
- package/lib/esm/SpatialViewState.d.ts +2 -1
- package/lib/esm/SpatialViewState.d.ts.map +1 -1
- package/lib/esm/SpatialViewState.js +3 -2
- package/lib/esm/SpatialViewState.js.map +1 -1
- package/lib/esm/render/GraphicBuilder.d.ts +4 -0
- package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
- package/lib/esm/render/GraphicBuilder.js +49 -0
- package/lib/esm/render/GraphicBuilder.js.map +1 -1
- package/lib/esm/render/RenderTarget.d.ts +1 -0
- package/lib/esm/render/RenderTarget.d.ts.map +1 -1
- package/lib/esm/render/RenderTarget.js.map +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js +2 -2
- package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +18 -10
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.d.ts +3 -3
- package/lib/esm/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js +54 -20
- package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/esm/render/webgl/SolarShadowMap.js +2 -2
- package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/esm/render/webgl/Target.d.ts +1 -0
- package/lib/esm/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/render/webgl/Target.js +1 -0
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts +2 -2
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +8 -3
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.d.ts +1 -0
- package/lib/esm/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/esm/tile/map/ArcGisUtilities.js +5 -3
- package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js +7 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @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,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;wBAChJ,qBAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,0CAAoB,CAAC,2CAAqB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;oBACtG,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,CAAC;QAC5C,CAAC;QAED,IAAI,QAAQ,KAAK,SAAS;YACxB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAEvC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAnKD,sDAmKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ArcGisErrorCode, ArcGISServiceMetadata, ArcGisUtilities, MapLayerAccessClient, MapLayerAccessToken, MapLayerImageryProvider, MapLayerImageryProviderStatus } from \"../../internal\";\nimport { IModelApp } from \"../../../IModelApp\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../../NotificationManager\";\nimport { headersIncludeAuthMethod } from \"../../../request/utils\";\n\n/** Base class for ArcGIS map-layer imagery providers.\n *\n * The initial purpose of this class is to offer shared methods\n * to query ArcGIS services and apply the appropriate security token.\n * @see [[ArcGISMapLayerImageryProvider]]\n * @internal\n */\nexport abstract class ArcGISImageryProvider extends MapLayerImageryProvider {\n\n protected _accessClient: MapLayerAccessClient|undefined;\n protected _lastAccessToken: MapLayerAccessToken|undefined;\n\n /** Flag indicating if access token should be added to request.\n * @note We assume a service to require access token for the entire viewing session.\n */\n protected _accessTokenRequired = false;\n\n protected _querySupported = false;\n\n public override get supportsMapFeatureInfo() { return this._querySupported;}\n\n constructor(settings: ImageMapLayerSettings, usesCachedTiles: boolean) {\n super(settings, usesCachedTiles);\n this._accessClient = IModelApp.mapLayerFormatRegistry?.getAccessClient(settings.formatId);\n }\n\n /** Updates the accessClient token state whenever the status of the provider change.\n * @internal\n * */\n protected override onStatusUpdated(status: MapLayerImageryProviderStatus) {\n if (status === MapLayerImageryProviderStatus.RequireAuth) {\n\n // Invalidate the token, so a new one get generated\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined) {\n this._accessClient.invalidateToken(this._lastAccessToken);\n }\n\n // Make sure we don't re-use this token again (i.e force login process)\n this._lastAccessToken = undefined;\n }\n }\n\n /**\n * Fetch an ArcGIS service metadata, and returns its JSON representation.\n * This wrapper maintains token state and should be used instead of the the ArcGisUtilities version.\n */\n protected async getServiceJson() {\n let metadata: ArcGISServiceMetadata|undefined;\n try {\n metadata = await ArcGisUtilities.getServiceJson({url: this._settings.url, formatId: this._settings.formatId, userName: this._settings.userName, password: this._settings.password, queryParams: this._settings.collectQueryParams()});\n\n } catch (_e) {\n }\n if (metadata && metadata.accessTokenRequired) {\n const accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(this._settings.formatId);\n if (accessClient) {\n try {\n // Keep track of last used access token, so we can invalidate it later when an errors occurs\n const accessToken = await accessClient.getAccessToken({mapLayerUrl: new URL(this._settings.url)});\n this._lastAccessToken = accessToken;\n } catch {\n }\n }\n // By turning this ON, tiles requests will include security token\n this._accessTokenRequired = metadata.accessTokenRequired;\n }\n return metadata;\n }\n\n /**\n * Make a request to an ArcGIS service using the provided URL and init parameters.\n * @param url URL to query\n * @param options Custom settings to apply to the request.\n * Refer to fetch API for more details (https://developer.mozilla.org/en-US/docs/Web/API/fetch)\n */\n protected async fetch(url: URL, options?: RequestInit) {\n\n let errorCode: number | undefined;\n const urlObj = new URL(url);\n const queryParams = this._settings.collectQueryParams();\n Object.keys(queryParams).forEach((paramKey) => {\n if (!urlObj.searchParams.has(paramKey))\n urlObj.searchParams.append(paramKey, queryParams[paramKey]);\n });\n\n if (this._accessTokenRequired && this._accessClient) {\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {\n mapLayerUrl: new URL(this._settings.url),\n userName: this._settings.userName,\n password: this._settings.password });\n }\n\n // We want to complete the first request before letting other requests go;\n // this done to avoid flooding server with requests missing credentials\n if (!this._firstRequestPromise)\n this._firstRequestPromise = new Promise<void>((resolve: any) => this.onFirstRequestCompleted.addOnce(()=>resolve()));\n else\n await this._firstRequestPromise;\n\n let response: Response|undefined;\n try {\n response = await fetch(urlObj.toString(), {...options, credentials: this._includeUserCredentials ? \"include\" : undefined});\n\n if (response.status === 401 && !this._lastAccessToken && headersIncludeAuthMethod(response.headers, [\"ntlm\", \"negotiate\"])) {\n // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)\n response = await fetch(url, {...options, credentials: \"include\" });\n if (response.status === 200) {\n this._includeUserCredentials = true; // avoid going through 401 challenges over and over\n }\n }\n\n if ((this._lastAccessToken && response.status === 400)\n || response.headers.get(\"content-type\")?.toLowerCase().includes(\"htm\")) {\n // For some reasons when we make a request with the fetch() api and there is a token error\n // we receive a status 400 instead of proper json response. (i.e doing the same request in the browser gives a different response)\n // For some other request, we also seen error message in html.\n // When it occurs, we fall back to root service request so we get a proper JSON response with error code.\n const tmpUrl = new URL(this._settings.url);\n if (this._lastAccessToken && this._accessTokenRequired)\n tmpUrl.searchParams.append(\"token\", this._lastAccessToken.token);\n tmpUrl.searchParams.append(\"f\",\"json\");\n response = await fetch(tmpUrl.toString(), options);\n }\n\n errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);\n\n if (errorCode !== undefined &&\n (errorCode === ArcGisErrorCode.TokenRequired || errorCode === ArcGisErrorCode.InvalidToken) ) {\n\n if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken ) {\n // **** Legacy token ONLY ***\n\n // Token might have expired, make a second attempt by forcing new token.\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)\n this._accessClient.invalidateToken(this._lastAccessToken);\n\n const urlObj2 = new URL(url);\n if (this._accessClient) {\n try {\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });\n } catch {\n }\n }\n\n // Make a second attempt with refreshed token\n response = await fetch(urlObj2.toString(), options);\n errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);\n }\n\n if (errorCode === ArcGisErrorCode.TokenRequired || errorCode === ArcGisErrorCode.InvalidToken) {\n // Looks like the initially generated token has expired.\n\n if (this.status === MapLayerImageryProviderStatus.Valid ) {\n // Only report new status change to avoid spamming the UI\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n this.onStatusChanged.raiseEvent(this);\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.FetchTooltipTokenError\", { layerName: this._settings.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n }\n }\n } finally {\n this.onFirstRequestCompleted.raiseEvent();\n }\n\n if (response === undefined)\n throw new Error(\"fetch call failed\");\n\n return response;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGISImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISImageryProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,6CAA4L;AAC5L,kDAA+C;AAC/C,sEAA2F;AAC3F,kDAAkE;AAElE;;;;;;GAMG;AACH,MAAsB,qBAAsB,SAAQ,kCAAuB;IAYzE,IAAoB,sBAAsB,KAAK,OAAO,IAAI,CAAC,eAAe,CAAC,CAAA,CAAC;IAE5E,YAAY,QAA+B,EAAE,eAAwB;QACnE,KAAK,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;QAVnC;;UAEE;QACQ,yBAAoB,GAAG,KAAK,CAAC;QAE7B,oBAAe,GAAG,KAAK,CAAC;QAMhC,IAAI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QAAQ,CAAC;IAClB,CAAC;CACF;AA1KD,sDA0KC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ArcGisErrorCode, ArcGISServiceMetadata, ArcGisUtilities, MapLayerAccessClient, MapLayerAccessToken, MapLayerImageryProvider, MapLayerImageryProviderStatus } from \"../../internal\";\nimport { IModelApp } from \"../../../IModelApp\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../../../NotificationManager\";\nimport { headersIncludeAuthMethod } from \"../../../request/utils\";\n\n/** Base class for ArcGIS map-layer imagery providers.\n *\n * The initial purpose of this class is to offer shared methods\n * to query ArcGIS services and apply the appropriate security token.\n * @see [[ArcGISMapLayerImageryProvider]]\n * @internal\n */\nexport abstract class ArcGISImageryProvider extends MapLayerImageryProvider {\n\n protected _accessClient: MapLayerAccessClient|undefined;\n protected _lastAccessToken: MapLayerAccessToken|undefined;\n\n /** Flag indicating if access token should be added to request.\n * @note We assume a service to require access token for the entire viewing session.\n */\n protected _accessTokenRequired = false;\n\n protected _querySupported = false;\n\n public override get supportsMapFeatureInfo() { return this._querySupported;}\n\n constructor(settings: ImageMapLayerSettings, usesCachedTiles: boolean) {\n super(settings, usesCachedTiles);\n this._accessClient = IModelApp.mapLayerFormatRegistry?.getAccessClient(settings.formatId);\n }\n\n /** Updates the accessClient token state whenever the status of the provider change.\n * @internal\n * */\n protected override onStatusUpdated(status: MapLayerImageryProviderStatus) {\n if (status === MapLayerImageryProviderStatus.RequireAuth) {\n\n // Invalidate the token, so a new one get generated\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined) {\n this._accessClient.invalidateToken(this._lastAccessToken);\n }\n\n // Make sure we don't re-use this token again (i.e force login process)\n this._lastAccessToken = undefined;\n }\n }\n\n /**\n * Fetch an ArcGIS service metadata, and returns its JSON representation.\n * This wrapper maintains token state and should be used instead of the the ArcGisUtilities version.\n */\n protected async getServiceJson() {\n let metadata: ArcGISServiceMetadata|undefined;\n try {\n metadata = await ArcGisUtilities.getServiceJson({url: this._settings.url, formatId: this._settings.formatId, userName: this._settings.userName, password: this._settings.password, queryParams: this._settings.collectQueryParams()});\n\n } catch (_e) {\n }\n if (metadata && metadata.accessTokenRequired) {\n const accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(this._settings.formatId);\n if (accessClient) {\n try {\n // Keep track of last used access token, so we can invalidate it later when an errors occurs\n const accessToken = await accessClient.getAccessToken({mapLayerUrl: new URL(this._settings.url)});\n this._lastAccessToken = accessToken;\n } catch {\n }\n }\n // By turning this ON, tiles requests will include security token\n this._accessTokenRequired = metadata.accessTokenRequired;\n }\n return metadata;\n }\n\n /**\n * Make a request to an ArcGIS service using the provided URL and init parameters.\n * @param url URL to query\n * @param options Custom settings to apply to the request.\n * Refer to fetch API for more details (https://developer.mozilla.org/en-US/docs/Web/API/fetch)\n */\n protected async fetch(url: URL, options?: RequestInit) {\n\n let errorCode: number | undefined;\n const urlObj = new URL(url);\n const queryParams = this._settings.collectQueryParams();\n Object.keys(queryParams).forEach((paramKey) => {\n if (!urlObj.searchParams.has(paramKey))\n urlObj.searchParams.append(paramKey, queryParams[paramKey]);\n });\n\n if (this._accessTokenRequired && this._accessClient) {\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {\n mapLayerUrl: new URL(this._settings.url),\n userName: this._settings.userName,\n password: this._settings.password });\n }\n\n // We want to complete the first request before letting other requests go;\n // this done to avoid flooding server with requests missing credentials\n if (!this._firstRequestPromise)\n this._firstRequestPromise = new Promise<void>((resolve: any) => this.onFirstRequestCompleted.addOnce(()=>resolve()));\n else\n await this._firstRequestPromise;\n\n let response: Response|undefined;\n try {\n response = await fetch(urlObj.toString(), {...options, credentials: this._includeUserCredentials ? \"include\" : undefined});\n\n if (response.status === 401 && !this._lastAccessToken && headersIncludeAuthMethod(response.headers, [\"ntlm\", \"negotiate\"])) {\n // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)\n response = await fetch(url, {...options, credentials: \"include\" });\n if (response.status === 200) {\n this._includeUserCredentials = true; // avoid going through 401 challenges over and over\n }\n }\n\n if ((this._lastAccessToken && response.status === 400)\n || response.headers.get(\"content-type\")?.toLowerCase().includes(\"htm\")) {\n // For some reasons when we make a request with the fetch() api and there is a token error\n // we receive a status 400 instead of proper json response. (i.e doing the same request in the browser gives a different response)\n // For some other request, we also seen error message in html.\n // When it occurs, we fall back to root service request so we get a proper JSON response with error code.\n const tmpUrl = new URL(this._settings.url);\n if (this._lastAccessToken && this._accessTokenRequired)\n tmpUrl.searchParams.append(\"token\", this._lastAccessToken.token);\n tmpUrl.searchParams.append(\"f\",\"json\");\n response = await fetch(tmpUrl.toString(), options);\n }\n\n errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);\n\n if (errorCode !== undefined &&\n ( errorCode === ArcGisErrorCode.TokenRequired\n || errorCode === ArcGisErrorCode.InvalidToken\n || errorCode === ArcGisErrorCode.MissingPermissions\n ) ) {\n\n if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken ) {\n // **** Legacy token ONLY ***\n\n // Token might have expired, make a second attempt by forcing new token.\n if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)\n this._accessClient.invalidateToken(this._lastAccessToken);\n\n const urlObj2 = new URL(url);\n if (this._accessClient) {\n try {\n this._lastAccessToken = await ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });\n } catch {\n }\n }\n\n // Make a second attempt with refreshed token\n response = await fetch(urlObj2.toString(), options);\n errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);\n }\n\n if (errorCode !== undefined &&\n ( errorCode === ArcGisErrorCode.TokenRequired\n || errorCode === ArcGisErrorCode.InvalidToken\n || errorCode === ArcGisErrorCode.MissingPermissions\n ) ) {\n // Looks like the initially generated token has expired.\n\n if (this.status === MapLayerImageryProviderStatus.Valid ) {\n // Only report new status change to avoid spamming the UI\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n this.onStatusChanged.raiseEvent(this);\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.FetchTooltipTokenError\", { layerName: this._settings.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n }\n }\n } finally {\n this.onFirstRequestCompleted.raiseEvent();\n }\n\n if (response === undefined)\n throw new Error(\"fetch call failed\");\n\n return response;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISMapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAEjH,OAAO,EACsC,qBAAqB,EACvC,kBAAkB,EAAqB,qBAAqB,EACrF,mBAAmB,EAAyD,MAAM,EACnF,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAoB,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,gBAAgB;AAChB,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,KAAK,GAAC,SAAS,GAAC,KAAK,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,6BAA6B;IAC5C,uDAA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,EAAE,GAAG;;;;YAKpB,SAAS;IAOD,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;cAoB7F,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI;IAmC5E,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ArcGISMapLayerImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAEjH,OAAO,EACsC,qBAAqB,EACvC,kBAAkB,EAAqB,qBAAqB,EACrF,mBAAmB,EAAyD,MAAM,EACnF,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAoB,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,gBAAgB;AAChB,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,KAAK,GAAC,SAAS,GAAC,KAAK,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,6BAA6B;IAC5C,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;IAElB,mFAAmF;IACnF,YAAY,EAAE,mBAAmB,CAAC;IAElC,8GAA8G;IAC9G,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;MAEE;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AS,CAAC;cAoB7F,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI;IAmC5E,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAkGjC,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;YAS7C,eAAe;IAyBP,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB3G,cAAc,CAAC,YAAY,EAAE,mBAAmB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+DzM,SAAS,CAAC,cAAc,CAAC,MAAM,SAAS,GAAG,MAAM;IAWpC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAU3F"}
|
|
@@ -134,7 +134,9 @@ class ArcGISMapLayerImageryProvider extends internal_1.ArcGISImageryProvider {
|
|
|
134
134
|
if (metadata?.content === undefined)
|
|
135
135
|
throw new core_common_1.ServerError(core_common_1.IModelStatus.ValidationFailed, "");
|
|
136
136
|
const json = metadata.content;
|
|
137
|
-
if (json?.error?.code === internal_1.ArcGisErrorCode.TokenRequired
|
|
137
|
+
if (json?.error?.code === internal_1.ArcGisErrorCode.TokenRequired
|
|
138
|
+
|| json?.error?.code === internal_1.ArcGisErrorCode.InvalidToken
|
|
139
|
+
|| json?.error?.code === internal_1.ArcGisErrorCode.MissingPermissions) {
|
|
138
140
|
// Check again layer status, it might have change during await.
|
|
139
141
|
if (this.status === internal_1.MapLayerImageryProviderStatus.Valid) {
|
|
140
142
|
this.setStatus(internal_1.MapLayerImageryProviderStatus.RequireAuth);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGISMapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,oDAAiH;AACjH,kDAA+C;AAC/C,6CAIwB;AACxB,0DAA+E;AAC/E,wDAA+E;AAC/E,sDAA6C;AAG7C,MAAM,cAAc,GAAI,uDAAuD,CAAC;AA6DhF,gBAAgB;AAChB,MAAa,wBAAwB;IAC5B,MAAM,CAAC,QAAQ,CAAC,OAAmB,EAAE,IAAmC,EAAE,gBAAyB;QAExG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,QAAQ,GAAG,GAAG,MAAM,CAAC,QAAQ,WAAW,CAAC;QAEhD,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC;QAED,MAAM,MAAM,GAAG,uBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAClI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAE9D,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EA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AC,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC;YACzF,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,gBAAgB,UAAU,SAAS,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,cAAc,EAAE,2BAA2B,IAAI,CAAC,2BAA2B,+BAA+B,CAAC;QAC5N,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnUD,sEAmUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\nimport { Cartographic, ImageMapLayerSettings, ImageSource, IModelStatus, ServerError } from \"@itwin/core-common\";\nimport { IModelApp } from \"../../../IModelApp\";\nimport {\n ArcGisErrorCode, ArcGisGeometryReaderJSON, ArcGISImageryProvider, ArcGISTileMap, ArcGisUtilities,\n FeatureGraphicsRenderer, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeature,\n MapLayerFeatureInfo, MapLayerImageryProviderStatus, MapSubLayerFeatureInfo, QuadId,\n} from \"../../internal\";\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { Point2d, Range2d, Range2dProps, XYProps } from \"@itwin/core-geometry\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { HitDetail } from \"../../../HitDetail\";\n\nconst loggerCategory = \"MapLayerImageryProvider.ArcGISMapLayerImageryProvider\";\n\n/** @internal */\nexport interface ArcGISIdentifyImageDisplayProps {\n width: number;\n height: number;\n dpi: number;\n}\n\n/** @internal */\nexport interface ArcGISIdentifyLayersProps {\n prefix: \"top\"|\"visible\"|\"all\";\n layerIds?: string[];\n}\n\n/** @internal */\nexport interface ArcGISIdentifyRequestUrlProps {\n /** The geometry to identify on. Point only support */\n geometry: XYProps;\n\n /** The type of geometry specified by the geometry parameter. Point only support */\n geometryType: \"esriGeometryPoint\";\n\n /** The well-known ID of the spatial reference of the input and output geometries as well as the mapExtent. */\n sr?: number;\n\n /** The layers to perform the identify operation on. The default value is top.\n * Format: [top | visible | all]:layerId1,layerId2\n */\n layers?: ArcGISIdentifyLayersProps;\n\n /** The distance in screen pixels from the specified geometry within which the identify operation should be performed.\n * The value for the tolerance is an integer.\n */\n tolerance: number;\n\n /** The extent or bounding box of the map currently being viewed.\n * Format: <xmin>, <ymin>, <xmax>, <ymax>\n */\n mapExtent: Range2dProps;\n\n /** The screen image display parameters (width, height, and DPI) of the map being currently viewed. T\n * Format: <width>,<height>,<dpi>\n */\n imageDisplay: ArcGISIdentifyImageDisplayProps;\n\n /** If true, the result set will include the geometries associated with each result. The default is true.\n */\n returnGeometry?: boolean;\n\n /** This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the identify operation.\n * The maxAllowableOffset is in the units of the sr.\n */\n maxAllowableOffset?: number;\n\n /** The response format. The default response format is html.\n */\n f?: \"json\"|\"html\";\n\n}\n\n/** @internal */\nexport class ArcGISIdentifyRequestUrl {\n public static fromJSON(baseUrl: URL|string, json: ArcGISIdentifyRequestUrlProps, srFractionDigits?: number): URL {\n\n const newUrl = new URL(baseUrl);\n newUrl.pathname = `${newUrl.pathname}/identify`;\n\n if (json.f) {\n newUrl.searchParams.append(\"f\", json.f);\n }\n\n const geomPt = Point2d.fromJSON(json.geometry);\n newUrl.searchParams.append(\"geometry\", `${this.toFixed(geomPt.x, srFractionDigits)},${this.toFixed(geomPt.y, srFractionDigits)}`);\n newUrl.searchParams.append(\"geometryType\", json.geometryType);\n\n if (json.sr) {\n newUrl.searchParams.append(\"sr\", `${json.sr}`);\n }\n\n if (json.layers) {\n newUrl.searchParams.append(\"layers\", `${json.layers.prefix}${json.layers.layerIds?.length ? `: ${json.layers.layerIds.join(\",\")}` : \"\"}`);\n }\n\n newUrl.searchParams.append(\"tolerance\", `${json.tolerance}`);\n\n newUrl.searchParams.append(\"mapExtent\", ArcGISIdentifyRequestUrl.getExtentString(json.mapExtent, srFractionDigits));\n\n newUrl.searchParams.append(\"imageDisplay\", `${json.imageDisplay.width},${json.imageDisplay.height},${json.imageDisplay.dpi}`);\n\n if (json.returnGeometry !== undefined) {\n newUrl.searchParams.append(\"returnGeometry\", json.returnGeometry ? \"true\" : \"false\");\n }\n\n if (json.maxAllowableOffset !== undefined) {\n newUrl.searchParams.append(\"maxAllowableOffset\", `${this.toFixed(json.maxAllowableOffset, srFractionDigits)}`);\n }\n\n return newUrl;\n }\n\n public static toFixed(value: number, srFractionDigits?: number) {\n return srFractionDigits === undefined ? value.toString() : value.toFixed(srFractionDigits);\n }\n\n public static getExtentString(range: Range2dProps, srFractionDigits?: number) {\n const extent = Range2d.fromJSON(range);\n const extentStringArray: string[] = [];\n extent.toFloat64Array().forEach((value) => extentStringArray.push(this.toFixed(value, srFractionDigits)));\n return extentStringArray.join(\",\");\n }\n}\n\n/** @internal */\nexport class ArcGISMapLayerImageryProvider extends ArcGISImageryProvider {\n private _maxDepthFromLod = 0;\n private _minDepthFromLod = 0;\n private _copyrightText = \"Copyright\";\n private _tileMapSupported = false;\n private _mapSupported = false;\n private _tilesOnly = false;\n private _tileMap: ArcGISTileMap|undefined;\n\n public serviceJson: any;\n constructor(settings: ImageMapLayerSettings) {\n super(settings, false);\n this._accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(settings.formatId);\n }\n\n protected override get _filterByCartoRange() { return false; } // Can't trust footprint ranges (USGS Hydro)\n\n public override get minimumZoomLevel() { return Math.max(super.minimumZoomLevel, this._minDepthFromLod); }\n public override get maximumZoomLevel() { return this._maxDepthFromLod > 0 ? this._maxDepthFromLod : super.maximumZoomLevel; }\n\n public uintToString(uintArray: any) {\n return Buffer.from(uintArray).toJSON();\n\n }\n\n private async fetchTile(row: number, column: number, zoomLevel: number) {\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\n if (tileUrl.length === 0)\n return undefined;\n return this.fetch(new URL(tileUrl), { method: \"GET\" });\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n if ((this.status === MapLayerImageryProviderStatus.RequireAuth)) {\n return undefined;\n }\n\n try {\n const tileResponse = await this.fetchTile(row, column, zoomLevel);\n if (tileResponse === undefined)\n return undefined;\n\n if (!this._hasSuccessfullyFetchedTile) {\n this._hasSuccessfullyFetchedTile = true;\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error) {\n Logger.logError(loggerCategory, `Error occurred when loading tile(${row},${column},${zoomLevel}) : ${error}`);\n return undefined;\n }\n }\n\n protected override _generateChildIds(quadId: QuadId, resolveChildren: (childIds: QuadId[]) => void) {\n const childIds = this.getPotentialChildIds(quadId);\n if (quadId.level < Math.max(1, this.minimumZoomLevel-1)) {\n resolveChildren(childIds);\n return;\n }\n\n if (this._tileMap) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._tileMap.getChildrenAvailability(childIds).then((availability) => {\n const availableChildIds = new Array<QuadId>();\n for (let i = 0; i < availability.length; i++)\n if (availability[i])\n availableChildIds.push(childIds[i]);\n\n resolveChildren (availableChildIds);\n });\n } else if (this._usesCachedTiles && this.cartoRange) {\n // Filter children by range\n const availableChildIds = new Array<QuadId>();\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < childIds.length; i++) {\n const childExtent = this.getEPSG4326Extent(childIds[i].row, childIds[i].column, childIds[i].level);\n\n const childRange = MapCartoRectangle.fromDegrees(childExtent.longitudeLeft, childExtent.latitudeBottom, childExtent.longitudeRight, childExtent.latitudeTop);\n if (childRange.intersectsRange(this.cartoRange)) {\n availableChildIds.push(childIds[i]);\n }\n }\n resolveChildren (availableChildIds);\n } else {\n resolveChildren (childIds); // Resolve all children\n }\n }\n\n public override async initialize(): Promise<void> {\n\n const metadata = await this.getServiceJson();\n\n if (metadata?.content === undefined)\n throw new ServerError(IModelStatus.ValidationFailed, \"\");\n\n const json = metadata.content;\n if (json?.error?.code === ArcGisErrorCode.TokenRequired || json?.error?.code === ArcGisErrorCode.InvalidToken) {\n // Check again layer status, it might have change during await.\n if (this.status === MapLayerImageryProviderStatus.Valid) {\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n return; // By returning (i.e not throwing), we ensure the tileTree get created and current provider is preserved to report status.\n }\n }\n\n this.serviceJson = json;\n\n if (json.capabilities) {\n const capabilities = json.capabilities.split(\",\");\n\n this._querySupported = capabilities.includes(\"Query\");\n this._tileMapSupported = capabilities.includes(\"Tilemap\");\n this._mapSupported = capabilities.includes(\"Map\");\n this._tilesOnly = capabilities.includes(\"TilesOnly\");\n }\n\n if (json.copyrightText)\n this._copyrightText = json.copyrightText;\n\n this._usesCachedTiles = !!json.tileInfo;\n\n if (this._usesCachedTiles) {\n // Only EPSG:3857 is supported with pre-rendered tiles. Fall back to 'Export' queries if possible otherwise throw.\n if (!ArcGisUtilities.isEpsg3857Compatible(json.tileInfo)) {\n if (this._mapSupported && !this._tilesOnly) {\n this._usesCachedTiles = false;\n } else {\n throw new ServerError(IModelStatus.ValidationFailed, \"Invalid coordinate system\");\n }\n }\n }\n\n if (this._usesCachedTiles) {\n // Read max LOD\n if (json.maxScale !== undefined && json.maxScale !== 0 && Array.isArray(json.tileInfo.lods)) {\n for (; this._maxDepthFromLod < json.tileInfo.lods.length && json.tileInfo.lods[this._maxDepthFromLod].scale > json.maxScale; this._maxDepthFromLod++)\n ;\n }\n\n // Create tile map object only if we are going to request tiles from this server and it support tilemap requests.\n if (this._tileMapSupported) {\n const fetch = async (url: URL, options?: RequestInit): Promise<Response> => {\n return this.fetch(url, options);\n };\n this._tileMap = new ArcGISTileMap(this._settings.url, this._settings, fetch);\n }\n }\n\n // Read range using fullextent from service metadata\n if (json.fullExtent) {\n if (json.fullExtent.spatialReference.latestWkid === 3857 || json.fullExtent.spatialReference.wkid === 102100) {\n const range3857 = Range2d.createFrom({\n low: {x: json.fullExtent.xmin, y: json.fullExtent.ymin},\n high: {x: json.fullExtent.xmax, y: json.fullExtent.ymax} });\n\n const west = this.getEPSG4326Lon(range3857.xLow);\n const south = this.getEPSG4326Lat(range3857.yLow);\n const east = this.getEPSG4326Lon(range3857.xHigh);\n const north = this.getEPSG4326Lat(range3857.yHigh);\n this.cartoRange = MapCartoRectangle.fromDegrees(west, south, east, north);\n }\n }\n\n // Read minLOD if available\n if (json.minLOD !== undefined) {\n const minLod = parseInt(json.minLOD, 10);\n if (!Number.isNaN(minLod)) {\n this._minDepthFromLod = minLod;\n }\n } else if (json.minScale) {\n // Read min LOD using minScale\n const minScale = json.minScale;\n if (json.tileInfo?.lods !== undefined && Array.isArray(json.tileInfo.lods)) {\n for (const lod of json.tileInfo.lods) {\n if (lod.scale < minScale) {\n this._minDepthFromLod = lod.level;\n break;\n }\n }\n }\n }\n\n }\n\n public override addLogoCards(cards: HTMLTableElement): void {\n if (!cards.dataset.arcGisLogoCard) {\n cards.dataset.arcGisLogoCard = \"true\";\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"ArcGIS\", notice: this._copyrightText }));\n }\n }\n\n // Translates the provided Cartographic into a EPSG:3857 point, and retrieve information.\n // tolerance is in pixels\n private async getIdentifyData(quadId: QuadId, carto: Cartographic, tolerance: number, returnGeometry?: boolean, maxAllowableOffset?: number): Promise<any> {\n\n const bbox = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\n const layerIds = new Array<string>();\n this._settings.subLayers.forEach((subLayer) => {\n if (this._settings.isSubLayerVisible(subLayer))\n layerIds.push(subLayer.idString);\n });\n const urlObj = ArcGISIdentifyRequestUrl.fromJSON(this._settings.url, {\n f: \"json\",\n geometry: {x: this.getEPSG3857X(carto.longitudeDegrees), y: this.getEPSG3857Y(carto.latitudeDegrees)},\n geometryType: \"esriGeometryPoint\",\n tolerance,\n mapExtent: {low: {x: bbox.left, y: bbox.bottom}, high: {x: bbox.right, y: bbox.top}},\n sr: 3857,\n imageDisplay: {width: this.tileSize, height: this.tileSize, dpi: 96},\n layers: {prefix: \"top\", layerIds},\n returnGeometry,\n maxAllowableOffset}, 3 /* 1mm accuracy*/);\n\n const response = await this.fetch(urlObj, { method: \"GET\" } );\n return response.json();\n }\n\n // Makes an identify request to ESRI MapService server, and return it as a list of formatted strings\n public override async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\n await super.getToolTip(strings, quadId, carto, tree);\n\n if (!this._querySupported)\n return;\n\n const stringSet = new Set<string>();\n const json = await this.getIdentifyData(quadId, carto, 1);\n\n if (json && Array.isArray(json.results)) {\n for (const result of json.results) {\n if (result.attributes !== undefined && result.attributes[result.displayFieldName] !== undefined) {\n const thisString = `${result.displayFieldName}: ${result.attributes[result.displayFieldName]}`;\n if (!stringSet.has(thisString)) {\n strings.push(thisString);\n stringSet.add(thisString);\n }\n }\n }\n }\n }\n\n // Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object\n public override async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void> {\n if (!this._querySupported)\n return;\n\n const tileExtent = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\n const toleranceWorld = (tileExtent.top - tileExtent.bottom) / this.tileSize;\n const maxAllowableOffsetFactor = 2;\n const maxAllowableOffset = maxAllowableOffsetFactor*toleranceWorld;\n\n const tolerancePixel = options?.tolerance ?? 7;\n const json = await this.getIdentifyData(quadId, carto, tolerancePixel, true, maxAllowableOffset);\n if (json && Array.isArray(json.results)) {\n const renderer = new FeatureGraphicsRenderer({viewport: hit.viewport, crs: \"webMercator\"});\n\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, subLayerInfos: [] };\n\n // The 'identify' service returns us a flat/unordered list of records..\n // results may represent features for the a common subLayer.\n // For simplicity, we group together features for a given sub-layer.\n const subLayers = new Map<string, MapSubLayerFeatureInfo> ();\n\n for (const result of json.results) {\n\n let subLayerInfo = subLayers.get(result.layerName);\n if (!subLayerInfo) {\n subLayerInfo = {\n subLayerName: result.layerName ?? \"\",\n displayFieldName: result.displayFieldName,\n features: [],\n };\n subLayers.set(result.layerName, subLayerInfo);\n }\n const feature: MapLayerFeature = {geometries: [], attributes: []};\n\n // Read all feature attributes\n for (const [key, value] of Object.entries(result.attributes)) {\n // Convert everything to string for now\n const strValue = String(value);\n feature.attributes.push({\n value: { valueFormat: PropertyValueFormat.Primitive, value: strValue, displayValue: strValue },\n property: { name: key, displayLabel: key, typename: StandardTypeNames.String },\n });\n }\n\n // Read feature geometries\n const geomReader = new ArcGisGeometryReaderJSON(result.geometryType, renderer);\n await geomReader.readGeometry(result.geometry);\n const graphics = renderer.moveGraphics();\n feature.geometries = graphics.map((graphic) => {\n return {graphic};\n });\n subLayerInfo.features.push(feature);\n\n }\n\n for ( const value of subLayers.values()) {\n layerInfo.subLayerInfos!.push(value);\n }\n\n featureInfos.push(layerInfo);\n }\n }\n\n protected getLayerString(prefix = \"show\"): string {\n const layers = new Array<string>();\n this._settings.subLayers.forEach((subLayer) => {\n if (this._settings.isSubLayerVisible(subLayer))\n layers.push(subLayer.idString);\n });\n\n return `${prefix}: ${layers.join(\",\")} `;\n }\n\n // construct the Url from the desired Tile\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\n let tmpUrl;\n if (this._usesCachedTiles) {\n tmpUrl = `${this._settings.url}/tile/${zoomLevel}/${row}/${column} `;\n } else {\n const bboxString = `${this.getEPSG3857ExtentString(row, column, zoomLevel)}&bboxSR=3857`;\n tmpUrl = `${this._settings.url}/export?bbox=${bboxString}&size=${this.tileSize},${this.tileSize}&layers=${this.getLayerString()}&format=png&transparent=${this.transparentBackgroundString}&f=image&sr=3857&imagesr=3857`;\n }\n return tmpUrl;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGISMapLayerImageryProvider.js","sourceRoot":"","sources":["../../../../../src/tile/map/ImageryPro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AC,SAAS,CAAC,GAAG,gBAAgB,UAAU,SAAS,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,cAAc,EAAE,2BAA2B,IAAI,CAAC,2BAA2B,+BAA+B,CAAC;QAC5N,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAtUD,sEAsUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\nimport { Cartographic, ImageMapLayerSettings, ImageSource, IModelStatus, ServerError } from \"@itwin/core-common\";\nimport { IModelApp } from \"../../../IModelApp\";\nimport {\n ArcGisErrorCode, ArcGisGeometryReaderJSON, ArcGISImageryProvider, ArcGISTileMap, ArcGisUtilities,\n FeatureGraphicsRenderer, ImageryMapTileTree, MapCartoRectangle, MapFeatureInfoOptions, MapLayerFeature,\n MapLayerFeatureInfo, MapLayerImageryProviderStatus, MapSubLayerFeatureInfo, QuadId,\n} from \"../../internal\";\nimport { PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { Point2d, Range2d, Range2dProps, XYProps } from \"@itwin/core-geometry\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { HitDetail } from \"../../../HitDetail\";\n\nconst loggerCategory = \"MapLayerImageryProvider.ArcGISMapLayerImageryProvider\";\n\n/** @internal */\nexport interface ArcGISIdentifyImageDisplayProps {\n width: number;\n height: number;\n dpi: number;\n}\n\n/** @internal */\nexport interface ArcGISIdentifyLayersProps {\n prefix: \"top\"|\"visible\"|\"all\";\n layerIds?: string[];\n}\n\n/** @internal */\nexport interface ArcGISIdentifyRequestUrlProps {\n /** The geometry to identify on. Point only support */\n geometry: XYProps;\n\n /** The type of geometry specified by the geometry parameter. Point only support */\n geometryType: \"esriGeometryPoint\";\n\n /** The well-known ID of the spatial reference of the input and output geometries as well as the mapExtent. */\n sr?: number;\n\n /** The layers to perform the identify operation on. The default value is top.\n * Format: [top | visible | all]:layerId1,layerId2\n */\n layers?: ArcGISIdentifyLayersProps;\n\n /** The distance in screen pixels from the specified geometry within which the identify operation should be performed.\n * The value for the tolerance is an integer.\n */\n tolerance: number;\n\n /** The extent or bounding box of the map currently being viewed.\n * Format: <xmin>, <ymin>, <xmax>, <ymax>\n */\n mapExtent: Range2dProps;\n\n /** The screen image display parameters (width, height, and DPI) of the map being currently viewed. T\n * Format: <width>,<height>,<dpi>\n */\n imageDisplay: ArcGISIdentifyImageDisplayProps;\n\n /** If true, the result set will include the geometries associated with each result. The default is true.\n */\n returnGeometry?: boolean;\n\n /** This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the identify operation.\n * The maxAllowableOffset is in the units of the sr.\n */\n maxAllowableOffset?: number;\n\n /** The response format. The default response format is html.\n */\n f?: \"json\"|\"html\";\n\n}\n\n/** @internal */\nexport class ArcGISIdentifyRequestUrl {\n public static fromJSON(baseUrl: URL|string, json: ArcGISIdentifyRequestUrlProps, srFractionDigits?: number): URL {\n\n const newUrl = new URL(baseUrl);\n newUrl.pathname = `${newUrl.pathname}/identify`;\n\n if (json.f) {\n newUrl.searchParams.append(\"f\", json.f);\n }\n\n const geomPt = Point2d.fromJSON(json.geometry);\n newUrl.searchParams.append(\"geometry\", `${this.toFixed(geomPt.x, srFractionDigits)},${this.toFixed(geomPt.y, srFractionDigits)}`);\n newUrl.searchParams.append(\"geometryType\", json.geometryType);\n\n if (json.sr) {\n newUrl.searchParams.append(\"sr\", `${json.sr}`);\n }\n\n if (json.layers) {\n newUrl.searchParams.append(\"layers\", `${json.layers.prefix}${json.layers.layerIds?.length ? `: ${json.layers.layerIds.join(\",\")}` : \"\"}`);\n }\n\n newUrl.searchParams.append(\"tolerance\", `${json.tolerance}`);\n\n newUrl.searchParams.append(\"mapExtent\", ArcGISIdentifyRequestUrl.getExtentString(json.mapExtent, srFractionDigits));\n\n newUrl.searchParams.append(\"imageDisplay\", `${json.imageDisplay.width},${json.imageDisplay.height},${json.imageDisplay.dpi}`);\n\n if (json.returnGeometry !== undefined) {\n newUrl.searchParams.append(\"returnGeometry\", json.returnGeometry ? \"true\" : \"false\");\n }\n\n if (json.maxAllowableOffset !== undefined) {\n newUrl.searchParams.append(\"maxAllowableOffset\", `${this.toFixed(json.maxAllowableOffset, srFractionDigits)}`);\n }\n\n return newUrl;\n }\n\n public static toFixed(value: number, srFractionDigits?: number) {\n return srFractionDigits === undefined ? value.toString() : value.toFixed(srFractionDigits);\n }\n\n public static getExtentString(range: Range2dProps, srFractionDigits?: number) {\n const extent = Range2d.fromJSON(range);\n const extentStringArray: string[] = [];\n extent.toFloat64Array().forEach((value) => extentStringArray.push(this.toFixed(value, srFractionDigits)));\n return extentStringArray.join(\",\");\n }\n}\n\n/** @internal */\nexport class ArcGISMapLayerImageryProvider extends ArcGISImageryProvider {\n private _maxDepthFromLod = 0;\n private _minDepthFromLod = 0;\n private _copyrightText = \"Copyright\";\n private _tileMapSupported = false;\n private _mapSupported = false;\n private _tilesOnly = false;\n private _tileMap: ArcGISTileMap|undefined;\n\n public serviceJson: any;\n constructor(settings: ImageMapLayerSettings) {\n super(settings, false);\n this._accessClient = IModelApp.mapLayerFormatRegistry.getAccessClient(settings.formatId);\n }\n\n protected override get _filterByCartoRange() { return false; } // Can't trust footprint ranges (USGS Hydro)\n\n public override get minimumZoomLevel() { return Math.max(super.minimumZoomLevel, this._minDepthFromLod); }\n public override get maximumZoomLevel() { return this._maxDepthFromLod > 0 ? this._maxDepthFromLod : super.maximumZoomLevel; }\n\n public uintToString(uintArray: any) {\n return Buffer.from(uintArray).toJSON();\n\n }\n\n private async fetchTile(row: number, column: number, zoomLevel: number) {\n const tileUrl: string = await this.constructUrl(row, column, zoomLevel);\n if (tileUrl.length === 0)\n return undefined;\n return this.fetch(new URL(tileUrl), { method: \"GET\" });\n }\n\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n if ((this.status === MapLayerImageryProviderStatus.RequireAuth)) {\n return undefined;\n }\n\n try {\n const tileResponse = await this.fetchTile(row, column, zoomLevel);\n if (tileResponse === undefined)\n return undefined;\n\n if (!this._hasSuccessfullyFetchedTile) {\n this._hasSuccessfullyFetchedTile = true;\n }\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error) {\n Logger.logError(loggerCategory, `Error occurred when loading tile(${row},${column},${zoomLevel}) : ${error}`);\n return undefined;\n }\n }\n\n protected override _generateChildIds(quadId: QuadId, resolveChildren: (childIds: QuadId[]) => void) {\n const childIds = this.getPotentialChildIds(quadId);\n if (quadId.level < Math.max(1, this.minimumZoomLevel-1)) {\n resolveChildren(childIds);\n return;\n }\n\n if (this._tileMap) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._tileMap.getChildrenAvailability(childIds).then((availability) => {\n const availableChildIds = new Array<QuadId>();\n for (let i = 0; i < availability.length; i++)\n if (availability[i])\n availableChildIds.push(childIds[i]);\n\n resolveChildren (availableChildIds);\n });\n } else if (this._usesCachedTiles && this.cartoRange) {\n // Filter children by range\n const availableChildIds = new Array<QuadId>();\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < childIds.length; i++) {\n const childExtent = this.getEPSG4326Extent(childIds[i].row, childIds[i].column, childIds[i].level);\n\n const childRange = MapCartoRectangle.fromDegrees(childExtent.longitudeLeft, childExtent.latitudeBottom, childExtent.longitudeRight, childExtent.latitudeTop);\n if (childRange.intersectsRange(this.cartoRange)) {\n availableChildIds.push(childIds[i]);\n }\n }\n resolveChildren (availableChildIds);\n } else {\n resolveChildren (childIds); // Resolve all children\n }\n }\n\n public override async initialize(): Promise<void> {\n\n const metadata = await this.getServiceJson();\n\n if (metadata?.content === undefined)\n throw new ServerError(IModelStatus.ValidationFailed, \"\");\n\n const json = metadata.content;\n if (json?.error?.code === ArcGisErrorCode.TokenRequired\n || json?.error?.code === ArcGisErrorCode.InvalidToken\n || json?.error?.code === ArcGisErrorCode.MissingPermissions\n ) {\n // Check again layer status, it might have change during await.\n if (this.status === MapLayerImageryProviderStatus.Valid) {\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n return; // By returning (i.e not throwing), we ensure the tileTree get created and current provider is preserved to report status.\n }\n }\n\n this.serviceJson = json;\n\n if (json.capabilities) {\n const capabilities = json.capabilities.split(\",\");\n\n this._querySupported = capabilities.includes(\"Query\");\n this._tileMapSupported = capabilities.includes(\"Tilemap\");\n this._mapSupported = capabilities.includes(\"Map\");\n this._tilesOnly = capabilities.includes(\"TilesOnly\");\n }\n\n if (json.copyrightText)\n this._copyrightText = json.copyrightText;\n\n this._usesCachedTiles = !!json.tileInfo;\n\n if (this._usesCachedTiles) {\n // Only EPSG:3857 is supported with pre-rendered tiles. Fall back to 'Export' queries if possible otherwise throw.\n if (!ArcGisUtilities.isEpsg3857Compatible(json.tileInfo)) {\n if (this._mapSupported && !this._tilesOnly) {\n this._usesCachedTiles = false;\n } else {\n throw new ServerError(IModelStatus.ValidationFailed, \"Invalid coordinate system\");\n }\n }\n }\n\n if (this._usesCachedTiles) {\n // Read max LOD\n if (json.maxScale !== undefined && json.maxScale !== 0 && Array.isArray(json.tileInfo.lods)) {\n for (; this._maxDepthFromLod < json.tileInfo.lods.length && json.tileInfo.lods[this._maxDepthFromLod].scale > json.maxScale; this._maxDepthFromLod++)\n ;\n }\n\n // Create tile map object only if we are going to request tiles from this server and it support tilemap requests.\n if (this._tileMapSupported) {\n const fetch = async (url: URL, options?: RequestInit): Promise<Response> => {\n return this.fetch(url, options);\n };\n this._tileMap = new ArcGISTileMap(this._settings.url, this._settings, fetch);\n }\n }\n\n // Read range using fullextent from service metadata\n if (json.fullExtent) {\n if (json.fullExtent.spatialReference.latestWkid === 3857 || json.fullExtent.spatialReference.wkid === 102100) {\n const range3857 = Range2d.createFrom({\n low: {x: json.fullExtent.xmin, y: json.fullExtent.ymin},\n high: {x: json.fullExtent.xmax, y: json.fullExtent.ymax} });\n\n const west = this.getEPSG4326Lon(range3857.xLow);\n const south = this.getEPSG4326Lat(range3857.yLow);\n const east = this.getEPSG4326Lon(range3857.xHigh);\n const north = this.getEPSG4326Lat(range3857.yHigh);\n this.cartoRange = MapCartoRectangle.fromDegrees(west, south, east, north);\n }\n }\n\n // Read minLOD if available\n if (json.minLOD !== undefined) {\n const minLod = parseInt(json.minLOD, 10);\n if (!Number.isNaN(minLod)) {\n this._minDepthFromLod = minLod;\n }\n } else if (json.minScale) {\n // Read min LOD using minScale\n const minScale = json.minScale;\n if (json.tileInfo?.lods !== undefined && Array.isArray(json.tileInfo.lods)) {\n for (const lod of json.tileInfo.lods) {\n if (lod.scale < minScale) {\n this._minDepthFromLod = lod.level;\n break;\n }\n }\n }\n }\n\n }\n\n public override addLogoCards(cards: HTMLTableElement): void {\n if (!cards.dataset.arcGisLogoCard) {\n cards.dataset.arcGisLogoCard = \"true\";\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"ArcGIS\", notice: this._copyrightText }));\n }\n }\n\n // Translates the provided Cartographic into a EPSG:3857 point, and retrieve information.\n // tolerance is in pixels\n private async getIdentifyData(quadId: QuadId, carto: Cartographic, tolerance: number, returnGeometry?: boolean, maxAllowableOffset?: number): Promise<any> {\n\n const bbox = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\n const layerIds = new Array<string>();\n this._settings.subLayers.forEach((subLayer) => {\n if (this._settings.isSubLayerVisible(subLayer))\n layerIds.push(subLayer.idString);\n });\n const urlObj = ArcGISIdentifyRequestUrl.fromJSON(this._settings.url, {\n f: \"json\",\n geometry: {x: this.getEPSG3857X(carto.longitudeDegrees), y: this.getEPSG3857Y(carto.latitudeDegrees)},\n geometryType: \"esriGeometryPoint\",\n tolerance,\n mapExtent: {low: {x: bbox.left, y: bbox.bottom}, high: {x: bbox.right, y: bbox.top}},\n sr: 3857,\n imageDisplay: {width: this.tileSize, height: this.tileSize, dpi: 96},\n layers: {prefix: \"top\", layerIds},\n returnGeometry,\n maxAllowableOffset}, 3 /* 1mm accuracy*/);\n\n const response = await this.fetch(urlObj, { method: \"GET\" } );\n return response.json();\n }\n\n // Makes an identify request to ESRI MapService server, and return it as a list of formatted strings\n public override async getToolTip(strings: string[], quadId: QuadId, carto: Cartographic, tree: ImageryMapTileTree): Promise<void> {\n await super.getToolTip(strings, quadId, carto, tree);\n\n if (!this._querySupported)\n return;\n\n const stringSet = new Set<string>();\n const json = await this.getIdentifyData(quadId, carto, 1);\n\n if (json && Array.isArray(json.results)) {\n for (const result of json.results) {\n if (result.attributes !== undefined && result.attributes[result.displayFieldName] !== undefined) {\n const thisString = `${result.displayFieldName}: ${result.attributes[result.displayFieldName]}`;\n if (!stringSet.has(thisString)) {\n strings.push(thisString);\n stringSet.add(thisString);\n }\n }\n }\n }\n }\n\n // Makes an identify request to ESRI MapService , and return it as a list MapLayerFeatureInfo object\n public override async getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void> {\n if (!this._querySupported)\n return;\n\n const tileExtent = this.getEPSG3857Extent(quadId.row, quadId.column, quadId.level);\n const toleranceWorld = (tileExtent.top - tileExtent.bottom) / this.tileSize;\n const maxAllowableOffsetFactor = 2;\n const maxAllowableOffset = maxAllowableOffsetFactor*toleranceWorld;\n\n const tolerancePixel = options?.tolerance ?? 7;\n const json = await this.getIdentifyData(quadId, carto, tolerancePixel, true, maxAllowableOffset);\n if (json && Array.isArray(json.results)) {\n const renderer = new FeatureGraphicsRenderer({viewport: hit.viewport, crs: \"webMercator\"});\n\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, subLayerInfos: [] };\n\n // The 'identify' service returns us a flat/unordered list of records..\n // results may represent features for the a common subLayer.\n // For simplicity, we group together features for a given sub-layer.\n const subLayers = new Map<string, MapSubLayerFeatureInfo> ();\n\n for (const result of json.results) {\n\n let subLayerInfo = subLayers.get(result.layerName);\n if (!subLayerInfo) {\n subLayerInfo = {\n subLayerName: result.layerName ?? \"\",\n displayFieldName: result.displayFieldName,\n features: [],\n };\n subLayers.set(result.layerName, subLayerInfo);\n }\n const feature: MapLayerFeature = {geometries: [], attributes: []};\n\n // Read all feature attributes\n for (const [key, value] of Object.entries(result.attributes)) {\n // Convert everything to string for now\n const strValue = String(value);\n feature.attributes.push({\n value: { valueFormat: PropertyValueFormat.Primitive, value: strValue, displayValue: strValue },\n property: { name: key, displayLabel: key, typename: StandardTypeNames.String },\n });\n }\n\n // Read feature geometries\n const geomReader = new ArcGisGeometryReaderJSON(result.geometryType, renderer);\n await geomReader.readGeometry(result.geometry);\n const graphics = renderer.moveGraphics();\n feature.geometries = graphics.map((graphic) => {\n return {graphic};\n });\n subLayerInfo.features.push(feature);\n\n }\n\n for ( const value of subLayers.values()) {\n layerInfo.subLayerInfos!.push(value);\n }\n\n featureInfos.push(layerInfo);\n }\n }\n\n protected getLayerString(prefix = \"show\"): string {\n const layers = new Array<string>();\n this._settings.subLayers.forEach((subLayer) => {\n if (this._settings.isSubLayerVisible(subLayer))\n layers.push(subLayer.idString);\n });\n\n return `${prefix}: ${layers.join(\",\")} `;\n }\n\n // construct the Url from the desired Tile\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\n let tmpUrl;\n if (this._usesCachedTiles) {\n tmpUrl = `${this._settings.url}/tile/${zoomLevel}/${row}/${column} `;\n } else {\n const bboxString = `${this.getEPSG3857ExtentString(row, column, zoomLevel)}&bboxSR=3857`;\n tmpUrl = `${this._settings.url}/export?bbox=${bboxString}&size=${this.tileSize},${this.tileSize}&layers=${this.getLayerString()}&format=png&transparent=${this.transparentBackgroundString}&f=image&sr=3857&imagesr=3857`;\n }\n return tmpUrl;\n }\n}\n"]}
|
|
@@ -7,6 +7,7 @@ import { FeatureSymbology } from "./render/FeatureSymbology";
|
|
|
7
7
|
import { DisclosedTileTreeSet, TileTreeReference } from "./tile/internal";
|
|
8
8
|
import { SceneContext } from "./ViewContext";
|
|
9
9
|
import { SpatialViewState } from "./SpatialViewState";
|
|
10
|
+
import { Range3d } from "@itwin/core-geometry";
|
|
10
11
|
/** The State of Planar Clip Mask applied to a reality model or background map.
|
|
11
12
|
* Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.
|
|
12
13
|
* @beta
|
|
@@ -16,12 +17,13 @@ export declare class PlanarClipMaskState {
|
|
|
16
17
|
private _tileTreeRefs?;
|
|
17
18
|
private _allLoaded;
|
|
18
19
|
private _usingViewportOverrides;
|
|
20
|
+
private _maskRange;
|
|
19
21
|
private constructor();
|
|
20
22
|
static create(settings: PlanarClipMaskSettings): PlanarClipMaskState;
|
|
21
23
|
static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState;
|
|
22
24
|
get usingViewportOverrides(): boolean;
|
|
23
25
|
discloseTileTrees(trees: DisclosedTileTreeSet): void;
|
|
24
|
-
getTileTrees(view: SpatialViewState, classifiedModelId: Id64String): TileTreeReference[] | undefined;
|
|
26
|
+
getTileTrees(view: SpatialViewState, classifiedModelId: Id64String, maskRange: Range3d): TileTreeReference[] | undefined;
|
|
25
27
|
getPlanarClipMaskSymbologyOverrides(view: SpatialViewState, context: SceneContext): FeatureSymbology.Overrides | undefined;
|
|
26
28
|
}
|
|
27
29
|
//# sourceMappingURL=PlanarClipMaskState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarClipMaskState.d.ts","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAiE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,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AS;CAmDlI"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskSettings } from "@itwin/core-common";
|
|
9
9
|
import { FeatureSymbology } from "./render/FeatureSymbology";
|
|
10
|
+
import { Range3d } from "@itwin/core-geometry";
|
|
10
11
|
/** The State of Planar Clip Mask applied to a reality model or background map.
|
|
11
12
|
* Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.
|
|
12
13
|
* @beta
|
|
@@ -15,6 +16,7 @@ export class PlanarClipMaskState {
|
|
|
15
16
|
constructor(settings) {
|
|
16
17
|
this._allLoaded = false;
|
|
17
18
|
this._usingViewportOverrides = false;
|
|
19
|
+
this._maskRange = Range3d.createNull();
|
|
18
20
|
this.settings = settings;
|
|
19
21
|
}
|
|
20
22
|
static create(settings) {
|
|
@@ -29,10 +31,11 @@ export class PlanarClipMaskState {
|
|
|
29
31
|
if (this._tileTreeRefs)
|
|
30
32
|
this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));
|
|
31
33
|
}
|
|
32
|
-
// Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask.
|
|
33
|
-
getTileTrees(view, classifiedModelId) {
|
|
34
|
+
// Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask, and extend the maskRange if needed.
|
|
35
|
+
getTileTrees(view, classifiedModelId, maskRange) {
|
|
34
36
|
if (this.settings.mode === PlanarClipMaskMode.Priority) {
|
|
35
37
|
// For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.
|
|
38
|
+
// For this case, we don't need a maskRange so leave it as null.
|
|
36
39
|
const viewTrees = new Array();
|
|
37
40
|
const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;
|
|
38
41
|
view.forEachTileTreeRef((ref) => {
|
|
@@ -44,13 +47,17 @@ export class PlanarClipMaskState {
|
|
|
44
47
|
}
|
|
45
48
|
// For all other modes we need to let the tree refs in the view state decide which refs need to be drawn
|
|
46
49
|
// since batched tiles cannot turn on/off individual models just by their tile tree refs.
|
|
47
|
-
|
|
50
|
+
// Keep calling this until loaded so that the range is valid.
|
|
51
|
+
if (!this._allLoaded) {
|
|
48
52
|
this._tileTreeRefs = new Array();
|
|
49
|
-
if (this.settings.modelIds)
|
|
50
|
-
view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs);
|
|
51
|
-
|
|
52
|
-
if (!this._allLoaded)
|
|
53
|
+
if (this.settings.modelIds) {
|
|
54
|
+
view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs, maskRange);
|
|
55
|
+
}
|
|
53
56
|
this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);
|
|
57
|
+
maskRange.clone(this._maskRange);
|
|
58
|
+
}
|
|
59
|
+
else // If already loaded, just set the maskRange to the saved maskRange.
|
|
60
|
+
this._maskRange.clone(maskRange);
|
|
54
61
|
return this._allLoaded ? this._tileTreeRefs : undefined;
|
|
55
62
|
}
|
|
56
63
|
// Returns any potential FeatureSymbology overrides for drawing the planar clip mask.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarClipMaskState.js","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAuB,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAK7D;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAM9B,YAAoB,QAAgC;QAH5C,eAAU,GAAG,KAAK,CAAC;QACnB,4BAAuB,GAAG,KAAK,CAAC;QAGtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAgC;QACnD,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,CAAC;gBAC7C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAwB;oBAChE,SAAS,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;gBACjD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskProps, PlanarClipMaskSettings } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { SceneContext } from \"./ViewContext\";\nimport { SpatialViewState } from \"./SpatialViewState\";\n\n/** The State of Planar Clip Mask applied to a reality model or background map.\n * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.\n * @beta\n */\nexport class PlanarClipMaskState {\n public readonly settings: PlanarClipMaskSettings;\n private _tileTreeRefs?: TileTreeReference[];\n private _allLoaded = false;\n private _usingViewportOverrides = false;\n\n private constructor(settings: PlanarClipMaskSettings) {\n this.settings = settings;\n }\n\n public static create(settings: PlanarClipMaskSettings): PlanarClipMaskState {\n return new PlanarClipMaskState(settings);\n }\n\n public static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState {\n return this.create(PlanarClipMaskSettings.fromJSON(props));\n }\n\n public get usingViewportOverrides(): boolean { return this._usingViewportOverrides; };\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n if (this._tileTreeRefs)\n this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));\n }\n\n // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask.\n public getTileTrees(view: SpatialViewState, classifiedModelId: Id64String): TileTreeReference[] | undefined {\n if (this.settings.mode === PlanarClipMaskMode.Priority) {\n // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.\n const viewTrees = new Array<TileTreeReference>();\n const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;\n view.forEachTileTreeRef((ref) => {\n const tree = ref.treeOwner.load();\n if (tree && tree.modelId !== classifiedModelId && ref.planarclipMaskPriority > thisPriority)\n viewTrees.push(ref);\n });\n\n return viewTrees;\n }\n\n // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn\n // since batched tiles cannot turn on/off individual models just by their tile tree refs.\n if (!this._tileTreeRefs) {\n this._tileTreeRefs = new Array<TileTreeReference>();\n if (this.settings.modelIds)\n view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs);\n }\n\n if (!this._allLoaded)\n this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);\n\n return this._allLoaded ? this._tileTreeRefs : undefined;\n }\n\n // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.\n public getPlanarClipMaskSymbologyOverrides(view: SpatialViewState, context: SceneContext): FeatureSymbology.Overrides | undefined {\n this._usingViewportOverrides = false;\n // First obtain a list of models that will need to be turned off for drawing the planar clip mask (only used for batched tile trees).\n const overrideModels = view.getModelsNotInMask(this.settings.modelIds, PlanarClipMaskMode.Priority === this.settings.mode);\n\n const noSubCategoryOrElementIds = !this.settings.subCategoryOrElementIds;\n if (noSubCategoryOrElementIds && !overrideModels)\n return undefined;\n\n const overrides = new FeatureSymbology.Overrides();\n\n if (overrideModels) {\n // overrideModels is used for batched models. For those, we need to create model overrides to turn off models that are\n // not wanted in the mask (using transparency) no matter what mask mode is being used.\n const appOff = FeatureAppearance.fromTransparency(1.0);\n // For Priority or Models mode, we need to start with the current overrides and modify them\n if (PlanarClipMaskMode.Priority === this.settings.mode || PlanarClipMaskMode.Models === this.settings.mode || noSubCategoryOrElementIds) {\n this._usingViewportOverrides = true; // Set flag to use listener since context.viewport might change afterwards.\n const curOverrides = new FeatureSymbology.Overrides(context.viewport);\n curOverrides.addInvisibleElementOverridesToNeverDrawn(); // need this for fully trans element overrides to not participate in mask\n overrideModels.forEach((modelId: string) => {\n curOverrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n return curOverrides;\n }\n // Otherwise, we just start with a default overrides and modify it.\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n }\n\n // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.\n switch (this.settings.mode) {\n case PlanarClipMaskMode.IncludeElements: {\n overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds!, true);\n return overrides;\n }\n case PlanarClipMaskMode.ExcludeElements: {\n overrides.ignoreSubCategory = true;\n overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds!);\n return overrides;\n }\n case PlanarClipMaskMode.IncludeSubCategories: {\n for (const subCategoryId of this.settings.subCategoryOrElementIds!)\n overrides.setVisibleSubCategory(subCategoryId);\n return overrides;\n }\n }\n\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PlanarClipMaskState.js","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAuB,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAI7D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAO9B,YAAoB,QAAgC;QAJ5C,eAAU,GAAG,KAAK,CAAC;QACnB,4BAAuB,GAAG,KAAK,CAAC;QAChC,eAAU,GAAY,OAAO,CAAC,UAAU,EAAE,CAAC;QAGjD,IAAI,CA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;YACnB,CAAC;YACD,KAAK,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;gBACxC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;gBACnC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAwB,CAAC,CAAC;gBACnE,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,KAAK,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC7C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAwB;oBAChE,SAAS,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;gBACjD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskProps, PlanarClipMaskSettings } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { SceneContext } from \"./ViewContext\";\nimport { SpatialViewState } from \"./SpatialViewState\";\nimport { Range3d } from \"@itwin/core-geometry\";\n\n/** The State of Planar Clip Mask applied to a reality model or background map.\n * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.\n * @beta\n */\nexport class PlanarClipMaskState {\n public readonly settings: PlanarClipMaskSettings;\n private _tileTreeRefs?: TileTreeReference[];\n private _allLoaded = false;\n private _usingViewportOverrides = false;\n private _maskRange: Range3d = Range3d.createNull();\n\n private constructor(settings: PlanarClipMaskSettings) {\n this.settings = settings;\n }\n\n public static create(settings: PlanarClipMaskSettings): PlanarClipMaskState {\n return new PlanarClipMaskState(settings);\n }\n\n public static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState {\n return this.create(PlanarClipMaskSettings.fromJSON(props));\n }\n\n public get usingViewportOverrides(): boolean { return this._usingViewportOverrides; };\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n if (this._tileTreeRefs)\n this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));\n }\n\n // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask, and extend the maskRange if needed.\n public getTileTrees(view: SpatialViewState, classifiedModelId: Id64String, maskRange: Range3d): TileTreeReference[] | undefined {\n if (this.settings.mode === PlanarClipMaskMode.Priority) {\n // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.\n // For this case, we don't need a maskRange so leave it as null.\n const viewTrees = new Array<TileTreeReference>();\n const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;\n view.forEachTileTreeRef((ref) => {\n const tree = ref.treeOwner.load();\n if (tree && tree.modelId !== classifiedModelId && ref.planarclipMaskPriority > thisPriority)\n viewTrees.push(ref);\n });\n\n return viewTrees;\n }\n\n // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn\n // since batched tiles cannot turn on/off individual models just by their tile tree refs.\n // Keep calling this until loaded so that the range is valid.\n if (!this._allLoaded) {\n this._tileTreeRefs = new Array<TileTreeReference>();\n if (this.settings.modelIds) {\n view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs, maskRange);\n }\n this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);\n maskRange.clone(this._maskRange);\n } else // If already loaded, just set the maskRange to the saved maskRange.\n this._maskRange.clone(maskRange);\n\n return this._allLoaded ? this._tileTreeRefs : undefined;\n }\n\n // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.\n public getPlanarClipMaskSymbologyOverrides(view: SpatialViewState, context: SceneContext): FeatureSymbology.Overrides | undefined {\n this._usingViewportOverrides = false;\n // First obtain a list of models that will need to be turned off for drawing the planar clip mask (only used for batched tile trees).\n const overrideModels = view.getModelsNotInMask(this.settings.modelIds, PlanarClipMaskMode.Priority === this.settings.mode);\n\n const noSubCategoryOrElementIds = !this.settings.subCategoryOrElementIds;\n if (noSubCategoryOrElementIds && !overrideModels)\n return undefined;\n\n const overrides = new FeatureSymbology.Overrides();\n\n if (overrideModels) {\n // overrideModels is used for batched models. For those, we need to create model overrides to turn off models that are\n // not wanted in the mask (using transparency) no matter what mask mode is being used.\n const appOff = FeatureAppearance.fromTransparency(1.0);\n // For Priority or Models mode, we need to start with the current overrides and modify them\n if (PlanarClipMaskMode.Priority === this.settings.mode || PlanarClipMaskMode.Models === this.settings.mode || noSubCategoryOrElementIds) {\n this._usingViewportOverrides = true; // Set flag to use listener since context.viewport might change afterwards.\n const curOverrides = new FeatureSymbology.Overrides(context.viewport);\n curOverrides.addInvisibleElementOverridesToNeverDrawn(); // need this for fully trans element overrides to not participate in mask\n overrideModels.forEach((modelId: string) => {\n curOverrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n return curOverrides;\n }\n // Otherwise, we just start with a default overrides and modify it.\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n }\n\n // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.\n switch (this.settings.mode) {\n case PlanarClipMaskMode.IncludeElements: {\n overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds!, true);\n return overrides;\n }\n case PlanarClipMaskMode.ExcludeElements: {\n overrides.ignoreSubCategory = true;\n overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds!);\n return overrides;\n }\n case PlanarClipMaskMode.IncludeSubCategories: {\n for (const subCategoryId of this.settings.subCategoryOrElementIds!)\n overrides.setVisibleSubCategory(subCategoryId);\n return overrides;\n }\n }\n\n return undefined;\n }\n}\n"]}
|
|
@@ -104,9 +104,10 @@ export declare class SpatialViewState extends ViewState3d {
|
|
|
104
104
|
/** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.
|
|
105
105
|
* @param modelIds modelIds for which to get the TileTreeReferences
|
|
106
106
|
* @param maskTreeRefs where to store the TileTreeReferences
|
|
107
|
+
* @param maskRange range to extend for the maskRefs
|
|
107
108
|
* @internal
|
|
108
109
|
*/
|
|
109
|
-
collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[]): void;
|
|
110
|
+
collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[], maskRange: Range3d): void;
|
|
110
111
|
/** For getting a list of modelIds which do not participate in masking for planar classification.
|
|
111
112
|
* @param maskModels models which DO participate in planar clip masking
|
|
112
113
|
* @param useVisible when true, use visible models to set flag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialViewState.d.ts","sourceRoot":"","sources":["../../src/SpatialViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAqB,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAY,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/J,OAAO,EAA8B,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAyB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAA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AC,IAAI,EAAE,oBAAoB,GAAG,IAAI;IAMlE,4CAA4C;IAC5B,kBAAkB,IAAI,IAAI;IAM1C;;;;;;OAMG;IACI,gCAAgC,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,SAAS,EAAE,WAAW,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,IAAI;IAI9L;;;;;OAKG;IACI,eAAe,CAAC,QAAQ,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAIlH;;;;OAIG;IACI,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,UAAU,EAAE,GAAG,SAAS;IAIrH,OAAO,CAAC,8BAA8B;IAYtC,OAAO,CAAC,gCAAgC;CAIzC;AACD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,WAA2B,SAAS,WAA2C;gBAEnE,KAAK,EAAE,0BAA0B,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB;IAEhK,cAAc,IAAI,OAAO;CAC1C"}
|
|
@@ -203,10 +203,11 @@ export class SpatialViewState extends ViewState3d {
|
|
|
203
203
|
/** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.
|
|
204
204
|
* @param modelIds modelIds for which to get the TileTreeReferences
|
|
205
205
|
* @param maskTreeRefs where to store the TileTreeReferences
|
|
206
|
+
* @param maskRange range to extend for the maskRefs
|
|
206
207
|
* @internal
|
|
207
208
|
*/
|
|
208
|
-
collectMaskRefs(modelIds, maskTreeRefs) {
|
|
209
|
-
this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs);
|
|
209
|
+
collectMaskRefs(modelIds, maskTreeRefs, maskRange) {
|
|
210
|
+
this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs, maskRange);
|
|
210
211
|
}
|
|
211
212
|
/** For getting a list of modelIds which do not participate in masking for planar classification.
|
|
212
213
|
* @param maskModels models which DO participate in planar clip masking
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialViewState.js","sourceRoot":"","sources":["../../src/SpatialViewState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAmC,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAY,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAE3E,OAAO,EAAE,0BAA0B,EAAuB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAqB,MAAM,iBAAiB,CAAC;AAU/E;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACxC,MAAM,KAAc,SAAS,KAAK,OAAO,uBAAuB,CAAC,CAAC,CAAC;IAW1E,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,IAAW,aAAa,CAAC,QAA4B;QACnD,IAAI,QAAQ,KAAK,IAAI,CAAC,aAAa;YACjC,OAAO;QAET,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC;QAC7C,IAAI,CAAC,gCAAgC,EAAE,CAAC;QAExC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC;QAE/B,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,8BAA8B,EAAE,CAAC;YACtC,IAAI,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EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,iCAAiC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpD,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,gBAAgB;IAClD,MAAM,KAAc,SAAS,KAAK,OAAO,4BAA4B,CAAC,CAAC,CAAC;IAE/E,YAAY,KAAiC,EAAE,MAAwB,EAAE,UAAiC,EAAE,YAAiC,EAAE,aAAiC,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEpO,cAAc,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;CAC5D","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { BeEvent, CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { Constant, Matrix3d, Range3d, XYAndZ } from \"@itwin/core-geometry\";\nimport { AxisAlignedBox3d, HydrateViewStateRequestProps, HydrateViewStateResponseProps, SpatialViewDefinitionProps, ViewStateProps } from \"@itwin/core-common\";\nimport { AuxCoordSystemSpatialState, AuxCoordSystemState } from \"./AuxCoordSys\";\nimport { ModelSelectorState } from \"./ModelSelectorState\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle3dState } from \"./DisplayStyleState\";\nimport { GeometricModel3dState, GeometricModelState } from \"./ModelState\";\nimport { SceneContext } from \"./ViewContext\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { AttachToViewportArgs, ViewState3d } from \"./ViewState\";\nimport { SpatialTileTreeReferences, TileTreeReference } from \"./tile/internal\";\n\n/** Options supplied to [[SpatialViewState.computeFitRange]].\n * @public\n */\nexport interface ComputeSpatialViewFitRangeOptions {\n /** The minimal extents. The computed range will be unioned with this range if supplied. */\n baseExtents?: Range3d;\n}\n\n/** Defines a view of one or more SpatialModels.\n * The list of viewed models is stored in the ModelSelector.\n * @public\n * @extensions\n */\nexport class SpatialViewState extends ViewState3d {\n public static override get className() { return \"SpatialViewDefinition\"; }\n\n private readonly _treeRefs: SpatialTileTreeReferences;\n private _modelSelector: ModelSelectorState;\n private readonly _unregisterModelSelectorListeners: VoidFunction[] = [];\n\n /** An event raised when the set of models viewed by this view changes, *only* if the view is attached to a [[Viewport]].\n * @public\n */\n public readonly onViewedModelsChanged = new BeEvent<() => void>();\n\n public get modelSelector(): ModelSelectorState {\n return this._modelSelector;\n }\n\n public set modelSelector(selector: ModelSelectorState) {\n if (selector === this.modelSelector)\n return;\n\n const isAttached = this.isAttachedToViewport;\n this.unregisterModelSelectorListeners();\n\n this._modelSelector = selector;\n\n if (isAttached) {\n this.registerModelSelectorListeners();\n this.onViewedModelsChanged.raiseEvent();\n }\n\n this.markModelSelectorChanged();\n }\n\n /** Create a new *blank* SpatialViewState. The returned SpatialViewState will nave non-persistent empty [[CategorySelectorState]] and [[ModelSelectorState]],\n * and a non-persistent [[DisplayStyle3dState]] with default values for all of its components. Generally after creating a blank SpatialViewState,\n * callers will modify the state to suit specific needs.\n * @param iModel The IModelConnection for the new SpatialViewState\n * @param origin The origin for the new SpatialViewState\n * @param extents The extents for the new SpatialViewState\n * @param rotation The rotation of the new SpatialViewState. If undefined, use top view.\n * @public\n */\n public static createBlank(iModel: IModelConnection, origin: XYAndZ, extents: XYAndZ, rotation?: Matrix3d): SpatialViewState {\n const blank = {} as any;\n const cat = new CategorySelectorState(blank, iModel);\n const modelSelectorState = new ModelSelectorState(blank, iModel);\n const displayStyleState = new DisplayStyle3dState(blank, iModel);\n const view = new this(blank, iModel, cat, displayStyleState, modelSelectorState);\n view.setOrigin(origin);\n view.setExtents(extents);\n if (undefined !== rotation)\n view.setRotation(rotation);\n return view;\n }\n\n public static override createFromProps(props: ViewStateProps, iModel: IModelConnection): SpatialViewState {\n const cat = new CategorySelectorState(props.categorySelectorProps, iModel);\n const displayStyleState = new DisplayStyle3dState(props.displayStyleProps, iModel);\n const modelSelectorState = new ModelSelectorState(props.modelSelectorProps!, iModel);\n return new this(props.viewDefinitionProps as SpatialViewDefinitionProps, iModel, cat, displayStyleState, modelSelectorState);\n }\n\n public override toProps(): ViewStateProps {\n const props = super.toProps();\n props.modelSelectorProps = this.modelSelector.toJSON();\n return props;\n }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, arg3: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) {\n super(props, iModel, arg3, displayStyle);\n this._modelSelector = modelSelector;\n if (arg3 instanceof SpatialViewState) // from clone\n this._modelSelector = arg3.modelSelector.clone();\n\n this._treeRefs = SpatialTileTreeReferences.create(this);\n }\n\n /** @internal */\n public override isSpatialView(): this is SpatialViewState { return true; }\n\n public override equals(other: this): boolean { return super.equals(other) && this.modelSelector.equals(other.modelSelector); }\n\n public override createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystemSpatialState.createNew(acsName, this.iModel); }\n public get defaultExtentLimits() { return { min: Constant.oneMillimeter, max: 3 * Constant.diameterOfEarth }; } // Increased max by 3X to support globe mode.\n\n /** @internal */\n public markModelSelectorChanged(): void {\n this._treeRefs.update();\n }\n\n /** Get world-space viewed extents based on the iModel's project extents.\n * @deprecated in 3.6. These extents are based on [[IModelConnection.displayedExtents]], which is deprecated. Consider using [[computeFitRange]] or [[getViewedExtents]] instead.\n */\n protected getDisplayedExtents(): AxisAlignedBox3d {\n /* eslint-disable-next-line deprecation/deprecation */\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.displayedExtents);\n extents.scaleAboutCenterInPlace(1.0001); // projectExtents. lying smack up against the extents is not excluded by frustum...\n extents.extendRange(this.getGroundExtents());\n return extents;\n }\n\n private computeBaseExtents(): AxisAlignedBox3d {\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.projectExtents);\n\n // Ensure geometry coincident with planes of the project extents is not clipped.\n extents.scaleAboutCenterInPlace(1.0001);\n\n // Ensure ground plane is not clipped, if it's being drawn.\n extents.extendRange(this.getGroundExtents());\n\n return extents;\n }\n\n /** Compute a volume in world coordinates tightly encompassing the contents of the view. The volume is computed from the union of the volumes of the\n * view's viewed models, including [GeometricModel]($backend)s and reality models.\n * Those volumes are obtained from the [[TileTree]]s used to render those models, so any tile tree that has not yet been loaded will not contribute to the computation.\n * If `options.baseExtents` is defined, it will be unioned with the computed volume.\n * If the computed volume is null (empty), a default volume will be computed from [IModel.projectExtents]($common), which may be a looser approximation of the\n * models' volumes.\n * @param options Options used to customize how the volume is computed.\n * @returns A non-null volume in world coordinates encompassing the contents of the view.\n */\n public computeFitRange(options?: ComputeSpatialViewFitRangeOptions): AxisAlignedBox3d {\n // Fit to the union of the ranges of all loaded tile trees.\n const range = options?.baseExtents?.clone() ?? new Range3d();\n this.forEachTileTreeRef((ref) => {\n ref.unionFitRange(range);\n });\n\n // Fall back to the project extents if necessary.\n if (range.isNull)\n range.setFrom(this.computeBaseExtents());\n\n // Avoid ridiculously small extents.\n range.ensureMinLengths(1.0);\n\n return range;\n }\n\n public getViewedExtents(): AxisAlignedBox3d {\n // Encompass the project extents and ground plane.\n const extents = this.computeBaseExtents();\n\n // Include any tile trees that extend outside the project extents.\n extents.extendRange(this.computeFitRange());\n\n return extents;\n }\n\n public override toJSON(): SpatialViewDefinitionProps {\n const val = super.toJSON() as SpatialViewDefinitionProps;\n val.modelSelectorId = this.modelSelector.id;\n return val;\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n const notLoaded = this.iModel.models.filterLoaded(this.modelSelector.models);\n if (undefined === notLoaded)\n return; // all requested models are already loaded\n hydrateRequest.notLoadedModelSelectorStateModels = CompressedId64Set.sortAndCompress(notLoaded);\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n if (hydrateResponse.modelSelectorStateModels !== undefined)\n promises.push(this.iModel.models.updateLoadedWithModelProps(hydrateResponse.modelSelectorStateModels));\n await Promise.all(promises);\n }\n\n public viewsModel(modelId: Id64String): boolean { return this.modelSelector.containsModel(modelId); }\n public clearViewedModels() { this.modelSelector.models.clear(); }\n public addViewedModel(id: Id64String) { this.modelSelector.addModels(id); }\n public removeViewedModel(id: Id64String) { this.modelSelector.dropModels(id); }\n\n public forEachModel(func: (model: GeometricModelState) => void) {\n for (const modelId of this.modelSelector.models) {\n const model = this.iModel.models.getLoaded(modelId);\n if (undefined !== model && undefined !== model.asGeometricModel3d)\n func(model as GeometricModel3dState);\n }\n }\n\n /** @internal */\n public override forEachModelTreeRef(func: (treeRef: TileTreeReference) => void): void {\n for (const ref of this._treeRefs)\n func(ref);\n }\n\n /** @internal */\n public override createScene(context: SceneContext): void {\n super.createScene(context);\n context.textureDrapes.forEach((drape) => drape.collectGraphics(context));\n context.viewport.target.updateSolarShadows(this.getDisplayStyle3d().wantShadows ? context : undefined);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n this.registerModelSelectorListeners();\n this._treeRefs.attachToViewport(args);\n }\n\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._treeRefs.detachFromViewport();\n this.unregisterModelSelectorListeners();\n }\n\n /** Chiefly for debugging: change the \"deactivated\" state of one or more tile tree references. Deactivated references are\n * omitted when iterating the references, so e.g. their graphics are omitted from the scene.\n * @param modelIds The Ids of one or more models whose tile tree references are to be affected. If omitted, all models are affected.\n * @param deactivated True to deactivate the specified references, false to reactivate them, undefined to invert each one's current state.\n * @param which The references to be affected as either a broad category or one or more indices of animated references.\n * @internal\n */\n public setTileTreeReferencesDeactivated(modelIds: Id64String | Id64String[] | undefined, deactivated: boolean | undefined, which: \"all\" | \"animated\" | \"primary\" | \"section\" | number[]): void {\n this._treeRefs.setDeactivated(modelIds, deactivated, which);\n }\n\n /** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.\n * @param modelIds modelIds for which to get the TileTreeReferences\n * @param maskTreeRefs where to store the TileTreeReferences\n * @internal\n */\n public collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[]): void {\n this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs);\n }\n\n /** For getting a list of modelIds which do not participate in masking for planar classification.\n * @param maskModels models which DO participate in planar clip masking\n * @param useVisible when true, use visible models to set flag\n * @internal\n */\n public getModelsNotInMask(maskModels: OrderedId64Iterable | undefined, useVisible: boolean): Id64String[] | undefined {\n return this._treeRefs.getModelsNotInMask(maskModels, useVisible);\n }\n\n private registerModelSelectorListeners(): void {\n const models = this.modelSelector.observableModels;\n const func = () => {\n this.markModelSelectorChanged();\n this.onViewedModelsChanged.raiseEvent();\n };\n\n this._unregisterModelSelectorListeners.push(models.onAdded.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onDeleted.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onCleared.addListener(func));\n }\n\n private unregisterModelSelectorListeners(): void {\n this._unregisterModelSelectorListeners.forEach((f) => f());\n this._unregisterModelSelectorListeners.length = 0;\n }\n}\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\n * @public\n * @extensions\n */\nexport class OrthographicViewState extends SpatialViewState {\n public static override get className() { return \"OrthographicViewDefinition\"; }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) { super(props, iModel, categories, displayStyle, modelSelector); }\n\n public override supportsCamera(): boolean { return false; }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SpatialViewState.js","sourceRoot":"","sources":["../../src/SpatialViewState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EA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EAAE,aAAiC,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEpO,cAAc,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;CAC5D","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { BeEvent, CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { Constant, Matrix3d, Range3d, XYAndZ } from \"@itwin/core-geometry\";\nimport { AxisAlignedBox3d, HydrateViewStateRequestProps, HydrateViewStateResponseProps, SpatialViewDefinitionProps, ViewStateProps } from \"@itwin/core-common\";\nimport { AuxCoordSystemSpatialState, AuxCoordSystemState } from \"./AuxCoordSys\";\nimport { ModelSelectorState } from \"./ModelSelectorState\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle3dState } from \"./DisplayStyleState\";\nimport { GeometricModel3dState, GeometricModelState } from \"./ModelState\";\nimport { SceneContext } from \"./ViewContext\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { AttachToViewportArgs, ViewState3d } from \"./ViewState\";\nimport { SpatialTileTreeReferences, TileTreeReference } from \"./tile/internal\";\n\n/** Options supplied to [[SpatialViewState.computeFitRange]].\n * @public\n */\nexport interface ComputeSpatialViewFitRangeOptions {\n /** The minimal extents. The computed range will be unioned with this range if supplied. */\n baseExtents?: Range3d;\n}\n\n/** Defines a view of one or more SpatialModels.\n * The list of viewed models is stored in the ModelSelector.\n * @public\n * @extensions\n */\nexport class SpatialViewState extends ViewState3d {\n public static override get className() { return \"SpatialViewDefinition\"; }\n\n private readonly _treeRefs: SpatialTileTreeReferences;\n private _modelSelector: ModelSelectorState;\n private readonly _unregisterModelSelectorListeners: VoidFunction[] = [];\n\n /** An event raised when the set of models viewed by this view changes, *only* if the view is attached to a [[Viewport]].\n * @public\n */\n public readonly onViewedModelsChanged = new BeEvent<() => void>();\n\n public get modelSelector(): ModelSelectorState {\n return this._modelSelector;\n }\n\n public set modelSelector(selector: ModelSelectorState) {\n if (selector === this.modelSelector)\n return;\n\n const isAttached = this.isAttachedToViewport;\n this.unregisterModelSelectorListeners();\n\n this._modelSelector = selector;\n\n if (isAttached) {\n this.registerModelSelectorListeners();\n this.onViewedModelsChanged.raiseEvent();\n }\n\n this.markModelSelectorChanged();\n }\n\n /** Create a new *blank* SpatialViewState. The returned SpatialViewState will nave non-persistent empty [[CategorySelectorState]] and [[ModelSelectorState]],\n * and a non-persistent [[DisplayStyle3dState]] with default values for all of its components. Generally after creating a blank SpatialViewState,\n * callers will modify the state to suit specific needs.\n * @param iModel The IModelConnection for the new SpatialViewState\n * @param origin The origin for the new SpatialViewState\n * @param extents The extents for the new SpatialViewState\n * @param rotation The rotation of the new SpatialViewState. If undefined, use top view.\n * @public\n */\n public static createBlank(iModel: IModelConnection, origin: XYAndZ, extents: XYAndZ, rotation?: Matrix3d): SpatialViewState {\n const blank = {} as any;\n const cat = new CategorySelectorState(blank, iModel);\n const modelSelectorState = new ModelSelectorState(blank, iModel);\n const displayStyleState = new DisplayStyle3dState(blank, iModel);\n const view = new this(blank, iModel, cat, displayStyleState, modelSelectorState);\n view.setOrigin(origin);\n view.setExtents(extents);\n if (undefined !== rotation)\n view.setRotation(rotation);\n return view;\n }\n\n public static override createFromProps(props: ViewStateProps, iModel: IModelConnection): SpatialViewState {\n const cat = new CategorySelectorState(props.categorySelectorProps, iModel);\n const displayStyleState = new DisplayStyle3dState(props.displayStyleProps, iModel);\n const modelSelectorState = new ModelSelectorState(props.modelSelectorProps!, iModel);\n return new this(props.viewDefinitionProps as SpatialViewDefinitionProps, iModel, cat, displayStyleState, modelSelectorState);\n }\n\n public override toProps(): ViewStateProps {\n const props = super.toProps();\n props.modelSelectorProps = this.modelSelector.toJSON();\n return props;\n }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, arg3: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) {\n super(props, iModel, arg3, displayStyle);\n this._modelSelector = modelSelector;\n if (arg3 instanceof SpatialViewState) // from clone\n this._modelSelector = arg3.modelSelector.clone();\n\n this._treeRefs = SpatialTileTreeReferences.create(this);\n }\n\n /** @internal */\n public override isSpatialView(): this is SpatialViewState { return true; }\n\n public override equals(other: this): boolean { return super.equals(other) && this.modelSelector.equals(other.modelSelector); }\n\n public override createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystemSpatialState.createNew(acsName, this.iModel); }\n public get defaultExtentLimits() { return { min: Constant.oneMillimeter, max: 3 * Constant.diameterOfEarth }; } // Increased max by 3X to support globe mode.\n\n /** @internal */\n public markModelSelectorChanged(): void {\n this._treeRefs.update();\n }\n\n /** Get world-space viewed extents based on the iModel's project extents.\n * @deprecated in 3.6. These extents are based on [[IModelConnection.displayedExtents]], which is deprecated. Consider using [[computeFitRange]] or [[getViewedExtents]] instead.\n */\n protected getDisplayedExtents(): AxisAlignedBox3d {\n /* eslint-disable-next-line deprecation/deprecation */\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.displayedExtents);\n extents.scaleAboutCenterInPlace(1.0001); // projectExtents. lying smack up against the extents is not excluded by frustum...\n extents.extendRange(this.getGroundExtents());\n return extents;\n }\n\n private computeBaseExtents(): AxisAlignedBox3d {\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.projectExtents);\n\n // Ensure geometry coincident with planes of the project extents is not clipped.\n extents.scaleAboutCenterInPlace(1.0001);\n\n // Ensure ground plane is not clipped, if it's being drawn.\n extents.extendRange(this.getGroundExtents());\n\n return extents;\n }\n\n /** Compute a volume in world coordinates tightly encompassing the contents of the view. The volume is computed from the union of the volumes of the\n * view's viewed models, including [GeometricModel]($backend)s and reality models.\n * Those volumes are obtained from the [[TileTree]]s used to render those models, so any tile tree that has not yet been loaded will not contribute to the computation.\n * If `options.baseExtents` is defined, it will be unioned with the computed volume.\n * If the computed volume is null (empty), a default volume will be computed from [IModel.projectExtents]($common), which may be a looser approximation of the\n * models' volumes.\n * @param options Options used to customize how the volume is computed.\n * @returns A non-null volume in world coordinates encompassing the contents of the view.\n */\n public computeFitRange(options?: ComputeSpatialViewFitRangeOptions): AxisAlignedBox3d {\n // Fit to the union of the ranges of all loaded tile trees.\n const range = options?.baseExtents?.clone() ?? new Range3d();\n this.forEachTileTreeRef((ref) => {\n ref.unionFitRange(range);\n });\n\n // Fall back to the project extents if necessary.\n if (range.isNull)\n range.setFrom(this.computeBaseExtents());\n\n // Avoid ridiculously small extents.\n range.ensureMinLengths(1.0);\n\n return range;\n }\n\n public getViewedExtents(): AxisAlignedBox3d {\n // Encompass the project extents and ground plane.\n const extents = this.computeBaseExtents();\n\n // Include any tile trees that extend outside the project extents.\n extents.extendRange(this.computeFitRange());\n\n return extents;\n }\n\n public override toJSON(): SpatialViewDefinitionProps {\n const val = super.toJSON() as SpatialViewDefinitionProps;\n val.modelSelectorId = this.modelSelector.id;\n return val;\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n const notLoaded = this.iModel.models.filterLoaded(this.modelSelector.models);\n if (undefined === notLoaded)\n return; // all requested models are already loaded\n hydrateRequest.notLoadedModelSelectorStateModels = CompressedId64Set.sortAndCompress(notLoaded);\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n if (hydrateResponse.modelSelectorStateModels !== undefined)\n promises.push(this.iModel.models.updateLoadedWithModelProps(hydrateResponse.modelSelectorStateModels));\n await Promise.all(promises);\n }\n\n public viewsModel(modelId: Id64String): boolean { return this.modelSelector.containsModel(modelId); }\n public clearViewedModels() { this.modelSelector.models.clear(); }\n public addViewedModel(id: Id64String) { this.modelSelector.addModels(id); }\n public removeViewedModel(id: Id64String) { this.modelSelector.dropModels(id); }\n\n public forEachModel(func: (model: GeometricModelState) => void) {\n for (const modelId of this.modelSelector.models) {\n const model = this.iModel.models.getLoaded(modelId);\n if (undefined !== model && undefined !== model.asGeometricModel3d)\n func(model as GeometricModel3dState);\n }\n }\n\n /** @internal */\n public override forEachModelTreeRef(func: (treeRef: TileTreeReference) => void): void {\n for (const ref of this._treeRefs)\n func(ref);\n }\n\n /** @internal */\n public override createScene(context: SceneContext): void {\n super.createScene(context);\n context.textureDrapes.forEach((drape) => drape.collectGraphics(context));\n context.viewport.target.updateSolarShadows(this.getDisplayStyle3d().wantShadows ? context : undefined);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n this.registerModelSelectorListeners();\n this._treeRefs.attachToViewport(args);\n }\n\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._treeRefs.detachFromViewport();\n this.unregisterModelSelectorListeners();\n }\n\n /** Chiefly for debugging: change the \"deactivated\" state of one or more tile tree references. Deactivated references are\n * omitted when iterating the references, so e.g. their graphics are omitted from the scene.\n * @param modelIds The Ids of one or more models whose tile tree references are to be affected. If omitted, all models are affected.\n * @param deactivated True to deactivate the specified references, false to reactivate them, undefined to invert each one's current state.\n * @param which The references to be affected as either a broad category or one or more indices of animated references.\n * @internal\n */\n public setTileTreeReferencesDeactivated(modelIds: Id64String | Id64String[] | undefined, deactivated: boolean | undefined, which: \"all\" | \"animated\" | \"primary\" | \"section\" | number[]): void {\n this._treeRefs.setDeactivated(modelIds, deactivated, which);\n }\n\n /** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.\n * @param modelIds modelIds for which to get the TileTreeReferences\n * @param maskTreeRefs where to store the TileTreeReferences\n * @param maskRange range to extend for the maskRefs\n * @internal\n */\n public collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[], maskRange: Range3d): void {\n this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs, maskRange);\n }\n\n /** For getting a list of modelIds which do not participate in masking for planar classification.\n * @param maskModels models which DO participate in planar clip masking\n * @param useVisible when true, use visible models to set flag\n * @internal\n */\n public getModelsNotInMask(maskModels: OrderedId64Iterable | undefined, useVisible: boolean): Id64String[] | undefined {\n return this._treeRefs.getModelsNotInMask(maskModels, useVisible);\n }\n\n private registerModelSelectorListeners(): void {\n const models = this.modelSelector.observableModels;\n const func = () => {\n this.markModelSelectorChanged();\n this.onViewedModelsChanged.raiseEvent();\n };\n\n this._unregisterModelSelectorListeners.push(models.onAdded.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onDeleted.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onCleared.addListener(func));\n }\n\n private unregisterModelSelectorListeners(): void {\n this._unregisterModelSelectorListeners.forEach((f) => f());\n this._unregisterModelSelectorListeners.length = 0;\n }\n}\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\n * @public\n * @extensions\n */\nexport class OrthographicViewState extends SpatialViewState {\n public static override get className() { return \"OrthographicViewDefinition\"; }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) { super(props, iModel, categories, displayStyle, modelSelector); }\n\n public override supportsCamera(): boolean { return false; }\n}\n"]}
|
|
@@ -357,8 +357,12 @@ export declare abstract class GraphicBuilder {
|
|
|
357
357
|
addRangeBox(range: Range3d, solid?: boolean): void;
|
|
358
358
|
/** Add Frustum edges. Useful for debugging. */
|
|
359
359
|
addFrustum(frustum: Frustum): void;
|
|
360
|
+
/** Add Frustum sides. Useful for debugging. */
|
|
361
|
+
addFrustumSides(frustum: Frustum): void;
|
|
360
362
|
/** Add range edges from corner points */
|
|
361
363
|
addRangeBoxFromCorners(p: Point3d[]): void;
|
|
364
|
+
/** Add range sides from corner points */
|
|
365
|
+
addRangeBoxSidesFromCorners(p: Point3d[]): void;
|
|
362
366
|
/** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.
|
|
363
367
|
* @param lineColor The color in which to draw lines.
|
|
364
368
|
* @param fillColor The color in which to draw filled regions.
|