@arcgis/core 6.0.0-next.14 → 6.0.0-next.16
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/analysis/LineOfSightAnalysis.d.ts +49 -32
- package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
- package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
- package/analysis/Viewshed.d.ts +23 -3
- package/analysis/ViewshedAnalysis.d.ts +33 -13
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
- package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
- package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
- package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
- package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
- package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
- package/assets/esri/core/workers/chunks/23c43f09c4a4749516e1.js +1 -0
- package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
- package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
- package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 36cbd614454581aaf334.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
- package/assets/esri/core/workers/chunks/3baa4a9c52f41bfd6abb.js +1 -0
- package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
- package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
- package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
- package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
- package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
- package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
- package/assets/esri/core/workers/chunks/4bbe1f28f5f16a6bef05.js +1 -0
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
- package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
- package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
- package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
- package/assets/esri/core/workers/chunks/5acb422fe3cf693d9d4f.js +1 -0
- package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
- package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
- package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
- package/assets/esri/core/workers/chunks/6a8dd8b18b0b825b0c1b.js +1 -0
- package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
- package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
- package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
- package/assets/esri/core/workers/chunks/7b5f3c79e0605c32b267.js +1 -0
- package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
- package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
- package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
- package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
- package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
- package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
- package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
- package/assets/esri/core/workers/chunks/91dd65cf877c8f2e01a7.js +1 -0
- package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
- package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
- package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
- package/assets/esri/core/workers/chunks/9b051745d24d1f43480b.js +1 -0
- package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
- package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 9f06ec95bdf0d0b52b41.js} +1 -1
- package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
- package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → a7bd5ba4d7d97411fd33.js} +1 -1
- package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
- package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
- package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
- package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → bf35927979fc5e7e0478.js} +1 -1
- package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
- package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → c5a9e77977e867a75ff2.js} +1 -1
- package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → c79934cd6883307203f8.js} +1 -1
- package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
- package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
- package/assets/esri/core/workers/chunks/d311ff96a5a2791d8cfc.js +1 -0
- package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
- package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
- package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
- package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
- package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
- package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
- package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
- package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
- package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
- package/assets/esri/core/workers/chunks/{aadfe34a99c9ec7a0e11.js → f9c5aa0bbf23e780fecc.js} +1 -1
- package/assets/esri/core/workers/chunks/f9ff27cfcf0538ac5e26.js +1 -0
- package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
- package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
- package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/index.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/config.d.ts +2 -0
- package/config.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/PooledArray.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/MultiOriginStore.js +1 -1
- package/core/accessorSupport/Store.js +1 -1
- package/core/accessorSupport/decorators/reader.js +1 -1
- package/core/accessorSupport/decorators/writer.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +9 -0
- package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils.d.ts +5 -6
- package/geometry/support/polygonExtentClipping.js +1 -1
- package/identity/Credential.js +1 -1
- package/interfaces.d.ts +18 -9
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +4 -4
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +154 -4
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Layer.d.ts +2 -0
- package/layers/LineOfSightLayer.d.ts +10 -8
- package/layers/SceneLayer.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
- package/layers/mixins/ReloadableLayer.js +2 -0
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +2 -2
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +1 -1
- package/layers/raster/functions/stretchUtils.js +1 -1
- package/layers/raster/functions/vectorFieldUtils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/LabelClass.d.ts +3 -2
- package/layers/support/PortalItemData.d.ts +31 -8
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/featureReductionProperties.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/types.d.ts +4 -1
- package/layers/video/VideoController.js +10 -10
- package/libs/maquette/projection.js +1 -1
- package/networks/UtilityNetworkTraceAnalysis.js +1 -1
- package/package.json +5 -5
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/portal/Portal.js +1 -1
- package/request/process.js +1 -1
- package/request/types.d.ts +7 -0
- package/rest/knowledgeGraph/ObjectValue.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/smartMapping/raster/renderers/shadedRelief.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/clusterUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -3
- package/undoredo/support/Services.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +7 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sphereExtentUtils.js +2 -0
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/options/TooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/constraintUtils.js +1 -1
- package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +35 -13
- package/views/layers/SketchLayerView.d.ts +1 -0
- package/views/layers/ViewshedLayerView.d.ts +36 -12
- package/views/webgl/Program.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +10 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor.d.ts +10 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
- package/widgets/FeatureTable/support/TableTemplate.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +2 -2
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Legend.d.ts +1 -0
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/types.d.ts +2 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
- package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
- package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
- package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
- package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
- package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
- package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
- package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
- package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
- package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
- package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
- package/assets/esri/core/workers/chunks/22e8c0aad2fe75943865.js +0 -1
- package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
- package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
- package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
- package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
- package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
- package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
- package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
- package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
- package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
- package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
- package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
- package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
- package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
- package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
- package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
- package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
- package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
- package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
- package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
- package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
- package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
- package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
- package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
- package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
- package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
- package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
- package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
- package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
- package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
- package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
- package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
- package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
- package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
- package/layers/mixins/FeatureLayerReload.js +0 -2
- /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,r,i,a)=>{let o=m(e),s=this._ensureSnappingManager(),c=this._getSnappingContext(a),d=this._updatingHandles,{lineState:f}=this;i=i.next(o).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let n=this.analysis[t];n!=null&&(e.location=n)}return n});let h=p(this.view),g=r.next(o).next(e=>{let r=h(e);return
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,r,i,a)=>{let o=m(e),s=this._ensureSnappingManager(),c=this._getSnappingContext(a),d=this._updatingHandles,{lineState:f}=this;i=i.next(o).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let n=this.analysis[t];n!=null&&(e.location=n)}return n});let h=p(this.view),g=r.next(o).next(e=>{let r=h(e);return r||this.lineState!==`drawing`&&this.lineState!==`initial`||(this[t]=null,this[n]=null),r});if(a!==`touch`||f===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:s,snappingContext:c,updatingHandles:d});i.next(t),g=g.next(...e)}g.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[r]:[r,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(()=>this.analysis[t],t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.startPoint!=null,endPointAvailable:this.endPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";class E extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._transparentRenderOrder=0,this._fadedExtensions=N,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){
|
|
2
|
+
import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";class E extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._transparentRenderOrder=0,this._fadedExtensions=N,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e!=null&&this._stippleOffColor!=null&&o(e,this._stippleOffColor)||(this._stippleOffColor=e==null?null:l(e),this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??N,this.recreateGeometry()}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset?3:0,renderOccluded:this._normalizedRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){let t=new T(this.materialParameters,this.view.state.isGlobal),n=[];return this._createObject3DGeometry(t,e,n),{material:t,geometries:n}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){let r=this._createGeometry(e);n.push(r),t.addGeometry(r),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new T(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){let t=this._createGeometry(e);return this._updateVerticesDraped(t),new w(t)}_createGeometry(e){let t=this.extensionType===3,n=t?[i(),i(),i(),i()]:[i(),i()];return C(e,n,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===3?this._updateLineSegmentFinite(j):this._updateLineSegmentInfinite(this._extensionType,j)}_updateLineSegmentFinite(e){return h(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){let n=this.view.state.camera;switch(u(this._ray,O),e){case 0:O.c0=-Number.MAX_VALUE;break;case 1:case 2:{let e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,`ground`)??0,n=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&n<t&&r(O.ray.direction,O.ray.direction),this._extensionType===2&&t!=null&&(O.c1=Math.abs(n-t));break}}if(!m(n.frustum,O))return this._updateLineSegmentFinite(t);let i=d(O,k),a=f(O,A);return h(i,a,t)}_updateVertexAttributesObject3D(e,t){let n=e.geometries[0].getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=e[2];e.geometryVertexAttributeUpdated(e.geometries[0],`position`)}_updateVertexAttributesDraped(e,t){let n=e.getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=S;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===3?(yield g(e,-this.fadedExtensions.start,k),yield g(e,0,k),yield g(e,1,k),yield g(e,1+this.fadedExtensions.end,k)):(yield g(e,0,k),yield g(e,1,k))}}function D(e){e.geometries=[]}const O=p(),k=i(),A=i(),j=_(),M=1/3,N={start:M,end:M};export{E as ExtendedLineVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EventEmitter as e}from"../../../../core/Evented.js";import{set as t,add as n,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as s,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as l}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as h}from"./EngineVisualElement.js";import{LaserlineVisualElement as g}from"./LaserlineVisualElement.js";import{ElevationContext as _}from"../../layers/graphics/ElevationContext.js";import{createGeometry as v}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as y,geometryToRenderInfo as b}from"../../support/renderInfoUtils/line.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as S}from"../../webgl-engine/materials/RibbonLineMaterial.js";class C extends h{constructor(t){super(t),this._attachmentOrigin=f(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=s(1,0,1,1),this._innerWidth=0,this._innerColor=s(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new g({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:w,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:w,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&this._laserlineStyle!=null&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){let t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){
|
|
2
|
+
import{EventEmitter as e}from"../../../../core/Evented.js";import{set as t,add as n,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as s,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as l}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as h}from"./EngineVisualElement.js";import{LaserlineVisualElement as g}from"./LaserlineVisualElement.js";import{ElevationContext as _}from"../../layers/graphics/ElevationContext.js";import{createGeometry as v}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as y,geometryToRenderInfo as b}from"../../support/renderInfoUtils/line.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as S}from"../../webgl-engine/materials/RibbonLineMaterial.js";class C extends h{constructor(t){super(t),this._attachmentOrigin=f(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=s(1,0,1,1),this._innerWidth=0,this._innerColor=s(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new g({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:w,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:w,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&this._laserlineStyle!=null&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){let t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=e?c(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;let e=this.object3dResources.resources?.geometries;if(!e||e.length===0)return null;t(E,0,0,0);let i=0;for(let t of e)t.computeAttachmentOrigin(T)&&(n(E,E,T),i++);return i===0?null:(r(E,E,1/i),this.view.renderCoordsHelper.fromRenderCoords(E,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return this.geometry!=null&&this.geometry.type===`polygon`}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:`round`,polygonOffset:3,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}_recreateGeometry(e,t,n){this._createRenderGeometries(t,n);for(let t of n)e.addGeometry(t);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit(`attachment-origin-changed`)}_createObject3DResources(e){let t=new S(this._materialParameters,this.view.state.isGlobal),n=[];return this._recreateGeometry(e,t,n),{material:t,geometries:n}}_createDrapedResources(){let e=new S(this._materialParameters,this.view.state.isGlobal);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){let{geometry:t,view:n}=this,r=n.groundView.spatialReference;return t==null||r==null?[]:y(t,r).lines.map(({position:t})=>{let i={overlayInfo:{spatialReference:r,renderCoordsHelper:n.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new x(v(e,i))})}calculateMapBounds(e){if(this.object3dResources.resources==null)return!1;let t=this.view.renderCoordsHelper;for(let n of this.object3dResources.resources.geometries){let r=n.attributes.get(`position`),i=d(r.data.length);l(r.data,t.spatialReference,0,i,this.view.spatialReference,0),u(e,i)}return!0}_createRenderGeometries(e,t){let n=this.geometry;if(n==null)return;let r=b(n,this.view.elevationProvider,this.view.renderCoordsHelper,_.fromElevationInfo(this.elevationInfo??new m({mode:p(n,null)}))),i=[];for(let{position:n,mapPositions:a}of r.lines){let r={mapPositions:a,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(v(e,r)),i.push(n)}this._laserline.pathVerticalPlane=i}}function w(e){e.geometries=[]}const T=i(),E=i();export{C as OutlineVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as o,removeMaybe as s,destroyMaybe as c}from"../../../../core/maybe.js";import{MinPriority as l}from"../../../../core/MemCache.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as d,ignoreAbortErrors as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/Queue.js";import{when as h,watch as g,on as ee,syncAndInitial as te,whenOnce as _}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as y,subclass as ne}from"../../../../core/accessorSupport/decorators.js";import{diff as b,isEmpty as re}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as S,add as C,scale as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import ie from"../../../../geometry/Extent.js";import ae from"../../../../geometry/Point.js";import{canProjectWithoutEngine as oe}from"../../../../geometry/projectionUtils.js";import{projectBuffer as E}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as D}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as se,fromRect as ce,create as k,equals as le}from"../../../../geometry/support/aaBoundingBox.js";import{create as ue}from"../../../../geometry/support/aaBoundingRect.js";import{equals as de}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as fe}from"../../../../graphic/getPopupProvider.js";import pe from"../../../../layers/Layer.js";import{getObjectId as A,computeAABB as j,hasGeometry as M}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import P from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as F,validateTo3D as I}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as L}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as R}from"../../../../support/basemapUtils.js";import{loadArcade as z}from"../../../../support/loadArcade.js";import B from"../../../../symbols/LabelSymbol3D.js";import me from"../../../../symbols/TextSymbol.js";import he from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as ge}from"../../../../symbols/support/defaults3D.js";import{to3D as V}from"../../../../symbols/support/symbolConversion.js";import{aggregateSymbolComplexity as _e,defaultSymbolComplexity as ve}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as ye}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as be}from"./ElevationQuery.js";import{extractExpressionInfo as H,createContext as U}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as xe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as Se}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as Ce}from"./Graphics3DSymbolCreationContext.js";import{make as we}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as Te}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as Ee}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as De}from"./GraphicStateTracking.js";import{computeCentroid as Oe}from"./graphicUtils.js";import{placePointOnGeometry as ke}from"./pointUtils.js";import{SpatialIndex2D as Ae}from"./SpatialIndex2D.js";import{AggregateSymbolComplexity as je}from"./SymbolComplexity.js";import{StageLayerElevationProvider as Me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ne}from"../../support/extentUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/affectsGeometry.js";import{GridLocalOriginFactory as Fe}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{WebGLLayer as Ie}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Le}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Re}from"../../../layers/support/popupUtils.js";import{PromiseQueue as G}from"../../../support/PromiseQueue.js";import{PropertiesPool as ze}from"../../../support/PropertiesPool.js";import{ImmediateTask as K,noBudget as Be,TaskPriority as Ve}from"../../../support/Scheduler.js";import{TextureCompressionTracker as He}from"../../../support/TextureCompressionTracker.js";import{Yield as Ue}from"../../../support/Yield.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var J;const Y=T(),We=k();let X=class extends t{static{J=this}static{this.tmpVec=T()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ae({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type===`dictionary`?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+(this._spatialIndex?.updatingRemaining||0)*.1+(this._elevationAlignment?.updatingRemaining||0)*.1:0)}get displayFeatureLimit(){let e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,n=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,i=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,o=Math.max(1,a?.verticesPerFeature??1),s=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:n,c=Math.ceil(i/o),l=Math.max(t,Math.min(n,c,s)),u=this._get(`displayFeatureLimit`);return u&&u.maximumTotalNumberOfVertices===i&&u.averageSymbolComplexity===a&&u.maximumNumberOfFeatures===l?u:new ye(i,l,a)}get averageSymbolComplexity(){return x(()=>{let e=this._averageSymbolComplexities,t=this._get(`averageSymbolComplexity`);return e.numComplexities===0||t!=null&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get _averageSymbolComplexities(){let e=this._totalSymbolComplexities;return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}get _totalSymbolComplexities(){let e=new je;return this._forEachSymbolComplexity(t=>_e(t,e)),e}get usedMemory(){let e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=0;if(this._forEachSymbolComplexityUsed(e=>t+=e?.memory.resourceBytes??0),this._symbolMaterials==null){this._symbolMaterials=[];for(let e of this._symbols.values())if(e!=null){for(let t of e.symbolLayers)if(t)for(let e of t.materials)e&&this._symbolMaterials.push(e)}}let n=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,i=this._symbolMaterials.reduce((e,t)=>e+((n.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+i}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){let e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(this.averageSymbolComplexity!=null){let e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}_forEachSymbolComplexity(e){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(e):this._forEachSymbolComplexityUsed(e)}get visible(){return this._visible}_getConvertedSymbol(e){let t=e;if(t.type===`web-style`)return t.clone();let n=this._symbolConversionCache.get(t.id);if(n!=null)return n;let r=V(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return a==null&&r.error&&i.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){let t=this.currentRenderer;if(t==null)return;let n=t.symbols,r=`backgroundFillSymbol`in t?t.backgroundFillSymbol:null;if(!r&&!n.length)return;let i=this._getSymbolComplexityUsedOrRenderer(r);i!=null&&e(i);for(let t of n){let n=this._getSymbolComplexityUsedOrRenderer(t);n!=null&&e(n)}}_getSymbolComplexityUsedOrRenderer(e){if(e==null)return null;let t=this._symbols.get(e.id);if(t!=null)return t.complexity;let n=this._getConvertedSymbol(e);return n==null?null:ve(n)}_forEachSymbolComplexityUsed(e){this._symbols.forEach(t=>{e(t?.complexity)})}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new ze({computedExtent:()=>new ie},this),this.computedExtent=null,this.currentRenderer=null,this.rendererRequiresHydratedGraphic=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=K,this._dataUpdateQueue=new G,this._updateQueue=new G,this._focusAreasGraphicsQueue=new m,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new He,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.reportGraphicSourceMemory=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache(`graphics-3d-unused-symbols`,e=>e.destroy()),this.symbolCreationContext=new Ce(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new xe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e),usedMemoryInvalidated:e=>{let t=e.updateUsedMemory(this.reportGraphicSourceMemory);this.graphics3DGraphics.get(e.graphic.uid)===e&&(this._usedMemory+=t)}});let e=(e,t,n)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,n),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(A(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(h(()=>this.owner.view.state.highlights,()=>{let{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){let e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new be(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);let n=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=n,this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Fe(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;let r=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await U(r,this._viewSpatialReference,e,i.getLogger(this)),d(e),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,`drapeSourceType`in this.owner){let{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([g(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(f)),g(()=>W(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),g(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),g(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),g(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),g(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),g(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),g(()=>this.owner.view.timeZone,()=>{this.currentRenderer?.arcadeRequired&&this.recreateAllGraphics()}),g(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),h(()=>t.basemapTerrain?.tilingScheme,e=>{let n=t.groundView?.spatialReference;!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&n!=null&&(this.symbolCreationContext.overlaySR=n),this.hasHandles(`loaded-graphics`)?this.recreateAllGraphics():this.addHandles([ee(()=>this.owner?.loadedGraphics,`change`,e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],`loaded-graphics`)},{initial:!0}),g(()=>this.effectiveUpdatePolicy,e=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===0,e===1&&this.runTask(Be)},te)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ve.GRAPHICS_CORE,this),this.layer&&`featureReduction`in this.layer&&this.addHandles(g(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange(`averageSymbolComplexity`),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=o(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=o(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=K,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=s(this._deconflictor),this._labeler=s(this._labeler),this._elevationAlignment=c(this._elevationAlignment),this._scaleVisibility=c(this._scaleVisibility),this._filterVisibility=c(this._filterVisibility),this._objectStates=c(this._objectStates),this.clear(),`drapeSourceType`in this.owner){let{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=c(this._featureStore),this._updatingPendingLoadedGraphicsChange=s(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=c(this._graphicStateTracking),this.stage&&=(this.stageLayer=c(this.stageLayer),null),this._set(`owner`,null);for(let e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r(`graphic:layer-destroyed`,`Layer has been destroyed`));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=c(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=c(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(c),this._symbols.clear(),this._symbolMaterials&&=(this._symbolMaterials.length=0,null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange(`dataUpdating`),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Ie(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);let n=this.stageLayer.events;n.on(`transformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`shaderTransformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`visibilityChanged`,e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),n.on(`geometryAdded`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`geometryRemoved`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`attributesChanged`,e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){let e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*Ge,n=!this.suspendedOrOutsideOfView&&!t;n!==this._visible&&(this._visible=n,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){let e=this._visible&&(this.layer.opacity==null||this.layer.opacity>=q);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return e==null?void 0:this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return A(e,t)}get graphics3DGraphicsByObjectID(){let e=this.owner.layer?.objectIdField;if(!e)return;let t=new Map;return this.graphics3DGraphics.forEach(n=>{if(!n)return;let r=n.graphic,i=this._getGraphicObjectID(r,e);i!=null&&t.set(i,n)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){let t=this._deconflictor?.labelingInfoChange(e),n=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,n])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return`unknown`;let e=!1,t=!1;for(let[n,r]of this._symbols)if(r!=null)switch(r.getFastUpdateStatus()){case 3:return`unknown`;case 1:this._graphicsBySymbol.has(n)&&(t=!0);break;case 0:this._graphicsBySymbol.has(n)&&(e=!0);break;case 2:this._graphicsBySymbol.has(n)&&(t=e=!0)}return t?e?`mixed`:`fast`:e?`slow`:`mixed`}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange(`readyToRun`),this.readyToRun||this.notifyChange(`dataUpdating`),this.notifyChange(`updatingRemaining`),!e.hasProgressed)return Ue}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);let n=this._findGraphics3DGraphicByObjectId(e);n!=null&&this._updateUserVisibility(n)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(e==null)return!1;let t=e.graphic,n=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(n==null||!this._objectIdInvisibleSet.has(n));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){let t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);let n=this._whenGraphics3DGraphicRequests[e.uid];if(n)return n.promise;let r=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){let n=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,i=this.owner.view.groundView.spatialReference,a=(e,t,i)=>E(e,r,t,e,n,t,i),o=(e,t,r)=>E(e,i,t,e,n,t,r),s=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:t!=null&&!!t.useViewElevation,minDemResolution:t==null?null:t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,c=await e.getProjectedBoundingBox(a,o,s,t?.signal);if(!c)return null;let l=c.boundingBox;if(c.requiresDrapedElevation){let e=this.symbolCreationContext.elevationProvider;if(e){se(l,Y);let t=e.getElevation(Y[0],Y[1],0,n,`ground`)??0;l[2]=Math.min(l[2],t),l[5]=Math.max(l[5],t)}}return{boundingBox:l,screenSpaceObjects:c.screenSpaceObjects}}async whenGraphicBounds(e,t){await _(()=>this.owner?.loadedGraphics);let n=this.owner.layer?.objectIdField,i=this.owner.loadedGraphics.find(t=>t===e||n!=null&&t.attributes!=null&&e.attributes&&t.attributes[n]===e.attributes[n]);if(!i)throw new r(`internal:graphic-not-part-of-view`,`Graphic is not part of this view`);let a=await this._whenGraphics3DGraphic(i);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){let n=this.graphics3DGraphics.get(e.uid);if(!n)return null;let r=n.computeAttachmentOrigin();if(r.render.num===0&&r.draped.num===0)return null;S(Q,0,0,0);let i=0;if(r.render.num>0){if(!D(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,t))return null;C(Q,Q,$),i++}if(r.draped.num>0){let[e,n]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,n,`ground`)??0;if(S($,e,n,a),!D($,this._viewElevationProvider.spatialReference,$,t))return null;C(Q,Q,$),i++}return i>1&&w(Q,Q,1/i),new ae({x:Q[0],y:Q[1],z:Q[2],spatialReference:t})}getSymbolLayerSize(e,t){let n=this._symbols.get(e.id);if(n==null)throw new r(`internal:symbol-not-part-of-view`,`Symbol is not part of this view`);let i=e.symbolLayers.indexOf(t);if(i===-1)throw new r(`internal:missing-symbol-layer`,`Symbol layer is not in symbol`);let a=n.getSymbolLayerSize(i);if(a==null)throw new r(`internal:missing-size`,`Symbol layer has no valid size`);return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){let t=e.graphic.uid,n=this.graphics3DGraphics.get(t);if(n!=null||this._graphicsWithoutSymbol.get(t)!=null){switch(e.property){case`visible`:this._graphicUpdateVisibleHandler(n);break;case`geometry`:this._graphicUpdateGeometryHandler(n,e.graphic);break;case`symbol`:this._graphicUpdateSymbolHandler(n,e);break;case`attributes`:this.symbolCreationContext.featureExpressionInfoContext?.arcade?this._graphicUpdateGeometryHandler(n,e.graphic):this._usedMemory+=n?.updateUsedMemory(this.reportGraphicSourceMemory)??0;break;case`popupTemplate`:break;case`origin-transform`:this._graphicUpdateTransformHandler(n,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>e!=null&&e.graphics3DSymbol.updateGeometry(e)&&(this._labeler?.updateGraphicGeometry(e)??!0)?(this._labeler?.setDirty(),this._deconflictor?.setDirty(),this._usedMemory+=e.updateUsedMemory(this.reportGraphicSourceMemory),!0):!1);let n=t.geometry;n!=null&&this._expandComputedExtent(n)}_graphicUpdateTransformHandler(e,t){let n=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>t.newValue!=null&&e!=null&&n!=null&&e.graphics3DSymbol.updateTransform(e,n.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,n){if(t.geometry==null)this._recreateGraphic(t);else if(e==null){let e=t.symbol?.id;if(e){let t=this._symbols.get(e);if(t!=null&&t.loadStatus===0)return}this._recreateGraphic(t)}else if(!n()){let n=this._deconflictor?.getState(e);this._recreateGraphic(t);let r=this.graphics3DGraphics.get(t.uid);r&&n!=null&&this._deconflictor?.setState(r,n)}}_graphicUpdateSymbolHandler(e,t){let n=t.graphic,r=e==null?t.oldValue==null?null:this._symbols.get(t.oldValue.id):e.graphics3DSymbol;if(r==null||t.newValue==null){this._recreateGraphic(n);return}let i=r.symbol,a=this._getConvertedSymbol(t.newValue);if(a!=null&&(a.type!==i.type||a.type===`web-style`)||i.type===`web-style`){this._recreateGraphic(n);return}let o=this._graphicsBySymbol.get(i.id);if(o&&o.size!==1){this._recreateGraphic(n);return}let s=b(i,a);if(s==null){this._updateSymbolMapping(i.id,a);return}let c={diff:s,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(c),!re(c.diff)){this._recreateGraphic(n);return}let l=this._getRenderingInfo(n,!1);if(l==null){this._recreateGraphic(n);return}let u=r.extentPadding;for(let e of c.symbolStatePatches)e();if(u!==r.extentPadding&&this._recomputeExtentPadding(),e!=null)for(let t of c.graphics3DGraphicPatches)t(e,l);this._updateSymbolMapping(i.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===1&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){let t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),this._graphicsWaitingForSymbol.size===1&&this.notifyChange(`dataUpdating`),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`)))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{t!=null&&(e=Math.max(e,t.extentPadding))}),this._set(`extentPadding`,e)}_expandComputedExtent(e){let t=We,n=e.spatialReference;j(e,t);let r=this._viewSpatialReference,i=J.tmpVec;if(de(n,r)||O(t[0],t[1],0,n,i,r)&&(t[0]=i[0],t[1]=i[1],O(t[3],t[4],0,n,i,r),t[3]=i[0],t[4]=i[1]),!isFinite(t[0])||!isFinite(t[3])||!isFinite(t[1])||!isFinite(t[4]))return;let a=this.computedExtent,o=null,s=isFinite(t[2])&&isFinite(t[5]),c=s&&(a?.zmin==null||t[2]<a.zmin),l=s&&(a?.zmax==null||t[5]>a.zmax);a?(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||c||l)&&(o=this._propertiesPool.get(`computedExtent`),o.xmin=Math.min(t[0],a.xmin),o.ymin=Math.min(t[1],a.ymin),o.xmax=Math.max(t[3],a.xmax),o.ymax=Math.max(t[4],a.ymax),o.spatialReference=r):(o=this._propertiesPool.get(`computedExtent`),o.xmin=t[0],o.ymin=t[1],o.xmax=t[3],o.ymax=t[4],o.spatialReference=r),o&&(c&&(o.zmin=t[2]),l&&(o.zmax=t[5]),this._set(`computedExtent`,o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&=(this._elevationInfoChangeAbortController.abort(),null)}async elevationInfoChange(){this._abortElevationInfoChange();let e=new AbortController;this._elevationInfoChangeAbortController=e;let t=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await U(t,this._viewSpatialReference,e.signal,i.getLogger(this)),d(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`elevationInfo`,t)?t?.forEach(e=>{let t=e.graphic,n=e.labelLayers;for(let e of n)e.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,e)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo?.mode===`relative-to-scene`||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=c(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!==`relative-to-scene`)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&=(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),c(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;let{loadedGraphics:t,view:n}=this.owner,r=n.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;(e||!r)&&this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set(`computedExtent`,null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){let t=this._graphicsBySymbol.get(e),n=[];t&&(t.forEach((e,t)=>{this._conditionalRemove(e,t),this._spatialIndex?.remove(e),n.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,e),this._updateLayerVisibility(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));let r=this._symbols.get(e);c(r),this._symbols.delete(e),this._symbolMaterials=null,c(this._unusedSymbolsCache.pop(e)),this.add(n)}_recreateGraphicsForSymbol(e){let t=this._graphicsBySymbol.get(e);if(t){let e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&e.length!==0&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===0?this._addDelayed(e):this._addImmediate(e),this.notifyChange(`dataUpdating`)):i.getLogger(this).error(`#add()`,`Cannot add graphics before terrain surface has been initialized`))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===1&&(this.layer.geometryType===`mesh`||this.layer.geometryType==null)){for(let t of e)if(t.geometry!=null&&t.geometry.type===`mesh`&&!t.geometry.loaded)return 0}return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(let t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);n?n.add?n.state!==0&&n.abortController?.abort():this._pendingAdds++:(n=new Z,this._pendingAdds++,this._pendingUpdates.set(e,n)),n.add=t}this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}remove(e){this.effectiveUpdatePolicy===0?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange(`dataUpdating`)}_removeImmediate(e){for(let t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);if(n)n.add&&(n.remove?n.add=null:this._pendingUpdates.delete(e),n.state===1&&n.abortController?.abort(),this._pendingAdds--);else{let n=new Z;n.remove=t,this._pendingUpdates.set(e,n),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&i.getLogger(this).warn(`pendingAdds/Removes in inconsistent state!`),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();let t=this._focusAreasGraphicsQueue.pop(),n=ke(t.graphic.geometry);if(n==null)continue;let r=this.stage.view.focusAreasView?.containsGeometry(n)??!0;t.layers.forEach(e=>{(e?.type===`object3d`||e?.type===`buffer`)&&e.stageObject.geometries.some(e=>e.material instanceof Le&&e.material.parameters.focusAreaStyle==null!==r)&&this.recreateGraphics([t.graphic])})}this._focusAreasGraphicsQueue.length===0&&this.notifyChange(`readyToRun`)}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&this._spatialIndex?.updating)this._spatialIndex.update(),e.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(let[t,n]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(n.remove&&!n.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,this._pendingUpdates.delete(t),this._pendingRemoves===0))break}}for(let[t,n]of this._pendingUpdates){if(e.done)break;n.add&&n.state===0&&this._processPendingUpdateNew(n);let r=this.effectiveUpdatePolicy;if(n.remove&&(!n.add||n.state===2)&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,r=1),n.add)switch(n.state){case 2:this._addGraphic(n.add,n.renderingInfo,r),n.add=null,this._pendingAdds--,e.madeProgress();break;case 3:n.add=null,this._pendingAdds--}n.remove==null&&n.add==null&&this._pendingUpdates.delete(t)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`dataUpdating`))}}_processPendingUpdateNew(e){if(!e.add){e.state=2;return}let t=e.add.geometry;t!=null&&t.type===`mesh`&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;let n=e.abortController.signal;try{await t.load({signal:n})}catch(t){return this._processPendingUpdateNewError(e,t)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,e.state=p(t)?0:3}async _processPendingUpdateNewRenderingInfo(e){if(this.layer.renderer==null||this.layer.renderer.type!==`dictionary`){e.renderingInfo=this._getRenderingInfo(e.add),e.state=2;return}e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(t){e.abortController=null,e.state=p(t)?0:3;return}t?.symbol==null?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,n){if(this._graphicsWithoutSymbol.set(e.uid,e),t?.symbol==null||!M(e))return;let r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){let t=R(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(A(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,fe(this.layer)&&!!this.layer.popupEnabled&&!t&&Re(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}let i=t.symbol,a=this.getOrCreateGraphics3DSymbol(i,t.renderer);if(a==null)return;this._expandComputedExtent(e.geometry);let o=this._beginGraphicUpdate(e),s=new Se(e,t,this.layer),c=!1,l=e=>{e===a.symbol.id&&(c=!0)};this._whenSymbolRemoved.push(l);let u=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(e.uid)===o&&!c&&!a.destroyed&&(!this.graphicSymbolSupported||!e.symbol||e.symbol.id===a.symbol.id)){let t=this._createGraphics3DGraphic(a,s);this._spatialIndex&&t!=null&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}else--a.referenced,this._cleanupSymbols();this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()}},d=t=>{--this._loadingSymbols,!this.destroyed&&(this._whenSymbolRemoved.removeUnordered(l),c||(p(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,n===0?a.load(()=>this._dataUpdateQueue.push(u,null).catch(f),e=>this._dataUpdateQueue.push(()=>d(e),null).catch(f)):a.load(u,d)}_removeGraphic(e){let t=e.uid,n=this.graphics3DGraphics.get(t);if(n){n.graphics3DSymbol.onRemoveGraphic(n);let e=n.isElevationSource;this._conditionalRemove(n,t),this._spatialIndex?.remove(n);let r=n.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(r)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,n,e),n.destroy(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`))}_hasLabelingContext(e){if(e instanceof B||e instanceof me){let t=this.symbolCreationContext.layer;return t.labelingInfo?t.labelingInfo.some(t=>t.symbol===e):!1}return!1}_hasValidSymbolCreationContext(e){return e instanceof B&&!this._hasLabelingContext(e)?(i.getLogger(this).error(`LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported.`),!1):!0}_getRenderingInfo(e,t=!0){let n=e.geometry;if(n==null)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!oe(n.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let r=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e,a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{let e=r.symbol||ge(r.geometry);a=new L(null,e)}return a?.symbol==null?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(e.geometry==null)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let n=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(n,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;let n=this._getConvertedSymbol(e);if(!n)return null;let r;if(t!=null&&`backgroundFillSymbol`in t&&t.backgroundFillSymbol){let e=V(t.backgroundFillSymbol,{ignoreDrivers:!0});e.symbol!=null&&(r=e.symbol.symbolLayers)}let i=we(n,this.symbolCreationContext,r);return i.load(()=>{let e=i.extentPadding;e>this.extentPadding&&this._set(`extentPadding`,e),this.notifyChange(`averageSymbolComplexity`)},()=>{}),i}getOrCreateGraphics3DSymbol(e,t){let n=this._symbols.get(e.id);return n===void 0&&(n=this._unusedSymbolsCache.pop(e.id)??(e instanceof he?new Te(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t)),this._symbols.set(e.id,n),this._symbolMaterials=null),n!=null&&++n.referenced,n}trackGraphicState(e){return this._graphicStateTracking??=new De(this),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){e.updateUsedMemory(this.reportGraphicSourceMemory),this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,n=!1){this._usedMemory-=t.usedMemory,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,n&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){let{graphic:n}=t;if(this._graphicsWithoutSymbol.delete(n.uid),!this._symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;let r=e.createGraphics3DGraphic(t);if(r==null)return null;this._addGraphics3DGraphic(r);let i=e.symbol.id;if(this._graphicsBySymbol.has(i)||this._graphicsBySymbol.set(i,new Map),this._graphicsBySymbol.get(i).set(n.uid,r),r.isDraped&&this._graphicsDrapedUids.add(n.uid),r.centroid=null,n.geometry!=null&&n.geometry.type!==`point`&&(r.centroid=Oe(n.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(r),this._filterVisibility!=null){let{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(r);let a=this._whenGraphics3DGraphicRequests[n.uid];return a&&(delete this._whenGraphics3DGraphicRequests[n.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=o(this._rendererChangeAbortController),e!==this.currentRenderer){if(this._validateRenderer(e),e??this._currentRendererChange(null,!1),!F(e))this._currentRendererChange(e,!1);else if(e?.arcadeRequired){let t=new AbortController;this._rendererChangeAbortController=t;let{arcadeUtils:n}=await this._ensureArcade();d(t);let r=n.hasGeometryOperations(e),i=r||await this._rendererUsesFieldsRequiringArcadeTypeConversion(e);d(t),r&&(await n.enableGeometryOperations(),d(t)),this.effectiveUpdatePolicy===0?await this._updateQueue.push(()=>this._currentRendererChange(e,i),t.signal):this._currentRendererChange(e,i),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===0){let t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1)}}async _ensureArcade(){return this._arcadeOnDemand??=await z(),this._arcadeOnDemand}async _rendererUsesFieldsRequiringArcadeTypeConversion(e){let{fieldsIndex:t}=this.layer;return t!=null&&(await e.getRequiredFields(t)).some(e=>{switch(t.get(e)?.type){case`date`:case`date-only`:case`time-only`:case`timestamp-offset`:return!0;default:return!1}})}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererRequiresHydratedGraphic=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;let n=this.symbolCreationContext.renderer;if(e===n)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),e==null){this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();return}let r=b(n,e);this._updateUnchangedSymbolMappings(r,e,n),this.symbolCreationContext.renderer=e,r!=null&&(r.type===`complete`?this.recreateAllGraphicsAndSymbols():r.type===`partial`&&(this._applyRendererDiff(r,e,n)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange(`averageSymbolComplexity`))}_diffHasSymbolChange(e){for(let t in e.diff)switch(t){case`visualVariables`:case`defaultSymbol`:case`uniqueValueInfos`:break;case`uniqueValueGroups`:case`authoringInfo`:case`fieldDelimiter`:delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,n){e||=[],t||=[];let r=[];for(let i of t){let t=this._graphicsBySymbol.get(i.id);t&&t.forEach((a,o)=>{let s=a.graphic,c=this.layer instanceof pe?this.layer:null,l=this._arcadeOnDemand;if(i===n.defaultSymbol&&n.getSymbol(N(s,c,null),{arcade:l})===n.defaultSymbol)return;e.length||n.defaultSymbol?r.push(s):this._graphicsWithoutSymbol.set(o,s);let u=this.graphics3DGraphics.get(o);this._conditionalRemove(u,o),a.destroy(),t.delete(o),this._removeGraphics3DGraphic(o,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(i.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){let i=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(i||a){let o=a?.changed,s=a?.unchanged;if(o&&s&&o.some(e=>s.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;let c=a?a.added.map(e=>e.symbol).filter(n):[],l=a?a.removed.map(e=>e.symbol).filter(n):[];if(o)for(let e=0;e<o.length;e++)c.push(o[e].newValue.symbol),l.push(o[e].oldValue.symbol);return i?(r.defaultSymbol&&l.push(r.defaultSymbol),t.defaultSymbol&&c.push(t.defaultSymbol)):r.defaultSymbol&&c.length&&l.push(t.defaultSymbol),this._applySymbolSetDiff(c,l,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,n){if(t?.type!==`unique-value`||n?.type!==`unique-value`||e!=null&&e.type!==`partial`)return[];let r=e=>e==null?null:e.id,i=e&&e.diff,a=i?.defaultSymbol,o=i&&i.uniqueValueInfos,s;if(o)s=o.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{s=[];for(let e of n.uniqueValueInfos??[]){let n=r(e.symbol),i=t.uniqueValueInfos?.find(t=>t.value===e.value);i&&n!==r(i.symbol)&&s.push({oldId:n,newId:r(i.symbol)})}}return!a&&n.defaultSymbol&&s.push({oldId:r(n.defaultSymbol),newId:r(t.defaultSymbol)}),s}_updateSymbolMapping(e,t){let n=t!=null&&t?typeof t==`string`?t:t.id:null;if(e==null||e===n)return;let r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),r!==void 0&&this._graphicsBySymbol.set(n,r);let i=this._symbols.get(e);if(i!==void 0&&(this._symbols.delete(e),this._symbols.set(n,i),this._symbolMaterials=null,i!=null)){let e=typeof t==`string`?null:t;e==null?i.symbol.id=n:i.symbol=e}}_updateUnchangedSymbolMappings(e,t,n){let r=this._calculateUnchangedSymbolMapping(e,t,n);for(let{oldId:e,newId:t}of r)this._updateSymbolMapping(e,t)}_applyRendererDiff(e,t,n){if(this._diffHasSymbolChange(e))return!1;if(t instanceof P&&n instanceof P&&this._applyUniqueValueRendererDiff(e,t,n)&&Object.keys(e.diff).length===0)return!0;for(let n of this._graphicsBySymbol.keys()){let r=this._symbols.get(n);if(r!=null)switch(r.applyRendererDiff(e,t)){case 0:this._recreateSymbol(n);break;case 1:this._recreateGraphicsForSymbol(n)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`opacity`,t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`screenSizePerspectiveEnabled`,t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`slicePlaneEnabled`,t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`physicalBasedRenderingEnabled`,t)||this._recreateSymbol(n)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`skipHighSymbolLods`,t)||this._recreateSymbol(n)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`pixelRatio`,t)||this._recreateSymbol(n)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){let n=this.symbolCreationContext.clippingExtent,r=ue();return Ne(e,r,t)?this.symbolCreationContext.clippingExtent=ce(k(),r):this.symbolCreationContext.clippingExtent=null,!le(this.symbolCreationContext.clippingExtent,n)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(n=>{e(n)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(let[t,n]of this._symbols){if(n==null)return;e(n,this._graphicsBySymbol.get(t)||Ke,t)}if(!t?.excludeUnused)for(let t of this._unusedSymbolsCache)e(t,void 0,t.symbol.id)}updateGraphicsVisibilities(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{let t=this._updateUserVisibility(e),n=!!this._scaleVisibility?.updateVisibility(e);return t||n})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){let t=()=>`'${this.layer.title?`${this.layer.title}, `:``}id:${this.layer.id}'`,n=I(e,{geometryType:this.layer?.geometryType,logWarning:(e,n)=>i.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${n}`)});if(n){let e=`Renderer for layer ${t} is not supported in a SceneView`;i.getLogger(this).warn(e,n.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,n)=>{if(t==null||t.referenced>0)return;let r=this._graphicsBySymbol.get(n);(!r||r.size===0)&&(this._graphicsBySymbol.delete(n),this._symbols.delete(n),this._symbolMaterials=null,this._unusedSymbolsCache.put(n,t,l),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange(`averageSymbolComplexity`))}get test(){}get performanceInfo(){return new Ee(this.graphics3DGraphics.size,this.graphics3DGraphics.values().reduce((e,t)=>e+ +!!t.isVisible(),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([y({readOnly:!0})],X.prototype,`computedExtent`,void 0),e([y()],X.prototype,`currentRenderer`,void 0),e([y()],X.prototype,`rendererRequiresHydratedGraphic`,void 0),e([y()],X.prototype,`_frameTaskHandle`,void 0),e([y()],X.prototype,`_dataUpdateQueue`,void 0),e([y()],X.prototype,`_updateQueue`,void 0),e([y({readOnly:!0})],X.prototype,`_viewSpatialReference`,null),e([y()],X.prototype,`_rendererChangeAbortController`,void 0),e([y()],X.prototype,`_elevationInfoChangeAbortController`,void 0),e([y()],X.prototype,`_initializeAbortController`,void 0),e([y()],X.prototype,`_elevationAlignment`,void 0),e([y()],X.prototype,`_scaleVisibility`,void 0),e([y()],X.prototype,`_filterVisibility`,void 0),e([y()],X.prototype,`_initializePromise`,void 0),e([y()],X.prototype,`_spatialIndex`,void 0),e([y({readOnly:!0})],X.prototype,`extentPadding`,void 0),e([y()],X.prototype,`_updatingPendingLoadedGraphicsChange`,void 0),e([y()],X.prototype,`_featureStore`,void 0),e([y()],X.prototype,`_objectStates`,void 0),e([y()],X.prototype,`_loadingSymbols`,void 0),e([y({constructOnly:!0})],X.prototype,`compressionTracker`,void 0),e([y()],X.prototype,`preferredUpdatePolicy`,void 0),e([y()],X.prototype,`_forcedUpdatePolicy`,void 0),e([y({readOnly:!0})],X.prototype,`effectiveUpdatePolicy`,null),e([y({constructOnly:!0})],X.prototype,`elevationFeatureExpressionEnabled`,void 0),e([y({constructOnly:!0})],X.prototype,`owner`,void 0),e([y({constructOnly:!0})],X.prototype,`layer`,void 0),e([y({constructOnly:!0})],X.prototype,`graphicSymbolSupported`,void 0),e([y({constructOnly:!0})],X.prototype,`getRenderingInfoWithoutRenderer`,void 0),e([y({constructOnly:!0})],X.prototype,`componentFactories`,void 0),e([y({constructOnly:!0})],X.prototype,`setUidToIdOnAdd`,void 0),e([y({constructOnly:!0})],X.prototype,`reportGraphicSourceMemory`,void 0),e([y()],X.prototype,`featureStore`,null),e([y()],X.prototype,`initializePromise`,null),e([y()],X.prototype,`scaleVisibility`,null),e([y()],X.prototype,`elevationAlignment`,null),e([y()],X.prototype,`objectStates`,null),e([y()],X.prototype,`filterVisibility`,null),e([y({readOnly:!0})],X.prototype,`updating`,null),e([y({readOnly:!0})],X.prototype,`dataUpdating`,null),e([y({readOnly:!0})],X.prototype,`readyToRun`,null),e([y({readOnly:!0})],X.prototype,`suspendedOrOutsideOfView`,null),e([y({readOnly:!0})],X.prototype,`updatingRemaining`,null),e([y({readOnly:!0})],X.prototype,`displayFeatureLimit`,null),e([y({readOnly:!0})],X.prototype,`averageSymbolComplexity`,null),e([y({constructOnly:!0})],X.prototype,`hasZ`,void 0),e([y({constructOnly:!0})],X.prototype,`hasM`,void 0),e([y()],X.prototype,`_objectIdField`,null),X=J=e([ne(`esri.views.3d.layers.graphics.Graphics3DCore`)],X);class Z{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const Ge=10,Q=T(),$=T(),Ke=new Map;export{X as Graphics3DCore};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as o,removeMaybe as s,destroyMaybe as c}from"../../../../core/maybe.js";import{MinPriority as l}from"../../../../core/MemCache.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as d,ignoreAbortErrors as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/Queue.js";import{when as h,watch as g,on as ee,syncAndInitial as te,whenOnce as _}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as y,subclass as ne}from"../../../../core/accessorSupport/decorators.js";import{diff as b,isEmpty as re}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as S,add as C,scale as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import ie from"../../../../geometry/Extent.js";import ae from"../../../../geometry/Point.js";import{canProjectWithoutEngine as oe}from"../../../../geometry/projectionUtils.js";import{projectBuffer as E}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as D}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as se,fromRect as ce,create as k,equals as le}from"../../../../geometry/support/aaBoundingBox.js";import{create as ue}from"../../../../geometry/support/aaBoundingRect.js";import{equals as de}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as fe}from"../../../../graphic/getPopupProvider.js";import pe from"../../../../layers/Layer.js";import{getObjectId as A,computeAABB as j,hasGeometry as M}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import P from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as F,validateTo3D as I}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as L}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as R}from"../../../../support/basemapUtils.js";import{loadArcade as z}from"../../../../support/loadArcade.js";import B from"../../../../symbols/LabelSymbol3D.js";import me from"../../../../symbols/TextSymbol.js";import he from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as ge}from"../../../../symbols/support/defaults3D.js";import{to3D as V}from"../../../../symbols/support/symbolConversion.js";import{aggregateSymbolComplexity as _e,defaultSymbolComplexity as ve}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as ye}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as be}from"./ElevationQuery.js";import{extractExpressionInfo as H,createContext as U}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as xe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as Se}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as Ce}from"./Graphics3DSymbolCreationContext.js";import{make as we}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as Te}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as Ee}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as De}from"./GraphicStateTracking.js";import{computeCentroid as Oe}from"./graphicUtils.js";import{placePointOnGeometry as ke}from"./pointUtils.js";import{SpatialIndex2D as Ae}from"./SpatialIndex2D.js";import{AggregateSymbolComplexity as je}from"./SymbolComplexity.js";import{StageLayerElevationProvider as Me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ne}from"../../support/extentUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/affectsGeometry.js";import{GridLocalOriginFactory as Fe}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{WebGLLayer as Ie}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Le}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Re}from"../../../layers/support/popupUtils.js";import{PromiseQueue as G}from"../../../support/PromiseQueue.js";import{PropertiesPool as ze}from"../../../support/PropertiesPool.js";import{ImmediateTask as K,noBudget as Be,TaskPriority as Ve}from"../../../support/Scheduler.js";import{TextureCompressionTracker as He}from"../../../support/TextureCompressionTracker.js";import{Yield as Ue}from"../../../support/Yield.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var J;const Y=T(),We=k();let X=class extends t{static{J=this}static{this.tmpVec=T()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ae({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type===`dictionary`?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+(this._spatialIndex?.updatingRemaining||0)*.1+(this._elevationAlignment?.updatingRemaining||0)*.1:0)}get displayFeatureLimit(){let e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,n=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,i=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,o=Math.max(1,a?.verticesPerFeature??1),s=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:n,c=Math.ceil(i/o),l=Math.max(t,Math.min(n,c,s)),u=this._get(`displayFeatureLimit`);return u&&u.maximumTotalNumberOfVertices===i&&u.averageSymbolComplexity===a&&u.maximumNumberOfFeatures===l?u:new ye(i,l,a)}get averageSymbolComplexity(){return x(()=>{let e=this._averageSymbolComplexities,t=this._get(`averageSymbolComplexity`);return e.numComplexities===0||t!=null&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get _averageSymbolComplexities(){let e=this._totalSymbolComplexities;return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}get _totalSymbolComplexities(){let e=new je;return this._forEachSymbolComplexity(t=>_e(t,e)),e}get usedMemory(){let e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=0;if(this._forEachSymbolComplexityUsed(e=>t+=e?.memory.resourceBytes??0),this._symbolMaterials==null){this._symbolMaterials=[];for(let e of this._symbols.values())if(e!=null){for(let t of e.symbolLayers)if(t)for(let e of t.materials)e&&this._symbolMaterials.push(e)}}let n=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,i=this._symbolMaterials.reduce((e,t)=>e+((n.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+i}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){let e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(this.averageSymbolComplexity!=null){let e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}_forEachSymbolComplexity(e){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(e):this._forEachSymbolComplexityUsed(e)}get visible(){return this._visible}_getConvertedSymbol(e){let t=e;if(t.type===`web-style`)return t.clone();let n=this._symbolConversionCache.get(t.id);if(n!=null)return n;let r=V(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return a==null&&r.error&&i.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){let t=this.currentRenderer;if(t==null)return;let n=t.symbols,r=`backgroundFillSymbol`in t?t.backgroundFillSymbol:null;if(!r&&!n.length)return;let i=this._getSymbolComplexityUsedOrRenderer(r);i!=null&&e(i);for(let t of n){let n=this._getSymbolComplexityUsedOrRenderer(t);n!=null&&e(n)}}_getSymbolComplexityUsedOrRenderer(e){if(e==null)return null;let t=this._symbols.get(e.id);if(t!=null)return t.complexity;let n=this._getConvertedSymbol(e);return n==null?null:ve(n)}_forEachSymbolComplexityUsed(e){this._symbols.forEach(t=>{e(t?.complexity)})}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new ze({computedExtent:()=>new ie},this),this.computedExtent=null,this.currentRenderer=null,this.rendererRequiresHydratedGraphic=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=K,this._dataUpdateQueue=new G,this._updateQueue=new G,this._focusAreasGraphicsQueue=new m,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new He,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.reportGraphicSourceMemory=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache(`graphics-3d-unused-symbols`,e=>e.destroy()),this.symbolCreationContext=new Ce(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new xe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e),usedMemoryInvalidated:e=>{let t=e.updateUsedMemory(this.reportGraphicSourceMemory);this.graphics3DGraphics.get(e.graphic.uid)===e&&(this._usedMemory+=t)}});let e=(e,t,n)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,n),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(A(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(h(()=>this.owner.view.state.highlights,()=>{let{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){let e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new be(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);let n=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=n,this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Fe(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;let r=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await U(r,this._viewSpatialReference,e,i.getLogger(this)),d(e),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,`drapeSourceType`in this.owner){let{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([g(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(f)),g(()=>W(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),g(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),g(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),g(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),g(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),g(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),g(()=>this.owner.view.timeZone,()=>{this.currentRenderer?.arcadeRequired&&this.recreateAllGraphics()}),g(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),h(()=>t.basemapTerrain?.tilingScheme,e=>{let n=t.groundView?.spatialReference;!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&n!=null&&(this.symbolCreationContext.overlaySR=n),this.hasHandles(`loaded-graphics`)?this.recreateAllGraphics():this.addHandles([ee(()=>this.owner?.loadedGraphics,`change`,e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],`loaded-graphics`)},{initial:!0}),g(()=>this.effectiveUpdatePolicy,e=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===0,e===1&&this.runTask(Be)},te)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ve.GRAPHICS_CORE,this),this.layer&&`featureReduction`in this.layer&&this.addHandles(g(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange(`averageSymbolComplexity`),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=o(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=o(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=K,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=s(this._deconflictor),this._labeler=s(this._labeler),this._elevationAlignment=c(this._elevationAlignment),this._scaleVisibility=c(this._scaleVisibility),this._filterVisibility=c(this._filterVisibility),this._objectStates=c(this._objectStates),this.clear(),`drapeSourceType`in this.owner){let{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=c(this._featureStore),this._updatingPendingLoadedGraphicsChange=s(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=c(this._graphicStateTracking),this.stage&&=(this.stageLayer=c(this.stageLayer),null),this._set(`owner`,null);for(let e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r(`graphic:layer-destroyed`,`Layer has been destroyed`));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=c(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=c(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(c),this._symbols.clear(),this._symbolMaterials&&=(this._symbolMaterials.length=0,null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange(`dataUpdating`),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Ie(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);let n=this.stageLayer.events;n.on(`transformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`shaderTransformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`visibilityChanged`,e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),n.on(`geometryAdded`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`geometryRemoved`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`attributesChanged`,e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){let e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*Ge,n=!this.suspendedOrOutsideOfView&&!t;n!==this._visible&&(this._visible=n,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){let e=this._visible&&(this.layer.opacity==null||this.layer.opacity>=q);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return e==null?void 0:this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return A(e,t)}get graphics3DGraphicsByObjectID(){let e=this.owner.layer?.objectIdField;if(!e)return;let t=new Map;return this.graphics3DGraphics.forEach(n=>{if(!n)return;let r=n.graphic,i=this._getGraphicObjectID(r,e);i!=null&&t.set(i,n)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){let t=this._deconflictor?.labelingInfoChange(e),n=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,n])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return`unknown`;let e=!1,t=!1;for(let[n,r]of this._symbols)if(r!=null)switch(r.getFastUpdateStatus()){case 3:return`unknown`;case 1:this._graphicsBySymbol.has(n)&&(t=!0);break;case 0:this._graphicsBySymbol.has(n)&&(e=!0);break;case 2:this._graphicsBySymbol.has(n)&&(t=e=!0)}return t?e?`mixed`:`fast`:e?`slow`:`mixed`}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange(`readyToRun`),this.readyToRun||this.notifyChange(`dataUpdating`),this.notifyChange(`updatingRemaining`),!e.hasProgressed)return Ue}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);let n=this._findGraphics3DGraphicByObjectId(e);n!=null&&this._updateUserVisibility(n)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(e==null)return!1;let t=e.graphic,n=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(n==null||!this._objectIdInvisibleSet.has(n));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){let t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);let n=this._whenGraphics3DGraphicRequests[e.uid];if(n)return n.promise;let r=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){let n=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,i=this.owner.view.groundView.spatialReference,a=(e,t,i)=>E(e,r,t,e,n,t,i),o=(e,t,r)=>E(e,i,t,e,n,t,r),s=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:t!=null&&!!t.useViewElevation,minDemResolution:t==null?null:t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,c=await e.getProjectedBoundingBox(a,o,s,t?.signal);if(!c)return null;let l=c.boundingBox;if(c.requiresDrapedElevation){let e=this.symbolCreationContext.elevationProvider;if(e){se(l,Y);let t=e.getElevation(Y[0],Y[1],0,n,`ground`)??0;l[2]=Math.min(l[2],t),l[5]=Math.max(l[5],t)}}return{boundingBox:l,screenSpaceObjects:c.screenSpaceObjects}}async whenGraphicBounds(e,t){await _(()=>this.owner?.loadedGraphics);let n=this.owner.layer?.objectIdField,i=this.owner.loadedGraphics.find(t=>t===e||n!=null&&t.attributes!=null&&e.attributes&&t.attributes[n]===e.attributes[n]);if(!i)throw new r(`internal:graphic-not-part-of-view`,`Graphic is not part of this view`);let a=await this._whenGraphics3DGraphic(i);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){let n=this.graphics3DGraphics.get(e.uid);if(!n)return null;let r=n.computeAttachmentOrigin();if(r.render.num===0&&r.draped.num===0)return null;S(Q,0,0,0);let i=0;if(r.render.num>0){if(!D(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,t))return null;C(Q,Q,$),i++}if(r.draped.num>0){let[e,n]=r.draped.origin,a=this.owner.view.groundView.spatialReference,o=this.owner.view.elevationProvider.getElevation(e,n,0,a,`ground`)??0;if(S($,e,n,o),!D($,a,$,t))return null;C(Q,Q,$),i++}return i>1&&w(Q,Q,1/i),new ae({x:Q[0],y:Q[1],z:Q[2],spatialReference:t})}getSymbolLayerSize(e,t){let n=this._symbols.get(e.id);if(n==null)throw new r(`internal:symbol-not-part-of-view`,`Symbol is not part of this view`);let i=e.symbolLayers.indexOf(t);if(i===-1)throw new r(`internal:missing-symbol-layer`,`Symbol layer is not in symbol`);let a=n.getSymbolLayerSize(i);if(a==null)throw new r(`internal:missing-size`,`Symbol layer has no valid size`);return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){let t=e.graphic.uid,n=this.graphics3DGraphics.get(t);if(n!=null||this._graphicsWithoutSymbol.get(t)!=null){switch(e.property){case`visible`:this._graphicUpdateVisibleHandler(n);break;case`geometry`:this._graphicUpdateGeometryHandler(n,e.graphic);break;case`symbol`:this._graphicUpdateSymbolHandler(n,e);break;case`attributes`:this.symbolCreationContext.featureExpressionInfoContext?.arcade?this._graphicUpdateGeometryHandler(n,e.graphic):this._usedMemory+=n?.updateUsedMemory(this.reportGraphicSourceMemory)??0;break;case`popupTemplate`:break;case`origin-transform`:this._graphicUpdateTransformHandler(n,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>e!=null&&e.graphics3DSymbol.updateGeometry(e)&&(this._labeler?.updateGraphicGeometry(e)??!0)?(this._labeler?.setDirty(),this._deconflictor?.setDirty(),this._usedMemory+=e.updateUsedMemory(this.reportGraphicSourceMemory),!0):!1);let n=t.geometry;n!=null&&this._expandComputedExtent(n)}_graphicUpdateTransformHandler(e,t){let n=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>t.newValue!=null&&e!=null&&n!=null&&e.graphics3DSymbol.updateTransform(e,n.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,n){if(t.geometry==null)this._recreateGraphic(t);else if(e==null){let e=t.symbol?.id;if(e){let t=this._symbols.get(e);if(t!=null&&t.loadStatus===0)return}this._recreateGraphic(t)}else if(!n()){let n=this._deconflictor?.getState(e);this._recreateGraphic(t);let r=this.graphics3DGraphics.get(t.uid);r&&n!=null&&this._deconflictor?.setState(r,n)}}_graphicUpdateSymbolHandler(e,t){let n=t.graphic,r=e==null?t.oldValue==null?null:this._symbols.get(t.oldValue.id):e.graphics3DSymbol;if(r==null||t.newValue==null){this._recreateGraphic(n);return}let i=r.symbol,a=this._getConvertedSymbol(t.newValue);if(a!=null&&(a.type!==i.type||a.type===`web-style`)||i.type===`web-style`){this._recreateGraphic(n);return}let o=this._graphicsBySymbol.get(i.id);if(o&&o.size!==1){this._recreateGraphic(n);return}let s=b(i,a);if(s==null){this._updateSymbolMapping(i.id,a);return}let c={diff:s,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(c),!re(c.diff)){this._recreateGraphic(n);return}let l=this._getRenderingInfo(n,!1);if(l==null){this._recreateGraphic(n);return}let u=r.extentPadding;for(let e of c.symbolStatePatches)e();if(u!==r.extentPadding&&this._recomputeExtentPadding(),e!=null)for(let t of c.graphics3DGraphicPatches)t(e,l);this._updateSymbolMapping(i.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===1&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){let t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),this._graphicsWaitingForSymbol.size===1&&this.notifyChange(`dataUpdating`),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`)))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{t!=null&&(e=Math.max(e,t.extentPadding))}),this._set(`extentPadding`,e)}_expandComputedExtent(e){let t=We,n=e.spatialReference;j(e,t);let r=this._viewSpatialReference,i=J.tmpVec;if(de(n,r)||O(t[0],t[1],0,n,i,r)&&(t[0]=i[0],t[1]=i[1],O(t[3],t[4],0,n,i,r),t[3]=i[0],t[4]=i[1]),!isFinite(t[0])||!isFinite(t[3])||!isFinite(t[1])||!isFinite(t[4]))return;let a=this.computedExtent,o=null,s=isFinite(t[2])&&isFinite(t[5]),c=s&&(a?.zmin==null||t[2]<a.zmin),l=s&&(a?.zmax==null||t[5]>a.zmax);a?(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||c||l)&&(o=this._propertiesPool.get(`computedExtent`),o.xmin=Math.min(t[0],a.xmin),o.ymin=Math.min(t[1],a.ymin),o.xmax=Math.max(t[3],a.xmax),o.ymax=Math.max(t[4],a.ymax),o.spatialReference=r):(o=this._propertiesPool.get(`computedExtent`),o.xmin=t[0],o.ymin=t[1],o.xmax=t[3],o.ymax=t[4],o.spatialReference=r),o&&(c&&(o.zmin=t[2]),l&&(o.zmax=t[5]),this._set(`computedExtent`,o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&=(this._elevationInfoChangeAbortController.abort(),null)}async elevationInfoChange(){this._abortElevationInfoChange();let e=new AbortController;this._elevationInfoChangeAbortController=e;let t=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await U(t,this._viewSpatialReference,e.signal,i.getLogger(this)),d(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`elevationInfo`,t)?t?.forEach(e=>{let t=e.graphic,n=e.labelLayers;for(let e of n)e.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,e)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo?.mode===`relative-to-scene`||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=c(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!==`relative-to-scene`)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&=(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),c(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;let{loadedGraphics:t,view:n}=this.owner,r=n.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;(e||!r)&&this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set(`computedExtent`,null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){let t=this._graphicsBySymbol.get(e),n=[];t&&(t.forEach((e,t)=>{this._conditionalRemove(e,t),this._spatialIndex?.remove(e),n.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,e),this._updateLayerVisibility(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));let r=this._symbols.get(e);c(r),this._symbols.delete(e),this._symbolMaterials=null,c(this._unusedSymbolsCache.pop(e)),this.add(n)}_recreateGraphicsForSymbol(e){let t=this._graphicsBySymbol.get(e);if(t){let e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&e.length!==0&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===0?this._addDelayed(e):this._addImmediate(e),this.notifyChange(`dataUpdating`)):i.getLogger(this).error(`#add()`,`Cannot add graphics before terrain surface has been initialized`))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===1&&(this.layer.geometryType===`mesh`||this.layer.geometryType==null)){for(let t of e)if(t.geometry!=null&&t.geometry.type===`mesh`&&!t.geometry.loaded)return 0}return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(let t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);n?n.add?n.state!==0&&n.abortController?.abort():this._pendingAdds++:(n=new Z,this._pendingAdds++,this._pendingUpdates.set(e,n)),n.add=t}this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}remove(e){this.effectiveUpdatePolicy===0?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange(`dataUpdating`)}_removeImmediate(e){for(let t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);if(n)n.add&&(n.remove?n.add=null:this._pendingUpdates.delete(e),n.state===1&&n.abortController?.abort(),this._pendingAdds--);else{let n=new Z;n.remove=t,this._pendingUpdates.set(e,n),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&i.getLogger(this).warn(`pendingAdds/Removes in inconsistent state!`),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();let t=this._focusAreasGraphicsQueue.pop(),n=ke(t.graphic.geometry);if(n==null)continue;let r=this.stage.view.focusAreasView?.containsGeometry(n)??!0;t.layers.forEach(e=>{(e?.type===`object3d`||e?.type===`buffer`)&&e.stageObject.geometries.some(e=>e.material instanceof Le&&e.material.parameters.focusAreaStyle==null!==r)&&this.recreateGraphics([t.graphic])})}this._focusAreasGraphicsQueue.length===0&&this.notifyChange(`readyToRun`)}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&this._spatialIndex?.updating)this._spatialIndex.update(),e.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(let[t,n]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(n.remove&&!n.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,this._pendingUpdates.delete(t),this._pendingRemoves===0))break}}for(let[t,n]of this._pendingUpdates){if(e.done)break;n.add&&n.state===0&&this._processPendingUpdateNew(n);let r=this.effectiveUpdatePolicy;if(n.remove&&(!n.add||n.state===2)&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,r=1),n.add)switch(n.state){case 2:this._addGraphic(n.add,n.renderingInfo,r),n.add=null,this._pendingAdds--,e.madeProgress();break;case 3:n.add=null,this._pendingAdds--}n.remove==null&&n.add==null&&this._pendingUpdates.delete(t)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`dataUpdating`))}}_processPendingUpdateNew(e){if(!e.add){e.state=2;return}let t=e.add.geometry;t!=null&&t.type===`mesh`&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;let n=e.abortController.signal;try{await t.load({signal:n})}catch(t){return this._processPendingUpdateNewError(e,t)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,e.state=p(t)?0:3}async _processPendingUpdateNewRenderingInfo(e){if(this.layer.renderer==null||this.layer.renderer.type!==`dictionary`){e.renderingInfo=this._getRenderingInfo(e.add),e.state=2;return}e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(t){e.abortController=null,e.state=p(t)?0:3;return}t?.symbol==null?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,n){if(this._graphicsWithoutSymbol.set(e.uid,e),t?.symbol==null||!M(e))return;let r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){let t=R(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(A(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,fe(this.layer)&&!!this.layer.popupEnabled&&!t&&Re(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}let i=t.symbol,a=this.getOrCreateGraphics3DSymbol(i,t.renderer);if(a==null)return;this._expandComputedExtent(e.geometry);let o=this._beginGraphicUpdate(e),s=new Se(e,t,this.layer),c=!1,l=e=>{e===a.symbol.id&&(c=!0)};this._whenSymbolRemoved.push(l);let u=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(e.uid)===o&&!c&&!a.destroyed&&(!this.graphicSymbolSupported||!e.symbol||e.symbol.id===a.symbol.id)){let t=this._createGraphics3DGraphic(a,s);this._spatialIndex&&t!=null&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}else--a.referenced,this._cleanupSymbols();this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()}},d=t=>{--this._loadingSymbols,!this.destroyed&&(this._whenSymbolRemoved.removeUnordered(l),c||(p(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,n===0?a.load(()=>this._dataUpdateQueue.push(u,null).catch(f),e=>this._dataUpdateQueue.push(()=>d(e),null).catch(f)):a.load(u,d)}_removeGraphic(e){let t=e.uid,n=this.graphics3DGraphics.get(t);if(n){n.graphics3DSymbol.onRemoveGraphic(n);let e=n.isElevationSource;this._conditionalRemove(n,t),this._spatialIndex?.remove(n);let r=n.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(r)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,n,e),n.destroy(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`))}_hasLabelingContext(e){if(e instanceof B||e instanceof me){let t=this.symbolCreationContext.layer;return t.labelingInfo?t.labelingInfo.some(t=>t.symbol===e):!1}return!1}_hasValidSymbolCreationContext(e){return e instanceof B&&!this._hasLabelingContext(e)?(i.getLogger(this).error(`LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported.`),!1):!0}_getRenderingInfo(e,t=!0){let n=e.geometry;if(n==null)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!oe(n.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let r=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e,a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{let e=r.symbol||ge(r.geometry);a=new L(null,e)}return a?.symbol==null?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(e.geometry==null)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let n=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(n,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;let n=this._getConvertedSymbol(e);if(!n)return null;let r;if(t!=null&&`backgroundFillSymbol`in t&&t.backgroundFillSymbol){let e=V(t.backgroundFillSymbol,{ignoreDrivers:!0});e.symbol!=null&&(r=e.symbol.symbolLayers)}let i=we(n,this.symbolCreationContext,r);return i.load(()=>{let e=i.extentPadding;e>this.extentPadding&&this._set(`extentPadding`,e),this.notifyChange(`averageSymbolComplexity`)},()=>{}),i}getOrCreateGraphics3DSymbol(e,t){let n=this._symbols.get(e.id);return n===void 0&&(n=this._unusedSymbolsCache.pop(e.id)??(e instanceof he?new Te(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t)),this._symbols.set(e.id,n),this._symbolMaterials=null),n!=null&&++n.referenced,n}trackGraphicState(e){return this._graphicStateTracking??=new De(this),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){e.updateUsedMemory(this.reportGraphicSourceMemory),this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,n=!1){this._usedMemory-=t.usedMemory,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,n&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){let{graphic:n}=t;if(this._graphicsWithoutSymbol.delete(n.uid),!this._symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;let r=e.createGraphics3DGraphic(t);if(r==null)return null;this._addGraphics3DGraphic(r);let i=e.symbol.id;if(this._graphicsBySymbol.has(i)||this._graphicsBySymbol.set(i,new Map),this._graphicsBySymbol.get(i).set(n.uid,r),r.isDraped&&this._graphicsDrapedUids.add(n.uid),r.centroid=null,n.geometry!=null&&n.geometry.type!==`point`&&(r.centroid=Oe(n.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(r),this._filterVisibility!=null){let{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(r);let a=this._whenGraphics3DGraphicRequests[n.uid];return a&&(delete this._whenGraphics3DGraphicRequests[n.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=o(this._rendererChangeAbortController),e!==this.currentRenderer){if(this._validateRenderer(e),e??this._currentRendererChange(null,!1),!F(e))this._currentRendererChange(e,!1);else if(e?.arcadeRequired){let t=new AbortController;this._rendererChangeAbortController=t;let{arcadeUtils:n}=await this._ensureArcade();d(t);let r=n.hasGeometryOperations(e),i=r||await this._rendererUsesFieldsRequiringArcadeTypeConversion(e);d(t),r&&(await n.enableGeometryOperations(),d(t)),this.effectiveUpdatePolicy===0?await this._updateQueue.push(()=>this._currentRendererChange(e,i),t.signal):this._currentRendererChange(e,i),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===0){let t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1)}}async _ensureArcade(){return this._arcadeOnDemand??=await z(),this._arcadeOnDemand}async _rendererUsesFieldsRequiringArcadeTypeConversion(e){let{fieldsIndex:t}=this.layer;return t!=null&&(await e.getRequiredFields(t)).some(e=>{switch(t.get(e)?.type){case`date`:case`date-only`:case`time-only`:case`timestamp-offset`:return!0;default:return!1}})}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererRequiresHydratedGraphic=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;let n=this.symbolCreationContext.renderer;if(e===n)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),e==null){this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();return}let r=b(n,e);this._updateUnchangedSymbolMappings(r,e,n),this.symbolCreationContext.renderer=e,r!=null&&(r.type===`complete`?this.recreateAllGraphicsAndSymbols():r.type===`partial`&&(this._applyRendererDiff(r,e,n)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange(`averageSymbolComplexity`))}_diffHasSymbolChange(e){for(let t in e.diff)switch(t){case`visualVariables`:case`defaultSymbol`:case`uniqueValueInfos`:break;case`uniqueValueGroups`:case`authoringInfo`:case`fieldDelimiter`:delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,n){e||=[],t||=[];let r=[];for(let i of t){let t=this._graphicsBySymbol.get(i.id);t&&t.forEach((a,o)=>{let s=a.graphic,c=this.layer instanceof pe?this.layer:null,l=this._arcadeOnDemand;if(i===n.defaultSymbol&&n.getSymbol(N(s,c,null),{arcade:l})===n.defaultSymbol)return;e.length||n.defaultSymbol?r.push(s):this._graphicsWithoutSymbol.set(o,s);let u=this.graphics3DGraphics.get(o);this._conditionalRemove(u,o),a.destroy(),t.delete(o),this._removeGraphics3DGraphic(o,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(i.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){let i=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(i||a){let o=a?.changed,s=a?.unchanged;if(o&&s&&o.some(e=>s.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;let c=a?a.added.map(e=>e.symbol).filter(n):[],l=a?a.removed.map(e=>e.symbol).filter(n):[];if(o)for(let e=0;e<o.length;e++)c.push(o[e].newValue.symbol),l.push(o[e].oldValue.symbol);return i?(r.defaultSymbol&&l.push(r.defaultSymbol),t.defaultSymbol&&c.push(t.defaultSymbol)):r.defaultSymbol&&c.length&&l.push(t.defaultSymbol),this._applySymbolSetDiff(c,l,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,n){if(t?.type!==`unique-value`||n?.type!==`unique-value`||e!=null&&e.type!==`partial`)return[];let r=e=>e==null?null:e.id,i=e&&e.diff,a=i?.defaultSymbol,o=i&&i.uniqueValueInfos,s;if(o)s=o.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{s=[];for(let e of n.uniqueValueInfos??[]){let n=r(e.symbol),i=t.uniqueValueInfos?.find(t=>t.value===e.value);i&&n!==r(i.symbol)&&s.push({oldId:n,newId:r(i.symbol)})}}return!a&&n.defaultSymbol&&s.push({oldId:r(n.defaultSymbol),newId:r(t.defaultSymbol)}),s}_updateSymbolMapping(e,t){let n=t!=null&&t?typeof t==`string`?t:t.id:null;if(e==null||e===n)return;let r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),r!==void 0&&this._graphicsBySymbol.set(n,r);let i=this._symbols.get(e);if(i!==void 0&&(this._symbols.delete(e),this._symbols.set(n,i),this._symbolMaterials=null,i!=null)){let e=typeof t==`string`?null:t;e==null?i.symbol.id=n:i.symbol=e}}_updateUnchangedSymbolMappings(e,t,n){let r=this._calculateUnchangedSymbolMapping(e,t,n);for(let{oldId:e,newId:t}of r)this._updateSymbolMapping(e,t)}_applyRendererDiff(e,t,n){if(this._diffHasSymbolChange(e))return!1;if(t instanceof P&&n instanceof P&&this._applyUniqueValueRendererDiff(e,t,n)&&Object.keys(e.diff).length===0)return!0;for(let n of this._graphicsBySymbol.keys()){let r=this._symbols.get(n);if(r!=null)switch(r.applyRendererDiff(e,t)){case 0:this._recreateSymbol(n);break;case 1:this._recreateGraphicsForSymbol(n)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`opacity`,t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`screenSizePerspectiveEnabled`,t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`slicePlaneEnabled`,t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`physicalBasedRenderingEnabled`,t)||this._recreateSymbol(n)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`skipHighSymbolLods`,t)||this._recreateSymbol(n)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`pixelRatio`,t)||this._recreateSymbol(n)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){let n=this.symbolCreationContext.clippingExtent,r=ue();return Ne(e,r,t)?this.symbolCreationContext.clippingExtent=ce(k(),r):this.symbolCreationContext.clippingExtent=null,!le(this.symbolCreationContext.clippingExtent,n)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(n=>{e(n)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(let[t,n]of this._symbols){if(n==null)return;e(n,this._graphicsBySymbol.get(t)||Ke,t)}if(!t?.excludeUnused)for(let t of this._unusedSymbolsCache)e(t,void 0,t.symbol.id)}updateGraphicsVisibilities(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{let t=this._updateUserVisibility(e),n=!!this._scaleVisibility?.updateVisibility(e);return t||n})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){let t=()=>`'${this.layer.title?`${this.layer.title}, `:``}id:${this.layer.id}'`,n=I(e,{geometryType:this.layer?.geometryType,logWarning:(e,n)=>i.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${n}`)});if(n){let e=`Renderer for layer ${t} is not supported in a SceneView`;i.getLogger(this).warn(e,n.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,n)=>{if(t==null||t.referenced>0)return;let r=this._graphicsBySymbol.get(n);r&&r.size!==0||(this._graphicsBySymbol.delete(n),this._symbols.delete(n),this._symbolMaterials=null,this._unusedSymbolsCache.put(n,t,l),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange(`averageSymbolComplexity`))}get test(){}get performanceInfo(){return new Ee(this.graphics3DGraphics.size,this.graphics3DGraphics.values().reduce((e,t)=>e+ +!!t.isVisible(),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([y({readOnly:!0})],X.prototype,`computedExtent`,void 0),e([y()],X.prototype,`currentRenderer`,void 0),e([y()],X.prototype,`rendererRequiresHydratedGraphic`,void 0),e([y()],X.prototype,`_frameTaskHandle`,void 0),e([y()],X.prototype,`_dataUpdateQueue`,void 0),e([y()],X.prototype,`_updateQueue`,void 0),e([y({readOnly:!0})],X.prototype,`_viewSpatialReference`,null),e([y()],X.prototype,`_rendererChangeAbortController`,void 0),e([y()],X.prototype,`_elevationInfoChangeAbortController`,void 0),e([y()],X.prototype,`_initializeAbortController`,void 0),e([y()],X.prototype,`_elevationAlignment`,void 0),e([y()],X.prototype,`_scaleVisibility`,void 0),e([y()],X.prototype,`_filterVisibility`,void 0),e([y()],X.prototype,`_initializePromise`,void 0),e([y()],X.prototype,`_spatialIndex`,void 0),e([y({readOnly:!0})],X.prototype,`extentPadding`,void 0),e([y()],X.prototype,`_updatingPendingLoadedGraphicsChange`,void 0),e([y()],X.prototype,`_featureStore`,void 0),e([y()],X.prototype,`_objectStates`,void 0),e([y()],X.prototype,`_loadingSymbols`,void 0),e([y({constructOnly:!0})],X.prototype,`compressionTracker`,void 0),e([y()],X.prototype,`preferredUpdatePolicy`,void 0),e([y()],X.prototype,`_forcedUpdatePolicy`,void 0),e([y({readOnly:!0})],X.prototype,`effectiveUpdatePolicy`,null),e([y({constructOnly:!0})],X.prototype,`elevationFeatureExpressionEnabled`,void 0),e([y({constructOnly:!0})],X.prototype,`owner`,void 0),e([y({constructOnly:!0})],X.prototype,`layer`,void 0),e([y({constructOnly:!0})],X.prototype,`graphicSymbolSupported`,void 0),e([y({constructOnly:!0})],X.prototype,`getRenderingInfoWithoutRenderer`,void 0),e([y({constructOnly:!0})],X.prototype,`componentFactories`,void 0),e([y({constructOnly:!0})],X.prototype,`setUidToIdOnAdd`,void 0),e([y({constructOnly:!0})],X.prototype,`reportGraphicSourceMemory`,void 0),e([y()],X.prototype,`featureStore`,null),e([y()],X.prototype,`initializePromise`,null),e([y()],X.prototype,`scaleVisibility`,null),e([y()],X.prototype,`elevationAlignment`,null),e([y()],X.prototype,`objectStates`,null),e([y()],X.prototype,`filterVisibility`,null),e([y({readOnly:!0})],X.prototype,`updating`,null),e([y({readOnly:!0})],X.prototype,`dataUpdating`,null),e([y({readOnly:!0})],X.prototype,`readyToRun`,null),e([y({readOnly:!0})],X.prototype,`suspendedOrOutsideOfView`,null),e([y({readOnly:!0})],X.prototype,`updatingRemaining`,null),e([y({readOnly:!0})],X.prototype,`displayFeatureLimit`,null),e([y({readOnly:!0})],X.prototype,`averageSymbolComplexity`,null),e([y({constructOnly:!0})],X.prototype,`hasZ`,void 0),e([y({constructOnly:!0})],X.prototype,`hasM`,void 0),e([y()],X.prototype,`_objectIdField`,null),X=J=e([ne(`esri.views.3d.layers.graphics.Graphics3DCore`)],X);class Z{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const Ge=10,Q=T(),$=T(),Ke=new Map;export{X as Graphics3DCore};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{EventEmitter as n}from"../../../../core/Evented.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{EventEmitter as n}from"../../../../core/Evented.js";import"../../../../core/has.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{fromValues as o,fromExtent as s,create as c}from"../../../../geometry/support/aaBoundingRect.js";import{ExtentSet as l}from"./ExtentSet.js";import{projectElevationUpdateExtent as u}from"../../support/elevationUpdateExtentUtils.js";import{TaskPriority as d}from"../../../support/Scheduler.js";import{intersectsGeographicExtent as f}from"../../support/sphereExtentUtils.js";let p=class extends t{constructor(e){super(e),this._dirtyExtents=new l,this._globalDirty=!1,this._averageExtentUpdateSize=0,this._dirtyGraphicsSet=new Set,this._updateElevation=!1,this.graphicsCoreOwner=null,this.graphicsCore=null,this.events=new n}initialize(){let e=this.elevationProvider,t=this.graphicsCoreOwner.view.resourceController.scheduler;this._task=t.registerTask(g(this.graphicsCore.layer.elevationInfo?.mode),this),this.addHandles([e.on(`elevation-change`,e=>this._elevationChanged(e)),r(()=>this.graphicsCoreOwner.suspended,()=>this._suspendedChange()),this._task,r(()=>g(this.graphicsCore.layer.elevationInfo?.mode),e=>this._task.priority=e)])}destroy(){this._dirtyGraphicsSet.clear(),this.graphicsCoreOwner=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null,this.elevationProvider=null,this._dirtyExtents.destroy()}clear(){this._dirtyGraphicsSet.clear(),this.notifyChange(`updating`)}_suspendedChange(){this.graphicsCoreOwner.suspended===!0?this._updateElevation=!1:this.graphicsCoreOwner.suspended===!1&&this._updateElevation&&(this._globalDirty=!0,this.notifyChange(`updating`))}elevationInfoChange(){this._globalDirty=!0,this.notifyChange(`updating`)}get updating(){return this.readyToRun}get readyToRun(){return this._dirtyGraphicsSet.size>0||!this._dirtyExtents.empty||this._globalDirty}get updatingRemaining(){return this._dirtyGraphicsSet.size+this._dirtyExtents.size*this._averageExtentUpdateSize}runTask(e){for(this._globalDirty&&(this._markAllGraphicsElevationDirty(),this._globalDirty=!1,e.madeProgress()),e.run(()=>this._dirtyExtents.merge(e));this.readyToRun&&!e.done;)this._updateDirtyGraphics(e),this._updateDirtyExtents(e);this.notifyChange(`updating`)}_updateDirtyGraphics(e){let t=this.graphicsCoreOwner.view.renderCoordsHelper,n=this.graphicsCore.effectiveUpdatePolicy===0;for(let r of this._dirtyGraphicsSet.keys()){let i=this.graphicsCore.getGraphics3DGraphicById(r);if(this._dirtyGraphicsSet.delete(r),i!=null&&(i.alignWithElevation(this.elevationProvider,t,n),this.graphicsCore.deconflictor?.setDirty(),e.madeProgress()),e.done)return}}_updateDirtyExtents(e){for(;!this._dirtyExtents.empty&&!e.done;){let t=this._dirtyExtents.pop(),{spatialReference:n}=this.graphicsCoreOwner.view;this.events.emit(`invalidate-elevation`,{extent:t,spatialReference:n});let r=this._dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(t,n,e=>{let t=this.graphicsCore.getGraphics3DGraphicById(e);t!=null&&t.needsElevationUpdates()&&this._dirtyGraphicsSet.add(e)}),this._averageExtentUpdateSize=.1*(this._dirtyGraphicsSet.size-r)+.9*this._averageExtentUpdateSize,e.madeProgress()}}_markAllGraphicsElevationDirty(){this._dirtyExtents.clear(),this._dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach((e,t)=>this._dirtyGraphicsSet.add(t))}_elevationChanged(e){if(e.context===`scene`&&(!this.graphicsCore.layer.elevationInfo||this.graphicsCore.layer.elevationInfo.mode!==`relative-to-scene`))return;let t=e.extent,{spatialReference:n}=this.graphicsCoreOwner.view;if(t[0]!==-1/0&&!e.spatialReference.equals(n)&&(u(t,e.spatialReference,m,n)||o(-1/0,-1/0,1/0,1/0,m),t=m),this.graphicsCoreOwner.suspended){if(!this._updateElevation){let e=this.graphicsCore.computedExtent;(t[0]===-1/0||e&&f(t,s(e,h),n))&&(this._updateElevation=!0)}this.events.emit(`invalidate-elevation`,{extent:t,spatialReference:n})}else t[0]===-1/0?(this.events.emit(`invalidate-elevation`,{extent:t,spatialReference:n}),this._globalDirty=!0):this._dirtyExtents.add(t),this.notifyChange(`updating`)}};e([i()],p.prototype,`graphicsCoreOwner`,void 0),e([i()],p.prototype,`graphicsCore`,void 0),e([i()],p.prototype,`queryGraphicUIDsInExtent`,void 0),e([i()],p.prototype,`elevationProvider`,void 0),e([i({readOnly:!0})],p.prototype,`updating`,null),e([i({readOnly:!0})],p.prototype,`updatingRemaining`,null),p=e([a(`esri.views.3d.layers.graphics.Graphics3DElevationAlignment`)],p);const m=c(),h=c();function g(e){return e==null?d.ELEVATION_ALIGNMENT:e===`relative-to-scene`?d.ELEVATION_ALIGNMENT_SCENE:d.ELEVATION_ALIGNMENT}export{p as Graphics3DElevationAlignment};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{emptyArray as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import n from"../../../../core/ObjectPool.js";import{scale as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scale as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Polygon.js";import{projectBoundingRect as c}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as l,expandWithAABB as u,allFinite as d,toRect as f,create as p,set as m,zero as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as g,allFinite as _}from"../../../../geometry/support/aaBoundingRect.js";import{equals as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{computeAABR as y,estimateSize as b}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromGeometry as x}from"../../../../layers/graphics/featureConversionUtils.js";const S=new n(()=>p(),e=>m(e,h),null,10,5),C=g();class w{get labelLayers(){return this._labelLayers||e}get usedMemory(){return this._usedMemory}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e?.isElevationSource)}constructor(e,t,n){this.graphic=e,this.graphics3DSymbol=t,this.layers=n,this._visibleFlags=255,this._usedMemory=0,++t.referenced,n.every(e=>e&&`hiddenIfDeconflicted`in e&&e.hiddenIfDeconflicted)&&(this._visibleFlags|=256)}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(t=>{t.initialize(e),T(this._visibleFlags,1,t)})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return this.layers==null}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,t){this._labelLayers||=[],this._labelLayers.push(e),e.initialize(t),T(this._visibleFlags,16,e)}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),T(this._visibleFlags,1,e))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(t=>{(t.type===`draped`||t.type===`draped-buffer`)&&(e=!0)}),e}isVisible(e=1,t=0){let n=this._visibleFlags;return E(n,e,t|t*16|(n&256?0:8))}setVisibilityFlag(e,t,n){let r=e*t;return n!==((this._visibleFlags&r)===r)&&(n?this._visibleFlags|=r:this._visibleFlags&=~r,e===1&&this._forEachSymbolLayerGraphic(e=>T(this._visibleFlags,1,e)),this._forEachLabelGraphic(e=>T(this._visibleFlags,16,e)),!0)}getVisibilityFlag(e,t){return(this._visibleFlags&e*t)!==0}computeExtent(e){if(!this._extent){let t=this.graphic.geometry;if(t==null)return!1;this._extent=g(),y(t,this._extent);let n=t.spatialReference;if(!v(n,e)&&!c(this._extent,n,this._extent,e))return this._extent=null,!1}return!0}get hasCachedOptimizedGeometry(){return this._optimizedGeometry!=null}getAsOptimizedGeometry(e,t){return this._optimizedGeometry||=this._convertGraphicToOptimizedGeometry(this.graphic,e,t),this._optimizedGeometry}updateUsedMemory(e){let t=(e?b(this.graphic):0)+(this._optimizedGeometry?.usedMemory??0);this._forEachSymbolLayerGraphic(e=>t+=e.usedMemory);let n=t-this._usedMemory;return this._usedMemory=t,n}_convertGraphicToOptimizedGeometry(e,t,n){let r=e.geometry;return(r.type===`mesh`||r.type===`extent`)&&(r=s.fromExtent(r.type===`mesh`?r.extent:r)),x(r,t,n)}computeAttachmentOrigin(){let e={render:{origin:o(),num:0},draped:{origin:i(),num:0}};for(let t of this.layers)t?.computeAttachmentOrigin(e);return e.render.num>1&&a(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&r(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,n,r,i,a){return a||={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]},a.boundingBox?l(a.boundingBox):a.boundingBox=l(),a.requiresDrapedElevation=!1,await t(this.layers,async t=>{if(t==null)return;let o=t.type===`draped`||t.type===`draped-buffer`?n:e,s=S.acquire(),c=await t.getProjectedBoundingBox(o,r,a.screenSpaceObjects,i,s);
|
|
2
|
+
import{emptyArray as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import n from"../../../../core/ObjectPool.js";import{scale as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scale as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Polygon.js";import{projectBoundingRect as c}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as l,expandWithAABB as u,allFinite as d,toRect as f,create as p,set as m,zero as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as g,allFinite as _}from"../../../../geometry/support/aaBoundingRect.js";import{equals as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{computeAABR as y,estimateSize as b}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromGeometry as x}from"../../../../layers/graphics/featureConversionUtils.js";const S=new n(()=>p(),e=>m(e,h),null,10,5),C=g();class w{get labelLayers(){return this._labelLayers||e}get usedMemory(){return this._usedMemory}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e?.isElevationSource)}constructor(e,t,n){this.graphic=e,this.graphics3DSymbol=t,this.layers=n,this._visibleFlags=255,this._usedMemory=0,++t.referenced,n.every(e=>e&&`hiddenIfDeconflicted`in e&&e.hiddenIfDeconflicted)&&(this._visibleFlags|=256)}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(t=>{t.initialize(e),T(this._visibleFlags,1,t)})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return this.layers==null}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,t){this._labelLayers||=[],this._labelLayers.push(e),e.initialize(t),T(this._visibleFlags,16,e)}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),T(this._visibleFlags,1,e))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(t=>{(t.type===`draped`||t.type===`draped-buffer`)&&(e=!0)}),e}isVisible(e=1,t=0){let n=this._visibleFlags;return E(n,e,t|t*16|(n&256?0:8))}setVisibilityFlag(e,t,n){let r=e*t;return n!==((this._visibleFlags&r)===r)&&(n?this._visibleFlags|=r:this._visibleFlags&=~r,e===1&&this._forEachSymbolLayerGraphic(e=>T(this._visibleFlags,1,e)),this._forEachLabelGraphic(e=>T(this._visibleFlags,16,e)),!0)}getVisibilityFlag(e,t){return(this._visibleFlags&e*t)!==0}computeExtent(e){if(!this._extent){let t=this.graphic.geometry;if(t==null)return!1;this._extent=g(),y(t,this._extent);let n=t.spatialReference;if(!v(n,e)&&!c(this._extent,n,this._extent,e))return this._extent=null,!1}return!0}get hasCachedOptimizedGeometry(){return this._optimizedGeometry!=null}getAsOptimizedGeometry(e,t){return this._optimizedGeometry||=this._convertGraphicToOptimizedGeometry(this.graphic,e,t),this._optimizedGeometry}updateUsedMemory(e){let t=(e?b(this.graphic):0)+(this._optimizedGeometry?.usedMemory??0);this._forEachSymbolLayerGraphic(e=>t+=e.usedMemory);let n=t-this._usedMemory;return this._usedMemory=t,n}_convertGraphicToOptimizedGeometry(e,t,n){let r=e.geometry;return(r.type===`mesh`||r.type===`extent`)&&(r=s.fromExtent(r.type===`mesh`?r.extent:r)),x(r,t,n)}computeAttachmentOrigin(){let e={render:{origin:o(),num:0},draped:{origin:i(),num:0}};for(let t of this.layers)t?.computeAttachmentOrigin(e);return e.render.num>1&&a(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&r(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,n,r,i,a){return a||={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]},a.boundingBox?l(a.boundingBox):a.boundingBox=l(),a.requiresDrapedElevation=!1,await t(this.layers,async t=>{if(t==null)return;let o=t.type===`draped`||t.type===`draped-buffer`?n:e,s=S.acquire(),c=await t.getProjectedBoundingBox(o,r,a.screenSpaceObjects,i,s);isFinite(c[2])&&isFinite(c[5])||(a.requiresDrapedElevation=!0),c&&u(a.boundingBox,s),S.release(s)}),d(a.boundingBox)||_(f(a.boundingBox,C))?a:null}needsElevationUpdates(){for(let e of this.layers)if(e!=null&&(e.type===`object3d`||e.type===`buffer`||e.type===`lod-instance`)&&e.needsElevationUpdates)return!0;return this._labelLayers?.some(e=>e?.needsElevationUpdates??!1)??!1}alignWithElevation(e,t,n){this._forEachRenderedGraphic(r=>{(r.type===`object3d`||r.type===`buffer`||r.type===`lod-instance`)&&r.alignWithElevation(e,t,n)})}alignWithAbsoluteElevation(e,t,n){this._forEachRenderedGraphic(r=>{(r.type===`object3d`||r.type===`buffer`)&&r.alignWithAbsoluteElevation(e,t,n)})}addObjectStateSet(e){this._forEachSymbolLayerGraphic(t=>t.addObjectState(e))}removeObjectState(e){this._forEachSymbolLayerGraphic(t=>t.removeObjectState(e))}updateHighlights(e){this._forEachSymbolLayerGraphic(t=>t.updateHighlights(e))}_forEachGraphicList(e,t){e?.forEach(e=>e&&t(e))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this.labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){}}function T(e,t,n){let r=t===1?`hiddenIfDeconflicted`in n&&n.hiddenIfDeconflicted?0:8:e&256?0:8;n.setVisibility(E(e,t,r))}function E(e,t,n=0){let r=(t===1?15:255)&~n;return(e&r)===r}export{w as Graphics3DGraphic};
|