@itwin/core-frontend 5.13.0-dev.9 → 5.14.0-dev.1
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 +35 -1
- package/lib/cjs/BriefcaseTxns.d.ts +9 -0
- package/lib/cjs/BriefcaseTxns.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTxns.js +9 -0
- package/lib/cjs/BriefcaseTxns.js.map +1 -1
- package/lib/cjs/EmphasizeElements.d.ts +4 -1
- package/lib/cjs/EmphasizeElements.d.ts.map +1 -1
- package/lib/cjs/EmphasizeElements.js +16 -9
- package/lib/cjs/EmphasizeElements.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts +11 -1
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +14 -1
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModeljs-css.d.ts.map +1 -1
- package/lib/cjs/IModeljs-css.js +4 -2
- package/lib/cjs/IModeljs-css.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +7 -4
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/TxnEntityChanges.d.ts +4 -18
- package/lib/cjs/TxnEntityChanges.d.ts.map +1 -1
- package/lib/cjs/TxnEntityChanges.js.map +1 -1
- package/lib/cjs/ViewManager.d.ts +3 -0
- package/lib/cjs/ViewManager.d.ts.map +1 -1
- package/lib/cjs/ViewManager.js +9 -1
- package/lib/cjs/ViewManager.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +7 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +13 -1
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +7 -1
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/internal/GoogleMapsDecorator.js +1 -1
- package/lib/cjs/internal/GoogleMapsDecorator.js.map +1 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts +11 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.js +49 -3
- package/lib/cjs/internal/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +5 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts +3 -0
- package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ArcGisUtilities.js +32 -4
- package/lib/cjs/internal/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js +28 -6
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +7 -3
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +1 -7
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +4 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +6 -2
- package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/WmsCapabilities.d.ts +2 -0
- package/lib/cjs/internal/tile/map/WmsCapabilities.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/WmsCapabilities.js +28 -6
- package/lib/cjs/internal/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/cjs/internal/tile/map/WmsUtilities.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/WmsUtilities.js +25 -4
- package/lib/cjs/internal/tile/map/WmsUtilities.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +14 -6
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +74 -0
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js +114 -2
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +16 -0
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +118 -2
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +230 -20
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.d.ts +7 -1
- package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js +6 -0
- package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerTileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerTileTreeReference.js +1 -3
- package/lib/cjs/tile/map/MapLayerTileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +3 -1
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tools/Tool.d.ts +5 -1
- package/lib/cjs/tools/Tool.d.ts.map +1 -1
- package/lib/cjs/tools/Tool.js +5 -1
- package/lib/cjs/tools/Tool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +2 -1
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +81 -19
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/BriefcaseTxns.d.ts +9 -0
- package/lib/esm/BriefcaseTxns.d.ts.map +1 -1
- package/lib/esm/BriefcaseTxns.js +9 -0
- package/lib/esm/BriefcaseTxns.js.map +1 -1
- package/lib/esm/EmphasizeElements.d.ts +4 -1
- package/lib/esm/EmphasizeElements.d.ts.map +1 -1
- package/lib/esm/EmphasizeElements.js +16 -9
- package/lib/esm/EmphasizeElements.js.map +1 -1
- package/lib/esm/IModelApp.d.ts +11 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +14 -1
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModeljs-css.d.ts.map +1 -1
- package/lib/esm/IModeljs-css.js +4 -2
- package/lib/esm/IModeljs-css.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +7 -4
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/TxnEntityChanges.d.ts +4 -18
- package/lib/esm/TxnEntityChanges.d.ts.map +1 -1
- package/lib/esm/TxnEntityChanges.js.map +1 -1
- package/lib/esm/ViewManager.d.ts +3 -0
- package/lib/esm/ViewManager.d.ts.map +1 -1
- package/lib/esm/ViewManager.js +9 -1
- package/lib/esm/ViewManager.js.map +1 -1
- package/lib/esm/Viewport.d.ts +7 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +13 -1
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +7 -1
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/internal/GoogleMapsDecorator.js +1 -1
- package/lib/esm/internal/GoogleMapsDecorator.js.map +1 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.d.ts +11 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.js +49 -4
- package/lib/esm/internal/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +5 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts +3 -0
- package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ArcGisUtilities.js +33 -5
- package/lib/esm/internal/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js +29 -7
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +8 -4
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +1 -7
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +5 -2
- package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +7 -3
- package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/WmsCapabilities.d.ts +2 -0
- package/lib/esm/internal/tile/map/WmsCapabilities.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/WmsCapabilities.js +28 -6
- package/lib/esm/internal/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/esm/internal/tile/map/WmsUtilities.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/WmsUtilities.js +25 -4
- package/lib/esm/internal/tile/map/WmsUtilities.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +14 -6
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +74 -0
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js +113 -2
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +17 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +118 -2
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +228 -20
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.d.ts +7 -1
- package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.js +6 -0
- package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
- package/lib/esm/tile/map/MapLayerTileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerTileTreeReference.js +1 -3
- package/lib/esm/tile/map/MapLayerTileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +4 -2
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tools/Tool.d.ts +5 -1
- package/lib/esm/tools/Tool.d.ts.map +1 -1
- package/lib/esm/tools/Tool.js +5 -1
- package/lib/esm/tools/Tool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +2 -1
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +82 -20
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/package.json +21 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAc,MAAM,EAAsC,MAAM,qBAAqB,CAAC;AAC1H,OAAO,EAA6D,iBAAiB,EAAE,mBAAmB,EAAwB,MAAM,oBAAoB,CAAC;AAE7J,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAs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,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,KAAuB,EAAE,EAAkB;QACtE,MAAM,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAEvC,yDAAyD;QACzD,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAC1B,oCAAoC;YACpC,iGAAiG;YACjG,MAAM,gBAAgB,GAAG,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAEjF,IAAI,YAAY,GAAG,2BAA2B,CAAC;YAC/C,YAAY,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC5E,YAAY,IAAI,OAAO,CAAC;YAExB,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC9C,OAAO,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,UAAU,iCAAiC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,oBAAoB,CAAC;YAE7C,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC;gBACvC,OAAO;gBACP,SAAS,EAAE,EAAE;gBACb,OAAO,EAAE,gCAAgC;gBACzC,MAAM,EAAE,YAAY;aACrB,CAAC,CAAC,CAAC;QACN,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,kDAAkD,CAAC;AAC5D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\nimport { BentleyError, BentleyStatus, GuidString, Logger, LoggingMetaData, RealityDataStatus } from \"@itwin/core-bentley\";\r\nimport { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\r\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAssetUrl } from \"./tile/internal\";\r\nimport { RealityDataSourceTilesetUrlImpl } from \"./RealityDataSourceTilesetUrlImpl\";\r\nimport { RealityDataSourceContextShareImpl } from \"./RealityDataSourceContextShareImpl\";\r\nimport { RealityDataSourceCesiumIonAssetImpl } from \"./RealityDataSourceCesiumIonAssetImpl\";\r\nimport { RealityDataSourceGoogle3dTilesImpl } from \"./internal/RealityDataSourceGoogle3dTilesImpl\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { getCopyrights, GoogleMapsDecorator } from \"./internal/GoogleMapsDecorator\";\r\nimport { DecorateContext } from \"./ViewContext\";\r\nimport { ScreenViewport } from \"./Viewport\";\r\n\r\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\r\n\r\n/**\r\n * Reality Data Operation error\r\n * @alpha\r\n */\r\nexport class RealityDataError extends BentleyError {\r\n public constructor(errorNumber: RealityDataStatus, message: string, getMetaData?: LoggingMetaData) {\r\n super(errorNumber, message, getMetaData);\r\n }\r\n}\r\n\r\n/** This interface provide spatial location and volume of interest, in meters, centered around `spatial location`\r\n * @alpha\r\n */\r\nexport interface SpatialLocationAndExtents {\r\n /** location of the point at the center of the reaity data */\r\n location: Cartographic | EcefLocation;\r\n /** extents of the volume around location */\r\n worldRange: Range3d;\r\n /** true if this reality data is geolocated\r\n * A reality data is geolocated when we can compute a valid position relative to the earth surface.\r\n * Note that some reality data contains custom coordinate system without any information on the relative position on earth.\r\n * These reality data will have a location and worldRange but will be identified by the isGeoLocated set to false.\r\n */\r\n isGeolocated: boolean;\r\n}\r\n\r\n/** This interface provides information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\nexport interface PublisherProductInfo {\r\n /** product that create this reality data */\r\n product: string;\r\n /** engine that create this reality data */\r\n engine: string;\r\n /** the version of the engine that create this reality data */\r\n version: string;\r\n}\r\n\r\n/** This interface provide methods used to access a reality data from a reality data provider\r\n * @beta\r\n */\r\nexport interface RealityDataSource {\r\n readonly key: RealityDataSourceKey;\r\n readonly isContextShare: boolean;\r\n readonly realityDataId: string | undefined;\r\n /** Metatdata on the reality data source */\r\n readonly realityData: RealityData | undefined;\r\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\r\n readonly realityDataType: string | undefined;\r\n /** This method returns the URL to obtain the Reality Data properties.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\r\n /** If true, the geometricError property of the tiles will be used to compute screen-space error.\r\n * @alpha\r\n */\r\n readonly usesGeometricError?: boolean;\r\n /** If [[usesGeometricError]] is `true`, optionally specifies the maximum error, in pixels, to permit for a tile before requiring refinement of that tile.\r\n * Default: 16\r\n * @alpha\r\n */\r\n readonly maximumScreenSpaceError?: number;\r\n /** Given the URL of a tile's content, return the type of that content.\r\n * \"tileset\" indicates the content points to a JSON tileset describing the structure of the tile tree below the tile.\r\n * \"tile\" indicates the content points to a binary representation of the tile's graphics.\r\n * @alpha\r\n */\r\n getTileContentType(url: string): \"tile\" | \"tileset\";\r\n\r\n /** Gets a reality data root document json\r\n * @returns tile data json\r\n * @internal\r\n */\r\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\r\n /** Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n * @internal\r\n */\r\n getTileContent(name: string): Promise<any>;\r\n /** Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n getTileJson(name: string): Promise<any>;\r\n /** Gets spatial location and extents of this reality data source.\r\n * Will return undefined if cannot be resolved or is unbounded (cover entire earth eg: Open Street Map Building from Ion Asset)\r\n * @returns spatial location and extents\r\n * @throws [[RealityDataError]] if source is invalid or cannot be read\r\n * @alpha\r\n */\r\n getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;\r\n /** Gets information to identify the product and engine that create this reality data\r\n * Will return undefined if cannot be resolved\r\n * @returns information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\n getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;\r\n /** Optional, gets the tileset url associated with the reality data source\r\n * @returns tileset url\r\n * @internal\r\n */\r\n getTilesetUrl?(): string | undefined;\r\n}\r\n/** Utility functions for RealityDataSource\r\n * @beta\r\n */\r\nexport namespace RealityDataSource {\r\n /** Create a RealityDataSourceKey from a tilesetUrl.\r\n * @param tilesetUrl the reality data attachment url\r\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\r\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\r\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\r\n */\r\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\r\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\r\n const provider = RealityDataProvider.CesiumIonAsset;\r\n let cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId }; // default OSM building\r\n // Parse URL to extract possible asset id and key if provided\r\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(tilesetUrl);\r\n if (cesiumAsset) {\r\n cesiumIonAssetKey = RealityDataSource.createCesiumIonAssetKey(cesiumAsset.id, cesiumAsset.key);\r\n }\r\n return cesiumIonAssetKey;\r\n }\r\n\r\n // Try to extract realityDataId from URL and if not possible, use the url as the key\r\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\r\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n format = inputFormat ? inputFormat : info.format;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\r\n return contextShareKey;\r\n }\r\n\r\n // default to tileSetUrl\r\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\r\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\r\n return urlKey;\r\n }\r\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\r\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\r\n const format = inputFormat ? inputFormat : info.format;\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\r\n return contextShareKey;\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\r\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\r\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\r\n } else if (orbitGtBlob.rdsUrl) {\r\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\r\n }\r\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\r\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\r\n return { provider, format, id };\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\r\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\r\n return undefined;\r\n const splitIds = rdSourceKey.id.split(\":\");\r\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\r\n const sasToken = rdSourceKey.id.substring(sasTokenIndex + 2);\r\n const orbitGtBlob: OrbitGtBlobProps = {\r\n accountName: splitIds[0],\r\n containerName: splitIds[1],\r\n blobFileName: splitIds[2],\r\n sasToken,\r\n };\r\n return orbitGtBlob;\r\n }\r\n /** @internal - Is used by \"fdt attach cesium asset\" keyin*/\r\n export function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey {\r\n const id = getCesiumAssetUrl(osmAssetId,requestKey);\r\n return {provider: RealityDataProvider.CesiumIonAsset, format: RealityDataFormat.ThreeDTile, id};\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\r\n * @alpha\r\n */\r\n export async function fromKey(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n const provider = IModelApp.realityDataSourceProviders.find(key.provider);\r\n if (!provider) {\r\n Logger.logWarning(loggerCategory, `RealityDataSourceProvider \"${key.provider}\" is not registered`);\r\n return undefined;\r\n }\r\n\r\n return provider.createRealityDataSource(key, iTwinId);\r\n }\r\n}\r\n\r\n/** A named supplier of [RealityDataSource]]s.\r\n * The provider's name is stored in a [RealityDataSourceKey]($common). When the [[RealityDataSource]] is requested from the key,\r\n * the provider is looked up in [[IModelApp.realityDataSourceProviders]] by its name and, if found, its [[createRealityDataSource]] method\r\n * is invoked to produce the reality data source.\r\n * @beta\r\n */\r\n\r\nexport interface RealityDataSourceProvider {\r\n /** Produce a RealityDataSource for the specified `key`.\r\n * @param key Identifies the reality data source.\r\n * @param iTwinId A default iTwinId to use.\r\n * @returns the requested reality data source, or `undefined` if it could not be produced.\r\n */\r\n createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;\r\n /** Optionally add any decorations specific to this reality data source provider.\r\n * For example, the Google Photorealistic 3D Tiles reality data source provider will add the Google logo.\r\n */\r\n decorate?(_context: DecorateContext): void;\r\n /** Optionally add attribution logo cards to the viewport's logo div. */\r\n addAttributions?(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;\r\n /** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */\r\n useCachedDecorations?: true | undefined;\r\n}\r\n\r\n/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].\r\n * It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.\r\n * Any number of additional providers can be registered. They should typically be registered just after [[IModelApp.startup]].\r\n * @beta\r\n */\r\nexport class RealityDataSourceProviderRegistry {\r\n private readonly _providers = new Map<string, RealityDataSourceProvider>();\r\n\r\n /** @internal */\r\n public constructor() {\r\n this.register(RealityDataProvider.CesiumIonAsset, {\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceCesiumIonAssetImpl.createFromKey(key, iTwinId),\r\n });\r\n this.register(RealityDataProvider.TilesetUrl, {\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\r\n });\r\n this.register(RealityDataProvider.ContextShare, {\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceContextShareImpl.createFromKey(key, iTwinId),\r\n });\r\n this.register(RealityDataProvider.OrbitGtBlob, {\r\n // ###TODO separate TilesetUrlImpl\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\r\n });\r\n }\r\n\r\n /** Register `provider` to produce [[RealityDataSource]]s for the specified provider `name`. */\r\n public register(name: string, provider: RealityDataSourceProvider): void {\r\n this._providers.set(name, provider);\r\n }\r\n\r\n /** Look up the provider registered by the specified `name`. */\r\n public find(name: string): RealityDataSourceProvider | undefined {\r\n return this._providers.get(name);\r\n }\r\n}\r\n\r\n/**\r\n * Options for creating a Google Photorealistic 3D Tiles reality data source provider.\r\n * The caller must provide either an API key or a function that returns an auth token.\r\n * @beta\r\n */\r\nexport type Google3dTilesProviderOptions = {\r\n /** Google Map Tiles API Key used to access Google 3D Tiles. */\r\n apiKey: string;\r\n getAuthToken?: never;\r\n /** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */\r\n showCreditsOnScreen?: boolean\r\n} | {\r\n apiKey?: never;\r\n /** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the \"Bearer\" prefix. */\r\n getAuthToken: () => Promise<string>;\r\n /** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */\r\n showCreditsOnScreen?: boolean;\r\n};\r\n\r\n/**\r\n * Will provide Google Photorealistic 3D Tiles (in 3dTile format).\r\n * A valid API key or getAuthToken fuction must be supplied when creating this provider.\r\n * To use this provider, you must register it with [[IModelApp.realityDataSourceProviders]].\r\n * Example usage:\r\n * ```ts\r\n * [[include:GooglePhotorealistic3dTiles_providerApiKey]]\r\n * ```\r\n * @see [Google Photorealistic 3D Tiles]($docs/learning/frontend/GooglePhotorealistic3dTiles.md)\r\n * @beta\r\n */\r\nexport class Google3dTilesProvider implements RealityDataSourceProvider {\r\n /** Google Map Tiles API Key used to access Google 3D Tiles. */\r\n private _apiKey?: string;\r\n /** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the \"Bearer\" prefix. */\r\n private _getAuthToken?: () => Promise<string | undefined>;\r\n /** Decorator for Google Maps logos. */\r\n private _decorator: GoogleMapsDecorator;\r\n /** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */\r\n public readonly useCachedDecorations = true;\r\n\r\n public async createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n if (!this._apiKey && !this._getAuthToken) {\r\n Logger.logError(loggerCategory, \"Either an API key or getAuthToken function are required to create a Google3dTilesProvider.\");\r\n return undefined;\r\n }\r\n return RealityDataSourceGoogle3dTilesImpl.createFromKey(key, iTwinId, this._apiKey, this._getAuthToken);\r\n }\r\n\r\n public constructor(options: Google3dTilesProviderOptions) {\r\n this._apiKey = options.apiKey;\r\n this._getAuthToken = options.getAuthToken;\r\n this._decorator = new GoogleMapsDecorator(options.showCreditsOnScreen ?? true);\r\n }\r\n\r\n /**\r\n * Initialize the Google 3D Tiles reality data source provider by activating its decorator, which consists of loading the correct Google Maps logo.\r\n * @returns `true` if the decorator was successfully activated, otherwise `false`.\r\n */\r\n public async initialize(): Promise<boolean> {\r\n const isActivated = await this._decorator.activate(\"satellite\");\r\n if (!isActivated) {\r\n const msg = \"Failed to activate decorator\";\r\n Logger.logError(loggerCategory, msg);\r\n throw new BentleyError(BentleyStatus.ERROR, msg);\r\n }\r\n return isActivated;\r\n }\r\n\r\n public decorate(_context: DecorateContext): void {\r\n this._decorator.decorate(_context);\r\n }\r\n\r\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\r\n const copyrightMap = getCopyrights(vp);\r\n\r\n // Only add another logo card if the tiles have copyright\r\n if (copyrightMap.size > 0) {\r\n // Order by most occurances to least\r\n // See https://developers.google.com/maps/documentation/tile/create-renderer#display-attributions\r\n const sortedCopyrights = [...copyrightMap.entries()].sort((a, b) => b[1] - a[1]);\r\n\r\n let copyrightMsg = \"Data provided by:<br><ul>\";\r\n copyrightMsg += sortedCopyrights.map(([key]) => `<li>${key}</li>`).join(\"\");\r\n copyrightMsg += \"</ul>\";\r\n\r\n const iconSrc = document.createElement(\"img\");\r\n iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;\r\n iconSrc.style.padding = \"10px 10px 5px 10px\";\r\n\r\n cards.appendChild(IModelApp.makeLogoCard({\r\n iconSrc,\r\n iconWidth: 98,\r\n heading: \"Google Photorealistic 3D Tiles\",\r\n notice: copyrightMsg\r\n }));\r\n }\r\n }\r\n}\r\n\r\n/** Returns the URL used for retrieving Google Photorealistic 3D Tiles.\r\n * @beta\r\n */\r\nexport function getGoogle3dTilesUrl() {\r\n return \"https://tile.googleapis.com/v1/3dtiles/root.json\";\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAc,MAAM,EAAsC,MAAM,qBAAqB,CAAC;AAC1H,OAAO,EAA6D,iBAAiB,EAAE,mBAAmB,EAAwB,MAAM,oBAAoB,CAAC;AAE7J,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,+CAA+C,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIpF,MAAM,cAAc,GAAW,sBAAsB,CAAC,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAChD,YAAmB,WAA8B,EAAE,OAAe,EAAE,WAA6B;QAC/F,KAAK,CAAC,WAAW,EA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G,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;gBACvB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;YAED,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC9C,OAAO,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,UAAU,iCAAiC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,oBAAoB,CAAC;YAE7C,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC;gBACvC,OAAO;gBACP,SAAS,EAAE,EAAE;gBACb,OAAO,EAAE,gCAAgC;gBACzC,WAAW,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC;aACzC,CAAC,CAAC,CAAC;QACN,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,kDAAkD,CAAC;AAC5D,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\nimport { BentleyError, BentleyStatus, GuidString, Logger, LoggingMetaData, RealityDataStatus } from \"@itwin/core-bentley\";\r\nimport { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\r\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAssetUrl } from \"./tile/internal\";\r\nimport { RealityDataSourceTilesetUrlImpl } from \"./RealityDataSourceTilesetUrlImpl\";\r\nimport { RealityDataSourceContextShareImpl } from \"./RealityDataSourceContextShareImpl\";\r\nimport { RealityDataSourceCesiumIonAssetImpl } from \"./RealityDataSourceCesiumIonAssetImpl\";\r\nimport { RealityDataSourceGoogle3dTilesImpl } from \"./internal/RealityDataSourceGoogle3dTilesImpl\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { getCopyrights, GoogleMapsDecorator } from \"./internal/GoogleMapsDecorator\";\r\nimport { DecorateContext } from \"./ViewContext\";\r\nimport { ScreenViewport } from \"./Viewport\";\r\n\r\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\r\n\r\n/**\r\n * Reality Data Operation error\r\n * @alpha\r\n */\r\nexport class RealityDataError extends BentleyError {\r\n public constructor(errorNumber: RealityDataStatus, message: string, getMetaData?: LoggingMetaData) {\r\n super(errorNumber, message, getMetaData);\r\n }\r\n}\r\n\r\n/** This interface provide spatial location and volume of interest, in meters, centered around `spatial location`\r\n * @alpha\r\n */\r\nexport interface SpatialLocationAndExtents {\r\n /** location of the point at the center of the reaity data */\r\n location: Cartographic | EcefLocation;\r\n /** extents of the volume around location */\r\n worldRange: Range3d;\r\n /** true if this reality data is geolocated\r\n * A reality data is geolocated when we can compute a valid position relative to the earth surface.\r\n * Note that some reality data contains custom coordinate system without any information on the relative position on earth.\r\n * These reality data will have a location and worldRange but will be identified by the isGeoLocated set to false.\r\n */\r\n isGeolocated: boolean;\r\n}\r\n\r\n/** This interface provides information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\nexport interface PublisherProductInfo {\r\n /** product that create this reality data */\r\n product: string;\r\n /** engine that create this reality data */\r\n engine: string;\r\n /** the version of the engine that create this reality data */\r\n version: string;\r\n}\r\n\r\n/** This interface provide methods used to access a reality data from a reality data provider\r\n * @beta\r\n */\r\nexport interface RealityDataSource {\r\n readonly key: RealityDataSourceKey;\r\n readonly isContextShare: boolean;\r\n readonly realityDataId: string | undefined;\r\n /** Metatdata on the reality data source */\r\n readonly realityData: RealityData | undefined;\r\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\r\n readonly realityDataType: string | undefined;\r\n /** This method returns the URL to obtain the Reality Data properties.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\r\n /** If true, the geometricError property of the tiles will be used to compute screen-space error.\r\n * @alpha\r\n */\r\n readonly usesGeometricError?: boolean;\r\n /** If [[usesGeometricError]] is `true`, optionally specifies the maximum error, in pixels, to permit for a tile before requiring refinement of that tile.\r\n * Default: 16\r\n * @alpha\r\n */\r\n readonly maximumScreenSpaceError?: number;\r\n /** Given the URL of a tile's content, return the type of that content.\r\n * \"tileset\" indicates the content points to a JSON tileset describing the structure of the tile tree below the tile.\r\n * \"tile\" indicates the content points to a binary representation of the tile's graphics.\r\n * @alpha\r\n */\r\n getTileContentType(url: string): \"tile\" | \"tileset\";\r\n\r\n /** Gets a reality data root document json\r\n * @returns tile data json\r\n * @internal\r\n */\r\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\r\n /** Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n * @internal\r\n */\r\n getTileContent(name: string): Promise<any>;\r\n /** Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n getTileJson(name: string): Promise<any>;\r\n /** Gets spatial location and extents of this reality data source.\r\n * Will return undefined if cannot be resolved or is unbounded (cover entire earth eg: Open Street Map Building from Ion Asset)\r\n * @returns spatial location and extents\r\n * @throws [[RealityDataError]] if source is invalid or cannot be read\r\n * @alpha\r\n */\r\n getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;\r\n /** Gets information to identify the product and engine that create this reality data\r\n * Will return undefined if cannot be resolved\r\n * @returns information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\n getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;\r\n /** Optional, gets the tileset url associated with the reality data source\r\n * @returns tileset url\r\n * @internal\r\n */\r\n getTilesetUrl?(): string | undefined;\r\n}\r\n/** Utility functions for RealityDataSource\r\n * @beta\r\n */\r\nexport namespace RealityDataSource {\r\n /** Create a RealityDataSourceKey from a tilesetUrl.\r\n * @param tilesetUrl the reality data attachment url\r\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\r\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\r\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\r\n */\r\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\r\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\r\n const provider = RealityDataProvider.CesiumIonAsset;\r\n let cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId }; // default OSM building\r\n // Parse URL to extract possible asset id and key if provided\r\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(tilesetUrl);\r\n if (cesiumAsset) {\r\n cesiumIonAssetKey = RealityDataSource.createCesiumIonAssetKey(cesiumAsset.id, cesiumAsset.key);\r\n }\r\n return cesiumIonAssetKey;\r\n }\r\n\r\n // Try to extract realityDataId from URL and if not possible, use the url as the key\r\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\r\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n format = inputFormat ? inputFormat : info.format;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\r\n return contextShareKey;\r\n }\r\n\r\n // default to tileSetUrl\r\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\r\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\r\n return urlKey;\r\n }\r\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\r\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\r\n const format = inputFormat ? inputFormat : info.format;\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\r\n return contextShareKey;\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\r\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\r\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\r\n } else if (orbitGtBlob.rdsUrl) {\r\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\r\n }\r\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\r\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\r\n return { provider, format, id };\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\r\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\r\n return undefined;\r\n const splitIds = rdSourceKey.id.split(\":\");\r\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\r\n const sasToken = rdSourceKey.id.substring(sasTokenIndex + 2);\r\n const orbitGtBlob: OrbitGtBlobProps = {\r\n accountName: splitIds[0],\r\n containerName: splitIds[1],\r\n blobFileName: splitIds[2],\r\n sasToken,\r\n };\r\n return orbitGtBlob;\r\n }\r\n /** @internal - Is used by \"fdt attach cesium asset\" keyin*/\r\n export function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey {\r\n const id = getCesiumAssetUrl(osmAssetId,requestKey);\r\n return {provider: RealityDataProvider.CesiumIonAsset, format: RealityDataFormat.ThreeDTile, id};\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\r\n * @alpha\r\n */\r\n export async function fromKey(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n const provider = IModelApp.realityDataSourceProviders.find(key.provider);\r\n if (!provider) {\r\n Logger.logWarning(loggerCategory, `RealityDataSourceProvider \"${key.provider}\" is not registered`);\r\n return undefined;\r\n }\r\n\r\n return provider.createRealityDataSource(key, iTwinId);\r\n }\r\n}\r\n\r\n/** A named supplier of [RealityDataSource]]s.\r\n * The provider's name is stored in a [RealityDataSourceKey]($common). When the [[RealityDataSource]] is requested from the key,\r\n * the provider is looked up in [[IModelApp.realityDataSourceProviders]] by its name and, if found, its [[createRealityDataSource]] method\r\n * is invoked to produce the reality data source.\r\n * @beta\r\n */\r\n\r\nexport interface RealityDataSourceProvider {\r\n /** Produce a RealityDataSource for the specified `key`.\r\n * @param key Identifies the reality data source.\r\n * @param iTwinId A default iTwinId to use.\r\n * @returns the requested reality data source, or `undefined` if it could not be produced.\r\n */\r\n createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;\r\n /** Optionally add any decorations specific to this reality data source provider.\r\n * For example, the Google Photorealistic 3D Tiles reality data source provider will add the Google logo.\r\n */\r\n decorate?(_context: DecorateContext): void;\r\n /** Optionally add attribution logo cards to the viewport's logo div. */\r\n addAttributions?(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;\r\n /** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */\r\n useCachedDecorations?: true | undefined;\r\n}\r\n\r\n/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].\r\n * It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.\r\n * Any number of additional providers can be registered. They should typically be registered just after [[IModelApp.startup]].\r\n * @beta\r\n */\r\nexport class RealityDataSourceProviderRegistry {\r\n private readonly _providers = new Map<string, RealityDataSourceProvider>();\r\n\r\n /** @internal */\r\n public constructor() {\r\n this.register(RealityDataProvider.CesiumIonAsset, {\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceCesiumIonAssetImpl.createFromKey(key, iTwinId),\r\n });\r\n this.register(RealityDataProvider.TilesetUrl, {\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\r\n });\r\n this.register(RealityDataProvider.ContextShare, {\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceContextShareImpl.createFromKey(key, iTwinId),\r\n });\r\n this.register(RealityDataProvider.OrbitGtBlob, {\r\n // ###TODO separate TilesetUrlImpl\r\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\r\n });\r\n }\r\n\r\n /** Register `provider` to produce [[RealityDataSource]]s for the specified provider `name`. */\r\n public register(name: string, provider: RealityDataSourceProvider): void {\r\n this._providers.set(name, provider);\r\n }\r\n\r\n /** Look up the provider registered by the specified `name`. */\r\n public find(name: string): RealityDataSourceProvider | undefined {\r\n return this._providers.get(name);\r\n }\r\n}\r\n\r\n/**\r\n * Options for creating a Google Photorealistic 3D Tiles reality data source provider.\r\n * The caller must provide either an API key or a function that returns an auth token.\r\n * @beta\r\n */\r\nexport type Google3dTilesProviderOptions = {\r\n /** Google Map Tiles API Key used to access Google 3D Tiles. */\r\n apiKey: string;\r\n getAuthToken?: never;\r\n /** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */\r\n showCreditsOnScreen?: boolean\r\n} | {\r\n apiKey?: never;\r\n /** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the \"Bearer\" prefix. */\r\n getAuthToken: () => Promise<string>;\r\n /** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */\r\n showCreditsOnScreen?: boolean;\r\n};\r\n\r\n/**\r\n * Will provide Google Photorealistic 3D Tiles (in 3dTile format).\r\n * A valid API key or getAuthToken fuction must be supplied when creating this provider.\r\n * To use this provider, you must register it with [[IModelApp.realityDataSourceProviders]].\r\n * Example usage:\r\n * ```ts\r\n * [[include:GooglePhotorealistic3dTiles_providerApiKey]]\r\n * ```\r\n * @see [Google Photorealistic 3D Tiles]($docs/learning/frontend/GooglePhotorealistic3dTiles.md)\r\n * @beta\r\n */\r\nexport class Google3dTilesProvider implements RealityDataSourceProvider {\r\n /** Google Map Tiles API Key used to access Google 3D Tiles. */\r\n private _apiKey?: string;\r\n /** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the \"Bearer\" prefix. */\r\n private _getAuthToken?: () => Promise<string | undefined>;\r\n /** Decorator for Google Maps logos. */\r\n private _decorator: GoogleMapsDecorator;\r\n /** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */\r\n public readonly useCachedDecorations = true;\r\n\r\n public async createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n if (!this._apiKey && !this._getAuthToken) {\r\n Logger.logError(loggerCategory, \"Either an API key or getAuthToken function are required to create a Google3dTilesProvider.\");\r\n return undefined;\r\n }\r\n return RealityDataSourceGoogle3dTilesImpl.createFromKey(key, iTwinId, this._apiKey, this._getAuthToken);\r\n }\r\n\r\n public constructor(options: Google3dTilesProviderOptions) {\r\n this._apiKey = options.apiKey;\r\n this._getAuthToken = options.getAuthToken;\r\n this._decorator = new GoogleMapsDecorator(options.showCreditsOnScreen ?? true);\r\n }\r\n\r\n /**\r\n * Initialize the Google 3D Tiles reality data source provider by activating its decorator, which consists of loading the correct Google Maps logo.\r\n * @returns `true` if the decorator was successfully activated, otherwise `false`.\r\n */\r\n public async initialize(): Promise<boolean> {\r\n const isActivated = await this._decorator.activate(\"satellite\");\r\n if (!isActivated) {\r\n const msg = \"Failed to activate decorator\";\r\n Logger.logError(loggerCategory, msg);\r\n throw new BentleyError(BentleyStatus.ERROR, msg);\r\n }\r\n return isActivated;\r\n }\r\n\r\n public decorate(_context: DecorateContext): void {\r\n this._decorator.decorate(_context);\r\n }\r\n\r\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\r\n const copyrightMap = getCopyrights(vp);\r\n\r\n // Only add another logo card if the tiles have copyright\r\n if (copyrightMap.size > 0) {\r\n // Order by most occurances to least\r\n // See https://developers.google.com/maps/documentation/tile/create-renderer#display-attributions\r\n const sortedCopyrights = [...copyrightMap.entries()].sort((a, b) => b[1] - a[1]);\r\n\r\n const list = document.createElement(\"ul\");\r\n for (const [key] of sortedCopyrights) {\r\n const item = document.createElement(\"li\");\r\n item.textContent = key;\r\n list.appendChild(item);\r\n }\r\n\r\n const iconSrc = document.createElement(\"img\");\r\n iconSrc.src = `${IModelApp.publicPath}images/GoogleMaps_Logo_Gray.svg`;\r\n iconSrc.style.padding = \"10px 10px 5px 10px\";\r\n\r\n cards.appendChild(IModelApp.makeLogoCard({\r\n iconSrc,\r\n iconWidth: 98,\r\n heading: \"Google Photorealistic 3D Tiles\",\r\n noticeLines: [\"Data provided by:\", list],\r\n }));\r\n }\r\n }\r\n}\r\n\r\n/** Returns the URL used for retrieving Google Photorealistic 3D Tiles.\r\n * @beta\r\n */\r\nexport function getGoogle3dTilesUrl() {\r\n return \"https://tile.googleapis.com/v1/3dtiles/root.json\";\r\n}\r\n"]}
|
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
* @module IModelConnection
|
|
3
3
|
*/
|
|
4
4
|
import { CompressedId64Set, Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { NotifyEntitiesChangedArgs } from "@itwin/core-common";
|
|
6
|
-
/** Describes the BIS class of a [[TxnEntityChange]].
|
|
7
|
-
* @public
|
|
8
|
-
* @extensions
|
|
9
|
-
*/
|
|
10
|
-
export interface TxnEntityMetadata {
|
|
11
|
-
/** The class's name in "Schema:Class" format. */
|
|
12
|
-
readonly classFullName: string;
|
|
13
|
-
/** Returns true if this class is or is derived from the specified class.
|
|
14
|
-
* @note Class names are compared case-sensitively.
|
|
15
|
-
*/
|
|
16
|
-
is(baseClassFullName: string): boolean;
|
|
17
|
-
}
|
|
5
|
+
import { NotifyEntitiesChangedArgs, TxnEntityMetadata } from "@itwin/core-common";
|
|
18
6
|
/** The type of operation that produced a [[TxnEntityChange]].
|
|
19
7
|
* @public
|
|
20
8
|
* @extensions
|
|
@@ -59,11 +47,9 @@ export interface TxnEntityChangesFilterOptions {
|
|
|
59
47
|
*/
|
|
60
48
|
includeTypes?: TxnEntityChangeType[];
|
|
61
49
|
}
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* It can be more convenient to iterate over the individual [[TxnEntityChange]]s, especially if you wish to [[filter]] out some
|
|
66
|
-
* changes.
|
|
50
|
+
/** The frontend transaction-change payload for [[BriefcaseTxns.onElementsChanged]] and [[BriefcaseTxns.onModelsChanged]].
|
|
51
|
+
* Iterate [[TxnEntityChange]]s to inspect their `id`, `type`, and [[TxnEntityChange.metadata]], or use [[filter]] to select by change type or class hierarchy.
|
|
52
|
+
* Both payloads include metadata. Frontend changes also expose a per-change `type`, while backend changes are grouped into `inserts`, `deletes`, and `updates`; the compressed `inserted`, `deleted`, and `updated` sets remain available for bulk operations.
|
|
67
53
|
* @public
|
|
68
54
|
* @extensions
|
|
69
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxnEntityChanges.d.ts","sourceRoot":"","sources":["../../src/TxnEntityChanges.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,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,CAAC,OAAO,EAAE,6BAA6B,GAAG,uBAAuB,CAAC;CACzE;AAED,qBAAa,QAAS,YAAW,iBAAiB;IAChD,SAAgB,aAAa,EAAE,MAAM,CAAC;IACtC,SAAgB,WAAW,EAAE,QAAQ,EAAE,CAAM;gBAE1B,IAAI,EAAE,MAAM;IAIxB,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGrC;AAyCD,qBAAa,aAAc,YAAW,gBAAgB;IACpD,SAAgB,IAAI,EAAE,yBAAyB,CAAC;IAChD,SAAgB,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBAElB,IAAI,EAAE,yBAAyB;IAYlD,IAAW,QAAQ,IAAI,iBAAiB,GAAG,SAAS,CAA+B;IACnF,IAAW,OAAO,IAAI,iBAAiB,GAAG,SAAS,CAA8B;IACjF,IAAW,OAAO,IAAI,iBAAiB,GAAG,SAAS,CAA8B;IAE1E,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC;IAI9C,MAAM,CAAC,OAAO,EAAE,6BAA6B,GAAG,uBAAuB;CAK/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxnEntityChanges.js","sourceRoot":"","sources":["../../src/TxnEntityChanges.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAc,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TxnEntityChanges.js","sourceRoot":"","sources":["../../src/TxnEntityChanges.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAc,MAAM,qBAAqB,CAAC;AAuEpE,MAAM,OAAO,QAAQ;IACH,aAAa,CAAS;IACtB,WAAW,GAAe,EAAE,CAAC;IAE7C,YAAmB,IAAY;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAEM,EAAE,CAAC,Q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,CAAC,OAAO,CAAC,CAAC,CAAC;IACjF,IAAW,OAAO,KAAoC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE1E,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEM,MAAM,CAAC,OAAsC;QAClD,OAAO;YACL,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC;SAC9D,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IModelConnection\r\n */\r\n\r\nimport { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\r\nimport { NotifyEntitiesChangedArgs, TxnEntityMetadata } from \"@itwin/core-common\";\r\n\r\n/** The type of operation that produced a [[TxnEntityChange]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type TxnEntityChangeType = \"inserted\" | \"deleted\" | \"updated\";\r\n\r\n/** Represents a single change to a single [Entity]($backend), as part of a collection of [[TxnEntityChanges]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TxnEntityChange {\r\n /** The operation that produced the change. */\r\n type: TxnEntityChangeType;\r\n /** The Id of the affected entity. */\r\n id: Id64String;\r\n /** A representation of the BIS class of the affected entity. */\r\n metadata: TxnEntityMetadata;\r\n}\r\n\r\n/** A collection of [[TxnEntityChange]]s.\r\n * @public\r\n * @extensions\r\n */\r\nexport type TxnEntityChangeIterable = Iterable<Readonly<TxnEntityChange>>;\r\n\r\n/** A function that returns `true` if a particular BIS [Entity]($backend) class should be included when iterating a [[TxnEntityChangeIterable]].\r\n * For example, you may wish to include only elements deriving from \"BisCore:GeometricElement\", which you can determine by using [[TxnEntityMetadata.is]].\r\n * @see [[TxnEntityChangesFilterOptions.includeMetadata]] to supply such a criterion to [[TxnEntityChanges.filter]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type TxnEntityMetadataCriterion = (metadata: TxnEntityMetadata) => boolean;\r\n\r\n/** Options defining criteria by which to filter the contents of a [[TxnEntityChanges]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TxnEntityChangesFilterOptions {\r\n /** Permits filtering based on metadata. For example, you may wish to include only elements deriving from \"BisCore:GeometricElement\",\r\n * which you can determine by using [[TxnEntityMetadata.is]].\r\n * Only entities with metadata for which this function returns `true` will be included in the iteration.\r\n */\r\n includeMetadata?: TxnEntityMetadataCriterion;\r\n\r\n /** Permits filtering based on the type of change. For example, you may only care about newly-inserted entities, in which case you would specify `[\"inserted\"]`.\r\n * Only changes of the specified type(s) will be included in the iteration.\r\n */\r\n includeTypes?: TxnEntityChangeType[];\r\n}\r\n\r\n/** The frontend transaction-change payload for [[BriefcaseTxns.onElementsChanged]] and [[BriefcaseTxns.onModelsChanged]].\r\n * Iterate [[TxnEntityChange]]s to inspect their `id`, `type`, and [[TxnEntityChange.metadata]], or use [[filter]] to select by change type or class hierarchy.\r\n * Both payloads include metadata. Frontend changes also expose a per-change `type`, while backend changes are grouped into `inserts`, `deletes`, and `updates`; the compressed `inserted`, `deleted`, and `updated` sets remain available for bulk operations.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TxnEntityChanges extends TxnEntityChangeIterable {\r\n /** The ids of entities that were inserted during the Txn. */\r\n readonly inserted?: CompressedId64Set;\r\n /** The ids of entities that were deleted during the Txn. */\r\n readonly deleted?: CompressedId64Set;\r\n /** The ids of entities that were modified during the Txn, including any [Element]($backend)s for which one of their [ElementAspect]($backend)s was changed. */\r\n readonly updated?: CompressedId64Set;\r\n\r\n /** Obtain an iterator over changes meeting the criteria specified by `options`. */\r\n filter(options: TxnEntityChangesFilterOptions): TxnEntityChangeIterable;\r\n}\r\n\r\nexport class Metadata implements TxnEntityMetadata {\r\n public readonly classFullName: string;\r\n public readonly baseClasses: Metadata[] = [];\r\n\r\n public constructor(name: string) {\r\n this.classFullName = name;\r\n }\r\n\r\n public is(baseName: string): boolean {\r\n return baseName === this.classFullName || this.baseClasses.some((base) => base.is(baseName));\r\n }\r\n}\r\n\r\nfunction * entityChangesIterator(changes: EntityChanges, options?: TxnEntityChangesFilterOptions): Iterator<TxnEntityChange> {\r\n let excludedMetaIndices: Set<number> | undefined;\r\n if (options?.includeMetadata) {\r\n for (let i = 0; i < changes.metadata.length; i++) {\r\n if (!options.includeMetadata(changes.metadata[i])) {\r\n excludedMetaIndices = excludedMetaIndices ?? new Set<number>();\r\n excludedMetaIndices.add(i);\r\n }\r\n }\r\n }\r\n\r\n function * process(type: TxnEntityChangeType) {\r\n if (options?.includeTypes && !options.includeTypes.includes(type)) {\r\n return;\r\n }\r\n\r\n const ids = changes[type];\r\n if (undefined === ids) {\r\n return;\r\n }\r\n\r\n const metaIndices = changes.args[`${type}Meta`];\r\n let index = 0;\r\n for (const id of CompressedId64Set.iterable(ids)) {\r\n const metaIndex = metaIndices[index++];\r\n if (excludedMetaIndices && excludedMetaIndices.has(metaIndex)) {\r\n continue;\r\n }\r\n\r\n const metadata = changes.metadata[metaIndex];\r\n yield { type, id, metadata };\r\n }\r\n }\r\n\r\n yield* process(\"inserted\");\r\n yield* process(\"deleted\");\r\n yield* process(\"updated\");\r\n}\r\n\r\nexport class EntityChanges implements TxnEntityChanges {\r\n public readonly args: NotifyEntitiesChangedArgs;\r\n public readonly metadata: Metadata[];\r\n\r\n public constructor(args: NotifyEntitiesChangedArgs) {\r\n this.args = args;\r\n\r\n this.metadata = args.meta.map((x) => new Metadata(x.name));\r\n for (let i = 0; i < this.metadata.length; i++) {\r\n const meta = this.metadata[i];\r\n for (const baseIndex of args.meta[i].bases) {\r\n meta.baseClasses.push(this.metadata[baseIndex]);\r\n }\r\n }\r\n }\r\n\r\n public get inserted(): CompressedId64Set | undefined { return this.args.inserted; }\r\n public get deleted(): CompressedId64Set | undefined { return this.args.deleted; }\r\n public get updated(): CompressedId64Set | undefined { return this.args.updated; }\r\n\r\n public [Symbol.iterator](): Iterator<TxnEntityChange> {\r\n return entityChangesIterator(this);\r\n }\r\n\r\n public filter(options: TxnEntityChangesFilterOptions): TxnEntityChangeIterable {\r\n return {\r\n [Symbol.iterator]: () => entityChangesIterator(this, options),\r\n };\r\n }\r\n}\r\n"]}
|
package/lib/esm/ViewManager.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export declare class ViewManager implements Iterable<ScreenViewport> {
|
|
|
79
79
|
cursor: string;
|
|
80
80
|
private readonly _viewports;
|
|
81
81
|
readonly decorators: Decorator[];
|
|
82
|
+
private _selectedViewportChange;
|
|
82
83
|
private _selectedView?;
|
|
83
84
|
private _invalidateScenes;
|
|
84
85
|
private _skipSceneCreation;
|
|
@@ -136,6 +137,8 @@ export declare class ViewManager implements Iterable<ScreenViewport> {
|
|
|
136
137
|
setSelectedView(vp: ScreenViewport | undefined): Promise<BentleyStatus>;
|
|
137
138
|
/** @internal */
|
|
138
139
|
notifySelectedViewportChanged(previous: ScreenViewport | undefined, current: ScreenViewport | undefined): void;
|
|
140
|
+
/** @internal */
|
|
141
|
+
waitForSelectedViewportChange(): Promise<void>;
|
|
139
142
|
/** The "selected view" is the default for certain operations. */
|
|
140
143
|
get selectedView(): ScreenViewport | undefined;
|
|
141
144
|
/** Get the first opened view. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewManager.d.ts","sourceRoot":"","sources":["../../src/ViewManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,gBAAgB,E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OAEG;IACU,oBAAoB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC;IAQhF;;OAEG;IACU,uBAAuB,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ9F;;OAEG;IACI,qBAAqB,CAAC,GAAG,EAAE,SAAS,GAAG,mBAAmB,GAAG,SAAS;IAQ7E;;OAEG;IACU,sBAAsB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC;IAQlF;;OAEG;IACU,0BAA0B,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAQjG;;OAEG;IACI,uBAAuB,CAAC,GAAG,EAAE,SAAS,GAAG,mBAAmB,GAAG,SAAS;IAQ/E,IAAW,eAAe,IAAI,MAAM,CAA2E;IAC/G,IAAW,cAAc,IAAI,MAAM,CAAqE;IACxG,IAAW,UAAU,IAAI,MAAM,CAAqE;IACpG,IAAW,cAAc,IAAI,MAAM,CAAuE;IAC1G,IAAW,UAAU,IAAI,MAAM,CAAiE;IAChG,IAAW,YAAY,IAAI,MAAM,CAAmE;IACpG,IAAW,UAAU,IAAI,MAAM,CAAiE;IAChG,IAAW,UAAU,IAAI,MAAM,CAAiE;IAEhG;;OAEG;IACI,aAAa,CAAC,MAAM,GAAE,MAAkB;IAQ/C;;;;OAIG;IACI,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAKpE;;;;;OAKG;IACI,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAMzD"}
|
package/lib/esm/ViewManager.js
CHANGED
|
@@ -24,6 +24,7 @@ export class ViewManager {
|
|
|
24
24
|
cursor = "default";
|
|
25
25
|
_viewports = [];
|
|
26
26
|
decorators = [];
|
|
27
|
+
_selectedViewportChange = Promise.resolve();
|
|
27
28
|
_selectedView;
|
|
28
29
|
_invalidateScenes = false;
|
|
29
30
|
_skipSceneCreation = false;
|
|
@@ -151,9 +152,16 @@ export class ViewManager {
|
|
|
151
152
|
}
|
|
152
153
|
/** @internal */
|
|
153
154
|
notifySelectedViewportChanged(previous, current) {
|
|
154
|
-
IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)
|
|
155
|
+
const selectedViewportChange = IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)
|
|
156
|
+
.catch(() => undefined);
|
|
157
|
+
this._selectedViewportChange = this._selectedViewportChange.then(async () => selectedViewportChange, async () => selectedViewportChange)
|
|
158
|
+
.then(() => undefined, () => undefined);
|
|
155
159
|
this.onSelectedViewportChanged.emit({ previous, current });
|
|
156
160
|
}
|
|
161
|
+
/** @internal */
|
|
162
|
+
async waitForSelectedViewportChange() {
|
|
163
|
+
await this._selectedViewportChange;
|
|
164
|
+
}
|
|
157
165
|
/** The "selected view" is the default for certain operations. */
|
|
158
166
|
get selectedView() { return this._selectedView; }
|
|
159
167
|
/** Get the first opened view. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewManager.js","sourceRoot":"","sources":["../../src/ViewManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAe,SAAS,EAAW,MAAM,qBAAqB,CAAC;AAG9F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAY,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAiB,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAmExD;;;;;;;;GAQG;AACH,MAAM,OAAO,WAAW;IACf,cAAc,GAAG,KAAK,CAAC;IACvB,MAAM,GAAG,SAAS,CAAC;IACT,UAAU,GAAqB,EAAE,CAAC;IACnC,UAAU,GAAgB,EAAE,CAAC;IAC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AkB;QAC/C,KAAK,MAAM,EAAE,IAAI,IAAI;YACnB,EAAE,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEnC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,GAAG,UAAU,CAAC;IAChD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\nimport { BeEvent, BentleyStatus, BeTimePoint, BeUiEvent, Id64Arg } from \"@itwin/core-bentley\";\r\nimport { GeometryStreamProps } from \"@itwin/core-common\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { DisclosedTileTreeSet, TileTree } from \"./tile/internal\";\r\nimport { BeButtonEvent, EventHandled } from \"./tools/Tool\";\r\nimport { ScreenViewport, ViewportDecorator } from \"./Viewport\";\r\nimport { System } from \"./internal/render/webgl/System\";\r\n\r\n/** Interface for drawing [decoration graphics]($docs/learning/frontend/ViewDecorations.md) into, or on top of, the active [[ScreenViewport]]s managed by [[ViewManager]].\r\n * Decorators generate [[Decorations]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Decorator extends ViewportDecorator {\r\n /** If the [[decorate]] method created pickable graphics, return true if the supplied Id is from this Decorator.\r\n * @param id The Id of the currently selected pickable graphics.\r\n * @returns true if 'id' belongs to this Decorator\r\n */\r\n testDecorationHit?(id: string): boolean;\r\n\r\n /** If the [[decorate]] method created pickable graphics using a persistent element id instead of a transient id,\r\n * return true if the Decorator wants the opportunity to override the default persistent element behavior for\r\n * the supplied [[HitDetail]].\r\n * - Replace or augment the element's tooltip by implementing [[getDecorationToolTip]].\r\n * - Override the element's snap geometry by implementing [[getDecorationGeometry]].\r\n * - Handle button events as decorator events by implementing [[onDecorationButtonEvent]].\r\n * @param hit The HitDetail of the currently selected persistent element or pickable graphics using a persistent element id.\r\n * @returns true if this Decorator wants to override the default persistent element behavior.\r\n */\r\n overrideElementHit?(hit: HitDetail): boolean;\r\n\r\n /** If [[testDecorationHit]] or [[overrideElementHit]] returned true, implement this method to return the tooltip message for this Decorator.\r\n * @param hit The HitDetail about the decoration that was picked.\r\n * @returns A promise with the HTMLElement or string (that may contain HTML) with the tooltip message.\r\n */\r\n getDecorationToolTip?(hit: HitDetail): Promise<HTMLElement | string>;\r\n\r\n /** If [[testDecorationHit]] or [[overrideElementHit]] returned true, implement this method to handle a button event for this Decorator.\r\n * @param hit The HitDetail about the decoration that was picked.\r\n * @param ev The BeButtonEvent that identified this decoration.\r\n * @returns A Promise that resolves to Yes if event completely handled by decoration and event should not be processed by the calling tool.\r\n */\r\n onDecorationButtonEvent?(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled>;\r\n\r\n /** If [[testDecorationHit]] or [[overrideElementHit]] returned true, implement this method to return the snappable geometry for this Decorator. Geometry that changes with every cursor motion isn't valid for snapping.\r\n * An example would be an InteractiveTool for placing a linestring. It might wish to allow snapping to accepted segments, the segment from the last accepted point to the current cursor position would not be included\r\n * as snappable geometry and would just be displayed in dynamics.\r\n * @param hit The HitDetail about the decoration that was picked.\r\n * @returns GeometryStreamProps containing world coordinate snappable geometry for this decoration.\r\n */\r\n getDecorationGeometry?(hit: HitDetail): GeometryStreamProps | undefined;\r\n}\r\n\r\n/** Argument for [[ViewManager.onSelectedViewportChanged]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectedViewportChangedArgs {\r\n current?: ScreenViewport;\r\n previous?: ScreenViewport;\r\n}\r\n\r\n/** An object that can contribute customizations to the tooltip displayed when mousing over an element or other entity in a [[Viewport]].\r\n * @see [[ViewManager.addToolTipProvider]] to register a tooltip provider.\r\n * @public\r\n */\r\nexport interface ToolTipProvider {\r\n /** Augment or replace the tooltip for the specified HitDetail.\r\n * @note To cooperate with other tooltip providers, prefer to *append* information to the input tooltip instead of replacing it entirely.\r\n */\r\n augmentToolTip(hit: HitDetail, tooltip: Promise<HTMLElement | string>): Promise<HTMLElement | string>;\r\n}\r\n\r\n/** The ViewManager holds the list of opened views, plus the *selected view*. It also provides notifications of view open/close and suspend/resume.\r\n * Applications must call [[addViewport]] when new Viewports that should be associated with user events are created.\r\n *\r\n * A single ViewManager is created when [[IModelApp.startup]] is called. It can be accessed via the static member [[IModelApp.viewManager]].\r\n *\r\n * The ViewManager controls the render loop, which causes the contents of each registered [[Viewport]] to update on the screen.\r\n * @public\r\n * @extensions\r\n */\r\nexport class ViewManager implements Iterable<ScreenViewport> {\r\n public inDynamicsMode = false;\r\n public cursor = \"default\";\r\n private readonly _viewports: ScreenViewport[] = [];\r\n public readonly decorators: Decorator[] = [];\r\n private _selectedView?: ScreenViewport;\r\n private _invalidateScenes = false;\r\n private _skipSceneCreation = false;\r\n private _doIdleWork = false;\r\n private _idleWorkTimer?: any;\r\n\r\n /** @internal */\r\n public readonly toolTipProviders: ToolTipProvider[] = [];\r\n\r\n private _beginIdleWork() {\r\n const idleWork = () => {\r\n if (undefined === this._idleWorkTimer)\r\n return;\r\n if (this._viewports.length > 0) {\r\n this._idleWorkTimer = undefined;\r\n return;\r\n }\r\n if (IModelApp.renderSystem.doIdleWork())\r\n this._idleWorkTimer = setTimeout(idleWork, 1);\r\n else\r\n this._idleWorkTimer = undefined;\r\n };\r\n\r\n if (undefined === this._idleWorkTimer)\r\n this._idleWorkTimer = setTimeout(idleWork, 1);\r\n }\r\n\r\n /** @internal */\r\n public onInitialized() {\r\n this.addDecorator(IModelApp.accuSnap);\r\n this.addDecorator(IModelApp.tentativePoint);\r\n this.addDecorator(IModelApp.accuDraw);\r\n this.addDecorator(IModelApp.toolAdmin);\r\n this.cursor = \"default\";\r\n\r\n const options = IModelApp.renderSystem.options;\r\n this._doIdleWork = true === options.doIdleWork;\r\n if (this._doIdleWork)\r\n this._beginIdleWork();\r\n }\r\n\r\n /** @internal */\r\n public onShutDown() {\r\n if (undefined !== this._idleWorkTimer) {\r\n clearTimeout(this._idleWorkTimer);\r\n this._idleWorkTimer = undefined;\r\n }\r\n this._viewports.map((viewport) => {\r\n if (!viewport.isDisposed)\r\n this.dropViewport(viewport, true);\r\n });\r\n this._viewports.length = 0;\r\n this.decorators.length = 0;\r\n this.toolTipProviders.length = 0;\r\n this._selectedView = undefined;\r\n }\r\n\r\n /** Returns true if the specified viewport is currently being managed by this ViewManager.\r\n * @see [[addViewport]] to enable management of a viewport and [[dropViewport]] to disable it.\r\n */\r\n public hasViewport(viewport: ScreenViewport) {\r\n return this._viewports.includes(viewport);\r\n }\r\n\r\n /** Called after the selected view changes.\r\n * @param old Previously selected viewport.\r\n * @param current Currently selected viewport.\r\n */\r\n public readonly onSelectedViewportChanged = new BeUiEvent<SelectedViewportChangedArgs>();\r\n\r\n /** Called after a view is opened. This can happen when the iModel is first opened or when a user opens a new view. */\r\n public readonly onViewOpen = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called after a view is closed. This can happen when the iModel is closed or when a user closes an open view. */\r\n public readonly onViewClose = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called after a view is suspended. This happens when the application is minimized or, on a tablet, when the application\r\n * is moved to the background.\r\n */\r\n public readonly onViewSuspend = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called after a suspended view is resumed. This can happen when a minimized application is restored\r\n * or, on a tablet, when the application is moved to the foreground.\r\n */\r\n public readonly onViewResume = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called at the beginning of each tick of the render loop, before any viewports have been updated.\r\n * The render loop is typically invoked by a requestAnimationFrame() callback. It will not be invoked if the ViewManager is tracking no viewports.\r\n * @note Due to the frequency of this event, avoid performing expensive work inside event listeners.\r\n * @see [[ViewManager.onFinishRender]]\r\n */\r\n public readonly onBeginRender = new BeEvent<() => void>();\r\n\r\n /** Called at the end of each tick of the render loop, after all viewports have been updated.\r\n * The render loop is typically invoked by a requestAnimationFrame() callback. It will not be invoked if the ViewManager is tracking no viewports.\r\n * @note Due to the frequency of this event, avoid performing expensive work inside event listeners.\r\n * @see [[ViewManager.onBeginRender]]\r\n */\r\n public readonly onFinishRender = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n public endDynamicsMode(): void {\r\n if (!this.inDynamicsMode)\r\n return;\r\n\r\n this.inDynamicsMode = false;\r\n\r\n const cursorVp = IModelApp.toolAdmin.cursorView;\r\n if (cursorVp)\r\n cursorVp.changeDynamics(undefined, undefined);\r\n\r\n for (const vp of this._viewports) {\r\n if (vp !== cursorVp)\r\n vp.changeDynamics(undefined, undefined);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public beginDynamicsMode() { this.inDynamicsMode = true; }\r\n\r\n /** @internal */\r\n public get doesHostHaveFocus(): boolean { return document.hasFocus(); }\r\n\r\n /** Set the selected [[Viewport]] to undefined. */\r\n public clearSelectedView(): void {\r\n const previousVp = this.selectedView;\r\n this._selectedView = undefined;\r\n this.notifySelectedViewportChanged(previousVp, undefined);\r\n }\r\n\r\n /** Sets the selected [[Viewport]]. */\r\n public async setSelectedView(vp: ScreenViewport | undefined): Promise<BentleyStatus> {\r\n if (undefined === vp)\r\n vp = this.getFirstOpenView();\r\n\r\n if (vp === this.selectedView) // already the selected view\r\n return BentleyStatus.SUCCESS;\r\n\r\n if (undefined === vp) {\r\n this.clearSelectedView();\r\n return BentleyStatus.ERROR;\r\n }\r\n\r\n const previousVp = this.selectedView;\r\n this._selectedView = vp;\r\n\r\n this.notifySelectedViewportChanged(previousVp, vp);\r\n\r\n if (undefined === previousVp)\r\n await IModelApp.toolAdmin.startDefaultTool();\r\n\r\n return BentleyStatus.SUCCESS;\r\n }\r\n\r\n /** @internal */\r\n public notifySelectedViewportChanged(previous: ScreenViewport | undefined, current: ScreenViewport | undefined) {\r\n IModelApp.toolAdmin.onSelectedViewportChanged(previous, current);// eslint-disable-line @typescript-eslint/no-floating-promises\r\n this.onSelectedViewportChanged.emit({ previous, current });\r\n }\r\n\r\n /** The \"selected view\" is the default for certain operations. */\r\n public get selectedView(): ScreenViewport | undefined { return this._selectedView; }\r\n\r\n /** Get the first opened view. */\r\n public getFirstOpenView(): ScreenViewport | undefined { return this._viewports.length > 0 ? this._viewports[0] : undefined; }\r\n\r\n /** Check if only a single viewport is being used. If so, render directly on-screen using its WebGL canvas. Otherwise, render each view offscreen.\r\n * @internal\r\n */\r\n protected updateRenderToScreen() {\r\n const renderToScreen = 1 === this._viewports.length;\r\n for (const vp of this)\r\n vp.rendersToScreen = renderToScreen;\r\n }\r\n\r\n /** Add a new Viewport to the list of opened views and create an EventController for it.\r\n * @param newVp the Viewport to add\r\n * @returns SUCCESS if vp was successfully added, ERROR if it was already present.\r\n * @note raises onViewOpen event with newVp.\r\n */\r\n public addViewport(newVp: ScreenViewport): BentleyStatus {\r\n if (this.hasViewport(newVp)) // make sure its not already added\r\n return BentleyStatus.ERROR;\r\n\r\n newVp.onViewManagerAdd();\r\n\r\n this._viewports.push(newVp);\r\n this.updateRenderToScreen();\r\n this.setSelectedView(newVp);// eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n // Start up the render loop if necessary.\r\n if (1 === this._viewports.length)\r\n IModelApp.startEventLoop();\r\n\r\n this.onViewOpen.emit(newVp);\r\n\r\n return BentleyStatus.SUCCESS;\r\n }\r\n\r\n /** Remove a Viewport from the list of opened views, and optionally dispose of it.\r\n * Typically a Viewport is dropped when it is no longer of any use to the application, in which case it should also be\r\n * disposed of as it may hold significant GPU resources.\r\n * However in some cases a Viewport may be temporarily dropped to suspend rendering; and subsequently re-added to\r\n * resume rendering - for example, when the Viewport is temporarily hidden by other UI elements.\r\n * In the latter case it is up to the caller to ensure the Viewport is properly disposed of when it is no longer needed.\r\n * Attempting to invoke any function on a Viewport after it has been disposed is an error.\r\n * @param vp the Viewport to remove.\r\n * @param disposeOfViewport Whether or not to dispose of the Viewport. Defaults to true.\r\n * @return SUCCESS if vp was successfully removed, ERROR if it was not present.\r\n * @note raises onViewClose event with vp.\r\n */\r\n public dropViewport(vp: ScreenViewport, disposeOfViewport: boolean = true): BentleyStatus {\r\n const index = this._viewports.indexOf(vp);\r\n if (index === -1)\r\n return BentleyStatus.ERROR;\r\n\r\n this.onViewClose.emit(vp);\r\n\r\n // make sure tools don't think the cursor is still in this viewport\r\n IModelApp.toolAdmin.forgetViewport(vp);\r\n\r\n vp.onViewManagerDrop();\r\n\r\n this._viewports.splice(index, 1);\r\n\r\n if (this.selectedView === vp) // if removed viewport was selectedView, set it to undefined.\r\n this.setSelectedView(undefined);// eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n vp.rendersToScreen = false;\r\n this.updateRenderToScreen();\r\n\r\n if (disposeOfViewport)\r\n vp[Symbol.dispose]();\r\n\r\n if (this._doIdleWork && this._viewports.length === 0)\r\n this._beginIdleWork();\r\n\r\n return BentleyStatus.SUCCESS;\r\n }\r\n\r\n /** Iterate over the viewports registered with the view manager. */\r\n public [Symbol.iterator](): Iterator<ScreenViewport> {\r\n return this._viewports[Symbol.iterator]();\r\n }\r\n\r\n /** Instruct each registered [[Viewport]] that the cached [[Decorations]] for the specified `decorator` should be discarded and recreated on the next frame.\r\n * @see [[Viewport.invalidateCachedDecorations]] to invalidate the cached decorations for a single viewport.\r\n */\r\n public invalidateCachedDecorationsAllViews(decorator: ViewportDecorator): void {\r\n if (decorator.useCachedDecorations)\r\n for (const vp of this)\r\n vp.invalidateCachedDecorations(decorator);\r\n }\r\n\r\n /** Force each registered [[Viewport]] to regenerate its [[Decorations]] on the next frame. */\r\n public invalidateDecorationsAllViews(): void {\r\n for (const vp of this)\r\n vp.invalidateDecorations();\r\n }\r\n\r\n /** Force each registered [[Viewport]] to regenerate its [[FeatureSymbology.Overrides]] on the next frame.\r\n * This is rarely needed - viewports keep track of their own states to detect when the overrides need to be recreated.\r\n */\r\n public invalidateSymbologyOverridesAllViews(): void {\r\n for (const vp of this)\r\n vp.setFeatureOverrideProviderChanged();\r\n }\r\n\r\n /** @internal */\r\n public onSelectionSetChanged(_iModel: IModelConnection) {\r\n for (const vp of this)\r\n vp.markSelectionSetDirty();\r\n\r\n IModelApp.requestNextAnimation();\r\n }\r\n\r\n /** @internal */\r\n public invalidateViewportScenes(): void {\r\n for (const vp of this)\r\n vp.invalidateScene();\r\n }\r\n\r\n /** @internal */\r\n public validateViewportScenes(): void {\r\n for (const vp of this)\r\n vp.setValidScene();\r\n }\r\n\r\n /** Requests that [[Viewport.createScene]] be invoked for every viewport on the next frame.\r\n * This is rarely useful - viewports keep track of their own states to detect when the scene needs to be recreated.\r\n */\r\n public invalidateScenes(): void {\r\n this._invalidateScenes = true;\r\n IModelApp.requestNextAnimation();\r\n }\r\n\r\n /** @internal */\r\n public get sceneInvalidated(): boolean { return this._invalidateScenes; }\r\n\r\n /** Invoked by ToolAdmin event loop.\r\n * @internal\r\n */\r\n public renderLoop(): void {\r\n if (0 === this._viewports.length)\r\n return;\r\n if (this._skipSceneCreation)\r\n this.validateViewportScenes();\r\n else if (this._invalidateScenes)\r\n this.invalidateViewportScenes();\r\n\r\n this._invalidateScenes = false;\r\n\r\n this.onBeginRender.raiseEvent();\r\n\r\n for (const vp of this._viewports)\r\n vp.renderFrame();\r\n\r\n this.onFinishRender.raiseEvent();\r\n }\r\n\r\n /** Purge TileTrees that haven't been drawn since the specified time point and are not currently in use by any ScreenViewport.\r\n * Intended strictly for debugging purposes - TileAdmin takes care of properly purging.\r\n * @internal\r\n */\r\n public purgeTileTrees(olderThan: BeTimePoint): void {\r\n // A single viewport can display tiles from more than one IModelConnection.\r\n // NOTE: A viewport may be displaying no trees - but we need to record its IModel so we can purge those which are NOT being displayed\r\n // NOTE: That won't catch external tile trees previously used by that viewport.\r\n const trees = new DisclosedTileTreeSet();\r\n const treesByIModel = new Map<IModelConnection, Set<TileTree>>();\r\n for (const vp of this._viewports) {\r\n vp.discloseTileTrees(trees);\r\n if (undefined === treesByIModel.get(vp.iModel))\r\n treesByIModel.set(vp.iModel, new Set<TileTree>());\r\n }\r\n\r\n for (const tree of trees) {\r\n let set = treesByIModel.get(tree.iModel);\r\n if (undefined === set) {\r\n set = new Set<TileTree>();\r\n treesByIModel.set(tree.iModel, set);\r\n }\r\n\r\n set.add(tree);\r\n }\r\n\r\n for (const entry of treesByIModel) {\r\n const iModel = entry[0];\r\n iModel.tiles.purge(olderThan, entry[1]);\r\n }\r\n }\r\n\r\n /** Compute the tooltip for a persistent element.\r\n * This method calls the backend method [Element.getToolTipMessage]($backend), and replaces all instances of `${localizeTag}` with localized string from IModelApp.i18n.\r\n */\r\n public async getElementToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n const msg: string[] = await hit.iModel.getToolTipMessage(hit.sourceId); // wait for the locate message(s) from the backend\r\n return IModelApp.formatElementToolTip(msg);\r\n }\r\n\r\n /** Register a new [[ToolTipProvider]] to customize the locate tooltip.\r\n * @param provider The new tooltip provider to add.\r\n * @throws Error if `provider` is already registered.\r\n * @returns a function that may be called to remove this provider (in lieu of calling [[dropToolTipProvider]].)\r\n */\r\n public addToolTipProvider(provider: ToolTipProvider): () => void {\r\n if (this.toolTipProviders.includes(provider))\r\n throw new Error(\"tooltip provider already registered\");\r\n\r\n this.toolTipProviders.push(provider);\r\n return () => this.dropToolTipProvider(provider);\r\n }\r\n\r\n /** Drop (remove) a [[ToolTipProvider]] so it is no longer active.\r\n * @param provider The tooltip provider to drop.\r\n * @note Does nothing if provider is not currently active.\r\n */\r\n public dropToolTipProvider(provider: ToolTipProvider) {\r\n const index = this.toolTipProviders.indexOf(provider);\r\n if (index >= 0)\r\n this.toolTipProviders.splice(index, 1);\r\n }\r\n\r\n /** Add a new [[Decorator]] to display decorations into the active views.\r\n * @param decorator The new decorator to add.\r\n * @throws Error if decorator is already active.\r\n * @returns a function that may be called to remove this decorator (in lieu of calling [[dropDecorator]].)\r\n * @see [[dropDecorator]]\r\n */\r\n public addDecorator(decorator: Decorator): () => void {\r\n if (this.decorators.includes(decorator))\r\n throw new Error(\"decorator already registered\");\r\n\r\n this.decorators.push(decorator);\r\n this.invalidateDecorationsAllViews();\r\n return () => this.dropDecorator(decorator);\r\n }\r\n\r\n /** Drop (remove) a [[Decorator]] so it is no longer active.\r\n * @param decorator The Decorator to drop.\r\n * @returns true if the decorator was found and removed; false if the decorator was not found.\r\n */\r\n public dropDecorator(decorator: Decorator): boolean {\r\n const index = this.decorators.indexOf(decorator);\r\n if (index < 0)\r\n return false;\r\n\r\n this.invalidateCachedDecorationsAllViews(decorator);\r\n this.decorators.splice(index, 1);\r\n this.invalidateDecorationsAllViews();\r\n return true;\r\n }\r\n\r\n /** Get the tooltip for a pickable decoration.\r\n * @internal\r\n */\r\n public async getDecorationToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n for (const decorator of this.decorators) {\r\n if (undefined !== decorator.testDecorationHit && undefined !== decorator.getDecorationToolTip && decorator.testDecorationHit(hit.sourceId))\r\n return decorator.getDecorationToolTip(hit);\r\n }\r\n return hit.viewport ? hit.viewport.getToolTip(hit) : \"\";\r\n }\r\n\r\n /** Allow a pickable decoration to handle a button event that identified it for the SelectTool.\r\n * @internal\r\n */\r\n public async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.testDecorationHit && undefined !== decorator.onDecorationButtonEvent && decorator.testDecorationHit(hit.sourceId))\r\n return decorator.onDecorationButtonEvent(hit, ev);\r\n }\r\n return EventHandled.No;\r\n }\r\n\r\n /** Allow a pickable decoration to be snapped to by AccuSnap or TentativePoint.\r\n * @internal\r\n */\r\n public getDecorationGeometry(hit: HitDetail): GeometryStreamProps | undefined {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.testDecorationHit && undefined !== decorator.getDecorationGeometry && decorator.testDecorationHit(hit.sourceId))\r\n return decorator.getDecorationGeometry(hit);\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Allow a pickable decoration created using a persistent element id to augment or replace the the persistent element's tooltip.\r\n * @internal\r\n */\r\n public async overrideElementToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n for (const decorator of this.decorators) {\r\n if (undefined !== decorator.overrideElementHit && undefined !== decorator.getDecorationToolTip && decorator.overrideElementHit(hit))\r\n return decorator.getDecorationToolTip(hit);\r\n }\r\n return this.getElementToolTip(hit);\r\n }\r\n\r\n /** Allow a pickable decoration created using a persistent element id to handle a button event that identified it for the SelectTool.\r\n * @internal\r\n */\r\n public async overrideElementButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.overrideElementHit && undefined !== decorator.onDecorationButtonEvent && decorator.overrideElementHit(hit))\r\n return decorator.onDecorationButtonEvent(hit, ev);\r\n }\r\n return EventHandled.No;\r\n }\r\n\r\n /** Allow a pickable decoration created using a persistent element id to control whether snapping uses the persistent element's geometry.\r\n * @internal\r\n */\r\n public overrideElementGeometry(hit: HitDetail): GeometryStreamProps | undefined {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.overrideElementHit && undefined !== decorator.getDecorationGeometry && decorator.overrideElementHit(hit))\r\n return decorator.getDecorationGeometry(hit);\r\n }\r\n return undefined;\r\n }\r\n\r\n public get crossHairCursor(): string { return `url(${IModelApp.publicPath}cursors/crosshair.cur), crosshair`; }\r\n public get dynamicsCursor(): string { return `url(${IModelApp.publicPath}cursors/dynamics.cur), move`; }\r\n public get grabCursor(): string { return `url(${IModelApp.publicPath}cursors/openHand.cur), auto`; }\r\n public get grabbingCursor(): string { return `url(${IModelApp.publicPath}cursors/closedHand.cur), auto`; }\r\n public get walkCursor(): string { return `url(${IModelApp.publicPath}cursors/walk.cur), auto`; }\r\n public get rotateCursor(): string { return `url(${IModelApp.publicPath}cursors/rotate.cur), auto`; }\r\n public get lookCursor(): string { return `url(${IModelApp.publicPath}cursors/look.cur), auto`; }\r\n public get zoomCursor(): string { return `url(${IModelApp.publicPath}cursors/zoom.cur), auto`; }\r\n\r\n /** Change the cursor shown in all Viewports.\r\n * @param cursor The new cursor to display. If undefined, the default cursor is used.\r\n */\r\n public setViewCursor(cursor: string = \"default\") {\r\n if (cursor === this.cursor)\r\n return;\r\n this.cursor = cursor;\r\n for (const vp of this._viewports)\r\n vp.setCursor(cursor);\r\n }\r\n\r\n /** Intended strictly as a temporary solution for interactive editing applications, until official support for such apps is implemented.\r\n * Call this after editing one or more models, passing in the Ids of those models, to cause new tiles to be generated reflecting the changes.\r\n * Pass undefined if you are unsure which models changed (this is less efficient as it discards all tiles for all viewed models in all viewports).\r\n * @internal\r\n */\r\n public refreshForModifiedModels(modelIds: Id64Arg | undefined): void {\r\n for (const vp of this._viewports)\r\n vp.refreshForModifiedModels(modelIds);\r\n }\r\n\r\n /** Sets the number of [MSAA]($docs/learning/display/MSAA.md) samples for all currently- and subsequently-opened [[ScreenViewport]]s.\r\n * @param numSamples The number of samples as a power of two. Values of 1 or less indicates anti-aliasing should be disabled. Non-power-of-two values are rounded\r\n * down to the nearest power of two. The maximum number of samples supported depends upon the client's graphics hardware capabilities. Higher values produce\r\n * a higher-quality image but also may also reduce framerate.\r\n * @see [[Viewport.antialiasSamples]] to adjust the number of samples for a specific viewport.\r\n */\r\n public setAntialiasingAllViews(numSamples: number): void {\r\n for (const vp of this)\r\n vp.antialiasSamples = numSamples;\r\n\r\n System.instance.antialiasSamples = numSamples;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewManager.js","sourceRoot":"","sources":["../../src/ViewManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAe,SAAS,EAAW,MAAM,qBAAqB,CAAC;AAG9F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAY,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAiB,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,MAA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2B,CAAC,CAAC,CAAC;IACpG,IAAW,UAAU,KAAa,OAAO,OAAO,SAAS,CAAC,UAAU,yBAAyB,CAAC,CAAC,CAAC;IAChG,IAAW,UAAU,KAAa,OAAO,OAAO,SAAS,CAAC,UAAU,yBAAyB,CAAC,CAAC,CAAC;IAEhG;;OAEG;IACI,aAAa,CAAC,SAAiB,SAAS;QAC7C,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM;YACxB,OAAO;QACT,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU;YAC9B,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACI,wBAAwB,CAAC,QAA6B;QAC3D,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU;YAC9B,EAAE,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,uBAAuB,CAAC,UAAkB;QAC/C,KAAK,MAAM,EAAE,IAAI,IAAI;YACnB,EAAE,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEnC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,GAAG,UAAU,CAAC;IAChD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\nimport { BeEvent, BentleyStatus, BeTimePoint, BeUiEvent, Id64Arg } from \"@itwin/core-bentley\";\r\nimport { GeometryStreamProps } from \"@itwin/core-common\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { DisclosedTileTreeSet, TileTree } from \"./tile/internal\";\r\nimport { BeButtonEvent, EventHandled } from \"./tools/Tool\";\r\nimport { ScreenViewport, ViewportDecorator } from \"./Viewport\";\r\nimport { System } from \"./internal/render/webgl/System\";\r\n\r\n/** Interface for drawing [decoration graphics]($docs/learning/frontend/ViewDecorations.md) into, or on top of, the active [[ScreenViewport]]s managed by [[ViewManager]].\r\n * Decorators generate [[Decorations]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Decorator extends ViewportDecorator {\r\n /** If the [[decorate]] method created pickable graphics, return true if the supplied Id is from this Decorator.\r\n * @param id The Id of the currently selected pickable graphics.\r\n * @returns true if 'id' belongs to this Decorator\r\n */\r\n testDecorationHit?(id: string): boolean;\r\n\r\n /** If the [[decorate]] method created pickable graphics using a persistent element id instead of a transient id,\r\n * return true if the Decorator wants the opportunity to override the default persistent element behavior for\r\n * the supplied [[HitDetail]].\r\n * - Replace or augment the element's tooltip by implementing [[getDecorationToolTip]].\r\n * - Override the element's snap geometry by implementing [[getDecorationGeometry]].\r\n * - Handle button events as decorator events by implementing [[onDecorationButtonEvent]].\r\n * @param hit The HitDetail of the currently selected persistent element or pickable graphics using a persistent element id.\r\n * @returns true if this Decorator wants to override the default persistent element behavior.\r\n */\r\n overrideElementHit?(hit: HitDetail): boolean;\r\n\r\n /** If [[testDecorationHit]] or [[overrideElementHit]] returned true, implement this method to return the tooltip message for this Decorator.\r\n * @param hit The HitDetail about the decoration that was picked.\r\n * @returns A promise with the HTMLElement or string (that may contain HTML) with the tooltip message.\r\n */\r\n getDecorationToolTip?(hit: HitDetail): Promise<HTMLElement | string>;\r\n\r\n /** If [[testDecorationHit]] or [[overrideElementHit]] returned true, implement this method to handle a button event for this Decorator.\r\n * @param hit The HitDetail about the decoration that was picked.\r\n * @param ev The BeButtonEvent that identified this decoration.\r\n * @returns A Promise that resolves to Yes if event completely handled by decoration and event should not be processed by the calling tool.\r\n */\r\n onDecorationButtonEvent?(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled>;\r\n\r\n /** If [[testDecorationHit]] or [[overrideElementHit]] returned true, implement this method to return the snappable geometry for this Decorator. Geometry that changes with every cursor motion isn't valid for snapping.\r\n * An example would be an InteractiveTool for placing a linestring. It might wish to allow snapping to accepted segments, the segment from the last accepted point to the current cursor position would not be included\r\n * as snappable geometry and would just be displayed in dynamics.\r\n * @param hit The HitDetail about the decoration that was picked.\r\n * @returns GeometryStreamProps containing world coordinate snappable geometry for this decoration.\r\n */\r\n getDecorationGeometry?(hit: HitDetail): GeometryStreamProps | undefined;\r\n}\r\n\r\n/** Argument for [[ViewManager.onSelectedViewportChanged]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SelectedViewportChangedArgs {\r\n current?: ScreenViewport;\r\n previous?: ScreenViewport;\r\n}\r\n\r\n/** An object that can contribute customizations to the tooltip displayed when mousing over an element or other entity in a [[Viewport]].\r\n * @see [[ViewManager.addToolTipProvider]] to register a tooltip provider.\r\n * @public\r\n */\r\nexport interface ToolTipProvider {\r\n /** Augment or replace the tooltip for the specified HitDetail.\r\n * @note To cooperate with other tooltip providers, prefer to *append* information to the input tooltip instead of replacing it entirely.\r\n */\r\n augmentToolTip(hit: HitDetail, tooltip: Promise<HTMLElement | string>): Promise<HTMLElement | string>;\r\n}\r\n\r\n/** The ViewManager holds the list of opened views, plus the *selected view*. It also provides notifications of view open/close and suspend/resume.\r\n * Applications must call [[addViewport]] when new Viewports that should be associated with user events are created.\r\n *\r\n * A single ViewManager is created when [[IModelApp.startup]] is called. It can be accessed via the static member [[IModelApp.viewManager]].\r\n *\r\n * The ViewManager controls the render loop, which causes the contents of each registered [[Viewport]] to update on the screen.\r\n * @public\r\n * @extensions\r\n */\r\nexport class ViewManager implements Iterable<ScreenViewport> {\r\n public inDynamicsMode = false;\r\n public cursor = \"default\";\r\n private readonly _viewports: ScreenViewport[] = [];\r\n public readonly decorators: Decorator[] = [];\r\n private _selectedViewportChange: Promise<void> = Promise.resolve();\r\n private _selectedView?: ScreenViewport;\r\n private _invalidateScenes = false;\r\n private _skipSceneCreation = false;\r\n private _doIdleWork = false;\r\n private _idleWorkTimer?: any;\r\n\r\n /** @internal */\r\n public readonly toolTipProviders: ToolTipProvider[] = [];\r\n\r\n private _beginIdleWork() {\r\n const idleWork = () => {\r\n if (undefined === this._idleWorkTimer)\r\n return;\r\n if (this._viewports.length > 0) {\r\n this._idleWorkTimer = undefined;\r\n return;\r\n }\r\n if (IModelApp.renderSystem.doIdleWork())\r\n this._idleWorkTimer = setTimeout(idleWork, 1);\r\n else\r\n this._idleWorkTimer = undefined;\r\n };\r\n\r\n if (undefined === this._idleWorkTimer)\r\n this._idleWorkTimer = setTimeout(idleWork, 1);\r\n }\r\n\r\n /** @internal */\r\n public onInitialized() {\r\n this.addDecorator(IModelApp.accuSnap);\r\n this.addDecorator(IModelApp.tentativePoint);\r\n this.addDecorator(IModelApp.accuDraw);\r\n this.addDecorator(IModelApp.toolAdmin);\r\n this.cursor = \"default\";\r\n\r\n const options = IModelApp.renderSystem.options;\r\n this._doIdleWork = true === options.doIdleWork;\r\n if (this._doIdleWork)\r\n this._beginIdleWork();\r\n }\r\n\r\n /** @internal */\r\n public onShutDown() {\r\n if (undefined !== this._idleWorkTimer) {\r\n clearTimeout(this._idleWorkTimer);\r\n this._idleWorkTimer = undefined;\r\n }\r\n this._viewports.map((viewport) => {\r\n if (!viewport.isDisposed)\r\n this.dropViewport(viewport, true);\r\n });\r\n this._viewports.length = 0;\r\n this.decorators.length = 0;\r\n this.toolTipProviders.length = 0;\r\n this._selectedView = undefined;\r\n }\r\n\r\n /** Returns true if the specified viewport is currently being managed by this ViewManager.\r\n * @see [[addViewport]] to enable management of a viewport and [[dropViewport]] to disable it.\r\n */\r\n public hasViewport(viewport: ScreenViewport) {\r\n return this._viewports.includes(viewport);\r\n }\r\n\r\n /** Called after the selected view changes.\r\n * @param old Previously selected viewport.\r\n * @param current Currently selected viewport.\r\n */\r\n public readonly onSelectedViewportChanged = new BeUiEvent<SelectedViewportChangedArgs>();\r\n\r\n /** Called after a view is opened. This can happen when the iModel is first opened or when a user opens a new view. */\r\n public readonly onViewOpen = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called after a view is closed. This can happen when the iModel is closed or when a user closes an open view. */\r\n public readonly onViewClose = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called after a view is suspended. This happens when the application is minimized or, on a tablet, when the application\r\n * is moved to the background.\r\n */\r\n public readonly onViewSuspend = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called after a suspended view is resumed. This can happen when a minimized application is restored\r\n * or, on a tablet, when the application is moved to the foreground.\r\n */\r\n public readonly onViewResume = new BeUiEvent<ScreenViewport>();\r\n\r\n /** Called at the beginning of each tick of the render loop, before any viewports have been updated.\r\n * The render loop is typically invoked by a requestAnimationFrame() callback. It will not be invoked if the ViewManager is tracking no viewports.\r\n * @note Due to the frequency of this event, avoid performing expensive work inside event listeners.\r\n * @see [[ViewManager.onFinishRender]]\r\n */\r\n public readonly onBeginRender = new BeEvent<() => void>();\r\n\r\n /** Called at the end of each tick of the render loop, after all viewports have been updated.\r\n * The render loop is typically invoked by a requestAnimationFrame() callback. It will not be invoked if the ViewManager is tracking no viewports.\r\n * @note Due to the frequency of this event, avoid performing expensive work inside event listeners.\r\n * @see [[ViewManager.onBeginRender]]\r\n */\r\n public readonly onFinishRender = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n public endDynamicsMode(): void {\r\n if (!this.inDynamicsMode)\r\n return;\r\n\r\n this.inDynamicsMode = false;\r\n\r\n const cursorVp = IModelApp.toolAdmin.cursorView;\r\n if (cursorVp)\r\n cursorVp.changeDynamics(undefined, undefined);\r\n\r\n for (const vp of this._viewports) {\r\n if (vp !== cursorVp)\r\n vp.changeDynamics(undefined, undefined);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public beginDynamicsMode() { this.inDynamicsMode = true; }\r\n\r\n /** @internal */\r\n public get doesHostHaveFocus(): boolean { return document.hasFocus(); }\r\n\r\n /** Set the selected [[Viewport]] to undefined. */\r\n public clearSelectedView(): void {\r\n const previousVp = this.selectedView;\r\n this._selectedView = undefined;\r\n this.notifySelectedViewportChanged(previousVp, undefined);\r\n }\r\n\r\n /** Sets the selected [[Viewport]]. */\r\n public async setSelectedView(vp: ScreenViewport | undefined): Promise<BentleyStatus> {\r\n if (undefined === vp)\r\n vp = this.getFirstOpenView();\r\n\r\n if (vp === this.selectedView) // already the selected view\r\n return BentleyStatus.SUCCESS;\r\n\r\n if (undefined === vp) {\r\n this.clearSelectedView();\r\n return BentleyStatus.ERROR;\r\n }\r\n\r\n const previousVp = this.selectedView;\r\n this._selectedView = vp;\r\n\r\n this.notifySelectedViewportChanged(previousVp, vp);\r\n\r\n if (undefined === previousVp)\r\n await IModelApp.toolAdmin.startDefaultTool();\r\n\r\n return BentleyStatus.SUCCESS;\r\n }\r\n\r\n /** @internal */\r\n public notifySelectedViewportChanged(previous: ScreenViewport | undefined, current: ScreenViewport | undefined) {\r\n const selectedViewportChange = IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)\r\n .catch(() => undefined);\r\n this._selectedViewportChange = this._selectedViewportChange.then(async () => selectedViewportChange, async () => selectedViewportChange)\r\n .then(() => undefined, () => undefined);\r\n this.onSelectedViewportChanged.emit({ previous, current });\r\n }\r\n\r\n /** @internal */\r\n public async waitForSelectedViewportChange(): Promise<void> {\r\n await this._selectedViewportChange;\r\n }\r\n\r\n /** The \"selected view\" is the default for certain operations. */\r\n public get selectedView(): ScreenViewport | undefined { return this._selectedView; }\r\n\r\n /** Get the first opened view. */\r\n public getFirstOpenView(): ScreenViewport | undefined { return this._viewports.length > 0 ? this._viewports[0] : undefined; }\r\n\r\n /** Check if only a single viewport is being used. If so, render directly on-screen using its WebGL canvas. Otherwise, render each view offscreen.\r\n * @internal\r\n */\r\n protected updateRenderToScreen() {\r\n const renderToScreen = 1 === this._viewports.length;\r\n for (const vp of this)\r\n vp.rendersToScreen = renderToScreen;\r\n }\r\n\r\n /** Add a new Viewport to the list of opened views and create an EventController for it.\r\n * @param newVp the Viewport to add\r\n * @returns SUCCESS if vp was successfully added, ERROR if it was already present.\r\n * @note raises onViewOpen event with newVp.\r\n */\r\n public addViewport(newVp: ScreenViewport): BentleyStatus {\r\n if (this.hasViewport(newVp)) // make sure its not already added\r\n return BentleyStatus.ERROR;\r\n\r\n newVp.onViewManagerAdd();\r\n\r\n this._viewports.push(newVp);\r\n this.updateRenderToScreen();\r\n this.setSelectedView(newVp);// eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n // Start up the render loop if necessary.\r\n if (1 === this._viewports.length)\r\n IModelApp.startEventLoop();\r\n\r\n this.onViewOpen.emit(newVp);\r\n\r\n return BentleyStatus.SUCCESS;\r\n }\r\n\r\n /** Remove a Viewport from the list of opened views, and optionally dispose of it.\r\n * Typically a Viewport is dropped when it is no longer of any use to the application, in which case it should also be\r\n * disposed of as it may hold significant GPU resources.\r\n * However in some cases a Viewport may be temporarily dropped to suspend rendering; and subsequently re-added to\r\n * resume rendering - for example, when the Viewport is temporarily hidden by other UI elements.\r\n * In the latter case it is up to the caller to ensure the Viewport is properly disposed of when it is no longer needed.\r\n * Attempting to invoke any function on a Viewport after it has been disposed is an error.\r\n * @param vp the Viewport to remove.\r\n * @param disposeOfViewport Whether or not to dispose of the Viewport. Defaults to true.\r\n * @return SUCCESS if vp was successfully removed, ERROR if it was not present.\r\n * @note raises onViewClose event with vp.\r\n */\r\n public dropViewport(vp: ScreenViewport, disposeOfViewport: boolean = true): BentleyStatus {\r\n const index = this._viewports.indexOf(vp);\r\n if (index === -1)\r\n return BentleyStatus.ERROR;\r\n\r\n this.onViewClose.emit(vp);\r\n\r\n // make sure tools don't think the cursor is still in this viewport\r\n IModelApp.toolAdmin.forgetViewport(vp);\r\n\r\n vp.onViewManagerDrop();\r\n\r\n this._viewports.splice(index, 1);\r\n\r\n if (this.selectedView === vp) // if removed viewport was selectedView, set it to undefined.\r\n this.setSelectedView(undefined);// eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n vp.rendersToScreen = false;\r\n this.updateRenderToScreen();\r\n\r\n if (disposeOfViewport)\r\n vp[Symbol.dispose]();\r\n\r\n if (this._doIdleWork && this._viewports.length === 0)\r\n this._beginIdleWork();\r\n\r\n return BentleyStatus.SUCCESS;\r\n }\r\n\r\n /** Iterate over the viewports registered with the view manager. */\r\n public [Symbol.iterator](): Iterator<ScreenViewport> {\r\n return this._viewports[Symbol.iterator]();\r\n }\r\n\r\n /** Instruct each registered [[Viewport]] that the cached [[Decorations]] for the specified `decorator` should be discarded and recreated on the next frame.\r\n * @see [[Viewport.invalidateCachedDecorations]] to invalidate the cached decorations for a single viewport.\r\n */\r\n public invalidateCachedDecorationsAllViews(decorator: ViewportDecorator): void {\r\n if (decorator.useCachedDecorations)\r\n for (const vp of this)\r\n vp.invalidateCachedDecorations(decorator);\r\n }\r\n\r\n /** Force each registered [[Viewport]] to regenerate its [[Decorations]] on the next frame. */\r\n public invalidateDecorationsAllViews(): void {\r\n for (const vp of this)\r\n vp.invalidateDecorations();\r\n }\r\n\r\n /** Force each registered [[Viewport]] to regenerate its [[FeatureSymbology.Overrides]] on the next frame.\r\n * This is rarely needed - viewports keep track of their own states to detect when the overrides need to be recreated.\r\n */\r\n public invalidateSymbologyOverridesAllViews(): void {\r\n for (const vp of this)\r\n vp.setFeatureOverrideProviderChanged();\r\n }\r\n\r\n /** @internal */\r\n public onSelectionSetChanged(_iModel: IModelConnection) {\r\n for (const vp of this)\r\n vp.markSelectionSetDirty();\r\n\r\n IModelApp.requestNextAnimation();\r\n }\r\n\r\n /** @internal */\r\n public invalidateViewportScenes(): void {\r\n for (const vp of this)\r\n vp.invalidateScene();\r\n }\r\n\r\n /** @internal */\r\n public validateViewportScenes(): void {\r\n for (const vp of this)\r\n vp.setValidScene();\r\n }\r\n\r\n /** Requests that [[Viewport.createScene]] be invoked for every viewport on the next frame.\r\n * This is rarely useful - viewports keep track of their own states to detect when the scene needs to be recreated.\r\n */\r\n public invalidateScenes(): void {\r\n this._invalidateScenes = true;\r\n IModelApp.requestNextAnimation();\r\n }\r\n\r\n /** @internal */\r\n public get sceneInvalidated(): boolean { return this._invalidateScenes; }\r\n\r\n /** Invoked by ToolAdmin event loop.\r\n * @internal\r\n */\r\n public renderLoop(): void {\r\n if (0 === this._viewports.length)\r\n return;\r\n if (this._skipSceneCreation)\r\n this.validateViewportScenes();\r\n else if (this._invalidateScenes)\r\n this.invalidateViewportScenes();\r\n\r\n this._invalidateScenes = false;\r\n\r\n this.onBeginRender.raiseEvent();\r\n\r\n for (const vp of this._viewports)\r\n vp.renderFrame();\r\n\r\n this.onFinishRender.raiseEvent();\r\n }\r\n\r\n /** Purge TileTrees that haven't been drawn since the specified time point and are not currently in use by any ScreenViewport.\r\n * Intended strictly for debugging purposes - TileAdmin takes care of properly purging.\r\n * @internal\r\n */\r\n public purgeTileTrees(olderThan: BeTimePoint): void {\r\n // A single viewport can display tiles from more than one IModelConnection.\r\n // NOTE: A viewport may be displaying no trees - but we need to record its IModel so we can purge those which are NOT being displayed\r\n // NOTE: That won't catch external tile trees previously used by that viewport.\r\n const trees = new DisclosedTileTreeSet();\r\n const treesByIModel = new Map<IModelConnection, Set<TileTree>>();\r\n for (const vp of this._viewports) {\r\n vp.discloseTileTrees(trees);\r\n if (undefined === treesByIModel.get(vp.iModel))\r\n treesByIModel.set(vp.iModel, new Set<TileTree>());\r\n }\r\n\r\n for (const tree of trees) {\r\n let set = treesByIModel.get(tree.iModel);\r\n if (undefined === set) {\r\n set = new Set<TileTree>();\r\n treesByIModel.set(tree.iModel, set);\r\n }\r\n\r\n set.add(tree);\r\n }\r\n\r\n for (const entry of treesByIModel) {\r\n const iModel = entry[0];\r\n iModel.tiles.purge(olderThan, entry[1]);\r\n }\r\n }\r\n\r\n /** Compute the tooltip for a persistent element.\r\n * This method calls the backend method [Element.getToolTipMessage]($backend), and replaces all instances of `${localizeTag}` with localized string from IModelApp.i18n.\r\n */\r\n public async getElementToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n const msg: string[] = await hit.iModel.getToolTipMessage(hit.sourceId); // wait for the locate message(s) from the backend\r\n return IModelApp.formatElementToolTip(msg);\r\n }\r\n\r\n /** Register a new [[ToolTipProvider]] to customize the locate tooltip.\r\n * @param provider The new tooltip provider to add.\r\n * @throws Error if `provider` is already registered.\r\n * @returns a function that may be called to remove this provider (in lieu of calling [[dropToolTipProvider]].)\r\n */\r\n public addToolTipProvider(provider: ToolTipProvider): () => void {\r\n if (this.toolTipProviders.includes(provider))\r\n throw new Error(\"tooltip provider already registered\");\r\n\r\n this.toolTipProviders.push(provider);\r\n return () => this.dropToolTipProvider(provider);\r\n }\r\n\r\n /** Drop (remove) a [[ToolTipProvider]] so it is no longer active.\r\n * @param provider The tooltip provider to drop.\r\n * @note Does nothing if provider is not currently active.\r\n */\r\n public dropToolTipProvider(provider: ToolTipProvider) {\r\n const index = this.toolTipProviders.indexOf(provider);\r\n if (index >= 0)\r\n this.toolTipProviders.splice(index, 1);\r\n }\r\n\r\n /** Add a new [[Decorator]] to display decorations into the active views.\r\n * @param decorator The new decorator to add.\r\n * @throws Error if decorator is already active.\r\n * @returns a function that may be called to remove this decorator (in lieu of calling [[dropDecorator]].)\r\n * @see [[dropDecorator]]\r\n */\r\n public addDecorator(decorator: Decorator): () => void {\r\n if (this.decorators.includes(decorator))\r\n throw new Error(\"decorator already registered\");\r\n\r\n this.decorators.push(decorator);\r\n this.invalidateDecorationsAllViews();\r\n return () => this.dropDecorator(decorator);\r\n }\r\n\r\n /** Drop (remove) a [[Decorator]] so it is no longer active.\r\n * @param decorator The Decorator to drop.\r\n * @returns true if the decorator was found and removed; false if the decorator was not found.\r\n */\r\n public dropDecorator(decorator: Decorator): boolean {\r\n const index = this.decorators.indexOf(decorator);\r\n if (index < 0)\r\n return false;\r\n\r\n this.invalidateCachedDecorationsAllViews(decorator);\r\n this.decorators.splice(index, 1);\r\n this.invalidateDecorationsAllViews();\r\n return true;\r\n }\r\n\r\n /** Get the tooltip for a pickable decoration.\r\n * @internal\r\n */\r\n public async getDecorationToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n for (const decorator of this.decorators) {\r\n if (undefined !== decorator.testDecorationHit && undefined !== decorator.getDecorationToolTip && decorator.testDecorationHit(hit.sourceId))\r\n return decorator.getDecorationToolTip(hit);\r\n }\r\n return hit.viewport ? hit.viewport.getToolTip(hit) : \"\";\r\n }\r\n\r\n /** Allow a pickable decoration to handle a button event that identified it for the SelectTool.\r\n * @internal\r\n */\r\n public async onDecorationButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.testDecorationHit && undefined !== decorator.onDecorationButtonEvent && decorator.testDecorationHit(hit.sourceId))\r\n return decorator.onDecorationButtonEvent(hit, ev);\r\n }\r\n return EventHandled.No;\r\n }\r\n\r\n /** Allow a pickable decoration to be snapped to by AccuSnap or TentativePoint.\r\n * @internal\r\n */\r\n public getDecorationGeometry(hit: HitDetail): GeometryStreamProps | undefined {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.testDecorationHit && undefined !== decorator.getDecorationGeometry && decorator.testDecorationHit(hit.sourceId))\r\n return decorator.getDecorationGeometry(hit);\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Allow a pickable decoration created using a persistent element id to augment or replace the the persistent element's tooltip.\r\n * @internal\r\n */\r\n public async overrideElementToolTip(hit: HitDetail): Promise<HTMLElement | string> {\r\n for (const decorator of this.decorators) {\r\n if (undefined !== decorator.overrideElementHit && undefined !== decorator.getDecorationToolTip && decorator.overrideElementHit(hit))\r\n return decorator.getDecorationToolTip(hit);\r\n }\r\n return this.getElementToolTip(hit);\r\n }\r\n\r\n /** Allow a pickable decoration created using a persistent element id to handle a button event that identified it for the SelectTool.\r\n * @internal\r\n */\r\n public async overrideElementButtonEvent(hit: HitDetail, ev: BeButtonEvent): Promise<EventHandled> {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.overrideElementHit && undefined !== decorator.onDecorationButtonEvent && decorator.overrideElementHit(hit))\r\n return decorator.onDecorationButtonEvent(hit, ev);\r\n }\r\n return EventHandled.No;\r\n }\r\n\r\n /** Allow a pickable decoration created using a persistent element id to control whether snapping uses the persistent element's geometry.\r\n * @internal\r\n */\r\n public overrideElementGeometry(hit: HitDetail): GeometryStreamProps | undefined {\r\n for (const decorator of IModelApp.viewManager.decorators) {\r\n if (undefined !== decorator.overrideElementHit && undefined !== decorator.getDecorationGeometry && decorator.overrideElementHit(hit))\r\n return decorator.getDecorationGeometry(hit);\r\n }\r\n return undefined;\r\n }\r\n\r\n public get crossHairCursor(): string { return `url(${IModelApp.publicPath}cursors/crosshair.cur), crosshair`; }\r\n public get dynamicsCursor(): string { return `url(${IModelApp.publicPath}cursors/dynamics.cur), move`; }\r\n public get grabCursor(): string { return `url(${IModelApp.publicPath}cursors/openHand.cur), auto`; }\r\n public get grabbingCursor(): string { return `url(${IModelApp.publicPath}cursors/closedHand.cur), auto`; }\r\n public get walkCursor(): string { return `url(${IModelApp.publicPath}cursors/walk.cur), auto`; }\r\n public get rotateCursor(): string { return `url(${IModelApp.publicPath}cursors/rotate.cur), auto`; }\r\n public get lookCursor(): string { return `url(${IModelApp.publicPath}cursors/look.cur), auto`; }\r\n public get zoomCursor(): string { return `url(${IModelApp.publicPath}cursors/zoom.cur), auto`; }\r\n\r\n /** Change the cursor shown in all Viewports.\r\n * @param cursor The new cursor to display. If undefined, the default cursor is used.\r\n */\r\n public setViewCursor(cursor: string = \"default\") {\r\n if (cursor === this.cursor)\r\n return;\r\n this.cursor = cursor;\r\n for (const vp of this._viewports)\r\n vp.setCursor(cursor);\r\n }\r\n\r\n /** Intended strictly as a temporary solution for interactive editing applications, until official support for such apps is implemented.\r\n * Call this after editing one or more models, passing in the Ids of those models, to cause new tiles to be generated reflecting the changes.\r\n * Pass undefined if you are unsure which models changed (this is less efficient as it discards all tiles for all viewed models in all viewports).\r\n * @internal\r\n */\r\n public refreshForModifiedModels(modelIds: Id64Arg | undefined): void {\r\n for (const vp of this._viewports)\r\n vp.refreshForModifiedModels(modelIds);\r\n }\r\n\r\n /** Sets the number of [MSAA]($docs/learning/display/MSAA.md) samples for all currently- and subsequently-opened [[ScreenViewport]]s.\r\n * @param numSamples The number of samples as a power of two. Values of 1 or less indicates anti-aliasing should be disabled. Non-power-of-two values are rounded\r\n * down to the nearest power of two. The maximum number of samples supported depends upon the client's graphics hardware capabilities. Higher values produce\r\n * a higher-quality image but also may also reduce framerate.\r\n * @see [[Viewport.antialiasSamples]] to adjust the number of samples for a specific viewport.\r\n */\r\n public setAntialiasingAllViews(numSamples: number): void {\r\n for (const vp of this)\r\n vp.antialiasSamples = numSamples;\r\n\r\n System.instance.antialiasSamples = numSamples;\r\n }\r\n}\r\n"]}
|
package/lib/esm/Viewport.d.ts
CHANGED
|
@@ -548,13 +548,17 @@ export declare abstract class Viewport implements Disposable, TileUser {
|
|
|
548
548
|
* @see [DisplayStyleSettings.dropModelAppearanceOverride]($common)
|
|
549
549
|
*/
|
|
550
550
|
dropModelAppearanceOverride(id: Id64String): void;
|
|
551
|
-
/** Some changes
|
|
551
|
+
/** Some changes do not alter the set of graphics being displayed (the "scene") but may alter the visibility of objects within those graphics.
|
|
552
|
+
* Under certain circumstances, we may want to recreate the scene after such changes.
|
|
552
553
|
* Specifically, when shadows are enabled or we are displaying view attachments, the following changes may affect the visibility or transparency of elements or features:
|
|
553
554
|
* - Viewed categories and subcategories;
|
|
554
555
|
* - Always/never drawn elements
|
|
555
556
|
* - Symbology overrides.
|
|
557
|
+
* Cached decorations will also be invalidated in case they depend on object visibility.
|
|
556
558
|
*/
|
|
557
559
|
private maybeInvalidateScene;
|
|
560
|
+
/** @internal Invoked by [[maybeInvalidateScene]] when the visibility of objects in the scene may have changed, but the scene itself has not changed. */
|
|
561
|
+
protected onSceneVisibilityChanged(): void;
|
|
558
562
|
/** Enable or disable display of elements belonging to a set of categories specified by Id.
|
|
559
563
|
* Visibility of individual subcategories belonging to a category can be controlled separately through the use of [[SubCategoryOverride]]s.
|
|
560
564
|
* By default, enabling display of a category does not affect display of subcategories thereof which have been overridden to be invisible.
|
|
@@ -1374,6 +1378,8 @@ export declare class ScreenViewport extends Viewport {
|
|
|
1374
1378
|
[Symbol.dispose](): void;
|
|
1375
1379
|
/** @internal */
|
|
1376
1380
|
invalidateScene(): void;
|
|
1381
|
+
/** @internal */
|
|
1382
|
+
protected onSceneVisibilityChanged(): void;
|
|
1377
1383
|
/** Forces removal of a specific decorator's cached decorations from this viewport, if they exist.
|
|
1378
1384
|
* This will force those decorations to be regenerated.
|
|
1379
1385
|
* @see [[ViewportDecorator.useCachedDecorations]].
|