@itwin/core-common 5.5.0-dev.2 → 5.5.0-dev.4
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 +12 -1
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/CatalogIModel.js.map +1 -1
- package/lib/cjs/CesiumIonAssets.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderPolyline.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextField.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMaterialParams.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/RenderTextureParams.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/CatalogIModel.js.map +1 -1
- package/lib/esm/CesiumIonAssets.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderPolyline.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextField.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMaterialParams.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/RenderTextureParams.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAuH;AACvH,wDAAwD;AACxD,yCAAmC;AAEnC;;;;;;GAMG;AACH,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB;;OAEG;IACH,qFAAqB,CAAA;IACrB;;OAEG;IACH,yFAAuB,CAAA;IACvB;;;OAGG;IACH,+EAAkB,CAAA;AACpB,CAAC,EAdW,cAAc,8BAAd,cAAc,QAczB;AA+HD,cAAc;AACd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EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAD5C,aAAQ,GAAR,QAAQ,CAAK;QAAkB,YAAO,GAAP,OAAO,CAAM;IAE/E,CAAC;IACM,MAAM,CAAC,YAAY,CAAC,QAAa,EAAE,OAAa;QACrD,IAAK,QAAQ,CAAC,MAAiB,IAAK,gBAAgB,CAAC,KAAgB,EAAE,CAAC;YACtE,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,EAAE,CAAC;YAChD,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,uBAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF;AAZD,oCAYC","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 iModels\n */\nimport { BentleyError, CompressedId64Set, DbResult, Id64, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\nimport { Base64 } from \"js-base64\";\n\n/**\n * Specifies the format of the rows returned by the `query` and `restartQuery` methods of\n * [IModelConnection]($frontend), [IModelDb]($backend), and [ECDb]($backend).\n *\n * @public\n * @extensions\n */\nexport enum QueryRowFormat {\n /** Each row is an object in which each non-null column value can be accessed by its name as defined in the ECSql.\n * Null values are omitted.\n */\n UseECSqlPropertyNames,\n /** Each row is an array of values accessed by an index corresponding to the property's position in the ECSql SELECT statement.\n * Null values are included if they are followed by a non-null column, but trailing null values at the end of the array are omitted.\n */\n UseECSqlPropertyIndexes,\n /** Each row is an object in which each non-null column value can be accessed by a [remapped property name]($docs/learning/ECSqlRowFormat.md).\n * This format is backwards-compatible with the format produced by iTwin.js 2.x. Null values are omitted.\n * @depreacted in 4.11. Switch to UseECSqlPropertyIndexes for best performance, and UseECSqlPropertyNames if you want a JSON object as the result.\n */\n UseJsPropertyNames,\n}\n\n/**\n * Specify limit or range of rows to return\n * @public\n * @extensions\n * */\nexport interface QueryLimit {\n /** Number of rows to return */\n count?: number;\n /** Offset from which to return rows */\n offset?: number;\n}\n\n/** @public */\nexport interface QueryPropertyMetaData {\n /** The class name is set to empty if the property is a generated one, otherwise, it is the name of the ECClass that the property is contained within. */\n className: string;\n /** Access string is the property's alias if the property is a generated one, otherwise it is the ECSQL property path. */\n accessString?: string;\n /** True if the property is a generated one. False, if the property directly refers to one of the classes in the FROM or JOIN clauses.\n * Note: Using a column alias always generates a property. So in the ECSQL <c>SELECT AssetID, Length * Breadth AS Area FROM myschema.Cubicle</c> the first column (AssetID) would not be a generated property, but the second (Area) would be.\n */\n generated: boolean;\n /** The index of the property value if the result is formatted as an array */\n index: number;\n /** The JSON name is the property's alias if the property is a generated one, otherwise, it is the ECSQL property path for the system property.\n * The JSON names are unique and _%d is added for duplicate property JSON names to make them unique.\n */\n jsonName: string;\n /** The name is the property's alias if the property is a generated one, otherwise, it is the name of the property. */\n name: string;\n /** If this property is a PrimitiveECProperty, extend type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extend type is set to an empty string.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use extendedType instead\n */\n extendType: string;\n /** If this property is a PrimitiveECProperty, extended type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extended type will be undefined. */\n extendedType?: string;\n /** The type name is set to 'navigation' if the property is a navigation property, otherwise, it is the type name for the property. */\n typeName: string;\n}\n\n/** @beta */\nexport interface DbRuntimeStats {\n cpuTime: number;\n totalTime: number;\n timeLimit: number;\n memLimit: number;\n memUsed: number;\n prepareTime: number;\n}\n\n/**\n * Quota hint for the query.\n * @public\n * @extensions\n * */\nexport interface QueryQuota {\n /** Max time allowed in seconds. This is hint and may not be honoured but help in prioritize request */\n time?: number;\n /** Max memory allowed in bytes. This is hint and may not be honoured but help in prioritize request */\n memory?: number;\n}\n\n/**\n * Config for all request made to concurrent query engine.\n * @public\n * @extensions\n */\nexport interface BaseReaderOptions {\n /** Determine priority of this query default to 0, used as hint and can be overriden by backend. */\n priority?: number;\n /** If specified cancel last query (if any) with same restart token and queue the new query */\n restartToken?: string;\n /** For editing apps this can be set to true and all query will run on primary connection\n * his may cause slow queries execution but the most recent data changes will be visitable via query\n */\n usePrimaryConn?: boolean;\n /** Restrict time or memory for query but use as hint and may be changed base on backend settings */\n quota?: QueryQuota;\n /**\n * @internal\n * Allow query to be be deferred by milliseconds specified. This parameter is ignore by default unless\n * concurrent query is configure to honour it.\n */\n delay?: number;\n}\n\n/**\n * ECSql query config\n * @public\n * @extensions\n * */\nexport interface QueryOptions extends BaseReaderOptions {\n /**\n * default to false. It abbreviate blobs to single bytes. This help cases where wildcard is\n * used in select clause. Use BlobReader api to read individual blob specially if its of large size.\n * */\n abbreviateBlobs?: boolean;\n /**\n * default to false. It will suppress error and will not log it. Useful in cases where we expect query\n * can fail.\n */\n suppressLogErrors?: boolean;\n /** This is used internally. If true it query will return meta data about query. */\n includeMetaData?: boolean;\n /** Limit range of rows returned by query*/\n limit?: QueryLimit;\n /**\n * Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.\n * When true, XXXXClassId property will be returned as className.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\n * */\n convertClassIdsToClassNames?: boolean;\n /**\n * Determine row format.\n */\n rowFormat?: QueryRowFormat;\n}\n/** @beta */\nexport type BlobRange = QueryLimit;\n\n/** @beta */\nexport interface BlobOptions extends BaseReaderOptions {\n range?: BlobRange;\n}\n\n/** @public */\nexport class QueryOptionsBuilder {\n public constructor(private _options: QueryOptions = {}) { }\n public getOptions(): QueryOptions { return this._options; }\n /**\n * @internal\n * Allow to set priority of query. Query will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\n * @param val integer value which can be negative as well. By default its zero.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setPriority(val: number) {\n this._options.priority = val;\n return this;\n }\n /**\n * Allow to set restart token. If restart token is set then any other query(s) in queue with same token is cancelled if its not already executed.\n * @param val A string token identifying a use case in which previous query with same token is cancelled.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setRestartToken(val: string) {\n this._options.restartToken = val;\n return this;\n }\n /**\n * Allow to set quota restriction for query. Its a hint and may be overriden or ignored by concurrent query manager.\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setQuota(val: QueryQuota) {\n this._options.quota = val;\n return this;\n }\n /**\n * Force a query to be executed synchronously against primary connection. This option is ignored if provided by frontend.\n * @param val A boolean value to force use primary connection on main thread to execute query.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setUsePrimaryConnection(val: boolean) {\n this._options.usePrimaryConn = val;\n return this;\n }\n /**\n * By default all blobs are abbreviated to save memory and network bandwidth. If set to false, all blob data will be returned by query as is.\n * Use @type BlobReader to access blob data more efficiently.\n * @param val A boolean value, if set to false will return complete blob type property data. This could cost time and network bandwidth.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setAbbreviateBlobs(val: boolean) {\n this._options.abbreviateBlobs = val;\n return this;\n }\n /**\n * When query fail to prepare it will log error. This setting will suppress log errors in case where query come from user typing it and its expected to fail often.\n * @param val A boolean value, if set to true, any error logging will be suppressed.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setSuppressLogErrors(val: boolean) {\n this._options.suppressLogErrors = val;\n return this;\n }\n /**\n * If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.\n * @param val A boolean value.\n * @returns @type QueryOptionsBuilder for fluent interface.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\n */\n public setConvertClassIdsToNames(val: boolean) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this._options.convertClassIdsToClassNames = val;\n return this;\n }\n /**\n * Specify limit for query. Limit determine number of rows and offset in result-set.\n * @param val Specify count and offset from within the result-set of a ECSQL query.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setLimit(val: QueryLimit) {\n this._options.limit = val;\n return this;\n }\n /**\n * Specify row format returned by concurrent query manager.\n * @param val @enum QueryRowFormat specifying format for result.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setRowFormat(val: QueryRowFormat) {\n this._options.rowFormat = val;\n return this;\n }\n /**\n * @internal\n * Defers execution of query in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\n * @param val Number of milliseconds.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setDelay(val: number) {\n this._options.delay = val;\n return this;\n }\n}\n/** @beta */\nexport class BlobOptionsBuilder {\n public constructor(private _options: BlobOptions = {}) { }\n public getOptions(): BlobOptions { return this._options; }\n /**\n * @internal\n * Allow to set priority of blob request. Blob request will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\n * @param val integer value which can be negative as well. By default its zero.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setPriority(val: number) {\n this._options.priority = val;\n return this;\n }\n /**\n * Allow to set restart token. If restart token is set then any other blob request in queue with same token is cancelled if its not already executed.\n * @param val A string token identifying a use case in which previous blob request with same token is cancelled.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setRestartToken(val: string) {\n this._options.restartToken = val;\n return this;\n }\n /**\n * Allow to set quota restriction for blob request. Its a hint and may be overriden or ignored by concurrent query manager.\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setQuota(val: QueryQuota) {\n this._options.quota = val;\n return this;\n }\n /**\n * Force a blob request to be executed synchronously against primary connection. This option is ignored if provided by frontend.\n * @param val A boolean value to force use primary connection on main thread to execute blob request.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setUsePrimaryConnection(val: boolean) {\n this._options.usePrimaryConn = val;\n return this;\n }\n /**\n * Specify range with in the blob that need to be returned.\n * @param val Specify offset and count of bytes that need to be returned.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setRange(val: BlobRange) {\n this._options.range = val;\n return this;\n }\n /**\n * @internal\n * Defers execution of blob request in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\n * @param val Number of milliseconds.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setDelay(val: number) {\n this._options.delay = val;\n return this;\n }\n}\n\n/** @internal */\nexport enum QueryParamType {\n Boolean = 0,\n Double = 1,\n Id = 2,\n IdSet = 3,\n Integer = 4,\n Long = 5,\n Null = 6,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Point2d = 7,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Point3d = 8,\n String = 9,\n Blob = 10,\n Struct = 11,\n}\n\n/**\n * Bind values to an ECSQL query.\n *\n * All binding class methods accept an `indexOrName` parameter as a `string | number` type and a value to bind to it.\n * A binding must be mapped either by a positional index or a string/name. See the examples below.\n *\n * @example\n * Parameter By Index:\n * ```sql\n * SELECT a, v FROM test.Foo WHERE a=? AND b=?\n * ```\n * The first `?` is index 1 and the second `?` is index 2. The parameter index starts with 1 and not 0.\n *\n * @example\n * Parameter By Name:\n * ```sql\n * SELECT a, v FROM test.Foo WHERE a=:name_a AND b=:name_b\n * ```\n * Using \"name_a\" as the `indexOrName` will bind the provided value to `name_a` in the query. And the same goes for\n * using \"name_b\" and the `name_b` binding respectively.\n *\n * @see\n * - [ECSQL Parameters]($docs/learning/ECSQL.md#ecsql-parameters)\n * - [ECSQL Parameter Types]($docs/learning/ECSQLParameterTypes)\n * - [ECSQL Code Examples]($docs/learning/backend/ECSQLCodeExamples#parameter-bindings)\n *\n * @public\n */\nexport class QueryBinder {\n private _args = {};\n private verify(indexOrName: string | number) {\n if (typeof indexOrName === \"number\") {\n if (indexOrName < 1)\n throw new Error(\"expect index to be >= 1\");\n return;\n }\n if (!/^[a-zA-Z_]+\\w*$/i.test(indexOrName)) {\n throw new Error(\"expect named parameter to meet identifier specification\");\n }\n }\n\n /**\n * Bind boolean value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Boolean value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindBoolean(indexOrName: string | number, val: boolean) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true,\n value: {\n type: QueryParamType.Boolean,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind blob value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Blob value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindBlob(indexOrName: string | number, val: Uint8Array) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n const base64 = Base64.fromUint8Array(val);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Blob,\n value: base64,\n },\n });\n return this;\n }\n\n /**\n * Bind double value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Double value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindDouble(indexOrName: string | number, val: number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Double,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind @typedef Id64String value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @typedef Id64String value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindId(indexOrName: string | number, val: Id64String) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Id,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind @type OrderedId64Iterable to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @type OrderedId64Iterable value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindIdSet(indexOrName: string | number, val: OrderedId64Iterable) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n OrderedId64Iterable.uniqueIterator(val);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.IdSet,\n value: CompressedId64Set.sortAndCompress(OrderedId64Iterable.uniqueIterator(val)),\n },\n });\n return this;\n }\n\n /**\n * Bind integer to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Integer value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindInt(indexOrName: string | number, val: number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Integer,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind struct to ECSQL statement. Struct specified as object.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val struct value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindStruct(indexOrName: string | number, val: object) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Struct,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind long to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Long value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindLong(indexOrName: string | number, val: number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Long,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind string to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val String value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindString(indexOrName: string | number, val: string) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.String,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind null to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindNull(indexOrName: string | number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Null,\n value: null,\n },\n });\n return this;\n }\n\n /**\n * Bind @type Point2d to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @type Point2d value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindPoint2d(indexOrName: string | number, val: Point2d) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Point2d,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind @type Point3d to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @type Point3d value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindPoint3d(indexOrName: string | number, val: Point3d) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Point3d,\n value: val,\n },\n });\n return this;\n }\n\n private static bind(params: QueryBinder, nameOrId: string | number, val: any) {\n if (typeof val === \"boolean\") {\n params.bindBoolean(nameOrId, val);\n } else if (typeof val === \"number\") {\n params.bindDouble(nameOrId, val);\n } else if (typeof val === \"string\") {\n params.bindString(nameOrId, val);\n } else if (val instanceof Uint8Array) {\n params.bindBlob(nameOrId, val);\n } else if (val instanceof Point2d) {\n params.bindPoint2d(nameOrId, val);\n } else if (val instanceof Point3d) {\n params.bindPoint3d(nameOrId, val);\n } else if (val instanceof Array && val.length > 0 && typeof val[0] === \"string\" && Id64.isValidId64(val[0])) {\n params.bindIdSet(nameOrId, val);\n } else if (typeof val === \"undefined\" || val === null) {\n params.bindNull(nameOrId);\n } else if (typeof val === \"object\" && !Array.isArray(val)) {\n params.bindStruct(nameOrId, val);\n } else {\n throw new Error(\"unsupported type\");\n }\n }\n\n /**\n * Allow bulk bind either parameters by index as value array or by parameter names as object.\n * @param args if array of values is provided then array index is used as index. If object is provided then object property name is used as parameter name of reach value.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public static from(args: any[] | object | undefined): QueryBinder {\n const params = new QueryBinder();\n if (typeof args === \"undefined\")\n return params;\n\n if (Array.isArray(args)) {\n let i = 1;\n for (const val of args) {\n this.bind(params, i++, val);\n }\n } else {\n for (const prop of Object.getOwnPropertyNames(args)) {\n this.bind(params, prop, (args as any)[prop]);\n }\n }\n return params;\n }\n\n public serialize(): object {\n return this._args;\n }\n}\n\n/** @internal */\nexport enum DbRequestKind {\n BlobIO = 0,\n ECSql = 1\n}\n\n/** @internal */\nexport enum DbResponseKind {\n BlobIO = DbRequestKind.BlobIO,\n ECSql = DbRequestKind.ECSql,\n NoResult = 2\n}\n\n/** @internal */\nexport enum DbResponseStatus {\n Done = 1, /* query ran to completion. */\n Cancel = 2, /* Requested by user.*/\n Partial = 3, /* query was running but ran out of quota.*/\n Timeout = 4, /* query time quota expired while it was in queue.*/\n QueueFull = 5, /* could not submit the query as queue was full.*/\n ShuttingDown = 6, /* Shutdown is in progress. */\n Error = 100, /* generic error*/\n Error_ECSql_PreparedFailed = Error + 1, /* ecsql prepared failed*/\n Error_ECSql_StepFailed = Error + 2, /* ecsql step failed*/\n Error_ECSql_RowToJsonFailed = Error + 3, /* ecsql failed to serialized row to json.*/\n Error_ECSql_BindingFailed = Error + 4, /* ecsql binding failed.*/\n Error_BlobIO_OpenFailed = Error + 5, /* class or property or instance specified was not found or property as not of type blob.*/\n Error_BlobIO_OutOfRange = Error + 6, /* range specified is invalid based on size of blob.*/\n}\n\n/** @internal */\nexport enum DbValueFormat {\n ECSqlNames = 0,\n JsNames = 1\n}\n\n/** @internal */\nexport interface DbRequest extends BaseReaderOptions {\n kind?: DbRequestKind;\n}\n\n/** @internal */\nexport interface DbQueryRequest extends DbRequest, QueryOptions {\n valueFormat?: DbValueFormat;\n query: string;\n args?: object;\n}\n\n/** @internal */\nexport interface DbBlobRequest extends DbRequest, BlobOptions {\n className: string;\n accessString: string;\n instanceId: Id64String;\n}\n\n/** @internal */\nexport interface DbResponse {\n stats: DbRuntimeStats;\n status: DbResponseStatus;\n kind: DbResponseKind;\n error?: string;\n}\n\n/** @internal */\nexport interface DbQueryResponse extends DbResponse {\n meta: QueryPropertyMetaData[];\n data: any[];\n rowCount: number;\n}\n\n/** @internal */\nexport interface DbBlobResponse extends DbResponse {\n data?: Uint8Array;\n rawBlobSize: number;\n}\n\n/** @public */\nexport class DbQueryError extends BentleyError {\n public constructor(public readonly response: any, public readonly request?: any, rc?: DbResult) {\n super(rc ?? DbResult.BE_SQLITE_ERROR, response.error, { response, request });\n }\n public static throwIfError(response: any, request?: any) {\n if ((response.status as number) >= (DbResponseStatus.Error as number)) {\n throw new DbQueryError(response, request);\n }\n if (response.status === DbResponseStatus.Cancel) {\n throw new DbQueryError(response, request, DbResult.BE_SQLITE_INTERRUPT);\n }\n }\n}\n\n/** @internal */\nexport interface DbRequestExecutor<TRequest extends DbRequest, TResponse extends DbResponse> {\n execute(request: TRequest): Promise<TResponse>;\n}\n\n/** @internal */\nexport interface DbQueryConfig {\n globalQuota?: QueryQuota;\n /** For testing */\n ignoreDelay?: boolean;\n /** Priority of request is ignored */\n ignorePriority?: boolean;\n /** Max queue size after which queries are rejected with error QueueFull */\n requestQueueSize?: number;\n /** Number of worker thread, default to 4 */\n workerThreads?: number;\n /** Use thread connection to prepare the statement */\n doNotUsePrimaryConnToPrepare?: boolean;\n /** After no activity for given time concurrent query will automatically shutdown */\n autoShutdownWhenIdleForSeconds?: number;\n /** Maximum number of statement cache per worker. Default to 40 */\n statementCacheSizePerWorker?: number;\n /* Monitor poll interval in milliseconds. Its responsible for cancelling queries that pass quota. It can be set between 1000 and Max time quota for query */\n monitorPollInterval?: number;\n /** Set memory map io for each worker connection size in bytes. Default to zero mean do not use mmap io */\n memoryMapFileSize?: number;\n /** How often to measure progress of a running ECSql statement which is used to enforced time limit */\n progressOpCount?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAuH;AACvH,wDAAwD;AACxD,yCAAmC;AAEnC;;;;;;GAMG;AACH,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB;;OAEG;IACH,qFAAqB,CAAA;IACrB;;OAEG;IACH,yFAAuB,CAAA;IACvB;;;OAGG;IACH,+EAAkB,CAAA;AACpB,CAAC,EAdW,cAAc,8BAAd,cAAc,QAczB;AA+HD,cAAc;AACd,MAAa,mBAAmB;IACH;IAA3B,YAA2B,WAAyB,EAAE;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IAAI,CAAC;IACpD,UAAU,KAAmB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACI,WAAW,CAAC,GAAW;QAC5B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACI,eAAe,CAAC,GAAW;QAChC,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,GAAG,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACI,QAAQ,CAAC,GAAe;QAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;;O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------------------------------------------------------------------------------------------\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 iModels\r\n */\r\nimport { BentleyError, CompressedId64Set, DbResult, Id64, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { Base64 } from \"js-base64\";\r\n\r\n/**\r\n * Specifies the format of the rows returned by the `query` and `restartQuery` methods of\r\n * [IModelConnection]($frontend), [IModelDb]($backend), and [ECDb]($backend).\r\n *\r\n * @public\r\n * @extensions\r\n */\r\nexport enum QueryRowFormat {\r\n /** Each row is an object in which each non-null column value can be accessed by its name as defined in the ECSql.\r\n * Null values are omitted.\r\n */\r\n UseECSqlPropertyNames,\r\n /** Each row is an array of values accessed by an index corresponding to the property's position in the ECSql SELECT statement.\r\n * Null values are included if they are followed by a non-null column, but trailing null values at the end of the array are omitted.\r\n */\r\n UseECSqlPropertyIndexes,\r\n /** Each row is an object in which each non-null column value can be accessed by a [remapped property name]($docs/learning/ECSqlRowFormat.md).\r\n * This format is backwards-compatible with the format produced by iTwin.js 2.x. Null values are omitted.\r\n * @depreacted in 4.11. Switch to UseECSqlPropertyIndexes for best performance, and UseECSqlPropertyNames if you want a JSON object as the result.\r\n */\r\n UseJsPropertyNames,\r\n}\r\n\r\n/**\r\n * Specify limit or range of rows to return\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryLimit {\r\n /** Number of rows to return */\r\n count?: number;\r\n /** Offset from which to return rows */\r\n offset?: number;\r\n}\r\n\r\n/** @public */\r\nexport interface QueryPropertyMetaData {\r\n /** The class name is set to empty if the property is a generated one, otherwise, it is the name of the ECClass that the property is contained within. */\r\n className: string;\r\n /** Access string is the property's alias if the property is a generated one, otherwise it is the ECSQL property path. */\r\n accessString?: string;\r\n /** True if the property is a generated one. False, if the property directly refers to one of the classes in the FROM or JOIN clauses.\r\n * Note: Using a column alias always generates a property. So in the ECSQL <c>SELECT AssetID, Length * Breadth AS Area FROM myschema.Cubicle</c> the first column (AssetID) would not be a generated property, but the second (Area) would be.\r\n */\r\n generated: boolean;\r\n /** The index of the property value if the result is formatted as an array */\r\n index: number;\r\n /** The JSON name is the property's alias if the property is a generated one, otherwise, it is the ECSQL property path for the system property.\r\n * The JSON names are unique and _%d is added for duplicate property JSON names to make them unique.\r\n */\r\n jsonName: string;\r\n /** The name is the property's alias if the property is a generated one, otherwise, it is the name of the property. */\r\n name: string;\r\n /** If this property is a PrimitiveECProperty, extend type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extend type is set to an empty string.\r\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use extendedType instead\r\n */\r\n extendType: string;\r\n /** If this property is a PrimitiveECProperty, extended type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extended type will be undefined. */\r\n extendedType?: string;\r\n /** The type name is set to 'navigation' if the property is a navigation property, otherwise, it is the type name for the property. */\r\n typeName: string;\r\n}\r\n\r\n/** @beta */\r\nexport interface DbRuntimeStats {\r\n cpuTime: number;\r\n totalTime: number;\r\n timeLimit: number;\r\n memLimit: number;\r\n memUsed: number;\r\n prepareTime: number;\r\n}\r\n\r\n/**\r\n * Quota hint for the query.\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryQuota {\r\n /** Max time allowed in seconds. This is hint and may not be honoured but help in prioritize request */\r\n time?: number;\r\n /** Max memory allowed in bytes. This is hint and may not be honoured but help in prioritize request */\r\n memory?: number;\r\n}\r\n\r\n/**\r\n * Config for all request made to concurrent query engine.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BaseReaderOptions {\r\n /** Determine priority of this query default to 0, used as hint and can be overriden by backend. */\r\n priority?: number;\r\n /** If specified cancel last query (if any) with same restart token and queue the new query */\r\n restartToken?: string;\r\n /** For editing apps this can be set to true and all query will run on primary connection\r\n * his may cause slow queries execution but the most recent data changes will be visitable via query\r\n */\r\n usePrimaryConn?: boolean;\r\n /** Restrict time or memory for query but use as hint and may be changed base on backend settings */\r\n quota?: QueryQuota;\r\n /**\r\n * @internal\r\n * Allow query to be be deferred by milliseconds specified. This parameter is ignore by default unless\r\n * concurrent query is configure to honour it.\r\n */\r\n delay?: number;\r\n}\r\n\r\n/**\r\n * ECSql query config\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryOptions extends BaseReaderOptions {\r\n /**\r\n * default to false. It abbreviate blobs to single bytes. This help cases where wildcard is\r\n * used in select clause. Use BlobReader api to read individual blob specially if its of large size.\r\n * */\r\n abbreviateBlobs?: boolean;\r\n /**\r\n * default to false. It will suppress error and will not log it. Useful in cases where we expect query\r\n * can fail.\r\n */\r\n suppressLogErrors?: boolean;\r\n /** This is used internally. If true it query will return meta data about query. */\r\n includeMetaData?: boolean;\r\n /** Limit range of rows returned by query*/\r\n limit?: QueryLimit;\r\n /**\r\n * Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.\r\n * When true, XXXXClassId property will be returned as className.\r\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\r\n * */\r\n convertClassIdsToClassNames?: boolean;\r\n /**\r\n * Determine row format.\r\n */\r\n rowFormat?: QueryRowFormat;\r\n}\r\n/** @beta */\r\nexport type BlobRange = QueryLimit;\r\n\r\n/** @beta */\r\nexport interface BlobOptions extends BaseReaderOptions {\r\n range?: BlobRange;\r\n}\r\n\r\n/** @public */\r\nexport class QueryOptionsBuilder {\r\n public constructor(private _options: QueryOptions = {}) { }\r\n public getOptions(): QueryOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of query. Query will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other query(s) in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous query with same token is cancelled.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for query. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a query to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * By default all blobs are abbreviated to save memory and network bandwidth. If set to false, all blob data will be returned by query as is.\r\n * Use @type BlobReader to access blob data more efficiently.\r\n * @param val A boolean value, if set to false will return complete blob type property data. This could cost time and network bandwidth.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setAbbreviateBlobs(val: boolean) {\r\n this._options.abbreviateBlobs = val;\r\n return this;\r\n }\r\n /**\r\n * When query fail to prepare it will log error. This setting will suppress log errors in case where query come from user typing it and its expected to fail often.\r\n * @param val A boolean value, if set to true, any error logging will be suppressed.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setSuppressLogErrors(val: boolean) {\r\n this._options.suppressLogErrors = val;\r\n return this;\r\n }\r\n /**\r\n * If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.\r\n * @param val A boolean value.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\r\n */\r\n public setConvertClassIdsToNames(val: boolean) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this._options.convertClassIdsToClassNames = val;\r\n return this;\r\n }\r\n /**\r\n * Specify limit for query. Limit determine number of rows and offset in result-set.\r\n * @param val Specify count and offset from within the result-set of a ECSQL query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setLimit(val: QueryLimit) {\r\n this._options.limit = val;\r\n return this;\r\n }\r\n /**\r\n * Specify row format returned by concurrent query manager.\r\n * @param val @enum QueryRowFormat specifying format for result.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRowFormat(val: QueryRowFormat) {\r\n this._options.rowFormat = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of query in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n/** @beta */\r\nexport class BlobOptionsBuilder {\r\n public constructor(private _options: BlobOptions = {}) { }\r\n public getOptions(): BlobOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of blob request. Blob request will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other blob request in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous blob request with same token is cancelled.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for blob request. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a blob request to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute blob request.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * Specify range with in the blob that need to be returned.\r\n * @param val Specify offset and count of bytes that need to be returned.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRange(val: BlobRange) {\r\n this._options.range = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of blob request in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum QueryParamType {\r\n Boolean = 0,\r\n Double = 1,\r\n Id = 2,\r\n IdSet = 3,\r\n Integer = 4,\r\n Long = 5,\r\n Null = 6,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point2d = 7,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point3d = 8,\r\n String = 9,\r\n Blob = 10,\r\n Struct = 11,\r\n}\r\n\r\n/**\r\n * Bind values to an ECSQL query.\r\n *\r\n * All binding class methods accept an `indexOrName` parameter as a `string | number` type and a value to bind to it.\r\n * A binding must be mapped either by a positional index or a string/name. See the examples below.\r\n *\r\n * @example\r\n * Parameter By Index:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=? AND b=?\r\n * ```\r\n * The first `?` is index 1 and the second `?` is index 2. The parameter index starts with 1 and not 0.\r\n *\r\n * @example\r\n * Parameter By Name:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=:name_a AND b=:name_b\r\n * ```\r\n * Using \"name_a\" as the `indexOrName` will bind the provided value to `name_a` in the query. And the same goes for\r\n * using \"name_b\" and the `name_b` binding respectively.\r\n *\r\n * @see\r\n * - [ECSQL Parameters]($docs/learning/ECSQL.md#ecsql-parameters)\r\n * - [ECSQL Parameter Types]($docs/learning/ECSQLParameterTypes)\r\n * - [ECSQL Code Examples]($docs/learning/backend/ECSQLCodeExamples#parameter-bindings)\r\n *\r\n * @public\r\n */\r\nexport class QueryBinder {\r\n private _args = {};\r\n private verify(indexOrName: string | number) {\r\n if (typeof indexOrName === \"number\") {\r\n if (indexOrName < 1)\r\n throw new Error(\"expect index to be >= 1\");\r\n return;\r\n }\r\n if (!/^[a-zA-Z_]+\\w*$/i.test(indexOrName)) {\r\n throw new Error(\"expect named parameter to meet identifier specification\");\r\n }\r\n }\r\n\r\n /**\r\n * Bind boolean value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Boolean value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBoolean(indexOrName: string | number, val: boolean) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true,\r\n value: {\r\n type: QueryParamType.Boolean,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind blob value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Blob value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBlob(indexOrName: string | number, val: Uint8Array) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n const base64 = Base64.fromUint8Array(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Blob,\r\n value: base64,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind double value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Double value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindDouble(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Double,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @typedef Id64String value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @typedef Id64String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindId(indexOrName: string | number, val: Id64String) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Id,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type OrderedId64Iterable to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type OrderedId64Iterable value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindIdSet(indexOrName: string | number, val: OrderedId64Iterable) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n OrderedId64Iterable.uniqueIterator(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.IdSet,\r\n value: CompressedId64Set.sortAndCompress(OrderedId64Iterable.uniqueIterator(val)),\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind integer to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Integer value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindInt(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Integer,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind struct to ECSQL statement. Struct specified as object.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val struct value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindStruct(indexOrName: string | number, val: object) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Struct,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind long to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Long value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindLong(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Long,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind string to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindString(indexOrName: string | number, val: string) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.String,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind null to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindNull(indexOrName: string | number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Null,\r\n value: null,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point2d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point2d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint2d(indexOrName: string | number, val: Point2d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point2d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point3d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point3d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint3d(indexOrName: string | number, val: Point3d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point3d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n private static bind(params: QueryBinder, nameOrId: string | number, val: any) {\r\n if (typeof val === \"boolean\") {\r\n params.bindBoolean(nameOrId, val);\r\n } else if (typeof val === \"number\") {\r\n params.bindDouble(nameOrId, val);\r\n } else if (typeof val === \"string\") {\r\n params.bindString(nameOrId, val);\r\n } else if (val instanceof Uint8Array) {\r\n params.bindBlob(nameOrId, val);\r\n } else if (val instanceof Point2d) {\r\n params.bindPoint2d(nameOrId, val);\r\n } else if (val instanceof Point3d) {\r\n params.bindPoint3d(nameOrId, val);\r\n } else if (val instanceof Array && val.length > 0 && typeof val[0] === \"string\" && Id64.isValidId64(val[0])) {\r\n params.bindIdSet(nameOrId, val);\r\n } else if (typeof val === \"undefined\" || val === null) {\r\n params.bindNull(nameOrId);\r\n } else if (typeof val === \"object\" && !Array.isArray(val)) {\r\n params.bindStruct(nameOrId, val);\r\n } else {\r\n throw new Error(\"unsupported type\");\r\n }\r\n }\r\n\r\n /**\r\n * Allow bulk bind either parameters by index as value array or by parameter names as object.\r\n * @param args if array of values is provided then array index is used as index. If object is provided then object property name is used as parameter name of reach value.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public static from(args: any[] | object | undefined): QueryBinder {\r\n const params = new QueryBinder();\r\n if (typeof args === \"undefined\")\r\n return params;\r\n\r\n if (Array.isArray(args)) {\r\n let i = 1;\r\n for (const val of args) {\r\n this.bind(params, i++, val);\r\n }\r\n } else {\r\n for (const prop of Object.getOwnPropertyNames(args)) {\r\n this.bind(params, prop, (args as any)[prop]);\r\n }\r\n }\r\n return params;\r\n }\r\n\r\n public serialize(): object {\r\n return this._args;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum DbRequestKind {\r\n BlobIO = 0,\r\n ECSql = 1\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseKind {\r\n BlobIO = DbRequestKind.BlobIO,\r\n ECSql = DbRequestKind.ECSql,\r\n NoResult = 2\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseStatus {\r\n Done = 1, /* query ran to completion. */\r\n Cancel = 2, /* Requested by user.*/\r\n Partial = 3, /* query was running but ran out of quota.*/\r\n Timeout = 4, /* query time quota expired while it was in queue.*/\r\n QueueFull = 5, /* could not submit the query as queue was full.*/\r\n ShuttingDown = 6, /* Shutdown is in progress. */\r\n Error = 100, /* generic error*/\r\n Error_ECSql_PreparedFailed = Error + 1, /* ecsql prepared failed*/\r\n Error_ECSql_StepFailed = Error + 2, /* ecsql step failed*/\r\n Error_ECSql_RowToJsonFailed = Error + 3, /* ecsql failed to serialized row to json.*/\r\n Error_ECSql_BindingFailed = Error + 4, /* ecsql binding failed.*/\r\n Error_BlobIO_OpenFailed = Error + 5, /* class or property or instance specified was not found or property as not of type blob.*/\r\n Error_BlobIO_OutOfRange = Error + 6, /* range specified is invalid based on size of blob.*/\r\n}\r\n\r\n/** @internal */\r\nexport enum DbValueFormat {\r\n ECSqlNames = 0,\r\n JsNames = 1\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequest extends BaseReaderOptions {\r\n kind?: DbRequestKind;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryRequest extends DbRequest, QueryOptions {\r\n valueFormat?: DbValueFormat;\r\n query: string;\r\n args?: object;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobRequest extends DbRequest, BlobOptions {\r\n className: string;\r\n accessString: string;\r\n instanceId: Id64String;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbResponse {\r\n stats: DbRuntimeStats;\r\n status: DbResponseStatus;\r\n kind: DbResponseKind;\r\n error?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryResponse extends DbResponse {\r\n meta: QueryPropertyMetaData[];\r\n data: any[];\r\n rowCount: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobResponse extends DbResponse {\r\n data?: Uint8Array;\r\n rawBlobSize: number;\r\n}\r\n\r\n/** @public */\r\nexport class DbQueryError extends BentleyError {\r\n public constructor(public readonly response: any, public readonly request?: any, rc?: DbResult) {\r\n super(rc ?? DbResult.BE_SQLITE_ERROR, response.error, { response, request });\r\n }\r\n public static throwIfError(response: any, request?: any) {\r\n if ((response.status as number) >= (DbResponseStatus.Error as number)) {\r\n throw new DbQueryError(response, request);\r\n }\r\n if (response.status === DbResponseStatus.Cancel) {\r\n throw new DbQueryError(response, request, DbResult.BE_SQLITE_INTERRUPT);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequestExecutor<TRequest extends DbRequest, TResponse extends DbResponse> {\r\n execute(request: TRequest): Promise<TResponse>;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryConfig {\r\n globalQuota?: QueryQuota;\r\n /** For testing */\r\n ignoreDelay?: boolean;\r\n /** Priority of request is ignored */\r\n ignorePriority?: boolean;\r\n /** Max queue size after which queries are rejected with error QueueFull */\r\n requestQueueSize?: number;\r\n /** Number of worker thread, default to 4 */\r\n workerThreads?: number;\r\n /** Use thread connection to prepare the statement */\r\n doNotUsePrimaryConnToPrepare?: boolean;\r\n /** After no activity for given time concurrent query will automatically shutdown */\r\n autoShutdownWhenIdleForSeconds?: number;\r\n /** Maximum number of statement cache per worker. Default to 40 */\r\n statementCacheSizePerWorker?: number;\r\n /* Monitor poll interval in milliseconds. Its responsible for cancelling queries that pass quota. It can be set between 1000 and Max time quota for query */\r\n monitorPollInterval?: number;\r\n /** Set memory map io for each worker connection size in bytes. Default to zero mean do not use mmap io */\r\n memoryMapFileSize?: number;\r\n /** How often to measure progress of a running ECSql statement which is used to enforced time limit */\r\n progressOpCount?: number;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextRealityModel.js","sourceRoot":"","sources":["../../src/ContextRealityModel.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,yDAA+E;AAC/E,qDAAmG;AACnG,mEAAkH;AAClH,+EAAsG;AAatG;;GAEG;AACH,IAAY,mBAyBX;AAzBD,WAAY,mBAAmB;IAC7B;;;;;OAKG;IACH,gDAAyB,CAAA;IACzB;;;;;OAKG;IACH,kDAA2B,CAAA;IAC3B;;;;OAIG;IACH,oDAA6B,CAAA;IAC7B;;OAEG;IACH,wDAAiC,CAAA;AACnC,CAAC,EAzBW,mBAAmB,mCAAnB,mBAAmB,QAyB9B;AAED;;GAEG;AACH,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B;;SAEK;IACL,8CAAyB,CAAA;IACzB;;MAEE;IACF,gCAAW,CAAA;AACb,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B;AAED;;GAEG;AACH,WAAiB,iBAAiB;IAChC;;;;OAIG;IACH,SAAgB,OAAO,CAAC,UAAkB;QACxC,IAAI,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAC1C,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC7B,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC;QACjC,OAAO,MAAM,CAAC;I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CAAC,WAAW,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACxE,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,kBAAkB,CAAC,KAA0B;QACnD,6DAA6D;QAC7D,KAAK,CAAC,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAC;QACrF,6DAA6D;QAC7D,KAAK,CAAC,4BAA4B,CAAC,cAAc,CAAC,IAAI,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC;QAC/F,6DAA6D;QAC7D,KAAK,CAAC,wBAAwB,CAAC,cAAc,CAAC,IAAI,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;QACvF,6DAA6D;QAC7D,KAAK,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAC7E,CAAC;IAEO,2BAA2B,CAAC,IAAwC,EAAE,KAA0B;QACtG,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAEO,gCAAgC,CAAC,GAAkC,EAAE,KAA0B;QACrG,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;IAEO,4BAA4B,CAAC,QAAqC,EAAE,KAA0B;QACpG,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAEO,sBAAsB,CAAC,SAAkB,EAAE,KAA0B;QAC3E,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;CACF;AAlND,oDAkNC","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 DisplayStyles\n */\n\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { PlanarClipMaskMode, PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\nimport { SpatialClassifierProps, SpatialClassifiers, SpatialClassifiersContainer } from \"./SpatialClassification\";\nimport { RealityModelDisplayProps, RealityModelDisplaySettings } from \"./RealityModelDisplaySettings\";\n\n/** JSON representation of the blob properties for an OrbitGt property cloud.\n * @alpha\n */\nexport interface OrbitGtBlobProps {\n rdsUrl?: string;\n containerName: string;\n blobFileName: string;\n sasToken: string;\n accountName: string;\n}\n\n/** Identify the Reality Data service provider\n * @beta\n */\nexport enum RealityDataProvider {\n /**\n * This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.tilesetUrl property.\n * It was used to support RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles\n * You should use other modes when possible\n * @see [[RealityDataSource.createKeyFromUrl]] that will try to detect provider from an URL\n */\n TilesetUrl = \"TilesetUrl\",\n /**\n * This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.OrbitGtBlob property.\n * It was used to support OrbitPointCloud (OPC) from other server than ContextShare\n * You should use other modes when possible\n * @see [[RealityDataSource.createKeyFromOrbitGtBlobProps]] that will try to detect provider from an URL\n */\n OrbitGtBlob = \"OrbitGtBlob\",\n /**\n * Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or OPC storage format\n * This provider supports all types of 3dTile storage format and OrbitPointCloud: RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles, OPC\n * @see [[RealityDataFormat]].\n */\n ContextShare = \"ContextShare\",\n /**\n * Will provide Open Street Map Building (OSM) from Cesium Ion (in 3dTile format)\n */\n CesiumIonAsset = \"CesiumIonAsset\",\n}\n\n/** Identify the Reality Data storage format\n * @beta\n */\nexport enum RealityDataFormat {\n /**\n * 3dTile supported formats; RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles\n * */\n ThreeDTile = \"ThreeDTile\",\n /**\n * Orbit Point Cloud (OPC) storage format (RealityDataType.OPC)\n */\n OPC = \"OPC\",\n}\n\n/** Utility function for RealityDataFormat\n * @beta\n */\nexport namespace RealityDataFormat {\n /**\n * Try to extract the RealityDataFormat from the url\n * @param tilesetUrl the reality data attachment url\n * @returns the extracted RealityDataFormat or ThreeDTile by default if not found\n */\n export function fromUrl(tilesetUrl: string): RealityDataFormat {\n let format = RealityDataFormat.ThreeDTile;\n if (tilesetUrl.includes(\".opc\"))\n format = RealityDataFormat.OPC;\n return format;\n }\n}\n\n/**\n * Key used by RealityDataSource to identify provider and reality data format\n * This key identify one and only one reality data source on the provider\n * @beta\n */\nexport interface RealityDataSourceKey {\n /**\n * The provider that supplies the access to reality data source for displaying the reality model\n * @see [[RealityDataProvider]] for default supported value;\n */\n provider: string;\n /**\n * The format used by the provider to store the reality data\n * @see [[RealityDataFormat]] for default supported value;\n */\n format: string;\n /** The reality data id that identify a reality data for the provider */\n id: string;\n /** The context id that was used when reality data was attached - if none provided, current session iTwinId will be used */\n iTwinId?: string;\n}\n/**\n * RealityDataSourceKey utility functions\n * @beta */\nexport namespace RealityDataSourceKey {\n /** Utility function to convert a RealityDataSourceKey into its string representation */\n export function convertToString(rdSourceKey: RealityDataSourceKey): string {\n return `${rdSourceKey.provider}:${rdSourceKey.format}:${rdSourceKey.id}:${rdSourceKey?.iTwinId}`;\n }\n /** Utility function to compare two RealityDataSourceKey, we consider it equal even if itwinId is different */\n export function isEqual(key1: RealityDataSourceKey, key2: RealityDataSourceKey): boolean {\n if ((key1.provider === RealityDataProvider.CesiumIonAsset) && key2.provider === RealityDataProvider.CesiumIonAsset)\n return true; // ignore other properties for CesiumIonAsset, id is hidden\n if ((key1.provider === key2.provider) && (key1.format === key2.format) && (key1.id === key2.id)) {\n // && (key1?.iTwinId === key2?.iTwinId)) -> ignore iTwinId, consider it is the same reality data\n return true;\n }\n return false;\n }\n}\n\n/** JSON representation of the reality data reference attachment properties.\n * @beta\n*/\nexport interface RealityDataSourceProps {\n /** The source key that identify a reality data for the provider. */\n sourceKey: RealityDataSourceKey;\n}\n\n/** JSON representation of a [[ContextRealityModel]].\n * @public\n * @extensions\n */\nexport interface ContextRealityModelProps {\n /** See [[ContextRealityModel.rdSourceKey]].\n * @beta\n */\n rdSourceKey?: RealityDataSourceKey;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n tilesetUrl: string;\n /** See [[ContextRealityModel.orbitGtBlob]].\n * @alpha\n */\n orbitGtBlob?: OrbitGtBlobProps;\n /** See [[ContextRealityModel.realityDataId]]. */\n realityDataId?: string;\n /** An optional, user-friendly name for the reality model suitable for display in a user interface. */\n name?: string;\n /** An optional, user-friendly description of the reality model suitable for display in a user interface. */\n description?: string;\n /** See [[ContextRealityModel.classifiers]]. */\n classifiers?: SpatialClassifierProps[];\n /** See [[ContextRealityModel.planarClipMask]]. */\n planarClipMask?: PlanarClipMaskProps;\n /** See [[ContextRealityModel.appearanceOverrides]]. */\n appearanceOverrides?: FeatureAppearanceProps;\n /** See [[ContextRealityModel.displaySettings]].\n * @beta\n */\n displaySettings?: RealityModelDisplayProps;\n /** See [[ContextRealityModel.invisible]].\n * @beta\n */\n invisible?: boolean;\n}\n\n/** @public */\nexport namespace ContextRealityModelProps {\n /** Produce a deep copy of `input`. */\n export function clone(input: ContextRealityModelProps): ContextRealityModelProps {\n // Spread operator is shallow, and includes `undefined` properties and empty strings.\n // We want to make deep copies, omit undefined properties and empty strings, and require tilesetUrl to be defined.\n const output: ContextRealityModelProps = { tilesetUrl: input.tilesetUrl ?? \"\" };\n\n if (input.rdSourceKey)\n output.rdSourceKey = { ...input.rdSourceKey };\n\n if (input.name)\n output.name = input.name;\n\n if (input.realityDataId)\n output.realityDataId = input.realityDataId;\n\n if (input.description)\n output.description = input.description;\n\n if (input.orbitGtBlob)\n output.orbitGtBlob = { ...input.orbitGtBlob };\n\n if (input.appearanceOverrides) {\n output.appearanceOverrides = { ...input.appearanceOverrides };\n if (input.appearanceOverrides.rgb)\n output.appearanceOverrides.rgb = { ...input.appearanceOverrides.rgb };\n }\n\n if (input.displaySettings) {\n output.displaySettings = { ...input.displaySettings };\n if (input.displaySettings.pointCloud)\n output.displaySettings.pointCloud = { ...output.displaySettings.pointCloud };\n }\n\n if (input.planarClipMask)\n output.planarClipMask = { ...input.planarClipMask };\n\n if (input.classifiers)\n output.classifiers = input.classifiers.map((x) => { return { ...x, flags: { ...x.flags } }; });\n\n if (input.invisible)\n output.invisible = input.invisible;\n\n return output;\n }\n}\n\n/** A reality model not associated with a [GeometricModel]($backend) but instead defined in a [DisplayStyle]($backend) or [DisplayStyleState]($frontend).\n * Such reality models are displayed to provide context to the view and can be freely attached and detached at display time.\n * @see [this interactive example](https://www.itwinjs.org/sample-showcase/?group=Viewer&sample=reality-data-sample)\n * @see [[DisplayStyleSettings.contextRealityModels]] to define context reality models for a display style.\n * @public\n */\nexport class ContextRealityModel {\n /** @internal */\n protected readonly _props: ContextRealityModelProps;\n /**\n * The reality data source key identify the reality data provider and storage format.\n * It takes precedence over tilesetUrl and orbitGtBlob when present and can be use to actually replace these properties.\n * @beta\n */\n public readonly rdSourceKey?: RealityDataSourceKey;\n /** A name suitable for display in a user interface. By default, an empty string. */\n public readonly name: string;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n public readonly url: string;\n /** A description of the model suitable for display in a user interface. By default, an empty string. */\n public readonly description: string;\n /** An optional identifier that, if present, can be used to elide a request to the reality data service. */\n public readonly realityDataId?: string;\n\n private _invisible: boolean;\n private readonly _classifiers: SpatialClassifiers;\n /** @alpha */\n public readonly orbitGtBlob?: Readonly<OrbitGtBlobProps>;\n protected _appearanceOverrides?: FeatureAppearance;\n /** @beta */\n protected _displaySettings: RealityModelDisplaySettings;\n protected _planarClipMask?: PlanarClipMaskSettings;\n /** Event dispatched just before assignment to [[planarClipMaskSettings]]. */\n public readonly onPlanarClipMaskChanged = new BeEvent<(newSettings: PlanarClipMaskSettings | undefined, model: ContextRealityModel) => void>();\n /** Event dispatched just before assignment to [[appearanceOverrides]]. */\n public readonly onAppearanceOverridesChanged = new BeEvent<(newOverrides: FeatureAppearance | undefined, model: ContextRealityModel) => void>();\n /** Event dispatched just before assignment to [[displaySettings]].\n * @beta\n */\n public readonly onDisplaySettingsChanged = new BeEvent<(newSettings: RealityModelDisplaySettings, model: ContextRealityModel) => void>();\n /** Event dispatched just before a model become invisible\n * @beta\n */\n public readonly onInvisibleChanged = new BeEvent<(invisible: boolean, model: ContextRealityModel) => void>();\n\n /** Construct a new context reality model.\n * @param props JSON representation of the reality model, which will be kept in sync with changes made via the ContextRealityModel's methods.\n * @param options Options to customize how the reality model is created.\n */\n public constructor(props: ContextRealityModelProps, options?: { createClassifiers: (container: SpatialClassifiersContainer) => SpatialClassifiers }) {\n this._props = props;\n this.rdSourceKey = props.rdSourceKey;\n this.name = props.name ?? \"\";\n this.url = props.tilesetUrl ?? \"\";\n this.orbitGtBlob = props.orbitGtBlob;\n this.realityDataId = props.realityDataId;\n this.description = props.description ?? \"\";\n this._invisible = props.invisible ?? false;\n this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;\n this._displaySettings = RealityModelDisplaySettings.fromJSON(props.displaySettings);\n\n if (props.planarClipMask && props.planarClipMask.mode !== PlanarClipMaskMode.None)\n this._planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\n\n if (options?.createClassifiers) {\n this._classifiers = options.createClassifiers(props);\n } else {\n this._classifiers = new SpatialClassifiers(props);\n }\n }\n\n /** A set of [[SpatialClassifier]]s, of which one at any given time can be used to classify the reality model. */\n public get classifiers(): SpatialClassifiers {\n return this._classifiers;\n }\n\n /** Optionally describes how the geometry of the reality model can be masked by other models. */\n public get planarClipMaskSettings(): PlanarClipMaskSettings | undefined {\n return this._planarClipMask;\n }\n public set planarClipMaskSettings(settings: PlanarClipMaskSettings | undefined) {\n this.onPlanarClipMaskChanged.raiseEvent(settings, this);\n if (!settings)\n delete this._props.planarClipMask;\n else\n this._props.planarClipMask = settings.toJSON();\n\n this._planarClipMask = settings;\n }\n\n /** Overrides applied to the appearance of the reality model. Only the rgb, transparency, nonLocatable, and emphasized properties are applicable - the rest are ignored. */\n public get appearanceOverrides(): FeatureAppearance | undefined {\n return this._appearanceOverrides;\n }\n public set appearanceOverrides(overrides: FeatureAppearance | undefined) {\n this.onAppearanceOverridesChanged.raiseEvent(overrides, this);\n if (!overrides)\n delete this._props.appearanceOverrides;\n else\n this._props.appearanceOverrides = overrides.toJSON();\n\n this._appearanceOverrides = overrides;\n }\n\n /** Settings controlling how this reality model is displayed in a [Viewport]($frontend).\n * @beta\n */\n public get displaySettings(): RealityModelDisplaySettings {\n return this._displaySettings;\n }\n public set displaySettings(settings: RealityModelDisplaySettings) {\n this.onDisplaySettingsChanged.raiseEvent(settings, this);\n this._props.displaySettings = settings.toJSON();\n this._displaySettings = settings;\n }\n\n /** If true, reality model is not drawn.\n * @beta\n */\n public get invisible(): boolean {\n return this._invisible;\n }\n public set invisible(invisible: boolean) {\n if (invisible !== this.invisible) {\n this.onInvisibleChanged.raiseEvent(invisible, this);\n }\n\n this._props.invisible = invisible;\n this._invisible = invisible;\n }\n\n /** Convert this model to its JSON representation. */\n public toJSON(): ContextRealityModelProps {\n return ContextRealityModelProps.clone(this._props);\n }\n\n /** Returns true if [[name]] and [[url]] match the specified name and url. */\n public matchesNameAndUrl(name: string, url: string): boolean {\n return this.name === name && this.url === url;\n }\n}\n\n/** An object that can store the JSON representation of a list of [[ContextRealityModel]]s.\n * @see [[ContextRealityModels]].\n * @see [[DisplayStyleSettingsProps.contextRealityModels]].\n * @public\n * @extensions\n */\nexport interface ContextRealityModelsContainer {\n /** The list of reality models. */\n contextRealityModels?: ContextRealityModelProps[];\n /** @internal used for type discrimination with ContextRealityModelsArgs. */\n container?: never;\n}\n\n/** Arguments supplied to the constructor of [[ContextRealityModels]].\n * @public\n */\nexport interface ContextRealityModelsArgs {\n /** The object that holds the JSON representation of the list of context reality models. */\n container: ContextRealityModelsContainer;\n /** Optional function used to instantiate each [[ContextRealityModel]] in the list. */\n createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel;\n /** If true, the list will not be populated by the constructor. Instead, the caller is responsible for calling [[ContextRealityModels.populate]] exactly once after construction.\n * This is chiefly intended for use internally by the [DisplayStyleState]($frontend) constructor.\n */\n deferPopulating?: boolean;\n}\n\n/** A list of [[ContextRealityModel]]s attached to a [[DisplayStyleSettings]]. The list may be presented to the user with the name and description of each model.\n * The list is automatically synchronized with the underlying JSON representation provided by the input [[ContextRealityModelsContainer]].\n * @see [this interactive example](https://www.itwinjs.org/sample-showcase/?group=Viewer&sample=reality-data-sample)\n * @see [[DisplayStyleSettings.contextRealityModels]].\n * @public\n */\nexport class ContextRealityModels {\n private readonly _container: ContextRealityModelsContainer;\n private readonly _createModel: (props: ContextRealityModelProps) => ContextRealityModel;\n private readonly _models: ContextRealityModel[] = [];\n /** Event dispatched just before [[ContextRealityModel.planarClipMaskSettings]] is modified for one of the reality models. */\n public readonly onPlanarClipMaskChanged = new BeEvent<(model: ContextRealityModel, newSettings: PlanarClipMaskSettings | undefined) => void>();\n /** Event dispatched just before [[ContextRealityModel.appearanceOverrides]] is modified for one of the reality models. */\n public readonly onAppearanceOverridesChanged = new BeEvent<(model: ContextRealityModel, newOverrides: FeatureAppearance | undefined) => void>();\n /** Event dispatched just before [[ContextRealityModel.displaySettings]] is modified for one of the reality models.\n * @beta\n */\n public readonly onDisplaySettingsChanged = new BeEvent<(model: ContextRealityModel, newSettings: RealityModelDisplaySettings) => void>();\n /** Event dispatched just before [[ContextRealityModel.invisible]] is modified for one of the reality models.\n * @beta\n */\n public readonly onInvisibleChanged = new BeEvent<(model: ContextRealityModel, invisible: boolean) => void>();\n /** Event dispatched when a model is [[add]]ed, [[delete]]d, [[replace]]d, or [[update]]d. */\n public readonly onChanged = new BeEvent<(previousModel: ContextRealityModel | undefined, newModel: ContextRealityModel | undefined) => void>();\n\n /** Construct a new list of reality models from its JSON representation. The list will be initialized from `container.contextRealityModels` and that JSON representation\n * will be kept in sync with changes made to the list. The caller should not directly modify `container.contextRealityModels` or its contents as that will cause the list\n * to become out of sync with the JSON representation.\n * @param container The object that holds the JSON representation of the list.\n * @param createContextRealityModel Optional function used to instantiate each [[ContextRealityModel]] in the list.\n */\n public constructor(container: ContextRealityModelsContainer, createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel);\n\n /** Construct a new list of reality models from its JSON representation. The list will be initialized from `args.container.contextRealityModels` and that JSON representation\n * will be kept in sync with changes made to the list. The caller should not directly modify `container.contextRealityModels` or its contents as that will cause the list\n * to become out of sync with the JSON representation.\n * @param args Specifies the container and optionally customizes how the list of models is populated.\n */\n public constructor(args: ContextRealityModelsArgs);\n\n /** @internal */\n public constructor(arg0: ContextRealityModelsContainer | ContextRealityModelsArgs, createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel) {\n let container: ContextRealityModelsContainer;\n let defer = false;\n if (arg0.container) {\n container = arg0.container;\n createContextRealityModel = arg0.createContextRealityModel;\n defer = true === arg0.deferPopulating;\n } else {\n container = arg0;\n }\n\n this._container = container;\n this._createModel = createContextRealityModel ?? ((props) => new ContextRealityModel(props));\n\n if (!defer)\n this.populate();\n }\n\n /** @internal needs to be invoked after DisplayStyleSettings constructor by DisplayStyleState constructor.*/\n /** Populate the list of [[models]] from the container that was supplied to the constructor.\n * This should only be invoked once, and only if [[ContextRealityModelsArgs.deferPopulating]] was specified as `true` when calling the constructor.\n * @public\n */\n public populate(): void {\n assert(this._models.length === 0, \"do not call ContextRealityModels.populate more than once\");\n const models = this._container.contextRealityModels;\n if (models)\n for (const model of models)\n this._models.push(this.createModel(model));\n }\n\n /** The read-only list of reality models. */\n public get models(): ReadonlyArray<ContextRealityModel> {\n return this._models;\n }\n\n /** Append a new reality model to the list.\n * @param The JSON representation of the reality model.\n * @returns the newly-added reality model.\n */\n public add(props: ContextRealityModelProps): ContextRealityModel {\n if (!this._container.contextRealityModels)\n this._container.contextRealityModels = [];\n\n props = ContextRealityModelProps.clone(props);\n const model = this.createModel(props);\n\n this.onChanged.raiseEvent(undefined, model);\n\n this._models.push(model);\n this._container.contextRealityModels.push(props);\n\n return model;\n }\n\n /** Remove the specified reality model from the list.\n * @param model The reality model to remove.\n * @returns true if the model was removed, or false if the model was not present in the list.\n */\n public delete(model: ContextRealityModel): boolean {\n const index = this._models.indexOf(model);\n if (-1 === index)\n return false;\n\n assert(undefined !== this._container.contextRealityModels);\n assert(index < this._container.contextRealityModels.length);\n\n this.dropEventListeners(model);\n this.onChanged.raiseEvent(model, undefined);\n\n this._models.splice(index, 1);\n if (this.models.length === 0)\n this._container.contextRealityModels = undefined;\n else\n this._container.contextRealityModels.splice(index, 1);\n\n return true;\n }\n\n /** Remove all reality models from the list. */\n public clear(): void {\n for (const model of this.models) {\n this.dropEventListeners(model);\n this.onChanged.raiseEvent(model, undefined);\n }\n\n this._container.contextRealityModels = undefined;\n this._models.length = 0;\n }\n\n /** Replace a reality model in the list.\n * @param toReplace The reality model to be replaced.\n * @param replaceWith The JSON representation of the replacement reality model.\n * @returns the newly-created reality model that replaced `toReplace`.\n * @throws Error if `toReplace` is not present in the list\n * @note The replacement occupies the same index in the list as `toReplace` did.\n */\n public replace(toReplace: ContextRealityModel, replaceWith: ContextRealityModelProps): ContextRealityModel {\n const index = this._models.indexOf(toReplace);\n if (-1 === index)\n throw new Error(\"ContextRealityModel not present in list.\");\n\n assert(undefined !== this._container.contextRealityModels);\n assert(index < this._container.contextRealityModels.length);\n\n replaceWith = ContextRealityModelProps.clone(replaceWith);\n const model = this.createModel(replaceWith);\n\n this.onChanged.raiseEvent(toReplace, model);\n this.dropEventListeners(toReplace);\n\n this._models[index] = model;\n this._container.contextRealityModels[index] = replaceWith;\n\n return model;\n }\n\n /** Change selected properties of a reality model.\n * @param toUpdate The reality model whose properties are to be modified.\n * @param updateProps The properties to change.\n * @returns The updated reality model, identical to `toUpdate` except for properties explicitly supplied by `updateProps`.\n * @throws Error if `toUpdate` is not present in the list.\n */\n public update(toUpdate: ContextRealityModel, updateProps: Partial<ContextRealityModelProps>): ContextRealityModel {\n const props = {\n ...toUpdate.toJSON(),\n ...updateProps,\n };\n\n // Partial<> makes it possible to pass `undefined` for tilesetUrl...preserve previous URL in that case.\n if (undefined === props.tilesetUrl)\n props.tilesetUrl = toUpdate.url;\n\n return this.replace(toUpdate, props);\n }\n\n private createModel(props: ContextRealityModelProps): ContextRealityModel {\n const model = this._createModel(props);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onPlanarClipMaskChanged.addListener(this.handlePlanarClipMaskChanged, this);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onAppearanceOverridesChanged.addListener(this.handleAppearanceOverridesChanged, this);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onDisplaySettingsChanged.addListener(this.handleDisplaySettingsChanged, this);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onInvisibleChanged.addListener(this.handleInvisibleChanged, this);\n return model;\n }\n\n private dropEventListeners(model: ContextRealityModel): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onPlanarClipMaskChanged.removeListener(this.handlePlanarClipMaskChanged, this);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onAppearanceOverridesChanged.removeListener(this.handleAppearanceOverridesChanged, this);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onDisplaySettingsChanged.removeListener(this.handleDisplaySettingsChanged, this);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n model.onInvisibleChanged.removeListener(this.handleInvisibleChanged, this);\n }\n\n private handlePlanarClipMaskChanged(mask: PlanarClipMaskSettings | undefined, model: ContextRealityModel): void {\n this.onPlanarClipMaskChanged.raiseEvent(model, mask);\n }\n\n private handleAppearanceOverridesChanged(app: FeatureAppearance | undefined, model: ContextRealityModel): void {\n this.onAppearanceOverridesChanged.raiseEvent(model, app);\n }\n\n private handleDisplaySettingsChanged(settings: RealityModelDisplaySettings, model: ContextRealityModel): void {\n this.onDisplaySettingsChanged.raiseEvent(model, settings);\n }\n\n private handleInvisibleChanged(invisible: boolean, model: ContextRealityModel): void {\n this.onInvisibleChanged.raiseEvent(model, invisible);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContextRealityModel.js","sourceRoot":"","sources":["../../src/ContextRealityModel.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,yDAA+E;AAC/E,qDAAmG;AACnG,mEAAkH;AAClH,+EAAsG;AAatG;;GAEG;AACH,IAAY,mBAyBX;AAzBD,WAAY,mBAAmB;IAC7B;;;;;OAKG;IACH,gDAAyB,CAAA;IACzB;;;;;OAKG;IACH,kDAA2B,CAAA;IAC3B;;;;OAIG;IACH,oDAA6B,CAAA;IAC7B;;OAEG;IACH,wDAAiC,CAAA;AACnC,CAAC,EAzBW,mBAAmB,mCAAnB,mBAAmB,QAyB9B;AAED;;GAEG;AACH,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B;;SAEK;IACL,8CAAyB,CAAA;IACzB;;MAEE;IACF,gCAAW,CAAA;AACb,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B;AAED;;GAEG;AACH,WAAiB,iBAAiB;IAChC;;;;OAIG;IACH,SAAgB,OAAO,CAAC,UAAkB;QACxC,IAAI,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAC1C,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC7B,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,yBAAO,UAKtB,CAAA;AACH,CAAC,EAZgB,iBAAiB,iCAAjB,iBAAiB,QAYjC;AAuBD;;WAEW;AACX,IAAiB,oBAAoB,CAepC;AAfD,WAAiB,oBAAoB;IACnC,wFAAwF;IACxF,SAAgB,eAAe,CAAC,WAAiC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C,2BAA2B,EAAE,IAAI,CAAC,CAAC;QACrF,6DAA6D;QAC7D,KAAK,CAAC,4BAA4B,CAAC,cAAc,CAAC,IAAI,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC;QAC/F,6DAA6D;QAC7D,KAAK,CAAC,wBAAwB,CAAC,cAAc,CAAC,IAAI,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;QACvF,6DAA6D;QAC7D,KAAK,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAC7E,CAAC;IAEO,2BAA2B,CAAC,IAAwC,EAAE,KAA0B;QACtG,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAEO,gCAAgC,CAAC,GAAkC,EAAE,KAA0B;QACrG,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;IAEO,4BAA4B,CAAC,QAAqC,EAAE,KAA0B;QACpG,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAEO,sBAAsB,CAAC,SAAkB,EAAE,KAA0B;QAC3E,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;CACF;AAlND,oDAkNC","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 DisplayStyles\r\n */\r\n\r\nimport { assert, BeEvent } from \"@itwin/core-bentley\";\r\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\r\nimport { PlanarClipMaskMode, PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\r\nimport { SpatialClassifierProps, SpatialClassifiers, SpatialClassifiersContainer } from \"./SpatialClassification\";\r\nimport { RealityModelDisplayProps, RealityModelDisplaySettings } from \"./RealityModelDisplaySettings\";\r\n\r\n/** JSON representation of the blob properties for an OrbitGt property cloud.\r\n * @alpha\r\n */\r\nexport interface OrbitGtBlobProps {\r\n rdsUrl?: string;\r\n containerName: string;\r\n blobFileName: string;\r\n sasToken: string;\r\n accountName: string;\r\n}\r\n\r\n/** Identify the Reality Data service provider\r\n * @beta\r\n */\r\nexport enum RealityDataProvider {\r\n /**\r\n * This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.tilesetUrl property.\r\n * It was used to support RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles\r\n * You should use other modes when possible\r\n * @see [[RealityDataSource.createKeyFromUrl]] that will try to detect provider from an URL\r\n */\r\n TilesetUrl = \"TilesetUrl\",\r\n /**\r\n * This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.OrbitGtBlob property.\r\n * It was used to support OrbitPointCloud (OPC) from other server than ContextShare\r\n * You should use other modes when possible\r\n * @see [[RealityDataSource.createKeyFromOrbitGtBlobProps]] that will try to detect provider from an URL\r\n */\r\n OrbitGtBlob = \"OrbitGtBlob\",\r\n /**\r\n * Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or OPC storage format\r\n * This provider supports all types of 3dTile storage format and OrbitPointCloud: RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles, OPC\r\n * @see [[RealityDataFormat]].\r\n */\r\n ContextShare = \"ContextShare\",\r\n /**\r\n * Will provide Open Street Map Building (OSM) from Cesium Ion (in 3dTile format)\r\n */\r\n CesiumIonAsset = \"CesiumIonAsset\",\r\n}\r\n\r\n/** Identify the Reality Data storage format\r\n * @beta\r\n */\r\nexport enum RealityDataFormat {\r\n /**\r\n * 3dTile supported formats; RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles\r\n * */\r\n ThreeDTile = \"ThreeDTile\",\r\n /**\r\n * Orbit Point Cloud (OPC) storage format (RealityDataType.OPC)\r\n */\r\n OPC = \"OPC\",\r\n}\r\n\r\n/** Utility function for RealityDataFormat\r\n * @beta\r\n */\r\nexport namespace RealityDataFormat {\r\n /**\r\n * Try to extract the RealityDataFormat from the url\r\n * @param tilesetUrl the reality data attachment url\r\n * @returns the extracted RealityDataFormat or ThreeDTile by default if not found\r\n */\r\n export function fromUrl(tilesetUrl: string): RealityDataFormat {\r\n let format = RealityDataFormat.ThreeDTile;\r\n if (tilesetUrl.includes(\".opc\"))\r\n format = RealityDataFormat.OPC;\r\n return format;\r\n }\r\n}\r\n\r\n/**\r\n * Key used by RealityDataSource to identify provider and reality data format\r\n * This key identify one and only one reality data source on the provider\r\n * @beta\r\n */\r\nexport interface RealityDataSourceKey {\r\n /**\r\n * The provider that supplies the access to reality data source for displaying the reality model\r\n * @see [[RealityDataProvider]] for default supported value;\r\n */\r\n provider: string;\r\n /**\r\n * The format used by the provider to store the reality data\r\n * @see [[RealityDataFormat]] for default supported value;\r\n */\r\n format: string;\r\n /** The reality data id that identify a reality data for the provider */\r\n id: string;\r\n /** The context id that was used when reality data was attached - if none provided, current session iTwinId will be used */\r\n iTwinId?: string;\r\n}\r\n/**\r\n * RealityDataSourceKey utility functions\r\n * @beta */\r\nexport namespace RealityDataSourceKey {\r\n /** Utility function to convert a RealityDataSourceKey into its string representation */\r\n export function convertToString(rdSourceKey: RealityDataSourceKey): string {\r\n return `${rdSourceKey.provider}:${rdSourceKey.format}:${rdSourceKey.id}:${rdSourceKey?.iTwinId}`;\r\n }\r\n /** Utility function to compare two RealityDataSourceKey, we consider it equal even if itwinId is different */\r\n export function isEqual(key1: RealityDataSourceKey, key2: RealityDataSourceKey): boolean {\r\n if ((key1.provider === RealityDataProvider.CesiumIonAsset) && key2.provider === RealityDataProvider.CesiumIonAsset)\r\n return true; // ignore other properties for CesiumIonAsset, id is hidden\r\n if ((key1.provider === key2.provider) && (key1.format === key2.format) && (key1.id === key2.id)) {\r\n // && (key1?.iTwinId === key2?.iTwinId)) -> ignore iTwinId, consider it is the same reality data\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of the reality data reference attachment properties.\r\n * @beta\r\n*/\r\nexport interface RealityDataSourceProps {\r\n /** The source key that identify a reality data for the provider. */\r\n sourceKey: RealityDataSourceKey;\r\n}\r\n\r\n/** JSON representation of a [[ContextRealityModel]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ContextRealityModelProps {\r\n /** See [[ContextRealityModel.rdSourceKey]].\r\n * @beta\r\n */\r\n rdSourceKey?: RealityDataSourceKey;\r\n /** The URL that supplies the 3d tiles for displaying the reality model. */\r\n tilesetUrl: string;\r\n /** See [[ContextRealityModel.orbitGtBlob]].\r\n * @alpha\r\n */\r\n orbitGtBlob?: OrbitGtBlobProps;\r\n /** See [[ContextRealityModel.realityDataId]]. */\r\n realityDataId?: string;\r\n /** An optional, user-friendly name for the reality model suitable for display in a user interface. */\r\n name?: string;\r\n /** An optional, user-friendly description of the reality model suitable for display in a user interface. */\r\n description?: string;\r\n /** See [[ContextRealityModel.classifiers]]. */\r\n classifiers?: SpatialClassifierProps[];\r\n /** See [[ContextRealityModel.planarClipMask]]. */\r\n planarClipMask?: PlanarClipMaskProps;\r\n /** See [[ContextRealityModel.appearanceOverrides]]. */\r\n appearanceOverrides?: FeatureAppearanceProps;\r\n /** See [[ContextRealityModel.displaySettings]].\r\n * @beta\r\n */\r\n displaySettings?: RealityModelDisplayProps;\r\n /** See [[ContextRealityModel.invisible]].\r\n * @beta\r\n */\r\n invisible?: boolean;\r\n}\r\n\r\n/** @public */\r\nexport namespace ContextRealityModelProps {\r\n /** Produce a deep copy of `input`. */\r\n export function clone(input: ContextRealityModelProps): ContextRealityModelProps {\r\n // Spread operator is shallow, and includes `undefined` properties and empty strings.\r\n // We want to make deep copies, omit undefined properties and empty strings, and require tilesetUrl to be defined.\r\n const output: ContextRealityModelProps = { tilesetUrl: input.tilesetUrl ?? \"\" };\r\n\r\n if (input.rdSourceKey)\r\n output.rdSourceKey = { ...input.rdSourceKey };\r\n\r\n if (input.name)\r\n output.name = input.name;\r\n\r\n if (input.realityDataId)\r\n output.realityDataId = input.realityDataId;\r\n\r\n if (input.description)\r\n output.description = input.description;\r\n\r\n if (input.orbitGtBlob)\r\n output.orbitGtBlob = { ...input.orbitGtBlob };\r\n\r\n if (input.appearanceOverrides) {\r\n output.appearanceOverrides = { ...input.appearanceOverrides };\r\n if (input.appearanceOverrides.rgb)\r\n output.appearanceOverrides.rgb = { ...input.appearanceOverrides.rgb };\r\n }\r\n\r\n if (input.displaySettings) {\r\n output.displaySettings = { ...input.displaySettings };\r\n if (input.displaySettings.pointCloud)\r\n output.displaySettings.pointCloud = { ...output.displaySettings.pointCloud };\r\n }\r\n\r\n if (input.planarClipMask)\r\n output.planarClipMask = { ...input.planarClipMask };\r\n\r\n if (input.classifiers)\r\n output.classifiers = input.classifiers.map((x) => { return { ...x, flags: { ...x.flags } }; });\r\n\r\n if (input.invisible)\r\n output.invisible = input.invisible;\r\n\r\n return output;\r\n }\r\n}\r\n\r\n/** A reality model not associated with a [GeometricModel]($backend) but instead defined in a [DisplayStyle]($backend) or [DisplayStyleState]($frontend).\r\n * Such reality models are displayed to provide context to the view and can be freely attached and detached at display time.\r\n * @see [this interactive example](https://www.itwinjs.org/sample-showcase/?group=Viewer&sample=reality-data-sample)\r\n * @see [[DisplayStyleSettings.contextRealityModels]] to define context reality models for a display style.\r\n * @public\r\n */\r\nexport class ContextRealityModel {\r\n /** @internal */\r\n protected readonly _props: ContextRealityModelProps;\r\n /**\r\n * The reality data source key identify the reality data provider and storage format.\r\n * It takes precedence over tilesetUrl and orbitGtBlob when present and can be use to actually replace these properties.\r\n * @beta\r\n */\r\n public readonly rdSourceKey?: RealityDataSourceKey;\r\n /** A name suitable for display in a user interface. By default, an empty string. */\r\n public readonly name: string;\r\n /** The URL that supplies the 3d tiles for displaying the reality model. */\r\n public readonly url: string;\r\n /** A description of the model suitable for display in a user interface. By default, an empty string. */\r\n public readonly description: string;\r\n /** An optional identifier that, if present, can be used to elide a request to the reality data service. */\r\n public readonly realityDataId?: string;\r\n\r\n private _invisible: boolean;\r\n private readonly _classifiers: SpatialClassifiers;\r\n /** @alpha */\r\n public readonly orbitGtBlob?: Readonly<OrbitGtBlobProps>;\r\n protected _appearanceOverrides?: FeatureAppearance;\r\n /** @beta */\r\n protected _displaySettings: RealityModelDisplaySettings;\r\n protected _planarClipMask?: PlanarClipMaskSettings;\r\n /** Event dispatched just before assignment to [[planarClipMaskSettings]]. */\r\n public readonly onPlanarClipMaskChanged = new BeEvent<(newSettings: PlanarClipMaskSettings | undefined, model: ContextRealityModel) => void>();\r\n /** Event dispatched just before assignment to [[appearanceOverrides]]. */\r\n public readonly onAppearanceOverridesChanged = new BeEvent<(newOverrides: FeatureAppearance | undefined, model: ContextRealityModel) => void>();\r\n /** Event dispatched just before assignment to [[displaySettings]].\r\n * @beta\r\n */\r\n public readonly onDisplaySettingsChanged = new BeEvent<(newSettings: RealityModelDisplaySettings, model: ContextRealityModel) => void>();\r\n /** Event dispatched just before a model become invisible\r\n * @beta\r\n */\r\n public readonly onInvisibleChanged = new BeEvent<(invisible: boolean, model: ContextRealityModel) => void>();\r\n\r\n /** Construct a new context reality model.\r\n * @param props JSON representation of the reality model, which will be kept in sync with changes made via the ContextRealityModel's methods.\r\n * @param options Options to customize how the reality model is created.\r\n */\r\n public constructor(props: ContextRealityModelProps, options?: { createClassifiers: (container: SpatialClassifiersContainer) => SpatialClassifiers }) {\r\n this._props = props;\r\n this.rdSourceKey = props.rdSourceKey;\r\n this.name = props.name ?? \"\";\r\n this.url = props.tilesetUrl ?? \"\";\r\n this.orbitGtBlob = props.orbitGtBlob;\r\n this.realityDataId = props.realityDataId;\r\n this.description = props.description ?? \"\";\r\n this._invisible = props.invisible ?? false;\r\n this._appearanceOverrides = props.appearanceOverrides ? FeatureAppearance.fromJSON(props.appearanceOverrides) : undefined;\r\n this._displaySettings = RealityModelDisplaySettings.fromJSON(props.displaySettings);\r\n\r\n if (props.planarClipMask && props.planarClipMask.mode !== PlanarClipMaskMode.None)\r\n this._planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\r\n\r\n if (options?.createClassifiers) {\r\n this._classifiers = options.createClassifiers(props);\r\n } else {\r\n this._classifiers = new SpatialClassifiers(props);\r\n }\r\n }\r\n\r\n /** A set of [[SpatialClassifier]]s, of which one at any given time can be used to classify the reality model. */\r\n public get classifiers(): SpatialClassifiers {\r\n return this._classifiers;\r\n }\r\n\r\n /** Optionally describes how the geometry of the reality model can be masked by other models. */\r\n public get planarClipMaskSettings(): PlanarClipMaskSettings | undefined {\r\n return this._planarClipMask;\r\n }\r\n public set planarClipMaskSettings(settings: PlanarClipMaskSettings | undefined) {\r\n this.onPlanarClipMaskChanged.raiseEvent(settings, this);\r\n if (!settings)\r\n delete this._props.planarClipMask;\r\n else\r\n this._props.planarClipMask = settings.toJSON();\r\n\r\n this._planarClipMask = settings;\r\n }\r\n\r\n /** Overrides applied to the appearance of the reality model. Only the rgb, transparency, nonLocatable, and emphasized properties are applicable - the rest are ignored. */\r\n public get appearanceOverrides(): FeatureAppearance | undefined {\r\n return this._appearanceOverrides;\r\n }\r\n public set appearanceOverrides(overrides: FeatureAppearance | undefined) {\r\n this.onAppearanceOverridesChanged.raiseEvent(overrides, this);\r\n if (!overrides)\r\n delete this._props.appearanceOverrides;\r\n else\r\n this._props.appearanceOverrides = overrides.toJSON();\r\n\r\n this._appearanceOverrides = overrides;\r\n }\r\n\r\n /** Settings controlling how this reality model is displayed in a [Viewport]($frontend).\r\n * @beta\r\n */\r\n public get displaySettings(): RealityModelDisplaySettings {\r\n return this._displaySettings;\r\n }\r\n public set displaySettings(settings: RealityModelDisplaySettings) {\r\n this.onDisplaySettingsChanged.raiseEvent(settings, this);\r\n this._props.displaySettings = settings.toJSON();\r\n this._displaySettings = settings;\r\n }\r\n\r\n /** If true, reality model is not drawn.\r\n * @beta\r\n */\r\n public get invisible(): boolean {\r\n return this._invisible;\r\n }\r\n public set invisible(invisible: boolean) {\r\n if (invisible !== this.invisible) {\r\n this.onInvisibleChanged.raiseEvent(invisible, this);\r\n }\r\n\r\n this._props.invisible = invisible;\r\n this._invisible = invisible;\r\n }\r\n\r\n /** Convert this model to its JSON representation. */\r\n public toJSON(): ContextRealityModelProps {\r\n return ContextRealityModelProps.clone(this._props);\r\n }\r\n\r\n /** Returns true if [[name]] and [[url]] match the specified name and url. */\r\n public matchesNameAndUrl(name: string, url: string): boolean {\r\n return this.name === name && this.url === url;\r\n }\r\n}\r\n\r\n/** An object that can store the JSON representation of a list of [[ContextRealityModel]]s.\r\n * @see [[ContextRealityModels]].\r\n * @see [[DisplayStyleSettingsProps.contextRealityModels]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ContextRealityModelsContainer {\r\n /** The list of reality models. */\r\n contextRealityModels?: ContextRealityModelProps[];\r\n /** @internal used for type discrimination with ContextRealityModelsArgs. */\r\n container?: never;\r\n}\r\n\r\n/** Arguments supplied to the constructor of [[ContextRealityModels]].\r\n * @public\r\n */\r\nexport interface ContextRealityModelsArgs {\r\n /** The object that holds the JSON representation of the list of context reality models. */\r\n container: ContextRealityModelsContainer;\r\n /** Optional function used to instantiate each [[ContextRealityModel]] in the list. */\r\n createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel;\r\n /** If true, the list will not be populated by the constructor. Instead, the caller is responsible for calling [[ContextRealityModels.populate]] exactly once after construction.\r\n * This is chiefly intended for use internally by the [DisplayStyleState]($frontend) constructor.\r\n */\r\n deferPopulating?: boolean;\r\n}\r\n\r\n/** A list of [[ContextRealityModel]]s attached to a [[DisplayStyleSettings]]. The list may be presented to the user with the name and description of each model.\r\n * The list is automatically synchronized with the underlying JSON representation provided by the input [[ContextRealityModelsContainer]].\r\n * @see [this interactive example](https://www.itwinjs.org/sample-showcase/?group=Viewer&sample=reality-data-sample)\r\n * @see [[DisplayStyleSettings.contextRealityModels]].\r\n * @public\r\n */\r\nexport class ContextRealityModels {\r\n private readonly _container: ContextRealityModelsContainer;\r\n private readonly _createModel: (props: ContextRealityModelProps) => ContextRealityModel;\r\n private readonly _models: ContextRealityModel[] = [];\r\n /** Event dispatched just before [[ContextRealityModel.planarClipMaskSettings]] is modified for one of the reality models. */\r\n public readonly onPlanarClipMaskChanged = new BeEvent<(model: ContextRealityModel, newSettings: PlanarClipMaskSettings | undefined) => void>();\r\n /** Event dispatched just before [[ContextRealityModel.appearanceOverrides]] is modified for one of the reality models. */\r\n public readonly onAppearanceOverridesChanged = new BeEvent<(model: ContextRealityModel, newOverrides: FeatureAppearance | undefined) => void>();\r\n /** Event dispatched just before [[ContextRealityModel.displaySettings]] is modified for one of the reality models.\r\n * @beta\r\n */\r\n public readonly onDisplaySettingsChanged = new BeEvent<(model: ContextRealityModel, newSettings: RealityModelDisplaySettings) => void>();\r\n /** Event dispatched just before [[ContextRealityModel.invisible]] is modified for one of the reality models.\r\n * @beta\r\n */\r\n public readonly onInvisibleChanged = new BeEvent<(model: ContextRealityModel, invisible: boolean) => void>();\r\n /** Event dispatched when a model is [[add]]ed, [[delete]]d, [[replace]]d, or [[update]]d. */\r\n public readonly onChanged = new BeEvent<(previousModel: ContextRealityModel | undefined, newModel: ContextRealityModel | undefined) => void>();\r\n\r\n /** Construct a new list of reality models from its JSON representation. The list will be initialized from `container.contextRealityModels` and that JSON representation\r\n * will be kept in sync with changes made to the list. The caller should not directly modify `container.contextRealityModels` or its contents as that will cause the list\r\n * to become out of sync with the JSON representation.\r\n * @param container The object that holds the JSON representation of the list.\r\n * @param createContextRealityModel Optional function used to instantiate each [[ContextRealityModel]] in the list.\r\n */\r\n public constructor(container: ContextRealityModelsContainer, createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel);\r\n\r\n /** Construct a new list of reality models from its JSON representation. The list will be initialized from `args.container.contextRealityModels` and that JSON representation\r\n * will be kept in sync with changes made to the list. The caller should not directly modify `container.contextRealityModels` or its contents as that will cause the list\r\n * to become out of sync with the JSON representation.\r\n * @param args Specifies the container and optionally customizes how the list of models is populated.\r\n */\r\n public constructor(args: ContextRealityModelsArgs);\r\n\r\n /** @internal */\r\n public constructor(arg0: ContextRealityModelsContainer | ContextRealityModelsArgs, createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel) {\r\n let container: ContextRealityModelsContainer;\r\n let defer = false;\r\n if (arg0.container) {\r\n container = arg0.container;\r\n createContextRealityModel = arg0.createContextRealityModel;\r\n defer = true === arg0.deferPopulating;\r\n } else {\r\n container = arg0;\r\n }\r\n\r\n this._container = container;\r\n this._createModel = createContextRealityModel ?? ((props) => new ContextRealityModel(props));\r\n\r\n if (!defer)\r\n this.populate();\r\n }\r\n\r\n /** @internal needs to be invoked after DisplayStyleSettings constructor by DisplayStyleState constructor.*/\r\n /** Populate the list of [[models]] from the container that was supplied to the constructor.\r\n * This should only be invoked once, and only if [[ContextRealityModelsArgs.deferPopulating]] was specified as `true` when calling the constructor.\r\n * @public\r\n */\r\n public populate(): void {\r\n assert(this._models.length === 0, \"do not call ContextRealityModels.populate more than once\");\r\n const models = this._container.contextRealityModels;\r\n if (models)\r\n for (const model of models)\r\n this._models.push(this.createModel(model));\r\n }\r\n\r\n /** The read-only list of reality models. */\r\n public get models(): ReadonlyArray<ContextRealityModel> {\r\n return this._models;\r\n }\r\n\r\n /** Append a new reality model to the list.\r\n * @param The JSON representation of the reality model.\r\n * @returns the newly-added reality model.\r\n */\r\n public add(props: ContextRealityModelProps): ContextRealityModel {\r\n if (!this._container.contextRealityModels)\r\n this._container.contextRealityModels = [];\r\n\r\n props = ContextRealityModelProps.clone(props);\r\n const model = this.createModel(props);\r\n\r\n this.onChanged.raiseEvent(undefined, model);\r\n\r\n this._models.push(model);\r\n this._container.contextRealityModels.push(props);\r\n\r\n return model;\r\n }\r\n\r\n /** Remove the specified reality model from the list.\r\n * @param model The reality model to remove.\r\n * @returns true if the model was removed, or false if the model was not present in the list.\r\n */\r\n public delete(model: ContextRealityModel): boolean {\r\n const index = this._models.indexOf(model);\r\n if (-1 === index)\r\n return false;\r\n\r\n assert(undefined !== this._container.contextRealityModels);\r\n assert(index < this._container.contextRealityModels.length);\r\n\r\n this.dropEventListeners(model);\r\n this.onChanged.raiseEvent(model, undefined);\r\n\r\n this._models.splice(index, 1);\r\n if (this.models.length === 0)\r\n this._container.contextRealityModels = undefined;\r\n else\r\n this._container.contextRealityModels.splice(index, 1);\r\n\r\n return true;\r\n }\r\n\r\n /** Remove all reality models from the list. */\r\n public clear(): void {\r\n for (const model of this.models) {\r\n this.dropEventListeners(model);\r\n this.onChanged.raiseEvent(model, undefined);\r\n }\r\n\r\n this._container.contextRealityModels = undefined;\r\n this._models.length = 0;\r\n }\r\n\r\n /** Replace a reality model in the list.\r\n * @param toReplace The reality model to be replaced.\r\n * @param replaceWith The JSON representation of the replacement reality model.\r\n * @returns the newly-created reality model that replaced `toReplace`.\r\n * @throws Error if `toReplace` is not present in the list\r\n * @note The replacement occupies the same index in the list as `toReplace` did.\r\n */\r\n public replace(toReplace: ContextRealityModel, replaceWith: ContextRealityModelProps): ContextRealityModel {\r\n const index = this._models.indexOf(toReplace);\r\n if (-1 === index)\r\n throw new Error(\"ContextRealityModel not present in list.\");\r\n\r\n assert(undefined !== this._container.contextRealityModels);\r\n assert(index < this._container.contextRealityModels.length);\r\n\r\n replaceWith = ContextRealityModelProps.clone(replaceWith);\r\n const model = this.createModel(replaceWith);\r\n\r\n this.onChanged.raiseEvent(toReplace, model);\r\n this.dropEventListeners(toReplace);\r\n\r\n this._models[index] = model;\r\n this._container.contextRealityModels[index] = replaceWith;\r\n\r\n return model;\r\n }\r\n\r\n /** Change selected properties of a reality model.\r\n * @param toUpdate The reality model whose properties are to be modified.\r\n * @param updateProps The properties to change.\r\n * @returns The updated reality model, identical to `toUpdate` except for properties explicitly supplied by `updateProps`.\r\n * @throws Error if `toUpdate` is not present in the list.\r\n */\r\n public update(toUpdate: ContextRealityModel, updateProps: Partial<ContextRealityModelProps>): ContextRealityModel {\r\n const props = {\r\n ...toUpdate.toJSON(),\r\n ...updateProps,\r\n };\r\n\r\n // Partial<> makes it possible to pass `undefined` for tilesetUrl...preserve previous URL in that case.\r\n if (undefined === props.tilesetUrl)\r\n props.tilesetUrl = toUpdate.url;\r\n\r\n return this.replace(toUpdate, props);\r\n }\r\n\r\n private createModel(props: ContextRealityModelProps): ContextRealityModel {\r\n const model = this._createModel(props);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onPlanarClipMaskChanged.addListener(this.handlePlanarClipMaskChanged, this);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onAppearanceOverridesChanged.addListener(this.handleAppearanceOverridesChanged, this);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onDisplaySettingsChanged.addListener(this.handleDisplaySettingsChanged, this);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onInvisibleChanged.addListener(this.handleInvisibleChanged, this);\r\n return model;\r\n }\r\n\r\n private dropEventListeners(model: ContextRealityModel): void {\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onPlanarClipMaskChanged.removeListener(this.handlePlanarClipMaskChanged, this);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onAppearanceOverridesChanged.removeListener(this.handleAppearanceOverridesChanged, this);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onDisplaySettingsChanged.removeListener(this.handleDisplaySettingsChanged, this);\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n model.onInvisibleChanged.removeListener(this.handleInvisibleChanged, this);\r\n }\r\n\r\n private handlePlanarClipMaskChanged(mask: PlanarClipMaskSettings | undefined, model: ContextRealityModel): void {\r\n this.onPlanarClipMaskChanged.raiseEvent(model, mask);\r\n }\r\n\r\n private handleAppearanceOverridesChanged(app: FeatureAppearance | undefined, model: ContextRealityModel): void {\r\n this.onAppearanceOverridesChanged.raiseEvent(model, app);\r\n }\r\n\r\n private handleDisplaySettingsChanged(settings: RealityModelDisplaySettings, model: ContextRealityModel): void {\r\n this.onDisplaySettingsChanged.raiseEvent(model, settings);\r\n }\r\n\r\n private handleInvisibleChanged(invisible: boolean, model: ContextRealityModel): void {\r\n this.onInvisibleChanged.raiseEvent(model, invisible);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContourDisplay.js","sourceRoot":"","sources":["../../src/ContourDisplay.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsK;AACtK,6CAA0C;AAC1C,yCAAqD;AAoBrD;;;;GAIG;AACH,MAAa,YAAY;IACvB,oEAAoE;IACpD,KAAK,CAAW;IAChC;;;OAGG;IACa,UAAU,CAAS;IACnC,uFAAuF;IACvE,OAAO,CAAa;IAEpC,mEAAmE;IAC5D,MAAM,CAAC,KAAmB;QAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;YAC9G,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yEAAyE;IAClE,OAAO,CAAC,KAAmB;QAChC,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,OAAO,CAAC,GAAiB,EAAE,GAAiB;QACxD,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,IAAA,6BAAc,EAAC,GAAG,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eAAwB;QACjD,OAAO,eAAe,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAC/G,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAgD;QAC3D,IAAI,CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC7D,CAAC;;AAtFH,wCAuFC","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 Symbology\n */\n\nimport { compareArrays, compareBooleans, compareNumbers, compareStrings, CompressedId64Set, NonFunctionPropertiesOf, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { LinePixels } from \"./LinePixels\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\n\n/** JSON representation of a [[ContourStyle]].\n * @public\n */\nexport interface ContourStyleProps {\n /** See [[ContourStyle.color]]. */\n color?: RgbColorProps;\n /** See [[ContourStyle.pixelWidth]]. */\n pixelWidth?: number;\n /** See [[ContourStyle.pattern]]. */\n pattern?: LinePixels;\n}\n\n/** A type containing all of the properties of [[ContourStyle]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourStyle.create]] and [[ContourStyle.clone]].\n * @public\n */\nexport type ContourStyleProperties = NonFunctionPropertiesOf<ContourStyle>;\n\n/** The style settings used by either a minor or major contour.\n * @see [[Contour.majorStyle]]\n * @see [[Contour.minorStyle]]\n * @public\n */\nexport class ContourStyle {\n /** The color in which to draw the contour lines. Default: black. */\n public readonly color: RgbColor;\n /** The width in screen pixels of the contour lines.\n * Useful values range between 1 and 8.5, in increments of 0.5. Other values will be rounded to meet these criteria.\n * Default: 1.0.\n */\n public readonly pixelWidth: number;\n /** The pattern for a major or minor contour line. Defaults to [[LinePixels.Solid]]. */\n public readonly pattern: LinePixels;\n\n /** Returns true if `this` and `other` are logically equivalent. */\n public equals(other: ContourStyle): boolean {\n if (!this.color.equals(other.color) || this.pixelWidth !== other.pixelWidth || this.pattern !== other.pattern) {\n return false;\n }\n return true;\n }\n\n /** Perform ordered comparison between this and another contour style. */\n public compare(other: ContourStyle): number {\n return ContourStyle.compare(this, other);\n }\n\n /** Performs ordered comparison of two contour styles.\n * @param lhs First contour style to compare\n * @param rhs Second contour style to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n * @public\n */\n public static compare(lhs: ContourStyle, rhs: ContourStyle): number {\n let diff = 0;\n if ((diff = lhs.color.compareTo(rhs.color)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.pixelWidth, rhs.pixelWidth)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.pattern, rhs.pattern)) !== 0)\n return diff;\n\n return diff;\n }\n\n private constructor(props?: Partial<ContourStyleProperties>) {\n this.color = props?.color ?? RgbColor.fromJSON({r: 0, g: 0, b: 0});\n this.pixelWidth = props?.pixelWidth ?? 1;\n this.pattern = props?.pattern ?? LinePixels.Solid;\n }\n\n public static fromJSON(props?: ContourStyleProps) {\n if (!props)\n return new ContourStyle();\n\n return new this({\n color: props?.color ? RgbColor.fromJSON(props.color) : undefined,\n pixelWidth: props?.pixelWidth,\n pattern: props?.pattern,\n });\n }\n\n public toJSON(): ContourStyleProps {\n const props: ContourStyleProps = {};\n\n if (!this.color.equals(RgbColor.fromJSON({r: 0, g: 0, b: 0})))\n props.color = this.color.toJSON();\n\n if (1 !== this.pixelWidth)\n props.pixelWidth = this.pixelWidth;\n\n if (0 !== this.pattern)\n props.pattern = this.pattern;\n\n return props;\n }\n\n /** Create a new ContourStyle. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourStyleProperties>): ContourStyle {\n return props ? new this(props) : new ContourStyle();\n }\n\n /** Create a copy of this ContourStyle, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourStyleProperties>): ContourStyle {\n if (!changedProps)\n return this;\n\n return ContourStyle.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of a [[Contour]].\n * @public\n */\nexport interface ContourProps {\n /** See [[Contour.majorStyle]]. */\n majorStyle?: ContourStyleProps;\n /** See [[Contour.minor]]. */\n minorStyle?: ContourStyleProps;\n /** See [[Contour.minorInterval]]. */\n minorInterval?: number;\n /** See [[Contour.majorIntervalCount]]. */\n majorIntervalCount?: number;\n /** See [[Contour.showGeometry]] */\n showGeometry?: boolean;\n}\n\n/** A type containing all of the properties of [[Contour]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[Contour.create]] and [[Contour.clone]].\n * @public\n */\nexport type ContourProperties = NonFunctionPropertiesOf<Contour>;\n\n/** Describes how to generate and style contour lines for geometry within a single [[ContourGroup]].\n * Contours provide a way to visualize elevation within a 3d scene by drawing lines at fixed intervals along the z-axis.\n * There are actually 2 kinds of contour lines: major and minor. Each kind can be styled independently.\n * A contour line is generated every [[minorInterval]] meters. Every `nth` line will be a *major* contour, where `n` = [[majorIntervalCount]]; the intervening lines will\n * all be *minor* contours.\n * For example, with a [[majorIntervalCount]] of `1`, every contour will be major; of `2`, every other contour will be major; and of `3`, there will be two minor contours in between\n * each major contour.\n *\n * @public\n */\nexport class Contour {\n /** Settings that describe how a major contour is styled. Defaults to an instantation of [[ContourStyle]] using `pixelWidth` of 2 and default values for the other properties. */\n public readonly majorStyle: ContourStyle;\n /** Settings that describe how a minor contour is styled. Defaults to an instantation of [[ContourStyle]] using default values for the properties. */\n public readonly minorStyle: ContourStyle;\n /** The interval for the minor contour occurrence in meters; these can be specified as fractional. Defaults to 1. If a value <= 0 is specified, this will be treated as 1 meter. */\n public readonly minorInterval: number;\n /** The count of minor contour intervals that define a major interval (integer > 0). A value of 1 means no minor contours will be shown, only major contours. Defaults to 5. If a value < 1 is specified, this will be treated as 1. If a non-integer value is specified, it will be treated as if it were rounded to the nearest integer. */\n public readonly majorIntervalCount: number;\n /** If true, show underlying geometry along with the associated contours. If false, only show the contours, not the underlying geometry. Defaults to true. */\n public readonly showGeometry: boolean;\n\n public static readonly defaults = new Contour({});\n\n /** Returns true if `this` is logically equivalent to `other`. */\n public equals(other: Contour): boolean {\n return this.compare(other) === 0;\n }\n\n /** Performs ordered comparison between this and another contour. */\n public compare(other: Contour): number {\n return Contour.compare(this, other);\n }\n\n /** Performs ordered comparison of two contours.\n * @param lhs First contour to compare\n * @param rhs Second contour to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n */\n public static compare(lhs: Contour, rhs: Contour): number {\n return ContourStyle.compare(lhs.majorStyle, rhs.majorStyle)\n || ContourStyle.compare(lhs.minorStyle, rhs.minorStyle)\n || compareNumbers(lhs.minorInterval, rhs.minorInterval)\n || compareNumbers(lhs.majorIntervalCount, rhs.majorIntervalCount)\n || compareBooleans(lhs.showGeometry, rhs.showGeometry);\n }\n\n private constructor(props?: Partial<ContourProperties>) {\n this.majorStyle = props?.majorStyle ?? ContourStyle.fromJSON({ pixelWidth: 2 });\n this.minorStyle = props?.minorStyle ?? ContourStyle.fromJSON();\n this.minorInterval = props?.minorInterval ?? 1;\n this.majorIntervalCount = props?.majorIntervalCount ?? 5;\n this.showGeometry = props?.showGeometry ?? true;\n }\n\n public static fromJSON(props?: ContourProps) {\n if (!props)\n return new Contour();\n\n return new this({\n majorStyle: props?.majorStyle ? ContourStyle.fromJSON(props.majorStyle) : undefined,\n minorStyle: props?.minorStyle ? ContourStyle.fromJSON(props.minorStyle) : undefined,\n minorInterval: props?.minorInterval,\n majorIntervalCount: props?.majorIntervalCount,\n showGeometry: props?.showGeometry,\n });\n }\n\n public toJSON(): ContourProps {\n const props: ContourProps = {};\n\n if (!this.majorStyle.equals(ContourStyle.fromJSON({ pixelWidth: 2 })))\n props.majorStyle = this.majorStyle.toJSON();\n\n if (!this.minorStyle.equals(ContourStyle.fromJSON()))\n props.minorStyle = this.minorStyle.toJSON();\n\n if (1 !== this.minorInterval)\n props.minorInterval = this.minorInterval;\n\n if (5 !== this.majorIntervalCount)\n props.majorIntervalCount = this.majorIntervalCount;\n\n if (true !== this.showGeometry)\n props.showGeometry = this.showGeometry;\n\n return props;\n }\n\n /** Create a new Contour. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourProperties>): Contour {\n return props ? new this(props) : new Contour();\n }\n\n /** Create a copy of this Contour, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourProperties>): Contour {\n if (!changedProps)\n return this;\n\n return Contour.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of a [[ContourGroup]].\n * @public\n */\nexport interface ContourGroupProps {\n /** See [[ContourGroup.contourDef]]. */\n contourDef?: ContourProps;\n /** See [[ContourGroup.subCategories]]. */\n subCategories?: CompressedId64Set;\n /** See [[ContourGroup.name]]. */\n name?: string;\n}\n\n/** A type containing all of the properties of [[ContourGroup]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourGroup.create]] and [[ContourGroup.clone]].\n * @public\n */\nexport type ContourGroupProperties = NonFunctionPropertiesOf<ContourGroup>;\n\n/** Defines a group of objects to which to apply [[Contour]] lines in a particular style.\n * The [[ContourDisplay]] settings can contain multiple groups.\n * Each group is described by a set of [SubCategory]($backend)'s; all geometry belonging to any of those subcategories belongs to the group.\n * An empty set of subcategories indicates that this is a default group, implicitly containing all subcategories that are not explicitly included in another group.\n * Each group has an optional, non-user-facing name that applications can use to assign semantics to particular groups.\n * @public\n */\nexport class ContourGroup {\n private _subCategories: CompressedId64Set;\n\n /** Describes the appearance of all of the contours applied to geometry belonging to this group. */\n public readonly contourDef: Contour;\n /** An optional, non-user-facing name that applications can use to assign semantics to particular groups.\n * Default: an empty string.\n */\n public readonly name: string;\n\n /** The set of subcategories belonging to this group, or an empty set if this is a default group. If more than one empty set exists in the [[ContourDisplay]] object's `groups` array, the last entry in that array is used for rendering the default styling.\n * @see [[isDefaultGroup]] to test if this is a default group.\n */\n public get subCategories(): OrderedId64Iterable {\n return CompressedId64Set.iterable(this._subCategories);\n }\n\n /** Returns true if [[subCategories]] is an empty set, indicating that any subcategory not included in any other [[ContourGroup]] is implicitly\n * included in this group.\n */\n public get isDefaultGroup(): boolean {\n return OrderedId64Iterable.isEmptySet(this._subCategories);\n }\n\n /** Returns true if `this` and `other` contain the exact same set of subcategories. */\n public subCategoriesEqual(other: ContourGroup): boolean {\n return this._subCategories === other._subCategories;\n }\n\n /** Perform ordered comparison between this and another contour group. */\n public compare(other: ContourGroup): number {\n return compareStrings(this.name, other.name) || compareStrings(this._subCategories, other._subCategories) || this.contourDef.compare(other.contourDef);\n }\n\n /** Returns true if `this` and `other` are logically equivalent, having the same styling, name, and set of subcategories. */\n public equals(other: ContourGroup | undefined): boolean {\n return undefined !== other && this.compare(other) === 0;\n }\n\n private constructor(props?: Partial<ContourGroupProperties>) {\n this.contourDef = props?.contourDef ?? Contour.fromJSON();\n this._subCategories = props?.subCategories ? CompressedId64Set.sortAndCompress(props.subCategories) : \"\";\n this.name = props?.name ?? \"\";\n }\n\n public static fromJSON(props?: ContourGroupProps) {\n if (!props)\n return new ContourGroup();\n\n return new this({\n contourDef: props?.contourDef ? Contour.fromJSON(props.contourDef) : undefined,\n name: props?.name,\n subCategories: props?.subCategories ? CompressedId64Set.iterable(props.subCategories) : undefined,\n });\n }\n\n public toJSON(): ContourGroupProps {\n const props: ContourGroupProps = {};\n\n if (!this.contourDef.equals(Contour.defaults))\n props.contourDef = this.contourDef.toJSON();\n\n if (this.name)\n props.name = this.name;\n\n props.subCategories = this._subCategories;\n return props;\n }\n\n /** Create a new ContourGroup. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourGroupProperties>): ContourGroup {\n return props ? new this(props) : new ContourGroup();\n }\n\n /** Create a copy of this ContourGroup, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourGroupProperties>): ContourGroup {\n if (!changedProps)\n return this;\n\n return ContourGroup.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of [[ContourDisplay]] settings.\n * @public\n */\nexport interface ContourDisplayProps {\n /** See [[ContourDisplay.groups]]. */\n groups?: ContourGroupProps[];\n /** See [[ContourDisplay.displayContours]]. */\n displayContours?: boolean;\n}\n\n/** A type containing all of the properties of [[ContourDisplay]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourDisplay.create]] and [[ContourDisplay.clone]].\n * @public\n */\nexport type ContourDisplayProperties = NonFunctionPropertiesOf<ContourDisplay>;\n\n/** Settings that specify how to apply [contour lines]($docs/learning/display/ContourDisplay.md) to groups of geometry\n * within a 3d scene.\n * @see [[DisplayStyle3dSettings.contours]] to associate contour settings with a display style.\n * @public\n */\nexport class ContourDisplay {\n /** A list of the groups, each describing their own specific contour display settings. Defaults to an empty array.\n * @note The display system supports no more than [[ContourDisplay.maxContourGroups]]. Entries in this array exceeding that maximum will\n * have no effect on the display of contour lines.\n */\n public readonly groups: ContourGroup[];\n /** Whether to display the contour lines described by these settings. Default: false.\n * @see [[withDisplayContours]] to change this flag.\n */\n public readonly displayContours: boolean;\n /** The maximum number of contour groups that the system will allow. Any contour groups added to the [[groups]] array beyond this number will be ignored\n * for display purposes.\n */\n public static readonly maxContourGroups = 5;\n\n /** Perform ordered comparison between this and another `ContourDisplay`. */\n public compare(other: ContourDisplay): number {\n return compareBooleans(this.displayContours, other.displayContours) || compareArrays(this.groups, other.groups, (lhs, rhs) => lhs.compare(rhs));\n }\n\n /** Returns true if `this` and `other` are logically equivalent, having the same groups and styling. */\n public equals(other: ContourDisplay): boolean {\n if (this.displayContours !== other.displayContours)\n return false;\n if (this.groups.length !== other.groups.length)\n return false;\n for (let index = 0, len = this.groups.length; index < len && index < ContourDisplay.maxContourGroups; ++index) {\n const match = this.groups[index].equals(other.groups[index]);\n if (!match)\n return false;\n }\n return true;\n }\n\n private constructor(props?: Partial<ContourDisplayProperties>) {\n this.displayContours = props?.displayContours ?? false;\n this.groups = props?.groups ?? [];\n }\n\n public static fromJSON(props?: ContourDisplayProps) {\n if (!props)\n return new ContourDisplay();\n\n const groups: ContourGroup[] = [];\n if (undefined !== props && undefined !== props.groups) {\n for (let n = 0; n < props.groups.length; n++) {\n groups[n] = ContourGroup.fromJSON(props.groups[n]);\n }\n }\n\n return new this({\n displayContours: props?.displayContours,\n groups: props.groups ? groups : undefined,\n });\n }\n\n public toJSON(): ContourDisplayProps {\n const props: ContourDisplayProps = {};\n\n props.groups = [];\n for (let n = 0; n < this.groups.length; n++) {\n props.groups[n] = this.groups[n].toJSON();\n }\n\n props.displayContours = this.displayContours;\n return props;\n }\n\n /** Create a new ContourDisplay. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourDisplayProperties>): ContourDisplay {\n return props ? new this(props) : new ContourDisplay();\n }\n\n /** Create a copy of these settings, changing the `displayContours` flag as specified. */\n public withDisplayContours(displayContours: boolean): ContourDisplay {\n return displayContours === this.displayContours ? this : ContourDisplay.create({ ...this, displayContours });\n }\n\n /** Create a copy of this ContourDisplay, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourDisplayProperties>): ContourDisplay {\n if (!changedProps)\n return this;\n\n return ContourDisplay.create({ ...this, ...changedProps });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContourDisplay.js","sourceRoot":"","sources":["../../src/ContourDisplay.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsK;AACtK,6CAA0C;AAC1C,yCAAq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---------------------------------------------------------------------------------------------\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 Symbology\r\n */\r\n\r\nimport { compareArrays, compareBooleans, compareNumbers, compareStrings, CompressedId64Set, NonFunctionPropertiesOf, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { LinePixels } from \"./LinePixels\";\r\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\r\n\r\n/** JSON representation of a [[ContourStyle]].\r\n * @public\r\n */\r\nexport interface ContourStyleProps {\r\n /** See [[ContourStyle.color]]. */\r\n color?: RgbColorProps;\r\n /** See [[ContourStyle.pixelWidth]]. */\r\n pixelWidth?: number;\r\n /** See [[ContourStyle.pattern]]. */\r\n pattern?: LinePixels;\r\n}\r\n\r\n/** A type containing all of the properties of [[ContourStyle]] with none of the methods and with the `readonly` modifiers removed.\r\n * Used by [[ContourStyle.create]] and [[ContourStyle.clone]].\r\n * @public\r\n */\r\nexport type ContourStyleProperties = NonFunctionPropertiesOf<ContourStyle>;\r\n\r\n/** The style settings used by either a minor or major contour.\r\n * @see [[Contour.majorStyle]]\r\n * @see [[Contour.minorStyle]]\r\n * @public\r\n */\r\nexport class ContourStyle {\r\n /** The color in which to draw the contour lines. Default: black. */\r\n public readonly color: RgbColor;\r\n /** The width in screen pixels of the contour lines.\r\n * Useful values range between 1 and 8.5, in increments of 0.5. Other values will be rounded to meet these criteria.\r\n * Default: 1.0.\r\n */\r\n public readonly pixelWidth: number;\r\n /** The pattern for a major or minor contour line. Defaults to [[LinePixels.Solid]]. */\r\n public readonly pattern: LinePixels;\r\n\r\n /** Returns true if `this` and `other` are logically equivalent. */\r\n public equals(other: ContourStyle): boolean {\r\n if (!this.color.equals(other.color) || this.pixelWidth !== other.pixelWidth || this.pattern !== other.pattern) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Perform ordered comparison between this and another contour style. */\r\n public compare(other: ContourStyle): number {\r\n return ContourStyle.compare(this, other);\r\n }\r\n\r\n /** Performs ordered comparison of two contour styles.\r\n * @param lhs First contour style to compare\r\n * @param rhs Second contour style to compare\r\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\r\n * @public\r\n */\r\n public static compare(lhs: ContourStyle, rhs: ContourStyle): number {\r\n let diff = 0;\r\n if ((diff = lhs.color.compareTo(rhs.color)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.pixelWidth, rhs.pixelWidth)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.pattern, rhs.pattern)) !== 0)\r\n return diff;\r\n\r\n return diff;\r\n }\r\n\r\n private constructor(props?: Partial<ContourStyleProperties>) {\r\n this.color = props?.color ?? RgbColor.fromJSON({r: 0, g: 0, b: 0});\r\n this.pixelWidth = props?.pixelWidth ?? 1;\r\n this.pattern = props?.pattern ?? LinePixels.Solid;\r\n }\r\n\r\n public static fromJSON(props?: ContourStyleProps) {\r\n if (!props)\r\n return new ContourStyle();\r\n\r\n return new this({\r\n color: props?.color ? RgbColor.fromJSON(props.color) : undefined,\r\n pixelWidth: props?.pixelWidth,\r\n pattern: props?.pattern,\r\n });\r\n }\r\n\r\n public toJSON(): ContourStyleProps {\r\n const props: ContourStyleProps = {};\r\n\r\n if (!this.color.equals(RgbColor.fromJSON({r: 0, g: 0, b: 0})))\r\n props.color = this.color.toJSON();\r\n\r\n if (1 !== this.pixelWidth)\r\n props.pixelWidth = this.pixelWidth;\r\n\r\n if (0 !== this.pattern)\r\n props.pattern = this.pattern;\r\n\r\n return props;\r\n }\r\n\r\n /** Create a new ContourStyle. Any properties not specified by `props` will be initialized to their default values. */\r\n public static create(props?: Partial<ContourStyleProperties>): ContourStyle {\r\n return props ? new this(props) : new ContourStyle();\r\n }\r\n\r\n /** Create a copy of this ContourStyle, identical except for any properties specified by `changedProps`.\r\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\r\n */\r\n public clone(changedProps?: Partial<ContourStyleProperties>): ContourStyle {\r\n if (!changedProps)\r\n return this;\r\n\r\n return ContourStyle.create({ ...this, ...changedProps });\r\n }\r\n}\r\n\r\n/** JSON representation of a [[Contour]].\r\n * @public\r\n */\r\nexport interface ContourProps {\r\n /** See [[Contour.majorStyle]]. */\r\n majorStyle?: ContourStyleProps;\r\n /** See [[Contour.minor]]. */\r\n minorStyle?: ContourStyleProps;\r\n /** See [[Contour.minorInterval]]. */\r\n minorInterval?: number;\r\n /** See [[Contour.majorIntervalCount]]. */\r\n majorIntervalCount?: number;\r\n /** See [[Contour.showGeometry]] */\r\n showGeometry?: boolean;\r\n}\r\n\r\n/** A type containing all of the properties of [[Contour]] with none of the methods and with the `readonly` modifiers removed.\r\n * Used by [[Contour.create]] and [[Contour.clone]].\r\n * @public\r\n */\r\nexport type ContourProperties = NonFunctionPropertiesOf<Contour>;\r\n\r\n/** Describes how to generate and style contour lines for geometry within a single [[ContourGroup]].\r\n * Contours provide a way to visualize elevation within a 3d scene by drawing lines at fixed intervals along the z-axis.\r\n * There are actually 2 kinds of contour lines: major and minor. Each kind can be styled independently.\r\n * A contour line is generated every [[minorInterval]] meters. Every `nth` line will be a *major* contour, where `n` = [[majorIntervalCount]]; the intervening lines will\r\n * all be *minor* contours.\r\n * For example, with a [[majorIntervalCount]] of `1`, every contour will be major; of `2`, every other contour will be major; and of `3`, there will be two minor contours in between\r\n * each major contour.\r\n *\r\n * @public\r\n */\r\nexport class Contour {\r\n /** Settings that describe how a major contour is styled. Defaults to an instantation of [[ContourStyle]] using `pixelWidth` of 2 and default values for the other properties. */\r\n public readonly majorStyle: ContourStyle;\r\n /** Settings that describe how a minor contour is styled. Defaults to an instantation of [[ContourStyle]] using default values for the properties. */\r\n public readonly minorStyle: ContourStyle;\r\n /** The interval for the minor contour occurrence in meters; these can be specified as fractional. Defaults to 1. If a value <= 0 is specified, this will be treated as 1 meter. */\r\n public readonly minorInterval: number;\r\n /** The count of minor contour intervals that define a major interval (integer > 0). A value of 1 means no minor contours will be shown, only major contours. Defaults to 5. If a value < 1 is specified, this will be treated as 1. If a non-integer value is specified, it will be treated as if it were rounded to the nearest integer. */\r\n public readonly majorIntervalCount: number;\r\n /** If true, show underlying geometry along with the associated contours. If false, only show the contours, not the underlying geometry. Defaults to true. */\r\n public readonly showGeometry: boolean;\r\n\r\n public static readonly defaults = new Contour({});\r\n\r\n /** Returns true if `this` is logically equivalent to `other`. */\r\n public equals(other: Contour): boolean {\r\n return this.compare(other) === 0;\r\n }\r\n\r\n /** Performs ordered comparison between this and another contour. */\r\n public compare(other: Contour): number {\r\n return Contour.compare(this, other);\r\n }\r\n\r\n /** Performs ordered comparison of two contours.\r\n * @param lhs First contour to compare\r\n * @param rhs Second contour to compare\r\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\r\n */\r\n public static compare(lhs: Contour, rhs: Contour): number {\r\n return ContourStyle.compare(lhs.majorStyle, rhs.majorStyle)\r\n || ContourStyle.compare(lhs.minorStyle, rhs.minorStyle)\r\n || compareNumbers(lhs.minorInterval, rhs.minorInterval)\r\n || compareNumbers(lhs.majorIntervalCount, rhs.majorIntervalCount)\r\n || compareBooleans(lhs.showGeometry, rhs.showGeometry);\r\n }\r\n\r\n private constructor(props?: Partial<ContourProperties>) {\r\n this.majorStyle = props?.majorStyle ?? ContourStyle.fromJSON({ pixelWidth: 2 });\r\n this.minorStyle = props?.minorStyle ?? ContourStyle.fromJSON();\r\n this.minorInterval = props?.minorInterval ?? 1;\r\n this.majorIntervalCount = props?.majorIntervalCount ?? 5;\r\n this.showGeometry = props?.showGeometry ?? true;\r\n }\r\n\r\n public static fromJSON(props?: ContourProps) {\r\n if (!props)\r\n return new Contour();\r\n\r\n return new this({\r\n majorStyle: props?.majorStyle ? ContourStyle.fromJSON(props.majorStyle) : undefined,\r\n minorStyle: props?.minorStyle ? ContourStyle.fromJSON(props.minorStyle) : undefined,\r\n minorInterval: props?.minorInterval,\r\n majorIntervalCount: props?.majorIntervalCount,\r\n showGeometry: props?.showGeometry,\r\n });\r\n }\r\n\r\n public toJSON(): ContourProps {\r\n const props: ContourProps = {};\r\n\r\n if (!this.majorStyle.equals(ContourStyle.fromJSON({ pixelWidth: 2 })))\r\n props.majorStyle = this.majorStyle.toJSON();\r\n\r\n if (!this.minorStyle.equals(ContourStyle.fromJSON()))\r\n props.minorStyle = this.minorStyle.toJSON();\r\n\r\n if (1 !== this.minorInterval)\r\n props.minorInterval = this.minorInterval;\r\n\r\n if (5 !== this.majorIntervalCount)\r\n props.majorIntervalCount = this.majorIntervalCount;\r\n\r\n if (true !== this.showGeometry)\r\n props.showGeometry = this.showGeometry;\r\n\r\n return props;\r\n }\r\n\r\n /** Create a new Contour. Any properties not specified by `props` will be initialized to their default values. */\r\n public static create(props?: Partial<ContourProperties>): Contour {\r\n return props ? new this(props) : new Contour();\r\n }\r\n\r\n /** Create a copy of this Contour, identical except for any properties specified by `changedProps`.\r\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\r\n */\r\n public clone(changedProps?: Partial<ContourProperties>): Contour {\r\n if (!changedProps)\r\n return this;\r\n\r\n return Contour.create({ ...this, ...changedProps });\r\n }\r\n}\r\n\r\n/** JSON representation of a [[ContourGroup]].\r\n * @public\r\n */\r\nexport interface ContourGroupProps {\r\n /** See [[ContourGroup.contourDef]]. */\r\n contourDef?: ContourProps;\r\n /** See [[ContourGroup.subCategories]]. */\r\n subCategories?: CompressedId64Set;\r\n /** See [[ContourGroup.name]]. */\r\n name?: string;\r\n}\r\n\r\n/** A type containing all of the properties of [[ContourGroup]] with none of the methods and with the `readonly` modifiers removed.\r\n * Used by [[ContourGroup.create]] and [[ContourGroup.clone]].\r\n * @public\r\n */\r\nexport type ContourGroupProperties = NonFunctionPropertiesOf<ContourGroup>;\r\n\r\n/** Defines a group of objects to which to apply [[Contour]] lines in a particular style.\r\n * The [[ContourDisplay]] settings can contain multiple groups.\r\n * Each group is described by a set of [SubCategory]($backend)'s; all geometry belonging to any of those subcategories belongs to the group.\r\n * An empty set of subcategories indicates that this is a default group, implicitly containing all subcategories that are not explicitly included in another group.\r\n * Each group has an optional, non-user-facing name that applications can use to assign semantics to particular groups.\r\n * @public\r\n */\r\nexport class ContourGroup {\r\n private _subCategories: CompressedId64Set;\r\n\r\n /** Describes the appearance of all of the contours applied to geometry belonging to this group. */\r\n public readonly contourDef: Contour;\r\n /** An optional, non-user-facing name that applications can use to assign semantics to particular groups.\r\n * Default: an empty string.\r\n */\r\n public readonly name: string;\r\n\r\n /** The set of subcategories belonging to this group, or an empty set if this is a default group. If more than one empty set exists in the [[ContourDisplay]] object's `groups` array, the last entry in that array is used for rendering the default styling.\r\n * @see [[isDefaultGroup]] to test if this is a default group.\r\n */\r\n public get subCategories(): OrderedId64Iterable {\r\n return CompressedId64Set.iterable(this._subCategories);\r\n }\r\n\r\n /** Returns true if [[subCategories]] is an empty set, indicating that any subcategory not included in any other [[ContourGroup]] is implicitly\r\n * included in this group.\r\n */\r\n public get isDefaultGroup(): boolean {\r\n return OrderedId64Iterable.isEmptySet(this._subCategories);\r\n }\r\n\r\n /** Returns true if `this` and `other` contain the exact same set of subcategories. */\r\n public subCategoriesEqual(other: ContourGroup): boolean {\r\n return this._subCategories === other._subCategories;\r\n }\r\n\r\n /** Perform ordered comparison between this and another contour group. */\r\n public compare(other: ContourGroup): number {\r\n return compareStrings(this.name, other.name) || compareStrings(this._subCategories, other._subCategories) || this.contourDef.compare(other.contourDef);\r\n }\r\n\r\n /** Returns true if `this` and `other` are logically equivalent, having the same styling, name, and set of subcategories. */\r\n public equals(other: ContourGroup | undefined): boolean {\r\n return undefined !== other && this.compare(other) === 0;\r\n }\r\n\r\n private constructor(props?: Partial<ContourGroupProperties>) {\r\n this.contourDef = props?.contourDef ?? Contour.fromJSON();\r\n this._subCategories = props?.subCategories ? CompressedId64Set.sortAndCompress(props.subCategories) : \"\";\r\n this.name = props?.name ?? \"\";\r\n }\r\n\r\n public static fromJSON(props?: ContourGroupProps) {\r\n if (!props)\r\n return new ContourGroup();\r\n\r\n return new this({\r\n contourDef: props?.contourDef ? Contour.fromJSON(props.contourDef) : undefined,\r\n name: props?.name,\r\n subCategories: props?.subCategories ? CompressedId64Set.iterable(props.subCategories) : undefined,\r\n });\r\n }\r\n\r\n public toJSON(): ContourGroupProps {\r\n const props: ContourGroupProps = {};\r\n\r\n if (!this.contourDef.equals(Contour.defaults))\r\n props.contourDef = this.contourDef.toJSON();\r\n\r\n if (this.name)\r\n props.name = this.name;\r\n\r\n props.subCategories = this._subCategories;\r\n return props;\r\n }\r\n\r\n /** Create a new ContourGroup. Any properties not specified by `props` will be initialized to their default values. */\r\n public static create(props?: Partial<ContourGroupProperties>): ContourGroup {\r\n return props ? new this(props) : new ContourGroup();\r\n }\r\n\r\n /** Create a copy of this ContourGroup, identical except for any properties specified by `changedProps`.\r\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\r\n */\r\n public clone(changedProps?: Partial<ContourGroupProperties>): ContourGroup {\r\n if (!changedProps)\r\n return this;\r\n\r\n return ContourGroup.create({ ...this, ...changedProps });\r\n }\r\n}\r\n\r\n/** JSON representation of [[ContourDisplay]] settings.\r\n * @public\r\n */\r\nexport interface ContourDisplayProps {\r\n /** See [[ContourDisplay.groups]]. */\r\n groups?: ContourGroupProps[];\r\n /** See [[ContourDisplay.displayContours]]. */\r\n displayContours?: boolean;\r\n}\r\n\r\n/** A type containing all of the properties of [[ContourDisplay]] with none of the methods and with the `readonly` modifiers removed.\r\n * Used by [[ContourDisplay.create]] and [[ContourDisplay.clone]].\r\n * @public\r\n */\r\nexport type ContourDisplayProperties = NonFunctionPropertiesOf<ContourDisplay>;\r\n\r\n/** Settings that specify how to apply [contour lines]($docs/learning/display/ContourDisplay.md) to groups of geometry\r\n * within a 3d scene.\r\n * @see [[DisplayStyle3dSettings.contours]] to associate contour settings with a display style.\r\n * @public\r\n */\r\nexport class ContourDisplay {\r\n /** A list of the groups, each describing their own specific contour display settings. Defaults to an empty array.\r\n * @note The display system supports no more than [[ContourDisplay.maxContourGroups]]. Entries in this array exceeding that maximum will\r\n * have no effect on the display of contour lines.\r\n */\r\n public readonly groups: ContourGroup[];\r\n /** Whether to display the contour lines described by these settings. Default: false.\r\n * @see [[withDisplayContours]] to change this flag.\r\n */\r\n public readonly displayContours: boolean;\r\n /** The maximum number of contour groups that the system will allow. Any contour groups added to the [[groups]] array beyond this number will be ignored\r\n * for display purposes.\r\n */\r\n public static readonly maxContourGroups = 5;\r\n\r\n /** Perform ordered comparison between this and another `ContourDisplay`. */\r\n public compare(other: ContourDisplay): number {\r\n return compareBooleans(this.displayContours, other.displayContours) || compareArrays(this.groups, other.groups, (lhs, rhs) => lhs.compare(rhs));\r\n }\r\n\r\n /** Returns true if `this` and `other` are logically equivalent, having the same groups and styling. */\r\n public equals(other: ContourDisplay): boolean {\r\n if (this.displayContours !== other.displayContours)\r\n return false;\r\n if (this.groups.length !== other.groups.length)\r\n return false;\r\n for (let index = 0, len = this.groups.length; index < len && index < ContourDisplay.maxContourGroups; ++index) {\r\n const match = this.groups[index].equals(other.groups[index]);\r\n if (!match)\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n private constructor(props?: Partial<ContourDisplayProperties>) {\r\n this.displayContours = props?.displayContours ?? false;\r\n this.groups = props?.groups ?? [];\r\n }\r\n\r\n public static fromJSON(props?: ContourDisplayProps) {\r\n if (!props)\r\n return new ContourDisplay();\r\n\r\n const groups: ContourGroup[] = [];\r\n if (undefined !== props && undefined !== props.groups) {\r\n for (let n = 0; n < props.groups.length; n++) {\r\n groups[n] = ContourGroup.fromJSON(props.groups[n]);\r\n }\r\n }\r\n\r\n return new this({\r\n displayContours: props?.displayContours,\r\n groups: props.groups ? groups : undefined,\r\n });\r\n }\r\n\r\n public toJSON(): ContourDisplayProps {\r\n const props: ContourDisplayProps = {};\r\n\r\n props.groups = [];\r\n for (let n = 0; n < this.groups.length; n++) {\r\n props.groups[n] = this.groups[n].toJSON();\r\n }\r\n\r\n props.displayContours = this.displayContours;\r\n return props;\r\n }\r\n\r\n /** Create a new ContourDisplay. Any properties not specified by `props` will be initialized to their default values. */\r\n public static create(props?: Partial<ContourDisplayProperties>): ContourDisplay {\r\n return props ? new this(props) : new ContourDisplay();\r\n }\r\n\r\n /** Create a copy of these settings, changing the `displayContours` flag as specified. */\r\n public withDisplayContours(displayContours: boolean): ContourDisplay {\r\n return displayContours === this.displayContours ? this : ContourDisplay.create({ ...this, displayContours });\r\n }\r\n\r\n /** Create a copy of this ContourDisplay, identical except for any properties specified by `changedProps`.\r\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\r\n */\r\n public clone(changedProps?: Partial<ContourDisplayProperties>): ContourDisplay {\r\n if (!changedProps)\r\n return this;\r\n\r\n return ContourDisplay.create({ ...this, ...changedProps });\r\n }\r\n}\r\n"]}
|