@itwin/core-common 5.0.0-dev.56 → 5.0.0-dev.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/AmbientOcclusion.js +17 -9
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js +20 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js +30 -10
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js +4 -0
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js +19 -0
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/BlobReader.js +8 -6
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/Camera.js +3 -0
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/ClipStyle.js +29 -3
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js +16 -0
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorDef.js +6 -5
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +5 -3
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js +53 -27
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js +37 -2
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +95 -63
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSqlReader.js +52 -49
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ElementProps.js +5 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EntityProps.js +31 -0
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/Environment.js +24 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js +15 -6
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js +82 -49
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js +5 -0
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js +2 -2
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GeometryParams.js +58 -0
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/Gradient.js +12 -9
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js +14 -12
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js +7 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js +6 -0
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js +6 -0
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js +23 -3
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js +10 -0
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js +44 -20
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js +2 -0
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js +4 -0
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/Image.js +10 -0
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/LightSettings.js +39 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js +3 -2
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js +33 -0
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js +6 -0
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js +4 -0
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js +8 -0
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js +23 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js +32 -24
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js +79 -2
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js +34 -17
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderSchedule.d.ts +1 -2
- package/lib/cjs/RenderSchedule.d.ts.map +1 -1
- package/lib/cjs/RenderSchedule.js +138 -11
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/RenderTexture.js +14 -0
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js +3 -0
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.d.ts.map +1 -1
- package/lib/cjs/RpcInterface.js +6 -0
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/SkyBox.js +15 -2
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarShadows.js +5 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js +19 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js +35 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js +15 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js +19 -0
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js +24 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js +53 -2
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Tween.js +28 -19
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/ViewDetails.js +9 -5
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js +84 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js +7 -2
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +10 -0
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +27 -6
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +49 -3
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js +12 -0
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js +17 -0
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js +4 -0
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js +23 -20
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js +62 -0
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +26 -8
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js +54 -108
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js +1 -0
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js +100 -0
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js +16 -0
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js +19 -6
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js +10 -0
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js +14 -0
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js +6 -0
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js +75 -0
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js +18 -0
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js +10 -0
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js +10 -7
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js +1 -0
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +7 -6
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +8 -7
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js +2 -2
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +4 -7
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +2 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +2 -2
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js +1 -4
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +25 -36
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +28 -30
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +17 -9
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js +28 -30
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js +17 -16
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js +30 -28
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js +13 -6
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js +10 -9
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +45 -23
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js +4 -2
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js +5 -10
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +7 -13
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +16 -19
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js +2 -0
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js +2 -2
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js +6 -6
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +12 -10
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +14 -0
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js +7 -0
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js +3 -0
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js +4 -3
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js +8 -0
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js +24 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js +5 -0
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js +2 -0
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +9 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js +17 -9
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js +20 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js +30 -10
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js +4 -0
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js +19 -0
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/BlobReader.js +8 -6
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/Camera.js +3 -0
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/ClipStyle.js +29 -3
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js +16 -0
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorDef.js +6 -5
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js +5 -3
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js +53 -27
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js +37 -2
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +95 -63
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSqlReader.js +52 -49
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ElementProps.js +5 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.js +31 -0
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Environment.js +24 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js +15 -6
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js +82 -49
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js +5 -0
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js +2 -2
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GeometryParams.js +58 -0
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/Gradient.js +12 -9
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js +14 -12
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js +7 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js +6 -0
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js +6 -0
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js +23 -3
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js +10 -0
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js +44 -20
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js +2 -0
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js +4 -0
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/Image.js +10 -0
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/LightSettings.js +39 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/MapImagerySettings.js +3 -2
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js +33 -0
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/ModelClipGroup.js +6 -0
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js +4 -0
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js +8 -0
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js +23 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js +32 -24
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js +79 -2
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js +34 -17
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderSchedule.d.ts +1 -2
- package/lib/esm/RenderSchedule.d.ts.map +1 -1
- package/lib/esm/RenderSchedule.js +138 -11
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/RenderTexture.js +14 -0
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js +3 -0
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.d.ts.map +1 -1
- package/lib/esm/RpcInterface.js +6 -0
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/SkyBox.js +15 -2
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarShadows.js +5 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js +19 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js +35 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js +15 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js +19 -0
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js +24 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ThematicDisplay.js +53 -2
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Tween.js +28 -19
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/ViewDetails.js +9 -5
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js +84 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js +7 -2
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +10 -0
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js +27 -6
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js +49 -3
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js +12 -0
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js +17 -0
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js +4 -0
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js +23 -20
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js +62 -0
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +26 -8
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js +54 -108
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js +1 -0
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js +100 -0
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js +16 -0
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js +19 -6
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js +10 -0
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js +14 -0
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js +6 -0
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js +75 -0
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js +18 -0
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js +10 -0
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js +10 -7
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js +1 -0
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +7 -6
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +8 -7
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js +2 -2
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +4 -7
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +2 -2
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +2 -2
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js +1 -4
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +25 -36
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +28 -30
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +17 -9
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js +28 -30
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js +17 -16
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js +30 -28
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js +13 -6
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js +10 -9
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +45 -23
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js +4 -2
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js +5 -10
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js +7 -13
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +16 -19
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js +2 -0
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js +2 -2
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js +6 -6
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +12 -10
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +14 -0
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js +7 -0
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js +3 -0
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js +4 -3
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js +8 -0
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js +24 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js +5 -0
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js +2 -0
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js +9 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Atmosphere.js","sourceRoot":"","sources":["../../src/Atmosphere.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;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EM,MAAM,CAAC,QAAQ,CAAC,IAAY;YACjC,IAAI,SAAS,KAAK,IAAI;gBACpB,OAAO,IAAI,CAAC,QAAQ,CAAC;YACvB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAEM,MAAM,CAAC,OAAiB;YAC7B,MAAM,IAAI,GAAU;gBAClB,0BAA0B,EAAE,IAAI,CAAC,0BAA0B;gBAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,4BAA4B,EAAE,IAAI,CAAC,4BAA4B;gBAC/D,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;gBAC3C,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;aACvC,CAAC;YAEF,IAAI,SAAS,KAAK,OAAO;gBACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YAEzB,OAAO,IAAI,CAAC;QACd,CAAC;;IArFU,mBAAQ,WAsFpB,CAAA;AACH,CAAC,EAhKgB,UAAU,KAAV,UAAU,QAgK1B","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 */\nimport { JsonUtils } from \"@itwin/core-bentley\";\n\n/** Namespace containing types controlling how atmospheric scattering should be rendered.\n * @beta\n * The techniques used to render the atmosphere approximate the physical behavior of light when interacting with particles in the air (Rayleigh Scattering and Mie Scattering)\n * Presently, only Rayleigh Scattering is implemented here\n *\n * In a nutshell, this implementation samples atmospheric density along rays cast from the view and uses the samples to simulate the scattering of light toward the camera.\n * The amount of light scattered toward the camera is dependent on the amount of light scattered away from its original path from the sun, so rays must also be cast from the sample points to the sun.\n *\n * The effect can be computed on vertices (the default for the background map) and fragments (the default for the skybox, which is a ViewportQuad).\n * All coordinates are in view space.\n *\n * This implementation is adapted from equations outlined in \"Display of Clouds Taking into Account Multiple Anisotropic Scattering and Sky Light\", Nishita et al. 1993\n * which are further refined for use in GPU shaders in \"Photorealistic Real-Time Outdoor Light Scattering\", Hoffman and Preetham 2002.\n * These sources are also compiled in Chapter 16 of NVIDIA's \"GPU Gems 2\", which can be found online here:\n * https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\n *\n * This implementation is also highly inspired by Sebastian Lague's Solar System project: https://github.com/SebLague/Solar-System/ and video: https://www.youtube.com/watch?v=DxfEbulyFcY\n * along with this ShaderToy replica: https://www.shadertoy.com/view/fltXD2.\n * Both of which are inspired by this Nvidia article on atmospheric scattering: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering.\n */\nexport namespace Atmosphere {\n\n /** @internal JSON representation of a [[Wavelengths]] object */\n export interface WavelengthsProps {\n r: number;\n g: number;\n b: number;\n }\n\n /** @internal An immutable container of wavelength values for the red, green and blue pixel components. Values are in nanometers. */\n export class Wavelengths {\n public readonly r: number;\n public readonly g: number;\n public readonly b: number;\n\n /** Constructs from red, green, and blue wavelength values.\n * @param r Wavelength value for red\n * @param g Wavelength value for green\n * @param b Wavelength value for blue\n */\n constructor(props: WavelengthsProps) {\n this.r = Math.max(0, props.r);\n this.g = Math.max(0, props.g);\n this.b = Math.max(0, props.b);\n }\n\n public equals(other: Wavelengths): boolean {\n return this.r === other.r && this.g === other.g && this.b === other.b;\n }\n\n public toJSON(): WavelengthsProps {\n return { r: this.r, g: this.g, b: this.b };\n }\n\n public static fromJSON(json: WavelengthsProps | undefined): Wavelengths {\n let r = 0;\n let g = 0;\n let b = 0;\n if (undefined !== json) {\n if (typeof json.r === \"number\")\n r = json.r;\n if (typeof json.g === \"number\")\n g = json.g;\n if (typeof json.b === \"number\")\n b = json.b;\n }\n return new Wavelengths({ r, g, b });\n }\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export interface Props {\n /** Whether the ground plane should be displayed. Defaults to false. */\n display?: boolean;\n /** @internal See [[Settings.atmosphereHeightAboveEarth]] */\n atmosphereHeightAboveEarth?: number;\n /** See [[Settings.exposure]] */\n exposure?: number;\n /** @internal See [[Settings.densityFalloff]] */\n densityFalloff?: number;\n /** @internal See [[Settings.minDensityHeightBelowEarth]] */\n depthBelowEarthForMaxDensity?: number;\n /** See [[Settings.numViewRaySamples]] */\n numViewRaySamples?: number;\n /** See [[Settings.numSunRaySamples]] */\n numSunRaySamples?: number;\n /** @internal See [[Settings.scatteringStrength]] */\n scatteringStrength?: number;\n /** @internal See [[Settings.wavelengths]] */\n wavelengths?: WavelengthsProps;\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export class Settings {\n private static _defaultAtmosphereHeightAboveEarth: number = 100000.0;\n private static _defaultExposure: number = 2.0;\n private static _defaultDensityFalloff: number = 10.0;\n private static _defaultMinDensityHeightBelowEarth: 0.0;\n private static _defaultScatteringStrength: number = 100;\n private static _defaultWavelengths: Wavelengths = new Wavelengths({ r: 700.0, g: 530.0, b: 440.0 });\n\n private static _defaultNumViewRaySamples: number = 10;\n private static _highQualityNumViewRaySamples: number = 20;\n private static _defaultNumSunRaySamples: number = 5;\n\n public static readonly defaults = new Settings({});\n public static readonly highQuality = new Settings({ numViewRaySamples: this._highQualityNumViewRaySamples });\n\n /** @internal If defined, corresponds to the height in meters above the earth's pole at which the atmosphere terminates. Physically, this is the point at which there are no more air molecules to interfere with light transmission. Defaults to 100_000.0. */\n public readonly atmosphereHeightAboveEarth: number;\n /** If defined, this value is used to simulate the aperture of a camera. Higher values allow more light in. This value might need to be adjusted slightly in situations without much sunlight (like sunset) to brighten the image. Defaults to 2.0 */\n public readonly exposure: number;\n /** @internal If defined, controls the rate at which the air density decreases between the point it is the highest and the point is is the lowest. A higher value means a faster decrease in air density. Defaults to 10.0. */\n public readonly densityFalloff: number;\n /** @internal If defined, corresponds to the height in meters below the earth's pole at which the atmosphere is at its densest. Physically, this is the point at which there is the most air molecules to interfere with light transmission. Defaults to 0.0. */\n public readonly depthBelowEarthForMaxDensity: number;\n /** If defined, corresponds to the number of atmospheric density samples used to compute the amount of light scattered along each view ray. For each sample point, another ray will be cast toward the sun to compute the amount of light reaching the sample point. Higher values increase fidelity, but greatly decrease performance because sun rays must be cast from each additional sample point. The range is 1 to 40. Defaults to 10. */\n public readonly numViewRaySamples: number;\n /** If defined, corresponds to the number of atmospheric density samples uses to compute the amount of light scattered along each sun ray. Higher values increase fidelity slightly but greatly decrease performance. Minimal improvement is observable with values above 5. The range is 1 to 40. Defaults to 5. */\n public readonly numSunRaySamples: number;\n /** @internal If defined, controls how strongly the atmosphere's air diverts light. Higher values increase scattering intensity. Defaults to 100.0. */\n public readonly scatteringStrength: number;\n /** @internal If defined, corresponds the wavelengths of the red, green and blue color components in nanometers used to simulate how the atmosphere's air molecules affects light transmission. (See Rayleigh Scattering) Thus, a value of 470 for the red wavelength will make the red light component scatter as if it physically were a cyan light ray. The default value is {r:700.0, g:530.0, b:440.0}. */\n public readonly wavelengths: Wavelengths;\n\n public equals(other: Settings): boolean {\n if (this.atmosphereHeightAboveEarth !== other.atmosphereHeightAboveEarth)\n return false;\n if (this.exposure !== other.exposure)\n return false;\n if (this.densityFalloff !== other.densityFalloff)\n return false;\n if (this.depthBelowEarthForMaxDensity !== other.depthBelowEarthForMaxDensity)\n return false;\n if (this.numViewRaySamples !== other.numViewRaySamples)\n return false;\n if (this.numSunRaySamples !== other.numSunRaySamples)\n return false;\n if (this.scatteringStrength !== other.scatteringStrength)\n return false;\n if (!this.wavelengths.equals(other.wavelengths))\n return false;\n return true;\n }\n\n private constructor(json: Props) {\n this.atmosphereHeightAboveEarth = JsonUtils.asDouble(json.atmosphereHeightAboveEarth, Settings._defaultAtmosphereHeightAboveEarth);\n this.exposure = JsonUtils.asDouble(json.exposure, Settings._defaultExposure);\n this.densityFalloff = JsonUtils.asDouble(json.densityFalloff, Settings._defaultDensityFalloff);\n this.depthBelowEarthForMaxDensity = JsonUtils.asDouble(json.depthBelowEarthForMaxDensity, Settings._defaultMinDensityHeightBelowEarth);\n this.numViewRaySamples = JsonUtils.asDouble(json.numViewRaySamples, Settings._defaultNumViewRaySamples);\n this.numSunRaySamples = JsonUtils.asDouble(json.numSunRaySamples, Settings._defaultNumSunRaySamples);\n this.scatteringStrength = JsonUtils.asDouble(json.scatteringStrength, Settings._defaultScatteringStrength);\n this.wavelengths = Wavelengths.fromJSON(JsonUtils.asObject(json.wavelengths) ?? Settings._defaultWavelengths);\n }\n\n public static fromJSON(json?: Props) {\n if (undefined === json)\n return this.defaults;\n return new Settings(json);\n }\n\n public toJSON(display?: boolean): Props {\n const json: Props = {\n atmosphereHeightAboveEarth: this.atmosphereHeightAboveEarth,\n exposure: this.exposure,\n densityFalloff: this.densityFalloff,\n depthBelowEarthForMaxDensity: this.depthBelowEarthForMaxDensity,\n numViewRaySamples: this.numViewRaySamples,\n numSunRaySamples: this.numSunRaySamples,\n scatteringStrength: this.scatteringStrength,\n wavelengths: this.wavelengths.toJSON(),\n };\n\n if (undefined !== display)\n json.display = display;\n\n return json;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Atmosphere.js","sourceRoot":"","sources":["../../src/Atmosphere.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,KAAW,UAAU,CAgK1B;AAhKD,WAAiB,UAAU;IASzB,oIAAoI;IACpI,MAAa,WAAW;QACN,CAAC,CAAS;QACV,CAAC,CAAS;QACV,CAAC,CAAS;QAE1B;;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gB,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;YACrG,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,0BAA0B,CAAC,CAAC;YAC3G,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAChH,CAAC;QAEM,MAAM,CAAC,QAAQ,CAAC,IAAY;YACjC,IAAI,SAAS,KAAK,IAAI;gBACpB,OAAO,IAAI,CAAC,QAAQ,CAAC;YACvB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAEM,MAAM,CAAC,OAAiB;YAC7B,MAAM,IAAI,GAAU;gBAClB,0BAA0B,EAAE,IAAI,CAAC,0BAA0B;gBAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,4BAA4B,EAAE,IAAI,CAAC,4BAA4B;gBAC/D,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;gBAC3C,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;aACvC,CAAC;YAEF,IAAI,SAAS,KAAK,OAAO;gBACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YAEzB,OAAO,IAAI,CAAC;QACd,CAAC;;IArFU,mBAAQ,WAsFpB,CAAA;AACH,CAAC,EAhKgB,UAAU,KAAV,UAAU,QAgK1B","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 */\nimport { JsonUtils } from \"@itwin/core-bentley\";\n\n/** Namespace containing types controlling how atmospheric scattering should be rendered.\n * @beta\n * The techniques used to render the atmosphere approximate the physical behavior of light when interacting with particles in the air (Rayleigh Scattering and Mie Scattering)\n * Presently, only Rayleigh Scattering is implemented here\n *\n * In a nutshell, this implementation samples atmospheric density along rays cast from the view and uses the samples to simulate the scattering of light toward the camera.\n * The amount of light scattered toward the camera is dependent on the amount of light scattered away from its original path from the sun, so rays must also be cast from the sample points to the sun.\n *\n * The effect can be computed on vertices (the default for the background map) and fragments (the default for the skybox, which is a ViewportQuad).\n * All coordinates are in view space.\n *\n * This implementation is adapted from equations outlined in \"Display of Clouds Taking into Account Multiple Anisotropic Scattering and Sky Light\", Nishita et al. 1993\n * which are further refined for use in GPU shaders in \"Photorealistic Real-Time Outdoor Light Scattering\", Hoffman and Preetham 2002.\n * These sources are also compiled in Chapter 16 of NVIDIA's \"GPU Gems 2\", which can be found online here:\n * https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\n *\n * This implementation is also highly inspired by Sebastian Lague's Solar System project: https://github.com/SebLague/Solar-System/ and video: https://www.youtube.com/watch?v=DxfEbulyFcY\n * along with this ShaderToy replica: https://www.shadertoy.com/view/fltXD2.\n * Both of which are inspired by this Nvidia article on atmospheric scattering: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering.\n */\nexport namespace Atmosphere {\n\n /** @internal JSON representation of a [[Wavelengths]] object */\n export interface WavelengthsProps {\n r: number;\n g: number;\n b: number;\n }\n\n /** @internal An immutable container of wavelength values for the red, green and blue pixel components. Values are in nanometers. */\n export class Wavelengths {\n public readonly r: number;\n public readonly g: number;\n public readonly b: number;\n\n /** Constructs from red, green, and blue wavelength values.\n * @param r Wavelength value for red\n * @param g Wavelength value for green\n * @param b Wavelength value for blue\n */\n constructor(props: WavelengthsProps) {\n this.r = Math.max(0, props.r);\n this.g = Math.max(0, props.g);\n this.b = Math.max(0, props.b);\n }\n\n public equals(other: Wavelengths): boolean {\n return this.r === other.r && this.g === other.g && this.b === other.b;\n }\n\n public toJSON(): WavelengthsProps {\n return { r: this.r, g: this.g, b: this.b };\n }\n\n public static fromJSON(json: WavelengthsProps | undefined): Wavelengths {\n let r = 0;\n let g = 0;\n let b = 0;\n if (undefined !== json) {\n if (typeof json.r === \"number\")\n r = json.r;\n if (typeof json.g === \"number\")\n g = json.g;\n if (typeof json.b === \"number\")\n b = json.b;\n }\n return new Wavelengths({ r, g, b });\n }\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export interface Props {\n /** Whether the ground plane should be displayed. Defaults to false. */\n display?: boolean;\n /** @internal See [[Settings.atmosphereHeightAboveEarth]] */\n atmosphereHeightAboveEarth?: number;\n /** See [[Settings.exposure]] */\n exposure?: number;\n /** @internal See [[Settings.densityFalloff]] */\n densityFalloff?: number;\n /** @internal See [[Settings.minDensityHeightBelowEarth]] */\n depthBelowEarthForMaxDensity?: number;\n /** See [[Settings.numViewRaySamples]] */\n numViewRaySamples?: number;\n /** See [[Settings.numSunRaySamples]] */\n numSunRaySamples?: number;\n /** @internal See [[Settings.scatteringStrength]] */\n scatteringStrength?: number;\n /** @internal See [[Settings.wavelengths]] */\n wavelengths?: WavelengthsProps;\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export class Settings {\n private static _defaultAtmosphereHeightAboveEarth: number = 100000.0;\n private static _defaultExposure: number = 2.0;\n private static _defaultDensityFalloff: number = 10.0;\n private static _defaultMinDensityHeightBelowEarth: 0.0;\n private static _defaultScatteringStrength: number = 100;\n private static _defaultWavelengths: Wavelengths = new Wavelengths({ r: 700.0, g: 530.0, b: 440.0 });\n\n private static _defaultNumViewRaySamples: number = 10;\n private static _highQualityNumViewRaySamples: number = 20;\n private static _defaultNumSunRaySamples: number = 5;\n\n public static readonly defaults = new Settings({});\n public static readonly highQuality = new Settings({ numViewRaySamples: this._highQualityNumViewRaySamples });\n\n /** @internal If defined, corresponds to the height in meters above the earth's pole at which the atmosphere terminates. Physically, this is the point at which there are no more air molecules to interfere with light transmission. Defaults to 100_000.0. */\n public readonly atmosphereHeightAboveEarth: number;\n /** If defined, this value is used to simulate the aperture of a camera. Higher values allow more light in. This value might need to be adjusted slightly in situations without much sunlight (like sunset) to brighten the image. Defaults to 2.0 */\n public readonly exposure: number;\n /** @internal If defined, controls the rate at which the air density decreases between the point it is the highest and the point is is the lowest. A higher value means a faster decrease in air density. Defaults to 10.0. */\n public readonly densityFalloff: number;\n /** @internal If defined, corresponds to the height in meters below the earth's pole at which the atmosphere is at its densest. Physically, this is the point at which there is the most air molecules to interfere with light transmission. Defaults to 0.0. */\n public readonly depthBelowEarthForMaxDensity: number;\n /** If defined, corresponds to the number of atmospheric density samples used to compute the amount of light scattered along each view ray. For each sample point, another ray will be cast toward the sun to compute the amount of light reaching the sample point. Higher values increase fidelity, but greatly decrease performance because sun rays must be cast from each additional sample point. The range is 1 to 40. Defaults to 10. */\n public readonly numViewRaySamples: number;\n /** If defined, corresponds to the number of atmospheric density samples uses to compute the amount of light scattered along each sun ray. Higher values increase fidelity slightly but greatly decrease performance. Minimal improvement is observable with values above 5. The range is 1 to 40. Defaults to 5. */\n public readonly numSunRaySamples: number;\n /** @internal If defined, controls how strongly the atmosphere's air diverts light. Higher values increase scattering intensity. Defaults to 100.0. */\n public readonly scatteringStrength: number;\n /** @internal If defined, corresponds the wavelengths of the red, green and blue color components in nanometers used to simulate how the atmosphere's air molecules affects light transmission. (See Rayleigh Scattering) Thus, a value of 470 for the red wavelength will make the red light component scatter as if it physically were a cyan light ray. The default value is {r:700.0, g:530.0, b:440.0}. */\n public readonly wavelengths: Wavelengths;\n\n public equals(other: Settings): boolean {\n if (this.atmosphereHeightAboveEarth !== other.atmosphereHeightAboveEarth)\n return false;\n if (this.exposure !== other.exposure)\n return false;\n if (this.densityFalloff !== other.densityFalloff)\n return false;\n if (this.depthBelowEarthForMaxDensity !== other.depthBelowEarthForMaxDensity)\n return false;\n if (this.numViewRaySamples !== other.numViewRaySamples)\n return false;\n if (this.numSunRaySamples !== other.numSunRaySamples)\n return false;\n if (this.scatteringStrength !== other.scatteringStrength)\n return false;\n if (!this.wavelengths.equals(other.wavelengths))\n return false;\n return true;\n }\n\n private constructor(json: Props) {\n this.atmosphereHeightAboveEarth = JsonUtils.asDouble(json.atmosphereHeightAboveEarth, Settings._defaultAtmosphereHeightAboveEarth);\n this.exposure = JsonUtils.asDouble(json.exposure, Settings._defaultExposure);\n this.densityFalloff = JsonUtils.asDouble(json.densityFalloff, Settings._defaultDensityFalloff);\n this.depthBelowEarthForMaxDensity = JsonUtils.asDouble(json.depthBelowEarthForMaxDensity, Settings._defaultMinDensityHeightBelowEarth);\n this.numViewRaySamples = JsonUtils.asDouble(json.numViewRaySamples, Settings._defaultNumViewRaySamples);\n this.numSunRaySamples = JsonUtils.asDouble(json.numSunRaySamples, Settings._defaultNumSunRaySamples);\n this.scatteringStrength = JsonUtils.asDouble(json.scatteringStrength, Settings._defaultScatteringStrength);\n this.wavelengths = Wavelengths.fromJSON(JsonUtils.asObject(json.wavelengths) ?? Settings._defaultWavelengths);\n }\n\n public static fromJSON(json?: Props) {\n if (undefined === json)\n return this.defaults;\n return new Settings(json);\n }\n\n public toJSON(display?: boolean): Props {\n const json: Props = {\n atmosphereHeightAboveEarth: this.atmosphereHeightAboveEarth,\n exposure: this.exposure,\n densityFalloff: this.densityFalloff,\n depthBelowEarthForMaxDensity: this.depthBelowEarthForMaxDensity,\n numViewRaySamples: this.numViewRaySamples,\n numSunRaySamples: this.numSunRaySamples,\n scatteringStrength: this.scatteringStrength,\n wavelengths: this.wavelengths.toJSON(),\n };\n\n if (undefined !== display)\n json.display = display;\n\n return json;\n }\n }\n}\n"]}
|
|
@@ -19,6 +19,10 @@ export var BackgroundMapType;
|
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
21
|
export class BackgroundMapProvider {
|
|
22
|
+
/** The name of the provider. */
|
|
23
|
+
name;
|
|
24
|
+
/** The type of map imagery provided. */
|
|
25
|
+
type;
|
|
22
26
|
constructor(name, type) {
|
|
23
27
|
this.name = name;
|
|
24
28
|
this.type = type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundMapProvider.js","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,6DAAU,CAAA;IACV,6DAAU,CAAA;AACZ,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAoBD;;GAEG;AACH,MAAM,OAAO,qBAAqB;
|
|
1
|
+
{"version":3,"file":"BackgroundMapProvider.js","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,6DAAU,CAAA;IACV,6DAAU,CAAA;AACZ,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAoBD;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAChC,gCAAgC;IAChB,IAAI,CAA4B;IAChD,wCAAwC;IACxB,IAAI,CAAoB;IAExC,YAAoB,IAA+B,EAAE,IAAuB;QAC1E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,sDAAsD;IAC/C,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,MAAM,IAAI,GAA8B,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC;QACtG,IAAI,IAAI,CAAC;QACT,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,iBAAiB,CAAC,MAAM,CAAC;YAC9B,KAAK,iBAAiB,CAAC,MAAM;gBAC3B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;gBAClB,MAAM;YACR;gBACE,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;gBAChC,MAAM;QACV,CAAC;QAED,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,wDAAwD;IACjD,MAAM;QACX,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,4DAA4D;QAC5D,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,YAAyC,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;IACrH,CAAC;IAED,6DAA6D;IACtD,MAAM,CAAC,KAA4B;QACxC,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAwC;QACnD,OAAO,qBAAqB,CAAC,QAAQ,CAAC;YACpC,GAAG,IAAI,CAAC,MAAM,EAAE;YAChB,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\n\n/** Enumerates the types of map imagery that can be supplied by a [[BackgroundMapProvider]].\n * @public\n * @extensions\n */\nexport enum BackgroundMapType {\n Street = 1,\n Aerial = 2,\n Hybrid = 3,\n}\n\n/** Enumerates a set of supported [[BackgroundMapProvider]]s that can provide map imagery.\n * @note To access imagery from such a provider, an API key must be supplied via [IModelAppOptions.mapLayerOptions]($frontend).\n * @public\n * @extensions\n */\nexport type BackgroundMapProviderName = \"BingProvider\" | \"MapBoxProvider\";\n\n/** JSON representation of a [[BackgroundMapProvider]].\n * @see [[BaseMapLayerProps.provider]].\n * @public\n */\nexport interface BackgroundMapProviderProps {\n /** The name of the provider. Default: \"BingProvider\" */\n name?: BackgroundMapProviderName;\n /** The type of imagery to display. Default: Hybrid. */\n type?: BackgroundMapType;\n}\n\n/** Describes one of a small set of standard, known suppliers of background map imagery as part of a [[BaseMapLayerSettings]].\n * @public\n */\nexport class BackgroundMapProvider {\n /** The name of the provider. */\n public readonly name: BackgroundMapProviderName;\n /** The type of map imagery provided. */\n public readonly type: BackgroundMapType;\n\n private constructor(name: BackgroundMapProviderName, type: BackgroundMapType) {\n this.name = name;\n this.type = type;\n }\n\n /** Create a provider from its JSON representation. */\n public static fromJSON(props: BackgroundMapProviderProps): BackgroundMapProvider {\n const name: BackgroundMapProviderName = props.name === \"MapBoxProvider\" ? props.name : \"BingProvider\";\n let type;\n switch (props.type) {\n case BackgroundMapType.Street:\n case BackgroundMapType.Aerial:\n type = props.type;\n break;\n default:\n type = BackgroundMapType.Hybrid;\n break;\n }\n\n return new BackgroundMapProvider(name, type);\n }\n\n /** Convert this provider to its JSON representation. */\n public toJSON(): BackgroundMapProviderProps {\n return { name: this.name, type: this.type };\n }\n\n /** @internal */\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BackgroundMapProvider {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.fromJSON({ name: props.providerName as BackgroundMapProviderName, type: props.providerData?.mapType });\n }\n\n /** Return true if this provider is equivalent to `other`. */\n public equals(other: BackgroundMapProvider): boolean {\n return this.name === other.name && this.type === other.type;\n }\n\n /** Produce a copy of this provider with identical properties except for those explicitly specified by `changedProps`.\n * Any properties explicitly set to `undefined` in `changedProps` will be reset to their default values.\n */\n public clone(changedProps: BackgroundMapProviderProps): BackgroundMapProvider {\n return BackgroundMapProvider.fromJSON({\n ...this.toJSON(),\n ...changedProps,\n });\n }\n}\n"]}
|
|
@@ -35,6 +35,25 @@ function normalizeTransparency(trans) {
|
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
37
|
export class BackgroundMapSettings {
|
|
38
|
+
/** Retained strictly for persistence. */
|
|
39
|
+
_provider;
|
|
40
|
+
/** Elevation in meters, relative to WGS84 Ellipsoid.. */
|
|
41
|
+
groundBias;
|
|
42
|
+
/** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */
|
|
43
|
+
transparency;
|
|
44
|
+
/** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */
|
|
45
|
+
useDepthBuffer;
|
|
46
|
+
/** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */
|
|
47
|
+
applyTerrain;
|
|
48
|
+
/** Settings associated with terrain display. */
|
|
49
|
+
terrainSettings;
|
|
50
|
+
/** Globe display mode. */
|
|
51
|
+
globeMode;
|
|
52
|
+
/** Planar Mask - used to mask the background map to avoid overlapping with other geometry
|
|
53
|
+
* @beta
|
|
54
|
+
*/
|
|
55
|
+
planarClipMask;
|
|
56
|
+
_locatable;
|
|
38
57
|
/** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it
|
|
39
58
|
* allows the user to select elements that are behind the map.
|
|
40
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundMapS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AC,IAAI,CAAC,UAAU;YAC3D,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\n\n/** Describes the projection of the background map\n * @see [[BackgroundMapProps]]\n * @see [[DisplayStyleSettingsProps]]\n * @public\n * @extensions\n */\nexport enum GlobeMode {\n /** Display Earth as 3d ellipsoid */\n Ellipsoid = 0,\n /** Display Earth as plane. */\n Plane = 1,\n}\n\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\n * @public\n * @extensions\n */\nexport interface BackgroundMapProps {\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\n groundBias?: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\n * Default value: false.\n */\n transparency?: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n useDepthBuffer?: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n applyTerrain?: boolean;\n /** Properties associated with terrain display. */\n terrainSettings?: TerrainProps;\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\n globeMode?: GlobeMode;\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n nonLocatable?: boolean;\n /** A planar mask applied to the map geometry\n * @beta\n */\n planarClipMask?: PlanarClipMaskProps;\n\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\n providerName?: never;\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\n providerData?: never;\n}\n\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\n * @public\n * @extensions\n */\nexport interface DeprecatedBackgroundMapProps {\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\n * Default value: \"BingProvider\"\n * @deprecated in 3.x. use MapImageryProps.backgroundBase.\n */\n providerName?: string;\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\n * @deprecated in 3.x. use MapImageryProps.backgroundBase\n */\n providerData?: {\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\n mapType?: BackgroundMapType;\n };\n}\n\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\n * @public\n * @extensions\n */\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\n\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\n}\n\nfunction normalizeTransparency(trans?: number | false): number | false {\n if (\"number\" === typeof trans)\n return Math.min(1, Math.max(0, trans));\n\n return false;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\n * @public\n */\nexport class BackgroundMapSettings {\n /** Retained strictly for persistence. */\n private readonly _provider: BackgroundMapProvider;\n\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\n public readonly groundBias: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\n public readonly transparency: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n public readonly useDepthBuffer: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n public readonly applyTerrain: boolean;\n /** Settings associated with terrain display. */\n public readonly terrainSettings: TerrainSettings;\n /** Globe display mode. */\n public readonly globeMode: GlobeMode;\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\n * @beta\n */\n public readonly planarClipMask: PlanarClipMaskSettings;\n private readonly _locatable: boolean;\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n public get locatable(): boolean {\n // Handle legacy TerrainProps.nonLocatable:\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\n // - Otherwise, use BackgroundMapProps.nonLocatable.\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\n return false;\n\n return this._locatable;\n }\n\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\n\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\n this.groundBias = props.groundBias ?? 0;\n this.transparency = normalizeTransparency(props.transparency);\n this.useDepthBuffer = props.useDepthBuffer ?? false;\n this.applyTerrain = props.applyTerrain ?? false;\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\n this.globeMode = normalizeGlobeMode(props.globeMode);\n this._locatable = true !== props.nonLocatable;\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\n }\n\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\n * the iModel - otherwise, prefer [[fromJSON]].\n */\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\n return new this(json ?? {});\n }\n\n /** Construct from JSON, performing validation and applying default values for undefined fields.\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\n */\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\n return new BackgroundMapSettings(json ?? {});\n }\n\n /** Convert these settings to their in-memory JSON representation.\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\n */\n public toJSON(): BackgroundMapProps {\n const props: BackgroundMapProps = {};\n if (0 !== this.groundBias)\n props.groundBias = this.groundBias;\n if (this.applyTerrain)\n props.applyTerrain = true;\n if (false !== this.transparency)\n props.transparency = this.transparency;\n if (GlobeMode.Ellipsoid !== this.globeMode)\n props.globeMode = this.globeMode;\n if (this.useDepthBuffer)\n props.useDepthBuffer = true;\n if (!this._locatable)\n props.nonLocatable = true;\n\n const terrainSettings = this.terrainSettings.toJSON();\n for (const prop of Object.values(terrainSettings)) {\n if (undefined !== prop) {\n props.terrainSettings = terrainSettings;\n break;\n }\n }\n\n if (this.planarClipMask.isValid)\n props.planarClipMask = this.planarClipMask.toJSON();\n\n return props;\n }\n\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\n * the iModel - otherwise, prefer [[toJSON]].\n */\n public toPersistentJSON(): PersistentBackgroundMapProps {\n const props = this.toJSON() as PersistentBackgroundMapProps;\n\n // Preserve deprecated imagery provider properties.\n if (\"BingProvider\" !== this._provider.name)\n props.providerName = this._provider.name; // eslint-disable-line @typescript-eslint/no-deprecated\n if (BackgroundMapType.Hybrid !== this._provider.type)\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line @typescript-eslint/no-deprecated\n\n return props;\n }\n\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\n public equalsJSON(json?: BackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromJSON(json));\n }\n\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\n }\n\n /** Returns true if these settings are equivalent to `other`. */\n public equals(other: BackgroundMapSettings): boolean {\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\n }\n\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\n if (undefined === changedProps)\n return this;\n\n const props = {\n groundBias: changedProps.groundBias ?? this.groundBias,\n transparency: changedProps.transparency ?? this.transparency,\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\n globeMode: changedProps.globeMode ?? this.globeMode,\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\n providerName: this._provider.name,\n providerData: { mapType: this._provider.type },\n };\n\n return BackgroundMapSettings.fromPersistentJSON(props);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAuB,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAgB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAgED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB;IACnD,IAAI,QAAQ,KAAK,OAAO,KAAK;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAChC,yCAAyC;IACxB,SAAS,CAAwB;IAElD,yDAAyD;IACzC,UAAU,CAAS;IACnC,2MAA2M;IAC3L,YA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zD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\n\n/** Describes the projection of the background map\n * @see [[BackgroundMapProps]]\n * @see [[DisplayStyleSettingsProps]]\n * @public\n * @extensions\n */\nexport enum GlobeMode {\n /** Display Earth as 3d ellipsoid */\n Ellipsoid = 0,\n /** Display Earth as plane. */\n Plane = 1,\n}\n\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\n * @public\n * @extensions\n */\nexport interface BackgroundMapProps {\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\n groundBias?: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\n * Default value: false.\n */\n transparency?: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n useDepthBuffer?: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n applyTerrain?: boolean;\n /** Properties associated with terrain display. */\n terrainSettings?: TerrainProps;\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\n globeMode?: GlobeMode;\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n nonLocatable?: boolean;\n /** A planar mask applied to the map geometry\n * @beta\n */\n planarClipMask?: PlanarClipMaskProps;\n\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\n providerName?: never;\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\n providerData?: never;\n}\n\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\n * @public\n * @extensions\n */\nexport interface DeprecatedBackgroundMapProps {\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\n * Default value: \"BingProvider\"\n * @deprecated in 3.x. use MapImageryProps.backgroundBase.\n */\n providerName?: string;\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\n * @deprecated in 3.x. use MapImageryProps.backgroundBase\n */\n providerData?: {\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\n mapType?: BackgroundMapType;\n };\n}\n\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\n * @public\n * @extensions\n */\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\n\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\n}\n\nfunction normalizeTransparency(trans?: number | false): number | false {\n if (\"number\" === typeof trans)\n return Math.min(1, Math.max(0, trans));\n\n return false;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\n * @public\n */\nexport class BackgroundMapSettings {\n /** Retained strictly for persistence. */\n private readonly _provider: BackgroundMapProvider;\n\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\n public readonly groundBias: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\n public readonly transparency: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n public readonly useDepthBuffer: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n public readonly applyTerrain: boolean;\n /** Settings associated with terrain display. */\n public readonly terrainSettings: TerrainSettings;\n /** Globe display mode. */\n public readonly globeMode: GlobeMode;\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\n * @beta\n */\n public readonly planarClipMask: PlanarClipMaskSettings;\n private readonly _locatable: boolean;\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n public get locatable(): boolean {\n // Handle legacy TerrainProps.nonLocatable:\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\n // - Otherwise, use BackgroundMapProps.nonLocatable.\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\n return false;\n\n return this._locatable;\n }\n\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\n\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\n this.groundBias = props.groundBias ?? 0;\n this.transparency = normalizeTransparency(props.transparency);\n this.useDepthBuffer = props.useDepthBuffer ?? false;\n this.applyTerrain = props.applyTerrain ?? false;\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\n this.globeMode = normalizeGlobeMode(props.globeMode);\n this._locatable = true !== props.nonLocatable;\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\n }\n\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\n * the iModel - otherwise, prefer [[fromJSON]].\n */\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\n return new this(json ?? {});\n }\n\n /** Construct from JSON, performing validation and applying default values for undefined fields.\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\n */\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\n return new BackgroundMapSettings(json ?? {});\n }\n\n /** Convert these settings to their in-memory JSON representation.\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\n */\n public toJSON(): BackgroundMapProps {\n const props: BackgroundMapProps = {};\n if (0 !== this.groundBias)\n props.groundBias = this.groundBias;\n if (this.applyTerrain)\n props.applyTerrain = true;\n if (false !== this.transparency)\n props.transparency = this.transparency;\n if (GlobeMode.Ellipsoid !== this.globeMode)\n props.globeMode = this.globeMode;\n if (this.useDepthBuffer)\n props.useDepthBuffer = true;\n if (!this._locatable)\n props.nonLocatable = true;\n\n const terrainSettings = this.terrainSettings.toJSON();\n for (const prop of Object.values(terrainSettings)) {\n if (undefined !== prop) {\n props.terrainSettings = terrainSettings;\n break;\n }\n }\n\n if (this.planarClipMask.isValid)\n props.planarClipMask = this.planarClipMask.toJSON();\n\n return props;\n }\n\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\n * the iModel - otherwise, prefer [[toJSON]].\n */\n public toPersistentJSON(): PersistentBackgroundMapProps {\n const props = this.toJSON() as PersistentBackgroundMapProps;\n\n // Preserve deprecated imagery provider properties.\n if (\"BingProvider\" !== this._provider.name)\n props.providerName = this._provider.name; // eslint-disable-line @typescript-eslint/no-deprecated\n if (BackgroundMapType.Hybrid !== this._provider.type)\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line @typescript-eslint/no-deprecated\n\n return props;\n }\n\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\n public equalsJSON(json?: BackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromJSON(json));\n }\n\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\n }\n\n /** Returns true if these settings are equivalent to `other`. */\n public equals(other: BackgroundMapSettings): boolean {\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\n }\n\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\n if (undefined === changedProps)\n return this;\n\n const props = {\n groundBias: changedProps.groundBias ?? this.groundBias,\n transparency: changedProps.transparency ?? this.transparency,\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\n globeMode: changedProps.globeMode ?? this.globeMode,\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\n providerName: this._provider.name,\n providerData: { mapType: this._provider.type },\n };\n\n return BackgroundMapSettings.fromPersistentJSON(props);\n }\n}\n"]}
|
package/lib/esm/BlobReader.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { BlobOptionsBuilder, DbQueryError, DbRequestKind, } from "./ConcurrentQuery";
|
|
2
2
|
/** @beta */
|
|
3
3
|
export class Uint8Chunks {
|
|
4
|
-
|
|
5
|
-
this._chunks = [];
|
|
6
|
-
}
|
|
4
|
+
_chunks = [];
|
|
7
5
|
append(chunk) {
|
|
8
6
|
this._chunks.push(chunk);
|
|
9
7
|
}
|
|
@@ -25,14 +23,18 @@ export class Uint8Chunks {
|
|
|
25
23
|
}
|
|
26
24
|
/** @beta */
|
|
27
25
|
export class BlobReader {
|
|
26
|
+
_executor;
|
|
27
|
+
className;
|
|
28
|
+
accessString;
|
|
29
|
+
instanceId;
|
|
30
|
+
_chunks = new Uint8Chunks();
|
|
31
|
+
_lengthToRead = -1;
|
|
32
|
+
_options = new BlobOptionsBuilder().getOptions();
|
|
28
33
|
constructor(_executor, className, accessString, instanceId, options) {
|
|
29
34
|
this._executor = _executor;
|
|
30
35
|
this.className = className;
|
|
31
36
|
this.accessString = accessString;
|
|
32
37
|
this.instanceId = instanceId;
|
|
33
|
-
this._chunks = new Uint8Chunks();
|
|
34
|
-
this._lengthToRead = -1;
|
|
35
|
-
this._options = new BlobOptionsBuilder().getOptions();
|
|
36
38
|
this.reset(options);
|
|
37
39
|
}
|
|
38
40
|
reset(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlobReader.js","sourceRoot":"","sources":["../../src/BlobReader.ts"],"names":[],"mappings":"AAQA,OAAO,EACQ,kBAAkB,EAA4C,YAAY,EAAqB,aAAa,GAC1H,MAAM,mBAAmB,CAAC;AAE3B,YAAY;AACZ,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"BlobReader.js","sourceRoot":"","sources":["../../src/BlobReader.ts"],"names":[],"mappings":"AAQA,OAAO,EACQ,kBAAkB,EAA4C,YAAY,EAAqB,aAAa,GAC1H,MAAM,mBAAmB,CAAC;AAE3B,YAAY;AACZ,MAAM,OAAO,WAAW;IACd,OAAO,GAAiB,EAAE,CAAC;IAC5B,MAAM,CAAC,KAAiB;QAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACM,EAAE,CAAC,GAAW,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,IAAW,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAQ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,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;IACD,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD,IAAW,MAAM,KAAkB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;CAC1D","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 { Id64String } from \"@itwin/core-bentley\";\nimport {\n BlobOptions, BlobOptionsBuilder, BlobRange, DbBlobRequest, DbBlobResponse, DbQueryError, DbRequestExecutor, DbRequestKind,\n} from \"./ConcurrentQuery\";\n\n/** @beta */\nexport class Uint8Chunks implements Iterable<Uint8Array> {\n private _chunks: Uint8Array[] = [];\n public append(chunk: Uint8Array) {\n this._chunks.push(chunk);\n }\n public at(idx: number) { return this._chunks[idx]; }\n public get length() { return this._chunks.length; }\n public [Symbol.iterator](): Iterator<Uint8Array, any, undefined> {\n return (this._chunks as any)[Symbol.iterator];\n }\n public combine(): Uint8Array {\n const totalChunkLength = this._chunks.reduce((acc, v) => acc + v.length, 0);\n const combineChunk = new Uint8Array(totalChunkLength);\n let offset = 0;\n for (const array of this._chunks) {\n combineChunk.set(array, offset);\n offset += array.length;\n }\n return combineChunk;\n }\n}\n/** @beta */\nexport class BlobReader {\n private _chunks = new Uint8Chunks();\n private _lengthToRead: number = -1;\n private _options = new BlobOptionsBuilder().getOptions();\n public constructor(private _executor: DbRequestExecutor<DbBlobRequest, DbBlobResponse>,\n public readonly className: string,\n public readonly accessString: string,\n public readonly instanceId: Id64String,\n options?: BlobOptions) {\n this.reset(options);\n }\n public reset(options?: BlobOptions) {\n if (options) {\n this._options = options;\n }\n this._chunks = new Uint8Chunks();\n this._lengthToRead = this.range.count!;\n }\n public get range(): BlobRange { return this._options.range!; }\n public async step(): Promise<boolean> {\n if (this._lengthToRead === this._chunks.length) {\n return false;\n }\n const request: DbBlobRequest = {\n kind: DbRequestKind.BlobIO,\n className: this.className,\n accessString: this.accessString,\n instanceId: this.instanceId,\n ...this._options,\n };\n request.range = {offset: this._chunks.length, count: this.range ? this._lengthToRead - this._chunks.length : 0};\n const resp = await this._executor.execute(request);\n DbQueryError.throwIfError(resp, request);\n\n if (this._lengthToRead === -1) {\n this._lengthToRead = resp.rawBlobSize;\n }\n if (resp.data && resp.data.length > 0) {\n this._chunks.append(resp.data);\n }\n return true;\n }\n public async readToEnd(): Promise<Uint8Array> {\n while (await this.step()) { }\n return this._chunks.combine();\n }\n public get current(): Uint8Array {\n if (this._chunks.length === 0) {\n throw new Error(\"there is no current buffer\");\n }\n return this._chunks.at(this._chunks.length);\n }\n public get chunks(): Uint8Chunks { return this._chunks; }\n}\n"]}
|
package/lib/esm/Camera.js
CHANGED
package/lib/esm/Camera.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../../src/Camera.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAc,OAAO,EAAoB,MAAM,sBAAsB,CAAC;AAYpF;;;GAGG;AACH,MAAM,OAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../../src/Camera.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAA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Aa,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { JsonUtils } from \"@itwin/core-bentley\";\nimport { Angle, AngleProps, Point3d, XYAndZ, XYZProps } from \"@itwin/core-geometry\";\n\n/** JSON representation of a [[Camera]].\n * @public\n * @extensions\n */\nexport interface CameraProps {\n lens: AngleProps;\n focusDist: number; // NOTE: this is abbreviated, do not change!\n eye: XYZProps;\n}\n\n/** The current position (eyepoint), lens angle, and focus distance of a camera.\n * @see [Views]($docs/learning/frontend/Views.md)\n * @public\n */\nexport class Camera implements CameraProps {\n public readonly lens: Angle;\n public focusDist: number;\n public readonly eye: Point3d;\n\n public static isValidLensAngle(val: Angle) {\n return val.radians > (Math.PI / 8.0) && val.radians < Math.PI;\n }\n\n public static validateLensAngle(val: Angle) {\n if (!this.isValidLensAngle(val))\n val.setRadians(Math.PI / 2.0);\n }\n\n public invalidateFocus() { this.focusDist = 0.0; }\n public get isFocusValid() { return this.focusDist > 0.0 && this.focusDist < 1.0e14; }\n public getFocusDistance() { return this.focusDist; }\n public setFocusDistance(dist: number) { this.focusDist = dist; }\n public get isLensValid() { return Camera.isValidLensAngle(this.lens); }\n public validateLens() { Camera.validateLensAngle(this.lens); }\n public getLensAngle() { return this.lens; }\n public setLensAngle(angle: Angle) { this.lens.setFrom(angle); }\n public getEyePoint() { return this.eye; }\n public setEyePoint(pt: XYAndZ) { this.eye.setFrom(pt); }\n public get isValid() { return this.isLensValid && this.isFocusValid; }\n public equals(other: Camera) {\n return Math.abs(this.lens.radians - other.lens.radians) < .01 &&\n Math.abs(this.focusDist - other.focusDist) < .1 &&\n this.eye.isAlmostEqual(other.eye);\n }\n public clone() { return new Camera(this); }\n public setFrom(rhs: Camera) {\n this.lens.setFrom(rhs.lens);\n this.focusDist = rhs.focusDist;\n this.eye.setFrom(rhs.eye);\n }\n\n /** Construct a Camera\n * @param props The properties of the new camera. If undefined, create a camera with eye at {0,0,0}, 90 degree lens, 1 meter focus distance.\n */\n public constructor(props?: CameraProps) {\n if (props !== undefined) {\n this.lens = Angle.fromJSON(props.lens);\n this.focusDist = JsonUtils.asDouble(props.focusDist);\n this.eye = Point3d.fromJSON(props.eye);\n return;\n }\n this.lens = Angle.createRadians(Math.PI / 2.0);\n this.focusDist = 1;\n this.eye = new Point3d();\n }\n}\n"]}
|
package/lib/esm/ClipStyle.js
CHANGED
|
@@ -15,8 +15,14 @@ import { ColorDef } from "./ColorDef";
|
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
17
|
export class CutStyle {
|
|
18
|
+
/** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */
|
|
19
|
+
viewflags;
|
|
20
|
+
/** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */
|
|
21
|
+
hiddenLine;
|
|
22
|
+
/** If defined, overrides aspects of the symbology of the section-cut graphics. */
|
|
23
|
+
appearance;
|
|
18
24
|
/** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */
|
|
19
|
-
static
|
|
25
|
+
static defaults = new CutStyle();
|
|
20
26
|
constructor(viewflags, hiddenLine, appearance) {
|
|
21
27
|
this.viewflags = viewflags ?? {};
|
|
22
28
|
if (hiddenLine && !hiddenLine.matchesDefaults)
|
|
@@ -67,6 +73,10 @@ export class CutStyle {
|
|
|
67
73
|
* @extensions
|
|
68
74
|
*/
|
|
69
75
|
export class ClipIntersectionStyle {
|
|
76
|
+
/** Color to apply to intersection of geometry and clip planes, default white */
|
|
77
|
+
color;
|
|
78
|
+
/** Number of pixels to be considered intersecting the clip plane, default 1 */
|
|
79
|
+
width;
|
|
70
80
|
constructor(color = RgbColor.fromColorDef(ColorDef.white), width = 1) {
|
|
71
81
|
this.color = color;
|
|
72
82
|
this.width = width;
|
|
@@ -77,7 +87,7 @@ export class ClipIntersectionStyle {
|
|
|
77
87
|
return this.defaults;
|
|
78
88
|
return new ClipIntersectionStyle(color, width);
|
|
79
89
|
}
|
|
80
|
-
static
|
|
90
|
+
static defaults = new ClipIntersectionStyle();
|
|
81
91
|
static fromJSON(props) {
|
|
82
92
|
if (props === undefined) {
|
|
83
93
|
return ClipIntersectionStyle.defaults;
|
|
@@ -109,8 +119,24 @@ export class ClipIntersectionStyle {
|
|
|
109
119
|
* @public
|
|
110
120
|
*/
|
|
111
121
|
export class ClipStyle {
|
|
122
|
+
/** If `true`, geometry will be produced at the clip planes.
|
|
123
|
+
* - Solids (closed volumes) will produce facets on the clip planes.
|
|
124
|
+
* - Other surfaces will produce line strings representing the edges of the surface at the clip planes.
|
|
125
|
+
* @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.
|
|
126
|
+
*/
|
|
127
|
+
produceCutGeometry;
|
|
128
|
+
/** If 'true', intersection of geometry and clip planes will be colorized */
|
|
129
|
+
colorizeIntersection;
|
|
130
|
+
/** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */
|
|
131
|
+
cutStyle;
|
|
132
|
+
/** If defined, geometry inside the clip planes will be drawn in this color. */
|
|
133
|
+
insideColor;
|
|
134
|
+
/** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */
|
|
135
|
+
outsideColor;
|
|
136
|
+
/** Controls the style of the intersection of geometry and clip planes */
|
|
137
|
+
intersectionStyle;
|
|
112
138
|
/** The default style, which overrides none of the view's settings. */
|
|
113
|
-
static
|
|
139
|
+
static defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);
|
|
114
140
|
constructor(produceCutGeometry, colorizeIntersection, cutStyle, inside, outside, intersectionStyle) {
|
|
115
141
|
this.produceCutGeometry = produceCutGeometry;
|
|
116
142
|
this.colorizeIntersection = colorizeIntersection;
|
package/lib/esm/ClipStyle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAA0B,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgBtC;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAQnB,sHAAsH;aAC/F,aAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAEjD,YAAoB,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC3H,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;QACjC,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE/B,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,MAAM,CAAC,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC5H,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YACpJ,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAE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zB,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAElC,IAAI,IAAI,CAAC,oBAAoB;YAC3B,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;YACvC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC5B,CAAC;QAED,IAAI,IAAI,CAAC,WAAW;YAClB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAEhD,IAAI,IAAI,CAAC,YAAY;YACnB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAElD,IAAI,IAAI,CAAC,iBAAiB;YACxB,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAE5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uHAAuH;IACvH,IAAW,eAAe;QACxB,IAAI,IAAI,KAAK,SAAS,CAAC,QAAQ;YAC7B,OAAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { ViewFlagOverrides } from \"./ViewFlags\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { HiddenLine } from \"./HiddenLine\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\n * @see [[ClipStyleProps.cutStyle]].\n * @public\n * @extensions\n */\nexport interface CutStyleProps {\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\n viewflags?: ViewFlagOverrides;\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\n hiddenLine?: HiddenLine.SettingsProps;\n /** If defined, overrides aspects of the cut geometry's symbology. */\n appearance?: FeatureAppearanceProps;\n}\n\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\n * @public\n */\nexport class CutStyle {\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\n public readonly viewflags: Readonly<ViewFlagOverrides>;\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\n public readonly hiddenLine?: HiddenLine.Settings;\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\n public readonly appearance?: FeatureAppearance;\n\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\n public static readonly defaults = new CutStyle();\n\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\n this.viewflags = viewflags ?? {};\n if (hiddenLine && !hiddenLine.matchesDefaults)\n this.hiddenLine = hiddenLine;\n\n if (appearance && !appearance.matchesDefaults)\n this.appearance = appearance;\n }\n\n /** Create a CutStyle from its components. */\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\n return new CutStyle(viewflags, hiddenLine, appearance);\n\n return this.defaults;\n }\n\n public static fromJSON(props?: CutStyleProps): CutStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const viewflags = { ...props?.viewflags };\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\n\n return this.create(viewflags, hiddenLine, appearance);\n } else {\n return this.defaults;\n }\n }\n\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\n public toJSON(): CutStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: CutStyleProps = {};\n if (JsonUtils.isNonEmptyObject(this.viewflags))\n props.viewflags = this.viewflags;\n\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\n props.hiddenLine = this.hiddenLine?.toJSON();\n\n if (this.appearance && !this.appearance.matchesDefaults)\n props.appearance = this.appearance.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\n public get matchesDefaults(): boolean {\n if (this === CutStyle.defaults)\n return true;\n\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\n }\n}\n\n/** Wire format describing a [[ClipIntersectionStyle]].\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\n * @public\n * @extensions\n */\nexport interface ClipIntersectionStyleProps {\n /** Color to apply to intersection of geometry and clip planes, default white */\n color?: RgbColorProps;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n width?: number;\n}\n\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\n * @public\n * @extensions\n */\nexport class ClipIntersectionStyle {\n /** Color to apply to intersection of geometry and clip planes, default white */\n public readonly color: RgbColor;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n public readonly width: number;\n\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\n this.color = color;\n this.width = width;\n }\n /** Create a highlight from its components. */\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\n if (!color && !width)\n return this.defaults;\n\n return new ClipIntersectionStyle(color, width);\n }\n\n public static readonly defaults = new ClipIntersectionStyle();\n\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\n if (props === undefined) {\n return ClipIntersectionStyle.defaults;\n }\n\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\n const width = props.width ? props.width : 1;\n return new ClipIntersectionStyle(color, width);\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipIntersectionStyleProps | undefined {\n const props: ClipIntersectionStyleProps = {};\n\n if (this.matchesDefaults) {\n return undefined;\n }\n\n if (this.color)\n props.color = this.color.toJSON();\n\n if (this.width)\n props.width = this.width;\n\n return props;\n }\n\n public get matchesDefaults(): boolean {\n if (this === ClipIntersectionStyle.defaults)\n return true;\n\n return !this.color && !this.width;\n }\n}\n\n/** Arguments supplied to [[ClipStyle.create]].\n * @public\n * @extensions\n */\nexport interface ClipStyleCreateArgs {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If `true`, intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyle;\n}\n\n/** Wire format describing a [[ClipStyle]].\n * @see [[DisplayStyleSettingsProps.clipStyle]].\n * @public\n * @extensions\n */\nexport interface ClipStyleProps {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyleProps;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColorProps;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColorProps;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyleProps;\n}\n\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\n * @see [[DisplayStyleSettings.clipStyle]].\n * @public\n */\nexport class ClipStyle {\n /** If `true`, geometry will be produced at the clip planes.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n public readonly produceCutGeometry: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n public readonly colorizeIntersection: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n public readonly cutStyle: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n public readonly insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n public readonly outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n public readonly intersectionStyle?: ClipIntersectionStyle;\n\n /** The default style, which overrides none of the view's settings. */\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\n\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\n this.produceCutGeometry = produceCutGeometry;\n this.colorizeIntersection = colorizeIntersection;\n this.cutStyle = cutStyle;\n this.insideColor = inside;\n this.outsideColor = outside;\n this.intersectionStyle = intersectionStyle;\n }\n\n /** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\n\n /** Create a style from its components. */\n public static create(style: ClipStyleCreateArgs): ClipStyle;\n\n /** @internal */\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\n\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\n\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\n return this.defaults;\n }\n\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\n }\n\n const style = styleOrProduceCutGeometry;\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\n return this.defaults;\n\n const produceCutGeometry = style.produceCutGeometry ? true : false;\n const colorizeIntersection = style.colorizeIntersection ? true : false;\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\n\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\n }\n\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const produceCutGeometry = props.produceCutGeometry ?? false;\n const colorizeIntersection = props.colorizeIntersection ? true : false;\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\n\n return this.create({produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle});\n }\n\n return this.defaults;\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: ClipStyleProps = {};\n if (this.produceCutGeometry)\n props.produceCutGeometry = true;\n\n if (this.colorizeIntersection)\n props.colorizeIntersection = true;\n\n const cutStyle = this.cutStyle.toJSON();\n if (cutStyle) {\n assert(!this.cutStyle.matchesDefaults);\n props.cutStyle = cutStyle;\n }\n\n if (this.insideColor)\n props.insideColor = this.insideColor.toJSON();\n\n if (this.outsideColor)\n props.outsideColor = this.outsideColor.toJSON();\n\n if (this.intersectionStyle)\n props.intersectionStyle = this.intersectionStyle.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\n public get matchesDefaults(): boolean {\n if (this === ClipStyle.defaults)\n return true;\n\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAA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AAmB,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,kBAAkB;YACzB,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAElC,IAAI,IAAI,CAAC,oBAAoB;YAC3B,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;YACvC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC5B,CAAC;QAED,IAAI,IAAI,CAAC,WAAW;YAClB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAEhD,IAAI,IAAI,CAAC,YAAY;YACnB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAElD,IAAI,IAAI,CAAC,iBAAiB;YACxB,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAE5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uHAAuH;IACvH,IAAW,eAAe;QACxB,IAAI,IAAI,KAAK,SAAS,CAAC,QAAQ;YAC7B,OAAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { ViewFlagOverrides } from \"./ViewFlags\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { HiddenLine } from \"./HiddenLine\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\n * @see [[ClipStyleProps.cutStyle]].\n * @public\n * @extensions\n */\nexport interface CutStyleProps {\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\n viewflags?: ViewFlagOverrides;\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\n hiddenLine?: HiddenLine.SettingsProps;\n /** If defined, overrides aspects of the cut geometry's symbology. */\n appearance?: FeatureAppearanceProps;\n}\n\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\n * @public\n */\nexport class CutStyle {\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\n public readonly viewflags: Readonly<ViewFlagOverrides>;\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\n public readonly hiddenLine?: HiddenLine.Settings;\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\n public readonly appearance?: FeatureAppearance;\n\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\n public static readonly defaults = new CutStyle();\n\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\n this.viewflags = viewflags ?? {};\n if (hiddenLine && !hiddenLine.matchesDefaults)\n this.hiddenLine = hiddenLine;\n\n if (appearance && !appearance.matchesDefaults)\n this.appearance = appearance;\n }\n\n /** Create a CutStyle from its components. */\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\n return new CutStyle(viewflags, hiddenLine, appearance);\n\n return this.defaults;\n }\n\n public static fromJSON(props?: CutStyleProps): CutStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const viewflags = { ...props?.viewflags };\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\n\n return this.create(viewflags, hiddenLine, appearance);\n } else {\n return this.defaults;\n }\n }\n\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\n public toJSON(): CutStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: CutStyleProps = {};\n if (JsonUtils.isNonEmptyObject(this.viewflags))\n props.viewflags = this.viewflags;\n\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\n props.hiddenLine = this.hiddenLine?.toJSON();\n\n if (this.appearance && !this.appearance.matchesDefaults)\n props.appearance = this.appearance.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\n public get matchesDefaults(): boolean {\n if (this === CutStyle.defaults)\n return true;\n\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\n }\n}\n\n/** Wire format describing a [[ClipIntersectionStyle]].\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\n * @public\n * @extensions\n */\nexport interface ClipIntersectionStyleProps {\n /** Color to apply to intersection of geometry and clip planes, default white */\n color?: RgbColorProps;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n width?: number;\n}\n\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\n * @public\n * @extensions\n */\nexport class ClipIntersectionStyle {\n /** Color to apply to intersection of geometry and clip planes, default white */\n public readonly color: RgbColor;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n public readonly width: number;\n\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\n this.color = color;\n this.width = width;\n }\n /** Create a highlight from its components. */\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\n if (!color && !width)\n return this.defaults;\n\n return new ClipIntersectionStyle(color, width);\n }\n\n public static readonly defaults = new ClipIntersectionStyle();\n\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\n if (props === undefined) {\n return ClipIntersectionStyle.defaults;\n }\n\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\n const width = props.width ? props.width : 1;\n return new ClipIntersectionStyle(color, width);\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipIntersectionStyleProps | undefined {\n const props: ClipIntersectionStyleProps = {};\n\n if (this.matchesDefaults) {\n return undefined;\n }\n\n if (this.color)\n props.color = this.color.toJSON();\n\n if (this.width)\n props.width = this.width;\n\n return props;\n }\n\n public get matchesDefaults(): boolean {\n if (this === ClipIntersectionStyle.defaults)\n return true;\n\n return !this.color && !this.width;\n }\n}\n\n/** Arguments supplied to [[ClipStyle.create]].\n * @public\n * @extensions\n */\nexport interface ClipStyleCreateArgs {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If `true`, intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyle;\n}\n\n/** Wire format describing a [[ClipStyle]].\n * @see [[DisplayStyleSettingsProps.clipStyle]].\n * @public\n * @extensions\n */\nexport interface ClipStyleProps {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyleProps;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColorProps;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColorProps;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyleProps;\n}\n\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\n * @see [[DisplayStyleSettings.clipStyle]].\n * @public\n */\nexport class ClipStyle {\n /** If `true`, geometry will be produced at the clip planes.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n public readonly produceCutGeometry: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n public readonly colorizeIntersection: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n public readonly cutStyle: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n public readonly insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n public readonly outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n public readonly intersectionStyle?: ClipIntersectionStyle;\n\n /** The default style, which overrides none of the view's settings. */\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\n\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\n this.produceCutGeometry = produceCutGeometry;\n this.colorizeIntersection = colorizeIntersection;\n this.cutStyle = cutStyle;\n this.insideColor = inside;\n this.outsideColor = outside;\n this.intersectionStyle = intersectionStyle;\n }\n\n /** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\n\n /** Create a style from its components. */\n public static create(style: ClipStyleCreateArgs): ClipStyle;\n\n /** @internal */\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\n\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\n\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\n return this.defaults;\n }\n\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\n }\n\n const style = styleOrProduceCutGeometry;\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\n return this.defaults;\n\n const produceCutGeometry = style.produceCutGeometry ? true : false;\n const colorizeIntersection = style.colorizeIntersection ? true : false;\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\n\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\n }\n\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const produceCutGeometry = props.produceCutGeometry ?? false;\n const colorizeIntersection = props.colorizeIntersection ? true : false;\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\n\n return this.create({produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle});\n }\n\n return this.defaults;\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: ClipStyleProps = {};\n if (this.produceCutGeometry)\n props.produceCutGeometry = true;\n\n if (this.colorizeIntersection)\n props.colorizeIntersection = true;\n\n const cutStyle = this.cutStyle.toJSON();\n if (cutStyle) {\n assert(!this.cutStyle.matchesDefaults);\n props.cutStyle = cutStyle;\n }\n\n if (this.insideColor)\n props.insideColor = this.insideColor.toJSON();\n\n if (this.outsideColor)\n props.outsideColor = this.outsideColor.toJSON();\n\n if (this.intersectionStyle)\n props.intersectionStyle = this.intersectionStyle.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\n public get matchesDefaults(): boolean {\n if (this === ClipStyle.defaults)\n return true;\n\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\n }\n}\n"]}
|
package/lib/esm/Code.js
CHANGED
|
@@ -11,11 +11,16 @@ import { Id64, JsonUtils } from "@itwin/core-bentley";
|
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
13
|
export class Code {
|
|
14
|
+
/** The id of the [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec) of the Element */
|
|
15
|
+
spec;
|
|
16
|
+
/** The [CodeScope]($docs/bis/guide/fundamentals/codes.md#codescope-property) of the Element */
|
|
17
|
+
scope;
|
|
14
18
|
/** The [CodeValue]($docs/bis/guide/fundamentals/codes.md#codevalue-property) of the Element
|
|
15
19
|
* @note Leading and trailing whitespace is invalid so is automatically trimmed.
|
|
16
20
|
*/
|
|
17
21
|
get value() { return this._value ?? ""; }
|
|
18
22
|
set value(val) { this._value = val?.trim(); }
|
|
23
|
+
_value;
|
|
19
24
|
constructor(codeProps) {
|
|
20
25
|
this.spec = Id64.fromJSON(codeProps.spec);
|
|
21
26
|
this.scope = JsonUtils.asString(codeProps.scope);
|
|
@@ -219,6 +224,17 @@ export var CodeScopeSpec;
|
|
|
219
224
|
* @public
|
|
220
225
|
*/
|
|
221
226
|
export class CodeSpec {
|
|
227
|
+
/** The iModel holding this CodeSpec. */
|
|
228
|
+
iModel;
|
|
229
|
+
/** The id of this CodeSpec. */
|
|
230
|
+
id;
|
|
231
|
+
/** The name of this CodeSpec. */
|
|
232
|
+
name;
|
|
233
|
+
/** The JSON properties for this CodeSpec.
|
|
234
|
+
* @note Use the getters and setters instead of accessing this directly.
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
properties;
|
|
222
238
|
constructor(iModel, id, name, properties) {
|
|
223
239
|
this.iModel = iModel;
|
|
224
240
|
this.id = id;
|