@arcgis/core 5.2.0-next.47 → 5.2.0-next.49
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/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.d.ts +33 -0
- package/applications/Components/OrientedImageryViewer/PanoramicViewer/utils.js +2 -0
- package/arcgisGlobal.d.ts +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +1 -0
- package/assets/esri/core/workers/chunks/031ccf2e1583beebdf24.js +1 -0
- package/assets/esri/core/workers/chunks/0474af7687466d8befd2.js +1 -0
- package/assets/esri/core/workers/chunks/{2a4868acd546312aa6d8.js → 05f6887805d92da03122.js} +1 -1
- package/assets/esri/core/workers/chunks/069b6d8bdb34ee88d437.js +1 -0
- package/assets/esri/core/workers/chunks/{f9b2727b41943d83d4ca.js → 0a413d917f3d19440fc1.js} +1 -1
- package/assets/esri/core/workers/chunks/0b2ca406761c63529a6a.js +1 -0
- package/assets/esri/core/workers/chunks/{68f7eaa3122de7c00adb.js → 0ea374f7b16745b9bbc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{c369d4266f38e9ea6592.js → 1119a33245138e7b3914.js} +1 -1
- package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +1 -0
- package/assets/esri/core/workers/chunks/172571397c66f992d08c.js +1 -0
- package/assets/esri/core/workers/chunks/18edf2846d7546285e5e.js +1 -0
- package/assets/esri/core/workers/chunks/1b0557fcb058fc450230.js +1 -0
- package/assets/esri/core/workers/chunks/{98f575c038da74ced2a6.js → 1bc45872d22d61dbd7d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{835643f716f7058a2722.js → 1cf8fb704c48ac3d3b15.js} +1 -1
- package/assets/esri/core/workers/chunks/25cb56c3b538d00e7693.js +1 -0
- package/assets/esri/core/workers/chunks/{4d4710d57c72ec75cccc.js → 26f1fd3f2be5102aae1d.js} +1 -1
- package/assets/esri/core/workers/chunks/285a5bd708f0fe1c620c.js +1 -0
- package/assets/esri/core/workers/chunks/{7777a79f26a06a6c5240.js → 304a22c580ce103480cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{383392c63202ac044b6c.js → 33bd9785bd0b6ccef21b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c0d92c0e3511775401a.js → 35cbf00f0c37a86517af.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f19bc532be24ca64755.js → 36fe6adf6517d8f80125.js} +1 -1
- package/assets/esri/core/workers/chunks/382d9491c2a56c1925fe.js +1 -0
- package/assets/esri/core/workers/chunks/3af2b9d6d5466cb2b957.js +256 -0
- package/assets/esri/core/workers/chunks/{b3cd17daf5a297b96705.js → 3bc2943035391b44d4cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{d36f17d32c654b1ac7fa.js → 3f1a7f8a9ead64bf0b7b.js} +1 -1
- package/assets/esri/core/workers/chunks/40f7bb0ebd918d76f078.js +1 -0
- package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +1 -0
- package/assets/esri/core/workers/chunks/{821176ee3be724621bb0.js → 461c2de938bf4c9b1442.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc637aec16918052548e.js → 47af3525396f890f2a6b.js} +1 -1
- package/assets/esri/core/workers/chunks/4ee7232ea41fa41c5ed4.js +29 -0
- package/assets/esri/core/workers/chunks/4ee900e5dbb130fa0c7b.js +1 -0
- package/assets/esri/core/workers/chunks/50674ba5f24129d61d89.js +1 -0
- package/assets/esri/core/workers/chunks/547a2fe53139f705f95e.js +1 -0
- package/assets/esri/core/workers/chunks/5ce09c4d06e98b1e9251.js +1 -0
- package/assets/esri/core/workers/chunks/5dbd28fce73751d2d1aa.js +1 -0
- package/assets/esri/core/workers/chunks/5ec8b02e097cf6718462.js +1 -0
- package/assets/esri/core/workers/chunks/5f54d927dc77e92cf145.js +1 -0
- package/assets/esri/core/workers/chunks/63e3d338751240479335.js +1 -0
- package/assets/esri/core/workers/chunks/69b9a327f23e052fced7.js +1 -0
- package/assets/esri/core/workers/chunks/6c2b5087a9df65267f4e.js +1 -0
- package/assets/esri/core/workers/chunks/6ccd5fa5e35dc70fcd5d.js +1 -0
- package/assets/esri/core/workers/chunks/6e520ef645c5edcd499a.js +1 -0
- package/assets/esri/core/workers/chunks/7659391f952d134164cf.js +1 -0
- package/assets/esri/core/workers/chunks/78add8e6b54b51eaa299.js +1 -0
- package/assets/esri/core/workers/chunks/{2b669473aa2c7cfb63c7.js → 7b0ed52363704cfce129.js} +1 -1
- package/assets/esri/core/workers/chunks/7b61f56d0f766421eaef.js +1 -0
- package/assets/esri/core/workers/chunks/7f2f2a92dce3f68e579b.js +1 -0
- package/assets/esri/core/workers/chunks/801a664f21e0218bc705.js +1 -0
- package/assets/esri/core/workers/chunks/{8f9fb4e8a7d73db41664.js → 851bcc75acac4a2f199b.js} +1 -1
- package/assets/esri/core/workers/chunks/{6010b7be978698a642d0.js → 8977c85aecc7e08ab13c.js} +1 -1
- package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +1 -0
- package/assets/esri/core/workers/chunks/8d21e2dabc5165f1c8ca.js +1 -0
- package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +1 -0
- package/assets/esri/core/workers/chunks/{f2adf1227a795604d3b8.js → 90ae80b797642bff0efa.js} +1 -1
- package/assets/esri/core/workers/chunks/{71ce1009dadcae8f8094.js → 95b3b8fe45ef4ac6b277.js} +1 -1
- package/assets/esri/core/workers/chunks/96cec8a02ca96175d602.js +1 -0
- package/assets/esri/core/workers/chunks/99eccf9ce53582cfa5b5.js +1 -0
- package/assets/esri/core/workers/chunks/9b7cb96acea388d86fa4.js +1 -0
- package/assets/esri/core/workers/chunks/{dee4019338a79c1ecd26.js → 9d0a9d465ec3a8ba1ed2.js} +1 -1
- package/assets/esri/core/workers/chunks/9e474465d069cb9e94f5.js +1 -0
- package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +1 -0
- package/assets/esri/core/workers/chunks/{ae9f9e975d7a9d442fa5.js → ab5aa4280ed0cb7fcbe9.js} +1 -1
- package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +1 -0
- package/assets/esri/core/workers/chunks/{ee58f4bbc0a1f7d03df0.js → b32ede7805c7c6644e4c.js} +1 -1
- package/assets/esri/core/workers/chunks/b49952541d189b4b9f7e.js +1 -0
- package/assets/esri/core/workers/chunks/b8bdacebd4d24ba90f3f.js +1 -0
- package/assets/esri/core/workers/chunks/{85cd0cd721b27c497b18.js → baac90da0703891d59c4.js} +1 -1
- package/assets/esri/core/workers/chunks/bb552089b34d6811fb03.js +1 -0
- package/assets/esri/core/workers/chunks/cd1f1a72483b7c80bd9a.js +1 -0
- package/assets/esri/core/workers/chunks/{744f34e379484e63277c.js → cdb331b58e22f8c1c988.js} +2 -2
- package/assets/esri/core/workers/chunks/{b23d1e10fc4161d1f3eb.js → d021775cf747556660a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{728ea88e7d4733230e1f.js → d1af0bd611a3dc549858.js} +85 -81
- package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +1 -0
- package/assets/esri/core/workers/chunks/d49e42f36bc3dc256b9f.js +1 -0
- package/assets/esri/core/workers/chunks/d560ed96dde5ca3a5583.js +1 -0
- package/assets/esri/core/workers/chunks/dc1787d88b11ed985159.js +1 -0
- package/assets/esri/core/workers/chunks/{399e23d777a043efa9f1.js → dd95f50dac3f33cdb6d2.js} +1 -1
- package/assets/esri/core/workers/chunks/ddb92c815d17c67a45e6.js +1 -0
- package/assets/esri/core/workers/chunks/{7c2784ebbe17d79f669c.js → de50a19944617cd426b8.js} +1 -1
- package/assets/esri/core/workers/chunks/{52efa4ded11c1e71f04f.js → e2e2162adbfb9b46bede.js} +1 -1
- package/assets/esri/core/workers/chunks/e4353f0792f45aa6a62f.js +1 -0
- package/assets/esri/core/workers/chunks/eac8cae89da9ce2f4946.js +1 -0
- package/assets/esri/core/workers/chunks/edf87407dd20685c82ab.js +1 -0
- package/assets/esri/core/workers/chunks/ee7c8a7f384ea6393487.js +705 -0
- package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +1 -0
- package/assets/esri/core/workers/chunks/f244632f7934a4b72c91.js +1 -0
- package/assets/esri/core/workers/chunks/fc639c730115e07a4a1a.js +1 -0
- package/assets/esri/libs/basisu/basis_encoder.wasm +0 -0
- package/assets/esri/libs/basisu/basis_transcoder.wasm +0 -0
- package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
- package/chunks/Component.glsl.js +104 -67
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/LineMarker.glsl.js +31 -31
- package/chunks/RibbonLine.glsl.js +60 -49
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/dxt_encoder.js +1 -1
- package/chunks/vec3.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/Mesh.d.ts +4 -4
- package/geometry/support/MeshMaterialMetallicRoughness.d.ts +13 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/buffer/math/vec3.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/meshUtils.d.ts +33 -5
- package/geometry/support/plane.js +1 -1
- package/kernel.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.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 +2 -0
- package/package.json +2 -2
- package/rest/featureService/FeatureService.d.ts +74 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/ObjectSymbol3DLayer.d.ts +10 -8
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/TextRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/richTextUtils.js +2 -0
- package/symbols/support/ObjectSymbol3DLayerResource.d.ts +9 -4
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/AggregateStrategy.js +2 -0
- package/views/2d/layers/features/processor/bins/BinAdapter.js +2 -0
- package/views/2d/layers/features/processor/bins/BinLevelState.js +2 -0
- package/views/2d/layers/features/processor/bins/BinState.js +2 -0
- package/views/2d/layers/features/processor/bins/createBinningStrategy.js +2 -0
- package/views/2d/layers/features/processor/clusters/ClusterAdapter.js +2 -0
- package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +2 -0
- package/views/2d/layers/features/processor/clusters/ClusterSendState.js +2 -0
- package/views/2d/layers/features/processor/clusters/createClusterStrategy.js +2 -0
- package/views/2d/layers/features/processor/createAggregateStrategy.js +2 -0
- package/views/2d/layers/features/processor/tracks/Track.js +2 -0
- package/views/2d/layers/features/processor/tracks/TrackAdapter.js +2 -0
- package/views/2d/layers/features/processor/tracks/TrackLevelState.js +2 -0
- package/views/2d/layers/features/processor/tracks/TrackSendState.js +2 -0
- package/views/2d/layers/features/processor/tracks/createTrackStrategy.js +2 -0
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +36 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +19 -20
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +17 -10
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCacheStore.js +2 -0
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +8 -5
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.d.ts +63 -0
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.d.ts +66 -0
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +0 -10
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector3D/selectorUtils.js +2 -0
- package/assets/esri/core/workers/chunks/0115681a3de6df0aebdf.js +0 -1
- package/assets/esri/core/workers/chunks/025caafc70ac26f0a4ed.js +0 -1
- package/assets/esri/core/workers/chunks/08e18fb12533fc76e49c.js +0 -1
- package/assets/esri/core/workers/chunks/0e64e20fedfe01a1985f.js +0 -1
- package/assets/esri/core/workers/chunks/0f674c625f24ac73e25a.js +0 -1
- package/assets/esri/core/workers/chunks/15351354afcbf840a23d.js +0 -29
- package/assets/esri/core/workers/chunks/176c5eaaa23a479c88e0.js +0 -1
- package/assets/esri/core/workers/chunks/1d1f5578c7d8619f7a46.js +0 -1
- package/assets/esri/core/workers/chunks/1f118d85d8271ad7690b.js +0 -1
- package/assets/esri/core/workers/chunks/2015f4def2ef201bdab8.js +0 -1
- package/assets/esri/core/workers/chunks/268637fd6c50264acfc3.js +0 -1
- package/assets/esri/core/workers/chunks/272c8ab189217240d05f.js +0 -1
- package/assets/esri/core/workers/chunks/296fa9fb80e521c30cb1.js +0 -1
- package/assets/esri/core/workers/chunks/354199a41de44902de84.js +0 -1
- package/assets/esri/core/workers/chunks/384b619854ef8a3f6e94.js +0 -1
- package/assets/esri/core/workers/chunks/3af923abeb6e65c4468f.js +0 -1
- package/assets/esri/core/workers/chunks/46d3ddf62fa7a76dd57d.js +0 -1
- package/assets/esri/core/workers/chunks/4b24f72b56edc28bb15e.js +0 -1
- package/assets/esri/core/workers/chunks/4f09f208ece2ec1db727.js +0 -1
- package/assets/esri/core/workers/chunks/57374213084bef59b776.js +0 -1
- package/assets/esri/core/workers/chunks/5f9c4dad6952c4c58ebf.js +0 -1
- package/assets/esri/core/workers/chunks/706230b70a36d2e038f7.js +0 -1
- package/assets/esri/core/workers/chunks/7cc729b57a6a52c8ac68.js +0 -1
- package/assets/esri/core/workers/chunks/8026cc0065f6520c4161.js +0 -1
- package/assets/esri/core/workers/chunks/804ab5f614efa12a131b.js +0 -1
- package/assets/esri/core/workers/chunks/81d55594cee124040565.js +0 -1
- package/assets/esri/core/workers/chunks/8d21f3d6edbcd7b335d0.js +0 -1
- package/assets/esri/core/workers/chunks/8d90bef1091204fba0f1.js +0 -1
- package/assets/esri/core/workers/chunks/8ec5e470583b75fceae1.js +0 -1
- package/assets/esri/core/workers/chunks/9114a575b78a7ea18d0f.js +0 -1
- package/assets/esri/core/workers/chunks/93e705c1147cc8ceca02.js +0 -1
- package/assets/esri/core/workers/chunks/9a97f6cda2f36941efae.js +0 -1
- package/assets/esri/core/workers/chunks/9ceeae787dc7c194d60e.js +0 -1
- package/assets/esri/core/workers/chunks/a8033e606b2db1ee332d.js +0 -1
- package/assets/esri/core/workers/chunks/a90f7b1c6c69b6033b4c.js +0 -1
- package/assets/esri/core/workers/chunks/a9c641bcdef161c754bf.js +0 -1
- package/assets/esri/core/workers/chunks/ad5c2b0de6713d0a93a4.js +0 -680
- package/assets/esri/core/workers/chunks/ae50b2d5e63f62c088d2.js +0 -1
- package/assets/esri/core/workers/chunks/aea247138617e12b699b.js +0 -1
- package/assets/esri/core/workers/chunks/b03dcf3d55266745f3d1.js +0 -1
- package/assets/esri/core/workers/chunks/b32bdf5730953c2fb16b.js +0 -1
- package/assets/esri/core/workers/chunks/bf287f0e2ecb4532dc00.js +0 -1
- package/assets/esri/core/workers/chunks/c01a121ebe571a848452.js +0 -1
- package/assets/esri/core/workers/chunks/c3cd38ca8690286d40d7.js +0 -1
- package/assets/esri/core/workers/chunks/c4b13124a9cfc78c42a6.js +0 -261
- package/assets/esri/core/workers/chunks/c5e36544b2d1792e4c5f.js +0 -1
- package/assets/esri/core/workers/chunks/c6042825f61cd70d54d8.js +0 -1
- package/assets/esri/core/workers/chunks/cba3316910ff088f4d77.js +0 -1
- package/assets/esri/core/workers/chunks/d8b67ca02cdc1e8191e3.js +0 -1
- package/assets/esri/core/workers/chunks/dadefe369f49e89a2610.js +0 -1
- package/assets/esri/core/workers/chunks/db416ba3132034e20642.js +0 -1
- package/assets/esri/core/workers/chunks/de9573871f64c01e9f01.js +0 -1
- package/assets/esri/core/workers/chunks/dfbdc72c7ea137e3841d.js +0 -1
- package/assets/esri/core/workers/chunks/e3e966777f18164afcd8.js +0 -1
- package/assets/esri/core/workers/chunks/e9c48630757bea465b7e.js +0 -1
- package/assets/esri/core/workers/chunks/f2c8122d31aedc2604ee.js +0 -1
- package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +0 -1
- package/assets/esri/core/workers/chunks/ff089723a27859fe18d1.js +0 -1
- package/chunks/Zlib.js +0 -2
- package/views/2d/layers/features/processor/AAggregateStrategy.js +0 -2
- package/views/2d/layers/features/processor/BinningStrategy.js +0 -2
- package/views/2d/layers/features/processor/ClusterStrategy.js +0 -2
- package/views/2d/layers/features/processor/TrackStrategy.js +0 -2
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +0 -2
- /package/assets/esri/core/workers/chunks/{744f34e379484e63277c.js.LICENSE.txt → cdb331b58e22f8c1c988.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/PooledArray.js";import{multiply as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as
|
|
2
|
+
import e from"../../../../core/PooledArray.js";import{multiply as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4Z as n,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{lerp as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustum.js";import{Sphere as h}from"../../../../geometry/support/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{DepthRange as c}from"./DepthRange.js";import{assert as u}from"./Util.js";const d=1e4,l=100,m=500,g=500,_=.1;function p(e,t,r,n){let i=0;if(!t.some(e=>!!e.material&&(i+=e.numGeometries,i>=d)))return W.compute(e,t,n);const a=new c;return r.forEach(t=>a.union(b(e,t))),a}function b(e,t){if(!t.visible)return;const r=new c,n=t.getSpatialQueryAccelerator();return n?w(r,e,n):j(r,e,t.objects),r}function w(e,t,r){const{eye:n,viewForward:i,frustum:a}=t,s=e=>e.visible,o=r.objectCount;if(o<m)E.set(t.near,Math.min(e.near,t.far)),r.forEachInDepthRange(n,i,1,E,(r,n)=>{x(e,t,r),E.far=e.near,n.setRange(E)},a,s),E.set(Math.max(e.far,t.near),t.far),r.forEachInDepthRange(n,i,-1,E,(r,n)=>{x(e,t,r),E.near=e.far,n.setRange(E)},a,s);else{const n=Math.max(Math.min(o,g),Math.ceil(o*_)),h=r.findClosest(i,1,a,s,n),f=r.findClosest(i,-1,a,s,n);h&&f&&(v(e,t,h.boundingVolumeWorldSpace.bounds),v(e,t,f.boundingVolumeWorldSpace.bounds))}}function j(e,t,r){F.clear(),r.forEach(e=>{e.visible&&0!==e.geometries.length&&F.add(e,t)}),F.empty||(F.sort(),E.set(t.near,Math.min(e.near,t.far)),F.forEachInDepthRange(E,1,(r,n)=>{n<e.near&&x(e,t,r)}),E.set(Math.max(e.far,t.near),t.far),F.forEachInDepthRange(E,-1,(t,r,n)=>{e.far=Math.max(e.far,n)}))}function x(e,r,n){if(!n.visible)return;if(!o(r.frustum,n.boundingVolumeWorldSpace.bounds))return;const i=n.transformation,a=D;n.geometries.forEach(n=>{t(a,i,n.transformation);const s=f(a);R(e,r,n.boundingInfo,a,s)})}function R(e,t,r,n,a){if(null==r)return;i(A.center,r.boundingSphere.center,n);const{eye:s,viewForward:h}=t,f=h[0]*(A.center[0]-s[0])+h[1]*(A.center[1]-s[1])+h[2]*(A.center[2]-s[2]);if(A.radius=r.boundingSphere.radius*a,!(f-A.radius>e.near&&f+A.radius<e.far)&&o(t.frustum,A))if(r.boundingSphere.radius>l&&r.children)for(const i of r.children)R(e,t,i,n,a);else N.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,n,r.boundingBox)}function v(e,t,r){const n=t.eye,i=t.viewForward,a=(r.center[0]-n[0])*i[0]+(r.center[1]-n[1])*i[1]+(r.center[2]-n[2])*i[2];e.near=Math.min(e.near,a-r.radius),e.far=Math.max(e.far,a+r.radius)}class M{constructor(){this._items=new e({allocator:e=>e||{object:null,distance:0,near:0,far:0},deallocator:e=>(e.object=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return 0===this._items.length}clear(){this._items.clear()}add(e,t){const r=t.eye,n=t.viewForward,i=e.boundingVolumeWorldSpace.bounds,a=(i.center[0]-r[0])*n[0]+(i.center[1]-r[1])*n[1]+(i.center[2]-r[2])*n[2];if(!Number.isFinite(a))return;const s=this._items.pushNew();s.object=e,s.distance=a,s.near=a-i.radius,s.far=a+i.radius}sort(){this._items.sort((e,t)=>e.distance-t.distance)}forEachInDepthRange(e,t,r){if(1===t)for(let n=0;n<this._items.length;++n){const t=this._items.data[n];t.far<e.near||t.near>e.far||r(t.object,t.near,t.far)}else for(let n=this._items.length-1;n>=0;--n){const t=this._items.data[n];t.far<e.near||t.near>e.far||r(t.object,t.near,t.far)}}}class B{constructor(){this._geometries=new Array,this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._looseRange=new c(0,0)}compute(e,t,r){this._reset();const{viewMatrix:i}=e;t.forEach(e=>{e.forEachGeometry(e=>{if(!e.visible||0===r&&!e.castShadow)return;const t=e.boundingSphere,a=n(t.center,i),s=a-t.radius,o=a+t.radius;this._geometries.push(e),this._near.push(-o),this._far.push(-s)})});const a=new c;if(0===this._geometries.length)return a;for(let n=0;n<this._geometries.length;++n)this._near[n]>a.far&&(a.far=this._near[n]),this._near[n]>2&&this._far[n]<a.near&&(a.near=this._far[n]);const s=this._looseRange;s.near=Math.max(.5*a.near,2),s.far=2*a.far;let o=0,h=0;for(let n=0;n<this._geometries.length;++n)this._near[n]<a.near&&(this._near[n]>=s.near?a.near=this._near[n]:this._nearCandidates[o++]=n),this._far[n]>a.far&&(this._far[n]<=s.far?a.far=this._far[n]:this._farCandidates[h++]=n);if(0===this._nearCandidates.length&&0===this._farCandidates.length)return a;this._nearCandidates.sort((e,t)=>this._near[e]<this._near[t]?-1:this._near[e]>this._near[t]?1:0),this._farCandidates.sort((e,t)=>this._far[e]<this._far[t]?1:this._far[e]>this._far[t]?-1:0);for(let n=0;n<this._nearCandidates.length;++n){const t=this._nearCandidates[n];if(this._near[t]<a.near){const r=this._geometries[t],{boundingInfo:n,shaderTransformation:i}=r;this._includeNearBoundingInfoRec(e,n,i,a)}}for(let n=0;n<this._farCandidates.length;++n){const t=this._farCandidates[n];if(this._far[t]>a.far){const r=this._geometries[t],{boundingInfo:n,shaderTransformation:i}=r;this._includeFarBoundingInfoRec(e,n,i,a)}}return this._reset(),a}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0}_isOutsideSidePlanes(e,t){const{center:r,radius:n}=e;return t[0][0]*r[0]+t[0][1]*r[1]+t[0][2]*r[2]+t[0][3]>n||t[1][0]*r[0]+t[1][1]*r[1]+t[1][2]*r[2]+t[1][3]>n||t[2][0]*r[0]+t[2][1]*r[1]+t[2][2]*r[2]+t[2][3]>n||t[3][0]*r[0]+t[3][1]*r[1]+t[3][2]*r[2]+t[3][3]>n}_includeNearBoundingInfoRec(e,t,r,a){if(null==t)return;i(A.center,t.boundingSphere.center,r),A.radius=t.boundingSphere.radius*f(r);const{frustum:s}=e;if(this._isOutsideSidePlanes(A,s))return;const o=A.radius,{viewMatrix:h}=e,c=n(A.center,h),u=c+o;if(!(-(c-o)<2||-u>=a.near))if(-u>this._looseRange.near)a.near=-u;else{if(o>l){const n=t.children;if(void 0!==n){for(const t of n)this._includeNearBoundingInfoRec(e,t,r,a);return}}N.unionDepthRangeWithAABB(a,e.viewProjectionMatrix,r,t.boundingBox)}}_includeFarBoundingInfoRec(e,t,r,a){if(null==t)return;i(A.center,t.boundingSphere.center,r),A.radius=t.boundingSphere.radius*f(r);const{frustum:s}=e;if(this._isOutsideSidePlanes(A,s))return;const{viewMatrix:o,viewProjectionMatrix:h}=e,c=n(A.center,o)-A.radius;if(!(-c<=a.far))if(-c<this._looseRange.far)a.far=-c;else{if(A.radius>l){const n=t.children;if(void 0!==n){for(const t of n)this._includeFarBoundingInfoRec(e,t,r,a);return}}N.unionDepthRangeWithAABB(a,h,r,t.boundingBox)}}}class C{constructor(){this._modelViewProj=r(),this._clipPosition=[s(),s(),s(),s(),s(),s(),s(),s()]}unionDepthRangeWithAABB(e,r,n,i){const a=this._modelViewProj;t(a,r,n);let s=!1;for(let t=0;t<8;++t){const e=this._clipPosition[t],r=0===t||3===t||4===t||7===t?i[0]:i[3],n=0===t||1===t||4===t||5===t?i[1]:i[4],s=t<4?i[2]:i[5];e[0]=a[0]*r+a[4]*n+a[8]*s+a[12],e[1]=a[1]*r+a[5]*n+a[9]*s+a[13],e[2]=a[2]*r+a[6]*n+a[10]*s+a[14],e[3]=a[3]*r+a[7]*n+a[11]*s+a[15]}for(let t=0;t<12;++t){const r=S(this._clipPosition[y[t][0]],this._clipPosition[y[t][1]],this._clipPosition[y[t][2]]);let n=!0;for(let e=0;e<r.length;++e){if(r[e][3]>=2){n=!1;break}}if(!n){s=!0;for(let t=0;t<r.length;++t){const n=r[t][3];Number.isFinite(n)&&(e.near=Math.min(n,e.near),e.far=Math.max(n,e.far))}}}return s}}function S(e,t,r){let n=[e,t,r];for(let i=0;i<4;++i){const e=n;n=[];for(let t=0;t<e.length;++t){const r=e[t],a=e[(t+1)%e.length];I(a,i)?(I(r,i)||n.push(P(r,a,i)),n.push(a)):I(r,i)&&n.push(P(r,a,i))}}return n}function I(e,t){return 0===t?e[0]>=-e[3]:1===t?e[1]>=-e[3]:2===t?e[0]<=e[3]:3===t?e[1]<=e[3]:void u(!1)}function P(e,t,r){let n=0;return 0===r?n=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):1===r?n=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):2===r?n=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):3===r&&(n=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),a(s(),e,t,n)}const y=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],A=new h,D=r(),E=new c,F=new M,W=new B,N=new C;export{p as depthRangeFromScene};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{copy as
|
|
2
|
+
import i from"../../../../core/PooledArray.js";import{copy as e,lerp as s,squaredLength as n,dot as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as o,h as r}from"../../../../chunks/boundedPlane.js";import{clipLineSegment as a,create as c,clipPolygon as h,fromValues as f}from"../../../../geometry/support/plane.js";function m(i){return(e,n,t)=>!r(i,s(w,e,n,t))}const p=new i({allocator:i=>i??l()}),u=new i({allocator:i=>i??l()});function*g(i,e){let s=e,n=p,t=u;for(const l of i){if(n.length=0,h(l,s,()=>n.pushNew(),!1),n.length>=3&&(yield n),n.length=0,h(l,s,()=>n.pushNew(),!0),n.length<3)return;s=n,[n,t]=[t,n]}}class _{constructor(i){this._lineRemainingA=y(),this._lineRemainingB=y(),this._lineVisible=y(),this._slicedAwayHalfspaces=b(i),this._slicePlane=o(i)}*processTriangle(i){yield*g(this._slicedAwayHalfspaces,i)}*processLineSegment(i,s,n){let t=this._lineRemainingA,l=this._lineRemainingB;e(t[0],s),e(t[1],n);for(const o of this._slicedAwayHalfspaces){if(a(o,t[0],t[1],this._lineVisible[0],this._lineVisible[1],!1)&&(e(i[0],this._lineVisible[0]),e(i[1],this._lineVisible[1]),yield i),!a(o,t[0],t[1],l[0],l[1],!0))return;[l,t]=[t,l]}}validatePoint(i){return!r(this._slicePlane,i)}}function b(i){const e=[c(i.plane),c(),c(),c(),c()];return d(i.basis1,i.origin,e[1],e[2]),d(i.basis2,i.origin,e[3],e[4]),e}function d(i,e,s,l){const o=n(i),r=t(i,e);f(i[0],i[1],i[2],-r+o,s),f(-i[0],-i[1],-i[2],r+o,l)}function y(){return[l(),l()]}const w=l();export{_ as SliceScreenPolygonPrimitiveProcessor,g as clipPolygonAgainstSlicedAwayHalfspaces,b as createSliceExtrusionHalfspacePlanes,m as sliceFilterPredicate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../../../../core/arrayUtils.js";import{isAborted as o,throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as s,
|
|
2
|
+
import{isSome as e}from"../../../../../core/arrayUtils.js";import{isAborted as o,throwIfAborted as n}from"../../../../../core/promiseUtils.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as s,expandWithAABB as r,center as i,diameter as c}from"../../../../../geometry/support/aaBoundingBox.js";import{getEmissions as u}from"../../effects/emissive/emissions.js";import{LodComponentData as m}from"./LodComponentData.js";class a{static async create(t,s,r){const i=await Promise.allSettled(s.components.map(e=>t.controller.schedule(()=>new m(t,e.geometry),r))),c=i.map(e=>"fulfilled"===e.status?e.value:null).filter(e);if(o(r)||c.length!==i.length){c.forEach(e=>e.destroy()),n(r);for(const e of i)if("rejected"===e.status)throw e.reason}return new a(s.minScreenSpaceRadius,c)}constructor(e,o){this.minScreenSpaceRadius=e,this.components=o}destroy(){this.components.forEach(e=>e.destroy())}intersect(e,o,n,t,s,r,i){this.components.forEach(c=>c.intersect(e,o,n,t,s,r,this.boundingSphere,i))}*intersectScreenPolygon(e,o,n,t,s){for(const r of this.components)r.intersectScreenPolygon(e,o,n,t,this.boundingSphere,s),yield}get boundingBox(){if(null==this._boundingBox){const e=s();this.components.forEach(o=>{const{boundingInfo:n}=o;null!=n&&r(e,n.boundingBox)}),this._boundingBox=e}return this._boundingBox}get boundingSphere(){if(null==this._boundingSphere){const e=this.boundingBox,o=t();i(e,o),this._boundingSphere={center:o,radius:.5*c(e)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((e,o)=>e+o.numTriangles,0)}get emissions(){return u(this.components)}}export{a as LodLevel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{createScreenPointArray as t,createRenderScreenPointArray3 as n}from"../../../../core/screenUtils.js";import{copy as r,set as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i,intersects as s,containsPoint as u,create as f}from"../../../../geometry/support/aaBoundingRect.js";import{create as c,distance2 as p,fromPoints as m}from"../../../../geometry/support/lineSegment.js";import{signedDistance as a,intersectLineSegment as l}from"../../../../geometry/support/plane.js";import{containsPoint2dFromValues as h}from"../../../../geometry/support/triangle.js";function g(t,n){return t.isRectangle?u(t.bounds,n):v(n,t.points)}function M(t,n,r){const o=n[0]-r,e=n[1]-r,u=n[0]+r,f=n[1]+r;if(!s(t.bounds,i(o,e,u,f,A)))return!1;if(g(t,n))return!0;const c=r*r;for(const i of t.points){const t=i[0]-n[0],r=i[1]-n[1];if(t*t+r*r<=c)return!0}for(let i=0;i<t.points.length;i++){if(k(n,t.points[i],t.points[(i+1)%t.points.length])<=c)return!0}return!1}function j(t,n){if(!s(t.bounds,n))return!1;if(t.isRectangle)return!0;for(const r of t.points)if(u(n,r))return!0;for(let r=0;r<4;r++)if(v(z(C,n,r),t.points))return!0;for(let r=0;r<t.points.length;r++){const o=t.points[r],e=r===t.points.length-1?t.points[0]:t.points[r+1];for(let t=0;t<4;t++){if(B(o,e,z(C,n,t),z(D,n,(t+1)%4)))return!0}}return!1}function x(t,n,r,o){const e=Math.min(n[0],r[0],o[0]),s=Math.min(n[1],r[1],o[1]),u=Math.max(n[0],r[0],o[0]),f=Math.max(n[1],r[1],o[1]);if(!j(t,i(e,s,u,f,A)))return!1;if(g(t,n)||g(t,r)||g(t,o))return!0;for(const i of t.points)if(h(n,r,o,i,K))return!0;for(let i=0;i<t.points.length;i++){const e=t.points[i],s=t.points[(i+1)%t.points.length];if(B(n,r,e,s)||B(r,o,e,s)||B(o,n,e,s))return!0}return!1}function d(t,n,r,o){const e=Math.min(n[0],r[0])-o,u=Math.min(n[1],r[1])-o,f=Math.max(n[0],r[0])+o,c=Math.max(n[1],r[1])+o;if(!s(t.bounds,i(e,u,f,c,A)))return!1;if(g(t,n)||g(t,r))return!0;const p=o*o;for(const i of t.points)if(k(i,n,r)<=p)return!0;for(let i=0;i<t.points.length;i++){const o=t.points[i],e=t.points[(i+1)%t.points.length];if(B(n,r,o,e)||U(n,r,o,e)<=p)return!0}return!1}function b(t,n,o,e,i){r(G,n),r(H,o);const s=t.projectToRenderScreen(G,E),u=t.projectToRenderScreen(H,F);if(null==s||null==u)return!1;const f=R(t,G),c=R(t,H);if(f&&c)return!1;if(f!==c){const n=f?G:H,r=f?s:u;if(!S(t,n,f?H:G))return!1;if(!t.projectToRenderScreen(n,r))return!1}return e[0]=s[0],e[1]=s[1],e[2]=0,i[0]=u[0],i[1]=u[1],i[2]=0,!0}function R(t,n){return y(t,n)>0}function y(t,n){return a(t.frustum[4],n)}function S(t,n,r){return T(t,n,r,n)}function T(t,n,r,o){return l(t.frustum[4],m(n,r,J),o)}function v(t,n){let r=!1;for(let o=0,e=n.length-1;o<n.length;e=o++){const i=n[o],s=n[e];if(!(i[1]>t[1]!=s[1]>t[1]))continue;const u=(s[0]-i[0])*(t[1]-i[1])/(s[1]-i[1])+i[0];t[0]<u&&(r=!r)}return r}function B(t,n,r,o){const e=q(t,n,r),i=q(t,n,o),s=q(r,o,t),u=q(r,o,n);return e!==i&&s!==u||(0===e&&w(t,n,r)||0===i&&w(t,n,o)||0===s&&w(r,o,t)||0===u&&w(r,o,n))}function U(t,n,r,o){return B(t,n,r,o)?0:Math.min(k(t,r,o),k(n,r,o),k(r,t,n),k(o,t,n))}function k(t,n,r){return p(m(o(G,n[0],n[1],0),o(H,r[0],r[1],0),J),o(I,t[0],t[1],0))}function q(t,n,r){const o=(n[1]-t[1])*(r[0]-n[0])-(n[0]-t[0])*(r[1]-n[1]);return Math.abs(o)<=K?0:Math.sign(o)}function w(t,n,r){return r[0]>=Math.min(t[0],n[0])-K&&r[0]<=Math.max(t[0],n[0])+K&&r[1]>=Math.min(t[1],n[1])-K&&r[1]<=Math.max(t[1],n[1])+K}function z(t,n,r){return t[0]=0===r||3===r?n[0]:n[2],t[1]=r<2?n[1]:n[3],t}const A=f(),C=t(),D=t(),E=n(),F=n(),G=e(),H=e(),I=e(),J=c(),K=1e-9;export{R as isBehindNearPlane,b as projectWorldLineSegmentToRenderScreen,g as screenPolygonContainsPoint,j as screenPolygonIntersectsBounds,d as screenPolygonIntersectsBufferedSegment,M as screenPolygonIntersectsCircle,x as screenPolygonIntersectsTriangle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{createScreenPointArray as
|
|
2
|
+
import t from"../../../../core/PooledArray.js";import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{copy as o,distance as r,squaredDistance as n,set as i,transformMat4 as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{intersectsTransformedAabb as c}from"../../../../geometry/support/frustum.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as f,closestPointFromValues as p}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as d}from"./intersectionConstants.js";import{screenPolygonIntersectsTriangle as h}from"./screenPolygonOverlapUtils.js";class I{constructor(t){this.primitiveIndex=t}}class g{constructor(t){this.type=t,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=l(),this.normal=l()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(t,e,r,n){this.distance=t,this.primitiveIndex=e,o(this.point,r),this.hasNormal=null!=n,null!=n&&o(this.normal,n)}updateIfCloserFromValues(t,e,o,r){t<this.distance&&this.update(t,e,o,r)}updateIfCloser(t){const{distance:e,primitiveIndex:o,point:r,normal:n}=t;this.updateIfCloserFromValues(e,o,r,t.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function y(t,e,o,r,n){if(!t.visible||0!==t.type)return null;const i=new g(4);let s;if(t.boundingInfo)s=j(t.boundingInfo,e,o,r,n);else{const i=t.positionAttribute,l=t.primitivePositionIndices;s=v(e,o,r,0,l.length/3,l,i.data,i.stride,n,null,0)}for(const l of s)i.updateIfCloser(l);return i.valid?i:null}function b(t,e,o,r,n){const i=new g(4);for(const s of N(t,e,o,r,n))i.updateIfCloser(s);return i.valid?i:null}function*v(t,e,o,r,n,i,s,l,a,u=null,c=0){const m=(t,o,r,n)=>{const m=(u?.[n]??n)+c,f=null==u?m:n,p=3*m;return x(t,i,s,l,p+0,a,f,e),x(o,i,s,l,p+1,a,f,e),x(r,i,s,l,p+2,a,f,e),m};return yield*N(t,o,r,n,m)}function*N(t,e,o,n,i){if(null==t.camera)return;const{camera:s,screenPolygonPrimitiveProcessor:l}=t;for(let a=o;a<n;++a){const t=i(V[0],V[1],V[2],a),o=O;let n;E.reset();const u=w;for(const i of l.processTriangle(V))if(u.length=0,m(s.frustum[4],i,()=>u.pushNew(),!1),!(u.length<3)){for(let t=0;t<u.length;t++)s.projectToScreen(u.at(t),A[t]);P(e,A,u.length)&&(T(s.eye,u,B),null==n&&(n=f(O,V[0],V[1],V[2])),E.updateIfCloserFromValues(r(s.eye,B),t,B,n?o:null))}E.valid&&(yield E)}}function*j(t,e,o,r,n){let i;if(null!=n?(a(F,t.boundingBox),n.applyToAabb(F),i=c(r.broadPhaseFrustum,F,o)):i=c(r.broadPhaseFrustum,t.boundingBox,o),!i)return;const{primitiveIndices:s,position:l}=t,u=s?s.length:l.indices.length/3;if(u>d){const i=t.children;if(void 0!==i){for(const t of i)yield*j(t,e,o,r,n);return}}yield*v(e,o,r,0,u,l.indices,l.data,l.stride,n,s,0)}function x(t,e,o,r,n,l,a,u){const c=r*e[n],m=o[c+0],f=o[c+1],p=o[c+2];null!=l?l.applyToVertex(t,m,f,p,a):i(t,m,f,p),u&&s(t,t,u)}function P(t,e,o){for(let r=1;r<o-1;r++)if(h(t,e[0],e[r],e[r+1]))return!0;return!1}function T(t,e,r){let i=Number.POSITIVE_INFINITY;const s=e.at(0);for(let l=1;l<e.length-1;l++){p(S,t,s,e.at(l),e.at(l+1));const a=n(t,S);a<i&&(i=a,o(r,S))}}const F=u(),C=12,V=[l(),l(),l()],w=new t({allocator:t=>t??l()}),A=Array.from({length:C},()=>e()),B=l(),O=l(),S=l(),E=new g(4);export{I as DrapedHit,g as Hit,v as forEachTriangleRangeScreenPolygonHit,N as forEachTriangleReaderRangeScreenPolygonHit,y as intersectTriangleGeometryScreenPolygon,b as intersectTriangleReaderRangeScreenPolygon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e,subtract as t,add as r,set as s,copy as i,normalize as a,length as o,scale as n,dot as l,transformMat3 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as h,fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as p,getMin as d,setMax as f,getMax as x}from"../../../../geometry/support/aaBoundingBox.js";import{is3DGeometryOrShadowLike as g,isColor as T}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as v}from"../lib/GLTextureMaterial.js";import{Material as S}from"../lib/Material.js";import{intersectTriangleGeometry as b}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as M}from"../lib/screenPolygonTriangleIntersections.js";import{getVerticalOffsetObject3D as y}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as O}from"./DefaultBufferWriter.js";import{intersectWithPolygonOffset as C,applyPolygonOffsetToHit as P}from"./intersectWithPolygonOffset.js";import{verticalOffsetAtDistance as R}from"./internal/MaterialUtil.js";import{getLayout as w,DefaultMaterialPassParameters as j,DefaultMaterialTechnique as V}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as I}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as _}from"../shaders/RealisticTreeTechnique.js";import{hasShadowHighlights as A}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class B extends S{constructor(e,t){super(e,z),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>g(e)&&!this.transparent],[4,e=>g(e)&&this.transparent]]),this._layout=w(this.parameters),this._configuration=new I(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=D}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:s,doubleSided:i,doubleSidedType:a}=t;r.hasVertexTangents=!s&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=s?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!s&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=s?2:i&&"normal"===a?1:i&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,T(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=A(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,r,s,i,a,o){const n=this._getMaterialVerticalOffset(r,s);null!=n&&(i=t(F,i,n),a=t(E,a,n)),o=C(o,this._configuration,i,a),b(e,s,i,a,y(s.verticalOffset),o)}intersectScreenPolygon(e,t,r,s){return P(M(e,r,t,s,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new N(e)}createBufferWriter(){return new O(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:s,texture:i,textureId:a,textureAlphaMode:o,colorMixMode:n}=this.parameters,l=r[3];return e||t<1&&"replace"!==n||l<1&&"ignore"!==n||s<1||(null!=i||null!=a)&&1!==o&&2!==o&&"replace"!==n}_createScreenPolygonVertexDisplacement(e,t){const s=this._getMaterialVerticalOffset(e,t);return null==s?null:{applyToVertex:(e,t,r,i)=>(e[0]=t+s[0],e[1]=r+s[1],e[2]=i+s[2],e),applyToAabb:e=>(p(e,r(W,d(e,W),s)),f(e,r(W,x(e,W),s)),e)}}_getMaterialVerticalOffset(e,r){if(null==this.parameters.verticalOffset)return null;const u=r.camera;s(G,e[12],e[13],e[14]);let h=null;switch(r.viewingMode){case 1:h=a(k,G);break;case 2:h=i(k,q)}const m=t(H,G,u.eye),p=o(m),d=n(m,m,1/p);let f=null;this.parameters.screenSizePerspective&&(f=l(h,d));const x=R(u,p,this.parameters.verticalOffset,f??0,this.parameters.screenSizePerspective,null);return n(h,h,x),c(L,h,r.transform.inverseRotation)}}class N extends v{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return s(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?_:V,e)}}class z extends j{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const F=h(),E=h(),q=m(0,0,1),k=h(),G=h(),H=h(),L=h(),W=h();export{N as DefaultGLMaterial,B as DefaultMaterial,z as DefaultMaterialParameters};
|
|
2
|
+
import{exactEquals as e,subtract as t,add as r,set as s,copy as i,normalize as a,length as o,scale as n,dot as l,transformMat3 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as h,fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as p,getMin as d,setMax as f,getMax as x}from"../../../../geometry/support/aaBoundingBox.js";import{is3DGeometryOrShadowLike as g,isColor as T}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as v}from"../lib/GLTextureMaterial.js";import{Material as S}from"../lib/Material.js";import{intersectTriangleGeometry as b}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as M}from"../lib/screenPolygonTriangleIntersections.js";import{getVerticalOffsetObject3D as y}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as O}from"./DefaultBufferWriter.js";import{intersectWithPolygonOffset as C,applyPolygonOffsetToHit as P}from"./intersectWithPolygonOffset.js";import{verticalOffsetAtDistance as R}from"./internal/MaterialUtil.js";import{getLayout as w,DefaultMaterialPassParameters as j,DefaultMaterialTechnique as V}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as I}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as _}from"../shaders/RealisticTreeTechnique.js";import{hasShadowHighlights as A}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class B extends S{constructor(e,t){super(e,z),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>g(e)&&!this.transparent],[4,e=>g(e)&&this.transparent]]),this._layout=w(this.parameters),this._configuration=new I(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=D}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:s,doubleSided:i,doubleSidedType:a}=t;r.hasVertexTangents=!s&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=s?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!s&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=s?2:i&&"normal"===a?1:i&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,T(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=A(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,r,s,i,a,o){const n=this._getMaterialVerticalOffset(r,s);null!=n&&(i=t(F,i,n),a=t(E,a,n)),o=C(o,this._configuration,i,a),b(e,s,i,a,y(s.verticalOffset),o)}intersectScreenPolygon(e,t,r,s){return P(M(e,r,t,s,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new N(e)}createBufferWriter(){return new O(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:s,texture:i,textureId:a,textureAlphaMode:o,colorMixMode:n}=this.parameters,l=r[3];return e||t<1&&"replace"!==n||l<1&&"ignore"!==n||s<1||(null!=i||null!=a)&&1!==o&&2!==o&&"replace"!==n}_createScreenPolygonVertexDisplacement(e,t){const s=this._getMaterialVerticalOffset(e,t);return null==s?null:{applyToVertex:(e,t,r,i)=>(e[0]=t+s[0],e[1]=r+s[1],e[2]=i+s[2],e),applyToAabb:e=>(p(e,r(W,d(e,W),s)),f(e,r(W,x(e,W),s)),e)}}_getMaterialVerticalOffset(e,r){if(null==this.parameters.verticalOffset)return null;const u=r.camera;s(G,e[12],e[13],e[14]);let h=null;switch(r.viewingMode){case 1:h=a(k,G);break;case 2:h=i(k,q)}const m=t(H,G,u.eye),p=o(m),d=n(m,m,1/p);let f=null;this.parameters.screenSizePerspective&&(f=l(h,d));const x=R(u,p,this.parameters.verticalOffset,f??0,this.parameters.screenSizePerspective,null);return n(h,h,x),c(L,h,r.transform.inverseRotation)}}class N extends v{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return s(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?_:V,e)}}class z extends j{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const F=h(),E=h(),q=m(0,0,1),k=h(),G=h(),H=h(),L=h(),W=h();export{N as DefaultGLMaterial,B as DefaultMaterial,z as DefaultMaterialParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{BufferViewUint32 as t,BufferViewVec3f as e,BufferViewVec2Snorm16 as i,BufferViewSnorm16 as r,BufferViewFloat16 as s,BufferViewFloat as o,BufferViewVec2f as a,BufferViewVec4Unorm8 as n,BufferViewUnorm8 as h}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as c}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as u,is3DGeometry as f,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import g from"../lib/GLMaterial.js";import{isPathGeometry as m}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as d}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as y,intersectAabbInvDir as b}from"../lib/RayIntersections.js";import{assert as _}from"../lib/Util.js";import{applyPolygonOffsetToHit as S}from"./intersectWithPolygonOffset.js";import{getLayout as w,getTextureLayout as F}from"./PathLayouts.js";import{PathPassParameters as P,PathTechnique as V}from"./PathTechnique.js";import{PathTechniqueConfiguration as x}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as R,writePosition as j,writeBufferVec2 as z,writeBufferInt16 as B,writeBufferFloat16 as O,writeBufferFloat as v,writeColor as A,writeBufferUint8 as T,writeOlidColor as M}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as I}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as U}from"../../../../webscene/support/AlphaCutoff.js";class L extends C{constructor(t,e){super(t,D),this.supportsEdges=!0,this.produces=new Map([[2,t=>(this.parameters.castShadows&&u(t)||f(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&u(t)||f(t))&&this.transparent]]),this._configuration=new x(e.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,p(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=I(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=U}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(){}intersectScreenPolygonDraped(){return null}intersectScreenPolygon(t,e,i,r){return m(t)?S(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(t,e,i,r,s){if(!m(t))return;const o=new y(e.tolerance,!1,e.options.normalRequired),a=t.boundingInfo;if(null==a)return void t.intersectRay(i,r,o,s);const n=a.boundingBox,h=[r[0]-i[0],r[1]-i[1],r[2]-i[2]],c=Math.sqrt(h[0]*h[0]+h[1]*h[1]+h[2]*h[2]),u=[c/h[0],c/h[1],c/h[2]];b(n,i,u,e.tolerance)&&t.intersectRay(i,r,o,s)}createBufferWriter(){return new G(w(),F(this.parameters))}createGLMaterial(t){return new q(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class q extends g{beginSlot(t){return this.getTechnique(V,t)}}class D extends P{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class G{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=c}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(e,i,r,s,o){R(r,null,this.layout,e,i,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",t),h=r.get("pathVertexInfo");if(n&&h){_(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,d(o,a))}}}_writeTextureBuffer(t,c,u,f){const p=f.offset,g=f.buffer.getField("position",e),m=c.get("position");g&&m&&(_(3===m.size),j(m,t,g,p));const d=f.buffer.getField("profileRight",i),y=c.get("profileRight");d&&y&&(_(2===y.size),z(y,d,p));const b=f.buffer.getField("profileUp",i),S=c.get("profileUp");b&&S&&(_(2===S.size),z(S,b,p));const w=f.buffer.getField("profileRotation",r),F=c.get("profileRotation");w&&F&&(_(1===F.size),B(F,w,p));const P=f.buffer.getField("pathRotationUp",i),V=c.get("pathRotationUp");P&&V&&(_(2===V.size),z(V,P,p));const x=f.buffer.getField("pathMaxStretchDistance",s),C=c.get("pathMaxStretchDistance");x&&C&&(_(1===C.size),O(C,x,p));const R=f.buffer.getField("sizeFeatureAttribute",o),I=c.get("sizeFeatureAttribute");R&&I&&v(I,R,p);const U=f.buffer.getField("size",a),L=c.get("size");U&&L&&(_(2===L.size),z(L,U,p));const q=f.buffer.getField("colorFeatureAttribute",o),D=c.get("colorFeatureAttribute");q&&D&&v(D,q,p);const G=f.buffer.getField("color",n),W=c.get("color");G&&W&&A(W,4,G,p);const H=f.buffer.getField("opacityFeatureAttribute",o),k=c.get("opacityFeatureAttribute");H&&k&&v(k,H,p);const E=f.buffer.getField("opacity",h),J=c.get("opacity");if(E&&J&&(_(1===J.size),T(J,E,p)),l()){const t=f.buffer.getField("olidColor",n),e=m?.indices.length??0;u&&t&&e&&M(u,t,e,p)}}}export{D as Parameters,G as PathBufferWriter,L as PathMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";class i extends e{constructor(t){super(),this.spherical=t,this.offsetBackfaces=!1,this.cullFace=0,this.pbrMode=0,this.emissionSource=0,this.upVectorAlignment=0,this.pathCapType=3,this.pathProfileType=0,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasPathSize=!1,this.hasPathColor=!1,this.hasPathOpacity=!1,this.hasOccludees=!1,this.snowCover=!1,this.receiveGlobalIllumination=!1,this.supportNaN=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1,this.doubleSidedMode=0,this.renderOccluded=!1}}t([o()],i.prototype,"offsetBackfaces",void 0),t([o({count:3})],i.prototype,"cullFace",void 0),t([o({count:
|
|
2
|
+
import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";class i extends e{constructor(t){super(),this.spherical=t,this.offsetBackfaces=!1,this.cullFace=0,this.pbrMode=0,this.emissionSource=0,this.upVectorAlignment=0,this.pathCapType=3,this.pathProfileType=0,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasPathSize=!1,this.hasPathColor=!1,this.hasPathOpacity=!1,this.hasOccludees=!1,this.snowCover=!1,this.receiveGlobalIllumination=!1,this.supportNaN=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1,this.doubleSidedMode=0,this.renderOccluded=!1}}t([o()],i.prototype,"offsetBackfaces",void 0),t([o({count:3})],i.prototype,"cullFace",void 0),t([o({count:8})],i.prototype,"pbrMode",void 0),t([o({count:8})],i.prototype,"emissionSource",void 0),t([o({count:2})],i.prototype,"upVectorAlignment",void 0),t([o({count:4})],i.prototype,"pathCapType",void 0),t([o({count:2})],i.prototype,"pathProfileType",void 0),t([o()],i.prototype,"receiveShadows",void 0),t([o()],i.prototype,"hasShadowHighlights",void 0),t([o()],i.prototype,"receiveAmbientOcclusion",void 0),t([o()],i.prototype,"hasVVSize",void 0),t([o()],i.prototype,"hasVVColor",void 0),t([o()],i.prototype,"hasVVOpacity",void 0),t([o()],i.prototype,"hasPathSize",void 0),t([o()],i.prototype,"hasPathColor",void 0),t([o()],i.prototype,"hasPathOpacity",void 0),t([o()],i.prototype,"hasOccludees",void 0),t([o()],i.prototype,"snowCover",void 0),t([o()],i.prototype,"receiveGlobalIllumination",void 0);export{i as PathTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as a}from"../../../../core/time.js";import{copy as n,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as m,scale as h,add as u,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as y}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as v,create as w}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{fromPoints as E,distance2 as x,closestLineSegmentPoint as j,projectPoint as L,projectPointFraction as z,create as A}from"../../../../geometry/support/lineSegment.js";import{fromPoints as M,signedDistance as C,getNormal as R,create as O}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as V,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as F,isColor as U,isDepth as I,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{Material as Y}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{r as ee}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as te,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ie}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as se}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class ne extends Y{constructor(e,t){super(e,le),this.produces=new Map([[2,e=>F(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>I(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new se(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=de(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&fe(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=s[0],c=s[1],p=he(o,r);let m=Number.MAX_VALUE,h=0;for(const u of ue(Se,Pe,this.parameters,e)){const e=l-Se[0],r=c-Se[1],i=Pe[0]-Se[0],s=Pe[1]-Se[1],a=t((i*e+s*r)/(i*i+s*s),0,1),n=i*a-e,o=s*a-r,p=n*n+o*o;p<m&&(m=p,h=u)}m<p*p&&a(n.distance,n.normal,h)}intersectRay(t,r,i,s,a,o){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!K(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=xe;n(w,i.point);const T=v*_.pixelRatio,L=Je*_.pixelRatio,z=T/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;M(_.eye,Ne[0],Ne[1],ke),M(_.eye,Ne[1],Ne[2],We),M(_.eye,Ne[2],Ne[3],De),M(_.eye,Ne[3],Ne[0],Ye);let A=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(_e,be,y,r,me(this.parameters,P))){if(C(ke,_e)<0&&C(ke,be)<0||C(We,_e)<0&&C(We,be)<0||C(De,_e)<0&&C(De,be)<0||C(Ye,_e)<0&&C(Ye,be)<0)continue;const t=_.projectToRenderScreen(_e,je),r=_.projectToRenderScreen(be,Le);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,_e,be);const e=_.frustum,r=-C(e[4],_e)/m(Te,R(e[4]));if(h(Te,Te,r),u(_e,_e,Te),!_.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&r[2]<0){p(Te,be,_e);const e=_.frustum,t=-C(e[4],be)/m(Te,R(e[4]));if(h(Te,Te,t),u(be,be,Te),!_.projectToRenderScreen(be,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Re),s=x(i,w);if(!(s>=A)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,_e,be,w,_,v,L);if(s>=e*e)continue}A=s,f(Me,_e),f(Ce,be),O=e}}if(A<z*z){let e=Number.MAX_VALUE;if(j(E(Me,Ce,Re),E(b,S,Oe),Ee)){p(Ee,Ee,b);const t=d(Ee);h(Ee,Ee,1/t),e=t/g(b,S)}o(e,Ee,O)}}intersectScreenPolygon(t,r,i,s){const{options:a,camera:n,screenPolygonPrimitiveProcessor:o}=i;if(!a.selectionMode||!t.visible)return null;if(!K(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),m=Je,h=m*n.pixelRatio,u=new X(4);for(const e of this._forEachTransformedLineSegment(_e,be,c,r,me(this.parameters,l)))for(const[t,r]of o.processLineSegment(qe,_e,be)){if(!J(n,t,r,je,Le))continue;const i=E(je,Le,Re);let a=p/2+m;this.parameters.screenSizePerspective&&(_(xe,je,Le,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(i,t,r,xe,n,p,h)/n.pixelRatio)),n.renderToScreen(je,ze),n.renderToScreen(Le,Ae),q(s,ze,Ae,a)&&(L(E(t,r,Oe),n.eye,ye),u.updateIfCloserFromValues(g(n.eye,ye),e,ye,null))}return u}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const a=he(this._getLineSize(e,!0),t);for(const n of ue(Se,Pe,this.parameters,e,r))if(q(s,Se,Pe,a))return new G(n);return null}createBufferWriter(){return new ce(te(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new oe(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,a,n){const o=z(e,i);_(ye,t,r,o),b(ve,ye,s.viewMatrix);const l=d(ve),c=this.computeCameraAbsCosAngle(ye,s,this._configuration.spherical);ge.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return ge.apply(a)*s.pixelRatio/2+n}computeCameraAbsCosAngle(e,t,r){return r?S(Ee,e):c(Ee,0,0,1),p(we,e,t.eye),S(we,we),Math.abs(m(Ee,we))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const a=s?r.length-2:r.length-5;for(let n=0;n<a;n+=3){e[0]=r[n]+i[12],e[1]=r[n+1]+i[13],e[2]=r[n+2]+i[14];const s=(n+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield n/3}}}class oe extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ie,e)}}class le extends ${constructor(){super(...arguments),this._width=0,this.color=v,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class ce{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=de(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+2}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,a,n){null!=n&&this._writeTextureBuffer(e,r,n),null!=s&&this._writeVertexBuffer(e,r,i,s,a)}_writeTextureBuffer(e,t,r){const i=t.get("position"),s=i.data.length/3,a=s+2,n=this._isClosed(t),{buffer:o,offset:l}=r,c=o.getField("position",V);Q(null!==c,"Expected valid position field in texture buffer");for(let p=0;p<s;++p)this._getTransformedPosition(Be,i.data,p,e),c.setVec(l+p+1,Be);n?(o.copyItem(l+a-2,l+0),o.copyItem(l+1,l+a-1)):(o.copyItem(l+1,l+0),o.copyItem(l+a-2,l+a-1))}_writeVertexBuffer(e,t,r,i,s){const{buffer:a,offset:n}=i,{layout:o}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,m=p+2,h=t.get("distanceToStart")?.data;c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=a.getField("textureElementIndex",B);Q(null!=u,"Missing texture buffer index field"),Q(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const d=s.from;Q(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const _=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(_){const e=t.get("sizeFeatureAttribute");1===e.data.length?b=e.data[0]:S=e.data}else b=t.get("size")?.data[0]??1;let P=[1,1,1,1],v=0,w=null;const E=o.fields.has("colorFeatureAttribute");if(E){const e=t.get("colorFeatureAttribute");1===e.data.length?v=e.data[0]:w=e.data}else P=t.get("color")?.data??P;const x=t.get("timeStamps")?.data,j=x&&o.fields.has("timeStamps"),L=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(L){const e=t.get("opacityFeatureAttribute");1===e.data.length?z=e.data[0]:A=e.data}const M=new Float32Array(a.buffer),C=T(a.buffer),R=new Uint8Array(a.buffer),O=new Uint32Array(a.buffer),V=o.stride/4;let F=n*V;const U=F;let I=0;const N=M.BYTES_PER_ELEMENT/C.BYTES_PER_ELEMENT,k=W(),D=this._isClosed(t),Y=(e,t,i,s,a,n,o,l)=>{const c=o+1;O[F]=d+c,F++,M[F++]=l;let p=F*N;if(C[p++]=a,C[p++]=n,F=Math.ceil(p/N),E)M[F]=w?.[o]??v;else{const e=Math.min(4*o,P.length-4),t=4*F;R[t]=255*P[e],R[t+1]=255*P[e+1],R[t+2]=255*P[e+2],R[t+3]=255*P[e+3]}if(F++,M[F++]=S?.[o]??b,L&&(M[F++]=A?.[o]??z),k){let e=4*F;r?(R[e++]=r[0],R[e++]=r[1],R[e++]=r[2],R[e++]=r[3]):(R[e++]=0,R[e++]=0,R[e++]=0,R[e++]=0),F=Math.ceil(.25*e)}j&&(p=F*N,C[p++]=s[0],C[p++]=s[1],C[p++]=s[2],C[p++]=s[3],F=Math.ceil(p/N))},J=()=>{f(Ve,Be),f(Be,Fe)},q=e=>{if(j){const t=4*e;y(Ue,x[t+0],x[t+1],x[t+2],x[t+3])}},X=(e,t,r)=>{null!=h?I=h[r]:I+=g(e,t)};F+=V,this._getTransformedPosition(Be,l.data,0,e),q(0);let G=0,H=0;D?(this._getTransformedPosition(Ve,l.data,p-1,e),G=0,H=p):(this._getTransformedPosition(Fe,l.data,1,e),Y(Be,Be,Fe,Ue,1,-4,0,0),Y(Be,Be,Fe,Ue,1,4,0,0),J(),q(1),G=1,H=p-1);for(let f=G;f<H;f++){this._getTransformedPosition(Fe,l.data,(f+1)%p,e),X(Ve,Be,f),Y(Ve,Be,Fe,Ue,0,-1,f,I),Y(Ve,Be,Fe,Ue,0,1,f,I);const t=this.numJoinSubdivisions;for(let e=0;e<t;++e){const r=(e+1)/(t+1);Y(Ve,Be,Fe,Ue,r,-1,f,I),Y(Ve,Be,Fe,Ue,r,1,f,I)}Y(Ve,Be,Fe,Ue,1,-2,f,I),Y(Ve,Be,Fe,Ue,1,2,f,I),J(),q((f+1)%p)}X(Ve,Be,H),D?(this._getTransformedPosition(Fe,l.data,1,e),Y(Ve,Be,Fe,Ue,0,-1,G,I),Y(Ve,Be,Fe,Ue,0,1,G,I)):(Y(Ve,Be,Be,Ue,0,-5,H,I),Y(Ve,Be,Be,Ue,0,5,H,I)),pe(M,U+V,M,U,V);F=pe(M,F-V,M,F,V),this._parameters.wireframe&&this._addWireframeVertices(a,U,F,V)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),n=i*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=pe(a,e,s,o,n);for(let c=0;c<=a.length-4*n;c+=2*n)l(c),l(c+2*n),l(c+1*n),l(c+2*n),l(c+1*n),l(c+3*n)}}function pe(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t){return(e/2+Je)*t}function*ue(e,t,r,i,s){const a=i.get("position").data,l=me(r,i)?a.length-2:a.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,a[0]+c,a[1]+p);for(let m=3;m<l+3;m+=3){const r=m%a.length;o(t,a[r]+c,a[r+1]+p),yield m/3,n(e,t)}}function fe(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function de(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return ee+r}}const ge=new H,_e=P(),be=P(),Se=l(),Pe=l(),ye=P(),ve=P(),we=P(),Te=P(),Ee=P(),xe=P(),je=r(),Le=r(),ze=i(),Ae=i(),Me=P(),Ce=P(),Re=A(),Oe=A(),Ve=P(),Be=P(),Fe=P(),Ue=w(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],ke=O(),We=O(),De=O(),Ye=O(),Je=4,qe=[P(),P()];export{le as Parameters,ne as RibbonLineMaterial};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as o,set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as v}from"../../../../geometry/support/float16.js";import{create as w,fromPoints as E,distance2 as x,closestLineSegmentPoint as T,projectPoint as j,projectPointFraction as L}from"../../../../geometry/support/lineSegment.js";import{create as z,fromPoints as C,signedDistance as A,getNormal as M}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as R,BufferViewFloat as V,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as U,isColor as I,isDepth as N,isColorHighlightOLIDOrDepth as W,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as D}from"../effects/geometry/olidUtils.js";import Y from"../lib/GLMaterial.js";import{Material as J}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as q,screenPolygonIntersectsBufferedSegment as X}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as H}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as K}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as Q,assert as Z}from"../lib/Util.js";import{isImagePattern as $}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ee}from"./VisualVariablePassParameters.js";import{writeOlidColor as te}from"./internal/bufferWriterUtils.js";import{r as re}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ne}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as oe}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class le extends J{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>U(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>N(e)],[10,e=>W(e)&&8===this.parameters.renderOccluded],[11,e=>W(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new oe(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=_e(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ge(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,n,o){if(!i.options.selectionMode)return;const a=this._getLineSize(e,!0),l=s[0],c=s[1],p=fe(a,r);let u=Number.MAX_VALUE,m=0;for(const h of de(ye,ve,this.parameters,e)){const e=l-ye[0],r=c-ye[1],i=ve[0]-ye[0],s=ve[1]-ye[1],n=t((i*e+s*r)/(i*i+s*s),0,1),o=i*n-e,a=s*n-r,p=o*o+a*a;p<u&&(u=p,m=h)}u<p*p&&n(o.distance,o.normal,m)}intersectRay(t,r,i,s,n,a){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!Q(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=Le;o(w,i.point);const j=v*_.pixelRatio,L=Je*_.pixelRatio,z=j/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;C(_.eye,Ne[0],Ne[1],We),C(_.eye,Ne[1],Ne[2],ke),C(_.eye,Ne[2],Ne[3],De),C(_.eye,Ne[3],Ne[0],Ye);let R=Number.MAX_VALUE,V=0;for(const e of this._forEachTransformedLineSegment(Se,Pe,y,r,he(this.parameters,P))){if(A(We,Se)<0&&A(We,Pe)<0||A(ke,Se)<0&&A(ke,Pe)<0||A(De,Se)<0&&A(De,Pe)<0||A(Ye,Se)<0&&A(Ye,Pe)<0)continue;const t=_.projectToRenderScreen(Se,ze),r=_.projectToRenderScreen(Pe,Ce);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,Se,Pe);const e=_.frustum,r=-A(e[4],Se)/u(Te,M(e[4]));if(m(Te,Te,r),h(Se,Se,Te),!_.projectToRenderScreen(Se,t))continue}else if(t[2]>0&&r[2]<0){p(Te,Pe,Se);const e=_.frustum,t=-A(e[4],Pe)/u(Te,M(e[4]));if(m(Te,Te,t),h(Pe,Pe,Te),!_.projectToRenderScreen(Pe,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Fe),s=x(i,w);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,Se,Pe,w,_,v,L);if(s>=e*e)continue}R=s,f(Re,Se),f(Ve,Pe),V=e}}if(R<z*z){let e=Number.MAX_VALUE;if(T(E(Re,Ve,Fe),E(b,S,Oe),je)){p(je,je,b);const t=d(je);m(je,je,1/t),e=t/g(b,S)}a(e,je,V)}}intersectScreenPolygon(t,r,i,s){const{options:n,camera:o,screenPolygonPrimitiveProcessor:a}=i;if(!n.selectionMode||!t.visible)return null;if(!Q(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Je,m=u*o.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(Se,Pe,c,r,he(this.parameters,l)))for(const[t,r]of a.processLineSegment(qe,Se,Pe)){if(!q(o,t,r,ze,Ce))continue;const i=E(ze,Ce,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(Le,ze,Ce,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(i,t,r,Le,o,p,m)/o.pixelRatio)),o.renderToScreen(ze,Ae),o.renderToScreen(Ce,Me),X(s,Ae,Me,n)&&(j(E(t,r,Oe),o.eye,we),h.updateIfCloserFromValues(g(o.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const n=fe(this._getLineSize(e,!0),t);for(const o of de(ye,ve,this.parameters,e,r))if(X(s,ye,ve,n))return new H(o);return null}createBufferWriter(){return new ue(ie(this.parameters),se(this.parameters),this.parameters)}createGLMaterial(e){return new ce(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,n,o){const a=L(e,i);_(we,t,r,a),b(Ee,we,s.viewMatrix);const l=d(Ee),c=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,r){return r?S(je,e):c(je,0,0,1),p(xe,e,t.eye),S(xe,xe),Math.abs(u(je,xe))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const n=s?r.length-2:r.length-5;for(let o=0;o<n;o+=3){e[0]=r[o]+i[12],e[1]=r[o+1]+i[13],e[2]=r[o+2]+i[14];const s=(o+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield o/3}}}class ce extends Y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ne,e)}}class pe extends ee{constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return $(this.stipplePattern)&&null!=this.stippleTexture}}class ue{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=_e(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return he(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,n,o){null!=o&&this._writeTextureBuffer(e,r,i,o),null!=s&&this._writeVertexBuffer(e,r,i,s,n)}_writeTextureBuffer(e,t,r,i){const s=t.get("position"),n=s.data.length/3,o=this._isClosed(t),{buffer:a,offset:l}=i,c=a.getField("position",R),p=a.getField("u0",V),u=a.getField("sizeFeatureAttribute",V),m=a.getField("size",V),h=a.getField("colorFeatureAttribute",V),d=a.getField("color",F),_=a.getField("olidColor",F),b=a.getField("timeStamps",O),S=a.getField("opacityFeatureAttribute",V),P=t.get("sizeFeatureAttribute")?.data,y=t.get("size")?.data,v=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,x=t.get("distanceToStart")?.data,T=t.get("timeStamps");Z(null!==c,"Expected valid position field in texture buffer"),Z(null!==p,"Expected valid u0 field in texture buffer");let j=0;for(let L=0;L<n;++L){this._getTransformedPosition(Ue,s.data,L,e),L>0&&(null!=x?j=x[L]??j:j+=g(Be,Ue));const t=l+L+1;if(c.setVec(t,Ue),p.set(t,j),f(Be,Ue),u&&u.set(t,1===P?.length?P[0]:P?.[L]??0),m&&m.set(t,1===y?.length?y[0]:y?.[L]??1),h&&h.set(t,1===v?.length?v[0]:v?.[L]??0),d)if(null!=w){const e=Math.min(4*L,w.length-4);d.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else d.setValues(t,1,1,1,1);S&&S.set(t,1===E?.length?E[0]:E?.[L]??0)}if(null!=b&&null!=T){Z(4===T.size);const e=T.data;for(let t=0;t<n;++t){const r=4*t,i=l+t+1;b.set(i,0,e[r]),b.set(i,1,e[r+1]),b.set(i,2,e[r+2]),b.set(i,3,e[r+3])}}if(o){const e=l,t=l+1,r=l+2,i=l+n,s=i+1,o=i+2;a.copyItem(i,e),a.copyItem(t,s),a.copyItem(r,o),c.getVec(i,Be),c.getVec(t,Ue);const u=j+g(Be,Ue);p.set(s,u)}else{const e=l,t=l+1,r=l+n,i=r+1;a.copyItem(t,e),a.copyItem(r,i)}D()&&null!=r&&null!=_&&te(r,_,n+(o?3:2),l)}_writeVertexBuffer(e,t,r,i,s){const{buffer:n,offset:o}=i,{layout:a}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,u=this._isClosed(t),m=p+(u?3:2);c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const h=n.getField("textureElementIndex",B);Z(null!=h,"Missing texture buffer index field"),Z(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const f=s.from;Z(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const d=new Float32Array(n.buffer),g=v(n.buffer),_=new Uint32Array(n.buffer),b=a.stride/4;let S=o*b;const P=S,y=d.BYTES_PER_ELEMENT/g.BYTES_PER_ELEMENT,w=(e,t,r)=>{const i=r+1;_[S]=f+i,S++;let s=S*y;g[s++]=e,g[s++]=t,S=Math.ceil(s/y)};S+=b;let E=0,x=0;u?(E=0,x=p):(w(1,-4,0),w(1,4,0),E=1,x=p-1);for(let v=E;v<x;v++){w(0,-1,v),w(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const r=(t+1)/(e+1);w(r,-1,v),w(r,1,v)}w(1,-2,v),w(1,2,v)}u?(w(0,-1,x),w(0,1,x)):(w(0,-5,x),w(0,5,x)),me(d,P+b,d,P,b);S=me(d,S-b,d,S,b),this._parameters.wireframe&&this._addWireframeVertices(n,P,S,b)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),o=i*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=me(n,e,s,a,o);for(let c=0;c<=n.length-4*o;c+=2*o)l(c),l(c+2*o),l(c+1*o),l(c+2*o),l(c+1*o),l(c+3*o)}}function me(e,t,r,i,s){for(let n=0;n<s;n++)r[i++]=e[t++];return i}function he(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function fe(e,t){return(e/2+Je)*t}function*de(e,t,r,i,s){const n=i.get("position").data,l=he(r,i)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;a(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const r=u%n.length;a(t,n[r]+c,n[r+1]+p),yield u/3,o(e,t)}}function ge(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function _e(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return re+r}}const be=new K,Se=P(),Pe=P(),ye=l(),ve=l(),we=P(),Ee=P(),xe=P(),Te=P(),je=P(),Le=P(),ze=r(),Ce=r(),Ae=i(),Me=i(),Re=P(),Ve=P(),Fe=w(),Oe=w(),Be=P(),Ue=P(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],We=z(),ke=z(),De=z(),Ye=z(),Je=4,qe=[P(),P()];export{pe as Parameters,le as RibbonLineMaterial};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fadeInTime as e,fadeOutTime as i}from"../../support/flow/constants.js";import{Float2PassUniform as o}from"../core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fadeInTime as e,fadeOutTime as i}from"../../support/flow/constants.js";import{Float2PassUniform as o}from"../core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as m}from"../core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../core/shaderModules/glsl.js";function n(a,n){const{hasAnimation:s,animation:T}=n;if(!s)return;const{attributes:f,varyings:p,vertex:u,fragment:c}=a,h=n.timeStampsExpr??"timeStamps";null==n.timeStampsExpr&&f.add("timeStamps","vec4"),p.add("vTimeStamp","float"),p.add("vFirstTime","float"),p.add("vLastTime","float"),p.add("vTransitionType","float"),u.main.add(l`
|
|
3
|
+
vec4 animatedLineTimeStamps = ${h};
|
|
4
|
+
vTimeStamp = animatedLineTimeStamps.x;
|
|
5
|
+
vFirstTime = animatedLineTimeStamps.y;
|
|
6
|
+
vLastTime = animatedLineTimeStamps.z;
|
|
7
|
+
vTransitionType = animatedLineTimeStamps.w;
|
|
8
|
+
`),3===T&&c.constants.add("decayRate","float",2.3),c.code.add(l`
|
|
6
9
|
float getTrailOpacity(float x) {
|
|
7
10
|
if (x < 0.0) {
|
|
8
11
|
return 0.0;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
${d(T)}
|
|
12
|
-
}`),c.uniforms.add(new
|
|
15
|
+
}`),c.uniforms.add(new m("timeElapsed",t=>t.timeElapsed),new m("trailLength",t=>t.trailLength),new m("speed",t=>t.animationSpeed),new o("startEndTime",a=>t(r,a.startTime,a.endTime))),c.constants.add("fadeInTime","float",e),c.constants.add("fadeOutTime","float",i),c.constants.add("incomingTransition","int",0),c.constants.add("outgoingTransition","int",2),c.code.add(l`float fadeIn(float x) {
|
|
13
16
|
return smoothstep(0.0, fadeInTime, x);
|
|
14
17
|
}
|
|
15
18
|
float fadeOut(float x) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as o}from"../materials/TriangleTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as o}from"../materials/TriangleTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:8})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:3})],s.prototype,"customDepthTest",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasSymbolColors",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"hasVertexTangents",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"instanced",void 0),e([t()],s.prototype,"instancedDoublePrecision",void 0),e([t()],s.prototype,"hasModelTransformation",void 0),e([t()],s.prototype,"offsetBackfaces",void 0),e([t()],s.prototype,"hasVVSize",void 0),e([t()],s.prototype,"hasVVColor",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"hasShadowHighlights",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"receiveGlobalIllumination",void 0),e([t()],s.prototype,"textureAlphaPremultiplied",void 0),e([t()],s.prototype,"instancedFeatureAttribute",void 0),e([t()],s.prototype,"instancedColor",void 0),e([t()],s.prototype,"writeDepth",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"hasColorTextureTransform",void 0),e([t()],s.prototype,"hasEmissionTextureTransform",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"hasOcclusionTextureTransform",void 0),e([t()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/
|
|
2
|
+
import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"./alphaCutoff.glsl.js";import"./AnimatedLine.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"./RibbonLineTextureBuffer.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build,r as ribbonlineNumRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(
|
|
2
|
+
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(t){return e().u32("textureElementIndex",{integer:!0}).vec2f16("lineParameters")}const u=[{type:"vec3f32",name:"position"},{type:"f32",name:"u0"}];function n(e){const o=[...u];return e.hasVVColor?o.push({type:"f32",name:"colorFeatureAttribute"}):o.push({type:"vec4unorm8",name:"color"}),e.hasVVSize?o.push({type:"f32",name:"sizeFeatureAttribute"}):o.push({type:"f32",name:"size"}),e.hasVVOpacity&&o.push({type:"f32",name:"opacityFeatureAttribute"}),t()&&o.push({type:"vec4unorm8",name:"olidColor"}),e.hasAnimation&&o.push({type:"vec4f16",name:"timeStamps"}),new r(o)}export{o as getLayout,n as getTextureBufferLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as s,depthTest as n,blending as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as c,stencilBaseAllZeros as p,stencilWriteMaskOn as u,stencilToolTransparentOccluder as a,depthCompareAlways as d,stencilToolMaskOccluder as h,stencilWriteMaskOff as m,depthCompareLess as f}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as g}from"../materials/PolygonOffset.js";import{R as b}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as P}from"./RibbonLineLayouts.js";import{PrimitiveType as T}from"../../../webgl/enums.js";import{makePipelineState as W,defaultColorWrite as j,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let O=class extends l{constructor(e,i){super(e,i,t(P(
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as s,depthTest as n,blending as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as c,stencilBaseAllZeros as p,stencilWriteMaskOn as u,stencilToolTransparentOccluder as a,depthCompareAlways as d,stencilToolMaskOccluder as h,stencilWriteMaskOff as m,depthCompareLess as f}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as g}from"../materials/PolygonOffset.js";import{R as b}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as P}from"./RibbonLineLayouts.js";import{PrimitiveType as T}from"../../../webgl/enums.js";import{makePipelineState as W,defaultColorWrite as j,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let O=class extends l{constructor(e,i){super(e,i,t(P())),this.shader=new r(b,()=>import("./RibbonLine.glsl.js")),this.ignoreUnused=!0,this.primitiveType=i.wireframe?T.LINES:T.TRIANGLE_STRIP}_makePipelineState(e,i){const{output:t,hasOccludees:r}=e;return W({blending:o(t,!1,e.emissionDimmingPass),depthTest:n(t),depthWrite:s(e),colorWrite:j,stencilWrite:r?u:null,stencilTest:r?i?c:p:null,polygonOffset:g(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:i}=e;this._occluderPipelineTransparent=W({blending:_,polygonOffset:g(e),depthTest:d,depthWrite:null,colorWrite:j,stencilWrite:null,stencilTest:i?a:null}),this._occluderPipelineOpaque=W({blending:_,polygonOffset:g(e),depthTest:i?d:f,depthWrite:null,colorWrite:j,stencilWrite:i?m:null,stencilTest:i?h:null}),this._occluderPipelineMaskWrite=W({blending:null,polygonOffset:g(e),depthTest:f,depthWrite:null,colorWrite:null,stencilWrite:i?u:null,stencilTest:i?c:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i,t){if(t)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,i,t);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,i,t);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,i,t)}}};O=e([i("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],O);export{O as RibbonLineTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{TextureBackedBufferModule as e}from"../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Texture2DUintDrawUniform as r}from"../core/shaderModules/Texture2DUintDrawUniform.js";import{
|
|
2
|
+
import{TextureBackedBufferModule as e}from"../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Texture2DUintDrawUniform as r}from"../core/shaderModules/Texture2DUintDrawUniform.js";import{getTextureBufferLayout as o}from"./RibbonLineLayouts.js";const t=new r("componentTextureBuffer",e=>e.textureBuffer);function n(r){return new e({layout:o(r),itemIndexExpression:"textureElementIndex",bufferUniform:t})}export{n as getTextureBackedBufferModule};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return 0!==this.overlayMode}get hasWater(){return 11!==this.output}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return 0!==this.overlayMode}get hasWater(){return 11!==this.output}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:8})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"hasShadowHighlights",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"receiveGlobalIllumination",void 0),e([t()],i.prototype,"tileBorders",void 0);export{i as TerrainTechniqueConfiguration};
|
package/views/PopupView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{createTask as p}from"../core/asyncUtils.js";import t from"../core/Error.js";import{generatorFlat as o,generatorFromPromises as s}from"../core/generatorUtils.js";import has from"../core/has.js";import i from"../core/Logger.js";import{allSettledValues as r,throwIfAborted as u,wrapAbortWithTimeout as n}from"../core/promiseUtils.js";import{watch as a,syncAndInitial as h,whenOnce as c}from"../core/reactiveUtils.js";import{property as l,subclass as m}from"../core/accessorSupport/decorators.js";import{addPopup as d,openPopupWithViewClick as f,isPopup as g,isPopupElement as w,openPopupWithOptions as y,closePopup as P}from"./popupAdapter.js";import{ViewEventPriorities as E}from"./input/InputManager.js";const _=_=>{const V=_;let j=class extends V{constructor(...e){super(...e),this._popupSetupTask=null,this.popupEnabled=!0,this.popup={}}initialize(){this.addHandles([a(()=>[this.ui,this.popup,this.popupElement],([e,p,t],o)=>{const[s,i,r]=o??[];d(this,[e,p,t],[s,i,r])},h),this.on("click",e=>{this.popup&&this.popupEnabled&&("mouse"!==e.pointerType||0===e.button)&&f(this,e)},E.WIDGET)]),c(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>import("../widgets/Popup.js"))}destroy(){this.destroyed||this.closePopup()}get popup(){return this._get("popup")}set popup(e){this._set("popup",e)}async openPopup(e){if(g(this.popup))return this.popup.open(e);if(this.popupElement&&w(this.popupElement)){if(e){const{fetchFeatures:p,title:t,...o}=e;delete e.fetchFeatures,Object.assign(this.popupElement,o),void 0!==t&&(this.popupElement.heading=t)}this.popupElement.open=!0}try{if(await this.setupPopup(),!this.popup)return void i.getLogger(this).error(new t("view:null-popup","Popup is null and can't be opened"));y(this,e)}catch{}}closePopup(){this._popupSetupTask?.abort(),P(this.popup,this.popupElement)}async*fetchPopupFeatures(e,p){await this.when();const t=await this._getPopupHits(e,p),i=this._popupHitsToFeatures(e,t.hits,p);yield*o(s(i,p),p)}async fetchPopupFeaturesLegacy(e,p){await this.when();const t=await this._getPopupHits(e,p),o=this._popupHitsToFeatures(e,t.hits,p);return{pendingFeatures:o,allGraphicsPromise:r(o).then(e=>e.filter(e=>!!e).flat()),location:t.location}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!g(this.popup))return this._popupSetupTask=p(async e=>{if(!this.popupEnabled||!w(this.popupElement))if(this.dependencies.popup&&"function"==typeof this.dependencies.popup)await this.dependencies.popup(),u(e),customElements.get("arcgis-popup")||i.getLogger(this).error(new t("view:undefined-popup-element","`arcgis-popup` custom element is undefined and can't be opened")),this.popupElement=document.createElement("arcgis-popup");else{const{default:p}=await import("../widgets/Popup.js");if(u(e),!this.popup||g(this.popup))return;const t=this.popup;if("open"in t||"close"in t){const{open:e,close:o,...s}=t;this.popup=new p({...s})}else this.popup=new p(t)}}),this._popupSetupTask.promise}_popupHitsToFeatures(e,p,t){const o=[],s=[];let i=!1;const r=n(t,has("popup-view-fetch-timeout")??F),u=e=>{const p=new v(e);return s.push(p),o.push(p.promise),p},a=e=>{const p=s.at(-1);return p&&p.layerView===e&&!i?p:u(e)};for(const n of p)if("graphic"in n){a(n.layerView).graphics.push(n.graphic),i=!1}else o.push(n.layerView.fetchPopupFeaturesAtTarget(e,n.geometry,r)),i=!0;return s.forEach(e=>e.resolve(r)),o}async _getPopupHits(e,p){const{hits:t,location:o}=await this.popupHitTest(e);u(p);const s=[];for(const i of t)if("graphic"in i){if(this._isValidPopupGraphic(i.graphic,p)){const e=this._isFeaturePatchingLayerView(i.layerView)?i.layerView:void 0;s.push({graphic:i.graphic,layerView:e})}}else s.push({geometry:i.geometry,layerView:i.layerView});return{hits:s,location:o}}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(p?.defaultPopupTemplateEnabled)}_isFeaturePatchingLayerView(e){return!e||(!("layer"in e)||!e.suspended)&&"patchFeaturesForPopup"in e}};return e([l()],j.prototype,"popup",null),e([l()],j.prototype,"popupElement",void 0),e([l()],j.prototype,"popupEnabled",void 0),j=e([m("esri.views.PopupView")],j),j};class v{constructor(e){this.layerView=e,this._resolver=Promise.withResolvers(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(e){const{layerView:p,graphics:t,_resolver:o}=this;if(!p)return o.resolve(t),o.promise;let s;return p.patchFeaturesForPopup(t,e).catch(e=>(s=e,null)).then(e=>{e?o.resolve(e):o.reject(s)}),o.promise}}const F=5e3;export{_ as PopupView};
|
|
2
|
+
import{__decorate as e}from"tslib";import{createTask as p}from"../core/asyncUtils.js";import t from"../core/Error.js";import{generatorFlat as o,generatorFromPromises as s}from"../core/generatorUtils.js";import has from"../core/has.js";import i from"../core/Logger.js";import{allSettledValues as r,throwIfAborted as u,wrapAbortWithTimeout as n}from"../core/promiseUtils.js";import{watch as a,syncAndInitial as h,whenOnce as c}from"../core/reactiveUtils.js";import{property as l,subclass as m}from"../core/accessorSupport/decorators.js";import{addPopup as d,openPopupWithViewClick as f,isPopup as g,isPopupElement as w,openPopupWithOptions as y,closePopup as P}from"./popupAdapter.js";import{ViewEventPriorities as E}from"./input/InputManager.js";const _=_=>{const V=_;let j=class extends V{constructor(...e){super(...e),this._popupSetupTask=null,this.popupEnabled=!0,this.popup={}}initialize(){this.addHandles([a(()=>[this.ui,this.popup,this.popupElement],([e,p,t],o)=>{const[s,i,r]=o??[];d(this,[e,p,t],[s,i,r])},h),this.on("click",e=>{this.popup&&this.popupEnabled&&("mouse"!==e.pointerType||0===e.button)&&f(this,e).catch(()=>{})},E.WIDGET)]),c(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>import("../widgets/Popup.js"))}destroy(){this.destroyed||this.closePopup()}get popup(){return this._get("popup")}set popup(e){this._set("popup",e)}async openPopup(e){if(g(this.popup))return this.popup.open(e);if(this.popupElement&&w(this.popupElement)){if(e){const{fetchFeatures:p,title:t,...o}=e;delete e.fetchFeatures,Object.assign(this.popupElement,o),void 0!==t&&(this.popupElement.heading=t)}this.popupElement.open=!0}try{if(await this.setupPopup(),!this.popup)return void i.getLogger(this).error(new t("view:null-popup","Popup is null and can't be opened"));y(this,e)}catch{}}closePopup(){this._popupSetupTask?.abort(),P(this.popup,this.popupElement)}async*fetchPopupFeatures(e,p){await this.when();const t=await this._getPopupHits(e,p),i=this._popupHitsToFeatures(e,t.hits,p);yield*o(s(i,p),p)}async fetchPopupFeaturesLegacy(e,p){await this.when();const t=await this._getPopupHits(e,p),o=this._popupHitsToFeatures(e,t.hits,p);return{pendingFeatures:o,allGraphicsPromise:r(o).then(e=>e.filter(e=>!!e).flat()),location:t.location}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!g(this.popup))return this._popupSetupTask=p(async e=>{if(!this.popupEnabled||!w(this.popupElement))if(this.dependencies.popup&&"function"==typeof this.dependencies.popup)await this.dependencies.popup(),u(e),customElements.get("arcgis-popup")||i.getLogger(this).error(new t("view:undefined-popup-element","`arcgis-popup` custom element is undefined and can't be opened")),this.popupElement=document.createElement("arcgis-popup");else{const{default:p}=await import("../widgets/Popup.js");if(u(e),!this.popup||g(this.popup))return;const t=this.popup;if("open"in t||"close"in t){const{open:e,close:o,...s}=t;this.popup=new p({...s})}else this.popup=new p(t)}}),this._popupSetupTask.promise}_popupHitsToFeatures(e,p,t){const o=[],s=[];let i=!1;const r=n(t,has("popup-view-fetch-timeout")??F),u=e=>{const p=new v(e);return s.push(p),o.push(p.promise),p},a=e=>{const p=s.at(-1);return p&&p.layerView===e&&!i?p:u(e)};for(const n of p)if("graphic"in n){a(n.layerView).graphics.push(n.graphic),i=!1}else o.push(n.layerView.fetchPopupFeaturesAtTarget(e,n.geometry,r)),i=!0;return s.forEach(e=>e.resolve(r)),o}async _getPopupHits(e,p){const{hits:t,location:o}=await this.popupHitTest(e);u(p);const s=[];for(const i of t)if("graphic"in i){if(this._isValidPopupGraphic(i.graphic,p)){const e=this._isFeaturePatchingLayerView(i.layerView)?i.layerView:void 0;s.push({graphic:i.graphic,layerView:e})}}else s.push({geometry:i.geometry,layerView:i.layerView});return{hits:s,location:o}}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(p?.defaultPopupTemplateEnabled)}_isFeaturePatchingLayerView(e){return!e||(!("layer"in e)||!e.suspended)&&"patchFeaturesForPopup"in e}};return e([l()],j.prototype,"popup",null),e([l()],j.prototype,"popupElement",void 0),e([l()],j.prototype,"popupEnabled",void 0),j=e([m("esri.views.PopupView")],j),j};class v{constructor(e){this.layerView=e,this._resolver=Promise.withResolvers(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(e){const{layerView:p,graphics:t,_resolver:o}=this;if(!p)return o.resolve(t),o.promise;let s;return p.patchFeaturesForPopup(t,e).catch(e=>(s=e,null)).then(e=>{e?o.resolve(e):o.reject(s)}),o.promise}}const F=5e3;export{_ as PopupView};
|