@arcgis/core 4.34.0-next.41 → 4.34.0-next.43
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/Basemap.js +1 -1
- package/Ground.js +1 -1
- package/PopupTemplate.js +1 -1
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/016d421114118307d4dd.js +1 -0
- package/assets/esri/core/workers/chunks/07eea90733834313e9fa.js +1 -0
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +1 -0
- package/assets/esri/core/workers/chunks/0ebf666564d323d82259.js +1 -0
- package/assets/esri/core/workers/chunks/1a3a4c2c642899be37a0.js +1 -0
- package/assets/esri/core/workers/chunks/20ffac42ff5095af00fe.js +1 -0
- package/assets/esri/core/workers/chunks/{d465e1b3a8a53d9c0a12.js → 24e76fa530fc0c495fb5.js} +1 -1
- package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +1 -0
- package/assets/esri/core/workers/chunks/{9247d768c3eccc0828a9.js → 28d71e1b866113650c75.js} +1 -1
- package/assets/esri/core/workers/chunks/{85bfd380d4f522ff8e83.js → 2ae50b02cdf126a8b562.js} +1 -1
- package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +1 -0
- package/assets/esri/core/workers/chunks/345ed9ac44e47355803e.js +1 -0
- package/assets/esri/core/workers/chunks/5ae6e2b3557fe8730072.js +1 -0
- package/assets/esri/core/workers/chunks/5f28470304b57e24d94c.js +1 -0
- package/assets/esri/core/workers/chunks/{6c167daf115cd6abb3e5.js → 615915e7c48f0a3d0060.js} +1 -1
- package/assets/esri/core/workers/chunks/655b8d24ffe5405f8ba1.js +1 -0
- package/assets/esri/core/workers/chunks/68a69d3fcad6febf55f6.js +22 -0
- package/assets/esri/core/workers/chunks/6b73926feb5c5d957062.js +1 -0
- package/assets/esri/core/workers/chunks/6cd828cfe41e0cab2068.js +1 -0
- package/assets/esri/core/workers/chunks/{6269c4bbf0f224a954e9.js → 6f4079b7a2b45f304ee6.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad106f5f6d6848f40de3.js → 71b222089f5e9dcee474.js} +1 -1
- package/assets/esri/core/workers/chunks/{962c0ef63de1635fb4aa.js → 7e99fc78bd0f40a8ba81.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a27f9b11d03874809ee.js → 8867368ab9b005460f19.js} +17 -10
- package/assets/esri/core/workers/chunks/892623d938583cd0f006.js +1 -0
- package/assets/esri/core/workers/chunks/99daf4b144838fa9ca67.js +1 -0
- package/assets/esri/core/workers/chunks/{31ad9949b08a5b07218c.js → 9aa84b86262fa8334bc4.js} +22 -21
- package/assets/esri/core/workers/chunks/{cca36750c86352c6d1f9.js → a638f1688ac9525a52a7.js} +1 -1
- package/assets/esri/core/workers/chunks/ab3c018c406dcd81ef9e.js +1 -0
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +1 -0
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +1 -0
- package/assets/esri/core/workers/chunks/{9e7af4c3c0f8cf0f5c5b.js → b4251e10621fb3ad03a3.js} +1 -1
- package/assets/esri/core/workers/chunks/b79aa5ba0424641f878b.js +1 -0
- package/assets/esri/core/workers/chunks/b85dbefdb09bc6c99e0d.js +1 -0
- package/assets/esri/core/workers/chunks/bb56defb6dfb9b2c1f27.js +1 -0
- package/assets/esri/core/workers/chunks/c47227a626edc1e1ecf1.js +1 -0
- package/assets/esri/core/workers/chunks/c6da9ba188b627ab3b79.js +1 -0
- package/assets/esri/core/workers/chunks/{9c60599131860f635483.js → cd6398a2951922e13b86.js} +1 -1
- package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +1 -0
- package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +1 -0
- package/assets/esri/core/workers/chunks/{7d082bfcd13ad6e8c89d.js → d552b22219ec795aff89.js} +1 -1
- package/assets/esri/core/workers/chunks/{94850c094e076d81a016.js → dca2b487152cde45fb65.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f523fa4d4ade4316625.js → e19cd07df8ce87e18832.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8d57588267e2fc4406c.js → e3f5afdf133c58b3d161.js} +1 -1
- package/assets/esri/core/workers/chunks/e505a101621de39de280.js +1 -0
- package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +1 -0
- package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +1 -0
- package/assets/esri/core/workers/chunks/{712c740cf58c2e282efc.js → e962e6b47cb7e5a71c24.js} +1 -1
- package/assets/esri/core/workers/chunks/{88308a0dcc479688e67c.js → f1adf8ebc2c1b93857bf.js} +1 -1
- package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +1 -0
- package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +1 -0
- package/assets/esri/core/workers/chunks/f667096ea325f690c4a6.js +1 -0
- package/assets/esri/core/workers/chunks/fe55833c80cf59df9c2b.js +1 -0
- package/assets/esri/core/workers/chunks/fe6fa1f2c2d54d41645e.js +1 -0
- package/chunks/ComponentShader.glsl.js +6 -5
- package/config.js +1 -1
- package/core/floatRGBA.js +1 -1
- package/core/workers/registry.js +1 -1
- package/graphic/graphicOrigins.d.ts +2 -0
- package/interfaces.d.ts +281 -124
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GraphicsLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/MediaLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/support/BuildingFilter.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/MapImage.js +1 -1
- package/networks/Network.js +1 -1
- package/package.json +1 -1
- package/portal/Portal.js +1 -1
- package/portal/PortalItem.js +1 -1
- package/renderers/DotDensityRenderer.js +1 -1
- package/renderers/FlowRenderer.js +1 -1
- package/renderers/VectorFieldRenderer.js +1 -1
- package/renderers/support/ColormapInfo.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/support/AttributeBinsFeatureSet.js +1 -1
- package/rest/support/DirectionsFeature.js +1 -1
- package/rest/support/FindImagesParameters.js +1 -1
- package/rest/support/ImageAreaParameters.js +1 -1
- package/rest/support/ImageBoundaryParameters.js +1 -1
- package/rest/support/ImageDistanceParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageHeightParameters.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/ImagePixelLocationParameters.js +1 -1
- package/rest/support/ImagePointParameters.js +1 -1
- package/rest/support/ImageToMapMultirayParameters.js +1 -1
- package/rest/support/ImageToMapParameters.js +1 -1
- package/rest/support/ImageUrlParameters.js +1 -1
- package/rest/support/MapToImageParameters.js +1 -1
- package/rest/support/MeasureFromImageParameters.js +1 -1
- package/support/revision.js +1 -1
- package/versionManagement/VersionManagementService.js +1 -1
- package/versionManagement/VersioningState.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
- package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/Mesh2D.js +1 -1
- package/views/2d/engine/webgl/VertexStream.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/meshing/SimpleMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
- package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +5 -0
- package/views/3d/support/GaussianSplatWorkerHandle.js +5 -0
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +21 -14
- package/views/3d/webgl-engine/collections/Component/UniformComponentParameters.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js +7 -0
- package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/BackedBufferObject.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +7 -6
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/Draw.js +1 -1
- package/views/support/TileTreeDebugger.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/views/webgl/VertexBuffer.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/FeatureForm/GroupInput.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/00ae094cc21bc42faa54.js +0 -1
- package/assets/esri/core/workers/chunks/01bd8f90e55081e65b38.js +0 -1
- package/assets/esri/core/workers/chunks/1cd15aa69f85ecfa32b0.js +0 -1
- package/assets/esri/core/workers/chunks/21a9f9c0cc1cde2fee90.js +0 -1
- package/assets/esri/core/workers/chunks/2ae0bda04fd5386b462f.js +0 -1
- package/assets/esri/core/workers/chunks/31e6eb2685872baf538a.js +0 -1
- package/assets/esri/core/workers/chunks/3358c1b04490706681cc.js +0 -1
- package/assets/esri/core/workers/chunks/34f677e8c1691c10e4e9.js +0 -1
- package/assets/esri/core/workers/chunks/364fb103cb139f26b455.js +0 -1
- package/assets/esri/core/workers/chunks/4ae15645e68e7f6dd6b7.js +0 -1
- package/assets/esri/core/workers/chunks/5156410dd84ea1232a6c.js +0 -1
- package/assets/esri/core/workers/chunks/560bb06cf1bf30df4af3.js +0 -1
- package/assets/esri/core/workers/chunks/5f11fff5bc16fdec42db.js +0 -1
- package/assets/esri/core/workers/chunks/647cff1eaaf1b622f439.js +0 -1
- package/assets/esri/core/workers/chunks/6b5b609b357924fa35be.js +0 -1
- package/assets/esri/core/workers/chunks/719b89341b26c3568c2f.js +0 -1
- package/assets/esri/core/workers/chunks/791b3130b34b52160c1f.js +0 -1
- package/assets/esri/core/workers/chunks/79b389baf972d329c38d.js +0 -1
- package/assets/esri/core/workers/chunks/7a5808c6e67c43274d86.js +0 -1
- package/assets/esri/core/workers/chunks/7ef7f3925495b9ade88c.js +0 -1
- package/assets/esri/core/workers/chunks/90a9b618058dc41294de.js +0 -1
- package/assets/esri/core/workers/chunks/95f0c15d83d1f38e01d0.js +0 -1
- package/assets/esri/core/workers/chunks/a13a36207f265f720255.js +0 -1
- package/assets/esri/core/workers/chunks/a36be186ad10200c420c.js +0 -1
- package/assets/esri/core/workers/chunks/ad1e5c24c1eae5ab8e45.js +0 -1
- package/assets/esri/core/workers/chunks/b481807b31e59cce9931.js +0 -1
- package/assets/esri/core/workers/chunks/bc27cdd7c415ab166536.js +0 -1
- package/assets/esri/core/workers/chunks/c52314b987c63cd630f7.js +0 -1
- package/assets/esri/core/workers/chunks/d1635a7ab0c204852237.js +0 -1
- package/assets/esri/core/workers/chunks/da228aed337f492456cc.js +0 -1
- package/assets/esri/core/workers/chunks/e08b2e9213d35f85916f.js +0 -1
- package/assets/esri/core/workers/chunks/e95a8c988ef822723503.js +0 -1
- package/assets/esri/core/workers/chunks/ec9ed7c9d64f88fcb806.js +0 -1
- package/assets/esri/core/workers/chunks/fd3009164d5e38fda85f.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{estimateNumberArrayMemory as i}from"../../../core/memoryEstimations.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{generateUID as n}from"../../../core/uid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{i as u}from"../../../chunks/vec32.js";import{create as h,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as m,extentContainsCoords2D as y}from"../../../geometry/support/contains.js";import{newDoubleArray as f,doubleArrayFrom as _}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import v from"../../../graphic/SceneGraphicOrigin.js";import{fallbackObjectIDAttribute as I}from"../../../layers/LayerConstants.js";import{estimateSize as x}from"../../../layers/graphics/dehydratedFeatures.js";import{ImmutableDehydratedPoint as E}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as w}from"../../../layers/graphics/hydratedFeatures.js";import j from"../../../layers/graphics/controllers/I3SOnDemandController.js";import O from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayerView as C}from"../../../support/basemapUtils.js";import{isGraphic as S}from"../../../support/guards.js";import{I3SPointsWorkerHandle as D}from"./I3SPointsWorkerHandle.js";import{LayerView3D as F}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as G}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as A}from"./graphics/QueryEngine.js";import{QueryEngineContext as V}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as P,normalizeEditResultsEvent as L,processAttributeEdits as R}from"./i3s/featureEditing.js";import{getCachedAttributeValue as M}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as H}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as U}from"./i3s/I3SOverrides.js";import{checkRecyclable as Q,checkSpatialReferences as q,containsDraco as T,whenGraphicAttributes as B}from"./i3s/I3SUtil.js";import{attributeLookup as k}from"./support/attributeUtils.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{normalizeHighlightTarget as K,emptyHighlightHandle as Z,isObjectId as $}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as Y}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as J}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as X}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as ee}from"./support/TemporalSceneLayerView.js";import{debugFlags as te}from"../support/debugFlags.js";import{compute as re}from"../support/orientedBoundingBox.js";import{updatingProgress as ie}from"../support/updatingProperties.js";import{Vertices as se}from"../webgl-engine/lib/Attribute.js";import oe from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ae}from"../../layers/support/popupUtils.js";import{getHighlightName as ne}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as le,isInEffectiveScaleRange as de}from"../../support/layerViewUtils.js";import{TaskPriority as ue}from"../../support/Scheduler.js";const he=W();class pe{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}get cachedMemory(){return this.graphics.reduce((e,t)=>x(t)+e,i(this.featureIds)+1024)}}let ce=class extends(ee(z(J(F(oe))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new H((e,t,r)=>fe(e,t,r),e=>this.processor.graphicsCore.recreateGraphics(e)),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),Q(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:e,memoryController:i}),r(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:this.layer,memoryController:e}),q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new X({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set("processor",new G({owner:this,preferredUpdatePolicy:0,scaleVisibilityEnabled:!le(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new j({layerView:this}),T(this.layer.geometryDefinitions)&&(this._worker=new D(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}),a(()=>te.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&te.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||!this._treeDebugger||te.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},o)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,o),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=r(this._treeDebugger),this._i3sOverrides=r(this._i3sOverrides),this._set("processor",r(this.processor)),this._controller=r(this._controller),this._queryEngine=r(this._queryEngine),this._worker=r(this._worker),this._memCache=r(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=r(this._fieldsHelper)}get i3slayer(){return this.layer}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return le()?de(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get _graphicOrigin(){return new v(this.layer)}async whenGraphicAttributes(e,t){return B(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=w(this.loadedGraphics.find(t=>t.uid===e),this.layer),r=this._getObjectIdField();return t?.attributes?.[r]?(t.layer=this.layer,t.sourceLayer=this.layer,t.origin=this._graphicOrigin,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){const r=ne(t),i=this.layer.objectIdField,s=K(e);if(0===s.length)return Z;if(S(s[0])){const e=s;if(null!=k(this.layer.fieldsIndex,e[0].attributes,i)){const t=e.map(e=>k(this.layer.fieldsIndex,e.attributes,i));return this.processor.highlightByObjectIds(t,i,r)}return this.processor.highlightByGraphics(e,r)}return $(s[0])?this.processor.highlightByObjectIds(s,i,r):Z}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return P(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new D(e=>this.view.resourceController.immediate.schedule(e)));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,r,i){if(!ye(r)&&!me(r))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void t.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?be(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=ye(r)?await this._extractBinaryPointPositions(e,r,i):this._extractLegacyPointPositions(r),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;c(a,l,0,a,d,0,o.length);const u=ye(r)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new pe(h,o,r.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,r.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),_e(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const t of p.graphics)this._verticalScale(t.geometry);const g=this.view.stage.renderView.olidRenderHelper;if(g){const e=C(this.view,this.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];g.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&ae(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0),e.serviceObbInIndexSR=re(new se(t,3)),i.isGeographic&&(g(e.serviceObbInIndexSR.center,s,Ie,i),e.serviceObbInIndexSR.center=Ie)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=f(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:p,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?_(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=f(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ve[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,r,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=r.length,n=3;for(let l=0;l<a;l++){const r=l*n;u(Ie,i[r],i[r+1],i[r+2]);const a=!Number.isNaN(i[2]);null==s||(a?m(s,Ie):y(s,Ie))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(Ie[0],Ie[1],Ie[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??n(),g=h*o,m=isNaN(t[g+2])?void 0:t[g+2],y=new E(u,t[g],t[g+1],m),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(xe.property="geometry",xe.graphic=f,xe.oldValue=f.geometry,xe.newValue=y,f.geometry=y,f.level=i,l.graphicUpdateHandler(xe),Ee()),d.push(f);else{const e=n();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,r,i,s){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,i,s),r.attributeInfo=i,this.loadedGraphics.addNode(e.index,r),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),_e(r),this._filterNode(r),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,r)=>e.push(r))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){_e(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach(e=>e.nodeIndex===t&&i.push(e.uid)),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||I}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every((e,t)=>s[t]===o[t])||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&t.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,r=this._excludeObjectIds,i=this._getObjectIdField();for(const s of e.graphics){const e=s.visible,o=this._evaluateClause(t,s),a=!r.has(s.attributes[i]);s.visible=o&&a,e!==s.visible&&(xe.graphic=s,xe.property="visible",xe.oldValue=e,xe.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(xe),Ee())}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:s,resourceController:o}=t,a=new V(s,e,o,()=>this.processor.featureStore,i,r);this._queryEngine=new A({context:a,priority:ue.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await L(t,e);R(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new Y(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],ce.prototype,"processor",void 0),e([l({type:O})],ce.prototype,"filter",void 0),e([l()],ce.prototype,"loadedGraphics",void 0),e([l()],ce.prototype,"i3slayer",null),e([l()],ce.prototype,"layerViewUid",null),e([l()],ce.prototype,"_controller",void 0),e([l()],ce.prototype,"updating",void 0),e([l()],ce.prototype,"suspended",void 0),e([l(ie)],ce.prototype,"updatingProgress",void 0),e([l()],ce.prototype,"updatingProgressValue",null),e([l({readOnly:!0})],ce.prototype,"visibleAtCurrentScale",null),e([l(he.requiredFields)],ce.prototype,"requiredFields",null),e([l(he.availableFields)],ce.prototype,"availableFields",void 0),e([l()],ce.prototype,"_fieldsHelper",void 0),e([l({type:Number})],ce.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],ce.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],ce.prototype,"_excludeObjectIds",null),e([l({readOnly:!0})],ce.prototype,"lodFactor",null),e([l({readOnly:!0})],ce.prototype,"hasM",null),e([l({readOnly:!0})],ce.prototype,"hasZ",null),e([l()],ce.prototype,"contentVisible",null),e([l({readOnly:!0})],ce.prototype,"legendEnabled",null),e([l()],ce.prototype,"_graphicOrigin",null),ce=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],ce);const ge=ce;function me(e){return"pointData"in e}function ye(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function fe(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=M(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function _e(e){const t=e.attributeInfo;if(null==t?.loadedAttributes||null==t.attributeData)return;const r=e.node.index;for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=M(t.attributeData[e],i))}}}function be(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ve={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},Ie=h(),xe={graphic:null,property:null,oldValue:null,newValue:null};function Ee(){xe.graphic=null,xe.property=null,xe.oldValue=null,xe.newValue=null}export{ge as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{estimateNumberArrayMemory as i}from"../../../core/memoryEstimations.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{generateUID as n}from"../../../core/uid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{i as u}from"../../../chunks/vec32.js";import{create as h,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as m,extentContainsCoords2D as y}from"../../../geometry/support/contains.js";import{newDoubleArray as f,doubleArrayFrom as _}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import v from"../../../graphic/SceneGraphicOrigin.js";import{fallbackObjectIDAttribute as I}from"../../../layers/LayerConstants.js";import{estimateSize as x}from"../../../layers/graphics/dehydratedFeatures.js";import{ImmutableDehydratedPoint as E}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as w}from"../../../layers/graphics/hydratedFeatures.js";import j from"../../../layers/graphics/controllers/I3SOnDemandController.js";import O from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayerView as C}from"../../../support/basemapUtils.js";import{isGraphic as S}from"../../../support/guards.js";import{I3SPointsWorkerHandle as D}from"./I3SPointsWorkerHandle.js";import{LayerView3D as F}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as G}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as A}from"./graphics/QueryEngine.js";import{QueryEngineContext as V}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as P,normalizeEditResultsEvent as L,processAttributeEdits as R}from"./i3s/featureEditing.js";import{getCachedAttributeValue as H}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as M}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as U}from"./i3s/I3SOverrides.js";import{checkRecyclable as Q,checkSpatialReferences as q,containsDraco as T,whenGraphicAttributes as B}from"./i3s/I3SUtil.js";import{attributeLookup as k}from"./support/attributeUtils.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{normalizeHighlightTarget as K,emptyHighlightHandle as Z,isObjectId as $}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as Y}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as J}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as X}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as ee}from"./support/TemporalSceneLayerView.js";import{debugFlags as te}from"../support/debugFlags.js";import{compute as re}from"../support/orientedBoundingBox.js";import{updatingProgress as ie}from"../support/updatingProperties.js";import{Vertices as se}from"../webgl-engine/lib/Attribute.js";import oe from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ae}from"../../layers/support/popupUtils.js";import{getHighlightName as ne}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as le,isInEffectiveScaleRange as de}from"../../support/layerViewUtils.js";import{TaskPriority as ue}from"../../support/Scheduler.js";const he=W();class pe{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}get cachedMemory(){return this.graphics.reduce((e,t)=>x(t)+e,i(this.featureIds)+1024)}}let ce=class extends(ee(z(J(F(oe))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new M((e,t,r)=>fe(e,t,r),e=>this.processor.graphicsCore.recreateGraphics(e)),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),Q(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:e,memoryController:i}),r(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:this.layer,memoryController:e}),q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new X({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set("processor",new G({owner:this,preferredUpdatePolicy:0,scaleVisibilityEnabled:!le(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new j({layerView:this}),T(this.layer.geometryDefinitions)&&(this._workerHandle=new D(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}),a(()=>te.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&te.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||!this._treeDebugger||te.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},o)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,o),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=r(this._treeDebugger),this._i3sOverrides=r(this._i3sOverrides),this._set("processor",r(this.processor)),this._controller=r(this._controller),this._queryEngine=r(this._queryEngine),this._workerHandle=r(this._workerHandle),this._memCache=r(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=r(this._fieldsHelper)}get i3slayer(){return this.layer}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return le()?de(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get _graphicOrigin(){return new v(this.layer)}async whenGraphicAttributes(e,t){return B(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=w(this.loadedGraphics.find(t=>t.uid===e),this.layer),r=this._getObjectIdField();return t?.attributes?.[r]?(t.layer=this.layer,t.sourceLayer=this.layer,t.origin=this._graphicOrigin,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){const r=ne(t),i=this.layer.objectIdField,s=K(e);if(0===s.length)return Z;if(S(s[0])){const e=s;if(null!=k(this.layer.fieldsIndex,e[0].attributes,i)){const t=e.map(e=>k(this.layer.fieldsIndex,e.attributes,i));return this.processor.highlightByObjectIds(t,i,r)}return this.processor.highlightByGraphics(e,r)}return $(s[0])?this.processor.highlightByObjectIds(s,i,r):Z}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return P(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._workerHandle&&(this._workerHandle=new D(e=>this.view.resourceController.immediate.schedule(e)));const i=await this._workerHandle.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,r,i){if(!ye(r)&&!me(r))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void t.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?be(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=ye(r)?await this._extractBinaryPointPositions(e,r,i):this._extractLegacyPointPositions(r),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;c(a,l,0,a,d,0,o.length);const u=ye(r)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new pe(h,o,r.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,r.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),_e(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const t of p.graphics)this._verticalScale(t.geometry);const g=this.view.stage.renderView.olidRenderHelper;if(g){const e=C(this.view,this.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];g.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&ae(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0),e.serviceObbInIndexSR=re(new se(t,3)),i.isGeographic&&(g(e.serviceObbInIndexSR.center,s,Ie,i),e.serviceObbInIndexSR.center=Ie)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=f(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:p,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?_(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=f(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ve[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,r,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=r.length,n=3;for(let l=0;l<a;l++){const r=l*n;u(Ie,i[r],i[r+1],i[r+2]);const a=!Number.isNaN(i[2]);null==s||(a?m(s,Ie):y(s,Ie))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(Ie[0],Ie[1],Ie[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??n(),g=h*o,m=isNaN(t[g+2])?void 0:t[g+2],y=new E(u,t[g],t[g+1],m),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(xe.property="geometry",xe.graphic=f,xe.oldValue=f.geometry,xe.newValue=y,f.geometry=y,f.level=i,l.graphicUpdateHandler(xe),Ee()),d.push(f);else{const e=n();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,r,i,s){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,i,s),r.attributeInfo=i,this.loadedGraphics.addNode(e.index,r),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),_e(r),this._filterNode(r),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,r)=>e.push(r))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){_e(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach(e=>e.nodeIndex===t&&i.push(e.uid)),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||I}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every((e,t)=>s[t]===o[t])||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&t.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,r=this._excludeObjectIds,i=this._getObjectIdField();for(const s of e.graphics){const e=s.visible,o=this._evaluateClause(t,s),a=!r.has(s.attributes[i]);s.visible=o&&a,e!==s.visible&&(xe.graphic=s,xe.property="visible",xe.oldValue=e,xe.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(xe),Ee())}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:s,resourceController:o}=t,a=new V(s,e,o,()=>this.processor.featureStore,i,r);this._queryEngine=new A({context:a,priority:ue.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await L(t,e);R(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new Y(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],ce.prototype,"processor",void 0),e([l({type:O})],ce.prototype,"filter",void 0),e([l()],ce.prototype,"loadedGraphics",void 0),e([l()],ce.prototype,"i3slayer",null),e([l()],ce.prototype,"layerViewUid",null),e([l()],ce.prototype,"_controller",void 0),e([l()],ce.prototype,"updating",void 0),e([l()],ce.prototype,"suspended",void 0),e([l(ie)],ce.prototype,"updatingProgress",void 0),e([l()],ce.prototype,"updatingProgressValue",null),e([l({readOnly:!0})],ce.prototype,"visibleAtCurrentScale",null),e([l(he.requiredFields)],ce.prototype,"requiredFields",null),e([l(he.availableFields)],ce.prototype,"availableFields",void 0),e([l()],ce.prototype,"_fieldsHelper",void 0),e([l({type:Number})],ce.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],ce.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],ce.prototype,"_excludeObjectIds",null),e([l({readOnly:!0})],ce.prototype,"lodFactor",null),e([l({readOnly:!0})],ce.prototype,"hasM",null),e([l({readOnly:!0})],ce.prototype,"hasZ",null),e([l()],ce.prototype,"contentVisible",null),e([l({readOnly:!0})],ce.prototype,"legendEnabled",null),e([l()],ce.prototype,"_graphicOrigin",null),ce=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],ce);const ge=ce;function me(e){return"pointData"in e}function ye(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function fe(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=H(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function _e(e){const t=e.attributeInfo;if(null==t?.loadedAttributes||null==t.attributeData)return;const r=e.node.index;for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=H(t.attributeData[e],i))}}}function be(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ve={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},Ie=h(),xe={graphic:null,property:null,oldValue:null,newValue:null};function Ee(){xe.graphic=null,xe.property=null,xe.oldValue=null,xe.newValue=null}export{ge as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import t from"../../../../core/Error.js";import{px2pt as r,pt2px as i}from"../../../../core/screenUtils.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as s}from"../../../../chunks/vec42.js";import{ZEROS as o,ones as l,clone as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import c from"../../../../geometry/Extent.js";import p from"../../../../geometry/Polygon.js";import{create as h,fromBuffer as m,intersectsClippingArea as y,empty as u,expandWithAABB as d,expandWithBuffer as _}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as f}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as g}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as b,needsElevationUpdates2D as C}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as M}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as k}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as v,nanFallbackColor as P}from"./Graphics3DSymbolLayer.js";import{parseCapType as w,parseLineMarkerStyle as L}from"./lineUtils.js";import{initFastSymbolUpdatesState as x,updateFastSymbolUpdatesState as U,getAttributeValue as j,ConvertOptions as S}from"../support/FastSymbolUpdates.js";import{debugFlags as V}from"../../support/debugFlags.js";import{createGeometry as O}from"../../support/engineContent/line.js";import{geometryToRenderInfo as A,geometryToRenderInfoDraped as E}from"../../support/renderInfoUtils/line.js";import{Object3D as D}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as z}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as F}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as G}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";const I=["polyline","polygon","extent"];class W extends v{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,T(t))}async doLoad(){this._fastUpdates=x(this._context.renderer,this._fastVisualVariableConvertOptions());const e=!0;if(this._fastMarkerUpdates=x(this._context.renderer,this._fastVisualVariableConvertOptions(e)),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:r(1))<0)throw new t("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t){const r={...this._getMaterialColorParameters(t),width:this._computeMaterialWidth(this.symbolLayer?.size),hasPolygonOffset:!0,join:this.symbolLayer.join||"miter",cap:w(this.symbolLayer.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:G(this.symbolLayer.pattern)};return 4===t&&this._fastMarkerUpdates?.visualVariables?{...r,...this._fastMarkerUpdates.materialParameters}:this._fastUpdates?.visualVariables?{...r,...this._fastUpdates.materialParameters}:r}_getMaterialColorParameters(e){const t=4===e,r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(r[3]=0),{color:r}}get _materialColor(){return this.symbolLayer.material?.color}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[0]&&(this._materials[0]=new R(this._getMaterialParameters(!1,0))),this._materials[0]}get _ringMaterial(){return null==this._materials[1]&&(this._materials[1]=new R(this._getMaterialParameters(!0,1))),this._materials[1]}get _wireframeLineMaterial(){return null==this._materials[2]&&(this._materials[2]=new R({...this._getMaterialParameters(!1,2),wireframe:!0})),this._materials[2]}get _wireframeRingMaterial(){return null==this._materials[3]&&(this._materials[3]=new R({...this._getMaterialParameters(!0,3),wireframe:!0})),this._materials[3]}get _markerMaterial(){return null==this._materials[4]&&null!=this.symbolLayer.marker&&(this._materials[4]=new F({...this._getMaterialParameters(!1,4),placement:this.symbolLayer.marker.placement,markerPrimitive:L(this.symbolLayer.marker.style)})),this._materials[4]}_getDrivenSize(e){if(this._drivenProperties.size){const t=e.size;return null!=t?i(f(t)):this._getFallbackSize()}return 1}_getDrivenColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(s(r,e??this._getFallbackOpacityAndColor(o)),null==t)||this._drivenProperties.opacity&&(e||this._materialColor)&&(r[3]=t??this._getFallbackOpacity()),r}_getDrivenMarkerColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(s(r,e??this._getFallbackMarkerOpacityAndColor(o)),null==t)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(r[3]=t??this._getFallbackMarkerOpacity()),r}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,I,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,r,t.uid)}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;{const e=this._fastUpdates;if(!U(e,t,this._fastVisualVariableConvertOptions()))return 0;for(const t of this._materials)t instanceof R&&t.setParameters(e.materialParameters);const r=this._fastMarkerUpdates,i=!0;if(!U(r,t,this._fastVisualVariableConvertOptions(i)))return 0;for(const t of this._materials)t instanceof F&&t.setParameters(r.materialParameters)}}return 2}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue),delete t.size),"complete"===t.cap?.type&&(r.cap=w(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push(()=>{for(const e of this._materials)e?.setParameters(r)})}layerOpacityChanged(){for(let e=0;e<5;e++){const t=this._materials[e];t&&t.setParameters(this._getMaterialColorParameters(e))}}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=b(W.elevationModeChangeTypes,r,i);if(1!==a)return a;const s=C(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};for(const t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=H(e.graphic.geometry),a="polygon"===i.type?i.rings:i.paths,s=new Array,o=h(),l=A(i,this._context.elevationProvider,this._context.renderCoordsHelper,t),n="polygon"===i.type?"rings":"paths";this._logGeometryCreationWarnings(l,a,n,"LineSymbol3DLayer");for(let h=0;h<l.lines.length;h++){const t=l.lines[h],a=t.position,n=t.mapPositions;if(null!=this._context.clippingExtent&&(m(n,o),!y(o,this._context.clippingExtent)))continue;const c=this._createGeometry("polygon"===i.type?this._ringMaterial:this._lineMaterial,e,a,n,i.type,1,r);if(s.push(c),V.LINE_WIREFRAMES&&s.push(c.instantiate({material:"polygon"===i.type?this._wireframeRingMaterial:this._wireframeLineMaterial})),null!=this._markerMaterial){const t=c.instantiate({material:this._markerMaterial});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),s.push(t)}}if(0===s.length)return null;const c=this._context.layerViewUid,p=new D({geometries:s,castShadow:!1,layerViewUid:c,graphicUid:r}),u=new k(this,p,null,g,t);return u.alignedSampledElevation=l.sampledElevation,u.needsElevationUpdates=C(t.mode),u}_createGeometry(e,t,r,i,a,s,o){const l=0===s?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,n="polygon"===a,c=this._fastUpdates?.visualVariables.color,p=this._fastUpdates?.visualVariables.size,h=this._fastUpdates?.visualVariables.opacity,m=this._context.layerViewUid,y=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:m}),u={position:r,size:p?null:this._getDrivenSize(t.renderingInfo),color:c?null:this._getDrivenColor(t.renderingInfo),sizeFeature:p?j(p.field,t.graphic):null,colorFeature:c?j(c.field,t.graphic):null,opacityFeature:h?j(h.field,t.graphic):null};return O(e,{overlayInfo:l,removeDuplicateStartEnd:n,mapPositions:i,attributeData:u},y)}_createAsOverlay(e){const t=e.graphic,r=H(t.geometry),i="polygon"===r.type?r.rings:r.paths,a="polygon"===r.type?this._ringMaterial:this._lineMaterial;a.renderPriority=this._renderPriority;const s=V.LINE_WIREFRAMES?"polygon"===r.type?this._wireframeRingMaterial:this._wireframeLineMaterial:null,o=this._markerMaterial;null!=s&&(s.renderPriority=this._renderPriority-.001),null!=o&&(o.renderPriority=this._renderPriority-.002);const l=new Array,n=h(),c=u(),p=E(r,this._context.overlaySR),f="polygon"===r.type?"rings":"paths";this._logGeometryCreationWarnings(p,i,f,"LineSymbol3DLayer");for(const h of p.lines){if(m(h.position,n),!y(n,this._context.clippingExtent))continue;d(c,n);const i=this._createGeometry(a,e,h.position,void 0,r.type,0,t.uid),p=e=>{const r=this._context.layerViewUid,i=new z(e,{layerViewUid:r,graphicUid:t.uid});l.push(i)};if(null!=o){const t=i.instantiate({material:o});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),p(t);const r=this.symbolLayer.marker.placement;"begin"!==r&&"begin-end"!==r||_(n,h.position,0,1),"end"!==r&&"begin-end"!==r||_(n,h.position,h.position.length-3,1)}p(i),V.LINE_WIREFRAMES&&p(i.instantiate({material:s}))}return new M(this,l,c,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return null!=e&&"style"===e.type&&"none"===e.style}_computeMaterialWidth(e){return e=e??r(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?i(1):1:i(e)}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&B(this._getCombinedOpacityAndColor(this._materialColor),this._materials[4],e));if("collection"===i.type)return;const a="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,s=this._getCombinedOpacityAndColor(a);r.useMaterialColor&&B(n(s),this._materials[4],e),this._patternHidesLine&&(s[3]=0),B(s,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,o=s?a.newValue:null,l=null==o&&null==this._markerColor;o&&B(this._getCombinedOpacityAndColor(o),i,e);const n=r.diff.style?.newValue;return n&&e.symbolLayerStatePatches.push(()=>i.setParameters({markerPrimitive:L(n)})),delete t.marker,{changed:s,useMaterialColor:l}}_fastVisualVariableConvertOptions(e=!1){const t=this._getFallbackSize();return new S({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(P):this._getFallbackOpacityAndColor(P),fallbackSize:a(t,t,t)})}_getFallbackOpacityAndColor(t){return e.toUnitRGBA(this._materialColor)??t}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(t){const r=this.symbolLayer?.marker?.color;return e.toUnitRGBA(r)??this._getFallbackOpacityAndColor(t)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}_getFallbackSize(){const e=this.symbolLayer?.size;return null!=e?i(e):1}}function H(e){switch(e.type){case"extent":if(e instanceof c)return p.fromExtent(e);break;case"polygon":case"polyline":return e}return null}function B(e,t,r){null!=t&&r.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function T(e){const t=e.material?.color,r=e.marker?.color??t;return 1===(t?.a??0)&&1===(r?.a??0)}export{W as Graphics3DLineSymbolLayer};
|
|
5
|
+
import e from"../../../../Color.js";import t from"../../../../core/Error.js";import{px2pt as r,pt2px as i}from"../../../../core/screenUtils.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as s}from"../../../../chunks/vec42.js";import{ZEROS as o,ones as l,clone as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import c from"../../../../geometry/Extent.js";import p from"../../../../geometry/Polygon.js";import{create as h,fromBuffer as m,intersectsClippingArea as y,empty as u,expandWithAABB as _,expandWithBuffer as d}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as g}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as f}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as b,needsElevationUpdates2D as C}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as v}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as M}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as k,nanFallbackColor as P}from"./Graphics3DSymbolLayer.js";import{parseCapType as w,parseLineMarkerStyle as L}from"./lineUtils.js";import{initFastSymbolUpdatesState as S,updateFastSymbolUpdatesState as x,getAttributeValue as U,ConvertOptions as j}from"../support/FastSymbolUpdates.js";import{debugFlags as V}from"../../support/debugFlags.js";import{createGeometry as O}from"../../support/engineContent/line.js";import{geometryToRenderInfo as A,geometryToRenderInfoDraped as E}from"../../support/renderInfoUtils/line.js";import{Object3D as D}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as z}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as F}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as G}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";const I=["polyline","polygon","extent"];class W extends k{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,T(t))}async doLoad(){this._fastUpdates=S(this._context.renderer,this._fastVisualVariableConvertOptions());const e=!0;if(this._fastMarkerUpdates=S(this._context.renderer,this._fastVisualVariableConvertOptions(e)),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:r(1))<0)throw new t("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t){const r={...this._getMaterialColorParameters(t),width:this._computeMaterialWidth(this.symbolLayer?.size),hasPolygonOffset:!0,join:this.symbolLayer.join||"miter",cap:w(this.symbolLayer.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:G(this.symbolLayer.pattern),emissiveStrength:this._emissiveStrength??0};return 4===t&&this._fastMarkerUpdates?.visualVariables?{...r,...this._fastMarkerUpdates.materialParameters}:this._fastUpdates?.visualVariables?{...r,...this._fastUpdates.materialParameters}:r}_getMaterialColorParameters(e){const t=4===e,r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(r[3]=0),{color:r}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){return this.symbolLayer.material?.emissive?.strength}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[0]&&(this._materials[0]=new R(this._getMaterialParameters(!1,0))),this._materials[0]}get _ringMaterial(){return null==this._materials[1]&&(this._materials[1]=new R(this._getMaterialParameters(!0,1))),this._materials[1]}get _wireframeLineMaterial(){return null==this._materials[2]&&(this._materials[2]=new R({...this._getMaterialParameters(!1,2),wireframe:!0})),this._materials[2]}get _wireframeRingMaterial(){return null==this._materials[3]&&(this._materials[3]=new R({...this._getMaterialParameters(!0,3),wireframe:!0})),this._materials[3]}get _markerMaterial(){return null==this._materials[4]&&null!=this.symbolLayer.marker&&(this._materials[4]=new F({...this._getMaterialParameters(!1,4),placement:this.symbolLayer.marker.placement,markerPrimitive:L(this.symbolLayer.marker.style)})),this._materials[4]}_getDrivenSize(e){if(this._drivenProperties.size){const t=e.size;return null!=t?i(g(t)):this._getFallbackSize()}return 1}_getDrivenColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(s(r,e??this._getFallbackOpacityAndColor(o)),null==t)||this._drivenProperties.opacity&&(e||this._materialColor)&&(r[3]=t??this._getFallbackOpacity()),r}_getDrivenMarkerColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(s(r,e??this._getFallbackMarkerOpacityAndColor(o)),null==t)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(r[3]=t??this._getFallbackMarkerOpacity()),r}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,I,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,r,t.uid)}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;{const e=this._fastUpdates;if(!x(e,t,this._fastVisualVariableConvertOptions()))return 0;for(const t of this._materials)t instanceof R&&t.setParameters(e.materialParameters);const r=this._fastMarkerUpdates,i=!0;if(!x(r,t,this._fastVisualVariableConvertOptions(i)))return 0;for(const t of this._materials)t instanceof F&&t.setParameters(r.materialParameters)}}return 2}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue),delete t.size),"complete"===t.cap?.type&&(r.cap=w(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push(()=>{for(const e of this._materials)e?.setParameters(r)})}layerOpacityChanged(){for(let e=0;e<5;e++){const t=this._materials[e];t&&t.setParameters(this._getMaterialColorParameters(e))}}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=b(W.elevationModeChangeTypes,r,i);if(1!==a)return a;const s=C(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};for(const t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=H(e.graphic.geometry),a="polygon"===i.type?i.rings:i.paths,s=new Array,o=h(),l=A(i,this._context.elevationProvider,this._context.renderCoordsHelper,t),n="polygon"===i.type?"rings":"paths";this._logGeometryCreationWarnings(l,a,n,"LineSymbol3DLayer");for(let h=0;h<l.lines.length;h++){const t=l.lines[h],a=t.position,n=t.mapPositions;if(null!=this._context.clippingExtent&&(m(n,o),!y(o,this._context.clippingExtent)))continue;const c=this._createGeometry("polygon"===i.type?this._ringMaterial:this._lineMaterial,e,a,n,i.type,1,r);if(s.push(c),V.LINE_WIREFRAMES&&s.push(c.instantiate({material:"polygon"===i.type?this._wireframeRingMaterial:this._wireframeLineMaterial})),null!=this._markerMaterial){const t=c.instantiate({material:this._markerMaterial});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),s.push(t)}}if(0===s.length)return null;const c=this._context.layerViewUid,p=new D({geometries:s,castShadow:!1,layerViewUid:c,graphicUid:r}),u=new M(this,p,null,f,t);return u.alignedSampledElevation=l.sampledElevation,u.needsElevationUpdates=C(t.mode),u}_createGeometry(e,t,r,i,a,s,o){const l=0===s?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,n="polygon"===a,c=this._fastUpdates?.visualVariables.color,p=this._fastUpdates?.visualVariables.size,h=this._fastUpdates?.visualVariables.opacity,m=this._context.layerViewUid,y=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:m}),u={position:r,size:p?null:this._getDrivenSize(t.renderingInfo),color:c?null:this._getDrivenColor(t.renderingInfo),sizeFeature:p?U(p.field,t.graphic):null,colorFeature:c?U(c.field,t.graphic):null,opacityFeature:h?U(h.field,t.graphic):null};return O(e,{overlayInfo:l,removeDuplicateStartEnd:n,mapPositions:i,attributeData:u},y)}_createAsOverlay(e){const t=e.graphic,r=H(t.geometry),i="polygon"===r.type?r.rings:r.paths,a="polygon"===r.type?this._ringMaterial:this._lineMaterial;a.renderPriority=this._renderPriority;const s=V.LINE_WIREFRAMES?"polygon"===r.type?this._wireframeRingMaterial:this._wireframeLineMaterial:null,o=this._markerMaterial;null!=s&&(s.renderPriority=this._renderPriority-.001),null!=o&&(o.renderPriority=this._renderPriority-.002);const l=new Array,n=h(),c=u(),p=E(r,this._context.overlaySR),g="polygon"===r.type?"rings":"paths";this._logGeometryCreationWarnings(p,i,g,"LineSymbol3DLayer");for(const h of p.lines){if(m(h.position,n),!y(n,this._context.clippingExtent))continue;_(c,n);const i=this._createGeometry(a,e,h.position,void 0,r.type,0,t.uid),p=e=>{const r=this._context.layerViewUid,i=new z(e,{layerViewUid:r,graphicUid:t.uid});l.push(i)};if(null!=o){const t=i.instantiate({material:o});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),p(t);const r=this.symbolLayer.marker.placement;"begin"!==r&&"begin-end"!==r||d(n,h.position,0,1),"end"!==r&&"begin-end"!==r||d(n,h.position,h.position.length-3,1)}p(i),V.LINE_WIREFRAMES&&p(i.instantiate({material:s}))}return new v(this,l,c,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return null!=e&&"style"===e.type&&"none"===e.style}_computeMaterialWidth(e){return e=e??r(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?i(1):1:i(e)}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&B(this._getCombinedOpacityAndColor(this._materialColor),this._materials[4],e));if("collection"===i.type)return;const a="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,s=this._getCombinedOpacityAndColor(a);r.useMaterialColor&&B(n(s),this._materials[4],e),this._patternHidesLine&&(s[3]=0),B(s,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,o=s?a.newValue:null,l=null==o&&null==this._markerColor;o&&B(this._getCombinedOpacityAndColor(o),i,e);const n=r.diff.style?.newValue;return n&&e.symbolLayerStatePatches.push(()=>i.setParameters({markerPrimitive:L(n)})),delete t.marker,{changed:s,useMaterialColor:l}}_fastVisualVariableConvertOptions(e=!1){const t=this._getFallbackSize();return new j({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(P):this._getFallbackOpacityAndColor(P),fallbackSize:a(t,t,t)})}_getFallbackOpacityAndColor(t){return e.toUnitRGBA(this._materialColor)??t}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(t){const r=this.symbolLayer?.marker?.color;return e.toUnitRGBA(r)??this._getFallbackOpacityAndColor(t)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}_getFallbackSize(){const e=this.symbolLayer?.size;return null!=e?i(e):1}}function H(e){switch(e.type){case"extent":if(e instanceof c)return p.fromExtent(e);break;case"polygon":case"polyline":return e}return null}function B(e,t,r){null!=t&&r.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function T(e){const t=e.material?.color,r=e.marker?.color??t;return 1===(t?.a??0)&&1===(r?.a??0)}export{W as Graphics3DLineSymbolLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{nullUid as t}from"../../../../../../core/uid.js";import{property as r}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{glLayout as s}from"../../../../support/buffer/glUtil.js";import{SyncRenderPlugin as n}from"../../../../webgl-engine/effects/RenderPlugin.js";import{GLMaterials as o}from"../../../../webgl-engine/lib/GLMaterials.js";import{BoundingVolume as a}from"../../../../webgl-engine/lib/Object3D.js";import{DrawParameters as l}from"../../../../webgl-engine/materials/DrawParameters.js";import{HUDMaterial as u}from"../../../../webgl-engine/materials/HUDMaterial.js";let c=class extends n{constructor(e){super(e),this._glMaterials=null,this._produces=new Map,this._renderGeometries=new Map,this._vaoCache=null,this._drawParameters=new l,this._bufferWriter=null,this.slicePlaneEnabled=!1,this.isGround=!1,this.type=e.material instanceof u?1:0,this.layerViewUid=e.layerViewUid}get produces(){return this._produces}get numFeatures(){const e=6;let t=0;return this._renderGeometries.forEach(r=>t+=r.numElements/e),t}get usedMemory(){let e=0;return this._renderGeometries.forEach(t=>{e+=t.vao.usedMemory}),e}intersect(e,r,i,s){const{material:n,_bufferWriter:o,layerViewUid:l,_renderGeometries:u}=this;null!=o.intersect&&u.forEach(({buffer:r,localOrigin:u,items:c})=>o.intersect(r.data,n.parameters,u,e,i,s,(r,i,s,o)=>{if(!c.visibilities[s])return;const u=c.objectIds[s];e.handleObjectIntersection({object:{id:t,graphicUid:u,layerViewUid:l,boundingVolumeWorldSpace:new a,geometries:[{material:n}]},geometryId:0,primitiveIndex:s},r,i,null,o)}))}initialize(){this._bufferWriter=this.material.createBufferWriter(),this.material.produces.forEach((e,t)=>{this._produces.set(t,t=>8!==t&&5!==t&&e(t))})}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometryBuffer(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e,s=t.produces.get(i.slot);if(!s?.(r))return null;if(8===r||5===r)return null;const n=this._glMaterials.load(e.rctx,i.slot,r);return n?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(0===r.size)return;const{bind:i}=e,s=9===i.slot||10===i.slot?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const o=t.program;for(const[a,l]of r){const{vao:e,localOrigin:r,drawCalls:a}=l;this._drawParameters.origin=r,o.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e),n.bindVAO(e),n.setPipelineState(t.getPipeline(!1,s));for(const i of a)n.drawArrays(t.primitiveType,i.start,i.count)}}initializeRenderContext(e){this._glMaterials=new o(this.material,e.materials),this._vaoCache=e.renderContext.rctx.getVaoCache(s(this._bufferWriter.layout))}uninitializeRenderContext(){}addRenderGeometryBuffer(e,t,r,i){this.removeRenderGeometryBuffer(e);const{data:s,elementCount:n}=t,o=this._vaoCache.newVao(s.byteLength);o.buffer()?.
|
|
5
|
+
import{__decorate as e}from"tslib";import{nullUid as t}from"../../../../../../core/uid.js";import{property as r}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{glLayout as s}from"../../../../support/buffer/glUtil.js";import{SyncRenderPlugin as n}from"../../../../webgl-engine/effects/RenderPlugin.js";import{GLMaterials as o}from"../../../../webgl-engine/lib/GLMaterials.js";import{BoundingVolume as a}from"../../../../webgl-engine/lib/Object3D.js";import{DrawParameters as l}from"../../../../webgl-engine/materials/DrawParameters.js";import{HUDMaterial as u}from"../../../../webgl-engine/materials/HUDMaterial.js";let c=class extends n{constructor(e){super(e),this._glMaterials=null,this._produces=new Map,this._renderGeometries=new Map,this._vaoCache=null,this._drawParameters=new l,this._bufferWriter=null,this.slicePlaneEnabled=!1,this.isGround=!1,this.type=e.material instanceof u?1:0,this.layerViewUid=e.layerViewUid}get produces(){return this._produces}get numFeatures(){const e=6;let t=0;return this._renderGeometries.forEach(r=>t+=r.numElements/e),t}get usedMemory(){let e=0;return this._renderGeometries.forEach(t=>{e+=t.vao.usedMemory}),e}intersect(e,r,i,s){const{material:n,_bufferWriter:o,layerViewUid:l,_renderGeometries:u}=this;null!=o.intersect&&u.forEach(({buffer:r,localOrigin:u,items:c})=>o.intersect(r.data,n.parameters,u,e,i,s,(r,i,s,o)=>{if(!c.visibilities[s])return;const u=c.objectIds[s];e.handleObjectIntersection({object:{id:t,graphicUid:u,layerViewUid:l,boundingVolumeWorldSpace:new a,geometries:[{material:n}]},geometryId:0,primitiveIndex:s},r,i,null,o)}))}initialize(){this._bufferWriter=this.material.createBufferWriter(),this.material.produces.forEach((e,t)=>{this._produces.set(t,t=>8!==t&&5!==t&&e(t))})}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometryBuffer(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e,s=t.produces.get(i.slot);if(!s?.(r))return null;if(8===r||5===r)return null;const n=this._glMaterials.load(e.rctx,i.slot,r);return n?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(0===r.size)return;const{bind:i}=e,s=9===i.slot||10===i.slot?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const o=t.program;for(const[a,l]of r){const{vao:e,localOrigin:r,drawCalls:a}=l;this._drawParameters.origin=r,o.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e),n.bindVAO(e),n.setPipelineState(t.getPipeline(!1,s));for(const i of a)n.drawArrays(t.primitiveType,i.start,i.count)}}initializeRenderContext(e){this._glMaterials=new o(this.material,e.materials),this._vaoCache=e.renderContext.rctx.getVaoCache(s(this._bufferWriter.layout))}uninitializeRenderContext(){}addRenderGeometryBuffer(e,t,r,i){this.removeRenderGeometryBuffer(e);const{data:s,elementCount:n}=t,o=this._vaoCache.newVao(s.byteLength);o.buffer()?.setSubData(new Uint8Array(s),0,0,s.byteLength);const a={localOrigin:i,numElements:n,buffer:t,items:r,vao:o,drawCalls:this._produceDrawCalls(r)};this._renderGeometries.set(e,a)}updateRenderGeometryBuffer(e,t,r,i){const{data:s,elementCount:n}=t,o=this._renderGeometries.get(e);if(null==o)return;this._vaoCache.deleteVao(o.vao);const a=this._vaoCache.newVao(s.byteLength);a.buffer()?.setSubData(new Uint8Array(s),0,0,s.byteLength),o.localOrigin=i,o.numElements=n,o.buffer=t,o.items=r,o.vao=a,o.drawCalls=this._produceDrawCalls(r)}removeRenderGeometryBuffer(e){const t=this._renderGeometries.get(e);null!=t&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}updateVisibility(e,t){const r=this._renderGeometries.get(e);if(null==r)return;const{items:i}=r;if(i.visibilities.length!==t.length)throw new Error("Unexpected mismatch between old and new visibility flag buffer length.");i.visibilities=t,r.drawCalls=this._produceDrawCalls(i)}hasHighlight(){return!1}_produceDrawCalls(e){const{visibilities:t,ranges:r}=e,i=[];if(m(r)){if(0===r.numItems)return[];const e=r.numVertices;let s=null;for(let n=0;n<r.numItems;++n){t[n]?null==s?(s={start:n*e,count:e},i.push(s)):s.count+=e:s=null}}else{const e=r.counts,s=e.length;if(0===s)return[];let n=null,o=0;for(let r=0;r<s;++r){const s=t[r],a=e[r];s?null==n?(n={start:o,count:a},i.push(n)):n.count+=a:n=null,o+=a}}return i}};function m(e){return"numItems"in e}e([r({constructOnly:!0})],c.prototype,"material",void 0),c=e([i("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],c);export{c as DirectRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{validateColorAndOpacity as e,validateColor as r}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as o}from"../../../../core/mathUtils.js";import{uncompressedFormats as
|
|
5
|
+
import{validateColorAndOpacity as e,validateColor as r}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as o}from"../../../../core/mathUtils.js";import{uncompressedFormats as a,compressibleUsages as s}from"./enums.js";import{RenderTexture as t}from"../../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as n}from"../../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Texture as l}from"../../webgl-engine/lib/Texture.js";import{useSchematicPBRI3S as i,useSchematicPBR as u,schematicMRRFactors as c,advancedMRRFactors as m}from"../../webgl-engine/materials/pbrUtils.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";function g(r,o,a){const s=new Map,t=(e,r)=>{if(null==e)return-1;const o=s.get(e.id);if(o)return o.usage|=r,o.id;const a=s.size;return s.set(e.id,{id:a,usage:r}),a},n=o.pbrMetallicRoughness,l=n?.baseColorFactor?e(n.baseColorFactor):null,d=o.emissiveFactor,g=has("disable-feature:diffuse-rendering-i3s")||a?i({normalTexture:o.normalTexture,emissiveTexture:o.emissiveTexture,emissiveFactor:o.emissiveFactor,occlusionTexture:o.occlusionTexture,metallicRoughnessTexture:n?.metallicRoughnessTexture,metallicFactor:n?.metallicFactor,roughnessFactor:n?.roughnessFactor}):u({normalTexture:o.normalTexture,emissiveTexture:o.emissiveTexture,emissiveFactor:o.emissiveFactor,occlusionTexture:o.occlusionTexture,metallicRoughnessTexture:n?.metallicRoughnessTexture,metallicFactor:n?.metallicFactor,roughnessFactor:n?.roughnessFactor}),f=g?c[0]:n?.metallicFactor??m[0],h=g?c[1]:n?.roughnessFactor??m[1],T="mask"===o.alphaMode?33:1,F={baseColorFactor:l?[l[0],l[1],l[2],l[3]]:[1,1,1,1],baseColorTextureId:t(n?.baseColorTexture,T),metallicRoughnessTextureId:t(n?.metallicRoughnessTexture,2),metallicFactor:f,roughnessFactor:h},b={alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,doubleSided:o.doubleSided,cullFace:"none"===o.cullFace?0:"back"===o.cullFace?2:"front"===o.cullFace?1:0,normalTextureId:t(o.normalTexture,4),emissiveTextureId:t(o.emissiveTexture,16),occlusionTextureId:t(o.occlusionTexture,8),emissiveFactor:d?[d[0],d[1],d[2]]:[0,0,0],metallicRoughness:F,wrapTextures:!1,hasParametersFromSource:g},C=[];return s.forEach(({usage:e},o)=>{const a=null!=r&&r[o]&&r[o].formats,s=a?p(a.map(({name:e,format:r})=>({name:e,encoding:x[r]}))):[];C.push({id:o,usage:e,encodings:s})}),{material:b,textures:C}}function p(e){return e.sort((e,r)=>e.encoding-r.encoding)}const x={ktx2:1,basis:2,dds:4,png:8,jpg:16,"ktx-etc2":32},f={"image/ktx2":2,"image/x.basis":2,"image/vnd-ms.dds":4,"image/png":8,"image/jpg":16,"image/jpeg":16,"image/ktx":32};function h(e){const a=e?.materialDefinitions?Object.keys(e.materialDefinitions)[0]:null,s=e?.textureDefinitions?Object.keys(e.textureDefinitions)[0]:null,t=a?e.materialDefinitions?.[a]:null,n=s?e.textureDefinitions?.[s]:null,l=T();if(null!=t){const e=t.params;e.diffuse&&(r(e.diffuse),l.metallicRoughness.baseColorFactor=[e.diffuse[0],e.diffuse[1],e.diffuse[2],1]),null!=e.doubleSided&&(l.doubleSided=e.doubleSided,l.cullFace=e.doubleSided?0:2),"none"!==e.cullFace&&"front"!==e.cullFace&&"back"!==e.cullFace||(l.cullFace="none"===e.cullFace?0:"back"===e.cullFace?2:1),e.transparency&&(l.metallicRoughness.baseColorFactor[3]=o(1-e.transparency,0,1)),(e.useVertexColorAlpha||l.metallicRoughness.baseColorFactor[3]<1)&&(l.alphaMode="blend")}const i=[];if(null!=n){const e=0;!n.wrap||"repeat"!==n.wrap[0]&&"repeat"!==n.wrap[1]||(l.wrapTextures=!0);let r=1;"rgba"===n.channels&&(l.alphaMode="blend",r|=32);const o=n.images.length-1,a=n.images[o],s=e=>e?.split("/").pop(),t=Array.isArray(n.encoding)?p(n.encoding.map((e,r)=>({name:s(a.href[r]),encoding:f[e]||0}))):[{name:s(a.href),encoding:f[n.encoding]||0}];i.push({id:e,usage:r,encodings:t}),l.metallicRoughness.baseColorTextureId=e}return{material:l,textures:i}}const T=()=>({alphaMode:"opaque",alphaCutoff:d,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0});function F(e,r,o,a,s,t){if(null==e?.data)return null;const n=e.data,i=a.renderingContext.parameters.maxMaxAnisotropy,u=i>1,c=o||!r.wrapTextures?b:C,m=k(e.encoding),d=1&e.usage?"opaque"===r.alphaMode?3:4:3,g=P(e.encoding,e.usage)?{compressionTracker:s,compressionCallback:t}:void 0;return new l(n,{mipmap:u,maxAnisotropy:i,encoding:m,wrap:c,components:d,compressionOptions:g,noUnpackFlip:!0})}const b={s:33071,t:33071},C={s:10497,t:10497};function R(r,o,a,s,l,i){const u=i.rendererTextureUsage,g=e=>v(s,a,e&u),p=e(o.metallicRoughness.baseColorFactor);r.baseColor=[p[0],p[1],p[2],p[3]],r.hasParametersFromSource=!!o.hasParametersFromSource,r.usePBR=i.usePBR,r.mrrFactors=[o.metallicRoughness.metallicFactor,o.metallicRoughness.roughnessFactor,o.hasParametersFromSource?c[2]:m[2]],r.emissiveBaseColor=o.emissiveFactor,r.isIntegratedMesh=i.isIntegratedMesh,r.textureAlphaCutoff="mask"===o.alphaMode?o.alphaCutoff:d,r.alphaDiscardMode="opaque"===o.alphaMode?1:"mask"===o.alphaMode?2:3;const x=[],f=g(33);null!=f&&(r.baseColorTexture=new t(l,f),x.push(r.baseColorTexture.loadPromise));const h=g(2);null!=h&&(r.metallicRoughnessTexture=new t(l,h),x.push(r.metallicRoughnessTexture.loadPromise));const T=g(16);null!=T&&(r.emissionTexture=new t(l,T),x.push(r.emissionTexture.loadPromise));const F=g(8);null!=F&&(r.occlusionTexture=new t(l,F),x.push(r.occlusionTexture.loadPromise));const b=g(4);return null!=b&&(r.normalTexture=new t(l,b),x.push(r.normalTexture.loadPromise)),r.commonMaterialParameters.hasSlicePlane=i.slicePlaneEnabled,r.commonMaterialParameters.doubleSided=o.doubleSided,r.commonMaterialParameters.cullFace=o.cullFace,r.ellipsoidMode=n(i.viewSpatialReference),Promise.all(x)}function w(e){const r=!!e.compressedTextureS3TC,o=!!e.compressedTextureETC,a=has("disable-feature:i3s-basis")?0:3;return 24|(r?4|a:0)|(o?a:0)}function M(e,r){if(null!=r)return e.find(e=>0!==(e.encoding&r))}function v(e,r,o){if(null==e||0===o)return null;for(let a=0;a<e.length;a++){const s=e[a];if(null!=s&&0!==(s.usage&o)){const e=r[a];return null!=e?e.id:null}}return null}function P(e,r){return!!has("enable-feature:esri-compress-IM-textures")&&(0!==(e&a)&&!(r&~s))}function k(e){switch(e){case 1:return"image/ktx2";case 2:return"image/x.basis";case 4:return"image/vnd-ms.dds";case 8:return"image/png";case 16:return"image/jpeg";case 32:return"image/ktx";default:return""}}export{R as configureMaterial,F as createTexture,T as defaultMaterial,g as getMaterialAndTextures,h as getMaterialAndTexturesFromShared,w as getSupportedEncodings,M as selectEncoding};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../request.js";import{binaryIndexOf as t}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{invert as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i,t as s,c as a}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as c}from"../../../../geometry/projectionUtils.js";import u from"../../../../geometry/SpatialReference.js";import{projectVectorToVector as f}from"../../../../geometry/projection/projectVectorToVector.js";import{create as p,empty as m,expandPointInPlace as d,intersects as h}from"../../../../geometry/support/aaBoundingRect.js";import{a as y}from"../../../../chunks/sphere.js";import{fetchFeaturePopupFeatures as g}from"../../../../layers/support/featurePopupQueryUtils.js";import b from"../../../../rest/support/Query.js";import{readBinaryAttribute as w,getCachedAttributeValue as x}from"./I3SBinaryReader.js";import{computeGlobalTransformation as v}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as S,createMaterialFromEdges as M}from"../support/edgeUtils.js";import{parseColorMixMode as R}from"../support/symbolColorUtils.js";import{Obb as j,compute as I}from"../../support/orientedBoundingBox.js";import{spatialReferenceIncompatibleError as T}from"../../../support/layerViewUtils.js";function k(e){return e?parseInt(e.slice(e.lastIndexOf("/")+1),10):void 0}function U(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function W(e,t,r,o){r.traverse(t,t=>{const r=t.serviceMbsInIndexSR;return 0!==(null!=r&&q(e,r))&&(o(t),!0)})}function C(e,t,r){let o=0,n=0;for(let i=0;i<t.length&&o<e.length;i++)e[o]===t[i]&&(r(i)&&(e[n]=e[o],n++),o++);e.length=n}function A(e,r,o){let n=0,i=0;for(;n<o.length;){t(e,o[n])>=0===r&&(o[i]=o[n],i++),n++}o.length=i}function K(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return L[0]=(e[0]-t.position[0])/t.rotationScale[0],L[1]=(e[1]-t.position[1])/t.rotationScale[4],L[2]=(e[2]-t.position[0])/t.rotationScale[0],L[3]=(e[3]-t.position[1])/t.rotationScale[4],L}const L=p();function q(e,t){const r=t[0],o=t[1],n=t[3],i=e[0]-r,s=r-e[2],a=e[1]-o,l=o-e[3],c=Math.max(i,s,0),u=Math.max(a,l,0),f=c*c+u*u;if(f>n*n)return 0;if(f>0)return 1;return-Math.max(i,s,a,l)>n?3:2}function F(e,t,r){const o=[],n=r?.missingFields,i=r?.originalFields;let s=!1;for(const a of e){const e=t.get(a);e?(i?.push(a),o.push(e.name),a!==e.name&&(s=!0)):n?.push(a)}return r&&"hasMismatchedCasing"in r&&(r.hasMismatchedCasing=s),o}async function G(e,t,o,n,i,s){if(0===t.length)return[];const a=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await O(e.associatedLayer,t,n,s)}catch(l){if(e.associatedLayer.loaded)throw l}if(a){const r=P(e,t,o,i),l=e.parsedUrl.path;return await Promise.allSettled(r.map(t=>E(l,a,t.node,t.indices,n,e.apiKey,e.customParameters,s).then(e=>{for(let r=0;r<t.graphics.length;r++){const o=t.graphics[r],n=e[r];if(o.attributes)for(const e in o.attributes)e in n||(n[e]=o.attributes[e]);o.attributes=n}}))),t}throw new r("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function P({globalIdField:e},t,r,o){const n=new Map,i=[],s=o();for(const a of t){const t=a.attributes?.[r],o=null==t?a.getGlobalId():void 0;for(let r=0;r<s.length;r++){const l=s[r],c=B(l,t,e,o);if(c<0)continue;let u=n.get(l.node);u||(u={node:l.node,indices:[],graphics:[]},i.push(u),n.set(l.node,u)),u.indices.push(c),u.graphics.push(a);for(let e=r;e>0;e--)s[e]=s[e-1];s[0]=l;break}}return i}function B(e,t,r,o){if(null!=t&&"number"==typeof t)return e.featureIds.indexOf(t);if(null==o||null==r)return-1;const n=e.attributeInfo?.attributeData?.[r];return n?n.indexOf(o):-1}async function O(e,t,r,o){const n=[],i={hasMismatchedCasing:!1,originalFields:n},s=F(r,e.fieldsIndex,i),a=new b({outFields:[...s]});if(await g(e,t,a,{updateSourceAttributes:!0,...o}),!i.hasMismatchedCasing)return t;for(let l=0;l<t.length;l++){const e=t[l];if(e.attributes)for(let t=0;t<n.length;t++){const r=n[t],o=s[t];o in e.attributes&&(e.attributes[r]=e.attributes[o],delete e.attributes[o])}}return t}function E(e,t,r,o,n,i,s,a){return V(e,t,r.resources.attributes,o,n,i,s,a)}async function V(t,r,o,n,i,s,a,l){const c=[];for(const e of r)if(e&&i.includes(e.name)){const r=`${t}/nodes/${o}/attributes/${e.key}/0`;c.push({url:r,storageInfo:e})}const u=await Promise.allSettled(c.map(t=>e(t.url,{responseType:"array-buffer",query:{...a,token:s},signal:l?.signal}).then(e=>w(t.storageInfo,e.data)))),f=[];for(const e of n){const t={};for(let r=0;r<u.length;r++){const o=u[r];if("fulfilled"===o.status){const n=o.value;t[c[r].storageInfo.name]=x(n,e)}}f.push(t)}return f}function $(e){const t=e.store,o=t.indexCRS||t.geographicCRS,n=void 0===o?t.indexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const i=o?new u(k(o)):e.spatialReference;return i.equals(e.spatialReference)?e.spatialReference:i}function z(e){const t=e.store,o=t.vertexCRS||t.projectedCRS,n=void 0===o?t.vertexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const i=o?new u(k(o)):e.spatialReference;return i.equals(e.spatialReference)?e.spatialReference:i}function Q(e,t,r){if(!c(e,t))throw T("scene layer",e?.wkid,t?.wkid);if("local"===r&&!Z(e,t))throw T("scene layer",e?.wkid,t?.wkid)}function D(e,t,o){if(e.serviceUpdateTimeStamp?.lastUpdate!==t.serviceUpdateTimeStamp?.lastUpdate||!o.isEmpty||e.associatedLayer?.url!==t.associatedLayer?.url)throw new r("layerview:recycle-failed","Could not recycle layerview")}function Z(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function H(e,t,r){const o=$(e),n=z(e);Q(o,t,r),Q(n,t,r)}function J(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&null!=e.vertexAttributes?.position)}function N(e){if(null==e.store?.defaultGeometrySchema||!J(e.store.defaultGeometrySchema))throw new r("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function X(e,t){H(e,t.spatialReference,t.viewingMode)}function Y(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&null!=e.vertexAttributes?.position))}function _(e){if(null==e.store?.defaultGeometrySchema||!Y(e.store.defaultGeometrySchema))throw new r("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function ee(e,t){Q(e.spatialReference,t.spatialReference,t.viewingMode)}function te(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function re(e){return"mesh-3d"===e.type}function oe(e){if(null==e||!te(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.symbols;if(0===t.length)return!0;for(const r of t){if(!re(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||null==e.material?.color||"replace"!==e.material.colorMixMode)return!0}return!1}const ne=S({color:[0,0,0,0],opacity:0});class ie{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function se(e){const t=new ie;let r=!1,o=!1;for(const n of e.symbolLayers.items)if("fill"===n.type&&n.enabled){const e=n.material,i=n.edges;if(null!=e&&!r){const o=e.color,i=R(e.colorMixMode);t.material=null!=o?{color:[o.r/255,o.g/255,o.b/255],alpha:o.a,colorMixMode:i}:{color:[1,1,1],alpha:1,colorMixMode:1},t.castShadows=n.castShadows,r=!0}null==i||o||(t.edgeMaterial=M(i,{}),o=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:1}),t}function ae(e,t){return(0|e)+(0|t)|0}function le(e,t,r,n,l,c,u){if(!c||0===c.length||null==t||!e.serviceMbsInIndexSR)return null;const p=v(e.serviceMbsInIndexSR,l,"none",r,t);o(ge,p);let g=null;const b=()=>{if(!g)if(g=fe,m(me),null!=e.serviceObbInIndexSR){e.serviceObbInIndexSR.transform(de,r,t,l,u),de.getCorners(g);for(const e of g)s(e,e,ge),d(me,e)}else{const o=e.serviceMbsInIndexSR;if(!o)return;const n=o[3];f(y(o),r,he,t),s(he,he,ge),he[2]+=l;for(let e=0;e<8;++e){const t=1&e?n:-n,r=2&e?n:-n,o=4&e?n:-n,i=g[e];a(i,[he[0]+t,he[1]+r,he[2]+o]),d(me,i)}}};let w=1/0,x=-1/0;const S=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;m(pe);const o=r.spatialReference||n,a=r.rings.reduce((e,r)=>r.reduce((e,r)=>(i(he,r[0],r[1],r[2]),f(he,o,he,t),s(he,he,ge),d(pe,he),Math.min(he[2],e)),e),1/0);b(),h(me,pe)&&(w=Math.min(w,a),x=Math.max(x,a))};if(c.forEach(e=>S(e)),w===1/0)return null;const M=(e,t,r)=>{s(he,r,p),e[t]=he[0],e[t+1]=he[1],e[t+2]=he[2],t+=24,r[2]=w,s(he,r,p),e[t]=he[0],e[t+1]=he[1],e[t+2]=he[2],t+=24,r[2]=x,s(he,r,p),e[t]=he[0],e[t+1]=he[1],e[t+2]=he[2]};for(let o=0;o<8;++o)M(ye.data,3*o,g[o]);return I(ye)}function ce(e){return e[3]>=0}function ue(e){null!=e&&(e[3]=-1)}const fe=[l(),l(),l(),l(),l(),l(),l(),l()],pe=p(),me=p(),de=new j,he=l(),ye={data:new Array(72),size:3,exclusive:!0,stride:3},ge=n();export{ie as SymbolInfo,ae as addWraparound,ee as checkPointCloudLayerCompatibleWithView,_ as checkPointCloudLayerValid,D as checkRecyclable,X as checkSceneLayerCompatibleWithView,N as checkSceneLayerValid,Q as checkSpatialReference,H as checkSpatialReferences,le as computeVisibilityObb,U as containsDraco,k as extractWkid,C as filterInPlace,F as findFieldsCaseInsensitive,W as findIntersectingNodes,K as getClipRect,$ as getIndexCrs,se as getSymbolInfo,z as getVertexCrs,q as intersectBoundingRectWithMbs,ue as invalidateMbs,Z as isSupportedLocalModeProjection,ce as isValidMbs,A as objectIdFilter,V as queryAttributesFromCachedAttributesId,oe as rendererNeedsTextures,ne as transparentEdgeMaterial,G as whenGraphicAttributes};
|
|
5
|
+
import e from"../../../../request.js";import{binaryIndexOf as t}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{invert as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as s,t as i,c as a}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as c}from"../../../../geometry/projectionUtils.js";import u from"../../../../geometry/SpatialReference.js";import{projectVectorToVector as f}from"../../../../geometry/projection/projectVectorToVector.js";import{create as p,empty as m,expandPointInPlace as d,intersects as h}from"../../../../geometry/support/aaBoundingRect.js";import{a as y}from"../../../../chunks/sphere.js";import{fetchFeaturePopupFeatures as g}from"../../../../layers/support/featurePopupQueryUtils.js";import b from"../../../../rest/support/Query.js";import{readBinaryAttribute as w,getCachedAttributeValue as v}from"./I3SBinaryReader.js";import{computeGlobalTransformation as x}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as S,createMaterialFromEdges as M}from"../support/edgeUtils.js";import{parseColorMixMode as j}from"../support/symbolColorUtils.js";import{Obb as R,compute as I}from"../../support/orientedBoundingBox.js";import{emissiveStrengthDefault as T}from"../../webgl-engine/core/shaderLibrary/output/Emissions.glsl.js";import{spatialReferenceIncompatibleError as k}from"../../../support/layerViewUtils.js";function U(e){return e?parseInt(e.slice(e.lastIndexOf("/")+1),10):void 0}function W(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function C(e,t,r,o){r.traverse(t,t=>{const r=t.serviceMbsInIndexSR;return 0!==(null!=r&&F(e,r))&&(o(t),!0)})}function A(e,t,r){let o=0,n=0;for(let s=0;s<t.length&&o<e.length;s++)e[o]===t[s]&&(r(s)&&(e[n]=e[o],n++),o++);e.length=n}function K(e,r,o){let n=0,s=0;for(;n<o.length;){t(e,o[n])>=0===r&&(o[s]=o[n],s++),n++}o.length=s}function L(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return q[0]=(e[0]-t.position[0])/t.rotationScale[0],q[1]=(e[1]-t.position[1])/t.rotationScale[4],q[2]=(e[2]-t.position[0])/t.rotationScale[0],q[3]=(e[3]-t.position[1])/t.rotationScale[4],q}const q=p();function F(e,t){const r=t[0],o=t[1],n=t[3],s=e[0]-r,i=r-e[2],a=e[1]-o,l=o-e[3],c=Math.max(s,i,0),u=Math.max(a,l,0),f=c*c+u*u;if(f>n*n)return 0;if(f>0)return 1;return-Math.max(s,i,a,l)>n?3:2}function G(e,t,r){const o=[],n=r?.missingFields,s=r?.originalFields;let i=!1;for(const a of e){const e=t.get(a);e?(s?.push(a),o.push(e.name),a!==e.name&&(i=!0)):n?.push(a)}return r&&"hasMismatchedCasing"in r&&(r.hasMismatchedCasing=i),o}async function P(e,t,o,n,s,i){if(0===t.length)return[];const a=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await E(e.associatedLayer,t,n,i)}catch(l){if(e.associatedLayer.loaded)throw l}if(a){const r=B(e,t,o,s),l=e.parsedUrl.path;return await Promise.allSettled(r.map(t=>V(l,a,t.node,t.indices,n,e.apiKey,e.customParameters,i).then(e=>{for(let r=0;r<t.graphics.length;r++){const o=t.graphics[r],n=e[r];if(o.attributes)for(const e in o.attributes)e in n||(n[e]=o.attributes[e]);o.attributes=n}}))),t}throw new r("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function B({globalIdField:e},t,r,o){const n=new Map,s=[],i=o();for(const a of t){const t=a.attributes?.[r],o=null==t?a.getGlobalId():void 0;for(let r=0;r<i.length;r++){const l=i[r],c=O(l,t,e,o);if(c<0)continue;let u=n.get(l.node);u||(u={node:l.node,indices:[],graphics:[]},s.push(u),n.set(l.node,u)),u.indices.push(c),u.graphics.push(a);for(let e=r;e>0;e--)i[e]=i[e-1];i[0]=l;break}}return s}function O(e,t,r,o){if(null!=t&&"number"==typeof t)return e.featureIds.indexOf(t);if(null==o||null==r)return-1;const n=e.attributeInfo?.attributeData?.[r];return n?n.indexOf(o):-1}async function E(e,t,r,o){const n=[],s={hasMismatchedCasing:!1,originalFields:n},i=G(r,e.fieldsIndex,s),a=new b({outFields:[...i]});if(await g(e,t,a,{updateSourceAttributes:!0,...o}),!s.hasMismatchedCasing)return t;for(let l=0;l<t.length;l++){const e=t[l];if(e.attributes)for(let t=0;t<n.length;t++){const r=n[t],o=i[t];o in e.attributes&&(e.attributes[r]=e.attributes[o],delete e.attributes[o])}}return t}function V(e,t,r,o,n,s,i,a){return $(e,t,r.resources.attributes,o,n,s,i,a)}async function $(t,r,o,n,s,i,a,l){const c=[];for(const e of r)if(e&&s.includes(e.name)){const r=`${t}/nodes/${o}/attributes/${e.key}/0`;c.push({url:r,storageInfo:e})}const u=await Promise.allSettled(c.map(t=>e(t.url,{responseType:"array-buffer",query:{...a,token:i},signal:l?.signal}).then(e=>w(t.storageInfo,e.data)))),f=[];for(const e of n){const t={};for(let r=0;r<u.length;r++){const o=u[r];if("fulfilled"===o.status){const n=o.value;t[c[r].storageInfo.name]=v(n,e)}}f.push(t)}return f}function z(e){const t=e.store,o=t.indexCRS||t.geographicCRS,n=void 0===o?t.indexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const s=o?new u(U(o)):e.spatialReference;return s.equals(e.spatialReference)?e.spatialReference:s}function Q(e){const t=e.store,o=t.vertexCRS||t.projectedCRS,n=void 0===o?t.vertexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const s=o?new u(U(o)):e.spatialReference;return s.equals(e.spatialReference)?e.spatialReference:s}function D(e,t,r){if(!c(e,t))throw k("scene layer",e?.wkid,t?.wkid);if("local"===r&&!H(e,t))throw k("scene layer",e?.wkid,t?.wkid)}function Z(e,t,o){if(e.serviceUpdateTimeStamp?.lastUpdate!==t.serviceUpdateTimeStamp?.lastUpdate||!o.isEmpty||e.associatedLayer?.url!==t.associatedLayer?.url)throw new r("layerview:recycle-failed","Could not recycle layerview")}function H(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function J(e,t,r){const o=z(e),n=Q(e);D(o,t,r),D(n,t,r)}function N(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&null!=e.vertexAttributes?.position)}function X(e){if(null==e.store?.defaultGeometrySchema||!N(e.store.defaultGeometrySchema))throw new r("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function Y(e,t){J(e,t.spatialReference,t.viewingMode)}function _(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&null!=e.vertexAttributes?.position))}function ee(e){if(null==e.store?.defaultGeometrySchema||!_(e.store.defaultGeometrySchema))throw new r("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function te(e,t){D(e.spatialReference,t.spatialReference,t.viewingMode)}function re(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function oe(e){return"mesh-3d"===e.type}function ne(e){if(null==e||!re(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.symbols;if(0===t.length)return!0;for(const r of t){if(!oe(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||null==e.material?.color||"replace"!==e.material.colorMixMode)return!0}return!1}const se=S({color:[0,0,0,0],opacity:0});class ie{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function ae(e){const t=new ie;let r=!1,o=!1;for(const n of e.symbolLayers.items)if("fill"===n.type&&n.enabled){const e=n.material,s=n.edges;if(null!=e&&!r){const o=e.color,s=j(e.colorMixMode),i={strength:e.emissive?.strength??T,source:"color"===e.emissive?.source?1:0};t.material=null!=o?{color:[o.r/255,o.g/255,o.b/255],alpha:o.a,colorMixMode:s,emissive:i}:{color:[1,1,1],alpha:1,colorMixMode:1,emissive:i},t.castShadows=n.castShadows,r=!0}null==s||o||(t.edgeMaterial=M(s,{}),o=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:1,emissive:{strength:T,source:0}}),t}function le(e,t){return(0|e)+(0|t)|0}function ce(e,t,r,n,l,c,u){if(!c||0===c.length||null==t||!e.serviceMbsInIndexSR)return null;const p=x(e.serviceMbsInIndexSR,l,"none",r,t);o(be,p);let g=null;const b=()=>{if(!g)if(g=pe,m(de),null!=e.serviceObbInIndexSR){e.serviceObbInIndexSR.transform(he,r,t,l,u),he.getCorners(g);for(const e of g)i(e,e,be),d(de,e)}else{const o=e.serviceMbsInIndexSR;if(!o)return;const n=o[3];f(y(o),r,ye,t),i(ye,ye,be),ye[2]+=l;for(let e=0;e<8;++e){const t=1&e?n:-n,r=2&e?n:-n,o=4&e?n:-n,s=g[e];a(s,[ye[0]+t,ye[1]+r,ye[2]+o]),d(de,s)}}};let w=1/0,v=-1/0;const S=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;m(me);const o=r.spatialReference||n,a=r.rings.reduce((e,r)=>r.reduce((e,r)=>(s(ye,r[0],r[1],r[2]),f(ye,o,ye,t),i(ye,ye,be),d(me,ye),Math.min(ye[2],e)),e),1/0);b(),h(de,me)&&(w=Math.min(w,a),v=Math.max(v,a))};if(c.forEach(e=>S(e)),w===1/0)return null;const M=(e,t,r)=>{i(ye,r,p),e[t]=ye[0],e[t+1]=ye[1],e[t+2]=ye[2],t+=24,r[2]=w,i(ye,r,p),e[t]=ye[0],e[t+1]=ye[1],e[t+2]=ye[2],t+=24,r[2]=v,i(ye,r,p),e[t]=ye[0],e[t+1]=ye[1],e[t+2]=ye[2]};for(let o=0;o<8;++o)M(ge.data,3*o,g[o]);return I(ge)}function ue(e){return e[3]>=0}function fe(e){null!=e&&(e[3]=-1)}const pe=[l(),l(),l(),l(),l(),l(),l(),l()],me=p(),de=p(),he=new R,ye=l(),ge={data:new Array(72),size:3,exclusive:!0,stride:3},be=n();export{ie as SymbolInfo,le as addWraparound,te as checkPointCloudLayerCompatibleWithView,ee as checkPointCloudLayerValid,Z as checkRecyclable,Y as checkSceneLayerCompatibleWithView,X as checkSceneLayerValid,D as checkSpatialReference,J as checkSpatialReferences,ce as computeVisibilityObb,W as containsDraco,U as extractWkid,A as filterInPlace,G as findFieldsCaseInsensitive,C as findIntersectingNodes,L as getClipRect,z as getIndexCrs,ae as getSymbolInfo,Q as getVertexCrs,F as intersectBoundingRectWithMbs,fe as invalidateMbs,H as isSupportedLocalModeProjection,ue as isValidMbs,K as objectIdFilter,$ as queryAttributesFromCachedAttributesId,ne as rendererNeedsTextures,se as transparentEdgeMaterial,P as whenGraphicAttributes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as s}from"../../../../core/maybe.js";import t from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,g as a,u as l,e as h,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as m,offset as p,contains as g,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as z}from"./PointCloudHighlights.js";import{isDepth as R,isColorOrColorEmission as y}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as j}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as v}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as q}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as A,g as F}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as E,positionsLayout as H,colorsLayout as M}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as I}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{
|
|
5
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as s}from"../../../../core/maybe.js";import t from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,g as a,u as l,e as h,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as m,offset as p,contains as g,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as z}from"./PointCloudHighlights.js";import{isDepth as R,isColorOrColorEmission as y}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as j}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as v}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as q}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as A,g as F}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as E,positionsLayout as H,colorsLayout as M}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as I}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{PrimitiveType as N}from"../../../webgl/enums.js";import{VertexBuffer as L}from"../../../webgl/VertexBuffer.js";let B=class extends j{constructor(e){super(e),this.type=5,this.isGround=!1,this._passParameters=new A,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlight:(e,s,t)=>this._addHighlight(e,s,t),removeHighlight:(e,s)=>this._removeHighlight(e,s)}),this.produces=new Map([[2,e=>!(R(e)||8===e&&this._highlights.empty)],[3,e=>R(e)]]),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new I,this._nodes=new t}destroy(){this._nodes.prune()}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,s,t,i){const r=d(),f=d(),P=d(),x=d(),z=b(),R=e.camera.perScreenPixelRatio/2,y=e.camera.near;n(f,i,t);const j=1/o(f);a(f,f,j),l(P,f),u(z,f[0],f[1],f[2],-h(f,t));const q=new C,A=new C,F=new Array,E=m(),H=m(this._passParameters.clipBox);p(H,-t[0],-t[1],-t[2],H),this._nodes.forAll(o=>{const a=o.splatSize*this._passParameters.scaleFactor;let l=o.obb.minimumDistancePlane(z),d=o.obb.maximumDistancePlane(z);l-=V(a,l+y,this._passParameters,R,o.isLeaf),d-=V(a,d+y,this._passParameters,R,o.isLeaf);const u=d<0,m=null!=q.dist&&null!=A.dist&&q.dist<l*j&&A.dist>d*j;if(u||m)return;const b=O(a,d+y,this._passParameters,R,o.isLeaf);if(!o.obb.intersectRay(t,f,b))return;const S=b*b;o.obb.toAaBoundingBox(E),p(E,-t[0],-t[1],-t[2],E);const w=!g(H,E);n(x,o.origin,t);const v=o.coordinates.length/3;for(let n=0;n<v;n++){if(r[0]=x[0]+o.coordinates[3*n],r[1]=x[1]+o.coordinates[3*n+1],r[2]=x[2]+o.coordinates[3*n+2],w&&!_(H,r))continue;const l=h(r,f),d=c(r)-l*l;if(d>S)continue;let u=l+y;const m=V(a,u,this._passParameters,R,o.isLeaf);if(l-m<0)continue;u-=m;const p=O(a,u,this._passParameters,R,o.isLeaf);if(d>p*p)continue;const g=(l-m)*j,b=e=>(e.point=T(o,n,e.point),e.dist=g,e.normal=P,e.node=o,e.pointId=n,e.layerViewUid=this.layerViewUid,e);if((null==q.dist||g<q.dist)&&(null==s||s(t,i,g))&&b(q),0!==e.options.store&&(null==A.dist||g>A.dist)&&(null==s||s(t,i,g))&&b(A),2===e.options.store&&(null==s||s(t,i,g))){const e=new C;F.push(b(e))}}});const M=e=>{const{layerViewUid:s,node:t,pointId:i}=e;return new w(e.point,s,i,()=>this.createGraphic(t,i,e.point))},I=(e,s)=>{const t=M(s);e.set(this.type,t,s.dist,s.normal)};if(k(q)){const s=e.results.min;(null==s.distance||q.dist<s.distance)&&I(s,q)}if(k(A)&&0!==e.options.store){const s=e.results.max;(null==s.distance||A.dist>s.distance)&&I(s,A)}if(2===e.options.store){const s=S(t,i);for(const t of F){const i=new v(s);I(i,t),e.results.all.push(i)}}}acquireTechniques(e){const s=8===e.output;return 0!==this._nodes.length&&(y(e.output)||R(e.output)&&3===e.bind.slot||s)?(this._nodes.forAll(s=>this._initNode(e,s)),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=s&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._context.techniques.get(E,this._configuration)):null}render(e,s){const{rctx:t,bind:i,output:r}=e,n=t.bindTechnique(s,i,this._passParameters),o=8===r,a=i.highlight?.name??null;o&&!a||this._nodes.forAll(s=>{0===s.coordinates.length||null==s.vao||o&&!s.highlightMap.has(a)||(n.assertCompatibleVertexAttributeLocations(s.vao),n.bindDraw(i,this._passParameters,s),t.bindVAO(s.vao),o?this._renderHighlightFragments(e,s):t.drawArrays(N.POINTS,0,s.coordinates.length/3))})}_renderHighlightFragments(e,s){const{highlightMap:t}=s,{rctx:i,bind:r}=e,{highlight:n}=r;if(!n)return;const o=n.name,a=t.get(o);if(!a||0===a.length)return;const{highlightOrderMap:l,highlightLevel:h}=r;if(null==h)return;for(const g of t.keys())if(g!==o){const e=l.get(g);if(void 0!==e&&e>h)return}let c=0,d=a[0].componentIndex,u=d+1;const m=()=>{for(;c<a.length&&a[c].id.highlightName!==o;)d=a[c].componentIndex,++c;u=d+1};m();const p=(e,s)=>{const t=s-e;t>0&&i.drawArrays(N.POINTS,e,t)};for(;c<a.length;){const e=a[c];if(e.id.highlightName!==o){p(d,u),++c,m();continue}const s=e.componentIndex;s!==u&&(p(d,u),d=s),u=s+1,++c}p(d,u)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!x(this._passParameters.clipBox,P,(e,s)=>e===s)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace(i=>i.id!==e||(t=i,i.vao=s(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),t}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll(e=>e.vao=s(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,s){return this._highlights.add(e,s)}_addHighlight(e,s,t){e.addHighlight(s,t),this._requestRender()}_removeHighlight(e,s){e.removeHighlight(s),this._requestRender()}_initNode(e,s){s.vao??=new q(e.rctx,new Map([["positions",new L(e.rctx,H,s.coordinates)],["colors",new L(e.rctx,M,s.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}};function O(e,s,t,i,r){if(t.drawScreenSpace)return t.fixedSize*s*i;const n=F(r)*s*i;return t.useFixedSizes?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*s*i,e/2),n):Math.min(e/2,n)}function V(e,s,t,i,r){return t.drawScreenSpace?0:O(e,s,t,i,r)}function T(e,s,t){return null==t&&(t=d()),t[0]=e.origin[0]+e.coordinates[3*s],t[1]=e.origin[1]+e.coordinates[3*s+1],t[2]=e.origin[2]+e.coordinates[3*s+2],t}e([i({constructOnly:!0})],B.prototype,"createGraphic",void 0),B=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],B);class C{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function k(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}export{B as PointCloudRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../../../Graphic.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../../geometry/Polygon.js";import{toExtent as s}from"../../../../geometry/support/aaBoundingRect.js";import l from"../../../../symbols/SimpleFillSymbol.js";import{TileTreeDebugger as
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../../../Graphic.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../../geometry/Polygon.js";import{toExtent as s}from"../../../../geometry/support/aaBoundingRect.js";import l from"../../../../symbols/SimpleFillSymbol.js";import{TileTreeDebugger as a}from"../../../support/TileTreeDebugger.js";let p=class extends a{get _flowSubView(){const{layerView:e}=this;return"imagery-3d"===e.type?e.test.subView:e.test.flowSubView}constructor(e,r=!0){super(e),this._fullExtentGraphic=null,this.enableLabels=r}clear(){super.clear(),this._fullExtentGraphic&&(this.view.graphics.remove(this._fullExtentGraphic),this._fullExtentGraphic=null)}update(){super.update();const e=this._flowSubView.layer.fullExtent;this._fullExtentGraphic=new r({geometry:e,symbol:new l({color:[0,0,0,0],outline:{color:"black",width:3}})}),this.view.graphics.add(this._fullExtentGraphic)}getTiles(){const e=null!=this.view.basemapTerrain.spatialReference?this.view.basemapTerrain.spatialReference:null,r=this._flowSubView.test.renderedTiles;return this.view.basemapTerrain.test.getRenderedTiles().map(t=>{const o=r?.has(t)?[0,255,0,.3]:[255,0,0,.3],a=new l({color:o,outline:{color:"black",width:1}});return{...t,lij:t.lij,level:t.level,geometry:i.fromExtent(s(t.extent,e)),label:t.lij.toString(),polygonSymbol:a}})}};e([t()],p.prototype,"layerView",void 0),p=e([o("esri.views.3d.layers.support.FlowTileTree3DDebugger")],p);export{p as FlowTileTree3DDebugger};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as n}from"../../../geometry/support/aaBoundingBox.js";class e{constructor(t){this.newSortOrder=t}}let a=t(),r=t();const o=n();let s=null,l=null;const i=10,h=20,c=.25;function f(t){let n=!1;for(let e=0;e<t.length;e+=3){const a=t[e],r=t[e+1],s=t[e+2];n?(o[0]=Math.min(o[0],a),o[3]=Math.max(o[3],a),o[1]=Math.min(o[1],r),o[4]=Math.max(o[4],r),o[2]=Math.min(o[2],s),o[5]=Math.max(o[5],s)):(o[0]=o[3]=a,o[1]=o[4]=r,o[2]=o[5]=s,n=!0)}n||(o[0]=o[3]=0,o[1]=o[4]=0,o[2]=o[5]=0)}function m(t,n){s?.length!==t&&(s=new Uint32Array(t)),l&&l.length===1+(1<<n)?l.fill(0):l=new Uint32Array(1+(1<<n))}function u(t,n,e){const a=e[0],r=e[1],f=e[2],u=t.length/3,M=Math.max(i,Math.min(h,Math.round(Math.log2(u/c)))),g=1+(1<<M);m(u,M);let b=0,x=0;for(let s=0;s<8;++s){const t=(1&s?o[0]:o[3])*a+(2&s?o[1]:o[4])*r+(4&s?o[2]:o[5])*f;0===s?b=x=t:(b=Math.min(b,t),x=Math.max(x,t))}const w=x-b;if(w<1e-6)for(let o=0;o<u;++o)s[o]=0,l[0]++;else{const n=(1<<M)/w;for(let e=0,o=0;e<u;++e){const i=(t[o++]*a+t[o++]*r+t[o++]*f-b)*n>>>0;s[e]=i,l[i]++}}for(let o=1;o<g;o++)l[o]+=l[o-1];for(let o=0;o<u;o++){const t=s[o];n[--l[t]]=o}}async function M(t){const{cameraPosition:n,cameraDirection:o,gaussianCenters:s,sortOrder:l}=t;if(0===s.length||0===l.length||l.length!==s.length/3)return{result:new e(l)};const i=.001;return Math.abs(n[0]-a[0])>i||Math.abs(n[1]-a[1])>i||Math.abs(n[2]-a[2])>i||Math.abs(o[0]-r[0])>i||Math.abs(o[1]-r[1])>i||Math.abs(o[2]-r[2])>i?(a=n,r=n,f(s),u(s,l,o),{result:new e(l),transferList:[l.buffer]}):{result:new e(l),transferList:[l.buffer]}}export{e as SplatSortWorkerOutput,M as sortCentersRelativeToCamera};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{WorkerHandle as e}from"../../../core/workers/WorkerHandle.js";class r extends e{constructor(e){super("GaussianSplatSortWorker","sortCentersRelativeToCamera",{sortCentersRelativeToCamera:e=>[e.gaussianCenters.buffer,e.sortOrder.buffer]},e)}sortCentersRelativeToCamera(e,r){return this.invokeMethod("sortCentersRelativeToCamera",e,r)}}export{r as GaussianSplatSortWorkerHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromExtent as s,clone as
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromExtent as s,clone as a}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as i}from"../../../2d/engine/flow/dataUtils.js";import r from"../../layers/FlowSubView3D.js";import{tileToKey as l,FlowDataTile as o}from"./loadUtils.js";import{isRasterTile as n}from"../../terrain/TerrainData.js";let d=class extends r{constructor(e){super(e),this._flowDataTiles=h(),this._resetTileData=!0}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:e,layerIndex:t,layerClass:s})=>{const{renderedTiles:a}=this;null!=a&&t===this._layerIndex&&1===s&&this._updateFlowDataTile(e)})]),this.updatingHandles.add(()=>this.renderedTiles,e=>{const t=h();e?.forEach(e=>{const s=this._flowDataTiles.get(l(e))??this._getFlowDataCopy(e);null!=s&&t.set(l(e),s)}),this._flowDataTiles=t,this._resetTileData=!0,this.triggerLoad()})}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}async fetchDataAndGenerateStreamlines(e,t){const{simulationSettings:a,_flowDataTiles:i,workerHandle:r}=this,{size:l}=e;if(null==a||null==r)return;const o=s(e.extent),n=this._resetTileData;this._resetTileData=!1;const d=h();i.forEach((e,t)=>{"delete"===e?(d.set(t,"delete"),i.delete(t)):(n||"on-worker"!==e)&&(d.set(t,e),i.set(t,"on-worker"))});const c={simulationSettings:a,size:l,flowDataTiles:d,reset:n,extent:o,pixelSize:this.surface.tilingScheme.pixelSize},{streamlines:u}=await r.generateTiledStreamlines(c,t);return u}_getFlowDataCopy(e){const{_layerIndex:t}=this;if(null==t)return null;const s=e.getLayerInfo(t,1);if(s.dataMissing||!e.hasLayerData(t,1))return null;const{data:r}=s;if(!n(r))return null;const l=i(this.layer.serviceRasterInfo.dataType,r.source),d=new Uint8Array(l.width*l.height);for(let a=0;a<d.length;a++)d[a]=l.mask[a];return new o(l.data,d,l.width,l.height,e.lij,a(e.extent))}async _updateFlowDataTile(e){if(this.renderedTiles?.has(e)){const t=this._getFlowDataCopy(e)??"delete";this._setTileData(e,t)}else this._setTileData(e,"delete");await this.triggerLoad()}_setTileData(e,t){this._flowDataTiles.set(l(e),t)}};function h(){return new Map}d=e([t("esri.views.3d.support.flow.FlowSubViewTiles3D")],d);export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{zValueInAbsoluteHeightMode as n}from"../../../../support/elevationInfoUtils.js";import{lineStripsToParameters as r,createGeometry as i}from"../engineContent/line.js";function l(t,l,s,c,h,m){const{spatialReference:p}=
|
|
5
|
+
import t from"../../../../Color.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{zValueInAbsoluteHeightMode as n}from"../../../../support/elevationInfoUtils.js";import{lineStripsToParameters as r,createGeometry as i}from"../engineContent/line.js";function l(t,l,s,c,h,m){const{spatialReference:p}=l.extent,g=[];for(let e=0;e<s.length;e+=3){const r=[s[e],s[e+1]],[i,a]=f(r,l),{absoluteZ:h}=n(i,a,0,p,t,c),m=o(i,a,h);t.renderCoordsHelper.toRenderCoords(m,p,m),g.push(m)}const u=Math.floor(s.length/3),d=e(u);for(let o=0;o<u;o++)d[o]=s[3*o+2];a(d,Math.floor(m.getIntRange(0,d.length)));const j=r([g],void 0,[d]);return i(h,j[0])}function s(o,e,n){if(null==o)return{};const r=t.toUnitRGBA(o.color);return r[3]*=e,{color:r,width:o.trailWidth,cap:2,animationSpeed:o.flowSpeed,trailLength:o.trailLength,animation:3,emissiveStrength:n}}function f([t,o],e){const{extent:n,size:[r,i]}=e;return[t/r*n.width+n.xmin,(i-o)/i*n.height+n.ymin]}function a(t,o){if(0===t.length||o<0||o>=t.length)return;const e=t[o];for(let n=0;n<t.length;n++)t[n]-=e}export{l as createStreamlineGeometry,s as materialParametersFromRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{width as t,height as n,containsXY as l,
|
|
5
|
+
import{width as t,height as n,containsXY as l,create as r}from"../../../../geometry/support/aaBoundingRect.js";import{createFlowFieldFromData as o}from"../../../2d/engine/flow/dataUtils.js";import{getFeatureTileId as u}from"../../layers/support/FeatureTileDescriptor.js";class e{constructor(t,n,l,r,o,u){this.data=t,this.mask=n,this.width=l,this.height=r,this.lij=o,this.extent=u}}function i(t){return u(t.lij[0],t.lij[1],t.lij[2])}function s(t){let[n,l,o,u]=[null,null,null,null];for(const r of t){const t=r.extent;n=a(t[0],n),l=a(t[1],l),o=c(t[2],o),u=c(t[3],u)}return null==n||null==l||null==o||null==u?null:r([n,l,o,u])}function c(t,n){return null==n?t:Math.max(t,n)}function a(t,n){return null==n?t:Math.min(t,n)}function f(r,u,e,i,s){const[c,a]=e;let f=null;const h=new Map;u.forEach(t=>{h.set(t.lij,o(r,t))});const m=(t,n,r)=>l(t.extent,n,r);return(l,r)=>{const o=Math.round(l),e=Math.round(r);if(o<0||o>=c||e<0||e>=a)return[0,0];const p=l/c*t(i)+i[0],j=(a-r)/a*n(i)+i[1];if(null==f||!m(f,p,j)){f=null;for(const[t,n]of u)if(m(n,p,j)){f=n;break}}if(null==f?.data)return[0,0];const d=h.get(f.lij);if(null==d)return[0,0];const x=f.extent;return d((p-x[0])/t(x)*s,s-(j-x[1])/n(x)*s)}}export{e as FlowDataTile,s as boundingRectOfTiles,f as createFlowFieldFromDataTiled,i as tileToKey};
|