@itwin/core-common 4.0.0-dev.59 → 4.0.0-dev.60
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.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackendTypes.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/Render.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.d.ts +9 -2
- package/lib/cjs/RpcInterface.d.ts.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.d.ts +2 -2
- package/lib/cjs/RpcManager.js +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/Snapping.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.d.ts +6 -0
- package/lib/cjs/TileProps.d.ts.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/core-common.d.ts +8 -10
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +8 -10
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +3 -15
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +2 -20
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts +3 -3
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +3 -3
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.d.ts +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.d.ts +10 -8
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.d.ts.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +7 -4
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackendTypes.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/Render.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.d.ts +9 -2
- package/lib/esm/RpcInterface.d.ts.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.d.ts +2 -2
- package/lib/esm/RpcManager.js +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/Snapping.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.d.ts +6 -0
- package/lib/esm/TileProps.d.ts.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/core-common.d.ts +8 -10
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +8 -10
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts +3 -15
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +2 -20
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.d.ts +3 -3
- package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +3 -3
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.d.ts +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.d.ts +10 -8
- package/lib/esm/rpc/web/BentleyCloudRpcManager.d.ts.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js +7 -4
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +6 -6
- package/lib/cjs/CloudStorage.d.ts +0 -63
- package/lib/cjs/CloudStorage.d.ts.map +0 -1
- package/lib/cjs/CloudStorage.js +0 -114
- package/lib/cjs/CloudStorage.js.map +0 -1
- package/lib/cjs/CloudStorageTileCache.d.ts +0 -28
- package/lib/cjs/CloudStorageTileCache.d.ts.map +0 -1
- package/lib/cjs/CloudStorageTileCache.js +0 -66
- package/lib/cjs/CloudStorageTileCache.js.map +0 -1
- package/lib/esm/CloudStorage.d.ts +0 -63
- package/lib/esm/CloudStorage.d.ts.map +0 -1
- package/lib/esm/CloudStorage.js +0 -110
- package/lib/esm/CloudStorage.js.map +0 -1
- package/lib/esm/CloudStorageTileCache.d.ts +0 -28
- package/lib/esm/CloudStorageTileCache.d.ts.map +0 -1
- package/lib/esm/CloudStorageTileCache.js +0 -62
- package/lib/esm/CloudStorageTileCache.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageGraphic.js","sourceRoot":"","sources":["../../../src/geometry/ImageGraphic.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA6E;AAsB7E;;;;;;;;;;GAUG;AACH,MAAa,mBAAmB;IAM9B,YAAmB,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW;QACnE,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAA+B;QACpD,OAAO,IAAI,mBAAmB,CAAC,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC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E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF;AA/DD,oCA+DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ImageGraphic.js","sourceRoot":"","sources":["../../../src/geometry/ImageGraphic.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA6E;AAsB7E;;;;;;;;;;GAUG;AACH,MAAa,mBAAmB;IAM9B,YAAmB,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW;QACnE,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAA+B;QACpD,OAAO,IAAI,mBAAmB,CAAC,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjJ,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,MAA4C;QACpE,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAE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AAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM;QACX,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC9B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,MAAgB;QAClC,IAAI,SAAS,KAAK,MAAM;YACtB,MAAM,GAAG,IAAI,uBAAO,EAAE,CAAC;;YAEvB,MAAM,CAAC,OAAO,EAAE,CAAC;QAEnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,6DAA6D;IACtD,gBAAgB,CAAC,SAAoB;QAC1C,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF;AA/DD,oCA+DC","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 Geometry\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d, Range3d, Transform, XYZProps } from \"@itwin/core-geometry\";\n\n/** JSON representation of the 4 corners of an [[ImageGraphicProps]]. @see [[ImageGraphicCorners]].\n * @public\n * @extensions\n */\nexport type ImageGraphicCornersProps = [XYZProps, XYZProps, XYZProps, XYZProps];\n\n/** JSON representation of an [[ImageGraphic]].\n * @see [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport interface ImageGraphicProps {\n /** The 4 corners of defining the quadrilateral on which the image is displayed. */\n corners: ImageGraphicCornersProps;\n /** The Id of the persistent [[Texture]] element defining the image to be displayed on the quadrilateral. */\n textureId: Id64String;\n /** Whether or not to draw a border around the image. */\n hasBorder: boolean;\n}\n\n/** Defines the 4 corners of an [[ImageGraphic]]. The points are expected to lie in a single plane and define a (possibly-skewed) quadrilateral.\n * The points map to the corners of the image as follows:\n * `\n * 3____2\n * | |\n * |____|\n * 0 1\n * `\n * The image can be flipped and/or rotated by specifying the points in a different order.\n * @public\n */\nexport class ImageGraphicCorners {\n public readonly 0: Point3d;\n public readonly 1: Point3d;\n public readonly 2: Point3d;\n public readonly 3: Point3d;\n\n public constructor(p0: Point3d, p1: Point3d, p2: Point3d, p3: Point3d) {\n this[0] = p0;\n this[1] = p1;\n this[2] = p2;\n this[3] = p3;\n }\n\n public static fromJSON(props: ImageGraphicCornersProps): ImageGraphicCorners {\n return new ImageGraphicCorners(Point3d.fromJSON(props[0]), Point3d.fromJSON(props[1]), Point3d.fromJSON(props[2]), Point3d.fromJSON(props[3]));\n }\n\n public static from4Points(points: [Point3d, Point3d, Point3d, Point3d]): ImageGraphicCorners {\n return new ImageGraphicCorners(points[0], points[1], points[2], points[3]);\n }\n\n public clone(): ImageGraphicCorners {\n return new ImageGraphicCorners(this[0].clone(), this[1].clone(), this[2].clone(), this[3].clone());\n }\n\n public toJSON(): ImageGraphicCornersProps {\n return [this[0].toJSON(), this[1].toJSON(), this[2].toJSON(), this[3].toJSON()];\n }\n}\n\n/** A geometric primitive that displays an image mapped to the corners of a quadrilateral, with an optional border.\n * The image is always displayed regardless of [[RenderMode]] or [[ViewFlags]], and is displayed without lighting.\n * @public\n */\nexport class ImageGraphic {\n /** The 4 corners of defining the quadrilateral on which the image is displayed. */\n public readonly corners: ImageGraphicCorners;\n /** The Id of the persistent [[Texture]] element defining the image to be displayed on the quadrilateral. */\n public readonly textureId: Id64String;\n /** Whether or not to draw a border around the image. */\n public readonly hasBorder: boolean;\n\n /** Construct a new ImageGraphic.\n * @param corners Defines the 4 corners of the quadrilateral on which the image is to be displayed. The ImageGraphic takes ownership of this input.\n * @param textureId Identifies a persistent [[Texture]] element defining the image to be mapped onto the quadrilateral.\n * @param hasBorder Whether or not to display a border around the image.\n */\n public constructor(corners: ImageGraphicCorners, textureId: Id64String, hasBorder = false) {\n this.corners = corners;\n this.textureId = textureId;\n this.hasBorder = hasBorder;\n }\n\n public static fromJSON(props: ImageGraphicProps): ImageGraphic {\n const corners = ImageGraphicCorners.fromJSON(props.corners);\n return new ImageGraphic(corners, props.textureId, props.hasBorder);\n }\n\n public clone(): ImageGraphic {\n return new ImageGraphic(this.corners.clone(), this.textureId, this.hasBorder);\n }\n\n public cloneTransformed(transform: Transform): ImageGraphic {\n const clone = this.clone();\n clone.transformInPlace(transform);\n return clone;\n }\n\n public toJSON(): ImageGraphicProps {\n return {\n corners: this.corners.toJSON(),\n textureId: this.textureId,\n hasBorder: this.hasBorder,\n };\n }\n\n /** Computes and returns the range.\n * @param result If supplied, will be modified to hold the computed range and returned.\n * @returns The computed range.\n */\n public computeRange(result?: Range3d): Range3d {\n if (undefined === result)\n result = new Range3d();\n else\n result.setNull();\n\n result.extend(this.corners[0], this.corners[1], this.corners[2], this.corners[3]);\n return result;\n }\n\n /** Apply a transform to the corners of the quadrilateral. */\n public transformInPlace(transform: Transform): void {\n transform.multiplyPoint3d(this.corners[0], this.corners[0]);\n transform.multiplyPoint3d(this.corners[1], this.corners[1]);\n transform.multiplyPoint3d(this.corners[2], this.corners[2]);\n transform.multiplyPoint3d(this.corners[3], this.corners[3]);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA4G;AAE5G,cAAc;AACd,IAAiB,SAAS,CAoLzB;AApLD,WAAiB,SAAS;IAkCxB,2DAA2D;IAC3D,MAAa,QAAQ;QAcnB,yCAAyC;QACzC,YAAY,KAAoB;YAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;YACrC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;YACrC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;YACzC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,wBAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACzE,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CA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AAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;gBAChC,OAAO,KAAK,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC;gBAClE,OAAO,KAAK,CAAC;YACf,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IA1BY,cAAI,OA0BhB,CAAA;AACH,CAAC,EApLgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAoLzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Symbology\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\r\n\r\n/** @public */\r\nexport namespace LineStyle {\r\n\r\n /** Modify the line style appearance without changing the line style definition.\r\n * Applies to the style previously established by a [[GeometryAppearanceProps]] or current [[SubCategoryAppearance]].\r\n * Most of the modifiers affect the line style stroke pattern, with the orientation and scales being the exception.\r\n * @see [[GeometryStreamEntryProps]]\r\n */\r\n export interface ModifierProps {\r\n /** Optional scale to apply to all length values, 1.0 if undefined */\r\n scale?: number;\r\n /** Optional scale to apply to scalable dashes, 1.0 if undefined */\r\n dashScale?: number;\r\n /** Optional scale to apply to scalable gaps, 1.0 if undefined */\r\n gapScale?: number;\r\n /** Optional start width in meters to apply to dashes, no width if undefined */\r\n startWidth?: number;\r\n /** Optional end width in meters to apply to dashes, same as startWidth if undefined */\r\n endWidth?: number;\r\n /** Optional shift by distance in meters, 0.0 if undefined */\r\n distPhase?: number;\r\n /** Optional shift by fraction, 0.0 if undefined */\r\n fractPhase?: number;\r\n /** Optional flag to center stroke pattern and stretch ends, false if undefined */\r\n centerPhase?: boolean;\r\n /** Optional flag to enable or disable single segment mode */\r\n segmentMode?: boolean;\r\n /** Optional flag that denotes startWidth and endWidth represent physical widths that should not be affected by scale, false if undefined */\r\n physicalWidth?: boolean;\r\n /** Optional up vector for style (applicable to 3d only), 0.0,0.0,1.0 if undefined */\r\n normal?: XYZProps;\r\n /** Optional orientation for style (applicable to 3d only), 0.0,0.0,0.0 if undefined */\r\n rotation?: YawPitchRollProps;\r\n }\r\n\r\n /** Optional modifiers to override line style definition */\r\n export class Modifier implements ModifierProps {\r\n public scale?: number;\r\n public dashScale?: number;\r\n public gapScale?: number;\r\n public startWidth?: number;\r\n public endWidth?: number;\r\n public distPhase?: number;\r\n public fractPhase?: number;\r\n public centerPhase?: boolean;\r\n public segmentMode?: boolean;\r\n public physicalWidth?: boolean;\r\n public normal?: Vector3d;\r\n public rotation?: YawPitchRollAngles;\r\n\r\n /** constructor for LineStyle.Modifier */\r\n constructor(props: ModifierProps) {\r\n this.scale = props.scale;\r\n this.dashScale = props.dashScale;\r\n this.gapScale = props.gapScale;\r\n this.startWidth = props.startWidth;\r\n this.endWidth = props.endWidth;\r\n this.distPhase = props.distPhase;\r\n this.fractPhase = props.fractPhase;\r\n this.centerPhase = props.centerPhase;\r\n this.segmentMode = props.segmentMode;\r\n this.physicalWidth = props.physicalWidth;\r\n this.normal = props.normal ? Vector3d.fromJSON(props.normal) : undefined;\r\n this.rotation = props.rotation ? YawPitchRollAngles.fromJSON(props.rotation) : undefined;\r\n }\r\n\r\n /** Returns a deep copy of this object. */\r\n public clone() {\r\n return new Modifier(this);\r\n }\r\n\r\n /** Compare two LineStyle.Modifier for equivalence */\r\n public equals(other: Modifier): boolean {\r\n if (this === other) // same pointer\r\n return true;\r\n\r\n if (other.scale !== this.scale ||\r\n other.dashScale !== this.dashScale ||\r\n other.gapScale !== this.gapScale ||\r\n other.startWidth !== this.startWidth ||\r\n other.endWidth !== this.endWidth ||\r\n other.distPhase !== this.distPhase ||\r\n other.fractPhase !== this.fractPhase ||\r\n other.centerPhase !== this.centerPhase ||\r\n other.segmentMode !== this.segmentMode ||\r\n other.physicalWidth !== this.physicalWidth)\r\n return false;\r\n\r\n if ((this.normal === undefined) !== (other.normal === undefined))\r\n return false;\r\n if (this.normal && !this.normal.isAlmostEqual(other.normal!))\r\n return false;\r\n\r\n if ((this.rotation === undefined) !== (other.rotation === undefined))\r\n return false;\r\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n public applyTransform(transform: Transform): boolean {\r\n if (transform.isIdentity)\r\n return true;\r\n if (this.normal) {\r\n transform.matrix.multiplyVector(this.normal, this.normal);\r\n const normalized = this.normal.normalize();\r\n if (normalized)\r\n this.normal.setFrom(normalized);\r\n else\r\n return false;\r\n }\r\n if (this.rotation) {\r\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\r\n const scales = new Vector3d();\r\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\r\n return false;\r\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\r\n if (undefined === newRotation)\r\n return false;\r\n this.rotation.setFrom(newRotation);\r\n }\r\n\r\n let scaleFactor;\r\n const scaleVector = Vector3d.create();\r\n const scaleMatrix = transform.matrix;\r\n scaleMatrix.normalizeRowsInPlace(scaleVector);\r\n\r\n // Check for flatten transform, dividing scaleVector by 3 gives wrong scaleFactor\r\n if (scaleVector.x !== 0.0 && scaleVector.y !== 0.0 && scaleVector.z !== 0.0)\r\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 3.0;\r\n else\r\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 2.0;\r\n\r\n if (1.0 === scaleFactor)\r\n return true;\r\n\r\n if (this.scale)\r\n this.scale *= scaleFactor;\r\n\r\n if (this.physicalWidth)\r\n return true;\r\n\r\n if (this.startWidth)\r\n this.startWidth *= scaleFactor;\r\n\r\n if (this.endWidth)\r\n this.endWidth *= scaleFactor;\r\n\r\n return true;\r\n }\r\n }\r\n\r\n /** Line style id and optional modifiers to override line style definition */\r\n export class Info {\r\n public styleId: Id64String;\r\n public styleMod?: Modifier; // Optional modifiers to override line style definition\r\n\r\n /** Creates a LineStyle.Info object */\r\n constructor(styleId: Id64String, styleMod?: Modifier) {\r\n this.styleId = styleId;\r\n this.styleMod = styleMod;\r\n }\r\n\r\n /** Returns a deep copy of this object. */\r\n public clone(): Info {\r\n return new Info(this.styleId, this.styleMod ? this.styleMod.clone() : undefined);\r\n }\r\n\r\n public equals(other: Info): boolean {\r\n if (this === other)\r\n return true;\r\n if (this.styleId !== other.styleId)\r\n return false;\r\n if ((this.styleMod === undefined) !== (other.styleMod === undefined))\r\n return false;\r\n if (this.styleMod && !this.styleMod.equals(other.styleMod!))\r\n return false;\r\n return true;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA4G;AAE5G,cAAc;AACd,IAAiB,SAAS,CAoLzB;AApLD,WAAiB,SAAS;IAkCxB,2DAA2D;IAC3D,MAAa,QAAQ;QAcnB,yCAAyC;QACzC,YAAY,KAAoB;YAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAA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;QACtC,YAAY,OAAmB,EAAE,QAAmB;YAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;QAED,0CAA0C;QACnC,KAAK;YACV,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACnF,CAAC;QAEM,MAAM,CAAC,KAAW;YACvB,IAAI,IAAI,KAAK,KAAK;gBAChB,OAAO,IAAI,CAAC;YACd,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;gBAChC,OAAO,KAAK,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC;gBAClE,OAAO,KAAK,CAAC;YACf,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IA1BY,cAAI,OA0BhB,CAAA;AACH,CAAC,EApLgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAoLzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Symbology\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\n\n/** @public */\nexport namespace LineStyle {\n\n /** Modify the line style appearance without changing the line style definition.\n * Applies to the style previously established by a [[GeometryAppearanceProps]] or current [[SubCategoryAppearance]].\n * Most of the modifiers affect the line style stroke pattern, with the orientation and scales being the exception.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface ModifierProps {\n /** Optional scale to apply to all length values, 1.0 if undefined */\n scale?: number;\n /** Optional scale to apply to scalable dashes, 1.0 if undefined */\n dashScale?: number;\n /** Optional scale to apply to scalable gaps, 1.0 if undefined */\n gapScale?: number;\n /** Optional start width in meters to apply to dashes, no width if undefined */\n startWidth?: number;\n /** Optional end width in meters to apply to dashes, same as startWidth if undefined */\n endWidth?: number;\n /** Optional shift by distance in meters, 0.0 if undefined */\n distPhase?: number;\n /** Optional shift by fraction, 0.0 if undefined */\n fractPhase?: number;\n /** Optional flag to center stroke pattern and stretch ends, false if undefined */\n centerPhase?: boolean;\n /** Optional flag to enable or disable single segment mode */\n segmentMode?: boolean;\n /** Optional flag that denotes startWidth and endWidth represent physical widths that should not be affected by scale, false if undefined */\n physicalWidth?: boolean;\n /** Optional up vector for style (applicable to 3d only), 0.0,0.0,1.0 if undefined */\n normal?: XYZProps;\n /** Optional orientation for style (applicable to 3d only), 0.0,0.0,0.0 if undefined */\n rotation?: YawPitchRollProps;\n }\n\n /** Optional modifiers to override line style definition */\n export class Modifier implements ModifierProps {\n public scale?: number;\n public dashScale?: number;\n public gapScale?: number;\n public startWidth?: number;\n public endWidth?: number;\n public distPhase?: number;\n public fractPhase?: number;\n public centerPhase?: boolean;\n public segmentMode?: boolean;\n public physicalWidth?: boolean;\n public normal?: Vector3d;\n public rotation?: YawPitchRollAngles;\n\n /** constructor for LineStyle.Modifier */\n constructor(props: ModifierProps) {\n this.scale = props.scale;\n this.dashScale = props.dashScale;\n this.gapScale = props.gapScale;\n this.startWidth = props.startWidth;\n this.endWidth = props.endWidth;\n this.distPhase = props.distPhase;\n this.fractPhase = props.fractPhase;\n this.centerPhase = props.centerPhase;\n this.segmentMode = props.segmentMode;\n this.physicalWidth = props.physicalWidth;\n this.normal = props.normal ? Vector3d.fromJSON(props.normal) : undefined;\n this.rotation = props.rotation ? YawPitchRollAngles.fromJSON(props.rotation) : undefined;\n }\n\n /** Returns a deep copy of this object. */\n public clone() {\n return new Modifier(this);\n }\n\n /** Compare two LineStyle.Modifier for equivalence */\n public equals(other: Modifier): boolean {\n if (this === other) // same pointer\n return true;\n\n if (other.scale !== this.scale ||\n other.dashScale !== this.dashScale ||\n other.gapScale !== this.gapScale ||\n other.startWidth !== this.startWidth ||\n other.endWidth !== this.endWidth ||\n other.distPhase !== this.distPhase ||\n other.fractPhase !== this.fractPhase ||\n other.centerPhase !== this.centerPhase ||\n other.segmentMode !== this.segmentMode ||\n other.physicalWidth !== this.physicalWidth)\n return false;\n\n if ((this.normal === undefined) !== (other.normal === undefined))\n return false;\n if (this.normal && !this.normal.isAlmostEqual(other.normal!))\n return false;\n\n if ((this.rotation === undefined) !== (other.rotation === undefined))\n return false;\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\n return false;\n\n return true;\n }\n\n public applyTransform(transform: Transform): boolean {\n if (transform.isIdentity)\n return true;\n if (this.normal) {\n transform.matrix.multiplyVector(this.normal, this.normal);\n const normalized = this.normal.normalize();\n if (normalized)\n this.normal.setFrom(normalized);\n else\n return false;\n }\n if (this.rotation) {\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\n const scales = new Vector3d();\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\n if (undefined === newRotation)\n return false;\n this.rotation.setFrom(newRotation);\n }\n\n let scaleFactor;\n const scaleVector = Vector3d.create();\n const scaleMatrix = transform.matrix;\n scaleMatrix.normalizeRowsInPlace(scaleVector);\n\n // Check for flatten transform, dividing scaleVector by 3 gives wrong scaleFactor\n if (scaleVector.x !== 0.0 && scaleVector.y !== 0.0 && scaleVector.z !== 0.0)\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 3.0;\n else\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 2.0;\n\n if (1.0 === scaleFactor)\n return true;\n\n if (this.scale)\n this.scale *= scaleFactor;\n\n if (this.physicalWidth)\n return true;\n\n if (this.startWidth)\n this.startWidth *= scaleFactor;\n\n if (this.endWidth)\n this.endWidth *= scaleFactor;\n\n return true;\n }\n }\n\n /** Line style id and optional modifiers to override line style definition */\n export class Info {\n public styleId: Id64String;\n public styleMod?: Modifier; // Optional modifiers to override line style definition\n\n /** Creates a LineStyle.Info object */\n constructor(styleId: Id64String, styleMod?: Modifier) {\n this.styleId = styleId;\n this.styleMod = styleMod;\n }\n\n /** Returns a deep copy of this object. */\n public clone(): Info {\n return new Info(this.styleId, this.styleMod ? this.styleMod.clone() : undefined);\n }\n\n public equals(other: Info): boolean {\n if (this === other)\n return true;\n if (this.styleId !== other.styleId)\n return false;\n if ((this.styleMod === undefined) !== (other.styleMod === undefined))\n return false;\n if (this.styleMod && !this.styleMod.equals(other.styleMod!))\n return false;\n return true;\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Placement.js","sourceRoot":"","sources":["../../../src/geometry/Placement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmD;AACnD,wDAE8B;AAE9B,wCAAqC;AACrC,gDAA6C;AAsC7C;;;GAGG;AACH,MAAa,WAAW;IACtB,YAA0B,MAAe,EAAS,MAA0B,EAAS,IAAyB;QAApF,WAAM,GAAN,MAAM,CAAS;QAAS,WAAM,GAAN,MAAM,CAAoB;QAAS,SAAI,GAAJ,IAAI,CAAqB;IAAI,CAAC;IACnH,sFAAsF;IACtF,IAAW,QAAQ,KAAe,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACpE,uFAAuF;IACvF,IAAW,SAAS,KAAgB,OAAO,yBAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzG,w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C,IAAI,CAAC,OAAO;YACf,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,uBAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEzE,2CAA2C;QAC3C,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACzB,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAE,GAAG,CAAC,CAAE,2CAA2C;QACjE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAgB;QACvC,MAAM,SAAS,GAAG,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,kCAAkB,CAAC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY;YACnF,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF;AA1DD,kCA0DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Constant, Matrix3d, Point2d, Point3d, Range2d, Range3d, Range3dProps, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\r\nimport { Frustum } from \"../Frustum\";\r\nimport { IModelError } from \"../IModelError\";\r\n\r\n/** A Range3d that is aligned with the axes of spatial coordinates.\r\n * @public\r\n * @extensions\r\n */\r\nexport type AxisAlignedBox3d = Range3d;\r\n\r\n/** The properties of a Range3d.\r\n * @public\r\n * @extensions\r\n */\r\nexport type AxisAlignedBox3dProps = Range3dProps;\r\n\r\n/** A bounding box aligned to the orientation of a 3d Element\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementAlignedBox3d = Range3d;\r\n\r\n/** A bounding box aligned to the orientation of a 2d Element\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementAlignedBox2d = Range2d;\r\n\r\n/** A bounding box aligned to a local coordinate system\r\n * @public\r\n * @extensions\r\n */\r\nexport type LocalAlignedBox3d = Range3d;\r\n\r\n/** Either a Placement2d or Placement3d\r\n * @public\r\n * @extensions\r\n */\r\nexport type Placement = Placement2d | Placement3d;\r\n\r\n/** The placement of a GeometricElement3d. This includes the origin, orientation, and size (bounding box) of the element.\r\n * All geometry of a GeometricElement are relative to its placement.\r\n * @public\r\n */\r\nexport class Placement3d implements Placement3dProps {\r\n public constructor(public origin: Point3d, public angles: YawPitchRollAngles, public bbox: ElementAlignedBox3d) { }\r\n /** Get the rotation from local coordinates of this placement to world coordinates. */\r\n public get rotation(): Matrix3d { return this.angles.toMatrix3d(); }\r\n /** Get the transform from local coordinates of this placement to world coordinates. */\r\n public get transform(): Transform { return Transform.createOriginAndMatrix(this.origin, this.rotation); }\r\n /** determine if this is 3d placement */\r\n public get is3d(): boolean { return true; }\r\n\r\n /** Create a new Placement3d from a Placement3dProps. */\r\n public static fromJSON(json?: Placement3dProps): Placement3d {\r\n const props: any = json ? json : {};\r\n return new Placement3d(Point3d.fromJSON(props.origin), YawPitchRollAngles.fromJSON(props.angles), Range3d.fromJSON<ElementAlignedBox3d>(props.bbox));\r\n }\r\n\r\n /** Get the 8 corners, in world coordinates, of this placement. */\r\n public getWorldCorners(out?: Frustum): Frustum {\r\n const frust = Frustum.fromRange(this.bbox, out);\r\n frust.multiply(this.transform);\r\n return frust;\r\n }\r\n\r\n /** Set the contents of this Placement3d from another Placement3d */\r\n public setFrom(other: Placement3d) {\r\n this.origin.setFrom(other.origin);\r\n this.angles.setFrom(other.angles);\r\n this.bbox.setFrom(other.bbox);\r\n }\r\n\r\n /** Determine whether this Placement3d is valid. */\r\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\r\n\r\n /** Calculate the axis-aligned bounding box for this placement. */\r\n public calculateRange(): AxisAlignedBox3d {\r\n const range = new Range3d();\r\n if (!this.isValid)\r\n return range;\r\n\r\n this.transform.multiplyRange(this.bbox, range);\r\n\r\n // low and high are not allowed to be equal\r\n range.ensureMinLengths();\r\n return range;\r\n }\r\n\r\n /** Multiply the Transform of this Placement3d by the specified *other* Transform.\r\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement3d.\r\n */\r\n public multiplyTransform(other: Transform): void {\r\n const transform = other.multiplyTransformTransform(this.transform);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\r\n if (undefined === angles)\r\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\r\n\r\n this.angles = angles;\r\n this.origin.setFrom(transform.origin);\r\n }\r\n}\r\n\r\n/** The placement of a GeometricElement2d. This includes the origin, rotation, and size (bounding box) of the element.\r\n * @public\r\n */\r\nexport class Placement2d implements Placement2dProps {\r\n public constructor(public origin: Point2d, public angle: Angle, public bbox: ElementAlignedBox2d) { }\r\n /** Get the rotation from local coordinates of this placement to world coordinates. */\r\n public get rotation(): Matrix3d { return Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)!; }\r\n /** Get the transform from local coordinates of this placement to world coordinates. */\r\n public get transform(): Transform { return Transform.createOriginAndMatrix(Point3d.createFrom(this.origin), this.rotation); }\r\n /** Create a new Placement2d from a Placement2dProps. */\r\n public static fromJSON(json?: Placement2dProps): Placement2d {\r\n const props: any = json ? json : {};\r\n return new Placement2d(Point2d.fromJSON(props.origin), Angle.fromJSON(props.angle), Range2d.fromJSON(props.bbox));\r\n }\r\n /** determine if this is 3d placement */\r\n public get is3d(): boolean { return false; }\r\n\r\n /** Get the 8 corners, in world coordinates, of this placement. */\r\n public getWorldCorners(out?: Frustum): Frustum {\r\n const frust = Frustum.fromRange(this.bbox, out);\r\n frust.multiply(this.transform);\r\n return frust;\r\n }\r\n\r\n /** Determine whether this Placement2d is valid. */\r\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\r\n\r\n /** Set the contents of this Placement2d from another Placement2d */\r\n public setFrom(other: Placement2d) {\r\n this.origin.setFrom(other.origin);\r\n this.angle.setFrom(other.angle);\r\n this.bbox.setFrom(other.bbox);\r\n }\r\n\r\n /** Calculate the axis-aligned bounding box for this placement. */\r\n public calculateRange(): AxisAlignedBox3d {\r\n const range = new Range3d();\r\n if (!this.isValid)\r\n return range;\r\n\r\n this.transform.multiplyRange(Range3d.createRange2d(this.bbox, 0), range);\r\n\r\n // low and high are not allowed to be equal\r\n range.ensureMinLengths();\r\n range.low.z = - 1.0; // is the 2dFrustumDepth, which === 1 meter\r\n range.high.z = 1.0;\r\n return range;\r\n }\r\n\r\n /** Multiply the Transform of this Placement2d by the specified *other* Transform.\r\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement2d.\r\n */\r\n public multiplyTransform(other: Transform): void {\r\n const transform = other.multiplyTransformTransform(this.transform);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\r\n if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)\r\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\r\n\r\n this.angle = angles.yaw;\r\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C,CAAC;QACvE,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY;YACnF,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF;AA1DD,kCA0DC","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 Geometry\n */\n\nimport { IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, Constant, Matrix3d, Point2d, Point3d, Range2d, Range3d, Range3dProps, Transform, Vector3d, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\nimport { Frustum } from \"../Frustum\";\nimport { IModelError } from \"../IModelError\";\n\n/** A Range3d that is aligned with the axes of spatial coordinates.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3d = Range3d;\n\n/** The properties of a Range3d.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3dProps = Range3dProps;\n\n/** A bounding box aligned to the orientation of a 3d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox3d = Range3d;\n\n/** A bounding box aligned to the orientation of a 2d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox2d = Range2d;\n\n/** A bounding box aligned to a local coordinate system\n * @public\n * @extensions\n */\nexport type LocalAlignedBox3d = Range3d;\n\n/** Either a Placement2d or Placement3d\n * @public\n * @extensions\n */\nexport type Placement = Placement2d | Placement3d;\n\n/** The placement of a GeometricElement3d. This includes the origin, orientation, and size (bounding box) of the element.\n * All geometry of a GeometricElement are relative to its placement.\n * @public\n */\nexport class Placement3d implements Placement3dProps {\n public constructor(public origin: Point3d, public angles: YawPitchRollAngles, public bbox: ElementAlignedBox3d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return this.angles.toMatrix3d(); }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(this.origin, this.rotation); }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return true; }\n\n /** Create a new Placement3d from a Placement3dProps. */\n public static fromJSON(json?: Placement3dProps): Placement3d {\n const props: any = json ? json : {};\n return new Placement3d(Point3d.fromJSON(props.origin), YawPitchRollAngles.fromJSON(props.angles), Range3d.fromJSON<ElementAlignedBox3d>(props.bbox));\n }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Set the contents of this Placement3d from another Placement3d */\n public setFrom(other: Placement3d) {\n this.origin.setFrom(other.origin);\n this.angles.setFrom(other.angles);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Determine whether this Placement3d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(this.bbox, range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n return range;\n }\n\n /** Multiply the Transform of this Placement3d by the specified *other* Transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement3d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if (undefined === angles)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angles = angles;\n this.origin.setFrom(transform.origin);\n }\n}\n\n/** The placement of a GeometricElement2d. This includes the origin, rotation, and size (bounding box) of the element.\n * @public\n */\nexport class Placement2d implements Placement2dProps {\n public constructor(public origin: Point2d, public angle: Angle, public bbox: ElementAlignedBox2d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)!; }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(Point3d.createFrom(this.origin), this.rotation); }\n /** Create a new Placement2d from a Placement2dProps. */\n public static fromJSON(json?: Placement2dProps): Placement2d {\n const props: any = json ? json : {};\n return new Placement2d(Point2d.fromJSON(props.origin), Angle.fromJSON(props.angle), Range2d.fromJSON(props.bbox));\n }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return false; }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Determine whether this Placement2d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Set the contents of this Placement2d from another Placement2d */\n public setFrom(other: Placement2d) {\n this.origin.setFrom(other.origin);\n this.angle.setFrom(other.angle);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(Range3d.createRange2d(this.bbox, 0), range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n range.low.z = - 1.0; // is the 2dFrustumDepth, which === 1 meter\n range.high.z = 1.0;\n return range;\n }\n\n /** Multiply the Transform of this Placement2d by the specified *other* Transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement2d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angle = angles.yaw;\n this.origin.setFrom(transform.origin);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Projection.js","sourceRoot":"","sources":["../../../src/geometry/Projection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,yHAAyH;;;AAEzH,wDAAgD;AAmFhD;;;;;GAKG;AACH,MAAa,eAAe;IAc1B,YAAY,IAA2B;QACrC,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;SACnB;IACH,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA0B;QAC/C,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IAClI,CAAC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KAAqB;QACjC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,wBAAQ,CAAC,iBAAiB;YAC3E,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,wBAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7E,CAAC;CACF;AAtCD,wCAsCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n// cspell:ignore Albers, Krovak, OSTN, Cassini, Grinten, Mollweide, Eckert, Homolosine, Carree, Winkel, Tripel, Polyconic\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\n\r\n/** This enum contains the list of all projection methods that can be represented as part of the HorizontalCRS\r\n * class. The None method indicates there is no projection and thus the CRS is longitude/latitude based\r\n * with units as degrees.\r\n * All other projection indicated a projected CRS.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ProjectionMethod =\r\n \"None\" |\r\n \"TransverseMercator\" |\r\n \"SouthOrientedTransverseMercator\" |\r\n \"TransverseMercatorWisconsin\" |\r\n \"TransverseMercatorMinnesota\" |\r\n \"TransverseMercatorAffine\" |\r\n \"MercatorStandardParallel\" |\r\n \"Mercator\" |\r\n \"UniversalTransverseMercator\" |\r\n \"LambertConformalConicTwoParallels\" |\r\n \"LambertConformalConicBelgium\" |\r\n \"LambertConformalConicAffine\" |\r\n \"LambertConformalConicWisconsin\" |\r\n \"LambertConformalConicMinnesota\" |\r\n \"LambertConformalConicMichigan\" |\r\n \"LambertConformalConicOneParallel\" |\r\n \"AlbersEqualArea\" |\r\n \"NewZealandNationalGrid\" |\r\n \"ObliqueMercator1\" |\r\n \"ObliqueMercator2\" |\r\n \"TransverseMercatorOSTN97\" |\r\n \"TransverseMercatorOSTN02\" |\r\n \"TransverseMercatorOSTN15\" |\r\n \"Krovak\" |\r\n \"KrovakModified\" |\r\n \"ObliqueCylindricalSwiss\" |\r\n \"TransverseMercatorDenmarkSystem34\" |\r\n \"TransverseMercatorDenmarkSystem3499\" |\r\n \"TransverseMercatorDenmarkSystem3401\" |\r\n \"Cassini\" |\r\n \"Sinusoidal\" |\r\n \"VanDerGrinten\" |\r\n \"Bonne\" |\r\n \"Mollweide\" |\r\n \"EckertIV\" |\r\n \"EckertVI\" |\r\n \"GoodeHomolosine\" |\r\n \"Robinson\" |\r\n \"PlateCarree\" |\r\n \"MillerCylindrical\" |\r\n \"WinkelTripel\" |\r\n \"AzimuthalEqualArea\" |\r\n \"ObliqueStereographic\" |\r\n \"RectifiedSkewOrthomorphicCentered\" |\r\n \"RectifiedSkewOrthomorphicOrigin\" |\r\n \"ObliqueCylindricalHungary\" |\r\n \"Orthographic\" |\r\n \"AmericanPolyconic\" |\r\n \"LambertEquidistantAzimuthal\" |\r\n \"ObliqueMercatorMinnesota\";\r\n\r\n/** The equations are:\r\n * X1 = a1*X + a2*Y + TranslationX\r\n * Y1 = b1*X + b2*Y + translationY\r\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AffineTransformProps {\r\n /** The X post translation */\r\n translationX: number;\r\n /** The Y post-translation */\r\n translationY: number;\r\n /** A1 value as defined in global comment. */\r\n a1: number;\r\n /** B1 value as defined in global comment. */\r\n b1: number;\r\n /** A2 value as defined in global comment. */\r\n a2: number;\r\n /** B2 value as defined in global comment. */\r\n b2: number;\r\n}\r\n\r\n/** The equations are:\r\n * X1 = a1*X + a2*Y + TranslationX\r\n * Y1 = b1*X + b2*Y + translationY\r\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\r\n * @public\r\n */\r\nexport class AffineTransform implements AffineTransformProps {\r\n /** The X post translation */\r\n public readonly translationX!: number;\r\n /** The Y post-translation */\r\n public readonly translationY!: number;\r\n /** A1 value as defined in global comment. */\r\n public readonly a1!: number;\r\n /** B1 value as defined in global comment. */\r\n public readonly b1!: number;\r\n /** A2 value as defined in global comment. */\r\n public readonly a2!: number;\r\n /** B2 value as defined in global comment. */\r\n public readonly b2!: number;\r\n\r\n constructor(data?: AffineTransformProps) {\r\n if (data) {\r\n this.translationX = data.translationX;\r\n this.translationY = data.translationY;\r\n this.a1 = data.a1;\r\n this.b1 = data.b1;\r\n this.a2 = data.a2;\r\n this.b2 = data.b2;\r\n }\r\n }\r\n\r\n /** Creates an Affine Transform from JSON representation.\r\n * @public */\r\n public static fromJSON(data: AffineTransformProps): AffineTransform {\r\n return new AffineTransform(data);\r\n }\r\n\r\n /** Creates a JSON from the Affine Transform definition\r\n * @public */\r\n public toJSON(): AffineTransformProps {\r\n return { translationX: this.translationX, a1: this.a1, a2: this.a2, translationY: this.translationY, b1: this.b1, b2: this.b2 };\r\n }\r\n\r\n /** Compares two Affine Transforms. It applies a minuscule tolerance for number compares\r\n * @public */\r\n public equals(other: AffineTransform): boolean {\r\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\r\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\r\n Math.abs(this.a1 - other.a1) < Geometry.smallFraction &&\r\n Math.abs(this.b1 - other.b1) < Geometry.smallFraction &&\r\n Math.abs(this.a2 - other.a2) < Geometry.smallFraction &&\r\n Math.abs(this.b2 - other.b2) < Geometry.smallFraction);\r\n }\r\n}\r\n\r\n/** Type used in the definition of UTM Zoning projection. This projection only requires a zone number and\r\n * the hemisphere North or South.\r\n * @public\r\n * @extensions\r\n */\r\nexport type HemisphereEnum = \"South\" | \"North\";\r\n\r\n/** The type to define the three zones of the Danish System 34 projections.\r\n * @public\r\n * @extensions\r\n */\r\nexport type DanishSystem34Region = \"Jylland\" | \"Sjaelland\" | \"Bornholm\";\r\n\r\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method\r\n * and a set of projection parameters specific to projection method selected.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ProjectionProps {\r\n /** The projection method. */\r\n method: ProjectionMethod;\r\n /** The False Easting of the projection. */\r\n falseEasting?: number;\r\n /** The False Northing of the projection. */\r\n falseNorthing?: number;\r\n /** The Central Meridian. */\r\n centralMeridian?: number;\r\n /** The latitude of origin of the projection. */\r\n latitudeOfOrigin?: number;\r\n /** Longitude of origin of the projection. */\r\n longitudeOfOrigin?: number;\r\n /** The scale reduction factor applied at origin. The nature of the projection has a\r\n * inherent scale factor applied that gradually varies outward from the projection origin.\r\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\r\n * For the michigan variation of the Lambert Conformal Conic projection it\r\n * can be used instead or in addition to Standard Parallel to define\r\n * a scale factor.\r\n */\r\n scaleFactor?: number;\r\n /** The elevation of the origin of the projection above the geoid. This value\r\n * allows compensation for the scale factor related to elevation above the sea level.\r\n */\r\n elevationAboveGeoid?: number;\r\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\r\n geoidSeparation?: number;\r\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\r\n affine?: AffineTransformProps;\r\n /** Standard parallel for projection that only use one.\r\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\r\n * which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\r\n * For conic projections (Lambert Tangential ...) it defines\r\n * the standard parallel at which the cone is tangent to the ellipsoid.\r\n */\r\n standardParallel?: number;\r\n /** The first standard parallel at which the cone crosses the ellipsoid. */\r\n standardParallel1?: number;\r\n /** The second standard parallel at which the cone crosses the ellipsoid. */\r\n standardParallel2?: number;\r\n /** The UTM zone number. A number from 0 to 60. */\r\n zoneNumber?: number;\r\n /** The hemisphere for Universal Transverse Mercator projection. */\r\n hemisphere?: HemisphereEnum;\r\n /** Longitude of the central point. */\r\n centralPointLongitude?: number;\r\n /** Latitude of the central point. */\r\n centralPointLatitude?: number;\r\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n point1Longitude?: number;\r\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n point1Latitude?: number;\r\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\r\n point2Longitude?: number;\r\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\r\n point2Latitude?: number;\r\n /** The Danish zone for Danish projections. */\r\n danishSystem34Region?: DanishSystem34Region;\r\n /** Azimuth. */\r\n azimuth?: number;\r\n}\r\n\r\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method and a set\r\n * of projection parameters specific to projection method selected to flatten the surface of the model of the Earth\r\n * defines as a geodetic ellipsoid. The flattening and the distortion angular, linear, scale from the process varies between methods.\r\n * Refer to appropriate external documentation for details.\r\n * @note Various property sets are required for specific projection methods. The current class implementation does not enforce\r\n * these rules yet and it is possible to define or not define any property regardless the method used.\r\n * @public\r\n */\r\nexport class Projection implements ProjectionProps {\r\n /** The projection method. */\r\n public readonly method!: ProjectionMethod;\r\n /** The False Easting of the projection. */\r\n public readonly falseEasting?: number;\r\n /** The False Northing of the projection. */\r\n public readonly falseNorthing?: number;\r\n /** The Central Meridian. */\r\n public readonly centralMeridian?: number;\r\n /** The latitude of origin of the projection. */\r\n public readonly latitudeOfOrigin?: number;\r\n /** Longitude of origin of the projection. */\r\n public readonly longitudeOfOrigin?: number;\r\n /** The scale reduction factor applied at origin. The nature of the projection has a\r\n * inherent scale factor applied that gradually varies outward from the projection origin.\r\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\r\n * For the michigan variation of the Lambert Conformal Conic projection it\r\n * can be used instead or in addition to Standard Parallel to define\r\n * a scale factor.\r\n */\r\n public readonly scaleFactor?: number;\r\n /** The elevation of the origin of the projection above the geoid. This value\r\n * allows compensation for the scale factor related to elevation above the sea level.\r\n */\r\n public readonly elevationAboveGeoid?: number;\r\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\r\n public readonly geoidSeparation?: number;\r\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\r\n public readonly affine?: AffineTransform;\r\n /** Standard parallel for projection that only use one.\r\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\r\n ** which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\r\n * For conic projections (Lambert Tangential ...) it defines\r\n * the standard parallel at which the cone is tangent to the ellipsoid.\r\n */\r\n public readonly standardParallel?: number;\r\n /** The first standard parallel at which the cone crosses the ellipsoid. */\r\n public readonly standardParallel1?: number;\r\n /** The second standard parallel at which the cone crosses the ellipsoid. */\r\n public readonly standardParallel2?: number;\r\n /** The UTM zone number. A number from 0 to 60. */\r\n public readonly zoneNumber?: number;\r\n /** The hemisphere for Universal Transverse Mercator projection. */\r\n public readonly hemisphere?: HemisphereEnum;\r\n /** Longitude of the central point. */\r\n public readonly centralPointLongitude?: number;\r\n /** Latitude of the central point. */\r\n public readonly centralPointLatitude?: number;\r\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n public readonly point1Longitude?: number;\r\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n public readonly point1Latitude?: number;\r\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\r\n public readonly point2Longitude?: number;\r\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\r\n public readonly point2Latitude?: number;\r\n /** The Danish zone for Danish projections. */\r\n public readonly danishSystem34Region?: DanishSystem34Region;\r\n /** Azimuth. */\r\n public readonly azimuth?: number;\r\n\r\n public constructor(_data?: ProjectionProps) {\r\n if (_data) {\r\n this.method = _data.method;\r\n this.falseEasting = _data.falseEasting;\r\n this.falseNorthing = _data.falseNorthing;\r\n this.centralMeridian = _data.centralMeridian;\r\n this.latitudeOfOrigin = _data.latitudeOfOrigin;\r\n this.longitudeOfOrigin = _data.longitudeOfOrigin;\r\n this.scaleFactor = _data.scaleFactor;\r\n this.elevationAboveGeoid = _data.elevationAboveGeoid;\r\n this.geoidSeparation = _data.geoidSeparation;\r\n this.affine = _data.affine ? AffineTransform.fromJSON(_data.affine) : undefined;\r\n this.standardParallel = _data.standardParallel;\r\n this.standardParallel1 = _data.standardParallel1;\r\n this.standardParallel2 = _data.standardParallel2;\r\n this.zoneNumber = _data.zoneNumber;\r\n this.hemisphere = _data.hemisphere;\r\n this.centralPointLongitude = _data.centralPointLongitude;\r\n this.centralPointLatitude = _data.centralPointLatitude;\r\n this.point1Longitude = _data.point1Longitude;\r\n this.point1Latitude = _data.point1Latitude;\r\n this.point2Longitude = _data.point2Longitude;\r\n this.point2Latitude = _data.point2Latitude;\r\n this.danishSystem34Region = _data.danishSystem34Region;\r\n this.azimuth = _data.azimuth;\r\n }\r\n }\r\n\r\n /** Creates a Projection from JSON representation.\r\n * @public */\r\n public static fromJSON(data: ProjectionProps): Projection {\r\n return new Projection(data);\r\n }\r\n\r\n /** Creates a JSON from the Projection definition\r\n * @public */\r\n public toJSON(): ProjectionProps {\r\n const data: ProjectionProps = { method: this.method };\r\n data.falseEasting = this.falseEasting;\r\n data.falseNorthing = this.falseNorthing;\r\n data.centralMeridian = this.centralMeridian;\r\n data.latitudeOfOrigin = this.latitudeOfOrigin;\r\n data.longitudeOfOrigin = this.longitudeOfOrigin;\r\n data.scaleFactor = this.scaleFactor;\r\n data.elevationAboveGeoid = this.elevationAboveGeoid;\r\n data.geoidSeparation = this.geoidSeparation;\r\n data.affine = this.affine ? this.affine.toJSON() : undefined;\r\n data.standardParallel = this.standardParallel;\r\n data.standardParallel1 = this.standardParallel1;\r\n data.standardParallel2 = this.standardParallel2;\r\n data.zoneNumber = this.zoneNumber;\r\n data.hemisphere = this.hemisphere;\r\n data.centralPointLongitude = this.centralPointLongitude;\r\n data.centralPointLatitude = this.centralPointLatitude;\r\n data.point1Longitude = this.point1Longitude;\r\n data.point1Latitude = this.point1Latitude;\r\n data.point2Longitude = this.point2Longitude;\r\n data.point2Latitude = this.point2Latitude;\r\n data.danishSystem34Region = this.danishSystem34Region;\r\n data.azimuth = this.azimuth;\r\n return data;\r\n }\r\n\r\n /** Compares two projections. It is a strict compare operation as descriptive data is compared\r\n * but a minuscule tolerance is applied to number compares.\r\n * @public */\r\n public equals(other: Projection): boolean {\r\n if (this.method !== other.method ||\r\n this.zoneNumber !== other.zoneNumber ||\r\n this.hemisphere !== other.hemisphere ||\r\n this.danishSystem34Region !== other.danishSystem34Region)\r\n return false;\r\n\r\n // Note that even though falseEasting, falseNorthing, elevationAboveGeoid and geoidSeparation are expressed\r\n // in the units of the projection which can be foot or US survey foot, they are still within the same order\r\n // of size that Geometry.smallMetricDistance can be used effectively.\r\n if (!Geometry.isAlmostEqualOptional(this.falseEasting, other.falseEasting, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.falseNorthing, other.falseNorthing, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.centralMeridian, other.centralMeridian, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.latitudeOfOrigin, other.latitudeOfOrigin, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.longitudeOfOrigin, other.longitudeOfOrigin, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.scaleFactor, other.scaleFactor, Geometry.smallFraction) ||\r\n !Geometry.isAlmostEqualOptional(this.elevationAboveGeoid, other.elevationAboveGeoid, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.geoidSeparation, other.geoidSeparation, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.standardParallel, other.standardParallel, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.standardParallel1, other.standardParallel1, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.standardParallel2, other.standardParallel2, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.centralPointLongitude, other.centralPointLongitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.centralPointLatitude, other.centralPointLatitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point1Longitude, other.point1Longitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point1Latitude, other.point1Latitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point2Longitude, other.point2Longitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point2Latitude, other.point2Latitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.azimuth, other.azimuth, Geometry.smallAngleDegrees))\r\n return false;\r\n\r\n if (this.affine && other.affine) {\r\n if (!this.affine.equals(other.affine))\r\n return false;\r\n } else {\r\n if (this.affine || other.affine)\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/** A 2D cartographic point in degrees\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Carto2DDegreesProps {\r\n /** Latitude value in degrees */\r\n latitude: number;\r\n /** Longitude value in degrees */\r\n longitude: number;\r\n}\r\n\r\n/** A 2D cartographic point in degrees\r\n * @public\r\n */\r\nexport class Carto2DDegrees implements Carto2DDegreesProps {\r\n /** Latitude value in degrees. Must be between -90 and +90 included */\r\n private _latitude!: number;\r\n /** Returns or sets the latitude in degrees. When setting the provided number must be between or equal from -90 to 90. */\r\n public get latitude() { return this._latitude; }\r\n public set latitude(newLatitude: number) {\r\n if ((newLatitude <= 90.0) && (newLatitude >= -90.0))\r\n this._latitude = newLatitude;\r\n }\r\n /** Longitude value in degrees */\r\n public longitude!: number;\r\n\r\n public constructor(data?: Carto2DDegreesProps) {\r\n this.latitude = 0.0; /* make sure latitude is init even if invalid latitude provided */\r\n if (data) {\r\n this.latitude = data.latitude;\r\n this.longitude = data.longitude;\r\n }\r\n }\r\n\r\n /** Creates a Carto2DDegrees object from JSON representation.\r\n * @public */\r\n public static fromJSON(data: Carto2DDegreesProps): Carto2DDegrees {\r\n return new Carto2DDegrees(data);\r\n }\r\n\r\n /** Creates a JSON from the Carto2DDegrees definition\r\n * @public */\r\n public toJSON(): Carto2DDegreesProps {\r\n return { latitude: this.latitude, longitude: this.longitude };\r\n }\r\n\r\n /** Compares two Carto2DDegrees object. It applies a minuscule tolerance to compares.\r\n * @public */\r\n public equals(other: Carto2DDegrees): boolean {\r\n return (Math.abs(this.latitude - other.latitude) < Geometry.smallAngleDegrees &&\r\n Math.abs(this.longitude - other.longitude) < Geometry.smallAngleDegrees);\r\n }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"Projection.js","sourceRoot":"","sources":["../../../src/geometry/Projection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,yHAAyH;;;AAEzH,wDAAgD;AAmFhD;;;;;GAKG;AACH,MAAa,eAAe;IAc1B,YAAY,IAA2B;QACrC,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;SACnB;IACH,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA0B;QAC/C,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY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,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IAChE,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAAqB;QACjC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,wBAAQ,CAAC,iBAAiB;YAC3E,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,wBAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7E,CAAC;CACF;AAtCD,wCAsCC","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 Geometry\n */\n// cspell:ignore Albers, Krovak, OSTN, Cassini, Grinten, Mollweide, Eckert, Homolosine, Carree, Winkel, Tripel, Polyconic\n\nimport { Geometry } from \"@itwin/core-geometry\";\n\n/** This enum contains the list of all projection methods that can be represented as part of the HorizontalCRS\n * class. The None method indicates there is no projection and thus the CRS is longitude/latitude based\n * with units as degrees.\n * All other projection indicated a projected CRS.\n * @public\n * @extensions\n */\nexport type ProjectionMethod =\n \"None\" |\n \"TransverseMercator\" |\n \"SouthOrientedTransverseMercator\" |\n \"TransverseMercatorWisconsin\" |\n \"TransverseMercatorMinnesota\" |\n \"TransverseMercatorAffine\" |\n \"MercatorStandardParallel\" |\n \"Mercator\" |\n \"UniversalTransverseMercator\" |\n \"LambertConformalConicTwoParallels\" |\n \"LambertConformalConicBelgium\" |\n \"LambertConformalConicAffine\" |\n \"LambertConformalConicWisconsin\" |\n \"LambertConformalConicMinnesota\" |\n \"LambertConformalConicMichigan\" |\n \"LambertConformalConicOneParallel\" |\n \"AlbersEqualArea\" |\n \"NewZealandNationalGrid\" |\n \"ObliqueMercator1\" |\n \"ObliqueMercator2\" |\n \"TransverseMercatorOSTN97\" |\n \"TransverseMercatorOSTN02\" |\n \"TransverseMercatorOSTN15\" |\n \"Krovak\" |\n \"KrovakModified\" |\n \"ObliqueCylindricalSwiss\" |\n \"TransverseMercatorDenmarkSystem34\" |\n \"TransverseMercatorDenmarkSystem3499\" |\n \"TransverseMercatorDenmarkSystem3401\" |\n \"Cassini\" |\n \"Sinusoidal\" |\n \"VanDerGrinten\" |\n \"Bonne\" |\n \"Mollweide\" |\n \"EckertIV\" |\n \"EckertVI\" |\n \"GoodeHomolosine\" |\n \"Robinson\" |\n \"PlateCarree\" |\n \"MillerCylindrical\" |\n \"WinkelTripel\" |\n \"AzimuthalEqualArea\" |\n \"ObliqueStereographic\" |\n \"RectifiedSkewOrthomorphicCentered\" |\n \"RectifiedSkewOrthomorphicOrigin\" |\n \"ObliqueCylindricalHungary\" |\n \"Orthographic\" |\n \"AmericanPolyconic\" |\n \"LambertEquidistantAzimuthal\" |\n \"ObliqueMercatorMinnesota\";\n\n/** The equations are:\n * X1 = a1*X + a2*Y + TranslationX\n * Y1 = b1*X + b2*Y + translationY\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\n * @public\n * @extensions\n */\nexport interface AffineTransformProps {\n /** The X post translation */\n translationX: number;\n /** The Y post-translation */\n translationY: number;\n /** A1 value as defined in global comment. */\n a1: number;\n /** B1 value as defined in global comment. */\n b1: number;\n /** A2 value as defined in global comment. */\n a2: number;\n /** B2 value as defined in global comment. */\n b2: number;\n}\n\n/** The equations are:\n * X1 = a1*X + a2*Y + TranslationX\n * Y1 = b1*X + b2*Y + translationY\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\n * @public\n */\nexport class AffineTransform implements AffineTransformProps {\n /** The X post translation */\n public readonly translationX!: number;\n /** The Y post-translation */\n public readonly translationY!: number;\n /** A1 value as defined in global comment. */\n public readonly a1!: number;\n /** B1 value as defined in global comment. */\n public readonly b1!: number;\n /** A2 value as defined in global comment. */\n public readonly a2!: number;\n /** B2 value as defined in global comment. */\n public readonly b2!: number;\n\n constructor(data?: AffineTransformProps) {\n if (data) {\n this.translationX = data.translationX;\n this.translationY = data.translationY;\n this.a1 = data.a1;\n this.b1 = data.b1;\n this.a2 = data.a2;\n this.b2 = data.b2;\n }\n }\n\n /** Creates an Affine Transform from JSON representation.\n * @public */\n public static fromJSON(data: AffineTransformProps): AffineTransform {\n return new AffineTransform(data);\n }\n\n /** Creates a JSON from the Affine Transform definition\n * @public */\n public toJSON(): AffineTransformProps {\n return { translationX: this.translationX, a1: this.a1, a2: this.a2, translationY: this.translationY, b1: this.b1, b2: this.b2 };\n }\n\n /** Compares two Affine Transforms. It applies a minuscule tolerance for number compares\n * @public */\n public equals(other: AffineTransform): boolean {\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\n Math.abs(this.a1 - other.a1) < Geometry.smallFraction &&\n Math.abs(this.b1 - other.b1) < Geometry.smallFraction &&\n Math.abs(this.a2 - other.a2) < Geometry.smallFraction &&\n Math.abs(this.b2 - other.b2) < Geometry.smallFraction);\n }\n}\n\n/** Type used in the definition of UTM Zoning projection. This projection only requires a zone number and\n * the hemisphere North or South.\n * @public\n * @extensions\n */\nexport type HemisphereEnum = \"South\" | \"North\";\n\n/** The type to define the three zones of the Danish System 34 projections.\n * @public\n * @extensions\n */\nexport type DanishSystem34Region = \"Jylland\" | \"Sjaelland\" | \"Bornholm\";\n\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method\n * and a set of projection parameters specific to projection method selected.\n * @public\n * @extensions\n */\nexport interface ProjectionProps {\n /** The projection method. */\n method: ProjectionMethod;\n /** The False Easting of the projection. */\n falseEasting?: number;\n /** The False Northing of the projection. */\n falseNorthing?: number;\n /** The Central Meridian. */\n centralMeridian?: number;\n /** The latitude of origin of the projection. */\n latitudeOfOrigin?: number;\n /** Longitude of origin of the projection. */\n longitudeOfOrigin?: number;\n /** The scale reduction factor applied at origin. The nature of the projection has a\n * inherent scale factor applied that gradually varies outward from the projection origin.\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\n * For the michigan variation of the Lambert Conformal Conic projection it\n * can be used instead or in addition to Standard Parallel to define\n * a scale factor.\n */\n scaleFactor?: number;\n /** The elevation of the origin of the projection above the geoid. This value\n * allows compensation for the scale factor related to elevation above the sea level.\n */\n elevationAboveGeoid?: number;\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\n geoidSeparation?: number;\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\n affine?: AffineTransformProps;\n /** Standard parallel for projection that only use one.\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\n * which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\n * For conic projections (Lambert Tangential ...) it defines\n * the standard parallel at which the cone is tangent to the ellipsoid.\n */\n standardParallel?: number;\n /** The first standard parallel at which the cone crosses the ellipsoid. */\n standardParallel1?: number;\n /** The second standard parallel at which the cone crosses the ellipsoid. */\n standardParallel2?: number;\n /** The UTM zone number. A number from 0 to 60. */\n zoneNumber?: number;\n /** The hemisphere for Universal Transverse Mercator projection. */\n hemisphere?: HemisphereEnum;\n /** Longitude of the central point. */\n centralPointLongitude?: number;\n /** Latitude of the central point. */\n centralPointLatitude?: number;\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n point1Longitude?: number;\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n point1Latitude?: number;\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\n point2Longitude?: number;\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\n point2Latitude?: number;\n /** The Danish zone for Danish projections. */\n danishSystem34Region?: DanishSystem34Region;\n /** Azimuth. */\n azimuth?: number;\n}\n\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method and a set\n * of projection parameters specific to projection method selected to flatten the surface of the model of the Earth\n * defines as a geodetic ellipsoid. The flattening and the distortion angular, linear, scale from the process varies between methods.\n * Refer to appropriate external documentation for details.\n * @note Various property sets are required for specific projection methods. The current class implementation does not enforce\n * these rules yet and it is possible to define or not define any property regardless the method used.\n * @public\n */\nexport class Projection implements ProjectionProps {\n /** The projection method. */\n public readonly method!: ProjectionMethod;\n /** The False Easting of the projection. */\n public readonly falseEasting?: number;\n /** The False Northing of the projection. */\n public readonly falseNorthing?: number;\n /** The Central Meridian. */\n public readonly centralMeridian?: number;\n /** The latitude of origin of the projection. */\n public readonly latitudeOfOrigin?: number;\n /** Longitude of origin of the projection. */\n public readonly longitudeOfOrigin?: number;\n /** The scale reduction factor applied at origin. The nature of the projection has a\n * inherent scale factor applied that gradually varies outward from the projection origin.\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\n * For the michigan variation of the Lambert Conformal Conic projection it\n * can be used instead or in addition to Standard Parallel to define\n * a scale factor.\n */\n public readonly scaleFactor?: number;\n /** The elevation of the origin of the projection above the geoid. This value\n * allows compensation for the scale factor related to elevation above the sea level.\n */\n public readonly elevationAboveGeoid?: number;\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\n public readonly geoidSeparation?: number;\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\n public readonly affine?: AffineTransform;\n /** Standard parallel for projection that only use one.\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\n ** which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\n * For conic projections (Lambert Tangential ...) it defines\n * the standard parallel at which the cone is tangent to the ellipsoid.\n */\n public readonly standardParallel?: number;\n /** The first standard parallel at which the cone crosses the ellipsoid. */\n public readonly standardParallel1?: number;\n /** The second standard parallel at which the cone crosses the ellipsoid. */\n public readonly standardParallel2?: number;\n /** The UTM zone number. A number from 0 to 60. */\n public readonly zoneNumber?: number;\n /** The hemisphere for Universal Transverse Mercator projection. */\n public readonly hemisphere?: HemisphereEnum;\n /** Longitude of the central point. */\n public readonly centralPointLongitude?: number;\n /** Latitude of the central point. */\n public readonly centralPointLatitude?: number;\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n public readonly point1Longitude?: number;\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n public readonly point1Latitude?: number;\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\n public readonly point2Longitude?: number;\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\n public readonly point2Latitude?: number;\n /** The Danish zone for Danish projections. */\n public readonly danishSystem34Region?: DanishSystem34Region;\n /** Azimuth. */\n public readonly azimuth?: number;\n\n public constructor(_data?: ProjectionProps) {\n if (_data) {\n this.method = _data.method;\n this.falseEasting = _data.falseEasting;\n this.falseNorthing = _data.falseNorthing;\n this.centralMeridian = _data.centralMeridian;\n this.latitudeOfOrigin = _data.latitudeOfOrigin;\n this.longitudeOfOrigin = _data.longitudeOfOrigin;\n this.scaleFactor = _data.scaleFactor;\n this.elevationAboveGeoid = _data.elevationAboveGeoid;\n this.geoidSeparation = _data.geoidSeparation;\n this.affine = _data.affine ? AffineTransform.fromJSON(_data.affine) : undefined;\n this.standardParallel = _data.standardParallel;\n this.standardParallel1 = _data.standardParallel1;\n this.standardParallel2 = _data.standardParallel2;\n this.zoneNumber = _data.zoneNumber;\n this.hemisphere = _data.hemisphere;\n this.centralPointLongitude = _data.centralPointLongitude;\n this.centralPointLatitude = _data.centralPointLatitude;\n this.point1Longitude = _data.point1Longitude;\n this.point1Latitude = _data.point1Latitude;\n this.point2Longitude = _data.point2Longitude;\n this.point2Latitude = _data.point2Latitude;\n this.danishSystem34Region = _data.danishSystem34Region;\n this.azimuth = _data.azimuth;\n }\n }\n\n /** Creates a Projection from JSON representation.\n * @public */\n public static fromJSON(data: ProjectionProps): Projection {\n return new Projection(data);\n }\n\n /** Creates a JSON from the Projection definition\n * @public */\n public toJSON(): ProjectionProps {\n const data: ProjectionProps = { method: this.method };\n data.falseEasting = this.falseEasting;\n data.falseNorthing = this.falseNorthing;\n data.centralMeridian = this.centralMeridian;\n data.latitudeOfOrigin = this.latitudeOfOrigin;\n data.longitudeOfOrigin = this.longitudeOfOrigin;\n data.scaleFactor = this.scaleFactor;\n data.elevationAboveGeoid = this.elevationAboveGeoid;\n data.geoidSeparation = this.geoidSeparation;\n data.affine = this.affine ? this.affine.toJSON() : undefined;\n data.standardParallel = this.standardParallel;\n data.standardParallel1 = this.standardParallel1;\n data.standardParallel2 = this.standardParallel2;\n data.zoneNumber = this.zoneNumber;\n data.hemisphere = this.hemisphere;\n data.centralPointLongitude = this.centralPointLongitude;\n data.centralPointLatitude = this.centralPointLatitude;\n data.point1Longitude = this.point1Longitude;\n data.point1Latitude = this.point1Latitude;\n data.point2Longitude = this.point2Longitude;\n data.point2Latitude = this.point2Latitude;\n data.danishSystem34Region = this.danishSystem34Region;\n data.azimuth = this.azimuth;\n return data;\n }\n\n /** Compares two projections. It is a strict compare operation as descriptive data is compared\n * but a minuscule tolerance is applied to number compares.\n * @public */\n public equals(other: Projection): boolean {\n if (this.method !== other.method ||\n this.zoneNumber !== other.zoneNumber ||\n this.hemisphere !== other.hemisphere ||\n this.danishSystem34Region !== other.danishSystem34Region)\n return false;\n\n // Note that even though falseEasting, falseNorthing, elevationAboveGeoid and geoidSeparation are expressed\n // in the units of the projection which can be foot or US survey foot, they are still within the same order\n // of size that Geometry.smallMetricDistance can be used effectively.\n if (!Geometry.isAlmostEqualOptional(this.falseEasting, other.falseEasting, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.falseNorthing, other.falseNorthing, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.centralMeridian, other.centralMeridian, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.latitudeOfOrigin, other.latitudeOfOrigin, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.longitudeOfOrigin, other.longitudeOfOrigin, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.scaleFactor, other.scaleFactor, Geometry.smallFraction) ||\n !Geometry.isAlmostEqualOptional(this.elevationAboveGeoid, other.elevationAboveGeoid, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.geoidSeparation, other.geoidSeparation, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.standardParallel, other.standardParallel, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.standardParallel1, other.standardParallel1, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.standardParallel2, other.standardParallel2, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.centralPointLongitude, other.centralPointLongitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.centralPointLatitude, other.centralPointLatitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point1Longitude, other.point1Longitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point1Latitude, other.point1Latitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point2Longitude, other.point2Longitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point2Latitude, other.point2Latitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.azimuth, other.azimuth, Geometry.smallAngleDegrees))\n return false;\n\n if (this.affine && other.affine) {\n if (!this.affine.equals(other.affine))\n return false;\n } else {\n if (this.affine || other.affine)\n return false;\n }\n return true;\n }\n}\n\n/** A 2D cartographic point in degrees\n * @public\n * @extensions\n */\nexport interface Carto2DDegreesProps {\n /** Latitude value in degrees */\n latitude: number;\n /** Longitude value in degrees */\n longitude: number;\n}\n\n/** A 2D cartographic point in degrees\n * @public\n */\nexport class Carto2DDegrees implements Carto2DDegreesProps {\n /** Latitude value in degrees. Must be between -90 and +90 included */\n private _latitude!: number;\n /** Returns or sets the latitude in degrees. When setting the provided number must be between or equal from -90 to 90. */\n public get latitude() { return this._latitude; }\n public set latitude(newLatitude: number) {\n if ((newLatitude <= 90.0) && (newLatitude >= -90.0))\n this._latitude = newLatitude;\n }\n /** Longitude value in degrees */\n public longitude!: number;\n\n public constructor(data?: Carto2DDegreesProps) {\n this.latitude = 0.0; /* make sure latitude is init even if invalid latitude provided */\n if (data) {\n this.latitude = data.latitude;\n this.longitude = data.longitude;\n }\n }\n\n /** Creates a Carto2DDegrees object from JSON representation.\n * @public */\n public static fromJSON(data: Carto2DDegreesProps): Carto2DDegrees {\n return new Carto2DDegrees(data);\n }\n\n /** Creates a JSON from the Carto2DDegrees definition\n * @public */\n public toJSON(): Carto2DDegreesProps {\n return { latitude: this.latitude, longitude: this.longitude };\n }\n\n /** Compares two Carto2DDegrees object. It applies a minuscule tolerance to compares.\n * @public */\n public equals(other: Carto2DDegrees): boolean {\n return (Math.abs(this.latitude - other.latitude) < Geometry.smallAngleDegrees &&\n Math.abs(this.longitude - other.longitude) < Geometry.smallAngleDegrees);\n }\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextString.js","sourceRoot":"","sources":["../../../src/geometry/TextString.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAqH;AA6BrH;;;;GAIG;AACH,MAAa,UAAU;IAmBrB,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAExF,YAAmB,KAAsB;QACvC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,KA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AC;QACnF,MAAM,MAAM,GAAG,IAAI,wBAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,MAAM,WAAW,GAAG,kCAAkB,CAAC,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/E,IAAI,SAAS,KAAK,WAAW;YAC3B,OAAO,KAAK,CAAC;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,GAAG,OAAO,IAAI,QAAQ,GAAG,OAAO;YAC3C,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtED,gCAsEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"TextString.js","sourceRoot":"","sources":["../../../src/geometry/TextString.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAqH;AA6BrH;;;;GAIG;AACH,MAAa,UAAU;IAmBrB,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;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,CAAC;QAE/B,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,gBAAgB,CAAC,SAAoB;QAC1C,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;QACnF,MAAM,MAAM,GAAG,IAAI,wBAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,MAAM,WAAW,GAAG,kCAAkB,CAAC,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/E,IAAI,SAAS,KAAK,WAAW;YAC3B,OAAO,KAAK,CAAC;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,GAAG,OAAO,IAAI,QAAQ,GAAG,OAAO;YAC3C,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtED,gCAsEC","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 Geometry\n */\n\nimport { Point3d, Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { FontId } from \"../Fonts\";\n\n/** Properties for a TextString class.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface TextStringProps {\n /** text string */\n text: string;\n /** FontId for the TextString. FontIds are mapped to font names and types via the FontMap */\n font: FontId;\n /* text height */\n height: number;\n /* width / height ratio. Default is 1.0 */\n widthFactor?: number;\n /** bold text. Default is false */\n bold?: boolean;\n /** italic text. Default is false */\n italic?: boolean;\n /** underline text. Default is false */\n underline?: boolean;\n /** Optional position relative to element's placement. Default is 0,0,0 */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement. Default is identity matrix */\n rotation?: YawPitchRollProps;\n}\n\n/** A single line of text, all with the same font, styles (underline, bold, italic), and size.\n * This class also holds the origin and direction for the text.\n * A paragraph is composed of one or more instances of TextStrings.\n * @public\n */\nexport class TextString {\n /** Text string */\n public text: string;\n /** FontId for this TextString. FontIds are mapped to font names and types via the FontMap */\n public font: FontId;\n /* text height, in meters */\n public height: number;\n /* width / height ratio. Default is 1.0 */\n public widthFactor?: number;\n /** bold text. Default is false */\n public bold?: boolean;\n /** italic text. Default is false */\n public italic?: boolean;\n /** underline text. Default is false */\n public underline?: boolean;\n /** position relative to element's placement */\n public readonly origin: Point3d;\n /** Rotation relative to element's placement */\n public readonly rotation: YawPitchRollAngles;\n public get width() { return this.height * (this.widthFactor ? this.widthFactor : 1.0); }\n\n public constructor(props: TextStringProps) {\n this.text = props.text;\n this.font = props.font;\n this.height = props.height;\n this.widthFactor = props.widthFactor;\n this.bold = props.bold;\n this.italic = props.italic;\n this.underline = props.underline;\n this.origin = Point3d.fromJSON(props.origin);\n this.rotation = YawPitchRollAngles.fromJSON(props.rotation);\n }\n\n public toJSON(): TextStringProps {\n const val: any = {};\n val.text = this.text;\n val.font = this.font;\n val.height = this.height;\n val.widthFactor = this.widthFactor;\n val.bold = this.bold;\n val.italic = this.italic;\n val.underline = this.underline;\n if (!this.origin.isAlmostZero)\n val.origin = this.origin;\n\n if (!this.rotation.isIdentity())\n val.rotation = this.rotation;\n\n return val;\n }\n\n public transformInPlace(transform: Transform): boolean {\n const newOrigin = transform.multiplyPoint3d(this.origin, this.origin);\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\n const scales = new Vector3d();\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\n if (undefined === newRotation)\n return false;\n const newHeight = this.height * scales.y;\n const newWidth = this.width * scales.x;\n if (newHeight < 1.0e-10 || newWidth < 1.0e-10)\n return false;\n this.origin.setFrom(newOrigin);\n this.rotation.setFrom(newRotation);\n this.height = newHeight;\n this.widthFactor = (newHeight === newWidth ? undefined : (newWidth / newHeight));\n return true;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcSession.js","sourceRoot":"","sources":["../../../src/ipc/IpcSession.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,gBAAgB;AAChB,MAAsB,UAAU;IAEvB,MAAM,KAAK,MAAM,KAA6B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAEpE,MAAM,CAAC,KAAK,CAAC,OAAmB;QACrC,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,IAAI;QAChB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CAGF;AArBD,gCAqBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"IpcSession.js","sourceRoot":"","sources":["../../../src/ipc/IpcSession.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,gBAAgB;AAChB,MAAsB,UAAU;IAEvB,MAAM,KAAK,MAAM,KAA6B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAEpE,MAAM,CAAC,KAAK,CAAC,OAAmB;QACrC,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,IAAI;QAChB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CAGF;AArBD,gCAqBC","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 IpcSocket\n */\n\n/** @internal */\nexport interface InterceptedRpcRequest {\n definition: { interfaceName: string, interfaceVersion: string };\n operation: string;\n parameters: any[];\n context: { [index: string]: string };\n}\n\n/** @internal */\nexport abstract class IpcSession {\n private static _active?: IpcSession;\n public static get active(): IpcSession | undefined { return this._active; }\n\n public static start(session: IpcSession) {\n if (this._active) {\n return;\n }\n\n this._active = session;\n }\n\n public static stop() {\n if (!this._active) {\n return;\n }\n\n this._active = undefined;\n }\n\n public abstract handleRpc(info: InterceptedRpcRequest): Promise<any>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcSocket.js","sourceRoot":"","sources":["../../../src/ipc/IpcSocket.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;KAGK;AACE,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC;AAAvD,QAAA,YAAY,gBAA2C","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"IpcSocket.js","sourceRoot":"","sources":["../../../src/ipc/IpcSocket.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;KAGK;AACE,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC;AAAvD,QAAA,YAAY,gBAA2C","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 IpcSocket\n */\n\n/**\n * The prefix for all IpcSocket channels to disambiguate from system channels.\n * @internal\n * */\nexport const iTwinChannel = (channel: string) => `itwin.${channel}`;\n\n/**\n * A function to handle an Ipc message.\n * @public\n */\nexport type IpcListener = (evt: Event, ...args: any[]) => void;\n\n/**\n * Function returned when establishing an Ipc `receive` listener or `invoke` handler. Call this method to remove the listener/handler.\n * @public\n * @extensions\n */\nexport type RemoveFunction = () => void;\n\n/**\n * Payload of an IpcInvoke response. The presence of `error` indicates that the backend threw an exception and the\n * frontend will re-throw a [BackendError]$(frontend) with the `errorNumber` and `message` values. Otherwise the `result`\n * member holds the response.\n * @internal */\nexport type IpcInvokeReturn = { result: any, error?: never } | { result?: never, error: { name: string, message: string, errorNumber: number, stack?: string } };\n\n/**\n * An inter-process socket connection between a single [IModelHost]($backend) on the backend (the node process), and an [IModelApp]($frontend) on\n * the frontend (the browser process.) Each side will implement this interface to form a two way connection. The frontend and backend\n * processes connected through an IpcSocket don't necessarily have to be on the same computer, but often are.\n * @public\n*/\nexport interface IpcSocket {\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message. Must begin with the [[iTwinChannel]] prefix.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n send: (channel: string, ...data: any[]) => void;\n /**\n * Establish a handler to receive messages for a channel through a socket.\n * @param channel The name of the channel for the messages. Must begin with the [[iTwinChannel]] prefix.\n * @param listener A function called when messages are sent over `channel`\n * @note returns A function to call to remove the listener.\n */\n addListener: (channel: string, listener: IpcListener) => RemoveFunction;\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n removeListener: (channel: string, listener: IpcListener) => void;\n}\n\n/**\n * Interface for the frontend (browser) side of a socket connection. Frontends may invoke methods implemented on the backend.\n * @public\n */\nexport interface IpcSocketFrontend extends IpcSocket {\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously.\n * @param channel The name of the channel for the method. Must begin with the [[iTwinChannel]] prefix.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface *may* be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n invoke: (channel: string, ...args: any[]) => Promise<any>;\n}\n\n/**\n * Interface for the backend (Node.js) side of a socket connection. Backends provide the implementation\n * of methods that are invoked from the frontend.\n * @public\n */\nexport interface IpcSocketBackend extends IpcSocket {\n /**\n * Establish a backend implementation of an Ipc interface for a channel.\n * @param channel The name of the channel for this handler. Must begin with the [[iTwinChannel]] prefix.\n * @param handler A function that supplies the implementation for methods invoked over `channel` via [[IpcSocketFrontend.invoke]]\n * @note returns A function to call to remove the handler.\n */\n handle: (channel: string, handler: (...args: any[]) => Promise<any>) => RemoveFunction;\n}\n\n"]}
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AAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;IAEO,KAAK,CAAC,eAAe;QAC3B,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YACrD,OAAO;SACR;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC9C,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;YAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;gBAE3B,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,WAAW;oBAC/B,IAAI,GAAG,EAAE,CAAC;gBAEZ,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,EAAS,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;gBAEnE,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC;oBAC1B,IAAI,EAAE,uBAAuB,CAAC,QAAQ;oBACtC,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,QAAQ,EAAE,OAAO,CAAC,OAAO;oBACzB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,CAAC;iBACb,CAAC,CAAC;gBAEH,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;aAC9B;SACF;QAED,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACF;AA9DD,kDA8DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IpcSocket\r\n */\r\n\r\nimport { IpcListener, IpcSocket, IpcSocketBackend, IpcSocketFrontend, RemoveFunction } from \"./IpcSocket\";\r\nimport { IpcWebSocketTransport } from \"./IpcWebSocketTransport\";\r\n\r\n/** @internal */\r\nexport enum IpcWebSocketMessageType {\r\n Send,\r\n Push,\r\n Invoke,\r\n Response,\r\n Internal,\r\n Duplicate\r\n}\r\n\r\n/** @internal */\r\nexport interface IpcWebSocketMessage {\r\n type: IpcWebSocketMessageType;\r\n request?: number;\r\n response?: number;\r\n channel: string;\r\n method?: string;\r\n data?: any[];\r\n sequence: number;\r\n}\r\n\r\n/** @internal */\r\nexport namespace IpcWebSocketMessage {\r\n export function internal(): IpcWebSocketMessage {\r\n return { type: IpcWebSocketMessageType.Internal, channel: \"\", sequence: Number.MIN_SAFE_INTEGER };\r\n }\r\n\r\n export function duplicate(): IpcWebSocketMessage {\r\n return { type: IpcWebSocketMessageType.Duplicate, channel: \"\", sequence: Number.MIN_SAFE_INTEGER };\r\n }\r\n\r\n export function skip(message: IpcWebSocketMessage): boolean {\r\n return message.type === IpcWebSocketMessageType.Internal || message.type === IpcWebSocketMessageType.Duplicate;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport abstract class IpcWebSocket implements IpcSocket {\r\n public static transport: IpcWebSocketTransport;\r\n public static receivers: Set<(evt: Event, message: IpcWebSocketMessage) => void> = new Set();\r\n\r\n protected _channels = new Map<string, Set<IpcListener>>();\r\n\r\n public constructor() {\r\n IpcWebSocket.receivers.add(async (e, m) => this.broadcast(e, m));\r\n }\r\n\r\n public abstract send(channel: string, ...data: any[]): void;\r\n\r\n public addListener(channel: string, listener: IpcListener): RemoveFunction {\r\n let listeners = this._channels.get(channel);\r\n if (!listeners) {\r\n listeners = new Set();\r\n this._channels.set(channel, listeners);\r\n }\r\n\r\n if (!listeners.has(listener))\r\n listeners.add(listener);\r\n\r\n return () => listeners!.delete(listener);\r\n }\r\n\r\n public removeListener(channel: string, listener: IpcListener) {\r\n this._channels.get(channel)?.delete(listener);\r\n }\r\n\r\n private async broadcast(evt: Event, message: IpcWebSocketMessage) {\r\n if (message.type !== IpcWebSocketMessageType.Send && message.type !== IpcWebSocketMessageType.Push)\r\n return;\r\n\r\n const handlers = this._channels.get(message.channel);\r\n if (!handlers)\r\n return;\r\n\r\n let arg = message.data;\r\n if (typeof (arg) === \"undefined\")\r\n arg = [];\r\n\r\n for (const handler of handlers)\r\n handler(evt, ...arg);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class IpcWebSocketFrontend extends IpcWebSocket implements IpcSocketFrontend {\r\n private _nextRequest = 0;\r\n private _pendingRequests = new Map<number, (response: any) => void>();\r\n\r\n public constructor() {\r\n super();\r\n IpcWebSocket.receivers.add(async (e, m) => this.dispatch(e, m));\r\n }\r\n\r\n public send(channel: string, ...data: any[]): void {\r\n IpcWebSocket.transport.send({ type: IpcWebSocketMessageType.Send, channel, data, sequence: -1 });\r\n }\r\n\r\n public async invoke(channel: string, methodName: string, ...args: any[]): Promise<any> {\r\n const requestId = ++this._nextRequest;\r\n IpcWebSocket.transport.send({ type: IpcWebSocketMessageType.Invoke, channel, method: methodName, data: args, request: requestId, sequence: -1 });\r\n\r\n return new Promise((resolve) => {\r\n this._pendingRequests.set(requestId, resolve);\r\n });\r\n }\r\n\r\n private async dispatch(_evt: Event, message: IpcWebSocketMessage) {\r\n if (message.type !== IpcWebSocketMessageType.Response || !message.response)\r\n return;\r\n\r\n const pendingHandler = this._pendingRequests.get(message.response);\r\n if (!pendingHandler)\r\n return;\r\n\r\n this._pendingRequests.delete(message.response);\r\n pendingHandler(message.data);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class IpcWebSocketBackend extends IpcWebSocket implements IpcSocketBackend {\r\n private _handlers = new Map<string, (event: Event, methodName: string, ...args: any[]) => Promise<any>>();\r\n private _processingQueue: IpcWebSocketMessage[] = [];\r\n private _processing: IpcWebSocketMessage | undefined;\r\n\r\n public constructor() {\r\n super();\r\n IpcWebSocket.receivers.add(async (e, m) => this.dispatch(e, m));\r\n }\r\n\r\n public send(channel: string, ...data: any[]): void {\r\n IpcWebSocket.transport.send({ type: IpcWebSocketMessageType.Push, channel, data, sequence: -1 });\r\n }\r\n\r\n public handle(channel: string, handler: (event: Event, methodName: string, ...args: any[]) => Promise<any>): RemoveFunction {\r\n this._handlers.set(channel, handler);\r\n\r\n return () => {\r\n if (this._handlers.get(channel) === handler)\r\n this._handlers.delete(channel);\r\n };\r\n }\r\n\r\n private async dispatch(_evt: Event, message: IpcWebSocketMessage) {\r\n if (message.type !== IpcWebSocketMessageType.Invoke)\r\n return;\r\n\r\n this._processingQueue.push(message);\r\n await this.processMessages();\r\n }\r\n\r\n private async processMessages() {\r\n if (this._processing || !this._processingQueue.length) {\r\n return;\r\n }\r\n\r\n const message = this._processingQueue.shift();\r\n if (message && message.method) {\r\n const handler = this._handlers.get(message.channel);\r\n if (handler) {\r\n this._processing = message;\r\n\r\n let args = message.data;\r\n if (typeof (args) === \"undefined\")\r\n args = [];\r\n\r\n const response = await handler({} as any, message.method, ...args);\r\n\r\n IpcWebSocket.transport.send({\r\n type: IpcWebSocketMessageType.Response,\r\n channel: message.channel,\r\n response: message.request,\r\n data: response,\r\n sequence: -1,\r\n });\r\n\r\n this._processing = undefined;\r\n }\r\n }\r\n\r\n await this.processMessages();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IpcWebSocket.js","sourceRoot":"","sources":["../../../src/ipc/IpcWebSocket.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH,gBAAgB;AAChB,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,qEAAI,CAAA;IACJ,qEAAI,CAAA;IACJ,yEAAM,CAAA;IACN,6EAAQ,CAAA;IACR,6EAAQ,CAAA;IACR,+EAAS,CAAA;AACX,CAAC,EAPW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,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G,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,OAAO,EAAE;gBACX,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;gBAE3B,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,WAAW;oBAC/B,IAAI,GAAG,EAAE,CAAC;gBAEZ,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,EAAS,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;gBAEnE,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC;oBAC1B,IAAI,EAAE,uBAAuB,CAAC,QAAQ;oBACtC,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,QAAQ,EAAE,OAAO,CAAC,OAAO;oBACzB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,CAAC;iBACb,CAAC,CAAC;gBAEH,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;aAC9B;SACF;QAED,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACF;AA9DD,kDA8DC","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 IpcSocket\n */\n\nimport { IpcListener, IpcSocket, IpcSocketBackend, IpcSocketFrontend, RemoveFunction } from \"./IpcSocket\";\nimport { IpcWebSocketTransport } from \"./IpcWebSocketTransport\";\n\n/** @internal */\nexport enum IpcWebSocketMessageType {\n Send,\n Push,\n Invoke,\n Response,\n Internal,\n Duplicate\n}\n\n/** @internal */\nexport interface IpcWebSocketMessage {\n type: IpcWebSocketMessageType;\n request?: number;\n response?: number;\n channel: string;\n method?: string;\n data?: any[];\n sequence: number;\n}\n\n/** @internal */\nexport namespace IpcWebSocketMessage {\n export function internal(): IpcWebSocketMessage {\n return { type: IpcWebSocketMessageType.Internal, channel: \"\", sequence: Number.MIN_SAFE_INTEGER };\n }\n\n export function duplicate(): IpcWebSocketMessage {\n return { type: IpcWebSocketMessageType.Duplicate, channel: \"\", sequence: Number.MIN_SAFE_INTEGER };\n }\n\n export function skip(message: IpcWebSocketMessage): boolean {\n return message.type === IpcWebSocketMessageType.Internal || message.type === IpcWebSocketMessageType.Duplicate;\n }\n}\n\n/** @internal */\nexport abstract class IpcWebSocket implements IpcSocket {\n public static transport: IpcWebSocketTransport;\n public static receivers: Set<(evt: Event, message: IpcWebSocketMessage) => void> = new Set();\n\n protected _channels = new Map<string, Set<IpcListener>>();\n\n public constructor() {\n IpcWebSocket.receivers.add(async (e, m) => this.broadcast(e, m));\n }\n\n public abstract send(channel: string, ...data: any[]): void;\n\n public addListener(channel: string, listener: IpcListener): RemoveFunction {\n let listeners = this._channels.get(channel);\n if (!listeners) {\n listeners = new Set();\n this._channels.set(channel, listeners);\n }\n\n if (!listeners.has(listener))\n listeners.add(listener);\n\n return () => listeners!.delete(listener);\n }\n\n public removeListener(channel: string, listener: IpcListener) {\n this._channels.get(channel)?.delete(listener);\n }\n\n private async broadcast(evt: Event, message: IpcWebSocketMessage) {\n if (message.type !== IpcWebSocketMessageType.Send && message.type !== IpcWebSocketMessageType.Push)\n return;\n\n const handlers = this._channels.get(message.channel);\n if (!handlers)\n return;\n\n let arg = message.data;\n if (typeof (arg) === \"undefined\")\n arg = [];\n\n for (const handler of handlers)\n handler(evt, ...arg);\n }\n}\n\n/** @internal */\nexport class IpcWebSocketFrontend extends IpcWebSocket implements IpcSocketFrontend {\n private _nextRequest = 0;\n private _pendingRequests = new Map<number, (response: any) => void>();\n\n public constructor() {\n super();\n IpcWebSocket.receivers.add(async (e, m) => this.dispatch(e, m));\n }\n\n public send(channel: string, ...data: any[]): void {\n IpcWebSocket.transport.send({ type: IpcWebSocketMessageType.Send, channel, data, sequence: -1 });\n }\n\n public async invoke(channel: string, methodName: string, ...args: any[]): Promise<any> {\n const requestId = ++this._nextRequest;\n IpcWebSocket.transport.send({ type: IpcWebSocketMessageType.Invoke, channel, method: methodName, data: args, request: requestId, sequence: -1 });\n\n return new Promise((resolve) => {\n this._pendingRequests.set(requestId, resolve);\n });\n }\n\n private async dispatch(_evt: Event, message: IpcWebSocketMessage) {\n if (message.type !== IpcWebSocketMessageType.Response || !message.response)\n return;\n\n const pendingHandler = this._pendingRequests.get(message.response);\n if (!pendingHandler)\n return;\n\n this._pendingRequests.delete(message.response);\n pendingHandler(message.data);\n }\n}\n\n/** @internal */\nexport class IpcWebSocketBackend extends IpcWebSocket implements IpcSocketBackend {\n private _handlers = new Map<string, (event: Event, methodName: string, ...args: any[]) => Promise<any>>();\n private _processingQueue: IpcWebSocketMessage[] = [];\n private _processing: IpcWebSocketMessage | undefined;\n\n public constructor() {\n super();\n IpcWebSocket.receivers.add(async (e, m) => this.dispatch(e, m));\n }\n\n public send(channel: string, ...data: any[]): void {\n IpcWebSocket.transport.send({ type: IpcWebSocketMessageType.Push, channel, data, sequence: -1 });\n }\n\n public handle(channel: string, handler: (event: Event, methodName: string, ...args: any[]) => Promise<any>): RemoveFunction {\n this._handlers.set(channel, handler);\n\n return () => {\n if (this._handlers.get(channel) === handler)\n this._handlers.delete(channel);\n };\n }\n\n private async dispatch(_evt: Event, message: IpcWebSocketMessage) {\n if (message.type !== IpcWebSocketMessageType.Invoke)\n return;\n\n this._processingQueue.push(message);\n await this.processMessages();\n }\n\n private async processMessages() {\n if (this._processing || !this._processingQueue.length) {\n return;\n }\n\n const message = this._processingQueue.shift();\n if (message && message.method) {\n const handler = this._handlers.get(message.channel);\n if (handler) {\n this._processing = message;\n\n let args = message.data;\n if (typeof (args) === \"undefined\")\n args = [];\n\n const response = await handler({} as any, message.method, ...args);\n\n IpcWebSocket.transport.send({\n type: IpcWebSocketMessageType.Response,\n channel: message.channel,\n response: message.request,\n data: response,\n sequence: -1,\n });\n\n this._processing = undefined;\n }\n }\n\n await this.processMessages();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcWebSocketTransport.js","sourceRoot":"","sources":["../../../src/ipc/IpcWebSocketTransport.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iDAAqD;AAErD,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9I,CAAC;AAED,IAAI,KAAK,GAAU,EAAE,CAAC;AAEtB,gBAAgB;AAChB,MAAsB,qBAAqB;IAA3C;QAEU,cAAS,GAAU,EAAE,CAAC;QACtB,iBAAY,GAAG,CAAC,CAAC;IAqD3B,CAAC;IAjDW,MAAM,CAAC,IAAS;QACxB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,WAAW,IAAI,IAAI,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7F,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,IAAS,EAAE,UAAe;QACvD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1B,EAAE,IAAI,CAAC,YAAY,CAAC;YAEpB,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE;gBAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;gBAChC,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;gBAC1B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;g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,OAAO,GAAG,GAAG,EAAE;YAClB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,kCAAmB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACzE,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;;AAtDc,wBAAY,GAAqD,IAAI,GAAG,EAAE,AAA9D,CAA+D","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IpcSocket\r\n */\r\n\r\nimport { IpcWebSocketMessage } from \"./IpcWebSocket\";\r\n\r\nfunction isBuffer(val: any): boolean {\r\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\r\n}\r\n\r\nlet parts: any[] = [];\r\n\r\n/** @internal */\r\nexport abstract class IpcWebSocketTransport {\r\n private _partial?: string;\r\n private _received: any[] = [];\r\n private _outstanding = 0;\r\n\r\n public abstract send(message: IpcWebSocketMessage): void;\r\n\r\n protected unwrap(data: any) {\r\n return (typeof (Blob) !== \"undefined\" && data instanceof Blob) ? data.arrayBuffer() : data;\r\n }\r\n\r\n protected async notifyIncoming(data: any, connection: any): Promise<IpcWebSocketMessage> {\r\n if (this._partial) {\r\n this._received.push(data);\r\n --this._outstanding;\r\n\r\n if (this._outstanding === 0) {\r\n const partial = this._partial;\r\n const received = this._received;\r\n this._partial = undefined;\r\n this._received = [];\r\n await Promise.all(received.map(async (v, i, a) => a[i] = await this.unwrap(v)));\r\n\r\n parts = received;\r\n const message: IpcWebSocketMessage = JSON.parse(partial, reviver);\r\n parts.length = 0;\r\n\r\n return InSentOrder.deliver(message, connection);\r\n } else {\r\n return IpcWebSocketMessage.internal();\r\n }\r\n } else {\r\n const [serialized, followers] = JSON.parse(data);\r\n\r\n if (followers) {\r\n this._partial = serialized;\r\n this._outstanding = followers;\r\n return IpcWebSocketMessage.internal();\r\n } else {\r\n const message: IpcWebSocketMessage = JSON.parse(serialized, reviver);\r\n return InSentOrder.deliver(message, connection);\r\n }\r\n }\r\n }\r\n\r\n protected serialize(data: IpcWebSocketMessage): any[] {\r\n parts.length = 0;\r\n const objects = JSON.stringify(data, replacer);\r\n const value = [JSON.stringify([objects, parts.length]), ...parts];\r\n parts.length = 0;\r\n return value;\r\n }\r\n\r\n protected notifyClose(connection: any) {\r\n InSentOrder.close(connection);\r\n }\r\n}\r\n\r\ninterface Marker { ipc: \"binary\", type: number, index: number }\r\nconst types = [Uint8Array, Int8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, DataView];\r\nfunction identify(value: any) {\r\n return isBuffer(value) ? 0 : types.indexOf(value.constructor);\r\n}\r\n\r\nfunction lookup(value: Marker) {\r\n return types[value.type];\r\n}\r\n\r\nfunction replacer(this: any, _key: string, value: any) {\r\n const asBinary = replaceBinary(value);\r\n if (asBinary) {\r\n return asBinary;\r\n }\r\n\r\n return value;\r\n}\r\n\r\nfunction reviver(_key: string, value: any) {\r\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"ipc\") && value.ipc === \"binary\") {\r\n return reviveBinary(value);\r\n }\r\n\r\n return value;\r\n}\r\n\r\nfunction replaceBinary(value: any): Marker | undefined {\r\n if (ArrayBuffer.isView(value) || isBuffer(value)) {\r\n const index = parts.push(value) - 1;\r\n const type = identify(value);\r\n return { ipc: \"binary\", type, index };\r\n } else {\r\n return undefined;\r\n }\r\n}\r\n\r\nfunction reviveBinary(value: Marker): ArrayBufferView {\r\n const constructor = lookup(value);\r\n const part = parts[value.index];\r\n return new constructor(part);\r\n}\r\n\r\nfunction makePromise<T>() {\r\n let resolve: (value: T | PromiseLike<T>) => void = () => { };\r\n let reject: (reason?: any) => void = () => { };\r\n const promise = new Promise<T>((res, rej) => {\r\n resolve = res;\r\n reject = rej;\r\n });\r\n\r\n return { promise, resolve, reject };\r\n}\r\n\r\n/* Reconstructing the sequence in which messages were sent is necessary since\r\n the binary data for a message has to be awaited in IpcWebSocketTransport.unwrap. */\r\nclass InSentOrder {\r\n private static _connections: Map<any, { queue: InSentOrder[], last: number }> = new Map();\r\n\r\n public static async deliver(message: IpcWebSocketMessage, connection: any): Promise<IpcWebSocketMessage> {\r\n let context = this._connections.get(connection);\r\n if (!context) {\r\n context = { queue: [], last: -1 };\r\n this._connections.set(connection, context);\r\n }\r\n\r\n const entry = new InSentOrder(message);\r\n context.queue.push(entry);\r\n context.queue.sort((a, b) => a.sequence - b.sequence);\r\n\r\n while (context.queue.length !== 0) {\r\n const next = context.queue[0];\r\n const duplicate = next.sequence <= context.last;\r\n const match = next.sequence === (context.last + 1);\r\n\r\n if (duplicate) {\r\n next.duplicate = true;\r\n } else if (match) {\r\n ++context.last;\r\n }\r\n\r\n if (duplicate || match) {\r\n context.queue.shift();\r\n next.release();\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n return entry.message;\r\n }\r\n\r\n public static close(connection: any) {\r\n this._connections.delete(connection);\r\n }\r\n\r\n public release = () => { };\r\n public sequence: number;\r\n public duplicate = false;\r\n public message: Promise<IpcWebSocketMessage>;\r\n\r\n private constructor(message: IpcWebSocketMessage) {\r\n this.sequence = message.sequence;\r\n\r\n const { promise, resolve } = makePromise<IpcWebSocketMessage>();\r\n this.message = promise;\r\n\r\n this.release = () => {\r\n const value = this.duplicate ? IpcWebSocketMessage.duplicate() : message;\r\n resolve(value);\r\n };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IpcWebSocketTransport.js","sourceRoot":"","sources":["../../../src/ipc/IpcWebSocketTransport.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iDAAqD;AAErD,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CA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------------------------------------\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 IpcSocket\n */\n\nimport { IpcWebSocketMessage } from \"./IpcWebSocket\";\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet parts: any[] = [];\n\n/** @internal */\nexport abstract class IpcWebSocketTransport {\n private _partial?: string;\n private _received: any[] = [];\n private _outstanding = 0;\n\n public abstract send(message: IpcWebSocketMessage): void;\n\n protected unwrap(data: any) {\n return (typeof (Blob) !== \"undefined\" && data instanceof Blob) ? data.arrayBuffer() : data;\n }\n\n protected async notifyIncoming(data: any, connection: any): Promise<IpcWebSocketMessage> {\n if (this._partial) {\n this._received.push(data);\n --this._outstanding;\n\n if (this._outstanding === 0) {\n const partial = this._partial;\n const received = this._received;\n this._partial = undefined;\n this._received = [];\n await Promise.all(received.map(async (v, i, a) => a[i] = await this.unwrap(v)));\n\n parts = received;\n const message: IpcWebSocketMessage = JSON.parse(partial, reviver);\n parts.length = 0;\n\n return InSentOrder.deliver(message, connection);\n } else {\n return IpcWebSocketMessage.internal();\n }\n } else {\n const [serialized, followers] = JSON.parse(data);\n\n if (followers) {\n this._partial = serialized;\n this._outstanding = followers;\n return IpcWebSocketMessage.internal();\n } else {\n const message: IpcWebSocketMessage = JSON.parse(serialized, reviver);\n return InSentOrder.deliver(message, connection);\n }\n }\n }\n\n protected serialize(data: IpcWebSocketMessage): any[] {\n parts.length = 0;\n const objects = JSON.stringify(data, replacer);\n const value = [JSON.stringify([objects, parts.length]), ...parts];\n parts.length = 0;\n return value;\n }\n\n protected notifyClose(connection: any) {\n InSentOrder.close(connection);\n }\n}\n\ninterface Marker { ipc: \"binary\", type: number, index: number }\nconst types = [Uint8Array, Int8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, DataView];\nfunction identify(value: any) {\n return isBuffer(value) ? 0 : types.indexOf(value.constructor);\n}\n\nfunction lookup(value: Marker) {\n return types[value.type];\n}\n\nfunction replacer(this: any, _key: string, value: any) {\n const asBinary = replaceBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n return value;\n}\n\nfunction reviver(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"ipc\") && value.ipc === \"binary\") {\n return reviveBinary(value);\n }\n\n return value;\n}\n\nfunction replaceBinary(value: any): Marker | undefined {\n if (ArrayBuffer.isView(value) || isBuffer(value)) {\n const index = parts.push(value) - 1;\n const type = identify(value);\n return { ipc: \"binary\", type, index };\n } else {\n return undefined;\n }\n}\n\nfunction reviveBinary(value: Marker): ArrayBufferView {\n const constructor = lookup(value);\n const part = parts[value.index];\n return new constructor(part);\n}\n\nfunction makePromise<T>() {\n let resolve: (value: T | PromiseLike<T>) => void = () => { };\n let reject: (reason?: any) => void = () => { };\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n return { promise, resolve, reject };\n}\n\n/* Reconstructing the sequence in which messages were sent is necessary since\n the binary data for a message has to be awaited in IpcWebSocketTransport.unwrap. */\nclass InSentOrder {\n private static _connections: Map<any, { queue: InSentOrder[], last: number }> = new Map();\n\n public static async deliver(message: IpcWebSocketMessage, connection: any): Promise<IpcWebSocketMessage> {\n let context = this._connections.get(connection);\n if (!context) {\n context = { queue: [], last: -1 };\n this._connections.set(connection, context);\n }\n\n const entry = new InSentOrder(message);\n context.queue.push(entry);\n context.queue.sort((a, b) => a.sequence - b.sequence);\n\n while (context.queue.length !== 0) {\n const next = context.queue[0];\n const duplicate = next.sequence <= context.last;\n const match = next.sequence === (context.last + 1);\n\n if (duplicate) {\n next.duplicate = true;\n } else if (match) {\n ++context.last;\n }\n\n if (duplicate || match) {\n context.queue.shift();\n next.release();\n } else {\n break;\n }\n }\n\n return entry.message;\n }\n\n public static close(connection: any) {\n this._connections.delete(connection);\n }\n\n public release = () => { };\n public sequence: number;\n public duplicate = false;\n public message: Promise<IpcWebSocketMessage>;\n\n private constructor(message: IpcWebSocketMessage) {\n this.sequence = message.sequence;\n\n const { promise, resolve } = makePromise<IpcWebSocketMessage>();\n this.message = promise;\n\n this.release = () => {\n const value = this.duplicate ? IpcWebSocketMessage.duplicate() : message;\n resolve(value);\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevToolsRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/DevToolsRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,kDAA+C;AAC/C,8CAA2C;AAE3C;;GAEG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAQ,CAAA;IAER,oFAAoF;IACpF,6EAAe,CAAA;AACjB,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAED;;;GAGG;AACH,MAAsB,oBAAqB,SAAQ,2BAAY;IAC7D,oEAAoE;IAC7D,MAAM,CAAC,SAAS,KAA2B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAUlH;;;gGAG4F;IAC5F,iEAAiE;IAC1D,KAAK,CAAC,IAAI,CAAC,YAA4B,IAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAErG,qEAAqE;IAC9D,KAAK,CAAC,KAAK,CAAC,YAA4B,EAAE,QAA8B,IAAkB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAElI,uEAAuE;IAChE,KAAK,CAAC,QAAQ,CAAC,YAA4B;QAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACrD,QAAQ,CAAC,aAAa,GAAG,MAAM,uBAAU,CAAC,0BAA0B,EAAE,CAAC;QACvE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gFAAgF;IACzE,KAAK,CAAC,WAAW,CAAC,YAA4B,EAAE,eAAuB,EAAE,SAAmB,IAAmC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AA1BvK,2CAA2C;AACpB,kCAAa,GAAG,sBAAsB,CAAC;AAE9D;;GAEG;AACW,qCAAgB,GAAG,OAAO,CAAC;AAVrB,oDAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"DevToolsRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/DevToolsRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,kDAA+C;AAC/C,8CAA2C;AAE3C;;GAEG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAQ,CAAA;IAER,oFAAoF;IACpF,6EAAe,CAAA;AACjB,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAED;;;GAGG;AACH,MAAsB,oBAAqB,SAAQ,2BAAY;IAC7D,oEAAoE;IAC7D,MAAM,CAAC,SAAS,KAA2B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAUlH;;;gGAG4F;IAC5F,iEAAiE;IAC1D,KAAK,CAAC,IAAI,CAAC,YAA4B,IAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAErG,qEAAqE;IAC9D,KAAK,CAAC,KAAK,CAAC,YAA4B,EAAE,QAA8B,IAAkB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAElI,uEAAuE;IAChE,KAAK,CAAC,QAAQ,CAAC,YAA4B;QAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACrD,QAAQ,CAAC,aAAa,GAAG,MAAM,uBAAU,CAAC,0BAA0B,EAAE,CAAC;QACvE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gFAAgF;IACzE,KAAK,CAAC,WAAW,CAAC,YAA4B,EAAE,eAAuB,EAAE,SAAmB,IAAmC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AA1BvK,2CAA2C;AACpB,kCAAa,GAAG,sBAAsB,CAAC;AAE9D;;GAEG;AACW,qCAAgB,GAAG,OAAO,CAAC;AAVrB,oDAAoB","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 RpcInterface\n */\n\nimport { LogLevel } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../IModel\";\nimport { RpcInterface } from \"../RpcInterface\";\nimport { RpcManager } from \"../RpcManager\";\n\n/** Options to get the backend statistics\n * @internal\n */\nexport enum DevToolsStatsOptions {\n None = 0,\n\n /** All unitized values are setup as formatted strings with the appropriate units */\n FormatUnits = 1,\n}\n\n/** The purpose of this class is to house RPC methods for developer tools.\n * Note that this should NOT be used in production environments.\n * @internal\n */\nexport abstract class DevToolsRpcInterface extends RpcInterface { // eslint-disable-line deprecation/deprecation\n /** Returns the IModelReadRpcInterface instance for the frontend. */\n public static getClient(): DevToolsRpcInterface { return RpcManager.getClientForInterface(DevToolsRpcInterface); }\n\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"DevToolsRpcInterface\";\n\n /** The semantic version of the interface.\n * @note The DevToolsRpcInterface will remain at 0.x since it is for testing only and not intended for production.\n */\n public static interfaceVersion = \"0.7.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in this folder for the semantic versioning rules.\n ==========================================================================================*/\n // Sends a ping and returns true if the backend received the ping\n public async ping(_iModelToken: IModelRpcProps): Promise<boolean> { return this.forward(arguments); }\n\n // Returns JSON object with backend performance and memory statistics\n public async stats(_iModelToken: IModelRpcProps, _options: DevToolsStatsOptions): Promise<any> { return this.forward(arguments); }\n\n // Returns JSON object with backend versions (application and iModelJs)\n public async versions(_iModelToken: IModelRpcProps): Promise<any> {\n const versions = await this.forward(arguments) || {};\n versions.availableRpcs = await RpcManager.describeAvailableEndpoints();\n return versions;\n }\n\n // Sets a new log level for the specified category and returns the old log level\n public async setLogLevel(_iModelToken: IModelRpcProps, _loggerCategory: string, _logLevel: LogLevel): Promise<LogLevel | undefined> { return this.forward(arguments); }\n}\n"]}
|