@itwin/core-common 5.0.0-dev.8 → 5.0.0-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackendTypes.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinError.d.ts +1 -1
- package/lib/cjs/ITwinError.d.ts.map +1 -1
- package/lib/cjs/ITwinError.js +1 -1
- package/lib/cjs/ITwinError.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/Render.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackendTypes.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinError.d.ts +1 -1
- package/lib/esm/ITwinError.d.ts.map +1 -1
- package/lib/esm/ITwinError.js +1 -1
- package/lib/esm/ITwinError.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/Render.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../src/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+D;AAC/D,iDAAoD;AAEpD,qDAAiD;AAEjD,yCAAqD;AAGrD,SAAS,oBAAoB,CAAC,GAAmB,EAAE,GAAqB;IACtE,GAAG,CAAC,KAAK,EAAE,CAAC;IACZ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,EAAE,IAAI,GAAG;YAClB,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AA+BD,SAAS,kBAAkB,CAAC,KAA6B;IACvD,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO;WAC9B,SAAS,KAAK,KAAK,CAAC,MAAM,IAAI,SAAS,KAAK,KAAK,CAAC,UAAU;WAC5D,SAAS,KAAK,KAAK,CAAC,YAAY,IAAI,SAAS,KAAK,KAAK,CAAC,gBAAgB;WACxE,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,KA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yBAAyB,yCAAzB,yBAAyB,QAqCzC","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 { assert, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { BatchType, Feature } from \"./FeatureTable\";\nimport { ColorDef } from \"./ColorDef\";\nimport { GeometryClass } from \"./GeometryParams\";\nimport { LinePixels } from \"./LinePixels\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { SubCategoryOverride } from \"./SubCategoryOverride\";\n\nfunction copyIdSetToUint32Set(dst: Id64.Uint32Set, src: Iterable<string>): void {\n dst.clear();\n if (typeof src === \"string\") {\n dst.addId(src);\n } else {\n for (const id of src)\n dst.addId(id);\n }\n}\n\n// cspell:ignore subcat subcats\n\n/** JSON representation of a [[FeatureAppearance]].\n * @public\n * @extensions\n */\nexport interface FeatureAppearanceProps {\n /** See [[FeatureAppearance.rgb]]. */\n rgb?: RgbColorProps;\n /** See [[FeatureAppearance.lineRgb]]. */\n lineRgb?: RgbColorProps | false;\n /** See [[FeatureAppearance.weight]]. */\n weight?: number;\n /** See [[FeatureAppearance.transparency]]. */\n transparency?: number;\n /** See [[FeatureAppearance.lineTransparency]]. */\n lineTransparency?: number | false;\n /** See [[FeatureAppearance.viewDependentTransparency]]. */\n viewDependentTransparency?: true;\n /** See [[FeatureAppearance.linePixels]]. */\n linePixels?: LinePixels;\n /** See [[FeatureAppearance.ignoresMaterial]]. */\n ignoresMaterial?: true;\n /** See [[FeatureAppearance.nonLocatable]]. */\n nonLocatable?: true;\n /** See [[FeatureAppearance.emphasized]]. */\n emphasized?: true;\n}\n\nfunction propsMatchDefaults(props: FeatureAppearanceProps): boolean {\n return !props.rgb && !props.lineRgb\n && undefined === props.weight && undefined === props.linePixels\n && undefined === props.transparency && undefined === props.lineTransparency\n && !props.ignoresMaterial && !props.nonLocatable && !props.emphasized;\n}\n\nfunction equalRgb(a: RgbColor | undefined, b: RgbColor | undefined): boolean {\n if (a === b) {\n return true;\n } else if (!a || !b) {\n return false;\n } else {\n return a.equals(b);\n }\n}\n\nfunction equalLineRgb(a: RgbColor | false | undefined, b: RgbColor | false | undefined): boolean {\n if (a === b) {\n return true;\n } else if (a instanceof RgbColor && b instanceof RgbColor) {\n return equalRgb(a, b);\n } else {\n assert(a === undefined || a === false);\n assert(b === undefined || b === false);\n return false;\n }\n}\n\nfunction equalTransparency(a: number | undefined, b: number | undefined): boolean {\n if (a === b) {\n return true;\n } else if (undefined === a || undefined === b) {\n return false;\n } else {\n return Math.floor(a * 0xff) === Math.floor(b * 0xff);\n }\n}\n\nfunction equalLineTransparency(a: number | false | undefined, b: number | false | undefined): boolean {\n if (a === b) {\n return true;\n } else if (typeof a === \"number\" && typeof b === \"number\") {\n return equalTransparency(a, b);\n } else {\n assert(a === undefined || a === false);\n assert(b === undefined || b === false);\n return false;\n }\n}\n\nfunction transparencyFromJSON(transp: number | undefined): number | undefined {\n if (undefined === transp) {\n return undefined;\n }\n\n transp = Math.max(0, Math.min(transp, 1));\n\n // Fix up rounding errors...\n const smallDelta = 0.0001;\n if (1.0 - transp < smallDelta) {\n transp = 1.0;\n } else if (transp < smallDelta) {\n transp = 0.0;\n }\n\n return transp;\n}\n\n/** Defines overrides for selected aspects of a [[Feature]]'s symbology.\n * Any member defined in the appearance overrides that aspect of symbology for all [[Feature]]s to which the appearance is applied.\n *\n * The [[rgb]] and [[transparency]] overrides, if defined, apply to all geometry by default.\n * However, the color and transparency of \"linear\" geometry can optionally be controlled independently from the rest of the geometry via [[lineRgb]] and [[lineTransparency]].\n * Linear geometry consists of any of the following:\n * - Curves and line strings;\n * - Points and point strings; and\n * - The outlines of planar regions.\n * The edges of 3d surfaces like spheres are not considered linear geometry.\n *\n * @see [[FeatureOverrides]] to customize the appearance of multiple features.\n * @public\n */\nexport class FeatureAppearance {\n /** Overrides the feature's color.\n * If [[lineRgb]] is `undefined`, this color also applies to linear geometry.\n */\n public readonly rgb?: RgbColor;\n /** If defined, overrides the color of linear geometry independently of [[rgb]].\n * If `false`, linear geometry draws using its normal color; otherwise, it uses the specified color.\n */\n public readonly lineRgb?: RgbColor | false;\n /** The width of lines and edges in pixels as an integer in [1, 31]. */\n public readonly weight?: number;\n /** The transparency in the range [0, 1] where 0 indicates fully opaque and 1 indicates fully transparent.\n * If [[lineTransparency]] is `undefined`, this transparency also applies to linear geometry.\n * @see [[viewDependentTransparency]] for details on how this override interacts with the [DisplayStyle]($backend).\n */\n public readonly transparency?: number;\n /** If defined, overrides the transparency of linear geometry independently of [[transparency]].\n * If `false`, linear geometry draws using its normal transparency; otherwise, it uses the specified transparency.\n * @see [[viewDependentTransparency]] for details on how this override interacts with the [DisplayStyle]($backend).\n */\n public readonly lineTransparency?: number | false;\n /** The pixel pattern applied to lines and edges. */\n public readonly linePixels?: LinePixels;\n /** If true, don't apply the [[RenderMaterial]] to the feature's surfaces. */\n public readonly ignoresMaterial?: true;\n /** If true, the feature will not be drawn when using [Viewport.readPixels]($frontend), meaning [Tool]($frontend)s will not be able to interact with it. */\n public readonly nonLocatable?: true;\n /** If true, the feature will be rendered using the [[Hilite.Settings]] defined by [Viewport.emphasisSettings]($frontend) to make it stand out. */\n public readonly emphasized?: true;\n /** If true, then [[transparency]] and/or [[lineTransparency]] will only be applied if [[ViewFlags.transparency]] is enabled and the current [[RenderMode]] supports transparency.\n * Default: false, meaning the transparency will be applied regardless of view flags or render mode.\n * This property has no effect if this appearance does not override transparency.\n */\n public readonly viewDependentTransparency?: true;\n\n /** An appearance that overrides nothing. */\n public static readonly defaults = new FeatureAppearance({});\n\n public static fromJSON(props?: FeatureAppearanceProps) {\n if (!props || propsMatchDefaults(props)) {\n return this.defaults;\n }\n\n return new FeatureAppearance(props);\n }\n\n /** Create a FeatureAppearance that overrides only the RGB color.\n * @note The transparency component of the ColorDef is ignored.\n */\n public static fromRgb(color: ColorDef): FeatureAppearance {\n return new FeatureAppearance({ rgb: RgbColor.fromColorDef(color) });\n }\n\n /** Create a FeatureAppearance that overrides the RGB and transparency.\n * The appearance's transparency is derived from the transparency component of the ColorDef.\n */\n public static fromRgba(color: ColorDef, viewDependentTransparency = false): FeatureAppearance {\n return new FeatureAppearance({\n rgb: RgbColor.fromColorDef(color),\n transparency: color.colors.t / 255,\n viewDependentTransparency: viewDependentTransparency ? true : undefined,\n });\n }\n /** Create a FeatureAppearance that overrides only the transparency */\n public static fromTransparency(transparencyValue: number, viewDependent = false): FeatureAppearance {\n return new FeatureAppearance({\n transparency: transparencyValue,\n viewDependentTransparency: viewDependent ? true : undefined,\n });\n }\n\n /** Create a FeatureAppearance with overrides corresponding to those defined by the supplied SubCategoryOverride.\n * @note Subcategory overrides set [[viewDependentTransparency]] to `true`.\n */\n public static fromSubCategoryOverride(ovr: SubCategoryOverride): FeatureAppearance {\n const rgb = undefined !== ovr.color ? RgbColor.fromColorDef(ovr.color) : undefined;\n const transparency = ovr.transparency;\n const weight = ovr.weight;\n const ignoresMaterial = undefined !== ovr.material && Id64.isValid(ovr.material) ? true : undefined;\n return this.fromJSON({ rgb, transparency, weight, ignoresMaterial, viewDependentTransparency: true });\n }\n\n /** Returns true if this appearance does not override any aspects of symbology. */\n public get matchesDefaults(): boolean {\n return this.equals(FeatureAppearance.defaults);\n }\n\n public get overridesRgb(): boolean { return undefined !== this.rgb; }\n public get overridesTransparency(): boolean { return undefined !== this.transparency; }\n public get overridesLinePixels(): boolean { return undefined !== this.linePixels; }\n public get overridesWeight(): boolean { return undefined !== this.weight; }\n\n /** Get the color that will be applied to linear geometry, or undefined if not overridden.\n * This is the same as [[rgb]] if [[lineRgb]] is `undefined`.\n */\n public getLineRgb(): RgbColor | undefined {\n return false !== this.lineRgb ? (this.lineRgb ?? this.rgb) : undefined;\n }\n\n /** Get the transparency that will be applied to linear geometry, or undefined if not overridden.\n * This is the same as [[transparency]] if [[lineTransparency]] is `undefined`.\n */\n public getLineTransparency(): number | undefined {\n return false !== this.lineTransparency ? (this.lineTransparency ?? this.transparency) : undefined;\n }\n\n public get overridesSymbology(): boolean {\n return this.overridesRgb || this.overridesTransparency || this.overridesWeight || this.overridesLinePixels || !!this.ignoresMaterial\n || this.emphasized || this.overridesNonLocatable\n || undefined !== this.getLineRgb() || undefined !== this.getLineTransparency();\n }\n\n public get overridesNonLocatable(): boolean { return undefined !== this.nonLocatable; }\n\n public get isFullyTransparent(): boolean {\n const surf = this.transparency ?? 0;\n const line = this.getLineTransparency() ?? 0;\n return surf >= 1 && line >= 1;\n }\n\n /** Returns true if any aspect of the appearance is overridden (i.e., if any member is not undefined). */\n public get anyOverridden(): boolean { return this.overridesSymbology || this.overridesNonLocatable; }\n\n public equals(other: FeatureAppearance): boolean {\n if (this === other)\n return true;\n\n return equalRgb(this.rgb, other.rgb)\n && this.weight === other.weight\n && equalTransparency(this.transparency, other.transparency)\n && this.linePixels === other.linePixels\n && this.ignoresMaterial === other.ignoresMaterial\n && this.nonLocatable === other.nonLocatable\n && this.emphasized === other.emphasized\n && this.viewDependentTransparency === other.viewDependentTransparency\n && equalLineTransparency(this.lineTransparency, other.lineTransparency)\n && equalLineRgb(this.lineRgb, other.lineRgb);\n }\n\n public toJSON(): FeatureAppearanceProps {\n const props: FeatureAppearanceProps = {};\n if (this.rgb)\n props.rgb = this.rgb.toJSON();\n\n if (undefined !== this.weight)\n props.weight = this.weight;\n\n if (undefined !== this.transparency) {\n props.transparency = this.transparency;\n if (this.viewDependentTransparency)\n props.viewDependentTransparency = true;\n }\n\n if (undefined !== this.linePixels)\n props.linePixels = this.linePixels;\n\n if (true === this.ignoresMaterial)\n props.ignoresMaterial = true;\n\n if (true === this.nonLocatable)\n props.nonLocatable = true;\n\n if (true === this.emphasized)\n props.emphasized = true;\n\n if (undefined !== this.lineTransparency)\n props.lineTransparency = this.lineTransparency;\n\n if (this.lineRgb) {\n props.lineRgb = this.lineRgb;\n if (this.viewDependentTransparency)\n props.viewDependentTransparency = true;\n }\n\n return props;\n }\n\n /** Convert this appearance to JSON, and override any properties explicitly specified by `changedProps` in the result.\n * Example:\n * ```ts\n * const base = FeatureAppearance.fromRgba(ColorDef.white); // transparency=0, rgb=white\n * const clone = base.cloneProps({ transparency: undefined, weight: 5 }); // transparency=undefined, rgb=white, weight=5\n * ```\n * @see [[FeatureAppearance.clone]].\n */\n public cloneProps(changedProps: FeatureAppearanceProps): FeatureAppearanceProps {\n return {\n ...this.toJSON(),\n ...changedProps,\n };\n }\n\n /** Create a copy of this appearance, overriding any properties explicitly specified by `changedProps`.\n * Example:\n * ```ts\n * const base = FeatureAppearance.fromRgba(ColorDef.white); // transparency=0, rgb=white\n * const clone = base.clone({ transparency: undefined, weight: 5 }); // transparency=undefined, rgb=white, weight=5\n * ```\n * @see [[FeatureAppearance.cloneProps]].\n */\n public clone(changedProps: FeatureAppearanceProps): FeatureAppearance {\n return FeatureAppearance.fromJSON(this.cloneProps(changedProps));\n }\n\n /** Produce a FeatureAppearance from the supplied appearance in which any aspect not defined by the base appearance is overridden by this appearance. */\n public extendAppearance(base: FeatureAppearance): FeatureAppearance {\n if (!this.overridesSymbology)\n return base;\n\n const props = base.toJSON();\n if (undefined === props.rgb)\n props.rgb = this.rgb;\n if (undefined === props.transparency)\n props.transparency = this.transparency;\n if (undefined === props.linePixels)\n props.linePixels = this.linePixels;\n if (undefined === props.weight)\n props.weight = this.weight;\n if (undefined === props.ignoresMaterial && this.ignoresMaterial)\n props.ignoresMaterial = true;\n if (undefined === props.nonLocatable && this.nonLocatable)\n props.nonLocatable = true;\n if (undefined === props.emphasized && this.emphasized)\n props.emphasized = true;\n if (!props.lineRgb)\n props.lineRgb = this.lineRgb;\n if (undefined === props.lineTransparency)\n props.lineTransparency = this.lineTransparency;\n\n if (this.viewDependentTransparency && (undefined !== props.transparency || undefined !== props.lineTransparency))\n props.viewDependentTransparency = true;\n\n return FeatureAppearance.fromJSON(props);\n }\n\n protected constructor(props: FeatureAppearanceProps) {\n this.rgb = undefined !== props.rgb ? RgbColor.fromJSON(props.rgb) : undefined;\n this.lineRgb = typeof props.lineRgb === \"object\" ? RgbColor.fromJSON(props.lineRgb) : (false === props.lineRgb ? false : undefined);\n\n this.transparency = transparencyFromJSON(props.transparency);\n this.lineTransparency = typeof props.lineTransparency === \"number\" ? transparencyFromJSON(props.lineTransparency) : (false === props.lineTransparency ? false : undefined);\n\n this.weight = props.weight;\n this.linePixels = props.linePixels;\n\n this.ignoresMaterial = props.ignoresMaterial;\n this.nonLocatable = props.nonLocatable;\n this.emphasized = props.emphasized;\n\n if (undefined !== this.weight) {\n this.weight = Math.max(1, Math.min(this.weight, 32));\n }\n\n if (props.viewDependentTransparency && (undefined !== this.transparency || undefined !== this.getLineTransparency())) {\n this.viewDependentTransparency = true;\n }\n }\n}\n\n/** Interface adopted by an object that can supply a [[FeatureAppearance]] given a low-level description of a [[Feature]].\n * @see [[FeatureOverrides]] for the commonly-used implementation.\n * @see [[FeatureAppearanceProvider]] to supplement the appearance supplied by this interface.\n * @public\n * @extensions\n */\nexport interface FeatureAppearanceSource {\n /** Supplies the desired appearance overrides for the specified [[Feature]], or `undefined` if the feature should not be drawn.\n * The feature is described by its components for efficiency reasons.\n * @param elemLo The lower 32 bits of the feature's element Id.\n * @param elemHi The upper 32 bits of the feature's element Id.\n * @param subcatLo The lower 32 bits of the feature's subcategory Id.\n * @param subcatHi The upper 32 bits of the feature's subcategory Id.\n * @param geomClass The geometry class of the feature.\n * @param modelLo The lower 32 bits of the feature's model Id.\n * @param modelHi The upper 32 bits of the feature's model Id.\n * @param type The type of batch to which the feature belongs.\n * @param animationNodeId The Id of the corresponding node in the [[RenderSchedule]], or `0` if none.\n * @returns The desired appearance overrides, or `undefined` to indicate the feature should not be displayed.\n * @see [Id64.isValidUint32Pair]($core-bentley) to determine if the components of an [Id64String]($core-bentley) represent a valid Id.\n */\n getAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined;\n}\n\n/** Common options for [[FeatureOverrides.override]].\n * @public\n */\nexport interface OverrideFeatureAppearanceOptions {\n /** Specifies the aspects of the [[Feature]]'s appearance to be overridden. */\n appearance: FeatureAppearance;\n /** Specifies what to do if a [[FeatureAppearance]] has already been configured for the specified element, model, or subcategory by a previous call to [[FeatureOverrides.override]].\n * - \"subsume\" (the default): Merge the two appearances using the logic described by [[FeatureAppearance.extendAppearance]] such that any aspect overridden by the existing appearance will be overwritten\n * if also overridden by [[appearance]].\n * - The resulting appearance is computed as `existingAppearance.extendAppearance(newAppearance)`.\n * - \"extend\": Merge the two appearances using the logic described by [[FeatureAppearance.extendAppearance]] such that any aspect overridden by [[appearance]] will only\n * apply if that aspect is not already overridden by a previous appearance.\n * - The resulting appearance is computed as `newAppearance.extendAppearance(existingAppearance)`.\n * - \"replace\": Completely replace the existing appearance with [[appearance]].\n * - \"skip\": Keep the existing appearance.\n */\n onConflict?: \"extend\" | \"subsume\" | \"replace\" | \"skip\";\n}\n\n/** Options for using [[FeatureOverrides.override]] to override the appearance of a [GeometricModel]($backend).\n * @public\n */\nexport interface OverrideModelAppearanceOptions extends OverrideFeatureAppearanceOptions {\n /** The Id of the model whose appearance is to be overridden. */\n modelId: Id64String;\n /** @internal */\n elementId?: never;\n /** @internal */\n subCategoryId?: never;\n}\n\n/** Options for using [[FeatureOverrides.override]] to override the appearance of a [GeometricElement]($backend).\n * @public\n */\nexport interface OverrideElementAppearanceOptions extends OverrideFeatureAppearanceOptions {\n /** The Id of the element whose appearance is to be overridden. */\n elementId: Id64String;\n /** @internal */\n modelId?: never;\n /** @internal */\n subCategoryId?: never;\n}\n\n/** Options for using [[FeatureOverrides.override]] to override the appearance of a [SubCategory]($backend).\n * @public\n */\nexport interface OverrideSubCategoryAppearanceOptions extends OverrideFeatureAppearanceOptions {\n /** The Id of the subcategory whose appearance is to be overridden. */\n subCategoryId: Id64String;\n /** @internal */\n modelId?: never;\n /** @internal */\n elementId?: never;\n}\n\n/** Arguments supplied to [[FeatureOverrides.override]].\n * @public\n */\nexport type OverrideFeatureAppearanceArgs = OverrideElementAppearanceOptions | OverrideModelAppearanceOptions | OverrideSubCategoryAppearanceOptions;\n\n/** Arguments provided to a function of type [[IgnoreAnimationOverrides]].\n * @see [[FeatureOverrides.ignoreAnimationOverrides]] to register such a function.\n * @public\n */\nexport interface IgnoreAnimationOverridesArgs {\n /** The Id of the element under consideration.\n * @see [Id64.fromUint32Pair]($bentley) to convert a Uint32Pair into an [Id64String]($bentley), if needed.\n */\n readonly elementId: Readonly<Id64.Uint32Pair>;\n /** The [[RenderSchedule.ElementTimeline.batchId]] identifying the [[RenderSchedule.ElementTimeline]] to which the element under consideration belongs. */\n readonly animationNodeId: number;\n}\n\n/** A function that can be supplied to [[FeatureOverrides.ignoreAnimationOverrides]] to indicate whether the color or transparency overrides defined\n * by the view's [[RenderSchedule.Script]] should be ignored. The arguments describe the element under consideration. The function should return true if that\n * element should not have its color or transparency modified by the schedule script.\n * @public\n */\nexport type IgnoreAnimationOverrides = (args: IgnoreAnimationOverridesArgs) => boolean;\n\nconst scratchIgnoreAnimationOverridesArgs = {\n elementId: { lower: 0, upper: 0 },\n animationNodeId: 0,\n};\n\n/** Specifies how to customize the appearance of individual [[Feature]]s, typically within the context of a [Viewport]($frontend).\n * Individual aspects of a feature's appearance - like visibility, color, and transparency - are overridden by supplying a [[FeatureAppearance]].\n * Those overrides can be specified on the basis of the feature's model, element, and/or subcategory. A default set of overrides can also be specified to\n * apply to the appearance of any feature not otherwise overridden.\n *\n * It is possible to override multiple aspects of a feature on different bases. For example, you might specify that all features belonging to subcategory \"A\" should be drawn in red,\n * and that all features belonging to model \"B\" should be drawn 50% transparent. In this case, a feature belonging to both subcategory \"A\" and model \"B\" will be drawn as 50% transparent red -\n * the separate overrides are combined to produce the feature's overall appearance.\n *\n * In the case of conflicts, there is an order of precedence:\n * - Model overrides take highest precedence.\n * - Element overrides are of higher precedence than subcategory and animation overrides.\n * - Overrides applied by a [[RenderSchedule.Script]]'s [[RenderSchedule.ElementTimeline]] are of higher precedence than subcategory overrides, but can be suppressed on a per-element basis via [[ignoreAnimationOverrides]].\n * - Subcategory overrides have lowest precedence.\n *\n * For example, you might specify that all features belonging to subcategory \"A\" should be drawn in red, and all those belonging to model \"B\" should be drawn in green.\n * Then a feature belonging to subcategory \"A\" and model \"B\" will be drawn in green, because the model overrides take precedence.\n *\n * Instances of this class are not typically instantiated by an application directly; instead, an application can implement a [FeatureOverrideProvider]($frontend)\n * that augments the overrides supplied by a viewport.\n *\n * @see [FeatureSymbology.Overrides]($frontend) to create overrides specific to a [Viewport]($frontend) or [ViewState]($frontend).\n * @see [FeatureOverrideProvider]($frontend) to customize the appearance of features within a [Viewport]($frontend).\n * @public\n */\nexport class FeatureOverrides implements FeatureAppearanceSource {\n /** @internal */\n protected readonly _ignoreAnimationOverrides: IgnoreAnimationOverrides[] = [];\n /** Ids of elements that should never be drawn. This takes precedence over [[alwaysDrawn]]. @internal */\n protected readonly _neverDrawn = new Id64.Uint32Set();\n /** Ids of elements that should always be drawn. [[neverDrawn]] takes precedence over this set. @internal */\n protected readonly _alwaysDrawn = new Id64.Uint32Set();\n /** If true, no elements *except* those defined in the \"always drawn\" set will be drawn.\n * @see [[setAlwaysDrawn]]\n */\n public isAlwaysDrawnExclusive = false;\n /** If true, the always-drawn elements are drawn even if their subcategories are not visible.\n * @see [[setAlwaysDrawn]]\n */\n public alwaysDrawnIgnoresSubCategory = true;\n /** If true, all subcategories are considered visible. This is used for drawing sheets via section callouts in the absence of an actual sheet view.\n * @internal\n */\n public ignoreSubCategory = false;\n\n /** Overrides applied to any feature not explicitly overridden. @internal */\n protected _defaultOverrides = FeatureAppearance.defaults;\n /** Whether construction geometry should be drawn. @internal */\n protected _constructions = false;\n /** Whether dimensions should be drawn. @internal */\n protected _dimensions = false;\n /** Whether area patterns should be drawn. @internal */\n protected _patterns = false;\n /** Whether line weights should be applied. If false, all lines are rendered 1-pixel wide. @internal */\n protected _lineWeights = true;\n\n /** Overrides applied to all elements belonging to each model. @internal */\n protected readonly _modelOverrides = new Id64.Uint32Map<FeatureAppearance>();\n /** Overrides applied to specific elements. @internal */\n protected readonly _elementOverrides = new Id64.Uint32Map<FeatureAppearance>();\n /** Overrides applied to geometry belonging to each subcategory. @internal */\n protected readonly _subCategoryOverrides = new Id64.Uint32Map<FeatureAppearance>();\n /** The set of displayed subcategories. Geometry belonging to subcategories not included in this set will not be drawn. @internal */\n protected readonly _visibleSubCategories = new Id64.Uint32Set();\n /** Display priorities assigned to subcategories, possibly overridden by display style. Only applicable for plan projection models. @internal */\n protected readonly _subCategoryPriorities = new Id64.Uint32Map<number>();\n\n /** Per-model, a set of subcategories whose visibility should be inverted for elements within that model.\n * Populated by Viewport.\n * @internal\n */\n protected readonly _modelSubCategoryOverrides = new Id64.Uint32Map<Id64.Uint32Set>();\n\n /** Ids of animation nodes that should never be drawn.\n * @internal\n */\n public readonly neverDrawnAnimationNodes = new Set<number>();\n /** Mapping of animation node Ids to overrides applied to the corresponding animation nodes.\n * @internal\n */\n public readonly animationNodeOverrides = new Map<number, FeatureAppearance>();\n\n /** Accepts a criterion that determines whether color and transparency overrides originating from the view's [[RenderSchedule.Script]] should be ignored for a given element.\n * The function receives a description of the element in question and returns `true` if the script's overrides should be ignored.\n * Any number of such functions can be registered; if any one of them returns `true`, the script's overrides are not applied to the specified element.\n *\n * For example, applications commonly emphasize a set of elements by applying a [[FeatureAppearance.emphasized]] override to them, and specifying a highly-transparent\n * default appearance to de-emphasize the rest of the elements in the view. If some of the de-emphasized elements' appearances are also being overridden by the schedule script, then\n * they won't appear de-emphasized, making it difficult for the emphasized elements to stand out. In situations like this, [FeatureOverrideProvider]($frontend)s like [EmphasizeElements]($frontend) can register an [[IgnoreAnimationOverrides]] function that returns true if the element in question is not in the set of emphasized elements.\n */\n public ignoreAnimationOverrides(ignore: IgnoreAnimationOverrides): void {\n this._ignoreAnimationOverrides.push(ignore);\n }\n\n /** Overrides applied to features for which no other overrides are defined */\n public get defaultOverrides(): FeatureAppearance { return this._defaultOverrides; }\n /** Whether or not line weights are applied. If false, all lines are drawn with a weight of 1. */\n public get lineWeights(): boolean { return this._lineWeights; }\n\n /** A set of elements that are always invisible.\n * @note If an element is present in both `alwaysDrawn` and [[neverDrawn]], it will not be displayed - `neverDrawn` takes precedence.\n */\n public get neverDrawn() { return this._neverDrawn; }\n /** A set of elements that are unconditionally displayed.\n * @see [[isAlwaysDrawnExclusive]] to specify that *only* elements in this set will be displayed.\n * @note If an element is present in both `alwaysDrawn` and [[neverDrawn]], it will not be displayed - `neverDrawn` takes precedence.\n */\n public get alwaysDrawn() { return this._alwaysDrawn; }\n\n /** @internal */\n protected isNeverDrawn(elemIdLo: number, elemIdHi: number, animationNodeId: number): boolean {\n if (this._neverDrawn.has(elemIdLo, elemIdHi))\n return true;\n else\n return this.neverDrawnAnimationNodes.has(animationNodeId);\n }\n /** @internal */\n protected isAlwaysDrawn(idLo: number, idHi: number): boolean { return this._alwaysDrawn.has(idLo, idHi); }\n /** Returns true if the [SubCategory]($backend) specified by Id is in the set of visible subcategories. @internal */\n public isSubCategoryVisible(idLo: number, idHi: number): boolean { return this._visibleSubCategories.has(idLo, idHi); }\n /** @internal */\n public isSubCategoryVisibleInModel(subcatLo: number, subcatHi: number, modelLo: number, modelHi: number): boolean {\n if (this.ignoreSubCategory)\n return true;\n\n let vis = this.isSubCategoryVisible(subcatLo, subcatHi);\n const modelOvr = this._modelSubCategoryOverrides.get(modelLo, modelHi);\n if (undefined !== modelOvr && modelOvr.has(subcatLo, subcatHi))\n vis = !vis;\n\n return vis;\n }\n\n /** @internal */\n protected getModelOverrides(idLo: number, idHi: number): FeatureAppearance | undefined {\n return this._modelOverrides.get(idLo, idHi);\n }\n\n private getElementAnimationOverrides(idLo: number, idHi: number, animationNodeId: number): FeatureAppearance | undefined {\n if (this.animationNodeOverrides.size === 0)\n return undefined;\n\n // NB: An animation node Id of zero means \"not animated\". Some providers like EmphasizeElements may provide an appearance override for unanimated nodes.\n // That should be preserved.\n const app = this.animationNodeOverrides.get(animationNodeId);\n if (!app || 0 === animationNodeId || this._ignoreAnimationOverrides.length === 0)\n return app;\n\n const args = scratchIgnoreAnimationOverridesArgs;\n args.elementId.lower = idLo;\n args.elementId.upper = idHi;\n args.animationNodeId = animationNodeId;\n return this._ignoreAnimationOverrides.some((ignore) => ignore(args)) ? undefined : app;\n }\n\n /** @internal */\n protected getElementOverrides(idLo: number, idHi: number, animationNodeId: number): FeatureAppearance | undefined {\n const elemApp = this._elementOverrides.get(idLo, idHi);\n const nodeApp = this.getElementAnimationOverrides(idLo, idHi, animationNodeId);\n if (elemApp)\n return nodeApp ? nodeApp.extendAppearance(elemApp) : elemApp;\n\n return nodeApp;\n }\n\n /** @internal */\n protected getSubCategoryOverrides(idLo: number, idHi: number): FeatureAppearance | undefined { return this._subCategoryOverrides.get(idLo, idHi); }\n\n /** Add a [SubCategory]($backend) to the set of visible subcategories. */\n public setVisibleSubCategory(id: Id64String): void { this._visibleSubCategories.addId(id); }\n /** Specify the Id of an element that should never be drawn. */\n public setNeverDrawn(id: Id64String): void { this._neverDrawn.addId(id); }\n /** Specify the Id of an element that should always be drawn. */\n public setAlwaysDrawn(id: Id64String): void { this._alwaysDrawn.addId(id); }\n /** Specify the Id of a animation node that should never be drawn. */\n public setAnimationNodeNeverDrawn(id: number): void { this.neverDrawnAnimationNodes.add(id); }\n /** Specify the Ids of elements that should never be drawn. */\n public setNeverDrawnSet(ids: Iterable<Id64String>) { copyIdSetToUint32Set(this._neverDrawn, ids); }\n /** Specify the Ids of elements that should always be drawn. */\n public setAlwaysDrawnSet(ids: Iterable<Id64String>, exclusive: boolean, ignoreSubCategory = true) {\n copyIdSetToUint32Set(this._alwaysDrawn, ids);\n this.isAlwaysDrawnExclusive = exclusive;\n this.alwaysDrawnIgnoresSubCategory = ignoreSubCategory;\n }\n\n /** Returns the feature's appearance overrides, or undefined if the feature is not visible. */\n public getFeatureAppearance(feature: Feature, modelId: Id64String, type: BatchType = BatchType.Primary, animationNodeId = 0): FeatureAppearance | undefined {\n return this.getAppearance(\n Id64.getLowerUint32(feature.elementId), Id64.getUpperUint32(feature.elementId),\n Id64.getLowerUint32(feature.subCategoryId), Id64.getUpperUint32(feature.subCategoryId),\n feature.geometryClass,\n Id64.getLowerUint32(modelId), Id64.getUpperUint32(modelId),\n type, animationNodeId);\n }\n\n private static readonly _weight1Appearance = FeatureAppearance.fromJSON({ weight: 1 });\n\n /** Returns a feature's appearance overrides, or undefined if the feature is not visible.\n * Takes Id64s as pairs of unsigned 32-bit integers for efficiency, because that is how they are stored by the PackedFeatureTable associated with each batch of graphics.\n * @see [[getFeatureAppearance]] for an equivalent function that accepts [Id64String]($core-bentley)s instead of integer pairs.\n */\n public getAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined {\n if (BatchType.VolumeClassifier === type || BatchType.PlanarClassifier === type)\n return this.getClassifierAppearance(elemLo, elemHi, subcatLo, subcatHi, modelLo, modelHi, animationNodeId);\n\n let app = !this._lineWeights ? FeatureOverrides._weight1Appearance : FeatureAppearance.defaults;\n const modelApp = this.getModelOverrides(modelLo, modelHi);\n if (undefined !== modelApp)\n app = modelApp.extendAppearance(app);\n\n // Is the element visible?\n let elemApp, alwaysDrawn = false;\n\n if (Id64.isValidUint32Pair(elemLo, elemHi)) {\n if (this.isNeverDrawn(elemLo, elemHi, animationNodeId))\n return undefined;\n\n alwaysDrawn = this.isAlwaysDrawn(elemLo, elemHi);\n if (!alwaysDrawn && this.isAlwaysDrawnExclusive)\n return undefined;\n\n // Element overrides take precedence\n elemApp = this.getElementOverrides(elemLo, elemHi, animationNodeId);\n if (undefined !== elemApp)\n app = undefined !== modelApp ? elemApp.extendAppearance(app) : elemApp;\n }\n\n let subCatApp;\n if (!this.ignoreSubCategory && Id64.isValidUint32Pair(subcatLo, subcatHi)) {\n if ((!alwaysDrawn || !this.alwaysDrawnIgnoresSubCategory) && !this.isSubCategoryVisibleInModel(subcatLo, subcatHi, modelLo, modelHi))\n return undefined;\n\n subCatApp = this.getSubCategoryOverrides(subcatLo, subcatHi);\n if (undefined !== subCatApp)\n app = subCatApp.extendAppearance(app);\n }\n\n // Only apply default if *no* appearance was explicitly registered (doesn't matter if registered appearance does not actually override anything)\n if (undefined === elemApp && undefined === modelApp && undefined === subCatApp)\n app = this._defaultOverrides.extendAppearance(app);\n\n let visible = alwaysDrawn || this.isClassVisible(geomClass);\n if (visible && app.isFullyTransparent)\n visible = false; // don't bother rendering something with full transparency...\n\n return visible ? app : undefined;\n }\n\n /** Classifiers behave totally differently...in particular they are never invisible unless fully-transparent.\n * @internal\n */\n protected getClassifierAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, modelLo: number, modelHi: number, animationNodeId: number): FeatureAppearance | undefined {\n let app = FeatureAppearance.defaults;\n const modelApp = this.getModelOverrides(modelLo, modelHi);\n if (undefined !== modelApp)\n app = modelApp.extendAppearance(app);\n\n const elemApp = this.getElementOverrides(elemLo, elemHi, animationNodeId);\n if (undefined !== elemApp)\n app = undefined !== modelApp ? elemApp.extendAppearance(app) : elemApp;\n\n if (!this.ignoreSubCategory && Id64.isValidUint32Pair(subcatLo, subcatHi)) {\n const subCat = this.getSubCategoryOverrides(subcatLo, subcatHi);\n if (undefined !== subCat)\n app = subCat.extendAppearance(app);\n }\n\n if (undefined === elemApp && undefined === modelApp)\n app = this._defaultOverrides.extendAppearance(app);\n\n // NB: A fully-transparent classifier means the classifier is a clip mask - classified pixels will be discarded.\n return app;\n }\n\n /** Return whether geometry of the specified class should be drawn.\n * @see [[ViewFlags.constructions]], [[ViewFlags.dimensions]], and [[ViewFlags.patterns]].\n */\n public isClassVisible(geomClass: GeometryClass): boolean {\n switch (geomClass) {\n case GeometryClass.Construction: return this._constructions;\n case GeometryClass.Dimension: return this._dimensions;\n case GeometryClass.Pattern: return this._patterns;\n default: return true;\n }\n }\n\n /** Specify overrides for all elements belonging to a specified [GeometricModel]($backend), or all geometry belonging to a specified [GeometricElement]($backend) or [SubCategory]($backend). */\n public override(args: OverrideFeatureAppearanceArgs): void {\n let id: Id64String;\n let map: Id64.Uint32Map<FeatureAppearance>;\n if (undefined !== args.elementId) {\n id = args.elementId;\n map = this._elementOverrides;\n } else if (undefined !== args.modelId) {\n id = args.modelId;\n map = this._modelOverrides;\n } else {\n id = args.subCategoryId;\n map = this._subCategoryOverrides;\n }\n\n let app = args.appearance;\n const idLo = Id64.getLowerUint32(id);\n const idHi = Id64.getUpperUint32(id);\n\n if (undefined !== args.elementId && this.isNeverDrawn(idLo, idHi, 0))\n return;\n\n const replace = \"replace\" === args.onConflict;\n const existing = replace ? undefined : map.get(idLo, idHi);\n if (existing) {\n assert(\"replace\" !== args.onConflict);\n switch (args.onConflict) {\n case \"skip\":\n return;\n case \"extend\":\n app = app.extendAppearance(existing);\n break;\n default:\n app = existing.extendAppearance(app);\n break;\n }\n }\n\n map.set(idLo, idHi, app);\n }\n\n /** Specify overrides for all elements within the specified model.\n * @param id The Id of the model.\n * @param app The symbology overrides.\n * @param replaceExisting Specifies whether to replace a pre-existing override for the same model.\n * @note These overrides take priority over all other overrides.\n * @note If [[defaultOverrides]] are defined, they will not apply to any element within this model, even if the supplied appearance overrides nothing.\n * @deprecated in 3.x. Use [[FeatureOverrides.override]].\n */\n public overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {\n this.override({ modelId: id, appearance: app, onConflict: replaceExisting ? \"replace\" : \"skip\" });\n }\n\n /** Specify overrides for all geometry belonging to the specified [SubCategory]($backend).\n * @param id The Id of the subcategory.\n * @param app The symbology overrides.\n * @param replaceExisting Specifies whether to replace a pre-existing override for the same subcategory.\n * @note These overrides have lower priority than element and model overrides.\n * @note If [[defaultOverrides]] are defined, they will not apply to any geometry within this subcategory, even if the supplied appearance overrides nothing.\n * @deprecated in 3.x. Use [[FeatureOverrides.override]].\n */\n public overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {\n this.override({ subCategoryId: id, appearance: app, onConflict: replaceExisting ? \"replace\" : \"skip\" });\n }\n\n /** Specify overrides for all geometry originating from the specified element.\n * @param id The Id of the element.\n * @param app The symbology overrides.\n * @param replaceExisting Specifies whether to replace a pre-existing override for the same element.\n * @note These overrides take precedence over subcategory overrides, but not over model overrides.\n * @note If [[defaultOverrides]] are defined, they will not apply to this element, even if the supplied appearance overrides nothing.\n * @deprecated in 3.x. Use [[FeatureOverrides.override]].\n */\n public overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {\n this.override({ elementId: id, appearance: app, onConflict: replaceExisting ? \"replace\" : \"skip\" });\n }\n\n /** Specify overrides for all geometry originating from the specified animation node.\n * @param id The Id of the animation node.\n * @param app The symbology overrides.\n * @note These overrides do not take precedence over element overrides.\n */\n public overrideAnimationNode(id: number, app: FeatureAppearance): void {\n this.animationNodeOverrides.set(id, app);\n }\n\n /** Defines a default appearance to be applied to any [[Feature]] *not* explicitly overridden.\n * @param appearance The symbology overrides.\n * @param replaceExisting Specifies whether to replace the current default overrides if they are already defined.\n */\n public setDefaultOverrides(appearance: FeatureAppearance, replaceExisting: boolean = true): void {\n if (replaceExisting || !appearance.overridesSymbology)\n this._defaultOverrides = appearance;\n }\n\n /** Get the display priority of a subcategory. This is only relevant when using [[PlanProjectionSettings]].\n * @internal\n */\n public getSubCategoryPriority(idLo: number, idHi: number): number {\n return this._subCategoryPriorities.get(idLo, idHi) ?? 0;\n }\n\n /** Adds all fully transparent elements to the _neverDrawn set. This is used for BatchedModels planar masks.\n * @internal\n */\n public addInvisibleElementOverridesToNeverDrawn(): void {\n this._elementOverrides.forEach((lo, hi) => {\n const app = this.getElementOverrides(lo, hi, 0);\n if (app?.isFullyTransparent)\n this._neverDrawn.add(lo, hi);\n });\n }\n\n /** Construct a new Overrides that overrides nothing.\n * @see [FeatureSymbology.Overrides]($frontend) to construct overrides based on a [ViewState]($frontend) or [Viewport]($frontend).\n */\n public constructor() {\n //\n }\n\n /** Returns true if geometry belonging to the specified subcategory will be drawn. */\n public isSubCategoryIdVisible(id: Id64String): boolean { return this.isSubCategoryVisible(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }\n /** Returns the overrides applied to geometry belonging to the specified model, if any such are defined. */\n public getModelOverridesById(id: Id64String): FeatureAppearance | undefined { return this.getModelOverrides(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }\n /** Returns the overrides applied to geometry belonging to the specified element, if any such are defined. */\n public getElementOverridesById(id: Id64String): FeatureAppearance | undefined { return this.getElementOverrides(Id64.getLowerUint32(id), Id64.getUpperUint32(id), 0); }\n /** Returns the overrides applied to geometry belonging to the specified subcategory, if any such are defined. */\n public getSubCategoryOverridesById(id: Id64String): FeatureAppearance | undefined { return this.getSubCategoryOverrides(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }\n\n /** Returns true if the specified Feature will be drawn. */\n public isFeatureVisible(feature: Feature): boolean {\n const { elementId, subCategoryId, geometryClass } = feature;\n const isValidElemId = !Id64.isInvalid(elementId);\n const elemIdParts = isValidElemId ? Id64.getUint32Pair(elementId) : undefined;\n\n if (undefined !== elemIdParts && this.isNeverDrawn(elemIdParts.lower, elemIdParts.upper, 0))\n return false;\n\n const alwaysDrawn = undefined !== elemIdParts && this.isAlwaysDrawn(elemIdParts.lower, elemIdParts.upper);\n if (alwaysDrawn || this.isAlwaysDrawnExclusive)\n return alwaysDrawn;\n\n // NB: This ignores per-model subcategory visibility overrides, because caller did not specify a model.\n if (!this.isSubCategoryIdVisible(subCategoryId))\n return false;\n\n return this.isClassVisible(geometryClass);\n }\n}\n\n/** Interface adopted by an object that can supply the [[FeatureAppearance]] supplied by a [[FeatureAppearanceSource]].\n * This is useful for selectively overriding or agumenting a [Viewport]($frontend)'s symbology overrides.\n * A typical implementation will invoke [[FeatureAppearanceSource.getAppearance]] and customize the returned appearance.\n * @see [[FeatureAppearanceProvider.chain]] to chain two providers together.\n * @public\n * @extensions\n */\nexport interface FeatureAppearanceProvider {\n /** Supply the desired appearance overrides for the specified [[Feature]], or `undefined` if the feature should not be drawn.\n * The feature is described by its components for efficiency reasons.\n * @param source The base symbology overrides, e.g., typically defined by a [Viewport]($frontend).\n * @param elemLo The lower 32 bits of the feature's element Id.\n * @param elemHi The upper 32 bits of the feature's element Id.\n * @param subcatLo The lower 32 bits of the feature's subcategory Id.\n * @param subcatHi The upper 32 bits of the feature's subcategory Id.\n * @param geomClass The geometry class of the feature.\n * @param modelLo The lower 32 bits of the feature's model Id.\n * @param modelHi The upper 32 bits of the feature's model Id.\n * @param type The type of batch to which the feature belongs.\n * @param animationNodeId The Id of the corresponding node in the [[RenderSchedule]], or `0` if none.\n * @returns The desired appearance overrides, or `undefined` to indicate the feature should not be displayed.\n * @see [[FeatureAppearanceSource.getAppearance]] to forward the request to the source.\n * @see [Id64.isValidUint32Pair]($core-bentley) to determine if the components of an [Id64String]($core-bentley) represent a valid Id.\n */\n getFeatureAppearance(source: FeatureAppearanceSource, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined;\n}\n\n/** @public */\nexport namespace FeatureAppearanceProvider {\n /** Produce a FeatureAppearanceSource for which `getAppearance()` returns the appearance specified in `source`, potentially modified by `provider`. */\n function wrap(source: FeatureAppearanceSource, provider: FeatureAppearanceProvider): FeatureAppearanceSource {\n return {\n getAppearance: (elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number) => {\n return provider.getFeatureAppearance(source, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\n },\n };\n }\n\n /** Create a provider that obtains each feature's appearance from the source, and if the feature is visible, modifies the appearance.\n * @param supplementAppearance A function accepting the feature's base appearance and returning a supplemental appearance.\n * @public\n */\n export function supplement(supplementAppearance: (appearance: FeatureAppearance) => FeatureAppearance): FeatureAppearanceProvider {\n return {\n getFeatureAppearance: (source: FeatureAppearanceSource, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number) => {\n const app = source.getAppearance(elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\n return app ? supplementAppearance(app) : app;\n },\n };\n }\n\n /** Chain two FeatureAppearanceProviders together such that `first`'s `getFeatureAppearance` function is applied before `second`'s.\n * If `second` invokes `source.getAppearance()`, the returned appearance will include any modifications applied by `first`.\n * @public\n */\n export function chain(first: FeatureAppearanceProvider, second: FeatureAppearanceProvider): FeatureAppearanceProvider {\n if (first === second)\n return first;\n\n return {\n getFeatureAppearance: (source: FeatureAppearanceSource, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number) => {\n return second.getFeatureAppearance(wrap(source, first), elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\n },\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../src/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+D;AAC/D,iDAAoD;AAEpD,qDAAiD;AAEjD,yCAAqD;AAGrD,SAAS,oBAAoB,CAAC,GAAmB,EAAE,GAAqB;IACtE,GAAG,CAAC,KAAK,EAAE,CAAC;IACZ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,EAAE,IAAI,GAAG;YAClB,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AA+BD,S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e,EAAE,IAAe,EAAE,eAAuB,EAAE,EAAE;gBAClO,OAAO,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;YAClJ,CAAC;SACF,CAAC;IACJ,CAAC;IATe,+BAAK,QASpB,CAAA;AACH,CAAC,EArCgB,yBAAyB,yCAAzB,yBAAyB,QAqCzC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { BatchType, Feature } from \"./FeatureTable\";\r\nimport { ColorDef } from \"./ColorDef\";\r\nimport { GeometryClass } from \"./GeometryParams\";\r\nimport { LinePixels } from \"./LinePixels\";\r\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\r\nimport { SubCategoryOverride } from \"./SubCategoryOverride\";\r\n\r\nfunction copyIdSetToUint32Set(dst: Id64.Uint32Set, src: Iterable<string>): void {\r\n dst.clear();\r\n if (typeof src === \"string\") {\r\n dst.addId(src);\r\n } else {\r\n for (const id of src)\r\n dst.addId(id);\r\n }\r\n}\r\n\r\n// cspell:ignore subcat subcats\r\n\r\n/** JSON representation of a [[FeatureAppearance]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FeatureAppearanceProps {\r\n /** See [[FeatureAppearance.rgb]]. */\r\n rgb?: RgbColorProps;\r\n /** See [[FeatureAppearance.lineRgb]]. */\r\n lineRgb?: RgbColorProps | false;\r\n /** See [[FeatureAppearance.weight]]. */\r\n weight?: number;\r\n /** See [[FeatureAppearance.transparency]]. */\r\n transparency?: number;\r\n /** See [[FeatureAppearance.lineTransparency]]. */\r\n lineTransparency?: number | false;\r\n /** See [[FeatureAppearance.viewDependentTransparency]]. */\r\n viewDependentTransparency?: true;\r\n /** See [[FeatureAppearance.linePixels]]. */\r\n linePixels?: LinePixels;\r\n /** See [[FeatureAppearance.ignoresMaterial]]. */\r\n ignoresMaterial?: true;\r\n /** See [[FeatureAppearance.nonLocatable]]. */\r\n nonLocatable?: true;\r\n /** See [[FeatureAppearance.emphasized]]. */\r\n emphasized?: true;\r\n}\r\n\r\nfunction propsMatchDefaults(props: FeatureAppearanceProps): boolean {\r\n return !props.rgb && !props.lineRgb\r\n && undefined === props.weight && undefined === props.linePixels\r\n && undefined === props.transparency && undefined === props.lineTransparency\r\n && !props.ignoresMaterial && !props.nonLocatable && !props.emphasized;\r\n}\r\n\r\nfunction equalRgb(a: RgbColor | undefined, b: RgbColor | undefined): boolean {\r\n if (a === b) {\r\n return true;\r\n } else if (!a || !b) {\r\n return false;\r\n } else {\r\n return a.equals(b);\r\n }\r\n}\r\n\r\nfunction equalLineRgb(a: RgbColor | false | undefined, b: RgbColor | false | undefined): boolean {\r\n if (a === b) {\r\n return true;\r\n } else if (a instanceof RgbColor && b instanceof RgbColor) {\r\n return equalRgb(a, b);\r\n } else {\r\n assert(a === undefined || a === false);\r\n assert(b === undefined || b === false);\r\n return false;\r\n }\r\n}\r\n\r\nfunction equalTransparency(a: number | undefined, b: number | undefined): boolean {\r\n if (a === b) {\r\n return true;\r\n } else if (undefined === a || undefined === b) {\r\n return false;\r\n } else {\r\n return Math.floor(a * 0xff) === Math.floor(b * 0xff);\r\n }\r\n}\r\n\r\nfunction equalLineTransparency(a: number | false | undefined, b: number | false | undefined): boolean {\r\n if (a === b) {\r\n return true;\r\n } else if (typeof a === \"number\" && typeof b === \"number\") {\r\n return equalTransparency(a, b);\r\n } else {\r\n assert(a === undefined || a === false);\r\n assert(b === undefined || b === false);\r\n return false;\r\n }\r\n}\r\n\r\nfunction transparencyFromJSON(transp: number | undefined): number | undefined {\r\n if (undefined === transp) {\r\n return undefined;\r\n }\r\n\r\n transp = Math.max(0, Math.min(transp, 1));\r\n\r\n // Fix up rounding errors...\r\n const smallDelta = 0.0001;\r\n if (1.0 - transp < smallDelta) {\r\n transp = 1.0;\r\n } else if (transp < smallDelta) {\r\n transp = 0.0;\r\n }\r\n\r\n return transp;\r\n}\r\n\r\n/** Defines overrides for selected aspects of a [[Feature]]'s symbology.\r\n * Any member defined in the appearance overrides that aspect of symbology for all [[Feature]]s to which the appearance is applied.\r\n *\r\n * The [[rgb]] and [[transparency]] overrides, if defined, apply to all geometry by default.\r\n * However, the color and transparency of \"linear\" geometry can optionally be controlled independently from the rest of the geometry via [[lineRgb]] and [[lineTransparency]].\r\n * Linear geometry consists of any of the following:\r\n * - Curves and line strings;\r\n * - Points and point strings; and\r\n * - The outlines of planar regions.\r\n * The edges of 3d surfaces like spheres are not considered linear geometry.\r\n *\r\n * @see [[FeatureOverrides]] to customize the appearance of multiple features.\r\n * @public\r\n */\r\nexport class FeatureAppearance {\r\n /** Overrides the feature's color.\r\n * If [[lineRgb]] is `undefined`, this color also applies to linear geometry.\r\n */\r\n public readonly rgb?: RgbColor;\r\n /** If defined, overrides the color of linear geometry independently of [[rgb]].\r\n * If `false`, linear geometry draws using its normal color; otherwise, it uses the specified color.\r\n */\r\n public readonly lineRgb?: RgbColor | false;\r\n /** The width of lines and edges in pixels as an integer in [1, 31]. */\r\n public readonly weight?: number;\r\n /** The transparency in the range [0, 1] where 0 indicates fully opaque and 1 indicates fully transparent.\r\n * If [[lineTransparency]] is `undefined`, this transparency also applies to linear geometry.\r\n * @see [[viewDependentTransparency]] for details on how this override interacts with the [DisplayStyle]($backend).\r\n */\r\n public readonly transparency?: number;\r\n /** If defined, overrides the transparency of linear geometry independently of [[transparency]].\r\n * If `false`, linear geometry draws using its normal transparency; otherwise, it uses the specified transparency.\r\n * @see [[viewDependentTransparency]] for details on how this override interacts with the [DisplayStyle]($backend).\r\n */\r\n public readonly lineTransparency?: number | false;\r\n /** The pixel pattern applied to lines and edges. */\r\n public readonly linePixels?: LinePixels;\r\n /** If true, don't apply the [[RenderMaterial]] to the feature's surfaces. */\r\n public readonly ignoresMaterial?: true;\r\n /** If true, the feature will not be drawn when using [Viewport.readPixels]($frontend), meaning [Tool]($frontend)s will not be able to interact with it. */\r\n public readonly nonLocatable?: true;\r\n /** If true, the feature will be rendered using the [[Hilite.Settings]] defined by [Viewport.emphasisSettings]($frontend) to make it stand out. */\r\n public readonly emphasized?: true;\r\n /** If true, then [[transparency]] and/or [[lineTransparency]] will only be applied if [[ViewFlags.transparency]] is enabled and the current [[RenderMode]] supports transparency.\r\n * Default: false, meaning the transparency will be applied regardless of view flags or render mode.\r\n * This property has no effect if this appearance does not override transparency.\r\n */\r\n public readonly viewDependentTransparency?: true;\r\n\r\n /** An appearance that overrides nothing. */\r\n public static readonly defaults = new FeatureAppearance({});\r\n\r\n public static fromJSON(props?: FeatureAppearanceProps) {\r\n if (!props || propsMatchDefaults(props)) {\r\n return this.defaults;\r\n }\r\n\r\n return new FeatureAppearance(props);\r\n }\r\n\r\n /** Create a FeatureAppearance that overrides only the RGB color.\r\n * @note The transparency component of the ColorDef is ignored.\r\n */\r\n public static fromRgb(color: ColorDef): FeatureAppearance {\r\n return new FeatureAppearance({ rgb: RgbColor.fromColorDef(color) });\r\n }\r\n\r\n /** Create a FeatureAppearance that overrides the RGB and transparency.\r\n * The appearance's transparency is derived from the transparency component of the ColorDef.\r\n */\r\n public static fromRgba(color: ColorDef, viewDependentTransparency = false): FeatureAppearance {\r\n return new FeatureAppearance({\r\n rgb: RgbColor.fromColorDef(color),\r\n transparency: color.colors.t / 255,\r\n viewDependentTransparency: viewDependentTransparency ? true : undefined,\r\n });\r\n }\r\n /** Create a FeatureAppearance that overrides only the transparency */\r\n public static fromTransparency(transparencyValue: number, viewDependent = false): FeatureAppearance {\r\n return new FeatureAppearance({\r\n transparency: transparencyValue,\r\n viewDependentTransparency: viewDependent ? true : undefined,\r\n });\r\n }\r\n\r\n /** Create a FeatureAppearance with overrides corresponding to those defined by the supplied SubCategoryOverride.\r\n * @note Subcategory overrides set [[viewDependentTransparency]] to `true`.\r\n */\r\n public static fromSubCategoryOverride(ovr: SubCategoryOverride): FeatureAppearance {\r\n const rgb = undefined !== ovr.color ? RgbColor.fromColorDef(ovr.color) : undefined;\r\n const transparency = ovr.transparency;\r\n const weight = ovr.weight;\r\n const ignoresMaterial = undefined !== ovr.material && Id64.isValid(ovr.material) ? true : undefined;\r\n return this.fromJSON({ rgb, transparency, weight, ignoresMaterial, viewDependentTransparency: true });\r\n }\r\n\r\n /** Returns true if this appearance does not override any aspects of symbology. */\r\n public get matchesDefaults(): boolean {\r\n return this.equals(FeatureAppearance.defaults);\r\n }\r\n\r\n public get overridesRgb(): boolean { return undefined !== this.rgb; }\r\n public get overridesTransparency(): boolean { return undefined !== this.transparency; }\r\n public get overridesLinePixels(): boolean { return undefined !== this.linePixels; }\r\n public get overridesWeight(): boolean { return undefined !== this.weight; }\r\n\r\n /** Get the color that will be applied to linear geometry, or undefined if not overridden.\r\n * This is the same as [[rgb]] if [[lineRgb]] is `undefined`.\r\n */\r\n public getLineRgb(): RgbColor | undefined {\r\n return false !== this.lineRgb ? (this.lineRgb ?? this.rgb) : undefined;\r\n }\r\n\r\n /** Get the transparency that will be applied to linear geometry, or undefined if not overridden.\r\n * This is the same as [[transparency]] if [[lineTransparency]] is `undefined`.\r\n */\r\n public getLineTransparency(): number | undefined {\r\n return false !== this.lineTransparency ? (this.lineTransparency ?? this.transparency) : undefined;\r\n }\r\n\r\n public get overridesSymbology(): boolean {\r\n return this.overridesRgb || this.overridesTransparency || this.overridesWeight || this.overridesLinePixels || !!this.ignoresMaterial\r\n || this.emphasized || this.overridesNonLocatable\r\n || undefined !== this.getLineRgb() || undefined !== this.getLineTransparency();\r\n }\r\n\r\n public get overridesNonLocatable(): boolean { return undefined !== this.nonLocatable; }\r\n\r\n public get isFullyTransparent(): boolean {\r\n const surf = this.transparency ?? 0;\r\n const line = this.getLineTransparency() ?? 0;\r\n return surf >= 1 && line >= 1;\r\n }\r\n\r\n /** Returns true if any aspect of the appearance is overridden (i.e., if any member is not undefined). */\r\n public get anyOverridden(): boolean { return this.overridesSymbology || this.overridesNonLocatable; }\r\n\r\n public equals(other: FeatureAppearance): boolean {\r\n if (this === other)\r\n return true;\r\n\r\n return equalRgb(this.rgb, other.rgb)\r\n && this.weight === other.weight\r\n && equalTransparency(this.transparency, other.transparency)\r\n && this.linePixels === other.linePixels\r\n && this.ignoresMaterial === other.ignoresMaterial\r\n && this.nonLocatable === other.nonLocatable\r\n && this.emphasized === other.emphasized\r\n && this.viewDependentTransparency === other.viewDependentTransparency\r\n && equalLineTransparency(this.lineTransparency, other.lineTransparency)\r\n && equalLineRgb(this.lineRgb, other.lineRgb);\r\n }\r\n\r\n public toJSON(): FeatureAppearanceProps {\r\n const props: FeatureAppearanceProps = {};\r\n if (this.rgb)\r\n props.rgb = this.rgb.toJSON();\r\n\r\n if (undefined !== this.weight)\r\n props.weight = this.weight;\r\n\r\n if (undefined !== this.transparency) {\r\n props.transparency = this.transparency;\r\n if (this.viewDependentTransparency)\r\n props.viewDependentTransparency = true;\r\n }\r\n\r\n if (undefined !== this.linePixels)\r\n props.linePixels = this.linePixels;\r\n\r\n if (true === this.ignoresMaterial)\r\n props.ignoresMaterial = true;\r\n\r\n if (true === this.nonLocatable)\r\n props.nonLocatable = true;\r\n\r\n if (true === this.emphasized)\r\n props.emphasized = true;\r\n\r\n if (undefined !== this.lineTransparency)\r\n props.lineTransparency = this.lineTransparency;\r\n\r\n if (this.lineRgb) {\r\n props.lineRgb = this.lineRgb;\r\n if (this.viewDependentTransparency)\r\n props.viewDependentTransparency = true;\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Convert this appearance to JSON, and override any properties explicitly specified by `changedProps` in the result.\r\n * Example:\r\n * ```ts\r\n * const base = FeatureAppearance.fromRgba(ColorDef.white); // transparency=0, rgb=white\r\n * const clone = base.cloneProps({ transparency: undefined, weight: 5 }); // transparency=undefined, rgb=white, weight=5\r\n * ```\r\n * @see [[FeatureAppearance.clone]].\r\n */\r\n public cloneProps(changedProps: FeatureAppearanceProps): FeatureAppearanceProps {\r\n return {\r\n ...this.toJSON(),\r\n ...changedProps,\r\n };\r\n }\r\n\r\n /** Create a copy of this appearance, overriding any properties explicitly specified by `changedProps`.\r\n * Example:\r\n * ```ts\r\n * const base = FeatureAppearance.fromRgba(ColorDef.white); // transparency=0, rgb=white\r\n * const clone = base.clone({ transparency: undefined, weight: 5 }); // transparency=undefined, rgb=white, weight=5\r\n * ```\r\n * @see [[FeatureAppearance.cloneProps]].\r\n */\r\n public clone(changedProps: FeatureAppearanceProps): FeatureAppearance {\r\n return FeatureAppearance.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** Produce a FeatureAppearance from the supplied appearance in which any aspect not defined by the base appearance is overridden by this appearance. */\r\n public extendAppearance(base: FeatureAppearance): FeatureAppearance {\r\n if (!this.overridesSymbology)\r\n return base;\r\n\r\n const props = base.toJSON();\r\n if (undefined === props.rgb)\r\n props.rgb = this.rgb;\r\n if (undefined === props.transparency)\r\n props.transparency = this.transparency;\r\n if (undefined === props.linePixels)\r\n props.linePixels = this.linePixels;\r\n if (undefined === props.weight)\r\n props.weight = this.weight;\r\n if (undefined === props.ignoresMaterial && this.ignoresMaterial)\r\n props.ignoresMaterial = true;\r\n if (undefined === props.nonLocatable && this.nonLocatable)\r\n props.nonLocatable = true;\r\n if (undefined === props.emphasized && this.emphasized)\r\n props.emphasized = true;\r\n if (!props.lineRgb)\r\n props.lineRgb = this.lineRgb;\r\n if (undefined === props.lineTransparency)\r\n props.lineTransparency = this.lineTransparency;\r\n\r\n if (this.viewDependentTransparency && (undefined !== props.transparency || undefined !== props.lineTransparency))\r\n props.viewDependentTransparency = true;\r\n\r\n return FeatureAppearance.fromJSON(props);\r\n }\r\n\r\n protected constructor(props: FeatureAppearanceProps) {\r\n this.rgb = undefined !== props.rgb ? RgbColor.fromJSON(props.rgb) : undefined;\r\n this.lineRgb = typeof props.lineRgb === \"object\" ? RgbColor.fromJSON(props.lineRgb) : (false === props.lineRgb ? false : undefined);\r\n\r\n this.transparency = transparencyFromJSON(props.transparency);\r\n this.lineTransparency = typeof props.lineTransparency === \"number\" ? transparencyFromJSON(props.lineTransparency) : (false === props.lineTransparency ? false : undefined);\r\n\r\n this.weight = props.weight;\r\n this.linePixels = props.linePixels;\r\n\r\n this.ignoresMaterial = props.ignoresMaterial;\r\n this.nonLocatable = props.nonLocatable;\r\n this.emphasized = props.emphasized;\r\n\r\n if (undefined !== this.weight) {\r\n this.weight = Math.max(1, Math.min(this.weight, 32));\r\n }\r\n\r\n if (props.viewDependentTransparency && (undefined !== this.transparency || undefined !== this.getLineTransparency())) {\r\n this.viewDependentTransparency = true;\r\n }\r\n }\r\n}\r\n\r\n/** Interface adopted by an object that can supply a [[FeatureAppearance]] given a low-level description of a [[Feature]].\r\n * @see [[FeatureOverrides]] for the commonly-used implementation.\r\n * @see [[FeatureAppearanceProvider]] to supplement the appearance supplied by this interface.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FeatureAppearanceSource {\r\n /** Supplies the desired appearance overrides for the specified [[Feature]], or `undefined` if the feature should not be drawn.\r\n * The feature is described by its components for efficiency reasons.\r\n * @param elemLo The lower 32 bits of the feature's element Id.\r\n * @param elemHi The upper 32 bits of the feature's element Id.\r\n * @param subcatLo The lower 32 bits of the feature's subcategory Id.\r\n * @param subcatHi The upper 32 bits of the feature's subcategory Id.\r\n * @param geomClass The geometry class of the feature.\r\n * @param modelLo The lower 32 bits of the feature's model Id.\r\n * @param modelHi The upper 32 bits of the feature's model Id.\r\n * @param type The type of batch to which the feature belongs.\r\n * @param animationNodeId The Id of the corresponding node in the [[RenderSchedule]], or `0` if none.\r\n * @returns The desired appearance overrides, or `undefined` to indicate the feature should not be displayed.\r\n * @see [Id64.isValidUint32Pair]($core-bentley) to determine if the components of an [Id64String]($core-bentley) represent a valid Id.\r\n */\r\n getAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined;\r\n}\r\n\r\n/** Common options for [[FeatureOverrides.override]].\r\n * @public\r\n */\r\nexport interface OverrideFeatureAppearanceOptions {\r\n /** Specifies the aspects of the [[Feature]]'s appearance to be overridden. */\r\n appearance: FeatureAppearance;\r\n /** Specifies what to do if a [[FeatureAppearance]] has already been configured for the specified element, model, or subcategory by a previous call to [[FeatureOverrides.override]].\r\n * - \"subsume\" (the default): Merge the two appearances using the logic described by [[FeatureAppearance.extendAppearance]] such that any aspect overridden by the existing appearance will be overwritten\r\n * if also overridden by [[appearance]].\r\n * - The resulting appearance is computed as `existingAppearance.extendAppearance(newAppearance)`.\r\n * - \"extend\": Merge the two appearances using the logic described by [[FeatureAppearance.extendAppearance]] such that any aspect overridden by [[appearance]] will only\r\n * apply if that aspect is not already overridden by a previous appearance.\r\n * - The resulting appearance is computed as `newAppearance.extendAppearance(existingAppearance)`.\r\n * - \"replace\": Completely replace the existing appearance with [[appearance]].\r\n * - \"skip\": Keep the existing appearance.\r\n */\r\n onConflict?: \"extend\" | \"subsume\" | \"replace\" | \"skip\";\r\n}\r\n\r\n/** Options for using [[FeatureOverrides.override]] to override the appearance of a [GeometricModel]($backend).\r\n * @public\r\n */\r\nexport interface OverrideModelAppearanceOptions extends OverrideFeatureAppearanceOptions {\r\n /** The Id of the model whose appearance is to be overridden. */\r\n modelId: Id64String;\r\n /** @internal */\r\n elementId?: never;\r\n /** @internal */\r\n subCategoryId?: never;\r\n}\r\n\r\n/** Options for using [[FeatureOverrides.override]] to override the appearance of a [GeometricElement]($backend).\r\n * @public\r\n */\r\nexport interface OverrideElementAppearanceOptions extends OverrideFeatureAppearanceOptions {\r\n /** The Id of the element whose appearance is to be overridden. */\r\n elementId: Id64String;\r\n /** @internal */\r\n modelId?: never;\r\n /** @internal */\r\n subCategoryId?: never;\r\n}\r\n\r\n/** Options for using [[FeatureOverrides.override]] to override the appearance of a [SubCategory]($backend).\r\n * @public\r\n */\r\nexport interface OverrideSubCategoryAppearanceOptions extends OverrideFeatureAppearanceOptions {\r\n /** The Id of the subcategory whose appearance is to be overridden. */\r\n subCategoryId: Id64String;\r\n /** @internal */\r\n modelId?: never;\r\n /** @internal */\r\n elementId?: never;\r\n}\r\n\r\n/** Arguments supplied to [[FeatureOverrides.override]].\r\n * @public\r\n */\r\nexport type OverrideFeatureAppearanceArgs = OverrideElementAppearanceOptions | OverrideModelAppearanceOptions | OverrideSubCategoryAppearanceOptions;\r\n\r\n/** Arguments provided to a function of type [[IgnoreAnimationOverrides]].\r\n * @see [[FeatureOverrides.ignoreAnimationOverrides]] to register such a function.\r\n * @public\r\n */\r\nexport interface IgnoreAnimationOverridesArgs {\r\n /** The Id of the element under consideration.\r\n * @see [Id64.fromUint32Pair]($bentley) to convert a Uint32Pair into an [Id64String]($bentley), if needed.\r\n */\r\n readonly elementId: Readonly<Id64.Uint32Pair>;\r\n /** The [[RenderSchedule.ElementTimeline.batchId]] identifying the [[RenderSchedule.ElementTimeline]] to which the element under consideration belongs. */\r\n readonly animationNodeId: number;\r\n}\r\n\r\n/** A function that can be supplied to [[FeatureOverrides.ignoreAnimationOverrides]] to indicate whether the color or transparency overrides defined\r\n * by the view's [[RenderSchedule.Script]] should be ignored. The arguments describe the element under consideration. The function should return true if that\r\n * element should not have its color or transparency modified by the schedule script.\r\n * @public\r\n */\r\nexport type IgnoreAnimationOverrides = (args: IgnoreAnimationOverridesArgs) => boolean;\r\n\r\nconst scratchIgnoreAnimationOverridesArgs = {\r\n elementId: { lower: 0, upper: 0 },\r\n animationNodeId: 0,\r\n};\r\n\r\n/** Specifies how to customize the appearance of individual [[Feature]]s, typically within the context of a [Viewport]($frontend).\r\n * Individual aspects of a feature's appearance - like visibility, color, and transparency - are overridden by supplying a [[FeatureAppearance]].\r\n * Those overrides can be specified on the basis of the feature's model, element, and/or subcategory. A default set of overrides can also be specified to\r\n * apply to the appearance of any feature not otherwise overridden.\r\n *\r\n * It is possible to override multiple aspects of a feature on different bases. For example, you might specify that all features belonging to subcategory \"A\" should be drawn in red,\r\n * and that all features belonging to model \"B\" should be drawn 50% transparent. In this case, a feature belonging to both subcategory \"A\" and model \"B\" will be drawn as 50% transparent red -\r\n * the separate overrides are combined to produce the feature's overall appearance.\r\n *\r\n * In the case of conflicts, there is an order of precedence:\r\n * - Model overrides take highest precedence.\r\n * - Element overrides are of higher precedence than subcategory and animation overrides.\r\n * - Overrides applied by a [[RenderSchedule.Script]]'s [[RenderSchedule.ElementTimeline]] are of higher precedence than subcategory overrides, but can be suppressed on a per-element basis via [[ignoreAnimationOverrides]].\r\n * - Subcategory overrides have lowest precedence.\r\n *\r\n * For example, you might specify that all features belonging to subcategory \"A\" should be drawn in red, and all those belonging to model \"B\" should be drawn in green.\r\n * Then a feature belonging to subcategory \"A\" and model \"B\" will be drawn in green, because the model overrides take precedence.\r\n *\r\n * Instances of this class are not typically instantiated by an application directly; instead, an application can implement a [FeatureOverrideProvider]($frontend)\r\n * that augments the overrides supplied by a viewport.\r\n *\r\n * @see [FeatureSymbology.Overrides]($frontend) to create overrides specific to a [Viewport]($frontend) or [ViewState]($frontend).\r\n * @see [FeatureOverrideProvider]($frontend) to customize the appearance of features within a [Viewport]($frontend).\r\n * @public\r\n */\r\nexport class FeatureOverrides implements FeatureAppearanceSource {\r\n /** @internal */\r\n protected readonly _ignoreAnimationOverrides: IgnoreAnimationOverrides[] = [];\r\n /** Ids of elements that should never be drawn. This takes precedence over [[alwaysDrawn]]. @internal */\r\n protected readonly _neverDrawn = new Id64.Uint32Set();\r\n /** Ids of elements that should always be drawn. [[neverDrawn]] takes precedence over this set. @internal */\r\n protected readonly _alwaysDrawn = new Id64.Uint32Set();\r\n /** If true, no elements *except* those defined in the \"always drawn\" set will be drawn.\r\n * @see [[setAlwaysDrawn]]\r\n */\r\n public isAlwaysDrawnExclusive = false;\r\n /** If true, the always-drawn elements are drawn even if their subcategories are not visible.\r\n * @see [[setAlwaysDrawn]]\r\n */\r\n public alwaysDrawnIgnoresSubCategory = true;\r\n /** If true, all subcategories are considered visible. This is used for drawing sheets via section callouts in the absence of an actual sheet view.\r\n * @internal\r\n */\r\n public ignoreSubCategory = false;\r\n\r\n /** Overrides applied to any feature not explicitly overridden. @internal */\r\n protected _defaultOverrides = FeatureAppearance.defaults;\r\n /** Whether construction geometry should be drawn. @internal */\r\n protected _constructions = false;\r\n /** Whether dimensions should be drawn. @internal */\r\n protected _dimensions = false;\r\n /** Whether area patterns should be drawn. @internal */\r\n protected _patterns = false;\r\n /** Whether line weights should be applied. If false, all lines are rendered 1-pixel wide. @internal */\r\n protected _lineWeights = true;\r\n\r\n /** Overrides applied to all elements belonging to each model. @internal */\r\n protected readonly _modelOverrides = new Id64.Uint32Map<FeatureAppearance>();\r\n /** Overrides applied to specific elements. @internal */\r\n protected readonly _elementOverrides = new Id64.Uint32Map<FeatureAppearance>();\r\n /** Overrides applied to geometry belonging to each subcategory. @internal */\r\n protected readonly _subCategoryOverrides = new Id64.Uint32Map<FeatureAppearance>();\r\n /** The set of displayed subcategories. Geometry belonging to subcategories not included in this set will not be drawn. @internal */\r\n protected readonly _visibleSubCategories = new Id64.Uint32Set();\r\n /** Display priorities assigned to subcategories, possibly overridden by display style. Only applicable for plan projection models. @internal */\r\n protected readonly _subCategoryPriorities = new Id64.Uint32Map<number>();\r\n\r\n /** Per-model, a set of subcategories whose visibility should be inverted for elements within that model.\r\n * Populated by Viewport.\r\n * @internal\r\n */\r\n protected readonly _modelSubCategoryOverrides = new Id64.Uint32Map<Id64.Uint32Set>();\r\n\r\n /** Ids of animation nodes that should never be drawn.\r\n * @internal\r\n */\r\n public readonly neverDrawnAnimationNodes = new Set<number>();\r\n /** Mapping of animation node Ids to overrides applied to the corresponding animation nodes.\r\n * @internal\r\n */\r\n public readonly animationNodeOverrides = new Map<number, FeatureAppearance>();\r\n\r\n /** Accepts a criterion that determines whether color and transparency overrides originating from the view's [[RenderSchedule.Script]] should be ignored for a given element.\r\n * The function receives a description of the element in question and returns `true` if the script's overrides should be ignored.\r\n * Any number of such functions can be registered; if any one of them returns `true`, the script's overrides are not applied to the specified element.\r\n *\r\n * For example, applications commonly emphasize a set of elements by applying a [[FeatureAppearance.emphasized]] override to them, and specifying a highly-transparent\r\n * default appearance to de-emphasize the rest of the elements in the view. If some of the de-emphasized elements' appearances are also being overridden by the schedule script, then\r\n * they won't appear de-emphasized, making it difficult for the emphasized elements to stand out. In situations like this, [FeatureOverrideProvider]($frontend)s like [EmphasizeElements]($frontend) can register an [[IgnoreAnimationOverrides]] function that returns true if the element in question is not in the set of emphasized elements.\r\n */\r\n public ignoreAnimationOverrides(ignore: IgnoreAnimationOverrides): void {\r\n this._ignoreAnimationOverrides.push(ignore);\r\n }\r\n\r\n /** Overrides applied to features for which no other overrides are defined */\r\n public get defaultOverrides(): FeatureAppearance { return this._defaultOverrides; }\r\n /** Whether or not line weights are applied. If false, all lines are drawn with a weight of 1. */\r\n public get lineWeights(): boolean { return this._lineWeights; }\r\n\r\n /** A set of elements that are always invisible.\r\n * @note If an element is present in both `alwaysDrawn` and [[neverDrawn]], it will not be displayed - `neverDrawn` takes precedence.\r\n */\r\n public get neverDrawn() { return this._neverDrawn; }\r\n /** A set of elements that are unconditionally displayed.\r\n * @see [[isAlwaysDrawnExclusive]] to specify that *only* elements in this set will be displayed.\r\n * @note If an element is present in both `alwaysDrawn` and [[neverDrawn]], it will not be displayed - `neverDrawn` takes precedence.\r\n */\r\n public get alwaysDrawn() { return this._alwaysDrawn; }\r\n\r\n /** @internal */\r\n protected isNeverDrawn(elemIdLo: number, elemIdHi: number, animationNodeId: number): boolean {\r\n if (this._neverDrawn.has(elemIdLo, elemIdHi))\r\n return true;\r\n else\r\n return this.neverDrawnAnimationNodes.has(animationNodeId);\r\n }\r\n /** @internal */\r\n protected isAlwaysDrawn(idLo: number, idHi: number): boolean { return this._alwaysDrawn.has(idLo, idHi); }\r\n /** Returns true if the [SubCategory]($backend) specified by Id is in the set of visible subcategories. @internal */\r\n public isSubCategoryVisible(idLo: number, idHi: number): boolean { return this._visibleSubCategories.has(idLo, idHi); }\r\n /** @internal */\r\n public isSubCategoryVisibleInModel(subcatLo: number, subcatHi: number, modelLo: number, modelHi: number): boolean {\r\n if (this.ignoreSubCategory)\r\n return true;\r\n\r\n let vis = this.isSubCategoryVisible(subcatLo, subcatHi);\r\n const modelOvr = this._modelSubCategoryOverrides.get(modelLo, modelHi);\r\n if (undefined !== modelOvr && modelOvr.has(subcatLo, subcatHi))\r\n vis = !vis;\r\n\r\n return vis;\r\n }\r\n\r\n /** @internal */\r\n protected getModelOverrides(idLo: number, idHi: number): FeatureAppearance | undefined {\r\n return this._modelOverrides.get(idLo, idHi);\r\n }\r\n\r\n private getElementAnimationOverrides(idLo: number, idHi: number, animationNodeId: number): FeatureAppearance | undefined {\r\n if (this.animationNodeOverrides.size === 0)\r\n return undefined;\r\n\r\n // NB: An animation node Id of zero means \"not animated\". Some providers like EmphasizeElements may provide an appearance override for unanimated nodes.\r\n // That should be preserved.\r\n const app = this.animationNodeOverrides.get(animationNodeId);\r\n if (!app || 0 === animationNodeId || this._ignoreAnimationOverrides.length === 0)\r\n return app;\r\n\r\n const args = scratchIgnoreAnimationOverridesArgs;\r\n args.elementId.lower = idLo;\r\n args.elementId.upper = idHi;\r\n args.animationNodeId = animationNodeId;\r\n return this._ignoreAnimationOverrides.some((ignore) => ignore(args)) ? undefined : app;\r\n }\r\n\r\n /** @internal */\r\n protected getElementOverrides(idLo: number, idHi: number, animationNodeId: number): FeatureAppearance | undefined {\r\n const elemApp = this._elementOverrides.get(idLo, idHi);\r\n const nodeApp = this.getElementAnimationOverrides(idLo, idHi, animationNodeId);\r\n if (elemApp)\r\n return nodeApp ? nodeApp.extendAppearance(elemApp) : elemApp;\r\n\r\n return nodeApp;\r\n }\r\n\r\n /** @internal */\r\n protected getSubCategoryOverrides(idLo: number, idHi: number): FeatureAppearance | undefined { return this._subCategoryOverrides.get(idLo, idHi); }\r\n\r\n /** Add a [SubCategory]($backend) to the set of visible subcategories. */\r\n public setVisibleSubCategory(id: Id64String): void { this._visibleSubCategories.addId(id); }\r\n /** Specify the Id of an element that should never be drawn. */\r\n public setNeverDrawn(id: Id64String): void { this._neverDrawn.addId(id); }\r\n /** Specify the Id of an element that should always be drawn. */\r\n public setAlwaysDrawn(id: Id64String): void { this._alwaysDrawn.addId(id); }\r\n /** Specify the Id of a animation node that should never be drawn. */\r\n public setAnimationNodeNeverDrawn(id: number): void { this.neverDrawnAnimationNodes.add(id); }\r\n /** Specify the Ids of elements that should never be drawn. */\r\n public setNeverDrawnSet(ids: Iterable<Id64String>) { copyIdSetToUint32Set(this._neverDrawn, ids); }\r\n /** Specify the Ids of elements that should always be drawn. */\r\n public setAlwaysDrawnSet(ids: Iterable<Id64String>, exclusive: boolean, ignoreSubCategory = true) {\r\n copyIdSetToUint32Set(this._alwaysDrawn, ids);\r\n this.isAlwaysDrawnExclusive = exclusive;\r\n this.alwaysDrawnIgnoresSubCategory = ignoreSubCategory;\r\n }\r\n\r\n /** Returns the feature's appearance overrides, or undefined if the feature is not visible. */\r\n public getFeatureAppearance(feature: Feature, modelId: Id64String, type: BatchType = BatchType.Primary, animationNodeId = 0): FeatureAppearance | undefined {\r\n return this.getAppearance(\r\n Id64.getLowerUint32(feature.elementId), Id64.getUpperUint32(feature.elementId),\r\n Id64.getLowerUint32(feature.subCategoryId), Id64.getUpperUint32(feature.subCategoryId),\r\n feature.geometryClass,\r\n Id64.getLowerUint32(modelId), Id64.getUpperUint32(modelId),\r\n type, animationNodeId);\r\n }\r\n\r\n private static readonly _weight1Appearance = FeatureAppearance.fromJSON({ weight: 1 });\r\n\r\n /** Returns a feature's appearance overrides, or undefined if the feature is not visible.\r\n * Takes Id64s as pairs of unsigned 32-bit integers for efficiency, because that is how they are stored by the PackedFeatureTable associated with each batch of graphics.\r\n * @see [[getFeatureAppearance]] for an equivalent function that accepts [Id64String]($core-bentley)s instead of integer pairs.\r\n */\r\n public getAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined {\r\n if (BatchType.VolumeClassifier === type || BatchType.PlanarClassifier === type)\r\n return this.getClassifierAppearance(elemLo, elemHi, subcatLo, subcatHi, modelLo, modelHi, animationNodeId);\r\n\r\n let app = !this._lineWeights ? FeatureOverrides._weight1Appearance : FeatureAppearance.defaults;\r\n const modelApp = this.getModelOverrides(modelLo, modelHi);\r\n if (undefined !== modelApp)\r\n app = modelApp.extendAppearance(app);\r\n\r\n // Is the element visible?\r\n let elemApp, alwaysDrawn = false;\r\n\r\n if (Id64.isValidUint32Pair(elemLo, elemHi)) {\r\n if (this.isNeverDrawn(elemLo, elemHi, animationNodeId))\r\n return undefined;\r\n\r\n alwaysDrawn = this.isAlwaysDrawn(elemLo, elemHi);\r\n if (!alwaysDrawn && this.isAlwaysDrawnExclusive)\r\n return undefined;\r\n\r\n // Element overrides take precedence\r\n elemApp = this.getElementOverrides(elemLo, elemHi, animationNodeId);\r\n if (undefined !== elemApp)\r\n app = undefined !== modelApp ? elemApp.extendAppearance(app) : elemApp;\r\n }\r\n\r\n let subCatApp;\r\n if (!this.ignoreSubCategory && Id64.isValidUint32Pair(subcatLo, subcatHi)) {\r\n if ((!alwaysDrawn || !this.alwaysDrawnIgnoresSubCategory) && !this.isSubCategoryVisibleInModel(subcatLo, subcatHi, modelLo, modelHi))\r\n return undefined;\r\n\r\n subCatApp = this.getSubCategoryOverrides(subcatLo, subcatHi);\r\n if (undefined !== subCatApp)\r\n app = subCatApp.extendAppearance(app);\r\n }\r\n\r\n // Only apply default if *no* appearance was explicitly registered (doesn't matter if registered appearance does not actually override anything)\r\n if (undefined === elemApp && undefined === modelApp && undefined === subCatApp)\r\n app = this._defaultOverrides.extendAppearance(app);\r\n\r\n let visible = alwaysDrawn || this.isClassVisible(geomClass);\r\n if (visible && app.isFullyTransparent)\r\n visible = false; // don't bother rendering something with full transparency...\r\n\r\n return visible ? app : undefined;\r\n }\r\n\r\n /** Classifiers behave totally differently...in particular they are never invisible unless fully-transparent.\r\n * @internal\r\n */\r\n protected getClassifierAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, modelLo: number, modelHi: number, animationNodeId: number): FeatureAppearance | undefined {\r\n let app = FeatureAppearance.defaults;\r\n const modelApp = this.getModelOverrides(modelLo, modelHi);\r\n if (undefined !== modelApp)\r\n app = modelApp.extendAppearance(app);\r\n\r\n const elemApp = this.getElementOverrides(elemLo, elemHi, animationNodeId);\r\n if (undefined !== elemApp)\r\n app = undefined !== modelApp ? elemApp.extendAppearance(app) : elemApp;\r\n\r\n if (!this.ignoreSubCategory && Id64.isValidUint32Pair(subcatLo, subcatHi)) {\r\n const subCat = this.getSubCategoryOverrides(subcatLo, subcatHi);\r\n if (undefined !== subCat)\r\n app = subCat.extendAppearance(app);\r\n }\r\n\r\n if (undefined === elemApp && undefined === modelApp)\r\n app = this._defaultOverrides.extendAppearance(app);\r\n\r\n // NB: A fully-transparent classifier means the classifier is a clip mask - classified pixels will be discarded.\r\n return app;\r\n }\r\n\r\n /** Return whether geometry of the specified class should be drawn.\r\n * @see [[ViewFlags.constructions]], [[ViewFlags.dimensions]], and [[ViewFlags.patterns]].\r\n */\r\n public isClassVisible(geomClass: GeometryClass): boolean {\r\n switch (geomClass) {\r\n case GeometryClass.Construction: return this._constructions;\r\n case GeometryClass.Dimension: return this._dimensions;\r\n case GeometryClass.Pattern: return this._patterns;\r\n default: return true;\r\n }\r\n }\r\n\r\n /** Specify overrides for all elements belonging to a specified [GeometricModel]($backend), or all geometry belonging to a specified [GeometricElement]($backend) or [SubCategory]($backend). */\r\n public override(args: OverrideFeatureAppearanceArgs): void {\r\n let id: Id64String;\r\n let map: Id64.Uint32Map<FeatureAppearance>;\r\n if (undefined !== args.elementId) {\r\n id = args.elementId;\r\n map = this._elementOverrides;\r\n } else if (undefined !== args.modelId) {\r\n id = args.modelId;\r\n map = this._modelOverrides;\r\n } else {\r\n id = args.subCategoryId;\r\n map = this._subCategoryOverrides;\r\n }\r\n\r\n let app = args.appearance;\r\n const idLo = Id64.getLowerUint32(id);\r\n const idHi = Id64.getUpperUint32(id);\r\n\r\n if (undefined !== args.elementId && this.isNeverDrawn(idLo, idHi, 0))\r\n return;\r\n\r\n const replace = \"replace\" === args.onConflict;\r\n const existing = replace ? undefined : map.get(idLo, idHi);\r\n if (existing) {\r\n assert(\"replace\" !== args.onConflict);\r\n switch (args.onConflict) {\r\n case \"skip\":\r\n return;\r\n case \"extend\":\r\n app = app.extendAppearance(existing);\r\n break;\r\n default:\r\n app = existing.extendAppearance(app);\r\n break;\r\n }\r\n }\r\n\r\n map.set(idLo, idHi, app);\r\n }\r\n\r\n /** Specify overrides for all elements within the specified model.\r\n * @param id The Id of the model.\r\n * @param app The symbology overrides.\r\n * @param replaceExisting Specifies whether to replace a pre-existing override for the same model.\r\n * @note These overrides take priority over all other overrides.\r\n * @note If [[defaultOverrides]] are defined, they will not apply to any element within this model, even if the supplied appearance overrides nothing.\r\n * @deprecated in 3.x. Use [[FeatureOverrides.override]].\r\n */\r\n public overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {\r\n this.override({ modelId: id, appearance: app, onConflict: replaceExisting ? \"replace\" : \"skip\" });\r\n }\r\n\r\n /** Specify overrides for all geometry belonging to the specified [SubCategory]($backend).\r\n * @param id The Id of the subcategory.\r\n * @param app The symbology overrides.\r\n * @param replaceExisting Specifies whether to replace a pre-existing override for the same subcategory.\r\n * @note These overrides have lower priority than element and model overrides.\r\n * @note If [[defaultOverrides]] are defined, they will not apply to any geometry within this subcategory, even if the supplied appearance overrides nothing.\r\n * @deprecated in 3.x. Use [[FeatureOverrides.override]].\r\n */\r\n public overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {\r\n this.override({ subCategoryId: id, appearance: app, onConflict: replaceExisting ? \"replace\" : \"skip\" });\r\n }\r\n\r\n /** Specify overrides for all geometry originating from the specified element.\r\n * @param id The Id of the element.\r\n * @param app The symbology overrides.\r\n * @param replaceExisting Specifies whether to replace a pre-existing override for the same element.\r\n * @note These overrides take precedence over subcategory overrides, but not over model overrides.\r\n * @note If [[defaultOverrides]] are defined, they will not apply to this element, even if the supplied appearance overrides nothing.\r\n * @deprecated in 3.x. Use [[FeatureOverrides.override]].\r\n */\r\n public overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting: boolean = true): void {\r\n this.override({ elementId: id, appearance: app, onConflict: replaceExisting ? \"replace\" : \"skip\" });\r\n }\r\n\r\n /** Specify overrides for all geometry originating from the specified animation node.\r\n * @param id The Id of the animation node.\r\n * @param app The symbology overrides.\r\n * @note These overrides do not take precedence over element overrides.\r\n */\r\n public overrideAnimationNode(id: number, app: FeatureAppearance): void {\r\n this.animationNodeOverrides.set(id, app);\r\n }\r\n\r\n /** Defines a default appearance to be applied to any [[Feature]] *not* explicitly overridden.\r\n * @param appearance The symbology overrides.\r\n * @param replaceExisting Specifies whether to replace the current default overrides if they are already defined.\r\n */\r\n public setDefaultOverrides(appearance: FeatureAppearance, replaceExisting: boolean = true): void {\r\n if (replaceExisting || !appearance.overridesSymbology)\r\n this._defaultOverrides = appearance;\r\n }\r\n\r\n /** Get the display priority of a subcategory. This is only relevant when using [[PlanProjectionSettings]].\r\n * @internal\r\n */\r\n public getSubCategoryPriority(idLo: number, idHi: number): number {\r\n return this._subCategoryPriorities.get(idLo, idHi) ?? 0;\r\n }\r\n\r\n /** Adds all fully transparent elements to the _neverDrawn set. This is used for BatchedModels planar masks.\r\n * @internal\r\n */\r\n public addInvisibleElementOverridesToNeverDrawn(): void {\r\n this._elementOverrides.forEach((lo, hi) => {\r\n const app = this.getElementOverrides(lo, hi, 0);\r\n if (app?.isFullyTransparent)\r\n this._neverDrawn.add(lo, hi);\r\n });\r\n }\r\n\r\n /** Construct a new Overrides that overrides nothing.\r\n * @see [FeatureSymbology.Overrides]($frontend) to construct overrides based on a [ViewState]($frontend) or [Viewport]($frontend).\r\n */\r\n public constructor() {\r\n //\r\n }\r\n\r\n /** Returns true if geometry belonging to the specified subcategory will be drawn. */\r\n public isSubCategoryIdVisible(id: Id64String): boolean { return this.isSubCategoryVisible(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }\r\n /** Returns the overrides applied to geometry belonging to the specified model, if any such are defined. */\r\n public getModelOverridesById(id: Id64String): FeatureAppearance | undefined { return this.getModelOverrides(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }\r\n /** Returns the overrides applied to geometry belonging to the specified element, if any such are defined. */\r\n public getElementOverridesById(id: Id64String): FeatureAppearance | undefined { return this.getElementOverrides(Id64.getLowerUint32(id), Id64.getUpperUint32(id), 0); }\r\n /** Returns the overrides applied to geometry belonging to the specified subcategory, if any such are defined. */\r\n public getSubCategoryOverridesById(id: Id64String): FeatureAppearance | undefined { return this.getSubCategoryOverrides(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }\r\n\r\n /** Returns true if the specified Feature will be drawn. */\r\n public isFeatureVisible(feature: Feature): boolean {\r\n const { elementId, subCategoryId, geometryClass } = feature;\r\n const isValidElemId = !Id64.isInvalid(elementId);\r\n const elemIdParts = isValidElemId ? Id64.getUint32Pair(elementId) : undefined;\r\n\r\n if (undefined !== elemIdParts && this.isNeverDrawn(elemIdParts.lower, elemIdParts.upper, 0))\r\n return false;\r\n\r\n const alwaysDrawn = undefined !== elemIdParts && this.isAlwaysDrawn(elemIdParts.lower, elemIdParts.upper);\r\n if (alwaysDrawn || this.isAlwaysDrawnExclusive)\r\n return alwaysDrawn;\r\n\r\n // NB: This ignores per-model subcategory visibility overrides, because caller did not specify a model.\r\n if (!this.isSubCategoryIdVisible(subCategoryId))\r\n return false;\r\n\r\n return this.isClassVisible(geometryClass);\r\n }\r\n}\r\n\r\n/** Interface adopted by an object that can supply the [[FeatureAppearance]] supplied by a [[FeatureAppearanceSource]].\r\n * This is useful for selectively overriding or agumenting a [Viewport]($frontend)'s symbology overrides.\r\n * A typical implementation will invoke [[FeatureAppearanceSource.getAppearance]] and customize the returned appearance.\r\n * @see [[FeatureAppearanceProvider.chain]] to chain two providers together.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FeatureAppearanceProvider {\r\n /** Supply the desired appearance overrides for the specified [[Feature]], or `undefined` if the feature should not be drawn.\r\n * The feature is described by its components for efficiency reasons.\r\n * @param source The base symbology overrides, e.g., typically defined by a [Viewport]($frontend).\r\n * @param elemLo The lower 32 bits of the feature's element Id.\r\n * @param elemHi The upper 32 bits of the feature's element Id.\r\n * @param subcatLo The lower 32 bits of the feature's subcategory Id.\r\n * @param subcatHi The upper 32 bits of the feature's subcategory Id.\r\n * @param geomClass The geometry class of the feature.\r\n * @param modelLo The lower 32 bits of the feature's model Id.\r\n * @param modelHi The upper 32 bits of the feature's model Id.\r\n * @param type The type of batch to which the feature belongs.\r\n * @param animationNodeId The Id of the corresponding node in the [[RenderSchedule]], or `0` if none.\r\n * @returns The desired appearance overrides, or `undefined` to indicate the feature should not be displayed.\r\n * @see [[FeatureAppearanceSource.getAppearance]] to forward the request to the source.\r\n * @see [Id64.isValidUint32Pair]($core-bentley) to determine if the components of an [Id64String]($core-bentley) represent a valid Id.\r\n */\r\n getFeatureAppearance(source: FeatureAppearanceSource, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined;\r\n}\r\n\r\n/** @public */\r\nexport namespace FeatureAppearanceProvider {\r\n /** Produce a FeatureAppearanceSource for which `getAppearance()` returns the appearance specified in `source`, potentially modified by `provider`. */\r\n function wrap(source: FeatureAppearanceSource, provider: FeatureAppearanceProvider): FeatureAppearanceSource {\r\n return {\r\n getAppearance: (elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number) => {\r\n return provider.getFeatureAppearance(source, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n },\r\n };\r\n }\r\n\r\n /** Create a provider that obtains each feature's appearance from the source, and if the feature is visible, modifies the appearance.\r\n * @param supplementAppearance A function accepting the feature's base appearance and returning a supplemental appearance.\r\n * @public\r\n */\r\n export function supplement(supplementAppearance: (appearance: FeatureAppearance) => FeatureAppearance): FeatureAppearanceProvider {\r\n return {\r\n getFeatureAppearance: (source: FeatureAppearanceSource, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number) => {\r\n const app = source.getAppearance(elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n return app ? supplementAppearance(app) : app;\r\n },\r\n };\r\n }\r\n\r\n /** Chain two FeatureAppearanceProviders together such that `first`'s `getFeatureAppearance` function is applied before `second`'s.\r\n * If `second` invokes `source.getAppearance()`, the returned appearance will include any modifications applied by `first`.\r\n * @public\r\n */\r\n export function chain(first: FeatureAppearanceProvider, second: FeatureAppearanceProvider): FeatureAppearanceProvider {\r\n if (first === second)\r\n return first;\r\n\r\n return {\r\n getFeatureAppearance: (source: FeatureAppearanceSource, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number) => {\r\n return second.getFeatureAppearance(wrap(source, first), elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n },\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -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;AAEjD;;;;;;;;GAQG;AACH,MAAa,OAAO;IAKlB,YAAmB,YAAw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AC,YAAoB;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAEM,wBAAwB,CAAC,aAA4B,EAAE,SAAiB;QAC7E,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,wBAAwB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;IAC7F,CAAC;CACF;AAzFD,oEAyFC","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\";\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 /** @internal */\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 /** @internal */\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 /** @internal */\n public getArray(): Array<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\nconst scratchPackedFeature = PackedFeature.create();\n\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\n assert(maxNodeId > 0);\n\n let nodeIds;\n const outputFeature = PackedFeature.createWithIndex();\n for (const feature of table.iterable(outputFeature)) {\n const nodeId = computeNodeId(feature);\n assert(nodeId <= maxNodeId);\n if (0 !== nodeId) {\n if (!nodeIds) {\n const size = table.numFeatures;\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\n }\n\n nodeIds[feature.index] = nodeId;\n }\n }\n\n return nodeIds;\n}\n\n/**\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\n * wherein each feature occupies 3 32-bit integers.\n * @internal\n */\nexport class PackedFeatureTable implements RenderFeatureTable {\n public readonly data: Uint32Array;\n public readonly batchModelId: Id64String;\n public readonly batchModelIdPair: Id64.Uint32Pair;\n public readonly numFeatures: number;\n public readonly anyDefined: boolean;\n public readonly type: BatchType;\n public animationNodeIds?: UintArray;\n\n public get byteLength(): number { return this.data.byteLength; }\n\n /** Construct a PackedFeatureTable from the packed binary data.\n * This is used internally when deserializing Tiles in iMdl format.\n * @internal\n */\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\n this.data = data;\n this.batchModelId = modelId;\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\n this.numFeatures = numFeatures;\n this.type = type;\n this.animationNodeIds = animationNodeIds;\n\n switch (this.numFeatures) {\n case 0:\n this.anyDefined = false;\n break;\n case 1:\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\n break;\n default:\n this.anyDefined = true;\n break;\n }\n\n assert(this.data.length >= this._subCategoriesOffset);\n assert(undefined === this.animationNodeIds || this.animationNodeIds.length === this.numFeatures);\n }\n\n /** Create a packed feature table from a [[FeatureTable]]. */\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\n // the array cannot be resized after it is created.\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\n // back-end arrive within tiles already in the packed format.\n const subcategories = new Map<string, number>();\n for (const iv of featureTable.getArray()) {\n const found = subcategories.get(iv.value.subCategoryId.toString());\n if (undefined === found)\n subcategories.set(iv.value.subCategoryId, subcategories.size);\n }\n\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\n const subCategoriesOffset = 3 * featureTable.length;\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\n const uint32s = new Uint32Array(nUint32s);\n\n for (const iv of featureTable.getArray()) {\n const feature = iv.value;\n const index = iv.index * 3;\n\n let subCategoryIndex = subcategories.get(feature.subCategoryId)!;\n assert(undefined !== subCategoryIndex); // we inserted it above...\n subCategoryIndex |= (feature.geometryClass << 24);\n\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\n uint32s[index + 2] = subCategoryIndex;\n }\n\n subcategories.forEach((index: number, id: string, _map) => {\n const index32 = subCategoriesOffset + 2 * index;\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\n });\n\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\n }\n\n /** Retrieve the Feature associated with the specified index. */\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result, this.batchModelId);\n }\n\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n /** @internal */\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\n out = out ?? { lower: 0, upper: 0 };\n assert(featureIndex < this.numFeatures);\n const offset = 3 * featureIndex;\n out.lower = this.data[offset];\n out.upper = this.data[offset + 1];\n return out;\n }\n\n /** @internal */\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\n const index = 3 * featureIndex;\n let subCatIndex = this.data[index + 2];\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n return { lower: this.data[subCatIndex], upper: this.data[subCatIndex + 1] };\n }\n\n /** @internal */\n public getAnimationNodeId(featureIndex: number): number {\n return undefined !== this.animationNodeIds && featureIndex < this.numFeatures ? this.animationNodeIds[featureIndex] : 0;\n }\n\n /** @internal */\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n assert(featureIndex < this.numFeatures);\n\n const index32 = 3 * featureIndex;\n result.elementId.lower = this.data[index32];\n result.elementId.upper = this.data[index32 + 1];\n\n const subCatIndexAndClass = this.data[index32 + 2];\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\n\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n result.subCategoryId.lower = this.data[subCatIndex];\n result.subCategoryId.upper = this.data[subCatIndex + 1];\n\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\n result.modelId.lower = this.batchModelIdPair.lower;\n result.modelId.upper = this.batchModelIdPair.upper;\n\n return result;\n }\n\n public getModelIdPair(_featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n out.lower = this.batchModelIdPair.lower;\n out.upper = this.batchModelIdPair.upper;\n return out;\n }\n\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\n public findElementId(featureIndex: number): Id64String | undefined {\n if (featureIndex >= this.numFeatures)\n return undefined;\n else\n return this.readId(3 * featureIndex);\n }\n\n /** Return true if this table contains exactly 1 feature. */\n public get isUniform(): boolean { return 1 === this.numFeatures; }\n\n /** If this table contains exactly 1 feature, return it. */\n public getUniform(result: ModelFeature): ModelFeature | undefined {\n return this.isUniform ? this.getFeature(0, result) : undefined;\n }\n\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\n\n /** Unpack the features into a [[FeatureTable]]. */\n public unpack(): FeatureTable {\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\n const feature = ModelFeature.create();\n for (let i = 0; i < this.numFeatures; i++) {\n this.getFeature(i, feature);\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\n }\n\n return table;\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n assert(undefined === this.animationNodeIds);\n this.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n for (let i = 0; i < this.numFeatures; i++) {\n this.getPackedFeature(i, output);\n output.index = i;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\n\n private readId(offset32: number): Id64String {\n return Id64.fromUint32Pair(this.data[offset32], this.data[offset32 + 1]);\n }\n}\n\ninterface PackedFeatureModelEntry {\n lastFeatureIndex: number;\n idLower: number;\n idUpper: number;\n}\n\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\n\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\n * The model table itself consists of one entry per model, where each entry looks like:\n * indexOfLastFeatureInModel: u32\n * modelId: u64\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\n * This lookup can be optimized using binary search.\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\n * @internal\n */\nexport class PackedFeatureModelTable {\n private readonly _data: Uint32Array;\n\n public constructor(data: Uint32Array) {\n this._data = data;\n assert(this._data.length % 3 === 0);\n }\n\n /** The number of models in the table. */\n public get length(): number {\n return this._data.length / 3;\n }\n\n public get byteLength(): number {\n return this._data.byteLength;\n }\n\n private getLastFeatureIndex(modelIndex: number): number {\n return this._data[modelIndex * 3];\n }\n\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\n if (modelIndex >= this.length) {\n result.idLower = result.idUpper = 0;\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\n return result;\n }\n\n const index = modelIndex * 3;\n result.lastFeatureIndex = this._data[index + 0];\n result.idLower = this._data[index + 1];\n result.idUpper = this._data[index + 2];\n return result;\n }\n\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\n if (!result)\n result = { lower: 0, upper: 0 };\n else\n result.lower = result.upper = 0;\n\n let first = 0;\n const last = this.length;\n let count = last;\n while (count > 0) {\n const step = Math.floor(count / 2);\n const mid = first + step;\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\n if (featureIndex > lastFeatureIndex) {\n first = mid + 1;\n count -= step + 1;\n } else {\n count = step;\n }\n }\n\n if (first < last) {\n result.lower = this._data[first * 3 + 1];\n result.upper = this._data[first * 3 + 2];\n }\n\n return result;\n }\n}\n\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\n * @internal\n */\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\n private readonly _features: PackedFeatureTable;\n private readonly _models: PackedFeatureModelTable;\n\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\n this._features = features;\n this._models = models;\n }\n\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\n const featureData = data.subarray(0, modelTableOffset);\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\n\n const modelData = data.subarray(modelTableOffset);\n const models = new PackedFeatureModelTable(modelData);\n\n return new MultiModelPackedFeatureTable(features, models);\n }\n\n public get batchModelId() { return this._features.batchModelId; }\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\n public get numFeatures() { return this._features.numFeatures; }\n public get type() { return this._features.type; }\n public get animationNodeIds(): UintArray | undefined { return this._features.animationNodeIds; }\n public set animationNodeIds(ids: UintArray | undefined) { this._features.animationNodeIds = ids; }\n\n public get byteLength() {\n return this._features.byteLength + this._models.byteLength;\n }\n\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n this._features.getPackedFeature(featureIndex, result);\n this._models.getModelIdPair(featureIndex, result.modelId);\n return result;\n }\n\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result);\n }\n\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n return this._features.getElementIdPair(featureIndex, out);\n }\n\n public getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n this._models.getModelIdPair(featureIndex, out);\n return out;\n }\n\n public findElementId(featureIndex: number): Id64String | undefined {\n return this._features.findElementId(featureIndex);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\n let modelIndex = 0;\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\n\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\n if (featureIndex > modelEntry.lastFeatureIndex)\n this._models.getEntry(++modelIndex, modelEntry);\n\n this._features.getPackedFeature(featureIndex, output);\n output.modelId.lower = modelEntry.idLower;\n output.modelId.upper = modelEntry.idUpper;\n output.index = featureIndex;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n public getAnimationNodeId(featureIndex: number): number {\n return this._features.getAnimationNodeId(featureIndex);\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n this._features.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\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;AAEjD;;;;;;;;GAQG;AACH,MAAa,OAAO;IAKlB,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,SA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n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport {\r\n assert, compareNumbers, compareStrings, Id64, Id64String, IndexedValue, IndexMap, UintArray,\r\n} from \"@itwin/core-bentley\";\r\nimport { GeometryClass } from \"./GeometryParams\";\r\n\r\n/** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be\r\n * grouped with other such entities in a [[FeatureTable]].\r\n * Features roughly correlate to elements: a [Tile]($frontend)'s graphics combines geometry from every\r\n * [GeometricElement]($backend) that intersects the tile's volume, so each element produces at least one feature.\r\n * However, an element's geometry stream can contain geometry belonging to multiple different combinations of [SubCategory]($backend) and\r\n * [[GeometryClass]], so an individual element may produce more than one feature.\r\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\r\n * @public\r\n */\r\nexport class Feature {\r\n public readonly elementId: Id64String;\r\n public readonly subCategoryId: Id64String;\r\n public readonly geometryClass: GeometryClass;\r\n\r\n public constructor(elementId: Id64String = Id64.invalid, subCategoryId: Id64String = Id64.invalid, geometryClass: GeometryClass = GeometryClass.Primary) {\r\n this.elementId = elementId;\r\n this.subCategoryId = subCategoryId;\r\n this.geometryClass = geometryClass;\r\n }\r\n\r\n public get isDefined(): boolean { return !Id64.isInvalid(this.elementId) || !Id64.isInvalid(this.subCategoryId) || this.geometryClass !== GeometryClass.Primary; }\r\n public get isUndefined(): boolean { return !this.isDefined; }\r\n\r\n /** Returns true if this feature is equivalent to the supplied feature. */\r\n public equals(other: Feature): boolean { return 0 === this.compare(other); }\r\n\r\n /** Performs ordinal comparison of this feature with another.\r\n * @param rhs The feature to compare with.\r\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`.\r\n */\r\n public compare(rhs: Feature): number {\r\n if (this === rhs)\r\n return 0;\r\n\r\n let cmp = compareNumbers(this.geometryClass, rhs.geometryClass);\r\n if (0 === cmp) {\r\n cmp = compareStrings(this.elementId, rhs.elementId);\r\n if (0 === cmp) {\r\n cmp = compareStrings(this.subCategoryId, rhs.subCategoryId);\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n}\r\n\r\n/** A [[Feature]] with a modelId identifying the model containing the feature, obtained from a [[RenderFeatureTable]].\r\n * @public\r\n */\r\nexport interface ModelFeature {\r\n modelId: Id64String;\r\n elementId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n}\r\n\r\n/** @public */\r\nexport namespace ModelFeature {\r\n /** Create a ModelFeature of [[GeometryClass.Primary]] with all invalid Ids.\r\n * This is primarily useful for creating a `result` argument for [[RenderFeatureTable.findFeature]] and [[RenderFeatureTable.getFeature]].\r\n */\r\n export function create(): ModelFeature {\r\n return {\r\n modelId: Id64.invalid,\r\n elementId: Id64.invalid,\r\n subCategoryId: Id64.invalid,\r\n geometryClass: GeometryClass.Primary,\r\n };\r\n }\r\n\r\n /** Returns `true` if any of `feature`'s properties differ from the defaults (invalid Ids and [[GeometryClass.Primary]]). */\r\n export function isDefined(feature: ModelFeature): boolean {\r\n return !Id64.isInvalid(feature.modelId) || !Id64.isInvalid(feature.elementId) || !Id64.isInvalid(feature.subCategoryId) || feature.geometryClass !== GeometryClass.Primary;\r\n }\r\n\r\n /** @alpha */\r\n export function unpack(packed: PackedFeature, result: ModelFeature, unpackedModelId?: Id64String): ModelFeature {\r\n result.modelId = unpackedModelId ?? Id64.fromUint32PairObject(packed.modelId);\r\n result.elementId = Id64.fromUint32PairObject(packed.elementId);\r\n result.subCategoryId = Id64.fromUint32PairObject(packed.subCategoryId);\r\n result.geometryClass = packed.geometryClass;\r\n return result;\r\n }\r\n}\r\n\r\n/** Represents a [[Feature]] within a [[RenderFeatureTable]]. This representation is optimized for use on the GPU.\r\n * @public\r\n */\r\nexport interface PackedFeature {\r\n modelId: Id64.Uint32Pair;\r\n elementId: Id64.Uint32Pair;\r\n subCategoryId: Id64.Uint32Pair;\r\n geometryClass: GeometryClass;\r\n /** @alpha */\r\n animationNodeId: number;\r\n}\r\n\r\n/** Represents a [[PackedFeature]] obtained from a [[RenderFeatureTable]], including the index of that feature within the table.\r\n * @public\r\n */\r\nexport interface PackedFeatureWithIndex extends PackedFeature {\r\n index: number;\r\n}\r\n\r\n/** @public */\r\nexport namespace PackedFeature {\r\n /** Create a PackedFeature of [[GeometryClass.Primary]] with all invalid Ids.\r\n * This is primarily useful for creating a `result` argument for [[RenderFeatureTable.getPackedFeature]].\r\n */\r\n export function create(): PackedFeature {\r\n const pair = { upper: 0, lower: 0 };\r\n return {\r\n modelId: { ...pair },\r\n elementId: { ...pair },\r\n subCategoryId: { ...pair },\r\n geometryClass: GeometryClass.Primary,\r\n animationNodeId: 0,\r\n };\r\n }\r\n\r\n /** Create a PackedFeatureWithIndex of [[GeometryClass.Primary]] with all invalid Ids and an index of zero.\r\n * This is primarily useful for creating a reusable `output` argument for [[RenderFeatureTable.iterable]].\r\n */\r\n export function createWithIndex(): PackedFeatureWithIndex {\r\n const result = create() as PackedFeatureWithIndex;\r\n result.index = 0;\r\n return result;\r\n }\r\n}\r\n\r\n/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.\r\n * The most commonly-encountered batches are Tiles, which can be of either Primary or\r\n * Classifier type.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BatchType {\r\n /** This batch contains graphics derived from a model's visible geometry. */\r\n Primary,\r\n /**\r\n * This batch contains color volumes which are used to classify a model's visible geometry.\r\n * The graphics themselves are not rendered to the screen; instead they are rendered to the stencil buffer\r\n * to resymbolize the primary geometry.\r\n */\r\n VolumeClassifier,\r\n /**\r\n * This batch contains planar graphics which are used to classify a model's visible geometry.\r\n * The graphics themselves are not rendered to the screen; instead they are rendered to a texture buffer\r\n * to resymbolize the primary geometry.\r\n */\r\n PlanarClassifier,\r\n}\r\n\r\n/** Defines a look-up table for [[Feature]]s within a batched [RenderGraphic]($frontend). Consecutive 32-bit\r\n * indices are assigned to each unique Feature. Primitives within the RenderGraphic can\r\n * use per-vertex indices to specify the distribution of Features within the primitive. The appearance of individual\r\n * features can be customized using [[FeatureOverrides]]. Typically a [Tile]($frontend) will contain a feature table\r\n * identifying the elements whose geometry appears within that tile.\r\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\r\n * @public\r\n */\r\nexport class FeatureTable extends IndexMap<Feature> {\r\n public readonly modelId: Id64String;\r\n public readonly type: BatchType;\r\n\r\n /** Construct an empty FeatureTable. */\r\n public constructor(maxFeatures: number, modelId: Id64String = Id64.invalid, type: BatchType = BatchType.Primary) {\r\n super((lhs, rhs) => lhs.compare(rhs), maxFeatures);\r\n this.modelId = modelId;\r\n this.type = type;\r\n }\r\n\r\n /** Returns the maximum number of [[Feature]]s this FeatureTable can contain. */\r\n public get maxFeatures(): number { return this._maximumSize; }\r\n /** @internal */\r\n public get anyDefined(): boolean { return this.length > 1 || (1 === this.length && this._array[0].value.isDefined); }\r\n /** Returns true if this FeatureTable contains exactly one [[Feature]]. */\r\n public get isUniform(): boolean { return 1 === this.length; }\r\n /** If this FeatureTable contains exactly one [[Feature]], returns that Feature; otherwise returns undefined. */\r\n public get uniform(): Feature | undefined { return 1 === this.length ? this._array[0].value : undefined; }\r\n /** Returns true if this FeatureTable is associated with [[BatchType.VolumeClassifier]] geometry. */\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n /** Returns true if this FeatureTable is associated with [[BatchType.PlanarClassifier]] geometry. */\r\n public get isPlanarClassifier(): boolean { return BatchType.PlanarClassifier === this.type; }\r\n\r\n /** Returns the Feature corresponding to the specified index, or undefined if the index is not present. */\r\n public findFeature(index: number): Feature | undefined {\r\n for (const entry of this._array)\r\n if (entry.index === index)\r\n return entry.value;\r\n\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public insertWithIndex(feature: Feature, index: number): void {\r\n const bound = this.lowerBound(feature);\r\n assert(!bound.equal);\r\n assert(!this.isFull);\r\n const entry = new IndexedValue<Feature>(feature, index);\r\n this._array.splice(bound.index, 0, entry);\r\n }\r\n\r\n /** @internal */\r\n public getArray(): Array<IndexedValue<Feature>> { return this._array; }\r\n\r\n /** Convert this feature table to a representation that can be supplied to [RenderSystem.createBatch]($frontend). */\r\n public pack(): RenderFeatureTable {\r\n return PackedFeatureTable.pack(this);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport type ComputeNodeId = (feature: PackedFeatureWithIndex) => number;\r\n\r\n/** Representation of a [[FeatureTable]] suitable for use with [RenderSystem.createBatch]($frontend).\r\n * The [[Feature]]s are represented as [[PackedFeature]]s. The feature table may contain features from multiple [Model]($backend)s.\r\n * @see [[FeatureTable.pack]] to produce a RenderFeatureTable.\r\n * @public\r\n */\r\nexport interface RenderFeatureTable {\r\n /** The \"model Id\" of the tile tree containing the tile from which this feature table originated.\r\n * It may be a transient Id if, for example, the tile tree represents a reality model or represents the geometry of multiple\r\n * persistent models batched together.\r\n */\r\n readonly batchModelId: Id64String;\r\n /** A split representation of [[batchModelId]], to avoid having to constantly having to parse the string. */\r\n readonly batchModelIdPair: Id64.Uint32Pair;\r\n /** The number of features in the table; equivalently, one more than the largest feature index. */\r\n readonly numFeatures: number;\r\n /** The number of bytes consumed by the feature table, strictly for diagnostic purposes. */\r\n readonly byteLength: number;\r\n readonly type: BatchType;\r\n /** @alpha */\r\n animationNodeIds?: UintArray;\r\n\r\n /** Get the feature at the specified index. The caller is responsible for validating featureIndex less than numFeatures. */\r\n getFeature(featureIndex: number, result: ModelFeature): ModelFeature;\r\n\r\n /** Find the feature at the specified index. Returns undefined if featureIndex >= [[numFeatures]]. */\r\n findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;\r\n\r\n /** Find the Id of the element associated with the feature at the specified index. */\r\n findElementId(featureIndex: number): Id64String | undefined;\r\n\r\n /** Get the Id of the element associated with the feature at the specified index as a pair of 32-bit integers.\r\n * The caller is responsible for validating that `featureIndex` is less than [[numFeatures]].\r\n */\r\n getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\r\n\r\n /** Get the feature at the specified index. The caller is responsible for validating featureIndex less than numFeatures. */\r\n getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;\r\n\r\n /** Get an object that provides ordered iteration over all features.\r\n * @note The `output` object is reused (mutated in place) as the current value on each iteration.\r\n */\r\n iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;\r\n\r\n /** @alpha */\r\n populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;\r\n\r\n /** @alpha */\r\n getAnimationNodeId(featureIndex: number): number;\r\n\r\n /** Get the Id of the model associated with the feature at the specified index.\r\n * The caller is responsible for validating that `featureIndex` is less than [[numFeatures]].\r\n * This is more efficient than [[getFeature]] for callers who are only interested in the model Id.\r\n */\r\n getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\r\n}\r\n\r\nconst scratchPackedFeature = PackedFeature.create();\r\n\r\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\r\n assert(maxNodeId > 0);\r\n\r\n let nodeIds;\r\n const outputFeature = PackedFeature.createWithIndex();\r\n for (const feature of table.iterable(outputFeature)) {\r\n const nodeId = computeNodeId(feature);\r\n assert(nodeId <= maxNodeId);\r\n if (0 !== nodeId) {\r\n if (!nodeIds) {\r\n const size = table.numFeatures;\r\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\r\n }\r\n\r\n nodeIds[feature.index] = nodeId;\r\n }\r\n }\r\n\r\n return nodeIds;\r\n}\r\n\r\n/**\r\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\r\n * wherein each feature occupies 3 32-bit integers.\r\n * @internal\r\n */\r\nexport class PackedFeatureTable implements RenderFeatureTable {\r\n public readonly data: Uint32Array;\r\n public readonly batchModelId: Id64String;\r\n public readonly batchModelIdPair: Id64.Uint32Pair;\r\n public readonly numFeatures: number;\r\n public readonly anyDefined: boolean;\r\n public readonly type: BatchType;\r\n public animationNodeIds?: UintArray;\r\n\r\n public get byteLength(): number { return this.data.byteLength; }\r\n\r\n /** Construct a PackedFeatureTable from the packed binary data.\r\n * This is used internally when deserializing Tiles in iMdl format.\r\n * @internal\r\n */\r\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\r\n this.data = data;\r\n this.batchModelId = modelId;\r\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\r\n this.numFeatures = numFeatures;\r\n this.type = type;\r\n this.animationNodeIds = animationNodeIds;\r\n\r\n switch (this.numFeatures) {\r\n case 0:\r\n this.anyDefined = false;\r\n break;\r\n case 1:\r\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\r\n break;\r\n default:\r\n this.anyDefined = true;\r\n break;\r\n }\r\n\r\n assert(this.data.length >= this._subCategoriesOffset);\r\n assert(undefined === this.animationNodeIds || this.animationNodeIds.length === this.numFeatures);\r\n }\r\n\r\n /** Create a packed feature table from a [[FeatureTable]]. */\r\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\r\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\r\n // the array cannot be resized after it is created.\r\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\r\n // back-end arrive within tiles already in the packed format.\r\n const subcategories = new Map<string, number>();\r\n for (const iv of featureTable.getArray()) {\r\n const found = subcategories.get(iv.value.subCategoryId.toString());\r\n if (undefined === found)\r\n subcategories.set(iv.value.subCategoryId, subcategories.size);\r\n }\r\n\r\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\r\n const subCategoriesOffset = 3 * featureTable.length;\r\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\r\n const uint32s = new Uint32Array(nUint32s);\r\n\r\n for (const iv of featureTable.getArray()) {\r\n const feature = iv.value;\r\n const index = iv.index * 3;\r\n\r\n let subCategoryIndex = subcategories.get(feature.subCategoryId)!;\r\n assert(undefined !== subCategoryIndex); // we inserted it above...\r\n subCategoryIndex |= (feature.geometryClass << 24);\r\n\r\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\r\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\r\n uint32s[index + 2] = subCategoryIndex;\r\n }\r\n\r\n subcategories.forEach((index: number, id: string, _map) => {\r\n const index32 = subCategoriesOffset + 2 * index;\r\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\r\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\r\n });\r\n\r\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\r\n }\r\n\r\n /** Retrieve the Feature associated with the specified index. */\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result, this.batchModelId);\r\n }\r\n\r\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n out = out ?? { lower: 0, upper: 0 };\r\n assert(featureIndex < this.numFeatures);\r\n const offset = 3 * featureIndex;\r\n out.lower = this.data[offset];\r\n out.upper = this.data[offset + 1];\r\n return out;\r\n }\r\n\r\n /** @internal */\r\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\r\n const index = 3 * featureIndex;\r\n let subCatIndex = this.data[index + 2];\r\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n return { lower: this.data[subCatIndex], upper: this.data[subCatIndex + 1] };\r\n }\r\n\r\n /** @internal */\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return undefined !== this.animationNodeIds && featureIndex < this.numFeatures ? this.animationNodeIds[featureIndex] : 0;\r\n }\r\n\r\n /** @internal */\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n assert(featureIndex < this.numFeatures);\r\n\r\n const index32 = 3 * featureIndex;\r\n result.elementId.lower = this.data[index32];\r\n result.elementId.upper = this.data[index32 + 1];\r\n\r\n const subCatIndexAndClass = this.data[index32 + 2];\r\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\r\n\r\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n result.subCategoryId.lower = this.data[subCatIndex];\r\n result.subCategoryId.upper = this.data[subCatIndex + 1];\r\n\r\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\r\n result.modelId.lower = this.batchModelIdPair.lower;\r\n result.modelId.upper = this.batchModelIdPair.upper;\r\n\r\n return result;\r\n }\r\n\r\n public getModelIdPair(_featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n out.lower = this.batchModelIdPair.lower;\r\n out.upper = this.batchModelIdPair.upper;\r\n return out;\r\n }\r\n\r\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n if (featureIndex >= this.numFeatures)\r\n return undefined;\r\n else\r\n return this.readId(3 * featureIndex);\r\n }\r\n\r\n /** Return true if this table contains exactly 1 feature. */\r\n public get isUniform(): boolean { return 1 === this.numFeatures; }\r\n\r\n /** If this table contains exactly 1 feature, return it. */\r\n public getUniform(result: ModelFeature): ModelFeature | undefined {\r\n return this.isUniform ? this.getFeature(0, result) : undefined;\r\n }\r\n\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\r\n\r\n /** Unpack the features into a [[FeatureTable]]. */\r\n public unpack(): FeatureTable {\r\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\r\n const feature = ModelFeature.create();\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getFeature(i, feature);\r\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\r\n }\r\n\r\n return table;\r\n }\r\n\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n assert(undefined === this.animationNodeIds);\r\n this.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getPackedFeature(i, output);\r\n output.index = i;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\r\n\r\n private readId(offset32: number): Id64String {\r\n return Id64.fromUint32Pair(this.data[offset32], this.data[offset32 + 1]);\r\n }\r\n}\r\n\r\ninterface PackedFeatureModelEntry {\r\n lastFeatureIndex: number;\r\n idLower: number;\r\n idUpper: number;\r\n}\r\n\r\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\r\n\r\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\r\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\r\n * The model table itself consists of one entry per model, where each entry looks like:\r\n * indexOfLastFeatureInModel: u32\r\n * modelId: u64\r\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\r\n * This lookup can be optimized using binary search.\r\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\r\n * @internal\r\n */\r\nexport class PackedFeatureModelTable {\r\n private readonly _data: Uint32Array;\r\n\r\n public constructor(data: Uint32Array) {\r\n this._data = data;\r\n assert(this._data.length % 3 === 0);\r\n }\r\n\r\n /** The number of models in the table. */\r\n public get length(): number {\r\n return this._data.length / 3;\r\n }\r\n\r\n public get byteLength(): number {\r\n return this._data.byteLength;\r\n }\r\n\r\n private getLastFeatureIndex(modelIndex: number): number {\r\n return this._data[modelIndex * 3];\r\n }\r\n\r\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\r\n if (modelIndex >= this.length) {\r\n result.idLower = result.idUpper = 0;\r\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\r\n return result;\r\n }\r\n\r\n const index = modelIndex * 3;\r\n result.lastFeatureIndex = this._data[index + 0];\r\n result.idLower = this._data[index + 1];\r\n result.idUpper = this._data[index + 2];\r\n return result;\r\n }\r\n\r\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\r\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n if (!result)\r\n result = { lower: 0, upper: 0 };\r\n else\r\n result.lower = result.upper = 0;\r\n\r\n let first = 0;\r\n const last = this.length;\r\n let count = last;\r\n while (count > 0) {\r\n const step = Math.floor(count / 2);\r\n const mid = first + step;\r\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\r\n if (featureIndex > lastFeatureIndex) {\r\n first = mid + 1;\r\n count -= step + 1;\r\n } else {\r\n count = step;\r\n }\r\n }\r\n\r\n if (first < last) {\r\n result.lower = this._data[first * 3 + 1];\r\n result.upper = this._data[first * 3 + 2];\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\r\n * @internal\r\n */\r\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\r\n private readonly _features: PackedFeatureTable;\r\n private readonly _models: PackedFeatureModelTable;\r\n\r\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\r\n this._features = features;\r\n this._models = models;\r\n }\r\n\r\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\r\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\r\n const featureData = data.subarray(0, modelTableOffset);\r\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\r\n\r\n const modelData = data.subarray(modelTableOffset);\r\n const models = new PackedFeatureModelTable(modelData);\r\n\r\n return new MultiModelPackedFeatureTable(features, models);\r\n }\r\n\r\n public get batchModelId() { return this._features.batchModelId; }\r\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\r\n public get numFeatures() { return this._features.numFeatures; }\r\n public get type() { return this._features.type; }\r\n public get animationNodeIds(): UintArray | undefined { return this._features.animationNodeIds; }\r\n public set animationNodeIds(ids: UintArray | undefined) { this._features.animationNodeIds = ids; }\r\n\r\n public get byteLength() {\r\n return this._features.byteLength + this._models.byteLength;\r\n }\r\n\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n this._features.getPackedFeature(featureIndex, result);\r\n this._models.getModelIdPair(featureIndex, result.modelId);\r\n return result;\r\n }\r\n\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result);\r\n }\r\n\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n return this._features.getElementIdPair(featureIndex, out);\r\n }\r\n\r\n public getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n this._models.getModelIdPair(featureIndex, out);\r\n return out;\r\n }\r\n\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n return this._features.findElementId(featureIndex);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\r\n let modelIndex = 0;\r\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\r\n\r\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\r\n if (featureIndex > modelEntry.lastFeatureIndex)\r\n this._models.getEntry(++modelIndex, modelEntry);\r\n\r\n this._features.getPackedFeature(featureIndex, output);\r\n output.modelId.lower = modelEntry.idLower;\r\n output.modelId.upper = modelEntry.idUpper;\r\n output.index = featureIndex;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return this._features.getAnimationNodeId(featureIndex);\r\n }\r\n\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n this._features.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\r\n }\r\n}\r\n"]}
|