@itwin/core-frontend 3.0.0-dev.102 → 3.0.0-dev.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/ApproximateTerrainHeights.js +3 -3
- package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
- package/lib/cjs/ContextRealityModelState.js +1 -1
- package/lib/cjs/ContextRealityModelState.js.map +1 -1
- package/lib/cjs/ElementLocateManager.d.ts +5 -0
- package/lib/cjs/ElementLocateManager.d.ts.map +1 -1
- package/lib/cjs/ElementLocateManager.js +12 -2
- package/lib/cjs/ElementLocateManager.js.map +1 -1
- package/lib/cjs/ModelState.js +1 -1
- package/lib/cjs/ModelState.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts +53 -29
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +245 -91
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/TwoWayViewportSync.d.ts +35 -6
- package/lib/cjs/TwoWayViewportSync.d.ts.map +1 -1
- package/lib/cjs/TwoWayViewportSync.js +51 -11
- package/lib/cjs/TwoWayViewportSync.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +23 -5
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +13 -9
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +0 -1
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +0 -1
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +4 -2
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.d.ts.map +1 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.js +10 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/cjs/tile/CesiumAssetProvider.d.ts +13 -0
- package/lib/cjs/tile/CesiumAssetProvider.d.ts.map +1 -0
- package/lib/cjs/tile/CesiumAssetProvider.js +34 -0
- package/lib/cjs/tile/CesiumAssetProvider.js.map +1 -0
- package/lib/cjs/tile/ContextShareProvider.d.ts +22 -0
- package/lib/cjs/tile/ContextShareProvider.d.ts.map +1 -0
- package/lib/cjs/tile/ContextShareProvider.js +110 -0
- package/lib/cjs/tile/ContextShareProvider.js.map +1 -0
- package/lib/cjs/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.js +8 -5
- package/lib/cjs/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts +1 -54
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +24 -217
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/internal.d.ts +3 -0
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +3 -0
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts +22 -0
- package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -0
- package/lib/cjs/tile/map/ArcGISTileMap.js +173 -0
- package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -0
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +5 -4
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +18 -40
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +6 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +63 -21
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +4 -4
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +20 -24
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +17 -6
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +9 -4
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +22 -4
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTile.js +4 -3
- package/lib/cjs/tile/map/MapTile.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +1 -1
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.d.ts +7 -2
- package/lib/cjs/tile/map/MapTilingScheme.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js +21 -8
- package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/cjs/tile/map/QuadId.d.ts +1 -0
- package/lib/cjs/tile/map/QuadId.d.ts.map +1 -1
- package/lib/cjs/tile/map/QuadId.js +2 -1
- package/lib/cjs/tile/map/QuadId.js.map +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.d.ts +7 -0
- package/lib/cjs/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/cjs/tile/map/WmtsCapabilities.js +16 -2
- package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +2 -10
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.js +3 -3
- package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
- package/lib/esm/ContextRealityModelState.js +1 -1
- package/lib/esm/ContextRealityModelState.js.map +1 -1
- package/lib/esm/ElementLocateManager.d.ts +5 -0
- package/lib/esm/ElementLocateManager.d.ts.map +1 -1
- package/lib/esm/ElementLocateManager.js +12 -2
- package/lib/esm/ElementLocateManager.js.map +1 -1
- package/lib/esm/ModelState.js +1 -1
- package/lib/esm/ModelState.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts +53 -29
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +246 -90
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/TwoWayViewportSync.d.ts +35 -6
- package/lib/esm/TwoWayViewportSync.d.ts.map +1 -1
- package/lib/esm/TwoWayViewportSync.js +49 -10
- package/lib/esm/TwoWayViewportSync.js.map +1 -1
- package/lib/esm/Viewport.d.ts +23 -5
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +13 -9
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +0 -1
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +0 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +4 -2
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.d.ts.map +1 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.js +10 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/esm/tile/CesiumAssetProvider.d.ts +13 -0
- package/lib/esm/tile/CesiumAssetProvider.d.ts.map +1 -0
- package/lib/esm/tile/CesiumAssetProvider.js +30 -0
- package/lib/esm/tile/CesiumAssetProvider.js.map +1 -0
- package/lib/esm/tile/ContextShareProvider.d.ts +22 -0
- package/lib/esm/tile/ContextShareProvider.d.ts.map +1 -0
- package/lib/esm/tile/ContextShareProvider.js +106 -0
- package/lib/esm/tile/ContextShareProvider.js.map +1 -0
- package/lib/esm/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/esm/tile/OrbitGtTileTree.js +8 -5
- package/lib/esm/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts +1 -54
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +26 -218
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/internal.d.ts +3 -0
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +3 -0
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/ArcGISTileMap.d.ts +22 -0
- package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -0
- package/lib/esm/tile/map/ArcGISTileMap.js +169 -0
- package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -0
- package/lib/esm/tile/map/CesiumTerrainProvider.js +5 -4
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +19 -41
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +6 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +63 -21
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +4 -4
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +21 -25
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +17 -6
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +9 -4
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +22 -4
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTile.js +4 -3
- package/lib/esm/tile/map/MapTile.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +1 -1
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.d.ts +7 -2
- package/lib/esm/tile/map/MapTilingScheme.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js +22 -9
- package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/esm/tile/map/QuadId.d.ts +1 -0
- package/lib/esm/tile/map/QuadId.d.ts.map +1 -1
- package/lib/esm/tile/map/QuadId.js +2 -1
- package/lib/esm/tile/map/QuadId.js.map +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.d.ts +7 -0
- package/lib/esm/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/esm/tile/map/WmtsCapabilities.js +16 -2
- package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +2 -10
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/package.json +24 -24
- package/lib/cjs/RealityDataConnection.d.ts +0 -31
- package/lib/cjs/RealityDataConnection.d.ts.map +0 -1
- package/lib/cjs/RealityDataConnection.js +0 -101
- package/lib/cjs/RealityDataConnection.js.map +0 -1
- package/lib/esm/RealityDataConnection.d.ts +0 -31
- package/lib/esm/RealityDataConnection.d.ts.map +0 -1
- package/lib/esm/RealityDataConnection.js +0 -98
- package/lib/esm/RealityDataConnection.js.map +0 -1
|
@@ -40,8 +40,8 @@ export class ApproximateTerrainHeights {
|
|
|
40
40
|
result = Range1d.createFrom(this.globalHeightRange, result);
|
|
41
41
|
if (undefined === this._terrainHeights)
|
|
42
42
|
return result; // Not initialized.
|
|
43
|
-
let level = quadId.level
|
|
44
|
-
if (
|
|
43
|
+
let level = quadId.level, column = quadId.column, row = quadId.row;
|
|
44
|
+
if (level > 6) {
|
|
45
45
|
column = column >> (level - 6);
|
|
46
46
|
row = row >> quadId.row >> ((level - 6));
|
|
47
47
|
level = 6;
|
|
@@ -83,7 +83,7 @@ export class ApproximateTerrainHeights {
|
|
|
83
83
|
let failed = false;
|
|
84
84
|
for (let j = 0; j < 4; ++j) {
|
|
85
85
|
const corner = this._scratchCorners[j];
|
|
86
|
-
this._tilingScheme.cartographicToTileXY(corner, i
|
|
86
|
+
this._tilingScheme.cartographicToTileXY(corner, i, this._scratchTileXY);
|
|
87
87
|
if (j === 0) {
|
|
88
88
|
currentX = this._scratchTileXY.x;
|
|
89
89
|
currentY = this._scratchTileXY.y;
|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C;YACtB,UAAU,GAAG,QAAQ,CAAC;SACvB;QAED,IAAI,CAAC,KAAK,CAAC,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,OAAO;YACL,CAAC,EAAE,UAAU;YACb,CAAC,EAAE,UAAU;YACb,KAAK,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SAC3C,CAAC;IACJ,CAAC;;AA1GsB,kCAAQ,GAAG,CAAC,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 Views\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Point2d, Range1d, Range2d } from \"@itwin/core-geometry\";\r\nimport { Cartographic } from \"@itwin/core-common\";\r\nimport { getJson } from \"@bentley/itwin-client\";\r\nimport { GeographicTilingScheme, QuadId } from \"./tile/internal\";\r\n\r\nlet instance: ApproximateTerrainHeights | undefined;\r\n\r\n/**\r\n * A collection of functions for approximating terrain height\r\n * @internal\r\n */\r\nexport class ApproximateTerrainHeights {\r\n public static readonly maxLevel = 6;\r\n public readonly globalHeightRange = Range1d.createXX(-400, 90000); // Dead Sea to Mount Everest.\r\n private _terrainHeights: any;\r\n private readonly _scratchCorners = [Cartographic.createZero(), Cartographic.createZero(), Cartographic.createZero(), Cartographic.createZero()];\r\n private readonly _tilingScheme = new GeographicTilingScheme(2, 1, true); // Y at top... ?\r\n private readonly _scratchTileXY = Point2d.createZero();\r\n\r\n public static get instance(): ApproximateTerrainHeights {\r\n if (undefined === instance)\r\n instance = new ApproximateTerrainHeights();\r\n\r\n return instance;\r\n }\r\n\r\n /**\r\n * Initializes the minimum and maximum terrain heights.\r\n * @return {Promise}\r\n */\r\n public async initialize(): Promise<void> {\r\n if (undefined === this._terrainHeights) {\r\n this._terrainHeights = await getJson(\"assets/approximateTerrainHeights.json\");\r\n }\r\n }\r\n\r\n public getTileHeightRange(quadId: QuadId, result?: Range1d): Range1d {\r\n result = Range1d.createFrom(this.globalHeightRange, result);\r\n if (undefined === this._terrainHeights)\r\n return result; // Not initialized.\r\n\r\n let level = quadId.level, column = quadId.column, row = quadId.row;\r\n if (level > 6) {\r\n column = column >> (level - 6);\r\n row = row >> quadId.row >> ((level - 6));\r\n level = 6;\r\n }\r\n\r\n const key = `${level}-${column}-${row}`;\r\n const heights = this._terrainHeights[key];\r\n assert(undefined !== heights);\r\n\r\n result.low = heights[0];\r\n result.high = heights[1];\r\n\r\n return result;\r\n }\r\n\r\n public getMinimumMaximumHeights(rectangle: Range2d, result?: Range1d): Range1d {\r\n result = Range1d.createFrom(this.globalHeightRange, result);\r\n if (undefined === this._terrainHeights)\r\n return result; // Not initialized.\r\n\r\n const xyLevel = this._getTileXYLevel(rectangle);\r\n if (undefined !== xyLevel) {\r\n const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\r\n const heights = this._terrainHeights[key];\r\n assert(undefined !== heights);\r\n if (undefined !== heights) {\r\n result.low = heights[0];\r\n result.high = heights[1];\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private _getTileXYLevel(rectangle: Range2d): { x: number, y: number, level: number } | undefined {\r\n Cartographic.fromRadians({ longitude: rectangle.low.x, latitude: rectangle.high.y, height: 0.0 }, this._scratchCorners[0]);\r\n Cartographic.fromRadians({ longitude: rectangle.high.x, latitude: rectangle.high.y, height: 0.0 }, this._scratchCorners[1]);\r\n Cartographic.fromRadians({ longitude: rectangle.low.x, latitude: rectangle.low.y, height: 0.0 }, this._scratchCorners[2]);\r\n Cartographic.fromRadians({ longitude: rectangle.high.x, latitude: rectangle.low.y, height: 0.0 }, this._scratchCorners[3]);\r\n\r\n // Determine which tile the bounding rectangle is in\r\n let lastLevelX = 0, lastLevelY = 0;\r\n let currentX = 0, currentY = 0;\r\n const maxLevel = ApproximateTerrainHeights.maxLevel;\r\n let i;\r\n for (i = 0; i <= maxLevel; ++i) {\r\n let failed = false;\r\n for (let j = 0; j < 4; ++j) {\r\n const corner = this._scratchCorners[j];\r\n this._tilingScheme.cartographicToTileXY(corner, i, this._scratchTileXY);\r\n if (j === 0) {\r\n currentX = this._scratchTileXY.x;\r\n currentY = this._scratchTileXY.y;\r\n } else if (currentX !== this._scratchTileXY.x || currentY !== this._scratchTileXY.y) {\r\n failed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (failed)\r\n break;\r\n\r\n lastLevelX = currentX;\r\n lastLevelY = currentY;\r\n }\r\n\r\n if (i === 0) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n x: lastLevelX,\r\n y: lastLevelY,\r\n level: (i > maxLevel) ? maxLevel : (i - 1),\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -23,7 +23,7 @@ export class ContextRealityModelState extends ContextRealityModel {
|
|
|
23
23
|
this.iModel = iModel;
|
|
24
24
|
this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;
|
|
25
25
|
if (undefined === props.orbitGtBlob) {
|
|
26
|
-
this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.
|
|
26
|
+
this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromUrl(props.tilesetUrl);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextRealityModelState.js","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAA4B,iBAAiB,EAAE,iBAAiB,EAAwB,MAAM,oBA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AAE,IAAI,CAAC,WAAW;gBAC7B,MAAM,EAAE,YAAY;aACrB,CAAC,CAAC;QAEL,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,EAAE;YACvD,IAAI,CAAC,QAAQ,CAAC,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,6FAA6F;IAC7F,IAAW,OAAO,KAAwB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjE,mEAAmE;IACnE,IAAW,OAAO;QAChB,OAAO,CAAC,IAAI,CAAC,QAAQ,YAAY,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,CAAC;IAED,kEAAkE;IAClE,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,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\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { ContextRealityModel, ContextRealityModelProps, FeatureAppearance, RealityDataFormat, RealityDataSourceKey } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"./DisplayStyleState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createRealityTileTreeReference, RealityModelTileTree, TileTreeReference } from \"./tile/internal\";\r\n\r\n/** A [ContextRealityModel]($common) attached to a [[DisplayStyleState]] supplying a [[TileTreeReference]] used to draw the\r\n * reality model in a [[Viewport]].\r\n * @see [DisplayStyleSettings.contextRealityModels]($common).\r\n * @see [[DisplayStyleState.contextRealityModelStates]].\r\n * @see [[DisplayStyleState.attachRealityModel]].\r\n * @public\r\n */\r\nexport class ContextRealityModelState extends ContextRealityModel {\r\n private readonly _treeRef: RealityModelTileTree.Reference;\r\n /** The iModel with which the reality model is associated. */\r\n public readonly iModel: IModelConnection;\r\n /** The reality data source key with which the reality model is associated. */\r\n public override readonly rdSourceKey: RealityDataSourceKey;\r\n\r\n /** @internal */\r\n public constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState) {\r\n super(props);\r\n this.iModel = iModel;\r\n this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;\r\n if (undefined === props.orbitGtBlob) {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromUrl(props.tilesetUrl);\r\n } else {\r\n this.rdSourceKey = props.rdSourceKey ? props.rdSourceKey : RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);\r\n }\r\n const useOrbitGtTileTreeReference = this.rdSourceKey.format === RealityDataFormat.OPC;\r\n this._treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n iModel,\r\n source: displayStyle,\r\n rdSourceKey: this.rdSourceKey,\r\n url: props.tilesetUrl,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n planarClipMask: this.planarClipMaskSettings,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n iModel,\r\n orbitGtBlob: props.orbitGtBlob!,\r\n rdSourceKey: this.rdSourceKey,\r\n name: props.name,\r\n classifiers: this.classifiers,\r\n source: displayStyle,\r\n });\r\n\r\n this.onPlanarClipMaskChanged.addListener((newSettings) => {\r\n this._treeRef.planarClipMask = newSettings ? PlanarClipMaskState.create(newSettings) : undefined;\r\n });\r\n }\r\n\r\n /** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */\r\n public get treeRef(): TileTreeReference { return this._treeRef; }\r\n\r\n /** The transient Id assigned to this reality model at run-time. */\r\n public get modelId(): Id64String | undefined {\r\n return (this._treeRef instanceof RealityModelTileTree.Reference) ? this._treeRef.modelId : undefined;\r\n }\r\n\r\n /** Whether the reality model spans the entire globe ellipsoid. */\r\n public get isGlobal(): boolean {\r\n return this.treeRef.isGlobal;\r\n }\r\n}\r\n"]}
|
|
@@ -49,6 +49,11 @@ export declare class LocateOptions {
|
|
|
49
49
|
* @see [[HitDetail.iModel]] and [[HitDetail.isExternalIModelHit]]
|
|
50
50
|
*/
|
|
51
51
|
allowExternalIModels: boolean;
|
|
52
|
+
/** If true, then the world point of a hit on a model will preserve any transforms applied to the model at display time,
|
|
53
|
+
* such as those supplied by a [[ModelDisplayTransformProvider]] or [PlanProjectionSettings.elevation]($common).
|
|
54
|
+
* Otherwise, the world point will be multiplied by the inverse of any such transforms to correlate it with the model's true coordinate space.
|
|
55
|
+
*/
|
|
56
|
+
preserveModelDisplayTransforms: boolean;
|
|
52
57
|
/** Make a copy of this LocateOptions. */
|
|
53
58
|
clone(): LocateOptions;
|
|
54
59
|
setFrom(other: LocateOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementLocateManager.d.ts","sourceRoot":"","sources":["../../src/ElementLocateManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAW,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtD;;GAEG;AACH,oBAAY,YAAY;IACtB,QAAQ,IAAI;IACZ,UAAU,IAAI;CACf;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED,cAAc;AACd,oBAAY,UAAU;IACpB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,UAAU,IAAI;IACd,QAAQ,MAAM;IACd,cAAc,MAAM;IACpB,YAAY,MAAM;IAClB,aAAa,MAAM;IACnB,oBAAoB,MAAM;CAC3B;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,yDAAyD;IAClD,gBAAgB,UAAS;IAChC,+DAA+D;IACxD,iBAAiB,UAAS;IACjC,wCAAwC;IACjC,OAAO,SAAM;IACpB,gDAAgD;IACzC,SAAS,YAAuB;IACvC;;;;OAIG;IACI,oBAAoB,UAAS;
|
|
1
|
+
{"version":3,"file":"ElementLocateManager.d.ts","sourceRoot":"","sources":["../../src/ElementLocateManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAW,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtD;;GAEG;AACH,oBAAY,YAAY;IACtB,QAAQ,IAAI;IACZ,UAAU,IAAI;CACf;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED,cAAc;AACd,oBAAY,UAAU;IACpB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,UAAU,IAAI;IACd,QAAQ,MAAM;IACd,cAAc,MAAM;IACpB,YAAY,MAAM;IAClB,aAAa,MAAM;IACnB,oBAAoB,MAAM;CAC3B;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,yDAAyD;IAClD,gBAAgB,UAAS;IAChC,+DAA+D;IACxD,iBAAiB,UAAS;IACjC,wCAAwC;IACjC,OAAO,SAAM;IACpB,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AE,aAAa,GAAG,OAAO;CAMrI;AAED,cAAc;AACd,qBAAa,oBAAoB;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAgB,OAAO,gBAAuB;IAC9C,SAAgB,MAAM,gBAAuB;IAE7C,qDAAqD;WACvC,oBAAoB,CAAC,GAAG,EAAE,MAAM;IACvC,aAAa;IACpB,IAAW,cAAc,WAAmB;IAC5C,IAAW,mBAAmB,WAAmB;IAE1C,KAAK,IAAI,IAAI;IACb,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC;IACpC,UAAU,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI;IACjC,UAAU,IAAI,SAAS,GAAG,SAAS;IAE1C,0FAA0F;IACnF,gBAAgB,IAAI,SAAS,GAAG,SAAS;IAiBnC,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAqCxG,iBAAiB;IACjB,cAAc;YAOP,SAAS;IAiCV,QAAQ,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CAYlM"}
|
|
@@ -60,6 +60,11 @@ export class LocateOptions {
|
|
|
60
60
|
* @see [[HitDetail.iModel]] and [[HitDetail.isExternalIModelHit]]
|
|
61
61
|
*/
|
|
62
62
|
this.allowExternalIModels = false;
|
|
63
|
+
/** If true, then the world point of a hit on a model will preserve any transforms applied to the model at display time,
|
|
64
|
+
* such as those supplied by a [[ModelDisplayTransformProvider]] or [PlanProjectionSettings.elevation]($common).
|
|
65
|
+
* Otherwise, the world point will be multiplied by the inverse of any such transforms to correlate it with the model's true coordinate space.
|
|
66
|
+
*/
|
|
67
|
+
this.preserveModelDisplayTransforms = false;
|
|
63
68
|
}
|
|
64
69
|
/** Make a copy of this LocateOptions. */
|
|
65
70
|
clone() {
|
|
@@ -209,8 +214,13 @@ export class ElementPicker {
|
|
|
209
214
|
const pixel = pixels.getPixel(elmPoint.x, elmPoint.y);
|
|
210
215
|
if (undefined === pixel || undefined === pixel.elementId)
|
|
211
216
|
continue;
|
|
212
|
-
const hitPointWorld = vp.getPixelDataWorldPoint(
|
|
213
|
-
|
|
217
|
+
const hitPointWorld = vp.getPixelDataWorldPoint({
|
|
218
|
+
pixels,
|
|
219
|
+
x: elmPoint.x,
|
|
220
|
+
y: elmPoint.y,
|
|
221
|
+
preserveModelDisplayTransforms: options.preserveModelDisplayTransforms,
|
|
222
|
+
});
|
|
223
|
+
if (!hitPointWorld)
|
|
214
224
|
continue;
|
|
215
225
|
const modelId = undefined !== pixel.featureTable ? pixel.featureTable.modelId : undefined;
|
|
216
226
|
const hit = new HitDetail(pickPointWorld, vp, options.hitSource, hitPointWorld, pixel.elementId, this.getPixelPriority(pixel), testPointView.distance(elmPoint), pixel.distanceFraction, pixel.subCategoryId, pixel.geometryClass, modelId, pixel.iModel, pixel.tileId, pixel.isClassifier);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementLocateManager.js","sourceRoot":"","sources":["../../src/ElementLocateManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CA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ED,IAAI,MAA6B,CAAC;QAClC,OAAO,SAAS,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE;YACjD,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAC5G,OAAO,MAAM,CAAC;YAChB,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC,CAAC,8CAA8C;SAChF;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,QAAwB,EAAE,SAAkB,EAAE,SAAkB,EAAE,IAAgC,EAAE,MAAmB,EAAE,UAAU,GAAG,IAAI;QAC9J,QAAQ,CAAC,MAAM,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAC1E,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAErB,8FAA8F;QAC9F,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO;YACrB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,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 LocatingElements\r\n */\r\n\r\nimport { Id64 } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { HitDetail, HitList, HitPriority, HitSource } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { Pixel } from \"./render/Pixel\";\r\nimport { InputSource, InteractiveTool } from \"./tools/Tool\";\r\nimport { ScreenViewport, Viewport } from \"./Viewport\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/** The possible actions for which a locate filter can be called.\r\n * @public\r\n */\r\nexport enum LocateAction {\r\n Identify = 0,\r\n AutoLocate = 1,\r\n}\r\n\r\n/** Values to return from a locate filter.\r\n * Return `Reject` to indicate the element is unacceptable.\r\n * @public\r\n */\r\nexport enum LocateFilterStatus {\r\n Accept = 0,\r\n Reject = 1,\r\n}\r\n\r\n/** @public */\r\nexport enum SnapStatus {\r\n Success = 0,\r\n Aborted = 1,\r\n NoElements = 2,\r\n Disabled = 100,\r\n NoSnapPossible = 200,\r\n NotSnappable = 300,\r\n FilteredByApp = 600,\r\n FilteredByAppQuietly = 700,\r\n}\r\n\r\n/** Options that customize the way element location (i.e. *picking*) works.\r\n * @public\r\n */\r\nexport class LocateOptions {\r\n /** If true, also test graphics from view decorations. */\r\n public allowDecorations = false;\r\n /** If true, also test graphics with non-locatable flag set. */\r\n public allowNonLocatable = false;\r\n /** Maximum number of hits to return. */\r\n public maxHits = 20;\r\n /** The [[HitSource]] identifying the caller. */\r\n public hitSource = HitSource.DataPoint;\r\n /** If true, also test graphics from an IModelConnection other than the one associated with the Viewport. This can occur if, e.g., a\r\n * [[TiledGraphicsProvider]] is used to display graphics from a different iModel into the [[Viewport]].\r\n * @note If you override this, you must be prepared to properly handle [[HitDetail]]s originating from other IModelConnections.\r\n * @see [[HitDetail.iModel]] and [[HitDetail.isExternalIModelHit]]\r\n */\r\n public allowExternalIModels = false;\r\n\r\n /** Make a copy of this LocateOptions. */\r\n public clone(): LocateOptions {\r\n const other = new LocateOptions();\r\n other.allowDecorations = this.allowDecorations;\r\n other.allowNonLocatable = this.allowNonLocatable;\r\n other.maxHits = this.maxHits;\r\n other.hitSource = this.hitSource;\r\n other.allowExternalIModels = this.allowExternalIModels;\r\n return other;\r\n }\r\n public setFrom(other: LocateOptions): void {\r\n this.allowDecorations = other.allowDecorations;\r\n this.allowNonLocatable = other.allowNonLocatable;\r\n this.maxHits = other.maxHits;\r\n this.hitSource = other.hitSource;\r\n this.allowExternalIModels = other.allowExternalIModels;\r\n }\r\n public init() {\r\n this.allowDecorations = this.allowNonLocatable = this.allowExternalIModels = false;\r\n this.maxHits = 20;\r\n this.hitSource = HitSource.DataPoint;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class LocateResponse {\r\n public snapStatus = SnapStatus.Success;\r\n public reason?: string;\r\n public explanation = \"\";\r\n\r\n /** @internal */\r\n public clone(): LocateResponse {\r\n const other = new LocateResponse();\r\n other.snapStatus = this.snapStatus;\r\n other.reason = this.reason;\r\n other.explanation = this.explanation;\r\n return other;\r\n }\r\n\r\n /** @internal */\r\n public setFrom(other: LocateResponse): void {\r\n this.snapStatus = other.snapStatus;\r\n this.reason = other.reason;\r\n this.explanation = other.explanation;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport interface HitListHolder {\r\n setHitList(list: HitList<HitDetail> | undefined): void;\r\n}\r\n\r\n/** @public */\r\nexport class ElementPicker {\r\n public viewport?: Viewport;\r\n public readonly pickPointWorld = new Point3d();\r\n public hitList?: HitList<HitDetail>;\r\n\r\n public empty() {\r\n this.pickPointWorld.setZero();\r\n this.viewport = undefined;\r\n if (this.hitList)\r\n this.hitList.empty();\r\n else\r\n this.hitList = new HitList<HitDetail>();\r\n }\r\n\r\n /** return the HitList for the last Pick performed. Optionally allows the caller to take ownership of the list. */\r\n public getHitList(takeOwnership: boolean): HitList<HitDetail> {\r\n const list = this.hitList!;\r\n if (takeOwnership)\r\n this.hitList = undefined;\r\n return list;\r\n }\r\n\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** Return a hit from the list of hits created the last time pickElements was called. */\r\n public getHit(i: number): HitDetail | undefined { return this.hitList ? this.hitList.getHit(i) : undefined; }\r\n\r\n public resetCurrentHit(): void { if (this.hitList) this.hitList.resetCurrentHit(); }\r\n\r\n private getPixelPriority(pixel: Pixel.Data) {\r\n switch (pixel.type) {\r\n case Pixel.GeometryType.Surface:\r\n return Pixel.Planarity.Planar === pixel.planarity ? HitPriority.PlanarSurface : HitPriority.NonPlanarSurface;\r\n case Pixel.GeometryType.Linear:\r\n return HitPriority.WireEdge;\r\n case Pixel.GeometryType.Edge:\r\n return Pixel.Planarity.Planar === pixel.planarity ? HitPriority.PlanarEdge : HitPriority.NonPlanarEdge;\r\n case Pixel.GeometryType.Silhouette:\r\n return HitPriority.SilhouetteEdge;\r\n default:\r\n return HitPriority.Unknown;\r\n }\r\n }\r\n\r\n private comparePixel(pixel1: Pixel.Data, pixel2: Pixel.Data, distXY1: number, distXY2: number) {\r\n const priority1 = this.getPixelPriority(pixel1);\r\n const priority2 = this.getPixelPriority(pixel2);\r\n if (priority1 < priority2) return -1;\r\n if (priority1 > priority2) return 1;\r\n if (distXY1 < distXY2) return -1;\r\n if (distXY1 > distXY2) return 1;\r\n if (pixel1.distanceFraction > pixel2.distanceFraction) return -1;\r\n if (pixel1.distanceFraction < pixel2.distanceFraction) return 1;\r\n return 0;\r\n }\r\n\r\n /** Generate a list of elements that are close to a given point.\r\n * @returns The number of hits in the hitList of this object.\r\n */\r\n public doPick(vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions): number {\r\n if (this.hitList && this.hitList.length > 0 && vp === this.viewport && pickPointWorld.isAlmostEqual(this.pickPointWorld)) {\r\n this.hitList.resetCurrentHit();\r\n return this.hitList.length;\r\n }\r\n\r\n this.empty(); // empty the hit list\r\n this.viewport = vp;\r\n this.pickPointWorld.setFrom(pickPointWorld);\r\n\r\n const pickPointView = vp.worldToView(pickPointWorld);\r\n const testPointView = new Point2d(Math.floor(pickPointView.x + 0.5), Math.floor(pickPointView.y + 0.5));\r\n let pixelRadius = Math.floor(pickRadiusView + 0.5);\r\n const rect = new ViewRect(testPointView.x - pixelRadius, testPointView.y - pixelRadius, testPointView.x + pixelRadius, testPointView.y + pixelRadius);\r\n let result: number = 0;\r\n vp.readPixels(rect, Pixel.Selector.All, (pixels) => {\r\n if (undefined === pixels)\r\n return;\r\n\r\n testPointView.x = vp.cssPixelsToDevicePixels(testPointView.x);\r\n testPointView.y = vp.cssPixelsToDevicePixels(testPointView.y);\r\n pixelRadius = vp.cssPixelsToDevicePixels(pixelRadius);\r\n\r\n const elmHits = new Map<string, Point2d>();\r\n const testPoint = Point2d.createZero();\r\n for (testPoint.x = testPointView.x - pixelRadius; testPoint.x <= testPointView.x + pixelRadius; ++testPoint.x) {\r\n for (testPoint.y = testPointView.y - pixelRadius; testPoint.y <= testPointView.y + pixelRadius; ++testPoint.y) {\r\n const pixel = pixels.getPixel(testPoint.x, testPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId || Id64.isInvalid(pixel.elementId))\r\n continue; // no geometry at this location...\r\n\r\n const distXY = testPointView.distance(testPoint);\r\n if (distXY > pixelRadius)\r\n continue; // ignore corners. it's a locate circle not square...\r\n\r\n const oldPoint = elmHits.get(pixel.elementId);\r\n if (undefined !== oldPoint) {\r\n if (this.comparePixel(pixel, pixels.getPixel(oldPoint.x, oldPoint.y), distXY, testPointView.distance(oldPoint)) < 0)\r\n oldPoint.setFrom(testPoint); // new hit is better, update location...\r\n } else {\r\n elmHits.set(pixel.elementId, testPoint.clone());\r\n }\r\n }\r\n }\r\n if (0 === elmHits.size)\r\n return;\r\n\r\n for (const elmPoint of elmHits.values()) {\r\n const pixel = pixels.getPixel(elmPoint.x, elmPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId)\r\n continue;\r\n\r\n const hitPointWorld = vp.getPixelDataWorldPoint(pixels, elmPoint.x, elmPoint.y);\r\n if (undefined === hitPointWorld)\r\n continue;\r\n\r\n const modelId = undefined !== pixel.featureTable ? pixel.featureTable.modelId : undefined;\r\n const hit = new HitDetail(pickPointWorld, vp, options.hitSource, hitPointWorld, pixel.elementId, this.getPixelPriority(pixel), testPointView.distance(elmPoint), pixel.distanceFraction, pixel.subCategoryId, pixel.geometryClass, modelId, pixel.iModel, pixel.tileId, pixel.isClassifier);\r\n this.hitList!.addHit(hit);\r\n\r\n if (this.hitList!.hits.length > options.maxHits)\r\n this.hitList!.hits.length = options.maxHits; // truncate array...\r\n }\r\n\r\n result = this.hitList!.length;\r\n }, !options.allowNonLocatable);\r\n\r\n return result;\r\n }\r\n\r\n public testHit(hit: HitDetail, vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions): boolean {\r\n if (0 === this.doPick(vp, pickPointWorld, pickRadiusView, options))\r\n return false;\r\n\r\n return this.hitList!.hits.some((thisHit) => hit.isSameHit(thisHit));\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class ElementLocateManager {\r\n public hitList?: HitList<HitDetail>;\r\n public currHit?: HitDetail;\r\n public readonly options = new LocateOptions();\r\n public readonly picker = new ElementPicker();\r\n\r\n /** get the full message key for a locate failure */\r\n public static getFailureMessageKey(key: string) { return `LocateFailure.${key}`; }\r\n public onInitialized() { }\r\n public get apertureInches() { return 0.11; }\r\n public get touchApertureInches() { return 0.22; }\r\n\r\n public clear(): void { this.setCurrHit(undefined); }\r\n public setHitList(list?: HitList<HitDetail>) { this.hitList = list; }\r\n public setCurrHit(hit?: HitDetail): void { this.currHit = hit; }\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** return the current path from either the snapping logic or the pre-locating systems. */\r\n public getPreLocatedHit(): HitDetail | undefined {\r\n // NOTE: Check AccuSnap first as Tentative is used to build intersect snap. For normal snaps when a Tentative is active there should be no AccuSnap.\r\n let preLocated = IModelApp.accuSnap.getHitAndList(this);\r\n\r\n if (!preLocated && !!(preLocated = IModelApp.tentativePoint.getHitAndList(this))) {\r\n const vp = preLocated.viewport;\r\n this.picker.empty(); // Get new hit list at hit point; want reset to cycle hits using adjusted point location...\r\n this.picker.doPick(vp, preLocated.getPoint(), (vp.pixelsFromInches(this.apertureInches) / 2.0) + 1.5, this.options);\r\n this.setHitList(this.picker.getHitList(true));\r\n }\r\n\r\n if (this.hitList)\r\n this.hitList.resetCurrentHit();\r\n\r\n return preLocated;\r\n }\r\n\r\n public async filterHit(hit: HitDetail, _action: LocateAction, out: LocateResponse): Promise<LocateFilterStatus> {\r\n // Tools must opt-in to locate of transient geometry as it requires special treatment.\r\n if (!this.options.allowDecorations && !hit.isElementHit) {\r\n if (hit.isModelHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"RealityModel\");\r\n else if (hit.isMapHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Map\");\r\n else\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Transient\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n // Tools must opt-in to locate geometry from external iModels.\r\n if (!this.options.allowExternalIModels && hit.isExternalIModelHit) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ExternalIModel\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n if (undefined !== hit.subCategoryId && !hit.isExternalIModelHit) {\r\n const appearance = hit.viewport.getSubCategoryAppearance(hit.subCategoryId);\r\n if (appearance.dontLocate) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"NotLocatableSubCategory\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n }\r\n\r\n const tool = IModelApp.toolAdmin.activeTool;\r\n if (!(tool && tool instanceof InteractiveTool))\r\n return LocateFilterStatus.Accept;\r\n\r\n const status = await tool.filterHit(hit, out);\r\n if (LocateFilterStatus.Reject === status)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ByApp\");\r\n\r\n return status;\r\n }\r\n\r\n public initLocateOptions() { this.options.init(); }\r\n public initToolLocate() {\r\n this.initLocateOptions();\r\n this.clear();\r\n this.picker.empty();\r\n IModelApp.tentativePoint.clear(true);\r\n }\r\n\r\n private async _doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, vp: ScreenViewport | undefined, source: InputSource, filterHits: boolean): Promise<HitDetail | undefined> {\r\n if (!vp)\r\n return;\r\n\r\n // the \"newSearch\" flag indicates whether the caller wants us to conduct a new search at the testPoint, or just continue returning paths from the previous search.\r\n if (newSearch) {\r\n const hit = this.getPreLocatedHit();\r\n\r\n // if we're snapped to something, that path has the highest priority and becomes the active hit.\r\n if (hit) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(hit, LocateAction.Identify, response))\r\n return hit;\r\n\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n this.picker.empty();\r\n this.picker.doPick(vp, testPoint, (vp.pixelsFromInches(InputSource.Touch === source ? this.touchApertureInches : this.apertureInches) / 2.0) + 1.5, this.options);\r\n\r\n const hitList = this.picker.getHitList(true);\r\n this.setHitList(hitList);\r\n }\r\n\r\n let newHit: HitDetail | undefined;\r\n while (undefined !== (newHit = this.getNextHit())) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(newHit, LocateAction.Identify, response))\r\n return newHit;\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public async doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, view: ScreenViewport | undefined, source: InputSource, filterHits = true): Promise<HitDetail | undefined> {\r\n response.reason = ElementLocateManager.getFailureMessageKey(\"NoElements\");\r\n response.explanation = \"\";\r\n\r\n const hit = await this._doLocate(response, newSearch, testPoint, view, source, filterHits);\r\n this.setCurrHit(hit);\r\n\r\n // if we found a hit, remove it from the list of remaining hits near the current search point.\r\n if (hit && this.hitList)\r\n this.hitList.removeHitsFrom(hit.sourceId);\r\n return hit;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ElementLocateManager.js","sourceRoot":"","sources":["../../src/ElementLocateManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE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,OAAO;YACrB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,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 LocatingElements\r\n */\r\n\r\nimport { Id64 } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { HitDetail, HitList, HitPriority, HitSource } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { Pixel } from \"./render/Pixel\";\r\nimport { InputSource, InteractiveTool } from \"./tools/Tool\";\r\nimport { ScreenViewport, Viewport } from \"./Viewport\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/** The possible actions for which a locate filter can be called.\r\n * @public\r\n */\r\nexport enum LocateAction {\r\n Identify = 0,\r\n AutoLocate = 1,\r\n}\r\n\r\n/** Values to return from a locate filter.\r\n * Return `Reject` to indicate the element is unacceptable.\r\n * @public\r\n */\r\nexport enum LocateFilterStatus {\r\n Accept = 0,\r\n Reject = 1,\r\n}\r\n\r\n/** @public */\r\nexport enum SnapStatus {\r\n Success = 0,\r\n Aborted = 1,\r\n NoElements = 2,\r\n Disabled = 100,\r\n NoSnapPossible = 200,\r\n NotSnappable = 300,\r\n FilteredByApp = 600,\r\n FilteredByAppQuietly = 700,\r\n}\r\n\r\n/** Options that customize the way element location (i.e. *picking*) works.\r\n * @public\r\n */\r\nexport class LocateOptions {\r\n /** If true, also test graphics from view decorations. */\r\n public allowDecorations = false;\r\n /** If true, also test graphics with non-locatable flag set. */\r\n public allowNonLocatable = false;\r\n /** Maximum number of hits to return. */\r\n public maxHits = 20;\r\n /** The [[HitSource]] identifying the caller. */\r\n public hitSource = HitSource.DataPoint;\r\n /** If true, also test graphics from an IModelConnection other than the one associated with the Viewport. This can occur if, e.g., a\r\n * [[TiledGraphicsProvider]] is used to display graphics from a different iModel into the [[Viewport]].\r\n * @note If you override this, you must be prepared to properly handle [[HitDetail]]s originating from other IModelConnections.\r\n * @see [[HitDetail.iModel]] and [[HitDetail.isExternalIModelHit]]\r\n */\r\n public allowExternalIModels = false;\r\n /** If true, then the world point of a hit on a model will preserve any transforms applied to the model at display time,\r\n * such as those supplied by a [[ModelDisplayTransformProvider]] or [PlanProjectionSettings.elevation]($common).\r\n * Otherwise, the world point will be multiplied by the inverse of any such transforms to correlate it with the model's true coordinate space.\r\n */\r\n public preserveModelDisplayTransforms = false;\r\n\r\n /** Make a copy of this LocateOptions. */\r\n public clone(): LocateOptions {\r\n const other = new LocateOptions();\r\n other.allowDecorations = this.allowDecorations;\r\n other.allowNonLocatable = this.allowNonLocatable;\r\n other.maxHits = this.maxHits;\r\n other.hitSource = this.hitSource;\r\n other.allowExternalIModels = this.allowExternalIModels;\r\n return other;\r\n }\r\n public setFrom(other: LocateOptions): void {\r\n this.allowDecorations = other.allowDecorations;\r\n this.allowNonLocatable = other.allowNonLocatable;\r\n this.maxHits = other.maxHits;\r\n this.hitSource = other.hitSource;\r\n this.allowExternalIModels = other.allowExternalIModels;\r\n }\r\n public init() {\r\n this.allowDecorations = this.allowNonLocatable = this.allowExternalIModels = false;\r\n this.maxHits = 20;\r\n this.hitSource = HitSource.DataPoint;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class LocateResponse {\r\n public snapStatus = SnapStatus.Success;\r\n public reason?: string;\r\n public explanation = \"\";\r\n\r\n /** @internal */\r\n public clone(): LocateResponse {\r\n const other = new LocateResponse();\r\n other.snapStatus = this.snapStatus;\r\n other.reason = this.reason;\r\n other.explanation = this.explanation;\r\n return other;\r\n }\r\n\r\n /** @internal */\r\n public setFrom(other: LocateResponse): void {\r\n this.snapStatus = other.snapStatus;\r\n this.reason = other.reason;\r\n this.explanation = other.explanation;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport interface HitListHolder {\r\n setHitList(list: HitList<HitDetail> | undefined): void;\r\n}\r\n\r\n/** @public */\r\nexport class ElementPicker {\r\n public viewport?: Viewport;\r\n public readonly pickPointWorld = new Point3d();\r\n public hitList?: HitList<HitDetail>;\r\n\r\n public empty() {\r\n this.pickPointWorld.setZero();\r\n this.viewport = undefined;\r\n if (this.hitList)\r\n this.hitList.empty();\r\n else\r\n this.hitList = new HitList<HitDetail>();\r\n }\r\n\r\n /** return the HitList for the last Pick performed. Optionally allows the caller to take ownership of the list. */\r\n public getHitList(takeOwnership: boolean): HitList<HitDetail> {\r\n const list = this.hitList!;\r\n if (takeOwnership)\r\n this.hitList = undefined;\r\n return list;\r\n }\r\n\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** Return a hit from the list of hits created the last time pickElements was called. */\r\n public getHit(i: number): HitDetail | undefined { return this.hitList ? this.hitList.getHit(i) : undefined; }\r\n\r\n public resetCurrentHit(): void { if (this.hitList) this.hitList.resetCurrentHit(); }\r\n\r\n private getPixelPriority(pixel: Pixel.Data) {\r\n switch (pixel.type) {\r\n case Pixel.GeometryType.Surface:\r\n return Pixel.Planarity.Planar === pixel.planarity ? HitPriority.PlanarSurface : HitPriority.NonPlanarSurface;\r\n case Pixel.GeometryType.Linear:\r\n return HitPriority.WireEdge;\r\n case Pixel.GeometryType.Edge:\r\n return Pixel.Planarity.Planar === pixel.planarity ? HitPriority.PlanarEdge : HitPriority.NonPlanarEdge;\r\n case Pixel.GeometryType.Silhouette:\r\n return HitPriority.SilhouetteEdge;\r\n default:\r\n return HitPriority.Unknown;\r\n }\r\n }\r\n\r\n private comparePixel(pixel1: Pixel.Data, pixel2: Pixel.Data, distXY1: number, distXY2: number) {\r\n const priority1 = this.getPixelPriority(pixel1);\r\n const priority2 = this.getPixelPriority(pixel2);\r\n if (priority1 < priority2) return -1;\r\n if (priority1 > priority2) return 1;\r\n if (distXY1 < distXY2) return -1;\r\n if (distXY1 > distXY2) return 1;\r\n if (pixel1.distanceFraction > pixel2.distanceFraction) return -1;\r\n if (pixel1.distanceFraction < pixel2.distanceFraction) return 1;\r\n return 0;\r\n }\r\n\r\n /** Generate a list of elements that are close to a given point.\r\n * @returns The number of hits in the hitList of this object.\r\n */\r\n public doPick(vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions): number {\r\n if (this.hitList && this.hitList.length > 0 && vp === this.viewport && pickPointWorld.isAlmostEqual(this.pickPointWorld)) {\r\n this.hitList.resetCurrentHit();\r\n return this.hitList.length;\r\n }\r\n\r\n this.empty(); // empty the hit list\r\n this.viewport = vp;\r\n this.pickPointWorld.setFrom(pickPointWorld);\r\n\r\n const pickPointView = vp.worldToView(pickPointWorld);\r\n const testPointView = new Point2d(Math.floor(pickPointView.x + 0.5), Math.floor(pickPointView.y + 0.5));\r\n let pixelRadius = Math.floor(pickRadiusView + 0.5);\r\n const rect = new ViewRect(testPointView.x - pixelRadius, testPointView.y - pixelRadius, testPointView.x + pixelRadius, testPointView.y + pixelRadius);\r\n let result: number = 0;\r\n vp.readPixels(rect, Pixel.Selector.All, (pixels) => {\r\n if (undefined === pixels)\r\n return;\r\n\r\n testPointView.x = vp.cssPixelsToDevicePixels(testPointView.x);\r\n testPointView.y = vp.cssPixelsToDevicePixels(testPointView.y);\r\n pixelRadius = vp.cssPixelsToDevicePixels(pixelRadius);\r\n\r\n const elmHits = new Map<string, Point2d>();\r\n const testPoint = Point2d.createZero();\r\n for (testPoint.x = testPointView.x - pixelRadius; testPoint.x <= testPointView.x + pixelRadius; ++testPoint.x) {\r\n for (testPoint.y = testPointView.y - pixelRadius; testPoint.y <= testPointView.y + pixelRadius; ++testPoint.y) {\r\n const pixel = pixels.getPixel(testPoint.x, testPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId || Id64.isInvalid(pixel.elementId))\r\n continue; // no geometry at this location...\r\n\r\n const distXY = testPointView.distance(testPoint);\r\n if (distXY > pixelRadius)\r\n continue; // ignore corners. it's a locate circle not square...\r\n\r\n const oldPoint = elmHits.get(pixel.elementId);\r\n if (undefined !== oldPoint) {\r\n if (this.comparePixel(pixel, pixels.getPixel(oldPoint.x, oldPoint.y), distXY, testPointView.distance(oldPoint)) < 0)\r\n oldPoint.setFrom(testPoint); // new hit is better, update location...\r\n } else {\r\n elmHits.set(pixel.elementId, testPoint.clone());\r\n }\r\n }\r\n }\r\n if (0 === elmHits.size)\r\n return;\r\n\r\n for (const elmPoint of elmHits.values()) {\r\n const pixel = pixels.getPixel(elmPoint.x, elmPoint.y);\r\n if (undefined === pixel || undefined === pixel.elementId)\r\n continue;\r\n\r\n const hitPointWorld = vp.getPixelDataWorldPoint({\r\n pixels,\r\n x: elmPoint.x,\r\n y: elmPoint.y,\r\n preserveModelDisplayTransforms: options.preserveModelDisplayTransforms,\r\n });\r\n\r\n if (!hitPointWorld)\r\n continue;\r\n\r\n const modelId = undefined !== pixel.featureTable ? pixel.featureTable.modelId : undefined;\r\n const hit = new HitDetail(pickPointWorld, vp, options.hitSource, hitPointWorld, pixel.elementId, this.getPixelPriority(pixel), testPointView.distance(elmPoint), pixel.distanceFraction, pixel.subCategoryId, pixel.geometryClass, modelId, pixel.iModel, pixel.tileId, pixel.isClassifier);\r\n this.hitList!.addHit(hit);\r\n\r\n if (this.hitList!.hits.length > options.maxHits)\r\n this.hitList!.hits.length = options.maxHits; // truncate array...\r\n }\r\n\r\n result = this.hitList!.length;\r\n }, !options.allowNonLocatable);\r\n\r\n return result;\r\n }\r\n\r\n public testHit(hit: HitDetail, vp: ScreenViewport, pickPointWorld: Point3d, pickRadiusView: number, options: LocateOptions): boolean {\r\n if (0 === this.doPick(vp, pickPointWorld, pickRadiusView, options))\r\n return false;\r\n\r\n return this.hitList!.hits.some((thisHit) => hit.isSameHit(thisHit));\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class ElementLocateManager {\r\n public hitList?: HitList<HitDetail>;\r\n public currHit?: HitDetail;\r\n public readonly options = new LocateOptions();\r\n public readonly picker = new ElementPicker();\r\n\r\n /** get the full message key for a locate failure */\r\n public static getFailureMessageKey(key: string) { return `LocateFailure.${key}`; }\r\n public onInitialized() { }\r\n public get apertureInches() { return 0.11; }\r\n public get touchApertureInches() { return 0.22; }\r\n\r\n public clear(): void { this.setCurrHit(undefined); }\r\n public setHitList(list?: HitList<HitDetail>) { this.hitList = list; }\r\n public setCurrHit(hit?: HitDetail): void { this.currHit = hit; }\r\n public getNextHit(): HitDetail | undefined { return this.hitList ? this.hitList.getNextHit() : undefined; }\r\n\r\n /** return the current path from either the snapping logic or the pre-locating systems. */\r\n public getPreLocatedHit(): HitDetail | undefined {\r\n // NOTE: Check AccuSnap first as Tentative is used to build intersect snap. For normal snaps when a Tentative is active there should be no AccuSnap.\r\n let preLocated = IModelApp.accuSnap.getHitAndList(this);\r\n\r\n if (!preLocated && !!(preLocated = IModelApp.tentativePoint.getHitAndList(this))) {\r\n const vp = preLocated.viewport;\r\n this.picker.empty(); // Get new hit list at hit point; want reset to cycle hits using adjusted point location...\r\n this.picker.doPick(vp, preLocated.getPoint(), (vp.pixelsFromInches(this.apertureInches) / 2.0) + 1.5, this.options);\r\n this.setHitList(this.picker.getHitList(true));\r\n }\r\n\r\n if (this.hitList)\r\n this.hitList.resetCurrentHit();\r\n\r\n return preLocated;\r\n }\r\n\r\n public async filterHit(hit: HitDetail, _action: LocateAction, out: LocateResponse): Promise<LocateFilterStatus> {\r\n // Tools must opt-in to locate of transient geometry as it requires special treatment.\r\n if (!this.options.allowDecorations && !hit.isElementHit) {\r\n if (hit.isModelHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"RealityModel\");\r\n else if (hit.isMapHit)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Map\");\r\n else\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"Transient\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n // Tools must opt-in to locate geometry from external iModels.\r\n if (!this.options.allowExternalIModels && hit.isExternalIModelHit) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ExternalIModel\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n\r\n if (undefined !== hit.subCategoryId && !hit.isExternalIModelHit) {\r\n const appearance = hit.viewport.getSubCategoryAppearance(hit.subCategoryId);\r\n if (appearance.dontLocate) {\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"NotLocatableSubCategory\");\r\n return LocateFilterStatus.Reject;\r\n }\r\n }\r\n\r\n const tool = IModelApp.toolAdmin.activeTool;\r\n if (!(tool && tool instanceof InteractiveTool))\r\n return LocateFilterStatus.Accept;\r\n\r\n const status = await tool.filterHit(hit, out);\r\n if (LocateFilterStatus.Reject === status)\r\n out.reason = ElementLocateManager.getFailureMessageKey(\"ByApp\");\r\n\r\n return status;\r\n }\r\n\r\n public initLocateOptions() { this.options.init(); }\r\n public initToolLocate() {\r\n this.initLocateOptions();\r\n this.clear();\r\n this.picker.empty();\r\n IModelApp.tentativePoint.clear(true);\r\n }\r\n\r\n private async _doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, vp: ScreenViewport | undefined, source: InputSource, filterHits: boolean): Promise<HitDetail | undefined> {\r\n if (!vp)\r\n return;\r\n\r\n // the \"newSearch\" flag indicates whether the caller wants us to conduct a new search at the testPoint, or just continue returning paths from the previous search.\r\n if (newSearch) {\r\n const hit = this.getPreLocatedHit();\r\n\r\n // if we're snapped to something, that path has the highest priority and becomes the active hit.\r\n if (hit) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(hit, LocateAction.Identify, response))\r\n return hit;\r\n\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n this.picker.empty();\r\n this.picker.doPick(vp, testPoint, (vp.pixelsFromInches(InputSource.Touch === source ? this.touchApertureInches : this.apertureInches) / 2.0) + 1.5, this.options);\r\n\r\n const hitList = this.picker.getHitList(true);\r\n this.setHitList(hitList);\r\n }\r\n\r\n let newHit: HitDetail | undefined;\r\n while (undefined !== (newHit = this.getNextHit())) {\r\n if (!filterHits || LocateFilterStatus.Accept === await this.filterHit(newHit, LocateAction.Identify, response))\r\n return newHit;\r\n response = new LocateResponse(); // we have the reason and explanation we want.\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public async doLocate(response: LocateResponse, newSearch: boolean, testPoint: Point3d, view: ScreenViewport | undefined, source: InputSource, filterHits = true): Promise<HitDetail | undefined> {\r\n response.reason = ElementLocateManager.getFailureMessageKey(\"NoElements\");\r\n response.explanation = \"\";\r\n\r\n const hit = await this._doLocate(response, newSearch, testPoint, view, source, filterHits);\r\n this.setCurrHit(hit);\r\n\r\n // if we found a hit, remove it from the list of remaining hits near the current search point.\r\n if (hit && this.hitList)\r\n this.hitList.removeHitsFrom(hit.sourceId);\r\n return hit;\r\n }\r\n}\r\n"]}
|
package/lib/esm/ModelState.js
CHANGED
|
@@ -133,7 +133,7 @@ export class GeometricModelState extends ModelState {
|
|
|
133
133
|
// If this is a TileTree reality model, create it's reference
|
|
134
134
|
const tilesetUrl = this.jsonProperties.tilesetUrl;
|
|
135
135
|
if (tilesetUrl) {
|
|
136
|
-
const rdSourceKeyCS = RealityDataSource.
|
|
136
|
+
const rdSourceKeyCS = RealityDataSource.createKeyFromUrl(tilesetUrl);
|
|
137
137
|
return createRealityTileTreeReference({
|
|
138
138
|
rdSourceKey: rdSourceKeyCS,
|
|
139
139
|
url: tilesetUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelState.js","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAC0E,iBAAiB,EAAwB,cAAc,EAAE,kBAAkB,GAC3J,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,O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CAAC;CACnE;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC9D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC1D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAC7D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC;CACzE","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 ModelState\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RealityDataFormat, RealityDataSourceKey, RelatedElement, SpatialClassifiers,\r\n} from \"@itwin/core-common\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createPrimaryTileTreeReference, createRealityTileTreeReference, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewState } from \"./ViewState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\r\n /** @internal */\r\n public static override get className() { return \"Model\"; }\r\n public readonly modeledElement: RelatedElement;\r\n public readonly name: string;\r\n public parentModel: Id64String;\r\n public readonly isPrivate: boolean;\r\n public readonly isTemplate: boolean;\r\n\r\n constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState) {\r\n super(props, iModel, state);\r\n this.modeledElement = RelatedElement.fromJSON(props.modeledElement)!;\r\n this.name = props.name ? props.name : \"\";\r\n this.parentModel = Id64.fromJSON(props.parentModel)!; // NB! Must always match the model of the modeledElement!\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n }\r\n\r\n /** Add all custom-handled properties of a Model to a json object. */\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.modeledElement = this.modeledElement;\r\n val.parentModel = this.parentModel;\r\n val.name = this.name;\r\n if (this.isPrivate)\r\n val.isPrivate = this.isPrivate;\r\n if (this.isTemplate)\r\n val.isTemplate = this.isTemplate;\r\n return val;\r\n }\r\n\r\n /** Determine whether this is a GeometricModel */\r\n public get isGeometricModel(): boolean { return false; }\r\n\r\n /** Attempts to cast this model to a geometric model. */\r\n public get asGeometricModel(): GeometricModelState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 3d geometric model. */\r\n public get asGeometricModel3d(): GeometricModel3dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 2d geometric model. */\r\n public get asGeometricModel2d(): GeometricModel2dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a spatial model. */\r\n public get asSpatialModel(): SpatialModelState | undefined { return undefined; }\r\n\r\n /**\r\n * Return the tool tip for this model. This is called only if the hit does not return a tooltip.\r\n * @internal\r\n */\r\n public getToolTip(_hit: HitDetail): HTMLElement | string | undefined { return undefined; }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel]($backend).\r\n * The contents of a GeometricModelState can be rendered inside a [[Viewport]].\r\n * @public\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\r\n /** @internal */\r\n public static override get className() { return \"GeometricModel\"; }\r\n /** @internal */\r\n public geometryGuid?: string;\r\n\r\n private _modelRange?: Range3d;\r\n\r\n constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState) {\r\n super(props, iModel, state);\r\n this.geometryGuid = props.geometryGuid;\r\n }\r\n\r\n /** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */\r\n public abstract get is3d(): boolean;\r\n /** @internal */\r\n public override get asGeometricModel(): GeometricModelState { return this; }\r\n /** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */\r\n public get is2d(): boolean { return !this.is3d; }\r\n\r\n /** @internal */\r\n public override get isGeometricModel(): boolean { return true; }\r\n /** @internal */\r\n public get treeModelId(): Id64String { return this.id; }\r\n\r\n /** Query for the union of the ranges of all the elements in this GeometricModel.\r\n * @internal\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryModelRanges(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]);\r\n }\r\n return this._modelRange;\r\n }\r\n\r\n /** @internal */\r\n public createTileTreeReference(view: ViewState): TileTreeReference {\r\n // If this is a reality model, its tile tree is obtained from reality data service URL.\r\n\r\n const spatialModel = this.asSpatialModel;\r\n const rdSourceKey = this.jsonProperties.rdSourceKey;\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n const treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // url: tilesetUrl, // If rdSourceKey is defined, url is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // orbitGtBlob: props.orbitGtBlob!, // If rdSourceKey is defined, orbitGtBlob is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n });\r\n return treeRef;\r\n }\r\n\r\n const orbitGtBlob = this.jsonProperties.orbitGtBlob;\r\n\r\n // If this is an OrbitGt reality model, create it's reference\r\n if(orbitGtBlob) {\r\n let orbitGtName = \"\";\r\n if (orbitGtBlob.blobFileName !== \"\") {\r\n if (orbitGtBlob.blobFileName[0] === \"/\")\r\n orbitGtName = orbitGtBlob.blobFileName.substring(1);\r\n else\r\n orbitGtName = orbitGtBlob.blobFileName;\r\n }\r\n // Create rdSourceKey if not provided\r\n const rdSourceKeyOGT: RealityDataSourceKey = RealityDataSource.createKeyFromOrbitGtBlobProps(orbitGtBlob);\r\n\r\n return createOrbitGtTileTreeReference({\r\n rdSourceKey: rdSourceKeyOGT,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n orbitGtBlob,\r\n name: orbitGtName,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n });\r\n }\r\n\r\n // If this is a TileTree reality model, create it's reference\r\n const tilesetUrl = this.jsonProperties.tilesetUrl;\r\n\r\n if(tilesetUrl) {\r\n const rdSourceKeyCS = RealityDataSource.createRealityDataSourceKeyFromUrl(tilesetUrl);\r\n return createRealityTileTreeReference({\r\n rdSourceKey: rdSourceKeyCS,\r\n url : tilesetUrl,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this);\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\r\n /** @internal */\r\n public static override get className() { return \"GeometricModel2d\"; }\r\n /** @internal */\r\n public readonly globalOrigin: Point2d;\r\n\r\n constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState) {\r\n super(props, iModel, state);\r\n this.globalOrigin = Point2d.fromJSON(props.globalOrigin);\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return false; }\r\n /** @internal */\r\n public override get asGeometricModel2d(): GeometricModel2dState { return this; }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n val.globalOrigin = this.globalOrigin;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel3d]($backend).\r\n * @public\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\r\n /** @internal */\r\n public static override get className() { return \"GeometricModel3d\"; }\r\n\r\n constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState) {\r\n super(props, iModel, state);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return true; }\r\n /** @internal */\r\n public override get asGeometricModel3d(): GeometricModel3dState { return this; }\r\n\r\n /** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n}\r\n\r\n/** Represents the front-end state of a [SheetModel]($backend).\r\n * @public\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\r\n /** @internal */\r\n public static override get className() { return \"SheetModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialModel]($backend).\r\n * @public\r\n */\r\nexport class SpatialModelState extends GeometricModel3dState {\r\n /** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */\r\n public readonly classifiers?: SpatialClassifiers;\r\n\r\n /** @internal */\r\n public static override get className() { return \"SpatialModel\"; }\r\n /** @internal */\r\n public override get asSpatialModel(): SpatialModelState { return this; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState) {\r\n super(props, iModel, state);\r\n if (this.isRealityModel)\r\n this.classifiers = new SpatialClassifiers(this.jsonProperties);\r\n }\r\n /** Return true if this is a reality model (represented by a 3d tile set). */\r\n public get isRealityModel(): boolean {\r\n return undefined !== this.jsonProperties.tilesetUrl;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\r\n /** @internal */\r\n public static override get className() { return \"PhysicalModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialLocationModel]($backend).\r\n * @public\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\r\n /** @internal */\r\n public static override get className() { return \"SpatialLocationModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [DrawingModel]($backend).\r\n * @public\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\r\n /** @internal */\r\n public static override get className() { return \"DrawingModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SectionDrawingModel]($backend).\r\n * @public\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n /** @internal */\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ModelState.js","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB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cAAc,CAAC,UAAU,CAAC;IACtD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IACvD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC9D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC1D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAC7D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC;CACzE","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 ModelState\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RealityDataFormat, RealityDataSourceKey, RelatedElement, SpatialClassifiers,\r\n} from \"@itwin/core-common\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createPrimaryTileTreeReference, createRealityTileTreeReference, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewState } from \"./ViewState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\r\n /** @internal */\r\n public static override get className() { return \"Model\"; }\r\n public readonly modeledElement: RelatedElement;\r\n public readonly name: string;\r\n public parentModel: Id64String;\r\n public readonly isPrivate: boolean;\r\n public readonly isTemplate: boolean;\r\n\r\n constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState) {\r\n super(props, iModel, state);\r\n this.modeledElement = RelatedElement.fromJSON(props.modeledElement)!;\r\n this.name = props.name ? props.name : \"\";\r\n this.parentModel = Id64.fromJSON(props.parentModel)!; // NB! Must always match the model of the modeledElement!\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n }\r\n\r\n /** Add all custom-handled properties of a Model to a json object. */\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.modeledElement = this.modeledElement;\r\n val.parentModel = this.parentModel;\r\n val.name = this.name;\r\n if (this.isPrivate)\r\n val.isPrivate = this.isPrivate;\r\n if (this.isTemplate)\r\n val.isTemplate = this.isTemplate;\r\n return val;\r\n }\r\n\r\n /** Determine whether this is a GeometricModel */\r\n public get isGeometricModel(): boolean { return false; }\r\n\r\n /** Attempts to cast this model to a geometric model. */\r\n public get asGeometricModel(): GeometricModelState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 3d geometric model. */\r\n public get asGeometricModel3d(): GeometricModel3dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 2d geometric model. */\r\n public get asGeometricModel2d(): GeometricModel2dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a spatial model. */\r\n public get asSpatialModel(): SpatialModelState | undefined { return undefined; }\r\n\r\n /**\r\n * Return the tool tip for this model. This is called only if the hit does not return a tooltip.\r\n * @internal\r\n */\r\n public getToolTip(_hit: HitDetail): HTMLElement | string | undefined { return undefined; }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel]($backend).\r\n * The contents of a GeometricModelState can be rendered inside a [[Viewport]].\r\n * @public\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\r\n /** @internal */\r\n public static override get className() { return \"GeometricModel\"; }\r\n /** @internal */\r\n public geometryGuid?: string;\r\n\r\n private _modelRange?: Range3d;\r\n\r\n constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState) {\r\n super(props, iModel, state);\r\n this.geometryGuid = props.geometryGuid;\r\n }\r\n\r\n /** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */\r\n public abstract get is3d(): boolean;\r\n /** @internal */\r\n public override get asGeometricModel(): GeometricModelState { return this; }\r\n /** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */\r\n public get is2d(): boolean { return !this.is3d; }\r\n\r\n /** @internal */\r\n public override get isGeometricModel(): boolean { return true; }\r\n /** @internal */\r\n public get treeModelId(): Id64String { return this.id; }\r\n\r\n /** Query for the union of the ranges of all the elements in this GeometricModel.\r\n * @internal\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryModelRanges(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]);\r\n }\r\n return this._modelRange;\r\n }\r\n\r\n /** @internal */\r\n public createTileTreeReference(view: ViewState): TileTreeReference {\r\n // If this is a reality model, its tile tree is obtained from reality data service URL.\r\n\r\n const spatialModel = this.asSpatialModel;\r\n const rdSourceKey = this.jsonProperties.rdSourceKey;\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n const treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // url: tilesetUrl, // If rdSourceKey is defined, url is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // orbitGtBlob: props.orbitGtBlob!, // If rdSourceKey is defined, orbitGtBlob is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n });\r\n return treeRef;\r\n }\r\n\r\n const orbitGtBlob = this.jsonProperties.orbitGtBlob;\r\n\r\n // If this is an OrbitGt reality model, create it's reference\r\n if(orbitGtBlob) {\r\n let orbitGtName = \"\";\r\n if (orbitGtBlob.blobFileName !== \"\") {\r\n if (orbitGtBlob.blobFileName[0] === \"/\")\r\n orbitGtName = orbitGtBlob.blobFileName.substring(1);\r\n else\r\n orbitGtName = orbitGtBlob.blobFileName;\r\n }\r\n // Create rdSourceKey if not provided\r\n const rdSourceKeyOGT: RealityDataSourceKey = RealityDataSource.createKeyFromOrbitGtBlobProps(orbitGtBlob);\r\n\r\n return createOrbitGtTileTreeReference({\r\n rdSourceKey: rdSourceKeyOGT,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n orbitGtBlob,\r\n name: orbitGtName,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n });\r\n }\r\n\r\n // If this is a TileTree reality model, create it's reference\r\n const tilesetUrl = this.jsonProperties.tilesetUrl;\r\n\r\n if(tilesetUrl) {\r\n const rdSourceKeyCS = RealityDataSource.createKeyFromUrl(tilesetUrl);\r\n return createRealityTileTreeReference({\r\n rdSourceKey: rdSourceKeyCS,\r\n url : tilesetUrl,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this);\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\r\n /** @internal */\r\n public static override get className() { return \"GeometricModel2d\"; }\r\n /** @internal */\r\n public readonly globalOrigin: Point2d;\r\n\r\n constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState) {\r\n super(props, iModel, state);\r\n this.globalOrigin = Point2d.fromJSON(props.globalOrigin);\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return false; }\r\n /** @internal */\r\n public override get asGeometricModel2d(): GeometricModel2dState { return this; }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n val.globalOrigin = this.globalOrigin;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel3d]($backend).\r\n * @public\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\r\n /** @internal */\r\n public static override get className() { return \"GeometricModel3d\"; }\r\n\r\n constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState) {\r\n super(props, iModel, state);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n\r\n /** @internal */\r\n public get is3d(): boolean { return true; }\r\n /** @internal */\r\n public override get asGeometricModel3d(): GeometricModel3dState { return this; }\r\n\r\n /** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n}\r\n\r\n/** Represents the front-end state of a [SheetModel]($backend).\r\n * @public\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\r\n /** @internal */\r\n public static override get className() { return \"SheetModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialModel]($backend).\r\n * @public\r\n */\r\nexport class SpatialModelState extends GeometricModel3dState {\r\n /** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */\r\n public readonly classifiers?: SpatialClassifiers;\r\n\r\n /** @internal */\r\n public static override get className() { return \"SpatialModel\"; }\r\n /** @internal */\r\n public override get asSpatialModel(): SpatialModelState { return this; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState) {\r\n super(props, iModel, state);\r\n if (this.isRealityModel)\r\n this.classifiers = new SpatialClassifiers(this.jsonProperties);\r\n }\r\n /** Return true if this is a reality model (represented by a 3d tile set). */\r\n public get isRealityModel(): boolean {\r\n return undefined !== this.jsonProperties.tilesetUrl;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\r\n /** @internal */\r\n public static override get className() { return \"PhysicalModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialLocationModel]($backend).\r\n * @public\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\r\n /** @internal */\r\n public static override get className() { return \"SpatialLocationModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [DrawingModel]($backend).\r\n * @public\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\r\n /** @internal */\r\n public static override get className() { return \"DrawingModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SectionDrawingModel]($backend).\r\n * @public\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n /** @internal */\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
|
@@ -1,36 +1,60 @@
|
|
|
1
1
|
import { GuidString } from "@itwin/core-bentley";
|
|
2
|
-
import { OrbitGtBlobProps, RealityDataFormat, RealityDataProvider, RealityDataSourceKey
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param props JSON representation of the reality data source
|
|
17
|
-
*/
|
|
18
|
-
protected constructor(props: RealityDataSourceProps);
|
|
19
|
-
static createRealityDataSourceKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey;
|
|
20
|
-
static createFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey;
|
|
21
|
-
static createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey;
|
|
22
|
-
static createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined;
|
|
23
|
-
/** Construct a new reality data source.
|
|
24
|
-
* @param props JSON representation of the reality data source
|
|
25
|
-
*/
|
|
26
|
-
static fromProps(props: RealityDataSourceProps): RealityDataSource;
|
|
27
|
-
get isContextShare(): boolean;
|
|
28
|
-
get realityDataId(): string | undefined;
|
|
29
|
-
get iTwinId(): string | undefined;
|
|
2
|
+
import { OrbitGtBlobProps, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from "@itwin/core-common";
|
|
3
|
+
import { RealityData } from "./RealityDataAccessProps";
|
|
4
|
+
/**
|
|
5
|
+
* This interface provide methods used to access a reality data from a reality data provider
|
|
6
|
+
* @alpha
|
|
7
|
+
*/
|
|
8
|
+
export interface RealityDataSource {
|
|
9
|
+
readonly key: RealityDataSourceKey;
|
|
10
|
+
readonly isContextShare: boolean;
|
|
11
|
+
readonly realityDataId: string | undefined;
|
|
12
|
+
/** Metatdata on the reality data source */
|
|
13
|
+
readonly realityData: RealityData | undefined;
|
|
14
|
+
/** The reality data type (e.g.: "RealityMesh3DTiles", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/
|
|
15
|
+
readonly realityDataType: string | undefined;
|
|
30
16
|
/**
|
|
31
|
-
* This method returns the URL to
|
|
17
|
+
* This method returns the URL to obtain the Reality Data properties.
|
|
18
|
+
* @param iTwinId id of associated iTwin project
|
|
32
19
|
* @returns string containing the URL to reality data.
|
|
33
20
|
*/
|
|
34
21
|
getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets a reality data root document json
|
|
24
|
+
* @returns tile data json
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
getRootDocument(iTwinId: GuidString | undefined): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets tile content
|
|
30
|
+
* @param name name or path of tile
|
|
31
|
+
* @returns array buffer of tile content
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
getTileContent(name: string): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Gets a tileset's app data json
|
|
37
|
+
* @param name name or path of tile
|
|
38
|
+
* @returns app data json object
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
getTileJson(name: string): Promise<any>;
|
|
42
|
+
}
|
|
43
|
+
/** @alpha */
|
|
44
|
+
export declare namespace RealityDataSource {
|
|
45
|
+
/** Utility function to convert a RealityDataSourceKey into its string representation
|
|
46
|
+
* @alpha
|
|
47
|
+
*/
|
|
48
|
+
function keyToString(rdSourceKey: RealityDataSourceKey): string;
|
|
49
|
+
function formatfromUrl(tilesetUrl: string): RealityDataFormat;
|
|
50
|
+
function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey;
|
|
51
|
+
function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey;
|
|
52
|
+
function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey;
|
|
53
|
+
function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined;
|
|
54
|
+
/** Return an instance of a RealityDataSource from a source key.
|
|
55
|
+
* There will aways be only one reality data RealityDataSource for a corresponding reality data source key.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
function fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
|
|
35
59
|
}
|
|
36
60
|
//# sourceMappingURL=RealityDataSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSource.d.ts","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RealityDataSource.d.ts","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAMA,OAAO,EAA8B,UAAU,EAAU,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAe,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAA0B,MAAM,oBAAoB,CAAC;AAGzJ,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9C,kGAAkG;IAClG,QAAQ,CAAC,eAAe,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