@itwin/core-frontend 5.0.0-dev.99 → 5.1.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +20 -41
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/AccuSnap.d.ts +1 -0
- package/lib/cjs/AccuSnap.d.ts.map +1 -1
- package/lib/cjs/AccuSnap.js +69 -1
- package/lib/cjs/AccuSnap.js.map +1 -1
- package/lib/cjs/BriefcaseConnection.d.ts +1 -1
- package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/CatalogConnection.d.ts +71 -0
- package/lib/cjs/CatalogConnection.d.ts.map +1 -0
- package/lib/cjs/CatalogConnection.js +95 -0
- package/lib/cjs/CatalogConnection.js.map +1 -0
- package/lib/cjs/ElementLocateManager.d.ts.map +1 -1
- package/lib/cjs/ElementLocateManager.js +5 -2
- package/lib/cjs/ElementLocateManager.js.map +1 -1
- package/lib/cjs/HitDetail.d.ts +29 -2
- package/lib/cjs/HitDetail.d.ts.map +1 -1
- package/lib/cjs/HitDetail.js +14 -0
- package/lib/cjs/HitDetail.js.map +1 -1
- package/lib/cjs/IpcApp.d.ts +1 -1
- package/lib/cjs/IpcApp.d.ts.map +1 -1
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/ModelState.d.ts.map +1 -1
- package/lib/cjs/ModelState.js +7 -5
- package/lib/cjs/ModelState.js.map +1 -1
- package/lib/cjs/NativeApp.d.ts +2 -1
- package/lib/cjs/NativeApp.d.ts.map +1 -1
- package/lib/cjs/NativeApp.js +1 -0
- package/lib/cjs/NativeApp.js.map +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +1 -0
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +1 -0
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +1 -0
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/internal/cross-package.d.ts +1 -1
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +3 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts +2 -0
- package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js +7 -0
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.d.ts +0 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.js +11 -20
- package/lib/cjs/internal/render/webgl/MapLayerParams.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SceneCompositor.d.ts +9 -0
- package/lib/cjs/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/SceneCompositor.js +86 -11
- package/lib/cjs/internal/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ShaderBuilder.d.ts +4 -3
- package/lib/cjs/internal/render/webgl/ShaderBuilder.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ShaderBuilder.js +3 -3
- package/lib/cjs/internal/render/webgl/ShaderBuilder.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SolarShadowMap.js +2 -2
- package/lib/cjs/internal/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SurfaceGeometry.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/SurfaceGeometry.js +20 -8
- package/lib/cjs/internal/render/webgl/SurfaceGeometry.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Atmosphere.js +1 -1
- package/lib/cjs/internal/render/webgl/glsl/ClearPickAndColor.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/ClearPickAndColor.js +2 -1
- package/lib/cjs/internal/render/webgl/glsl/ClearPickAndColor.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Contours.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Contours.js +31 -1
- package/lib/cjs/internal/render/webgl/glsl/Contours.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Fragment.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Fragment.js +7 -2
- package/lib/cjs/internal/render/webgl/glsl/Fragment.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Surface.js +1 -1
- package/lib/cjs/internal/tile/GraphicsCollector.d.ts +1 -0
- package/lib/cjs/internal/tile/GraphicsCollector.d.ts.map +1 -1
- package/lib/cjs/internal/tile/GraphicsCollector.js +1 -0
- package/lib/cjs/internal/tile/GraphicsCollector.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.js +5 -0
- package/lib/cjs/internal/tile/IModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts +4 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +5 -0
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/ImdlDecoder.d.ts +2 -0
- package/lib/cjs/internal/tile/ImdlDecoder.d.ts.map +1 -1
- package/lib/cjs/internal/tile/ImdlDecoder.js.map +1 -1
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.d.ts +2 -2
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.d.ts.map +1 -1
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.js +2 -1
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.js.map +1 -1
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeHandler.d.ts +3 -3
- package/lib/cjs/internal/tile/LayerTileTreeHandler.d.ts.map +1 -0
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeHandler.js +3 -2
- package/lib/cjs/internal/tile/LayerTileTreeHandler.js.map +1 -0
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeReferenceHandler.d.ts +7 -5
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -0
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeReferenceHandler.js +29 -4
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -0
- package/lib/cjs/internal/tile/PrimaryTileTree.d.ts +9 -4
- package/lib/cjs/internal/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/PrimaryTileTree.js +30 -8
- package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +0 -2
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +2 -21
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/render/Pixel.d.ts +13 -2
- package/lib/cjs/render/Pixel.d.ts.map +1 -1
- package/lib/cjs/render/Pixel.js +20 -8
- package/lib/cjs/render/Pixel.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.d.ts +3 -2
- package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +1 -0
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/internal.d.ts +3 -2
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +3 -2
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +2 -3
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +2 -4
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tools/AccuDrawTool.d.ts +0 -12
- package/lib/cjs/tools/AccuDrawTool.d.ts.map +1 -1
- package/lib/cjs/tools/AccuDrawTool.js +2 -60
- package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts +0 -1
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.js +15 -19
- package/lib/cjs/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +25 -16
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +29 -40
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuDraw.d.ts.map +1 -1
- package/lib/esm/AccuDraw.js +21 -42
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/AccuSnap.d.ts +1 -0
- package/lib/esm/AccuSnap.d.ts.map +1 -1
- package/lib/esm/AccuSnap.js +69 -1
- package/lib/esm/AccuSnap.js.map +1 -1
- package/lib/esm/BriefcaseConnection.d.ts +1 -1
- package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/CatalogConnection.d.ts +71 -0
- package/lib/esm/CatalogConnection.d.ts.map +1 -0
- package/lib/esm/CatalogConnection.js +92 -0
- package/lib/esm/CatalogConnection.js.map +1 -0
- package/lib/esm/ElementLocateManager.d.ts.map +1 -1
- package/lib/esm/ElementLocateManager.js +5 -2
- package/lib/esm/ElementLocateManager.js.map +1 -1
- package/lib/esm/HitDetail.d.ts +29 -2
- package/lib/esm/HitDetail.d.ts.map +1 -1
- package/lib/esm/HitDetail.js +14 -0
- package/lib/esm/HitDetail.js.map +1 -1
- package/lib/esm/IpcApp.d.ts +1 -1
- package/lib/esm/IpcApp.d.ts.map +1 -1
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/ModelState.d.ts.map +1 -1
- package/lib/esm/ModelState.js +7 -5
- package/lib/esm/ModelState.js.map +1 -1
- package/lib/esm/NativeApp.d.ts +2 -1
- package/lib/esm/NativeApp.d.ts.map +1 -1
- package/lib/esm/NativeApp.js +1 -0
- package/lib/esm/NativeApp.js.map +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +1 -0
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +1 -0
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +1 -0
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/internal/cross-package.d.ts +1 -1
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts +2 -0
- package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js +8 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.d.ts +0 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.js +11 -20
- package/lib/esm/internal/render/webgl/MapLayerParams.js.map +1 -1
- package/lib/esm/internal/render/webgl/SceneCompositor.d.ts +9 -0
- package/lib/esm/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/SceneCompositor.js +86 -11
- package/lib/esm/internal/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/esm/internal/render/webgl/ShaderBuilder.d.ts +4 -3
- package/lib/esm/internal/render/webgl/ShaderBuilder.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ShaderBuilder.js +3 -3
- package/lib/esm/internal/render/webgl/ShaderBuilder.js.map +1 -1
- package/lib/esm/internal/render/webgl/SolarShadowMap.js +2 -2
- package/lib/esm/internal/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/esm/internal/render/webgl/SurfaceGeometry.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/SurfaceGeometry.js +20 -8
- package/lib/esm/internal/render/webgl/SurfaceGeometry.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Atmosphere.js +1 -1
- package/lib/esm/internal/render/webgl/glsl/ClearPickAndColor.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/ClearPickAndColor.js +2 -1
- package/lib/esm/internal/render/webgl/glsl/ClearPickAndColor.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Contours.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Contours.js +31 -1
- package/lib/esm/internal/render/webgl/glsl/Contours.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Fragment.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Fragment.js +7 -2
- package/lib/esm/internal/render/webgl/glsl/Fragment.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/RealityMesh.js +1 -1
- package/lib/esm/internal/render/webgl/glsl/Surface.js +1 -1
- package/lib/esm/internal/tile/GraphicsCollector.d.ts +1 -0
- package/lib/esm/internal/tile/GraphicsCollector.d.ts.map +1 -1
- package/lib/esm/internal/tile/GraphicsCollector.js +1 -0
- package/lib/esm/internal/tile/GraphicsCollector.js.map +1 -1
- package/lib/esm/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTile.js +6 -1
- package/lib/esm/internal/tile/IModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts +4 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +6 -1
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/ImdlDecoder.d.ts +2 -0
- package/lib/esm/internal/tile/ImdlDecoder.d.ts.map +1 -1
- package/lib/esm/internal/tile/ImdlDecoder.js.map +1 -1
- package/lib/esm/internal/tile/ImdlGraphicsCreator.d.ts +2 -2
- package/lib/esm/internal/tile/ImdlGraphicsCreator.d.ts.map +1 -1
- package/lib/esm/internal/tile/ImdlGraphicsCreator.js +2 -1
- package/lib/esm/internal/tile/ImdlGraphicsCreator.js.map +1 -1
- package/lib/esm/{tile → internal/tile}/LayerTileTreeHandler.d.ts +3 -3
- package/lib/esm/internal/tile/LayerTileTreeHandler.d.ts.map +1 -0
- package/lib/esm/{tile → internal/tile}/LayerTileTreeHandler.js +3 -2
- package/lib/esm/internal/tile/LayerTileTreeHandler.js.map +1 -0
- package/lib/esm/{tile → internal/tile}/LayerTileTreeReferenceHandler.d.ts +7 -5
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -0
- package/lib/esm/{tile → internal/tile}/LayerTileTreeReferenceHandler.js +29 -4
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -0
- package/lib/esm/internal/tile/PrimaryTileTree.d.ts +9 -4
- package/lib/esm/internal/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/PrimaryTileTree.js +32 -10
- package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts +0 -2
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +2 -21
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/render/Pixel.d.ts +13 -2
- package/lib/esm/render/Pixel.d.ts.map +1 -1
- package/lib/esm/render/Pixel.js +20 -8
- package/lib/esm/render/Pixel.js.map +1 -1
- package/lib/esm/tile/ImdlReader.d.ts +3 -2
- package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
- package/lib/esm/tile/ImdlReader.js +1 -0
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/internal.d.ts +3 -2
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +3 -2
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.d.ts +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +3 -4
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +2 -4
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tools/AccuDrawTool.d.ts +0 -12
- package/lib/esm/tools/AccuDrawTool.d.ts.map +1 -1
- package/lib/esm/tools/AccuDrawTool.js +3 -60
- package/lib/esm/tools/AccuDrawTool.js.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.d.ts +0 -1
- package/lib/esm/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.js +16 -20
- package/lib/esm/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +25 -16
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +29 -40
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/lib/public/locales/en/CoreTools.json +0 -5
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/public/sprites/SnapPerpendicularPoint.png +0 -0
- package/lib/public/sprites/SnapTangentPoint.png +0 -0
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +16 -16
- package/lib/cjs/tile/LayerTileTreeHandler.d.ts.map +0 -1
- package/lib/cjs/tile/LayerTileTreeHandler.js.map +0 -1
- package/lib/cjs/tile/LayerTileTreeReferenceHandler.d.ts.map +0 -1
- package/lib/cjs/tile/LayerTileTreeReferenceHandler.js.map +0 -1
- package/lib/esm/tile/LayerTileTreeHandler.d.ts.map +0 -1
- package/lib/esm/tile/LayerTileTreeHandler.js.map +0 -1
- package/lib/esm/tile/LayerTileTreeReferenceHandler.d.ts.map +0 -1
- package/lib/esm/tile/LayerTileTreeReferenceHandler.js.map +0 -1
package/lib/esm/HitDetail.js
CHANGED
|
@@ -24,6 +24,8 @@ export var SnapMode;
|
|
|
24
24
|
SnapMode[SnapMode["Origin"] = 16] = "Origin";
|
|
25
25
|
SnapMode[SnapMode["Bisector"] = 32] = "Bisector";
|
|
26
26
|
SnapMode[SnapMode["Intersection"] = 64] = "Intersection";
|
|
27
|
+
SnapMode[SnapMode["PerpendicularPoint"] = 128] = "PerpendicularPoint";
|
|
28
|
+
SnapMode[SnapMode["TangentPoint"] = 256] = "TangentPoint";
|
|
27
29
|
})(SnapMode || (SnapMode = {}));
|
|
28
30
|
/**
|
|
29
31
|
* @public
|
|
@@ -155,6 +157,10 @@ export class HitDetail {
|
|
|
155
157
|
* @beta
|
|
156
158
|
*/
|
|
157
159
|
get path() { return this._props.path; }
|
|
160
|
+
/** Information about the [contour line]($docs/learning/display/ContourDisplay.md), if any, from which this hit originated.
|
|
161
|
+
* @beta
|
|
162
|
+
*/
|
|
163
|
+
get contour() { return this._props.contour; }
|
|
158
164
|
/** @internal */
|
|
159
165
|
constructor(arg0, viewport, hitSource, hitPoint, sourceId, priority, distXY, distFraction, subCategoryId, geometryClass, modelId, sourceIModel, tileId, isClassifier) {
|
|
160
166
|
if (arg0 instanceof Point3d) {
|
|
@@ -198,6 +204,7 @@ export class HitDetail {
|
|
|
198
204
|
tileId: arg0.tileId,
|
|
199
205
|
isClassifier: arg0.isClassifier,
|
|
200
206
|
path,
|
|
207
|
+
contour: arg0.contour,
|
|
201
208
|
};
|
|
202
209
|
}
|
|
203
210
|
}
|
|
@@ -298,6 +305,11 @@ export class SnapDetail extends HitDetail {
|
|
|
298
305
|
this.adjustedPoint.setFrom(point);
|
|
299
306
|
this.heat = heat;
|
|
300
307
|
}
|
|
308
|
+
/** Change the snap mode. */
|
|
309
|
+
setSnapMode(snapMode) {
|
|
310
|
+
this.snapMode = snapMode;
|
|
311
|
+
this.sprite = IconSprites.getSpriteFromUrl(SnapDetail.getSnapSpriteUrl(snapMode));
|
|
312
|
+
}
|
|
301
313
|
/** Set curve primitive and HitGeometryType for this SnapDetail. */
|
|
302
314
|
setCurvePrimitive(primitive, localToWorld, geomType) {
|
|
303
315
|
this.primitive = primitive;
|
|
@@ -389,6 +401,8 @@ export class SnapDetail extends HitDetail {
|
|
|
389
401
|
case SnapMode.Origin: return `${IModelApp.publicPath}sprites/SnapOrigin.png`;
|
|
390
402
|
case SnapMode.Bisector: return `${IModelApp.publicPath}sprites/SnapBisector.png`;
|
|
391
403
|
case SnapMode.Intersection: return `${IModelApp.publicPath}sprites/SnapIntersection.png`;
|
|
404
|
+
case SnapMode.PerpendicularPoint: return `${IModelApp.publicPath}sprites/SnapPerpendicularPoint.png`;
|
|
405
|
+
case SnapMode.TangentPoint: return `${IModelApp.publicPath}sprites/SnapTangentPoint.png`;
|
|
392
406
|
}
|
|
393
407
|
return "";
|
|
394
408
|
}
|
package/lib/esm/HitDetail.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HitDetail.js","sourceRoot":"","sources":["../../src/HitDetail.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAkB,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAiC,MAAM,sBAAsB,CAAC;AACxI,OAAO,EAAiB,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AC;QACd,OAAO,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAChD,IAAI,UAAU,GAAG,CAAC;gBAChB,MAAM;QACV,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4DAA4D;IACrD,SAAS,CAAC,CAAS,EAAE,GAAM;QAChC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;YAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;YAEpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LocatingElements\n */\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { Arc3d, CurvePrimitive, LineSegment3d, LineString3d, Path, Point3d, Transform, Vector3d, XYZProps } from \"@itwin/core-geometry\";\nimport { GeometryClass, LinePixels } from \"@itwin/core-common\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { IconSprites, Sprite } from \"./Sprites\";\nimport { DecorateContext } from \"./ViewContext\";\nimport { ScreenViewport, Viewport } from \"./Viewport\";\nimport { GraphicType } from \"./common/render/GraphicType\";\n\n/**\n * @public\n * @extensions\n */\nexport enum SnapMode {\n Nearest = 1,\n NearestKeypoint = 1 << 1,\n MidPoint = 1 << 2,\n Center = 1 << 3,\n Origin = 1 << 4,\n Bisector = 1 << 5,\n Intersection = 1 << 6,\n}\n\n/**\n * @public\n * @extensions\n */\nexport enum SnapHeat {\n None = 0,\n NotInRange = 1, // \"of interest\", but out of range\n InRange = 2,\n}\n\n/** The procedure that generated this Hit.\n * @public\n * @extensions\n */\nexport enum HitSource {\n None = 0,\n FromUser = 1,\n MotionLocate = 2,\n AccuSnap = 3,\n TentativeSnap = 4,\n DataPoint = 5,\n Application = 6,\n EditAction = 7,\n EditActionSS = 8,\n}\n\n/** What was being tested to generate this hit. This is not the element or\n * GeometricPrimitive that generated the Hit, it is an indication of whether it is an edge or interior hit.\n * @public\n * @extensions\n */\nexport enum HitGeomType {\n None = 0,\n Point = 1,\n Segment = 2,\n Curve = 3,\n Arc = 4,\n Surface = 5,\n}\n\n/** Classification of GeometricPrimitive that generated the Hit.\n * @public\n * @extensions\n */\nexport enum HitParentGeomType {\n None = 0,\n Wire = 1,\n Sheet = 2,\n Solid = 3,\n Mesh = 4,\n Text = 5,\n}\n\n/**\n * @public\n * @extensions\n */\nexport enum HitPriority {\n WireEdge = 0,\n PlanarEdge = 1,\n NonPlanarEdge = 2,\n SilhouetteEdge = 3,\n PlanarSurface = 4,\n NonPlanarSurface = 5,\n Unknown = 6,\n}\n\n/**\n * @public\n * @extensions\n */\nexport enum HitDetailType {\n Hit = 1,\n Snap = 2,\n Intersection = 3,\n}\n\n/** As part of a [[HitPath]], describes the [ViewAttachment]($backend), if any, from which the hit represented by a [[HitDetail]] originated.\n * @beta\n */\nexport interface ViewAttachmentHitInfo {\n /** The element Id of the [ViewAttachment]($backend) from which the hit originated. */\n readonly id: Id64String;\n /** The viewport that renders the contents of the attached view into the [[ScreenViewport]].\n * @note Do not alter the state of this viewport.\n * @alpha\n */\n readonly viewport: Viewport;\n}\n\n/** As part of a [[HitPath]], describes the [SectionDrawing]($backend), if any, from which the hit represented by a [[HitDetail]] originated.\n * @beta\n */\nexport interface SectionDrawingAttachmentHitInfo {\n /** The viewport that renders the contents of the attached view into the [[ScreenViewport]].\n * @note Do not alter the state of this viewport.\n * @alpha\n */\n readonly viewport: Viewport;\n}\n\n/** As part of a [[HitDetail]], describes a series of \"attached\" views through which the hit was located.\n * Typically, the contents of a view are rendered directly to the screen via [[HitDetail.viewport]].\n * However, in some contexts one view might be \"attached\" to the viewport's view via a [ViewAttachment]($backend), [SectionDrawing]($backend), or both.\n * HitPath captures this information in one of the following possible ways:\n * 1. A [[SheetViewState]] renders another view through a [ViewAttachment]($backend), in which case [[viewAttachment]] will be defined.\n * 2. A [[DrawingViewState]] renders a [[SpatialViewState]] through a [SectionDrawing]($backend) attachment, in which case [[sectionDrawingAttachment]] will be defined; or\n * 3. A combination of 1 and 2 where a [ViewAttachment]($backend) on a sheet renders a [SectionDrawing]($backend) with an attached [[SpatialViewState]], in which both [viewAttachment]] and [[sectionDrawingAttachment]] will be defined.\n * @beta\n */\nexport interface HitPath {\n /** Details about the [ViewAttachment]($backend) through which the hit was obtained. */\n viewAttachment?: ViewAttachmentHitInfo;\n /** Details about the [SectionDrawing]($backend) attachment through which the hit was obtained. */\n sectionDrawingAttachment?: SectionDrawingAttachmentHitInfo;\n};\n\n/** Arguments supplied to the [[HitDetail]] constructor.\n * @public\n */\nexport interface HitDetailProps {\n /** The point in world coordinates that was used as the initial locate point. */\n readonly testPoint: Point3d;\n /** The viewport in which the locate operation was performed. */\n readonly viewport: ScreenViewport;\n /** The procedure that requested the locate operation. */\n readonly hitSource: HitSource;\n /** The approximate location in world coordinates on the geometry identified by this HitDetail. */\n readonly hitPoint: Point3d;\n /** The source of the geometry. This may be a persistent element Id, or a transient Id used for, e.g., pickable decorations. */\n readonly sourceId: Id64String;\n /** The hit geometry priority/classification. */\n readonly priority: HitPriority;\n /** The xy distance to the hit in view coordinates. */\n readonly distXY: number;\n /** The distance in view coordinates between the hit and the near plane. */\n readonly distFraction: number;\n /** The [SubCategory]($backend) to which the hit geometry belongs. */\n readonly subCategoryId?: Id64String;\n /** The class of the hit geometry. */\n readonly geometryClass?: GeometryClass;\n /** The Id of the [[ModelState]] from which the hit originated. */\n readonly modelId?: string;\n /** The IModelConnection from which the hit originated.\n * This should almost always be left undefined, unless the hit is known to have originated from an iModel\n * other than the one associated with the viewport.\n * @internal\n */\n readonly sourceIModel?: IModelConnection;\n /** @internal */\n readonly transformFromSourceIModel?: Transform;\n /** @internal chiefly for debugging */\n readonly tileId?: string;\n /** True if the hit originated from a reality model classifier.\n * @alpha\n */\n readonly isClassifier?: boolean;\n /** Describes the path by which the hit was located through a series of attached views.\n * @beta\n */\n readonly path?: HitPath;\n}\n\n/** A HitDetail stores the result when locating geometry displayed in a view.\n * It holds an approximate location on an element (or decoration) from a *pick*.\n * @public\n * @extensions\n */\nexport class HitDetail {\n private readonly _props: HitDetailProps;\n\n /** The point in world coordinates that was used as the initial locate point. */\n public get testPoint(): Point3d { return this._props.testPoint; }\n /** The viewport in which the locate operation was performed. */\n public get viewport(): ScreenViewport { return this._props.viewport; }\n /** The procedure that requested the locate operation. */\n public get hitSource(): HitSource { return this._props.hitSource; }\n /** The approximate location in world coordinates on the geometry identified by this HitDetail. */\n public get hitPoint(): Point3d { return this._props.hitPoint; }\n /** The source of the geometry. This may be a persistent element Id, or a transient Id used for, e.g., pickable decorations. */\n public get sourceId(): Id64String { return this._props.sourceId; }\n /** The hit geometry priority/classification. */\n public get priority(): HitPriority { return this._props.priority; }\n /** The xy distance to the hit in view coordinates. */\n public get distXY(): number { return this._props.distXY; }\n /** The distance in view coordinates between the hit and the near plane. */\n public get distFraction(): number { return this._props.distFraction; }\n /** The [SubCategory]($backend) to which the hit geometry belongs. */\n public get subCategoryId(): Id64String | undefined { return this._props.subCategoryId; }\n /** The class of the hit geometry. */\n public get geometryClass(): GeometryClass | undefined { return this._props.geometryClass; }\n /** The Id of the [[ModelState]] from which the hit originated. */\n public get modelId(): string | undefined { return this._props.modelId; }\n /** The IModelConnection from which the hit originated.\n * This should almost always be left undefined, unless the hit is known to have originated from an iModel\n * other than the one associated with the viewport.\n * @internal\n */\n public get sourceIModel(): IModelConnection | undefined { return this._props.sourceIModel; }\n /** @internal */\n public get transformFromSourceIModel(): Transform | undefined { return this._props.transformFromSourceIModel; }\n /** @internal chiefly for debugging */\n public get tileId(): string | undefined { return this._props.tileId; }\n /** True if the hit originated from a reality model classifier.\n * @alpha\n */\n public get isClassifier(): boolean | undefined { return this._props.isClassifier; }\n /** Information about the [ViewAttachment]($backend) within which the hit geometry resides, if any.\n * @note Only [[SheetViewState]]s can have view attachments.\n * @beta\n */\n public get viewAttachment(): ViewAttachmentHitInfo | undefined { return this._props.path?.viewAttachment; }\n /** Describes the path by which the hit was located through a series of attached views.\n * @beta\n */\n public get path(): HitPath | undefined { return this._props.path; }\n\n /** Create a new HitDetail from the inputs to and results of a locate operation. */\n public constructor(props: HitDetailProps);\n\n /** @deprecated in 4.1. Use the overload that takes a [[HitDetailProps]]. */\n public constructor(testPoint: Point3d, viewport: ScreenViewport, hitSource: HitSource, hitPoint: Point3d, sourceId: string, priority: HitPriority, distXY: number, distFraction: number, subCategoryId?: string, geometryClass?: GeometryClass, modelId?: string, sourceIModel?: IModelConnection, tileId?: string, isClassifier?: boolean);\n\n /** @internal */\n public constructor(arg0: Point3d | HitDetailProps, viewport?: ScreenViewport, hitSource?: HitSource, hitPoint?: Point3d, sourceId?: string, priority?: HitPriority, distXY?: number, distFraction?: number, subCategoryId?: string, geometryClass?: GeometryClass, modelId?: string, sourceIModel?: IModelConnection, tileId?: string, isClassifier?: boolean) {\n if (arg0 instanceof Point3d) {\n assert(undefined !== viewport && undefined !== hitSource && undefined !== hitPoint && undefined !== sourceId);\n assert(undefined !== priority && undefined !== distXY && undefined !== distFraction);\n\n this._props = {\n testPoint: arg0,\n viewport,\n hitSource,\n hitPoint,\n sourceId,\n priority,\n distXY,\n distFraction,\n subCategoryId,\n geometryClass,\n modelId,\n sourceIModel,\n tileId,\n isClassifier,\n };\n } else {\n // Ignore an empty path.\n const path = arg0.path?.sectionDrawingAttachment || arg0.path?.viewAttachment ? arg0.path : undefined;\n\n // Tempting to use { ...arg0 } but spread operator omits getters so, e.g., if input is a HitDetail we would lose all the properties.\n this._props = {\n testPoint: arg0.testPoint,\n viewport: arg0.viewport,\n hitSource: arg0.hitSource,\n hitPoint: arg0.hitPoint,\n sourceId: arg0.sourceId,\n priority: arg0.priority,\n distXY: arg0.distXY,\n distFraction: arg0.distFraction,\n subCategoryId: arg0.subCategoryId,\n geometryClass: arg0.geometryClass,\n modelId: arg0.modelId,\n sourceIModel: arg0.sourceIModel,\n transformFromSourceIModel: arg0.transformFromSourceIModel,\n tileId: arg0.tileId,\n isClassifier: arg0.isClassifier,\n path,\n };\n }\n }\n\n /** Get the type of HitDetail.\n * @returns HitDetailType.Hit if this is a HitDetail, HitDetailType.Snap if it is a SnapDetail\n */\n public getHitType(): HitDetailType { return HitDetailType.Hit; }\n\n /** Get the *hit point* for this HitDetail. Returns the approximate point on the element that caused the hit when not a SnapDetail or IntersectDetail.\n * For a snap that is *hot*, the *exact* point on the Element for the snap mode is returned, otherwise the close point on the hit geometry is returned.\n */\n public getPoint(): Point3d { return this.hitPoint; }\n\n /** Determine if this HitPoint is from the same source as another HitDetail. */\n public isSameHit(otherHit?: HitDetail): boolean { return (undefined !== otherHit && this.sourceId === otherHit.sourceId && this.iModel === otherHit.iModel); }\n /** Return whether sourceId is for a persistent element and not a pickable decoration. */\n public get isElementHit(): boolean { return !Id64.isInvalid(this.sourceId) && !Id64.isTransient(this.sourceId); }\n // return whether the sourceId is for a model (reality models etc.)\n public get isModelHit(): boolean {\n return this.modelId === this.sourceId;\n }\n // return whether the hit point is from map.\n public get isMapHit(): boolean { return 0 !== this.viewport.mapLayerFromHit(this).length; }\n\n /** Create a deep copy of this HitDetail */\n public clone(): HitDetail {\n return new HitDetail(this);\n }\n\n /** Draw this HitDetail as a Decoration. Causes the picked element to *flash* */\n public draw(_context: DecorateContext) {\n this.viewport.flashedId = this.sourceId;\n }\n\n /** Get the tooltip content for this HitDetail. */\n public async getToolTip(): Promise<HTMLElement | string> {\n let toolTipPromise = this.isElementHit ? IModelApp.viewManager.overrideElementToolTip(this) : IModelApp.viewManager.getDecorationToolTip(this);\n for (const toolTipProvider of IModelApp.viewManager.toolTipProviders)\n toolTipPromise = toolTipProvider.augmentToolTip(this, toolTipPromise);\n return toolTipPromise;\n }\n\n /** The IModelConnection from which the hit originated. In some cases this may not be the same as the iModel associated with the Viewport -\n * for example, if a [[TiledGraphicsProvider]] is used to display graphics from a different iModel in the viewport.\n * This HitDetail's element, subcategory, and model Ids are defined in the context of this IModelConnection.\n */\n public get iModel(): IModelConnection {\n return this.sourceIModel ?? this.viewport.iModel;\n }\n\n /** Returns true if this hit originated from an [[IModelConnection]] other than the one associated with the [[Viewport]].\n * @see [[iModel]].\n */\n public get isExternalIModelHit(): boolean {\n return this.iModel !== this.viewport.iModel;\n }\n}\n\n/** A SnapDetail is generated from the result of a snap request. In addition to the HitDetail about the reason the element was *picked*,\n * it holds the *exact* point on the element from the snapping logic, plus additional information that varies with the type of element and snap mode.\n * @public\n * @extensions\n */\nexport class SnapDetail extends HitDetail {\n /** A sprite to show the user the type of snap performed */\n public sprite?: Sprite;\n /** HitPoint adjusted by snap */\n public readonly snapPoint: Point3d;\n /** AccuSnap/AccuDraw can adjust the point after the snap. */\n public readonly adjustedPoint: Point3d;\n /** Curve primitive for snap. */\n public primitive?: CurvePrimitive;\n /** Surface normal at snapPoint */\n public normal?: Vector3d;\n /** The HitGeomType of this SnapDetail */\n public geomType?: HitGeomType;\n /** The HitGeomType of this SnapDetail */\n public parentGeomType?: HitParentGeomType;\n\n /** Constructor for SnapDetail.\n * @param from The HitDetail that created this snap\n * @param snapMode The SnapMode used to create this SnapDetail\n * @param heat The SnapHeat of this SnapDetail\n * @param snapPoint The snapped point in the element\n */\n public constructor(from: HitDetail, public snapMode: SnapMode = SnapMode.Nearest, public heat: SnapHeat = SnapHeat.None, snapPoint?: XYZProps) {\n super(from);\n this.snapPoint = Point3d.fromJSON(snapPoint ? snapPoint : from.hitPoint);\n this.adjustedPoint = this.snapPoint.clone();\n this.sprite = IconSprites.getSpriteFromUrl(SnapDetail.getSnapSpriteUrl(snapMode));\n }\n\n /** Returns `HitDetailType.Snap` */\n public override getHitType(): HitDetailType { return HitDetailType.Snap; }\n /** Get the snap point if this SnapDetail is *hot*, the pick point otherwise. */\n public override getPoint(): Point3d { return this.isHot ? this.snapPoint : super.getPoint(); }\n /** Return true if the pick point was closer than the snap aperture from the generated snap point. */\n public get isHot(): boolean { return this.heat !== SnapHeat.None; }\n /** Determine whether the [[adjustedPoint]] is different than the [[snapPoint]]. This happens, for example, when points are adjusted for grids, acs plane snap, and AccuDraw. */\n public get isPointAdjusted(): boolean { return !this.adjustedPoint.isExactEqual(this.snapPoint); }\n /** Change the snap point. */\n public setSnapPoint(point: Point3d, heat: SnapHeat) {\n this.snapPoint.setFrom(point);\n this.adjustedPoint.setFrom(point);\n this.heat = heat;\n }\n\n /** Set curve primitive and HitGeometryType for this SnapDetail. */\n public setCurvePrimitive(primitive?: CurvePrimitive, localToWorld?: Transform, geomType?: HitGeomType): void {\n this.primitive = primitive;\n this.geomType = undefined;\n\n // Only HitGeomType.Point and HitGeomType.Surface are valid without a curve primitive.\n if (undefined === this.primitive) {\n if (HitGeomType.Point === geomType || HitGeomType.Surface === geomType)\n this.geomType = geomType;\n return;\n }\n\n if (undefined !== localToWorld)\n this.primitive.tryTransformInPlace(localToWorld);\n\n if (this.primitive instanceof Arc3d)\n this.geomType = HitGeomType.Arc;\n else if (this.primitive instanceof LineSegment3d)\n this.geomType = HitGeomType.Segment;\n else if (this.primitive instanceof LineString3d)\n this.geomType = HitGeomType.Segment;\n else\n this.geomType = HitGeomType.Curve;\n\n // Set curve primitive geometry type override...\n // - HitGeomType.Point with arc/ellipse denotes center.\n // - HitGeomType.Surface with any curve primitive denotes an interior hit.\n if (undefined !== geomType && HitGeomType.None !== geomType)\n this.geomType = geomType;\n }\n\n /** Make a copy of this SnapDetail. */\n public override clone(): SnapDetail {\n const val = new SnapDetail(this, this.snapMode, this.heat, this.snapPoint);\n val.sprite = this.sprite;\n val.geomType = this.geomType;\n val.parentGeomType = this.parentGeomType;\n val.adjustedPoint.setFrom(this.adjustedPoint);\n if (undefined !== this.primitive)\n val.primitive = this.primitive.clone();\n if (undefined !== this.normal)\n val.normal = this.normal.clone();\n return val;\n }\n\n public getCurvePrimitive(singleSegment: boolean = true): CurvePrimitive | undefined {\n if (!singleSegment || undefined === this.primitive)\n return this.primitive;\n\n if (this.primitive instanceof LineString3d) {\n const ls = this.primitive;\n if (ls.points.length > 2) {\n const loc = ls.closestPoint(this.snapPoint, false);\n const nSegments = ls.points.length - 1;\n const uSegRange = (1.0 / nSegments);\n let segmentNo = Math.floor(loc.fraction / uSegRange);\n if (segmentNo >= nSegments)\n segmentNo = nSegments - 1;\n return LineSegment3d.create(ls.points[segmentNo], ls.points[segmentNo + 1]);\n }\n }\n\n return this.primitive;\n }\n\n public override draw(context: DecorateContext) {\n if (undefined !== this.primitive) {\n let singleSegment = false;\n switch (this.snapMode) {\n case SnapMode.Center:\n case SnapMode.Origin:\n case SnapMode.Bisector:\n break; // Snap point for these is computed using entire linestring, not just the hit segment...\n\n default: {\n singleSegment = true;\n break;\n }\n }\n\n const builder = context.createGraphicBuilder(GraphicType.WorldOverlay);\n const outline = context.viewport.hilite.color.adjustedForContrast(context.viewport.view.backgroundColor, 50);\n const centerLine = context.viewport.hilite.color.adjustedForContrast(outline, 175);\n const path = Path.create(this.getCurvePrimitive(singleSegment)!);\n\n builder.setSymbology(outline, outline, 6);\n builder.addPath(path);\n\n builder.setSymbology(centerLine, centerLine, 2);\n builder.addPath(path);\n\n context.addDecorationFromBuilder(builder);\n return;\n }\n super.draw(context);\n }\n\n private static getSnapSpriteUrl(snapType: SnapMode): string {\n switch (snapType) {\n case SnapMode.Nearest: return `${IModelApp.publicPath}sprites/SnapPointOn.png`;\n case SnapMode.NearestKeypoint: return `${IModelApp.publicPath}sprites/SnapKeypoint.png`;\n case SnapMode.MidPoint: return `${IModelApp.publicPath}sprites/SnapMidpoint.png`;\n case SnapMode.Center: return `${IModelApp.publicPath}sprites/SnapCenter.png`;\n case SnapMode.Origin: return `${IModelApp.publicPath}sprites/SnapOrigin.png`;\n case SnapMode.Bisector: return `${IModelApp.publicPath}sprites/SnapBisector.png`;\n case SnapMode.Intersection: return `${IModelApp.publicPath}sprites/SnapIntersection.png`;\n }\n return \"\";\n }\n}\n\n/**\n * @public\n * @extensions\n */\nexport class IntersectDetail extends SnapDetail {\n public constructor(from: SnapDetail, heat: SnapHeat = SnapHeat.None, snapPoint: XYZProps, public readonly otherPrimitive: CurvePrimitive, public readonly otherId: string) {\n super(from, SnapMode.Intersection, heat, snapPoint);\n this.primitive = from.primitive;\n this.normal = from.normal; // Preserve normal from primary snap location for AccuDraw smart rotation...\n }\n\n public override draw(context: DecorateContext) {\n if (undefined !== this.primitive && undefined !== this.otherPrimitive) {\n const builder = context.createGraphicBuilder(GraphicType.WorldOverlay);\n const outline = context.viewport.hilite.color.adjustedForContrast(context.viewport.view.backgroundColor, 50);\n const centerLine = context.viewport.hilite.color.adjustedForContrast(outline, 175);\n const path1 = Path.create(this.primitive);\n const path2 = Path.create(this.otherPrimitive);\n\n builder.setSymbology(outline, outline, 6);\n builder.addPath(path1);\n builder.addPath(path2);\n\n builder.setSymbology(centerLine, centerLine, 2);\n builder.addPath(path1);\n builder.setSymbology(centerLine, centerLine, 2, LinePixels.Code2);\n builder.addPath(path2);\n\n context.addDecorationFromBuilder(builder);\n return;\n }\n super.draw(context);\n }\n}\n\n/** The result of a \"locate\" is a sorted list of objects that satisfied the search criteria (a HitList). Earlier hits in the list\n * are somehow *better* than those later on.\n * @public\n * @extensions\n */\nexport class HitList<T extends HitDetail> {\n public hits: T[] = [];\n public currHit = -1;\n public get length(): number { return this.hits.length; }\n public empty(): void {\n this.hits.length = 0;\n this.currHit = -1;\n }\n\n public resetCurrentHit(): void { this.currHit = -1; }\n\n /** Get a hit from a particular index into a HitList\n * return the requested hit from the HitList or undefined\n */\n public getHit(hitNum: number): T | undefined {\n if (hitNum < 0)\n hitNum = this.length - 1;\n\n return (hitNum >= this.length) ? undefined : this.hits[hitNum];\n }\n\n /** When setting one or more indices to undefined you must call dropNulls afterwards */\n public setHit(i: number, p: T | undefined): void {\n if (i < 0 || i >= this.length)\n return;\n this.hits[i] = p!;\n }\n\n public dropNulls(): void {\n const hits = this.hits;\n this.hits = [];\n for (const hit of hits)\n this.hits.push(hit);\n }\n\n public getNextHit(): T | undefined {\n this.currHit++;\n return this.getCurrentHit();\n }\n\n public getCurrentHit(): T | undefined { return -1 === this.currHit ? undefined : this.getHit(this.currHit); }\n\n public setCurrentHit(hit: T): void {\n this.resetCurrentHit();\n for (let thisHit; undefined !== (thisHit = this.getNextHit());) {\n if (thisHit === hit)\n return;\n }\n }\n\n /** remove the current hit from the list. */\n public removeCurrentHit() { this.removeHit(this.currHit); }\n\n /** remove a hit in the list. */\n public removeHit(hitNum: number) {\n if (hitNum < 0) // Support -1 == END\n hitNum = this.length - 1;\n\n if (hitNum <= this.currHit)\n this.currHit = -1;\n\n if (hitNum >= this.length) // Locate calls GetNextHit, which increments currHit, until it goes beyond the end of size of the array.\n return; // Then Reset call RemoteCurrentHit, which passes in currHit. When it is out of range, we do nothing.\n\n this.hits.splice(hitNum, 1);\n }\n\n /** search through list and remove any hits that contain a specified element id. */\n public removeHitsFrom(sourceId: string): boolean {\n let removedOne = false;\n\n // walk backwards through list so we don't have to worry about what happens on remove\n for (let i = this.length - 1; i >= 0; i--) {\n const thisHit = this.hits[i];\n if (thisHit && sourceId === thisHit.sourceId) {\n removedOne = true;\n this.removeHit(i);\n }\n }\n return removedOne;\n }\n\n private getPriorityZOverride(priority: HitPriority): number {\n switch (priority) {\n case HitPriority.WireEdge:\n case HitPriority.PlanarEdge:\n case HitPriority.NonPlanarEdge:\n return 0;\n case HitPriority.SilhouetteEdge:\n return 1;\n case HitPriority.PlanarSurface:\n case HitPriority.NonPlanarSurface:\n return 2;\n default:\n return 3;\n }\n }\n\n /** compare two hits for insertion into list. */\n public compare(hit1: HitDetail | undefined, hit2: HitDetail | undefined): -1 | 1 | 0 {\n if (!hit1 || !hit2)\n return 0;\n\n const zOverride1 = this.getPriorityZOverride(hit1.priority);\n const zOverride2 = this.getPriorityZOverride(hit2.priority);\n\n // Prefer edges over surfaces, this is more important than z because we know the edge isn't obscured...\n if (zOverride1 < zOverride2)\n return -1;\n if (zOverride1 > zOverride2)\n return 1;\n\n // Compare xy distance from pick point, prefer hits closer to center...\n if (hit1.distXY < hit2.distXY)\n return -1;\n if (hit1.distXY > hit2.distXY)\n return 1;\n\n // Compare distance fraction, prefer hits closer to eye...\n if (hit1.distFraction > hit2.distFraction)\n return -1;\n if (hit1.distFraction < hit2.distFraction)\n return 1;\n\n // Compare geometry class, prefer path/region hits over surface hits when all else is equal...\n if (hit1.priority < hit2.priority)\n return -1;\n if (hit1.priority > hit2.priority)\n return 1;\n\n return 0;\n }\n\n /** Add a new hit to the list. Hits are sorted according to their priority and distance. */\n public addHit(newHit: T): number {\n if (0 === this.hits.length) {\n this.hits.push(newHit);\n return 0;\n }\n let index = 0;\n for (; index < this.hits.length; ++index) {\n const oldHit = this.hits[index];\n const comparison = this.compare(newHit, oldHit);\n if (comparison < 0)\n break;\n }\n\n this.hits.splice(index, 0, newHit);\n return index;\n }\n\n /** Insert a new hit into the list at the supplied index. */\n public insertHit(i: number, hit: T): void {\n if (i < 0 || i >= this.length)\n this.hits.push(hit);\n else\n this.hits.splice(i, 0, hit);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HitDetail.js","sourceRoot":"","sources":["../../src/HitDetail.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAA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AEpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LocatingElements\n */\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { Arc3d, CurvePrimitive, LineSegment3d, LineString3d, Path, Point3d, Transform, Vector3d, XYZProps } from \"@itwin/core-geometry\";\nimport { ContourGroup, GeometryClass, LinePixels } from \"@itwin/core-common\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { IconSprites, Sprite } from \"./Sprites\";\nimport { DecorateContext } from \"./ViewContext\";\nimport { ScreenViewport, Viewport } from \"./Viewport\";\nimport { GraphicType } from \"./common/render/GraphicType\";\n\n/**\n * @public\n * @extensions\n */\nexport enum SnapMode {\n Nearest = 1,\n NearestKeypoint = 1 << 1,\n MidPoint = 1 << 2,\n Center = 1 << 3,\n Origin = 1 << 4,\n Bisector = 1 << 5,\n Intersection = 1 << 6,\n PerpendicularPoint = 1 << 7,\n TangentPoint = 1 << 8,\n}\n\n/**\n * @public\n * @extensions\n */\nexport enum SnapHeat {\n None = 0,\n NotInRange = 1, // \"of interest\", but out of range\n InRange = 2,\n}\n\n/** The procedure that generated this Hit.\n * @public\n * @extensions\n */\nexport enum HitSource {\n None = 0,\n FromUser = 1,\n MotionLocate = 2,\n AccuSnap = 3,\n TentativeSnap = 4,\n DataPoint = 5,\n Application = 6,\n EditAction = 7,\n EditActionSS = 8,\n}\n\n/** What was being tested to generate this hit. This is not the element or\n * GeometricPrimitive that generated the Hit, it is an indication of whether it is an edge or interior hit.\n * @public\n * @extensions\n */\nexport enum HitGeomType {\n None = 0,\n Point = 1,\n Segment = 2,\n Curve = 3,\n Arc = 4,\n Surface = 5,\n}\n\n/** Classification of GeometricPrimitive that generated the Hit.\n * @public\n * @extensions\n */\nexport enum HitParentGeomType {\n None = 0,\n Wire = 1,\n Sheet = 2,\n Solid = 3,\n Mesh = 4,\n Text = 5,\n}\n\n/**\n * @public\n * @extensions\n */\nexport enum HitPriority {\n WireEdge = 0,\n PlanarEdge = 1,\n NonPlanarEdge = 2,\n SilhouetteEdge = 3,\n PlanarSurface = 4,\n NonPlanarSurface = 5,\n Unknown = 6,\n}\n\n/**\n * @public\n * @extensions\n */\nexport enum HitDetailType {\n Hit = 1,\n Snap = 2,\n Intersection = 3,\n}\n\n/** As part of a [[HitPath]], describes the [ViewAttachment]($backend), if any, from which the hit represented by a [[HitDetail]] originated.\n * @beta\n */\nexport interface ViewAttachmentHitInfo {\n /** The element Id of the [ViewAttachment]($backend) from which the hit originated. */\n readonly id: Id64String;\n /** The viewport that renders the contents of the attached view into the [[ScreenViewport]].\n * @note Do not alter the state of this viewport.\n * @alpha\n */\n readonly viewport: Viewport;\n}\n\n/** As part of a [[HitPath]], describes the [SectionDrawing]($backend), if any, from which the hit represented by a [[HitDetail]] originated.\n * @beta\n */\nexport interface SectionDrawingAttachmentHitInfo {\n /** The viewport that renders the contents of the attached view into the [[ScreenViewport]].\n * @note Do not alter the state of this viewport.\n * @alpha\n */\n readonly viewport: Viewport;\n}\n\n/** As part of a [[HitDetail]], describes a series of \"attached\" views through which the hit was located.\n * Typically, the contents of a view are rendered directly to the screen via [[HitDetail.viewport]].\n * However, in some contexts one view might be \"attached\" to the viewport's view via a [ViewAttachment]($backend), [SectionDrawing]($backend), or both.\n * HitPath captures this information in one of the following possible ways:\n * 1. A [[SheetViewState]] renders another view through a [ViewAttachment]($backend), in which case [[viewAttachment]] will be defined.\n * 2. A [[DrawingViewState]] renders a [[SpatialViewState]] through a [SectionDrawing]($backend) attachment, in which case [[sectionDrawingAttachment]] will be defined; or\n * 3. A combination of 1 and 2 where a [ViewAttachment]($backend) on a sheet renders a [SectionDrawing]($backend) with an attached [[SpatialViewState]], in which both [viewAttachment]] and [[sectionDrawingAttachment]] will be defined.\n * @beta\n */\nexport interface HitPath {\n /** Details about the [ViewAttachment]($backend) through which the hit was obtained. */\n viewAttachment?: ViewAttachmentHitInfo;\n /** Details about the [SectionDrawing]($backend) attachment through which the hit was obtained. */\n sectionDrawingAttachment?: SectionDrawingAttachmentHitInfo;\n};\n\n/** Information about a [contour line]($docs/learning/display/ContourDisplay.md) that generated a [[HitDetail]] or [[Pixel]].\n * @see [[HitDetail.contour]]\n * @see [[Pixel.Data.contour]]\n * @beta\n */\nexport interface ContourHit {\n /** The contour group that generated the contour line, as specified by [[ContourDisplay.groups]]. */\n readonly group: ContourGroup;\n /** True if the contour is a major contour line as specified by the [[group]] from which it originated, false if it is a minor contour line. */\n readonly isMajor: boolean;\n /** The height in world coordinates of the contour line. This is always a multiple of the [Contour.minorInterval]($common) defined for the [[group]].\n * @note The multiple may be approximate due to the limitations of floating-point precision.\n */\n readonly elevation: number;\n}\n\n/** Arguments supplied to the [[HitDetail]] constructor.\n * @public\n */\nexport interface HitDetailProps {\n /** The point in world coordinates that was used as the initial locate point. */\n readonly testPoint: Point3d;\n /** The viewport in which the locate operation was performed. */\n readonly viewport: ScreenViewport;\n /** The procedure that requested the locate operation. */\n readonly hitSource: HitSource;\n /** The approximate location in world coordinates on the geometry identified by this HitDetail. */\n readonly hitPoint: Point3d;\n /** The source of the geometry. This may be a persistent element Id, or a transient Id used for, e.g., pickable decorations. */\n readonly sourceId: Id64String;\n /** The hit geometry priority/classification. */\n readonly priority: HitPriority;\n /** The xy distance to the hit in view coordinates. */\n readonly distXY: number;\n /** The distance in view coordinates between the hit and the near plane. */\n readonly distFraction: number;\n /** The [SubCategory]($backend) to which the hit geometry belongs. */\n readonly subCategoryId?: Id64String;\n /** The class of the hit geometry. */\n readonly geometryClass?: GeometryClass;\n /** The Id of the [[ModelState]] from which the hit originated. */\n readonly modelId?: string;\n /** The IModelConnection from which the hit originated.\n * This should almost always be left undefined, unless the hit is known to have originated from an iModel\n * other than the one associated with the viewport.\n * @internal\n */\n readonly sourceIModel?: IModelConnection;\n /** @internal */\n readonly transformFromSourceIModel?: Transform;\n /** @internal chiefly for debugging */\n readonly tileId?: string;\n /** True if the hit originated from a reality model classifier.\n * @alpha\n */\n readonly isClassifier?: boolean;\n /** Describes the path by which the hit was located through a series of attached views.\n * @beta\n */\n readonly path?: HitPath;\n /** Information about the [contour line]($docs/learning/display/ContourDisplay.md), if any, from which this hit originated.\n * @beta\n */\n readonly contour?: ContourHit;\n}\n\n/** A HitDetail stores the result when locating geometry displayed in a view.\n * It holds an approximate location on an element (or decoration) from a *pick*.\n * @public\n * @extensions\n */\nexport class HitDetail {\n private readonly _props: HitDetailProps;\n\n /** The point in world coordinates that was used as the initial locate point. */\n public get testPoint(): Point3d { return this._props.testPoint; }\n /** The viewport in which the locate operation was performed. */\n public get viewport(): ScreenViewport { return this._props.viewport; }\n /** The procedure that requested the locate operation. */\n public get hitSource(): HitSource { return this._props.hitSource; }\n /** The approximate location in world coordinates on the geometry identified by this HitDetail. */\n public get hitPoint(): Point3d { return this._props.hitPoint; }\n /** The source of the geometry. This may be a persistent element Id, or a transient Id used for, e.g., pickable decorations. */\n public get sourceId(): Id64String { return this._props.sourceId; }\n /** The hit geometry priority/classification. */\n public get priority(): HitPriority { return this._props.priority; }\n /** The xy distance to the hit in view coordinates. */\n public get distXY(): number { return this._props.distXY; }\n /** The distance in view coordinates between the hit and the near plane. */\n public get distFraction(): number { return this._props.distFraction; }\n /** The [SubCategory]($backend) to which the hit geometry belongs. */\n public get subCategoryId(): Id64String | undefined { return this._props.subCategoryId; }\n /** The class of the hit geometry. */\n public get geometryClass(): GeometryClass | undefined { return this._props.geometryClass; }\n /** The Id of the [[ModelState]] from which the hit originated. */\n public get modelId(): string | undefined { return this._props.modelId; }\n /** The IModelConnection from which the hit originated.\n * This should almost always be left undefined, unless the hit is known to have originated from an iModel\n * other than the one associated with the viewport.\n * @internal\n */\n public get sourceIModel(): IModelConnection | undefined { return this._props.sourceIModel; }\n /** @internal */\n public get transformFromSourceIModel(): Transform | undefined { return this._props.transformFromSourceIModel; }\n /** @internal chiefly for debugging */\n public get tileId(): string | undefined { return this._props.tileId; }\n /** True if the hit originated from a reality model classifier.\n * @alpha\n */\n public get isClassifier(): boolean | undefined { return this._props.isClassifier; }\n /** Information about the [ViewAttachment]($backend) within which the hit geometry resides, if any.\n * @note Only [[SheetViewState]]s can have view attachments.\n * @beta\n */\n public get viewAttachment(): ViewAttachmentHitInfo | undefined { return this._props.path?.viewAttachment; }\n /** Describes the path by which the hit was located through a series of attached views.\n * @beta\n */\n public get path(): HitPath | undefined { return this._props.path; }\n /** Information about the [contour line]($docs/learning/display/ContourDisplay.md), if any, from which this hit originated.\n * @beta\n */\n public get contour(): ContourHit | undefined { return this._props.contour; }\n\n /** Create a new HitDetail from the inputs to and results of a locate operation. */\n public constructor(props: HitDetailProps);\n\n /** @deprecated in 4.1. Use the overload that takes a [[HitDetailProps]]. */\n public constructor(testPoint: Point3d, viewport: ScreenViewport, hitSource: HitSource, hitPoint: Point3d, sourceId: string, priority: HitPriority, distXY: number, distFraction: number, subCategoryId?: string, geometryClass?: GeometryClass, modelId?: string, sourceIModel?: IModelConnection, tileId?: string, isClassifier?: boolean);\n\n /** @internal */\n public constructor(arg0: Point3d | HitDetailProps, viewport?: ScreenViewport, hitSource?: HitSource, hitPoint?: Point3d, sourceId?: string, priority?: HitPriority, distXY?: number, distFraction?: number, subCategoryId?: string, geometryClass?: GeometryClass, modelId?: string, sourceIModel?: IModelConnection, tileId?: string, isClassifier?: boolean) {\n if (arg0 instanceof Point3d) {\n assert(undefined !== viewport && undefined !== hitSource && undefined !== hitPoint && undefined !== sourceId);\n assert(undefined !== priority && undefined !== distXY && undefined !== distFraction);\n\n this._props = {\n testPoint: arg0,\n viewport,\n hitSource,\n hitPoint,\n sourceId,\n priority,\n distXY,\n distFraction,\n subCategoryId,\n geometryClass,\n modelId,\n sourceIModel,\n tileId,\n isClassifier,\n };\n } else {\n // Ignore an empty path.\n const path = arg0.path?.sectionDrawingAttachment || arg0.path?.viewAttachment ? arg0.path : undefined;\n\n // Tempting to use { ...arg0 } but spread operator omits getters so, e.g., if input is a HitDetail we would lose all the properties.\n this._props = {\n testPoint: arg0.testPoint,\n viewport: arg0.viewport,\n hitSource: arg0.hitSource,\n hitPoint: arg0.hitPoint,\n sourceId: arg0.sourceId,\n priority: arg0.priority,\n distXY: arg0.distXY,\n distFraction: arg0.distFraction,\n subCategoryId: arg0.subCategoryId,\n geometryClass: arg0.geometryClass,\n modelId: arg0.modelId,\n sourceIModel: arg0.sourceIModel,\n transformFromSourceIModel: arg0.transformFromSourceIModel,\n tileId: arg0.tileId,\n isClassifier: arg0.isClassifier,\n path,\n contour: arg0.contour,\n };\n }\n }\n\n /** Get the type of HitDetail.\n * @returns HitDetailType.Hit if this is a HitDetail, HitDetailType.Snap if it is a SnapDetail\n */\n public getHitType(): HitDetailType { return HitDetailType.Hit; }\n\n /** Get the *hit point* for this HitDetail. Returns the approximate point on the element that caused the hit when not a SnapDetail or IntersectDetail.\n * For a snap that is *hot*, the *exact* point on the Element for the snap mode is returned, otherwise the close point on the hit geometry is returned.\n */\n public getPoint(): Point3d { return this.hitPoint; }\n\n /** Determine if this HitPoint is from the same source as another HitDetail. */\n public isSameHit(otherHit?: HitDetail): boolean { return (undefined !== otherHit && this.sourceId === otherHit.sourceId && this.iModel === otherHit.iModel); }\n /** Return whether sourceId is for a persistent element and not a pickable decoration. */\n public get isElementHit(): boolean { return !Id64.isInvalid(this.sourceId) && !Id64.isTransient(this.sourceId); }\n // return whether the sourceId is for a model (reality models etc.)\n public get isModelHit(): boolean {\n return this.modelId === this.sourceId;\n }\n // return whether the hit point is from map.\n public get isMapHit(): boolean { return 0 !== this.viewport.mapLayerFromHit(this).length; }\n\n /** Create a deep copy of this HitDetail */\n public clone(): HitDetail {\n return new HitDetail(this);\n }\n\n /** Draw this HitDetail as a Decoration. Causes the picked element to *flash* */\n public draw(_context: DecorateContext) {\n this.viewport.flashedId = this.sourceId;\n }\n\n /** Get the tooltip content for this HitDetail. */\n public async getToolTip(): Promise<HTMLElement | string> {\n let toolTipPromise = this.isElementHit ? IModelApp.viewManager.overrideElementToolTip(this) : IModelApp.viewManager.getDecorationToolTip(this);\n for (const toolTipProvider of IModelApp.viewManager.toolTipProviders)\n toolTipPromise = toolTipProvider.augmentToolTip(this, toolTipPromise);\n return toolTipPromise;\n }\n\n /** The IModelConnection from which the hit originated. In some cases this may not be the same as the iModel associated with the Viewport -\n * for example, if a [[TiledGraphicsProvider]] is used to display graphics from a different iModel in the viewport.\n * This HitDetail's element, subcategory, and model Ids are defined in the context of this IModelConnection.\n */\n public get iModel(): IModelConnection {\n return this.sourceIModel ?? this.viewport.iModel;\n }\n\n /** Returns true if this hit originated from an [[IModelConnection]] other than the one associated with the [[Viewport]].\n * @see [[iModel]].\n */\n public get isExternalIModelHit(): boolean {\n return this.iModel !== this.viewport.iModel;\n }\n}\n\n/** A SnapDetail is generated from the result of a snap request. In addition to the HitDetail about the reason the element was *picked*,\n * it holds the *exact* point on the element from the snapping logic, plus additional information that varies with the type of element and snap mode.\n * @public\n * @extensions\n */\nexport class SnapDetail extends HitDetail {\n /** A sprite to show the user the type of snap performed */\n public sprite?: Sprite;\n /** HitPoint adjusted by snap */\n public readonly snapPoint: Point3d;\n /** AccuSnap/AccuDraw can adjust the point after the snap. */\n public readonly adjustedPoint: Point3d;\n /** Curve primitive for snap. */\n public primitive?: CurvePrimitive;\n /** Surface normal at snapPoint */\n public normal?: Vector3d;\n /** The HitGeomType of this SnapDetail */\n public geomType?: HitGeomType;\n /** The HitGeomType of this SnapDetail */\n public parentGeomType?: HitParentGeomType;\n\n /** Constructor for SnapDetail.\n * @param from The HitDetail that created this snap\n * @param snapMode The SnapMode used to create this SnapDetail\n * @param heat The SnapHeat of this SnapDetail\n * @param snapPoint The snapped point in the element\n */\n public constructor(from: HitDetail, public snapMode: SnapMode = SnapMode.Nearest, public heat: SnapHeat = SnapHeat.None, snapPoint?: XYZProps) {\n super(from);\n this.snapPoint = Point3d.fromJSON(snapPoint ? snapPoint : from.hitPoint);\n this.adjustedPoint = this.snapPoint.clone();\n this.sprite = IconSprites.getSpriteFromUrl(SnapDetail.getSnapSpriteUrl(snapMode));\n }\n\n /** Returns `HitDetailType.Snap` */\n public override getHitType(): HitDetailType { return HitDetailType.Snap; }\n /** Get the snap point if this SnapDetail is *hot*, the pick point otherwise. */\n public override getPoint(): Point3d { return this.isHot ? this.snapPoint : super.getPoint(); }\n /** Return true if the pick point was closer than the snap aperture from the generated snap point. */\n public get isHot(): boolean { return this.heat !== SnapHeat.None; }\n /** Determine whether the [[adjustedPoint]] is different than the [[snapPoint]]. This happens, for example, when points are adjusted for grids, acs plane snap, and AccuDraw. */\n public get isPointAdjusted(): boolean { return !this.adjustedPoint.isExactEqual(this.snapPoint); }\n\n /** Change the snap point. */\n public setSnapPoint(point: Point3d, heat: SnapHeat) {\n this.snapPoint.setFrom(point);\n this.adjustedPoint.setFrom(point);\n this.heat = heat;\n }\n\n /** Change the snap mode. */\n public setSnapMode(snapMode: SnapMode) {\n this.snapMode = snapMode;\n this.sprite = IconSprites.getSpriteFromUrl(SnapDetail.getSnapSpriteUrl(snapMode));\n }\n\n /** Set curve primitive and HitGeometryType for this SnapDetail. */\n public setCurvePrimitive(primitive?: CurvePrimitive, localToWorld?: Transform, geomType?: HitGeomType): void {\n this.primitive = primitive;\n this.geomType = undefined;\n\n // Only HitGeomType.Point and HitGeomType.Surface are valid without a curve primitive.\n if (undefined === this.primitive) {\n if (HitGeomType.Point === geomType || HitGeomType.Surface === geomType)\n this.geomType = geomType;\n return;\n }\n\n if (undefined !== localToWorld)\n this.primitive.tryTransformInPlace(localToWorld);\n\n if (this.primitive instanceof Arc3d)\n this.geomType = HitGeomType.Arc;\n else if (this.primitive instanceof LineSegment3d)\n this.geomType = HitGeomType.Segment;\n else if (this.primitive instanceof LineString3d)\n this.geomType = HitGeomType.Segment;\n else\n this.geomType = HitGeomType.Curve;\n\n // Set curve primitive geometry type override...\n // - HitGeomType.Point with arc/ellipse denotes center.\n // - HitGeomType.Surface with any curve primitive denotes an interior hit.\n if (undefined !== geomType && HitGeomType.None !== geomType)\n this.geomType = geomType;\n }\n\n /** Make a copy of this SnapDetail. */\n public override clone(): SnapDetail {\n const val = new SnapDetail(this, this.snapMode, this.heat, this.snapPoint);\n val.sprite = this.sprite;\n val.geomType = this.geomType;\n val.parentGeomType = this.parentGeomType;\n val.adjustedPoint.setFrom(this.adjustedPoint);\n if (undefined !== this.primitive)\n val.primitive = this.primitive.clone();\n if (undefined !== this.normal)\n val.normal = this.normal.clone();\n return val;\n }\n\n public getCurvePrimitive(singleSegment: boolean = true): CurvePrimitive | undefined {\n if (!singleSegment || undefined === this.primitive)\n return this.primitive;\n\n if (this.primitive instanceof LineString3d) {\n const ls = this.primitive;\n if (ls.points.length > 2) {\n const loc = ls.closestPoint(this.snapPoint, false);\n const nSegments = ls.points.length - 1;\n const uSegRange = (1.0 / nSegments);\n let segmentNo = Math.floor(loc.fraction / uSegRange);\n if (segmentNo >= nSegments)\n segmentNo = nSegments - 1;\n return LineSegment3d.create(ls.points[segmentNo], ls.points[segmentNo + 1]);\n }\n }\n\n return this.primitive;\n }\n\n public override draw(context: DecorateContext) {\n if (undefined !== this.primitive) {\n let singleSegment = false;\n switch (this.snapMode) {\n case SnapMode.Center:\n case SnapMode.Origin:\n case SnapMode.Bisector:\n break; // Snap point for these is computed using entire linestring, not just the hit segment...\n\n default: {\n singleSegment = true;\n break;\n }\n }\n\n const builder = context.createGraphicBuilder(GraphicType.WorldOverlay);\n const outline = context.viewport.hilite.color.adjustedForContrast(context.viewport.view.backgroundColor, 50);\n const centerLine = context.viewport.hilite.color.adjustedForContrast(outline, 175);\n const path = Path.create(this.getCurvePrimitive(singleSegment)!);\n\n builder.setSymbology(outline, outline, 6);\n builder.addPath(path);\n\n builder.setSymbology(centerLine, centerLine, 2);\n builder.addPath(path);\n\n context.addDecorationFromBuilder(builder);\n return;\n }\n super.draw(context);\n }\n\n private static getSnapSpriteUrl(snapType: SnapMode): string {\n switch (snapType) {\n case SnapMode.Nearest: return `${IModelApp.publicPath}sprites/SnapPointOn.png`;\n case SnapMode.NearestKeypoint: return `${IModelApp.publicPath}sprites/SnapKeypoint.png`;\n case SnapMode.MidPoint: return `${IModelApp.publicPath}sprites/SnapMidpoint.png`;\n case SnapMode.Center: return `${IModelApp.publicPath}sprites/SnapCenter.png`;\n case SnapMode.Origin: return `${IModelApp.publicPath}sprites/SnapOrigin.png`;\n case SnapMode.Bisector: return `${IModelApp.publicPath}sprites/SnapBisector.png`;\n case SnapMode.Intersection: return `${IModelApp.publicPath}sprites/SnapIntersection.png`;\n case SnapMode.PerpendicularPoint: return `${IModelApp.publicPath}sprites/SnapPerpendicularPoint.png`;\n case SnapMode.TangentPoint: return `${IModelApp.publicPath}sprites/SnapTangentPoint.png`;\n }\n return \"\";\n }\n}\n\n/**\n * @public\n * @extensions\n */\nexport class IntersectDetail extends SnapDetail {\n public constructor(from: SnapDetail, heat: SnapHeat = SnapHeat.None, snapPoint: XYZProps, public readonly otherPrimitive: CurvePrimitive, public readonly otherId: string) {\n super(from, SnapMode.Intersection, heat, snapPoint);\n this.primitive = from.primitive;\n this.normal = from.normal; // Preserve normal from primary snap location for AccuDraw smart rotation...\n }\n\n public override draw(context: DecorateContext) {\n if (undefined !== this.primitive && undefined !== this.otherPrimitive) {\n const builder = context.createGraphicBuilder(GraphicType.WorldOverlay);\n const outline = context.viewport.hilite.color.adjustedForContrast(context.viewport.view.backgroundColor, 50);\n const centerLine = context.viewport.hilite.color.adjustedForContrast(outline, 175);\n const path1 = Path.create(this.primitive);\n const path2 = Path.create(this.otherPrimitive);\n\n builder.setSymbology(outline, outline, 6);\n builder.addPath(path1);\n builder.addPath(path2);\n\n builder.setSymbology(centerLine, centerLine, 2);\n builder.addPath(path1);\n builder.setSymbology(centerLine, centerLine, 2, LinePixels.Code2);\n builder.addPath(path2);\n\n context.addDecorationFromBuilder(builder);\n return;\n }\n super.draw(context);\n }\n}\n\n/** The result of a \"locate\" is a sorted list of objects that satisfied the search criteria (a HitList). Earlier hits in the list\n * are somehow *better* than those later on.\n * @public\n * @extensions\n */\nexport class HitList<T extends HitDetail> {\n public hits: T[] = [];\n public currHit = -1;\n public get length(): number { return this.hits.length; }\n public empty(): void {\n this.hits.length = 0;\n this.currHit = -1;\n }\n\n public resetCurrentHit(): void { this.currHit = -1; }\n\n /** Get a hit from a particular index into a HitList\n * return the requested hit from the HitList or undefined\n */\n public getHit(hitNum: number): T | undefined {\n if (hitNum < 0)\n hitNum = this.length - 1;\n\n return (hitNum >= this.length) ? undefined : this.hits[hitNum];\n }\n\n /** When setting one or more indices to undefined you must call dropNulls afterwards */\n public setHit(i: number, p: T | undefined): void {\n if (i < 0 || i >= this.length)\n return;\n this.hits[i] = p!;\n }\n\n public dropNulls(): void {\n const hits = this.hits;\n this.hits = [];\n for (const hit of hits)\n this.hits.push(hit);\n }\n\n public getNextHit(): T | undefined {\n this.currHit++;\n return this.getCurrentHit();\n }\n\n public getCurrentHit(): T | undefined { return -1 === this.currHit ? undefined : this.getHit(this.currHit); }\n\n public setCurrentHit(hit: T): void {\n this.resetCurrentHit();\n for (let thisHit; undefined !== (thisHit = this.getNextHit());) {\n if (thisHit === hit)\n return;\n }\n }\n\n /** remove the current hit from the list. */\n public removeCurrentHit() { this.removeHit(this.currHit); }\n\n /** remove a hit in the list. */\n public removeHit(hitNum: number) {\n if (hitNum < 0) // Support -1 == END\n hitNum = this.length - 1;\n\n if (hitNum <= this.currHit)\n this.currHit = -1;\n\n if (hitNum >= this.length) // Locate calls GetNextHit, which increments currHit, until it goes beyond the end of size of the array.\n return; // Then Reset call RemoteCurrentHit, which passes in currHit. When it is out of range, we do nothing.\n\n this.hits.splice(hitNum, 1);\n }\n\n /** search through list and remove any hits that contain a specified element id. */\n public removeHitsFrom(sourceId: string): boolean {\n let removedOne = false;\n\n // walk backwards through list so we don't have to worry about what happens on remove\n for (let i = this.length - 1; i >= 0; i--) {\n const thisHit = this.hits[i];\n if (thisHit && sourceId === thisHit.sourceId) {\n removedOne = true;\n this.removeHit(i);\n }\n }\n return removedOne;\n }\n\n private getPriorityZOverride(priority: HitPriority): number {\n switch (priority) {\n case HitPriority.WireEdge:\n case HitPriority.PlanarEdge:\n case HitPriority.NonPlanarEdge:\n return 0;\n case HitPriority.SilhouetteEdge:\n return 1;\n case HitPriority.PlanarSurface:\n case HitPriority.NonPlanarSurface:\n return 2;\n default:\n return 3;\n }\n }\n\n /** compare two hits for insertion into list. */\n public compare(hit1: HitDetail | undefined, hit2: HitDetail | undefined): -1 | 1 | 0 {\n if (!hit1 || !hit2)\n return 0;\n\n const zOverride1 = this.getPriorityZOverride(hit1.priority);\n const zOverride2 = this.getPriorityZOverride(hit2.priority);\n\n // Prefer edges over surfaces, this is more important than z because we know the edge isn't obscured...\n if (zOverride1 < zOverride2)\n return -1;\n if (zOverride1 > zOverride2)\n return 1;\n\n // Compare xy distance from pick point, prefer hits closer to center...\n if (hit1.distXY < hit2.distXY)\n return -1;\n if (hit1.distXY > hit2.distXY)\n return 1;\n\n // Compare distance fraction, prefer hits closer to eye...\n if (hit1.distFraction > hit2.distFraction)\n return -1;\n if (hit1.distFraction < hit2.distFraction)\n return 1;\n\n // Compare geometry class, prefer path/region hits over surface hits when all else is equal...\n if (hit1.priority < hit2.priority)\n return -1;\n if (hit1.priority > hit2.priority)\n return 1;\n\n return 0;\n }\n\n /** Add a new hit to the list. Hits are sorted according to their priority and distance. */\n public addHit(newHit: T): number {\n if (0 === this.hits.length) {\n this.hits.push(newHit);\n return 0;\n }\n let index = 0;\n for (; index < this.hits.length; ++index) {\n const oldHit = this.hits[index];\n const comparison = this.compare(newHit, oldHit);\n if (comparison < 0)\n break;\n }\n\n this.hits.splice(index, 0, newHit);\n return index;\n }\n\n /** Insert a new hit into the list at the supplied index. */\n public insertHit(i: number, hit: T): void {\n if (i < 0 || i >= this.length)\n this.hits.push(hit);\n else\n this.hits.splice(i, 0, hit);\n }\n}\n"]}
|
package/lib/esm/IpcApp.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare class IpcApp {
|
|
|
73
73
|
/** Create a type safe Proxy object to make IPC calls to a registered backend interface.
|
|
74
74
|
* @param channelName the channel registered by the backend handler.
|
|
75
75
|
*/
|
|
76
|
-
static makeIpcProxy<K>(channelName:
|
|
76
|
+
static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K>;
|
|
77
77
|
/** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a "methodName" argument followed by optional arguments
|
|
78
78
|
* @param channelName the channel registered by the backend handler.
|
|
79
79
|
* @param functionName the function to call on the handler.
|
package/lib/esm/IpcApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcApp.d.ts","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAyC,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EACsC,eAAe,EAAwC,WAAW,EAAE,iBAAiB,EAChI,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAgC;IACnD,qEAAqE;IAErE,OAAO,CAAC,MAAM,KAAK,GAAG,GAA4C;IAElE,iIAAiI;IACjI,WAAkB,OAAO,IAAI,OAAO,CAAoC;IAExE;;;;;;;OAOG;WACW,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,G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,QAAQ,EAAE,CAAC,CAAC,sCAAsC;QACtE,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;;AAGH;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAgB,mBAAmB;IAIhC,YAAY;QACjB,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAW,EAAE,QAAgB,EAAE,GAAG,IAAW,EAAE,EAAE;YAC5F,MAAM,IAAI,GAAI,IAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,IAAI,OAAO,IAAI,KAAK,UAAU;gBAC5B,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,8DAA8D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAErL,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K>(channelName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EACL,YAAY,EAAE,WAAW,EAAE,cAAc,EAAyF,YAAY,GAE/I,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAU1D;;;GAGG;AACH,MAAM,OAAO,MAAM;IACT,MAAM,CAAC,IAAI,CAAgC;IACnD,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC;IAElE,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAA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AAG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelState.d.ts","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"m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B;CAChE;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAC1D,wHAAwH;IACxH,SAAgB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAEtD,WAA2B,SAAS,WAA6B;IAEjE,IAAoB,cAAc,IAAI,iBAAiB,CAAiB;gBAErD,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,iBAAiB;IAMzF,6EAA6E;IAC7E,IAAW,cAAc,IAAI,OAAO,CAEnC;CACF;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,WAA2B,SAAS,WAA8B;CACnE;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB;IAC9D,WAA2B,SAAS,WAAqC;CAC1E;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAC1D,WAA2B,SAAS,WAA6B;CAClE;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB;IAC7D,WAA2B,SAAS,WAAoC;CACzE"}
|
package/lib/esm/ModelState.js
CHANGED
|
@@ -96,6 +96,8 @@ export class GeometricModelState extends ModelState {
|
|
|
96
96
|
const spatialModel = this.asSpatialModel;
|
|
97
97
|
const rdSourceKey = this.jsonProperties.rdSourceKey;
|
|
98
98
|
const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;
|
|
99
|
+
const getBackgroundBase = () => view.displayStyle.settings?.mapImagery.backgroundBase;
|
|
100
|
+
const getBackgroundLayers = () => view.displayStyle.settings?.mapImagery.backgroundLayers;
|
|
99
101
|
if (rdSourceKey) {
|
|
100
102
|
const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;
|
|
101
103
|
const treeRef = (!useOrbitGtTileTreeReference) ?
|
|
@@ -107,8 +109,8 @@ export class GeometricModelState extends ModelState {
|
|
|
107
109
|
// url: tilesetUrl, // If rdSourceKey is defined, url is not used
|
|
108
110
|
classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,
|
|
109
111
|
getDisplaySettings,
|
|
110
|
-
getBackgroundBase
|
|
111
|
-
getBackgroundLayers
|
|
112
|
+
getBackgroundBase,
|
|
113
|
+
getBackgroundLayers,
|
|
112
114
|
}) :
|
|
113
115
|
createOrbitGtTileTreeReference({
|
|
114
116
|
rdSourceKey,
|
|
@@ -157,11 +159,11 @@ export class GeometricModelState extends ModelState {
|
|
|
157
159
|
tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,
|
|
158
160
|
classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,
|
|
159
161
|
getDisplaySettings,
|
|
160
|
-
getBackgroundBase
|
|
161
|
-
getBackgroundLayers
|
|
162
|
+
getBackgroundBase,
|
|
163
|
+
getBackgroundLayers,
|
|
162
164
|
});
|
|
163
165
|
}
|
|
164
|
-
return createPrimaryTileTreeReference(view, this);
|
|
166
|
+
return createPrimaryTileTreeReference(view, this, getBackgroundBase, getBackgroundLayers);
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
/** Represents the front-end state of a [GeometricModel2d]($backend).
|
|
@@ -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,2BAA2B,EAAE,cAAc,GACpK,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,8BAA8B,EAAqB,MAAM,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MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC1D,wHAAwH;IACxG,WAAW,CAA2B;IAE/C,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;IAEjE,IAAoB,cAAc,KAAwB,OAAO,IAAI,CAAC,CAAC,CAAC;IAExE,YAAmB,KAAiB,EAAE,MAAwB,EAAE,KAAyB;QACvF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,cAAc;YACrB,IAAI,CAAC,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED,6EAA6E;IAC7E,IAAW,cAAc;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACpH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAChD,MAAM,KAAc,SAAS,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;CACnE;AAED;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IACnD,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IACtD,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, RealityModelDisplaySettings, RelatedElement,\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\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\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 * @extensions\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\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 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 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 * @note This value is cached after the first time it is called.\r\n * @public\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryExtents(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]?.extents);\r\n }\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 const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n\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 getDisplaySettings,\r\n getBackgroundBase: () => view.displayStyle.settings.mapImagery.backgroundBase,\r\n getBackgroundLayers: () => view.displayStyle.settings.mapImagery.backgroundLayers,\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 getDisplaySettings,\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 getDisplaySettings,\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 getDisplaySettings,\r\n getBackgroundBase: () => view.displayStyle.settings.mapImagery.backgroundBase,\r\n getBackgroundLayers: () => view.displayStyle.settings.mapImagery.backgroundLayers,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this);\r\n\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\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 public get is3d(): boolean { return false; }\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 * @extensions\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\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 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 public get is3d(): boolean { return true; }\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 * @extensions\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\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 * @extensions\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?: SpatialClassifiersState;\r\n\r\n public static override get className() { return \"SpatialModel\"; }\r\n\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 = SpatialClassifiersState.create(this.jsonProperties);\r\n }\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 !!this.jsonProperties.tilesetUrl || !!this.jsonProperties.rdSourceKey || !!this.jsonProperties.orbitGtBlob;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\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 * @extensions\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\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 * @extensions\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\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 * @extensions\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\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,CAAC;AAClE,OAAO,EAC0E,iBAAiB,EAAwB,2BAA2B,EAAE,cAAc,GACpK,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WA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Ac,SAAS,KAAK,OAAO,YAAY,CAAC,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC1D,wHAAwH;IACxG,WAAW,CAA2B;IAE/C,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;IAEjE,IAAoB,cAAc,KAAwB,OAAO,IAAI,CAAC,CAAC,CAAC;IAExE,YAAmB,KAAiB,EAAE,MAAwB,EAAE,KAAyB;QACvF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,cAAc;YACrB,IAAI,CAAC,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED,6EAA6E;IAC7E,IAAW,cAAc;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACpH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAChD,MAAM,KAAc,SAAS,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;CACnE;AAED;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IACnD,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IACtD,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, RealityModelDisplaySettings, RelatedElement,\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\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\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 * @extensions\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\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 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 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 * @note This value is cached after the first time it is called.\r\n * @public\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryExtents(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]?.extents);\r\n }\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 const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;\r\n const getBackgroundBase = () => view.displayStyle.settings?.mapImagery.backgroundBase;\r\n const getBackgroundLayers = () => view.displayStyle.settings?.mapImagery.backgroundLayers\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n\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 getDisplaySettings,\r\n getBackgroundBase,\r\n getBackgroundLayers,\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 getDisplaySettings,\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 getDisplaySettings,\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 getDisplaySettings,\r\n getBackgroundBase,\r\n getBackgroundLayers,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this, getBackgroundBase, getBackgroundLayers);\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\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 public get is3d(): boolean { return false; }\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 * @extensions\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\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 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 public get is3d(): boolean { return true; }\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 * @extensions\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\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 * @extensions\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?: SpatialClassifiersState;\r\n\r\n public static override get className() { return \"SpatialModel\"; }\r\n\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 = SpatialClassifiersState.create(this.jsonProperties);\r\n }\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 !!this.jsonProperties.tilesetUrl || !!this.jsonProperties.rdSourceKey || !!this.jsonProperties.orbitGtBlob;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\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 * @extensions\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\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 * @extensions\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\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 * @extensions\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
package/lib/esm/NativeApp.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module NativeApp
|
|
3
3
|
*/
|
|
4
4
|
import { BeEvent, GuidString } from "@itwin/core-bentley";
|
|
5
|
-
import { BriefcaseDownloader, BriefcaseProps, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps, NativeAppFunctions, StorageValue, SyncMode } from "@itwin/core-common";
|
|
5
|
+
import { BriefcaseDownloader, BriefcaseProps, CatalogIModel, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps, NativeAppFunctions, StorageValue, SyncMode } from "@itwin/core-common";
|
|
6
6
|
import { IpcAppOptions } from "./IpcApp";
|
|
7
7
|
import { OnDownloadProgress } from "./BriefcaseConnection";
|
|
8
8
|
/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for
|
|
@@ -44,6 +44,7 @@ export declare class NativeApp {
|
|
|
44
44
|
private static _removeAppNotify?;
|
|
45
45
|
/** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */
|
|
46
46
|
static nativeAppIpc: import("@itwin/core-bentley").PickAsyncMethods<NativeAppFunctions>;
|
|
47
|
+
static catalogIpc: import("@itwin/core-bentley").PickAsyncMethods<CatalogIModel.IpcMethods>;
|
|
47
48
|
private static _storages;
|
|
48
49
|
private static _onOnline;
|
|
49
50
|
private static _onOffline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeApp.d.ts","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"NativeApp.d.ts","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,mBAAmB,EACrI,kBAAkB,EACwB,YAAY,EAAE,QAAQ,EACjE,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAU,aAAa,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EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzC,iCAAiC;IACpB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,sCAAsC;IACzB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|
package/lib/esm/NativeApp.js
CHANGED
|
@@ -27,6 +27,7 @@ export class NativeApp {
|
|
|
27
27
|
static _removeAppNotify;
|
|
28
28
|
/** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */
|
|
29
29
|
static nativeAppIpc = IpcApp.makeIpcProxy(nativeAppIpcStrings.channelName);
|
|
30
|
+
static catalogIpc = IpcApp.makeIpcProxy("catalogIModel/ipc");
|
|
30
31
|
static _storages = new Map();
|
|
31
32
|
static _onOnline = async () => {
|
|
32
33
|
await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);
|