@arcgis/core 4.22.0-next.20211021 → 4.22.0-next.20211025
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00ac1ce56f9885a8be83.js +1 -0
- package/assets/esri/core/workers/chunks/01c9afe41ab4ccc597c9.js +1 -0
- package/assets/esri/core/workers/chunks/02a3d14adc504a51fa24.js +1 -0
- package/assets/esri/core/workers/chunks/035a9ab0202d5386b782.js +1 -0
- package/assets/esri/core/workers/chunks/062bace5505f13689c7d.js +1 -0
- package/assets/esri/core/workers/chunks/06c7745d813bcb540ce8.js +1 -0
- package/assets/esri/core/workers/chunks/0950b488a60b2abc21fc.js +1 -0
- package/assets/esri/core/workers/chunks/0af396f2e0de681113ef.js +1 -0
- package/assets/esri/core/workers/chunks/131838059f0f81d8eaee.js +1 -0
- package/assets/esri/core/workers/chunks/146cba0d172ec2f4eba2.js +1 -0
- package/assets/esri/core/workers/chunks/17e49c0dfa5a5a6213e2.js +1 -0
- package/assets/esri/core/workers/chunks/1a0b08190274725dc956.js +1 -0
- package/assets/esri/core/workers/chunks/1add7f0779accdf8d204.js +1 -0
- package/assets/esri/core/workers/chunks/20b81d11e6286d347bfc.js +1 -0
- package/assets/esri/core/workers/chunks/{e596bd3de960d1dc1c57.js → 2207580a78ee292ed9b8.js} +1 -1
- package/assets/esri/core/workers/chunks/2d3646a83465c75986f9.js +1 -0
- package/assets/esri/core/workers/chunks/2d38ee3ef3ebe32a1194.js +1 -0
- package/assets/esri/core/workers/chunks/3737dcc3c0dea3ca05d5.js +1 -0
- package/assets/esri/core/workers/chunks/3e2042e70647c1afa6aa.js +1 -0
- package/assets/esri/core/workers/chunks/3ebfaab2855a2236a95d.js +1 -0
- package/assets/esri/core/workers/chunks/{d6fe616192a8efbfbc3e.js → 440f8101402a4c0d7019.js} +1 -1
- package/assets/esri/core/workers/chunks/4587d770767966985e22.js +1 -0
- package/assets/esri/core/workers/chunks/487b8892fae85810a8c0.js +1 -0
- package/assets/esri/core/workers/chunks/4901a78f32c3ea6b823b.js +1 -0
- package/assets/esri/core/workers/chunks/496fe47fc4d28e1a716d.js +1 -0
- package/assets/esri/core/workers/chunks/{9f22f47d4b2e72d7bdcf.js → 4c010119c24510ea31bb.js} +2 -2
- package/assets/esri/core/workers/chunks/{9f22f47d4b2e72d7bdcf.js.LICENSE.txt → 4c010119c24510ea31bb.js.LICENSE.txt} +0 -0
- package/assets/esri/core/workers/chunks/4f5076e1f2b18ce8156d.js +1 -0
- package/assets/esri/core/workers/chunks/{f291ebc4b089bd1f0a3f.js → 50e86a6bb13042b1dbac.js} +1 -1
- package/assets/esri/core/workers/chunks/{64d9a062c1f1ac08a3ac.js → 565020b1c02a8cb33c2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d78c60a22f76df7c48c7.js → 59640d78295e2e363f18.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0356f320a1b2fbd03f0.js → 5ac2b2598245aa17cdbd.js} +1 -1
- package/assets/esri/core/workers/chunks/5b4a8cce5601cc92c8a3.js +1 -0
- package/assets/esri/core/workers/chunks/5b92d5d4049622531109.js +1 -0
- package/assets/esri/core/workers/chunks/{751c1a2838b54a74a9a6.js → 5f3caa0ddb215342c728.js} +2 -2
- package/assets/esri/core/workers/chunks/615e995d5ce8fa044b09.js +1 -0
- package/assets/esri/core/workers/chunks/62a2453699e0dd2393b9.js +1 -0
- package/assets/esri/core/workers/chunks/67013547be1a7ae1670a.js +1 -0
- package/assets/esri/core/workers/chunks/67eddf4808f8888faeb4.js +1 -0
- package/assets/esri/core/workers/chunks/695dbedff2340aa019ba.js +1 -0
- package/assets/esri/core/workers/chunks/6a7e388c94206d2f61ff.js +1 -0
- package/assets/esri/core/workers/chunks/6e22b69d55e791ab3d9a.js +1 -0
- package/assets/esri/core/workers/chunks/71e6c0c5ef0aa7eb1703.js +1 -0
- package/assets/esri/core/workers/chunks/7a74e230439c5111f852.js +1 -0
- package/assets/esri/core/workers/chunks/7e76a8e6fa67e607d09e.js +1 -0
- package/assets/esri/core/workers/chunks/7fe4985ca0cb3e6d35c6.js +1 -0
- package/assets/esri/core/workers/chunks/8027330714ff5ffb020e.js +1 -0
- package/assets/esri/core/workers/chunks/844b564d1a422a17f6ac.js +1 -0
- package/assets/esri/core/workers/chunks/856f9281a08cb032238e.js +1 -0
- package/assets/esri/core/workers/chunks/89b4983de872780e9aa1.js +1 -0
- package/assets/esri/core/workers/chunks/8f3bc0cd2c2b01ab80cd.js +1 -0
- package/assets/esri/core/workers/chunks/8fd912e325ccd48b98a9.js +1 -0
- package/assets/esri/core/workers/chunks/901907a5c01f0fd1478f.js +1 -0
- package/assets/esri/core/workers/chunks/92a0b88a14c92239df8a.js +1 -0
- package/assets/esri/core/workers/chunks/972e9aeb3c29c9bf441a.js +1 -0
- package/assets/esri/core/workers/chunks/9758c34ce61c3714515a.js +1 -0
- package/assets/esri/core/workers/chunks/{457ea4feaa006d60c6b1.js → 9a04d087a29f0f3937a3.js} +1 -1
- package/assets/esri/core/workers/chunks/9b0bb171224b35ce2031.js +1 -0
- package/assets/esri/core/workers/chunks/9cbe7afdaef8720dfc8d.js +1 -0
- package/assets/esri/core/workers/chunks/9ccde5b6562f0007fe45.js +1 -0
- package/assets/esri/core/workers/chunks/9d320bbeedeea15522ab.js +1 -0
- package/assets/esri/core/workers/chunks/a001b3b4527817548094.js +1 -0
- package/assets/esri/core/workers/chunks/{197b72bca45065e0eb4a.js → a0c580d4a1915ddd3fe4.js} +1 -1
- package/assets/esri/core/workers/chunks/a4a9c15929b43d83701f.js +1 -0
- package/assets/esri/core/workers/chunks/a54d11f44721f808b82f.js +1 -0
- package/assets/esri/core/workers/chunks/a646a11673d513c00e7a.js +1 -0
- package/assets/esri/core/workers/chunks/a792e2bc7cafdc29f05e.js +1 -0
- package/assets/esri/core/workers/chunks/acae1771697034f265b1.js +1 -0
- package/assets/esri/core/workers/chunks/af2ee804a9c63eea610c.js +1 -0
- package/assets/esri/core/workers/chunks/b28b487047da3aeef3fd.js +1 -0
- package/assets/esri/core/workers/chunks/b3e57824a5855cb37a96.js +1 -0
- package/assets/esri/core/workers/chunks/b89449ead32e4cd21edd.js +1 -0
- package/assets/esri/core/workers/chunks/b99891ed5a02cab02173.js +1 -0
- package/assets/esri/core/workers/chunks/bac84bc621be73a7a4bc.js +1 -0
- package/assets/esri/core/workers/chunks/{25037dcf8a0c72b7b647.js → bbe068388167e9dd0c11.js} +1 -1
- package/assets/esri/core/workers/chunks/c271a1857bcc4e9a36dd.js +1 -0
- package/assets/esri/core/workers/chunks/{eb3035e49a45ecc82575.js → c5030664720fcdc6d85e.js} +1 -1
- package/assets/esri/core/workers/chunks/c534ed122f8a1202d3a3.js +1 -0
- package/assets/esri/core/workers/chunks/c5ef2e28b0c539ddb6a7.js +1 -0
- package/assets/esri/core/workers/chunks/c65e5ccfae03d148d82b.js +1 -0
- package/assets/esri/core/workers/chunks/c91660f3982be4e03705.js +1 -0
- package/assets/esri/core/workers/chunks/ce93113b99bdbeddd07b.js +1 -0
- package/assets/esri/core/workers/chunks/cf2d408e669cfa2c65be.js +1 -0
- package/assets/esri/core/workers/chunks/d08f63ffeecefa02ad91.js +1 -0
- package/assets/esri/core/workers/chunks/{8d33644192c01e5416b4.js → d1a71b58ef62e71979c5.js} +1 -1
- package/assets/esri/core/workers/chunks/d30eade5afecd334f6cb.js +1 -0
- package/assets/esri/core/workers/chunks/d8782d0856b9d815cb6c.js +1 -0
- package/assets/esri/core/workers/chunks/db16c21b650001502e6c.js +1 -0
- package/assets/esri/core/workers/chunks/db18110c57253a31ac96.js +1 -0
- package/assets/esri/core/workers/chunks/dbaa5fb466d6c0214f24.js +1 -0
- package/assets/esri/core/workers/chunks/deae370788a7aacf4dd5.js +1 -0
- package/assets/esri/core/workers/chunks/e6ca132e1eeea3aa174e.js +1 -0
- package/assets/esri/core/workers/chunks/e878ccc431729ef3360f.js +1 -0
- package/assets/esri/core/workers/chunks/eb124f15ad4b9193f00a.js +1 -0
- package/assets/esri/core/workers/chunks/ebc71c06c1c22aaef54e.js +1 -0
- package/assets/esri/core/workers/chunks/f183da283af0836421ab.js +1 -0
- package/assets/esri/core/workers/chunks/f42bdc2a134833d33b4e.js +1 -0
- package/assets/esri/core/workers/chunks/{736d628cda4e02d40337.js → f8612c2fc5739e98be58.js} +1 -1
- package/assets/esri/core/workers/chunks/f965e3e5f6f4f9ba54ac.js +1 -0
- package/assets/esri/core/workers/chunks/fa4089640f480b69962e.js +1 -0
- package/assets/esri/core/workers/chunks/fb219563e5169ea67d68.js +1 -0
- package/assets/esri/libs/i3s/i3s.wasm +0 -0
- package/chunks/ChapmanAtmosphere.glsl.js +56 -77
- package/chunks/Clouds.glsl.js +1 -1
- package/chunks/Pattern.glsl.js +9 -11
- package/chunks/RibbonLine.glsl.js +60 -68
- package/chunks/i3s.js +1 -1
- package/chunks/mat4.js +1 -1
- package/chunks/vec3.js +1 -1
- package/core/Collection.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/support/OwningCollection.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workers.js +2 -2
- package/geometry/projection.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +205 -497
- package/layers/ElevationLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VoxelWasmPerScene.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/analyses/AreaMeasurement3D.js +1 -1
- package/layers/analyses/DirectLineMeasurement3D.js +1 -1
- package/layers/analyses/Slice.js +1 -1
- package/layers/effects/EffectList.js +1 -1
- package/layers/effects/effects.js +1 -1
- package/layers/effects/jsonUtils.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/effects/utils.js +5 -0
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/package.json +2 -2
- package/portal/support/portalLayers.js +1 -1
- package/request.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/statistics/support/WorkerClient.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/GraphicsCollection.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/patterns/LinePattern3D.js +5 -0
- package/symbols/patterns/LineStylePattern3D.d.ts +4 -0
- package/symbols/patterns/LineStylePattern3D.js +5 -0
- package/symbols/patterns/StylePattern3D.js +1 -1
- package/symbols/patterns/lineStyles.js +5 -0
- package/symbols/patterns/utils.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +5 -0
- package/symbols/support/Symbol3DMaterial.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/defaults3D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/symbolLayerUtils3D.js +1 -1
- package/views/2d/engine/vectorTiles/TileParser.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/EditsQueue.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/externalRenderers.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
- package/views/3d/interactive/analysisTools/slice/images/Factory.js +5 -0
- package/views/3d/interactive/analysisTools/slice/sliceToolConfig.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/graphics/Slice/SliceController.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/analyses/AreaMeasurement3D/AreaMeasurementView3D.js +1 -1
- package/views/3d/layers/analyses/AreaMeasurement3D/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/layers/analyses/AreaMeasurement3D/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/layers/analyses/DirectLineMeasurement3D/DirectLineMeasurementView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/ElevationQuery.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/Loadable.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/graphics/pointUtils.js +1 -1
- package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/GoToOperation.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/support/StreamDataLoader.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +5 -0
- package/views/3d/support/TextureCollection.js +1 -1
- package/views/3d/support/debugFlags.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +13 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +10 -3
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialTexture.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextTexture.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/support/AllocationTracer.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/QueueProcessor.js +1 -1
- package/views/webgl/capabilities/load.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/BuildingExplorer/support/layerUtils.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0283801d442984997abe.js +0 -1
- package/assets/esri/core/workers/chunks/0419e14a520b8fcf3e7a.js +0 -1
- package/assets/esri/core/workers/chunks/05318446b6a40caea361.js +0 -1
- package/assets/esri/core/workers/chunks/09e714d4381649348ac9.js +0 -1
- package/assets/esri/core/workers/chunks/0cecd668b9d5d3f83293.js +0 -1
- package/assets/esri/core/workers/chunks/13a73a88efd4f464173e.js +0 -1
- package/assets/esri/core/workers/chunks/1576727e8174d672555b.js +0 -1
- package/assets/esri/core/workers/chunks/1a3cbeb0a53d03a51dad.js +0 -1
- package/assets/esri/core/workers/chunks/1b8524b617bfc6fe422c.js +0 -1
- package/assets/esri/core/workers/chunks/1dc1d750046912ff6cef.js +0 -1
- package/assets/esri/core/workers/chunks/21fa174c114640be5e40.js +0 -1
- package/assets/esri/core/workers/chunks/2a3f6e56079620421a02.js +0 -1
- package/assets/esri/core/workers/chunks/2a5bcc73e55986ad93fe.js +0 -1
- package/assets/esri/core/workers/chunks/2a6f2e3d639aae491171.js +0 -1
- package/assets/esri/core/workers/chunks/2c17d1bad17bcee53f7d.js +0 -1
- package/assets/esri/core/workers/chunks/2cea27a0d07aa9a88ad4.js +0 -1
- package/assets/esri/core/workers/chunks/2e193d97d199b29b00c2.js +0 -1
- package/assets/esri/core/workers/chunks/2eb41fdf0d0a3b0c3232.js +0 -1
- package/assets/esri/core/workers/chunks/2f09ea639ca5d1d6ca7e.js +0 -1
- package/assets/esri/core/workers/chunks/2fb847ab1440bd1bdf15.js +0 -1
- package/assets/esri/core/workers/chunks/402d22ebbae608760b4f.js +0 -1
- package/assets/esri/core/workers/chunks/44daef7f0cbc6f6af09f.js +0 -1
- package/assets/esri/core/workers/chunks/46899156159e398c693f.js +0 -1
- package/assets/esri/core/workers/chunks/46bf8921db25845c63c0.js +0 -1
- package/assets/esri/core/workers/chunks/4eb23554e375350f73b5.js +0 -1
- package/assets/esri/core/workers/chunks/551917be63a513dfa4de.js +0 -1
- package/assets/esri/core/workers/chunks/564f6f5484bcb13ebb2b.js +0 -1
- package/assets/esri/core/workers/chunks/61df67ae47b7fb5875d9.js +0 -1
- package/assets/esri/core/workers/chunks/62642a8fc7bafe339984.js +0 -1
- package/assets/esri/core/workers/chunks/6304f4e53027df04eb8f.js +0 -1
- package/assets/esri/core/workers/chunks/6331987617ad166ea098.js +0 -1
- package/assets/esri/core/workers/chunks/6b13fcbc71c0088d317e.js +0 -1
- package/assets/esri/core/workers/chunks/6f7a6841e7269d2764ad.js +0 -1
- package/assets/esri/core/workers/chunks/70110efd2de23d9a5263.js +0 -1
- package/assets/esri/core/workers/chunks/7eae3f0588cde44fce39.js +0 -1
- package/assets/esri/core/workers/chunks/80d3c7a429c6412f1a8d.js +0 -1
- package/assets/esri/core/workers/chunks/80deebdf54bea04a0889.js +0 -1
- package/assets/esri/core/workers/chunks/81aa5fe7dcb4fdeb0974.js +0 -1
- package/assets/esri/core/workers/chunks/840d08b41913cad4df89.js +0 -1
- package/assets/esri/core/workers/chunks/85d154aeb511c5d70bb1.js +0 -1
- package/assets/esri/core/workers/chunks/8681e99e2bc9ece61c43.js +0 -1
- package/assets/esri/core/workers/chunks/8e5ef967f6518f4c93b1.js +0 -1
- package/assets/esri/core/workers/chunks/8edd7f70c8b95c34125c.js +0 -1
- package/assets/esri/core/workers/chunks/9044a7b90a53312b6392.js +0 -1
- package/assets/esri/core/workers/chunks/905b4dfc1ce57a225fa4.js +0 -1
- package/assets/esri/core/workers/chunks/945f90b31ebfae623ea0.js +0 -1
- package/assets/esri/core/workers/chunks/9943fd69b67cd1871d68.js +0 -1
- package/assets/esri/core/workers/chunks/9ad91c23480ffb656030.js +0 -1
- package/assets/esri/core/workers/chunks/9d103681372ab01a4147.js +0 -1
- package/assets/esri/core/workers/chunks/9d3230f59b4c4d1b2713.js +0 -1
- package/assets/esri/core/workers/chunks/9db75bc0980d16b730a1.js +0 -1
- package/assets/esri/core/workers/chunks/a0659b8bdc067da7badd.js +0 -1
- package/assets/esri/core/workers/chunks/a480ee9a994410177961.js +0 -1
- package/assets/esri/core/workers/chunks/a9b279975d7df0f295d7.js +0 -1
- package/assets/esri/core/workers/chunks/aa3abaa5ad4a5a3bcb84.js +0 -1
- package/assets/esri/core/workers/chunks/aa8e607f908297786675.js +0 -1
- package/assets/esri/core/workers/chunks/ab5a302b5f62d38293f9.js +0 -1
- package/assets/esri/core/workers/chunks/abd6a84396e0eb3f01ad.js +0 -1
- package/assets/esri/core/workers/chunks/abe9f8516b03a3fb0477.js +0 -1
- package/assets/esri/core/workers/chunks/aff6aa5c7f75f8e052d9.js +0 -1
- package/assets/esri/core/workers/chunks/b601cc5304b132536239.js +0 -1
- package/assets/esri/core/workers/chunks/b85f614ddbddd3c3007e.js +0 -1
- package/assets/esri/core/workers/chunks/b944f4ab25a691b3e611.js +0 -1
- package/assets/esri/core/workers/chunks/bbdacddb61e651ca0098.js +0 -1
- package/assets/esri/core/workers/chunks/c2fa728e805637a1783e.js +0 -1
- package/assets/esri/core/workers/chunks/c901f5f85d962254fc2c.js +0 -1
- package/assets/esri/core/workers/chunks/ca173b908d89a4e334f6.js +0 -1
- package/assets/esri/core/workers/chunks/cc2ef3bfa1f614d7452c.js +0 -1
- package/assets/esri/core/workers/chunks/cdb32a9ac9f5804c4212.js +0 -1
- package/assets/esri/core/workers/chunks/ce9a4997973da80141a5.js +0 -1
- package/assets/esri/core/workers/chunks/d0674b50a358d3bb9db2.js +0 -1
- package/assets/esri/core/workers/chunks/d18b7b4b3b9bea7204b0.js +0 -1
- package/assets/esri/core/workers/chunks/d2ce983f7babdf18a0ed.js +0 -1
- package/assets/esri/core/workers/chunks/d38a0d867dc6cecdc551.js +0 -1
- package/assets/esri/core/workers/chunks/e39ca33e9e463c1d6060.js +0 -1
- package/assets/esri/core/workers/chunks/e471d103205018a5cf7f.js +0 -1
- package/assets/esri/core/workers/chunks/e542fb044fc96f7e8af2.js +0 -1
- package/assets/esri/core/workers/chunks/e94e00a28591337b2def.js +0 -1
- package/assets/esri/core/workers/chunks/eb2709ccbc001f42ac1b.js +0 -1
- package/assets/esri/core/workers/chunks/f905511ca5f9b59fc17f.js +0 -1
- package/assets/esri/core/workers/chunks/f910e80dd87727af5184.js +0 -1
- package/assets/esri/core/workers/chunks/f9300a24305b0af1d227.js +0 -1
- package/assets/esri/core/workers/chunks/fa1e1ac5b3ef7bdf8a78.js +0 -1
- package/assets/esri/core/workers/chunks/fce76a84c7d25d8d47e8.js +0 -1
- package/assets/esri/core/workers/chunks/fef4f97fbe861a1b60e8.js +0 -1
- package/layers/AreaMeasurementLayer.d.ts +0 -4
- package/layers/DirectLineMeasurementLayer.d.ts +0 -4
- package/symbols/support/symbolPreview.d.ts +0 -4
- package/symbols/support/symbolPreview.js +0 -5
- package/views/3d/layers/AreaMeasurementLayerView3D.d.ts +0 -4
- package/views/3d/layers/DirectLineMeasurementLayerView3D.d.ts +0 -4
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{result as t,forEach as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import s from"../../../core/Logger.js";import{unwrapOr as o,isSome as n,isNone as a,mapSome as d}from"../../../core/maybe.js";import{createAbortController as l,eachAlways as h,isAbortError as u,eachAlwaysValues as p,throwIfAborted as c}from"../../../core/promiseUtils.js";import{pt2px as _}from"../../../core/screenUtils.js";import{estimateSize as m,isArrayBuffer as g}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as f}from"../../../core/unitUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{d as w}from"../../../chunks/vec3.js";import{a as N}from"../../../chunks/vec3f32.js";import{projectBoundingRect as x}from"../../../geometry/projection.js";import{create as P}from"../../../geometry/support/aaBoundingBox.js";import{containsPoint as v,create as C}from"../../../geometry/support/aaBoundingRect.js";import{create as S,fromNormalAndOffset as I}from"../../../geometry/support/plane.js";import{makeDehydratedPoint as A}from"../../../layers/graphics/dehydratedFeatures.js";import k from"../../../layers/support/CodedValue.js";import V from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as R}from"../../../layers/support/fieldUtils.js";import{PromiseQueue as L}from"../../../layers/support/PromiseQueue.js";import{getMetersPerUnit as j}from"../../../symbols/support/unitConversionUtils.js";import{LayerView3D as Q}from"./LayerView3D.js";import{PointCloudWorkerHandle as U}from"./PointCloudWorkerHandle.js";import{checkPointCloudLayerValid as D,checkPointCloudLayerCompatibleWithView as F}from"./i3s/I3SUtil.js";import{nodeDiff as z,sortFrontToBack as M,splitWorkEntries as W}from"./i3s/LoDUtil.js";import O from"./i3s/PagedNodeIndex.js";import{getSplatSizeAlgorithm as E,getFixedSizeAlgorithm as H,getRendererInfo as B,getFilterInfo as G,rendererUsesFixedSizes as q,getAttributeInfo as T}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as $,readGeometry as J,elevationFromPositions as K}from"./i3s/PointCloudWorkerUtil.js";import{PointGraphic as Y}from"./i3s/PointGraphic.js";import{PointRenderer as X}from"./i3s/PointRenderer.js";import{PopupSceneLayerView as Z}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as ee}from"../support/extentUtils.js";import{minimumDistancePlane as te}from"../support/orientedBoundingBox.js";import{updatingProgress as ie}from"../support/updatingProperties.js";import re from"../../layers/LayerView.js";import{extractSafeScaleBounds as se,scaleBoundsPredicate as oe}from"../../support/layerViewUtils.js";import{TaskPriority as ne}from"../../support/Scheduler.js";const ae=s.getLogger("esri.views.3d.layers.PointCloudLayerView3D"),de=8,le=S();let he=class extends(Z(Q(re))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new L,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[]}get pointScale(){const e=E(this.layer&&this.layer.renderer),t=1;return e&&null!=e.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=H(this.layer&&this.layer.renderer),t=!1;return e&&null!=e.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=H(this.layer&&this.layer.renderer),t=0;return e&&null!=e.size?e.size:t}get inverseDensity(){const e=96;return this.layer&&this.layer.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=B(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.primaryAttribute.name);const i=G(this.layer);if(i)for(const r of i)t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of R(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=P(),t=this.view.renderSpatialReference;return ee(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;if(e&&"absolute-height"===e.mode){const t=f(this.layer.spatialReference),i=j(e.unit);return o(e.offset,0)*i/t}return 0}initialize(){const e=this.view.resourceController;this._worker=new U((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._tmpPoint=A(0,0,0,this.layer.spatialReference),D(this.layer),F(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(2),this._dataRequester=e.createStreamDataRequester(3),this._initRenderer();const t=this._initNodePages(),i=this.view.resourceController.memoryController;this._memCache=i.newCache(this.layer.uid),this.updatingHandles.add(this,"_clippingBox",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this,"_elevationOffset",(()=>this._elevationOffsetChanged()),2),this.updatingHandles.add(this.layer,"renderer",(()=>this._rendererChanged()),2),this.updatingHandles.add(this.layer,"filters",(()=>this._reload()),2),this.updatingHandles.add(this.layer,"outFields",(()=>this._reload()),2),this.updatingHandles.add(this.layer,"scaleRangeId",(()=>this._setUpdateViewNeeded())),this.updatingHandles.add(this,"clippingArea",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this.view.state,"contentCamera",(()=>this._setUpdateViewNeeded())),this.handles.add([this.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),i.events.on("quality-changed",(()=>this._setUpdateViewNeeded()))]),this.addResolvingPromise(t),this.when((()=>{this.handles.add([e.scheduler.registerTask(ne.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks((()=>this._idleBegin()),(()=>this._idleEnd())),this.updatingHandles.add(this,"suspended",(e=>{e?this._clearNodeState():this._setUpdateViewNeeded()}),2)])}),(()=>{this.updatingHandles.removeAll(),this.handles.removeAll()}))}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker&&(this._worker.destroy(),this._worker=null),this._destroyRenderer(),this._memCache.destroy(),this._memCache=null,this._codedDomainPopulationAbortController&&(this._codedDomainPopulationAbortController.abort(),this._codedDomainPopulationAbortController=null),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new X({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerUid=this.layer.uid,this.updatingHandles.add(this,"_clippingBox",(e=>this._renderer.clippingBox=e),2),this.updatingHandles.add(this,"suspended",(e=>this._setPointsVisible(!e)),2),this.updatingHandles.add(this,"pointScale",(e=>this._renderer.scaleFactor=e),2),this._renderer.minSizePx=Math.sqrt(2),this.updatingHandles.add(this,"useRealWorldSymbolSizes",(e=>this._renderer.useRealWorldSymbolSizes=e),2),this.updatingHandles.add(this,"pointSize",(e=>{const t=_(e);this._renderer.size=e,this._renderer.sizePx=t}),2),this.updatingHandles.add(this,"slicePlaneEnabled",(e=>this._renderer.slicePlane=e),2),this.updatingHandles.add(this,"inverseDensity",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this,"maximumPointCount",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this.view,"qualitySettings.sceneService.pointCloud.lodFactor",(e=>{this._lodFactor=e,this._setUpdateViewNeeded()}),2)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i){const r=n(e.pointIdFilterMap)?e.pointIdFilterMap[t]:t,s=this.view.computeMapPointFromVec3d(i),o=this._createGraphicAttributes(e,r);return new Y({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:r,epoch:this._nodeLoadEpoch},geometry:s,attributes:o,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_encodeGraphicAttribute(e,t,i,r){const s=e.storageInfo&&e.storageInfo.attributeValues,o=s?s.valuesPerElement:1;if(1===o)r[e.name]=t[i];else if("UInt8"===s.valueType&&o<=4){let s=0;const n=i*o;for(let e=n;e<n+o;e++)s=(s<<8)+t[e];r[e.name]=s}else r[e.name]=void 0}_setPointsVisible(e){e&&!this._rendererAdded?(this.view._stage.addRenderPlugin([3],this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view._stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=q(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_scaleUpdateHandler(e){this.layer.minScale||this.layer.maxScale?x(e.extent,e.spatialReference,pe,this.layer.spatialReference)&&(this._nodeScales.forEach(((t,i)=>{if(!this._renderedNodes.has(i))return void this._nodeScales.delete(i);const r=this._index.getNode(i);v(pe,r.obb.center)&&this._nodeScales.set(i,e.scale)})),this._setUpdateViewNeeded()):this._nodeScales.clear()}displayNodes(e){this._workQueue=z([...this._renderedNodes],e,this._index),M(this._workQueue,this.view.state.contentCamera.viewForward,this._index),W(this._workQueue,de,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach((({abortController:t})=>e.push(t))),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach((t=>t.load.forEach((t=>e.add(t)))));const t=new Array,i=new Map;this._loadingNodes.forEach(((r,s)=>{e.has(s)?i.set(s,r):t.push(r)})),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter((e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0})),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach((({abortController:e})=>e.abort())),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach((e=>this._removeFromRenderer(e))),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.length>0}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run((()=>this._updateWorkQueues()));this._indexQueue.length>0&&e.run((()=>this._processIndexQueue())););for(this._processWorkQueue(e);this._idleQueue.length>0&&e.run((()=>this._idleQueue.process())););}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then((t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()})).then((()=>{this._indexPagesLoading.delete(e)}),(()=>{this._indexPagesLoading.delete(e)})),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(a(t))return;this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find((e=>!this._renderedNodes.has(e))))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map((e=>{const t=l(),i=this._memCache.pop(e.toString());return n(i)?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this.loadNode(e,t.signal)}),this._loadingNodes.get(e).promise}))).then((t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)})).catch((()=>{})).then((()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&0===this._idleQueue.length&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())})),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async populateClassCodeCodedDomain(e,i){const r="CLASS_CODE",s=this.layer.fieldsIndex.get(r);if(!s||s.domain)return;if(-1===e.indexOf(s.name))return;const o=await t(this.layer.queryCachedStatistics(r,{signal:i}));if(!1===o.ok)return;const n=o.value,a=n&&n.labels&&n.labels.labels;a&&Array.isArray(a)&&(s.domain=new V({name:"CLASS_CODE",codedValues:a.map((e=>new k({code:e.value,name:e.label})))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=l(),this._codedDomainPopulationPromise=this.populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then((()=>{this._codedDomainPopulationAbortController=null}))),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,o=t.map((e=>T(s,e))),n=async(e,t)=>{const r=this._index.getNode(t);await i(o,(async t=>{const i=t.useElevation?await this._loadElevationAttributeFromGeometry(r.resourceId):await this._loadAndParseAttribute(r,t);if(i)for(const r of e)if(this._isValidPointGraphic(r)){const e=r.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,i,e,r.attributes)}}))},a=[];return r.forEach(((e,t)=>{a.push(n(e,t))})),await h(a),e}_isValidPointGraphic(e){return e instanceof Y&&e.pointCloudMetadata&&e.pointCloudMetadata.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return n(i)?$({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=J(t,await this._loadGeometry(e,null));return K(i,i.length/3)}highlight(e){if(!e)return{remove(){}};const t=r.isCollection(e)?e.toArray():Array.isArray(e)?e:[e];return this._renderer.highlight(t.map((e=>this._graphicToPointDefinition(e))))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new O(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then((e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()}))}_loadNodePage(e){const t=l(),i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then((t=>t.nodes.map(((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:t.obb,firstChild:t.firstChild,childCount:t.childCount,vertexCount:null!=t.vertexCount?t.vertexCount:t.pointCount,lodThreshold:null!=t.lodThreshold?t.lodThreshold:t.effectiveArea}))))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;let e=this.inverseDensity/this._lodFactor*this._getLodMemoryFactor();const t=this.maximumPointCount*this._lodFactor*this._getLodMemoryFactor();let i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(r/(.75*t));for(;r>t;)e*=s,i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(2);return this.displayNodes(i),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_getLodMemoryFactor(){return this.view.resourceController.memoryController.memoryFactor}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=w(s,t.eye),n=I(s,-o,le),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const{minScale:h,maxScale:u}=se(this.layer),p=0===h&&0===u?e=>l.push(e):e=>{const t=this._getScale(e);oe(t,h,u)&&l.push(e)};return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return p(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(p(e),!1)},pageMiss:(e,t)=>{p(e),this._indexQueue.indexOf(t)<0&&this._indexQueue.push(t)}}),l}_getScale(e){let t=this._nodeScales.get(e);if(null==t){const i=this._index.getNode(e).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],t=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(e,t)}return t}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,te(e,r));return t/(n*n)/(4*s*s)/i}loadNode(e,t){try{return this.loadNodeAsync(e,t)}catch(i){throw u(i)||ae.error(i),i}}async loadAdditionalUserAttributes(e,t,i){const r=this.layer.outFields;if(!r)return[];const s=R(this.layer.fieldsIndex,r),o=new Set(e.map((e=>n(e)?e.name:null))),a=this.layer.attributeStorageInfo,l=[];for(const n of s){if(o.has(n))continue;const e=T(a,n);e&&l.push(t(e))}const h=await p(l);return c(i),d(h,(e=>e))}async loadNodeAsync(e,t){const i=this._index.getNode(e),r=B(this.layer),s=G(this.layer),o=i.resourceId,d=async e=>{if(a(e))return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return n(i)?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push((async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:n,modulationAttribute:a}=r,l=d(n),h=d(a),u=s.map((e=>e.attributeInfo)),p=u.map((e=>d(e))),_=this.loadAdditionalUserAttributes([n,a,...u],d,t),[m,g,f,y,b]=await Promise.all([i,l,h,Promise.all(p),_]);c(t);const w={geometryBuffer:m,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obb:this._index.getRenderObb(e),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)}),t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(a(t)||!t.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(e,"json",{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,"binary",{query:{token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._nodeScales.delete(e),this._memCache.put(t.id.toString(),t,ue(t))}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(X.isInstanceOfNode(t))return t.splatSize=r,t.obb=s,t.origin=N(t.obb.center),t;const o=.01*Math.max(s.halfSize[0],s.halfSize[1],s.halfSize[2]);if(t.obb.halfSize[0]>s.halfSize[0]+o||t.obb.halfSize[1]>s.halfSize[1]+o||t.obb.halfSize[2]>s.halfSize[2]+o){if(this._maxLoggedBoxWarnings>0){const i=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;ae.warn(`Node ${e} reported bounding box too small. got ${i(s)} but points cover ${i(t.obb)}`),0==--this._maxLoggedBoxWarnings&&ae.warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,t.obb)}return{id:e,coordinates:t.points,origin:N(s.center),rgb:t.rgb,attributes:t.attributes,pointIdFilterMap:t.pointIdFilterMap,highlights:null,splatSize:r,obb:s,isLeaf:0===i.childCount}}getUsedMemory(){let e=0;return this._renderer.forEachNode((t=>{e+=ce,e+=m(t.coordinates);for(const i of t.attributes){const t=i.values;g(t.buffer)&&(e+=m(t))}})),e}getUnloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount));let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.getUsedMemory()-e*ce)/t)+i*ce}ignoresMemoryFactor(){return!1}get performanceInfo(){return{nodes:this._renderedNodes.size,displayedNumberOfFeatures:[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount),0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};function ue(e){return 5*e.coordinates.length+128}e([y()],he.prototype,"layer",void 0),e([y({readOnly:!0,aliasOf:"layer.parsedUrl.path"})],he.prototype,"baseUrl",void 0),e([y({readOnly:!0})],he.prototype,"pointScale",null),e([y({readOnly:!0})],he.prototype,"useRealWorldSymbolSizes",null),e([y({readOnly:!0})],he.prototype,"pointSize",null),e([y({readOnly:!0})],he.prototype,"inverseDensity",null),e([y()],he.prototype,"maximumPointCount",void 0),e([y({readOnly:!0})],he.prototype,"availableFields",null),e([y({readOnly:!0})],he.prototype,"_clippingBox",null),e([y({readOnly:!0})],he.prototype,"_elevationOffset",null),e([y({type:Boolean})],he.prototype,"slicePlaneEnabled",void 0),e([y()],he.prototype,"updating",void 0),e([y(ie)],he.prototype,"updatingProgress",void 0),e([y({readOnly:!0})],he.prototype,"updatingProgressValue",null),he=e([b("esri.views.3d.layers.PointCloudLayerView3D")],he);const pe=C(),ce=160,_e=he;export{_e as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{result as t,forEach as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import s from"../../../core/Logger.js";import{unwrapOr as o,isSome as n,isNone as a,mapSome as d}from"../../../core/maybe.js";import{eachAlways as l,isAbortError as h,eachAlwaysValues as u,throwIfAborted as p}from"../../../core/promiseUtils.js";import{pt2px as c}from"../../../core/screenUtils.js";import{estimateSize as _,isArrayBuffer as m}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as g}from"../../../core/unitUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{d as b}from"../../../chunks/vec3.js";import{a as w}from"../../../chunks/vec3f32.js";import{projectBoundingRect as N}from"../../../geometry/projection.js";import{create as x}from"../../../geometry/support/aaBoundingBox.js";import{containsPoint as P,create as v}from"../../../geometry/support/aaBoundingRect.js";import{create as C,fromNormalAndOffset as S}from"../../../geometry/support/plane.js";import{makeDehydratedPoint as I}from"../../../layers/graphics/dehydratedFeatures.js";import A from"../../../layers/support/CodedValue.js";import k from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as V}from"../../../layers/support/fieldUtils.js";import{PromiseQueue as R}from"../../../layers/support/PromiseQueue.js";import{getMetersPerUnit as L}from"../../../symbols/support/unitConversionUtils.js";import{LayerView3D as j}from"./LayerView3D.js";import{PointCloudWorkerHandle as Q}from"./PointCloudWorkerHandle.js";import{checkPointCloudLayerValid as U,checkPointCloudLayerCompatibleWithView as D}from"./i3s/I3SUtil.js";import{nodeDiff as F,sortFrontToBack as z,splitWorkEntries as M}from"./i3s/LoDUtil.js";import W from"./i3s/PagedNodeIndex.js";import{getSplatSizeAlgorithm as O,getFixedSizeAlgorithm as E,getRendererInfo as H,getFilterInfo as B,rendererUsesFixedSizes as G,getAttributeInfo as q}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as T,readGeometry as $,elevationFromPositions as J}from"./i3s/PointCloudWorkerUtil.js";import{PointGraphic as K}from"./i3s/PointGraphic.js";import{PointRenderer as Y}from"./i3s/PointRenderer.js";import{PopupSceneLayerView as X}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as Z}from"../support/extentUtils.js";import{minimumDistancePlane as ee}from"../support/orientedBoundingBox.js";import{updatingProgress as te}from"../support/updatingProperties.js";import ie from"../../layers/LayerView.js";import{extractSafeScaleBounds as re,scaleBoundsPredicate as se}from"../../support/layerViewUtils.js";import{TaskPriority as oe}from"../../support/Scheduler.js";const ne=s.getLogger("esri.views.3d.layers.PointCloudLayerView3D"),ae=8,de=C();let le=class extends(X(j(ie))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new R,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[]}get pointScale(){const e=O(this.layer&&this.layer.renderer),t=1;return e&&null!=e.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=E(this.layer&&this.layer.renderer),t=!1;return e&&null!=e.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=E(this.layer&&this.layer.renderer),t=0;return e&&null!=e.size?e.size:t}get inverseDensity(){const e=96;return this.layer&&this.layer.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=H(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.primaryAttribute.name);const i=B(this.layer);if(i)for(const r of i)t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of V(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=x(),t=this.view.renderSpatialReference;return Z(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;if(e&&"absolute-height"===e.mode){const t=g(this.layer.spatialReference),i=L(e.unit);return o(e.offset,0)*i/t}return 0}initialize(){const e=this.view.resourceController;this._worker=new Q((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._tmpPoint=I(0,0,0,this.layer.spatialReference),U(this.layer),D(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(2),this._dataRequester=e.createStreamDataRequester(3),this._initRenderer();const t=this._initNodePages(),i=this.view.resourceController.memoryController;this._memCache=i.newCache(this.layer.uid),this.updatingHandles.add(this,"_clippingBox",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this,"_elevationOffset",(()=>this._elevationOffsetChanged()),2),this.updatingHandles.add(this.layer,"renderer",(()=>this._rendererChanged()),2),this.updatingHandles.add(this.layer,"filters",(()=>this._reload()),2),this.updatingHandles.add(this.layer,"outFields",(()=>this._reload()),2),this.updatingHandles.add(this.layer,"scaleRangeId",(()=>this._setUpdateViewNeeded())),this.updatingHandles.add(this,"clippingArea",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this.view.state,"contentCamera",(()=>this._setUpdateViewNeeded())),this.handles.add([this.view.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),i.events.on("quality-changed",(()=>this._setUpdateViewNeeded()))]),this.addResolvingPromise(t),this.when((()=>{this.handles.add([e.scheduler.registerTask(oe.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks((()=>this._idleBegin()),(()=>this._idleEnd())),this.updatingHandles.add(this,"suspended",(e=>{e?this._clearNodeState():this._setUpdateViewNeeded()}),2)])}),(()=>{this.updatingHandles.removeAll(),this.handles.removeAll()}))}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker&&(this._worker.destroy(),this._worker=null),this._destroyRenderer(),this._memCache.destroy(),this._memCache=null,this._codedDomainPopulationAbortController&&(this._codedDomainPopulationAbortController.abort(),this._codedDomainPopulationAbortController=null),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new Y({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerUid=this.layer.uid,this.updatingHandles.add(this,"_clippingBox",(e=>this._renderer.clippingBox=e),2),this.updatingHandles.add(this,"suspended",(e=>this._setPointsVisible(!e)),2),this.updatingHandles.add(this,"pointScale",(e=>this._renderer.scaleFactor=e),2),this._renderer.minSizePx=Math.sqrt(2),this.updatingHandles.add(this,"useRealWorldSymbolSizes",(e=>this._renderer.useRealWorldSymbolSizes=e),2),this.updatingHandles.add(this,"pointSize",(e=>{const t=c(e);this._renderer.size=e,this._renderer.sizePx=t}),2),this.updatingHandles.add(this,"slicePlaneEnabled",(e=>this._renderer.slicePlane=e),2),this.updatingHandles.add(this,"inverseDensity",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this,"maximumPointCount",(()=>this._setUpdateViewNeeded()),2),this.updatingHandles.add(this.view,"qualitySettings.sceneService.pointCloud.lodFactor",(e=>{this._lodFactor=e,this._setUpdateViewNeeded()}),2)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i){const r=n(e.pointIdFilterMap)?e.pointIdFilterMap[t]:t,s=this.view.computeMapPointFromVec3d(i),o=this._createGraphicAttributes(e,r);return new K({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:r,epoch:this._nodeLoadEpoch},geometry:s,attributes:o,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_encodeGraphicAttribute(e,t,i,r){const s=e.storageInfo&&e.storageInfo.attributeValues,o=s?s.valuesPerElement:1;if(1===o)r[e.name]=t[i];else if("UInt8"===s.valueType&&o<=4){let s=0;const n=i*o;for(let e=n;e<n+o;e++)s=(s<<8)+t[e];r[e.name]=s}else r[e.name]=void 0}_setPointsVisible(e){e&&!this._rendererAdded?(this.view._stage.addRenderPlugin([3],this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view._stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=G(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_scaleUpdateHandler(e){this.layer.minScale||this.layer.maxScale?N(e.extent,e.spatialReference,ue,this.layer.spatialReference)&&(this._nodeScales.forEach(((t,i)=>{if(!this._renderedNodes.has(i))return void this._nodeScales.delete(i);const r=this._index.getNode(i);P(ue,r.obb.center)&&this._nodeScales.set(i,e.scale)})),this._setUpdateViewNeeded()):this._nodeScales.clear()}displayNodes(e){this._workQueue=F([...this._renderedNodes],e,this._index),z(this._workQueue,this.view.state.contentCamera.viewForward,this._index),M(this._workQueue,ae,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach((({abortController:t})=>e.push(t))),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach((t=>t.load.forEach((t=>e.add(t)))));const t=new Array,i=new Map;this._loadingNodes.forEach(((r,s)=>{e.has(s)?i.set(s,r):t.push(r)})),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter((e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0})),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach((({abortController:e})=>e.abort())),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach((e=>this._removeFromRenderer(e))),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.length>0}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run((()=>this._updateWorkQueues()));this._indexQueue.length>0&&e.run((()=>this._processIndexQueue())););for(this._processWorkQueue(e);this._idleQueue.length>0&&e.run((()=>this._idleQueue.process())););}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then((t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()})).then((()=>{this._indexPagesLoading.delete(e)}),(()=>{this._indexPagesLoading.delete(e)})),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(a(t))return;this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find((e=>!this._renderedNodes.has(e))))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map((e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return n(i)?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this.loadNode(e,t.signal)}),this._loadingNodes.get(e).promise}))).then((t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)})).catch((()=>{})).then((()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&0===this._idleQueue.length&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())})),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async populateClassCodeCodedDomain(e,i){const r="CLASS_CODE",s=this.layer.fieldsIndex.get(r);if(!s||s.domain)return;if(-1===e.indexOf(s.name))return;const o=await t(this.layer.queryCachedStatistics(r,{signal:i}));if(!1===o.ok)return;const n=o.value,a=n&&n.labels&&n.labels.labels;a&&Array.isArray(a)&&(s.domain=new k({name:"CLASS_CODE",codedValues:a.map((e=>new A({code:e.value,name:e.label})))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this.populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then((()=>{this._codedDomainPopulationAbortController=null}))),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,o=t.map((e=>q(s,e))),n=async(e,t)=>{const r=this._index.getNode(t);await i(o,(async t=>{const i=t.useElevation?await this._loadElevationAttributeFromGeometry(r.resourceId):await this._loadAndParseAttribute(r,t);if(i)for(const r of e)if(this._isValidPointGraphic(r)){const e=r.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,i,e,r.attributes)}}))},a=[];return r.forEach(((e,t)=>{a.push(n(e,t))})),await l(a),e}_isValidPointGraphic(e){return e instanceof K&&e.pointCloudMetadata&&e.pointCloudMetadata.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return n(i)?T({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=$(t,await this._loadGeometry(e,null));return J(i,i.length/3)}highlight(e){if(!e)return{remove(){}};const t=r.isCollection(e)?e.toArray():Array.isArray(e)?e:[e];return this._renderer.highlight(t.map((e=>this._graphicToPointDefinition(e))))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new W(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then((e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()}))}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then((t=>t.nodes.map(((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:t.obb,firstChild:t.firstChild,childCount:t.childCount,vertexCount:null!=t.vertexCount?t.vertexCount:t.pointCount,lodThreshold:null!=t.lodThreshold?t.lodThreshold:t.effectiveArea}))))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;let e=this.inverseDensity/this._lodFactor*this._getLodMemoryFactor();const t=this.maximumPointCount*this._lodFactor*this._getLodMemoryFactor();let i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(r/(.75*t));for(;r>t;)e*=s,i=this._computeNodesForMinimumDensity(e),r=this._computePointCount(i),s=Math.sqrt(2);return this.displayNodes(i),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_getLodMemoryFactor(){return this.view.resourceController.memoryController.memoryFactor}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=b(s,t.eye),n=S(s,-o,de),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const{minScale:h,maxScale:u}=re(this.layer),p=0===h&&0===u?e=>l.push(e):e=>{const t=this._getScale(e);se(t,h,u)&&l.push(e)};return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return p(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(p(e),!1)},pageMiss:(e,t)=>{p(e),this._indexQueue.indexOf(t)<0&&this._indexQueue.push(t)}}),l}_getScale(e){let t=this._nodeScales.get(e);if(null==t){const i=this._index.getNode(e).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],t=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(e,t)}return t}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,ee(e,r));return t/(n*n)/(4*s*s)/i}loadNode(e,t){try{return this.loadNodeAsync(e,t)}catch(i){throw h(i)||ne.error(i),i}}async loadAdditionalUserAttributes(e,t,i){const r=this.layer.outFields;if(!r)return[];const s=V(this.layer.fieldsIndex,r),o=new Set(e.map((e=>n(e)?e.name:null))),a=this.layer.attributeStorageInfo,l=[];for(const n of s){if(o.has(n))continue;const e=q(a,n);e&&l.push(t(e))}const h=await u(l);return p(i),d(h,(e=>e))}async loadNodeAsync(e,t){const i=this._index.getNode(e),r=H(this.layer),s=B(this.layer),o=i.resourceId,d=async e=>{if(a(e))return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return n(i)?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push((async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:n,modulationAttribute:a}=r,l=d(n),h=d(a),u=s.map((e=>e.attributeInfo)),c=u.map((e=>d(e))),_=this.loadAdditionalUserAttributes([n,a,...u],d,t),[m,g,f,y,b]=await Promise.all([i,l,h,Promise.all(c),_]);p(t);const w={geometryBuffer:m,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obb:this._index.getRenderObb(e),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)}),t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(a(t)||!t.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(e,"json",{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,"binary",{query:{token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._nodeScales.delete(e),this._memCache.put(t.id.toString(),t,he(t))}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(Y.isInstanceOfNode(t))return t.splatSize=r,t.obb=s,t.origin=w(t.obb.center),t;const o=.01*Math.max(s.halfSize[0],s.halfSize[1],s.halfSize[2]);if(t.obb.halfSize[0]>s.halfSize[0]+o||t.obb.halfSize[1]>s.halfSize[1]+o||t.obb.halfSize[2]>s.halfSize[2]+o){if(this._maxLoggedBoxWarnings>0){const i=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;ne.warn(`Node ${e} reported bounding box too small. got ${i(s)} but points cover ${i(t.obb)}`),0==--this._maxLoggedBoxWarnings&&ne.warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,t.obb)}return{id:e,coordinates:t.points,origin:w(s.center),rgb:t.rgb,attributes:t.attributes,pointIdFilterMap:t.pointIdFilterMap,highlights:null,splatSize:r,obb:s,isLeaf:0===i.childCount}}getUsedMemory(){let e=0;return this._renderer.forEachNode((t=>{e+=pe,e+=_(t.coordinates);for(const i of t.attributes){const t=i.values;m(t.buffer)&&(e+=_(t))}})),e}getUnloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount));let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.getUsedMemory()-e*pe)/t)+i*pe}ignoresMemoryFactor(){return!1}get performanceInfo(){return{nodes:this._renderedNodes.size,displayedNumberOfFeatures:[...this._renderedNodes].reduce(((e,t)=>e+this._index.getNode(t).vertexCount),0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};function he(e){return 5*e.coordinates.length+128}e([f()],le.prototype,"layer",void 0),e([f({readOnly:!0,aliasOf:"layer.parsedUrl.path"})],le.prototype,"baseUrl",void 0),e([f({readOnly:!0})],le.prototype,"pointScale",null),e([f({readOnly:!0})],le.prototype,"useRealWorldSymbolSizes",null),e([f({readOnly:!0})],le.prototype,"pointSize",null),e([f({readOnly:!0})],le.prototype,"inverseDensity",null),e([f()],le.prototype,"maximumPointCount",void 0),e([f({readOnly:!0})],le.prototype,"availableFields",null),e([f({readOnly:!0})],le.prototype,"_clippingBox",null),e([f({readOnly:!0})],le.prototype,"_elevationOffset",null),e([f({type:Boolean})],le.prototype,"slicePlaneEnabled",void 0),e([f()],le.prototype,"updating",void 0),e([f(te)],le.prototype,"updatingProgress",void 0),e([f({readOnly:!0})],le.prototype,"updatingProgressValue",null),le=e([y("esri.views.3d.layers.PointCloudLayerView3D")],le);const ue=v(),pe=160,ce=le;export{ce 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.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as r,disposeMaybe as i,destroyMaybe as l}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenTrueOnce as o}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import h from"../../2d/engine/vectorTiles/SchemaHelper.js";import c from"../../2d/engine/vectorTiles/TileHandler3D.js";import p from"../../2d/engine/vectorTiles/VTLPainter3D.js";import d from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{test as f}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let g=class extends(y(m(u))){constructor(e){super(e),this.type="vector-tile-3d"}initialize(){if(r(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const e=f.force512VTL?this.layer.tileInfo:this.layer.compatibleTileInfo256,i=this._getTileInfoSupportError(e,this.layer.fullExtent);if(i)return this.addResolvingPromise(Promise.reject(i));const{basemapTerrain:l,spatialReference:n,pixelRatio:a}=this.view,m=o(this.view,"basemapTerrain.tilingSchemeLocked").then((()=>{const e=l.tilingScheme,t=e.pixelSize;let r;this.schemaHelper=new h(t,n.isGeographic),r=256===t?this.layer.compatibleTileInfo256:this.view.spatialReference.isGeographic?this.layer.compatibleTileInfo512:this.layer.tileInfo;const i=this._getTileInfoCompatibilityError(r,e);if(i)throw i;this._set("tileInfo",r)}));this._tileHandlerController=new AbortController;const y=this.view.resourceController;this._memCache=y.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:u,spriteUrl:g,glyphsUrl:_}=this.layer.currentStyleInfo,v=new d(u,{spriteUrl:g,glyphsUrl:_}),H=l.mapTileRequester;this._tileHandler=new c(this.layer,v,a,this._memCache,H);const w=this._tileHandlerController.signal,C=e=>y.schedule(e),T=this._tileHandler.start({signal:w,schedule:C}),j=this._tileHandler.spriteMosaic;j.then((e=>{!s(w)&&this._tileHandler&&(this.painter=new p(e,this._tileHandler.glyphMosaic))})),T.then((()=>this._tileHandlerController=null));const I=()=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const{style:e,spriteUrl:t,glyphsUrl:r}=this.layer.currentStyleInfo,i=new d(e,{spriteUrl:t,glyphsUrl:r}),l=new c(this.layer,i,a,this._memCache,H),s=l.start({signal:this._tileHandlerController.signal,schedule:C}),o=l.spriteMosaic;s.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([s,o]).then((([,e])=>{const t=this._tileHandler,r=this.painter;this.painter=new p(e,l.glyphMosaic),this._tileHandler=l,this.emit("data-changed"),t.destroy(),r&&r.dispose()})))};this.updatingHandles.add(this,"layer.currentStyleInfo",I),this.updatingHandles.add(this,"view.pixelRatio",I);const b=Promise.all([m,T,j]);this.addResolvingPromise(b)}destroy(){this.painter=i(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),l(this._tileHandler),this._memCache=l(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,r=e[e.length-1].scale,i=this.levelRangeFromScaleRange(t,r);return 1===i.minLevel&&256===this.tileInfo.size[0]&&(i.minLevel=0),i}async fetchTile(e,t,r,i){return this._tileHandler.getVectorTile(e,t,r,i)}};e([n({aliasOf:"layer.fullExtent"})],g.prototype,"fullExtent",void 0),e([n()],g.prototype,"layer",void 0),e([n()],g.prototype,"tileInfo",void 0),e([n()],g.prototype,"dataLevelRange",null),e([n()],g.prototype,"updatingProgressValue",void 0),g=e([a("esri.views.3d.layers.VectorTileLayerView3D")],g);const _=g;export{_ 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.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as s}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{destroyMaybe as t,isSome as a,unwrapOr as i}from"../../../../../core/maybe.js";import{EsriPromiseMixin as r}from"../../../../../core/Promise.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as l}from"../../../../../properties/defaultUnit.js";import{AreaMeasurementController as p}from"./support/AreaMeasurementController.js";import{AreaMeasurementView3DData as u}from"./support/AreaMeasurementView3DData.js";import{AreaMeasurementVisualization as y}from"./support/AreaMeasurementVisualization.js";let h=class extends(r(e)){constructor(s){super(s),this.type="area-measurement-view-3d",this.analysisViewData=new u}initialize(){this.analysisViewData.path.view=this.view,this.analysisViewData.path.areaMeasurement=this.analysis,this.analysisVisualization=new y({view:this.view,analysis:this.analysis,analysisView:this}),this.analysisController=new p({view:this.view,analysis:this.analysis,analysisViewData:this.analysisViewData})}destroy(){this.analysisController=t(this.analysisController),this.analysisVisualization=t(this.analysisVisualization),this.analysisViewData=t(this.analysisViewData)}get updating(){var s;return!(null==(s=this.analysisVisualization)||!s.loadingMessages)}get result(){if(a(this.analysisViewData.measurementData)){const s=this.analysisViewData.measurementData;return{area:s.area,geodesicArea:s.geodesicArea,pathLength:s.pathLength,geodesicPathLength:s.geodesicPathLength,perimeterLength:s.perimeterLength}}return{area:null,geodesicArea:null,pathLength:null,geodesicPathLength:null,perimeterLength:null}}get visible(){return this.analysis.visible}get unit(){return i(this.analysis.unit,this._defaultUnit)}get testData(){return{visualization:this.analysisVisualization,controller:this.analysisController}}};s([o()],h.prototype,"type",void 0),s([o()],h.prototype,"analysis",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"analysisVisualization",void 0),s([o()],h.prototype,"analysisController",void 0),s([o()],h.prototype,"result",null),s([o()],h.prototype,"analysisViewData",void 0),s([o()],h.prototype,"visible",null),s([o()],h.prototype,"unit",null),s([o(l)],h.prototype,"_defaultUnit",void 0),h=s([n("esri.views.3d.layers.analyses.AreaMeasurement.AreaMeasurementView3D")],h);const m=h;export{h as AreaMeasurementView3D,m 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.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import"../../../../../../geometry.js";import t from"../../../../../../core/Evented.js";import i from"../../../../../../core/Handles.js";import{destroyMaybe as r,isSome as o,unwrap as s}from"../../../../../../core/maybe.js";import{init as n}from"../../../../../../core/watchUtils.js";import{property as a}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/arrayUtils.js";import"../../../../../../core/has.js";import"../../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{empty as m,expandPointInPlace as l}from"../../../../../../geometry/support/aaBoundingRect.js";import{createCoordinateHelper as c}from"../../../../../interactive/coordinateHelper.js";import{EditGeometry as d,Component as p}from"../../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../../../../../interactive/editGeometry/EditGeometryOperations.js";import u from"../../../../../../geometry/Point.js";let g=class extends t.EventedAccessor{constructor(e={}){super(e),this._handles=new i,this._version=0,this._internalGeometryChange=!1,this._extent=m()}destroy(){this._handles=r(this._handles)}set areaMeasurement(e){this._set("areaMeasurement",e),o(e)&&o(this.view)&&this._initialize(e,this.view)}set view(e){this._set("view",e),o(e)&&o(this.areaMeasurement)&&this._initialize(this.areaMeasurement,e)}get initialized(){return o(this.areaMeasurement)&&o(this.view)}get version(){return this._version}get isValidPolygon(){return this.initialized&&this.editGeometry.components.length>0&&this.editGeometry.components[0].isClosed()}get extent(){if(this.initialized&&this.editGeometry.components.length>0&&this.editGeometry.components[0].vertices.length>0){const e=m(this._extent);return this.forEachVertex((t=>{l(e,t.pos)})),e}return null}get spatialReference(){return this.initialized?this.editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this._handles.removeAll(),this._handles.add(n(e,"geometry",(()=>this._updateEditGeometryFromModelGeometry(e,t)),!0)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){this._version++,this._internalGeometryChange||(this._handles.remove("EditGeometry"),o(e.geometry)?this._editGeometryOperations=y.fromGeometry(e.geometry,t.state.viewingMode):this._editGeometryOperations=new y(new d("polygon",c(!0,!1,t.spatialReference),t.state.viewingMode)),this._makeDirty(!0),this.emit("change"
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import"../../../../../../geometry.js";import t from"../../../../../../core/Evented.js";import i from"../../../../../../core/Handles.js";import{destroyMaybe as r,isSome as o,unwrap as s}from"../../../../../../core/maybe.js";import{init as n}from"../../../../../../core/watchUtils.js";import{property as a}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/arrayUtils.js";import"../../../../../../core/has.js";import"../../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{empty as m,expandPointInPlace as l}from"../../../../../../geometry/support/aaBoundingRect.js";import{createCoordinateHelper as c}from"../../../../../interactive/coordinateHelper.js";import{EditGeometry as d,Component as p}from"../../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../../../../../interactive/editGeometry/EditGeometryOperations.js";import u from"../../../../../../geometry/Point.js";let g=class extends t.EventedAccessor{constructor(e={}){super(e),this._handles=new i,this._version=0,this._internalGeometryChange=!1,this._extent=m()}destroy(){this._handles=r(this._handles)}set areaMeasurement(e){this._set("areaMeasurement",e),o(e)&&o(this.view)&&this._initialize(e,this.view)}set view(e){this._set("view",e),o(e)&&o(this.areaMeasurement)&&this._initialize(this.areaMeasurement,e)}get initialized(){return o(this.areaMeasurement)&&o(this.view)}get version(){return this._version}get isValidPolygon(){return this.initialized&&this.editGeometry.components.length>0&&this.editGeometry.components[0].isClosed()}get extent(){if(this.initialized&&this.editGeometry.components.length>0&&this.editGeometry.components[0].vertices.length>0){const e=m(this._extent);return this.forEachVertex((t=>{l(e,t.pos)})),e}return null}get spatialReference(){return this.initialized?this.editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this._handles.removeAll(),this._handles.add(n(e,"geometry",(()=>this._updateEditGeometryFromModelGeometry(e,t)),!0)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){this._version++,this._internalGeometryChange||(this._handles.remove("EditGeometry"),o(e.geometry)?this._editGeometryOperations=y.fromGeometry(e.geometry,t.state.viewingMode):this._editGeometryOperations=new y(new d("polygon",c(!0,!1,t.spatialReference),t.state.viewingMode)),this._makeDirty(!0),this.emit("change"),this._handles.add(this.editGeometry.on("change",(t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this.editGeometry.geometry:null,this._internalGeometryChange=!1})),"EditGeometry"))}get editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex((t=>{e.push(t)})),e}get numVertices(){return this.initialized&&this.editGeometry.components.length>0?this.editGeometry.components[0].vertices.length:0}get lastPoint(){if(this.initialized&&this.editGeometry.components.length>0){const e=this.editGeometry.components[0].getLastVertex();if(o(e))return this.editGeometry.coordinateHelper.vectorToPoint(e.pos)}return null}getVertex(e){if(!this.initialized||0===this.editGeometry.components.length||0===this.editGeometry.components[0].vertices.length)return null;const t=this.editGeometry.components[0].vertices[0];let i=t;do{if(i.index===e)return i;i=i.rightEdge.rightVertex}while(i!==t&&null!=i);return null}getVertexPositionAsPoint(e){return this.editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this.editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){this.initialized&&this.editGeometry.components.length>0&&this.editGeometry.components[0].iterateVertices(e)}forEachVertexPosition(e){const t=this.editGeometry.coordinateHelper;this.forEachVertex(((i,r)=>{t.vectorToPoint(i.pos,G),e(G,r)}))}clear(){o(this.areaMeasurement)&&(this.areaMeasurement.geometry=null)}add(e){if(!this.initialized)return null;if(0===this.editGeometry.components.length){const e=s(this.view);this.editGeometry.components.push(new p(e.spatialReference,e.state.viewingMode))}const t=this._editGeometryOperations.appendVertex(this.editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),t}close(){if(!this.initialized||0===this.editGeometry.components.length)return null;const e=this._editGeometryOperations.closeComponent(this.editGeometry.components[0]);return this.emit("change"),e}ensureContains(e,t=""){let i=!1;if(this.editGeometry.components.forEach((t=>{t.iterateVertices((t=>{t===e&&(i=!0)}))})),!i)throw new Error(`vertex doesnt exist ${t}`);return i}setVertexPosition(e,t){if(!this.initialized)return null;const i=this._editGeometryOperations.setVertexPosition(e,this.editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),i}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition(((i,r)=>{const o=e.getVertexPositionAsPointFromIndex(r);i.equals(o)||(t=!1)})),!!t}};e([a({value:null})],g.prototype,"areaMeasurement",null),e([a({value:null})],g.prototype,"view",null),e([a()],g.prototype,"isValidPolygon",null),e([a()],g.prototype,"extent",null),e([a()],g.prototype,"spatialReference",null),e([a()],g.prototype,"numVertices",null),g=e([h("esri.views.3d.layers.analyses.AreaMeasurement.support.AreaMeasurement3DPathHelper")],g);const G=new u;export{g as AreaMeasurement3DPathHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import"../../../../../../intl.js";import t from"../../../../../../core/Accessor.js";import"../../../../../../core/has.js";import i from"../../../../../../core/Handles.js";import{nextHighestPowerOfTen as s}from"../../../../../../core/mathUtils.js";import{destroyMaybe as r,isNone as n,isSome as a,unwrap as o}from"../../../../../../core/maybe.js";import h from"../../../../../../core/Quantity.js";import{formatDecimal as l}from"../../../../../../core/quantityFormatUtils.js";import{react as m,syncAndInitial as c}from"../../../../../../core/reactiveUtils.js";import{convertUnit as d,preferredImperialAreaUnit as p,preferredMetricAreaUnit as u,preferredImperialLengthUnit as g,preferredMetricLengthUnit as L}from"../../../../../../core/unitUtils.js";import{property as _}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/arrayUtils.js";import"../../../../../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{i as v,t as f}from"../../../../../../chunks/mat4.js";import{c as S}from"../../../../../../chunks/mat4f64.js";import{f as w}from"../../../../../../chunks/vec3.js";import{c as y}from"../../../../../../chunks/vec3f64.js";import j from"../../../../interactive/measurementTools/support/measurementUtils.js";import{midpoint as C}from"../../../../interactive/measurementTools/support/viewUtils.js";import{LabelVisualElement as P}from"../../../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as V}from"../../../../interactive/visualElements/LineVisualElement.js";import{MeasurementAreaVisualElement as A}from"../../../../interactive/visualElements/MeasurementAreaVisualElement.js";import{GeodesicSegment as D,EuclideanSegment as M}from"../../../../interactive/visualElements/support/Segment.js";import{createStipplePatternSimple as R}from"../../../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as I}from"../../../../../../intl/locale.js";import{fetchMessageBundle as z}from"../../../../../../intl/messages.js";let U=class extends t{constructor(e){super(e),this._handles=new i,this._params={...k},this._path=null,this._intersectedPath=null,this._perimeter=null,this._intersectedPerimeter=null,this._projectionLines=null,this._measurementArea=null,this._areaLabel=null,this._pathLengthLabel=null,this._cursorSegmentLengthLabel=null,this._perimeterLengthLabel=null,this._pathSegments=[],this._perimeterSegments=[],this._cursorSegment=null,this._origin=y(),this._originTransform=S(),this._cursorPositionRenderSpace=y(),this.messages=null,this.viewData=q,this.areaLabel=null,this.perimeterLengthLabel=null,this.mode=0,this.loadingMessages=!0,this.geodesicMeasurementDistanceThreshold=1e5}get visible(){return this.analysisView.visible}get testData(){return{labels:{area:this._areaLabel,pathLength:this._pathLengthLabel,cursorSegmentLength:this._cursorSegmentLengthLabel,perimeterLength:this._perimeterLengthLabel}}}initialize(){const e=this.view,t=this._params;this._path=new V({view:e,attached:!0,width:t.pathLineWidth,color:t.pathLineColor,polygonOffset:!0,renderOccluded:4}),this._intersectedPath=new V({view:e,attached:!0,width:t.pathLineWidth,color:t.intersectingLineColor,polygonOffset:!0,renderOccluded:4}),this._perimeter=new V({view:e,attached:!0,width:t.perimeterLineWidth,color:t.perimeterLineColor,polygonOffset:!0,renderOccluded:4}),this._intersectedPerimeter=new V({view:e,attached:!0,width:t.perimeterLineWidth,color:t.intersectingLineColor,polygonOffset:!0,renderOccluded:4}),this._projectionLines=new V({view:e,attached:!0,width:t.projectionLineWidth,color:t.projectionLineColor,stipplePattern:R(t.projectionLineStippleSize),stippleIntegerRepeats:!1,polygonOffset:!0,renderOccluded:4}),this._measurementArea=new A({view:e,attached:!0,color1:t.areaColor1,color2:t.areaColor2}),this._areaLabel=new P({view:this.view,attached:!0,fontSize:16}),this._pathLengthLabel=new P({view:e,attached:!0,fontSize:12}),this._cursorSegmentLengthLabel=new P({view:e,attached:!0,fontSize:12}),this._perimeterLengthLabel=new P({view:e,attached:!0,fontSize:12});const i=this.analysisView,s=i.analysisViewData;this._handles.add([m((()=>[this.mode,this.visible,i.unit,s.measurementData,s.cursorPoint]),(()=>this._update()),c),m((()=>{var t;return null==(t=e.state)?void 0:t.camera}),(()=>this._updateLabels()),c),I((async()=>this._updateMessageBundle()))]),this._updateMessageBundle()}destroy(){this._measurementArea=r(this._measurementArea),this._path=r(this._path),this._intersectedPath=r(this._intersectedPath),this._perimeter=r(this._perimeter),this._intersectedPerimeter=r(this._intersectedPerimeter),this._areaLabel=r(this._areaLabel),this._pathLengthLabel=r(this._pathLengthLabel),this._cursorSegmentLengthLabel=r(this._cursorSegmentLengthLabel),this._perimeterLengthLabel=r(this._perimeterLengthLabel),this._handles=r(this._handles),this.set("view",null)}_update(){if(this.destroyed)return;const e=this.analysisView.analysisViewData.measurementData;n(e)||(this._updateViewData(e,this.analysisView.analysisViewData.path,this.analysisView.analysisViewData.cursorPoint),this._updateOrigin(),this._updatePathSegments(),this._updatePerimeterSegments(),this._updateArea(),this._updateProjectionLines(),this._updateLabels())}_updateViewData(e,t,i){const r=t.isValidPolygon,n=t.lastPoint,o=a(n)&&a(i)?new h(j.segmentLengthGeodesic(n,i),"meters"):null,l=a(n)&&a(i)?new h(e.unitNormalizer.normalizeDistance(j.segmentLengthEuclidean(n,i,e.unitNormalizer.spatialReference)),"meters"):null;let m=this.mode;if(0===this.mode){m=1;(e.geodesicPathLength?e.geodesicPathLength.value:0)+(!r&&a(o)?o.value:0)>this.geodesicMeasurementDistanceThreshold&&(m=2)}null==e.geodesicPathLength&&(m=1);const c=2===m,p=c?e.geodesicArea:e.area;let u=1;if(p){const t=this._toPreferredAreaUnit(p,this.analysisView.unit);u=s(Math.sqrt(t.value)/Math.sqrt(300)),u*=Math.sqrt(d(1,t.unit,"square-meters")),u/=e.unitNormalizer.normalizeDistance(1)}const g={validMeasurement:r,path:t,pathVersion:t.version,cursorPoint:i,measurementData:e,mode:m,positionsGeographic:e.positionsGeographic,positionsRenderCoords:e.positionsRenderCoords,positionsProjected:e.positionsProjectedWorldCoords,positionsFittedRenderCoords:e.positionsFittedRenderCoords,intersectingSegments:c?e.geodesicIntersectingSegments:e.intersectingSegments,triangleIndices:c?e.geodesicTriangleIndices:e.triangleIndices,fittingMode:e.fittingMode,areaCentroid:c?e.geodesicAreaCentroidRenderCoords:e.areaCentroidRenderCoords,pathLengthLabelSegmentIndex:r?0:t.numVertices-2,perimeterLengthLabelSegmentIndex:0,checkerSize:u,geodesicCursorSegmentLength:o,cursorSegmentLength:l};this._set("viewData",g)}_updateOrigin(){const e=this.viewData;C(e.positionsRenderCoords,this._origin),v(this._originTransform),f(this._originTransform,this._originTransform,this._origin),this._measurementArea.transform=this._originTransform,this._projectionLines.transform=this._originTransform}_createSegments(e){const t=this.viewData,i=t.path,s=this.view.renderCoordsHelper.spatialReference,r=t.mode,n=[],a=[],o=[],h=t.validMeasurement?i.numVertices:i.numVertices-1;for(let l=0;l<h;++l){const h=t[e][l],m=t[e][(l+1)%i.numVertices];let c=null;switch(r){case 1:c=new M(h,m);break;case 2:c=new D(h,m,s)}t.intersectingSegments.has(l)?o.push(c):a.push(c),n.push(c)}return{all:n,nonIntersecting:a,intersecting:o}}_updatePathSegments(){const e=this.visible,t=this.viewData,i=this._createSegments("positionsRenderCoords"),s=t.path,r=!s.isValidPolygon,n=t.cursorPoint,o=this.view.renderCoordsHelper,h=o.spatialReference,l=t.mode;if(this._cursorSegment=null,s.numVertices>0&&r&&a(n)){if(o.toRenderCoords(n,this._cursorPositionRenderSpace)){const e=t.positionsRenderCoords[s.numVertices-1],r=this._cursorPositionRenderSpace;let n=null;switch(l){case 1:n=new M(e,r);break;case 2:n=new D(e,r,h)}i.nonIntersecting.push(n),this._cursorSegment=n}}this._path.setGeometryFromSegments(i.nonIntersecting,this._origin),this._path.visible=e,this._intersectedPath.setGeometryFromSegments(i.intersecting,this._origin),this._intersectedPath.visible=e,this._pathSegments=i.all}_updatePerimeterSegments(){const e=this.visible&&1===this.viewData.mode,t=this._createSegments("positionsFittedRenderCoords");this._perimeter.setGeometryFromSegments(t.nonIntersecting,this._origin),this._perimeter.visible=e,this._intersectedPerimeter.setGeometryFromSegments(t.intersecting,this._origin),this._intersectedPerimeter.visible=e,this._perimeterSegments=t.all}_updateArea(){const e=this.viewData;switch(e.mode){case 1:this._updateAreaEuclidean(e);break;case 2:this._updateAreaGeodesic()}}_updateAreaEuclidean(e){const t=this.visible;e.validMeasurement&&0===e.intersectingSegments.size&&e.triangleIndices?(this._measurementArea.geometry={uv:e.positionsProjected,position:e.positionsFittedRenderCoords,triangleIndices:e.triangleIndices},this._measurementArea.size=[e.checkerSize,e.checkerSize],this._measurementArea.visible=t):this._measurementArea.visible=!1}_updateAreaGeodesic(){this._measurementArea.visible=!1}_updateProjectionLines(){const e=this.viewData,t=this.visible,i=e.path,s=e.mode;if(i.numVertices>0&&e.validMeasurement&&1===s){const s=[];for(let t=0;t<i.numVertices;++t){const i=y();w(i,e.positionsRenderCoords[t],this._origin);const r=y();w(r,e.positionsFittedRenderCoords[t],this._origin),s.push([i,r])}this._projectionLines.geometry=s,this._projectionLines.visible=t}else this._projectionLines.geometry=null,this._projectionLines.visible=!1}_updateLabels(){if(this.destroyed)return;const e=this.viewData,t=e.path;if(!t)return;const i=e.measurementData,s=e.mode,r=!t.isValidPolygon,n=this.visible,h=this._formatAreaLabel(this.messages,2===s?i.geodesicArea:i.area,this.analysisView.unit);a(h)?(this._areaLabel.geometry={type:"point",point:e.areaCentroid},this._areaLabel.text=h,this._areaLabel.visible=e.validMeasurement&&0===e.intersectingSegments.size&&n):this._areaLabel.visible=!1,this._set("areaLabel",o(h));const l=this._formatLengthLabel(this.messages,2===s?i.geodesicPathLength:i.pathLength,this.analysisView.unit);if(a(l)&&e.pathLengthLabelSegmentIndex>=0&&e.pathLengthLabelSegmentIndex<this._pathSegments.length){const i=this._pathSegments[e.pathLengthLabelSegmentIndex],s=a(this._cursorSegment)?this._cursorSegment:O;this._pathLengthLabel.distance=this._params.labelDistance,this._pathLengthLabel.geometry={type:"corner",left:i,right:s},this._pathLengthLabel.text=l,this._pathLengthLabel.visible=r&&t.numVertices>0&&n}else this._pathLengthLabel.visible=!1;const m=2===s?e.geodesicCursorSegmentLength:e.cursorSegmentLength;if(a(m)){const e=this._formatLengthLabel(this.messages,m,this.analysisView.unit);this._cursorSegmentLengthLabel.distance=this._params.labelDistance,this._cursorSegmentLengthLabel.geometry=a(this._cursorSegment)?{type:"segment",segment:this._cursorSegment,sampleLocation:"end"}:null,this._cursorSegmentLengthLabel.anchor="bottom",this._cursorSegmentLengthLabel.text=o(e),this._cursorSegmentLengthLabel.visible=r&&0!==m.value&&n}else this._cursorSegmentLengthLabel.visible=!1;this._cursorSegmentLengthLabel.overlaps(this._pathLengthLabel)&&(this._cursorSegmentLengthLabel.visible=!1),this._pathLengthLabel.overlaps(this._areaLabel)&&(this._pathLengthLabel.visible=!1);const c=2===e.mode,d=c?i.geodesicPathLength:i.perimeterLength,p=o(null!=d?this._formatLengthLabel(this.messages,d,this.analysisView.unit):null);if(this._set("perimeterLengthLabel",o(p)),e.validMeasurement&&0===e.intersectingSegments.size){this._perimeterLengthLabel.distance=this._params.labelDistance,this._perimeterLengthLabel.anchor="top",this._perimeterLengthLabel.text=p,this._perimeterLengthLabel.visible=!0;let t=!0;for(let i=0;i<e.path.numVertices;++i){const s=(e.perimeterLengthLabelSegmentIndex+i)%e.path.numVertices,r=c?this._pathSegments[s]:this._perimeterSegments[s];if(t=!0,this._perimeterLengthLabel.geometry={type:"segment",segment:r,sampleLocation:"center"},!this._perimeterLengthLabel.overlaps(this._areaLabel))break;t=!1}this._perimeterLengthLabel.visible=t&&n}else this._perimeterLengthLabel.visible=!1}_toPreferredAreaUnit(e,t){return e.toUnit(this._preferredAreaUnit(e,t))}_preferredAreaUnit(e,t){switch(t){case"metric":return u(e.value,e.unit);case"imperial":return p(e.value,e.unit);default:return t}}_preferredLengthUnit(e,t){const i=this._deriveLengthUnitFromAreaUnit(t);switch(i){case"metric":return L(e.value,e.unit);case"imperial":return g(e.value,e.unit);default:return i}}_deriveLengthUnitFromAreaUnit(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-us-feet":return"us-feet";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";case"square-meters":return"meters";case"square-kilometers":return"kilometers"}throw new Error("unhandled area unit")}_formatAreaLabel(e,t,i){return e&&t&&l(e,t,this._preferredAreaUnit(t,i))}_formatLengthLabel(e,t,i){return e&&t&&l(e,t,this._preferredLengthUnit(t,i))}_updateMessageBundle(){this.loadingMessages=!0,z("esri/core/t9n/Units").then((e=>{this.messages=e,this.view&&this._update()})).finally((()=>{this.loadingMessages=!1}))}};e([_()],U.prototype,"view",void 0),e([_()],U.prototype,"messages",void 0),e([_()],U.prototype,"analysis",void 0),e([_()],U.prototype,"viewData",void 0),e([_()],U.prototype,"analysisView",void 0),e([_({readOnly:!0})],U.prototype,"areaLabel",void 0),e([_({readOnly:!0})],U.prototype,"perimeterLengthLabel",void 0),e([_()],U.prototype,"mode",void 0),e([_()],U.prototype,"loadingMessages",void 0),e([_()],U.prototype,"visible",null),e([_()],U.prototype,"geodesicMeasurementDistanceThreshold",void 0),U=e([b("esri.views.3d.layers.analyses.AreaMeasurement.support.AreaMeasurementVisualization")],U);const k={laserLineGlowColor:[1,.5,0],laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:[1,1,1],laserLineInnerWidth:1,laserLineGlobalAlpha:.75,laserLineEnabled:!0,handleColor:[1,.5,0],handleOpacity:.5,handleRadius:5,handleRadiusHovered:10,handleRadiusMouse:10,handleRadiusTouch:25,pathLineColor:[1,.5,0,1],pathLineWidth:3,intersectingLineColor:[1,.2,0,1],perimeterLineColor:[1,.5,0,1],perimeterLineWidth:2,projectionLineColor:[1,.5,0,1],projectionLineWidth:2,projectionLineStippleSize:5,areaColor1:[1,.5,0,.5],areaColor2:[1,1,1,.5],fillColor:[1,.5,0,.5],lineSubdivisions:64,labelDistance:25},q={validMeasurement:!1,path:null,pathVersion:-1,cursorPoint:null,measurementData:null,mode:null,positionsGeographic:null,positionsRenderCoords:null,positionsProjected:null,positionsFittedRenderCoords:null,intersectingSegments:null,triangleIndices:null,fittingMode:null,areaCentroid:null,pathLengthLabelSegmentIndex:null,perimeterLengthLabelSegmentIndex:null,checkerSize:null,geodesicCursorSegmentLength:null,cursorSegmentLength:null},O=new M(y(),y());export{U as AreaMeasurementVisualization};
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import"../../../../../../intl.js";import t from"../../../../../../core/Accessor.js";import"../../../../../../core/has.js";import i from"../../../../../../core/Handles.js";import{nextHighestPowerOfTen as s}from"../../../../../../core/mathUtils.js";import{destroyMaybe as r,isNone as n,isSome as a,unwrap as o}from"../../../../../../core/maybe.js";import h from"../../../../../../core/Quantity.js";import{formatDecimal as l}from"../../../../../../core/quantityFormatUtils.js";import{react as m,syncAndInitial as c}from"../../../../../../core/reactiveUtils.js";import{convertUnit as d,preferredImperialAreaUnit as p,preferredMetricAreaUnit as u,preferredImperialLengthUnit as g,preferredMetricLengthUnit as L}from"../../../../../../core/unitUtils.js";import{property as _}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/arrayUtils.js";import"../../../../../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{i as v,t as f}from"../../../../../../chunks/mat4.js";import{c as S}from"../../../../../../chunks/mat4f64.js";import{f as w}from"../../../../../../chunks/vec3.js";import{c as y}from"../../../../../../chunks/vec3f64.js";import j from"../../../../interactive/measurementTools/support/measurementUtils.js";import{midpoint as C}from"../../../../interactive/measurementTools/support/viewUtils.js";import{LabelVisualElement as P}from"../../../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as V}from"../../../../interactive/visualElements/LineVisualElement.js";import{MeasurementAreaVisualElement as A}from"../../../../interactive/visualElements/MeasurementAreaVisualElement.js";import{GeodesicSegment as D,EuclideanSegment as M}from"../../../../interactive/visualElements/support/Segment.js";import{createStipplePatternSimple as R}from"../../../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as I}from"../../../../../../intl/locale.js";import{fetchMessageBundle as z}from"../../../../../../intl/messages.js";let U=class extends t{constructor(e){super(e),this._handles=new i,this._params={...k},this._path=null,this._intersectedPath=null,this._perimeter=null,this._intersectedPerimeter=null,this._projectionLines=null,this._measurementArea=null,this._areaLabel=null,this._pathLengthLabel=null,this._cursorSegmentLengthLabel=null,this._perimeterLengthLabel=null,this._pathSegments=[],this._perimeterSegments=[],this._cursorSegment=null,this._origin=y(),this._originTransform=S(),this._cursorPositionRenderSpace=y(),this.messages=null,this.viewData=q,this.areaLabel=null,this.perimeterLengthLabel=null,this.mode=0,this.loadingMessages=!0,this.geodesicMeasurementDistanceThreshold=1e5}get visible(){return this.analysisView.visible}get testData(){return{labels:{area:this._areaLabel,pathLength:this._pathLengthLabel,cursorSegmentLength:this._cursorSegmentLengthLabel,perimeterLength:this._perimeterLengthLabel}}}initialize(){const e=this.view,t=this._params;this._path=new V({view:e,attached:!0,width:t.pathLineWidth,color:t.pathLineColor,polygonOffset:!0,renderOccluded:4}),this._intersectedPath=new V({view:e,attached:!0,width:t.pathLineWidth,color:t.intersectingLineColor,polygonOffset:!0,renderOccluded:4}),this._perimeter=new V({view:e,attached:!0,width:t.perimeterLineWidth,color:t.perimeterLineColor,polygonOffset:!0,renderOccluded:4}),this._intersectedPerimeter=new V({view:e,attached:!0,width:t.perimeterLineWidth,color:t.intersectingLineColor,polygonOffset:!0,renderOccluded:4}),this._projectionLines=new V({view:e,attached:!0,width:t.projectionLineWidth,color:t.projectionLineColor,stipplePattern:R(t.projectionLineStippleSize),stippleIntegerRepeats:!1,polygonOffset:!0,renderOccluded:4}),this._measurementArea=new A({view:e,attached:!0,color1:t.areaColor1,color2:t.areaColor2}),this._areaLabel=new P({view:this.view,attached:!0,fontSize:16}),this._pathLengthLabel=new P({view:e,attached:!0,fontSize:12}),this._cursorSegmentLengthLabel=new P({view:e,attached:!0,fontSize:12}),this._perimeterLengthLabel=new P({view:e,attached:!0,fontSize:12});const i=this.analysisView.analysisViewData;this._handles.add([m((()=>[this.mode,this.visible,this.analysisView.unit,i.measurementData,i.cursorPoint]),(()=>this._update()),c),m((()=>{var t;return null==(t=e.state)?void 0:t.camera}),(()=>this._updateLabels()),c),I((async()=>this._updateMessageBundle()))]),this._updateMessageBundle()}destroy(){this._measurementArea=r(this._measurementArea),this._path=r(this._path),this._intersectedPath=r(this._intersectedPath),this._perimeter=r(this._perimeter),this._intersectedPerimeter=r(this._intersectedPerimeter),this._areaLabel=r(this._areaLabel),this._pathLengthLabel=r(this._pathLengthLabel),this._cursorSegmentLengthLabel=r(this._cursorSegmentLengthLabel),this._perimeterLengthLabel=r(this._perimeterLengthLabel),this._handles=r(this._handles),this.set("view",null)}_update(){if(this.destroyed)return;const e=this.analysisView.analysisViewData.measurementData;n(e)||(this._updateViewData(e,this.analysisView.analysisViewData.path,this.analysisView.analysisViewData.cursorPoint),this._updateOrigin(),this._updatePathSegments(),this._updatePerimeterSegments(),this._updateArea(),this._updateProjectionLines(),this._updateLabels())}_updateViewData(e,t,i){const r=t.isValidPolygon,n=t.lastPoint,o=a(n)&&a(i)?new h(j.segmentLengthGeodesic(n,i),"meters"):null,l=a(n)&&a(i)?new h(e.unitNormalizer.normalizeDistance(j.segmentLengthEuclidean(n,i,e.unitNormalizer.spatialReference)),"meters"):null;let m=this.mode;if(0===this.mode){m=1;(e.geodesicPathLength?e.geodesicPathLength.value:0)+(!r&&a(o)?o.value:0)>this.geodesicMeasurementDistanceThreshold&&(m=2)}null==e.geodesicPathLength&&(m=1);const c=2===m,p=c?e.geodesicArea:e.area;let u=1;if(p){const t=this._toPreferredAreaUnit(p,this.analysisView.unit);u=s(Math.sqrt(t.value)/Math.sqrt(300)),u*=Math.sqrt(d(1,t.unit,"square-meters")),u/=e.unitNormalizer.normalizeDistance(1)}const g={validMeasurement:r,path:t,pathVersion:t.version,cursorPoint:i,measurementData:e,mode:m,positionsGeographic:e.positionsGeographic,positionsRenderCoords:e.positionsRenderCoords,positionsProjected:e.positionsProjectedWorldCoords,positionsFittedRenderCoords:e.positionsFittedRenderCoords,intersectingSegments:c?e.geodesicIntersectingSegments:e.intersectingSegments,triangleIndices:c?e.geodesicTriangleIndices:e.triangleIndices,fittingMode:e.fittingMode,areaCentroid:c?e.geodesicAreaCentroidRenderCoords:e.areaCentroidRenderCoords,pathLengthLabelSegmentIndex:r?0:t.numVertices-2,perimeterLengthLabelSegmentIndex:0,checkerSize:u,geodesicCursorSegmentLength:o,cursorSegmentLength:l};this._set("viewData",g)}_updateOrigin(){const e=this.viewData;C(e.positionsRenderCoords,this._origin),v(this._originTransform),f(this._originTransform,this._originTransform,this._origin),this._measurementArea.transform=this._originTransform,this._projectionLines.transform=this._originTransform}_createSegments(e){const t=this.viewData,i=t.path,s=this.view.renderCoordsHelper.spatialReference,r=t.mode,n=[],a=[],o=[],h=t.validMeasurement?i.numVertices:i.numVertices-1;for(let l=0;l<h;++l){const h=t[e][l],m=t[e][(l+1)%i.numVertices];let c=null;switch(r){case 1:c=new M(h,m);break;case 2:c=new D(h,m,s)}t.intersectingSegments.has(l)?o.push(c):a.push(c),n.push(c)}return{all:n,nonIntersecting:a,intersecting:o}}_updatePathSegments(){const e=this.visible,t=this.viewData,i=this._createSegments("positionsRenderCoords"),s=t.path,r=!s.isValidPolygon,n=t.cursorPoint,o=this.view.renderCoordsHelper,h=o.spatialReference,l=t.mode;if(this._cursorSegment=null,s.numVertices>0&&r&&a(n)){if(o.toRenderCoords(n,this._cursorPositionRenderSpace)){const e=t.positionsRenderCoords[s.numVertices-1],r=this._cursorPositionRenderSpace;let n=null;switch(l){case 1:n=new M(e,r);break;case 2:n=new D(e,r,h)}i.nonIntersecting.push(n),this._cursorSegment=n}}this._path.setGeometryFromSegments(i.nonIntersecting,this._origin),this._path.visible=e,this._intersectedPath.setGeometryFromSegments(i.intersecting,this._origin),this._intersectedPath.visible=e,this._pathSegments=i.all}_updatePerimeterSegments(){const e=this.visible&&1===this.viewData.mode,t=this._createSegments("positionsFittedRenderCoords");this._perimeter.setGeometryFromSegments(t.nonIntersecting,this._origin),this._perimeter.visible=e,this._intersectedPerimeter.setGeometryFromSegments(t.intersecting,this._origin),this._intersectedPerimeter.visible=e,this._perimeterSegments=t.all}_updateArea(){const e=this.viewData;switch(e.mode){case 1:this._updateAreaEuclidean(e);break;case 2:this._updateAreaGeodesic()}}_updateAreaEuclidean(e){const t=this.visible;e.validMeasurement&&0===e.intersectingSegments.size&&e.triangleIndices?(this._measurementArea.geometry={uv:e.positionsProjected,position:e.positionsFittedRenderCoords,triangleIndices:e.triangleIndices},this._measurementArea.size=[e.checkerSize,e.checkerSize],this._measurementArea.visible=t):this._measurementArea.visible=!1}_updateAreaGeodesic(){this._measurementArea.visible=!1}_updateProjectionLines(){const e=this.viewData,t=this.visible,i=e.path,s=e.mode;if(i.numVertices>0&&e.validMeasurement&&1===s){const s=[];for(let t=0;t<i.numVertices;++t){const i=y();w(i,e.positionsRenderCoords[t],this._origin);const r=y();w(r,e.positionsFittedRenderCoords[t],this._origin),s.push([i,r])}this._projectionLines.geometry=s,this._projectionLines.visible=t}else this._projectionLines.geometry=null,this._projectionLines.visible=!1}_updateLabels(){if(this.destroyed)return;const e=this.viewData,t=e.path;if(!t)return;const i=e.measurementData,s=e.mode,r=!t.isValidPolygon,n=this.visible,h=this._formatAreaLabel(this.messages,2===s?i.geodesicArea:i.area,this.analysisView.unit);a(h)?(this._areaLabel.geometry={type:"point",point:e.areaCentroid},this._areaLabel.text=h,this._areaLabel.visible=e.validMeasurement&&0===e.intersectingSegments.size&&n):this._areaLabel.visible=!1,this._set("areaLabel",o(h));const l=this._formatLengthLabel(this.messages,2===s?i.geodesicPathLength:i.pathLength,this.analysisView.unit);if(a(l)&&e.pathLengthLabelSegmentIndex>=0&&e.pathLengthLabelSegmentIndex<this._pathSegments.length){const i=this._pathSegments[e.pathLengthLabelSegmentIndex],s=a(this._cursorSegment)?this._cursorSegment:O;this._pathLengthLabel.distance=this._params.labelDistance,this._pathLengthLabel.geometry={type:"corner",left:i,right:s},this._pathLengthLabel.text=l,this._pathLengthLabel.visible=r&&t.numVertices>0&&n}else this._pathLengthLabel.visible=!1;const m=2===s?e.geodesicCursorSegmentLength:e.cursorSegmentLength;if(a(m)){const e=this._formatLengthLabel(this.messages,m,this.analysisView.unit);this._cursorSegmentLengthLabel.distance=this._params.labelDistance,this._cursorSegmentLengthLabel.geometry=a(this._cursorSegment)?{type:"segment",segment:this._cursorSegment,sampleLocation:"end"}:null,this._cursorSegmentLengthLabel.anchor="bottom",this._cursorSegmentLengthLabel.text=o(e),this._cursorSegmentLengthLabel.visible=r&&0!==m.value&&n}else this._cursorSegmentLengthLabel.visible=!1;this._cursorSegmentLengthLabel.overlaps(this._pathLengthLabel)&&(this._cursorSegmentLengthLabel.visible=!1),this._pathLengthLabel.overlaps(this._areaLabel)&&(this._pathLengthLabel.visible=!1);const c=2===e.mode,d=c?i.geodesicPathLength:i.perimeterLength,p=o(null!=d?this._formatLengthLabel(this.messages,d,this.analysisView.unit):null);if(this._set("perimeterLengthLabel",o(p)),e.validMeasurement&&0===e.intersectingSegments.size){this._perimeterLengthLabel.distance=this._params.labelDistance,this._perimeterLengthLabel.anchor="top",this._perimeterLengthLabel.text=p,this._perimeterLengthLabel.visible=!0;let t=!0;for(let i=0;i<e.path.numVertices;++i){const s=(e.perimeterLengthLabelSegmentIndex+i)%e.path.numVertices,r=c?this._pathSegments[s]:this._perimeterSegments[s];if(t=!0,this._perimeterLengthLabel.geometry={type:"segment",segment:r,sampleLocation:"center"},!this._perimeterLengthLabel.overlaps(this._areaLabel))break;t=!1}this._perimeterLengthLabel.visible=t&&n}else this._perimeterLengthLabel.visible=!1}_toPreferredAreaUnit(e,t){return e.toUnit(this._preferredAreaUnit(e,t))}_preferredAreaUnit(e,t){switch(t){case"metric":return u(e.value,e.unit);case"imperial":return p(e.value,e.unit);default:return t}}_preferredLengthUnit(e,t){const i=this._deriveLengthUnitFromAreaUnit(t);switch(i){case"metric":return L(e.value,e.unit);case"imperial":return g(e.value,e.unit);default:return i}}_deriveLengthUnitFromAreaUnit(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-us-feet":return"us-feet";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";case"square-meters":return"meters";case"square-kilometers":return"kilometers"}throw new Error("unhandled area unit")}_formatAreaLabel(e,t,i){return e&&t&&l(e,t,this._preferredAreaUnit(t,i))}_formatLengthLabel(e,t,i){return e&&t&&l(e,t,this._preferredLengthUnit(t,i))}_updateMessageBundle(){this.loadingMessages=!0,z("esri/core/t9n/Units").then((e=>{this.messages=e,this.view&&this._update()})).finally((()=>{this.loadingMessages=!1}))}};e([_()],U.prototype,"view",void 0),e([_()],U.prototype,"messages",void 0),e([_()],U.prototype,"analysis",void 0),e([_()],U.prototype,"viewData",void 0),e([_()],U.prototype,"analysisView",void 0),e([_({readOnly:!0})],U.prototype,"areaLabel",void 0),e([_({readOnly:!0})],U.prototype,"perimeterLengthLabel",void 0),e([_()],U.prototype,"mode",void 0),e([_()],U.prototype,"loadingMessages",void 0),e([_()],U.prototype,"visible",null),e([_()],U.prototype,"geodesicMeasurementDistanceThreshold",void 0),U=e([b("esri.views.3d.layers.analyses.AreaMeasurement.support.AreaMeasurementVisualization")],U);const k={laserLineGlowColor:[1,.5,0],laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:[1,1,1],laserLineInnerWidth:1,laserLineGlobalAlpha:.75,laserLineEnabled:!0,handleColor:[1,.5,0],handleOpacity:.5,handleRadius:5,handleRadiusHovered:10,handleRadiusMouse:10,handleRadiusTouch:25,pathLineColor:[1,.5,0,1],pathLineWidth:3,intersectingLineColor:[1,.2,0,1],perimeterLineColor:[1,.5,0,1],perimeterLineWidth:2,projectionLineColor:[1,.5,0,1],projectionLineWidth:2,projectionLineStippleSize:5,areaColor1:[1,.5,0,.5],areaColor2:[1,1,1,.5],fillColor:[1,.5,0,.5],lineSubdivisions:64,labelDistance:25},q={validMeasurement:!1,path:null,pathVersion:-1,cursorPoint:null,measurementData:null,mode:null,positionsGeographic:null,positionsRenderCoords:null,positionsProjected:null,positionsFittedRenderCoords:null,intersectingSegments:null,triangleIndices:null,fittingMode:null,areaCentroid:null,pathLengthLabelSegmentIndex:null,perimeterLengthLabelSegmentIndex:null,checkerSize:null,geodesicCursorSegmentLength:null,cursorSegmentLength:null},O=new M(y(),y());export{U as AreaMeasurementVisualization};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{destroyMaybe as i,unwrapOr as a}from"../../../../../core/maybe.js";import{EsriPromiseMixin as s}from"../../../../../core/Promise.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as o}from"../../../../../properties/defaultUnit.js";import{DirectLineMeasurementController as r}from"../../analysis/DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as u}from"../../analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js";let p=class extends(s(e)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.result=null,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{destroyMaybe as i,unwrapOr as a}from"../../../../../core/maybe.js";import{EsriPromiseMixin as s}from"../../../../../core/Promise.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as o}from"../../../../../properties/defaultUnit.js";import{DirectLineMeasurementController as r}from"../../analysis/DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as u}from"../../analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js";let p=class extends(s(e)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.result=null,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}initialize(){const t=this.view,e=this.analysis;this._analysisVisualization=new u({view:t,analysis:e,analysisView:this}),this._analysisController=new r({view:t,analysis:e,viewData:this})}destroy(){this._analysisController=i(this._analysisController),this._analysisVisualization=i(this._analysisVisualization)}whenReady(){return this._analysisVisualization.whenReady()}get updating(){var t;return!(null==(t=this._analysisVisualization)||!t.loadingMessages)}get viewMode(){return this._analysisVisualization.viewMode}get visualizedMeasurement(){return this._analysisVisualization.visualizedMeasurement}set visualizedMeasurement(t){this._analysisVisualization.visualizedMeasurement=t}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct.text}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal.text}get verticalLabelText(){return this._analysisVisualization.labels.vertical.text}get testData(){var t;return this.destroyed?{labels:null,stripeLength:null,visualization:null,controller:null}:{...null==(t=this._analysisVisualization)?void 0:t.testData,visualization:this._analysisVisualization,controller:this._analysisController}}get unit(){return a(this.analysis.unit,this._defaultUnit)}};t([l()],p.prototype,"updating",null),t([l()],p.prototype,"type",void 0),t([l()],p.prototype,"analysis",void 0),t([l()],p.prototype,"result",void 0),t([l()],p.prototype,"view",void 0),t([l()],p.prototype,"elevationAlignedStartPoint",void 0),t([l()],p.prototype,"elevationAlignedEndPoint",void 0),t([l({readOnly:!0})],p.prototype,"viewMode",null),t([l()],p.prototype,"visualizedMeasurement",null),t([l({readOnly:!0})],p.prototype,"actualVisualizedMeasurement",null),t([l()],p.prototype,"visualElementOrientation",null),t([l()],p.prototype,"allowVisualElementsOrientationChange",null),t([l()],p.prototype,"triangleCollapseRatioThreshold",null),t([l({readOnly:!0})],p.prototype,"directLabelText",null),t([l({readOnly:!0})],p.prototype,"horizontalLabelText",null),t([l({readOnly:!0})],p.prototype,"verticalLabelText",null),t([l()],p.prototype,"testData",null),t([l()],p.prototype,"_analysisVisualization",void 0),t([l()],p.prototype,"_analysisController",void 0),t([l()],p.prototype,"unit",null),t([l(o)],p.prototype,"_defaultUnit",void 0),p=t([n("esri.views.3d.layers.analyses.DirectLineMeasurement.DirectLineMeasurementView3D")],p);const y=p;export{y 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.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import{isNone as e,isSome as r}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{b as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as l}from"../../../../chunks/vec2f64.js";import{m as p,a as u,s as d,g as f}from"../../../../chunks/vec3.js";import{Z as m,c as g}from"../../../../chunks/vec3f64.js";import{s as b,t as v,b as y}from"../../../../chunks/vec4.js";import{c as G}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as S}from"../../../../geometry/projectionEllipsoid.js";import{create as B,empty as w,offset as D,width as V,height as j,expand as N,intersects as _}from"../../../../geometry/support/aaBoundingRect.js";import{a as P,c as C,e as I}from"../../../../chunks/boundedPlane.js";import{create as x}from"../../../../geometry/support/ray.js";import{d as A,g as M,i as z,c as O}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as T,prepare as E,drawPoly as F}from"./deconflictorDebug.js";import X from"../../support/debugFlags.js";import Y from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as R}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";const W=g(),U=G(),L=G(),H=g(),Z=h(),q=O(),J=x(),K=g(),Q=B();class ${constructor(){this.aabr=B(),this.distance=0,this.culled=!1,this.visible=!1}}class ii{constructor(i,t,s={}){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info=s}}class ti{constructor(){this.active=new Map,this.visible=new Map}clear(){this.active.clear(),this.visible.clear()}}class si{}class ei{constructor(){this.sortArray=new a({allocator:i=>i||new si})}}class ri{constructor(){this.camera=new Y,this.slicePlane=P(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),C(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let ai=class extends t{constructor(){super(...arguments),this._dirty=!1,this._runningViewState=new ri,this._state=0,this.graphics=new ti,this.iterators=new ei,this.accBinsNumX=15,this.accBinsNumY=20,this.accBinsSizeX=0,this.accBinsSizeY=0,this.accBins=null,this.accNumTests=0}get dirty(){return this._dirty}get state(){return this._state}destroy(){this.graphics.clear(),this.iterators=null}setDirty(){!this._dirty&&this.graphics.active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return 0!==this._state||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/4;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case 0:this.startUpdate(),i.madeProgress();case 1:if(this._state=1,!this.processActiveGraphics(i))return;case 2:if(this._state=2,!this.sortVisibleGraphics(i))return;case 3:if(this._state=3,!this.deconflictVisibleGraphics(i))return;default:T(this,this.graphics.visible),this._state=0,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(e(i)||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.getNumGeometryRecords():0))return!1;return t.getGeometryRecord(0).material instanceof k}startUpdate(){E(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this.initBins(i,t),this.resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new $,this.graphics.active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this.removeFromVisibleGraphics(i),oi(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this.graphics.active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}addToVisibleGraphics(i){this.graphics.visible.set(i.graphics3DGraphic.graphic.uid,i)}removeFromVisibleGraphics(i){this.graphics.visible.delete(i.graphics3DGraphic.graphic.uid)}processActiveGraphics(i){const t=this.ensureActiveGraphicsIterator(),s=n(Z,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?q:null;let a=0;for(r(e)&&(p(e,m,this._runningViewState.camera.viewMatrix),e[3]=S(this.view.spatialReference).radius,a=A(e,m));!i.done;){i.madeProgress();const r=t.next();if(r.done)return this.resetActiveGraphicsIterator(),!0;const o=r.value,c=o&&o.info[this.visibilityGroup];c&&(this.collectGraphics3DGraphics(o,s,e,a),c.culled?this.removeFromVisibleGraphics(o):this.addToVisibleGraphics(o))}return!1}sortVisibleGraphics(i){const t=this.ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),s.done)return this.resetSortGraphicsIterator(),!0}return!1}deconflictVisibleGraphics(i){const t=this.ensureVisibleGraphicsIterator(),s=1===this.visibilityGroup;for(;!i.done;){i.madeProgress();const e=t.next();if(e.done)return this.resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled)continue;const o=r.graphics3DGraphic,c=(!s||o.isVisible())&&!this.isConflicted(r);c&&this.addToBins(r),a.visible=c,this.setGraphicVisibility(r,c),F(a,c)}return!1}resetIterators(){this.iterators.active=null,this.iterators.visible=null,this.iterators.sort=null}ensureActiveGraphicsIterator(){return this.iterators.active||(this.iterators.active=ci(this.graphics.active)),this.iterators.active}resetActiveGraphicsIterator(){this.iterators.active=null}ensureVisibleGraphicsIterator(){return this.iterators.visible||(this.iterators.visible=ci(this.graphics.visible)),this.iterators.visible}resetVisibleGraphicsIterator(){this.iterators.visible=null}ensureSortGraphicsIterator(){return this.iterators.sort||(this.iterators.sort=ni(this.graphics.visible,this.iterators.sortArray,this.visibilityGroup)),this.iterators.sort}resetSortGraphicsIterator(){this.iterators.sort=null}collectGraphics3DGraphics(i,t,s,a){const o=i.graphics3DGraphic;if(o.destroyed)return;const c=i.info[this.visibilityGroup];if(!o.isVisible(0,3))return void(c.culled=!0);const n=this.getGraphicsLayers(o);w(c.aabr);let h=null;for(const l of n){if(!this.layerSupportsDeconfliction(l))continue;const o=l.stageObject.getGeometryRecord(0).material;if(e(h)){if(h=this.getProjectionInfo(l,t,pi),h.isOutsideScreen||this.isCulledBySlice(i,W)||r(s)&&this.isCulledByHorizon(h,s,a))return void(c.culled=!0);!X.DISABLE_DECONFLICTOR_VISIBILITY_OFFSET&&c.visible&&(h.distance*=.7)}this.expandBoundingRect(c,l,o,h)}e(h)?c.culled=!0:(c.distance=h.distance,c.culled=!1)}getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.getGeometryRecord(0),o=a.material,c=M(r.boundingVolumeWorldSpace.bounds);p(W,c,e.viewMatrix);const n=a.geometry.vertexAttributes,h=n.get("normal").data,l=n.get("auxpos1").data;return o.applyShaderOffsetsView(W,h,r.transformation,l,e,s.scaleInfo,W),b(U,W[0],W[1],W[2],1),v(L,U,e.projectionMatrix),u(s.positionNDC,L,1/L[3]),o.applyShaderOffsetsNDC(s.positionNDC,l,e,s.positionNDC,H),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(H[2]),s.distance=H[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),b(L,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),v(U,L,t),y(U,U,1/U[3]),d(s.positionView,W[0],W[1],W[2]),s}isCulledByHorizon(i,t,s){return f(J.direction,i.positionView),d(J.origin,0,0,0),!!z(t,J,K)&&i.distanceWithoutPolygonOffset>s}isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&I(this._runningViewState.slicePlane,t)}expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(hi);R(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=D(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,Q),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),h=this.iconMarginFactor;if(0!==h){const i=h*Math.min(V(n),j(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}N(i.aabr,n,i.aabr)}isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this.accBinsSizeX);e<=Math.floor(s.aabr[2]/this.accBinsSizeX);e++)if(!(e<0||e>=this.accBinsNumX))for(let i=Math.floor(s.aabr[1]/this.accBinsSizeY);i<=Math.floor(s.aabr[3]/this.accBinsSizeY);i++){if(i<0||i>=this.accBinsNumY)continue;const r=this.accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],a=e.info[this.visibilityGroup];if(a&&a.visible&&(e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,_(a.aabr,s.aabr))))return!0}}return!1}initBins(i,t){if(null==this.accBins){this.accBins=[];for(let i=0;i<this.accBinsNumX;i++){this.accBins.push([]);const i=this.accBins[this.accBins.length-1];for(let t=0;t<this.accBinsNumY;t++)i.push(new a)}}else for(let s=0;s<this.accBinsNumX;s++)for(let i=0;i<this.accBinsNumY;i++)this.accBins[s][i].clear();this.accBinsSizeX=i/this.accBinsNumX,this.accBinsSizeY=t/this.accBinsNumY,this.accNumTests=0}addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this.accBinsSizeX),e=Math.floor(t.aabr[2]/this.accBinsSizeX),r=Math.floor(t.aabr[1]/this.accBinsSizeY),a=Math.floor(t.aabr[3]/this.accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this.accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this.accBinsNumY||this.accBins[o][t].push(i)}setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(3,t,this.visibilityGroup),1===this.visibilityGroup&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function oi(i,t){const s=i.graphics3DGraphic;s.destroyed||s.clearVisibilityFlag(3,t)}function*ci(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ni(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.prio=i.info?-i.info[s].distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>t.prio-i.prio));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([o({constructOnly:!0})],ai.prototype,"view",void 0),i([o({type:Boolean,readOnly:!0})],ai.prototype,"updating",null),ai=i([c("esri.views.3d.layers.graphics.Deconflictor")],ai);const hi=l();class li{constructor(){this.positionView=g(),this.positionNDC=g(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}}}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const pi=new li;export{ai as Deconflictor,ii as DeconflictorGraphic,ri as DeconflictorViewState};
|
|
5
|
+
import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import{isNone as e,isSome as r}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{b as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as l}from"../../../../chunks/vec2f64.js";import{m as p,a as u,s as d,g as f}from"../../../../chunks/vec3.js";import{Z as m,c as g}from"../../../../chunks/vec3f64.js";import{s as b,t as v,b as y}from"../../../../chunks/vec4.js";import{c as G}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as S}from"../../../../geometry/projectionEllipsoid.js";import{create as B,empty as w,offset as D,width as j,height as V,expand as N,intersects as _}from"../../../../geometry/support/aaBoundingRect.js";import{a as P,c as x,e as C}from"../../../../chunks/boundedPlane.js";import{create as I}from"../../../../geometry/support/ray.js";import{d as A,g as M,i as z,c as T}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as O,prepare as E,drawPoly as X}from"./deconflictorDebug.js";import F from"../../support/debugFlags.js";import Y from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as k}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as R}from"../../webgl-engine/materials/HUDMaterial.js";const W=g(),U=G(),H=G(),L=g(),Z=h(),q=T(),J=I(),K=g(),Q=B();class ${constructor(){this.aabr=B(),this.distance=0,this.culled=!1,this.visible=!1}}class ii{constructor(i,t,s={}){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info=s}}class ti{constructor(){this.active=new Map,this.visible=new Map}clear(){this.active.clear(),this.visible.clear()}}class si{}class ei{constructor(){this.sortArray=new a({allocator:i=>i||new si})}}class ri{constructor(){this.camera=new Y,this.slicePlane=P(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),x(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let ai=class extends t{constructor(){super(...arguments),this._dirty=!1,this._runningViewState=new ri,this._state=0,this.graphics=new ti,this.iterators=new ei,this.accBinsNumX=15,this.accBinsNumY=20,this.accBinsSizeX=0,this.accBinsSizeY=0,this.accBins=null,this.accNumTests=0}get dirty(){return this._dirty}get state(){return this._state}destroy(){this.graphics.clear(),this.iterators=null}setDirty(){!this._dirty&&this.graphics.active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return 0!==this._state||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/4;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case 0:this.startUpdate(),i.madeProgress();case 1:if(this._state=1,!this.processActiveGraphics(i))return;case 2:if(this._state=2,!this.sortVisibleGraphics(i))return;case 3:if(this._state=3,!this.deconflictVisibleGraphics(i))return;default:O(this,this.graphics.visible),this._state=0,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(e(i)||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometryRecords.length:0))return!1;return t.geometryRecords[0].material instanceof R}startUpdate(){E(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this.initBins(i,t),this.resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new $,this.graphics.active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this.removeFromVisibleGraphics(i),oi(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this.graphics.active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}addToVisibleGraphics(i){this.graphics.visible.set(i.graphics3DGraphic.graphic.uid,i)}removeFromVisibleGraphics(i){this.graphics.visible.delete(i.graphics3DGraphic.graphic.uid)}processActiveGraphics(i){const t=this.ensureActiveGraphicsIterator(),s=n(Z,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?q:null;let a=0;for(r(e)&&(p(e,m,this._runningViewState.camera.viewMatrix),e[3]=S(this.view.spatialReference).radius,a=A(e,m));!i.done;){i.madeProgress();const r=t.next();if(r.done)return this.resetActiveGraphicsIterator(),!0;const o=r.value,c=o&&o.info[this.visibilityGroup];c&&(this.collectGraphics3DGraphics(o,s,e,a),c.culled?this.removeFromVisibleGraphics(o):this.addToVisibleGraphics(o))}return!1}sortVisibleGraphics(i){const t=this.ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),s.done)return this.resetSortGraphicsIterator(),!0}return!1}deconflictVisibleGraphics(i){const t=this.ensureVisibleGraphicsIterator(),s=1===this.visibilityGroup;for(;!i.done;){i.madeProgress();const e=t.next();if(e.done)return this.resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled)continue;const o=r.graphics3DGraphic,c=(!s||o.isVisible())&&!this.isConflicted(r);c&&this.addToBins(r),a.visible=c,this.setGraphicVisibility(r,c),X(a,c)}return!1}resetIterators(){this.iterators.active=null,this.iterators.visible=null,this.iterators.sort=null}ensureActiveGraphicsIterator(){return this.iterators.active||(this.iterators.active=ci(this.graphics.active)),this.iterators.active}resetActiveGraphicsIterator(){this.iterators.active=null}ensureVisibleGraphicsIterator(){return this.iterators.visible||(this.iterators.visible=ci(this.graphics.visible)),this.iterators.visible}resetVisibleGraphicsIterator(){this.iterators.visible=null}ensureSortGraphicsIterator(){return this.iterators.sort||(this.iterators.sort=ni(this.graphics.visible,this.iterators.sortArray,this.visibilityGroup)),this.iterators.sort}resetSortGraphicsIterator(){this.iterators.sort=null}collectGraphics3DGraphics(i,t,s,a){const o=i.graphics3DGraphic;if(o.destroyed)return;const c=i.info[this.visibilityGroup];if(!o.isVisible(0,3))return void(c.culled=!0);const n=this.getGraphicsLayers(o);w(c.aabr);let h=null;for(const l of n){if(!this.layerSupportsDeconfliction(l))continue;const o=l.stageObject.geometryRecords[0].material;if(e(h)){if(h=this.getProjectionInfo(l,t,pi),h.isOutsideScreen||this.isCulledBySlice(i,W)||r(s)&&this.isCulledByHorizon(h,s,a))return void(c.culled=!0);!F.TESTS_DISABLE_OPTIMIZATIONS&&c.visible&&(h.distance*=.7)}this.expandBoundingRect(c,l,o,h)}e(h)?c.culled=!0:(c.distance=h.distance,c.culled=!1)}getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometryRecords[0],o=a.material,c=M(r.boundingVolumeWorldSpace.bounds);p(W,c,e.viewMatrix);const n=a.geometry.vertexAttributes,h=n.get("normal").data,l=n.get("auxpos1").data;return o.applyShaderOffsetsView(W,h,r.transformation,l,e,s.scaleInfo,W),b(U,W[0],W[1],W[2],1),v(H,U,e.projectionMatrix),u(s.positionNDC,H,1/H[3]),o.applyShaderOffsetsNDC(s.positionNDC,l,e,s.positionNDC,L),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(L[2]),s.distance=L[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),b(H,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),v(U,H,t),y(U,U,1/U[3]),d(s.positionView,W[0],W[1],W[2]),s}isCulledByHorizon(i,t,s){return f(J.direction,i.positionView),d(J.origin,0,0,0),!!z(t,J,K)&&i.distanceWithoutPolygonOffset>s}isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&C(this._runningViewState.slicePlane,t)}expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(hi);k(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=D(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,Q),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),h=this.iconMarginFactor;if(0!==h){const i=h*Math.min(j(n),V(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}N(i.aabr,n,i.aabr)}isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this.accBinsSizeX);e<=Math.floor(s.aabr[2]/this.accBinsSizeX);e++)if(!(e<0||e>=this.accBinsNumX))for(let i=Math.floor(s.aabr[1]/this.accBinsSizeY);i<=Math.floor(s.aabr[3]/this.accBinsSizeY);i++){if(i<0||i>=this.accBinsNumY)continue;const r=this.accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],a=e.info[this.visibilityGroup];if(a&&a.visible&&(e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,_(a.aabr,s.aabr))))return!0}}return!1}initBins(i,t){if(null==this.accBins){this.accBins=[];for(let i=0;i<this.accBinsNumX;i++){this.accBins.push([]);const i=this.accBins[this.accBins.length-1];for(let t=0;t<this.accBinsNumY;t++)i.push(new a)}}else for(let s=0;s<this.accBinsNumX;s++)for(let i=0;i<this.accBinsNumY;i++)this.accBins[s][i].clear();this.accBinsSizeX=i/this.accBinsNumX,this.accBinsSizeY=t/this.accBinsNumY,this.accNumTests=0}addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this.accBinsSizeX),e=Math.floor(t.aabr[2]/this.accBinsSizeX),r=Math.floor(t.aabr[1]/this.accBinsSizeY),a=Math.floor(t.aabr[3]/this.accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this.accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this.accBinsNumY||this.accBins[o][t].push(i)}setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(3,t,this.visibilityGroup),1===this.visibilityGroup&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function oi(i,t){const s=i.graphics3DGraphic;s.destroyed||s.clearVisibilityFlag(3,t)}function*ci(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ni(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.prio=i.info?-i.info[s].distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>t.prio-i.prio));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([o({constructOnly:!0})],ai.prototype,"view",void 0),i([o({type:Boolean,readOnly:!0})],ai.prototype,"updating",null),ai=i([c("esri.views.3d.layers.graphics.Deconflictor")],ai);const hi=l();class li{constructor(){this.positionView=g(),this.positionNDC=g(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}}}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const pi=new li;export{ai as Deconflictor,ii as DeconflictorGraphic,ri as DeconflictorViewState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../core/maybe.js";import{e}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as n,computeTranslationToOriginAndRotation as r}from"../../../../geometry/projection.js";import{
|
|
5
|
+
import{isNone as t}from"../../../../core/maybe.js";import{e}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as n,computeTranslationToOriginAndRotation as r}from"../../../../geometry/projection.js";import{evaluateElevationInfoAtPoint as i,SampleElevationInfo as l}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as c}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as f}from"../../support/ElevationProvider.js";function p(t,e,a,o){const s=t.stageObject,r=a.spatialReference,l=s.geometryRecords,c="absolute-height"!==e.mode;let p=0;for(const u of l){const t=u.geometry,l=u.getShaderTransformation();I[0]=l[12],I[1]=l[13],I[2]=l[14],t.invalidateBoundingInfo();const d=t.getMutableAttribute("position"),h=d.data,S=t.vertexAttributes.get("mapPos").data,M=d.size,E=h.length/M,v=new f(S,r);let j=0,O=!1,y=0;for(let s=0;s<E;s++){if(g[0]=h[j],g[1]=h[j+1],g[2]=h[j+2],i(v,a,e,o,A),c&&(y+=A.sampledElevation),m.TESTS_DISABLE_OPTIMIZATIONS)h[j]=v.array[v.offset],h[j+1]=v.array[v.offset+1],h[j+2]=A.z,n(h,r,j,h,o.spatialReference,j,1),h[j]-=I[0],h[j+1]-=I[1],h[j+2]-=I[2],O=!0;else{b[0]=h[j]+I[0],b[1]=h[j+1]+I[1],b[2]=h[j+2]+I[2],o.setAltitude(b,A.z),h[j]=b[0]-I[0],h[j+1]=b[1]-I[1],h[j+2]=b[2]-I[2];const t=T/o.unitInMeters;(Math.abs(g[0]-h[j])>=t||Math.abs(g[1]-h[j+1])>=t||Math.abs(g[2]-h[j+2])>=t)&&(O=!0)}j+=M,v.offset+=3}p+=y/E,O&&s.geometryVertexAttrsUpdated(u)}return p/l.length}function u(t,a,s,n){const l=t.stageObject,f=a.centerPointInElevationSR;let p=0;if(l.metadata.usesVerticalDistanceToGround)i(f,s,a,n,A),c(l,A.verticalDistanceToGround),p=A.sampledElevation;else{i(f,s,a,n,A);"absolute-height"!==a.mode&&(p=A.sampledElevation)}const u=e(d,l.transformation),h=o(M,u[12],u[13],u[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(b[0]=f.x,b[1]=f.y,b[2]=A.z,r(f.spatialReference,b,u,n.spatialReference)&&(l.transformation=u)):n.setAltitudeOfTransformation(A.z,u);const I=T/n.unitInMeters;return(Math.abs(u[12]-h[0])>=I||Math.abs(u[13]-h[1])>=I||Math.abs(u[14]-h[2])>=I)&&(l.transformation=u),p}const d=a();function h(e,a,s,n){const l=e.graphics3DSymbolLayer.lodRenderer;if(t(l))return 0;const c=a.centerPointInElevationSR;i(c,s,a,n,A);const f="absolute-height"!==a.mode?A.sampledElevation:0,p=l.instanceData,u=e.instanceIndex,d=S;p.getGlobalTransform(u,d);const h=o(M,d[12],d[13],d[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(b[0]=c.x,b[1]=c.y,b[2]=A.z,r(c.spatialReference,b,d,n.spatialReference)&&p.setGlobalTransform(u,d)):n.setAltitudeOfTransformation(A.z,d);const I=T/n.unitInMeters;return(m.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(d[12]-h[0])>=I||Math.abs(d[13]-h[1])>=I||Math.abs(d[14]-h[2])>=I)&&p.setGlobalTransform(u,d),f}const T=.01,b=s(),I=s(),g=s(),S=a(),M=s(),A=new l;export{h as perLodInstanceElevationAligner,u as perObjectElevationAligner,p as perVertexElevationAligner};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../geometry.js";import{remove as e}from"../../../../core/arrayUtils.js";import{isSome as t}from"../../../../core/maybe.js";import{onAbort as r,createAbortError as s
|
|
5
|
+
import"../../../../geometry.js";import{remove as e}from"../../../../core/arrayUtils.js";import{isSome as t}from"../../../../core/maybe.js";import{onAbort as r,createAbortError as s}from"../../../../core/promiseUtils.js";import{TaskPriority as i}from"../../../support/Scheduler.js";import o from"../../../../geometry/Multipoint.js";class n{constructor(e,t){this.spatialReference=e,this.view=t}getElevation(e,t,r){return this.view.elevationProvider.getElevation(e,t,0,this.spatialReference,r)}async queryElevation(e,t,r,s,i){return this.view.elevationProvider.queryElevation(e,t,0,this.spatialReference,i,r,s)}}class a{constructor(e,t,r,s){this.spatialReference=t,this._getElevationQueryProvider=r,this._queries=new Array,this._queryOptions={...s,ignoreInvisibleLayers:!0},this._frameTask=e.registerTask(i.ELEVATION_QUERY,this)}destroy(){this._frameTask.remove()}queryElevation(t,i,o,n=0){return new Promise(((a,l)=>{const u={x:t,y:i,minDemResolution:n,result:{resolve:a,reject:l},signal:o};this._queries.push(u),r(o,(()=>{e(this._queries,u),l(s())}))}))}get running(){return this._queries.length>0}runTask(){const e=this._queries;this._queries=[];const i=this._getElevationQueryProvider();if(!i)return void e.forEach((e=>e.result.reject()));const n=e.map((e=>[e.x,e.y])),a=e.reduce(((e,t)=>Math.min(e,t.minDemResolution)),1/0),l=new o({points:n,spatialReference:this.spatialReference}),u=e.length>1&&e.some((e=>!!e.signal))?new AbortController:null,c=t(u)?u.signal:e[0].signal;if(t(u)){let t=0;e.forEach((i=>r(i.signal,(()=>{t++,i.result.reject(s()),t===e.length&&u.abort()}))))}const h={...this._queryOptions,minDemResolution:a,signal:c};i.queryElevation(l,h).then((r=>{e.forEach(((e,i)=>{t(e.signal)&&e.signal.aborted?e.result.reject(s()):e.result.resolve(r.geometry.points[i][2])}))})).catch((t=>{e.forEach((e=>e.result.reject(t)))}))}get test(){const e=this;return{update:()=>e._queries.length>0&&e.runTask()}}}export{a as ElevationQuery,n as ViewElevationProvider};
|