@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
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import n from"../../../../core/Logger.js";import{getMetersPerVerticalUnitForSR as r}from"../../../../core/units.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{create as
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import n from"../../../../core/Logger.js";import{getMetersPerVerticalUnitForSR as r}from"../../../../core/units.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s,ZEROS as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEmpty as l,copy as u,center as d,diameter as f,squaredDistanceToPoint as p}from"../../../../geometry/support/aaBoundingBox.js";import{allFinite as m}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as h}from"../../../../geometry/support/spatialReferenceUtils.js";import{getMetersPerUnit as g}from"../../../../symbols/support/unitConversionUtils.js";import{ElevationUpdateEvent as _}from"../../support/ElevationUpdateEvent.js";import{ProjectedElevationUpdateExtent as v,calculateElevationUpdateExtents as y,fullWorldElevationUpdateExtent as b,planetCenterProximityToleranceMeters as x}from"../../support/elevationUpdateExtentUtils.js";import{affectsGeometry as S}from"../../webgl-engine/lib/affectsGeometry.js";import{Intersector as C}from"../../webgl-engine/lib/Intersector.js";const w=Symbol(`layerHandles`);let T=class extends t{get spatialReference(){return this.view.spatialReference}constructor(e){super(e),this._elevationOffset=0}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper,this._projectedExtent=new v(this._renderCoordsHelper),this._intersectLayers=[this.stageLayer],this._intersector=new C(this.view.state.viewingMode),this._intersector.options.store=0;let[e,t]=this._computeLayerElevationRange(this.spatialReference,this.stageLayer);this._zmin=e,this._zmax=t;let n=this.stageLayer.events;this.addHandles([n.on([`layerObjectAdded`,`layerObjectRemoved`,`transformationChanged`,`shaderTransformationChanged`],e=>this._objectChanged(e)),n.on([`geometryAdded`,`geometryRemoved`],({object:e})=>this._objectChanged(e)),n.on(`attributesChanged`,({attribute:e,object:t})=>S(e)&&this._objectChanged(t))],w)}destroy(){this.removeHandles(w)}elevationInfoChanged(){let e=this.layer==null?null:this.layer.elevationInfo;if(e!=null&&e.mode!==`on-the-ground`){let t=r(this.layer.spatialReference),n=g(e.unit??`meters`);this._elevationOffset=(e.offset??0)*n/t}else this._elevationOffset=0}getElevation(e,t,r,i){if(j[0]=e,j[1]=t,j[2]=r,!this._renderCoordsHelper.toRenderCoords(j,i,j))return n.getLogger(this).error(`could not project point for elevation alignment`),null;let a=this._elevationOffset,o=this._zmin+a,s=this._zmax+a;return this._renderCoordsHelper.setAltitude(N,s,j),this._renderCoordsHelper.setAltitude(P,o,j),this._intersector.reset(N,P,null),this._intersector.intersect(this._intersectLayers,null,1,null,e=>!!e.lastValidElevationBB),this._intersector.results.min.getIntersectionPoint(j)?this._renderCoordsHelper.getAltitude(j):null}_objectChanged(e){let t=this.spatialReference;if(!e.lastValidElevationBB||!t)return;let n=e.lastValidElevationBB,{box:r,sphere:i}=e.boundingVolumeWorldSpace;if(this.view.state.viewingMode===1&&(!l(n)&&E(n)||E(r))){this._emitFullExtentElevationChange(t),u(n,r);return}let a=!l(n),o=new Float64Array(a?8:4),s=1/0,c=-1/0,d=!1;if(a&&(this._resetProjectedExtent(n,t),this._expandExtent(t,n,k,this._projectedExtent)||(d=!0),m(this._projectedExtent.extent)?(s=Math.min(s,k[0]),c=Math.max(c,k[1]),o.set(this._projectedExtent.extent)):d=!0),this._projectedExtent.reset(i.center,i.radius,t),this._expandExtent(t,r,D,this._projectedExtent)||(d=!0),m(this._projectedExtent.extent)?(s=Math.min(s,D[0]),c=Math.max(c,D[1]),o.set(this._projectedExtent.extent,a?4:0)):d=!0,d){this._emitFullExtentElevationChange(t),u(n,r);return}let f=y(o,t);f.length>0&&(this._zmin=Math.min(this._zmin,s),this._zmax=Math.max(this._zmax,c));for(let e of f)this._emitElevationChangeEvent(e,t);u(n,r)}_computeLayerElevationRange(e,t){let n=1/0,r=-1/0;return e!=null&&t.objects.forEach(t=>{this._expandExtent(e,t.boundingVolumeWorldSpace.box,O)&&(n=Math.min(n,O[0]),r=Math.max(r,O[1]))}),[n,r]}_expandExtent(e,t,n,r=null){n[0]=1/0,n[1]=-1/0;for(let i=0;i<8;++i){j[0]=t[i&1?0:3],j[1]=t[i&2?1:4],j[2]=t[i&4?2:5];let a=r==null?this._renderCoordsHelper.fromRenderCoords(j,j,e):r.addRenderPoint(j,e);if(a!=null)n[0]=Math.min(n[0],a[2]),n[1]=Math.max(n[1],a[2]);else if(r!=null)return!1;if(r!=null){for(let n=0;n<3;++n)if(!(i&1<<n)&&(o(M,j),M[n]=t[n],!r.addRenderEdge(j,M,e)))return!1}}return!0}_emitFullExtentElevationChange(e){let t=h(e);t!=null&&this._emitElevationChangeEvent(b(e,t),e)}_emitElevationChangeEvent(e,t){let n=new _(t,e);this.emit(`elevation-change`,n)}_resetProjectedExtent(e,t){d(e,A),this._projectedExtent.reset(A,.5*f(e),t)}};e([i({constructOnly:!0})],T.prototype,`layer`,void 0),e([i({constructOnly:!0})],T.prototype,`stageLayer`,void 0),e([i({constructOnly:!0})],T.prototype,`view`,void 0),e([i()],T.prototype,`spatialReference`,null),T=e([a(`esri.views.3d.layers.support.StageLayerElevationProvider`)],T);function E(e){return p(e,c)<=x*x}const D=new Float64Array(2),O=new Float64Array(2),k=new Float64Array(2),A=s(),j=s(),M=s(),N=s(),P=s();export{T as StageLayerElevationProvider};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{lerp as e}from"../../../../core/mathUtils.js";import t from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as n,createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as a}from"../../../../core/units.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as c,normalize as l,dot as u,distance as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{g as S}from"../../../../chunks/cameraUtilsSpherical.js";import{computeMapPointFromVec3d as C}from"../../support/hitTest.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{defaultTolerance as E,Intersector as D,defaultScreenPolygonPrimitiveProcessor as O}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as k,DrapedScreenPolygonIntersectionQuery as A}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as M,createSliceExtrusionHalfspacePlanes as N,clipPolygonAgainstSlicedAwayHalfspaces as P,sliceFilterPredicate as F}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as I}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as L}from"../../../support/Scheduler.js";class R{constructor(e,n,r){this.viewingMode=e,this._forEachLayer=n,this._view=r,this._externalIntersectionHandlers=new t,this._tolerance=E,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new D(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(L.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.viewingMode),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await I(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.point=null,t.screenPolygonPrimitiveProcessor=O,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new M(o):null;t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=O,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;!this._view.groundView.opaque&&(!j(r)||r.intersector===7)&&(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=E){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==2||e==null||c(t,e.origin,l(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,r=0,i=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=a(o.spatialReference),d=t==null?`absolute-height`:t.mode,f=x(t)/c,p=(d===`on-the-ground`?0:f+r)*c/s.unitInMeters,{camera:m}=o.state;if(d===`absolute-height`){let t=s?.getAltitude(m.eye),n=u(l(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<p&&n<0||t>=p&&n>0)return null;if(s.intersectInfiniteManifold(e,p,K)){let e=C(o,K);return e.z??=0,e.z-=f,e}return null}let h=m.projectToRenderScreen(e.origin,n(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?F(_):null,y=new D(this.viewingMode);y.options.store=0,y.options.verticalOffset=p,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.reset(S.beginPoint,S.endPoint,m),y.point=h;let w=null;if(i&&`type`in i&&i.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===i)?.uid;w=e?t=>t.layerViewUid===e:null}else i&&(w=e=>e.graphicUid!==i.uid);switch(d){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!w||w(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=C(o,K);return e.z=r,e}return null}computeIntersection(e,t,r,i){if(e==null)return;let a=this._view.state.camera,o=a.projectToRenderScreen(e.origin,n(b.get())),s=new U(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!(`include`in i||`exclude`in i);let c=this._createRayIntersectionQuery(e,o,r);t.reset(c.beginPoint,c.endPoint,a),t.intersect(s.layers,c.screenPoint,this._tolerance,null,s.objectFilter);let l=this._view.slice.plane,u=l?F(l):null;t.intersect(s.sliceableLayers,c.screenPoint,this._tolerance,u,s.objectFilter);let d=i&&(i.requiresGroundFeedback||i.enableDraped);this._intersectRayHandlers(t,s,c,u,!!d,e=>s.allowedIntersectorTypes==null||s.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(i&&i.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>s.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,n){return new k(e.origin,c(f(),e.origin,e.direction),t,n)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??O,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(t,n){let{state:{camera:{eye:r}},pointsOfInterest:i}=this._view,a=this._view.groundView.spatialReference,c=[],l=n?[]:null,u=S(this._view,i.focus.renderLocation),f=v(a),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let t=h!=null&&f?h+f.shortestSignedDiff(h,g[0]):g[0];return h=t,c.push(s(t,g[1])),l&&l.push(p(_)),m=Math.min(m,d(r,_)),!0},{points:b}=t,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<u;t++){let i=t/u;if(!y(t===0?n:o(Y,e(n[0],r[0],i),e(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(n==null||!l)return[G(c,m)];let C=this._clipDrapedScreenPolygonIntersectionQueries(l,n,f,r);return C.length>0?C:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=N(t);for(let t of P(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,t,n){let{renderCoordsHelper:r}=this._view,i=this._view.groundView.spatialReference,a=[],o=1/0,c=null;for(let l of e){if(!r.fromRenderCoords(l,X,i))return null;let e=c!=null&&t?c+t.shortestSignedDiff(c,X[0]):X[0];c=e,a.push(s(e,X[1])),o=Math.min(o,d(n,l))}return a.length>=3&&Number.isFinite(o)?G(a,o):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new D(this.viewingMode);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=r()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return(!V||V.viewingMode!==e)&&(V=new D(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new A(e,_(m(g),e),t)}const K=f(),q=f(),J=r(),Y=i(),X=f(),Z=r();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
|
|
2
|
+
import{lerp as e}from"../../../../core/mathUtils.js";import t from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as n,createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as a}from"../../../../core/units.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as c,normalize as l,dot as u,distance as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{g as S}from"../../../../chunks/cameraUtilsSpherical.js";import{computeMapPointFromVec3d as C}from"../../support/hitTest.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{defaultTolerance as E,Intersector as D,defaultScreenPolygonPrimitiveProcessor as O}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as k,DrapedScreenPolygonIntersectionQuery as A}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as M,createSliceExtrusionHalfspacePlanes as N,clipPolygonAgainstSlicedAwayHalfspaces as P,sliceFilterPredicate as F}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as I}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as L}from"../../../support/Scheduler.js";class R{constructor(e,n,r){this.viewingMode=e,this._forEachLayer=n,this._view=r,this._externalIntersectionHandlers=new t,this._tolerance=E,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new D(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(L.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.viewingMode),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await I(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.point=null,t.screenPolygonPrimitiveProcessor=O,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new M(o):null;t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=O,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||j(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=E){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==2||e==null||c(t,e.origin,l(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,r=0,i=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=a(o.spatialReference),d=t==null?`absolute-height`:t.mode,f=x(t)/c,p=(d===`on-the-ground`?0:f+r)*c/s.unitInMeters,{camera:m}=o.state;if(d===`absolute-height`){let t=s?.getAltitude(m.eye),n=u(l(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<p&&n<0||t>=p&&n>0)return null;if(s.intersectInfiniteManifold(e,p,K)){let e=C(o,K);return e.z??=0,e.z-=f,e}return null}let h=m.projectToRenderScreen(e.origin,n(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?F(_):null,y=new D(this.viewingMode);y.options.store=0,y.options.verticalOffset=p,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.reset(S.beginPoint,S.endPoint,m),y.point=h;let w=null;if(i&&`type`in i&&i.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===i)?.uid;w=e?t=>t.layerViewUid===e:null}else i&&(w=e=>e.graphicUid!==i.uid);switch(d){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!w||w(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=C(o,K);return e.z=r,e}return null}computeIntersection(e,t,r,i){if(e==null)return;let a=this._view.state.camera,o=a.projectToRenderScreen(e.origin,n(b.get())),s=new U(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!(`include`in i||`exclude`in i);let c=this._createRayIntersectionQuery(e,o,r);t.reset(c.beginPoint,c.endPoint,a),t.intersect(s.layers,c.screenPoint,this._tolerance,null,s.objectFilter);let l=this._view.slice.plane,u=l?F(l):null;t.intersect(s.sliceableLayers,c.screenPoint,this._tolerance,u,s.objectFilter);let d=i&&(i.requiresGroundFeedback||i.enableDraped);this._intersectRayHandlers(t,s,c,u,!!d,e=>s.allowedIntersectorTypes==null||s.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(i&&i.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>s.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,n){return new k(e.origin,c(f(),e.origin,e.direction),t,n)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??O,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(t,n){let{state:{camera:{eye:r}},pointsOfInterest:i}=this._view,a=this._view.groundView.spatialReference,c=[],l=n?[]:null,u=S(this._view,i.focus.renderLocation),f=v(a),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let t=h!=null&&f?h+f.shortestSignedDiff(h,g[0]):g[0];return h=t,c.push(s(t,g[1])),l&&l.push(p(_)),m=Math.min(m,d(r,_)),!0},{points:b}=t,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<u;t++){let i=t/u;if(!y(t===0?n:o(Y,e(n[0],r[0],i),e(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(n==null||!l)return[G(c,m)];let C=this._clipDrapedScreenPolygonIntersectionQueries(l,n,f,r);return C.length>0?C:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=N(t);for(let t of P(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,t,n){let{renderCoordsHelper:r}=this._view,i=this._view.groundView.spatialReference,a=[],o=1/0,c=null;for(let l of e){if(!r.fromRenderCoords(l,X,i))return null;let e=c!=null&&t?c+t.shortestSignedDiff(c,X[0]):X[0];c=e,a.push(s(e,X[1])),o=Math.min(o,d(n,l))}return a.length>=3&&Number.isFinite(o)?G(a,o):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new D(this.viewingMode);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=r()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return V&&V.viewingMode===e||(V=new D(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new A(e,_(m(g),e),t)}const K=f(),q=f(),J=r(),Y=i(),X=f(),Z=r();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
|
|
@@ -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"../../../core/has.js";import n from"../../../core/Logger.js";import{MemCacheStorage as r,MemCache as i}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{Milliseconds as o}from"../../../core/time.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import{isMemoryManagedView as u}from"./MemoryManagedView.js";import{makeBudget as d}from"../../support/Scheduler.js";function f(e){return new
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{MemCacheStorage as r,MemCache as i}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{Milliseconds as o}from"../../../core/time.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import{isMemoryManagedView as u}from"./MemoryManagedView.js";import{makeBudget as d}from"../../support/Scheduler.js";function f(e){return new _({view:e})}const p=.1,m=1.3,h=-4096,g=!!has(`esri-tests-disable-memory-pools`);let _=class extends t{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._predictedMemory=0,this._cacheStorage=new r,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=g?4096:750,this._additionalCacheMemory=g?h:0,this.addHandles(a({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){e==null||e<=0||g||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<e&&this._updateQuality(1),this._maxMemory=e)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(e){e!=null&&!g&&(this._additionalCacheMemory=e)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(e,t,n){return new i(e,this._cacheStorage,t,n)}resetStableQuality(){this._stableQuality=0}disableMemCache(){this.additionalCacheMemory=h}update(){if(this._predictedMemory<=0&&!this._updating)return;let e=this._layersUpdating();if(this._predictedMemory<.6&&this._canFastRecover)this._downscaleMemoryUsed=0,this._stableQuality=0,this._canFastRecover=!1,this._updateQuality(1);else if(e){if(this._predictedMemory>1.1||this._usedMemory>1){if(this._stableQuality>0)this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality);else if(this._quality>p&&this._downscaleMemoryUsed<this._usedMemory){if(this._compactAndUpdate())return;this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1}}}else if(this._downscaleMemoryUsed=0,this._usedMemory>1){if(this._compactAndUpdate())return;this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._predictedMemory}else this._stableQuality!==this._quality&&(this._usedMemory<.75&&this._quality<1?(this._stableQuality=this._quality,e=this._updateQuality(this._quality+.05)):this._quality<1&&(this._canFastRecover=!0));this._updating=e}_compactAndUpdate(){let e=d(o(100)),t=this.view.stage.compact(e);return this.view.overlayManager.renderer.compact(e)||t}_updateQuality(e){return e=Math.min(Math.max(e,p),1),e!==this._quality&&(this._quality=e,++this._numQualityChanges,!0)}_layersUpdating(){return this.view.allLayerViews.some(e=>!!e.updating)}_updateMemory(){if(!this.view?.updating||this.view.destroyed||this.view.destroying)return;this.view.stage?.renderer?.tick();let e=this.view.stage?.renderer?.usedMemory,t=(this.view.basemapTerrain?.usedMemory??0)+(e?e.fbos+e.edges+e.plugins+e.clouds:0)+this.view.deconflictor?.usedMemory+this.view.labeler?.usedMemory+(l(this.view)?.lyr3DInternalMemoryBytes??0),r=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(e=>{if(u(e)){let n=e.ignoresMemoryFactor?this._quality:1;t+=e.usedMemory*n,r+=e.unloadedMemory*n}});let i=this._warnMemoryUsage==null||Math.round(t*10)!==Math.round(this._warnMemoryUsage*10),a=this.maxMemory*1048576;if(t>a&&i){this._warnMemoryUsage=t;let e=e=>(e/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+` MB`,i=Math.round(this._quality*100);n.getLogger(this).warn(`Memory Limit exceeded! Limit: ${e(a)} Current: ${e(t)} Projected: ${e(t+r)} Quality: ${i}%`)}this._usedMemory=t/a,this._predictedMemory=(t+r)/a;let o=a-t;this._cacheStorage.maxSize=Math.max(0,o+this.additionalCacheMemory*1048576)}get test(){}};e([s({constructOnly:!0})],_.prototype,`view`,void 0),e([s()],_.prototype,`maxMemory`,null),e([s()],_.prototype,`_quality`,void 0),e([s()],_.prototype,`_usedMemory`,void 0),e([s()],_.prototype,`_updating`,void 0),e([s()],_.prototype,`_stableQuality`,void 0),e([s()],_.prototype,`_maxMemory`,void 0),e([s()],_.prototype,`_additionalCacheMemory`,void 0),_=e([c(`esri.views.3d.support.MemoryController`)],_);export{p as minQuality,f as newMemoryController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{asinClamped as e}from"../../../core/mathUtils.js";import{len as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as
|
|
2
|
+
import{asinClamped as e}from"../../../core/mathUtils.js";import{len as t,lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r,fromValues as i}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../geometry/SpatialReference.js";import{projectBoundingRect as o}from"../../../geometry/projection/projectBoundingRect.js";import{projectBuffer as s}from"../../../geometry/projection/projectBuffer.js";import{wgs84ToWebMercator as c}from"../../../geometry/projection/projectors.js";import{empty as l,expand as u,copy as d,create as f,fromValues as p}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as m,isWebMercator as h,isGeographic as g}from"../../../geometry/support/spatialReferenceUtils.js";export{intersectsGeographicExtent as intersectsElevationUpdateExtent,sphereToGeographicExtent}from"./sphereExtentUtils.js";const _=1;function v(e,t,n,r){let i=e[1],c=e[3];if(t==null||r==null||!o(e,t,n,r))return!1;if(!h(t)||h(r))return!0;if(i<=-x[1]){if(!s(y,a.WGS84,0,S,r,0))return!1;n[1]=S[1]}if(c>=x[1]){if(!s(b,a.WGS84,0,S,r,0))return!1;n[3]=S[1]}return!0}const y=i(0,-90,0),b=i(0,90,0),x=r();c(b,0,x,0);const S=r();function C(e,t,n,r){if(n<e[1]||n>e[3])return!1;if(t>=e[0]&&t<=e[2])return!0;let i=m(r);if(i==null)return!1;let a=i.valid[1]-i.valid[0];return Math.ceil((e[0]-t)/a)<=Math.floor((e[2]-t)/a)}function w(e,t){let n=t.valid,r=g(e)?90:n[1];return h(e)&&(r=x[1]),p(n[0],-r,n[1],r)}function T(e,t){let n=m(t);if(t==null||n==null){if(e.length===0)return[];let t=f();return O(e,t),[t]}return e.length===0?[w(t,n)]:D(e,n)}class E{constructor(e){this._renderCoordsHelper=e,this.extent=l(),this._mapCenterX=NaN,this._worldXWidth=0}reset(n,r,i){l(this.extent),this._mapCenterX=NaN;let a=m(i);if(this._renderCoordsHelper.viewingMode!==1||i==null||a==null)return;let o=t(n);if(r>=o){this._setFullWorldExtent(i,a);return}let s=Math.asin(r/o),c=e(n[2]/o);if(s>A||Math.abs(c)+s>=Math.PI/2){this._setFullWorldExtent(i,a);return}if(this._renderCoordsHelper.fromRenderCoords(n,j,i)==null)return;this._mapCenterX=j[0];let u=a.valid;this._worldXWidth=u[1]-u[0]}addRenderPoint(e,t){return this._renderCoordsHelper.fromRenderCoords(e,j,t)==null?null:(Number.isFinite(this._mapCenterX)&&(j[0]+=Math.round((this._mapCenterX-j[0])/this._worldXWidth)*this._worldXWidth),u(this.extent,j,this.extent),j)}addRenderEdge(e,t,r){if(this._renderCoordsHelper.viewingMode!==1)return!0;let i=t[0]-e[0],a=t[1]-e[1],o=t[2]-e[2],s=e[0]*e[0]+e[1]*e[1],c=e[0]*i+e[1]*a,l=i*i+a*a,u=o*c-e[2]*l,d=(e[2]*c-o*s)/u;return d>0&&d<1?(n(M,e,t,d),this.addRenderPoint(M,r)!=null):!0}_setFullWorldExtent(e,t){d(this.extent,w(e,t))}}function D(e,t){let n=t.valid,r=n[1]-n[0],i=e[0],a=1/0,o=1/0,s=-1/0,c=-1/0,l=1/0,u=-1/0;for(let t=0;t<e.length;t+=4){let n=e[t],d=e[t+1],f=e[t+2],p=e[t+3];a=Math.min(a,n),s=Math.max(s,f),o=Math.min(o,d),c=Math.max(c,p);let m=Math.round((i-n)/r),h=n+m*r,g=f+m*r;l=Math.min(l,h),u=Math.max(u,g)}let d=p(a,o,s,c),f=a,m=s;if(u-l<m-f&&(f=l,m=u),m-f>=r)return d[0]=n[0],d[2]=n[1],[d];let h=k(f,n[0],r);return f+=h*r,m+=h*r,m<=n[1]?(d[0]=f,d[2]=m,[d]):(d[0]=n[0],d[2]=m-r,[d,p(f,o,n[1],c)])}function O(e,t){let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t=0;t<e.length;t+=4){let o=e[t],s=e[t+1],c=e[t+2],l=e[t+3];n=Math.min(n,o),r=Math.min(r,s),i=Math.max(i,c),a=Math.max(a,l)}p(n,r,i,a,t)}function k(e,t,n){return Math.ceil((t-e)/n)}const A=Math.PI/4,j=r(),M=r();export{E as ProjectedElevationUpdateExtent,T as calculateElevationUpdateExtents,C as containsElevationUpdatePoint,w as fullWorldElevationUpdateExtent,_ as planetCenterProximityToleranceMeters,v as projectElevationUpdateExtent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as e}from"../../../core/handleUtils.js";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import{assertNotMesh as r}from"../../../geometry/asserts.js";import i from"../../../geometry/Extent.js";import{projectOrLoad as a}from"../../../geometry/projectionUtils.js";import{
|
|
2
|
+
import{handlesGroup as e}from"../../../core/handleUtils.js";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import{assertNotMesh as r}from"../../../geometry/asserts.js";import i from"../../../geometry/Extent.js";import{projectOrLoad as a}from"../../../geometry/projectionUtils.js";import{fromExtent as o,empty as s}from"../../../geometry/support/aaBoundingRect.js";import{projectElevationUpdateExtent as c}from"./elevationUpdateExtentUtils.js";import{intersectsGeographicExtent as l}from"./sphereExtentUtils.js";function u(s){let u=!1,m=(e,t,n)=>{if(u||d(e,n)||t==null)return;r(t);let h=a(t,s.view.spatialReference);if(h.pending!=null){u=!0,h.pending.finally(()=>{u=!1,m(e,t,n)});return}let g=h.geometry;if(g==null)return;let _=g.type===`point`?i.fromPoint(g):g.extent;_!=null&&c(e.extent,e.spatialReference,f,s.view.spatialReference)&&l(f,o(_,p),s.view.spatialReference)&&s.onElevationChanges()},h,g=t(()=>({elevationMode:s.elevationInfo?.mode,geometry:s.geometry}),({elevationMode:e,geometry:t})=>{h?.remove(),e!==`absolute-height`&&(h=s.view.elevationProvider.on(`elevation-change`,n=>m(n,t,e)))},n);return e([g,h])}function d({context:e},t){return t==null?!1:t===`absolute-height`||e===`scene`&&t!==`relative-to-scene`}const f=s(),p=s();export{u as createElevationUpdateHandle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clamp as t}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{exactEquals as s,dot as c,copy as l,lerp as u,subtract as d,normalize as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{wrap as h}from"../../../../geometry/support/ray.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PropertiesPool as _}from"../../../support/PropertiesPool.js";import{TaskPriority as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";let b=class extends g{constructor(e){super(e),this._propertiesPool=new _({location:()=>new m,renderLocation:()=>p()},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get(`renderLocation`)}initialize(){this.addHandles([r(()=>this.centerOnSurface.renderLocation,()=>this.updateRenderLocation(),{equals:s}),r(()=>this.state.contentCamera,()=>this.updateRenderLocation())]),this.scheduler&&this.addHandles(this.scheduler.registerTask(v.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool=n(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){let e=this._propertiesPool.get(`location`);return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get worldUnitsPerContentPixel(){let{camera:e,contentPixelRatio:t}=this.state;return e.computeRenderPixelSizeAt(this.renderLocation)*(e.pixelRatio/t)}get readyToRun(){return this._dirty}runTask(){let e=this._get(`renderLocation`),n=this.centerOnSurface.renderLocation,r=this.renderCoordsHelper,i=this.state.contentCamera;this._dirty=!1,r.worldUpAtPosition(n,x);let a=Math.max(0,(Math.acos(c(x,i.viewForward))-.5*Math.PI)*(i.aboveGround?1:-1));if(Number.isNaN(a)){if(!e||!s(e,n)){let e=this._propertiesPool.get(`renderLocation`);l(e,n),this._set(`renderLocation`,e)}return y}let o=1-t(a/(.5*Math.PI),0,1),d=o*o*o;this._calculateScreenHorizontalEdgeOnSurface(C);let f=this._propertiesPool.get(`renderLocation`);return u(f,n,C,d),
|
|
2
|
+
import{__decorate as e}from"tslib";import{clamp as t}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{exactEquals as s,dot as c,copy as l,lerp as u,subtract as d,normalize as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{wrap as h}from"../../../../geometry/support/ray.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PropertiesPool as _}from"../../../support/PropertiesPool.js";import{TaskPriority as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";let b=class extends g{constructor(e){super(e),this._propertiesPool=new _({location:()=>new m,renderLocation:()=>p()},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get(`renderLocation`)}initialize(){this.addHandles([r(()=>this.centerOnSurface.renderLocation,()=>this.updateRenderLocation(),{equals:s}),r(()=>this.state.contentCamera,()=>this.updateRenderLocation())]),this.scheduler&&this.addHandles(this.scheduler.registerTask(v.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool=n(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){let e=this._propertiesPool.get(`location`);return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get worldUnitsPerContentPixel(){let{camera:e,contentPixelRatio:t}=this.state;return e.computeRenderPixelSizeAt(this.renderLocation)*(e.pixelRatio/t)}get readyToRun(){return this._dirty}runTask(){let e=this._get(`renderLocation`),n=this.centerOnSurface.renderLocation,r=this.renderCoordsHelper,i=this.state.contentCamera;this._dirty=!1,r.worldUpAtPosition(n,x);let a=Math.max(0,(Math.acos(c(x,i.viewForward))-.5*Math.PI)*(i.aboveGround?1:-1));if(Number.isNaN(a)){if(!e||!s(e,n)){let e=this._propertiesPool.get(`renderLocation`);l(e,n),this._set(`renderLocation`,e)}return y}let o=1-t(a/(.5*Math.PI),0,1),d=o*o*o;this._calculateScreenHorizontalEdgeOnSurface(C);let f=this._propertiesPool.get(`renderLocation`);return u(f,n,C,d),e&&s(e,f)||this._set(`renderLocation`,f),y}_calculateScreenHorizontalEdgeOnSurface(e){let t=this.state.contentCamera,n=t.getRenderCenter(i());if(n[1]=t.aboveGround?t.padding[2]:t.fullHeight-t.padding[0],this.estimateSurfaceIntersectionAtRenderPoint(n,e))return e;let r=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(t.unprojectFromRenderScreen(n,S)){d(S,S,t.eye);let n=f(S,S);if(this.renderCoordsHelper.intersectInfiniteManifold(h(t.eye,n),r,e))return e}return this.renderCoordsHelper.setAltitude(e,r,t.eye)}updateRenderLocation(){this._dirty=!0}};e([a()],b.prototype,`_dirty`,void 0),e([a({constructOnly:!0})],b.prototype,`scheduler`,void 0),e([a({constructOnly:!0})],b.prototype,`centerOnSurface`,void 0),e([a({constructOnly:!0})],b.prototype,`estimateSurfaceIntersectionAtRenderPoint`,void 0),e([a()],b.prototype,`updating`,null),e([a()],b.prototype,`location`,null),e([a()],b.prototype,`renderLocation`,void 0),e([a()],b.prototype,`worldUnitsPerContentPixel`,null),b=e([o(`esri.views.3d.support.pointsOfInterest.Focus`)],b);const x=p(),S=p(),C=p();export{b as Focus};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{length as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{intersects as t,fromValues as n}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as r}from"../../../geometry/support/spatialReferenceUtils.js";function i(e,n,i){if(t(e,n))return!0;let a=r(i);if(a==null||e[1]>n[3]||e[3]<n[1])return!1;let o=a.valid[1]-a.valid[0];return Math.ceil((e[0]-n[2])/o)<=Math.floor((e[2]-n[0])/o)}function a(t,r){let i=e(t.center);if(!t.isValid||i<=t.radius)return n(-1/0,-1/0,1/0,1/0,r);let a=Math.asin(t.radius/i),s=Math.atan2(t.center[2],Math.hypot(t.center[0],t.center[1])),c=s*180/Math.PI;return o(Math.atan2(t.center[1],t.center[0])*180/Math.PI,c,s,a,r)}function o(e,t,r,i,a){let o=i*180/Math.PI;if(Math.abs(r)+i>=Math.PI/2)return n(-180,Math.max(-90,t-o),180,Math.min(90,t+o),a);let s=Math.asin(Math.min(1,Math.sin(i)/Math.cos(r)))*180/Math.PI;return n(e-s,t-o,e+s,t+o,a)}export{i as intersectsGeographicExtent,a as sphereToGeographicExtent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{releaseMaybe as e}from"../../../core/maybe.js";class t{constructor(e,t,n){this._fbos=e,this._format=t,this._name=n}get valid(){return this._handle?.getTexture()!=null}dispose(){this._handle=e(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){
|
|
2
|
+
import{releaseMaybe as e}from"../../../core/maybe.js";class t{constructor(e,t,n){this._fbos=e,this._format=t,this._name=n}get valid(){return this._handle?.getTexture()!=null}dispose(){this._handle=e(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){this._handle&&this._handle.fbo?.width===e&&this._handle.fbo?.height===t||(this._handle?.release(),this._handle=this._fbos.acquire(e,t,this._name,this._format))}bind(e){e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&this._handle?.getTexture()?.generateMipmap()}}export{t as OverlayFramebufferObject};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{unique as t}from"../../../core/arrayUtils.js";import{EventEmitter as n}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as r,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as a}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{watch as s,syncAndInitial as c,on as l,initial as u}from"../../../core/reactiveUtils.js";import{someSet as d}from"../../../core/SetUtils.js";import{property as f,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as m,fromTranslation as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as v}from"../support/debugFlags.js";import{Overlay as y}from"./Overlay.js";import{OverlayRenderTargets as b}from"./OverlayRenderTargets.js";import x from"../webgl/RenderCamera.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as C,renderHighlightBuffer as w}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as T}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as E}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as O}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as k}from"../webgl-engine/lib/ShadowMap.js";import{T as A}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as j}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as N}from"../webgl-engine/lighting/Lightsources.js";import{O as P}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as F}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as I}from"../../support/Scheduler.js";import L from"../../webgl/Texture.js";import{TextureDescriptor as R}from"../../webgl/TextureDescriptor.js";let z=class extends S{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new P,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new o,this._passParameters=new A,this._screenToMapUnitsRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new x,this.events=new n,this.longitudeCyclical=null,this.produces=new Map([[18,e=>e!==10||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;let{state:t,stage:r}=e.parent.view,i=r.renderer.fboCache,a=r.renderView.renderingContext,s=r.renderView.techniques;this._renderContext=new D(a,new k(i,t.viewingMode),s)}initialize(){let e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([s(()=>t.updating,()=>this.events.emit(`content-changed`),c),s(()=>this._spatialReference,e=>this._localOriginFactory=new E(e),c),l(()=>e.allLayerViews,`after-changes`,()=>this._sortedDrapeSourceRenderersDirty=!0),s(()=>C(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,u),s(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},u),e.resourceController.scheduler.registerTask(I.OVERLAY_RENDERER,this)]);let n=this._camera;n.near=1,n.far=1e4,n.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=n,this._bindParameters.updateLighting(new N(_()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=a(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToMapUnitsRatio(){return this._screenToMapUnitsRatio}get mapUnitsToGroundRatio(){return this.parent.mapUnitsToPlanarDistanceRatio*this._bindParameters.planarDistanceToGroundRatio}get localOriginFactory(){return this._localOriginFactory}set overlayStretch(e){this._bindParameters.overlayStretch=e}get overlayStretch(){return this._bindParameters.overlayStretch}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){let t=new T(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit(`content-changed`),this.notifyChange(`updating`),this.notifyChange(`isEmpty`)},()=>this.events.emit(`content-changed`));this._pluginContext={...e,materials:t},this._techniques.precompile(F)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||r(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return this._overlays!=null&&this._renderTargets!=null}getMaterialRenderer(e){for(let t of this._renderers.values()){let n=t.getMaterialRenderer(e);if(n)return n}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),t(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){this._renderers.get(e)?.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,`fullOpacity`in e&&this.addHandles(s(()=>e.fullOpacity,()=>this.events.emit(`content-changed`)),e)}removeDrapeSourceRenderer(e){if(e==null)return;let t=this._renderers.get(e);t!=null&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=this._overlays?d(e,e=>e.drapeTargetType===1):!1}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=d(e,e=>e.drapeSourceType===1),this._hasDrapedRasterSource=d(e,e=>e.drapeSourceType===0),this._hasDrapedFlowSource=d(e,e=>e.drapeSourceType===2)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t){this._overlays??=(this._renderTargets=new b(this._stage.renderer.fboCache),[new y,new y]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t)}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit(`textures-disposed`)}_useOverlayColorInsteadOfColorNoRasterImage(e){return e===1&&!this._needsColorWithoutRasterImage&&(this._hasDrapedFeatureSource||this._hasDrapedRasterSource)}getTexture(e){let t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=r(this._renderers,e=>e.hasOccluders)?H:1}_processDrapeSources(e,t){let n=!1;for(let[r,i]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&i.commitChanges()&&(n=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,n=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),n&&(this._overlays!=null&&this._renderers.size===0&&this.disposeOverlays(),this.notifyChange(`updating`),this.notifyChange(`isEmpty`),this._onMaterialOrContentChanged(),this.hasHighlights=r(this._renderers,e=>e.hasHighlights),this.events.emit(`content-changed`))}compact(e){let t=!1;for(let n of this._renderers.values()){if(e.done)break;t=n.compact(e)||t}return t&&this.notifyChange(`updating`),t}hasHighlight(e){return r(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>e.updatePolicy===1)}get isEmpty(){return!v.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){let e=r(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit(`has-water`)),this._hasWater}renders(e){if(v.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==4&&e!==2)return!0;if(!this._overlays)return!1;let t=this._overlays[0];for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;let n=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;let r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(n),r}_setOutput(e){let t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=e===4?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:+!!this._renderTargets?.getTexture(0)}updateAnimation(e){let t=!1;return this._renderers.forEach(n=>t=n.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;let t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(let e of this._renderTargets.targets){if(e.content===1&&!this._needsColorWithoutRasterImage)continue;let{output:n}=e;this._setOutput(n),n===10&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);let r=this._renderContext.renderOccludedMask;e.content===4&&(this._renderContext.renderOccludedMask=H),this._sortedRenderers.forAll(({drapeSource:t,renderer:n})=>{(e.content!==1||t.drapeSourceType!==0)&&(e.content===4&&n.hasOnlyOccluders||n.precompile(this._renderContext))}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;let n=this.allSourcesOccluders;for(let e of this._renderTargets.targets){if(!(e.content===0&&this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||e.content===1&&!this._needsColorWithoutRasterImage||e.content===4&&n)continue;let r=this._drawTarget(0,e),i=this._drawTarget(1,e);(r||i)&&e.fbo.generateMipMap()}}_drawTarget(e,t){let n=this._overlays[e],r=n.canvasGeometries;if(r.numViews===0)return!1;let i=this._view.state.contentPixelRatio;this._screenToMapUnitsRatio=i*n.mapUnitsPerPixel/this._bindParameters.overlayStretch;let{output:a,content:o}=t;if(this.isEmpty||a===4&&!this.hasWater||!n.hasSomeSizedView())return!1;let{_rctx:s,_camera:c,_renderContext:l,_bindParameters:u}=this;if(c.pixelRatio=n.pixelRatio*i,this._setOutput(a),u.screenToMapUnitsRatio=this._screenToMapUnitsRatio,u.screenToPlanarDistanceRatio=this._screenToMapUnitsRatio*this.parent.mapUnitsToPlanarDistanceRatio,o===4&&(l.renderOccludedMask=H),!this.renders(o))return l.renderOccludedMask=O,!1;let{resolution:d}=n,f=e===0,p=f?0:d;if(s.setViewport(p,0,d,d),this._bindTargetFBO(t),f&&(a===10?s.gl.clearBufferuiv(s.gl.COLOR,0,[0,0,0,0]):(s.setClearColor(0,0,0,0),s.clear(16384))),v.OVERLAY_DRAW_DEBUG_TEXTURE&&o!==4&&o!==2){this._techniques.precompile(j,U);let t=this._techniques.get(j,U);for(let i=0;i<r.numViews;i++)this._setViewParameters(r.extents[i],n),this._ensureDebugPatternResources(n.resolution,V[e]),s.bindTechnique(t,u,this._passParameters),s.screen.draw()}if(a===10){let{fboCache:n}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),w(s,n,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return s.bindFramebuffer(null),l.renderOccludedMask=O,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){let n=this._overlays[e],r=n.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:a})=>{if(t.content===1&&i.drapeSourceType===0)return;let{fullOpacity:o}=i,s=o!=null&&o<1&&t.output===0&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],n),a.render(this._renderContext);if(s){this._bindTargetFBO(t),this._overlayParameters.texture=s.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;let n=this._techniques.get(F);this._rctx.bindTechnique(n,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),s.release()}})}_bindTargetFBO(e){let t=this._resolution,n=2*t;e.fbo.ensureFramebuffer(n,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){let e=this._resolution,t=2*e,n=this._stage.renderer.fboCache,r=n.acquire(t,e,`overlay tmp`);return n.rctx.bindFramebuffer(r.fbo),n.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit(`content-changed`)}intersectRay(e,t,n,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(let{renderer:a}of this._sortedRenderers)i=a.intersectRay?.(e,t,n,r,i)??i}*intersectScreenPolygon(e,t,n){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let r=0;for(let{renderer:i}of this._sortedRenderers)r=yield*i.intersectScreenPolygon(e,t,n,r)}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),this._renderers.size===0)return;let e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((n,r)=>{let i=e.indexOf(r.layer?.uid),a=i>=0,o=r.renderGroup??+!a,s=r.drapeSourcePriorityOffset??0,c=t*o+(a?i:0)+s;this._sortedRenderers.push(new B(r,n,c))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){let n=this._camera;n.viewport=[0,0,t.resolution,t.resolution],this._bindParameters.planarDistanceToGroundRatio=this.parent.getPlanarDistanceToGroundRatio((e[1]+e[3])*.5),m(n.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],n.near,n.far),h(n.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if(g(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;let n=new Uint8Array(e*e*4),r=0;for(let t=0;t<e;t++)for(let i=0;i<e;i++){let a=Math.floor(i/10),o=Math.floor(t/10);a<2||o<2||a*10>e-20||o*10>e-20?(n[r++]=255,n[r++]=255,n[r++]=255,n[r++]=255):(n[r++]=255,n[r++]=255,n[r++]=255,a&1&&o&1?n[r++]=i&1^t&1?0:255:n[r++]=a&1^o&1?0:128)}let i=new R(e);i.samplingMode=9728,this._passParameters.texture=new L(this._rctx,i,n)}get test(){}};e([f()],z.prototype,`hasHighlights`,void 0),e([f()],z.prototype,`renderOccludedFlags`,void 0),e([f()],z.prototype,`_sortedDrapeSourceRenderersDirty`,void 0),e([f({constructOnly:!0})],z.prototype,`parent`,void 0),e([f({readOnly:!0})],z.prototype,`_techniques`,null),e([f({type:Boolean,readOnly:!0})],z.prototype,`updating`,null),e([f()],z.prototype,`isEmpty`,null),z=e([p(`esri.views.3d.terrain.OverlayRenderer`)],z);class B{constructor(e,t,n){this.drapeSource=e,this.renderer=t,this.index=n}}const V=[[1,.5,.5],[.5,.5,1]],H=4,U=new M;U.hasAlpha=!0;export{z as OverlayRenderer,H as overlayRenderOccludedFlag};
|
|
2
|
+
import{__decorate as e}from"tslib";import{unique as t}from"../../../core/arrayUtils.js";import{EventEmitter as n}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as r,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as a}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{watch as s,syncAndInitial as c,on as l,initial as u}from"../../../core/reactiveUtils.js";import{someSet as d}from"../../../core/SetUtils.js";import{property as f,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as m,fromTranslation as h}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as v}from"../support/debugFlags.js";import{Overlay as y}from"./Overlay.js";import{OverlayRenderTargets as b}from"./OverlayRenderTargets.js";import x from"../webgl/RenderCamera.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as C,renderHighlightBuffer as w}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as T}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as E}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as O}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as k}from"../webgl-engine/lib/ShadowMap.js";import{T as A}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as j}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as N}from"../webgl-engine/lighting/Lightsources.js";import{O as P}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as F}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as I}from"../../support/Scheduler.js";import L from"../../webgl/Texture.js";import{TextureDescriptor as R}from"../../webgl/TextureDescriptor.js";let z=class extends S{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new P,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new o,this._passParameters=new A,this._screenToMapUnitsRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new x,this.events=new n,this.longitudeCyclical=null,this.produces=new Map([[18,e=>e!==10||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;let{state:t,stage:r}=e.parent.view,i=r.renderer.fboCache,a=r.renderView.renderingContext,s=r.renderView.techniques;this._renderContext=new D(a,new k(i,t.viewingMode),s)}initialize(){let e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([s(()=>t.updating,()=>this.events.emit(`content-changed`),c),s(()=>this._spatialReference,e=>this._localOriginFactory=new E(e),c),l(()=>e.allLayerViews,`after-changes`,()=>this._sortedDrapeSourceRenderersDirty=!0),s(()=>C(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,u),s(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},u),e.resourceController.scheduler.registerTask(I.OVERLAY_RENDERER,this)]);let n=this._camera;n.near=1,n.far=1e4,n.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=n,this._bindParameters.updateLighting(new N(_()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=a(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToMapUnitsRatio(){return this._screenToMapUnitsRatio}get mapUnitsToGroundRatio(){return this.parent.mapUnitsToPlanarDistanceRatio*this._bindParameters.planarDistanceToGroundRatio}get localOriginFactory(){return this._localOriginFactory}set overlayStretch(e){this._bindParameters.overlayStretch=e}get overlayStretch(){return this._bindParameters.overlayStretch}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){let t=new T(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit(`content-changed`),this.notifyChange(`updating`),this.notifyChange(`isEmpty`)},()=>this.events.emit(`content-changed`));this._pluginContext={...e,materials:t},this._techniques.precompile(F)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||r(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return this._overlays!=null&&this._renderTargets!=null}getMaterialRenderer(e){for(let t of this._renderers.values()){let n=t.getMaterialRenderer(e);if(n)return n}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),t(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){this._renderers.get(e)?.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,`fullOpacity`in e&&this.addHandles(s(()=>e.fullOpacity,()=>this.events.emit(`content-changed`)),e)}removeDrapeSourceRenderer(e){if(e==null)return;let t=this._renderers.get(e);t!=null&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=this._overlays?d(e,e=>e.drapeTargetType===1):!1}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=d(e,e=>e.drapeSourceType===1),this._hasDrapedRasterSource=d(e,e=>e.drapeSourceType===0),this._hasDrapedFlowSource=d(e,e=>e.drapeSourceType===2)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t){this._overlays??=(this._renderTargets=new b(this._stage.renderer.fboCache),[new y,new y]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t)}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit(`textures-disposed`)}_useOverlayColorInsteadOfColorNoRasterImage(e){return e===1&&!this._needsColorWithoutRasterImage&&(this._hasDrapedFeatureSource||this._hasDrapedRasterSource)}getTexture(e){let t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=r(this._renderers,e=>e.hasOccluders)?H:1}_processDrapeSources(e,t){let n=!1;for(let[r,i]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&i.commitChanges()&&(n=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,n=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),n&&(this._overlays!=null&&this._renderers.size===0&&this.disposeOverlays(),this.notifyChange(`updating`),this.notifyChange(`isEmpty`),this._onMaterialOrContentChanged(),this.hasHighlights=r(this._renderers,e=>e.hasHighlights),this.events.emit(`content-changed`))}compact(e){let t=!1;for(let n of this._renderers.values()){if(e.done)break;t=n.compact(e)||t}return t&&this.notifyChange(`updating`),t}hasHighlight(e){return r(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>e.updatePolicy===1)}get isEmpty(){return!v.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){let e=r(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit(`has-water`)),this._hasWater}renders(e){if(v.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==4&&e!==2)return!0;if(!this._overlays)return!1;let t=this._overlays[0];for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;let n=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;let r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(n),r}_setOutput(e){let t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=e===4?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:+!!this._renderTargets?.getTexture(0)}updateAnimation(e){let t=!1;return this._renderers.forEach(n=>t=n.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;let t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(let e of this._renderTargets.targets){if(e.content===1&&!this._needsColorWithoutRasterImage)continue;let{output:n}=e;this._setOutput(n),n===10&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);let r=this._renderContext.renderOccludedMask;e.content===4&&(this._renderContext.renderOccludedMask=H),this._sortedRenderers.forAll(({drapeSource:t,renderer:n})=>{e.content===1&&t.drapeSourceType===0||e.content===4&&n.hasOnlyOccluders||n.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(let e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;let n=this.allSourcesOccluders;for(let e of this._renderTargets.targets){if(!(e.content===0&&this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||e.content===1&&!this._needsColorWithoutRasterImage||e.content===4&&n)continue;let r=this._drawTarget(0,e),i=this._drawTarget(1,e);(r||i)&&e.fbo.generateMipMap()}}_drawTarget(e,t){let n=this._overlays[e],r=n.canvasGeometries;if(r.numViews===0)return!1;let i=this._view.state.contentPixelRatio;this._screenToMapUnitsRatio=i*n.mapUnitsPerPixel/this._bindParameters.overlayStretch;let{output:a,content:o}=t;if(this.isEmpty||a===4&&!this.hasWater||!n.hasSomeSizedView())return!1;let{_rctx:s,_camera:c,_renderContext:l,_bindParameters:u}=this;if(c.pixelRatio=n.pixelRatio*i,this._setOutput(a),u.screenToMapUnitsRatio=this._screenToMapUnitsRatio,u.screenToPlanarDistanceRatio=this._screenToMapUnitsRatio*this.parent.mapUnitsToPlanarDistanceRatio,o===4&&(l.renderOccludedMask=H),!this.renders(o))return l.renderOccludedMask=O,!1;let{resolution:d}=n,f=e===0,p=f?0:d;if(s.setViewport(p,0,d,d),this._bindTargetFBO(t),f&&(a===10?s.gl.clearBufferuiv(s.gl.COLOR,0,[0,0,0,0]):(s.setClearColor(0,0,0,0),s.clear(16384))),v.OVERLAY_DRAW_DEBUG_TEXTURE&&o!==4&&o!==2){this._techniques.precompile(j,U);let t=this._techniques.get(j,U);for(let i=0;i<r.numViews;i++)this._setViewParameters(r.extents[i],n),this._ensureDebugPatternResources(n.resolution,V[e]),s.bindTechnique(t,u,this._passParameters),s.screen.draw()}if(a===10){let{fboCache:n}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),w(s,n,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return s.bindFramebuffer(null),l.renderOccludedMask=O,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){let n=this._overlays[e],r=n.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:a})=>{if(t.content===1&&i.drapeSourceType===0)return;let{fullOpacity:o}=i,s=o!=null&&o<1&&t.output===0&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],n),a.render(this._renderContext);if(s){this._bindTargetFBO(t),this._overlayParameters.texture=s.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;let n=this._techniques.get(F);this._rctx.bindTechnique(n,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),s.release()}})}_bindTargetFBO(e){let t=this._resolution,n=2*t;e.fbo.ensureFramebuffer(n,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){let e=this._resolution,t=2*e,n=this._stage.renderer.fboCache,r=n.acquire(t,e,`overlay tmp`);return n.rctx.bindFramebuffer(r.fbo),n.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit(`content-changed`)}intersectRay(e,t,n,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(let{renderer:a}of this._sortedRenderers)i=a.intersectRay?.(e,t,n,r,i)??i}*intersectScreenPolygon(e,t,n){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let r=0;for(let{renderer:i}of this._sortedRenderers)r=yield*i.intersectScreenPolygon(e,t,n,r)}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),this._renderers.size===0)return;let e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((n,r)=>{let i=e.indexOf(r.layer?.uid),a=i>=0,o=r.renderGroup??+!a,s=r.drapeSourcePriorityOffset??0,c=t*o+(a?i:0)+s;this._sortedRenderers.push(new B(r,n,c))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){let n=this._camera;n.viewport=[0,0,t.resolution,t.resolution],this._bindParameters.planarDistanceToGroundRatio=this.parent.getPlanarDistanceToGroundRatio((e[1]+e[3])*.5),m(n.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],n.near,n.far),h(n.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if(g(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;let n=new Uint8Array(e*e*4),r=0;for(let t=0;t<e;t++)for(let i=0;i<e;i++){let a=Math.floor(i/10),o=Math.floor(t/10);a<2||o<2||a*10>e-20||o*10>e-20?(n[r++]=255,n[r++]=255,n[r++]=255,n[r++]=255):(n[r++]=255,n[r++]=255,n[r++]=255,a&1&&o&1?n[r++]=i&1^t&1?0:255:n[r++]=a&1^o&1?0:128)}let i=new R(e);i.samplingMode=9728,this._passParameters.texture=new L(this._rctx,i,n)}get test(){}};e([f()],z.prototype,`hasHighlights`,void 0),e([f()],z.prototype,`renderOccludedFlags`,void 0),e([f()],z.prototype,`_sortedDrapeSourceRenderersDirty`,void 0),e([f({constructOnly:!0})],z.prototype,`parent`,void 0),e([f({readOnly:!0})],z.prototype,`_techniques`,null),e([f({type:Boolean,readOnly:!0})],z.prototype,`updating`,null),e([f()],z.prototype,`isEmpty`,null),z=e([p(`esri.views.3d.terrain.OverlayRenderer`)],z);class B{constructor(e,t,n){this.drapeSource=e,this.renderer=t,this.index=n}}const V=[[1,.5,.5],[.5,.5,1]],H=4,U=new M;U.hasAlpha=!0;export{z as OverlayRenderer,H as overlayRenderOccludedFlag};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{equals as e}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{isPowerOfTwo as t}from"../../../core/mathUtils.js";import{disposeMaybe as n,releaseMaybe as r}from"../../../core/maybe.js";import{glLayout as i}from"../support/buffer/glUtil.js";import{GeometryState as a}from"./GeometryState.js";import{PatchGeometry as o}from"./PatchGeometry.js";import"../../../geometry/Extent.js";import"../../../geometry/support/Ellipsoid.js";import{internalAssert as s,neighborEdgeIndices as c,oppositeEdge as l,neighborCornerIndices as u,enableTerrainInternalChecks as d}from"./terrainUtils.js";import{maxTileNeighborLevelDelta as f}from"./TerrainConst.js";import{TextureFader as p}from"./TextureFader.js";import{TextureReference as m}from"./TextureReference.js";import h from"./TileOverlayData.js";import{fallsWithinLayerView as g}from"./tileUtils.js";import{VertexArrayObject as _}from"../webgl-engine/lib/VertexArrayObject.js";import{BufferObject as v}from"../../webgl/BufferObject.js";import{VertexBuffer as y}from"../../webgl/VertexBuffer.js";class b{constructor(){this.geometry=new o,this.geometryState=null,this._texture=null,this._textureOpacity=1,this._textureFader=new p(()=>this._tile.surface.fadeDuration),this.overlay=new h,this._localOrigin=null,this._geometryStateChangedSinceLastUpdate=!0,this._hasGeometry=!1,this._modifiedFlags=0}get tile(){return this._tile}get localOrigin(){return this._localOrigin}init(e,t){this.clear(),this._tile=e,this.geometry.reset(),this.intersectionData=null,this.geometryState=new a,this._localOrigin=t,this.overlay.clear()}clear(){this.releaseGeometry(),this.releaseTexture(),this._textureFader.clear(),this._tile=null,this.intersectionData=null,this.geometryState=null}updateGeometryIfNeeded(e){if(this._tile&&this.geometryState&&((!this._vao||this._geometryStateChangedSinceLastUpdate||this.wireframeChanged||this.clippingAreaChanged||this.samplerDataChanged||this.numVerticesPerSideChanged||this.dirtyCorners||this.dirtyEdgeResolutions||this.dirtyEdges)&&(this._updateGeometry(e),this._geometryStateChangedSinceLastUpdate=!1),d&&this.tile.intersectsClippingArea))for(let e=0;e<A;++e)s(this.geometry.getEdgeCount(e)===this.geometryState.edgeResolutions[e]+1)}_calculateEdgeResolution(e,t){let n=this.tile,r=this.geometryState.numVerticesPerSide-1;if(!n.surface.isGlobal){let t=n.surface.groundExtent;if(t!=null&&(e===0&&n.extent[3]>t[3]||e===1&&n.extent[2]>t[2]||e===2&&n.extent[1]<t[1]||e===3&&n.extent[0]<t[0]))return r}let i=n.level,a=c[e];if(!t)return s(n.surface?.rootTiles==null||n.surface.updatingRootTiles||!n.shouldHaveNeighbor(a)),r;if(t.loaded){let n=t,a=n.renderData?.geometryState;if(!a)return r;let o=i-n.level;if(s(o>=0),o===0){let e=a.numVerticesPerSide-1;return Math.max(e,r)}let c=2**o,l=a.edgeResolutions[(e+2)%4]/c;return Math.max(1,l)}s(!t.leaf);let o=r;return t.forAllSubtreeOnSide(l(a),e=>e===n?!0:e.loaded?(o=Math.max(o,2**(e.level-i)),!0):(s(!e.leaf),!1)),o}updateNeighborData(){let e=this.tile;if(!e.intersectsClippingArea)return;let n=e.renderData.geometryState,r=t=>(t.loaded||t.level===e.level)&&t.intersectsClippingArea,i=n.edgePeerNeighbors,a=n.edgePeerNeighborSamplerVersions;for(let o=0;o<A;++o){let l=e.findNeighborTile(c[o],r),u=S(e,l),p=u?.renderData?.geometryState.samplerDataVersion??-1,m=i[o],h=u!==S(e,m),g=a[o]!==p;d&&l&&(s(e.level>=l.level),s(e.level-l.level<=f)),i[o]=l,(h||g)&&(a[o]=p,this._markEdgeDirty(o));let _=n.edgeResolutions[o],v=this._calculateEdgeResolution(o,l);s(t(v)),s(v>=1),n.edgeResolutions[o]=v,_!==v&&this._markEdgeResolutionDirty(o)}for(let t=0;t<A;++t){let a=e.findNeighborTile(u[t],r);n.cornerPeerNeighbors[t]=a;let o=S(e,i[t]),c=S(e,i[(t+1)%A]),l=S(e,a);x[t]=l,x[(t+1)%A]=c,x[(t+2)%A]=e,x[(t+3)%A]=o,s(x.some(t=>t?.loaded||t===e));let f=x.reduce((e,t)=>Math.min(e,t?.level??1/0),1/0);x.forEach((e,t)=>{e&&e.level>f&&(x[t]=null)}),s(x.some(t=>t?.loaded||t===e));let p=n.cornerNeighborCornerTiles,m=n.cornerNeighborCornerTileSamplerVersions;for(let e=0;e<A;++e){let n=x[e],r=n?.renderData?.geometryState?.samplerDataVersion??-1,i=t*A+e,a=p[i]!==n,o=!a&&m[i]!==r;(a||o)&&(p[i]=n,m[i]=r,this._markCornerDirty(t))}d&&s(j.some(n=>{let r=p[t*A+n];return r?.loaded||r===e}))}d&&s(n.edgeResolutions.every(e=>e>0));for(let e=0;e<A;++e)x[e]=null}_updateGeometry(e){if(!this.tile.intersectsClippingArea)return;d&&s(!this.tile.intersectsClippingArea||this.geometryState.edgeResolutions.every(e=>e>0)),this.intersectionData=null;let{tile:t,_vao:n,geometry:r,geometryState:i}=this,{vertexAttributes:a}=r,o=!n||!a||this.wireframeChanged||this.samplerDataChanged||this.clippingAreaChanged,c=this.dirtyEdgeResolutions!==0,l=i.edgeResolutions.reduce((e,t)=>Math.max(e,t),0)+1,u=c&&l>r.maxEdgeVertexCount,f=o||this.numVerticesPerSideChanged||u,p=!f&&c,m=!p&&this.dirtyEdges!==0,h=!m&&this.dirtyCorners!==0;f?(this.releaseGeometry(),this._createGeometry(e)):p?t.updateEdgeElevationsAndResolutions():m||h?t.updateEdgeElevations():console.warn(`Update for no reason?`),this._modifiedFlags=0}get hasGeometry(){return this._hasGeometry}releaseGeometry(){return this._hasGeometry=!1,this.intersectionData=null,this._vao?(this._vao=n(this._vao),this.geometry.release(),!0):!1}ensureTexture(e,t,n,r){let i=t?6408:6407;return this._texture!=null&&(n===0&&this._tile.surface.fadeDuration>0&&this._isTextureVisible(this._texture)||this._texture.descriptor.width!==e||this._texture.descriptor.pixelFormat!==i)&&this.releaseTexture(),this._texture??(this._texture=r(),this.tile.setMemoryDirty()),this._texture}releaseTexture(){this._texture&&(this._texture=r(this._texture),this.tile.setMemoryDirty())}reuseTexture(e,t){return!e||!this._texture?!1:(e.setTextureReference(new m(this._texture,0,t,this._textureOpacity,0,1)),!0)}get numVerticesPerSideChanged(){return(this._modifiedFlags&C)!==0}get samplerDataChanged(){return(this._modifiedFlags&w)!==0}get clippingAreaChanged(){return(this._modifiedFlags&T)!==0}get wireframeChanged(){return(this._modifiedFlags&E)!==0}get dirtyEdges(){return this._modifiedFlags>>D&15}get dirtyCorners(){return this._modifiedFlags>>O&15}get dirtyEdgeResolutions(){return this._modifiedFlags>>k&15}_markCornerDirty(e){let t=1<<e<<O;this._modifiedFlags|=t}_markEdgeDirty(e){let t=1<<e<<D;this._modifiedFlags|=t,this._markCornerDirty((e+0)%4),this._markCornerDirty((e+3)%4)}_markEdgeResolutionDirty(e){let t=1<<e<<k;this._modifiedFlags|=t,this._markEdgeDirty(e)}_markAllEdgesAndCornersDirty(){this._modifiedFlags|=15<<O|15<<D|15<<k}updateGeometryState(){let t=this._elevationInfo,n=this.tile,r=t.samplerData?n.getElevationVerticesPerSide(t.maxTileLevel):n.minimumVerticesPerSide,i=Math.max(r,5),a=n.clippingArea;(!n.intersectsClippingArea||n.withinClippingArea)&&(a=null);let o=this.geometryState,s=!1;o.numVerticesPerSide!==i&&(this._modifiedFlags|=C,o.numVerticesPerSide=i,o.samplerDataVersion++,s=!0),t.changed&&(this._modifiedFlags|=w,o.samplerData=t.samplerData,o.samplerDataSourceLevels=t.samplerDataSourceLevels,o.samplerDataVersion++,s=!0),e(o.clippingArea,a)||(this._modifiedFlags|=T,o.clippingArea=a,s=!0);let c=n.surface.wireframe;return o.wireframe!==c&&(this._modifiedFlags|=E,o.wireframe=c,s=!0),this._geometryStateChangedSinceLastUpdate||=s,s&&this._markAllEdgesAndCornersDirty(),this._hasGeometry=!0,this._geometryStateChangedSinceLastUpdate}_createGeometry(e){this.tile.createGeometry();let{vertexAttributes:t,indices:n}=this.geometry,r=e.gl;this._vao=new _(e,new y(e,i(t.layout),t.buffer),v.createIndex(e,r.STATIC_DRAW,n)),this._hasGeometry=!0}get vao(){return this._vao}setTextureReference(e,t=0){e?.texture===this._texture?this._textureOpacity=e.opacities[0]:this.releaseTexture(),this._textureFader.push(e,t)}get textureReference(){return this._textureFader.current}get nextTextureReference(){return this._textureFader.next}get textureFadeFactor(){return this._textureFader.fadeFactor}get textureIsFading(){return this._textureFader.isFading}_isTextureVisible(e){return this._textureFader.current?.texture===e||this._textureFader.next?.texture===e&&this._textureFader.fadeFactor<1}get _elevationInfo(){let t=this.geometryState.samplerData,n=this.geometryState.samplerDataSourceLevels,r=this.tile.layerInfo[0],i=r.length,a=Array(i),o=Array(i),s=0,c=0,l=!1;for(let e=0;e<i;e++){let n=r[e],i=n.upsampleInfo?.tile;if(i){let n=i.layerInfo[0][e].data,r=n&&n.samplerData;
|
|
2
|
+
import{equals as e}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{isPowerOfTwo as t}from"../../../core/mathUtils.js";import{disposeMaybe as n,releaseMaybe as r}from"../../../core/maybe.js";import{glLayout as i}from"../support/buffer/glUtil.js";import{GeometryState as a}from"./GeometryState.js";import{PatchGeometry as o}from"./PatchGeometry.js";import"../../../geometry/Extent.js";import"../../../geometry/support/Ellipsoid.js";import{internalAssert as s,neighborEdgeIndices as c,oppositeEdge as l,neighborCornerIndices as u,enableTerrainInternalChecks as d}from"./terrainUtils.js";import{maxTileNeighborLevelDelta as f}from"./TerrainConst.js";import{TextureFader as p}from"./TextureFader.js";import{TextureReference as m}from"./TextureReference.js";import h from"./TileOverlayData.js";import{fallsWithinLayerView as g}from"./tileUtils.js";import{VertexArrayObject as _}from"../webgl-engine/lib/VertexArrayObject.js";import{BufferObject as v}from"../../webgl/BufferObject.js";import{VertexBuffer as y}from"../../webgl/VertexBuffer.js";class b{constructor(){this.geometry=new o,this.geometryState=null,this._texture=null,this._textureOpacity=1,this._textureFader=new p(()=>this._tile.surface.fadeDuration),this.overlay=new h,this._localOrigin=null,this._geometryStateChangedSinceLastUpdate=!0,this._hasGeometry=!1,this._modifiedFlags=0}get tile(){return this._tile}get localOrigin(){return this._localOrigin}init(e,t){this.clear(),this._tile=e,this.geometry.reset(),this.intersectionData=null,this.geometryState=new a,this._localOrigin=t,this.overlay.clear()}clear(){this.releaseGeometry(),this.releaseTexture(),this._textureFader.clear(),this._tile=null,this.intersectionData=null,this.geometryState=null}updateGeometryIfNeeded(e){if(this._tile&&this.geometryState&&((!this._vao||this._geometryStateChangedSinceLastUpdate||this.wireframeChanged||this.clippingAreaChanged||this.samplerDataChanged||this.numVerticesPerSideChanged||this.dirtyCorners||this.dirtyEdgeResolutions||this.dirtyEdges)&&(this._updateGeometry(e),this._geometryStateChangedSinceLastUpdate=!1),d&&this.tile.intersectsClippingArea))for(let e=0;e<A;++e)s(this.geometry.getEdgeCount(e)===this.geometryState.edgeResolutions[e]+1)}_calculateEdgeResolution(e,t){let n=this.tile,r=this.geometryState.numVerticesPerSide-1;if(!n.surface.isGlobal){let t=n.surface.groundExtent;if(t!=null&&(e===0&&n.extent[3]>t[3]||e===1&&n.extent[2]>t[2]||e===2&&n.extent[1]<t[1]||e===3&&n.extent[0]<t[0]))return r}let i=n.level,a=c[e];if(!t)return s(n.surface?.rootTiles==null||n.surface.updatingRootTiles||!n.shouldHaveNeighbor(a)),r;if(t.loaded){let n=t,a=n.renderData?.geometryState;if(!a)return r;let o=i-n.level;if(s(o>=0),o===0){let e=a.numVerticesPerSide-1;return Math.max(e,r)}let c=2**o,l=a.edgeResolutions[(e+2)%4]/c;return Math.max(1,l)}s(!t.leaf);let o=r;return t.forAllSubtreeOnSide(l(a),e=>e===n?!0:e.loaded?(o=Math.max(o,2**(e.level-i)),!0):(s(!e.leaf),!1)),o}updateNeighborData(){let e=this.tile;if(!e.intersectsClippingArea)return;let n=e.renderData.geometryState,r=t=>(t.loaded||t.level===e.level)&&t.intersectsClippingArea,i=n.edgePeerNeighbors,a=n.edgePeerNeighborSamplerVersions;for(let o=0;o<A;++o){let l=e.findNeighborTile(c[o],r),u=S(e,l),p=u?.renderData?.geometryState.samplerDataVersion??-1,m=i[o],h=u!==S(e,m),g=a[o]!==p;d&&l&&(s(e.level>=l.level),s(e.level-l.level<=f)),i[o]=l,(h||g)&&(a[o]=p,this._markEdgeDirty(o));let _=n.edgeResolutions[o],v=this._calculateEdgeResolution(o,l);s(t(v)),s(v>=1),n.edgeResolutions[o]=v,_!==v&&this._markEdgeResolutionDirty(o)}for(let t=0;t<A;++t){let a=e.findNeighborTile(u[t],r);n.cornerPeerNeighbors[t]=a;let o=S(e,i[t]),c=S(e,i[(t+1)%A]),l=S(e,a);x[t]=l,x[(t+1)%A]=c,x[(t+2)%A]=e,x[(t+3)%A]=o,s(x.some(t=>t?.loaded||t===e));let f=x.reduce((e,t)=>Math.min(e,t?.level??1/0),1/0);x.forEach((e,t)=>{e&&e.level>f&&(x[t]=null)}),s(x.some(t=>t?.loaded||t===e));let p=n.cornerNeighborCornerTiles,m=n.cornerNeighborCornerTileSamplerVersions;for(let e=0;e<A;++e){let n=x[e],r=n?.renderData?.geometryState?.samplerDataVersion??-1,i=t*A+e,a=p[i]!==n,o=!a&&m[i]!==r;(a||o)&&(p[i]=n,m[i]=r,this._markCornerDirty(t))}d&&s(j.some(n=>{let r=p[t*A+n];return r?.loaded||r===e}))}d&&s(n.edgeResolutions.every(e=>e>0));for(let e=0;e<A;++e)x[e]=null}_updateGeometry(e){if(!this.tile.intersectsClippingArea)return;d&&s(!this.tile.intersectsClippingArea||this.geometryState.edgeResolutions.every(e=>e>0)),this.intersectionData=null;let{tile:t,_vao:n,geometry:r,geometryState:i}=this,{vertexAttributes:a}=r,o=!n||!a||this.wireframeChanged||this.samplerDataChanged||this.clippingAreaChanged,c=this.dirtyEdgeResolutions!==0,l=i.edgeResolutions.reduce((e,t)=>Math.max(e,t),0)+1,u=c&&l>r.maxEdgeVertexCount,f=o||this.numVerticesPerSideChanged||u,p=!f&&c,m=!p&&this.dirtyEdges!==0,h=!m&&this.dirtyCorners!==0;f?(this.releaseGeometry(),this._createGeometry(e)):p?t.updateEdgeElevationsAndResolutions():m||h?t.updateEdgeElevations():console.warn(`Update for no reason?`),this._modifiedFlags=0}get hasGeometry(){return this._hasGeometry}releaseGeometry(){return this._hasGeometry=!1,this.intersectionData=null,this._vao?(this._vao=n(this._vao),this.geometry.release(),!0):!1}ensureTexture(e,t,n,r){let i=t?6408:6407;return this._texture!=null&&(n===0&&this._tile.surface.fadeDuration>0&&this._isTextureVisible(this._texture)||this._texture.descriptor.width!==e||this._texture.descriptor.pixelFormat!==i)&&this.releaseTexture(),this._texture??(this._texture=r(),this.tile.setMemoryDirty()),this._texture}releaseTexture(){this._texture&&(this._texture=r(this._texture),this.tile.setMemoryDirty())}reuseTexture(e,t){return!e||!this._texture?!1:(e.setTextureReference(new m(this._texture,0,t,this._textureOpacity,0,1)),!0)}get numVerticesPerSideChanged(){return(this._modifiedFlags&C)!==0}get samplerDataChanged(){return(this._modifiedFlags&w)!==0}get clippingAreaChanged(){return(this._modifiedFlags&T)!==0}get wireframeChanged(){return(this._modifiedFlags&E)!==0}get dirtyEdges(){return this._modifiedFlags>>D&15}get dirtyCorners(){return this._modifiedFlags>>O&15}get dirtyEdgeResolutions(){return this._modifiedFlags>>k&15}_markCornerDirty(e){let t=1<<e<<O;this._modifiedFlags|=t}_markEdgeDirty(e){let t=1<<e<<D;this._modifiedFlags|=t,this._markCornerDirty((e+0)%4),this._markCornerDirty((e+3)%4)}_markEdgeResolutionDirty(e){let t=1<<e<<k;this._modifiedFlags|=t,this._markEdgeDirty(e)}_markAllEdgesAndCornersDirty(){this._modifiedFlags|=15<<O|15<<D|15<<k}updateGeometryState(){let t=this._elevationInfo,n=this.tile,r=t.samplerData?n.getElevationVerticesPerSide(t.maxTileLevel):n.minimumVerticesPerSide,i=Math.max(r,5),a=n.clippingArea;(!n.intersectsClippingArea||n.withinClippingArea)&&(a=null);let o=this.geometryState,s=!1;o.numVerticesPerSide!==i&&(this._modifiedFlags|=C,o.numVerticesPerSide=i,o.samplerDataVersion++,s=!0),t.changed&&(this._modifiedFlags|=w,o.samplerData=t.samplerData,o.samplerDataSourceLevels=t.samplerDataSourceLevels,o.samplerDataVersion++,s=!0),e(o.clippingArea,a)||(this._modifiedFlags|=T,o.clippingArea=a,s=!0);let c=n.surface.wireframe;return o.wireframe!==c&&(this._modifiedFlags|=E,o.wireframe=c,s=!0),this._geometryStateChangedSinceLastUpdate||=s,s&&this._markAllEdgesAndCornersDirty(),this._hasGeometry=!0,this._geometryStateChangedSinceLastUpdate}_createGeometry(e){this.tile.createGeometry();let{vertexAttributes:t,indices:n}=this.geometry,r=e.gl;this._vao=new _(e,new y(e,i(t.layout),t.buffer),v.createIndex(e,r.STATIC_DRAW,n)),this._hasGeometry=!0}get vao(){return this._vao}setTextureReference(e,t=0){e?.texture===this._texture?this._textureOpacity=e.opacities[0]:this.releaseTexture(),this._textureFader.push(e,t)}get textureReference(){return this._textureFader.current}get nextTextureReference(){return this._textureFader.next}get textureFadeFactor(){return this._textureFader.fadeFactor}get textureIsFading(){return this._textureFader.isFading}_isTextureVisible(e){return this._textureFader.current?.texture===e||this._textureFader.next?.texture===e&&this._textureFader.fadeFactor<1}get _elevationInfo(){let t=this.geometryState.samplerData,n=this.geometryState.samplerDataSourceLevels,r=this.tile.layerInfo[0],i=r.length,a=Array(i),o=Array(i),s=0,c=0,l=!1;for(let e=0;e<i;e++){let n=r[e],i=n.upsampleInfo?.tile;if(i){let n=i.layerInfo[0][e].data,r=n&&n.samplerData;t&&t[s]===r||(l=!0),a[s++]=r,o[s-1]=n?.level??i.level,c=Math.max(c,i.lij[0])}else if(n.data){let r=this.tile.surface.layerViewByIndex(e,0);if(g(this.tile,r)){let e=n.data;t&&t[s]===e.samplerData||(l=!0),a[s++]=e.samplerData,o[s-1]=e.level,c=this.tile.level}}}t!=null&&t.length!==s&&(l=!0);let u=s>0,d=u?a:null,f=u?o:null;return u&&(a.length=s,o.length=s),e(n,f)||(l=!0),{changed:l,samplerData:d,samplerDataSourceLevels:f,maxTileLevel:c}}get estimatedGeometryMemoryUsage(){let e=this.intersectionData?.estimatedMemoryUsage??0;return(this.geometry.indices?.byteLength??0)+(this.geometry.vertexAttributes?.byteLength??0)+e}get texture(){return this._texture}get test(){}checkGeometryWaterproofness(){}}const x=[null,null,null,null];function S(e,t){return t?.loaded||t===e?t:null}const C=1,w=2,T=4,E=8,D=4,O=8,k=12,A=4,j=[0,1,2,3];export{b as PatchRenderData,S as neighborTileIfLoadedOrSelf,j as zeroToFour};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e
|
|
2
|
+
const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e==null||`type`in e&&e.type===`empty-tile`}function a(e){return e!=null&&`type`in e&&`bitmap`in e}export{e as emptyTile,a as isCreateBitmapResult,i as isEmptyTile,n as isRasterTile,r as isTileTexture,t as isVectorTile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return j(e
|
|
2
|
+
import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return e?.sourceLayerInfo?.data!=null&&j(e.sourceLayerInfo)||!!e?.isVTLBackground}function k(e){return o(e?.sourceLayerInfo?.data)}function A(e){let t=e?.sourceLayerInfo?.data;return a(t)}function j(e){return s(e?.data)}function M(e){return e!=null&&`release`in e&&e.release(),null}function N(e,t,n,r,i){return u[r].checkIfTileInfoSupportedForViewSR(e,n,t,i)}function P(e,t,n){let r=null,i=null;if(e?.type===`wmts`){let a=F(e,t,n);r=a.tileInfo,i=a.fullExtent}else{i=_(e)?e.getCompatibleFullExtent(t):e.fullExtent;let a=n===2;r=_(e)?e.getCompatibleTileInfo(t,i,a):e?.type===`vector-tile`?a&&!I(t)||L.force512VTL?e.tileInfo:e.tileInfo.getCompatibleForVTL(256):e.tileInfo}let a=`tilemapCache`in e?e.tilemapCache?.effectiveMaxLOD:void 0;return r!=null&&i!=null&&N(r,i,t,n,a)==null?{tileInfo:r,fullExtent:i}:null}function F(t,n,i){let a=r(t);if(a!=null){if(e.isCollection(a)){let e=a.find(e=>N(e.tileInfo,e.fullExtent,n,i)==null);if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}return{tileInfo:null,fullExtent:null}}function I(e){return e.isWGS84||e.isWebMercator||n(e)||!t(e)}const L={force512VTL:!1};function R(e){return`[`+e[0]+`,`+e[1]+`,`+e[2]+`]`}function z(e){return`(`+e[0]+`,`+e[1]+`,`+e[2]+`)`}function B(e,t,n=Z){return Math.abs(e-t)<n}function V(e){return e===1?5:e===7?3:e===5?1:7}function H(e){return e===0?4:e===2?6:e===4?0:2}function U(e){return e===7||e===5}function W(e){return e===7||e===1}function G(e){return e===7||e===6||e===5}function K(e){return e===1||e===2||e===3}function q(e){return e===3||e===4||e===5}function J(e){return e===1||e===0||e===7}const Y=[0,2,4,6],X=[1,3,5,7],Z=1e-5;export{B as almostEquals,N as checkIfTileInfoSupportedForView,h as enableInternalTerrainChecks,f as enableTerrainInternalChecks,m as enableTerrainWaterproofChecks,p as enableWaterproofTests,Z as eps,F as getTileInfoAndExtentFromWMTSLayer,P as getTiledLayerInfo,g as internalAssert,w as isBlendableLayerView,K as isEast,S as isElevationLayerView,C as isGroupLayerView,A as isImageSourceRenderInfo,v as isImageryTileLayerView,D as isImageryTileRenderInfo,T as isMapTileLayerView,J as isNorth,W as isNorthCorner,_ as isProjectableRasterLayer,q as isSouth,E as isSurfaceLayerView,k as isTextureTileRenderInfo,y as isTileLayerView,b as isVectorTileLayerView,j as isVectorTilePerLayerInfo,O as isVectorTileRenderInfo,x as isWMTSLayerView,G as isWest,U as isWestCorner,R as lij2s,X as neighborCornerIndices,Y as neighborEdgeIndices,V as oppositeCorner,H as oppositeEdge,M as releaseTerrainData,L as test,z as v32s,I as vtlAssumes256PixelSizeAsDefault,d as weakAssert};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{remove as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as n}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{getEmissions as i}from"./emissive/emissions.js";import{DepthRange as a}from"../lib/DepthRange.js";class o{constructor(e){this.context=e,this._renderPlugins=[],this._slots=[],this._version=r(0);for(let e=0;e<20;++e)this._slots[e]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,r){let i=()=>{if(r?.aborted)throw e.uninitializeRenderContext(),n();this._renderPlugins.push(e),e.produces.forEach((t,n)=>this._slots[n].push(e)),this.context.requestRender(),this._version.value++},a=e.initializeRenderContext(this.context,r);if(t(a))return a.then(i);i()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if(process.env.NODE_ENV===`test`&&this._renderPlugins.some(e=>e.testsTransparentRenderOrder!==0))for(let t of e)this._slots[t].sort((e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(n=>t=n.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;let t=this.context.renderContext.bind.slot;for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){let t=this.context.renderContext.bind.slot,n=this.context.renderContext.output;this._slots[t].forEach(r=>{if(!r.produces.get(t)?.(n)||r.isDecoration&&!this.context.renderContext.bind.decorations)return;let i=r.acquireTechniques(this.context.renderContext);i&&e(r,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,n)=>t.union(n.queryDepthRange?.(e)),new a)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(n=>{let r=n.produces.get(t);return r?r(e):!1}))}hasHighlight(e){return s.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get emissions(){return i(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const s=[2,4,18,12,13,14];export{o as RenderPluginManager};
|
|
@@ -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/PooledArray.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as s}from"../blit/Blit.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[a.OCCLUDED]},this.produces=a.OCCLUDED,this._blit=new s(e.view.stage.renderView.techniques,2)}precompile(){let e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,f)})}render(){let e=this.input;return this._renderOccludedAndTransparentStencil(e),this._renderOccludedComposite(e),e}_renderOccludedAndTransparentStencil(e){let t=this.view.stage.renderer,n=u;this._acquirePlugins(n,8),n.length!==0&&(t.renderSlots(n,10),this._renderAndComposite(e,e.getAttachment(c),.5,()=>t.renderSlots(n,11),!1,!1),n.clear())}_renderOccludedComposite(e){let t=this.view.stage.renderer,n=u,r=this._acquirePlugins(n,p);if(n.length===0)return;let i=this._getDepthStencilAttachment(e),a=i.clearStencil;for(let o of f)r&o&&(this._renderAndComposite(e,i.depth,o===16?1:.5,()=>t.renderOccludedSlots(n,o),!0,a),a=!1);i.release(),n.clear()}_acquirePlugins(e,t){let n=this.view.stage.renderer;e.clear();let r=0,i=!1;for(let a of n.plugins.plugins){let n=a.renderOccludedFlags&t;r|=n,n&&(e.push(a),i||=a.testsTransparentRenderOrder!==0)}return i&&e.sort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder),r}_renderAndComposite(e,t,n,r,a,o){let s=this.renderingContext,{width:c,height:l}=e.fbo,u=this.fboCache.acquire(c,l,`tmp color`);u.attachDepth(t),s.bindFramebuffer(u.fbo),s.clearFramebuffer(i,a,o),r(),u.detachDepth(),this._blit.blend(u,e,this.bindParameters,n),u.release()}_getDepthStencilAttachment(e){let{width:t,height:n}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){let e=this.fboCache.acquireDepth(14,t,n,`retained stencil`);return{depth:e,release:()=>e.release(),clearStencil:!0}}let r=this.fboCache.acquire(t,n,`retained stencil`,14);return this.renderingContext.blitFramebuffer(e.fbo,r.fbo,1024),{depth:r.getAttachment(c),release:()=>r.release(),clearStencil:!1}}};e([n()],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),l=e([r(`esri.views.3d.webgl-engine.effects.geometry.RenderOccluded`)],l);const u=new t;function d(){u.prune()}const f=[4,2,16],p=f.reduce((e,t)=>e|t,0);export{l as RenderOccluded,d as cleanupRenderOccluded};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/PooledArray.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as s}from"../blit/Blit.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[a.OCCLUDED]},this.produces=a.OCCLUDED,this._blit=new s(e.view.stage.renderView.techniques,2)}precompile(){let e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,f)})}render(){let e=this.input;return this._renderOccludedAndTransparentStencil(e),this._renderOccludedComposite(e),e}_renderOccludedAndTransparentStencil(e){let t=this.view.stage.renderer,n=u;this._acquirePlugins(n,8),n.length!==0&&(t.renderSlots(n,10),this._renderAndComposite(e,e.getAttachment(c),.5,()=>t.renderSlots(n,11),!1,!1),n.clear())}_renderOccludedComposite(e){let t=this.view.stage.renderer,n=u,r=this._acquirePlugins(n,p);if(n.length===0)return;let i=this._getDepthStencilAttachment(e),a=i.clearStencil;for(let o of f)r&o&&(this._renderAndComposite(e,i.depth,o===16?1:.5,()=>t.renderOccludedSlots(n,o),!0,a),a=!1);i.release(),n.clear()}_acquirePlugins(e,t){let n=this.view.stage.renderer;e.clear();let r=0,i=!1;for(let a of n.plugins.plugins){let n=a.renderOccludedFlags&t;r|=n,n&&(e.push(a),i||=a.testsTransparentRenderOrder!==0)}return i&&(process.env.NODE_ENV===`test`?e.stableSort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder):e.sort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder)),r}_renderAndComposite(e,t,n,r,a,o){let s=this.renderingContext,{width:c,height:l}=e.fbo,u=this.fboCache.acquire(c,l,`tmp color`);u.attachDepth(t),s.bindFramebuffer(u.fbo),s.clearFramebuffer(i,a,o),r(),u.detachDepth(),this._blit.blend(u,e,this.bindParameters,n),u.release()}_getDepthStencilAttachment(e){let{width:t,height:n}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){let e=this.fboCache.acquireDepth(14,t,n,`retained stencil`);return{depth:e,release:()=>e.release(),clearStencil:!0}}let r=this.fboCache.acquire(t,n,`retained stencil`,14);return this.renderingContext.blitFramebuffer(e.fbo,r.fbo,1024),{depth:r.getAttachment(c),release:()=>r.release(),clearStencil:!1}}};e([n()],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),l=e([r(`esri.views.3d.webgl-engine.effects.geometry.RenderOccluded`)],l);const u=new t;function d(){u.prune()}const f=[4,2,16],p=f.reduce((e,t)=>e|t,0);export{l as RenderOccluded,d as cleanupRenderOccluded};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.globalIlluminationDirectFactor=.
|
|
2
|
+
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.globalIlluminationDirectFactor=.55,this.globalIlluminationAmbientFactor=.85,this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,this.highlights=[],this.highlightMixOrigin=n(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{u as BindParameters,l as ViewportSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";class j{constructor(e,n){this._data=e,this.id=u(),this.events=new t,this._parameters={...P,...n},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!d(e.src)&&(e.preload!==`auto`||!e.crossOrigin)&&(e.preload=`auto`,e.crossOrigin=`anonymous`,e.src=e.src,e.paused&&e.autoplay)){let t=[];p(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){
|
|
2
|
+
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";class j{constructor(e,n){this._data=e,this.id=u(),this.events=new t,this._parameters={...P,...n},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!d(e.src)&&(e.preload!==`auto`||!e.crossOrigin)&&(e.preload=`auto`,e.crossOrigin=`anonymous`,e.src=e.src,e.paused&&e.autoplay)){let t=[];p(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){f(e.src)||d(e.src)||e.crossOrigin||(e.crossOrigin=`anonymous`,e.src=e.src)}_createDescriptor(e){let t=new T;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=this._parameters.immutable===!0&&F(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return this._texture!=null}get usedMemory(){return this._texture?.usedMemory||M(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return t==null?(this._texture=new w(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),typeof t==`string`?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):s(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,t):c(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,new Uint8Array(t)):s(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,t):c(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,new Uint8Array(t)):(c(t)||s(t))&&this._parameters.encoding===`image/ktx2`?this._loadFromKTX2(e,t):(c(t)||s(t))&&this._parameters.encoding===`image/x.basis`?this._loadFromBasis(e,t):c(t)?this._loadFromPixelData(e,new Uint8Array(t)):l(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return this._texture==null||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=x(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=g(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>_(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>v(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){C(this._parameters.width>0&&this._parameters.height>0);let n=this._createDescriptor(e);return(n.pixelFormat===6407||n.pixelFormat===6408)&&(n.compress=this._parameters.compressionOptions),n.width=this._parameters.width??0,n.height=this._parameters.height??0,this._texture=new w(e,n,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async n=>{let r=await m(t,{signal:n});return i(n),this._loadFromImage(e,r)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async n=>{let r=await h(t,t.src,!1,n);return i(n),this._loadFromImage(e,r)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(t,n){return this._loadAsync(i=>new Promise((s,c)=>{let l=()=>{n.removeEventListener(`loadeddata`,u),n.removeEventListener(`error`,d),r(f)},u=()=>{n.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),s(this._loadFromImage(t,n)))},d=t=>{l(),c(t||new e(`texture:load-error`,`Failed to load video`))};n.addEventListener(`loadeddata`,u),n.addEventListener(`error`,d);let f=a(i,()=>d(o()))}))}_loadFromImage(e,t){let n=t;n instanceof HTMLVideoElement||(n=S(n,e.parameters));let r=N(n);this._parameters.width=r.width,this._parameters.height=r.height;let i=this._createDescriptor(e);return i.width=r.width,i.height=r.height,i.compress=this._parameters.compressionOptions,this._texture=new w(e,i,n),this._emptyTexture=null,this.events.emit(`loaded`),this._texture}_loadAsync(e){let t=new AbortController;this._loadingController=t;let n=e(t.signal);this._loadingPromise=n;let r=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===n&&(this._loadingPromise=null),this._emptyTexture=null};return n.then(r,r),n}unload(){if(this._texture=n(this._texture),this._emptyTexture=null,this._loadingController!=null){let e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit(`unloaded`)}get parameters(){return this._parameters}}function M(e,t){if(e==null)return 0;if(c(e)||s(e))return t.encoding===`image/ktx2`?y(e,!!t.mipmap):t.encoding===`image/x.basis`?b(e,!!t.mipmap):e.byteLength;let{width:n,height:r}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?N(e):t,i=t.pixelFormat??6408,a=A(i);return(t.mipmap?4/3:1)*n*r*a||0}function N(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const P={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};function F(e){return e!=null&&(E(e)||D(e)||O(e)||k(e))}export{j as ManagedTexture};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as t}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as n
|
|
2
|
+
import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as t}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as n}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{pathNumProfilesPerJoin as i,pathNumJoinSubdivisions as a}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as o,encodeInt16 as s}from"./Normals.js";import{PathEvaluator as c}from"./PathEvaluator.js";import{encodePathVertexInfo as l}from"./PathVertexInfo.js";class u{constructor(o,s,l,u,d){this.path=o,this.profile=s,this.extruder=l,this.cap=u,this._extrusionVertexCount=0,this._extrusionFrameCount=0;let f=this.path.vertices.length-2;this.numExtrusionProfiles=i*f+2,this.numVerticesTotal=s.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;let p=this.cap.numVertices;this.startCapGeometryVertexOffset=this.numVerticesTotal,this.numVerticesTotal+=p,this.endCapGeometryVertexOffset=this.numVerticesTotal,this.numVerticesTotal+=p,this.profileRightAxes=r(this.numExtrusionFrames*2),this.profileUpAxes=r(this.numExtrusionFrames*2);let m=d===1;this.profileRotationFrameUpAxes=m?r(this.numExtrusionFrames*2):null,this.pathMaxStretchDistances=t(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=n(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=e(o.positions,o.offset,o.vertices.length*3);let h=l.join===2;this._numJoinTriangles=s.joinTriangleBudgets[d][l.join];let g=2*s.numSegments*(h?a:1);this._compressed=this._numJoinTriangles<g;let _=2*s.numSegments*(f+1)+this._numJoinTriangles*f;this.vertexIndices=n(_*3+2*this.cap.numIndices,this.numVerticesTotal),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new c(this,s,l,u.type,d)}emitVertexDescriptor(e){let t=this._extrusionVertexCount;this.pathVertexInfos[t]=l(e),++this._extrusionVertexCount}emitExtrusionFrame(e,t){let{frame:n,rotationFrameUp:r,rotationAngle:i,maxStretchDistance:a}=e,c=this._extrusionFrameCount;return o(this.profileRightAxes,c,n.right[0],n.right[1],n.right[2]),o(this.profileUpAxes,c,n.up[0],n.up[1],n.up[2]),this.profileRotations[c]=s(i/Math.PI),this.profileRotationFrameUpAxes&&o(this.profileRotationFrameUpAxes,c,r[0],r[1],r[2]),this.pathMaxStretchDistances[c]=a,this.framePositionIndices[c]=t,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;let{vertices:e}=this.path,{profile:t}=this;this._updatePositions();for(let t=0;t<e.length;++t)this.emitExtrusionFrame(e[t],t);for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:0,type:1,capSide:0});let n=(e,t,n)=>{this.emitVertexDescriptor({frameIndex:e,sourceIndex:t,subdivision:n,type:0,capSide:0})};for(let t=1;t<e.length-1;++t)this.extruder.extrude(t,this.profile,n);let r=e.length-1;for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:t,type:n,capSide:0})),this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:t,type:n,capSide:1}))}_updatePositions(){let{positions:e,offset:t,vertices:n}=this.path;if(!Array.isArray(e))return;let r=n.length*3,i=this.positions;for(let n=0;n<r;++n)i[n]=e[t+n]}_buildTopology(){let e=this.profile.vertices.length*(this.numExtrusionProfiles-1),{vertexIndices:t}=this,n=0,r=(e,r,i)=>{t[n++]=e,t[n++]=r,t[n++]=i};this.extruder.buildTopology(this.path,this.profile,0,this.profileRotationFrameUpAxes!=null,this._compressed,this._numJoinTriangles,(e,t)=>{for(let n=0;n<this.profile.numSegments;++n){let i=this.profile.indices[n*2],a=this.profile.indices[n*2+1];r(e+i,t+i,t+a),r(e+i,t+a,e+a)}},r),this.cap.buildTopology(r,0,this.startCapGeometryVertexOffset,0),this.cap.buildTopology(r,1,this.endCapGeometryVertexOffset,e)}onPathChanged(){this._rebuildGeometry(),this._buildTopology()}}export{u as PathBuilder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class n{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return
|
|
2
|
+
import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class n{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return(this._profile.numSegments-1)*3}rebuildCapGeometry(e){let t=this._profile;for(let n=0;n<t.vertices.length;++n)e(n,0,2)}buildTopology(e,t,n){let r=this._profile,i=n+r.indices[0],a=t===1;for(let t=1;t<r.numSegments;++t){let o=r.indices[t*2],s=r.indices[t*2+1],c=n+o,l=n+s;a?e(l,c,i):e(i,c,l)}}}class r{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0,n=this._profile;t+=n.numSegments*2*(e-1);for(let e=0;e<n.numSegments;++e){let r=n.indices[e*2],i=n.indices[e*2+1];n.poleIndices[r]===n.poleIndices[i]?t+=1:t+=2}return t*3}rebuildCapGeometry(t){let n=this._profile;for(let e=0;e<n.poles.length;++e)t(e,0,2);if(this._breakNormals)for(let e=0;e<n.vertices.length;++e)t(e,0,1);for(let r=0;r<e-1;++r)for(let e=0;e<n.vertices.length;++e)t(e,r,3)}buildTopology(t,n,r,i){let a=this._profile,o=this._breakNormals?r+a.poles.length:i,s=this._breakNormals?r+a.poles.length+a.vertices.length:r+a.poles.length,c=n===1;for(let n=0;n<a.numSegments;++n){let i=a.indices[n*2],l=a.indices[n*2+1],u=r+a.poleIndices[i],d=r+a.poleIndices[l],f=o+i,p=o+l;for(let n=0;n<e-1;++n){let e=s+n*a.vertices.length+i,r=s+n*a.vertices.length+l;c?(t(e,p,f),t(p,e,r)):(t(f,p,e),t(r,e,p)),f=e,p=r}c?(t(u,p,f),u!==d&&t(u,d,p)):(t(f,p,u),u!==d&&t(p,d,u))}}}export{t as NoCapBuilder,r as RoundCapBuilder,n as TriangulationCapBuilder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as o,length as s,scale as c,set as l,dot as u,add as d,subtract as f,normalize as p,transformMat2 as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{
|
|
2
|
+
import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as o,length as s,scale as c,set as l,dot as u,add as d,subtract as f,normalize as p,transformMat2 as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as _,set as v,transformQuat as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumJoinSubdivisions as x,pathNumRoundCapExtrusionSubdivisions as S}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decodeInt16 as C,decompressNormal as w}from"./Normals.js";import{PathFrame2D as T}from"./PathFrame2D.js";import{constructPathRotationRight as E,isOuterJoinVertex as D}from"./pathGeometryUtils.js";import{decodePathVertexInfo as O}from"./PathVertexInfo.js";class k{constructor(e,t,n,r,i){this.builder=e,this.profile=t,this.extruder=n,this.capType=r,this.upVectorAlignment=i}evaluateVertexPosition(e,t,n,r){let{framePositionIndices:i,positions:f}=this.builder,p=H;this._evaluateExtrudedVertex(p,n);let m=I,h=0,g=p.frameIndex,y=p.frame.right,b=p.frame.up,x=i[g]*3,S=a(L,p.profileVertex,t);if(p.isCap)_(m,b,y),h=p.capPositionOffset*t[0];else{let e=R,n=z;o(e,p.rotationRight);let r=p.maxDistance;a(e,e,t);let i=s(e);i>0?c(e,e,1/i):l(e,0,0);let f=u(S,e);if(Math.abs(f)>r){l(n,-e[1],e[0]);let t=u(S,n);c(e,e,r*Math.sign(f)),c(n,n,t),d(S,e,n)}v(m,0,0,0)}let C=y[0]*S[0]+b[0]*S[1],w=y[1]*S[0]+b[1]*S[1],T=y[2]*S[0]+b[2]*S[1],E=r*3;e[E]=f[x]+C+m[0]*h,e[E+1]=f[x+1]+w+m[1]*h,e[E+2]=f[x+2]+T+m[2]*h}_evaluateExtrudedVertex(e,t){let{profileRotations:n,profileUpAxes:i,profileRightAxes:a,profileRotationFrameUpAxes:s,pathMaxStretchDistances:l,pathVertexInfos:u}=this.builder,{extruder:m,profile:g,upVectorAlignment:_}=this,{cutoffAngle:v,join:b}=m,T=A[_],k=this.upVectorAlignment===1,P=O(u[t]),I=P.frameIndex;e.frameIndex=I;let L=C(n[I])*Math.PI,R=l[I];switch(w(e.frame.right,a,I),w(e.frame.up,i,I),e.maxDistance=0,P.type){case 0:{e.isCap=!1;let t=g.vertices[P.sourceIndex],n=Math.abs(L)>=v,i=k?w(B,s,I):e.frame.up,a=E(F,e.frame,i,k),c=D(t,a,L);if(n&&c){o(e.profileVertex,t);let n=b===2?(-.5+P.subdivision/x)*L:(-.5+Math.floor(P.subdivision/2))*L;n!==0&&(r(V,i,n),k&&y(e.frame.up,e.frame.up,V),y(e.frame.right,e.frame.right,V))}else{let n=T(N,t,L,a);o(e.profileVertex,n)}o(e.rotationRight,c?h:a),e.maxDistance=c?0:R;break}case 1:{e.isCap=!0;let t=g.vertices[P.sourceIndex];switch(o(e.profileVertex,t),this.capType){case 0:case 1:case 3:e.capPositionOffset=0;break;case 2:e.capPositionOffset=j(P)?.5:-.5}break}case 2:{e.isCap=!0;let t=j(P)?1:-1;switch(this.capType){case 1:case 2:{let n=g.vertices[P.sourceIndex],r=this.capType===2?t*.5:0;o(e.profileVertex,n),e.capPositionOffset=r;break}case 3:{let n=t*.5,r=g.poles[P.sourceIndex],i=r.position;r.normal,o(e.profileVertex,i),e.capPositionOffset=n;break}}break}case 3:{e.isCap=!0;let t=(j(P)?1:-1)*.5,n=(1-(P.subdivision+1)/S)*Math.PI*.5,r=Math.sin(n),i=Math.cos(n),a=g.poleIndices[P.sourceIndex],s=g.poles[a],l=s.position,u=s.normal,m=g.vertices[P.sourceIndex];f(N,m,l),c(N,N,r),u?(d(N,N,l),o(e.profileVertex,N),e.capPositionOffset=t*i):(p(M,N),c(M,M,r),d(N,N,l),o(e.profileVertex,N),e.capPositionOffset=t*i);break}default:P.type}}}const A={0:(t,n,r)=>{if(Math.abs(r)<=0)return n;let i=e(Math.cos(.5*r));return l(t,(1+(i-1))*n[0],n[1])},1:(n,r,i,a)=>{if(Math.abs(i)===0)return r;let o=e(Math.cos(.5*i)),s=t(P,1+(o-1)*a[0]*a[0],(o-1)*a[0]*a[1],(o-1)*a[0]*a[1],1+(o-1)*a[1]*a[1]);return m(n,r,s)}};function j(e){return e.capSide===1}const M=g(),N=g(),P=n(),F=g(),I=b(),L=g(),R=g(),z=g(),B=b(),V=i(),H={profileVertex:g(),rotationRight:g(),maxDistance:0,capPositionOffset:0,isCap:!1,frame:new T,frameIndex:0};export{k as PathEvaluator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumProfilesPerJoin as t,pathNumJoinSubdivisions as n}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{constructPathRotationRight as r,needsJoinSubdivisions as i}from"./pathGeometryUtils.js";class a{constructor(e){this.join=e,this.cutoffAngle=this.join===0?.8*Math.PI:0}extrude(e,n,r){for(let i=0;i<t;++i)for(let t=0;t<n.vertices.length;++t)r(e,t,i)}buildTopology(e,t,n,r,i,a,o,s){i?this._buildCompressedTopology(e,t,n,r,a,o,s):this._buildFixedTopology(e,t,n,o)}_buildCompressedTopology(e,r,i,a,o,s,c){let l=r.vertices.length,u=this.join===2?n:1,d=Array(l).fill(!1),f=i;for(let i=1;i<e.vertices.length-1;++i){let p=l*(1+(i-1)*t);s(f,p),this._classifyJoinVertices(e.vertices[i],r,a,d);let m=o-r.indices.reduce((e,t)=>e+(d[t]?0:u),0);this._emitCompressedJoinTopology(r,p,d,c);for(let e=0;e<m;++e)c(p,p,p);f=p+n*l}let p=l*(1+(e.vertices.length-2)*t);s(f,p)}_buildFixedTopology(e,r,i,a){let o=r.vertices.length,s=this.join===2,c=+!s,l=s?n:2,u=i;for(let r=1;r<e.vertices.length-1;++r){let e=o*(1+(r-1)*t);a(u,e);for(let t=c;t<l;++t){let n=e+t*o;a(n,n+o)}u=e+n*o}let d=o*(1+(e.vertices.length-2)*t);a(u,d)}_classifyJoinVertices(e,t,n,a){let s=e.rotationAngle,c=r(o,e.frame,e.rotationFrameUp,n);for(let e=0;e<a.length;++e){let n=t.vertices[e];a[e]=!i(n,c,s)}}_emitCompressedJoinTopology(e,t,r,i){let a=e.vertices.length,o=this.join===2,s=+!o,c=o?n:2;for(let n=0;n<e.numSegments;++n){let o=e.indices[n*2],l=e.indices[n*2+1];if(!(r[o]&&r[l]))for(let e=s;e<c;++e){let n=t+e*a,s=n+a,c=n+o,u=s+o,d=s+l,f=n+l;r[o]||i(c,u,d),r[l]||i(c,d,f)}}}}const o=e();export{a as PathExtruder};
|