@itwin/core-common 5.5.0-dev.2 → 5.5.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -1
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/CatalogIModel.js.map +1 -1
- package/lib/cjs/CesiumIonAssets.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderPolyline.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextField.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMaterialParams.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/RenderTextureParams.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/CatalogIModel.js.map +1 -1
- package/lib/esm/CesiumIonAssets.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderPolyline.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextField.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMaterialParams.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/RenderTextureParams.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryStream.js","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,IAAI,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EACL,KAAK,EAAoB,aAAa,EAAE,UAAU,IAAI,QAAQ,EAAE,aAAa,EAAiB,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAC5I,QAAQ,EAAY,kBAAkB,GACvC,MAAM,sBAAsB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,KAAK,CAAC,KAAK,CAAC,CAAC;gBACnD,IAAI,CAAC,CAAC,aAAa,YAAY,aAAa,CAAC;oBAC3C,SAAS;gBAEX,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS;oBACvC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAE7D,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;gBAC3C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB,KAAc,OAAO,mBAAmB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CACpI","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { expectDefined, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, AnyGeometryQuery, GeometryQuery, IModelJson as GeomJson, LineSegment3d, LowAndHighXYZ, Matrix3d, Point2d, Point3d, Range3d, Transform, TransformProps,\n Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\nimport { GeometricElement2dProps, GeometricElement3dProps, GeometryPartProps, isPlacement2dProps, PlacementProps } from \"../ElementProps\";\nimport { BackgroundFill, FillDisplay, GeometryClass, GeometryParams } from \"../GeometryParams\";\nimport { Gradient } from \"../Gradient\";\nimport { IModelError } from \"../IModelError\";\nimport { AreaPattern } from \"./AreaPattern\";\nimport { ImageGraphic, ImageGraphicProps } from \"./ImageGraphic\";\nimport { LineStyle } from \"./LineStyle\";\nimport { TextString, TextStringProps } from \"./TextString\";\nimport { Base64EncodedString } from \"../Base64EncodedString\";\nimport { Placement2d, Placement3d } from \"./Placement\";\nimport { TextBlockGeometryProps } from \"../annotation/TextBlockGeometryProps\";\n\n/** Establish a non-default [[SubCategory]] or to override [[SubCategoryAppearance]] for the geometry that follows.\n * A GeometryAppearanceProps always signifies a reset to the [[SubCategoryAppearance]] for subsequent [[GeometryStreamProps]] entries for undefined values.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryAppearanceProps {\n /** Optional [[SubCategory]] id for subsequent geometry. Use to create a GeometryStream with geometry that is not on the default [[SubCategory]] for the element's [[Category]] or is has geometry on multiple subCategories. */\n subCategory?: Id64String;\n /** Optional color to override [[SubCategoryAppearance.color]] for subsequent geometry. */\n color?: ColorDefProps;\n /** Optional weight to override [[SubCategoryAppearance.weight]] for subsequent geometry. */\n weight?: number;\n /** Optional style to override [[SubCategoryAppearance.styleId]] for subsequent geometry. */\n style?: Id64String;\n /** Optional transparency, 0.0 if undefined. Effective transparency is a combination of this value and [[SubCategoryAppearance.color]]. */\n transparency?: number;\n /** Optional display priority (2d only), 0 if undefined. Effective display priority is a combination of this value and [[SubCategoryAppearance.priority]]. */\n displayPriority?: number;\n /** Optional GeometryClass (for DGN compatibility, subCategories preferred), [[GeometryClass.Primary]] if undefined. */\n geometryClass?: GeometryClass;\n}\n\n/** Add a [[gradient]], [[backgroundFill]], or solid [[color]] fill to subsequent planar regions (or meshes).\n * Only one value among [[gradient]], [[backgroundFill]], and [[color]] should be set.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface AreaFillProps {\n /** Fill display type, must be set to something other than [[FillDisplay.Never]] to display fill */\n display: FillDisplay;\n /** Optional fill transparency, will be the same as outline transparency if undefined. Allows for different fill and outline transparencies */\n transparency?: number;\n /** Set fill color to view background color. Use [[BackgroundFill.Solid]] for an opaque fill and [[BackgroundFill.Outline]] to display an outline using the line color */\n backgroundFill?: BackgroundFill;\n /** Set fill color to a specific color. If the fill color the same as the line color, it is an opaque fill, otherwise it is an outline fill */\n color?: ColorDefProps;\n /** Set fill using gradient properties. */\n gradient?: Gradient.SymbProps;\n}\n\n/** Override [[SubCategoryAppearance.materialId]] for subsequent surface and solid geometry.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface MaterialProps {\n /** Material id to use, specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material. */\n materialId?: Id64String;\n /** @internal */\n origin?: XYZProps;\n /** @internal */\n size?: XYZProps;\n /** @internal */\n rotation?: YawPitchRollProps;\n}\n\n/** JSON representation of a brep GeometryStream entry.\n * @public\n */\nexport namespace BRepEntity {\n /** Enum for type of solid kernel entity this represents */\n export enum Type {\n /** Body consisting of at least one solid region */\n Solid = 0,\n /** Body consisting of connected sets of faces having edges that are shared by a maximum of two faces */\n Sheet = 1,\n /** Body consisting of connected sets of edges having vertices that are shared by a maximum of two edges */\n Wire = 2,\n }\n\n /** Optional symbology that can be assigned to individual faces of a solid or sheet body */\n export interface FaceSymbologyProps {\n /** Optional color override for face */\n color?: ColorDefProps;\n /** Optional transparency override for face */\n transparency?: number;\n /** Optional material override for face */\n materialId?: Id64String;\n }\n\n /** Geometry entry representing raw brep data.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface DataProps {\n /** data as Base64 encoded string. Must be specifically requested using [[ElementLoadProps.wantBRepData]]. */\n data?: Base64EncodedString;\n /** body type, default is Solid */\n type?: Type;\n /** body transform, default is identity */\n transform?: TransformProps;\n /** body face attachments */\n faceSymbology?: FaceSymbologyProps[];\n }\n}\n\n/** Add a reference to a [[GeometryPart]] from the GeometryStream of a [[GeometricElement]].\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryPartInstanceProps {\n /** GeometryPart id */\n part: Id64String;\n /** Optional translation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/translation, supply non-zero x and y only */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/rotation, supply a non-zero yaw angle only */\n rotation?: YawPitchRollProps;\n /** Optional scale to apply to part, 1.0 if undefined */\n scale?: number;\n}\n\n/** Flags applied to the entire contents of a [[GeometryStreamProps]].\n * @see GeometryStreamHeaderProps\n * @public\n * @extensions\n */\nexport enum GeometryStreamFlags {\n /** No flags. */\n None = 0,\n /** When the geometry is displayed, it is always oriented to face the viewer. The placement origin of the element associated with the geometry is used as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume.\n */\n ViewIndependent = 1 << 0,\n}\n\n/** An entry in a [[GeometryStreamProps]] containing [[GeometryStreamFlags]] that apply to the geometry stream as a whole.\n * If this entry exists in the [[GeometryStreamProps]] array, it will always be the *first* entry.\n * @public\n * @extensions\n */\nexport interface GeometryStreamHeaderProps {\n /** The flags applied to the geometry stream. */\n flags: GeometryStreamFlags;\n}\n\n/** Allowed GeometryStream entries - should only set one value.\n * @see [GeometryStream]($docs/learning/common/geometrystream.md)\n * @public\n * @extensions\n */\nexport interface GeometryStreamEntryProps extends GeomJson.GeometryProps {\n header?: GeometryStreamHeaderProps;\n appearance?: GeometryAppearanceProps;\n styleMod?: LineStyle.ModifierProps;\n fill?: AreaFillProps;\n pattern?: AreaPattern.ParamsProps;\n material?: MaterialProps;\n geomPart?: GeometryPartInstanceProps;\n textString?: TextStringProps;\n brep?: BRepEntity.DataProps;\n image?: ImageGraphicProps;\n subRange?: LowAndHighXYZ;\n}\n\n/** A [[GeometricElement]]'s GeometryStream is represented by an array of [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport type GeometryStreamProps = GeometryStreamEntryProps[];\n\n/** GeometryStreamBuilder is a helper class for populating the [[GeometryStreamProps]] array needed to create a [[GeometricElement]] or [[GeometryPart]].\n * @public\n */\nexport class GeometryStreamBuilder {\n /** Current inverse placement transform, used for converting world coordinate input to be placement relative */\n private _worldToLocal?: Transform;\n /** GeometryStream entries */\n public readonly geometryStream: GeometryStreamProps = [];\n\n /** Supply optional local to world transform. Used to transform world coordinate input relative to element placement.\n * For a [[GeometricElement]]'s placement to be meaningful, world coordinate geometry should never be appended to an element with an identity placement.\n * Can be called with undefined or identity transform to start appending geometry supplied in local coordinates again.\n */\n public setLocalToWorld(localToWorld?: Transform) {\n this._worldToLocal = (undefined === localToWorld || localToWorld.isIdentity ? undefined : localToWorld.inverse());\n }\n\n /** Supply local to world transform from a Point3d and optional YawPitchRollAngles.\n * @see [[Placement3d]]\n */\n public setLocalToWorld3d(origin: Point3d, angles: YawPitchRollAngles = YawPitchRollAngles.createDegrees(0.0, 0.0, 0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(origin, angles.toMatrix3d()));\n }\n\n /** Supply local to world transform from a Point2d and optional Angle.\n * @see [[Placement2d]]\n */\n public setLocalToWorld2d(origin: Point2d, angle: Angle = Angle.createDegrees(0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(Point3d.createFrom(origin), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), angle)));\n }\n\n /** Supply local to world transform from a PlacementProps2d or PlacementProps3d.\n * @see [[PlacementProps]]\n */\n public setLocalToWorldFromPlacement(props: PlacementProps) {\n const placement = isPlacement2dProps(props) ? Placement2d.fromJSON(props) : Placement3d.fromJSON(props);\n this.setLocalToWorld(placement.transform);\n }\n\n /** Store local ranges in GeometryStream for all subsequent geometry appended. Can improve performance of range testing for elements with a GeometryStream\n * containing more than one [[GeometryQuery]] differentiable by range. Not useful for a single [[GeometryQuery]] as its range and that of the [[GeometricElement]] are the same.\n * Ignored when defining a [[GeometryPart]] and not needed when only appending [[GeometryPart]] instances to a [[GeometricElement]] as these store their own range.\n */\n public appendGeometryRanges() {\n this.geometryStream.push({ subRange: Range3d.createNull() });\n }\n\n /** Change [[SubCategory]] or reset to [[SubCategoryAppearance]] for subsequent geometry.\n * An invalid sub-category id can be supplied to force a reset to the current [[SubCategoryAppearance]].\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherit the symbology of their instance for anything not explicitly overridden.\n */\n public appendSubCategoryChange(subCategoryId: Id64String): boolean {\n this.geometryStream.push({ appearance: { subCategory: subCategoryId } });\n return true;\n }\n\n /** Change [[GeometryParams]] for subsequent geometry.\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherits the symbology of their instance for anything not explicitly overridden.\n */\n public appendGeometryParamsChange(geomParams: GeometryParams): boolean {\n const appearance: GeometryAppearanceProps = {\n subCategory: geomParams.subCategoryId,\n color: geomParams.lineColor?.toJSON(),\n weight: geomParams.weight,\n style: geomParams.styleInfo?.styleId,\n transparency: geomParams.elmTransparency,\n displayPriority: geomParams.elmPriority,\n geometryClass: geomParams.geometryClass,\n };\n this.geometryStream.push({ appearance });\n\n if (undefined !== geomParams.materialId)\n this.geometryStream.push({ material: { materialId: geomParams.materialId } });\n\n if (undefined !== geomParams.fillDisplay && FillDisplay.Never !== geomParams.fillDisplay) {\n const fill: AreaFillProps = {\n display: geomParams.fillDisplay,\n transparency: geomParams.fillTransparency,\n };\n if (undefined !== geomParams.gradient && Gradient.Mode.None !== geomParams.gradient.mode)\n fill.gradient = geomParams.gradient?.toJSON();\n else if (undefined !== geomParams.backgroundFill && BackgroundFill.None !== geomParams.backgroundFill)\n fill.backgroundFill = geomParams.backgroundFill;\n else if (undefined !== geomParams.fillColor)\n fill.color = geomParams.fillColor.toJSON();\n this.geometryStream.push({ fill });\n }\n\n if (undefined !== geomParams.pattern) {\n const localPattern = this._worldToLocal ? geomParams.pattern.clone() : geomParams.pattern;\n if (undefined !== this._worldToLocal && !localPattern.applyTransform(this._worldToLocal))\n return false;\n\n this.geometryStream.push({ pattern: localPattern.toJSON() });\n }\n\n if (undefined !== geomParams.styleInfo && undefined !== geomParams.styleInfo.styleMod) {\n const localStyleMod = new LineStyle.Modifier(geomParams.styleInfo.styleMod);\n if (undefined !== this._worldToLocal && !localStyleMod.applyTransform(this._worldToLocal))\n return false;\n this.geometryStream.push({ styleMod: localStyleMod });\n }\n\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement3d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart3d(partId: Id64String, instanceOrigin?: Point3d, instanceRotation?: YawPitchRollAngles, instanceScale?: number): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ geomPart: { part: partId, origin: instanceOrigin, rotation: instanceRotation, scale: instanceScale } });\n return true;\n }\n const partTrans = Transform.createOriginAndMatrix(instanceOrigin, instanceRotation ? instanceRotation.toMatrix3d() : Matrix3d.createIdentity());\n if (undefined !== instanceScale)\n partTrans.matrix.scaleColumnsInPlace(instanceScale, instanceScale, instanceScale);\n const resultTrans = this._worldToLocal.multiplyTransformTransform(partTrans);\n const scales = new Vector3d();\n if (!resultTrans.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(resultTrans.matrix);\n if (undefined === newRotation)\n return false;\n this.geometryStream.push({ geomPart: { part: partId, origin: resultTrans.getOrigin(), rotation: newRotation, scale: scales.x } });\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement2d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart2d(partId: Id64String, instanceOrigin?: Point2d, instanceRotation?: Angle, instanceScale?: number): boolean {\n return this.appendGeometryPart3d(partId, instanceOrigin ? Point3d.createFrom(instanceOrigin) : undefined, instanceRotation ? new YawPitchRollAngles(instanceRotation) : undefined, instanceScale);\n }\n\n /** Append a [[TextString]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendTextString(textString: TextString): boolean {\n if (this._worldToLocal) {\n textString = new TextString(textString);\n if (!textString.transformInPlace(this._worldToLocal)) {\n return false;\n }\n }\n\n this.geometryStream.push({ textString: textString.toJSON() });\n return true;\n }\n\n /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.\n * @beta\n */\n public appendTextBlock(block: TextBlockGeometryProps): boolean {\n for (const entry of block.entries) {\n let result: boolean;\n if (undefined !== entry.text) {\n result = this.appendTextString(new TextString(entry.text));\n } else if (undefined !== entry.color) {\n if (entry.color === \"subcategory\") {\n result = this.appendSubCategoryChange(Id64.invalid);\n } else {\n this.geometryStream.push({ appearance: { color: entry.color } });\n result = true;\n }\n } else {\n result = this.appendGeometry(LineSegment3d.fromJSON(entry.separator));\n }\n\n if (!result) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */\n public appendImage(image: ImageGraphic): boolean {\n if (undefined !== this._worldToLocal)\n image = image.cloneTransformed(this._worldToLocal);\n\n this.geometryStream.push({ image: image.toJSON() });\n return true;\n }\n\n /** Append a [[GeometryQuery]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendGeometry(geometry: GeometryQuery): boolean {\n if (undefined === this._worldToLocal) {\n const geomData = GeomJson.Writer.toIModelJson(geometry);\n if (undefined === geomData)\n return false;\n this.geometryStream.push(geomData);\n return true;\n }\n const localGeometry = geometry.cloneTransformed(this._worldToLocal);\n if (undefined === localGeometry)\n return false;\n const localGeomData = GeomJson.Writer.toIModelJson(localGeometry);\n if (undefined === localGeomData)\n return false;\n this.geometryStream.push(localGeomData);\n return true;\n }\n\n /** Append [[BRepEntity.DataProps]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array\n * @beta\n */\n public appendBRepData(brep: BRepEntity.DataProps): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ brep });\n return true;\n }\n const entityTrans = Transform.fromJSON(brep.transform);\n const localTrans = this._worldToLocal.multiplyTransformTransform(entityTrans);\n const localBrep: BRepEntity.DataProps = {\n data: brep.data,\n type: brep.type,\n transform: localTrans.isIdentity ? undefined : localTrans.toJSON(),\n faceSymbology: brep.faceSymbology,\n };\n this.geometryStream.push({ brep: localBrep });\n return true;\n }\n\n /** @internal */\n public getHeader(): GeometryStreamHeaderProps | undefined {\n return 0 < this.geometryStream.length ? this.geometryStream[0].header : undefined;\n }\n\n /** @internal */\n public obtainHeader(): GeometryStreamHeaderProps {\n const hdr = this.getHeader();\n if (undefined !== hdr)\n return hdr;\n\n const entry = { header: { flags: GeometryStreamFlags.None } };\n this.geometryStream.unshift(entry);\n return entry.header;\n }\n\n /** Controls whether or not the geometry in the stream should be displayed as view-independent.\n * When view-independent geometry is displayed, it is always oriented to face the viewer, using the placement origin of the element as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume\n * @public\n */\n public get isViewIndependent(): boolean {\n const hdr = this.getHeader();\n return undefined !== hdr && GeometryStreamFlags.None !== (hdr.flags & GeometryStreamFlags.ViewIndependent);\n }\n public set isViewIndependent(viewIndependent: boolean) {\n if (viewIndependent === this.isViewIndependent)\n return;\n\n const hdr = this.obtainHeader();\n if (viewIndependent)\n hdr.flags |= GeometryStreamFlags.ViewIndependent;\n else\n hdr.flags &= ~GeometryStreamFlags.ViewIndependent;\n }\n}\n\n/** Represents a text string within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface TextStringPrimitive {\n type: \"textString\";\n readonly textString: TextString;\n}\n\n/** Represents an image within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface ImagePrimitive {\n type: \"image\";\n readonly image: ImageGraphic;\n}\n\n/** Represents a reference to a GeometryPart within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface PartReference {\n type: \"partReference\";\n part: {\n id: Id64String;\n readonly toLocal?: Transform;\n };\n}\n\n/** Represents a BRep within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface BRepPrimitive {\n type: \"brep\";\n /** @beta */\n readonly brep: BRepEntity.DataProps;\n}\n\n/** Represents one of a variety of GeometryQuery objects within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface GeometryPrimitive {\n type: \"geometryQuery\";\n readonly geometry: AnyGeometryQuery;\n}\n\n/** Union of all possible geometric primitive types that may appear within a GeometryStream.\n * @public\n * @extensions\n */\nexport type GeometryStreamPrimitive = TextStringPrimitive | PartReference | BRepPrimitive | GeometryPrimitive | ImagePrimitive;\n\n/** Holds current state information for [[GeometryStreamIterator]]. Each entry represents exactly one geometry primitive in the stream.\n * @public\n * @extensions\n */\nexport interface GeometryStreamIteratorEntry {\n /** A [[GeometryParams]] representing the appearance of the current geometric entry */\n readonly geomParams: GeometryParams;\n /** Placement transform, used for converting placement relative, local coordinate entries to world */\n readonly localToWorld?: Transform;\n /** Optional stored local range for the current geometric entry */\n readonly localRange?: Range3d;\n /** Returns the geometric primitive represented by this entry. */\n readonly primitive: GeometryStreamPrimitive;\n}\n\nclass IteratorEntry implements GeometryStreamIteratorEntry {\n private _primitive?: GeometryStreamPrimitive;\n public readonly geomParams: GeometryParams;\n public readonly localToWorld?: Transform;\n public localRange?: Range3d;\n\n public constructor(appearance: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geomParams = typeof appearance === \"string\" ? new GeometryParams(appearance) : appearance;\n this.localToWorld = localToWorld;\n }\n\n public get primitive() { return expectDefined(this._primitive); }\n public set primitive(primitive: GeometryStreamPrimitive) { this._primitive = primitive; }\n\n public setGeometryQuery(geometry: AnyGeometryQuery) { this._primitive = { type: \"geometryQuery\", geometry }; }\n public setTextString(textString: TextString) { this._primitive = { type: \"textString\", textString }; }\n public setBRep(brep: BRepEntity.DataProps) { this._primitive = { type: \"brep\", brep }; }\n public setImage(image: ImageGraphic) { this._primitive = { type: \"image\", image }; }\n public setPartReference(id: Id64String, toLocal?: Transform) {\n this._primitive = {\n type: \"partReference\",\n part: { id, toLocal },\n };\n }\n}\n\n/** GeometryStreamIterator is a helper class for iterating a [[GeometryStreamProps]].\n * A [[GeometricElement]]'s GeometryStream must be specifically requested using [[ElementLoadProps.wantGeometry]].\n * Each [[GeometryStreamIteratorEntry]] returned by the iterator represents exactly one geometric primitive in the stream.\n * @public\n */\nexport class GeometryStreamIterator implements IterableIterator<GeometryStreamIteratorEntry> {\n /** GeometryStream entries */\n public geometryStream: GeometryStreamProps;\n /** Flags applied to the entire geometry stream. */\n public readonly flags: GeometryStreamFlags;\n /** Current entry position */\n private _index = 0;\n /** Allocated on first call to next() and reused thereafter. */\n private _entry?: IteratorEntry;\n /** Used to initialize this._entry. */\n private readonly _appearance: Id64String | GeometryParams;\n private readonly _localToWorld?: Transform;\n\n /** Construct a new GeometryStreamIterator given a [[GeometryStreamProps]] from either a [[GeometricElement3d]], [[GeometricElement2d]], or [[GeometryPart]].\n * Supply the [[GeometricElement]]'s category to initialize the appearance information for each geometric entry.\n */\n public constructor(geometryStream: GeometryStreamProps, categoryOrGeometryParams?: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geometryStream = geometryStream;\n this._appearance = categoryOrGeometryParams ?? Id64.invalid;\n this._localToWorld = localToWorld;\n if (0 < geometryStream.length && undefined !== geometryStream[0].header) {\n this.flags = geometryStream[0].header.flags;\n ++this._index;\n } else {\n this.flags = GeometryStreamFlags.None;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get entry() {\n if (undefined === this._entry)\n this._entry = new IteratorEntry(this._appearance, this._localToWorld);\n\n return this._entry;\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement3d]].\n * If [[GeometricElement3dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement3d(element: Pick<GeometricElement3dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined)\n transform = Transform.createOriginAndMatrix(Point3d.fromJSON(element.placement.origin), YawPitchRollAngles.fromJSON(element.placement.angles).toMatrix3d());\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement2d]].\n * If [[GeometricElement2dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement2d(element: Pick<GeometricElement2dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined) {\n const origin = Point3d.createFrom(Point2d.fromJSON(element.placement.origin));\n const matrix = expectDefined(Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.fromJSON(element.placement.angle)));\n transform = Transform.createOriginAndMatrix(origin, matrix);\n }\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometryPart]].\n * To iterate a part's GeometryStream in the context of a part instance found for a [[GeometricElement]], provide the optional [[GeometryParams]] and Transform from the [[GeometricElement]]'s [[GeometryStreamIterator]].\n * Supply the [[GeometryParams]] to return appearance information as inherited from the [[GeometricElement]].\n * Supply the partToWorld transform to return the part geometry in world coordinates.\n * Supply the partToLocal transform to return the part geometry relative to the [[GeometricElement]]'s placement.\n * @throws [[IModelError]] if geomPart.geom is undefined.\n */\n public static fromGeometryPart(geomPart: Pick<GeometryPartProps, \"geom\">, geomParams?: GeometryParams, partTransform?: Transform) {\n if (geomPart.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometryPart has no geometry or geometry wasn't requested\");\n\n return new GeometryStreamIterator(geomPart.geom, geomParams?.clone(), partTransform);\n }\n\n /** Get the transform that if applied to a [[GeometryPart]]'s GeometryStream entries would return them in world coordinates. */\n public partToWorld(): Transform | undefined {\n if (undefined === this._entry)\n return this._localToWorld;\n\n const partToLocal = \"partReference\" === this._entry.primitive.type ? this._entry.primitive.part.toLocal : undefined;\n if (this._entry.localToWorld === undefined || partToLocal === undefined)\n return this._entry.localToWorld;\n\n return this._entry.localToWorld.multiplyTransformTransform(partToLocal);\n }\n\n /** Advance to next displayable geometric entry while updating the current [[GeometryParams]] from appearance related entries.\n * Geometric entries are [[TextString]], [[GeometryQuery]], [[GeometryPart]], [[ImageGraphic]], and [[BRepEntity.DataProps]].\n */\n public next(): IteratorResult<GeometryStreamIteratorEntry> {\n // NOTE: localRange remains valid until we encounter either a new subRange entry or a geometry part reference.\n while (this._index < this.geometryStream.length) {\n const entry = this.geometryStream[this._index++];\n if (entry.appearance) {\n this.entry.geomParams.resetAppearance();\n if (entry.appearance.subCategory)\n this.entry.geomParams.subCategoryId = Id64.fromJSON(entry.appearance.subCategory);\n if (undefined !== entry.appearance.color)\n this.entry.geomParams.lineColor = ColorDef.fromJSON(entry.appearance.color);\n if (undefined !== entry.appearance.weight)\n this.entry.geomParams.weight = entry.appearance.weight;\n if (undefined !== entry.appearance.style)\n this.entry.geomParams.styleInfo = new LineStyle.Info(Id64.fromJSON(entry.appearance.style));\n if (undefined !== entry.appearance.transparency)\n this.entry.geomParams.elmTransparency = entry.appearance.transparency;\n if (undefined !== entry.appearance.displayPriority)\n this.entry.geomParams.elmPriority = entry.appearance.displayPriority;\n if (undefined !== entry.appearance.geometryClass)\n this.entry.geomParams.geometryClass = entry.appearance.geometryClass;\n } else if (entry.styleMod) {\n if (this.entry.geomParams.styleInfo === undefined)\n continue;\n\n const styleMod = new LineStyle.Modifier(entry.styleMod);\n if (this.entry.localToWorld !== undefined)\n styleMod.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.styleInfo = new LineStyle.Info(this.entry.geomParams.styleInfo.styleId, styleMod);\n } else if (entry.fill) {\n if (entry.fill.display)\n this.entry.geomParams.fillDisplay = entry.fill.display;\n if (entry.fill.transparency)\n this.entry.geomParams.fillTransparency = entry.fill.transparency;\n if (entry.fill.gradient)\n this.entry.geomParams.gradient = Gradient.Symb.fromJSON(entry.fill.gradient);\n else if (entry.fill.backgroundFill)\n this.entry.geomParams.backgroundFill = entry.fill.backgroundFill;\n else if (entry.fill.color)\n this.entry.geomParams.fillColor = ColorDef.fromJSON(entry.fill.color);\n } else if (entry.pattern) {\n const params = AreaPattern.Params.fromJSON(entry.pattern);\n if (this.entry.localToWorld !== undefined)\n params.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.pattern = params;\n } else if (entry.material) {\n if (entry.material.materialId)\n this.entry.geomParams.materialId = Id64.fromJSON(entry.material.materialId);\n } else if (entry.subRange) {\n this.entry.localRange = Range3d.fromJSON(entry.subRange);\n } else if (entry.geomPart) {\n let transform;\n if (entry.geomPart.origin !== undefined || entry.geomPart.rotation !== undefined || entry.geomPart.scale !== undefined) {\n const origin = entry.geomPart.origin ? Point3d.fromJSON(entry.geomPart.origin) : Point3d.createZero();\n const rotation = entry.geomPart.rotation ? YawPitchRollAngles.fromJSON(entry.geomPart.rotation).toMatrix3d() : Matrix3d.createIdentity();\n transform = Transform.createRefs(origin, rotation);\n if (entry.geomPart.scale)\n transform.multiplyTransformTransform(Transform.createRefs(Point3d.createZero(), Matrix3d.createUniformScale(entry.geomPart.scale)), transform);\n }\n\n // Subgraphic range doesn't apply to parts. A sane geometry stream (i.e., any that has been through the native layers or GeometryStreamBuilder)\n // will have a new subgraphic range for any geometric primitive following the part.\n this.entry.localRange = undefined;\n this.entry.setPartReference(Id64.fromJSON(entry.geomPart.part), transform);\n return { value: this.entry, done: false };\n } else if (entry.textString) {\n const textString = new TextString(entry.textString);\n if (this.entry.localToWorld !== undefined)\n textString.transformInPlace(this.entry.localToWorld);\n\n this.entry.setTextString(textString);\n return { value: this.entry, done: false };\n } else if (entry.image) {\n const image = ImageGraphic.fromJSON(entry.image);\n if (undefined !== this.entry.localToWorld)\n image.transformInPlace(this.entry.localToWorld);\n\n this.entry.setImage(image);\n return { value: this.entry, done: false };\n } else if (entry.brep) {\n if (this.entry.localToWorld !== undefined) {\n const entityTrans = Transform.fromJSON(entry.brep.transform);\n entry.brep.transform = this.entry.localToWorld.multiplyTransformTransform(entityTrans).toJSON();\n }\n\n this.entry.setBRep(entry.brep);\n return { value: this.entry, done: false };\n } else {\n const geometryQuery = GeomJson.Reader.parse(entry);\n if (!(geometryQuery instanceof GeometryQuery))\n continue;\n\n if (this.entry.localToWorld !== undefined)\n geometryQuery.tryTransformInPlace(this.entry.localToWorld);\n\n this.entry.setGeometryQuery(geometryQuery);\n return { value: this.entry, done: false };\n }\n }\n\n return { value: this.entry, done: true };\n }\n\n public [Symbol.iterator](): IterableIterator<GeometryStreamIteratorEntry> {\n return this;\n }\n\n /** @internal */\n public get isViewIndependent(): boolean { return GeometryStreamFlags.None !== (this.flags & GeometryStreamFlags.ViewIndependent); }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GeometryStream.js","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,IAAI,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EACL,KAAK,EAAoB,aAAa,EAAE,UAAU,IAAI,QAAQ,EAAE,aAAa,EAAiB,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAC5I,QAAQ,EAAY,kBAAkB,GACvC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AACtD,OAAO,EAAuE,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAC1I,OAAO,EAAE,cAAc,EAAE,WAAW,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACv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,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;gBAC3C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB,KAAc,OAAO,mBAAmB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CACpI","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { expectDefined, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, AnyGeometryQuery, GeometryQuery, IModelJson as GeomJson, LineSegment3d, LowAndHighXYZ, Matrix3d, Point2d, Point3d, Range3d, Transform, TransformProps,\r\n Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\r\nimport { GeometricElement2dProps, GeometricElement3dProps, GeometryPartProps, isPlacement2dProps, PlacementProps } from \"../ElementProps\";\r\nimport { BackgroundFill, FillDisplay, GeometryClass, GeometryParams } from \"../GeometryParams\";\r\nimport { Gradient } from \"../Gradient\";\r\nimport { IModelError } from \"../IModelError\";\r\nimport { AreaPattern } from \"./AreaPattern\";\r\nimport { ImageGraphic, ImageGraphicProps } from \"./ImageGraphic\";\r\nimport { LineStyle } from \"./LineStyle\";\r\nimport { TextString, TextStringProps } from \"./TextString\";\r\nimport { Base64EncodedString } from \"../Base64EncodedString\";\r\nimport { Placement2d, Placement3d } from \"./Placement\";\r\nimport { TextBlockGeometryProps } from \"../annotation/TextBlockGeometryProps\";\r\n\r\n/** Establish a non-default [[SubCategory]] or to override [[SubCategoryAppearance]] for the geometry that follows.\r\n * A GeometryAppearanceProps always signifies a reset to the [[SubCategoryAppearance]] for subsequent [[GeometryStreamProps]] entries for undefined values.\r\n * @see [[GeometryStreamEntryProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometryAppearanceProps {\r\n /** Optional [[SubCategory]] id for subsequent geometry. Use to create a GeometryStream with geometry that is not on the default [[SubCategory]] for the element's [[Category]] or is has geometry on multiple subCategories. */\r\n subCategory?: Id64String;\r\n /** Optional color to override [[SubCategoryAppearance.color]] for subsequent geometry. */\r\n color?: ColorDefProps;\r\n /** Optional weight to override [[SubCategoryAppearance.weight]] for subsequent geometry. */\r\n weight?: number;\r\n /** Optional style to override [[SubCategoryAppearance.styleId]] for subsequent geometry. */\r\n style?: Id64String;\r\n /** Optional transparency, 0.0 if undefined. Effective transparency is a combination of this value and [[SubCategoryAppearance.color]]. */\r\n transparency?: number;\r\n /** Optional display priority (2d only), 0 if undefined. Effective display priority is a combination of this value and [[SubCategoryAppearance.priority]]. */\r\n displayPriority?: number;\r\n /** Optional GeometryClass (for DGN compatibility, subCategories preferred), [[GeometryClass.Primary]] if undefined. */\r\n geometryClass?: GeometryClass;\r\n}\r\n\r\n/** Add a [[gradient]], [[backgroundFill]], or solid [[color]] fill to subsequent planar regions (or meshes).\r\n * Only one value among [[gradient]], [[backgroundFill]], and [[color]] should be set.\r\n * @see [[GeometryStreamEntryProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AreaFillProps {\r\n /** Fill display type, must be set to something other than [[FillDisplay.Never]] to display fill */\r\n display: FillDisplay;\r\n /** Optional fill transparency, will be the same as outline transparency if undefined. Allows for different fill and outline transparencies */\r\n transparency?: number;\r\n /** Set fill color to view background color. Use [[BackgroundFill.Solid]] for an opaque fill and [[BackgroundFill.Outline]] to display an outline using the line color */\r\n backgroundFill?: BackgroundFill;\r\n /** Set fill color to a specific color. If the fill color the same as the line color, it is an opaque fill, otherwise it is an outline fill */\r\n color?: ColorDefProps;\r\n /** Set fill using gradient properties. */\r\n gradient?: Gradient.SymbProps;\r\n}\r\n\r\n/** Override [[SubCategoryAppearance.materialId]] for subsequent surface and solid geometry.\r\n * @see [[GeometryStreamEntryProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface MaterialProps {\r\n /** Material id to use, specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material. */\r\n materialId?: Id64String;\r\n /** @internal */\r\n origin?: XYZProps;\r\n /** @internal */\r\n size?: XYZProps;\r\n /** @internal */\r\n rotation?: YawPitchRollProps;\r\n}\r\n\r\n/** JSON representation of a brep GeometryStream entry.\r\n * @public\r\n */\r\nexport namespace BRepEntity {\r\n /** Enum for type of solid kernel entity this represents */\r\n export enum Type {\r\n /** Body consisting of at least one solid region */\r\n Solid = 0,\r\n /** Body consisting of connected sets of faces having edges that are shared by a maximum of two faces */\r\n Sheet = 1,\r\n /** Body consisting of connected sets of edges having vertices that are shared by a maximum of two edges */\r\n Wire = 2,\r\n }\r\n\r\n /** Optional symbology that can be assigned to individual faces of a solid or sheet body */\r\n export interface FaceSymbologyProps {\r\n /** Optional color override for face */\r\n color?: ColorDefProps;\r\n /** Optional transparency override for face */\r\n transparency?: number;\r\n /** Optional material override for face */\r\n materialId?: Id64String;\r\n }\r\n\r\n /** Geometry entry representing raw brep data.\r\n * @see [[GeometryStreamEntryProps]]\r\n */\r\n export interface DataProps {\r\n /** data as Base64 encoded string. Must be specifically requested using [[ElementLoadProps.wantBRepData]]. */\r\n data?: Base64EncodedString;\r\n /** body type, default is Solid */\r\n type?: Type;\r\n /** body transform, default is identity */\r\n transform?: TransformProps;\r\n /** body face attachments */\r\n faceSymbology?: FaceSymbologyProps[];\r\n }\r\n}\r\n\r\n/** Add a reference to a [[GeometryPart]] from the GeometryStream of a [[GeometricElement]].\r\n * @see [[GeometryStreamEntryProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometryPartInstanceProps {\r\n /** GeometryPart id */\r\n part: Id64String;\r\n /** Optional translation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/translation, supply non-zero x and y only */\r\n origin?: XYZProps;\r\n /** Optional rotation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/rotation, supply a non-zero yaw angle only */\r\n rotation?: YawPitchRollProps;\r\n /** Optional scale to apply to part, 1.0 if undefined */\r\n scale?: number;\r\n}\r\n\r\n/** Flags applied to the entire contents of a [[GeometryStreamProps]].\r\n * @see GeometryStreamHeaderProps\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GeometryStreamFlags {\r\n /** No flags. */\r\n None = 0,\r\n /** When the geometry is displayed, it is always oriented to face the viewer. The placement origin of the element associated with the geometry is used as the rotation point.\r\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume.\r\n */\r\n ViewIndependent = 1 << 0,\r\n}\r\n\r\n/** An entry in a [[GeometryStreamProps]] containing [[GeometryStreamFlags]] that apply to the geometry stream as a whole.\r\n * If this entry exists in the [[GeometryStreamProps]] array, it will always be the *first* entry.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometryStreamHeaderProps {\r\n /** The flags applied to the geometry stream. */\r\n flags: GeometryStreamFlags;\r\n}\r\n\r\n/** Allowed GeometryStream entries - should only set one value.\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometryStreamEntryProps extends GeomJson.GeometryProps {\r\n header?: GeometryStreamHeaderProps;\r\n appearance?: GeometryAppearanceProps;\r\n styleMod?: LineStyle.ModifierProps;\r\n fill?: AreaFillProps;\r\n pattern?: AreaPattern.ParamsProps;\r\n material?: MaterialProps;\r\n geomPart?: GeometryPartInstanceProps;\r\n textString?: TextStringProps;\r\n brep?: BRepEntity.DataProps;\r\n image?: ImageGraphicProps;\r\n subRange?: LowAndHighXYZ;\r\n}\r\n\r\n/** A [[GeometricElement]]'s GeometryStream is represented by an array of [[GeometryStreamEntryProps]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type GeometryStreamProps = GeometryStreamEntryProps[];\r\n\r\n/** GeometryStreamBuilder is a helper class for populating the [[GeometryStreamProps]] array needed to create a [[GeometricElement]] or [[GeometryPart]].\r\n * @public\r\n */\r\nexport class GeometryStreamBuilder {\r\n /** Current inverse placement transform, used for converting world coordinate input to be placement relative */\r\n private _worldToLocal?: Transform;\r\n /** GeometryStream entries */\r\n public readonly geometryStream: GeometryStreamProps = [];\r\n\r\n /** Supply optional local to world transform. Used to transform world coordinate input relative to element placement.\r\n * For a [[GeometricElement]]'s placement to be meaningful, world coordinate geometry should never be appended to an element with an identity placement.\r\n * Can be called with undefined or identity transform to start appending geometry supplied in local coordinates again.\r\n */\r\n public setLocalToWorld(localToWorld?: Transform) {\r\n this._worldToLocal = (undefined === localToWorld || localToWorld.isIdentity ? undefined : localToWorld.inverse());\r\n }\r\n\r\n /** Supply local to world transform from a Point3d and optional YawPitchRollAngles.\r\n * @see [[Placement3d]]\r\n */\r\n public setLocalToWorld3d(origin: Point3d, angles: YawPitchRollAngles = YawPitchRollAngles.createDegrees(0.0, 0.0, 0.0)) {\r\n this.setLocalToWorld(Transform.createOriginAndMatrix(origin, angles.toMatrix3d()));\r\n }\r\n\r\n /** Supply local to world transform from a Point2d and optional Angle.\r\n * @see [[Placement2d]]\r\n */\r\n public setLocalToWorld2d(origin: Point2d, angle: Angle = Angle.createDegrees(0.0)) {\r\n this.setLocalToWorld(Transform.createOriginAndMatrix(Point3d.createFrom(origin), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), angle)));\r\n }\r\n\r\n /** Supply local to world transform from a PlacementProps2d or PlacementProps3d.\r\n * @see [[PlacementProps]]\r\n */\r\n public setLocalToWorldFromPlacement(props: PlacementProps) {\r\n const placement = isPlacement2dProps(props) ? Placement2d.fromJSON(props) : Placement3d.fromJSON(props);\r\n this.setLocalToWorld(placement.transform);\r\n }\r\n\r\n /** Store local ranges in GeometryStream for all subsequent geometry appended. Can improve performance of range testing for elements with a GeometryStream\r\n * containing more than one [[GeometryQuery]] differentiable by range. Not useful for a single [[GeometryQuery]] as its range and that of the [[GeometricElement]] are the same.\r\n * Ignored when defining a [[GeometryPart]] and not needed when only appending [[GeometryPart]] instances to a [[GeometricElement]] as these store their own range.\r\n */\r\n public appendGeometryRanges() {\r\n this.geometryStream.push({ subRange: Range3d.createNull() });\r\n }\r\n\r\n /** Change [[SubCategory]] or reset to [[SubCategoryAppearance]] for subsequent geometry.\r\n * An invalid sub-category id can be supplied to force a reset to the current [[SubCategoryAppearance]].\r\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherit the symbology of their instance for anything not explicitly overridden.\r\n */\r\n public appendSubCategoryChange(subCategoryId: Id64String): boolean {\r\n this.geometryStream.push({ appearance: { subCategory: subCategoryId } });\r\n return true;\r\n }\r\n\r\n /** Change [[GeometryParams]] for subsequent geometry.\r\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherits the symbology of their instance for anything not explicitly overridden.\r\n */\r\n public appendGeometryParamsChange(geomParams: GeometryParams): boolean {\r\n const appearance: GeometryAppearanceProps = {\r\n subCategory: geomParams.subCategoryId,\r\n color: geomParams.lineColor?.toJSON(),\r\n weight: geomParams.weight,\r\n style: geomParams.styleInfo?.styleId,\r\n transparency: geomParams.elmTransparency,\r\n displayPriority: geomParams.elmPriority,\r\n geometryClass: geomParams.geometryClass,\r\n };\r\n this.geometryStream.push({ appearance });\r\n\r\n if (undefined !== geomParams.materialId)\r\n this.geometryStream.push({ material: { materialId: geomParams.materialId } });\r\n\r\n if (undefined !== geomParams.fillDisplay && FillDisplay.Never !== geomParams.fillDisplay) {\r\n const fill: AreaFillProps = {\r\n display: geomParams.fillDisplay,\r\n transparency: geomParams.fillTransparency,\r\n };\r\n if (undefined !== geomParams.gradient && Gradient.Mode.None !== geomParams.gradient.mode)\r\n fill.gradient = geomParams.gradient?.toJSON();\r\n else if (undefined !== geomParams.backgroundFill && BackgroundFill.None !== geomParams.backgroundFill)\r\n fill.backgroundFill = geomParams.backgroundFill;\r\n else if (undefined !== geomParams.fillColor)\r\n fill.color = geomParams.fillColor.toJSON();\r\n this.geometryStream.push({ fill });\r\n }\r\n\r\n if (undefined !== geomParams.pattern) {\r\n const localPattern = this._worldToLocal ? geomParams.pattern.clone() : geomParams.pattern;\r\n if (undefined !== this._worldToLocal && !localPattern.applyTransform(this._worldToLocal))\r\n return false;\r\n\r\n this.geometryStream.push({ pattern: localPattern.toJSON() });\r\n }\r\n\r\n if (undefined !== geomParams.styleInfo && undefined !== geomParams.styleInfo.styleMod) {\r\n const localStyleMod = new LineStyle.Modifier(geomParams.styleInfo.styleMod);\r\n if (undefined !== this._worldToLocal && !localStyleMod.applyTransform(this._worldToLocal))\r\n return false;\r\n this.geometryStream.push({ styleMod: localStyleMod });\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement3d]].\r\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\r\n */\r\n public appendGeometryPart3d(partId: Id64String, instanceOrigin?: Point3d, instanceRotation?: YawPitchRollAngles, instanceScale?: number): boolean {\r\n if (undefined === this._worldToLocal) {\r\n this.geometryStream.push({ geomPart: { part: partId, origin: instanceOrigin, rotation: instanceRotation, scale: instanceScale } });\r\n return true;\r\n }\r\n const partTrans = Transform.createOriginAndMatrix(instanceOrigin, instanceRotation ? instanceRotation.toMatrix3d() : Matrix3d.createIdentity());\r\n if (undefined !== instanceScale)\r\n partTrans.matrix.scaleColumnsInPlace(instanceScale, instanceScale, instanceScale);\r\n const resultTrans = this._worldToLocal.multiplyTransformTransform(partTrans);\r\n const scales = new Vector3d();\r\n if (!resultTrans.matrix.normalizeColumnsInPlace(scales))\r\n return false;\r\n const newRotation = YawPitchRollAngles.createFromMatrix3d(resultTrans.matrix);\r\n if (undefined === newRotation)\r\n return false;\r\n this.geometryStream.push({ geomPart: { part: partId, origin: resultTrans.getOrigin(), rotation: newRotation, scale: scales.x } });\r\n return true;\r\n }\r\n\r\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement2d]].\r\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\r\n */\r\n public appendGeometryPart2d(partId: Id64String, instanceOrigin?: Point2d, instanceRotation?: Angle, instanceScale?: number): boolean {\r\n return this.appendGeometryPart3d(partId, instanceOrigin ? Point3d.createFrom(instanceOrigin) : undefined, instanceRotation ? new YawPitchRollAngles(instanceRotation) : undefined, instanceScale);\r\n }\r\n\r\n /** Append a [[TextString]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\r\n public appendTextString(textString: TextString): boolean {\r\n if (this._worldToLocal) {\r\n textString = new TextString(textString);\r\n if (!textString.transformInPlace(this._worldToLocal)) {\r\n return false;\r\n }\r\n }\r\n\r\n this.geometryStream.push({ textString: textString.toJSON() });\r\n return true;\r\n }\r\n\r\n /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.\r\n * @beta\r\n */\r\n public appendTextBlock(block: TextBlockGeometryProps): boolean {\r\n for (const entry of block.entries) {\r\n let result: boolean;\r\n if (undefined !== entry.text) {\r\n result = this.appendTextString(new TextString(entry.text));\r\n } else if (undefined !== entry.color) {\r\n if (entry.color === \"subcategory\") {\r\n result = this.appendSubCategoryChange(Id64.invalid);\r\n } else {\r\n this.geometryStream.push({ appearance: { color: entry.color } });\r\n result = true;\r\n }\r\n } else {\r\n result = this.appendGeometry(LineSegment3d.fromJSON(entry.separator));\r\n }\r\n\r\n if (!result) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */\r\n public appendImage(image: ImageGraphic): boolean {\r\n if (undefined !== this._worldToLocal)\r\n image = image.cloneTransformed(this._worldToLocal);\r\n\r\n this.geometryStream.push({ image: image.toJSON() });\r\n return true;\r\n }\r\n\r\n /** Append a [[GeometryQuery]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\r\n public appendGeometry(geometry: GeometryQuery): boolean {\r\n if (undefined === this._worldToLocal) {\r\n const geomData = GeomJson.Writer.toIModelJson(geometry);\r\n if (undefined === geomData)\r\n return false;\r\n this.geometryStream.push(geomData);\r\n return true;\r\n }\r\n const localGeometry = geometry.cloneTransformed(this._worldToLocal);\r\n if (undefined === localGeometry)\r\n return false;\r\n const localGeomData = GeomJson.Writer.toIModelJson(localGeometry);\r\n if (undefined === localGeomData)\r\n return false;\r\n this.geometryStream.push(localGeomData);\r\n return true;\r\n }\r\n\r\n /** Append [[BRepEntity.DataProps]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array\r\n * @beta\r\n */\r\n public appendBRepData(brep: BRepEntity.DataProps): boolean {\r\n if (undefined === this._worldToLocal) {\r\n this.geometryStream.push({ brep });\r\n return true;\r\n }\r\n const entityTrans = Transform.fromJSON(brep.transform);\r\n const localTrans = this._worldToLocal.multiplyTransformTransform(entityTrans);\r\n const localBrep: BRepEntity.DataProps = {\r\n data: brep.data,\r\n type: brep.type,\r\n transform: localTrans.isIdentity ? undefined : localTrans.toJSON(),\r\n faceSymbology: brep.faceSymbology,\r\n };\r\n this.geometryStream.push({ brep: localBrep });\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public getHeader(): GeometryStreamHeaderProps | undefined {\r\n return 0 < this.geometryStream.length ? this.geometryStream[0].header : undefined;\r\n }\r\n\r\n /** @internal */\r\n public obtainHeader(): GeometryStreamHeaderProps {\r\n const hdr = this.getHeader();\r\n if (undefined !== hdr)\r\n return hdr;\r\n\r\n const entry = { header: { flags: GeometryStreamFlags.None } };\r\n this.geometryStream.unshift(entry);\r\n return entry.header;\r\n }\r\n\r\n /** Controls whether or not the geometry in the stream should be displayed as view-independent.\r\n * When view-independent geometry is displayed, it is always oriented to face the viewer, using the placement origin of the element as the rotation point.\r\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume\r\n * @public\r\n */\r\n public get isViewIndependent(): boolean {\r\n const hdr = this.getHeader();\r\n return undefined !== hdr && GeometryStreamFlags.None !== (hdr.flags & GeometryStreamFlags.ViewIndependent);\r\n }\r\n public set isViewIndependent(viewIndependent: boolean) {\r\n if (viewIndependent === this.isViewIndependent)\r\n return;\r\n\r\n const hdr = this.obtainHeader();\r\n if (viewIndependent)\r\n hdr.flags |= GeometryStreamFlags.ViewIndependent;\r\n else\r\n hdr.flags &= ~GeometryStreamFlags.ViewIndependent;\r\n }\r\n}\r\n\r\n/** Represents a text string within a GeometryStream.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface TextStringPrimitive {\r\n type: \"textString\";\r\n readonly textString: TextString;\r\n}\r\n\r\n/** Represents an image within a GeometryStream.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ImagePrimitive {\r\n type: \"image\";\r\n readonly image: ImageGraphic;\r\n}\r\n\r\n/** Represents a reference to a GeometryPart within a GeometryStream.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PartReference {\r\n type: \"partReference\";\r\n part: {\r\n id: Id64String;\r\n readonly toLocal?: Transform;\r\n };\r\n}\r\n\r\n/** Represents a BRep within a GeometryStream.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BRepPrimitive {\r\n type: \"brep\";\r\n /** @beta */\r\n readonly brep: BRepEntity.DataProps;\r\n}\r\n\r\n/** Represents one of a variety of GeometryQuery objects within a GeometryStream.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometryPrimitive {\r\n type: \"geometryQuery\";\r\n readonly geometry: AnyGeometryQuery;\r\n}\r\n\r\n/** Union of all possible geometric primitive types that may appear within a GeometryStream.\r\n * @public\r\n * @extensions\r\n */\r\nexport type GeometryStreamPrimitive = TextStringPrimitive | PartReference | BRepPrimitive | GeometryPrimitive | ImagePrimitive;\r\n\r\n/** Holds current state information for [[GeometryStreamIterator]]. Each entry represents exactly one geometry primitive in the stream.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometryStreamIteratorEntry {\r\n /** A [[GeometryParams]] representing the appearance of the current geometric entry */\r\n readonly geomParams: GeometryParams;\r\n /** Placement transform, used for converting placement relative, local coordinate entries to world */\r\n readonly localToWorld?: Transform;\r\n /** Optional stored local range for the current geometric entry */\r\n readonly localRange?: Range3d;\r\n /** Returns the geometric primitive represented by this entry. */\r\n readonly primitive: GeometryStreamPrimitive;\r\n}\r\n\r\nclass IteratorEntry implements GeometryStreamIteratorEntry {\r\n private _primitive?: GeometryStreamPrimitive;\r\n public readonly geomParams: GeometryParams;\r\n public readonly localToWorld?: Transform;\r\n public localRange?: Range3d;\r\n\r\n public constructor(appearance: Id64String | GeometryParams, localToWorld?: Transform) {\r\n this.geomParams = typeof appearance === \"string\" ? new GeometryParams(appearance) : appearance;\r\n this.localToWorld = localToWorld;\r\n }\r\n\r\n public get primitive() { return expectDefined(this._primitive); }\r\n public set primitive(primitive: GeometryStreamPrimitive) { this._primitive = primitive; }\r\n\r\n public setGeometryQuery(geometry: AnyGeometryQuery) { this._primitive = { type: \"geometryQuery\", geometry }; }\r\n public setTextString(textString: TextString) { this._primitive = { type: \"textString\", textString }; }\r\n public setBRep(brep: BRepEntity.DataProps) { this._primitive = { type: \"brep\", brep }; }\r\n public setImage(image: ImageGraphic) { this._primitive = { type: \"image\", image }; }\r\n public setPartReference(id: Id64String, toLocal?: Transform) {\r\n this._primitive = {\r\n type: \"partReference\",\r\n part: { id, toLocal },\r\n };\r\n }\r\n}\r\n\r\n/** GeometryStreamIterator is a helper class for iterating a [[GeometryStreamProps]].\r\n * A [[GeometricElement]]'s GeometryStream must be specifically requested using [[ElementLoadProps.wantGeometry]].\r\n * Each [[GeometryStreamIteratorEntry]] returned by the iterator represents exactly one geometric primitive in the stream.\r\n * @public\r\n */\r\nexport class GeometryStreamIterator implements IterableIterator<GeometryStreamIteratorEntry> {\r\n /** GeometryStream entries */\r\n public geometryStream: GeometryStreamProps;\r\n /** Flags applied to the entire geometry stream. */\r\n public readonly flags: GeometryStreamFlags;\r\n /** Current entry position */\r\n private _index = 0;\r\n /** Allocated on first call to next() and reused thereafter. */\r\n private _entry?: IteratorEntry;\r\n /** Used to initialize this._entry. */\r\n private readonly _appearance: Id64String | GeometryParams;\r\n private readonly _localToWorld?: Transform;\r\n\r\n /** Construct a new GeometryStreamIterator given a [[GeometryStreamProps]] from either a [[GeometricElement3d]], [[GeometricElement2d]], or [[GeometryPart]].\r\n * Supply the [[GeometricElement]]'s category to initialize the appearance information for each geometric entry.\r\n */\r\n public constructor(geometryStream: GeometryStreamProps, categoryOrGeometryParams?: Id64String | GeometryParams, localToWorld?: Transform) {\r\n this.geometryStream = geometryStream;\r\n this._appearance = categoryOrGeometryParams ?? Id64.invalid;\r\n this._localToWorld = localToWorld;\r\n if (0 < geometryStream.length && undefined !== geometryStream[0].header) {\r\n this.flags = geometryStream[0].header.flags;\r\n ++this._index;\r\n } else {\r\n this.flags = GeometryStreamFlags.None;\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private get entry() {\r\n if (undefined === this._entry)\r\n this._entry = new IteratorEntry(this._appearance, this._localToWorld);\r\n\r\n return this._entry;\r\n }\r\n\r\n /** Create a new GeometryStream iterator for a [[GeometricElement3d]].\r\n * If [[GeometricElement3dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\r\n * @throws [[IModelError]] if element.geom is undefined.\r\n */\r\n public static fromGeometricElement3d(element: Pick<GeometricElement3dProps, \"geom\" | \"placement\" | \"category\">) {\r\n if (element.geom === undefined)\r\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\r\n\r\n let transform;\r\n if (element.placement !== undefined)\r\n transform = Transform.createOriginAndMatrix(Point3d.fromJSON(element.placement.origin), YawPitchRollAngles.fromJSON(element.placement.angles).toMatrix3d());\r\n\r\n return new GeometryStreamIterator(element.geom, element.category, transform);\r\n }\r\n\r\n /** Create a new GeometryStream iterator for a [[GeometricElement2d]].\r\n * If [[GeometricElement2dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\r\n * @throws [[IModelError]] if element.geom is undefined.\r\n */\r\n public static fromGeometricElement2d(element: Pick<GeometricElement2dProps, \"geom\" | \"placement\" | \"category\">) {\r\n if (element.geom === undefined)\r\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\r\n\r\n let transform;\r\n if (element.placement !== undefined) {\r\n const origin = Point3d.createFrom(Point2d.fromJSON(element.placement.origin));\r\n const matrix = expectDefined(Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.fromJSON(element.placement.angle)));\r\n transform = Transform.createOriginAndMatrix(origin, matrix);\r\n }\r\n\r\n return new GeometryStreamIterator(element.geom, element.category, transform);\r\n }\r\n\r\n /** Create a new GeometryStream iterator for a [[GeometryPart]].\r\n * To iterate a part's GeometryStream in the context of a part instance found for a [[GeometricElement]], provide the optional [[GeometryParams]] and Transform from the [[GeometricElement]]'s [[GeometryStreamIterator]].\r\n * Supply the [[GeometryParams]] to return appearance information as inherited from the [[GeometricElement]].\r\n * Supply the partToWorld transform to return the part geometry in world coordinates.\r\n * Supply the partToLocal transform to return the part geometry relative to the [[GeometricElement]]'s placement.\r\n * @throws [[IModelError]] if geomPart.geom is undefined.\r\n */\r\n public static fromGeometryPart(geomPart: Pick<GeometryPartProps, \"geom\">, geomParams?: GeometryParams, partTransform?: Transform) {\r\n if (geomPart.geom === undefined)\r\n throw new IModelError(IModelStatus.NoGeometry, \"GeometryPart has no geometry or geometry wasn't requested\");\r\n\r\n return new GeometryStreamIterator(geomPart.geom, geomParams?.clone(), partTransform);\r\n }\r\n\r\n /** Get the transform that if applied to a [[GeometryPart]]'s GeometryStream entries would return them in world coordinates. */\r\n public partToWorld(): Transform | undefined {\r\n if (undefined === this._entry)\r\n return this._localToWorld;\r\n\r\n const partToLocal = \"partReference\" === this._entry.primitive.type ? this._entry.primitive.part.toLocal : undefined;\r\n if (this._entry.localToWorld === undefined || partToLocal === undefined)\r\n return this._entry.localToWorld;\r\n\r\n return this._entry.localToWorld.multiplyTransformTransform(partToLocal);\r\n }\r\n\r\n /** Advance to next displayable geometric entry while updating the current [[GeometryParams]] from appearance related entries.\r\n * Geometric entries are [[TextString]], [[GeometryQuery]], [[GeometryPart]], [[ImageGraphic]], and [[BRepEntity.DataProps]].\r\n */\r\n public next(): IteratorResult<GeometryStreamIteratorEntry> {\r\n // NOTE: localRange remains valid until we encounter either a new subRange entry or a geometry part reference.\r\n while (this._index < this.geometryStream.length) {\r\n const entry = this.geometryStream[this._index++];\r\n if (entry.appearance) {\r\n this.entry.geomParams.resetAppearance();\r\n if (entry.appearance.subCategory)\r\n this.entry.geomParams.subCategoryId = Id64.fromJSON(entry.appearance.subCategory);\r\n if (undefined !== entry.appearance.color)\r\n this.entry.geomParams.lineColor = ColorDef.fromJSON(entry.appearance.color);\r\n if (undefined !== entry.appearance.weight)\r\n this.entry.geomParams.weight = entry.appearance.weight;\r\n if (undefined !== entry.appearance.style)\r\n this.entry.geomParams.styleInfo = new LineStyle.Info(Id64.fromJSON(entry.appearance.style));\r\n if (undefined !== entry.appearance.transparency)\r\n this.entry.geomParams.elmTransparency = entry.appearance.transparency;\r\n if (undefined !== entry.appearance.displayPriority)\r\n this.entry.geomParams.elmPriority = entry.appearance.displayPriority;\r\n if (undefined !== entry.appearance.geometryClass)\r\n this.entry.geomParams.geometryClass = entry.appearance.geometryClass;\r\n } else if (entry.styleMod) {\r\n if (this.entry.geomParams.styleInfo === undefined)\r\n continue;\r\n\r\n const styleMod = new LineStyle.Modifier(entry.styleMod);\r\n if (this.entry.localToWorld !== undefined)\r\n styleMod.applyTransform(this.entry.localToWorld);\r\n\r\n this.entry.geomParams.styleInfo = new LineStyle.Info(this.entry.geomParams.styleInfo.styleId, styleMod);\r\n } else if (entry.fill) {\r\n if (entry.fill.display)\r\n this.entry.geomParams.fillDisplay = entry.fill.display;\r\n if (entry.fill.transparency)\r\n this.entry.geomParams.fillTransparency = entry.fill.transparency;\r\n if (entry.fill.gradient)\r\n this.entry.geomParams.gradient = Gradient.Symb.fromJSON(entry.fill.gradient);\r\n else if (entry.fill.backgroundFill)\r\n this.entry.geomParams.backgroundFill = entry.fill.backgroundFill;\r\n else if (entry.fill.color)\r\n this.entry.geomParams.fillColor = ColorDef.fromJSON(entry.fill.color);\r\n } else if (entry.pattern) {\r\n const params = AreaPattern.Params.fromJSON(entry.pattern);\r\n if (this.entry.localToWorld !== undefined)\r\n params.applyTransform(this.entry.localToWorld);\r\n\r\n this.entry.geomParams.pattern = params;\r\n } else if (entry.material) {\r\n if (entry.material.materialId)\r\n this.entry.geomParams.materialId = Id64.fromJSON(entry.material.materialId);\r\n } else if (entry.subRange) {\r\n this.entry.localRange = Range3d.fromJSON(entry.subRange);\r\n } else if (entry.geomPart) {\r\n let transform;\r\n if (entry.geomPart.origin !== undefined || entry.geomPart.rotation !== undefined || entry.geomPart.scale !== undefined) {\r\n const origin = entry.geomPart.origin ? Point3d.fromJSON(entry.geomPart.origin) : Point3d.createZero();\r\n const rotation = entry.geomPart.rotation ? YawPitchRollAngles.fromJSON(entry.geomPart.rotation).toMatrix3d() : Matrix3d.createIdentity();\r\n transform = Transform.createRefs(origin, rotation);\r\n if (entry.geomPart.scale)\r\n transform.multiplyTransformTransform(Transform.createRefs(Point3d.createZero(), Matrix3d.createUniformScale(entry.geomPart.scale)), transform);\r\n }\r\n\r\n // Subgraphic range doesn't apply to parts. A sane geometry stream (i.e., any that has been through the native layers or GeometryStreamBuilder)\r\n // will have a new subgraphic range for any geometric primitive following the part.\r\n this.entry.localRange = undefined;\r\n this.entry.setPartReference(Id64.fromJSON(entry.geomPart.part), transform);\r\n return { value: this.entry, done: false };\r\n } else if (entry.textString) {\r\n const textString = new TextString(entry.textString);\r\n if (this.entry.localToWorld !== undefined)\r\n textString.transformInPlace(this.entry.localToWorld);\r\n\r\n this.entry.setTextString(textString);\r\n return { value: this.entry, done: false };\r\n } else if (entry.image) {\r\n const image = ImageGraphic.fromJSON(entry.image);\r\n if (undefined !== this.entry.localToWorld)\r\n image.transformInPlace(this.entry.localToWorld);\r\n\r\n this.entry.setImage(image);\r\n return { value: this.entry, done: false };\r\n } else if (entry.brep) {\r\n if (this.entry.localToWorld !== undefined) {\r\n const entityTrans = Transform.fromJSON(entry.brep.transform);\r\n entry.brep.transform = this.entry.localToWorld.multiplyTransformTransform(entityTrans).toJSON();\r\n }\r\n\r\n this.entry.setBRep(entry.brep);\r\n return { value: this.entry, done: false };\r\n } else {\r\n const geometryQuery = GeomJson.Reader.parse(entry);\r\n if (!(geometryQuery instanceof GeometryQuery))\r\n continue;\r\n\r\n if (this.entry.localToWorld !== undefined)\r\n geometryQuery.tryTransformInPlace(this.entry.localToWorld);\r\n\r\n this.entry.setGeometryQuery(geometryQuery);\r\n return { value: this.entry, done: false };\r\n }\r\n }\r\n\r\n return { value: this.entry, done: true };\r\n }\r\n\r\n public [Symbol.iterator](): IterableIterator<GeometryStreamIteratorEntry> {\r\n return this;\r\n }\r\n\r\n /** @internal */\r\n public get isViewIndependent(): boolean { return GeometryStreamFlags.None !== (this.flags & GeometryStreamFlags.ViewIndependent); }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageGraphic.js","sourceRoot":"","sources":["../../../src/geometry/ImageGraphic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAsB7E;;;;;;;;;;GAUG;AACH,MAAM,OAAO,mBAAmB;IACd,CAAC,CAAU;IAC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C,IAAI,SAAS,KAAK,MAAM;YACtB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;;YAEvB,MAAM,CAAC,OAAO,EAAE,CAAC;QAEnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,6DAA6D;IACtD,gBAAgB,CAAC,SAAoB;QAC1C,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d, Range3d, Transform, XYZProps } from \"@itwin/core-geometry\";\n\n/** JSON representation of the 4 corners of an [[ImageGraphicProps]]. @see [[ImageGraphicCorners]].\n * @public\n * @extensions\n */\nexport type ImageGraphicCornersProps = [XYZProps, XYZProps, XYZProps, XYZProps];\n\n/** JSON representation of an [[ImageGraphic]].\n * @see [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport interface ImageGraphicProps {\n /** The 4 corners of defining the quadrilateral on which the image is displayed. */\n corners: ImageGraphicCornersProps;\n /** The Id of the persistent [[Texture]] element defining the image to be displayed on the quadrilateral. */\n textureId: Id64String;\n /** Whether or not to draw a border around the image. */\n hasBorder: boolean;\n}\n\n/** Defines the 4 corners of an [[ImageGraphic]]. The points are expected to lie in a single plane and define a (possibly-skewed) quadrilateral.\n * The points map to the corners of the image as follows:\n * `\n * 3____2\n * | |\n * |____|\n * 0 1\n * `\n * The image can be flipped and/or rotated by specifying the points in a different order.\n * @public\n */\nexport class ImageGraphicCorners {\n public readonly 0: Point3d;\n public readonly 1: Point3d;\n public readonly 2: Point3d;\n public readonly 3: Point3d;\n\n public constructor(p0: Point3d, p1: Point3d, p2: Point3d, p3: Point3d) {\n this[0] = p0;\n this[1] = p1;\n this[2] = p2;\n this[3] = p3;\n }\n\n public static fromJSON(props: ImageGraphicCornersProps): ImageGraphicCorners {\n return new ImageGraphicCorners(Point3d.fromJSON(props[0]), Point3d.fromJSON(props[1]), Point3d.fromJSON(props[2]), Point3d.fromJSON(props[3]));\n }\n\n public static from4Points(points: [Point3d, Point3d, Point3d, Point3d]): ImageGraphicCorners {\n return new ImageGraphicCorners(points[0], points[1], points[2], points[3]);\n }\n\n public clone(): ImageGraphicCorners {\n return new ImageGraphicCorners(this[0].clone(), this[1].clone(), this[2].clone(), this[3].clone());\n }\n\n public toJSON(): ImageGraphicCornersProps {\n return [this[0].toJSON(), this[1].toJSON(), this[2].toJSON(), this[3].toJSON()];\n }\n}\n\n/** A geometric primitive that displays an image mapped to the corners of a quadrilateral, with an optional border.\n * The image is always displayed regardless of [[RenderMode]] or [[ViewFlags]], and is displayed without lighting.\n * @public\n */\nexport class ImageGraphic {\n /** The 4 corners of defining the quadrilateral on which the image is displayed. */\n public readonly corners: ImageGraphicCorners;\n /** The Id of the persistent [[Texture]] element defining the image to be displayed on the quadrilateral. */\n public readonly textureId: Id64String;\n /** Whether or not to draw a border around the image. */\n public readonly hasBorder: boolean;\n\n /** Construct a new ImageGraphic.\n * @param corners Defines the 4 corners of the quadrilateral on which the image is to be displayed. The ImageGraphic takes ownership of this input.\n * @param textureId Identifies a persistent [[Texture]] element defining the image to be mapped onto the quadrilateral.\n * @param hasBorder Whether or not to display a border around the image.\n */\n public constructor(corners: ImageGraphicCorners, textureId: Id64String, hasBorder = false) {\n this.corners = corners;\n this.textureId = textureId;\n this.hasBorder = hasBorder;\n }\n\n public static fromJSON(props: ImageGraphicProps): ImageGraphic {\n const corners = ImageGraphicCorners.fromJSON(props.corners);\n return new ImageGraphic(corners, props.textureId, props.hasBorder);\n }\n\n public clone(): ImageGraphic {\n return new ImageGraphic(this.corners.clone(), this.textureId, this.hasBorder);\n }\n\n public cloneTransformed(transform: Transform): ImageGraphic {\n const clone = this.clone();\n clone.transformInPlace(transform);\n return clone;\n }\n\n public toJSON(): ImageGraphicProps {\n return {\n corners: this.corners.toJSON(),\n textureId: this.textureId,\n hasBorder: this.hasBorder,\n };\n }\n\n /** Computes and returns the range.\n * @param result If supplied, will be modified to hold the computed range and returned.\n * @returns The computed range.\n */\n public computeRange(result?: Range3d): Range3d {\n if (undefined === result)\n result = new Range3d();\n else\n result.setNull();\n\n result.extend(this.corners[0], this.corners[1], this.corners[2], this.corners[3]);\n return result;\n }\n\n /** Apply a transform to the corners of the quadrilateral. */\n public transformInPlace(transform: Transform): void {\n transform.multiplyPoint3d(this.corners[0], this.corners[0]);\n transform.multiplyPoint3d(this.corners[1], this.corners[1]);\n transform.multiplyPoint3d(this.corners[2], this.corners[2]);\n transform.multiplyPoint3d(this.corners[3], this.corners[3]);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ImageGraphic.js","sourceRoot":"","sources":["../../../src/geometry/ImageGraphic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AA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EAAE;YAC9B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,MAAgB;QAClC,IAAI,SAAS,KAAK,MAAM;YACtB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;;YAEvB,MAAM,CAAC,OAAO,EAAE,CAAC;QAEnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,6DAA6D;IACtD,gBAAgB,CAAC,SAAoB;QAC1C,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Point3d, Range3d, Transform, XYZProps } from \"@itwin/core-geometry\";\r\n\r\n/** JSON representation of the 4 corners of an [[ImageGraphicProps]]. @see [[ImageGraphicCorners]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type ImageGraphicCornersProps = [XYZProps, XYZProps, XYZProps, XYZProps];\r\n\r\n/** JSON representation of an [[ImageGraphic]].\r\n * @see [[GeometryStreamEntryProps]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ImageGraphicProps {\r\n /** The 4 corners of defining the quadrilateral on which the image is displayed. */\r\n corners: ImageGraphicCornersProps;\r\n /** The Id of the persistent [[Texture]] element defining the image to be displayed on the quadrilateral. */\r\n textureId: Id64String;\r\n /** Whether or not to draw a border around the image. */\r\n hasBorder: boolean;\r\n}\r\n\r\n/** Defines the 4 corners of an [[ImageGraphic]]. The points are expected to lie in a single plane and define a (possibly-skewed) quadrilateral.\r\n * The points map to the corners of the image as follows:\r\n * `\r\n * 3____2\r\n * | |\r\n * |____|\r\n * 0 1\r\n * `\r\n * The image can be flipped and/or rotated by specifying the points in a different order.\r\n * @public\r\n */\r\nexport class ImageGraphicCorners {\r\n public readonly 0: Point3d;\r\n public readonly 1: Point3d;\r\n public readonly 2: Point3d;\r\n public readonly 3: Point3d;\r\n\r\n public constructor(p0: Point3d, p1: Point3d, p2: Point3d, p3: Point3d) {\r\n this[0] = p0;\r\n this[1] = p1;\r\n this[2] = p2;\r\n this[3] = p3;\r\n }\r\n\r\n public static fromJSON(props: ImageGraphicCornersProps): ImageGraphicCorners {\r\n return new ImageGraphicCorners(Point3d.fromJSON(props[0]), Point3d.fromJSON(props[1]), Point3d.fromJSON(props[2]), Point3d.fromJSON(props[3]));\r\n }\r\n\r\n public static from4Points(points: [Point3d, Point3d, Point3d, Point3d]): ImageGraphicCorners {\r\n return new ImageGraphicCorners(points[0], points[1], points[2], points[3]);\r\n }\r\n\r\n public clone(): ImageGraphicCorners {\r\n return new ImageGraphicCorners(this[0].clone(), this[1].clone(), this[2].clone(), this[3].clone());\r\n }\r\n\r\n public toJSON(): ImageGraphicCornersProps {\r\n return [this[0].toJSON(), this[1].toJSON(), this[2].toJSON(), this[3].toJSON()];\r\n }\r\n}\r\n\r\n/** A geometric primitive that displays an image mapped to the corners of a quadrilateral, with an optional border.\r\n * The image is always displayed regardless of [[RenderMode]] or [[ViewFlags]], and is displayed without lighting.\r\n * @public\r\n */\r\nexport class ImageGraphic {\r\n /** The 4 corners of defining the quadrilateral on which the image is displayed. */\r\n public readonly corners: ImageGraphicCorners;\r\n /** The Id of the persistent [[Texture]] element defining the image to be displayed on the quadrilateral. */\r\n public readonly textureId: Id64String;\r\n /** Whether or not to draw a border around the image. */\r\n public readonly hasBorder: boolean;\r\n\r\n /** Construct a new ImageGraphic.\r\n * @param corners Defines the 4 corners of the quadrilateral on which the image is to be displayed. The ImageGraphic takes ownership of this input.\r\n * @param textureId Identifies a persistent [[Texture]] element defining the image to be mapped onto the quadrilateral.\r\n * @param hasBorder Whether or not to display a border around the image.\r\n */\r\n public constructor(corners: ImageGraphicCorners, textureId: Id64String, hasBorder = false) {\r\n this.corners = corners;\r\n this.textureId = textureId;\r\n this.hasBorder = hasBorder;\r\n }\r\n\r\n public static fromJSON(props: ImageGraphicProps): ImageGraphic {\r\n const corners = ImageGraphicCorners.fromJSON(props.corners);\r\n return new ImageGraphic(corners, props.textureId, props.hasBorder);\r\n }\r\n\r\n public clone(): ImageGraphic {\r\n return new ImageGraphic(this.corners.clone(), this.textureId, this.hasBorder);\r\n }\r\n\r\n public cloneTransformed(transform: Transform): ImageGraphic {\r\n const clone = this.clone();\r\n clone.transformInPlace(transform);\r\n return clone;\r\n }\r\n\r\n public toJSON(): ImageGraphicProps {\r\n return {\r\n corners: this.corners.toJSON(),\r\n textureId: this.textureId,\r\n hasBorder: this.hasBorder,\r\n };\r\n }\r\n\r\n /** Computes and returns the range.\r\n * @param result If supplied, will be modified to hold the computed range and returned.\r\n * @returns The computed range.\r\n */\r\n public computeRange(result?: Range3d): Range3d {\r\n if (undefined === result)\r\n result = new Range3d();\r\n else\r\n result.setNull();\r\n\r\n result.extend(this.corners[0], this.corners[1], this.corners[2], this.corners[3]);\r\n return result;\r\n }\r\n\r\n /** Apply a transform to the corners of the quadrilateral. */\r\n public transformInPlace(transform: Transform): void {\r\n transform.multiplyPoint3d(this.corners[0], this.corners[0]);\r\n transform.multiplyPoint3d(this.corners[1], this.corners[1]);\r\n transform.multiplyPoint3d(this.corners[2], this.corners[2]);\r\n transform.multiplyPoint3d(this.corners[3], this.corners[3]);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAa,QAAQ,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAE5G,cAAc;AACd,MAAM,KAAW,SAAS,CAuLzB;AAvLD,WAAiB,SAAS;IAkCxB,2DAA2D;IAC3D,MAAa,QAAQ;QACZ,KAAK,CAAU;QACf,SAAS,CAAU;QACnB,QAAQ,CAAU;QAClB,UAAU,CAAU;QACpB,QAAQ,CAAU;QAClB,SAAS,CAAU;QACnB,UAAU,CAAU;QACpB,WAAW,CAAW;QACtB,WAAW,CAAW;QACtB,aAAa,CAAW;QACxB,MAAM,CAAY;QAClB,QAAQ,CAAsB;QAErC,yCAAyC;QACzC,YAAY,KAAoB;YAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,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F;IArHY,kBAAQ,WAqHpB,CAAA;IAED,6EAA6E;IAC7E,MAAa,IAAI;QACR,OAAO,CAAa;QACpB,QAAQ,CAAY,CAAC,uDAAuD;QAEnF,sCAAsC;QACtC,YAAY,OAAmB,EAAE,QAAmB;YAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;QAED,0CAA0C;QACnC,KAAK;YACV,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACnF,CAAC;QAEM,MAAM,CAAC,KAAW;YACvB,IAAI,IAAI,KAAK,KAAK;gBAChB,OAAO,IAAI,CAAC;YACd,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;gBAChC,OAAO,KAAK,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC;gBAClE,OAAO,KAAK,CAAC;YACf,oEAAoE;YACpE,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IA3BY,cAAI,OA2BhB,CAAA;AACH,CAAC,EAvLgB,SAAS,KAAT,SAAS,QAuLzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Symbology\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\n\n/** @public */\nexport namespace LineStyle {\n\n /** Modify the line style appearance without changing the line style definition.\n * Applies to the style previously established by a [[GeometryAppearanceProps]] or current [[SubCategoryAppearance]].\n * Most of the modifiers affect the line style stroke pattern, with the orientation and scales being the exception.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface ModifierProps {\n /** Optional scale to apply to all length values, 1.0 if undefined */\n scale?: number;\n /** Optional scale to apply to scalable dashes, 1.0 if undefined */\n dashScale?: number;\n /** Optional scale to apply to scalable gaps, 1.0 if undefined */\n gapScale?: number;\n /** Optional start width in meters to apply to dashes, no width if undefined */\n startWidth?: number;\n /** Optional end width in meters to apply to dashes, same as startWidth if undefined */\n endWidth?: number;\n /** Optional shift by distance in meters, 0.0 if undefined */\n distPhase?: number;\n /** Optional shift by fraction, 0.0 if undefined */\n fractPhase?: number;\n /** Optional flag to center stroke pattern and stretch ends, false if undefined */\n centerPhase?: boolean;\n /** Optional flag to enable or disable single segment mode */\n segmentMode?: boolean;\n /** Optional flag that denotes startWidth and endWidth represent physical widths that should not be affected by scale, false if undefined */\n physicalWidth?: boolean;\n /** Optional up vector for style (applicable to 3d only), 0.0,0.0,1.0 if undefined */\n normal?: XYZProps;\n /** Optional orientation for style (applicable to 3d only), 0.0,0.0,0.0 if undefined */\n rotation?: YawPitchRollProps;\n }\n\n /** Optional modifiers to override line style definition */\n export class Modifier implements ModifierProps {\n public scale?: number;\n public dashScale?: number;\n public gapScale?: number;\n public startWidth?: number;\n public endWidth?: number;\n public distPhase?: number;\n public fractPhase?: number;\n public centerPhase?: boolean;\n public segmentMode?: boolean;\n public physicalWidth?: boolean;\n public normal?: Vector3d;\n public rotation?: YawPitchRollAngles;\n\n /** constructor for LineStyle.Modifier */\n constructor(props: ModifierProps) {\n this.scale = props.scale;\n this.dashScale = props.dashScale;\n this.gapScale = props.gapScale;\n this.startWidth = props.startWidth;\n this.endWidth = props.endWidth;\n this.distPhase = props.distPhase;\n this.fractPhase = props.fractPhase;\n this.centerPhase = props.centerPhase;\n this.segmentMode = props.segmentMode;\n this.physicalWidth = props.physicalWidth;\n this.normal = props.normal ? Vector3d.fromJSON(props.normal) : undefined;\n this.rotation = props.rotation ? YawPitchRollAngles.fromJSON(props.rotation) : undefined;\n }\n\n /** Returns a deep copy of this object. */\n public clone() {\n return new Modifier(this);\n }\n\n /** Compare two LineStyle.Modifier for equivalence */\n public equals(other: Modifier): boolean {\n if (this === other) // same pointer\n return true;\n\n if (other.scale !== this.scale ||\n other.dashScale !== this.dashScale ||\n other.gapScale !== this.gapScale ||\n other.startWidth !== this.startWidth ||\n other.endWidth !== this.endWidth ||\n other.distPhase !== this.distPhase ||\n other.fractPhase !== this.fractPhase ||\n other.centerPhase !== this.centerPhase ||\n other.segmentMode !== this.segmentMode ||\n other.physicalWidth !== this.physicalWidth)\n return false;\n\n if ((this.normal === undefined) !== (other.normal === undefined))\n return false;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (this.normal && !this.normal.isAlmostEqual(other.normal!))\n return false;\n\n if ((this.rotation === undefined) !== (other.rotation === undefined))\n return false;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\n return false;\n\n return true;\n }\n\n public applyTransform(transform: Transform): boolean {\n if (transform.isIdentity)\n return true;\n if (this.normal) {\n transform.matrix.multiplyVector(this.normal, this.normal);\n const normalized = this.normal.normalize();\n if (normalized)\n this.normal.setFrom(normalized);\n else\n return false;\n }\n if (this.rotation) {\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\n const scales = new Vector3d();\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\n if (undefined === newRotation)\n return false;\n this.rotation.setFrom(newRotation);\n }\n\n let scaleFactor;\n const scaleVector = Vector3d.create();\n const scaleMatrix = transform.matrix;\n scaleMatrix.normalizeRowsInPlace(scaleVector);\n\n // Check for flatten transform, dividing scaleVector by 3 gives wrong scaleFactor\n if (scaleVector.x !== 0.0 && scaleVector.y !== 0.0 && scaleVector.z !== 0.0)\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 3.0;\n else\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 2.0;\n\n if (1.0 === scaleFactor)\n return true;\n\n if (this.scale)\n this.scale *= scaleFactor;\n\n if (this.physicalWidth)\n return true;\n\n if (this.startWidth)\n this.startWidth *= scaleFactor;\n\n if (this.endWidth)\n this.endWidth *= scaleFactor;\n\n return true;\n }\n }\n\n /** Line style id and optional modifiers to override line style definition */\n export class Info {\n public styleId: Id64String;\n public styleMod?: Modifier; // Optional modifiers to override line style definition\n\n /** Creates a LineStyle.Info object */\n constructor(styleId: Id64String, styleMod?: Modifier) {\n this.styleId = styleId;\n this.styleMod = styleMod;\n }\n\n /** Returns a deep copy of this object. */\n public clone(): Info {\n return new Info(this.styleId, this.styleMod ? this.styleMod.clone() : undefined);\n }\n\n public equals(other: Info): boolean {\n if (this === other)\n return true;\n if (this.styleId !== other.styleId)\n return false;\n if ((this.styleMod === undefined) !== (other.styleMod === undefined))\n return false;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (this.styleMod && !this.styleMod.equals(other.styleMod!))\n return false;\n return true;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAa,QAAQ,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAE5G,cAAc;AACd,MAAM,KAAW,SAAS,CAuLzB;AAvLD,WAAiB,SAAS;IAkCxB,2DAA2D;IAC3D,MAAa,QAAQ;QACZ,KAAK,CAAU;QACf,SAAS,CAAU;QACnB,QAAQ,CAAU;QAClB,UAAU,CAAU;QACpB,QAAQ,CAAU;QAClB,SA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CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IA3BY,cAAI,OA2BhB,CAAA;AACH,CAAC,EAvLgB,SAAS,KAAT,SAAS,QAuLzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Symbology\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\r\n\r\n/** @public */\r\nexport namespace LineStyle {\r\n\r\n /** Modify the line style appearance without changing the line style definition.\r\n * Applies to the style previously established by a [[GeometryAppearanceProps]] or current [[SubCategoryAppearance]].\r\n * Most of the modifiers affect the line style stroke pattern, with the orientation and scales being the exception.\r\n * @see [[GeometryStreamEntryProps]]\r\n */\r\n export interface ModifierProps {\r\n /** Optional scale to apply to all length values, 1.0 if undefined */\r\n scale?: number;\r\n /** Optional scale to apply to scalable dashes, 1.0 if undefined */\r\n dashScale?: number;\r\n /** Optional scale to apply to scalable gaps, 1.0 if undefined */\r\n gapScale?: number;\r\n /** Optional start width in meters to apply to dashes, no width if undefined */\r\n startWidth?: number;\r\n /** Optional end width in meters to apply to dashes, same as startWidth if undefined */\r\n endWidth?: number;\r\n /** Optional shift by distance in meters, 0.0 if undefined */\r\n distPhase?: number;\r\n /** Optional shift by fraction, 0.0 if undefined */\r\n fractPhase?: number;\r\n /** Optional flag to center stroke pattern and stretch ends, false if undefined */\r\n centerPhase?: boolean;\r\n /** Optional flag to enable or disable single segment mode */\r\n segmentMode?: boolean;\r\n /** Optional flag that denotes startWidth and endWidth represent physical widths that should not be affected by scale, false if undefined */\r\n physicalWidth?: boolean;\r\n /** Optional up vector for style (applicable to 3d only), 0.0,0.0,1.0 if undefined */\r\n normal?: XYZProps;\r\n /** Optional orientation for style (applicable to 3d only), 0.0,0.0,0.0 if undefined */\r\n rotation?: YawPitchRollProps;\r\n }\r\n\r\n /** Optional modifiers to override line style definition */\r\n export class Modifier implements ModifierProps {\r\n public scale?: number;\r\n public dashScale?: number;\r\n public gapScale?: number;\r\n public startWidth?: number;\r\n public endWidth?: number;\r\n public distPhase?: number;\r\n public fractPhase?: number;\r\n public centerPhase?: boolean;\r\n public segmentMode?: boolean;\r\n public physicalWidth?: boolean;\r\n public normal?: Vector3d;\r\n public rotation?: YawPitchRollAngles;\r\n\r\n /** constructor for LineStyle.Modifier */\r\n constructor(props: ModifierProps) {\r\n this.scale = props.scale;\r\n this.dashScale = props.dashScale;\r\n this.gapScale = props.gapScale;\r\n this.startWidth = props.startWidth;\r\n this.endWidth = props.endWidth;\r\n this.distPhase = props.distPhase;\r\n this.fractPhase = props.fractPhase;\r\n this.centerPhase = props.centerPhase;\r\n this.segmentMode = props.segmentMode;\r\n this.physicalWidth = props.physicalWidth;\r\n this.normal = props.normal ? Vector3d.fromJSON(props.normal) : undefined;\r\n this.rotation = props.rotation ? YawPitchRollAngles.fromJSON(props.rotation) : undefined;\r\n }\r\n\r\n /** Returns a deep copy of this object. */\r\n public clone() {\r\n return new Modifier(this);\r\n }\r\n\r\n /** Compare two LineStyle.Modifier for equivalence */\r\n public equals(other: Modifier): boolean {\r\n if (this === other) // same pointer\r\n return true;\r\n\r\n if (other.scale !== this.scale ||\r\n other.dashScale !== this.dashScale ||\r\n other.gapScale !== this.gapScale ||\r\n other.startWidth !== this.startWidth ||\r\n other.endWidth !== this.endWidth ||\r\n other.distPhase !== this.distPhase ||\r\n other.fractPhase !== this.fractPhase ||\r\n other.centerPhase !== this.centerPhase ||\r\n other.segmentMode !== this.segmentMode ||\r\n other.physicalWidth !== this.physicalWidth)\r\n return false;\r\n\r\n if ((this.normal === undefined) !== (other.normal === undefined))\r\n return false;\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n if (this.normal && !this.normal.isAlmostEqual(other.normal!))\r\n return false;\r\n\r\n if ((this.rotation === undefined) !== (other.rotation === undefined))\r\n return false;\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n public applyTransform(transform: Transform): boolean {\r\n if (transform.isIdentity)\r\n return true;\r\n if (this.normal) {\r\n transform.matrix.multiplyVector(this.normal, this.normal);\r\n const normalized = this.normal.normalize();\r\n if (normalized)\r\n this.normal.setFrom(normalized);\r\n else\r\n return false;\r\n }\r\n if (this.rotation) {\r\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\r\n const scales = new Vector3d();\r\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\r\n return false;\r\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\r\n if (undefined === newRotation)\r\n return false;\r\n this.rotation.setFrom(newRotation);\r\n }\r\n\r\n let scaleFactor;\r\n const scaleVector = Vector3d.create();\r\n const scaleMatrix = transform.matrix;\r\n scaleMatrix.normalizeRowsInPlace(scaleVector);\r\n\r\n // Check for flatten transform, dividing scaleVector by 3 gives wrong scaleFactor\r\n if (scaleVector.x !== 0.0 && scaleVector.y !== 0.0 && scaleVector.z !== 0.0)\r\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 3.0;\r\n else\r\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 2.0;\r\n\r\n if (1.0 === scaleFactor)\r\n return true;\r\n\r\n if (this.scale)\r\n this.scale *= scaleFactor;\r\n\r\n if (this.physicalWidth)\r\n return true;\r\n\r\n if (this.startWidth)\r\n this.startWidth *= scaleFactor;\r\n\r\n if (this.endWidth)\r\n this.endWidth *= scaleFactor;\r\n\r\n return true;\r\n }\r\n }\r\n\r\n /** Line style id and optional modifiers to override line style definition */\r\n export class Info {\r\n public styleId: Id64String;\r\n public styleMod?: Modifier; // Optional modifiers to override line style definition\r\n\r\n /** Creates a LineStyle.Info object */\r\n constructor(styleId: Id64String, styleMod?: Modifier) {\r\n this.styleId = styleId;\r\n this.styleMod = styleMod;\r\n }\r\n\r\n /** Returns a deep copy of this object. */\r\n public clone(): Info {\r\n return new Info(this.styleId, this.styleMod ? this.styleMod.clone() : undefined);\r\n }\r\n\r\n public equals(other: Info): boolean {\r\n if (this === other)\r\n return true;\r\n if (this.styleId !== other.styleId)\r\n return false;\r\n if ((this.styleMod === undefined) !== (other.styleMod === undefined))\r\n return false;\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n if (this.styleMod && !this.styleMod.equals(other.styleMod!))\r\n return false;\r\n return true;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Placement.js","sourceRoot":"","sources":["../../../src/geometry/Placement.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAE,QAAQ,EAAE,kBAAkB,GACrH,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAsC7C;;;GAGG;AACH,MAAM,OAAO,WAAW;IACI;IAAwB;IAAmC;IAArF,YAA0B,MAAe,EAAS,MAA0B,EAAS,IAAyB;QAApF,WAAM,GAAN,MAAM,CAAS;QAAS,WAAM,GAAN,MAAM,CAAoB;QAAS,SAAI,GAAJ,IAAI,CAAqB;IAAI,CAAC;IACnH,sFAAsF;IACtF,IAA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AAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,kEAAkE;IAC3D,cAAc;QACnB,MAAM,KAAK,GAAG,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,OAAO;YACf,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEzE,2CAA2C;QAC3C,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACzB,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAE,GAAG,CAAC,CAAE,2CAA2C;QACjE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAgB;QACvC,MAAM,SAAS,GAAG,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY;YACnF,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n\nimport { expectDefined, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, Constant, Matrix3d, Point2d, Point3d, Range2d, Range3d, Range3dProps, Transform, Vector3d, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\nimport { Frustum } from \"../Frustum\";\nimport { IModelError } from \"../IModelError\";\n\n/** A Range3d that is aligned with the axes of spatial coordinates.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3d = Range3d;\n\n/** The properties of a Range3d.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3dProps = Range3dProps;\n\n/** A bounding box aligned to the orientation of a 3d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox3d = Range3d;\n\n/** A bounding box aligned to the orientation of a 2d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox2d = Range2d;\n\n/** A bounding box aligned to a local coordinate system\n * @public\n * @extensions\n */\nexport type LocalAlignedBox3d = Range3d;\n\n/** Either a Placement2d or Placement3d\n * @public\n * @extensions\n */\nexport type Placement = Placement2d | Placement3d;\n\n/** The placement of a GeometricElement3d. This includes the origin, orientation, and size (bounding box) of the element.\n * All geometry of a GeometricElement are relative to its placement.\n * @public\n */\nexport class Placement3d implements Placement3dProps {\n public constructor(public origin: Point3d, public angles: YawPitchRollAngles, public bbox: ElementAlignedBox3d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return this.angles.toMatrix3d(); }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(this.origin, this.rotation); }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return true; }\n\n /** Create a new Placement3d from a Placement3dProps. */\n public static fromJSON(json?: Placement3dProps): Placement3d {\n const props: any = json ? json : {};\n return new Placement3d(Point3d.fromJSON(props.origin), YawPitchRollAngles.fromJSON(props.angles), Range3d.fromJSON<ElementAlignedBox3d>(props.bbox));\n }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Set the contents of this Placement3d from another Placement3d */\n public setFrom(other: Placement3d) {\n this.origin.setFrom(other.origin);\n this.angles.setFrom(other.angles);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Determine whether this Placement3d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(this.bbox, range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n return range;\n }\n\n /** Multiply the Transform of this Placement3d by the specified *other* Transform.\n * * Specifically `this.angles` is set to the rotation specified by `other.matrix * this.transform.matrix`\n * and `this.origin` is set to the origin of `other * this.transform`.\n * * Since the placement transform is local-to-world, this means `other` is a world-to-world transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement3d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if (undefined === angles)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angles = angles;\n this.origin.setFrom(transform.origin);\n }\n}\n\n/** The placement of a GeometricElement2d. This includes the origin, rotation, and size (bounding box) of the element.\n * @public\n */\nexport class Placement2d implements Placement2dProps {\n public constructor(public origin: Point2d, public angle: Angle, public bbox: ElementAlignedBox2d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return expectDefined(Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)); }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(Point3d.createFrom(this.origin), this.rotation); }\n /** Create a new Placement2d from a Placement2dProps. */\n public static fromJSON(json?: Placement2dProps): Placement2d {\n const props: any = json ? json : {};\n return new Placement2d(Point2d.fromJSON(props.origin), Angle.fromJSON(props.angle), Range2d.fromJSON(props.bbox));\n }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return false; }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Determine whether this Placement2d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Set the contents of this Placement2d from another Placement2d */\n public setFrom(other: Placement2d) {\n this.origin.setFrom(other.origin);\n this.angle.setFrom(other.angle);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(Range3d.createRange2d(this.bbox, 0), range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n range.low.z = - 1.0; // is the 2dFrustumDepth, which === 1 meter\n range.high.z = 1.0;\n return range;\n }\n\n /** Multiply the Transform of this Placement2d by the specified *other* Transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement2d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angle = angles.yaw;\n this.origin.setFrom(transform.origin);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Placement.js","sourceR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OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAgB;QACvC,MAAM,SAAS,GAAG,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY;YACnF,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { expectDefined, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Constant, Matrix3d, Point2d, Point3d, Range2d, Range3d, Range3dProps, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\r\nimport { Frustum } from \"../Frustum\";\r\nimport { IModelError } from \"../IModelError\";\r\n\r\n/** A Range3d that is aligned with the axes of spatial coordinates.\r\n * @public\r\n * @extensions\r\n */\r\nexport type AxisAlignedBox3d = Range3d;\r\n\r\n/** The properties of a Range3d.\r\n * @public\r\n * @extensions\r\n */\r\nexport type AxisAlignedBox3dProps = Range3dProps;\r\n\r\n/** A bounding box aligned to the orientation of a 3d Element\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementAlignedBox3d = Range3d;\r\n\r\n/** A bounding box aligned to the orientation of a 2d Element\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementAlignedBox2d = Range2d;\r\n\r\n/** A bounding box aligned to a local coordinate system\r\n * @public\r\n * @extensions\r\n */\r\nexport type LocalAlignedBox3d = Range3d;\r\n\r\n/** Either a Placement2d or Placement3d\r\n * @public\r\n * @extensions\r\n */\r\nexport type Placement = Placement2d | Placement3d;\r\n\r\n/** The placement of a GeometricElement3d. This includes the origin, orientation, and size (bounding box) of the element.\r\n * All geometry of a GeometricElement are relative to its placement.\r\n * @public\r\n */\r\nexport class Placement3d implements Placement3dProps {\r\n public constructor(public origin: Point3d, public angles: YawPitchRollAngles, public bbox: ElementAlignedBox3d) { }\r\n /** Get the rotation from local coordinates of this placement to world coordinates. */\r\n public get rotation(): Matrix3d { return this.angles.toMatrix3d(); }\r\n /** Get the transform from local coordinates of this placement to world coordinates. */\r\n public get transform(): Transform { return Transform.createOriginAndMatrix(this.origin, this.rotation); }\r\n /** determine if this is 3d placement */\r\n public get is3d(): boolean { return true; }\r\n\r\n /** Create a new Placement3d from a Placement3dProps. */\r\n public static fromJSON(json?: Placement3dProps): Placement3d {\r\n const props: any = json ? json : {};\r\n return new Placement3d(Point3d.fromJSON(props.origin), YawPitchRollAngles.fromJSON(props.angles), Range3d.fromJSON<ElementAlignedBox3d>(props.bbox));\r\n }\r\n\r\n /** Get the 8 corners, in world coordinates, of this placement. */\r\n public getWorldCorners(out?: Frustum): Frustum {\r\n const frust = Frustum.fromRange(this.bbox, out);\r\n frust.multiply(this.transform);\r\n return frust;\r\n }\r\n\r\n /** Set the contents of this Placement3d from another Placement3d */\r\n public setFrom(other: Placement3d) {\r\n this.origin.setFrom(other.origin);\r\n this.angles.setFrom(other.angles);\r\n this.bbox.setFrom(other.bbox);\r\n }\r\n\r\n /** Determine whether this Placement3d is valid. */\r\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\r\n\r\n /** Calculate the axis-aligned bounding box for this placement. */\r\n public calculateRange(): AxisAlignedBox3d {\r\n const range = new Range3d();\r\n if (!this.isValid)\r\n return range;\r\n\r\n this.transform.multiplyRange(this.bbox, range);\r\n\r\n // low and high are not allowed to be equal\r\n range.ensureMinLengths();\r\n return range;\r\n }\r\n\r\n /** Multiply the Transform of this Placement3d by the specified *other* Transform.\r\n * * Specifically `this.angles` is set to the rotation specified by `other.matrix * this.transform.matrix`\r\n * and `this.origin` is set to the origin of `other * this.transform`.\r\n * * Since the placement transform is local-to-world, this means `other` is a world-to-world transform.\r\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement3d.\r\n */\r\n public multiplyTransform(other: Transform): void {\r\n const transform = other.multiplyTransformTransform(this.transform);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\r\n if (undefined === angles)\r\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\r\n\r\n this.angles = angles;\r\n this.origin.setFrom(transform.origin);\r\n }\r\n}\r\n\r\n/** The placement of a GeometricElement2d. This includes the origin, rotation, and size (bounding box) of the element.\r\n * @public\r\n */\r\nexport class Placement2d implements Placement2dProps {\r\n public constructor(public origin: Point2d, public angle: Angle, public bbox: ElementAlignedBox2d) { }\r\n /** Get the rotation from local coordinates of this placement to world coordinates. */\r\n public get rotation(): Matrix3d { return expectDefined(Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)); }\r\n /** Get the transform from local coordinates of this placement to world coordinates. */\r\n public get transform(): Transform { return Transform.createOriginAndMatrix(Point3d.createFrom(this.origin), this.rotation); }\r\n /** Create a new Placement2d from a Placement2dProps. */\r\n public static fromJSON(json?: Placement2dProps): Placement2d {\r\n const props: any = json ? json : {};\r\n return new Placement2d(Point2d.fromJSON(props.origin), Angle.fromJSON(props.angle), Range2d.fromJSON(props.bbox));\r\n }\r\n /** determine if this is 3d placement */\r\n public get is3d(): boolean { return false; }\r\n\r\n /** Get the 8 corners, in world coordinates, of this placement. */\r\n public getWorldCorners(out?: Frustum): Frustum {\r\n const frust = Frustum.fromRange(this.bbox, out);\r\n frust.multiply(this.transform);\r\n return frust;\r\n }\r\n\r\n /** Determine whether this Placement2d is valid. */\r\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\r\n\r\n /** Set the contents of this Placement2d from another Placement2d */\r\n public setFrom(other: Placement2d) {\r\n this.origin.setFrom(other.origin);\r\n this.angle.setFrom(other.angle);\r\n this.bbox.setFrom(other.bbox);\r\n }\r\n\r\n /** Calculate the axis-aligned bounding box for this placement. */\r\n public calculateRange(): AxisAlignedBox3d {\r\n const range = new Range3d();\r\n if (!this.isValid)\r\n return range;\r\n\r\n this.transform.multiplyRange(Range3d.createRange2d(this.bbox, 0), range);\r\n\r\n // low and high are not allowed to be equal\r\n range.ensureMinLengths();\r\n range.low.z = - 1.0; // is the 2dFrustumDepth, which === 1 meter\r\n range.high.z = 1.0;\r\n return range;\r\n }\r\n\r\n /** Multiply the Transform of this Placement2d by the specified *other* Transform.\r\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement2d.\r\n */\r\n public multiplyTransform(other: Transform): void {\r\n const transform = other.multiplyTransformTransform(this.transform);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\r\n if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)\r\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\r\n\r\n this.angle = angles.yaw;\r\n this.origin.setFrom(transform.origin);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Projection.js","sourceRoot":"","sources":["../../../src/geometry/Projection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,yHAAyH;AAEzH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAA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C,WAAW,IAAI,CAAC,IAAI,CAAC;YACjD,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;IACjC,CAAC;IACD,iCAAiC;IAC1B,SAAS,CAAU;IAE1B,YAAmB,IAA0B;QAC3C,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,kEAAkE;QACvF,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,CAAC;IACH,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAAyB;QAC9C,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IAChE,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAAqB;QACjC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,iBAAiB;YAC3E,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7E,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 Geometry\n */\n// cspell:ignore Albers, Krovak, OSTN, Cassini, Grinten, Mollweide, Eckert, Homolosine, Carree, Winkel, Tripel, Polyconic\n\nimport { Geometry } from \"@itwin/core-geometry\";\n\n/** This enum contains the list of all projection methods that can be represented as part of the HorizontalCRS\n * class. The None method indicates there is no projection and thus the CRS is longitude/latitude based\n * with units as degrees.\n * All other projection indicated a projected CRS.\n * @public\n * @extensions\n */\nexport type ProjectionMethod =\n \"None\" |\n \"TransverseMercator\" |\n \"SouthOrientedTransverseMercator\" |\n \"TransverseMercatorWisconsin\" |\n \"TransverseMercatorMinnesota\" |\n \"TransverseMercatorAffine\" |\n \"MercatorStandardParallel\" |\n \"Mercator\" |\n \"UniversalTransverseMercator\" |\n \"LambertConformalConicTwoParallels\" |\n \"LambertConformalConicBelgium\" |\n \"LambertConformalConicAffine\" |\n \"LambertConformalConicWisconsin\" |\n \"LambertConformalConicMinnesota\" |\n \"LambertConformalConicMichigan\" |\n \"LambertConformalConicOneParallel\" |\n \"AlbersEqualArea\" |\n \"NewZealandNationalGrid\" |\n \"ObliqueMercator1\" |\n \"ObliqueMercator2\" |\n \"TransverseMercatorOSTN97\" |\n \"TransverseMercatorOSTN02\" |\n \"TransverseMercatorOSTN15\" |\n \"Krovak\" |\n \"KrovakModified\" |\n \"ObliqueCylindricalSwiss\" |\n \"TransverseMercatorDenmarkSystem34\" |\n \"TransverseMercatorDenmarkSystem3499\" |\n \"TransverseMercatorDenmarkSystem3401\" |\n \"Cassini\" |\n \"Sinusoidal\" |\n \"VanDerGrinten\" |\n \"Bonne\" |\n \"Mollweide\" |\n \"EckertIV\" |\n \"EckertVI\" |\n \"GoodeHomolosine\" |\n \"Robinson\" |\n \"PlateCarree\" |\n \"MillerCylindrical\" |\n \"WinkelTripel\" |\n \"AzimuthalEqualArea\" |\n \"ObliqueStereographic\" |\n \"RectifiedSkewOrthomorphicCentered\" |\n \"RectifiedSkewOrthomorphicOrigin\" |\n \"ObliqueCylindricalHungary\" |\n \"Orthographic\" |\n \"AmericanPolyconic\" |\n \"LambertEquidistantAzimuthal\" |\n \"ObliqueMercatorMinnesota\";\n\n/** The equations are:\n * X1 = a1*X + a2*Y + TranslationX\n * Y1 = b1*X + b2*Y + translationY\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\n * @public\n * @extensions\n */\nexport interface AffineTransformProps {\n /** The X post translation */\n translationX: number;\n /** The Y post-translation */\n translationY: number;\n /** A1 value as defined in global comment. */\n a1: number;\n /** B1 value as defined in global comment. */\n b1: number;\n /** A2 value as defined in global comment. */\n a2: number;\n /** B2 value as defined in global comment. */\n b2: number;\n}\n\n/** The equations are:\n * X1 = a1*X + a2*Y + TranslationX\n * Y1 = b1*X + b2*Y + translationY\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\n * @public\n */\nexport class AffineTransform implements AffineTransformProps {\n /** The X post translation */\n public readonly translationX!: number;\n /** The Y post-translation */\n public readonly translationY!: number;\n /** A1 value as defined in global comment. */\n public readonly a1!: number;\n /** B1 value as defined in global comment. */\n public readonly b1!: number;\n /** A2 value as defined in global comment. */\n public readonly a2!: number;\n /** B2 value as defined in global comment. */\n public readonly b2!: number;\n\n constructor(data?: AffineTransformProps) {\n if (data) {\n this.translationX = data.translationX;\n this.translationY = data.translationY;\n this.a1 = data.a1;\n this.b1 = data.b1;\n this.a2 = data.a2;\n this.b2 = data.b2;\n }\n }\n\n /** Creates an Affine Transform from JSON representation.\n * @public */\n public static fromJSON(data: AffineTransformProps): AffineTransform {\n return new AffineTransform(data);\n }\n\n /** Creates a JSON from the Affine Transform definition\n * @public */\n public toJSON(): AffineTransformProps {\n return { translationX: this.translationX, a1: this.a1, a2: this.a2, translationY: this.translationY, b1: this.b1, b2: this.b2 };\n }\n\n /** Compares two Affine Transforms. It applies a minuscule tolerance for number compares\n * @public */\n public equals(other: AffineTransform): boolean {\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\n Math.abs(this.a1 - other.a1) < Geometry.smallFraction &&\n Math.abs(this.b1 - other.b1) < Geometry.smallFraction &&\n Math.abs(this.a2 - other.a2) < Geometry.smallFraction &&\n Math.abs(this.b2 - other.b2) < Geometry.smallFraction);\n }\n}\n\n/** Type used in the definition of UTM Zoning projection. This projection only requires a zone number and\n * the hemisphere North or South.\n * @public\n * @extensions\n */\nexport type HemisphereEnum = \"South\" | \"North\";\n\n/** The type to define the three zones of the Danish System 34 projections.\n * @public\n * @extensions\n */\nexport type DanishSystem34Region = \"Jylland\" | \"Sjaelland\" | \"Bornholm\";\n\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method\n * and a set of projection parameters specific to projection method selected.\n * @public\n * @extensions\n */\nexport interface ProjectionProps {\n /** The projection method. */\n method: ProjectionMethod;\n /** The False Easting of the projection. */\n falseEasting?: number;\n /** The False Northing of the projection. */\n falseNorthing?: number;\n /** The Central Meridian. */\n centralMeridian?: number;\n /** The latitude of origin of the projection. */\n latitudeOfOrigin?: number;\n /** Longitude of origin of the projection. */\n longitudeOfOrigin?: number;\n /** The scale reduction factor applied at origin. The nature of the projection has a\n * inherent scale factor applied that gradually varies outward from the projection origin.\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\n * For the michigan variation of the Lambert Conformal Conic projection it\n * can be used instead or in addition to Standard Parallel to define\n * a scale factor.\n */\n scaleFactor?: number;\n /** The elevation of the origin of the projection above the geoid. This value\n * allows compensation for the scale factor related to elevation above the sea level.\n */\n elevationAboveGeoid?: number;\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\n geoidSeparation?: number;\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\n affine?: AffineTransformProps;\n /** Standard parallel for projection that only use one.\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\n * which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\n * For conic projections (Lambert Tangential ...) it defines\n * the standard parallel at which the cone is tangent to the ellipsoid.\n */\n standardParallel?: number;\n /** The first standard parallel at which the cone crosses the ellipsoid. */\n standardParallel1?: number;\n /** The second standard parallel at which the cone crosses the ellipsoid. */\n standardParallel2?: number;\n /** The UTM zone number. A number from 0 to 60. */\n zoneNumber?: number;\n /** The hemisphere for Universal Transverse Mercator projection. */\n hemisphere?: HemisphereEnum;\n /** Longitude of the central point. */\n centralPointLongitude?: number;\n /** Latitude of the central point. */\n centralPointLatitude?: number;\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n point1Longitude?: number;\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n point1Latitude?: number;\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\n point2Longitude?: number;\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\n point2Latitude?: number;\n /** The Danish zone for Danish projections. */\n danishSystem34Region?: DanishSystem34Region;\n /** Azimuth. */\n azimuth?: number;\n}\n\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method and a set\n * of projection parameters specific to projection method selected to flatten the surface of the model of the Earth\n * defines as a geodetic ellipsoid. The flattening and the distortion angular, linear, scale from the process varies between methods.\n * Refer to appropriate external documentation for details.\n * @note Various property sets are required for specific projection methods. The current class implementation does not enforce\n * these rules yet and it is possible to define or not define any property regardless the method used.\n * @public\n */\nexport class Projection implements ProjectionProps {\n /** The projection method. */\n public readonly method!: ProjectionMethod;\n /** The False Easting of the projection. */\n public readonly falseEasting?: number;\n /** The False Northing of the projection. */\n public readonly falseNorthing?: number;\n /** The Central Meridian. */\n public readonly centralMeridian?: number;\n /** The latitude of origin of the projection. */\n public readonly latitudeOfOrigin?: number;\n /** Longitude of origin of the projection. */\n public readonly longitudeOfOrigin?: number;\n /** The scale reduction factor applied at origin. The nature of the projection has a\n * inherent scale factor applied that gradually varies outward from the projection origin.\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\n * For the michigan variation of the Lambert Conformal Conic projection it\n * can be used instead or in addition to Standard Parallel to define\n * a scale factor.\n */\n public readonly scaleFactor?: number;\n /** The elevation of the origin of the projection above the geoid. This value\n * allows compensation for the scale factor related to elevation above the sea level.\n */\n public readonly elevationAboveGeoid?: number;\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\n public readonly geoidSeparation?: number;\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\n public readonly affine?: AffineTransform;\n /** Standard parallel for projection that only use one.\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\n ** which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\n * For conic projections (Lambert Tangential ...) it defines\n * the standard parallel at which the cone is tangent to the ellipsoid.\n */\n public readonly standardParallel?: number;\n /** The first standard parallel at which the cone crosses the ellipsoid. */\n public readonly standardParallel1?: number;\n /** The second standard parallel at which the cone crosses the ellipsoid. */\n public readonly standardParallel2?: number;\n /** The UTM zone number. A number from 0 to 60. */\n public readonly zoneNumber?: number;\n /** The hemisphere for Universal Transverse Mercator projection. */\n public readonly hemisphere?: HemisphereEnum;\n /** Longitude of the central point. */\n public readonly centralPointLongitude?: number;\n /** Latitude of the central point. */\n public readonly centralPointLatitude?: number;\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n public readonly point1Longitude?: number;\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\n public readonly point1Latitude?: number;\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\n public readonly point2Longitude?: number;\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\n public readonly point2Latitude?: number;\n /** The Danish zone for Danish projections. */\n public readonly danishSystem34Region?: DanishSystem34Region;\n /** Azimuth. */\n public readonly azimuth?: number;\n\n public constructor(_data?: ProjectionProps) {\n if (_data) {\n this.method = _data.method;\n this.falseEasting = _data.falseEasting;\n this.falseNorthing = _data.falseNorthing;\n this.centralMeridian = _data.centralMeridian;\n this.latitudeOfOrigin = _data.latitudeOfOrigin;\n this.longitudeOfOrigin = _data.longitudeOfOrigin;\n this.scaleFactor = _data.scaleFactor;\n this.elevationAboveGeoid = _data.elevationAboveGeoid;\n this.geoidSeparation = _data.geoidSeparation;\n this.affine = _data.affine ? AffineTransform.fromJSON(_data.affine) : undefined;\n this.standardParallel = _data.standardParallel;\n this.standardParallel1 = _data.standardParallel1;\n this.standardParallel2 = _data.standardParallel2;\n this.zoneNumber = _data.zoneNumber;\n this.hemisphere = _data.hemisphere;\n this.centralPointLongitude = _data.centralPointLongitude;\n this.centralPointLatitude = _data.centralPointLatitude;\n this.point1Longitude = _data.point1Longitude;\n this.point1Latitude = _data.point1Latitude;\n this.point2Longitude = _data.point2Longitude;\n this.point2Latitude = _data.point2Latitude;\n this.danishSystem34Region = _data.danishSystem34Region;\n this.azimuth = _data.azimuth;\n }\n }\n\n /** Creates a Projection from JSON representation.\n * @public */\n public static fromJSON(data: ProjectionProps): Projection {\n return new Projection(data);\n }\n\n /** Creates a JSON from the Projection definition\n * @public */\n public toJSON(): ProjectionProps {\n const data: ProjectionProps = { method: this.method };\n data.falseEasting = this.falseEasting;\n data.falseNorthing = this.falseNorthing;\n data.centralMeridian = this.centralMeridian;\n data.latitudeOfOrigin = this.latitudeOfOrigin;\n data.longitudeOfOrigin = this.longitudeOfOrigin;\n data.scaleFactor = this.scaleFactor;\n data.elevationAboveGeoid = this.elevationAboveGeoid;\n data.geoidSeparation = this.geoidSeparation;\n data.affine = this.affine ? this.affine.toJSON() : undefined;\n data.standardParallel = this.standardParallel;\n data.standardParallel1 = this.standardParallel1;\n data.standardParallel2 = this.standardParallel2;\n data.zoneNumber = this.zoneNumber;\n data.hemisphere = this.hemisphere;\n data.centralPointLongitude = this.centralPointLongitude;\n data.centralPointLatitude = this.centralPointLatitude;\n data.point1Longitude = this.point1Longitude;\n data.point1Latitude = this.point1Latitude;\n data.point2Longitude = this.point2Longitude;\n data.point2Latitude = this.point2Latitude;\n data.danishSystem34Region = this.danishSystem34Region;\n data.azimuth = this.azimuth;\n return data;\n }\n\n /** Compares two projections. It is a strict compare operation as descriptive data is compared\n * but a minuscule tolerance is applied to number compares.\n * @public */\n public equals(other: Projection): boolean {\n if (this.method !== other.method ||\n this.zoneNumber !== other.zoneNumber ||\n this.hemisphere !== other.hemisphere ||\n this.danishSystem34Region !== other.danishSystem34Region)\n return false;\n\n // Note that even though falseEasting, falseNorthing, elevationAboveGeoid and geoidSeparation are expressed\n // in the units of the projection which can be foot or US survey foot, they are still within the same order\n // of size that Geometry.smallMetricDistance can be used effectively.\n if (!Geometry.isAlmostEqualOptional(this.falseEasting, other.falseEasting, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.falseNorthing, other.falseNorthing, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.centralMeridian, other.centralMeridian, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.latitudeOfOrigin, other.latitudeOfOrigin, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.longitudeOfOrigin, other.longitudeOfOrigin, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.scaleFactor, other.scaleFactor, Geometry.smallFraction) ||\n !Geometry.isAlmostEqualOptional(this.elevationAboveGeoid, other.elevationAboveGeoid, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.geoidSeparation, other.geoidSeparation, Geometry.smallMetricDistance) ||\n !Geometry.isAlmostEqualOptional(this.standardParallel, other.standardParallel, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.standardParallel1, other.standardParallel1, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.standardParallel2, other.standardParallel2, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.centralPointLongitude, other.centralPointLongitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.centralPointLatitude, other.centralPointLatitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point1Longitude, other.point1Longitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point1Latitude, other.point1Latitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point2Longitude, other.point2Longitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.point2Latitude, other.point2Latitude, Geometry.smallAngleDegrees) ||\n !Geometry.isAlmostEqualOptional(this.azimuth, other.azimuth, Geometry.smallAngleDegrees))\n return false;\n\n if (this.affine && other.affine) {\n if (!this.affine.equals(other.affine))\n return false;\n } else {\n if (this.affine || other.affine)\n return false;\n }\n return true;\n }\n}\n\n/** A 2D cartographic point in degrees\n * @public\n * @extensions\n */\nexport interface Carto2DDegreesProps {\n /** Latitude value in degrees */\n latitude: number;\n /** Longitude value in degrees */\n longitude: number;\n}\n\n/** A 2D cartographic point in degrees\n * @public\n */\nexport class Carto2DDegrees implements Carto2DDegreesProps {\n /** Latitude value in degrees. Must be between -90 and +90 included */\n private _latitude!: number;\n /** Returns or sets the latitude in degrees. When setting the provided number must be between or equal from -90 to 90. */\n public get latitude() { return this._latitude; }\n public set latitude(newLatitude: number) {\n if ((newLatitude <= 90.0) && (newLatitude >= -90.0))\n this._latitude = newLatitude;\n }\n /** Longitude value in degrees */\n public longitude!: number;\n\n public constructor(data?: Carto2DDegreesProps) {\n this.latitude = 0.0; /* make sure latitude is init even if invalid latitude provided */\n if (data) {\n this.latitude = data.latitude;\n this.longitude = data.longitude;\n }\n }\n\n /** Creates a Carto2DDegrees object from JSON representation.\n * @public */\n public static fromJSON(data: Carto2DDegreesProps): Carto2DDegrees {\n return new Carto2DDegrees(data);\n }\n\n /** Creates a JSON from the Carto2DDegrees definition\n * @public */\n public toJSON(): Carto2DDegreesProps {\n return { latitude: this.latitude, longitude: this.longitude };\n }\n\n /** Compares two Carto2DDegrees object. It applies a minuscule tolerance to compares.\n * @public */\n public equals(other: Carto2DDegrees): boolean {\n return (Math.abs(this.latitude - other.latitude) < Geometry.smallAngleDegrees &&\n Math.abs(this.longitude - other.longitude) < Geometry.smallAngleDegrees);\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"Projection.js","sourceRoot":"","sources":["../../../src/geometry/Projection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F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QAAQ,CAAC,WAAmB;QACrC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC;YACjD,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;IACjC,CAAC;IACD,iCAAiC;IAC1B,SAAS,CAAU;IAE1B,YAAmB,IAA0B;QAC3C,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,kEAAkE;QACvF,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,CAAC;IACH,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAAyB;QAC9C,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IAChE,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAAqB;QACjC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,iBAAiB;YAC3E,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7E,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 Geometry\r\n */\r\n// cspell:ignore Albers, Krovak, OSTN, Cassini, Grinten, Mollweide, Eckert, Homolosine, Carree, Winkel, Tripel, Polyconic\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\n\r\n/** This enum contains the list of all projection methods that can be represented as part of the HorizontalCRS\r\n * class. The None method indicates there is no projection and thus the CRS is longitude/latitude based\r\n * with units as degrees.\r\n * All other projection indicated a projected CRS.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ProjectionMethod =\r\n \"None\" |\r\n \"TransverseMercator\" |\r\n \"SouthOrientedTransverseMercator\" |\r\n \"TransverseMercatorWisconsin\" |\r\n \"TransverseMercatorMinnesota\" |\r\n \"TransverseMercatorAffine\" |\r\n \"MercatorStandardParallel\" |\r\n \"Mercator\" |\r\n \"UniversalTransverseMercator\" |\r\n \"LambertConformalConicTwoParallels\" |\r\n \"LambertConformalConicBelgium\" |\r\n \"LambertConformalConicAffine\" |\r\n \"LambertConformalConicWisconsin\" |\r\n \"LambertConformalConicMinnesota\" |\r\n \"LambertConformalConicMichigan\" |\r\n \"LambertConformalConicOneParallel\" |\r\n \"AlbersEqualArea\" |\r\n \"NewZealandNationalGrid\" |\r\n \"ObliqueMercator1\" |\r\n \"ObliqueMercator2\" |\r\n \"TransverseMercatorOSTN97\" |\r\n \"TransverseMercatorOSTN02\" |\r\n \"TransverseMercatorOSTN15\" |\r\n \"Krovak\" |\r\n \"KrovakModified\" |\r\n \"ObliqueCylindricalSwiss\" |\r\n \"TransverseMercatorDenmarkSystem34\" |\r\n \"TransverseMercatorDenmarkSystem3499\" |\r\n \"TransverseMercatorDenmarkSystem3401\" |\r\n \"Cassini\" |\r\n \"Sinusoidal\" |\r\n \"VanDerGrinten\" |\r\n \"Bonne\" |\r\n \"Mollweide\" |\r\n \"EckertIV\" |\r\n \"EckertVI\" |\r\n \"GoodeHomolosine\" |\r\n \"Robinson\" |\r\n \"PlateCarree\" |\r\n \"MillerCylindrical\" |\r\n \"WinkelTripel\" |\r\n \"AzimuthalEqualArea\" |\r\n \"ObliqueStereographic\" |\r\n \"RectifiedSkewOrthomorphicCentered\" |\r\n \"RectifiedSkewOrthomorphicOrigin\" |\r\n \"ObliqueCylindricalHungary\" |\r\n \"Orthographic\" |\r\n \"AmericanPolyconic\" |\r\n \"LambertEquidistantAzimuthal\" |\r\n \"ObliqueMercatorMinnesota\";\r\n\r\n/** The equations are:\r\n * X1 = a1*X + a2*Y + TranslationX\r\n * Y1 = b1*X + b2*Y + translationY\r\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AffineTransformProps {\r\n /** The X post translation */\r\n translationX: number;\r\n /** The Y post-translation */\r\n translationY: number;\r\n /** A1 value as defined in global comment. */\r\n a1: number;\r\n /** B1 value as defined in global comment. */\r\n b1: number;\r\n /** A2 value as defined in global comment. */\r\n a2: number;\r\n /** B2 value as defined in global comment. */\r\n b2: number;\r\n}\r\n\r\n/** The equations are:\r\n * X1 = a1*X + a2*Y + TranslationX\r\n * Y1 = b1*X + b2*Y + translationY\r\n * An affine representing no transformation will have: a1 = 1.0, a2 = 0.0, b1 = 0.0, b2 = 1.0.\r\n * @public\r\n */\r\nexport class AffineTransform implements AffineTransformProps {\r\n /** The X post translation */\r\n public readonly translationX!: number;\r\n /** The Y post-translation */\r\n public readonly translationY!: number;\r\n /** A1 value as defined in global comment. */\r\n public readonly a1!: number;\r\n /** B1 value as defined in global comment. */\r\n public readonly b1!: number;\r\n /** A2 value as defined in global comment. */\r\n public readonly a2!: number;\r\n /** B2 value as defined in global comment. */\r\n public readonly b2!: number;\r\n\r\n constructor(data?: AffineTransformProps) {\r\n if (data) {\r\n this.translationX = data.translationX;\r\n this.translationY = data.translationY;\r\n this.a1 = data.a1;\r\n this.b1 = data.b1;\r\n this.a2 = data.a2;\r\n this.b2 = data.b2;\r\n }\r\n }\r\n\r\n /** Creates an Affine Transform from JSON representation.\r\n * @public */\r\n public static fromJSON(data: AffineTransformProps): AffineTransform {\r\n return new AffineTransform(data);\r\n }\r\n\r\n /** Creates a JSON from the Affine Transform definition\r\n * @public */\r\n public toJSON(): AffineTransformProps {\r\n return { translationX: this.translationX, a1: this.a1, a2: this.a2, translationY: this.translationY, b1: this.b1, b2: this.b2 };\r\n }\r\n\r\n /** Compares two Affine Transforms. It applies a minuscule tolerance for number compares\r\n * @public */\r\n public equals(other: AffineTransform): boolean {\r\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\r\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\r\n Math.abs(this.a1 - other.a1) < Geometry.smallFraction &&\r\n Math.abs(this.b1 - other.b1) < Geometry.smallFraction &&\r\n Math.abs(this.a2 - other.a2) < Geometry.smallFraction &&\r\n Math.abs(this.b2 - other.b2) < Geometry.smallFraction);\r\n }\r\n}\r\n\r\n/** Type used in the definition of UTM Zoning projection. This projection only requires a zone number and\r\n * the hemisphere North or South.\r\n * @public\r\n * @extensions\r\n */\r\nexport type HemisphereEnum = \"South\" | \"North\";\r\n\r\n/** The type to define the three zones of the Danish System 34 projections.\r\n * @public\r\n * @extensions\r\n */\r\nexport type DanishSystem34Region = \"Jylland\" | \"Sjaelland\" | \"Bornholm\";\r\n\r\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method\r\n * and a set of projection parameters specific to projection method selected.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ProjectionProps {\r\n /** The projection method. */\r\n method: ProjectionMethod;\r\n /** The False Easting of the projection. */\r\n falseEasting?: number;\r\n /** The False Northing of the projection. */\r\n falseNorthing?: number;\r\n /** The Central Meridian. */\r\n centralMeridian?: number;\r\n /** The latitude of origin of the projection. */\r\n latitudeOfOrigin?: number;\r\n /** Longitude of origin of the projection. */\r\n longitudeOfOrigin?: number;\r\n /** The scale reduction factor applied at origin. The nature of the projection has a\r\n * inherent scale factor applied that gradually varies outward from the projection origin.\r\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\r\n * For the michigan variation of the Lambert Conformal Conic projection it\r\n * can be used instead or in addition to Standard Parallel to define\r\n * a scale factor.\r\n */\r\n scaleFactor?: number;\r\n /** The elevation of the origin of the projection above the geoid. This value\r\n * allows compensation for the scale factor related to elevation above the sea level.\r\n */\r\n elevationAboveGeoid?: number;\r\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\r\n geoidSeparation?: number;\r\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\r\n affine?: AffineTransformProps;\r\n /** Standard parallel for projection that only use one.\r\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\r\n * which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\r\n * For conic projections (Lambert Tangential ...) it defines\r\n * the standard parallel at which the cone is tangent to the ellipsoid.\r\n */\r\n standardParallel?: number;\r\n /** The first standard parallel at which the cone crosses the ellipsoid. */\r\n standardParallel1?: number;\r\n /** The second standard parallel at which the cone crosses the ellipsoid. */\r\n standardParallel2?: number;\r\n /** The UTM zone number. A number from 0 to 60. */\r\n zoneNumber?: number;\r\n /** The hemisphere for Universal Transverse Mercator projection. */\r\n hemisphere?: HemisphereEnum;\r\n /** Longitude of the central point. */\r\n centralPointLongitude?: number;\r\n /** Latitude of the central point. */\r\n centralPointLatitude?: number;\r\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n point1Longitude?: number;\r\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n point1Latitude?: number;\r\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\r\n point2Longitude?: number;\r\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\r\n point2Latitude?: number;\r\n /** The Danish zone for Danish projections. */\r\n danishSystem34Region?: DanishSystem34Region;\r\n /** Azimuth. */\r\n azimuth?: number;\r\n}\r\n\r\n/** This class encapsulates the projection of the CRS. The projection relies on a projection method and a set\r\n * of projection parameters specific to projection method selected to flatten the surface of the model of the Earth\r\n * defines as a geodetic ellipsoid. The flattening and the distortion angular, linear, scale from the process varies between methods.\r\n * Refer to appropriate external documentation for details.\r\n * @note Various property sets are required for specific projection methods. The current class implementation does not enforce\r\n * these rules yet and it is possible to define or not define any property regardless the method used.\r\n * @public\r\n */\r\nexport class Projection implements ProjectionProps {\r\n /** The projection method. */\r\n public readonly method!: ProjectionMethod;\r\n /** The False Easting of the projection. */\r\n public readonly falseEasting?: number;\r\n /** The False Northing of the projection. */\r\n public readonly falseNorthing?: number;\r\n /** The Central Meridian. */\r\n public readonly centralMeridian?: number;\r\n /** The latitude of origin of the projection. */\r\n public readonly latitudeOfOrigin?: number;\r\n /** Longitude of origin of the projection. */\r\n public readonly longitudeOfOrigin?: number;\r\n /** The scale reduction factor applied at origin. The nature of the projection has a\r\n * inherent scale factor applied that gradually varies outward from the projection origin.\r\n * The scale factor at origin enables to level the inherent scale factor over an use extent.\r\n * For the michigan variation of the Lambert Conformal Conic projection it\r\n * can be used instead or in addition to Standard Parallel to define\r\n * a scale factor.\r\n */\r\n public readonly scaleFactor?: number;\r\n /** The elevation of the origin of the projection above the geoid. This value\r\n * allows compensation for the scale factor related to elevation above the sea level.\r\n */\r\n public readonly elevationAboveGeoid?: number;\r\n /** The geoid separation. It represents the elevation of the geoid above the ellipsoid at the center of the projection. */\r\n public readonly geoidSeparation?: number;\r\n /** The definition of the affine post-transformation for Transverse Mercator and Lambert Conformal Conic with post-affine projections */\r\n public readonly affine?: AffineTransform;\r\n /** Standard parallel for projection that only use one.\r\n * For cylindrical projections (mercator, transverse mercator ...) it defines the parallel at\r\n ** which the cylinder crosses the ellipsoid resulting in a scale factor being applied.\r\n * For conic projections (Lambert Tangential ...) it defines\r\n * the standard parallel at which the cone is tangent to the ellipsoid.\r\n */\r\n public readonly standardParallel?: number;\r\n /** The first standard parallel at which the cone crosses the ellipsoid. */\r\n public readonly standardParallel1?: number;\r\n /** The second standard parallel at which the cone crosses the ellipsoid. */\r\n public readonly standardParallel2?: number;\r\n /** The UTM zone number. A number from 0 to 60. */\r\n public readonly zoneNumber?: number;\r\n /** The hemisphere for Universal Transverse Mercator projection. */\r\n public readonly hemisphere?: HemisphereEnum;\r\n /** Longitude of the central point. */\r\n public readonly centralPointLongitude?: number;\r\n /** Latitude of the central point. */\r\n public readonly centralPointLatitude?: number;\r\n /** Longitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n public readonly point1Longitude?: number;\r\n /** Latitude of the first alignment point for some Oblique Mercator and Krovak projections. */\r\n public readonly point1Latitude?: number;\r\n /** Longitude of the second alignment point for some Oblique Mercator projections. */\r\n public readonly point2Longitude?: number;\r\n /** Latitude of the second alignment point for some Oblique Mercator projections. */\r\n public readonly point2Latitude?: number;\r\n /** The Danish zone for Danish projections. */\r\n public readonly danishSystem34Region?: DanishSystem34Region;\r\n /** Azimuth. */\r\n public readonly azimuth?: number;\r\n\r\n public constructor(_data?: ProjectionProps) {\r\n if (_data) {\r\n this.method = _data.method;\r\n this.falseEasting = _data.falseEasting;\r\n this.falseNorthing = _data.falseNorthing;\r\n this.centralMeridian = _data.centralMeridian;\r\n this.latitudeOfOrigin = _data.latitudeOfOrigin;\r\n this.longitudeOfOrigin = _data.longitudeOfOrigin;\r\n this.scaleFactor = _data.scaleFactor;\r\n this.elevationAboveGeoid = _data.elevationAboveGeoid;\r\n this.geoidSeparation = _data.geoidSeparation;\r\n this.affine = _data.affine ? AffineTransform.fromJSON(_data.affine) : undefined;\r\n this.standardParallel = _data.standardParallel;\r\n this.standardParallel1 = _data.standardParallel1;\r\n this.standardParallel2 = _data.standardParallel2;\r\n this.zoneNumber = _data.zoneNumber;\r\n this.hemisphere = _data.hemisphere;\r\n this.centralPointLongitude = _data.centralPointLongitude;\r\n this.centralPointLatitude = _data.centralPointLatitude;\r\n this.point1Longitude = _data.point1Longitude;\r\n this.point1Latitude = _data.point1Latitude;\r\n this.point2Longitude = _data.point2Longitude;\r\n this.point2Latitude = _data.point2Latitude;\r\n this.danishSystem34Region = _data.danishSystem34Region;\r\n this.azimuth = _data.azimuth;\r\n }\r\n }\r\n\r\n /** Creates a Projection from JSON representation.\r\n * @public */\r\n public static fromJSON(data: ProjectionProps): Projection {\r\n return new Projection(data);\r\n }\r\n\r\n /** Creates a JSON from the Projection definition\r\n * @public */\r\n public toJSON(): ProjectionProps {\r\n const data: ProjectionProps = { method: this.method };\r\n data.falseEasting = this.falseEasting;\r\n data.falseNorthing = this.falseNorthing;\r\n data.centralMeridian = this.centralMeridian;\r\n data.latitudeOfOrigin = this.latitudeOfOrigin;\r\n data.longitudeOfOrigin = this.longitudeOfOrigin;\r\n data.scaleFactor = this.scaleFactor;\r\n data.elevationAboveGeoid = this.elevationAboveGeoid;\r\n data.geoidSeparation = this.geoidSeparation;\r\n data.affine = this.affine ? this.affine.toJSON() : undefined;\r\n data.standardParallel = this.standardParallel;\r\n data.standardParallel1 = this.standardParallel1;\r\n data.standardParallel2 = this.standardParallel2;\r\n data.zoneNumber = this.zoneNumber;\r\n data.hemisphere = this.hemisphere;\r\n data.centralPointLongitude = this.centralPointLongitude;\r\n data.centralPointLatitude = this.centralPointLatitude;\r\n data.point1Longitude = this.point1Longitude;\r\n data.point1Latitude = this.point1Latitude;\r\n data.point2Longitude = this.point2Longitude;\r\n data.point2Latitude = this.point2Latitude;\r\n data.danishSystem34Region = this.danishSystem34Region;\r\n data.azimuth = this.azimuth;\r\n return data;\r\n }\r\n\r\n /** Compares two projections. It is a strict compare operation as descriptive data is compared\r\n * but a minuscule tolerance is applied to number compares.\r\n * @public */\r\n public equals(other: Projection): boolean {\r\n if (this.method !== other.method ||\r\n this.zoneNumber !== other.zoneNumber ||\r\n this.hemisphere !== other.hemisphere ||\r\n this.danishSystem34Region !== other.danishSystem34Region)\r\n return false;\r\n\r\n // Note that even though falseEasting, falseNorthing, elevationAboveGeoid and geoidSeparation are expressed\r\n // in the units of the projection which can be foot or US survey foot, they are still within the same order\r\n // of size that Geometry.smallMetricDistance can be used effectively.\r\n if (!Geometry.isAlmostEqualOptional(this.falseEasting, other.falseEasting, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.falseNorthing, other.falseNorthing, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.centralMeridian, other.centralMeridian, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.latitudeOfOrigin, other.latitudeOfOrigin, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.longitudeOfOrigin, other.longitudeOfOrigin, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.scaleFactor, other.scaleFactor, Geometry.smallFraction) ||\r\n !Geometry.isAlmostEqualOptional(this.elevationAboveGeoid, other.elevationAboveGeoid, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.geoidSeparation, other.geoidSeparation, Geometry.smallMetricDistance) ||\r\n !Geometry.isAlmostEqualOptional(this.standardParallel, other.standardParallel, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.standardParallel1, other.standardParallel1, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.standardParallel2, other.standardParallel2, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.centralPointLongitude, other.centralPointLongitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.centralPointLatitude, other.centralPointLatitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point1Longitude, other.point1Longitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point1Latitude, other.point1Latitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point2Longitude, other.point2Longitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.point2Latitude, other.point2Latitude, Geometry.smallAngleDegrees) ||\r\n !Geometry.isAlmostEqualOptional(this.azimuth, other.azimuth, Geometry.smallAngleDegrees))\r\n return false;\r\n\r\n if (this.affine && other.affine) {\r\n if (!this.affine.equals(other.affine))\r\n return false;\r\n } else {\r\n if (this.affine || other.affine)\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/** A 2D cartographic point in degrees\r\n * @public\r\n * @extensions\r\n */\r\nexport interface Carto2DDegreesProps {\r\n /** Latitude value in degrees */\r\n latitude: number;\r\n /** Longitude value in degrees */\r\n longitude: number;\r\n}\r\n\r\n/** A 2D cartographic point in degrees\r\n * @public\r\n */\r\nexport class Carto2DDegrees implements Carto2DDegreesProps {\r\n /** Latitude value in degrees. Must be between -90 and +90 included */\r\n private _latitude!: number;\r\n /** Returns or sets the latitude in degrees. When setting the provided number must be between or equal from -90 to 90. */\r\n public get latitude() { return this._latitude; }\r\n public set latitude(newLatitude: number) {\r\n if ((newLatitude <= 90.0) && (newLatitude >= -90.0))\r\n this._latitude = newLatitude;\r\n }\r\n /** Longitude value in degrees */\r\n public longitude!: number;\r\n\r\n public constructor(data?: Carto2DDegreesProps) {\r\n this.latitude = 0.0; /* make sure latitude is init even if invalid latitude provided */\r\n if (data) {\r\n this.latitude = data.latitude;\r\n this.longitude = data.longitude;\r\n }\r\n }\r\n\r\n /** Creates a Carto2DDegrees object from JSON representation.\r\n * @public */\r\n public static fromJSON(data: Carto2DDegreesProps): Carto2DDegrees {\r\n return new Carto2DDegrees(data);\r\n }\r\n\r\n /** Creates a JSON from the Carto2DDegrees definition\r\n * @public */\r\n public toJSON(): Carto2DDegreesProps {\r\n return { latitude: this.latitude, longitude: this.longitude };\r\n }\r\n\r\n /** Compares two Carto2DDegrees object. It applies a minuscule tolerance to compares.\r\n * @public */\r\n public equals(other: Carto2DDegrees): boolean {\r\n return (Math.abs(this.latitude - other.latitude) < Geometry.smallAngleDegrees &&\r\n Math.abs(this.longitude - other.longitude) < Geometry.smallAngleDegrees);\r\n }\r\n}\r\n\r\n"]}
|