@itwin/core-common 5.0.0-dev.6 → 5.0.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/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/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.d.ts +1 -1
- package/lib/cjs/Fonts.d.ts.map +1 -1
- package/lib/cjs/Fonts.js +2 -2
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinError.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.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/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/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.d.ts +1 -1
- package/lib/esm/Fonts.d.ts.map +1 -1
- package/lib/esm/Fonts.js +2 -2
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinError.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.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +7 -7
package/lib/esm/IModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAc,IAAI,EAAc,YAAY,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvI,OAAO,EACE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAkB,QAAQ,EAC9H,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAqN5C;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAcvB,uFAAuF;IAChF,YAAY,KAAgB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE5D,2FAA2F;IAC3F,YAAY,KAAwB;QAPpC,mFAAmF;QAClE,eAAU,GAAc,SAAS,CAAC,cAAc,EAAE,CAAC;QAOlE,IAAI,CAA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AAE,MAAgB,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;AAhStJ,sCAAsC;AACf,wBAAiB,GAAe,KAAK,AAApB,CAAqB;AAC7D,0CAA0C;AACnB,oBAAa,GAAe,KAAK,AAApB,CAAqB;AACzD,sCAAsC;AACf,mBAAY,GAAe,MAAM,AAArB,CAAsB","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 iModels\r\n */\r\n\r\nimport { assert, BeEvent, GeoServiceStatus, GuidString, Id64, Id64String, IModelStatus, Mutable, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Range3dProps, Transform, TransformProps, Vector3d, XYAndZ, XYZProps,\r\n YawPitchRollAngles, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { ChangesetIdWithIndex } from \"./ChangesetProps\";\r\nimport { Cartographic, CartographicProps } from \"./geometry/Cartographic\";\r\nimport { GeographicCRS, GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { AxisAlignedBox3d } from \"./geometry/Placement\";\r\nimport { IModelError } from \"./IModelError\";\r\nimport { ThumbnailProps } from \"./Thumbnail\";\r\n\r\n/** The properties to open a connection to an iModel for RPC operations.\r\n * @public\r\n */\r\nexport interface IModelRpcOpenProps {\r\n /** The iTwin in which the iModel exists - must be defined for briefcases that are synchronized with iModelHub. */\r\n readonly iTwinId?: GuidString;\r\n /** Guid of the iModel. */\r\n readonly iModelId?: GuidString;\r\n\r\n /** Id of the last Changeset that was applied to the iModel - must be defined for briefcases that are synchronized with iModelHub.\r\n * @note Changeset Ids are string hash values based on the content and parent.\r\n */\r\n readonly changeset?: ChangesetIdWithIndex;\r\n}\r\n\r\n/** The properties that identify an opened iModel for RPC operations.\r\n * @public\r\n */\r\nexport interface IModelRpcProps extends IModelRpcOpenProps {\r\n /** Unique key used for identifying the iModel between the frontend and the backend */\r\n readonly key: string;\r\n}\r\n\r\n/** Properties that position an iModel on the earth via [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\r\n * The origin is specified as an ECEF coordinate. The cartographicOrigin property contains the latitude, longitude and elevation above the WGS84 ellipsoid\r\n * of the origin property. This cartographicOrigin is offered as a convenient pre-calculated value representing the location of the ECEF origin.\r\n * The 3D coordinate system this class represents is positioned at specified origin and the axis positioned according to\r\n * the other properties.\r\n * If transform property is defined then it will not be computed from other properties.\r\n * If the xVector and yVector properties are defined (and transform is not defined) then they take precedence over the YawPitchRoll orientation property. The xVector and yVector\r\n * represent the direction and scale of the X and Y axes. The Z axis is always perpendicular (according to the right hand rule) to these X-Y axes.\r\n * The scaling in the Z direction is always unity. The scale of the X and Y axes is represented by the size of the vector length.\r\n * If the xVector and yVector are not present then the YawPitchRoll properties indicates the angles for all tree axes. Scaling in that case\r\n * is unity in all three directions.\r\n * Note that the present class is intended to represent geolocated 3D coordinate systems that are normally tangent to the WGS84 ellipsoid\r\n * possibly offset in altitude by the terrain elevation above the ellipsoid but other general 3D coordinate systems\r\n * can be defined.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface EcefLocationProps {\r\n /** The Origin of an iModel on the earth in ECEF coordinates */\r\n readonly origin: XYZProps;\r\n /** The [orientation](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion) of an iModel on the earth. */\r\n readonly orientation: YawPitchRollProps;\r\n /** Optional position on the earth used to establish the ECEF coordinates. */\r\n readonly cartographicOrigin?: CartographicProps;\r\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n readonly xVector?: XYZProps;\r\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n readonly yVector?: XYZProps;\r\n /** Optional potentially non-rigid transform defining the ECEF location.\r\n * @note If this property is supplied, the other properties are ignored.\r\n */\r\n readonly transform?: TransformProps;\r\n}\r\n\r\n/** Properties of the [Root Subject]($docs/bis/guide/references/glossary#subject-root).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface RootSubjectProps {\r\n /** The name of the root subject. */\r\n readonly name: string;\r\n /** Description of the root subject (optional). */\r\n readonly description?: string;\r\n}\r\n\r\n/** Properties of an iModel that are always held in memory whenever one is opened, both on the frontend and on the backend .\r\n * @public\r\n */\r\nexport interface IModelProps {\r\n /** The name and description of the root subject of this iModel */\r\n readonly rootSubject: RootSubjectProps;\r\n /** The volume of the entire project, in spatial coordinates */\r\n readonly projectExtents?: Range3dProps;\r\n /** An offset to be applied to all spatial coordinates. This is normally used to transform spatial coordinates into the Cartesian coordinate system of a Geographic Coordinate System. */\r\n readonly globalOrigin?: XYZProps;\r\n /** The location of the iModel in Earth Centered Earth Fixed coordinates. iModel units are always meters */\r\n readonly ecefLocation?: EcefLocationProps;\r\n /** The Geographic Coordinate Reference System indicating the projection and datum used. */\r\n readonly geographicCoordinateSystem?: GeographicCRSProps;\r\n /** The name of the iModel. */\r\n readonly name?: string;\r\n}\r\n\r\n/** The properties returned by the backend when creating a new [[IModelConnection]] from the frontend, either with Rpc or with Ipc.\r\n * These properties describe the iModel held on the backend for thew newly formed connection and are used to construct a new\r\n * [[IModelConnection]] instance on the frontend to access it.\r\n * @public\r\n */\r\nexport type IModelConnectionProps = IModelProps & IModelRpcProps;\r\n\r\n/** The properties that can be supplied when creating a *new* iModel.\r\n * @public\r\n */\r\nexport interface CreateIModelProps extends IModelProps {\r\n /** The GUID of new iModel. If not present, a GUID will be generated. */\r\n readonly guid?: GuidString;\r\n /** Client name for new iModel */\r\n readonly client?: string;\r\n /** Thumbnail for new iModel\r\n * @alpha\r\n */\r\n readonly thumbnail?: ThumbnailProps;\r\n}\r\n\r\n/**\r\n * Encryption-related properties that can be supplied when creating or opening snapshot iModels.\r\n * @public\r\n * @deprecated in 3.x. **NOTE**, encrypted iModels are no longer supported since they require licensed code.\r\n */\r\nexport interface IModelEncryptionProps {\r\n /** The password used to encrypt/decrypt the snapshot iModel. */\r\n readonly password?: string;\r\n}\r\n\r\n/**\r\n * Sqlite options.\r\n * @public\r\n */\r\nexport interface OpenSqliteArgs {\r\n /**\r\n * Specify timeout after which SQLite stop retrying to acquire lock to database file and throw SQLITE_BUSY error.\r\n * Timeout is specified in milliseconds.\r\n * For more information https://www.sqlite.org/c3ref/busy_timeout.html.\r\n * */\r\n readonly busyTimeout?: number;\r\n}\r\n\r\n/**\r\n * A key used to identify an opened [IModelDb]($backend) between the frontend and backend for Rpc and Ipc communications.\r\n * Keys must be unique - that is there can never be two IModelDbs opened with the same key at any given time.\r\n * If no key is supplied in a call to open an IModelDb, one is generated and returned.\r\n * It is only necessary to supply a key if you have some reason to assign a specific value to identify an IModelDb.\r\n * If you don't supply the key, you must use the returned value for Rpc and Ipc communications.\r\n * @public\r\n */\r\nexport interface OpenDbKey {\r\n readonly key?: string;\r\n}\r\n\r\n/** @beta TODO documentation */\r\nexport interface CloudContainerUri {\r\n readonly uriParams: string;\r\n}\r\n\r\n/** Options to open a [SnapshotDb]($backend).\r\n * @public\r\n */\r\nexport interface SnapshotOpenOptions extends IModelEncryptionProps, OpenDbKey { // eslint-disable-line @typescript-eslint/no-deprecated\r\n /**\r\n * The \"base\" name that can be used for creating temporary files related to this Db.\r\n * The string should be a name related to the current Db filename using some known pattern so that all files named \"baseName*\" can be deleted externally during cleanup.\r\n * It must be the name of a file (that may or may not exist) in a writable directory.\r\n * If not present, the baseName will default to the database's file name (including the path).\r\n * @internal\r\n */\r\n readonly tempFileBase?: string;\r\n}\r\n\r\n/** Options to open a [StandaloneDb]($backend) via [StandaloneDb.openFile]($backend) from the backend,\r\n * or [BriefcaseConnection.openStandalone]($frontend) from the frontend.\r\n * @public\r\n */\r\nexport type StandaloneOpenOptions = OpenDbKey;\r\n\r\n/** Options that can be supplied when creating snapshot iModels.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface CreateSnapshotIModelProps extends IModelEncryptionProps {\r\n /** If true, then create SQLite views for Model, Element, ElementAspect, and Relationship classes.\r\n * These database views can often be useful for interoperability workflows.\r\n */\r\n readonly createClassViews?: boolean;\r\n}\r\n\r\n/** The options that can be specified when creating an *empty* snapshot iModel.\r\n * @see [SnapshotDb.createEmpty]($backend)\r\n * @public\r\n */\r\nexport type CreateEmptySnapshotIModelProps = CreateIModelProps & CreateSnapshotIModelProps;\r\n\r\n/** Options that can be supplied when creating standalone iModels.\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface CreateStandaloneIModelProps extends IModelEncryptionProps {\r\n /** If present, file will allow local editing, but cannot be used to create changesets */\r\n readonly allowEdit?: string;\r\n}\r\n\r\n/** The options that can be specified when creating an *empty* standalone iModel.\r\n * @see [standalone.createEmpty]($backend)\r\n * @internal\r\n */\r\nexport type CreateEmptyStandaloneIModelProps = CreateIModelProps & CreateStandaloneIModelProps;\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FilePropertyProps {\r\n readonly namespace: string;\r\n readonly name: string;\r\n id?: number | string;\r\n subId?: number | string;\r\n}\r\n\r\n/** The position and orientation of an iModel on the earth in [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\r\n * @note This is an immutable type - all of its properties are frozen.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n * @public\r\n */\r\nexport class EcefLocation implements EcefLocationProps {\r\n /** The origin of the ECEF transform. */\r\n public readonly origin: Point3d;\r\n /** The orientation of the ECEF transform */\r\n public readonly orientation: YawPitchRollAngles;\r\n /** Optional position on the earth used to establish the ECEF origin and orientation. */\r\n public readonly cartographicOrigin?: Cartographic;\r\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n public readonly xVector?: Vector3d;\r\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\r\n public readonly yVector?: Vector3d;\r\n /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */\r\n private readonly _transform: Transform = Transform.createIdentity();\r\n\r\n /** Get the transform from iModel Spatial coordinates to ECEF from this EcefLocation */\r\n public getTransform(): Transform { return this._transform; }\r\n\r\n /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */\r\n constructor(props: EcefLocationProps) {\r\n this.origin = Point3d.fromJSON(props.origin).freeze();\r\n this.orientation = YawPitchRollAngles.fromJSON(props.orientation).freeze();\r\n if (props.cartographicOrigin)\r\n this.cartographicOrigin = Cartographic.fromRadians({ longitude: props.cartographicOrigin.longitude, latitude: props.cartographicOrigin.latitude, height: props.cartographicOrigin.height }).freeze();\r\n if (props.xVector && props.yVector) {\r\n this.xVector = Vector3d.fromJSON(props.xVector).freeze();\r\n this.yVector = Vector3d.fromJSON(props.yVector).freeze();\r\n }\r\n if (props.transform) {\r\n this._transform.setFromJSON(props.transform);\r\n this._transform.freeze();\r\n } else {\r\n let matrix;\r\n if (this.xVector && this.yVector) {\r\n const zVector = this.xVector.crossProduct(this.yVector);\r\n if (zVector.normalizeInPlace())\r\n matrix = Matrix3d.createColumns(this.xVector, this.yVector, zVector);\r\n }\r\n if (!matrix)\r\n matrix = this.orientation.toMatrix3d();\r\n\r\n this._transform = Transform.createOriginAndMatrix(this.origin, matrix);\r\n this._transform.freeze();\r\n }\r\n }\r\n\r\n /** Returns true if this EcefLocation is not located at the center of the Earth.\r\n * @alpha are locations very close to the center considered valid? What are the specific criteria?\r\n */\r\n public get isValid(): boolean {\r\n return !this.origin.isZero;\r\n }\r\n\r\n /** Construct ECEF Location from cartographic origin with optional known point and angle. */\r\n public static createFromCartographicOrigin(origin: Cartographic, point?: Point3d, angle?: Angle) {\r\n const ecefOrigin = origin.toEcef();\r\n const deltaRadians = 10 / Constant.earthRadiusWGS84.polar;\r\n const northCarto = Cartographic.fromRadians({ longitude: origin.longitude, latitude: origin.latitude + deltaRadians, height: origin.height });\r\n const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });\r\n const ecefNorth = northCarto.toEcef();\r\n const ecefEast = eastCarto.toEcef();\r\n const xVector = Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize();\r\n const yVector = Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize();\r\n const matrix = Matrix3d.createRigidFromColumns(xVector!, yVector!, AxisOrder.XYZ)!;\r\n if (angle !== undefined) {\r\n const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);\r\n matrix.multiplyMatrixMatrix(north, matrix);\r\n }\r\n if (point !== undefined) {\r\n const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));\r\n ecefOrigin.addInPlace(delta);\r\n }\r\n\r\n return new EcefLocation({ origin: ecefOrigin, orientation: YawPitchRollAngles.createFromMatrix3d(matrix)!, cartographicOrigin: origin });\r\n }\r\n\r\n /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */\r\n public static createFromTransform(transform: Transform): EcefLocation {\r\n const ecefOrigin = transform.getOrigin();\r\n const angleFromInput = YawPitchRollAngles.createDegrees(0, 0, 0);\r\n const locationOrientationFromInputT = YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);\r\n const transformProps = transform.toJSON();\r\n\r\n return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });\r\n }\r\n\r\n /** Get the location center of the earth in the iModel coordinate system. */\r\n public get earthCenter(): Point3d {\r\n const matrix = this.orientation.toMatrix3d();\r\n return Point3d.createFrom(matrix.multiplyTransposeXYZ(-this.origin.x, -this.origin.y, -this.origin.z));\r\n }\r\n\r\n /** Return true if this location is equivalent to another location within a small tolerance. */\r\n public isAlmostEqual(other: EcefLocation): boolean {\r\n if (!this.origin.isAlmostEqual(other.origin) || !this.orientation.isAlmostEqual(other.orientation))\r\n return false;\r\n\r\n if ((this.xVector === undefined) !== (other.xVector === undefined) || (this.yVector === undefined) !== (other.yVector === undefined))\r\n return false;\r\n\r\n if (this.xVector !== undefined && other.xVector !== undefined && !this.xVector.isAlmostEqual(other.xVector))\r\n return false;\r\n\r\n if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))\r\n return false;\r\n\r\n if (!this.getTransform().isAlmostEqual(other.getTransform()))\r\n return false;\r\n\r\n const thisCarto = this.cartographicOrigin;\r\n const otherCarto = other.cartographicOrigin;\r\n if (undefined === thisCarto || undefined === otherCarto)\r\n return undefined === thisCarto && undefined === otherCarto;\r\n\r\n return thisCarto.equalsEpsilon(otherCarto, Geometry.smallMetricDistance);\r\n }\r\n\r\n public toJSON(): EcefLocationProps {\r\n const props: Mutable<EcefLocationProps> = {\r\n origin: this.origin.toJSON(),\r\n orientation: this.orientation.toJSON(),\r\n transform: this.getTransform().toJSON(),\r\n };\r\n\r\n if (this.cartographicOrigin)\r\n props.cartographicOrigin = this.cartographicOrigin.toJSON();\r\n\r\n if (this.xVector)\r\n props.xVector = this.xVector.toJSON();\r\n\r\n if (this.yVector)\r\n props.yVector = this.yVector.toJSON();\r\n\r\n return props;\r\n }\r\n}\r\n\r\n/** Represents an iModel in JavaScript.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n * @public\r\n */\r\nexport abstract class IModel implements IModelProps {\r\n private _projectExtents?: AxisAlignedBox3d;\r\n private _name?: string;\r\n private _rootSubject?: RootSubjectProps;\r\n private _globalOrigin?: Point3d;\r\n private _ecefLocation?: EcefLocation;\r\n private _geographicCoordinateSystem?: GeographicCRS;\r\n private _iModelId?: GuidString;\r\n private _changeset: ChangesetIdWithIndex;\r\n\r\n /** The Id of the repository model. */\r\n public static readonly repositoryModelId: Id64String = \"0x1\";\r\n /** The Id of the root subject element. */\r\n public static readonly rootSubjectId: Id64String = \"0x1\";\r\n /** The Id of the dictionary model. */\r\n public static readonly dictionaryId: Id64String = \"0x10\";\r\n\r\n /** Event raised after [[name]] changes. */\r\n public readonly onNameChanged = new BeEvent<(previousName: string) => void>();\r\n /** Event raised after [[rootSubject]] changes. */\r\n public readonly onRootSubjectChanged = new BeEvent<(previousSubject: RootSubjectProps) => void>();\r\n /** Event raised after [[projectExtents]] changes. */\r\n public readonly onProjectExtentsChanged = new BeEvent<(previousExtents: AxisAlignedBox3d) => void>();\r\n /** Event raised after [[globalOrigin]] changes. */\r\n public readonly onGlobalOriginChanged = new BeEvent<(previousOrigin: Point3d) => void>();\r\n /** Event raised after [[ecefLocation]] changes. */\r\n public readonly onEcefLocationChanged = new BeEvent<(previousLocation: EcefLocation | undefined) => void>();\r\n /** Event raised after [[geographicCoordinateSystem]] changes. */\r\n public readonly onGeographicCoordinateSystemChanged = new BeEvent<(previousGCS: GeographicCRS | undefined) => void>();\r\n /** Event raised after [[changeset]] changes. */\r\n public readonly onChangesetChanged = new BeEvent<(previousChangeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Name of the iModel */\r\n public get name(): string {\r\n assert(this._name !== undefined);\r\n return this._name;\r\n }\r\n public set name(name: string) {\r\n if (name !== this._name) {\r\n const old = this._name;\r\n this._name = name;\r\n if (undefined !== old)\r\n this.onNameChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** The name and description of the root subject of this iModel */\r\n public get rootSubject(): RootSubjectProps {\r\n assert(this._rootSubject !== undefined);\r\n return this._rootSubject;\r\n }\r\n public set rootSubject(subject: RootSubjectProps) {\r\n if (undefined === this._rootSubject || this._rootSubject.name !== subject.name || this._rootSubject.description !== subject.description) {\r\n const old = this._rootSubject;\r\n this._rootSubject = subject;\r\n if (old)\r\n this.onRootSubjectChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** Returns `true` if this is a snapshot iModel. */\r\n public abstract get isSnapshot(): boolean;\r\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\r\n public abstract get isBriefcase(): boolean;\r\n\r\n public abstract get isOpen(): boolean;\r\n\r\n /**\r\n * The volume, in spatial coordinates, inside which the entire project is contained.\r\n * @note The object returned from this method is frozen. You *must* make a copy before you do anything that might attempt to modify it.\r\n */\r\n public get projectExtents() {\r\n assert(undefined !== this._projectExtents);\r\n return this._projectExtents;\r\n }\r\n public set projectExtents(extents: AxisAlignedBox3d) {\r\n // Don't allow any axis of the project extents to be less than 1 meter.\r\n const projectExtents = extents.clone();\r\n projectExtents.ensureMinLengths(1.0);\r\n if (!this._projectExtents || !this._projectExtents.isAlmostEqual(projectExtents)) {\r\n const old = this._projectExtents;\r\n projectExtents.freeze();\r\n this._projectExtents = projectExtents;\r\n if (old)\r\n this.onProjectExtentsChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** An offset to be applied to all spatial coordinates. */\r\n public get globalOrigin(): Point3d {\r\n assert(this._globalOrigin !== undefined);\r\n return this._globalOrigin;\r\n }\r\n public set globalOrigin(org: Point3d) {\r\n if (!this._globalOrigin || !this._globalOrigin.isAlmostEqual(org)) {\r\n const old = this._globalOrigin;\r\n org.freeze();\r\n this._globalOrigin = org;\r\n if (old)\r\n this.onGlobalOriginChanged.raiseEvent(old);\r\n }\r\n }\r\n\r\n /** The [EcefLocation]($docs/learning/glossary#ecefLocation) of the iModel in Earth Centered Earth Fixed coordinates.\r\n * If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a\r\n * 3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem\r\n * property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the\r\n * iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that\r\n * results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.\r\n * If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective\r\n * cartographic projection used and a linear transformation should then be calculated at the exact origin of the data\r\n * it must position.\r\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\r\n */\r\n public get ecefLocation(): EcefLocation | undefined {\r\n return this._ecefLocation;\r\n }\r\n public set ecefLocation(ecefLocation: EcefLocation | undefined) {\r\n const old = this._ecefLocation;\r\n if (!old && !ecefLocation)\r\n return;\r\n else if (old && ecefLocation && old.isAlmostEqual(ecefLocation))\r\n return;\r\n\r\n this._ecefLocation = ecefLocation;\r\n this.onEcefLocationChanged.raiseEvent(old);\r\n }\r\n\r\n /** Set the [EcefLocation]($docs/learning/glossary#ecefLocation) for this iModel. */\r\n public setEcefLocation(ecef: EcefLocationProps): void {\r\n this.ecefLocation = new EcefLocation(ecef);\r\n }\r\n\r\n /** The geographic coordinate reference system of the iModel. */\r\n public get geographicCoordinateSystem(): GeographicCRS | undefined {\r\n return this._geographicCoordinateSystem;\r\n }\r\n public set geographicCoordinateSystem(geoCRS: GeographicCRS | undefined) {\r\n const old = this._geographicCoordinateSystem;\r\n if (!old && !geoCRS)\r\n return;\r\n else if (old && geoCRS && old.equals(geoCRS))\r\n return;\r\n\r\n this._geographicCoordinateSystem = geoCRS;\r\n this.onGeographicCoordinateSystemChanged.raiseEvent(old);\r\n }\r\n\r\n /** Sets the geographic coordinate reference system from GeographicCRSProps. */\r\n public setGeographicCoordinateSystem(geoCRS: GeographicCRSProps) {\r\n this.geographicCoordinateSystem = new GeographicCRS(geoCRS);\r\n }\r\n\r\n /** @internal */\r\n public getConnectionProps(): IModelConnectionProps {\r\n return {\r\n name: this.name,\r\n rootSubject: this.rootSubject,\r\n projectExtents: this.projectExtents.toJSON(),\r\n globalOrigin: this.globalOrigin.toJSON(),\r\n ecefLocation: this.ecefLocation,\r\n geographicCoordinateSystem: this.geographicCoordinateSystem,\r\n ... this._getRpcProps(),\r\n };\r\n }\r\n\r\n /** Convert this iModel to a JSON representation. */\r\n public toJSON(): IModelConnectionProps {\r\n return this.getConnectionProps();\r\n }\r\n\r\n /** A key used to identify this iModel in RPC calls from frontend to backend.\r\n * @internal\r\n */\r\n protected _fileKey: string;\r\n /** Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications. */\r\n public get key(): string { return this._fileKey; }\r\n\r\n /** @internal */\r\n protected _iTwinId?: GuidString;\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public get iTwinId(): GuidString | undefined { return this._iTwinId; }\r\n\r\n /** The Guid that identifies this iModel. */\r\n public get iModelId(): GuidString | undefined { return this._iModelId; }\r\n\r\n /** @public */\r\n public get changeset(): ChangesetIdWithIndex {\r\n return { ...this._changeset };\r\n }\r\n public set changeset(changeset: ChangesetIdWithIndex) {\r\n const prev = this._changeset;\r\n if (prev.id !== changeset.id || prev.index !== changeset.index) {\r\n this._changeset = { id: changeset.id, index: changeset.index };\r\n this.onChangesetChanged.raiseEvent(prev);\r\n }\r\n }\r\n\r\n protected _openMode = OpenMode.Readonly;\r\n /** The [[OpenMode]] used for this IModel. */\r\n public get openMode(): OpenMode { return this._openMode; }\r\n\r\n /** Return a token for RPC operations.\r\n * @throws IModelError if the iModel is not open.\r\n */\r\n public getRpcProps(): IModelRpcProps {\r\n if (!this.isOpen)\r\n throw new IModelError(IModelStatus.BadRequest, \"IModel is not open for rpc\");\r\n\r\n return this._getRpcProps();\r\n }\r\n\r\n /** Returns the iModel's RPC properties.\r\n * @note It is an error to attempt to use these properties as a token for RPC operations if the iModel is not open.\r\n * @internal\r\n */\r\n protected _getRpcProps(): IModelRpcProps {\r\n return {\r\n key: this._fileKey,\r\n iTwinId: this.iTwinId,\r\n iModelId: this.iModelId,\r\n changeset: this.changeset,\r\n };\r\n }\r\n\r\n /** @internal */\r\n protected constructor(tokenProps?: IModelRpcProps) {\r\n this._changeset = tokenProps?.changeset ?? { id: \"\", index: 0 };\r\n this._fileKey = \"\";\r\n if (tokenProps) {\r\n this._fileKey = tokenProps.key;\r\n this._iTwinId = tokenProps.iTwinId;\r\n this._iModelId = tokenProps.iModelId;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected initialize(name: string, props: IModelProps) {\r\n this.name = name;\r\n this.rootSubject = props.rootSubject;\r\n this.projectExtents = Range3d.fromJSON(props.projectExtents);\r\n this.globalOrigin = Point3d.fromJSON(props.globalOrigin);\r\n\r\n const ecefLocation = props.ecefLocation ? new EcefLocation(props.ecefLocation) : undefined;\r\n this.ecefLocation = ecefLocation?.isValid ? ecefLocation : undefined;\r\n\r\n this.geographicCoordinateSystem = props.geographicCoordinateSystem ? new GeographicCRS(props.geographicCoordinateSystem) : undefined;\r\n }\r\n\r\n /** Get the default subCategoryId for the supplied categoryId */\r\n public static getDefaultSubCategoryId(categoryId: Id64String): Id64String {\r\n return Id64.isValid(categoryId) ? Id64.fromLocalAndBriefcaseIds(Id64.getLocalId(categoryId) + 1, Id64.getBriefcaseId(categoryId)) : Id64.invalid;\r\n }\r\n\r\n /** True if this iModel has an [EcefLocation]($docs/learning/glossary#ecefLocation). */\r\n public get isGeoLocated() { return undefined !== this._ecefLocation; }\r\n\r\n /** Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its [[IModel.ecefLocation]].\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public getEcefTransform(): Transform {\r\n if (undefined === this._ecefLocation)\r\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\r\n return this._ecefLocation.getTransform();\r\n }\r\n\r\n /** Convert a point in this iModel's Spatial coordinates to an ECEF point using its [[IModel.ecefLocation]].\r\n * @param spatial A point in the iModel's spatial coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Point3d in ECEF coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyPoint3d(spatial, result); }\r\n\r\n /** Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its [[ecefLocation]].\r\n * @param ecef A point in ECEF coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Point3d in this iModel's spatial coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\r\n */\r\n public ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyInversePoint3d(ecef, result)!; }\r\n\r\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].\r\n * @param spatial A point in the iModel's spatial coordinates\r\n * @param result If defined, use this for output\r\n * @returns A Cartographic location\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n */\r\n public spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic { return Cartographic.fromEcef(this.spatialToEcef(spatial), result)!; }\r\n\r\n /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].\r\n * @param cartographic A cartographic location\r\n * @param result If defined, use this for output\r\n * @returns A point in this iModel's spatial coordinates\r\n * @throws IModelError if [[isGeoLocated]] is false.\r\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\r\n */\r\n public cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d) { return this.ecefToSpatial(cartographic.toEcef(result), result); }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAc,IAAI,EAAc,YAAY,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvI,OAAO,EACE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAkB,QAAQ,EAC9H,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,sCA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AAC,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC;IAEvI;;;;;OAKG;IACI,6BAA6B,CAAC,OAAe,EAAE,MAAqB,IAAkB,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC;IAElK;;;;;;OAMG;IACI,6BAA6B,CAAC,YAA0B,EAAE,MAAgB,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;AAhStJ,sCAAsC;AACf,wBAAiB,GAAe,KAAK,AAApB,CAAqB;AAC7D,0CAA0C;AACnB,oBAAa,GAAe,KAAK,AAApB,CAAqB;AACzD,sCAAsC;AACf,mBAAY,GAAe,MAAM,AAArB,CAAsB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { assert, BeEvent, GeoServiceStatus, GuidString, Id64, Id64String, IModelStatus, Mutable, OpenMode } from \"@itwin/core-bentley\";\nimport {\n Angle, AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Range3dProps, Transform, TransformProps, Vector3d, XYAndZ, XYZProps,\n YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ChangesetIdWithIndex } from \"./ChangesetProps\";\nimport { Cartographic, CartographicProps } from \"./geometry/Cartographic\";\nimport { GeographicCRS, GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\nimport { AxisAlignedBox3d } from \"./geometry/Placement\";\nimport { IModelError } from \"./IModelError\";\nimport { ThumbnailProps } from \"./Thumbnail\";\n\n/** The properties to open a connection to an iModel for RPC operations.\n * @public\n */\nexport interface IModelRpcOpenProps {\n /** The iTwin in which the iModel exists - must be defined for briefcases that are synchronized with iModelHub. */\n readonly iTwinId?: GuidString;\n /** Guid of the iModel. */\n readonly iModelId?: GuidString;\n\n /** Id of the last Changeset that was applied to the iModel - must be defined for briefcases that are synchronized with iModelHub.\n * @note Changeset Ids are string hash values based on the content and parent.\n */\n readonly changeset?: ChangesetIdWithIndex;\n}\n\n/** The properties that identify an opened iModel for RPC operations.\n * @public\n */\nexport interface IModelRpcProps extends IModelRpcOpenProps {\n /** Unique key used for identifying the iModel between the frontend and the backend */\n readonly key: string;\n}\n\n/** Properties that position an iModel on the earth via [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\n * The origin is specified as an ECEF coordinate. The cartographicOrigin property contains the latitude, longitude and elevation above the WGS84 ellipsoid\n * of the origin property. This cartographicOrigin is offered as a convenient pre-calculated value representing the location of the ECEF origin.\n * The 3D coordinate system this class represents is positioned at specified origin and the axis positioned according to\n * the other properties.\n * If transform property is defined then it will not be computed from other properties.\n * If the xVector and yVector properties are defined (and transform is not defined) then they take precedence over the YawPitchRoll orientation property. The xVector and yVector\n * represent the direction and scale of the X and Y axes. The Z axis is always perpendicular (according to the right hand rule) to these X-Y axes.\n * The scaling in the Z direction is always unity. The scale of the X and Y axes is represented by the size of the vector length.\n * If the xVector and yVector are not present then the YawPitchRoll properties indicates the angles for all tree axes. Scaling in that case\n * is unity in all three directions.\n * Note that the present class is intended to represent geolocated 3D coordinate systems that are normally tangent to the WGS84 ellipsoid\n * possibly offset in altitude by the terrain elevation above the ellipsoid but other general 3D coordinate systems\n * can be defined.\n * @public\n * @extensions\n */\nexport interface EcefLocationProps {\n /** The Origin of an iModel on the earth in ECEF coordinates */\n readonly origin: XYZProps;\n /** The [orientation](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion) of an iModel on the earth. */\n readonly orientation: YawPitchRollProps;\n /** Optional position on the earth used to establish the ECEF coordinates. */\n readonly cartographicOrigin?: CartographicProps;\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\n readonly xVector?: XYZProps;\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\n readonly yVector?: XYZProps;\n /** Optional potentially non-rigid transform defining the ECEF location.\n * @note If this property is supplied, the other properties are ignored.\n */\n readonly transform?: TransformProps;\n}\n\n/** Properties of the [Root Subject]($docs/bis/guide/references/glossary#subject-root).\n * @public\n * @extensions\n */\nexport interface RootSubjectProps {\n /** The name of the root subject. */\n readonly name: string;\n /** Description of the root subject (optional). */\n readonly description?: string;\n}\n\n/** Properties of an iModel that are always held in memory whenever one is opened, both on the frontend and on the backend .\n * @public\n */\nexport interface IModelProps {\n /** The name and description of the root subject of this iModel */\n readonly rootSubject: RootSubjectProps;\n /** The volume of the entire project, in spatial coordinates */\n readonly projectExtents?: Range3dProps;\n /** An offset to be applied to all spatial coordinates. This is normally used to transform spatial coordinates into the Cartesian coordinate system of a Geographic Coordinate System. */\n readonly globalOrigin?: XYZProps;\n /** The location of the iModel in Earth Centered Earth Fixed coordinates. iModel units are always meters */\n readonly ecefLocation?: EcefLocationProps;\n /** The Geographic Coordinate Reference System indicating the projection and datum used. */\n readonly geographicCoordinateSystem?: GeographicCRSProps;\n /** The name of the iModel. */\n readonly name?: string;\n}\n\n/** The properties returned by the backend when creating a new [[IModelConnection]] from the frontend, either with Rpc or with Ipc.\n * These properties describe the iModel held on the backend for thew newly formed connection and are used to construct a new\n * [[IModelConnection]] instance on the frontend to access it.\n * @public\n */\nexport type IModelConnectionProps = IModelProps & IModelRpcProps;\n\n/** The properties that can be supplied when creating a *new* iModel.\n * @public\n */\nexport interface CreateIModelProps extends IModelProps {\n /** The GUID of new iModel. If not present, a GUID will be generated. */\n readonly guid?: GuidString;\n /** Client name for new iModel */\n readonly client?: string;\n /** Thumbnail for new iModel\n * @alpha\n */\n readonly thumbnail?: ThumbnailProps;\n}\n\n/**\n * Encryption-related properties that can be supplied when creating or opening snapshot iModels.\n * @public\n * @deprecated in 3.x. **NOTE**, encrypted iModels are no longer supported since they require licensed code.\n */\nexport interface IModelEncryptionProps {\n /** The password used to encrypt/decrypt the snapshot iModel. */\n readonly password?: string;\n}\n\n/**\n * Sqlite options.\n * @public\n */\nexport interface OpenSqliteArgs {\n /**\n * Specify timeout after which SQLite stop retrying to acquire lock to database file and throw SQLITE_BUSY error.\n * Timeout is specified in milliseconds.\n * For more information https://www.sqlite.org/c3ref/busy_timeout.html.\n * */\n readonly busyTimeout?: number;\n}\n\n/**\n * A key used to identify an opened [IModelDb]($backend) between the frontend and backend for Rpc and Ipc communications.\n * Keys must be unique - that is there can never be two IModelDbs opened with the same key at any given time.\n * If no key is supplied in a call to open an IModelDb, one is generated and returned.\n * It is only necessary to supply a key if you have some reason to assign a specific value to identify an IModelDb.\n * If you don't supply the key, you must use the returned value for Rpc and Ipc communications.\n * @public\n */\nexport interface OpenDbKey {\n readonly key?: string;\n}\n\n/** @beta TODO documentation */\nexport interface CloudContainerUri {\n readonly uriParams: string;\n}\n\n/** Options to open a [SnapshotDb]($backend).\n * @public\n */\nexport interface SnapshotOpenOptions extends IModelEncryptionProps, OpenDbKey { // eslint-disable-line @typescript-eslint/no-deprecated\n /**\n * The \"base\" name that can be used for creating temporary files related to this Db.\n * The string should be a name related to the current Db filename using some known pattern so that all files named \"baseName*\" can be deleted externally during cleanup.\n * It must be the name of a file (that may or may not exist) in a writable directory.\n * If not present, the baseName will default to the database's file name (including the path).\n * @internal\n */\n readonly tempFileBase?: string;\n}\n\n/** Options to open a [StandaloneDb]($backend) via [StandaloneDb.openFile]($backend) from the backend,\n * or [BriefcaseConnection.openStandalone]($frontend) from the frontend.\n * @public\n */\nexport type StandaloneOpenOptions = OpenDbKey;\n\n/** Options that can be supplied when creating snapshot iModels.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface CreateSnapshotIModelProps extends IModelEncryptionProps {\n /** If true, then create SQLite views for Model, Element, ElementAspect, and Relationship classes.\n * These database views can often be useful for interoperability workflows.\n */\n readonly createClassViews?: boolean;\n}\n\n/** The options that can be specified when creating an *empty* snapshot iModel.\n * @see [SnapshotDb.createEmpty]($backend)\n * @public\n */\nexport type CreateEmptySnapshotIModelProps = CreateIModelProps & CreateSnapshotIModelProps;\n\n/** Options that can be supplied when creating standalone iModels.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface CreateStandaloneIModelProps extends IModelEncryptionProps {\n /** If present, file will allow local editing, but cannot be used to create changesets */\n readonly allowEdit?: string;\n}\n\n/** The options that can be specified when creating an *empty* standalone iModel.\n * @see [standalone.createEmpty]($backend)\n * @internal\n */\nexport type CreateEmptyStandaloneIModelProps = CreateIModelProps & CreateStandaloneIModelProps;\n\n/**\n * @public\n * @extensions\n */\nexport interface FilePropertyProps {\n readonly namespace: string;\n readonly name: string;\n id?: number | string;\n subId?: number | string;\n}\n\n/** The position and orientation of an iModel on the earth in [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\n * @note This is an immutable type - all of its properties are frozen.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n * @public\n */\nexport class EcefLocation implements EcefLocationProps {\n /** The origin of the ECEF transform. */\n public readonly origin: Point3d;\n /** The orientation of the ECEF transform */\n public readonly orientation: YawPitchRollAngles;\n /** Optional position on the earth used to establish the ECEF origin and orientation. */\n public readonly cartographicOrigin?: Cartographic;\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\n public readonly xVector?: Vector3d;\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\n public readonly yVector?: Vector3d;\n /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */\n private readonly _transform: Transform = Transform.createIdentity();\n\n /** Get the transform from iModel Spatial coordinates to ECEF from this EcefLocation */\n public getTransform(): Transform { return this._transform; }\n\n /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */\n constructor(props: EcefLocationProps) {\n this.origin = Point3d.fromJSON(props.origin).freeze();\n this.orientation = YawPitchRollAngles.fromJSON(props.orientation).freeze();\n if (props.cartographicOrigin)\n this.cartographicOrigin = Cartographic.fromRadians({ longitude: props.cartographicOrigin.longitude, latitude: props.cartographicOrigin.latitude, height: props.cartographicOrigin.height }).freeze();\n if (props.xVector && props.yVector) {\n this.xVector = Vector3d.fromJSON(props.xVector).freeze();\n this.yVector = Vector3d.fromJSON(props.yVector).freeze();\n }\n if (props.transform) {\n this._transform.setFromJSON(props.transform);\n this._transform.freeze();\n } else {\n let matrix;\n if (this.xVector && this.yVector) {\n const zVector = this.xVector.crossProduct(this.yVector);\n if (zVector.normalizeInPlace())\n matrix = Matrix3d.createColumns(this.xVector, this.yVector, zVector);\n }\n if (!matrix)\n matrix = this.orientation.toMatrix3d();\n\n this._transform = Transform.createOriginAndMatrix(this.origin, matrix);\n this._transform.freeze();\n }\n }\n\n /** Returns true if this EcefLocation is not located at the center of the Earth.\n * @alpha are locations very close to the center considered valid? What are the specific criteria?\n */\n public get isValid(): boolean {\n return !this.origin.isZero;\n }\n\n /** Construct ECEF Location from cartographic origin with optional known point and angle. */\n public static createFromCartographicOrigin(origin: Cartographic, point?: Point3d, angle?: Angle) {\n const ecefOrigin = origin.toEcef();\n const deltaRadians = 10 / Constant.earthRadiusWGS84.polar;\n const northCarto = Cartographic.fromRadians({ longitude: origin.longitude, latitude: origin.latitude + deltaRadians, height: origin.height });\n const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });\n const ecefNorth = northCarto.toEcef();\n const ecefEast = eastCarto.toEcef();\n const xVector = Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize();\n const yVector = Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize();\n const matrix = Matrix3d.createRigidFromColumns(xVector!, yVector!, AxisOrder.XYZ)!;\n if (angle !== undefined) {\n const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);\n matrix.multiplyMatrixMatrix(north, matrix);\n }\n if (point !== undefined) {\n const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));\n ecefOrigin.addInPlace(delta);\n }\n\n return new EcefLocation({ origin: ecefOrigin, orientation: YawPitchRollAngles.createFromMatrix3d(matrix)!, cartographicOrigin: origin });\n }\n\n /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */\n public static createFromTransform(transform: Transform): EcefLocation {\n const ecefOrigin = transform.getOrigin();\n const angleFromInput = YawPitchRollAngles.createDegrees(0, 0, 0);\n const locationOrientationFromInputT = YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);\n const transformProps = transform.toJSON();\n\n return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });\n }\n\n /** Get the location center of the earth in the iModel coordinate system. */\n public get earthCenter(): Point3d {\n const matrix = this.orientation.toMatrix3d();\n return Point3d.createFrom(matrix.multiplyTransposeXYZ(-this.origin.x, -this.origin.y, -this.origin.z));\n }\n\n /** Return true if this location is equivalent to another location within a small tolerance. */\n public isAlmostEqual(other: EcefLocation): boolean {\n if (!this.origin.isAlmostEqual(other.origin) || !this.orientation.isAlmostEqual(other.orientation))\n return false;\n\n if ((this.xVector === undefined) !== (other.xVector === undefined) || (this.yVector === undefined) !== (other.yVector === undefined))\n return false;\n\n if (this.xVector !== undefined && other.xVector !== undefined && !this.xVector.isAlmostEqual(other.xVector))\n return false;\n\n if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))\n return false;\n\n if (!this.getTransform().isAlmostEqual(other.getTransform()))\n return false;\n\n const thisCarto = this.cartographicOrigin;\n const otherCarto = other.cartographicOrigin;\n if (undefined === thisCarto || undefined === otherCarto)\n return undefined === thisCarto && undefined === otherCarto;\n\n return thisCarto.equalsEpsilon(otherCarto, Geometry.smallMetricDistance);\n }\n\n public toJSON(): EcefLocationProps {\n const props: Mutable<EcefLocationProps> = {\n origin: this.origin.toJSON(),\n orientation: this.orientation.toJSON(),\n transform: this.getTransform().toJSON(),\n };\n\n if (this.cartographicOrigin)\n props.cartographicOrigin = this.cartographicOrigin.toJSON();\n\n if (this.xVector)\n props.xVector = this.xVector.toJSON();\n\n if (this.yVector)\n props.yVector = this.yVector.toJSON();\n\n return props;\n }\n}\n\n/** Represents an iModel in JavaScript.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n * @public\n */\nexport abstract class IModel implements IModelProps {\n private _projectExtents?: AxisAlignedBox3d;\n private _name?: string;\n private _rootSubject?: RootSubjectProps;\n private _globalOrigin?: Point3d;\n private _ecefLocation?: EcefLocation;\n private _geographicCoordinateSystem?: GeographicCRS;\n private _iModelId?: GuidString;\n private _changeset: ChangesetIdWithIndex;\n\n /** The Id of the repository model. */\n public static readonly repositoryModelId: Id64String = \"0x1\";\n /** The Id of the root subject element. */\n public static readonly rootSubjectId: Id64String = \"0x1\";\n /** The Id of the dictionary model. */\n public static readonly dictionaryId: Id64String = \"0x10\";\n\n /** Event raised after [[name]] changes. */\n public readonly onNameChanged = new BeEvent<(previousName: string) => void>();\n /** Event raised after [[rootSubject]] changes. */\n public readonly onRootSubjectChanged = new BeEvent<(previousSubject: RootSubjectProps) => void>();\n /** Event raised after [[projectExtents]] changes. */\n public readonly onProjectExtentsChanged = new BeEvent<(previousExtents: AxisAlignedBox3d) => void>();\n /** Event raised after [[globalOrigin]] changes. */\n public readonly onGlobalOriginChanged = new BeEvent<(previousOrigin: Point3d) => void>();\n /** Event raised after [[ecefLocation]] changes. */\n public readonly onEcefLocationChanged = new BeEvent<(previousLocation: EcefLocation | undefined) => void>();\n /** Event raised after [[geographicCoordinateSystem]] changes. */\n public readonly onGeographicCoordinateSystemChanged = new BeEvent<(previousGCS: GeographicCRS | undefined) => void>();\n /** Event raised after [[changeset]] changes. */\n public readonly onChangesetChanged = new BeEvent<(previousChangeset: ChangesetIdWithIndex) => void>();\n\n /** Name of the iModel */\n public get name(): string {\n assert(this._name !== undefined);\n return this._name;\n }\n public set name(name: string) {\n if (name !== this._name) {\n const old = this._name;\n this._name = name;\n if (undefined !== old)\n this.onNameChanged.raiseEvent(old);\n }\n }\n\n /** The name and description of the root subject of this iModel */\n public get rootSubject(): RootSubjectProps {\n assert(this._rootSubject !== undefined);\n return this._rootSubject;\n }\n public set rootSubject(subject: RootSubjectProps) {\n if (undefined === this._rootSubject || this._rootSubject.name !== subject.name || this._rootSubject.description !== subject.description) {\n const old = this._rootSubject;\n this._rootSubject = subject;\n if (old)\n this.onRootSubjectChanged.raiseEvent(old);\n }\n }\n\n /** Returns `true` if this is a snapshot iModel. */\n public abstract get isSnapshot(): boolean;\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\n public abstract get isBriefcase(): boolean;\n\n public abstract get isOpen(): boolean;\n\n /**\n * The volume, in spatial coordinates, inside which the entire project is contained.\n * @note The object returned from this method is frozen. You *must* make a copy before you do anything that might attempt to modify it.\n */\n public get projectExtents() {\n assert(undefined !== this._projectExtents);\n return this._projectExtents;\n }\n public set projectExtents(extents: AxisAlignedBox3d) {\n // Don't allow any axis of the project extents to be less than 1 meter.\n const projectExtents = extents.clone();\n projectExtents.ensureMinLengths(1.0);\n if (!this._projectExtents || !this._projectExtents.isAlmostEqual(projectExtents)) {\n const old = this._projectExtents;\n projectExtents.freeze();\n this._projectExtents = projectExtents;\n if (old)\n this.onProjectExtentsChanged.raiseEvent(old);\n }\n }\n\n /** An offset to be applied to all spatial coordinates. */\n public get globalOrigin(): Point3d {\n assert(this._globalOrigin !== undefined);\n return this._globalOrigin;\n }\n public set globalOrigin(org: Point3d) {\n if (!this._globalOrigin || !this._globalOrigin.isAlmostEqual(org)) {\n const old = this._globalOrigin;\n org.freeze();\n this._globalOrigin = org;\n if (old)\n this.onGlobalOriginChanged.raiseEvent(old);\n }\n }\n\n /** The [EcefLocation]($docs/learning/glossary#ecefLocation) of the iModel in Earth Centered Earth Fixed coordinates.\n * If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a\n * 3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem\n * property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the\n * iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that\n * results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.\n * If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective\n * cartographic projection used and a linear transformation should then be calculated at the exact origin of the data\n * it must position.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n */\n public get ecefLocation(): EcefLocation | undefined {\n return this._ecefLocation;\n }\n public set ecefLocation(ecefLocation: EcefLocation | undefined) {\n const old = this._ecefLocation;\n if (!old && !ecefLocation)\n return;\n else if (old && ecefLocation && old.isAlmostEqual(ecefLocation))\n return;\n\n this._ecefLocation = ecefLocation;\n this.onEcefLocationChanged.raiseEvent(old);\n }\n\n /** Set the [EcefLocation]($docs/learning/glossary#ecefLocation) for this iModel. */\n public setEcefLocation(ecef: EcefLocationProps): void {\n this.ecefLocation = new EcefLocation(ecef);\n }\n\n /** The geographic coordinate reference system of the iModel. */\n public get geographicCoordinateSystem(): GeographicCRS | undefined {\n return this._geographicCoordinateSystem;\n }\n public set geographicCoordinateSystem(geoCRS: GeographicCRS | undefined) {\n const old = this._geographicCoordinateSystem;\n if (!old && !geoCRS)\n return;\n else if (old && geoCRS && old.equals(geoCRS))\n return;\n\n this._geographicCoordinateSystem = geoCRS;\n this.onGeographicCoordinateSystemChanged.raiseEvent(old);\n }\n\n /** Sets the geographic coordinate reference system from GeographicCRSProps. */\n public setGeographicCoordinateSystem(geoCRS: GeographicCRSProps) {\n this.geographicCoordinateSystem = new GeographicCRS(geoCRS);\n }\n\n /** @internal */\n public getConnectionProps(): IModelConnectionProps {\n return {\n name: this.name,\n rootSubject: this.rootSubject,\n projectExtents: this.projectExtents.toJSON(),\n globalOrigin: this.globalOrigin.toJSON(),\n ecefLocation: this.ecefLocation,\n geographicCoordinateSystem: this.geographicCoordinateSystem,\n ... this._getRpcProps(),\n };\n }\n\n /** Convert this iModel to a JSON representation. */\n public toJSON(): IModelConnectionProps {\n return this.getConnectionProps();\n }\n\n /** A key used to identify this iModel in RPC calls from frontend to backend.\n * @internal\n */\n protected _fileKey: string;\n /** Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications. */\n public get key(): string { return this._fileKey; }\n\n /** @internal */\n protected _iTwinId?: GuidString;\n /** The Guid that identifies the iTwin that owns this iModel. */\n public get iTwinId(): GuidString | undefined { return this._iTwinId; }\n\n /** The Guid that identifies this iModel. */\n public get iModelId(): GuidString | undefined { return this._iModelId; }\n\n /** @public */\n public get changeset(): ChangesetIdWithIndex {\n return { ...this._changeset };\n }\n public set changeset(changeset: ChangesetIdWithIndex) {\n const prev = this._changeset;\n if (prev.id !== changeset.id || prev.index !== changeset.index) {\n this._changeset = { id: changeset.id, index: changeset.index };\n this.onChangesetChanged.raiseEvent(prev);\n }\n }\n\n protected _openMode = OpenMode.Readonly;\n /** The [[OpenMode]] used for this IModel. */\n public get openMode(): OpenMode { return this._openMode; }\n\n /** Return a token for RPC operations.\n * @throws IModelError if the iModel is not open.\n */\n public getRpcProps(): IModelRpcProps {\n if (!this.isOpen)\n throw new IModelError(IModelStatus.BadRequest, \"IModel is not open for rpc\");\n\n return this._getRpcProps();\n }\n\n /** Returns the iModel's RPC properties.\n * @note It is an error to attempt to use these properties as a token for RPC operations if the iModel is not open.\n * @internal\n */\n protected _getRpcProps(): IModelRpcProps {\n return {\n key: this._fileKey,\n iTwinId: this.iTwinId,\n iModelId: this.iModelId,\n changeset: this.changeset,\n };\n }\n\n /** @internal */\n protected constructor(tokenProps?: IModelRpcProps) {\n this._changeset = tokenProps?.changeset ?? { id: \"\", index: 0 };\n this._fileKey = \"\";\n if (tokenProps) {\n this._fileKey = tokenProps.key;\n this._iTwinId = tokenProps.iTwinId;\n this._iModelId = tokenProps.iModelId;\n }\n }\n\n /** @internal */\n protected initialize(name: string, props: IModelProps) {\n this.name = name;\n this.rootSubject = props.rootSubject;\n this.projectExtents = Range3d.fromJSON(props.projectExtents);\n this.globalOrigin = Point3d.fromJSON(props.globalOrigin);\n\n const ecefLocation = props.ecefLocation ? new EcefLocation(props.ecefLocation) : undefined;\n this.ecefLocation = ecefLocation?.isValid ? ecefLocation : undefined;\n\n this.geographicCoordinateSystem = props.geographicCoordinateSystem ? new GeographicCRS(props.geographicCoordinateSystem) : undefined;\n }\n\n /** Get the default subCategoryId for the supplied categoryId */\n public static getDefaultSubCategoryId(categoryId: Id64String): Id64String {\n return Id64.isValid(categoryId) ? Id64.fromLocalAndBriefcaseIds(Id64.getLocalId(categoryId) + 1, Id64.getBriefcaseId(categoryId)) : Id64.invalid;\n }\n\n /** True if this iModel has an [EcefLocation]($docs/learning/glossary#ecefLocation). */\n public get isGeoLocated() { return undefined !== this._ecefLocation; }\n\n /** Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its [[IModel.ecefLocation]].\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public getEcefTransform(): Transform {\n if (undefined === this._ecefLocation)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n return this._ecefLocation.getTransform();\n }\n\n /** Convert a point in this iModel's Spatial coordinates to an ECEF point using its [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Point3d in ECEF coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyPoint3d(spatial, result); }\n\n /** Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its [[ecefLocation]].\n * @param ecef A point in ECEF coordinates\n * @param result If defined, use this for output\n * @returns A Point3d in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\n */\n public ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyInversePoint3d(ecef, result)!; }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic { return Cartographic.fromEcef(this.spatialToEcef(spatial), result)!; }\n\n /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\n */\n public cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d) { return this.ecefToSpatial(cartographic.toEcef(result), result); }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,YAAY,EAA6D,eAAe,EAAE,YAAY,GACvG,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAU7B;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY;IAC3C,YAAmB,WAAuC,EAAE,OAAe,EAAE,WAA6B;QACxG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,gCAAgC;IAChC,yCAAQ,CAAA;IACR,mJAAmJ;IACnJ,6CAAU,CAAA;IACV;;OAEG;IACH,mDAAa,CAAA;AACf,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAkBD;;;;EAIE;AACF,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IAGpD,4DAA4D;IAC5D,YAAY,OAAe,EAAE,WAA6B,EAAE,gBAAoC;QAC9F,KAAK,CAAC,eAAe,CAAC,2BAA2B,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CAEF;AAED,cAAc;AACd,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,YAAmB,WAAmB,EAAE,OAAe;QACrD,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,iBAAiB,WAAW,GAAG,CAAC;IAC9C,CAAC;CACF;AAED,cAAc;AACd,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACjD,YAAmB,OAAe;QAChC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,cAAc;AACd,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QAClG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings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C;IACrC,CAAC;CACF;AAED,cAAc;AACd,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QAClG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData,\n} from \"@itwin/core-bentley\";\n\nexport {\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\n} from \"@itwin/core-bentley\";\n\nexport type { GetMetaDataFunction, LogFunction, LoggingMetaData } from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].\n * @see [[ITwinError]]\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public @deprecated in 4.10 Use [InUseLock]($common) instead.\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public @deprecated in 4.10 Use [InUseLocksError]($common) instead.\n*/\nexport class ConflictingLocksError extends IModelError {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public conflictingLocks?: ConflictingLock[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelVersion.js","sourceRoot":"","sources":["../../src/IModelVersion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;GAEG;AACH,MAAM,OAAO,aAAa;IAMxB,gBAAwB,CAAC;IAEzB,gDAAgD;IACzC,MAAM,CAAC,KAAK;QACjB,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,kDAAkD;IAC3C,MAAM,CAAC,MAAM;QAClB,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,aAAa,CAAC,WAAmB;QAC7C,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QAEpC,IAAI,WAAW,KAAK,EAAE,EAAE,CAAC;YACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YACtB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,CAAC,iBAAiB,GAAG,WAAW,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,yEAAyE;IAClE,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,YAAY,GAAG,WAAW,CAAC;QACnC,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;gBACrE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;oBACpC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,mDAAmD;IAC5C,MAAM,CAAC,QAAQ,CAAC,IAAwB;QAC7C,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClD,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAC9B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,uDAAuD;IACvD,IAAW,OAAO,KAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvD,wDAAwD;IACxD,IAAW,QAAQ,KAAc,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzD;;;;;OAKG;IACI,gBAAgB,KAA8B,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAErF,sFAAsF;IAC/E,OAAO,KAAyB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;CACnE","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"IModelVersion.js","sourceRoot":"","sources":["../../src/IModelVersion.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;GAEG;AACH,MAAM,OAAO,aAAa;IAMxB,gBAAwB,CAAC;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B;QAC7C,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAClD,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAC9B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,uDAAuD;IACvD,IAAW,OAAO,KAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvD,wDAAwD;IACxD,IAAW,QAAQ,KAAc,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzD;;;;;OAKG;IACI,gBAAgB,KAA8B,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAErF,sFAAsF;IAC/E,OAAO,KAAyB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;CACnE","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { ChangesetId } from \"./ChangesetProps\";\n\n/** Properties for IModelVersion\n * @public\n */\nexport type IModelVersionProps =\n { first: true, latest?: never, afterChangeSetId?: never, versionName?: never } |\n { latest: true, first?: never, afterChangeSetId?: never, versionName?: never } |\n { afterChangeSetId: string, first?: never, latest?: never, versionName?: never } |\n { versionName: string, first?: never, latest?: never, afterChangeSetId?: never };\n\n/** Option to specify the version of the iModel to be acquired and used\n * @public\n */\nexport class IModelVersion {\n private _first?: boolean;\n private _latest?: boolean;\n private _afterChangeSetId?: string;\n private _versionName?: string;\n\n private constructor() { }\n\n /** Describes the first version of the iModel */\n public static first(): IModelVersion {\n const version = new IModelVersion();\n version._first = true;\n return version;\n }\n\n /** Describes the latest version of the iModel */\n public static latest(): IModelVersion {\n const version = new IModelVersion();\n version._latest = true;\n return version;\n }\n\n /** Describes a version of the iModel by the last change set that needs\n * to be applied or merged to the iModel.\n * Note that all ChangeSets up to and and including the specified ChangeSet\n * needs to be applied.\n * If the changesetId is an empty string, it is assumed to be the first version\n * before any change sets have been applied.\n */\n public static asOfChangeSet(changesetId: string): IModelVersion {\n const version = new IModelVersion();\n\n if (changesetId === \"\") {\n version._first = true;\n return version;\n }\n\n version._afterChangeSetId = changesetId;\n return version;\n }\n\n /** Describes a version of the iModel with the specified version name */\n public static named(versionName: string): IModelVersion {\n const version = new IModelVersion();\n version._versionName = versionName;\n return version;\n }\n\n public toJSON(): IModelVersionProps {\n return this._versionName ? { versionName: this._versionName } :\n this._afterChangeSetId ? { afterChangeSetId: this._afterChangeSetId } :\n this._first ? { first: this._first } :\n { latest: true };\n }\n\n /** Creates a version from an IModelVersionProps */\n public static fromJSON(json: IModelVersionProps): IModelVersion {\n const version = new IModelVersion();\n version._first = json.first;\n version._afterChangeSetId = json.afterChangeSetId;\n version._latest = json.latest;\n version._versionName = json.versionName;\n return version;\n }\n\n /** Returns true if this describes the first version */\n public get isFirst(): boolean { return !!this._first; }\n\n /** Returns true if this describes the latest version */\n public get isLatest(): boolean { return !!this._latest; }\n\n /** Returns the last change set id to be applied to the iModel\n * to get to this specified version. @see asOfChangeSet().\n * Note that this method does not attempt to resolve the change set\n * if this describes the first version, last version, named version, etc.\n * @see evaluateChangeSet() for those use cases.\n */\n public getAsOfChangeSet(): ChangesetId | undefined { return this._afterChangeSetId; }\n\n /** Returns the name of the version if this describes a named version. @see named() */\n public getName(): string | undefined { return this._versionName; }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITwinError.js","sourceRoot":"","sources":["../../src/ITwinError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,Y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B,WAAW,CAAC,GAAe;QACzC,OAAO,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAFe,sBAAW,cAE1B,CAAA;AAEH,CAAC,EAXgB,UAAU,KAAV,UAAU,QAW1B;AAAA,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ITwinError.js","sourceRoot":"","sources":["../../src/ITwinError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AAuDpE,YAAY;AACZ,MAAM,KAAW,eAAe,CA0B/B;AA1BD,WAAiB,eAAe;IAE9B;;;OAGG;IACH,SAAgB,iBAAiB,CAAC,KAAc;QAC9C,OAAO,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,KAAK,cAAc,IAAI,KAAK,CAAC,QAAQ,KAAK,cAAc,CAAC;IACnH,CAAC;IAFe,iCAAiB,oBAEhC,CAAA;IAED,iFAAiF;IACjF,SAAgB,oBAAoB,CAAC,UAAuB,EAAE,OAAgB,EAAE,QAA0B;QACxG,MAAM,WAAW,GAAG,IAAI,KAAK,EAAE,CAAC;QAChC,WAAW,CAAC,IAAI,GAAG,iBAAiB,CAAC,CAAC,sIAAsI;QAC5K,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,oGAAoG;QAChK,MAAM,SAAS,GAAoB;YACjC,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,cAAc;YACxB,OAAO,EAAE,OAAO,IAAI,8DAA8D;YAClF,QAAQ;YACR,UAAU;SACX,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACtC,MAAM,WAAW,CAAC;IACpB,CAAC;IAbe,oCAAoB,uBAanC,CAAA;AAEH,CAAC,EA1BgB,eAAe,KAAf,eAAe,QA0B/B;AACD,YAAY;AACZ,MAAM,KAAW,UAAU,CAW1B;AAXD,WAAiB,UAAU;IACzB,mGAAmG;IACnG,SAAgB,YAAY,CAAC,KAAc;QACzC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAW,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,CAAC;IACjJ,CAAC;IAFe,uBAAY,eAE3B,CAAA;IAED,iEAAiE;IACjE,SAAgB,WAAW,CAAC,GAAe;QACzC,OAAO,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAFe,sBAAW,cAE1B,CAAA;AAEH,CAAC,EAXgB,UAAU,KAAV,UAAU,QAW1B;AAAA,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { BentleyError, LoggingMetaData } from \"@itwin/core-bentley\";\nimport { LockState } from \"./IModelError\";\n\n/**\n * Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @beta\n */\nexport interface InUseLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An interface used to describe an error for a developer/application. The message is not intended to be displayed to an end user.\n * This error interface should be extended when needing to throw errors with extra properties defined on them. See [[InUseLocksError]] for an example.\n * When extending ITwinError, one should typically add a type guard function and a function to throw the error either to a namespace for their error or as standalone functions.\n * See [[InUseLocksError.throwInUseLocksError]] and [[InUseLocksError.isInUseLocksError]] for examples of how to throw and check that an error is of type InUseLocksError.\n * * Example of catching a ITwinError:\n * ``` ts\n * [[include:ITwinError.catchAndHandleITwinError]]\n * ```\n * @beta\n */\nexport interface ITwinError {\n /** namespace for the error. This is a unique qualifier for the errorKey. */\n namespace: string;\n /** unique key for error, within namespace. All errorKeys within the same namespace must be unique. */\n errorKey: string;\n /** explanation of what went wrong. Intended to be read by a developer. */\n message: string;\n /** stack trace of the error. */\n stack?: string;\n /** metadata about the exception. */\n metadata?: LoggingMetaData;\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @beta\n*/\nexport interface InUseLocksError extends ITwinError {\n namespace: \"itwinjs-core\";\n errorKey: \"in-use-locks\";\n inUseLocks: InUseLock[];\n}\n\n/** @beta */\nexport namespace InUseLocksError {\n\n /**\n * type guard function that returns whether or not the passed in parameter is an [[InUseLocksError]].\n * it first checks [[ITwinError.isITwinError]] and then checks that the namespace property is \"itwinjs-core\" and the errorKey property is \"in-use-locks\".\n */\n export function isInUseLocksError(error: unknown): error is InUseLocksError {\n return ITwinError.isITwinError(error) && error.namespace === \"itwinjs-core\" && error.errorKey === \"in-use-locks\";\n }\n\n /** throws an error which passes the [[isInUseLocksError]] type guard function */\n export function throwInUseLocksError(inUseLocks: InUseLock[], message?: string, metadata?: LoggingMetaData): never {\n const errorObject = new Error();\n errorObject.name = \"InUseLocksError\"; // optional but makes it so that when the error is thrown and not caught we see InUseLocksError: 'message' instead of Error: 'message'\n Error.captureStackTrace(errorObject, throwInUseLocksError); // optional: whether we want to hide throwInUseLocksError or not from the stack. not super important\n const lockError: InUseLocksError = {\n namespace: \"itwinjs-core\",\n errorKey: \"in-use-locks\",\n message: message ?? \"One or more objects are already locked by another briefcase.\",\n metadata,\n inUseLocks,\n };\n Object.assign(errorObject, lockError);\n throw errorObject;\n }\n\n}\n/** @beta */\nexport namespace ITwinError {\n /** type guard function that returns whether or not the passed in parameter is an [[ITwinError]] */\n export function isITwinError(error: unknown): error is ITwinError {\n return error !== undefined && error !== null && typeof error === \"object\" && \"namespace\" in error && \"errorKey\" in error && \"message\" in error;\n }\n\n /** get the meta data associated with this ITwinError, if any. */\n export function getMetaData(err: ITwinError): object | undefined {\n return BentleyError.getMetaData(err.metadata);\n }\n\n};\n"]}
|
package/lib/esm/Image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/Image.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,uCAAuC;IACvC,yDAAQ,CAAA;IACR,sCAAsC;IACtC,uDAAO,CAAA;IACP,wBAAwB;IACxB,2DAAS,CAAA;AACX,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;GAEG;AACH,MAAM,OAAO,WAAW;IAQtB,2DAA2D;IAC3D,IAAW,gBAAgB,KAAa,OAAO,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE9F,0FAA0F;IACnF,MAAM,CAAC,mBAAmB,CAAC,MAAyB;QACzD,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;YACvC,KAAK,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,8CAA8C;IAC9C,IAAW,MAAM,KAAa,OAAO,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAErG;;;;;;;OAOG;IACI,MAAM,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AAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC;QAC7B,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;IAEvB,OAAO,GAAG,GAAG,CAAC,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,kDAAkD;IAClD,yDAAQ,CAAA;IACR,iDAAiD;IACjD,uDAAO,CAAA;IACP;;OAEG;IACH,uDAAO,CAAA;AACT,CAAC,EATW,iBAAiB,KAAjB,iBAAiB,QAS5B;AAED,gBAAgB;AAChB,MAAM,UAAU,wBAAwB,CAAC,MAAyB;IAChE,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,iBAAiB,CAAC,IAAI,CAAC;QAC5B,KAAK,iBAAiB,CAAC,GAAG,CAAC;QAC3B,KAAK,iBAAiB,CAAC,GAAG;YACxB,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,WAAW;IAMtB,4EAA4E;IAC5E,YAAmB,IAAyB,EAAE,MAAyB;QACrE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/Image.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,uCAAuC;IACvC,yDAAQ,CAAA;IACR,sCAAsC;IACtC,uDAAO,CAAA;IACP,wBAAwB;IACxB,2DAAS,CAAA;AACX,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;GAEG;AACH,MAAM,OAAO,WAAW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ACH,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,WAAW;IAMtB,4EAA4E;IAC5E,YAAmB,IAAyB,EAAE,MAAyB;QACrE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\n/** Format of an [[ImageBuffer]].\n * The format determines how many bytes are allocated for each pixel in the buffer and the semantics of each byte.\n * @see [[ImageBuffer.getNumBytesPerPixel]]\n * @public\n * @extensions\n */\nexport enum ImageBufferFormat {\n /** RGBA format - 4 bytes per pixel. */\n Rgba = 0,\n /** RGB format - 3 bytes per pixel. */\n Rgb = 2,\n /** 1 byte per pixel. */\n Alpha = 5,\n}\n\n/** Uncompressed rectangular bitmap image data.\n * @public\n */\nexport class ImageBuffer {\n /** Image data in which each pixel occupies 1 or more bytes depending of the [[ImageBufferFormat]]. */\n public readonly data: Uint8Array;\n /** Format of the bytes in the image. */\n public readonly format: ImageBufferFormat;\n /** Width of image in pixels */\n public readonly width: number;\n\n /** Return the number of bytes allocated for each pixel. */\n public get numBytesPerPixel(): number { return ImageBuffer.getNumBytesPerPixel(this.format); }\n\n /** Determine the number of bytes allocated to a single pixel for the specified format. */\n public static getNumBytesPerPixel(format: ImageBufferFormat): number {\n switch (format) {\n case ImageBufferFormat.Alpha: return 1;\n case ImageBufferFormat.Rgb: return 3;\n default: return 4;\n }\n }\n\n /** Get the height of this image in pixels. */\n public get height(): number { return ImageBuffer.computeHeight(this.data, this.format, this.width); }\n\n /** Create a new ImageBuffer.\n * @note The ImageBuffer takes ownership of the input Uint8Array.\n * @param data The uncompressed image bytes. Must be a multiple of the width times the number of bytes per pixel specified by the format.\n * @param format The format of the image.\n * @param width The width of the image in pixels.\n * @returns A new ImageBuffer.\n * @throws Error if the length of the Uint8Array is not appropriate for the specified width and format.\n */\n public static create(data: Uint8Array, format: ImageBufferFormat, width: number): ImageBuffer {\n if (!this.isValidData(data, format, width))\n throw new Error(\"The number of bytes supplied for ImageBuffer do not match its width and format.\");\n\n return new ImageBuffer(data, format, width);\n }\n\n /** @internal */\n protected static isValidData(data: Uint8Array, format: ImageBufferFormat, width: number): boolean {\n const height = this.computeHeight(data, format, width);\n return width > 0 && height > 0 && Math.floor(width) === width && Math.floor(height) === height;\n }\n\n /** @internal */\n protected static computeHeight(data: Uint8Array, format: ImageBufferFormat, width: number): number {\n return data.length / (width * this.getNumBytesPerPixel(format));\n }\n\n /** @internal */\n protected constructor(data: Uint8Array, format: ImageBufferFormat, width: number) {\n this.data = data;\n this.format = format;\n this.width = width;\n }\n}\n\n/** Returns whether the input is a power of two.\n * @note Floating point inputs are truncated.\n * @public\n */\nexport function isPowerOfTwo(num: number): boolean {\n return 0 === (num & (num - 1));\n}\n\n/** Returns the first power-of-two value greater than or equal to the input.\n * @note Floating point inputs are truncated.\n * @public\n */\nexport function nextHighestPowerOfTwo(num: number): number {\n --num;\n for (let i = 1; i < 32; i <<= 1)\n num = num | num >> i;\n\n return num + 1;\n}\n\n/** The format of an ImageSource.\n * @public\n * @extensions\n */\nexport enum ImageSourceFormat {\n /** Image data is stored with JPEG compression. */\n Jpeg = 0,\n /** Image data is stored with PNG compression. */\n Png = 2,\n /** Image is stored as an Svg stream.\n * @note SVG is only valid for ImageSources in JavaScript. It *may not* be used for persistent textures.\n */\n Svg = 3,\n}\n\n/** @internal */\nexport function isValidImageSourceFormat(format: ImageSourceFormat): boolean {\n switch (format) {\n case ImageSourceFormat.Jpeg:\n case ImageSourceFormat.Png:\n case ImageSourceFormat.Svg:\n return true;\n default:\n return false;\n }\n}\n\n/** Image data encoded and compressed in either Jpeg or Png format.\n * @public\n */\nexport class ImageSource {\n /** The content of the image, compressed */\n public readonly data: Uint8Array | string;\n /** The compression type. */\n public readonly format: ImageSourceFormat;\n\n /** Construct a new ImageSource, which takes ownership of the Uint8Array. */\n public constructor(data: Uint8Array | string, format: ImageSourceFormat) {\n this.data = data;\n this.format = format;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcAppProps.js","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAuBH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,cAAc,CAAC,SAAS,gBAAgB,QAAQ,EAAE,CAAC;AAwBpH,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,4BAA4B;CAClC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"IpcAppProps.js","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAuBH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,cAAc,CAAC,SAAS,gBAAgB,QAAQ,EAAE,CAAC;AAwBpH,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,4BAA4B;CAClC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { GuidString, Id64String, IModelStatus, LogLevel, OpenMode } from \"@itwin/core-bentley\";\nimport { Range3dProps, XYZProps } from \"@itwin/core-geometry\";\nimport { OpenBriefcaseProps, OpenCheckpointArgs } from \"./BriefcaseTypes\";\nimport { ChangedEntities } from \"./ChangedEntities\";\nimport { ChangesetIndex, ChangesetIndexAndId } from \"./ChangesetProps\";\nimport { GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\nimport { EcefLocationProps, IModelConnectionProps, IModelRpcProps, RootSubjectProps, SnapshotOpenOptions, StandaloneOpenOptions } from \"./IModel\";\nimport { ModelGeometryChangesProps } from \"./ModelGeometryChanges\";\n\n/** Options for pulling changes into iModel.\n * @internal\n */\nexport interface PullChangesOptions {\n /** Enables progress reporting. */\n reportProgress?: boolean;\n /** Interval for reporting progress (in milliseconds). */\n progressInterval?: number;\n /** Enables checks for abort. */\n enableCancellation?: boolean;\n}\n\n/** Get IPC channel name used for reporting progress of pulling changes into iModel.\n * @internal\n */\nexport const getPullChangesIpcChannel = (iModelId: string) => `${ipcAppChannels.functions}/pullChanges/${iModelId}`;\n\n/** Identifies a list of tile content Ids belonging to a single tile tree.\n * @internal\n */\nexport interface TileTreeContentIds {\n treeId: string;\n contentIds: string[];\n}\n\n/** Specifies a [GeometricModel]($backend)'s Id and a Guid identifying the current state of the geometry contained within the model.\n * @see [TxnManager.onModelGeometryChanged]($backend) and [BriefcaseTxns.onModelGeometryChanged]($frontend).\n * @public\n * @extensions\n */\nexport interface ModelIdAndGeometryGuid {\n /** The model's Id. */\n id: Id64String;\n /** A unique identifier for the current state of the model's geometry. If the guid differs between two revisions of the same iModel, it indicates that the geometry differs.\n * This is primarily an implementation detail used to determine whether [Tile]($frontend)s produced for one revision are compatible with another revision.\n */\n guid: GuidString;\n}\n\n/** @internal */\nexport const ipcAppChannels = {\n functions: \"itwinjs-core/ipc-app\",\n appNotify: \"itwinjs-core/ipcApp-notify\",\n txns: \"itwinjs-core/txns\",\n editingScope: \"itwinjs-core/editing-scope\",\n} as const;\n\n/**\n * Interface implemented by the frontend [NotificationHandler]($common) to be notified of events from IpcApp backend.\n * @internal\n */\nexport interface IpcAppNotifications {\n notifyApp: () => void;\n}\n\n/** @internal */\nexport interface NotifyEntitiesChangedMetadata {\n /** Class full name (\"Schema:Class\") */\n name: string;\n /** The indices in [[NotifyEntitiesChangedArgs.meta]] of each of this class's **direct** base classes. */\n bases: number[];\n}\n\n/** Arguments supplied to [[TxnNotifications.notifyElementsChanged]] and [[TxnNotifications.notifyModelsChanged]].\n * @internal\n */\nexport interface NotifyEntitiesChangedArgs extends ChangedEntities {\n /** An array of the same length as [[ChangedEntities.inserted]] (or empty if that array is undefined), containing the index in the [[meta]] array at which the\n * metadata for each entity's class is located.\n */\n insertedMeta: number[];\n /** See insertedMeta. */\n updatedMeta: number[];\n /** See insertedMeta. */\n deletedMeta: number[];\n\n /** Metadata describing each unique class of entity in this set of changes, followed by each unique direct or indirect base class of those classes. */\n meta: NotifyEntitiesChangedMetadata[];\n}\n\n/** Interface implemented by the frontend [NotificationHandler]($common) to be notified of changes to an iModel.\n * @see [TxnManager]($backend) for the source of these events.\n * @see [BriefcaseTxns]($frontend) for the frontend implementation.\n * @internal\n */\nexport interface TxnNotifications {\n notifyElementsChanged: (changes: NotifyEntitiesChangedArgs) => void;\n notifyModelsChanged: (changes: NotifyEntitiesChangedArgs) => void;\n notifyGeometryGuidsChanged: (changes: ModelIdAndGeometryGuid[]) => void;\n notifyCommit: () => void;\n notifyCommitted: (hasPendingTxns: boolean, time: number) => void;\n notifyReplayExternalTxns: () => void;\n notifyReplayedExternalTxns: () => void;\n notifyChangesApplied: () => void;\n notifyBeforeUndoRedo: (isUndo: boolean) => void;\n notifyAfterUndoRedo: (isUndo: boolean) => void;\n notifyPulledChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\n notifyPushedChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\n\n notifyIModelNameChanged: (name: string) => void;\n notifyRootSubjectChanged: (subject: RootSubjectProps) => void;\n notifyProjectExtentsChanged: (extents: Range3dProps) => void;\n notifyGlobalOriginChanged: (origin: XYZProps) => void;\n notifyEcefLocationChanged: (ecef: EcefLocationProps | undefined) => void;\n notifyGeographicCoordinateSystemChanged: (gcs: GeographicCRSProps | undefined) => void;\n}\n\n/**\n * Interface registered by the frontend [NotificationHandler]($common) to be notified of changes to an iModel during an [GraphicalEditingScope]($frontend).\n * @internal\n */\nexport interface EditingScopeNotifications {\n notifyGeometryChanged: (modelProps: ModelGeometryChangesProps[]) => void;\n}\n\n/**\n * The methods that may be invoked via Ipc from the frontend of an IpcApp and are implemented on its backend.\n * @internal\n */\nexport interface IpcAppFunctions {\n /** Send frontend log to backend.\n * @param _level Specify log level.\n * @param _category Specify log category.\n * @param _message Specify log message.\n * @param _metaData metaData if any.\n */\n log: (_timestamp: number, _level: LogLevel, _category: string, _message: string, _metaData?: any) => Promise<void>;\n\n /** see BriefcaseConnection.openFile */\n openBriefcase: (args: OpenBriefcaseProps) => Promise<IModelConnectionProps>;\n /** see BriefcaseConnection.openStandalone */\n openCheckpoint: (args: OpenCheckpointArgs) => Promise<IModelConnectionProps>;\n /** see BriefcaseConnection.openStandalone */\n openStandalone: (filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions) => Promise<IModelConnectionProps>;\n /** see SnapshotConnection.openFile */\n openSnapshot: (filePath: string, opts?: SnapshotOpenOptions) => Promise<IModelConnectionProps>;\n /** see BriefcaseConnection.close */\n closeIModel: (key: string) => Promise<void>;\n /** see BriefcaseConnection.saveChanges */\n saveChanges: (key: string, description?: string) => Promise<void>;\n /** see BriefcaseTxns.hasPendingTxns */\n hasPendingTxns: (key: string) => Promise<boolean>;\n /** see BriefcaseTxns.isUndoPossible */\n isUndoPossible: (key: string) => Promise<boolean>;\n /** see BriefcaseTxns.isRedoPossible */\n isRedoPossible: (key: string) => Promise<boolean>;\n /** see BriefcaseTxns.getUndoString */\n getUndoString: (key: string) => Promise<string>;\n /** see BriefcaseTxns.getRedoString */\n getRedoString: (key: string) => Promise<string>;\n\n /** see BriefcaseConnection.pullChanges */\n pullChanges: (key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions) => Promise<ChangesetIndexAndId>;\n /** Cancels pull of changes. */\n cancelPullChangesRequest: (key: string) => Promise<void>;\n /** see BriefcaseConnection.pushChanges */\n pushChanges: (key: string, description: string) => Promise<ChangesetIndexAndId>;\n /** Cancels currently pending or active generation of tile content. */\n cancelTileContentRequests: (tokenProps: IModelRpcProps, _contentIds: TileTreeContentIds[]) => Promise<void>;\n\n /** Cancel element graphics requests.\n * @see [[IModelTileRpcInterface.requestElementGraphics]].\n */\n cancelElementGraphicsRequests: (key: string, _requestIds: string[]) => Promise<void>;\n\n toggleGraphicalEditingScope: (key: string, _startSession: boolean) => Promise<boolean>;\n isGraphicalEditingSupported: (key: string) => Promise<boolean>;\n\n reverseTxns: (key: string, numOperations: number) => Promise<IModelStatus>;\n reverseAllTxn: (key: string) => Promise<IModelStatus>;\n reinstateTxn: (key: string) => Promise<IModelStatus>;\n restartTxnSession: (key: string) => Promise<void>;\n\n /** Query the number of concurrent threads supported by the host's IO or CPU thread pool. */\n queryConcurrency: (pool: \"io\" | \"cpu\") => Promise<number>;\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightSettings.js","sourceRoot":"","sources":["../../src/LightSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD,SAAS,gBAAgB,CAAC,KAAyB,EAAE,YAAoB;IACvE,MAAM,YAAY,GAAG,CAAC,CAAC;IACvB,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC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d,OAAO,IAAI,CAAC,iBAAiB,KAAK,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,KAAK,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO;eACtI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { Vector3d, XYZProps } from \"@itwin/core-geometry\";\r\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\r\n\r\nfunction extractIntensity(value: number | undefined, defaultValue: number) {\r\n const maxIntensity = 5;\r\n return typeof value === \"number\" ? Math.max(0, Math.min(maxIntensity, value)) : defaultValue;\r\n}\r\n\r\n/** Wire format for the solar directional light associated with a [[LightSettingsProps]].\r\n * The light is colored white and oriented in any direction in world coordinates.\r\n * It will cast shadows if it is above the world XY plane and if the shadows view flag is enabled for the view.\r\n * By default, the solar light is only applied when shadows are enabled, but can be set to be applied unconditionally.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SolarLightProps {\r\n /** Intensity of the light, typically in [0..1] but can range up to 5. Default: 1.0 */\r\n intensity?: number;\r\n /** Direction of the light in world coordinates. Defaults to a vector looking down on the scene at a 45 degree angle mostly along the Y axis. */\r\n direction?: XYZProps;\r\n /** If true, the light will be applied even when shadows are turned off for the view.\r\n * If false, a roughly overhead light of the same intensity oriented in view space will be used instead.\r\n * Default: false.\r\n */\r\n alwaysEnabled?: boolean;\r\n /** If defined, the time in UNIX milliseconds from which [[direction]] was calculated.\r\n * @see [[DisplayStyleSettings.setSunTime]] to compute the solar direction from a point in time.\r\n */\r\n timePoint?: number;\r\n}\r\n\r\nconst defaultSolarDirection = Vector3d.create(0.272166, 0.680414, 0.680414);\r\n\r\n/** Describes the solar directional light associated with a [[LightSettings]].\r\n * @see [[SolarLightProps]].\r\n * @public\r\n */\r\nexport class SolarLight {\r\n /** Direction of the light in world coordinates. Defaults to a vector looking down on the scene at a 45 degree angle mostly along the Y axis. */\r\n public readonly direction: Readonly<Vector3d>;\r\n /** Intensity of the light, typically in [0..1] but can range up to 5. Default: 1.0 */\r\n public readonly intensity: number;\r\n /** If true, the light will be applied even when shadows are turned off for the view.\r\n * If false, a roughly overhead light of the same intensity oriented in view space will be used instead.\r\n * Default: false.\r\n */\r\n public readonly alwaysEnabled: boolean;\r\n /** If defined, the time in UNIX milliseconds from which [[direction]] was calculated.\r\n * @see [[DisplayStyleSettings.setSunTime]] to compute the solar direction from a point in time.\r\n */\r\n public readonly timePoint?: number;\r\n\r\n public constructor(json?: SolarLightProps) {\r\n json = json || {};\r\n this.intensity = extractIntensity(json.intensity, 1);\r\n this.alwaysEnabled = JsonUtils.asBool(json.alwaysEnabled);\r\n\r\n if (json.direction)\r\n this.direction = Vector3d.fromJSON(json.direction);\r\n else\r\n this.direction = defaultSolarDirection.clone();\r\n\r\n if (typeof json.timePoint === \"number\")\r\n this.timePoint = json.timePoint;\r\n }\r\n\r\n public toJSON(): SolarLightProps | undefined {\r\n const direction = this.direction.isAlmostEqual(defaultSolarDirection) ? undefined : this.direction.toJSON();\r\n const intensity = this.intensity !== 1 ? this.intensity : undefined;\r\n const alwaysEnabled = this.alwaysEnabled ? true : undefined;\r\n const timePoint = this.timePoint;\r\n\r\n if (undefined === direction && undefined === intensity && undefined === alwaysEnabled && undefined === timePoint)\r\n return undefined;\r\n\r\n const json: SolarLightProps = {};\r\n if (direction)\r\n json.direction = direction;\r\n\r\n if (undefined !== intensity)\r\n json.intensity = intensity;\r\n\r\n if (undefined !== alwaysEnabled)\r\n json.alwaysEnabled = alwaysEnabled;\r\n\r\n if (undefined !== timePoint)\r\n json.timePoint = timePoint;\r\n\r\n return json;\r\n }\r\n\r\n /** Create a copy of this SolarLight, identical except in any properties explicitly specified by `changedProps`, with a possible exception for [[timePoint]].\r\n * If `this.timePoint` is defined and `changedProps` defines `direction` but **doesn't** define `timePoint`, the time point will only be preserved in the\r\n * copy if `changesProps.direction` is equal to `this.direction`.\r\n */\r\n public clone(changedProps?: SolarLightProps): SolarLight {\r\n if (!changedProps)\r\n return this;\r\n\r\n const props = this.toJSON() ?? {};\r\n if (undefined !== changedProps.direction)\r\n props.direction = changedProps.direction;\r\n\r\n if (undefined !== changedProps.intensity)\r\n props.intensity = changedProps.intensity;\r\n\r\n if (undefined !== changedProps.alwaysEnabled)\r\n props.alwaysEnabled = changedProps.alwaysEnabled;\r\n\r\n if (undefined !== changedProps.timePoint)\r\n props.timePoint = changedProps.timePoint;\r\n\r\n // If our direction was computed from a time point and the caller only supplies a direction, invalidate the time point unless the input direction matches our direction.\r\n // If caller explicitly supplied a timePoint, trust it.\r\n if (undefined !== this.timePoint && undefined === changedProps.timePoint && undefined !== changedProps.direction) {\r\n const newDirection = Vector3d.fromJSON(changedProps.direction);\r\n if (!newDirection.isAlmostEqual(this.direction))\r\n props.timePoint = undefined;\r\n }\r\n\r\n return new SolarLight(props);\r\n }\r\n\r\n public equals(rhs: SolarLight): boolean {\r\n return this.intensity === rhs.intensity && this.alwaysEnabled === rhs.alwaysEnabled && this.direction.isExactEqual(rhs.direction) && this.timePoint === rhs.timePoint;\r\n }\r\n}\r\n\r\n/** Wire format for the ambient light associated with a [[LightSettingsProps]].\r\n * Ambient light applies equally to all surfaces in the scene.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AmbientLightProps {\r\n /** The color of the light. Black is treated as a special case, indicating that the surface's own diffuse color should be used. */\r\n color?: RgbColorProps;\r\n /** The intensity of the light. Default: 0.2. */\r\n intensity?: number;\r\n}\r\n\r\n/** Describes the ambient light associated with a [[LightSettings]].\r\n * @see [[AmbientLightProps]]\r\n * @public\r\n */\r\nexport class AmbientLight {\r\n public readonly color: RgbColor;\r\n public readonly intensity: number;\r\n\r\n public constructor(json?: AmbientLightProps) {\r\n json = json || {};\r\n this.intensity = extractIntensity(json.intensity, 0.2);\r\n this.color = json.color ? RgbColor.fromJSON(json.color) : new RgbColor(0, 0, 0);\r\n }\r\n\r\n public toJSON(): AmbientLightProps | undefined {\r\n const color = this.color.r !== 0 || this.color.g !== 0 || this.color.b !== 0 ? this.color.toJSON() : undefined;\r\n const intensity = 0.2 !== this.intensity ? this.intensity : undefined;\r\n if (undefined === color && undefined === intensity)\r\n return undefined;\r\n\r\n const json: AmbientLightProps = {};\r\n if (color)\r\n json.color = color;\r\n\r\n if (undefined !== intensity)\r\n json.intensity = intensity;\r\n\r\n return json;\r\n }\r\n\r\n /** Create a copy of this light, identical except for any properties explicitly specified by `changed`. */\r\n public clone(changed?: AmbientLightProps): AmbientLight {\r\n if (!changed)\r\n return this;\r\n\r\n const props = this.toJSON() ?? {};\r\n if (undefined !== changed.intensity)\r\n props.intensity = changed.intensity;\r\n\r\n if (undefined !== changed.color)\r\n props.color = changed.color;\r\n\r\n return new AmbientLight(props);\r\n }\r\n\r\n public equals(rhs: AmbientLight): boolean {\r\n return this.intensity === rhs.intensity && this.color.equals(rhs.color);\r\n }\r\n}\r\n\r\n/** Wire format for a pair of hemisphere lights associated with a [[LightSettingsProps]].\r\n * Hemisphere lights are oriented in opposite directions along the world Z axis. Each has its own color; they share one intensity.\r\n * They are often used to simulate outdoor reflection of light from the ground and sky, so the colors often match the ground and sky colors\r\n * of the [[SkyBox]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface HemisphereLightsProps {\r\n /** The color of the downward-facing light. Default: (143, 205, 255). */\r\n upperColor?: RgbColorProps;\r\n /** The color of the upward-facing light. Default: (120, 143, 125). */\r\n lowerColor?: RgbColorProps;\r\n /** Intensity of the lights. Default: 0. */\r\n intensity?: number;\r\n}\r\n\r\nconst defaultUpperHemisphereColor = new RgbColor(143, 205, 255);\r\nconst defaultLowerHemisphereColor = new RgbColor(120, 143, 125);\r\n\r\n/** Describes a pair of hemisphere lights associated with a [[LightSettings]].\r\n * @see [[HemisphereLightsProps]]\r\n * @public\r\n */\r\nexport class HemisphereLights {\r\n public readonly upperColor: RgbColor;\r\n public readonly lowerColor: RgbColor;\r\n public readonly intensity: number;\r\n\r\n public constructor(json?: HemisphereLightsProps) {\r\n json = json || {};\r\n this.intensity = extractIntensity(json.intensity, 0);\r\n this.upperColor = json.upperColor ? RgbColor.fromJSON(json.upperColor) : defaultUpperHemisphereColor;\r\n this.lowerColor = json.lowerColor ? RgbColor.fromJSON(json.lowerColor) : defaultLowerHemisphereColor;\r\n }\r\n\r\n public toJSON(): HemisphereLightsProps | undefined {\r\n const upperColor = this.upperColor.equals(defaultUpperHemisphereColor) ? undefined : this.upperColor.toJSON();\r\n const lowerColor = this.lowerColor.equals(defaultLowerHemisphereColor) ? undefined : this.lowerColor.toJSON();\r\n const intensity = 0 === this.intensity ? undefined : this.intensity;\r\n\r\n if (undefined === upperColor && undefined === lowerColor && undefined === intensity)\r\n return undefined;\r\n\r\n const json: HemisphereLightsProps = {};\r\n if (upperColor)\r\n json.upperColor = upperColor;\r\n\r\n if (lowerColor)\r\n json.lowerColor = lowerColor;\r\n\r\n if (undefined !== intensity)\r\n json.intensity = intensity;\r\n\r\n return json;\r\n }\r\n\r\n /** Create a copy of these lights, identical except for any properties explicitly specified by `changed`. */\r\n public clone(changed?: HemisphereLightsProps): HemisphereLights {\r\n if (!changed)\r\n return this;\r\n\r\n const props = this.toJSON() || {};\r\n if (undefined !== changed.upperColor)\r\n props.upperColor = changed.upperColor;\r\n\r\n if (undefined !== changed.lowerColor)\r\n props.lowerColor = changed.lowerColor;\r\n\r\n if (undefined !== changed.intensity)\r\n props.intensity = changed.intensity;\r\n\r\n return new HemisphereLights(props);\r\n }\r\n\r\n public equals(rhs: HemisphereLights): boolean {\r\n return this.intensity === rhs.intensity && this.upperColor.equals(rhs.upperColor) && this.lowerColor.equals(rhs.lowerColor);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FresnelSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FresnelSettingsProps {\r\n /** See [[FresnelSettings.intensity]].\r\n * Default value: 0\r\n */\r\n intensity?: number;\r\n\r\n /** See [[FresnelSettings.invert]].\r\n * Default value: false\r\n */\r\n invert?: boolean;\r\n}\r\n\r\nfunction clampIntensity(intensity = 0): number {\r\n return Math.max(intensity, 0);\r\n}\r\n\r\n/** As part of a [[LightSettings]], describes how to apply a Fresnel effect to the contents of the view.\r\n * The \"Fresnel effect\" is based on the observation that the reflectivity of a surface varies based on the angle between the surface and\r\n * the viewer's line of sight. For example, a flat surface will appear more reflective when viewed at a glancing angle than it will when\r\n * viewed from above; and a sphere will appear more reflective around its edges than at its center.\r\n *\r\n * This principle can be used to improve photorealism, but the implementation provided here is intended to produce non-realistic but\r\n * aesthetically-pleasing results.\r\n * @see [[LightSettings.fresnel]].\r\n * @public\r\n */\r\nexport class FresnelSettings {\r\n /** The strength of the effect in terms of how much brighter the surface becomes. The intensity at a given point on the surface is determined by\r\n * the angle between the viewer's line of sight and the vector from the viewer to that point. Maximum intensity is produced when those vectors are\r\n * perpendicular, and zero intensity is produced when those vectors are parallel (unless [[invert]] is `true`).\r\n *\r\n * A value of zero turns off the effect. Values less than zero are clamped to zero. Typical values range between 0 and 1.\r\n */\r\n public readonly intensity: number;\r\n /** If true, inverts the effect's [[intensity]] such that maximum intensity is produced when the viewer's line of sight is parallel to the vector between\r\n * the viewer and the point on the surface, and zero intensity is produced when the viewer's line of sight is perpendicular to that vector.\r\n */\r\n public readonly invert: boolean;\r\n\r\n private constructor(intensity: number, invert: boolean) {\r\n assert(intensity >= 0);\r\n this.intensity = intensity;\r\n this.invert = invert;\r\n }\r\n\r\n private static readonly _defaults = new FresnelSettings(0, false);\r\n\r\n /** Create from JSON representation, using default values for any unspecified or `undefined` properties. */\r\n public static fromJSON(props?: FresnelSettingsProps): FresnelSettings {\r\n const intensity = clampIntensity(JsonUtils.asDouble(props?.intensity));\r\n const invert = JsonUtils.asBool(props?.invert);\r\n if (0 === intensity && !invert)\r\n return this._defaults;\r\n\r\n return new this(intensity, invert);\r\n }\r\n\r\n /** Create a new FresnelSettings.\r\n * @note Intensity values less than zero will be set to zero.\r\n */\r\n public static create(intensity = 0, invert = false): FresnelSettings {\r\n return this.fromJSON({ intensity, invert });\r\n }\r\n\r\n /** Convert to JSON representation.\r\n * @note If all settings match the default values, `undefined` will be returned.\r\n */\r\n public toJSON(): FresnelSettingsProps | undefined {\r\n if (0 === this.intensity && !this.invert)\r\n return undefined;\r\n\r\n const props: FresnelSettingsProps = {};\r\n if (0 !== this.intensity)\r\n props.intensity = this.intensity;\r\n\r\n if (this.invert)\r\n props.invert = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of these settings, modified to match any properties explicitly specified by `changedProps`. */\r\n public clone(changedProps?: FresnelSettingsProps): FresnelSettings {\r\n if ((undefined === changedProps?.intensity || changedProps.intensity === this.intensity)\r\n && (undefined === changedProps?.invert || changedProps.invert === this.invert))\r\n return this;\r\n\r\n const intensity = changedProps?.intensity ?? this.intensity;\r\n const invert = changedProps?.invert ?? this.invert;\r\n return FresnelSettings.fromJSON({ intensity, invert });\r\n }\r\n\r\n /** Return true if these settings are equivalent to `rhs`. */\r\n public equals(rhs: FresnelSettings): boolean {\r\n return this === rhs || (this.intensity === rhs.intensity && this.invert === rhs.invert);\r\n }\r\n}\r\n\r\n/** Wire format for a [[LightSettings]] describing lighting for a 3d scene.\r\n * 3d lighting provides the following lights, all of which are optional:\r\n * - A \"portrait\" light affixed to the camera and pointing directly forward into the scene. Color: white.\r\n * - A second directional light. Color: white.\r\n * - This can be a solar shadow-casting light, or (when shadows are disabled) a roughly overhead light oriented in view space.\r\n * - A pair of hemisphere lights pointing in opposite directions along the world Z axis. Each has its own customizable color.\r\n * - An ambient light of any color applied equally to all surfaces.\r\n * Specular intensity of all lights is controlled separately.\r\n * Light intensities are typically expressed in [0..1] but can be as large as 5.\r\n * @see [[DisplayStyle3dSettingsProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface LightSettingsProps {\r\n /** A white portrait light affixed to the camera and pointing directly forward into the scene. */\r\n portrait?: {\r\n /** Intensity, typically in [0..1], maximum 5. Default: 0.3. */\r\n intensity?: number;\r\n };\r\n /** Solar light settings. */\r\n solar?: SolarLightProps;\r\n /** Hemisphere light settings. */\r\n hemisphere?: HemisphereLightsProps;\r\n /** Ambient light settings. */\r\n ambient?: AmbientLightProps;\r\n /** Specular intensity applied to all lights. */\r\n specularIntensity?: number;\r\n /** Applies a [cel-shaded](https://en.wikipedia.org/wiki/Cel_shading) effect. If greater than zero, specifies the number of cels. Continuous lighting intensities\r\n * are computed, then quantized to the specified number of cels. Values greater than 254 have no visible effect.\r\n * Typically a value of 2 is appropriate if specular intensity is close to zero; 3 if specular intensity is larger.\r\n * Cel-shading is often combined with thick, dark visible edges for a cartoon or comic book effect.\r\n * Default: 0\r\n */\r\n numCels?: number;\r\n\r\n /** Fresnel settings.\r\n * @see [[FresnelSettings]].\r\n */\r\n fresnel?: FresnelSettingsProps;\r\n}\r\n\r\n/** Describes the lighting for a 3d scene, associated with a [[DisplayStyle3dSettings]] in turn associated with a [DisplayStyle3d]($backend) or [DisplayStyle3dState]($frontend).\r\n * @see [[LightSettingsProps]]\r\n * @public\r\n */\r\nexport class LightSettings {\r\n public readonly solar: SolarLight;\r\n public readonly ambient: AmbientLight;\r\n public readonly hemisphere: HemisphereLights;\r\n /** See [[LightSettingsProps.portrait]]. */\r\n public readonly portraitIntensity: number;\r\n public readonly specularIntensity: number;\r\n /** See [[LightSettingsProps.numCels]]. */\r\n public readonly numCels: number;\r\n public readonly fresnel: FresnelSettings;\r\n\r\n private constructor(solar: SolarLight, ambient: AmbientLight, hemisphere: HemisphereLights, portraitIntensity: number, specularIntensity: number, numCels: number,\r\n fresnel: FresnelSettings) {\r\n this.solar = solar;\r\n this.ambient = ambient;\r\n this.hemisphere = hemisphere;\r\n this.portraitIntensity = portraitIntensity;\r\n this.specularIntensity = specularIntensity;\r\n this.numCels = numCels;\r\n this.fresnel = fresnel;\r\n }\r\n\r\n public static fromJSON(props?: LightSettingsProps): LightSettings {\r\n const solar = new SolarLight(props?.solar);\r\n const ambient = new AmbientLight(props?.ambient);\r\n const hemisphere = new HemisphereLights(props?.hemisphere);\r\n const portraitIntensity = extractIntensity(props?.portrait?.intensity, 0.3);\r\n const specularIntensity = extractIntensity(props?.specularIntensity, 1.0);\r\n const numCels = JsonUtils.asInt(props?.numCels, 0);\r\n const fresnel = FresnelSettings.fromJSON(props?.fresnel);\r\n\r\n return new LightSettings(solar, ambient, hemisphere, portraitIntensity, specularIntensity, numCels, fresnel);\r\n }\r\n\r\n public toJSON(): LightSettingsProps | undefined {\r\n const solar = this.solar.toJSON();\r\n const ambient = this.ambient.toJSON();\r\n const hemisphere = this.hemisphere.toJSON();\r\n const portrait = 0.3 !== this.portraitIntensity ? { intensity: this.portraitIntensity } : undefined;\r\n const specularIntensity = 1 !== this.specularIntensity ? this.specularIntensity : undefined;\r\n const numCels = 0 !== this.numCels ? this.numCels : undefined;\r\n const fresnel = this.fresnel.toJSON();\r\n\r\n if (!solar && !ambient && !hemisphere && !portrait && undefined === specularIntensity && undefined === numCels && undefined === fresnel)\r\n return undefined;\r\n\r\n const json: LightSettingsProps = {};\r\n if (solar)\r\n json.solar = solar;\r\n\r\n if (ambient)\r\n json.ambient = ambient;\r\n\r\n if (hemisphere)\r\n json.hemisphere = hemisphere;\r\n\r\n if (portrait)\r\n json.portrait = portrait;\r\n\r\n if (undefined !== specularIntensity)\r\n json.specularIntensity = specularIntensity;\r\n\r\n if (undefined !== numCels)\r\n json.numCels = numCels;\r\n\r\n if (fresnel)\r\n json.fresnel = fresnel;\r\n\r\n return json;\r\n }\r\n\r\n /** Create a copy of these light settings, identical except for any properties explicitly specified by `changed`.\r\n * Note that the solar, ambient, and hemisphere lights will also be cloned using their own `clone` methods - so for example, the following:\r\n * ` clone({ ambient: { intensity: 0.5 } })`\r\n * will overwrite the ambient light's intensity but preserve its current color, rather than replacing the color with the default color.\r\n */\r\n public clone(changed?: LightSettingsProps): LightSettings {\r\n if (!changed)\r\n return this;\r\n\r\n const solar = this.solar.clone(changed.solar);\r\n const ambient = this.ambient.clone(changed.ambient);\r\n const hemisphere = this.hemisphere.clone(changed.hemisphere);\r\n const portrait = changed.portrait?.intensity ?? this.portraitIntensity;\r\n const specular = changed.specularIntensity ?? this.specularIntensity;\r\n const numCels = changed.numCels ?? this.numCels;\r\n const fresnel = this.fresnel.clone(changed.fresnel);\r\n\r\n return new LightSettings(solar, ambient, hemisphere, portrait, specular, numCels, fresnel);\r\n }\r\n\r\n public equals(rhs: LightSettings): boolean {\r\n if (this === rhs)\r\n return true;\r\n\r\n return this.portraitIntensity === rhs.portraitIntensity && this.specularIntensity === rhs.specularIntensity && this.numCels === rhs.numCels\r\n && this.ambient.equals(rhs.ambient) && this.solar.equals(rhs.solar) && this.hemisphere.equals(rhs.hemisphere) && this.fresnel.equals(rhs.fresnel);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LightSettings.js","sourceRoot":"","sources":["../../src/LightSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD,SAAS,gBAAgB,CAAC,KAAyB,EAAE,YAAoB;IACvE,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AAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;IAEM,MAAM,CAAC,GAAkB;QAC9B,IAAI,IAAI,KAAK,GAAG;YACd,OAAO,IAAI,CAAC;QAEd,OAAO,IAAI,CAAC,iBAAiB,KAAK,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,KAAK,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO;eACtI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { Vector3d, XYZProps } from \"@itwin/core-geometry\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\n\nfunction extractIntensity(value: number | undefined, defaultValue: number) {\n const maxIntensity = 5;\n return typeof value === \"number\" ? Math.max(0, Math.min(maxIntensity, value)) : defaultValue;\n}\n\n/** Wire format for the solar directional light associated with a [[LightSettingsProps]].\n * The light is colored white and oriented in any direction in world coordinates.\n * It will cast shadows if it is above the world XY plane and if the shadows view flag is enabled for the view.\n * By default, the solar light is only applied when shadows are enabled, but can be set to be applied unconditionally.\n * @public\n * @extensions\n */\nexport interface SolarLightProps {\n /** Intensity of the light, typically in [0..1] but can range up to 5. Default: 1.0 */\n intensity?: number;\n /** Direction of the light in world coordinates. Defaults to a vector looking down on the scene at a 45 degree angle mostly along the Y axis. */\n direction?: XYZProps;\n /** If true, the light will be applied even when shadows are turned off for the view.\n * If false, a roughly overhead light of the same intensity oriented in view space will be used instead.\n * Default: false.\n */\n alwaysEnabled?: boolean;\n /** If defined, the time in UNIX milliseconds from which [[direction]] was calculated.\n * @see [[DisplayStyleSettings.setSunTime]] to compute the solar direction from a point in time.\n */\n timePoint?: number;\n}\n\nconst defaultSolarDirection = Vector3d.create(0.272166, 0.680414, 0.680414);\n\n/** Describes the solar directional light associated with a [[LightSettings]].\n * @see [[SolarLightProps]].\n * @public\n */\nexport class SolarLight {\n /** Direction of the light in world coordinates. Defaults to a vector looking down on the scene at a 45 degree angle mostly along the Y axis. */\n public readonly direction: Readonly<Vector3d>;\n /** Intensity of the light, typically in [0..1] but can range up to 5. Default: 1.0 */\n public readonly intensity: number;\n /** If true, the light will be applied even when shadows are turned off for the view.\n * If false, a roughly overhead light of the same intensity oriented in view space will be used instead.\n * Default: false.\n */\n public readonly alwaysEnabled: boolean;\n /** If defined, the time in UNIX milliseconds from which [[direction]] was calculated.\n * @see [[DisplayStyleSettings.setSunTime]] to compute the solar direction from a point in time.\n */\n public readonly timePoint?: number;\n\n public constructor(json?: SolarLightProps) {\n json = json || {};\n this.intensity = extractIntensity(json.intensity, 1);\n this.alwaysEnabled = JsonUtils.asBool(json.alwaysEnabled);\n\n if (json.direction)\n this.direction = Vector3d.fromJSON(json.direction);\n else\n this.direction = defaultSolarDirection.clone();\n\n if (typeof json.timePoint === \"number\")\n this.timePoint = json.timePoint;\n }\n\n public toJSON(): SolarLightProps | undefined {\n const direction = this.direction.isAlmostEqual(defaultSolarDirection) ? undefined : this.direction.toJSON();\n const intensity = this.intensity !== 1 ? this.intensity : undefined;\n const alwaysEnabled = this.alwaysEnabled ? true : undefined;\n const timePoint = this.timePoint;\n\n if (undefined === direction && undefined === intensity && undefined === alwaysEnabled && undefined === timePoint)\n return undefined;\n\n const json: SolarLightProps = {};\n if (direction)\n json.direction = direction;\n\n if (undefined !== intensity)\n json.intensity = intensity;\n\n if (undefined !== alwaysEnabled)\n json.alwaysEnabled = alwaysEnabled;\n\n if (undefined !== timePoint)\n json.timePoint = timePoint;\n\n return json;\n }\n\n /** Create a copy of this SolarLight, identical except in any properties explicitly specified by `changedProps`, with a possible exception for [[timePoint]].\n * If `this.timePoint` is defined and `changedProps` defines `direction` but **doesn't** define `timePoint`, the time point will only be preserved in the\n * copy if `changesProps.direction` is equal to `this.direction`.\n */\n public clone(changedProps?: SolarLightProps): SolarLight {\n if (!changedProps)\n return this;\n\n const props = this.toJSON() ?? {};\n if (undefined !== changedProps.direction)\n props.direction = changedProps.direction;\n\n if (undefined !== changedProps.intensity)\n props.intensity = changedProps.intensity;\n\n if (undefined !== changedProps.alwaysEnabled)\n props.alwaysEnabled = changedProps.alwaysEnabled;\n\n if (undefined !== changedProps.timePoint)\n props.timePoint = changedProps.timePoint;\n\n // If our direction was computed from a time point and the caller only supplies a direction, invalidate the time point unless the input direction matches our direction.\n // If caller explicitly supplied a timePoint, trust it.\n if (undefined !== this.timePoint && undefined === changedProps.timePoint && undefined !== changedProps.direction) {\n const newDirection = Vector3d.fromJSON(changedProps.direction);\n if (!newDirection.isAlmostEqual(this.direction))\n props.timePoint = undefined;\n }\n\n return new SolarLight(props);\n }\n\n public equals(rhs: SolarLight): boolean {\n return this.intensity === rhs.intensity && this.alwaysEnabled === rhs.alwaysEnabled && this.direction.isExactEqual(rhs.direction) && this.timePoint === rhs.timePoint;\n }\n}\n\n/** Wire format for the ambient light associated with a [[LightSettingsProps]].\n * Ambient light applies equally to all surfaces in the scene.\n * @public\n * @extensions\n */\nexport interface AmbientLightProps {\n /** The color of the light. Black is treated as a special case, indicating that the surface's own diffuse color should be used. */\n color?: RgbColorProps;\n /** The intensity of the light. Default: 0.2. */\n intensity?: number;\n}\n\n/** Describes the ambient light associated with a [[LightSettings]].\n * @see [[AmbientLightProps]]\n * @public\n */\nexport class AmbientLight {\n public readonly color: RgbColor;\n public readonly intensity: number;\n\n public constructor(json?: AmbientLightProps) {\n json = json || {};\n this.intensity = extractIntensity(json.intensity, 0.2);\n this.color = json.color ? RgbColor.fromJSON(json.color) : new RgbColor(0, 0, 0);\n }\n\n public toJSON(): AmbientLightProps | undefined {\n const color = this.color.r !== 0 || this.color.g !== 0 || this.color.b !== 0 ? this.color.toJSON() : undefined;\n const intensity = 0.2 !== this.intensity ? this.intensity : undefined;\n if (undefined === color && undefined === intensity)\n return undefined;\n\n const json: AmbientLightProps = {};\n if (color)\n json.color = color;\n\n if (undefined !== intensity)\n json.intensity = intensity;\n\n return json;\n }\n\n /** Create a copy of this light, identical except for any properties explicitly specified by `changed`. */\n public clone(changed?: AmbientLightProps): AmbientLight {\n if (!changed)\n return this;\n\n const props = this.toJSON() ?? {};\n if (undefined !== changed.intensity)\n props.intensity = changed.intensity;\n\n if (undefined !== changed.color)\n props.color = changed.color;\n\n return new AmbientLight(props);\n }\n\n public equals(rhs: AmbientLight): boolean {\n return this.intensity === rhs.intensity && this.color.equals(rhs.color);\n }\n}\n\n/** Wire format for a pair of hemisphere lights associated with a [[LightSettingsProps]].\n * Hemisphere lights are oriented in opposite directions along the world Z axis. Each has its own color; they share one intensity.\n * They are often used to simulate outdoor reflection of light from the ground and sky, so the colors often match the ground and sky colors\n * of the [[SkyBox]].\n * @public\n * @extensions\n */\nexport interface HemisphereLightsProps {\n /** The color of the downward-facing light. Default: (143, 205, 255). */\n upperColor?: RgbColorProps;\n /** The color of the upward-facing light. Default: (120, 143, 125). */\n lowerColor?: RgbColorProps;\n /** Intensity of the lights. Default: 0. */\n intensity?: number;\n}\n\nconst defaultUpperHemisphereColor = new RgbColor(143, 205, 255);\nconst defaultLowerHemisphereColor = new RgbColor(120, 143, 125);\n\n/** Describes a pair of hemisphere lights associated with a [[LightSettings]].\n * @see [[HemisphereLightsProps]]\n * @public\n */\nexport class HemisphereLights {\n public readonly upperColor: RgbColor;\n public readonly lowerColor: RgbColor;\n public readonly intensity: number;\n\n public constructor(json?: HemisphereLightsProps) {\n json = json || {};\n this.intensity = extractIntensity(json.intensity, 0);\n this.upperColor = json.upperColor ? RgbColor.fromJSON(json.upperColor) : defaultUpperHemisphereColor;\n this.lowerColor = json.lowerColor ? RgbColor.fromJSON(json.lowerColor) : defaultLowerHemisphereColor;\n }\n\n public toJSON(): HemisphereLightsProps | undefined {\n const upperColor = this.upperColor.equals(defaultUpperHemisphereColor) ? undefined : this.upperColor.toJSON();\n const lowerColor = this.lowerColor.equals(defaultLowerHemisphereColor) ? undefined : this.lowerColor.toJSON();\n const intensity = 0 === this.intensity ? undefined : this.intensity;\n\n if (undefined === upperColor && undefined === lowerColor && undefined === intensity)\n return undefined;\n\n const json: HemisphereLightsProps = {};\n if (upperColor)\n json.upperColor = upperColor;\n\n if (lowerColor)\n json.lowerColor = lowerColor;\n\n if (undefined !== intensity)\n json.intensity = intensity;\n\n return json;\n }\n\n /** Create a copy of these lights, identical except for any properties explicitly specified by `changed`. */\n public clone(changed?: HemisphereLightsProps): HemisphereLights {\n if (!changed)\n return this;\n\n const props = this.toJSON() || {};\n if (undefined !== changed.upperColor)\n props.upperColor = changed.upperColor;\n\n if (undefined !== changed.lowerColor)\n props.lowerColor = changed.lowerColor;\n\n if (undefined !== changed.intensity)\n props.intensity = changed.intensity;\n\n return new HemisphereLights(props);\n }\n\n public equals(rhs: HemisphereLights): boolean {\n return this.intensity === rhs.intensity && this.upperColor.equals(rhs.upperColor) && this.lowerColor.equals(rhs.lowerColor);\n }\n}\n\n/** JSON representation of a [[FresnelSettings]].\n * @public\n * @extensions\n */\nexport interface FresnelSettingsProps {\n /** See [[FresnelSettings.intensity]].\n * Default value: 0\n */\n intensity?: number;\n\n /** See [[FresnelSettings.invert]].\n * Default value: false\n */\n invert?: boolean;\n}\n\nfunction clampIntensity(intensity = 0): number {\n return Math.max(intensity, 0);\n}\n\n/** As part of a [[LightSettings]], describes how to apply a Fresnel effect to the contents of the view.\n * The \"Fresnel effect\" is based on the observation that the reflectivity of a surface varies based on the angle between the surface and\n * the viewer's line of sight. For example, a flat surface will appear more reflective when viewed at a glancing angle than it will when\n * viewed from above; and a sphere will appear more reflective around its edges than at its center.\n *\n * This principle can be used to improve photorealism, but the implementation provided here is intended to produce non-realistic but\n * aesthetically-pleasing results.\n * @see [[LightSettings.fresnel]].\n * @public\n */\nexport class FresnelSettings {\n /** The strength of the effect in terms of how much brighter the surface becomes. The intensity at a given point on the surface is determined by\n * the angle between the viewer's line of sight and the vector from the viewer to that point. Maximum intensity is produced when those vectors are\n * perpendicular, and zero intensity is produced when those vectors are parallel (unless [[invert]] is `true`).\n *\n * A value of zero turns off the effect. Values less than zero are clamped to zero. Typical values range between 0 and 1.\n */\n public readonly intensity: number;\n /** If true, inverts the effect's [[intensity]] such that maximum intensity is produced when the viewer's line of sight is parallel to the vector between\n * the viewer and the point on the surface, and zero intensity is produced when the viewer's line of sight is perpendicular to that vector.\n */\n public readonly invert: boolean;\n\n private constructor(intensity: number, invert: boolean) {\n assert(intensity >= 0);\n this.intensity = intensity;\n this.invert = invert;\n }\n\n private static readonly _defaults = new FresnelSettings(0, false);\n\n /** Create from JSON representation, using default values for any unspecified or `undefined` properties. */\n public static fromJSON(props?: FresnelSettingsProps): FresnelSettings {\n const intensity = clampIntensity(JsonUtils.asDouble(props?.intensity));\n const invert = JsonUtils.asBool(props?.invert);\n if (0 === intensity && !invert)\n return this._defaults;\n\n return new this(intensity, invert);\n }\n\n /** Create a new FresnelSettings.\n * @note Intensity values less than zero will be set to zero.\n */\n public static create(intensity = 0, invert = false): FresnelSettings {\n return this.fromJSON({ intensity, invert });\n }\n\n /** Convert to JSON representation.\n * @note If all settings match the default values, `undefined` will be returned.\n */\n public toJSON(): FresnelSettingsProps | undefined {\n if (0 === this.intensity && !this.invert)\n return undefined;\n\n const props: FresnelSettingsProps = {};\n if (0 !== this.intensity)\n props.intensity = this.intensity;\n\n if (this.invert)\n props.invert = true;\n\n return props;\n }\n\n /** Create a copy of these settings, modified to match any properties explicitly specified by `changedProps`. */\n public clone(changedProps?: FresnelSettingsProps): FresnelSettings {\n if ((undefined === changedProps?.intensity || changedProps.intensity === this.intensity)\n && (undefined === changedProps?.invert || changedProps.invert === this.invert))\n return this;\n\n const intensity = changedProps?.intensity ?? this.intensity;\n const invert = changedProps?.invert ?? this.invert;\n return FresnelSettings.fromJSON({ intensity, invert });\n }\n\n /** Return true if these settings are equivalent to `rhs`. */\n public equals(rhs: FresnelSettings): boolean {\n return this === rhs || (this.intensity === rhs.intensity && this.invert === rhs.invert);\n }\n}\n\n/** Wire format for a [[LightSettings]] describing lighting for a 3d scene.\n * 3d lighting provides the following lights, all of which are optional:\n * - A \"portrait\" light affixed to the camera and pointing directly forward into the scene. Color: white.\n * - A second directional light. Color: white.\n * - This can be a solar shadow-casting light, or (when shadows are disabled) a roughly overhead light oriented in view space.\n * - A pair of hemisphere lights pointing in opposite directions along the world Z axis. Each has its own customizable color.\n * - An ambient light of any color applied equally to all surfaces.\n * Specular intensity of all lights is controlled separately.\n * Light intensities are typically expressed in [0..1] but can be as large as 5.\n * @see [[DisplayStyle3dSettingsProps]]\n * @public\n * @extensions\n */\nexport interface LightSettingsProps {\n /** A white portrait light affixed to the camera and pointing directly forward into the scene. */\n portrait?: {\n /** Intensity, typically in [0..1], maximum 5. Default: 0.3. */\n intensity?: number;\n };\n /** Solar light settings. */\n solar?: SolarLightProps;\n /** Hemisphere light settings. */\n hemisphere?: HemisphereLightsProps;\n /** Ambient light settings. */\n ambient?: AmbientLightProps;\n /** Specular intensity applied to all lights. */\n specularIntensity?: number;\n /** Applies a [cel-shaded](https://en.wikipedia.org/wiki/Cel_shading) effect. If greater than zero, specifies the number of cels. Continuous lighting intensities\n * are computed, then quantized to the specified number of cels. Values greater than 254 have no visible effect.\n * Typically a value of 2 is appropriate if specular intensity is close to zero; 3 if specular intensity is larger.\n * Cel-shading is often combined with thick, dark visible edges for a cartoon or comic book effect.\n * Default: 0\n */\n numCels?: number;\n\n /** Fresnel settings.\n * @see [[FresnelSettings]].\n */\n fresnel?: FresnelSettingsProps;\n}\n\n/** Describes the lighting for a 3d scene, associated with a [[DisplayStyle3dSettings]] in turn associated with a [DisplayStyle3d]($backend) or [DisplayStyle3dState]($frontend).\n * @see [[LightSettingsProps]]\n * @public\n */\nexport class LightSettings {\n public readonly solar: SolarLight;\n public readonly ambient: AmbientLight;\n public readonly hemisphere: HemisphereLights;\n /** See [[LightSettingsProps.portrait]]. */\n public readonly portraitIntensity: number;\n public readonly specularIntensity: number;\n /** See [[LightSettingsProps.numCels]]. */\n public readonly numCels: number;\n public readonly fresnel: FresnelSettings;\n\n private constructor(solar: SolarLight, ambient: AmbientLight, hemisphere: HemisphereLights, portraitIntensity: number, specularIntensity: number, numCels: number,\n fresnel: FresnelSettings) {\n this.solar = solar;\n this.ambient = ambient;\n this.hemisphere = hemisphere;\n this.portraitIntensity = portraitIntensity;\n this.specularIntensity = specularIntensity;\n this.numCels = numCels;\n this.fresnel = fresnel;\n }\n\n public static fromJSON(props?: LightSettingsProps): LightSettings {\n const solar = new SolarLight(props?.solar);\n const ambient = new AmbientLight(props?.ambient);\n const hemisphere = new HemisphereLights(props?.hemisphere);\n const portraitIntensity = extractIntensity(props?.portrait?.intensity, 0.3);\n const specularIntensity = extractIntensity(props?.specularIntensity, 1.0);\n const numCels = JsonUtils.asInt(props?.numCels, 0);\n const fresnel = FresnelSettings.fromJSON(props?.fresnel);\n\n return new LightSettings(solar, ambient, hemisphere, portraitIntensity, specularIntensity, numCels, fresnel);\n }\n\n public toJSON(): LightSettingsProps | undefined {\n const solar = this.solar.toJSON();\n const ambient = this.ambient.toJSON();\n const hemisphere = this.hemisphere.toJSON();\n const portrait = 0.3 !== this.portraitIntensity ? { intensity: this.portraitIntensity } : undefined;\n const specularIntensity = 1 !== this.specularIntensity ? this.specularIntensity : undefined;\n const numCels = 0 !== this.numCels ? this.numCels : undefined;\n const fresnel = this.fresnel.toJSON();\n\n if (!solar && !ambient && !hemisphere && !portrait && undefined === specularIntensity && undefined === numCels && undefined === fresnel)\n return undefined;\n\n const json: LightSettingsProps = {};\n if (solar)\n json.solar = solar;\n\n if (ambient)\n json.ambient = ambient;\n\n if (hemisphere)\n json.hemisphere = hemisphere;\n\n if (portrait)\n json.portrait = portrait;\n\n if (undefined !== specularIntensity)\n json.specularIntensity = specularIntensity;\n\n if (undefined !== numCels)\n json.numCels = numCels;\n\n if (fresnel)\n json.fresnel = fresnel;\n\n return json;\n }\n\n /** Create a copy of these light settings, identical except for any properties explicitly specified by `changed`.\n * Note that the solar, ambient, and hemisphere lights will also be cloned using their own `clone` methods - so for example, the following:\n * ` clone({ ambient: { intensity: 0.5 } })`\n * will overwrite the ambient light's intensity but preserve its current color, rather than replacing the color with the default color.\n */\n public clone(changed?: LightSettingsProps): LightSettings {\n if (!changed)\n return this;\n\n const solar = this.solar.clone(changed.solar);\n const ambient = this.ambient.clone(changed.ambient);\n const hemisphere = this.hemisphere.clone(changed.hemisphere);\n const portrait = changed.portrait?.intensity ?? this.portraitIntensity;\n const specular = changed.specularIntensity ?? this.specularIntensity;\n const numCels = changed.numCels ?? this.numCels;\n const fresnel = this.fresnel.clone(changed.fresnel);\n\n return new LightSettings(solar, ambient, hemisphere, portrait, specular, numCels, fresnel);\n }\n\n public equals(rhs: LightSettings): boolean {\n if (this === rhs)\n return true;\n\n return this.portraitIntensity === rhs.portraitIntensity && this.specularIntensity === rhs.specularIntensity && this.numCels === rhs.numCels\n && this.ambient.equals(rhs.ambient) && this.solar.equals(rhs.solar) && this.hemisphere.equals(rhs.hemisphere) && this.fresnel.equals(rhs.fresnel);\n }\n}\n"]}
|