@itwin/core-common 5.0.0-dev.56 → 5.0.0-dev.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/AmbientOcclusion.js +17 -9
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js +20 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js +30 -10
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js +4 -0
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js +19 -0
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/BlobReader.js +8 -6
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/Camera.js +3 -0
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/ClipStyle.js +29 -3
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js +16 -0
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorDef.js +6 -5
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +5 -3
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js +53 -27
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js +37 -2
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +95 -63
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSqlReader.js +52 -49
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ElementProps.js +5 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EntityProps.js +31 -0
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/Environment.js +24 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js +15 -6
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js +82 -49
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js +5 -0
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js +2 -2
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GeometryParams.js +58 -0
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/Gradient.js +12 -9
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js +14 -12
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js +7 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js +6 -0
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js +6 -0
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js +23 -3
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js +10 -0
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js +44 -20
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js +2 -0
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js +4 -0
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/Image.js +10 -0
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/LightSettings.js +39 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js +3 -2
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js +33 -0
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js +6 -0
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js +4 -0
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js +8 -0
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js +23 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js +32 -24
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js +79 -2
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js +34 -17
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderSchedule.d.ts +1 -2
- package/lib/cjs/RenderSchedule.d.ts.map +1 -1
- package/lib/cjs/RenderSchedule.js +138 -11
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/RenderTexture.js +14 -0
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js +3 -0
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.d.ts.map +1 -1
- package/lib/cjs/RpcInterface.js +6 -0
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/SkyBox.js +15 -2
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarShadows.js +5 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js +19 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js +35 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js +15 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js +19 -0
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js +24 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js +53 -2
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Tween.js +28 -19
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/ViewDetails.js +9 -5
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js +84 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js +7 -2
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +10 -0
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +27 -6
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +49 -3
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js +12 -0
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js +17 -0
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js +4 -0
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js +23 -20
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js +62 -0
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +26 -8
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js +54 -108
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js +1 -0
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js +100 -0
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js +16 -0
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js +19 -6
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js +10 -0
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js +14 -0
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js +6 -0
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js +75 -0
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js +18 -0
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js +10 -0
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js +10 -7
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js +1 -0
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +7 -6
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +8 -7
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js +2 -2
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +4 -7
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +2 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +2 -2
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js +1 -4
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +25 -36
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +28 -30
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +17 -9
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js +28 -30
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js +17 -16
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js +30 -28
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js +13 -6
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js +10 -9
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +45 -23
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js +4 -2
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js +5 -10
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +7 -13
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +16 -19
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js +2 -0
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js +2 -2
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js +6 -6
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +12 -10
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +14 -0
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js +7 -0
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js +3 -0
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js +4 -3
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js +8 -0
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js +24 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js +5 -0
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js +2 -0
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +9 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js +17 -9
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js +20 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js +30 -10
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js +4 -0
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js +19 -0
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/BlobReader.js +8 -6
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/Camera.js +3 -0
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/ClipStyle.js +29 -3
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js +16 -0
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorDef.js +6 -5
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js +5 -3
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js +53 -27
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js +37 -2
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +95 -63
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSqlReader.js +52 -49
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ElementProps.js +5 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.js +31 -0
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Environment.js +24 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js +15 -6
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js +82 -49
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js +5 -0
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js +2 -2
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GeometryParams.js +58 -0
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/Gradient.js +12 -9
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js +14 -12
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js +7 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js +6 -0
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js +6 -0
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js +23 -3
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js +10 -0
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js +44 -20
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js +2 -0
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js +4 -0
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/Image.js +10 -0
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/LightSettings.js +39 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/MapImagerySettings.js +3 -2
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js +33 -0
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/ModelClipGroup.js +6 -0
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js +4 -0
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js +8 -0
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js +23 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js +32 -24
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js +79 -2
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js +34 -17
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderSchedule.d.ts +1 -2
- package/lib/esm/RenderSchedule.d.ts.map +1 -1
- package/lib/esm/RenderSchedule.js +138 -11
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/RenderTexture.js +14 -0
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js +3 -0
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.d.ts.map +1 -1
- package/lib/esm/RpcInterface.js +6 -0
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/SkyBox.js +15 -2
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarShadows.js +5 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js +19 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js +35 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js +15 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js +19 -0
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js +24 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ThematicDisplay.js +53 -2
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Tween.js +28 -19
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/ViewDetails.js +9 -5
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js +84 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js +7 -2
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +10 -0
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js +27 -6
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js +49 -3
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js +12 -0
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js +17 -0
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js +4 -0
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js +23 -20
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js +62 -0
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +26 -8
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js +54 -108
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js +1 -0
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js +100 -0
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js +16 -0
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js +19 -6
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js +10 -0
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js +14 -0
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js +6 -0
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js +75 -0
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js +18 -0
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js +10 -0
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js +10 -7
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js +1 -0
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +7 -6
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +8 -7
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js +2 -2
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +4 -7
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +2 -2
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +2 -2
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js +1 -4
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +25 -36
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +28 -30
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +17 -9
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js +28 -30
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js +17 -16
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js +30 -28
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js +13 -6
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js +10 -9
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +45 -23
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js +4 -2
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js +5 -10
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js +7 -13
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +16 -19
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js +2 -0
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js +2 -2
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js +6 -6
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +12 -10
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +14 -0
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js +7 -0
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js +3 -0
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js +4 -3
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js +8 -0
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js +24 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js +5 -0
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js +2 -0
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js +9 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureTable.js","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAC7B,qDAAiD;AACjD,sEAAmE;AAEnE;;;;;;;;GAQG;AACH,MAAa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E,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,2EAA2E;IACpE,QAAQ,KAA2C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE/E,oHAAoH;IAC7G,IAAI;QACT,OAAO,uCAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AAnDD,oCAmDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport {\n assert, compareNumbers, compareStrings, Id64, Id64String, IndexedValue, IndexMap, UintArray,\n} from \"@itwin/core-bentley\";\nimport { GeometryClass } from \"./GeometryParams\";\nimport { PackedFeatureTable } from \"./internal/PackedFeatureTable\";\n\n/** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be\n * grouped with other such entities in a [[FeatureTable]].\n * Features roughly correlate to elements: a [Tile]($frontend)'s graphics combines geometry from every\n * [GeometricElement]($backend) that intersects the tile's volume, so each element produces at least one feature.\n * However, an element's geometry stream can contain geometry belonging to multiple different combinations of [SubCategory]($backend) and\n * [[GeometryClass]], so an individual element may produce more than one feature.\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\n * @public\n */\nexport class Feature {\n public readonly elementId: Id64String;\n public readonly subCategoryId: Id64String;\n public readonly geometryClass: GeometryClass;\n\n public constructor(elementId: Id64String = Id64.invalid, subCategoryId: Id64String = Id64.invalid, geometryClass: GeometryClass = GeometryClass.Primary) {\n this.elementId = elementId;\n this.subCategoryId = subCategoryId;\n this.geometryClass = geometryClass;\n }\n\n public get isDefined(): boolean { return !Id64.isInvalid(this.elementId) || !Id64.isInvalid(this.subCategoryId) || this.geometryClass !== GeometryClass.Primary; }\n public get isUndefined(): boolean { return !this.isDefined; }\n\n /** Returns true if this feature is equivalent to the supplied feature. */\n public equals(other: Feature): boolean { return 0 === this.compare(other); }\n\n /** Performs ordinal comparison of this feature with another.\n * @param rhs The feature to compare with.\n * @returns zero if the features are equivalent, a negative value if this feature compares as \"less than\" `rhs`, or a positive value if this feature compares \"greater than\" `rhs`.\n */\n public compare(rhs: Feature): number {\n if (this === rhs)\n return 0;\n\n let cmp = compareNumbers(this.geometryClass, rhs.geometryClass);\n if (0 === cmp) {\n cmp = compareStrings(this.elementId, rhs.elementId);\n if (0 === cmp) {\n cmp = compareStrings(this.subCategoryId, rhs.subCategoryId);\n }\n }\n\n return cmp;\n }\n}\n\n/** A [[Feature]] with a modelId identifying the model containing the feature, obtained from a [[RenderFeatureTable]].\n * @public\n */\nexport interface ModelFeature {\n modelId: Id64String;\n elementId: Id64String;\n subCategoryId: Id64String;\n geometryClass: GeometryClass;\n}\n\n/** @public */\nexport namespace ModelFeature {\n /** Create a ModelFeature of [[GeometryClass.Primary]] with all invalid Ids.\n * This is primarily useful for creating a `result` argument for [[RenderFeatureTable.findFeature]] and [[RenderFeatureTable.getFeature]].\n */\n export function create(): ModelFeature {\n return {\n modelId: Id64.invalid,\n elementId: Id64.invalid,\n subCategoryId: Id64.invalid,\n geometryClass: GeometryClass.Primary,\n };\n }\n\n /** Returns `true` if any of `feature`'s properties differ from the defaults (invalid Ids and [[GeometryClass.Primary]]). */\n export function isDefined(feature: ModelFeature): boolean {\n return !Id64.isInvalid(feature.modelId) || !Id64.isInvalid(feature.elementId) || !Id64.isInvalid(feature.subCategoryId) || feature.geometryClass !== GeometryClass.Primary;\n }\n\n /** @alpha */\n export function unpack(packed: PackedFeature, result: ModelFeature, unpackedModelId?: Id64String): ModelFeature {\n result.modelId = unpackedModelId ?? Id64.fromUint32PairObject(packed.modelId);\n result.elementId = Id64.fromUint32PairObject(packed.elementId);\n result.subCategoryId = Id64.fromUint32PairObject(packed.subCategoryId);\n result.geometryClass = packed.geometryClass;\n return result;\n }\n}\n\n/** Represents a [[Feature]] within a [[RenderFeatureTable]]. This representation is optimized for use on the GPU.\n * @public\n */\nexport interface PackedFeature {\n modelId: Id64.Uint32Pair;\n elementId: Id64.Uint32Pair;\n subCategoryId: Id64.Uint32Pair;\n geometryClass: GeometryClass;\n /** @alpha */\n animationNodeId: number;\n}\n\n/** Represents a [[PackedFeature]] obtained from a [[RenderFeatureTable]], including the index of that feature within the table.\n * @public\n */\nexport interface PackedFeatureWithIndex extends PackedFeature {\n index: number;\n}\n\n/** @public */\nexport namespace PackedFeature {\n /** Create a PackedFeature of [[GeometryClass.Primary]] with all invalid Ids.\n * This is primarily useful for creating a `result` argument for [[RenderFeatureTable.getPackedFeature]].\n */\n export function create(): PackedFeature {\n const pair = { upper: 0, lower: 0 };\n return {\n modelId: { ...pair },\n elementId: { ...pair },\n subCategoryId: { ...pair },\n geometryClass: GeometryClass.Primary,\n animationNodeId: 0,\n };\n }\n\n /** Create a PackedFeatureWithIndex of [[GeometryClass.Primary]] with all invalid Ids and an index of zero.\n * This is primarily useful for creating a reusable `output` argument for [[RenderFeatureTable.iterable]].\n */\n export function createWithIndex(): PackedFeatureWithIndex {\n const result = create() as PackedFeatureWithIndex;\n result.index = 0;\n return result;\n }\n}\n\n/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.\n * The most commonly-encountered batches are Tiles, which can be of either Primary or\n * Classifier type.\n * @public\n * @extensions\n */\nexport enum BatchType {\n /** This batch contains graphics derived from a model's visible geometry. */\n Primary,\n /**\n * This batch contains color volumes which are used to classify a model's visible geometry.\n * The graphics themselves are not rendered to the screen; instead they are rendered to the stencil buffer\n * to resymbolize the primary geometry.\n */\n VolumeClassifier,\n /**\n * This batch contains planar graphics which are used to classify a model's visible geometry.\n * The graphics themselves are not rendered to the screen; instead they are rendered to a texture buffer\n * to resymbolize the primary geometry.\n */\n PlanarClassifier,\n}\n\n/** Defines a look-up table for [[Feature]]s within a batched [RenderGraphic]($frontend). Consecutive 32-bit\n * indices are assigned to each unique Feature. Primitives within the RenderGraphic can\n * use per-vertex indices to specify the distribution of Features within the primitive. The appearance of individual\n * features can be customized using [[FeatureOverrides]]. Typically a [Tile]($frontend) will contain a feature table\n * identifying the elements whose geometry appears within that tile.\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\n * @public\n */\nexport class FeatureTable extends IndexMap<Feature> {\n public readonly modelId: Id64String;\n public readonly type: BatchType;\n\n /** Construct an empty FeatureTable. */\n public constructor(maxFeatures: number, modelId: Id64String = Id64.invalid, type: BatchType = BatchType.Primary) {\n super((lhs, rhs) => lhs.compare(rhs), maxFeatures);\n this.modelId = modelId;\n this.type = type;\n }\n\n /** Returns the maximum number of [[Feature]]s this FeatureTable can contain. */\n public get maxFeatures(): number { return this._maximumSize; }\n /** Returns true if this table contains at least one [[Feature]] with a valid element and/or subcategory Id. */\n public get anyDefined(): boolean { return this.length > 1 || (1 === this.length && this._array[0].value.isDefined); }\n /** Returns true if this FeatureTable contains exactly one [[Feature]]. */\n public get isUniform(): boolean { return 1 === this.length; }\n /** If this FeatureTable contains exactly one [[Feature]], returns that Feature; otherwise returns undefined. */\n public get uniform(): Feature | undefined { return 1 === this.length ? this._array[0].value : undefined; }\n /** Returns true if this FeatureTable is associated with [[BatchType.VolumeClassifier]] geometry. */\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n /** Returns true if this FeatureTable is associated with [[BatchType.PlanarClassifier]] geometry. */\n public get isPlanarClassifier(): boolean { return BatchType.PlanarClassifier === this.type; }\n\n /** Returns the Feature corresponding to the specified index, or undefined if the index is not present. */\n public findFeature(index: number): Feature | undefined {\n for (const entry of this._array)\n if (entry.index === index)\n return entry.value;\n\n return undefined;\n }\n\n /** Inserts the specified [[Feature]] at the specified index. This is really only useful when reconstructing a previously-create feature table\n * for which you know the index assigned to each feature.\n */\n public insertWithIndex(feature: Feature, index: number): void {\n const bound = this.lowerBound(feature);\n assert(!bound.equal);\n assert(!this.isFull);\n const entry = new IndexedValue<Feature>(feature, index);\n this._array.splice(bound.index, 0, entry);\n }\n\n /** Access the underlying array containing the table's current contents. */\n public getArray(): ReadonlyArray<IndexedValue<Feature>> { return this._array; }\n\n /** Convert this feature table to a representation that can be supplied to [RenderSystem.createBatch]($frontend). */\n public pack(): RenderFeatureTable {\n return PackedFeatureTable.pack(this);\n }\n}\n\n/** @alpha */\nexport type ComputeNodeId = (feature: PackedFeatureWithIndex) => number;\n\n/** Representation of a [[FeatureTable]] suitable for use with [RenderSystem.createBatch]($frontend).\n * The [[Feature]]s are represented as [[PackedFeature]]s. The feature table may contain features from multiple [Model]($backend)s.\n * @see [[FeatureTable.pack]] to produce a RenderFeatureTable.\n * @public\n */\nexport interface RenderFeatureTable {\n /** The \"model Id\" of the tile tree containing the tile from which this feature table originated.\n * It may be a transient Id if, for example, the tile tree represents a reality model or represents the geometry of multiple\n * persistent models batched together.\n */\n readonly batchModelId: Id64String;\n /** A split representation of [[batchModelId]], to avoid having to constantly having to parse the string. */\n readonly batchModelIdPair: Id64.Uint32Pair;\n /** The number of features in the table; equivalently, one more than the largest feature index. */\n readonly numFeatures: number;\n /** The number of bytes consumed by the feature table, strictly for diagnostic purposes. */\n readonly byteLength: number;\n readonly type: BatchType;\n /** @alpha */\n animationNodeIds?: UintArray;\n\n /** Get the feature at the specified index. The caller is responsible for validating featureIndex less than numFeatures. */\n getFeature(featureIndex: number, result: ModelFeature): ModelFeature;\n\n /** Find the feature at the specified index. Returns undefined if featureIndex >= [[numFeatures]]. */\n findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;\n\n /** Find the Id of the element associated with the feature at the specified index. */\n findElementId(featureIndex: number): Id64String | undefined;\n\n /** Get the Id of the element associated with the feature at the specified index as a pair of 32-bit integers.\n * The caller is responsible for validating that `featureIndex` is less than [[numFeatures]].\n */\n getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\n\n /** Get the feature at the specified index. The caller is responsible for validating featureIndex less than numFeatures. */\n getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;\n\n /** Get an object that provides ordered iteration over all features.\n * @note The `output` object is reused (mutated in place) as the current value on each iteration.\n */\n iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;\n\n /** @alpha */\n populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;\n\n /** @alpha */\n getAnimationNodeId(featureIndex: number): number;\n\n /** Get the Id of the model associated with the feature at the specified index.\n * The caller is responsible for validating that `featureIndex` is less than [[numFeatures]].\n * This is more efficient than [[getFeature]] for callers who are only interested in the model Id.\n */\n getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FeatureTable.js","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAC7B,qDAAiD;AACjD,sEAAmE;AAEnE;;;;;;;;GAQG;AACH,MAAa,OAAO;IACF,SAAS,CAAa;IACtB,aAAa,CAAa;IAC1B,aAAa,CAAgB;IAE7C,YAAmB,YAAwB,mBAAI,CAAC,OAAO,EAAE,gBAA4B,mBAAI,CAAC,OAAO,EAAE,gBAA+B,8BAAa,CAAC,OAAO;QACrJ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,IAAW,SAAS,KAAc,OAAO,CAAC,mBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,aAAa,KAAK,8BAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAClK,IAAW,WAAW,KAAc,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAE7D,0EAA0E;IACnE,MAAM,CAAC,KAAc,IAAa,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC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S,CAAC,gBAAgB,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7F,0GAA0G;IACnG,WAAW,CAAC,KAAa;QAC9B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM;YAC7B,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK;gBACvB,OAAO,KAAK,CAAC,KAAK,CAAC;QAEvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,OAAgB,EAAE,KAAa;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACvC,IAAA,qBAAM,EAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,IAAA,qBAAM,EAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,2BAAY,CAAU,OAAO,EAAE,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,2EAA2E;IACpE,QAAQ,KAA2C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE/E,oHAAoH;IAC7G,IAAI;QACT,OAAO,uCAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AAnDD,oCAmDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport {\n assert, compareNumbers, compareStrings, Id64, Id64String, IndexedValue, IndexMap, UintArray,\n} from \"@itwin/core-bentley\";\nimport { GeometryClass } from \"./GeometryParams\";\nimport { PackedFeatureTable } from \"./internal/PackedFeatureTable\";\n\n/** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be\n * grouped with other such entities in a [[FeatureTable]].\n * Features roughly correlate to elements: a [Tile]($frontend)'s graphics combines geometry from every\n * [GeometricElement]($backend) that intersects the tile's volume, so each element produces at least one feature.\n * However, an element's geometry stream can contain geometry belonging to multiple different combinations of [SubCategory]($backend) and\n * [[GeometryClass]], so an individual element may produce more than one feature.\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\n * @public\n */\nexport class Feature {\n public readonly elementId: Id64String;\n public readonly subCategoryId: Id64String;\n public readonly geometryClass: GeometryClass;\n\n public constructor(elementId: Id64String = Id64.invalid, subCategoryId: Id64String = Id64.invalid, geometryClass: GeometryClass = GeometryClass.Primary) {\n this.elementId = elementId;\n this.subCategoryId = subCategoryId;\n this.geometryClass = geometryClass;\n }\n\n public get isDefined(): boolean { return !Id64.isInvalid(this.elementId) || !Id64.isInvalid(this.subCategoryId) || this.geometryClass !== GeometryClass.Primary; }\n public get isUndefined(): boolean { return !this.isDefined; }\n\n /** Returns true if this feature is equivalent to the supplied feature. */\n public equals(other: Feature): boolean { return 0 === this.compare(other); }\n\n /** Performs ordinal comparison of this feature with another.\n * @param rhs The feature to compare with.\n * @returns zero if the features are equivalent, a negative value if this feature compares as \"less than\" `rhs`, or a positive value if this feature compares \"greater than\" `rhs`.\n */\n public compare(rhs: Feature): number {\n if (this === rhs)\n return 0;\n\n let cmp = compareNumbers(this.geometryClass, rhs.geometryClass);\n if (0 === cmp) {\n cmp = compareStrings(this.elementId, rhs.elementId);\n if (0 === cmp) {\n cmp = compareStrings(this.subCategoryId, rhs.subCategoryId);\n }\n }\n\n return cmp;\n }\n}\n\n/** A [[Feature]] with a modelId identifying the model containing the feature, obtained from a [[RenderFeatureTable]].\n * @public\n */\nexport interface ModelFeature {\n modelId: Id64String;\n elementId: Id64String;\n subCategoryId: Id64String;\n geometryClass: GeometryClass;\n}\n\n/** @public */\nexport namespace ModelFeature {\n /** Create a ModelFeature of [[GeometryClass.Primary]] with all invalid Ids.\n * This is primarily useful for creating a `result` argument for [[RenderFeatureTable.findFeature]] and [[RenderFeatureTable.getFeature]].\n */\n export function create(): ModelFeature {\n return {\n modelId: Id64.invalid,\n elementId: Id64.invalid,\n subCategoryId: Id64.invalid,\n geometryClass: GeometryClass.Primary,\n };\n }\n\n /** Returns `true` if any of `feature`'s properties differ from the defaults (invalid Ids and [[GeometryClass.Primary]]). */\n export function isDefined(feature: ModelFeature): boolean {\n return !Id64.isInvalid(feature.modelId) || !Id64.isInvalid(feature.elementId) || !Id64.isInvalid(feature.subCategoryId) || feature.geometryClass !== GeometryClass.Primary;\n }\n\n /** @alpha */\n export function unpack(packed: PackedFeature, result: ModelFeature, unpackedModelId?: Id64String): ModelFeature {\n result.modelId = unpackedModelId ?? Id64.fromUint32PairObject(packed.modelId);\n result.elementId = Id64.fromUint32PairObject(packed.elementId);\n result.subCategoryId = Id64.fromUint32PairObject(packed.subCategoryId);\n result.geometryClass = packed.geometryClass;\n return result;\n }\n}\n\n/** Represents a [[Feature]] within a [[RenderFeatureTable]]. This representation is optimized for use on the GPU.\n * @public\n */\nexport interface PackedFeature {\n modelId: Id64.Uint32Pair;\n elementId: Id64.Uint32Pair;\n subCategoryId: Id64.Uint32Pair;\n geometryClass: GeometryClass;\n /** @alpha */\n animationNodeId: number;\n}\n\n/** Represents a [[PackedFeature]] obtained from a [[RenderFeatureTable]], including the index of that feature within the table.\n * @public\n */\nexport interface PackedFeatureWithIndex extends PackedFeature {\n index: number;\n}\n\n/** @public */\nexport namespace PackedFeature {\n /** Create a PackedFeature of [[GeometryClass.Primary]] with all invalid Ids.\n * This is primarily useful for creating a `result` argument for [[RenderFeatureTable.getPackedFeature]].\n */\n export function create(): PackedFeature {\n const pair = { upper: 0, lower: 0 };\n return {\n modelId: { ...pair },\n elementId: { ...pair },\n subCategoryId: { ...pair },\n geometryClass: GeometryClass.Primary,\n animationNodeId: 0,\n };\n }\n\n /** Create a PackedFeatureWithIndex of [[GeometryClass.Primary]] with all invalid Ids and an index of zero.\n * This is primarily useful for creating a reusable `output` argument for [[RenderFeatureTable.iterable]].\n */\n export function createWithIndex(): PackedFeatureWithIndex {\n const result = create() as PackedFeatureWithIndex;\n result.index = 0;\n return result;\n }\n}\n\n/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.\n * The most commonly-encountered batches are Tiles, which can be of either Primary or\n * Classifier type.\n * @public\n * @extensions\n */\nexport enum BatchType {\n /** This batch contains graphics derived from a model's visible geometry. */\n Primary,\n /**\n * This batch contains color volumes which are used to classify a model's visible geometry.\n * The graphics themselves are not rendered to the screen; instead they are rendered to the stencil buffer\n * to resymbolize the primary geometry.\n */\n VolumeClassifier,\n /**\n * This batch contains planar graphics which are used to classify a model's visible geometry.\n * The graphics themselves are not rendered to the screen; instead they are rendered to a texture buffer\n * to resymbolize the primary geometry.\n */\n PlanarClassifier,\n}\n\n/** Defines a look-up table for [[Feature]]s within a batched [RenderGraphic]($frontend). Consecutive 32-bit\n * indices are assigned to each unique Feature. Primitives within the RenderGraphic can\n * use per-vertex indices to specify the distribution of Features within the primitive. The appearance of individual\n * features can be customized using [[FeatureOverrides]]. Typically a [Tile]($frontend) will contain a feature table\n * identifying the elements whose geometry appears within that tile.\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\n * @public\n */\nexport class FeatureTable extends IndexMap<Feature> {\n public readonly modelId: Id64String;\n public readonly type: BatchType;\n\n /** Construct an empty FeatureTable. */\n public constructor(maxFeatures: number, modelId: Id64String = Id64.invalid, type: BatchType = BatchType.Primary) {\n super((lhs, rhs) => lhs.compare(rhs), maxFeatures);\n this.modelId = modelId;\n this.type = type;\n }\n\n /** Returns the maximum number of [[Feature]]s this FeatureTable can contain. */\n public get maxFeatures(): number { return this._maximumSize; }\n /** Returns true if this table contains at least one [[Feature]] with a valid element and/or subcategory Id. */\n public get anyDefined(): boolean { return this.length > 1 || (1 === this.length && this._array[0].value.isDefined); }\n /** Returns true if this FeatureTable contains exactly one [[Feature]]. */\n public get isUniform(): boolean { return 1 === this.length; }\n /** If this FeatureTable contains exactly one [[Feature]], returns that Feature; otherwise returns undefined. */\n public get uniform(): Feature | undefined { return 1 === this.length ? this._array[0].value : undefined; }\n /** Returns true if this FeatureTable is associated with [[BatchType.VolumeClassifier]] geometry. */\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n /** Returns true if this FeatureTable is associated with [[BatchType.PlanarClassifier]] geometry. */\n public get isPlanarClassifier(): boolean { return BatchType.PlanarClassifier === this.type; }\n\n /** Returns the Feature corresponding to the specified index, or undefined if the index is not present. */\n public findFeature(index: number): Feature | undefined {\n for (const entry of this._array)\n if (entry.index === index)\n return entry.value;\n\n return undefined;\n }\n\n /** Inserts the specified [[Feature]] at the specified index. This is really only useful when reconstructing a previously-create feature table\n * for which you know the index assigned to each feature.\n */\n public insertWithIndex(feature: Feature, index: number): void {\n const bound = this.lowerBound(feature);\n assert(!bound.equal);\n assert(!this.isFull);\n const entry = new IndexedValue<Feature>(feature, index);\n this._array.splice(bound.index, 0, entry);\n }\n\n /** Access the underlying array containing the table's current contents. */\n public getArray(): ReadonlyArray<IndexedValue<Feature>> { return this._array; }\n\n /** Convert this feature table to a representation that can be supplied to [RenderSystem.createBatch]($frontend). */\n public pack(): RenderFeatureTable {\n return PackedFeatureTable.pack(this);\n }\n}\n\n/** @alpha */\nexport type ComputeNodeId = (feature: PackedFeatureWithIndex) => number;\n\n/** Representation of a [[FeatureTable]] suitable for use with [RenderSystem.createBatch]($frontend).\n * The [[Feature]]s are represented as [[PackedFeature]]s. The feature table may contain features from multiple [Model]($backend)s.\n * @see [[FeatureTable.pack]] to produce a RenderFeatureTable.\n * @public\n */\nexport interface RenderFeatureTable {\n /** The \"model Id\" of the tile tree containing the tile from which this feature table originated.\n * It may be a transient Id if, for example, the tile tree represents a reality model or represents the geometry of multiple\n * persistent models batched together.\n */\n readonly batchModelId: Id64String;\n /** A split representation of [[batchModelId]], to avoid having to constantly having to parse the string. */\n readonly batchModelIdPair: Id64.Uint32Pair;\n /** The number of features in the table; equivalently, one more than the largest feature index. */\n readonly numFeatures: number;\n /** The number of bytes consumed by the feature table, strictly for diagnostic purposes. */\n readonly byteLength: number;\n readonly type: BatchType;\n /** @alpha */\n animationNodeIds?: UintArray;\n\n /** Get the feature at the specified index. The caller is responsible for validating featureIndex less than numFeatures. */\n getFeature(featureIndex: number, result: ModelFeature): ModelFeature;\n\n /** Find the feature at the specified index. Returns undefined if featureIndex >= [[numFeatures]]. */\n findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;\n\n /** Find the Id of the element associated with the feature at the specified index. */\n findElementId(featureIndex: number): Id64String | undefined;\n\n /** Get the Id of the element associated with the feature at the specified index as a pair of 32-bit integers.\n * The caller is responsible for validating that `featureIndex` is less than [[numFeatures]].\n */\n getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\n\n /** Get the feature at the specified index. The caller is responsible for validating featureIndex less than numFeatures. */\n getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;\n\n /** Get an object that provides ordered iteration over all features.\n * @note The `output` object is reused (mutated in place) as the current value on each iteration.\n */\n iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;\n\n /** @alpha */\n populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;\n\n /** @alpha */\n getAnimationNodeId(featureIndex: number): number;\n\n /** Get the Id of the model associated with the feature at the specified index.\n * The caller is responsible for validating that `featureIndex` is less than [[numFeatures]].\n * This is more efficient than [[getFeature]] for callers who are only interested in the model Id.\n */\n getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\n}\n"]}
|
package/lib/cjs/Fonts.js
CHANGED
package/lib/cjs/Fonts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fonts.js","sourceRoot":"","sources":["../../src/Fonts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;GAIG;AACH,IAAY,QAkBX;AAlBD,WAAY,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AAG,CAAC,CAAC;QAE7B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACpC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,WAAW,EAAE;gBAC/C,OAAO,IAAI,CAAC;QAEhB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAzBD,0BAyBC","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\n/** The [FontFile]($backend) encodings understood by iTwin.js.\n * @see [this article]($docs/learning/backend/Fonts.md) to learn more about fonts in iModels.\n * @public\n * @extensions\n */\nexport enum FontType {\n /** [OpenType](https://en.wikipedia.org/wiki/OpenType) format, derived from and compatible with the earlier [TrueType](https://en.wikipedia.org/wiki/TrueType) format.\n * The vast majority of modern, scalable, aesthetically-pleasing fonts are delivered in this format.\n * OpenType files typically use one of the following suffixes: .ttf, .ttc, .otf, and .otc.\n * @see [FontFile.createFromTrueTypeFileName]($backend) to work with font files in this format.\n */\n TrueType = 1,\n /** [RSC](https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v27/en/GUID-FC78484C-E42F-30BF-BF68-2B2C025AE040.html) is a simple font format\n * originating in [MicroStation](https://en.wikipedia.org/wiki/MicroStation). In MicroStation, they are defined in \"resource files\" with a \".rsc\" suffix.\n * In iModels, they are encoded in a binary format. Currently, no APIs exist to convert to this binary format, but some [connectors]($docs/learning/imodel-connectors.md) can\n * perform the conversion.\n */\n Rsc = 2,\n /** [SHX](https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-DE941DB5-7044-433C-AA68-2A9AE98A5713) is a simple font format originating in\n * [AutoCAD](https://en.wikipedia.org/wiki/AutoCAD). SHX fonts are generally distributed as files with a \".shx\" suffix.\n * @see [FontFile.createFromShxFontBlob]($backend) to work with font files in this format.\n */\n Shx = 3,\n}\n\n/** An unsigned integer uniquely identifying a [font family]($docs/learning/backend/Fonts.md) in the context of an [[IModel]].\n * The iModel stores a mapping between `FontId`s and [[FontFamilyDescriptor]]s.\n * [[TextString]]s refer to fonts by the their `FontId`s.\n * A font Id of zero represents an invalid/non-existent font.\n * @see [IModelDbFonts]($backend) to work with font Ids.\n * @public\n * @extensions\n */\nexport type FontId = number;\n\n/** Uniquely describes one or more [[FontFace]]s sharing the same name and type comprising a single [font family]($docs/learning/backend/Fonts.md).\n * @public\n */\nexport interface FontFamilyDescriptor {\n /** The encoding in which the font family's faces are stored. */\n type: FontType;\n /** The name of the family. */\n name: string;\n}\n\n/** A [[FontFamilyDescriptor]] in which the [[FontType]] is optional, used when querying [[FontId]]s via [IModelDbFonts.findId]($backend).\n * If a font type is provided, this selector exactly identifies a unique font family, just like [[FontFamilyDescriptor]] does.\n * If the type is omitted, then the selector refers to the first font family that matches the specified [[name]]. If multiple families\n * with the same name exist, then a TrueType font will be preferred over a RSC font, and a RSC font preferred over an SHX font.\n * @beta\n */\nexport interface FontFamilySelector {\n /** The encoding in which the font family's faces are stored. */\n type?: FontType;\n /** The name of the family. */\n name: string;\n}\n\n/** Represents a [[FontFamilyDescriptor]] stored in an iModel with a unique numeric Id.\n * @public\n */\nexport interface FontProps extends FontFamilyDescriptor {\n /** An integer that uniquely identifies this font family in the context of the iModel in which it is stored. */\n id: FontId;\n}\n\n/** A specific variation of the glyphs defined by a [font family]($docs/learning/backend/Fonts.md).\n * Each face can be italicized, bolded, both, or neither.\n * Font faces are stored in [FontFile]($backend)s.\n * @beta\n */\nexport interface FontFace {\n /** The name of the font family to which this face belongs. */\n familyName: string;\n isBold: boolean;\n isItalic: boolean;\n}\n\n/** Information about the encoding of a [[FontType.Rsc]] [FontFile]($backend), used when embedding such a font into an iModel.\n * Currently, no public APIs exist to create such fonts.\n * @alpha\n */\nexport interface RscFontEncodingProps {\n codePage?: number;\n degree?: number;\n plusMinus?: number;\n diameter?: number;\n}\n\n/** The properties of a FontMap\n * @public\n * @extensions\n * @deprecated in 5.0.0. Use [IModelDb.fonts]($backend)\n */\nexport interface FontMapProps { fonts: FontProps[] }\n\n/**\n * A FontMap holds the set of font names available in an iModel.\n * Within the GeometryStream of an Element, a specific font is referenced by its FontId that is local to the iModel.\n * This class maps FontIds to FontProps.\n * @note This API has never worked properly. Don't use it. Use [IModelDb.fonts]($backend) instead.\n * @public\n * @deprecated in 5.0.0. Use [IModelDb.fonts]($backend) instead.\n */\nexport class FontMap {\n public readonly fonts = new Map<FontId, FontProps>();\n constructor(props?: FontMapProps) { // eslint-disable-line @typescript-eslint/no-deprecated\n if (undefined !== props)\n this.addFonts(props.fonts);\n }\n public addFonts(fonts: FontProps[]) {\n fonts.forEach((font) => this.fonts.set(font.id, font));\n }\n public toJSON(): FontMapProps { // eslint-disable-line @typescript-eslint/no-deprecated\n const fonts: FontProps[] = [];\n this.fonts.forEach((font) => fonts.push(font));\n return { fonts };\n }\n /** look up a font by case insensitive name or number and return its FontProps */\n public getFont(arg: string | FontId): FontProps | undefined {\n if (typeof arg === \"number\")\n return this.fonts.get(arg);\n\n for (const font of this.fonts.values())\n if (font.name.toLowerCase() === arg.toLowerCase())\n return font;\n\n return undefined;\n }\n}\n"]}
|
package/lib/cjs/Frustum.js
CHANGED
|
@@ -69,10 +69,10 @@ Object.freeze(exports.NpcCenter);
|
|
|
69
69
|
* @public
|
|
70
70
|
*/
|
|
71
71
|
class Frustum {
|
|
72
|
+
/** Array of the 8 points of this Frustum. */
|
|
73
|
+
points = [];
|
|
72
74
|
/** Constructor for Frustum. Members are initialized to the Npc cube. */
|
|
73
75
|
constructor() {
|
|
74
|
-
/** Array of the 8 points of this Frustum. */
|
|
75
|
-
this.points = [];
|
|
76
76
|
for (let i = 0; i < 8; ++i)
|
|
77
77
|
this.points[i] = exports.NpcCorners[i].clone();
|
|
78
78
|
}
|
package/lib/cjs/Frustum.js.map
CHANGED
|
@@ -1 +1 @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B,EAAE,CAAC;QACzC,SAAS,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAEzD,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;IACxE,CAAC;CACF;AA/PD,0BA+PC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport {\n AxisOrder, ClipPlane, ConvexClipPlaneSet, Geometry, GrowableXYZArray, LowAndHighXY, LowAndHighXYZ, Map4d, Matrix3d, Plane3dByOriginAndUnitNormal, Point3d, Range3d, Transform, Vector3d, XYAndZ,\n} from \"@itwin/core-geometry\";\n\n/** The 8 corners of the [Normalized Plane Coordinate]($docs/learning/glossary.md#npc) cube.\n * @public\n * @extensions\n */\nexport enum Npc {\n /** Left bottom rear */\n _000 = 0,\n /** Right bottom rear */\n _100 = 1,\n /** Left top rear */\n _010 = 2,\n /** Right top rear */\n _110 = 3,\n /** Left bottom front */\n _001 = 4,\n /** Right bottom front */\n _101 = 5,\n /** Left top front */\n _011 = 6,\n /** Right top front */\n _111 = 7,\n\n /* eslint-disable @typescript-eslint/no-duplicate-enum-values */\n LeftBottomRear = 0,\n RightBottomRear = 1,\n LeftTopRear = 2,\n RightTopRear = 3,\n LeftBottomFront = 4,\n RightBottomFront = 5,\n LeftTopFront = 6,\n RightTopFront = 7,\n /* eslint-enable @typescript-eslint/no-duplicate-enum-values */\n /** useful for sizing arrays */\n CORNER_COUNT = 8,\n}\n\n/** The 8 corners of an [[Npc]] Frustum.\n * @public\n */\nexport const NpcCorners = [ // eslint-disable-line @typescript-eslint/naming-convention\n new Point3d(0.0, 0.0, 0.0),\n new Point3d(1.0, 0.0, 0.0),\n new Point3d(0.0, 1.0, 0.0),\n new Point3d(1.0, 1.0, 0.0),\n new Point3d(0.0, 0.0, 1.0),\n new Point3d(1.0, 0.0, 1.0),\n new Point3d(0.0, 1.0, 1.0),\n new Point3d(1.0, 1.0, 1.0),\n];\nNpcCorners.forEach((corner) => Object.freeze(corner));\nObject.freeze(NpcCorners);\n\n/** The center point of the [Normalized Plane Coordinate]($docs/learning/glossary.md#npc) cube.\n * @public\n */\nexport const NpcCenter = new Point3d(.5, .5, .5); // eslint-disable-line @typescript-eslint/naming-convention\nObject.freeze(NpcCenter);\n\n/** The region of physical (3d) space that appears in a view. It forms the field-of-view of a camera.\n * It is stored as 8 points, in [[Npc]] order, that must define a truncated pyramid.\n * @public\n */\nexport class Frustum {\n /** Array of the 8 points of this Frustum. */\n public readonly points: Point3d[] = [];\n /** Constructor for Frustum. Members are initialized to the Npc cube. */\n public constructor() {\n for (let i = 0; i < 8; ++i)\n this.points[i] = NpcCorners[i].clone();\n }\n\n /** Initialize this Frustum to the 8 corners of the NPC cube. */\n public initNpc() {\n for (let i = 0; i < 8; ++i)\n Point3d.createFrom(NpcCorners[i], this.points[i]);\n\n return this;\n }\n\n /** Get a corner Point from this Frustum. */\n public getCorner(i: number) { return this.points[i]; }\n /** Get the point at the center of this Frustum (halfway between RightTopFront and LeftBottomRear. */\n public getCenter(): Point3d {\n return this.getCorner(Npc.RightTopFront).interpolate(0.5, this.getCorner(Npc.LeftBottomRear));\n }\n\n /** Get the distance between two corners of this Frustum. */\n public distance(corner1: number, corner2: number): number {\n return this.getCorner(corner1).distance(this.getCorner(corner2));\n }\n\n /** Get the ratio of the length of the diagonal of the front plane to the diagonal of the back plane. */\n public getFraction(): number {\n return Geometry.safeDivideFraction(this.distance(Npc.LeftTopFront, Npc.RightBottomFront), this.distance(Npc.LeftTopRear, Npc.RightBottomRear), 0);\n }\n\n /** Multiply all the points of this Frustum by a Transform, in place. */\n public multiply(trans: Transform): void {\n trans.multiplyPoint3dArrayInPlace(this.points);\n }\n\n /** Offset all of the points of this Frustum by a vector. */\n public translate(offset: XYAndZ): void {\n for (const pt of this.points)\n pt.plus(offset, pt);\n }\n\n /** Transform all the points of this Frustum and return the result in another Frustum. */\n public transformBy(trans: Transform, result?: Frustum): Frustum {\n result = result ? result : new Frustum();\n trans.multiplyPoint3dArray(this.points, result.points);\n return result;\n }\n\n /** Calculate a bounding range from the 8 points in this Frustum. */\n public toRange(range?: Range3d): Range3d {\n return Range3d.createArray(this.points, range);\n }\n\n /** Make a copy of this Frustum.\n * @param result Optional Frustum for copy. If undefined allocate a new Frustum.\n */\n public clone(result?: Frustum): Frustum {\n result = result ? result : new Frustum();\n result.setFrom(this);\n return result;\n }\n\n /** Set the points of this Frustum to be copies of the points in another Frustum. */\n public setFrom(other: Frustum) { this.setFromCorners(other.points); }\n /** Set the points of this frustum from array of corner points in NPC order. */\n public setFromCorners(corners: Point3d[]) {\n for (let i = 0; i < 8; ++i)\n this.points[i].setFrom(corners[i]);\n }\n\n /** Scale this Frustum, in place, about its center by a scale factor. */\n public scaleAboutCenter(scale: number): void {\n const orig = this.clone();\n const f = 0.5 * (1.0 + scale);\n orig.points[Npc._111].interpolate(f, orig.points[Npc._000], this.points[Npc._000]);\n orig.points[Npc._011].interpolate(f, orig.points[Npc._100], this.points[Npc._100]);\n orig.points[Npc._101].interpolate(f, orig.points[Npc._010], this.points[Npc._010]);\n orig.points[Npc._001].interpolate(f, orig.points[Npc._110], this.points[Npc._110]);\n orig.points[Npc._110].interpolate(f, orig.points[Npc._001], this.points[Npc._001]);\n orig.points[Npc._010].interpolate(f, orig.points[Npc._101], this.points[Npc._101]);\n orig.points[Npc._100].interpolate(f, orig.points[Npc._011], this.points[Npc._011]);\n orig.points[Npc._000].interpolate(f, orig.points[Npc._111], this.points[Npc._111]);\n }\n /** The point at the center of the front face of this frustum */\n public get frontCenter() {\n return this.getCorner(Npc.LeftBottomFront).interpolate(.5, this.getCorner(Npc.RightTopFront));\n }\n\n /** The point at the center of the rear face of this frustum */\n public get rearCenter() {\n return this.getCorner(Npc.LeftBottomRear).interpolate(.5, this.getCorner(Npc.RightTopRear));\n }\n\n /** Scale this frustum's XY (viewing) plane about its center */\n public scaleXYAboutCenter(scale: number) {\n const frontCenter = this.frontCenter, rearCenter = this.rearCenter;\n frontCenter.interpolate(scale, this.points[Npc.LeftTopFront], this.points[Npc.LeftTopFront]);\n frontCenter.interpolate(scale, this.points[Npc.RightTopFront], this.points[Npc.RightTopFront]);\n frontCenter.interpolate(scale, this.points[Npc.LeftBottomFront], this.points[Npc.LeftBottomFront]);\n frontCenter.interpolate(scale, this.points[Npc.RightBottomFront], this.points[Npc.RightBottomFront]);\n\n rearCenter.interpolate(scale, this.points[Npc.LeftTopRear], this.points[Npc.LeftTopRear]);\n rearCenter.interpolate(scale, this.points[Npc.RightTopRear], this.points[Npc.RightTopRear]);\n rearCenter.interpolate(scale, this.points[Npc.LeftBottomRear], this.points[Npc.LeftBottomRear]);\n rearCenter.interpolate(scale, this.points[Npc.RightBottomRear], this.points[Npc.RightBottomRear]);\n }\n\n /** Create a Map4d that converts world coordinates to/from [[Npc]] coordinates of this Frustum. */\n public toMap4d(): Map4d | undefined {\n const org = this.getCorner(Npc.LeftBottomRear);\n const xVec = org.vectorTo(this.getCorner(Npc.RightBottomRear));\n const yVec = org.vectorTo(this.getCorner(Npc.LeftTopRear));\n const zVec = org.vectorTo(this.getCorner(Npc.LeftBottomFront));\n return Map4d.createVectorFrustum(org, xVec, yVec, zVec, this.getFraction());\n }\n\n /** Get the rotation matrix to the frame of this frustum. This is equivalent to the view rotation matrix. */\n public getRotation(result?: Matrix3d): Matrix3d | undefined {\n const org = this.getCorner(Npc.LeftBottomRear);\n const xVec = org.vectorTo(this.getCorner(Npc.RightBottomRear));\n const yVec = org.vectorTo(this.getCorner(Npc.LeftTopRear));\n const matrix = Matrix3d.createRigidFromColumns(xVec, yVec, AxisOrder.XYZ, result);\n if (matrix)\n matrix.transposeInPlace();\n return matrix;\n }\n\n /** Get the eye point - undefined if parallel projection */\n public getEyePoint(result?: Point3d): Point3d | undefined {\n const fraction = this.getFraction();\n\n if (Math.abs(fraction - 1) < 1E-8)\n return undefined; // Parallel.\n\n const org = this.getCorner(Npc.LeftBottomRear);\n const zVec = org.vectorTo(this.getCorner(Npc.LeftBottomFront));\n\n return org.plusScaled(zVec, 1 / (1 - fraction), result);\n }\n\n /** Invalidate this Frustum by setting all 8 points to zero. */\n public invalidate(): void {\n for (let i = 0; i < 8; ++i)\n this.points[i].set(0, 0, 0);\n }\n\n /** Return true if this Frustum is equal to another Frustum */\n public equals(rhs: Frustum): boolean {\n for (let i = 0; i < 8; ++i) {\n if (!this.points[i].isExactEqual(rhs.points[i]))\n return false;\n }\n return true;\n }\n /** Return true if all of the points in this Frustum are *almost* the same as the points in another Frustum.\n * @see [[equals]], [XYZ.isAlmostEqual]($geometry)\n */\n public isSame(other: Frustum): boolean {\n for (let i = 0; i < 8; ++i) {\n if (!this.points[i].isAlmostEqual(other.points[i]))\n return false;\n }\n\n return true;\n }\n\n /** Initialize this Frustum from a Range */\n public initFromRange(range: LowAndHighXYZ | LowAndHighXY): void {\n const getZ = (arg: any): number => arg.z !== undefined ? arg.z : 0;\n const pts = this.points;\n pts[0].x = pts[2].x = pts[4].x = pts[6].x = range.low.x;\n pts[1].x = pts[3].x = pts[5].x = pts[7].x = range.high.x;\n pts[0].y = pts[1].y = pts[4].y = pts[5].y = range.low.y;\n pts[2].y = pts[3].y = pts[6].y = pts[7].y = range.high.y;\n pts[0].z = pts[1].z = pts[2].z = pts[3].z = getZ(range.low);\n pts[4].z = pts[5].z = pts[6].z = pts[7].z = getZ(range.high);\n }\n\n /** Create a new Frustum from a Range3d */\n public static fromRange(range: LowAndHighXYZ | LowAndHighXY, out?: Frustum): Frustum {\n const frustum = undefined !== out ? out : new Frustum();\n frustum.initFromRange(range);\n return frustum;\n }\n\n /** Return true if this Frustum has a mirror (is not in the correct order.) */\n public get hasMirror(): boolean {\n const pts = this.points;\n const u = pts[Npc._000].vectorTo(pts[Npc._001]);\n const v = pts[Npc._000].vectorTo(pts[Npc._010]);\n const w = pts[Npc._000].vectorTo(pts[Npc._100]);\n return (u.tripleProduct(v, w) > 0);\n }\n /** Make sure the frustum point order does not include mirroring. If so, reverse the order. */\n public fixPointOrder(): void {\n if (!this.hasMirror)\n return;\n\n // frustum has mirroring, reverse points\n const pts = this.points;\n for (let i = 0; i < 8; i += 2) {\n const tmpPoint = pts[i];\n pts[i] = pts[i + 1];\n pts[i + 1] = tmpPoint;\n }\n }\n\n /** Get a convex set of clipping planes bounding the region contained by this Frustum. */\n public getRangePlanes(clipFront: boolean, clipBack: boolean, expandPlaneDistance: number): ConvexClipPlaneSet {\n const convexSet = ConvexClipPlaneSet.createEmpty();\n const scratchNormal = Vector3d.create();\n Vector3d.createCrossProductToPoints(this.points[5], this.points[3], this.points[1], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[1]) - expandPlaneDistance));\n Vector3d.createCrossProductToPoints(this.points[2], this.points[4], this.points[0], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[0]) - expandPlaneDistance));\n Vector3d.createCrossProductToPoints(this.points[3], this.points[6], this.points[2], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[2]) - expandPlaneDistance));\n Vector3d.createCrossProductToPoints(this.points[4], this.points[1], this.points[0], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[0]) - expandPlaneDistance));\n\n if (clipBack) {\n Vector3d.createCrossProductToPoints(this.points[1], this.points[2], this.points[0], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[0]) - expandPlaneDistance));\n }\n if (clipFront) {\n Vector3d.createCrossProductToPoints(this.points[6], this.points[5], this.points[4], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[4]) - expandPlaneDistance));\n }\n return convexSet;\n }\n\n /** Get a (convex) polygon that represents the intersection of this frustum with a plane, or undefined if no intersection exists */\n public getIntersectionWithPlane(plane: Plane3dByOriginAndUnitNormal): Point3d[] | undefined {\n const clipPlane = ClipPlane.createPlane(plane);\n const loopPoints = clipPlane.intersectRange(this.toRange(), true);\n if (undefined === loopPoints)\n return undefined;\n\n const convexSet = this.getRangePlanes(false, false, 0);\n const workPoints = new GrowableXYZArray();\n const outPoints = new GrowableXYZArray();\n convexSet.polygonClip(loopPoints, outPoints, workPoints);\n\n return outPoints.length < 4 ? undefined : outPoints.getPoint3dArray();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Frustum.js","sourceRoot":"","sources":["../../src/Frustum.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAE8B;AAE9B;;;GAGG;AACH,IAAY,GA8BX;AA9BD,WAAY,GAAG;IACb,uBAAuB;IACvB,6BAAQ,CAAA;IACR,wBAAwB;IACxB,6BAAQ,CAAA;IACR,oBAAoB;IACpB,6BAAQ,CAAA;IACR,qBAAqB;IACrB,6BAAQ,CAAA;IACR,wBAAwB;IACxB,6BAAQ,CAAA;IACR,yBAAyB;IACzB,6BAAQ,CAAA;IACR,qBAAqB;IACrB,6BAAQ,CAAA;IACR,sBAAsB;IACtB,6BAAQ,CAAA;IAER,gEAAgE;IAChE,iDAAkB,CAAA;IAClB,mDAAmB,CAAA;IACnB,2CAAe,CAAA;IACf,6CAAgB,CAAA;IAChB,mDAAmB,CAAA;IACnB,qDAAoB,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CAAC,mBAAmB,CAAC,yBAAS,CAAC,uBAAuB,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC;QACpJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,mIAAmI;IAC5H,wBAAwB,CAAC,KAAmC;QACjE,MAAM,SAAS,GAAG,yBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;QAClE,IAAI,SAAS,KAAK,UAAU;YAC1B,OAAO,SAAS,CAAC;QAEnB,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,IAAI,gCAAgB,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,IAAI,gCAAgB,EAAE,CAAC;QACzC,SAAS,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAEzD,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;IACxE,CAAC;CACF;AA/PD,0BA+PC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport {\n AxisOrder, ClipPlane, ConvexClipPlaneSet, Geometry, GrowableXYZArray, LowAndHighXY, LowAndHighXYZ, Map4d, Matrix3d, Plane3dByOriginAndUnitNormal, Point3d, Range3d, Transform, Vector3d, XYAndZ,\n} from \"@itwin/core-geometry\";\n\n/** The 8 corners of the [Normalized Plane Coordinate]($docs/learning/glossary.md#npc) cube.\n * @public\n * @extensions\n */\nexport enum Npc {\n /** Left bottom rear */\n _000 = 0,\n /** Right bottom rear */\n _100 = 1,\n /** Left top rear */\n _010 = 2,\n /** Right top rear */\n _110 = 3,\n /** Left bottom front */\n _001 = 4,\n /** Right bottom front */\n _101 = 5,\n /** Left top front */\n _011 = 6,\n /** Right top front */\n _111 = 7,\n\n /* eslint-disable @typescript-eslint/no-duplicate-enum-values */\n LeftBottomRear = 0,\n RightBottomRear = 1,\n LeftTopRear = 2,\n RightTopRear = 3,\n LeftBottomFront = 4,\n RightBottomFront = 5,\n LeftTopFront = 6,\n RightTopFront = 7,\n /* eslint-enable @typescript-eslint/no-duplicate-enum-values */\n /** useful for sizing arrays */\n CORNER_COUNT = 8,\n}\n\n/** The 8 corners of an [[Npc]] Frustum.\n * @public\n */\nexport const NpcCorners = [ // eslint-disable-line @typescript-eslint/naming-convention\n new Point3d(0.0, 0.0, 0.0),\n new Point3d(1.0, 0.0, 0.0),\n new Point3d(0.0, 1.0, 0.0),\n new Point3d(1.0, 1.0, 0.0),\n new Point3d(0.0, 0.0, 1.0),\n new Point3d(1.0, 0.0, 1.0),\n new Point3d(0.0, 1.0, 1.0),\n new Point3d(1.0, 1.0, 1.0),\n];\nNpcCorners.forEach((corner) => Object.freeze(corner));\nObject.freeze(NpcCorners);\n\n/** The center point of the [Normalized Plane Coordinate]($docs/learning/glossary.md#npc) cube.\n * @public\n */\nexport const NpcCenter = new Point3d(.5, .5, .5); // eslint-disable-line @typescript-eslint/naming-convention\nObject.freeze(NpcCenter);\n\n/** The region of physical (3d) space that appears in a view. It forms the field-of-view of a camera.\n * It is stored as 8 points, in [[Npc]] order, that must define a truncated pyramid.\n * @public\n */\nexport class Frustum {\n /** Array of the 8 points of this Frustum. */\n public readonly points: Point3d[] = [];\n /** Constructor for Frustum. Members are initialized to the Npc cube. */\n public constructor() {\n for (let i = 0; i < 8; ++i)\n this.points[i] = NpcCorners[i].clone();\n }\n\n /** Initialize this Frustum to the 8 corners of the NPC cube. */\n public initNpc() {\n for (let i = 0; i < 8; ++i)\n Point3d.createFrom(NpcCorners[i], this.points[i]);\n\n return this;\n }\n\n /** Get a corner Point from this Frustum. */\n public getCorner(i: number) { return this.points[i]; }\n /** Get the point at the center of this Frustum (halfway between RightTopFront and LeftBottomRear. */\n public getCenter(): Point3d {\n return this.getCorner(Npc.RightTopFront).interpolate(0.5, this.getCorner(Npc.LeftBottomRear));\n }\n\n /** Get the distance between two corners of this Frustum. */\n public distance(corner1: number, corner2: number): number {\n return this.getCorner(corner1).distance(this.getCorner(corner2));\n }\n\n /** Get the ratio of the length of the diagonal of the front plane to the diagonal of the back plane. */\n public getFraction(): number {\n return Geometry.safeDivideFraction(this.distance(Npc.LeftTopFront, Npc.RightBottomFront), this.distance(Npc.LeftTopRear, Npc.RightBottomRear), 0);\n }\n\n /** Multiply all the points of this Frustum by a Transform, in place. */\n public multiply(trans: Transform): void {\n trans.multiplyPoint3dArrayInPlace(this.points);\n }\n\n /** Offset all of the points of this Frustum by a vector. */\n public translate(offset: XYAndZ): void {\n for (const pt of this.points)\n pt.plus(offset, pt);\n }\n\n /** Transform all the points of this Frustum and return the result in another Frustum. */\n public transformBy(trans: Transform, result?: Frustum): Frustum {\n result = result ? result : new Frustum();\n trans.multiplyPoint3dArray(this.points, result.points);\n return result;\n }\n\n /** Calculate a bounding range from the 8 points in this Frustum. */\n public toRange(range?: Range3d): Range3d {\n return Range3d.createArray(this.points, range);\n }\n\n /** Make a copy of this Frustum.\n * @param result Optional Frustum for copy. If undefined allocate a new Frustum.\n */\n public clone(result?: Frustum): Frustum {\n result = result ? result : new Frustum();\n result.setFrom(this);\n return result;\n }\n\n /** Set the points of this Frustum to be copies of the points in another Frustum. */\n public setFrom(other: Frustum) { this.setFromCorners(other.points); }\n /** Set the points of this frustum from array of corner points in NPC order. */\n public setFromCorners(corners: Point3d[]) {\n for (let i = 0; i < 8; ++i)\n this.points[i].setFrom(corners[i]);\n }\n\n /** Scale this Frustum, in place, about its center by a scale factor. */\n public scaleAboutCenter(scale: number): void {\n const orig = this.clone();\n const f = 0.5 * (1.0 + scale);\n orig.points[Npc._111].interpolate(f, orig.points[Npc._000], this.points[Npc._000]);\n orig.points[Npc._011].interpolate(f, orig.points[Npc._100], this.points[Npc._100]);\n orig.points[Npc._101].interpolate(f, orig.points[Npc._010], this.points[Npc._010]);\n orig.points[Npc._001].interpolate(f, orig.points[Npc._110], this.points[Npc._110]);\n orig.points[Npc._110].interpolate(f, orig.points[Npc._001], this.points[Npc._001]);\n orig.points[Npc._010].interpolate(f, orig.points[Npc._101], this.points[Npc._101]);\n orig.points[Npc._100].interpolate(f, orig.points[Npc._011], this.points[Npc._011]);\n orig.points[Npc._000].interpolate(f, orig.points[Npc._111], this.points[Npc._111]);\n }\n /** The point at the center of the front face of this frustum */\n public get frontCenter() {\n return this.getCorner(Npc.LeftBottomFront).interpolate(.5, this.getCorner(Npc.RightTopFront));\n }\n\n /** The point at the center of the rear face of this frustum */\n public get rearCenter() {\n return this.getCorner(Npc.LeftBottomRear).interpolate(.5, this.getCorner(Npc.RightTopRear));\n }\n\n /** Scale this frustum's XY (viewing) plane about its center */\n public scaleXYAboutCenter(scale: number) {\n const frontCenter = this.frontCenter, rearCenter = this.rearCenter;\n frontCenter.interpolate(scale, this.points[Npc.LeftTopFront], this.points[Npc.LeftTopFront]);\n frontCenter.interpolate(scale, this.points[Npc.RightTopFront], this.points[Npc.RightTopFront]);\n frontCenter.interpolate(scale, this.points[Npc.LeftBottomFront], this.points[Npc.LeftBottomFront]);\n frontCenter.interpolate(scale, this.points[Npc.RightBottomFront], this.points[Npc.RightBottomFront]);\n\n rearCenter.interpolate(scale, this.points[Npc.LeftTopRear], this.points[Npc.LeftTopRear]);\n rearCenter.interpolate(scale, this.points[Npc.RightTopRear], this.points[Npc.RightTopRear]);\n rearCenter.interpolate(scale, this.points[Npc.LeftBottomRear], this.points[Npc.LeftBottomRear]);\n rearCenter.interpolate(scale, this.points[Npc.RightBottomRear], this.points[Npc.RightBottomRear]);\n }\n\n /** Create a Map4d that converts world coordinates to/from [[Npc]] coordinates of this Frustum. */\n public toMap4d(): Map4d | undefined {\n const org = this.getCorner(Npc.LeftBottomRear);\n const xVec = org.vectorTo(this.getCorner(Npc.RightBottomRear));\n const yVec = org.vectorTo(this.getCorner(Npc.LeftTopRear));\n const zVec = org.vectorTo(this.getCorner(Npc.LeftBottomFront));\n return Map4d.createVectorFrustum(org, xVec, yVec, zVec, this.getFraction());\n }\n\n /** Get the rotation matrix to the frame of this frustum. This is equivalent to the view rotation matrix. */\n public getRotation(result?: Matrix3d): Matrix3d | undefined {\n const org = this.getCorner(Npc.LeftBottomRear);\n const xVec = org.vectorTo(this.getCorner(Npc.RightBottomRear));\n const yVec = org.vectorTo(this.getCorner(Npc.LeftTopRear));\n const matrix = Matrix3d.createRigidFromColumns(xVec, yVec, AxisOrder.XYZ, result);\n if (matrix)\n matrix.transposeInPlace();\n return matrix;\n }\n\n /** Get the eye point - undefined if parallel projection */\n public getEyePoint(result?: Point3d): Point3d | undefined {\n const fraction = this.getFraction();\n\n if (Math.abs(fraction - 1) < 1E-8)\n return undefined; // Parallel.\n\n const org = this.getCorner(Npc.LeftBottomRear);\n const zVec = org.vectorTo(this.getCorner(Npc.LeftBottomFront));\n\n return org.plusScaled(zVec, 1 / (1 - fraction), result);\n }\n\n /** Invalidate this Frustum by setting all 8 points to zero. */\n public invalidate(): void {\n for (let i = 0; i < 8; ++i)\n this.points[i].set(0, 0, 0);\n }\n\n /** Return true if this Frustum is equal to another Frustum */\n public equals(rhs: Frustum): boolean {\n for (let i = 0; i < 8; ++i) {\n if (!this.points[i].isExactEqual(rhs.points[i]))\n return false;\n }\n return true;\n }\n /** Return true if all of the points in this Frustum are *almost* the same as the points in another Frustum.\n * @see [[equals]], [XYZ.isAlmostEqual]($geometry)\n */\n public isSame(other: Frustum): boolean {\n for (let i = 0; i < 8; ++i) {\n if (!this.points[i].isAlmostEqual(other.points[i]))\n return false;\n }\n\n return true;\n }\n\n /** Initialize this Frustum from a Range */\n public initFromRange(range: LowAndHighXYZ | LowAndHighXY): void {\n const getZ = (arg: any): number => arg.z !== undefined ? arg.z : 0;\n const pts = this.points;\n pts[0].x = pts[2].x = pts[4].x = pts[6].x = range.low.x;\n pts[1].x = pts[3].x = pts[5].x = pts[7].x = range.high.x;\n pts[0].y = pts[1].y = pts[4].y = pts[5].y = range.low.y;\n pts[2].y = pts[3].y = pts[6].y = pts[7].y = range.high.y;\n pts[0].z = pts[1].z = pts[2].z = pts[3].z = getZ(range.low);\n pts[4].z = pts[5].z = pts[6].z = pts[7].z = getZ(range.high);\n }\n\n /** Create a new Frustum from a Range3d */\n public static fromRange(range: LowAndHighXYZ | LowAndHighXY, out?: Frustum): Frustum {\n const frustum = undefined !== out ? out : new Frustum();\n frustum.initFromRange(range);\n return frustum;\n }\n\n /** Return true if this Frustum has a mirror (is not in the correct order.) */\n public get hasMirror(): boolean {\n const pts = this.points;\n const u = pts[Npc._000].vectorTo(pts[Npc._001]);\n const v = pts[Npc._000].vectorTo(pts[Npc._010]);\n const w = pts[Npc._000].vectorTo(pts[Npc._100]);\n return (u.tripleProduct(v, w) > 0);\n }\n /** Make sure the frustum point order does not include mirroring. If so, reverse the order. */\n public fixPointOrder(): void {\n if (!this.hasMirror)\n return;\n\n // frustum has mirroring, reverse points\n const pts = this.points;\n for (let i = 0; i < 8; i += 2) {\n const tmpPoint = pts[i];\n pts[i] = pts[i + 1];\n pts[i + 1] = tmpPoint;\n }\n }\n\n /** Get a convex set of clipping planes bounding the region contained by this Frustum. */\n public getRangePlanes(clipFront: boolean, clipBack: boolean, expandPlaneDistance: number): ConvexClipPlaneSet {\n const convexSet = ConvexClipPlaneSet.createEmpty();\n const scratchNormal = Vector3d.create();\n Vector3d.createCrossProductToPoints(this.points[5], this.points[3], this.points[1], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[1]) - expandPlaneDistance));\n Vector3d.createCrossProductToPoints(this.points[2], this.points[4], this.points[0], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[0]) - expandPlaneDistance));\n Vector3d.createCrossProductToPoints(this.points[3], this.points[6], this.points[2], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[2]) - expandPlaneDistance));\n Vector3d.createCrossProductToPoints(this.points[4], this.points[1], this.points[0], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[0]) - expandPlaneDistance));\n\n if (clipBack) {\n Vector3d.createCrossProductToPoints(this.points[1], this.points[2], this.points[0], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[0]) - expandPlaneDistance));\n }\n if (clipFront) {\n Vector3d.createCrossProductToPoints(this.points[6], this.points[5], this.points[4], scratchNormal);\n if (scratchNormal.normalizeInPlace())\n convexSet.addPlaneToConvexSet(ClipPlane.createNormalAndDistance(scratchNormal, scratchNormal.dotProduct(this.points[4]) - expandPlaneDistance));\n }\n return convexSet;\n }\n\n /** Get a (convex) polygon that represents the intersection of this frustum with a plane, or undefined if no intersection exists */\n public getIntersectionWithPlane(plane: Plane3dByOriginAndUnitNormal): Point3d[] | undefined {\n const clipPlane = ClipPlane.createPlane(plane);\n const loopPoints = clipPlane.intersectRange(this.toRange(), true);\n if (undefined === loopPoints)\n return undefined;\n\n const convexSet = this.getRangePlanes(false, false, 0);\n const workPoints = new GrowableXYZArray();\n const outPoints = new GrowableXYZArray();\n convexSet.polygonClip(loopPoints, outPoints, workPoints);\n\n return outPoints.length < 4 ? undefined : outPoints.getPoint3dArray();\n }\n}\n"]}
|
|
@@ -61,6 +61,64 @@ var GeometryClass;
|
|
|
61
61
|
* @public
|
|
62
62
|
*/
|
|
63
63
|
class GeometryParams {
|
|
64
|
+
categoryId;
|
|
65
|
+
subCategoryId;
|
|
66
|
+
/** Optional render material to override [[SubCategoryAppearance.materialId]].
|
|
67
|
+
* Specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material.
|
|
68
|
+
*/
|
|
69
|
+
materialId;
|
|
70
|
+
/** Optional display priority added to [[SubCategoryAppearance.priority]].
|
|
71
|
+
* The net display priority value is used to control z ordering when drawing to 2d views.
|
|
72
|
+
*/
|
|
73
|
+
elmPriority;
|
|
74
|
+
/** Optional line weight to override [[SubCategoryAppearance.weight]].
|
|
75
|
+
* The weight is an integer in the range of [0,31] that by default corresponds to a pixel width of weight+1.
|
|
76
|
+
*/
|
|
77
|
+
weight;
|
|
78
|
+
/** Optional line color to override [[SubCategoryAppearance.color]].
|
|
79
|
+
* The transparency component is ignored and should instead be specified using [[elmTransparency]].
|
|
80
|
+
*/
|
|
81
|
+
lineColor;
|
|
82
|
+
/** Optional fill color for region interiors. Set the same as [[lineColor]] for an opaque fill.
|
|
83
|
+
* Valid when [[fillDisplay]] is not [[FillDisplay.Never]], [[gradient]] is undefined, and [[backgroundFill]] is [[BackgroundFill.None]].
|
|
84
|
+
* The transparency component is ignored and should instead be specified using [[fillTransparency]].
|
|
85
|
+
*/
|
|
86
|
+
fillColor;
|
|
87
|
+
/** Optional fill using the current view background color for region interiors.
|
|
88
|
+
* Valid when [[fillDisplay]] is not [[FillDisplay.Never]] and [[gradient]] is undefined. Default is [[BackgroundFill.None]].
|
|
89
|
+
*/
|
|
90
|
+
backgroundFill;
|
|
91
|
+
/** Optional fill specification that determines when and if a region interior will display using [[gradient]], [[backgroundFill]], or [[fillColor]] in that order of preference.
|
|
92
|
+
* Fill only applies to [[RenderMode.Wireframe]] views. In a [[RenderMode.SmoothShade]] or [[RenderMode.SolidFill]] view, regions will always display as surfaces preferring [[fillColor]] when present over [[lineColor]].
|
|
93
|
+
* Default is [[FillDisplay.Never]].
|
|
94
|
+
*/
|
|
95
|
+
fillDisplay;
|
|
96
|
+
/** Optional line color transparency to combine with [[SubCategoryAppearance.transparency]].
|
|
97
|
+
* Transparency values are combined by multiplying the opaqueness. A 50% transparent element on a 50% transparent sub-category creates a 75% transparent result (1 - ((1 - .5) * (1 - .5)) = 0.75).
|
|
98
|
+
* Value range is [0.0,1.0]. Pass 0.0 for completely opaque and 1.0 for completely transparent.
|
|
99
|
+
*/
|
|
100
|
+
elmTransparency;
|
|
101
|
+
/** Optional fill color transparency to combine with [[SubCategoryAppearance.transparency]].
|
|
102
|
+
* Transparency values are combined by multiplying the opaqueness. A 50% transparent fill on a 50% transparent sub-category creates a 75% transparent result (1 - ((1 - .5) * (1 - .5)) = 0.75).
|
|
103
|
+
* Value range is [0.0,1.0]. Pass 0.0 for completely opaque, 1.0 for completely transparent, or leave undefined to use [[elmTransparency]].
|
|
104
|
+
*/
|
|
105
|
+
fillTransparency;
|
|
106
|
+
/** Optional geometry classification that can be toggled off with a [[ViewFlags]] independent of [[SubCategoryAppearance.invisible]].
|
|
107
|
+
* Default is [[GeometryClass.Primary]].
|
|
108
|
+
*/
|
|
109
|
+
geometryClass;
|
|
110
|
+
/** Optional line style to override [[SubCategoryAppearance.styleId]] plus modifiers to override the line style definition.
|
|
111
|
+
* Specify an invalid [[Id64]] to override [[SubCategoryAppearance.styleId]] with a solid line.
|
|
112
|
+
*/
|
|
113
|
+
styleInfo;
|
|
114
|
+
/** Optional gradient fill settings for region interiors.
|
|
115
|
+
* Valid when [[fillDisplay]] is not [[FillDisplay.Never]].
|
|
116
|
+
*/
|
|
117
|
+
gradient;
|
|
118
|
+
/** Optional area pattern settings for region interiors.
|
|
119
|
+
* Independent of fill, a region can have both fill and pattern.
|
|
120
|
+
*/
|
|
121
|
+
pattern;
|
|
64
122
|
/** Create a GeometryParams given a [[Category]] Id for a [[GeometricElement]] and optional [[SubCategory]] Id. The [[SubCategory.appearance]] establishes the non-overriden display properties of
|
|
65
123
|
* graphics in a GeometricElement's [[GeometryStreamProps]]. A GeometricElement refers to a single Category through [[GeometricElement.category]], while it's graphics can appear on multiple SubCategories
|
|
66
124
|
* by adding a [[GeometryAppearanceProps]] with a SubCategory change to the GeometryStream.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryParams.js","sourceRoot":"","sources":["../../src/GeometryParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AAKvD,qCAAkC;AAElC;;;GAGG;AACH,IAAY,WASX;AATD,WAAY,WAAW;IACrB,gEAAgE;IAChE,+CAAS,CAAA;IACT,wDAAwD;IACxD,iDAAU,CAAA;IACV,sEAAsE;IACtE,iDAAU,CAAA;IACV,6DAA6D;IAC7D,qDAAY,CAAA;AACd,CAAC,EATW,WAAW,2BAAX,WAAW,QAStB;AAED;;;GAGG;AACH,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,kGAAkG;IAClG,mDAAQ,CAAA;IACR,8EAA8E;IAC9E,qDAAS,CAAA;IACT,gGAAgG;IAChG,yDAAW,CAAA;AACb,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB;AAED;;;;;;GAMG;AACH,IAAY,aASX;AATD,WAAY,aAAa;IACvB,kGAAkG;IAClG,uDAAW,CAAA;IACX,qHAAqH;IACrH,iEAAgB,CAAA;IAChB,mFAAmF;IACnF,2DAAa,CAAA;IACb,mGAAmG;IACnG,uDAAW,CAAA;AACb,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB;AAED;;;GAGG;AACH,MAAa,cAAc;IA0DzB;;;;OAIG;IACH,YAAmB,UAAsB,EAAS,gBAAgB,mBAAI,CAAC,OAAO;QAA3D,eAAU,GAAV,UAAU,CAAY;QAAS,kBAAa,GAAb,aAAa,CAAe;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Ac,KAAK,KAAK,CAAC,cAAc;gBAC9C,OAAO,KAAK,CAAC;YACf,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC;gBACrF,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC;oBACpE,OAAO,KAAK,CAAC;gBACf,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAU,CAAC;oBAC5D,OAAO,KAAK,CAAC;YACjB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAQ,CAAC;YACtD,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oLAAoL;IAC7K,aAAa,CAAC,UAAsB,EAAE,wBAAwB,GAAG,IAAI;QAC1E,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,eAAM,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAChE,IAAI,wBAAwB;YAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED,gHAAgH;IACzG,gBAAgB,CAAC,aAAyB,EAAE,wBAAwB,GAAG,IAAI;QAChF,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,wBAAwB;YAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;CACF;AApLD,wCAoLC","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 { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { ColorDef } from \"./ColorDef\";\nimport { AreaPattern } from \"./geometry/AreaPattern\";\nimport { LineStyle } from \"./geometry/LineStyle\";\nimport { Gradient } from \"./Gradient\";\nimport { IModel } from \"./IModel\";\n\n/** Whether a closed region should be drawn for wireframe display with its internal area filled or not.\n * @public\n * @extensions\n */\nexport enum FillDisplay {\n /** don't fill, even if fill attribute is on for the viewport */\n Never = 0,\n /** fill if the fill attribute is on for the viewport */\n ByView = 1,\n /** always fill, even if the fill attribute is off for the viewport */\n Always = 2,\n /** always fill, fill will always be behind other geometry */\n Blanking = 3,\n}\n\n/** Describes how a view's background color affects the interior area of a closed region.\n * @public\n * @extensions\n */\nexport enum BackgroundFill {\n /** single color fill uses the fill color and line color to draw either a solid or outline fill */\n None = 0,\n /** single color fill uses the view's background color to draw a solid fill */\n Solid = 1,\n /** single color fill uses the view's background color and line color to draw an outline fill */\n Outline = 2,\n}\n\n/** Categorizes a piece of geometry within a GeometryStream. Visibility of classes of geometry can be toggled\n * within a view using [[ViewFlags]].\n * @see [[GeometryStreamProps]].\n * @see [[Feature]].\n * @public\n * @extensions\n */\nexport enum GeometryClass {\n /** Used to classify the \"real\" geometry within a model. Most geometry falls within this class. */\n Primary = 0,\n /** Used to classify geometry used as a drawing aid in constructing the Primary geometry. For example, grid lines. */\n Construction = 1,\n /** Used to classify annotations which dimension (measure) the Primary geometry. */\n Dimension = 2,\n /** Used to classify geometry used to fill planar regions with a 2d pattern (e.g., hatch lines). */\n Pattern = 3,\n}\n\n/** Describes the display properties of graphics in a persistent element's GeometryStream that aren't inherited from [[SubCategoryAppearance]].\n * @see [[GeometryStreamProps]].\n * @public\n */\nexport class GeometryParams {\n /** Optional render material to override [[SubCategoryAppearance.materialId]].\n * Specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material.\n */\n public materialId?: Id64String;\n /** Optional display priority added to [[SubCategoryAppearance.priority]].\n * The net display priority value is used to control z ordering when drawing to 2d views.\n */\n public elmPriority?: number;\n /** Optional line weight to override [[SubCategoryAppearance.weight]].\n * The weight is an integer in the range of [0,31] that by default corresponds to a pixel width of weight+1.\n */\n public weight?: number;\n /** Optional line color to override [[SubCategoryAppearance.color]].\n * The transparency component is ignored and should instead be specified using [[elmTransparency]].\n */\n public lineColor?: ColorDef;\n /** Optional fill color for region interiors. Set the same as [[lineColor]] for an opaque fill.\n * Valid when [[fillDisplay]] is not [[FillDisplay.Never]], [[gradient]] is undefined, and [[backgroundFill]] is [[BackgroundFill.None]].\n * The transparency component is ignored and should instead be specified using [[fillTransparency]].\n */\n public fillColor?: ColorDef;\n /** Optional fill using the current view background color for region interiors.\n * Valid when [[fillDisplay]] is not [[FillDisplay.Never]] and [[gradient]] is undefined. Default is [[BackgroundFill.None]].\n */\n public backgroundFill?: BackgroundFill;\n /** Optional fill specification that determines when and if a region interior will display using [[gradient]], [[backgroundFill]], or [[fillColor]] in that order of preference.\n * Fill only applies to [[RenderMode.Wireframe]] views. In a [[RenderMode.SmoothShade]] or [[RenderMode.SolidFill]] view, regions will always display as surfaces preferring [[fillColor]] when present over [[lineColor]].\n * Default is [[FillDisplay.Never]].\n */\n public fillDisplay?: FillDisplay;\n /** Optional line color transparency to combine with [[SubCategoryAppearance.transparency]].\n * Transparency values are combined by multiplying the opaqueness. A 50% transparent element on a 50% transparent sub-category creates a 75% transparent result (1 - ((1 - .5) * (1 - .5)) = 0.75).\n * Value range is [0.0,1.0]. Pass 0.0 for completely opaque and 1.0 for completely transparent.\n */\n public elmTransparency?: number;\n /** Optional fill color transparency to combine with [[SubCategoryAppearance.transparency]].\n * Transparency values are combined by multiplying the opaqueness. A 50% transparent fill on a 50% transparent sub-category creates a 75% transparent result (1 - ((1 - .5) * (1 - .5)) = 0.75).\n * Value range is [0.0,1.0]. Pass 0.0 for completely opaque, 1.0 for completely transparent, or leave undefined to use [[elmTransparency]].\n */\n public fillTransparency?: number;\n /** Optional geometry classification that can be toggled off with a [[ViewFlags]] independent of [[SubCategoryAppearance.invisible]].\n * Default is [[GeometryClass.Primary]].\n */\n public geometryClass?: GeometryClass;\n /** Optional line style to override [[SubCategoryAppearance.styleId]] plus modifiers to override the line style definition.\n * Specify an invalid [[Id64]] to override [[SubCategoryAppearance.styleId]] with a solid line.\n */\n public styleInfo?: LineStyle.Info;\n /** Optional gradient fill settings for region interiors.\n * Valid when [[fillDisplay]] is not [[FillDisplay.Never]].\n */\n public gradient?: Gradient.Symb;\n /** Optional area pattern settings for region interiors.\n * Independent of fill, a region can have both fill and pattern.\n */\n public pattern?: AreaPattern.Params;\n\n /** Create a GeometryParams given a [[Category]] Id for a [[GeometricElement]] and optional [[SubCategory]] Id. The [[SubCategory.appearance]] establishes the non-overriden display properties of\n * graphics in a GeometricElement's [[GeometryStreamProps]]. A GeometricElement refers to a single Category through [[GeometricElement.category]], while it's graphics can appear on multiple SubCategories\n * by adding a [[GeometryAppearanceProps]] with a SubCategory change to the GeometryStream.\n * @note If a valid SubCategory Id is not supplied, the default SubCategory for the parent Category is used. To be considered valid, [[SubCategory.getCategoryId]] must refer to the specified Category Id.\n */\n constructor(public categoryId: Id64String, public subCategoryId = Id64.invalid) {\n if (!Id64.isValid(subCategoryId))\n this.subCategoryId = IModel.getDefaultSubCategoryId(categoryId);\n }\n\n public clone(): GeometryParams {\n const retVal = new GeometryParams(this.categoryId, this.subCategoryId);\n retVal.materialId = this.materialId;\n retVal.elmPriority = this.elmPriority;\n retVal.weight = this.weight;\n retVal.lineColor = this.lineColor;\n retVal.fillColor = this.fillColor;\n retVal.backgroundFill = this.backgroundFill;\n retVal.fillDisplay = this.fillDisplay;\n retVal.elmTransparency = this.elmTransparency;\n retVal.fillTransparency = this.fillTransparency;\n retVal.geometryClass = this.geometryClass;\n retVal.styleInfo = this.styleInfo ? this.styleInfo.clone() : undefined;\n retVal.gradient = this.gradient ? this.gradient.clone() : undefined;\n retVal.pattern = this.pattern ? this.pattern.clone() : undefined;\n return retVal;\n }\n\n /** Clears [[SubCategoryAppearance]] overrides while preserving [[categoryId]] and [[subCategoryId]]. */\n public resetAppearance() {\n this.materialId = undefined;\n this.elmPriority = undefined;\n this.weight = undefined;\n this.lineColor = undefined;\n this.fillColor = undefined;\n this.backgroundFill = undefined;\n this.fillDisplay = undefined;\n this.elmTransparency = undefined;\n this.fillTransparency = undefined;\n this.geometryClass = undefined;\n this.styleInfo = undefined;\n this.gradient = undefined;\n this.pattern = undefined;\n }\n\n /** Compare two [[GeometryParams]] for equivalence, i.e. both values are undefined and inherited from [[SubCategoryAppearance]] or have the same override. */\n public isEquivalent(other: GeometryParams): boolean {\n if (this === other)\n return true; // Same pointer\n\n if (this.categoryId !== other.categoryId)\n return false;\n if (this.subCategoryId !== other.subCategoryId)\n return false;\n if (this.geometryClass !== other.geometryClass)\n return false;\n\n if (this.elmPriority !== other.elmPriority)\n return false;\n if (this.elmTransparency !== other.elmTransparency)\n return false;\n if (this.fillTransparency !== other.fillTransparency)\n return false;\n\n if ((this.lineColor === undefined) !== (other.lineColor === undefined))\n return false;\n if (this.lineColor && !this.lineColor.equals(other.lineColor!))\n return false;\n\n if (this.weight !== other.weight)\n return false;\n\n if ((this.materialId === undefined) !== (other.materialId === undefined))\n return false;\n if (this.materialId && this.materialId !== other.materialId!)\n return false;\n\n if ((this.styleInfo === undefined) !== (other.styleInfo === undefined))\n return false;\n if (this.styleInfo && !this.styleInfo.equals(other.styleInfo!))\n return false;\n\n if (this.fillDisplay !== other.fillDisplay)\n return false;\n\n if (this.fillDisplay !== undefined && this.fillDisplay !== FillDisplay.Never) {\n if ((this.gradient === undefined) !== (other.gradient === undefined))\n return false;\n if (this.gradient && !this.gradient.equals(other.gradient!))\n return false;\n if (this.backgroundFill !== other.backgroundFill)\n return false;\n if (this.backgroundFill === undefined || this.backgroundFill === BackgroundFill.None) {\n if ((this.fillColor === undefined) !== (other.fillColor === undefined))\n return false;\n if (this.fillColor && !this.fillColor.equals(other.fillColor!))\n return false;\n }\n }\n\n if ((this.pattern === undefined) !== (other.pattern === undefined))\n return false;\n if (this.pattern && !this.pattern.equals(other.pattern!))\n return false;\n\n return true;\n }\n\n /** Change [[categoryId]] to the supplied id, [[subCategoryId]] to the supplied category's the default subCategory, and optionally clear any [[SubCategoryAppearance]] overrides. */\n public setCategoryId(categoryId: Id64String, clearAppearanceOverrides = true) {\n this.categoryId = categoryId;\n this.subCategoryId = IModel.getDefaultSubCategoryId(categoryId);\n if (clearAppearanceOverrides)\n this.resetAppearance();\n }\n\n /** Change [[subCategoryId]] to the supplied id and optionally clear any [[SubCategoryAppearance]] overrides. */\n public setSubCategoryId(subCategoryId: Id64String, clearAppearanceOverrides = true) {\n this.subCategoryId = subCategoryId;\n if (clearAppearanceOverrides)\n this.resetAppearance();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GeometryParams.js","sourceRoot":"","sources":["../../src/GeometryParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AAKvD,qCAAkC;AAElC;;;GAGG;AACH,IAAY,WASX;AATD,WAAY,WAAW;IACrB,gEAAgE;IAChE,+CAAS,CAAA;IACT,wDAAwD;IACxD,iDAAU,CAAA;IACV,sEAAsE;IACtE,iDAAU,CAAA;IACV,6DAA6D;IAC7D,qDAAY,CAAA;AACd,CAAC,EATW,WAAW,2BAAX,WAAW,QAStB;AAED;;;GAGG;AACH,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,kGAAkG;IAClG,mDAAQ,CAAA;IACR,8EAA8E;IAC9E,qDAAS,CAAA;IACT,gGAAgG;IAChG,yDAAW,CAAA;AACb,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB;AAED;;;;;;GAMG;AACH,IAAY,aASX;AATD,WAAY,aAAa;IACvB,kGAAkG;IAClG,uDAAW,CAAA;IACX,qHAAqH;I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O,KAAK,SAAS,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAQ,CAAC;YACtD,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oLAAoL;IAC7K,aAAa,CAAC,UAAsB,EAAE,wBAAwB,GAAG,IAAI;QAC1E,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,eAAM,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAChE,IAAI,wBAAwB;YAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED,gHAAgH;IACzG,gBAAgB,CAAC,aAAyB,EAAE,wBAAwB,GAAG,IAAI;QAChF,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,wBAAwB;YAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;CACF;AApLD,wCAoLC","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 { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { ColorDef } from \"./ColorDef\";\nimport { AreaPattern } from \"./geometry/AreaPattern\";\nimport { LineStyle } from \"./geometry/LineStyle\";\nimport { Gradient } from \"./Gradient\";\nimport { IModel } from \"./IModel\";\n\n/** Whether a closed region should be drawn for wireframe display with its internal area filled or not.\n * @public\n * @extensions\n */\nexport enum FillDisplay {\n /** don't fill, even if fill attribute is on for the viewport */\n Never = 0,\n /** fill if the fill attribute is on for the viewport */\n ByView = 1,\n /** always fill, even if the fill attribute is off for the viewport */\n Always = 2,\n /** always fill, fill will always be behind other geometry */\n Blanking = 3,\n}\n\n/** Describes how a view's background color affects the interior area of a closed region.\n * @public\n * @extensions\n */\nexport enum BackgroundFill {\n /** single color fill uses the fill color and line color to draw either a solid or outline fill */\n None = 0,\n /** single color fill uses the view's background color to draw a solid fill */\n Solid = 1,\n /** single color fill uses the view's background color and line color to draw an outline fill */\n Outline = 2,\n}\n\n/** Categorizes a piece of geometry within a GeometryStream. Visibility of classes of geometry can be toggled\n * within a view using [[ViewFlags]].\n * @see [[GeometryStreamProps]].\n * @see [[Feature]].\n * @public\n * @extensions\n */\nexport enum GeometryClass {\n /** Used to classify the \"real\" geometry within a model. Most geometry falls within this class. */\n Primary = 0,\n /** Used to classify geometry used as a drawing aid in constructing the Primary geometry. For example, grid lines. */\n Construction = 1,\n /** Used to classify annotations which dimension (measure) the Primary geometry. */\n Dimension = 2,\n /** Used to classify geometry used to fill planar regions with a 2d pattern (e.g., hatch lines). */\n Pattern = 3,\n}\n\n/** Describes the display properties of graphics in a persistent element's GeometryStream that aren't inherited from [[SubCategoryAppearance]].\n * @see [[GeometryStreamProps]].\n * @public\n */\nexport class GeometryParams {\n /** Optional render material to override [[SubCategoryAppearance.materialId]].\n * Specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material.\n */\n public materialId?: Id64String;\n /** Optional display priority added to [[SubCategoryAppearance.priority]].\n * The net display priority value is used to control z ordering when drawing to 2d views.\n */\n public elmPriority?: number;\n /** Optional line weight to override [[SubCategoryAppearance.weight]].\n * The weight is an integer in the range of [0,31] that by default corresponds to a pixel width of weight+1.\n */\n public weight?: number;\n /** Optional line color to override [[SubCategoryAppearance.color]].\n * The transparency component is ignored and should instead be specified using [[elmTransparency]].\n */\n public lineColor?: ColorDef;\n /** Optional fill color for region interiors. Set the same as [[lineColor]] for an opaque fill.\n * Valid when [[fillDisplay]] is not [[FillDisplay.Never]], [[gradient]] is undefined, and [[backgroundFill]] is [[BackgroundFill.None]].\n * The transparency component is ignored and should instead be specified using [[fillTransparency]].\n */\n public fillColor?: ColorDef;\n /** Optional fill using the current view background color for region interiors.\n * Valid when [[fillDisplay]] is not [[FillDisplay.Never]] and [[gradient]] is undefined. Default is [[BackgroundFill.None]].\n */\n public backgroundFill?: BackgroundFill;\n /** Optional fill specification that determines when and if a region interior will display using [[gradient]], [[backgroundFill]], or [[fillColor]] in that order of preference.\n * Fill only applies to [[RenderMode.Wireframe]] views. In a [[RenderMode.SmoothShade]] or [[RenderMode.SolidFill]] view, regions will always display as surfaces preferring [[fillColor]] when present over [[lineColor]].\n * Default is [[FillDisplay.Never]].\n */\n public fillDisplay?: FillDisplay;\n /** Optional line color transparency to combine with [[SubCategoryAppearance.transparency]].\n * Transparency values are combined by multiplying the opaqueness. A 50% transparent element on a 50% transparent sub-category creates a 75% transparent result (1 - ((1 - .5) * (1 - .5)) = 0.75).\n * Value range is [0.0,1.0]. Pass 0.0 for completely opaque and 1.0 for completely transparent.\n */\n public elmTransparency?: number;\n /** Optional fill color transparency to combine with [[SubCategoryAppearance.transparency]].\n * Transparency values are combined by multiplying the opaqueness. A 50% transparent fill on a 50% transparent sub-category creates a 75% transparent result (1 - ((1 - .5) * (1 - .5)) = 0.75).\n * Value range is [0.0,1.0]. Pass 0.0 for completely opaque, 1.0 for completely transparent, or leave undefined to use [[elmTransparency]].\n */\n public fillTransparency?: number;\n /** Optional geometry classification that can be toggled off with a [[ViewFlags]] independent of [[SubCategoryAppearance.invisible]].\n * Default is [[GeometryClass.Primary]].\n */\n public geometryClass?: GeometryClass;\n /** Optional line style to override [[SubCategoryAppearance.styleId]] plus modifiers to override the line style definition.\n * Specify an invalid [[Id64]] to override [[SubCategoryAppearance.styleId]] with a solid line.\n */\n public styleInfo?: LineStyle.Info;\n /** Optional gradient fill settings for region interiors.\n * Valid when [[fillDisplay]] is not [[FillDisplay.Never]].\n */\n public gradient?: Gradient.Symb;\n /** Optional area pattern settings for region interiors.\n * Independent of fill, a region can have both fill and pattern.\n */\n public pattern?: AreaPattern.Params;\n\n /** Create a GeometryParams given a [[Category]] Id for a [[GeometricElement]] and optional [[SubCategory]] Id. The [[SubCategory.appearance]] establishes the non-overriden display properties of\n * graphics in a GeometricElement's [[GeometryStreamProps]]. A GeometricElement refers to a single Category through [[GeometricElement.category]], while it's graphics can appear on multiple SubCategories\n * by adding a [[GeometryAppearanceProps]] with a SubCategory change to the GeometryStream.\n * @note If a valid SubCategory Id is not supplied, the default SubCategory for the parent Category is used. To be considered valid, [[SubCategory.getCategoryId]] must refer to the specified Category Id.\n */\n constructor(public categoryId: Id64String, public subCategoryId = Id64.invalid) {\n if (!Id64.isValid(subCategoryId))\n this.subCategoryId = IModel.getDefaultSubCategoryId(categoryId);\n }\n\n public clone(): GeometryParams {\n const retVal = new GeometryParams(this.categoryId, this.subCategoryId);\n retVal.materialId = this.materialId;\n retVal.elmPriority = this.elmPriority;\n retVal.weight = this.weight;\n retVal.lineColor = this.lineColor;\n retVal.fillColor = this.fillColor;\n retVal.backgroundFill = this.backgroundFill;\n retVal.fillDisplay = this.fillDisplay;\n retVal.elmTransparency = this.elmTransparency;\n retVal.fillTransparency = this.fillTransparency;\n retVal.geometryClass = this.geometryClass;\n retVal.styleInfo = this.styleInfo ? this.styleInfo.clone() : undefined;\n retVal.gradient = this.gradient ? this.gradient.clone() : undefined;\n retVal.pattern = this.pattern ? this.pattern.clone() : undefined;\n return retVal;\n }\n\n /** Clears [[SubCategoryAppearance]] overrides while preserving [[categoryId]] and [[subCategoryId]]. */\n public resetAppearance() {\n this.materialId = undefined;\n this.elmPriority = undefined;\n this.weight = undefined;\n this.lineColor = undefined;\n this.fillColor = undefined;\n this.backgroundFill = undefined;\n this.fillDisplay = undefined;\n this.elmTransparency = undefined;\n this.fillTransparency = undefined;\n this.geometryClass = undefined;\n this.styleInfo = undefined;\n this.gradient = undefined;\n this.pattern = undefined;\n }\n\n /** Compare two [[GeometryParams]] for equivalence, i.e. both values are undefined and inherited from [[SubCategoryAppearance]] or have the same override. */\n public isEquivalent(other: GeometryParams): boolean {\n if (this === other)\n return true; // Same pointer\n\n if (this.categoryId !== other.categoryId)\n return false;\n if (this.subCategoryId !== other.subCategoryId)\n return false;\n if (this.geometryClass !== other.geometryClass)\n return false;\n\n if (this.elmPriority !== other.elmPriority)\n return false;\n if (this.elmTransparency !== other.elmTransparency)\n return false;\n if (this.fillTransparency !== other.fillTransparency)\n return false;\n\n if ((this.lineColor === undefined) !== (other.lineColor === undefined))\n return false;\n if (this.lineColor && !this.lineColor.equals(other.lineColor!))\n return false;\n\n if (this.weight !== other.weight)\n return false;\n\n if ((this.materialId === undefined) !== (other.materialId === undefined))\n return false;\n if (this.materialId && this.materialId !== other.materialId!)\n return false;\n\n if ((this.styleInfo === undefined) !== (other.styleInfo === undefined))\n return false;\n if (this.styleInfo && !this.styleInfo.equals(other.styleInfo!))\n return false;\n\n if (this.fillDisplay !== other.fillDisplay)\n return false;\n\n if (this.fillDisplay !== undefined && this.fillDisplay !== FillDisplay.Never) {\n if ((this.gradient === undefined) !== (other.gradient === undefined))\n return false;\n if (this.gradient && !this.gradient.equals(other.gradient!))\n return false;\n if (this.backgroundFill !== other.backgroundFill)\n return false;\n if (this.backgroundFill === undefined || this.backgroundFill === BackgroundFill.None) {\n if ((this.fillColor === undefined) !== (other.fillColor === undefined))\n return false;\n if (this.fillColor && !this.fillColor.equals(other.fillColor!))\n return false;\n }\n }\n\n if ((this.pattern === undefined) !== (other.pattern === undefined))\n return false;\n if (this.pattern && !this.pattern.equals(other.pattern!))\n return false;\n\n return true;\n }\n\n /** Change [[categoryId]] to the supplied id, [[subCategoryId]] to the supplied category's the default subCategory, and optionally clear any [[SubCategoryAppearance]] overrides. */\n public setCategoryId(categoryId: Id64String, clearAppearanceOverrides = true) {\n this.categoryId = categoryId;\n this.subCategoryId = IModel.getDefaultSubCategoryId(categoryId);\n if (clearAppearanceOverrides)\n this.resetAppearance();\n }\n\n /** Change [[subCategoryId]] to the supplied id and optionally clear any [[SubCategoryAppearance]] overrides. */\n public setSubCategoryId(subCategoryId: Id64String, clearAppearanceOverrides = true) {\n this.subCategoryId = subCategoryId;\n if (clearAppearanceOverrides)\n this.resetAppearance();\n }\n}\n"]}
|
package/lib/cjs/Gradient.js
CHANGED
|
@@ -46,6 +46,8 @@ var Gradient;
|
|
|
46
46
|
* @see [[Gradient.KeyColorProps]]
|
|
47
47
|
*/
|
|
48
48
|
class KeyColor {
|
|
49
|
+
value;
|
|
50
|
+
color;
|
|
49
51
|
constructor(json) {
|
|
50
52
|
this.value = json.value;
|
|
51
53
|
this.color = ColorDef_1.ColorDef.fromJSON(json.color);
|
|
@@ -62,12 +64,13 @@ var Gradient;
|
|
|
62
64
|
* @see [[Gradient.SymbProps]]
|
|
63
65
|
*/
|
|
64
66
|
class Symb {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
mode = Mode.None;
|
|
68
|
+
flags = Flags.None;
|
|
69
|
+
angle;
|
|
70
|
+
tint;
|
|
71
|
+
shift = 0;
|
|
72
|
+
thematicSettings;
|
|
73
|
+
keys = [];
|
|
71
74
|
/** create a GradientSymb from a json object. */
|
|
72
75
|
static fromJSON(json) {
|
|
73
76
|
const result = new Symb();
|
|
@@ -82,15 +85,15 @@ var Gradient;
|
|
|
82
85
|
result.thematicSettings = (json.thematicSettings === undefined) ? undefined : ThematicDisplay_1.ThematicGradientSettings.fromJSON(json.thematicSettings);
|
|
83
86
|
return result;
|
|
84
87
|
}
|
|
85
|
-
static
|
|
88
|
+
static _fixedSchemeKeys = [
|
|
86
89
|
// NB: these color values are ordered as rbg. Note how the components are applied below.
|
|
87
90
|
[[0.0, 0, 255, 0], [0.25, 0, 255, 255], [0.5, 0, 0, 255], [0.75, 255, 0, 255], [1.0, 255, 0, 0]], // Blue Red.
|
|
88
91
|
[[0.0, 255, 0, 0], [0.25, 255, 0, 255], [0.5, 0, 0, 255], [0.75, 0, 255, 255], [1.0, 0, 255, 0]], // Red blue.
|
|
89
92
|
[[0.0, 0, 0, 0], [1.0, 255, 255, 255]], // Monochrome.
|
|
90
93
|
[[0.0, 152, 148, 188], [0.5, 204, 160, 204], [1.0, 152, 72, 128]], // Based off of the topographic gradients in Point Clouds.
|
|
91
94
|
[[0.0, 0, 255, 0], [0.2, 72, 96, 160], [0.4, 152, 96, 160], [0.6, 128, 32, 104], [0.7, 148, 180, 128], [1.0, 240, 240, 240]], // Based off of the sea-mountain gradient in Point Clouds.
|
|
92
|
-
];
|
|
93
|
-
static
|
|
95
|
+
];
|
|
96
|
+
static _fixedCustomKeys = [[0.0, 255, 0, 0], [1.0, 0, 255, 0]];
|
|
94
97
|
/** Create for [[ThematicDisplay]]. */
|
|
95
98
|
static createThematic(settings) {
|
|
96
99
|
const result = new Symb();
|