@itwin/core-common 5.3.0-dev.1 → 5.3.0-dev.10
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/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/CatalogIModel.js.map +1 -1
- package/lib/cjs/CesiumIonAssets.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +24 -6
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderPolyline.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts +4 -29
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +8 -35
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextField.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.d.ts +64 -36
- package/lib/cjs/annotation/TextStyle.d.ts.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +63 -44
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMaterialParams.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/RenderTextureParams.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/CatalogIModel.js.map +1 -1
- package/lib/esm/CesiumIonAssets.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +24 -6
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderPolyline.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts +4 -29
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +8 -35
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextField.js.map +1 -1
- package/lib/esm/annotation/TextStyle.d.ts +64 -36
- package/lib/esm/annotation/TextStyle.d.ts.map +1 -1
- package/lib/esm/annotation/TextStyle.js +63 -44
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMaterialParams.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/RenderTextureParams.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +7 -7
package/lib/esm/ViewProps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewProps.js","sourceRoot":"","sources":["../../src/ViewProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AA4OH;;;GAGG;AACH,MAAM,KAAW,YAAY,CA0W5B;AA1WD,WAAiB,YAAY;IAE3B;;;;OAIG;IACU,oBAAO,GAAG,OAAO,CAAC;IAkC/B,qGAAqG;IACxF,0BAAa,GAAG,CAAC,EAAiB,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AAgUnF,CAAC,EA1WgB,YAAY,KAAZ,YAAY,QA0W5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { CompressedId64Set, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { AngleProps, Range3dProps, TransformProps, XYProps, XYZProps, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { CameraProps } from \"./Camera\";\nimport { DisplayStyleProps, DisplayStyleSettingsProps } from \"./DisplayStyleSettings\";\nimport { DefinitionElementProps, DisplayStyleLoadProps, ElementProps, RenderTimelineProps, SheetProps, ViewAttachmentProps } from \"./ElementProps\";\nimport { EntityQueryParams } from \"./EntityProps\";\nimport { ModelProps } from \"./ModelProps\";\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\nimport { ViewDetails3dProps, ViewDetailsProps } from \"./ViewDetails\";\nimport { ThumbnailProps } from \"./Thumbnail\";\nimport { RenderSchedule } from \"./RenderSchedule\";\n\n/** The id of either an element or an entry in a ViewStore.\n * @public\n */\nexport type ViewIdString = Id64String; // should also include ViewStoreRpc.IdString when that's @public\n\n/** As part of a [[ViewStateProps]], describes the [[SpatialViewDefinition]] from which a [SectionDrawing]($backend) was generated.\n * @see [[SectionDrawingProps]]\n * @public\n * @extensions\n */\nexport interface SectionDrawingViewProps {\n /** The Id of the spatial view from which the SectionDrawing was generated. */\n spatialView: Id64String;\n /** If true, the spatial view should be displayed in the context of the drawing view. */\n displaySpatialView: boolean;\n /** Transform from drawing coordinates to spatial coordinates. If undefined, use identity transform. */\n drawingToSpatialTransform?: TransformProps;\n}\n\n/** The response props from the getCustomViewState3dData RPC endpoint\n * @internal\n */\nexport interface CustomViewState3dProps {\n modelIds: CompressedId64Set;\n modelExtents: Range3dProps;\n categoryIds: CompressedId64Set;\n}\n\n/**\n * The options passed to the getCustomViewState3dData RPC endpoint.\n * @internal\n */\nexport interface CustomViewState3dCreatorOptions {\n modelIds?: CompressedId64Set;\n}\n\n/**\n * A result row from querying for subcategories\n * @internal\n */\nexport interface SubCategoryResultRow {\n parentId: Id64String;\n id: Id64String;\n appearance: SubCategoryAppearance.Props;\n}\n\n/**\n * Request props for the hydrateViewState RPC endpoint.\n * @internal\n */\nexport interface HydrateViewStateRequestProps {\n acsId?: string;\n notLoadedModelSelectorStateModels?: CompressedId64Set;\n sheetViewAttachmentIds?: CompressedId64Set;\n viewStateLoadProps?: ViewStateLoadProps;\n baseModelId?: Id64String;\n spatialViewId?: Id64String;\n}\n\n/** Response props from the hydrateViewState RPC endpoint.\n * @internal\n */\nexport interface HydrateViewStateResponseProps {\n acsElementProps?: ElementProps;\n modelSelectorStateModels?: ModelProps[];\n // cast this to viewAttachmentInfo[] on the frontend.\n sheetViewAttachmentProps?: ViewAttachmentProps[];\n sheetViewViews?: (ViewStateProps | undefined)[];\n baseModelProps?: ModelProps;\n spatialViewProps?: ViewStateProps;\n}\n\n/** Returned from [IModelDb.Views.getViewStateProps]($backend).\n * @public\n * @extensions\n */\nexport interface ViewStateProps {\n viewDefinitionProps: ViewDefinitionProps;\n categorySelectorProps: CategorySelectorProps;\n modelSelectorProps?: ModelSelectorProps;\n displayStyleProps: DisplayStyleProps;\n /** Sheet-specific properties, if this is a view of a [SheetModel]($backend). */\n sheetProps?: SheetProps;\n /** The Ids of the [ViewAttachment]($backend)s contained within the [SheetModel]($backend), if this is a sheet view. */\n sheetAttachments?: Id64Array;\n /** For a [DrawingViewState]($frontend), the extents of the [DrawingModel]($backend), used for determining the upper limits of the view's extents. */\n modelExtents?: Range3dProps;\n /** Information about the [SectionDrawing]($backend) relevant to displaying a drawing view. */\n sectionDrawing?: SectionDrawingViewProps;\n}\n\n/** Options for loading a [[ViewStateProps]] via [IModelConnection.Views.load]($frontend) or [IModelDb.Views.getViewStateProps]($backend).\n * @public\n * @extensions\n */\nexport interface ViewStateLoadProps {\n /** Options for loading the view's [[DisplayStyleProps]]. */\n displayStyle?: DisplayStyleLoadProps;\n\n /**\n * bindings for query-based selectors\n * @beta\n */\n queryBindings?: {\n modelSelector?: ViewStoreRpc.QueryBindings;\n categorySelector?: ViewStoreRpc.QueryBindings;\n };\n}\n\n/** Properties that define a ModelSelector\n * @public\n * @extensions\n */\nexport interface ModelSelectorProps extends DefinitionElementProps {\n models: Id64Array;\n}\n\n/** Properties that define a CategorySelector\n * @public\n * @extensions\n */\nexport interface CategorySelectorProps extends DefinitionElementProps {\n categories: Id64Array;\n}\n\n/** Parameters for performing a query on [ViewDefinition]($backend) classes.\n * @public\n * @extensions\n */\nexport interface ViewQueryParams extends EntityQueryParams {\n wantPrivate?: boolean;\n}\n\n/** Parameters used to construct a ViewDefinition\n * @public\n * @extensions\n */\nexport interface ViewDefinitionProps extends DefinitionElementProps {\n categorySelectorId: ViewIdString;\n displayStyleId: ViewIdString;\n description?: string;\n jsonProperties?: {\n /** Additional properties of the view. */\n viewDetails?: ViewDetailsProps;\n };\n}\n\n/** Parameters to construct a ViewDefinition3d\n * @public\n * @extensions\n */\nexport interface ViewDefinition3dProps extends ViewDefinitionProps {\n /** if true, camera is valid. */\n cameraOn: boolean;\n /** The lower left back corner of the view frustum. */\n origin: XYZProps;\n /** The extent of the view frustum. */\n extents: XYZProps;\n /** Rotation of the view frustum (could be undefined if going Matrix3d -> YawPitchRoll). */\n angles?: YawPitchRollProps;\n /** The camera used for this view. */\n camera: CameraProps;\n jsonProperties?: {\n /** Additional properties of the view. */\n viewDetails?: ViewDetails3dProps;\n };\n}\n\n/** Parameters to construct a SpatialViewDefinition\n * @public\n * @extensions\n */\nexport interface SpatialViewDefinitionProps extends ViewDefinition3dProps {\n modelSelectorId: ViewIdString;\n}\n\n/** Parameters used to construct a ViewDefinition2d\n * @public\n * @extensions\n */\nexport interface ViewDefinition2dProps extends ViewDefinitionProps {\n baseModelId: Id64String;\n origin: XYProps;\n delta: XYProps;\n angle: AngleProps;\n}\n\n/**\n * @public\n * @extensions\n */\nexport interface AuxCoordSystemProps extends ElementProps {\n type?: number;\n description?: string;\n}\n\n/** Properties of AuxCoordSystem2d\n * @public\n * @extensions\n */\nexport interface AuxCoordSystem2dProps extends AuxCoordSystemProps {\n /** Origin of the AuxCoordSystem2d */\n origin?: XYProps;\n /** Rotation angle */\n angle?: AngleProps;\n}\n\n/** Properties of AuxCoordSystem3d\n * @public\n * @extensions\n */\nexport interface AuxCoordSystem3dProps extends AuxCoordSystemProps {\n /** Origin of the AuxCoordSystem3d */\n origin?: XYZProps;\n /** Yaw angle */\n yaw?: AngleProps;\n /** Pitch angle */\n pitch?: AngleProps;\n /** Roll angle */\n roll?: AngleProps;\n}\n\n/**\n * Access to a ViewStore from the frontend.\n * @beta\n */\nexport namespace ViewStoreRpc {\n\n /**\n * Version of the Rpc interface. If any methods or interfaces of this API change, this number should\n * be incremented according to the rules of semantic versioning. See .\\rpc\\README-RpcInterfaceVersioning.md for more information.\n * @internal\n */\n export const version = \"4.0.0\";\n\n /** an Id of a View, DisplayStyle, ModelSelector, CategorySelector, or Timeline in a ViewStore.\n * Will be a base-36 number with a leading \"@\".\n * @public\n */\n export type IdString = string;\n\n /**\n * A string identifying a group. This may either be a \"group name path\" or the RowString of a group (e.g. either \"group1/design/issues\" or \"@4e3\")\n * The syntax is not ambiguous because ViewStoreIdStrings always start with \"@\" and Group names can never contain \"@\".\n */\n export type ViewGroupSpec = IdString | ViewGroupPath;\n\n /** The name for a view. */\n export type ViewName = string;\n\n /** The name for a Tag. */\n export type TagName = string;\n\n /** The name of an \"owner\". Should come from the authentication system, so it will be guaranteed unique.\n * This name should be chosen by the user rather than their email address.\n */\n export type OwnerName = string;\n\n /** The path name of a view group (e.g. \"group1/design/issues\"). Does not include the \"root\" group. */\n export type ViewGroupPath = string;\n\n /** The name for a view group. */\n export type ViewGroupName = string;\n\n /** The name for a view group. */\n export type ClassFullName = string;\n\n /** Determine if a string is an Id of an entry in a ViewStore (base-36 integer with a leading \"@\") */\n export const isViewStoreId = (id?: ViewIdString) => true === id?.startsWith(\"@\");\n\n /** Parameters for querying for views in a ViewStore. */\n export interface QueryParams {\n /** a list of classFullNames to accept. If not present, all classes are returned. */\n readonly classNames?: ClassFullName[];\n /** Optional \"LIMIT\" clause to limit the number of views returned. */\n readonly limit?: number;\n /** Optional \"OFFSET\" clause. Only valid if Limit is also present. */\n readonly offset?: number;\n /** A string to filter view names. May include wildcards if the `nameCompare` uses LIKE or GLOB (see SQLite documentation for LIKE and GLOB). */\n readonly nameSearch?: string;\n /** The comparison operator for `nameSearch`. Default is `=` */\n readonly nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\n /* the Id of the view group to query. If not present, the root group is used. There is no way to query for views from multiple view groups in one request. */\n readonly group?: IdString;\n /** A list of tags to filter views. If present, only views that have one or more of the tags will be returned. */\n readonly tags?: TagName[];\n /* The name of an owner for private views. If present, private views owned by the owner will also be returned. Shared views are always returned. */\n readonly owner?: OwnerName;\n }\n\n /** Parameters for specifying a Query to select Categories or Models. */\n export interface SelectorQuery {\n /**\n * The full ClassName from which to select. If this SelectorQuery is for Categories, this must be or derive from \"BisCore:Category\".\n * If this SelectorQuery is for Models, this must be or derive from \"BisCore:Model\".\n */\n from: ClassFullName;\n /** If true, only return instances of `from`. Otherwise, return instances of `from` and any subclasses of `from`. */\n only?: boolean;\n /**\n * filter for query. If present, only instances of `from` that satisfy the filter will be returned.\n * If not supplied, all instances of `from` are returned.\n * @note\n * This value is used into the ECQuery:`SELECT ECInstanceId FROM ${query.from} WHERE ${query.where}`.\n */\n where?: string;\n /** List of Model or Category ids to add to the query results.\n * @note This is only valid if there is a `where` clause. Otherwise all instances of `from` will be returned so there is no value in adding ids.\n */\n adds?: Id64Array | CompressedId64Set;\n /** List of Model or Category Ids to remove from the query results. */\n removes?: Id64Array | CompressedId64Set;\n }\n\n /** A Model or Category selector may either be a query or a list of Ids. */\n export type SelectorProps = { query: SelectorQuery, ids?: never } | { query?: never, ids: Id64Array | CompressedId64Set };\n\n /** Information about a View in a ViewStore. */\n export interface ViewInfo {\n /** The Id of the view. */\n id: IdString;\n /** The name of the view. */\n name?: ViewName;\n /** The name of the owner of the view. */\n owner?: OwnerName;\n /** The className of the view. */\n className: ClassFullName;\n /** The Id of the view group containing the view. */\n groupId: IdString;\n /** If true, the view is private (unshared) and will only be returned by queries that specify the owner's name. */\n isPrivate: boolean;\n /** The Id of a ModelSelector, if the view has one. */\n modelSelectorId?: IdString;\n /** The Id of the CategorySelector for this view. */\n categorySelectorId: IdString;\n /** The Id of a DisplayStyle for the view. */\n displayStyleId: IdString;\n /** a list of tags for the view. */\n tags?: TagName[];\n }\n\n /** Information about a ViewGroup in a ViewStore. */\n export interface ViewGroupInfo {\n /** The Id of this view group. */\n id: IdString;\n /** The name of this view group. */\n name: ViewGroupName;\n /** The Id of the parent of this view group. If undefined, this is the root group. */\n parent?: IdString;\n /** The Id of the default view for this view group. */\n defaultView?: IdString;\n }\n\n /** Arguments for adding a new view to a ViewStore. */\n export interface AddViewArgs {\n /** the properties of the ViewDefinition for the new view. */\n readonly viewDefinition: ViewDefinitionProps;\n\n /**\n * The properties of a category selector for the new view.\n * @note This value is only used, and should only be present if `viewDefinition.categorySelectorId` **not** a valid\n * `IdString`. In that case, a new category selector will be created with these properties and its Id will be used.\n * Otherwise, the categorySelectorId from the ViewDefinition is used. If it does not represent a valid category\n * selector, an error is thrown.\n */\n readonly categorySelectorProps?: CategorySelectorProps;\n\n /** The properties of a model selector for the new view.\n * @note This value is only used, and should only be present if `viewDefinition.modelSelectorId` **not** a valid\n * `IdString`. In that case, a new model selector will be created with these properties and its Id will be used.\n * Otherwise, the modelSelectorId from the ViewDefinition is used. If it does not represent a valid model selector,\n * an error is thrown.\n */\n readonly modelSelectorProps?: ModelSelectorProps;\n\n /** The properties of a display style for the new view.\n * @note This value is only used, and should only be present if `viewDefinition.displayStyleId` **not** a valid\n * `IdString`. In that case, a new display style will be created with these properties and its Id will be used.\n * Otherwise, the displayStyleId from the ViewDefinition is used. If it does not represent a valid display style, an\n * error is thrown.\n */\n readonly displayStyleProps?: DisplayStyleProps;\n\n /* the owner of the view. Must be present if isPrivate is true. */\n readonly owner?: OwnerName;\n\n /* the Id of the view group for the view. If not present, the view is added to the root group. */\n readonly group?: IdString;\n\n /* if true, the view is private (unshared). */\n readonly isPrivate?: boolean;\n\n /* an optional list of tags for the view. */\n readonly tags?: TagName[];\n\n /** optional thumbnail for the view. */\n readonly thumbnail?: ThumbnailProps;\n }\n\n /** Argument for finding a category selector, model selector, display style, or timeline by name or Id. */\n export type NameOrId = { name: string, id?: never } | { id: IdString, name?: never };\n\n /** Bindings for parameterized values in where clause of SelectorQuery\n * @see[[ECSqlStatement.bindValues]]\n */\n export interface QueryBindings {\n bindings?: any[] | object;\n }\n\n /**\n * Methods for reading from a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreReader`. These\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\n * user only needs read permission to the ViewStore.\n */\n export interface Reader {\n /** Find all views owned by the supplied owner name. */\n findViewsByOwner(args: { owner: OwnerName }): Promise<ViewInfo[]>;\n\n /** Get a category selector by Id. Throws if it does not exist. */\n getCategorySelector(args: NameOrId & QueryBindings): Promise<CategorySelectorProps>;\n\n /** Get a display style by Id. Throws if it does not exist. */\n getDisplayStyle(args: NameOrId & { opts?: DisplayStyleLoadProps }): Promise<DisplayStyleProps>;\n\n /** Get a model selector by Id. Throws if it does not exist. */\n getModelSelector(args: NameOrId & QueryBindings): Promise<ModelSelectorProps>;\n\n /** Get a thumbnail for a view. */\n getThumbnail(args: { viewId: IdString }): Promise<ThumbnailProps | undefined>;\n\n /** Get a render timeline by Id. Throws if it does not exist. */\n getTimeline(args: NameOrId): Promise<RenderTimelineProps>;\n\n /** Get a view by name. The name can include the *view group path*, if no `groupId` is supplied. */\n getViewByName(arg: { name: ViewName, groupId?: IdString }): Promise<ViewInfo | undefined>;\n\n /** Get a view definition by viewId. Throws if it does not exist. */\n getViewDefinition(args: { viewId: IdString }): Promise<ViewDefinitionProps>;\n\n /** get the properties of a ViewGroup by id. This will include the defaultViewId, if one exists. */\n getViewGroupInfo(args: { groupId?: IdString }): Promise<ViewGroupInfo | undefined>;\n\n /** Get a list of ViewGroups that are children of the supplied parent. If no parent is supplied, the root group is used.\n * Each entry in the list includes the id and name of the ViewGroup.\n */\n getViewGroups(args: { parent?: ViewGroupSpec }): Promise<{ id: IdString, name: string }[]>;\n\n /** Get the ViewInfo for a view by Id. Returns undefined if the view does not exist. */\n getViewInfo(args: { viewId: IdString }): Promise<ViewInfo | undefined>;\n\n /** Query for a list of ViewInfos for views that match the supplied [[QueryParams]].\n * @note The array will be sorted by name, ascending. To limit the size of the array, supply `limit` and `offset` in the QueryParams.\n */\n queryViews(queryParams: QueryParams): Promise<ViewInfo[]>;\n }\n\n /**\n * Methods for writing to a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreWriter`. These\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\n * user must have write permission to the ViewStore.\n */\n export interface Writer {\n /**\n * Add a category selector to a ViewStore.\n * @returns The IdString of the new category selector.\n */\n addCategorySelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\n\n /** Add a display style to a ViewStore.\n * @returns The IdString of the new display style.\n */\n addDisplayStyle(args: { name?: string, className: string, settings: DisplayStyleSettingsProps, owner?: OwnerName }): Promise<IdString>;\n\n /**\n * Add a model selector to a ViewStore.\n * @returns The IdString of the new model selector.\n */\n addModelSelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\n\n /**\n * Add a thumbnail for a view. If the view already has a thumbnail, it is replaced.\n * If a view is deleted, its thumbnail is also deleted.\n * @note The thumbnail must be a valid image in PNG or JPEG format.\n */\n addOrReplaceThumbnail(args: { viewId: IdString, thumbnail: ThumbnailProps }): Promise<void>;\n\n /** Add tags to a view. If the view already has tags, the new tags are appended to the existing tags. */\n addTagsToView(args: { viewId: IdString, tags: TagName[] }): Promise<void>;\n\n /** Add a render timeline to a ViewStore.\n * @returns The IdString of the new timeline.\n */\n addTimeline(args: { name?: string, timeline: RenderSchedule.ScriptProps, owner?: OwnerName }): Promise<IdString>;\n\n /** Add a view to a ViewStore. If no group is supplied, the new view is added to the root view group.\n * @returns The IdString of the new view\n */\n addView(args: AddViewArgs): Promise<IdString>;\n\n /** Add a view group to a ViewStore. If no parent is supplied, the new group is added to the root view group.\n * @returns the IdString of new view group\n */\n addViewGroup(args: { name: string, parentId?: IdString, owner?: OwnerName }): Promise<IdString>;\n\n /** Change the default view for a view group. If no group is supplied, this changes the default view for the root view group. */\n changeDefaultViewId(args: { defaultView: IdString, group?: ViewGroupSpec }): Promise<void>;\n\n /** Delete the thumbnail for a view. */\n deleteThumbnail(args: { viewId: IdString }): Promise<void>;\n\n /**\n * Delete a view from a ViewStore. If this is the default view for a view group, it cannot be deleted until another\n * view is set as the default.\n * @note If this view references a category selector, model selector, or display style that is not referenced by any\n * other view, *and do not have a name*, they will each also be deleted. If the view has a thumbnail, it is also\n * deleted.\n */\n deleteView(args: { viewId: IdString }): Promise<void>;\n\n /** Delete a view group from a ViewStore. This will also delete all views in the group. */\n deleteViewGroup(args: { name: ViewGroupSpec }): Promise<void>;\n\n /** Delete a display style from a ViewStore. If the display style is referenced by any view, it cannot be deleted\n * and an exception will be thrown.\n */\n deleteDisplayStyle(args: { id: IdString }): Promise<void>;\n\n /** Delete a model selector from a ViewStore. If the model selector is referenced by any view, it cannot be deleted\n * and an exception will be thrown. */\n deleteModelSelector(args: { id: IdString }): Promise<void>;\n\n /** Delete a category selector from a ViewStore. If the category selector is referenced by any view, it cannot be\n * deleted and an exception will be thrown.\n */\n deleteCategorySelector(args: { id: IdString }): Promise<void>;\n\n /** Delete a render timeline from a ViewStore. */\n deleteTimeline(args: { id: IdString }): Promise<void>;\n\n /** Delete a tag. This removes it from all views where it was used. */\n deleteTag(args: { name: TagName }): Promise<void>;\n\n /** remove a tag from a view. */\n removeTagFromView(args: { viewId: IdString, tag: TagName }): Promise<void>;\n\n /** Update the properties of a category selector. */\n updateCategorySelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\n\n /** Update the properties of a display style. */\n updateDisplayStyle(args: NameOrId & { className: string, settings: DisplayStyleSettingsProps }): Promise<void>;\n\n /** Update the properties of a model selector. */\n updateModelSelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\n\n /** Update the properties of a render timeline. */\n updateTimeline(args: NameOrId & { timeline: RenderSchedule.ScriptProps }): Promise<void>;\n\n /** Update the properties of a view definition. */\n updateViewDefinition(args: { viewId: IdString, viewDefinition: ViewDefinitionProps }): Promise<void>;\n\n /** Change a view from shared to private, or vice versa. If changing to private, the owner must be supplied. */\n updateViewShared(arg: { viewId: IdString, isShared: boolean, owner?: string }): Promise<void>;\n\n /** Set the name of a category selector. */\n renameCategorySelector(args: { id: IdString, name?: string }): Promise<void>;\n\n /** Set the name of a display style. */\n renameDisplayStyle(args: { id: IdString, name?: string }): Promise<void>;\n\n /** Set the name of a model selector. */\n renameModelSelector(args: { id: IdString, name?: string }): Promise<void>;\n\n /** Set the name of a render timeline. */\n renameTimeline(args: { id: IdString, name?: string }): Promise<void>;\n\n /** Set the name of a view. */\n renameView(args: { viewId: IdString, name: string }): Promise<void>;\n\n /** Set the name of a view group. */\n renameViewGroup(args: { groupId: IdString, name: string }): Promise<void>;\n\n /** rename an existing tag. */\n renameTag(args: { oldName: TagName, newName: TagName }): Promise<void>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewProps.js","sourceRoot":"","sources":["../../src/ViewProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AA4OH;;;GAGG;AACH,MAAM,KAAW,YAAY,CA0W5B;AA1WD,WAAiB,YAAY;IAE3B;;;;OAIG;IACU,oBAAO,GAAG,OAAO,CAAC;IAkC/B,qGAAqG;IACxF,0BAAa,GAAG,CAAC,EAAiB,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AAgUnF,CAAC,EA1WgB,YAAY,KAAZ,YAAY,QA0W5B","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 Views\r\n */\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { AngleProps, Range3dProps, TransformProps, XYProps, XYZProps, YawPitchRollProps } from \"@itwin/core-geometry\";\r\nimport { CameraProps } from \"./Camera\";\r\nimport { DisplayStyleProps, DisplayStyleSettingsProps } from \"./DisplayStyleSettings\";\r\nimport { DefinitionElementProps, DisplayStyleLoadProps, ElementProps, RenderTimelineProps, SheetProps, ViewAttachmentProps } from \"./ElementProps\";\r\nimport { EntityQueryParams } from \"./EntityProps\";\r\nimport { ModelProps } from \"./ModelProps\";\r\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\r\nimport { ViewDetails3dProps, ViewDetailsProps } from \"./ViewDetails\";\r\nimport { ThumbnailProps } from \"./Thumbnail\";\r\nimport { RenderSchedule } from \"./RenderSchedule\";\r\n\r\n/** The id of either an element or an entry in a ViewStore.\r\n * @public\r\n */\r\nexport type ViewIdString = Id64String; // should also include ViewStoreRpc.IdString when that's @public\r\n\r\n/** As part of a [[ViewStateProps]], describes the [[SpatialViewDefinition]] from which a [SectionDrawing]($backend) was generated.\r\n * @see [[SectionDrawingProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SectionDrawingViewProps {\r\n /** The Id of the spatial view from which the SectionDrawing was generated. */\r\n spatialView: Id64String;\r\n /** If true, the spatial view should be displayed in the context of the drawing view. */\r\n displaySpatialView: boolean;\r\n /** Transform from drawing coordinates to spatial coordinates. If undefined, use identity transform. */\r\n drawingToSpatialTransform?: TransformProps;\r\n}\r\n\r\n/** The response props from the getCustomViewState3dData RPC endpoint\r\n * @internal\r\n */\r\nexport interface CustomViewState3dProps {\r\n modelIds: CompressedId64Set;\r\n modelExtents: Range3dProps;\r\n categoryIds: CompressedId64Set;\r\n}\r\n\r\n/**\r\n * The options passed to the getCustomViewState3dData RPC endpoint.\r\n * @internal\r\n */\r\nexport interface CustomViewState3dCreatorOptions {\r\n modelIds?: CompressedId64Set;\r\n}\r\n\r\n/**\r\n * A result row from querying for subcategories\r\n * @internal\r\n */\r\nexport interface SubCategoryResultRow {\r\n parentId: Id64String;\r\n id: Id64String;\r\n appearance: SubCategoryAppearance.Props;\r\n}\r\n\r\n/**\r\n * Request props for the hydrateViewState RPC endpoint.\r\n * @internal\r\n */\r\nexport interface HydrateViewStateRequestProps {\r\n acsId?: string;\r\n notLoadedModelSelectorStateModels?: CompressedId64Set;\r\n sheetViewAttachmentIds?: CompressedId64Set;\r\n viewStateLoadProps?: ViewStateLoadProps;\r\n baseModelId?: Id64String;\r\n spatialViewId?: Id64String;\r\n}\r\n\r\n/** Response props from the hydrateViewState RPC endpoint.\r\n * @internal\r\n */\r\nexport interface HydrateViewStateResponseProps {\r\n acsElementProps?: ElementProps;\r\n modelSelectorStateModels?: ModelProps[];\r\n // cast this to viewAttachmentInfo[] on the frontend.\r\n sheetViewAttachmentProps?: ViewAttachmentProps[];\r\n sheetViewViews?: (ViewStateProps | undefined)[];\r\n baseModelProps?: ModelProps;\r\n spatialViewProps?: ViewStateProps;\r\n}\r\n\r\n/** Returned from [IModelDb.Views.getViewStateProps]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewStateProps {\r\n viewDefinitionProps: ViewDefinitionProps;\r\n categorySelectorProps: CategorySelectorProps;\r\n modelSelectorProps?: ModelSelectorProps;\r\n displayStyleProps: DisplayStyleProps;\r\n /** Sheet-specific properties, if this is a view of a [SheetModel]($backend). */\r\n sheetProps?: SheetProps;\r\n /** The Ids of the [ViewAttachment]($backend)s contained within the [SheetModel]($backend), if this is a sheet view. */\r\n sheetAttachments?: Id64Array;\r\n /** For a [DrawingViewState]($frontend), the extents of the [DrawingModel]($backend), used for determining the upper limits of the view's extents. */\r\n modelExtents?: Range3dProps;\r\n /** Information about the [SectionDrawing]($backend) relevant to displaying a drawing view. */\r\n sectionDrawing?: SectionDrawingViewProps;\r\n}\r\n\r\n/** Options for loading a [[ViewStateProps]] via [IModelConnection.Views.load]($frontend) or [IModelDb.Views.getViewStateProps]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewStateLoadProps {\r\n /** Options for loading the view's [[DisplayStyleProps]]. */\r\n displayStyle?: DisplayStyleLoadProps;\r\n\r\n /**\r\n * bindings for query-based selectors\r\n * @beta\r\n */\r\n queryBindings?: {\r\n modelSelector?: ViewStoreRpc.QueryBindings;\r\n categorySelector?: ViewStoreRpc.QueryBindings;\r\n };\r\n}\r\n\r\n/** Properties that define a ModelSelector\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelSelectorProps extends DefinitionElementProps {\r\n models: Id64Array;\r\n}\r\n\r\n/** Properties that define a CategorySelector\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CategorySelectorProps extends DefinitionElementProps {\r\n categories: Id64Array;\r\n}\r\n\r\n/** Parameters for performing a query on [ViewDefinition]($backend) classes.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewQueryParams extends EntityQueryParams {\r\n wantPrivate?: boolean;\r\n}\r\n\r\n/** Parameters used to construct a ViewDefinition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinitionProps extends DefinitionElementProps {\r\n categorySelectorId: ViewIdString;\r\n displayStyleId: ViewIdString;\r\n description?: string;\r\n jsonProperties?: {\r\n /** Additional properties of the view. */\r\n viewDetails?: ViewDetailsProps;\r\n };\r\n}\r\n\r\n/** Parameters to construct a ViewDefinition3d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinition3dProps extends ViewDefinitionProps {\r\n /** if true, camera is valid. */\r\n cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n origin: XYZProps;\r\n /** The extent of the view frustum. */\r\n extents: XYZProps;\r\n /** Rotation of the view frustum (could be undefined if going Matrix3d -> YawPitchRoll). */\r\n angles?: YawPitchRollProps;\r\n /** The camera used for this view. */\r\n camera: CameraProps;\r\n jsonProperties?: {\r\n /** Additional properties of the view. */\r\n viewDetails?: ViewDetails3dProps;\r\n };\r\n}\r\n\r\n/** Parameters to construct a SpatialViewDefinition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialViewDefinitionProps extends ViewDefinition3dProps {\r\n modelSelectorId: ViewIdString;\r\n}\r\n\r\n/** Parameters used to construct a ViewDefinition2d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinition2dProps extends ViewDefinitionProps {\r\n baseModelId: Id64String;\r\n origin: XYProps;\r\n delta: XYProps;\r\n angle: AngleProps;\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystemProps extends ElementProps {\r\n type?: number;\r\n description?: string;\r\n}\r\n\r\n/** Properties of AuxCoordSystem2d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystem2dProps extends AuxCoordSystemProps {\r\n /** Origin of the AuxCoordSystem2d */\r\n origin?: XYProps;\r\n /** Rotation angle */\r\n angle?: AngleProps;\r\n}\r\n\r\n/** Properties of AuxCoordSystem3d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystem3dProps extends AuxCoordSystemProps {\r\n /** Origin of the AuxCoordSystem3d */\r\n origin?: XYZProps;\r\n /** Yaw angle */\r\n yaw?: AngleProps;\r\n /** Pitch angle */\r\n pitch?: AngleProps;\r\n /** Roll angle */\r\n roll?: AngleProps;\r\n}\r\n\r\n/**\r\n * Access to a ViewStore from the frontend.\r\n * @beta\r\n */\r\nexport namespace ViewStoreRpc {\r\n\r\n /**\r\n * Version of the Rpc interface. If any methods or interfaces of this API change, this number should\r\n * be incremented according to the rules of semantic versioning. See .\\rpc\\README-RpcInterfaceVersioning.md for more information.\r\n * @internal\r\n */\r\n export const version = \"4.0.0\";\r\n\r\n /** an Id of a View, DisplayStyle, ModelSelector, CategorySelector, or Timeline in a ViewStore.\r\n * Will be a base-36 number with a leading \"@\".\r\n * @public\r\n */\r\n export type IdString = string;\r\n\r\n /**\r\n * A string identifying a group. This may either be a \"group name path\" or the RowString of a group (e.g. either \"group1/design/issues\" or \"@4e3\")\r\n * The syntax is not ambiguous because ViewStoreIdStrings always start with \"@\" and Group names can never contain \"@\".\r\n */\r\n export type ViewGroupSpec = IdString | ViewGroupPath;\r\n\r\n /** The name for a view. */\r\n export type ViewName = string;\r\n\r\n /** The name for a Tag. */\r\n export type TagName = string;\r\n\r\n /** The name of an \"owner\". Should come from the authentication system, so it will be guaranteed unique.\r\n * This name should be chosen by the user rather than their email address.\r\n */\r\n export type OwnerName = string;\r\n\r\n /** The path name of a view group (e.g. \"group1/design/issues\"). Does not include the \"root\" group. */\r\n export type ViewGroupPath = string;\r\n\r\n /** The name for a view group. */\r\n export type ViewGroupName = string;\r\n\r\n /** The name for a view group. */\r\n export type ClassFullName = string;\r\n\r\n /** Determine if a string is an Id of an entry in a ViewStore (base-36 integer with a leading \"@\") */\r\n export const isViewStoreId = (id?: ViewIdString) => true === id?.startsWith(\"@\");\r\n\r\n /** Parameters for querying for views in a ViewStore. */\r\n export interface QueryParams {\r\n /** a list of classFullNames to accept. If not present, all classes are returned. */\r\n readonly classNames?: ClassFullName[];\r\n /** Optional \"LIMIT\" clause to limit the number of views returned. */\r\n readonly limit?: number;\r\n /** Optional \"OFFSET\" clause. Only valid if Limit is also present. */\r\n readonly offset?: number;\r\n /** A string to filter view names. May include wildcards if the `nameCompare` uses LIKE or GLOB (see SQLite documentation for LIKE and GLOB). */\r\n readonly nameSearch?: string;\r\n /** The comparison operator for `nameSearch`. Default is `=` */\r\n readonly nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /* the Id of the view group to query. If not present, the root group is used. There is no way to query for views from multiple view groups in one request. */\r\n readonly group?: IdString;\r\n /** A list of tags to filter views. If present, only views that have one or more of the tags will be returned. */\r\n readonly tags?: TagName[];\r\n /* The name of an owner for private views. If present, private views owned by the owner will also be returned. Shared views are always returned. */\r\n readonly owner?: OwnerName;\r\n }\r\n\r\n /** Parameters for specifying a Query to select Categories or Models. */\r\n export interface SelectorQuery {\r\n /**\r\n * The full ClassName from which to select. If this SelectorQuery is for Categories, this must be or derive from \"BisCore:Category\".\r\n * If this SelectorQuery is for Models, this must be or derive from \"BisCore:Model\".\r\n */\r\n from: ClassFullName;\r\n /** If true, only return instances of `from`. Otherwise, return instances of `from` and any subclasses of `from`. */\r\n only?: boolean;\r\n /**\r\n * filter for query. If present, only instances of `from` that satisfy the filter will be returned.\r\n * If not supplied, all instances of `from` are returned.\r\n * @note\r\n * This value is used into the ECQuery:`SELECT ECInstanceId FROM ${query.from} WHERE ${query.where}`.\r\n */\r\n where?: string;\r\n /** List of Model or Category ids to add to the query results.\r\n * @note This is only valid if there is a `where` clause. Otherwise all instances of `from` will be returned so there is no value in adding ids.\r\n */\r\n adds?: Id64Array | CompressedId64Set;\r\n /** List of Model or Category Ids to remove from the query results. */\r\n removes?: Id64Array | CompressedId64Set;\r\n }\r\n\r\n /** A Model or Category selector may either be a query or a list of Ids. */\r\n export type SelectorProps = { query: SelectorQuery, ids?: never } | { query?: never, ids: Id64Array | CompressedId64Set };\r\n\r\n /** Information about a View in a ViewStore. */\r\n export interface ViewInfo {\r\n /** The Id of the view. */\r\n id: IdString;\r\n /** The name of the view. */\r\n name?: ViewName;\r\n /** The name of the owner of the view. */\r\n owner?: OwnerName;\r\n /** The className of the view. */\r\n className: ClassFullName;\r\n /** The Id of the view group containing the view. */\r\n groupId: IdString;\r\n /** If true, the view is private (unshared) and will only be returned by queries that specify the owner's name. */\r\n isPrivate: boolean;\r\n /** The Id of a ModelSelector, if the view has one. */\r\n modelSelectorId?: IdString;\r\n /** The Id of the CategorySelector for this view. */\r\n categorySelectorId: IdString;\r\n /** The Id of a DisplayStyle for the view. */\r\n displayStyleId: IdString;\r\n /** a list of tags for the view. */\r\n tags?: TagName[];\r\n }\r\n\r\n /** Information about a ViewGroup in a ViewStore. */\r\n export interface ViewGroupInfo {\r\n /** The Id of this view group. */\r\n id: IdString;\r\n /** The name of this view group. */\r\n name: ViewGroupName;\r\n /** The Id of the parent of this view group. If undefined, this is the root group. */\r\n parent?: IdString;\r\n /** The Id of the default view for this view group. */\r\n defaultView?: IdString;\r\n }\r\n\r\n /** Arguments for adding a new view to a ViewStore. */\r\n export interface AddViewArgs {\r\n /** the properties of the ViewDefinition for the new view. */\r\n readonly viewDefinition: ViewDefinitionProps;\r\n\r\n /**\r\n * The properties of a category selector for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.categorySelectorId` **not** a valid\r\n * `IdString`. In that case, a new category selector will be created with these properties and its Id will be used.\r\n * Otherwise, the categorySelectorId from the ViewDefinition is used. If it does not represent a valid category\r\n * selector, an error is thrown.\r\n */\r\n readonly categorySelectorProps?: CategorySelectorProps;\r\n\r\n /** The properties of a model selector for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.modelSelectorId` **not** a valid\r\n * `IdString`. In that case, a new model selector will be created with these properties and its Id will be used.\r\n * Otherwise, the modelSelectorId from the ViewDefinition is used. If it does not represent a valid model selector,\r\n * an error is thrown.\r\n */\r\n readonly modelSelectorProps?: ModelSelectorProps;\r\n\r\n /** The properties of a display style for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.displayStyleId` **not** a valid\r\n * `IdString`. In that case, a new display style will be created with these properties and its Id will be used.\r\n * Otherwise, the displayStyleId from the ViewDefinition is used. If it does not represent a valid display style, an\r\n * error is thrown.\r\n */\r\n readonly displayStyleProps?: DisplayStyleProps;\r\n\r\n /* the owner of the view. Must be present if isPrivate is true. */\r\n readonly owner?: OwnerName;\r\n\r\n /* the Id of the view group for the view. If not present, the view is added to the root group. */\r\n readonly group?: IdString;\r\n\r\n /* if true, the view is private (unshared). */\r\n readonly isPrivate?: boolean;\r\n\r\n /* an optional list of tags for the view. */\r\n readonly tags?: TagName[];\r\n\r\n /** optional thumbnail for the view. */\r\n readonly thumbnail?: ThumbnailProps;\r\n }\r\n\r\n /** Argument for finding a category selector, model selector, display style, or timeline by name or Id. */\r\n export type NameOrId = { name: string, id?: never } | { id: IdString, name?: never };\r\n\r\n /** Bindings for parameterized values in where clause of SelectorQuery\r\n * @see[[ECSqlStatement.bindValues]]\r\n */\r\n export interface QueryBindings {\r\n bindings?: any[] | object;\r\n }\r\n\r\n /**\r\n * Methods for reading from a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreReader`. These\r\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\r\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\r\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\r\n * user only needs read permission to the ViewStore.\r\n */\r\n export interface Reader {\r\n /** Find all views owned by the supplied owner name. */\r\n findViewsByOwner(args: { owner: OwnerName }): Promise<ViewInfo[]>;\r\n\r\n /** Get a category selector by Id. Throws if it does not exist. */\r\n getCategorySelector(args: NameOrId & QueryBindings): Promise<CategorySelectorProps>;\r\n\r\n /** Get a display style by Id. Throws if it does not exist. */\r\n getDisplayStyle(args: NameOrId & { opts?: DisplayStyleLoadProps }): Promise<DisplayStyleProps>;\r\n\r\n /** Get a model selector by Id. Throws if it does not exist. */\r\n getModelSelector(args: NameOrId & QueryBindings): Promise<ModelSelectorProps>;\r\n\r\n /** Get a thumbnail for a view. */\r\n getThumbnail(args: { viewId: IdString }): Promise<ThumbnailProps | undefined>;\r\n\r\n /** Get a render timeline by Id. Throws if it does not exist. */\r\n getTimeline(args: NameOrId): Promise<RenderTimelineProps>;\r\n\r\n /** Get a view by name. The name can include the *view group path*, if no `groupId` is supplied. */\r\n getViewByName(arg: { name: ViewName, groupId?: IdString }): Promise<ViewInfo | undefined>;\r\n\r\n /** Get a view definition by viewId. Throws if it does not exist. */\r\n getViewDefinition(args: { viewId: IdString }): Promise<ViewDefinitionProps>;\r\n\r\n /** get the properties of a ViewGroup by id. This will include the defaultViewId, if one exists. */\r\n getViewGroupInfo(args: { groupId?: IdString }): Promise<ViewGroupInfo | undefined>;\r\n\r\n /** Get a list of ViewGroups that are children of the supplied parent. If no parent is supplied, the root group is used.\r\n * Each entry in the list includes the id and name of the ViewGroup.\r\n */\r\n getViewGroups(args: { parent?: ViewGroupSpec }): Promise<{ id: IdString, name: string }[]>;\r\n\r\n /** Get the ViewInfo for a view by Id. Returns undefined if the view does not exist. */\r\n getViewInfo(args: { viewId: IdString }): Promise<ViewInfo | undefined>;\r\n\r\n /** Query for a list of ViewInfos for views that match the supplied [[QueryParams]].\r\n * @note The array will be sorted by name, ascending. To limit the size of the array, supply `limit` and `offset` in the QueryParams.\r\n */\r\n queryViews(queryParams: QueryParams): Promise<ViewInfo[]>;\r\n }\r\n\r\n /**\r\n * Methods for writing to a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreWriter`. These\r\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\r\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\r\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\r\n * user must have write permission to the ViewStore.\r\n */\r\n export interface Writer {\r\n /**\r\n * Add a category selector to a ViewStore.\r\n * @returns The IdString of the new category selector.\r\n */\r\n addCategorySelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Add a display style to a ViewStore.\r\n * @returns The IdString of the new display style.\r\n */\r\n addDisplayStyle(args: { name?: string, className: string, settings: DisplayStyleSettingsProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /**\r\n * Add a model selector to a ViewStore.\r\n * @returns The IdString of the new model selector.\r\n */\r\n addModelSelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /**\r\n * Add a thumbnail for a view. If the view already has a thumbnail, it is replaced.\r\n * If a view is deleted, its thumbnail is also deleted.\r\n * @note The thumbnail must be a valid image in PNG or JPEG format.\r\n */\r\n addOrReplaceThumbnail(args: { viewId: IdString, thumbnail: ThumbnailProps }): Promise<void>;\r\n\r\n /** Add tags to a view. If the view already has tags, the new tags are appended to the existing tags. */\r\n addTagsToView(args: { viewId: IdString, tags: TagName[] }): Promise<void>;\r\n\r\n /** Add a render timeline to a ViewStore.\r\n * @returns The IdString of the new timeline.\r\n */\r\n addTimeline(args: { name?: string, timeline: RenderSchedule.ScriptProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Add a view to a ViewStore. If no group is supplied, the new view is added to the root view group.\r\n * @returns The IdString of the new view\r\n */\r\n addView(args: AddViewArgs): Promise<IdString>;\r\n\r\n /** Add a view group to a ViewStore. If no parent is supplied, the new group is added to the root view group.\r\n * @returns the IdString of new view group\r\n */\r\n addViewGroup(args: { name: string, parentId?: IdString, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Change the default view for a view group. If no group is supplied, this changes the default view for the root view group. */\r\n changeDefaultViewId(args: { defaultView: IdString, group?: ViewGroupSpec }): Promise<void>;\r\n\r\n /** Delete the thumbnail for a view. */\r\n deleteThumbnail(args: { viewId: IdString }): Promise<void>;\r\n\r\n /**\r\n * Delete a view from a ViewStore. If this is the default view for a view group, it cannot be deleted until another\r\n * view is set as the default.\r\n * @note If this view references a category selector, model selector, or display style that is not referenced by any\r\n * other view, *and do not have a name*, they will each also be deleted. If the view has a thumbnail, it is also\r\n * deleted.\r\n */\r\n deleteView(args: { viewId: IdString }): Promise<void>;\r\n\r\n /** Delete a view group from a ViewStore. This will also delete all views in the group. */\r\n deleteViewGroup(args: { name: ViewGroupSpec }): Promise<void>;\r\n\r\n /** Delete a display style from a ViewStore. If the display style is referenced by any view, it cannot be deleted\r\n * and an exception will be thrown.\r\n */\r\n deleteDisplayStyle(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a model selector from a ViewStore. If the model selector is referenced by any view, it cannot be deleted\r\n * and an exception will be thrown. */\r\n deleteModelSelector(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a category selector from a ViewStore. If the category selector is referenced by any view, it cannot be\r\n * deleted and an exception will be thrown.\r\n */\r\n deleteCategorySelector(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a render timeline from a ViewStore. */\r\n deleteTimeline(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a tag. This removes it from all views where it was used. */\r\n deleteTag(args: { name: TagName }): Promise<void>;\r\n\r\n /** remove a tag from a view. */\r\n removeTagFromView(args: { viewId: IdString, tag: TagName }): Promise<void>;\r\n\r\n /** Update the properties of a category selector. */\r\n updateCategorySelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\r\n\r\n /** Update the properties of a display style. */\r\n updateDisplayStyle(args: NameOrId & { className: string, settings: DisplayStyleSettingsProps }): Promise<void>;\r\n\r\n /** Update the properties of a model selector. */\r\n updateModelSelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\r\n\r\n /** Update the properties of a render timeline. */\r\n updateTimeline(args: NameOrId & { timeline: RenderSchedule.ScriptProps }): Promise<void>;\r\n\r\n /** Update the properties of a view definition. */\r\n updateViewDefinition(args: { viewId: IdString, viewDefinition: ViewDefinitionProps }): Promise<void>;\r\n\r\n /** Change a view from shared to private, or vice versa. If changing to private, the owner must be supplied. */\r\n updateViewShared(arg: { viewId: IdString, isShared: boolean, owner?: string }): Promise<void>;\r\n\r\n /** Set the name of a category selector. */\r\n renameCategorySelector(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a display style. */\r\n renameDisplayStyle(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a model selector. */\r\n renameModelSelector(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a render timeline. */\r\n renameTimeline(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a view. */\r\n renameView(args: { viewId: IdString, name: string }): Promise<void>;\r\n\r\n /** Set the name of a view group. */\r\n renameViewGroup(args: { groupId: IdString, name: string }): Promise<void>;\r\n\r\n /** rename an existing tag. */\r\n renameTag(args: { oldName: TagName, newName: TagName }): Promise<void>;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhiteOnWhiteReversalSettings.js","sourceRoot":"","sources":["../../src/WhiteOnWhiteReversalSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IACvC;;;OAGG;IACa,qBAAqB,CAAU;IAE/C,YAAoB,gBAAyB;QAC3C,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;IAChD,CAAC;IAEO,MAAM,CAAC,SAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEjE,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,OAAO,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACtE,CAAC;IAED,mHAAmH;IAC5G,MAAM;QACX,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;IAED,uDAAuD;IAChD,MAAM,CAAC,KAAmC;QAC/C,OAAO,IAAI,KAAK,KAAK,CAAC;IACxB,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 DisplayStyles\n */\n\n/** JSON representation of a [[WhiteOnWhiteReversalSettings]].\n * @public\n * @extensions\n */\nexport interface WhiteOnWhiteReversalProps {\n /** Default: false.\n * @see [[WhiteOnWhiteReversalSettings.ignoreBackgroundColor]].\n */\n ignoreBackgroundColor?: boolean;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more\n * visible in the view.\n * By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.\n * These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.\n * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.\n * @public\n */\nexport class WhiteOnWhiteReversalSettings {\n /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only\n * if the background color is pure white.\n * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.\n */\n public readonly ignoreBackgroundColor: boolean;\n\n private constructor(ignoreBackground: boolean) {\n this.ignoreBackgroundColor = ignoreBackground;\n }\n\n private static _noIgnore = new WhiteOnWhiteReversalSettings(true);\n private static _ignore = new WhiteOnWhiteReversalSettings(false);\n\n /** Create from JSON representation. */\n public static fromJSON(props?: WhiteOnWhiteReversalProps): WhiteOnWhiteReversalSettings {\n return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;\n }\n\n /** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */\n public toJSON(): WhiteOnWhiteReversalProps | undefined {\n return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: WhiteOnWhiteReversalSettings): boolean {\n return this === other;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"WhiteOnWhiteReversalSettings.js","sourceRoot":"","sources":["../../src/WhiteOnWhiteReversalSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAaH;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IACvC;;;OAGG;IACa,qBAAqB,CAAU;IAE/C,YAAoB,gBAAyB;QAC3C,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;IAChD,CAAC;IAEO,MAAM,CAAC,SAAS,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEjE,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,OAAO,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACtE,CAAC;IAED,mHAAmH;IAC5G,MAAM;QACX,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;IAED,uDAAuD;IAChD,MAAM,CAAC,KAAmC;QAC/C,OAAO,IAAI,KAAK,KAAK,CAAC;IACxB,CAAC","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\n/** JSON representation of a [[WhiteOnWhiteReversalSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface WhiteOnWhiteReversalProps {\r\n /** Default: false.\r\n * @see [[WhiteOnWhiteReversalSettings.ignoreBackgroundColor]].\r\n */\r\n ignoreBackgroundColor?: boolean;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more\r\n * visible in the view.\r\n * By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.\r\n * These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.\r\n * @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.\r\n * @public\r\n */\r\nexport class WhiteOnWhiteReversalSettings {\r\n /** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only\r\n * if the background color is pure white.\r\n * @see [[DisplayStyleSettings.backgroundColor]] to change the background color.\r\n */\r\n public readonly ignoreBackgroundColor: boolean;\r\n\r\n private constructor(ignoreBackground: boolean) {\r\n this.ignoreBackgroundColor = ignoreBackground;\r\n }\r\n\r\n private static _noIgnore = new WhiteOnWhiteReversalSettings(true);\r\n private static _ignore = new WhiteOnWhiteReversalSettings(false);\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props?: WhiteOnWhiteReversalProps): WhiteOnWhiteReversalSettings {\r\n return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;\r\n }\r\n\r\n /** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */\r\n public toJSON(): WhiteOnWhiteReversalProps | undefined {\r\n return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: WhiteOnWhiteReversalSettings): boolean {\r\n return this === other;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAnnotation.js","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAW,SAAS,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AA4HxD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACI,WAAW,CAAqB;IACvC,8BAA8B;IACvB,SAAS,CAAY;IAC5B,iEAAiE;IAC1D,MAAM,CAAuB;IACpC,8IAA8I;IACvI,MAAM,CAAU;IACvB,0CAA0C;IACnC,OAAO,CAA0B;IAExC,YAAoB,MAAe,EAAE,MAA0B,EAAE,SAAoB,EAAE,MAA4B,EAAE,OAAgC;QACnJ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,oCAAoC;IAC7B,MAAM,CAAC,MAAM,CAAC,IAA+B;QAClD,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,IAAI,EAAE,WAAW,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AAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;gBAAE,OAAO,KAAK,CAAC;YAExF,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,IAAI,EAAE,CAAC;YAC3C,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,IAAI,EAAE,CAAC;YAC3C,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;gBAAE,OAAO,KAAK,CAAC;YACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;gBACxC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAAE,OAAO,KAAK,CAAC;YAC1D,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAqB;QACjC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;YACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ;YAC9C,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC;YAClD,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;YACxC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;YACvC,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3D,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 Annotation\n */\n\nimport { Point3d, Range2d, Transform, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\nimport { TextStyleSettingsProps } from \"./TextStyle\";\n\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\n * [[TextAnnotation.computeTransform]] will align the anchor point with (0, 0).\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\n * @beta\n */\nexport interface TextAnnotationAnchor {\n /**\n * The vertical alignment of the anchor point.\n * \"top\" aligns the anchor point with the top of the text's bounding box.\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\n */\n vertical: \"top\" | \"middle\" | \"bottom\";\n\n /**\n * The horizontal alignment of the anchor point.\n * \"left\" aligns the anchor point with left side of the text's bounding box.\n * \"center\" aligns the anchor point with center of the text with's bounding box.\n * \"right\" aligns the anchor point with right side of the text's bounding box.\n */\n horizontal: \"left\" | \"center\" | \"right\";\n}\n\n/**\n * Describes how to attach a [[TextAnnotationLeader]] to the frame around a [[TextBlock]].\n * Leader can be attached using one of the three modes:\n * - KeyPoint: attach to a point on the frame specified by the given curveIndex and fractional position.\n * - TextPoint: attach to a point that is projected on to the frame from the point on a particular line of text specified by [[LeaderTextPointOptions]].\n * - Nearest: attach to the point on frame that is nearest to [[TextAnnotationLeader.startPoint]].\n * @beta\n */\nexport type LeaderAttachment =\n | { mode: \"KeyPoint\"; curveIndex: number; fraction: number }\n | { mode: \"TextPoint\"; position: LeaderTextPointOptions }\n | { mode: \"Nearest\" };\n\n/**\n * Specifies the possible positions to attach a leader on the frame around a [[TextBlock]]\n * when [[TextAnnotationLeader.attachment.mode]] is set to TextPoint.\n * TopLeft : attach to a point projected onto the frame from the point on the left side of the first line of text.\n * TopRight : attach to a point projected onto the frame from the point on the right side of the first line of text.\n * BottomLeft : attach to a point projected onto the frame from the point on the left side of the last line of text.\n * BottomRight : attach to a point projected onto the frame from the point on the right side of the last line of text.\n * @beta\n */\nexport type LeaderTextPointOptions = \"TopLeft\" | \"TopRight\" | \"BottomLeft\" | \"BottomRight\"\n\n/**\n * A line that connects a [[TextAnnotation]] to a point in space relative to another element in the iModel.\n * A leader is always attached to the frame around the annotation's [[TextBlock]].\n * If the frame is not visible, the leader attaches to an invisible rectangular frame around the text block.\n * @see [[TextAnnotation.leaders]] for the leaders associated with an annotation.\n * @see [[TextStyleSettings.leader]] and [[styleOverrides]] to customize the appearance of leaders.\n * @beta\n*/\nexport interface TextAnnotationLeader {\n /** The point where the leader starts.\n * This is the point on another element where the leader points to */\n startPoint: Point3d;\n /** Describes how to attach the leader to the frame around [[textBlock]].*/\n attachment: LeaderAttachment;\n /** Optional intermediate points that the leader should pass through.\n * If not specified, the leader will be a straight line from startPoint to the point on the frame.\n * For now, intermediate points are a set of points which create additional LineSegments in the leader, but there could be intermediate shapes instead of straight LineSegments in future*/\n intermediatePoints?: Point3d[];\n /** Optional style overrides for the leader. If not specified, the leader will use the style defined by [[TextBlock.styleName]] as it is.\n * If specified, these overrides will be applied to the style.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n/**\n * JSON representation of a [[TextAnnotationLeader]].\n * @beta\n */\nexport interface TextAnnotationLeaderProps {\n /** See [[TextAnnotationLeader.startPoint]]. */\n startPoint: XYZProps;\n /** See [[TextAnnotationLeader.attachment]]. */\n attachment: LeaderAttachment;\n /** See [[TextAnnotationLeader.intermediatePoints]]. Default: no intermediate points. */\n intermediatePoints?: XYZProps[];\n /** See [[TextAnnotationLeader.styleOverrides]]. Default: no style overrides. */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/**\n * JSON representation of a [[TextAnnotation]].\n * @beta\n */\nexport interface TextAnnotationProps {\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\n offset?: XYZProps;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollProps;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlockProps;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\n leaders?: TextAnnotationLeaderProps[];\n}\n\n/** Arguments supplied to [[TextAnnotation.create]].\n * @beta\n */\nexport interface TextAnnotationCreateArgs {\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\n offset?: Point3d;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollAngles;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlock;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\n leaders?: TextAnnotationLeader[];\n}\n\n/**\n * Represents a formatted block of text positioned in 2d or 3d space.\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\n * - First, a bounding box is computed enclosing the contents of the [[textBlock].\n * - Then, an \"anchor point\" is computed based on the bounding box and the [[anchor]] property. The anchor point can be at one of the four corners of the box, in the middle of one of its four\n * edges, or in the center of the box.\n * - The [[orientation]] is applied to rotate the box around the anchor point.\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\n * @see [appendTextAnnotationGeometry]($backend) to construct the geometry and append it to an [[ElementGeometry.Builder]].\n * @beta\n */\nexport class TextAnnotation {\n /** The rotation of the annotation.\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\n */\n public orientation: YawPitchRollAngles;\n /** The formatted document. */\n public textBlock: TextBlock;\n /** Describes how to compute the [[textBlock]]'s anchor point. */\n public anchor: TextAnnotationAnchor;\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\n public offset: Point3d;\n /** The leaders of the text annotation. */\n public leaders?: TextAnnotationLeader[];\n\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor, leaders?: TextAnnotationLeader[]) {\n this.offset = offset;\n this.orientation = angles;\n this.textBlock = textBlock;\n this.anchor = anchor;\n this.leaders = leaders;\n }\n\n /** Creates a new TextAnnotation. */\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\n const offset = args?.offset ?? new Point3d();\n const angles = args?.orientation ?? new YawPitchRollAngles();\n const textBlock = args?.textBlock ?? TextBlock.create();\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\n const leaders = args?.leaders ?? undefined;\n return new TextAnnotation(offset, angles, textBlock, anchor, leaders);\n }\n\n /**\n * Creates a new TextAnnotation instance from its JSON representation.\n */\n public static fromJSON(props?: TextAnnotationProps): TextAnnotation {\n return TextAnnotation.create({\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\n anchor: props?.anchor ? { ...props.anchor } : undefined,\n leaders: props?.leaders ? props.leaders.map((leader) => ({\n startPoint: Point3d.fromJSON(leader.startPoint),\n attachment: leader.attachment,\n styleOverrides: leader.styleOverrides ?? undefined,\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => Point3d.fromJSON(point)) : undefined,\n })) : undefined,\n });\n }\n\n /**\n * Converts this annotation to its JSON representation.\n */\n public toJSON(): TextAnnotationProps {\n const props: TextAnnotationProps = {};\n\n // Even if the text block is empty, we want to record its style ID and overrides, e.g.,\n // so the user can pick up where they left off editing it next time.\n props.textBlock = this.textBlock.toJSON();\n\n if (!this.offset.isZero) {\n props.offset = this.offset.toJSON();\n }\n\n if (!this.orientation.isIdentity()) {\n props.orientation = this.orientation.toJSON();\n }\n\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\n props.anchor = { ...this.anchor };\n }\n\n props.leaders = this.leaders?.map((leader) => ({\n startPoint: leader.startPoint.toJSON(),\n attachment: leader.attachment,\n styleOverrides: leader.styleOverrides ?? undefined,\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => point.toJSON()) : undefined,\n })) ?? undefined;\n\n return props;\n }\n\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].\n * The anchor point will coincide with (0, 0, 0) unless an [[offset]] is present.\n * If a scale factor is specified, the transform will also scale the annotation by that factor. Usually, this should come from the [[Drawing]] containing the annotation.\n * @param boundingBox A box fully containing the [[textBlock]]. This range should include the margins.\n * @param scaleFactor A factor by which to scale the annotation. Default: 1 (no scaling).\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\n * @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`.\n */\n public computeTransform(boundingBox: Range2d, scaleFactor: number = 1): Transform {\n const anchorPt = this.computeAnchorPoint(boundingBox);\n const matrix = this.orientation.toMatrix3d();\n\n const transform = Transform.createIdentity();\n const translation = Transform.createTranslation(this.offset.minus(anchorPt));\n const scaleTransform = Transform.createScaleAboutPoint(anchorPt, scaleFactor);\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\n transform.multiplyTransformTransform(translation, transform);\n transform.multiplyTransformTransform(scaleTransform, transform);\n transform.multiplyTransformTransform(rotation, transform);\n return transform;\n }\n\n /** Compute the anchor point of this annotation as specified by [[anchor]].\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\n */\n public computeAnchorPoint(boundingBox: Range2d): Point3d {\n let x = boundingBox.low.x;\n let y = boundingBox.high.y;\n\n switch (this.anchor.horizontal) {\n case \"center\":\n x += boundingBox.xLength() / 2;\n break;\n case \"right\":\n x += boundingBox.xLength();\n break;\n }\n\n switch (this.anchor.vertical) {\n case \"middle\":\n y -= boundingBox.yLength() / 2;\n break;\n case \"bottom\":\n y -= boundingBox.yLength();\n break;\n }\n\n return new Point3d(x, y, 0);\n }\n\n /** Returns true if the leaders of this annotation are equal to the leaders of `other`. */\n private areLeadersEqual(leadersA?: TextAnnotationLeader[], leadersB?: TextAnnotationLeader[]): boolean {\n if (leadersA === leadersB) return true;\n if (!leadersA || !leadersB || leadersA.length !== leadersB.length) return false;\n\n for (let i = 0; i < leadersA.length; ++i) {\n const a = leadersA[i];\n const b = leadersB[i];\n\n if (!a.startPoint.isAlmostEqual(b.startPoint)) return false;\n if (JSON.stringify(a.attachment) !== JSON.stringify(b.attachment)) return false;\n if (JSON.stringify(a.styleOverrides) !== JSON.stringify(b.styleOverrides)) return false;\n\n const pointsA = a.intermediatePoints ?? [];\n const pointsB = b.intermediatePoints ?? [];\n if (pointsA.length !== pointsB.length) return false;\n for (let j = 0; j < pointsA.length; ++j) {\n if (!pointsA[j].isAlmostEqual(pointsB[j])) return false;\n }\n }\n return true;\n }\n\n /** Returns true if this annotation is logically equivalent to `other`. */\n public equals(other: TextAnnotation): boolean {\n if (this.anchor.horizontal !== other.anchor.horizontal ||\n this.anchor.vertical !== other.anchor.vertical ||\n !this.orientation.isAlmostEqual(other.orientation) ||\n !this.offset.isAlmostEqual(other.offset) ||\n !this.textBlock.equals(other.textBlock))\n return false;\n\n return this.areLeadersEqual(this.leaders, other.leaders);\n\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"TextAnnotation.js","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"A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C,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAAE,OAAO,KAAK,CAAC;YAC1D,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAqB;QACjC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;YACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ;YAC9C,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC;YAClD,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;YACxC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;YACvC,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3D,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 Annotation\r\n */\r\n\r\nimport { Point3d, Range2d, Transform, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\r\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\r\nimport { TextStyleSettingsProps } from \"./TextStyle\";\r\n\r\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\r\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\r\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\r\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\r\n * [[TextAnnotation.computeTransform]] will align the anchor point with (0, 0).\r\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\r\n * @beta\r\n */\r\nexport interface TextAnnotationAnchor {\r\n /**\r\n * The vertical alignment of the anchor point.\r\n * \"top\" aligns the anchor point with the top of the text's bounding box.\r\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\r\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\r\n */\r\n vertical: \"top\" | \"middle\" | \"bottom\";\r\n\r\n /**\r\n * The horizontal alignment of the anchor point.\r\n * \"left\" aligns the anchor point with left side of the text's bounding box.\r\n * \"center\" aligns the anchor point with center of the text with's bounding box.\r\n * \"right\" aligns the anchor point with right side of the text's bounding box.\r\n */\r\n horizontal: \"left\" | \"center\" | \"right\";\r\n}\r\n\r\n/**\r\n * Describes how to attach a [[TextAnnotationLeader]] to the frame around a [[TextBlock]].\r\n * Leader can be attached using one of the three modes:\r\n * - KeyPoint: attach to a point on the frame specified by the given curveIndex and fractional position.\r\n * - TextPoint: attach to a point that is projected on to the frame from the point on a particular line of text specified by [[LeaderTextPointOptions]].\r\n * - Nearest: attach to the point on frame that is nearest to [[TextAnnotationLeader.startPoint]].\r\n * @beta\r\n */\r\nexport type LeaderAttachment =\r\n | { mode: \"KeyPoint\"; curveIndex: number; fraction: number }\r\n | { mode: \"TextPoint\"; position: LeaderTextPointOptions }\r\n | { mode: \"Nearest\" };\r\n\r\n/**\r\n * Specifies the possible positions to attach a leader on the frame around a [[TextBlock]]\r\n * when [[TextAnnotationLeader.attachment.mode]] is set to TextPoint.\r\n * TopLeft : attach to a point projected onto the frame from the point on the left side of the first line of text.\r\n * TopRight : attach to a point projected onto the frame from the point on the right side of the first line of text.\r\n * BottomLeft : attach to a point projected onto the frame from the point on the left side of the last line of text.\r\n * BottomRight : attach to a point projected onto the frame from the point on the right side of the last line of text.\r\n * @beta\r\n */\r\nexport type LeaderTextPointOptions = \"TopLeft\" | \"TopRight\" | \"BottomLeft\" | \"BottomRight\"\r\n\r\n/**\r\n * A line that connects a [[TextAnnotation]] to a point in space relative to another element in the iModel.\r\n * A leader is always attached to the frame around the annotation's [[TextBlock]].\r\n * If the frame is not visible, the leader attaches to an invisible rectangular frame around the text block.\r\n * @see [[TextAnnotation.leaders]] for the leaders associated with an annotation.\r\n * @see [[TextStyleSettings.leader]] and [[styleOverrides]] to customize the appearance of leaders.\r\n * @beta\r\n*/\r\nexport interface TextAnnotationLeader {\r\n /** The point where the leader starts.\r\n * This is the point on another element where the leader points to */\r\n startPoint: Point3d;\r\n /** Describes how to attach the leader to the frame around [[textBlock]].*/\r\n attachment: LeaderAttachment;\r\n /** Optional intermediate points that the leader should pass through.\r\n * If not specified, the leader will be a straight line from startPoint to the point on the frame.\r\n * For now, intermediate points are a set of points which create additional LineSegments in the leader, but there could be intermediate shapes instead of straight LineSegments in future*/\r\n intermediatePoints?: Point3d[];\r\n /** Optional style overrides for the leader. If not specified, the leader will use the style defined by [[TextBlock.styleName]] as it is.\r\n * If specified, these overrides will be applied to the style.\r\n */\r\n styleOverrides?: TextStyleSettingsProps;\r\n}\r\n/**\r\n * JSON representation of a [[TextAnnotationLeader]].\r\n * @beta\r\n */\r\nexport interface TextAnnotationLeaderProps {\r\n /** See [[TextAnnotationLeader.startPoint]]. */\r\n startPoint: XYZProps;\r\n /** See [[TextAnnotationLeader.attachment]]. */\r\n attachment: LeaderAttachment;\r\n /** See [[TextAnnotationLeader.intermediatePoints]]. Default: no intermediate points. */\r\n intermediatePoints?: XYZProps[];\r\n /** See [[TextAnnotationLeader.styleOverrides]]. Default: no style overrides. */\r\n styleOverrides?: TextStyleSettingsProps;\r\n}\r\n\r\n/**\r\n * JSON representation of a [[TextAnnotation]].\r\n * @beta\r\n */\r\nexport interface TextAnnotationProps {\r\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\r\n offset?: XYZProps;\r\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\r\n orientation?: YawPitchRollProps;\r\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\r\n textBlock?: TextBlockProps;\r\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\r\n anchor?: TextAnnotationAnchor;\r\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\r\n leaders?: TextAnnotationLeaderProps[];\r\n}\r\n\r\n/** Arguments supplied to [[TextAnnotation.create]].\r\n * @beta\r\n */\r\nexport interface TextAnnotationCreateArgs {\r\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\r\n offset?: Point3d;\r\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\r\n orientation?: YawPitchRollAngles;\r\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\r\n textBlock?: TextBlock;\r\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\r\n anchor?: TextAnnotationAnchor;\r\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\r\n leaders?: TextAnnotationLeader[];\r\n}\r\n\r\n/**\r\n * Represents a formatted block of text positioned in 2d or 3d space.\r\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\r\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\r\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\r\n * - First, a bounding box is computed enclosing the contents of the [[textBlock].\r\n * - Then, an \"anchor point\" is computed based on the bounding box and the [[anchor]] property. The anchor point can be at one of the four corners of the box, in the middle of one of its four\r\n * edges, or in the center of the box.\r\n * - The [[orientation]] is applied to rotate the box around the anchor point.\r\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\r\n * @see [appendTextAnnotationGeometry]($backend) to construct the geometry and append it to an [[ElementGeometry.Builder]].\r\n * @beta\r\n */\r\nexport class TextAnnotation {\r\n /** The rotation of the annotation.\r\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\r\n */\r\n public orientation: YawPitchRollAngles;\r\n /** The formatted document. */\r\n public textBlock: TextBlock;\r\n /** Describes how to compute the [[textBlock]]'s anchor point. */\r\n public anchor: TextAnnotationAnchor;\r\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\r\n public offset: Point3d;\r\n /** The leaders of the text annotation. */\r\n public leaders?: TextAnnotationLeader[];\r\n\r\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor, leaders?: TextAnnotationLeader[]) {\r\n this.offset = offset;\r\n this.orientation = angles;\r\n this.textBlock = textBlock;\r\n this.anchor = anchor;\r\n this.leaders = leaders;\r\n }\r\n\r\n /** Creates a new TextAnnotation. */\r\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\r\n const offset = args?.offset ?? new Point3d();\r\n const angles = args?.orientation ?? new YawPitchRollAngles();\r\n const textBlock = args?.textBlock ?? TextBlock.create();\r\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\r\n const leaders = args?.leaders ?? undefined;\r\n return new TextAnnotation(offset, angles, textBlock, anchor, leaders);\r\n }\r\n\r\n /**\r\n * Creates a new TextAnnotation instance from its JSON representation.\r\n */\r\n public static fromJSON(props?: TextAnnotationProps): TextAnnotation {\r\n return TextAnnotation.create({\r\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\r\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\r\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\r\n anchor: props?.anchor ? { ...props.anchor } : undefined,\r\n leaders: props?.leaders ? props.leaders.map((leader) => ({\r\n startPoint: Point3d.fromJSON(leader.startPoint),\r\n attachment: leader.attachment,\r\n styleOverrides: leader.styleOverrides ?? undefined,\r\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => Point3d.fromJSON(point)) : undefined,\r\n })) : undefined,\r\n });\r\n }\r\n\r\n /**\r\n * Converts this annotation to its JSON representation.\r\n */\r\n public toJSON(): TextAnnotationProps {\r\n const props: TextAnnotationProps = {};\r\n\r\n // Even if the text block is empty, we want to record its style ID and overrides, e.g.,\r\n // so the user can pick up where they left off editing it next time.\r\n props.textBlock = this.textBlock.toJSON();\r\n\r\n if (!this.offset.isZero) {\r\n props.offset = this.offset.toJSON();\r\n }\r\n\r\n if (!this.orientation.isIdentity()) {\r\n props.orientation = this.orientation.toJSON();\r\n }\r\n\r\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\r\n props.anchor = { ...this.anchor };\r\n }\r\n\r\n props.leaders = this.leaders?.map((leader) => ({\r\n startPoint: leader.startPoint.toJSON(),\r\n attachment: leader.attachment,\r\n styleOverrides: leader.styleOverrides ?? undefined,\r\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => point.toJSON()) : undefined,\r\n })) ?? undefined;\r\n\r\n return props;\r\n }\r\n\r\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\r\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\r\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\r\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].\r\n * The anchor point will coincide with (0, 0, 0) unless an [[offset]] is present.\r\n * If a scale factor is specified, the transform will also scale the annotation by that factor. Usually, this should come from the [[Drawing]] containing the annotation.\r\n * @param boundingBox A box fully containing the [[textBlock]]. This range should include the margins.\r\n * @param scaleFactor A factor by which to scale the annotation. Default: 1 (no scaling).\r\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\r\n * @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`.\r\n */\r\n public computeTransform(boundingBox: Range2d, scaleFactor: number = 1): Transform {\r\n const anchorPt = this.computeAnchorPoint(boundingBox);\r\n const matrix = this.orientation.toMatrix3d();\r\n\r\n const transform = Transform.createIdentity();\r\n const translation = Transform.createTranslation(this.offset.minus(anchorPt));\r\n const scaleTransform = Transform.createScaleAboutPoint(anchorPt, scaleFactor);\r\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\r\n transform.multiplyTransformTransform(translation, transform);\r\n transform.multiplyTransformTransform(scaleTransform, transform);\r\n transform.multiplyTransformTransform(rotation, transform);\r\n return transform;\r\n }\r\n\r\n /** Compute the anchor point of this annotation as specified by [[anchor]].\r\n * @param boundingBox A box fully containing the [[textBlock]].\r\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\r\n */\r\n public computeAnchorPoint(boundingBox: Range2d): Point3d {\r\n let x = boundingBox.low.x;\r\n let y = boundingBox.high.y;\r\n\r\n switch (this.anchor.horizontal) {\r\n case \"center\":\r\n x += boundingBox.xLength() / 2;\r\n break;\r\n case \"right\":\r\n x += boundingBox.xLength();\r\n break;\r\n }\r\n\r\n switch (this.anchor.vertical) {\r\n case \"middle\":\r\n y -= boundingBox.yLength() / 2;\r\n break;\r\n case \"bottom\":\r\n y -= boundingBox.yLength();\r\n break;\r\n }\r\n\r\n return new Point3d(x, y, 0);\r\n }\r\n\r\n /** Returns true if the leaders of this annotation are equal to the leaders of `other`. */\r\n private areLeadersEqual(leadersA?: TextAnnotationLeader[], leadersB?: TextAnnotationLeader[]): boolean {\r\n if (leadersA === leadersB) return true;\r\n if (!leadersA || !leadersB || leadersA.length !== leadersB.length) return false;\r\n\r\n for (let i = 0; i < leadersA.length; ++i) {\r\n const a = leadersA[i];\r\n const b = leadersB[i];\r\n\r\n if (!a.startPoint.isAlmostEqual(b.startPoint)) return false;\r\n if (JSON.stringify(a.attachment) !== JSON.stringify(b.attachment)) return false;\r\n if (JSON.stringify(a.styleOverrides) !== JSON.stringify(b.styleOverrides)) return false;\r\n\r\n const pointsA = a.intermediatePoints ?? [];\r\n const pointsB = b.intermediatePoints ?? [];\r\n if (pointsA.length !== pointsB.length) return false;\r\n for (let j = 0; j < pointsA.length; ++j) {\r\n if (!pointsA[j].isAlmostEqual(pointsB[j])) return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /** Returns true if this annotation is logically equivalent to `other`. */\r\n public equals(other: TextAnnotation): boolean {\r\n if (this.anchor.horizontal !== other.anchor.horizontal ||\r\n this.anchor.vertical !== other.anchor.vertical ||\r\n !this.orientation.isAlmostEqual(other.orientation) ||\r\n !this.offset.isAlmostEqual(other.offset) ||\r\n !this.textBlock.equals(other.textBlock))\r\n return false;\r\n\r\n return this.areLeadersEqual(this.leaders, other.leaders);\r\n\r\n }\r\n}"]}
|
|
@@ -65,7 +65,7 @@ export declare abstract class TextBlockComponent {
|
|
|
65
65
|
/** @internal */
|
|
66
66
|
protected constructor(props?: TextBlockComponentProps);
|
|
67
67
|
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).
|
|
68
|
-
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.
|
|
68
|
+
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.font.name` to "Comic Sans".
|
|
69
69
|
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
70
70
|
*/
|
|
71
71
|
get styleOverrides(): TextStyleSettingsProps;
|
|
@@ -265,13 +265,13 @@ export declare class FieldRun extends TextBlockComponent {
|
|
|
265
265
|
/** Discriminator field for the [[Run]] union. */
|
|
266
266
|
readonly type = "field";
|
|
267
267
|
/** The element and BIS class containing the property described by [[propertyPath]]. */
|
|
268
|
-
|
|
268
|
+
propertyHost: FieldPropertyHost;
|
|
269
269
|
/** Describes how to obtain the property value from [[propertyHost]]. */
|
|
270
|
-
|
|
270
|
+
propertyPath: FieldPropertyPath;
|
|
271
271
|
/** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].
|
|
272
272
|
* The specific options used depend upon the [[FieldPropertyType]].
|
|
273
273
|
*/
|
|
274
|
-
|
|
274
|
+
formatOptions?: FieldFormatOptions;
|
|
275
275
|
private _cachedContent;
|
|
276
276
|
/** The field's most recently evaluated display string. */
|
|
277
277
|
get cachedContent(): string;
|
|
@@ -339,23 +339,6 @@ export declare class List extends TextBlockComponent {
|
|
|
339
339
|
stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string;
|
|
340
340
|
equals(other: TextBlockComponent): boolean;
|
|
341
341
|
}
|
|
342
|
-
/** Describes the relative alignment of the content of a [[TextBlock]].
|
|
343
|
-
* @beta
|
|
344
|
-
*/
|
|
345
|
-
export type TextBlockJustification = "left" | "center" | "right";
|
|
346
|
-
/** Describes the margins around the content inside a [[TextBlock]]. It's measured in meters.
|
|
347
|
-
* @beta
|
|
348
|
-
*/
|
|
349
|
-
export interface TextBlockMargins {
|
|
350
|
-
/** The left margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
|
|
351
|
-
left: number;
|
|
352
|
-
/** The right margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
|
|
353
|
-
right: number;
|
|
354
|
-
/** The top margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
|
|
355
|
-
top: number;
|
|
356
|
-
/** The bottom margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
|
|
357
|
-
bottom: number;
|
|
358
|
-
}
|
|
359
342
|
/** JSON representation of a [[TextBlock]].
|
|
360
343
|
* @beta
|
|
361
344
|
*/
|
|
@@ -365,10 +348,6 @@ export interface TextBlockProps extends TextBlockComponentProps {
|
|
|
365
348
|
* Default: 0
|
|
366
349
|
*/
|
|
367
350
|
width?: number;
|
|
368
|
-
/** The alignment of the document content. Default: "left". */
|
|
369
|
-
justification?: TextBlockJustification;
|
|
370
|
-
/** The margins to surround the document content. Default: 0 margins on all sides */
|
|
371
|
-
margins?: Partial<TextBlockMargins>;
|
|
372
351
|
children?: ParagraphProps[];
|
|
373
352
|
}
|
|
374
353
|
/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.
|
|
@@ -383,10 +362,6 @@ export declare class TextBlock extends TextBlockComponent {
|
|
|
383
362
|
* Default: 0
|
|
384
363
|
*/
|
|
385
364
|
width: number;
|
|
386
|
-
/** The alignment of the document's content. */
|
|
387
|
-
justification: TextBlockJustification;
|
|
388
|
-
/** The margins of the document. */
|
|
389
|
-
margins: TextBlockMargins;
|
|
390
365
|
private constructor();
|
|
391
366
|
clearStyleOverrides(options?: ClearTextStyleOptions): void;
|
|
392
367
|
toJSON(): TextBlockProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextBlock.d.ts","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAA2C,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;CACf;AAWD;;;;;GAKG;AACH,8BAAsB,kBAAkB;IACtC,OAAO,CAAC,eAAe,CAAyB;IAEhD,gBAAgB;IAChB,SAAS,aAAa,KAAK,CAAC,EAAE,uBAAuB;IAIrD;;;OAGG;IACH,IAAW,cAAc,IAAI,sBAAsB,CAElD;IAED,IAAW,cAAc,CAAC,SAAS,EAAE,sBAAsB,E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_styleOverrides;
|
|
25
25
|
/** @internal */
|
|
26
26
|
constructor(props) {
|
|
27
|
-
this._styleOverrides =
|
|
27
|
+
this._styleOverrides = structuredClone(props?.styleOverrides ?? {});
|
|
28
28
|
}
|
|
29
29
|
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).
|
|
30
|
-
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.
|
|
30
|
+
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.font.name` to "Comic Sans".
|
|
31
31
|
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
32
32
|
*/
|
|
33
33
|
get styleOverrides() {
|
|
34
34
|
return this._styleOverrides;
|
|
35
35
|
}
|
|
36
36
|
set styleOverrides(overrides) {
|
|
37
|
-
this._styleOverrides =
|
|
37
|
+
this._styleOverrides = structuredClone(overrides);
|
|
38
38
|
}
|
|
39
39
|
/** Reset any [[styleOverrides]] applied to this component. */
|
|
40
40
|
clearStyleOverrides(_options) {
|
|
@@ -55,23 +55,14 @@ export class TextBlockComponent {
|
|
|
55
55
|
/** Convert this component to its JSON representation. */
|
|
56
56
|
toJSON() {
|
|
57
57
|
return {
|
|
58
|
-
styleOverrides:
|
|
58
|
+
styleOverrides: structuredClone(this.styleOverrides),
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
/** Returns true if `this` is equivalent to `other`. */
|
|
62
62
|
equals(other) {
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
for (const name of myKeys) {
|
|
69
|
-
const key = name;
|
|
70
|
-
if (this.styleOverrides[key] !== other.styleOverrides[key]) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
63
|
+
const mySettings = TextStyleSettings.fromJSON(this.styleOverrides);
|
|
64
|
+
const otherSettings = TextStyleSettings.fromJSON(other.styleOverrides);
|
|
65
|
+
return mySettings.equals(otherSettings);
|
|
75
66
|
}
|
|
76
67
|
}
|
|
77
68
|
/** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span
|
|
@@ -439,7 +430,6 @@ export class List extends TextBlockComponent {
|
|
|
439
430
|
return (other instanceof List) && super.equals(other);
|
|
440
431
|
}
|
|
441
432
|
}
|
|
442
|
-
;
|
|
443
433
|
/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.
|
|
444
434
|
* No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
|
|
445
435
|
* @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
|
|
@@ -452,21 +442,9 @@ export class TextBlock extends TextBlockComponent {
|
|
|
452
442
|
* Default: 0
|
|
453
443
|
*/
|
|
454
444
|
width;
|
|
455
|
-
/** The alignment of the document's content. */
|
|
456
|
-
justification;
|
|
457
|
-
/** The margins of the document. */
|
|
458
|
-
margins;
|
|
459
445
|
constructor(props) {
|
|
460
446
|
super(props);
|
|
461
447
|
this.width = props.width ?? 0;
|
|
462
|
-
this.justification = props.justification ?? "left";
|
|
463
|
-
// Assign default margins if not provided
|
|
464
|
-
this.margins = {
|
|
465
|
-
left: props.margins?.left ?? 0,
|
|
466
|
-
right: props.margins?.right ?? 0,
|
|
467
|
-
top: props.margins?.top ?? 0,
|
|
468
|
-
bottom: props.margins?.bottom ?? 0,
|
|
469
|
-
};
|
|
470
448
|
this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];
|
|
471
449
|
}
|
|
472
450
|
clearStyleOverrides(options) {
|
|
@@ -476,8 +454,6 @@ export class TextBlock extends TextBlockComponent {
|
|
|
476
454
|
return {
|
|
477
455
|
...super.toJSON(),
|
|
478
456
|
width: this.width,
|
|
479
|
-
justification: this.justification,
|
|
480
|
-
margins: this.margins,
|
|
481
457
|
children: this.children.map((x) => x.toJSON()),
|
|
482
458
|
};
|
|
483
459
|
}
|
|
@@ -522,12 +498,9 @@ export class TextBlock extends TextBlockComponent {
|
|
|
522
498
|
if (!super.equals(other)) {
|
|
523
499
|
return false;
|
|
524
500
|
}
|
|
525
|
-
if (this.width !== other.width
|
|
501
|
+
if (this.width !== other.width) {
|
|
526
502
|
return false;
|
|
527
503
|
}
|
|
528
|
-
const marginsAreEqual = Object.entries(this.margins).every(([key, value]) => value === other.margins[key]);
|
|
529
|
-
if (!marginsAreEqual)
|
|
530
|
-
return false;
|
|
531
504
|
if (this.children && other.children) {
|
|
532
505
|
if (this.children.length !== other.children.length) {
|
|
533
506
|
return false;
|