@arcgis/core 5.0.0-next.36 → 5.0.0-next.38
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/WebLinkChart.js +1 -1
- package/analysis/ShadowCast/types.d.ts +2 -0
- package/applications/Components/analysisUtils.d.ts +1 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/applications/Components/testUtils.d.ts +4 -0
- package/applications/Components/testUtils.js +5 -0
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
- package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
- package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
- package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
- package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
- package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
- package/assets/esri/core/workers/chunks/2f9129003f77bfeab2f9.js +1 -0
- package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
- package/assets/esri/core/workers/chunks/50ffb22c48fadd36c748.js +1 -0
- package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
- package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
- package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
- package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → 7ab237d19b84d89ff483.js} +7 -7
- package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
- package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
- package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
- package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
- package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
- package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +2 -2
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/Path.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +34 -36
- package/chunks/WaterSurface.glsl.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/iteratorUtils.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +59 -5
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +5 -5
- package/support/revision.js +1 -1
- package/support/tests/meshUtils.js +5 -0
- package/support/tests/serviceMockDependencies.js +5 -0
- package/support/tests/setupServiceMocksMesh.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImagerySubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/intersectionUtils.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/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.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/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.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/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.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/LineMarkerMaterial.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/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/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
- package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
- package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
- package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +0 -1
- package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
- package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
- package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
- package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
- package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
- package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{offsetDateUTC as r}from"../../core/timeUtils.js";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{e as o,
|
|
5
|
+
import{__decorate as e}from"tslib";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{offsetDateUTC as r}from"../../core/timeUtils.js";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{e as o,B as a,A as l,i as p}from"../../chunks/vec32.js";import{fromValues as u,fromArray as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import g from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import{parseTimeDimensionUnit as d}from"./NCTimeParser.js";import y from"./VoxelDimension.js";let f=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0;let i=this.dimensions[3].size>0;if(i){const e=this.dimensions[3];if(i="time"===e.quantity,i&&null!==e.unit){i=d(e.unit).didParse}}if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}get timeStops(){if("xyzt"!==this.volumeType)return[];const e=this.dimensions[3],i=[],s=d(e.unit);if(s.didParse)if(e.isRegular){const t=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let o=0;o<e.size;++o){const e=t+n*o;i.push(r(s.reference,e,s.unit))}}else if(Array.isArray(e.irregularSpacing?.values)&&e.irregularSpacing.values.length>0)for(let t=0;t<e.irregularSpacing.values.length;++t){const n=e.irregularSpacing.values[t];i.push(r(s.reference,n,s.unit))}return i}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return s.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return s.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=u(e.x,e.y,e.z??0);o(i,i,this.originInLayerSpace3D),a(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const s=e.z??0,t=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=t.reduce((e,i)=>Math.abs(n*i-s)<Math.abs(n*e-s)?i:e);for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new g({x:0,y:0,spatialReference:this.spatialReference});const i=m(e);if(l(i,i,this.voxelSizeInLayerSpaceSigned),p(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new g({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new g({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([t({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"id",void 0),e([t({type:[y],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"dimensions",void 0),e([t({type:c,json:{read:{enabled:!1}}})],f.prototype,"spatialReference",void 0),e([t({type:Number,json:{read:!1}})],f.prototype,"zDimension",null),e([t({type:[Boolean],json:{read:!1}})],f.prototype,"isValid",null),e([t({type:[Number],json:{read:!1}})],f.prototype,"originInLayerSpace3D",null),e([t({type:[Number],json:{read:!1}})],f.prototype,"voxelSizeInLayerSpaceSigned",null),e([t({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],f.prototype,"volumeType",null),e([t({type:[Number],json:{read:!1}})],f.prototype,"sizeInVoxels",null),e([t({type:[Date],json:{read:!1,write:!1}})],f.prototype,"timeStops",null),f=e([n("esri.layers.voxel.VoxelVolume")],f);export{f as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.38",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "SEE LICENSE IN copyright.txt",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@amcharts/amcharts5": "~5.14.
|
|
22
|
-
"@arcgis/toolkit": "^5.0.0-next.
|
|
21
|
+
"@amcharts/amcharts5": "~5.14.4",
|
|
22
|
+
"@arcgis/toolkit": "^5.0.0-next.50",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^3.3.2",
|
|
25
|
-
"@vaadin/grid": "~24.9.
|
|
25
|
+
"@vaadin/grid": "~24.9.5",
|
|
26
26
|
"@zip.js/zip.js": "~2.8.8",
|
|
27
27
|
"luxon": "~3.7.2",
|
|
28
|
-
"marked": "~
|
|
28
|
+
"marked": "~17.0.0",
|
|
29
29
|
"tslib": "^2.8.1"
|
|
30
30
|
},
|
|
31
31
|
"type": "module"
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20251113",d="47c76123e885a306881d2d0c77bcf14a9389b2d5";export{c as buildDate,d as commitHash};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../Color.js";import{clone as r}from"../../core/lang.js";import{n as o,f as t,e as s}from"../../chunks/vec32.js";import{fromValues as m,create as n}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../geometry/Mesh.js";import p from"../../geometry/support/MeshComponent.js";import a from"../../geometry/support/MeshGeoreferencedVertexSpace.js";import c from"../../geometry/support/MeshLocalVertexSpace.js";import f from"../../geometry/support/MeshMaterialMetallicRoughness.js";import l from"../../geometry/support/MeshTransform.js";import{MeshVertexAttributes as u}from"../../geometry/support/MeshVertexAttributes.js";import{addMeshCloneContext as g}from"../../geometry/support/meshUtils/meshCloneUtils.js";import{convertVertexSpace as v}from"../../geometry/support/meshUtils/vertexSpaceConversion.js";function x(r,a){const g=m(0,0,1),v=m(1,0,1),x=m(1,1,0),j=o(n(),t(n(),s(n(),v,g),s(n(),x,g)));return new i({components:[new p({faces:[0,1,2],material:new f({color:new e("red")})})],vertexAttributes:new u({normal:[...j,...j,...j],position:[...g,...v,...x],uv:[0,.375,.25,.375,.25,.125]}),spatialReference:r.spatialReference,vertexSpace:new c({origin:m(r.x,r.y,r.z??0)}),transform:new l({scale:a?.scale??[1,1,1],rotationAngle:a?.rotationAngle??0})})}function j(e){if(!e.vertexSpace.origin)return e;const o=new a;return e.clone(g(void 0,{vertexAttributes:new u({...v(e,o),uv:r(e.vertexAttributes.uv),color:r(e.vertexAttributes.color)}),vertexSpace:o,transform:null}))}export{x as createTriangle,j as meshMakeAbsolute};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{e as s}from"../../chunks/containsOperator.js";import{e as n}from"../../chunks/crossesOperator.js";import{e as m}from"../../chunks/generalizeOperator.js";import{e as a}from"../../chunks/intersectsOperator.js";import{e as i}from"../../chunks/overlapsOperator.js";import{e as c}from"../../chunks/touchesOperator.js";import{e as p}from"../../chunks/withinOperator.js";import{getGeometryExtent as u}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as y}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import h from"../../layers/support/FieldsIndex.js";function g(){return{sql:{async createTestFeature(r,t){const o=await e(r,new h(t));return e=>o.testFeature(e)}},projection:{load:r,project:O},geometry:{isGeographic:j,quantize:(e,r)=>y(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:m}=v(e,r,t,o);return s(n,m)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return i(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:m}=v(e,r,t,o);return n(s,m)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=v(e,r,t,o);return p(s,n)},generalize(e,r,t,o,s){if("number"==typeof s)throw new Error("maxDeviation can't be a number because the generalize operator requires a specific unit");const n=m(b(e,r),t,{removeDegenerateParts:o,unit:s});return n?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>u(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await import("./setupServiceMocksMesh.js");return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await import("./setupServiceMocksMesh.js");return s(e,r,t,o)}}}}function b(e,r){const t=f(e);return t.spatialReference=r instanceof o?r:o.fromJSON(r),t}function O(e,r,t){return!e||G(r,t)?e:k(e,r,t)?.toJSON()}function k(e,r,s){if(e)return G(r,s)?b(e,r):t(b(e,r),o.fromJSON(s))}function v(e,r,t,o){return{aGeometry:b(e,r),bGeometry:k(t,o,r)}}export{g as getServiceMockDependencies};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../Color.js";import t from"../../geometry/Mesh.js";import o from"../../geometry/Point.js";import r from"../../geometry/support/MeshMaterialMetallicRoughness.js";import a from"../../geometry/support/MeshTransform.js";import{loadImage as n}from"../../request/loadImage.js";import{meshMakeAbsolute as i}from"./meshUtils.js";import{isEncodedMeshTexture as s}from"../../views/3d/glTF/internal/resourceUtils.js";async function l(e,r,n,i){const s=URL.createObjectURL(new Blob([e]));try{const e=o.fromJSON(r),n=await t.createFromGLTF(e,s,{vertexSpace:e.spatialReference.isGeographic?"local":"georeferenced"}),{rotationAxis:l,rotationAngle:c,translation:u,scale:m}=i;return n.transform=new a({rotationAngle:c??0,rotationAxis:null!=l?[l[0],l[1],l[2]]:[0,0,1],translation:null!=u?[u[0],u[1],u[2]]:[0,0,0],scale:null!=m?[m[0],m[1],m[2]]:[1,1,1]}),n}finally{URL.revokeObjectURL(s)}}async function c(e,t,o,r){const a=await l(e,t,o,r),n=a.extent.toJSON();return a.destroy(),n}async function u(t,o,a,n){const s=await l(t,o,a,n),{components:c}=s;if(null==c)throw new Error("Mesh has no components");const{transform:u}=s;if(null==u)throw new Error("Mesh has no transform");const d=i(s);if(!d)throw new Error("failed to project");const w=c.map(async t=>{const{faces:o,material:a}=t,n=a instanceof r,i={pbrMetallicRoughness:{baseColorFactor:null!=a?.color?e.toUnitRGBA(a.color):[1,1,1,1],baseColorTexture:await m(a?.colorTexture),metallicFactor:n?a.metallic:void 0,roughnessFactor:n?a.roughness:void 0,metallicRoughnessTexture:n&&null!=a.metallicRoughnessTexture?await m(a.metallicRoughnessTexture):void 0},normalTexture:null!=a?.normalTexture?await m(a.normalTexture):void 0,occlusionTexture:n&&null!=a.occlusionTexture?await m(a.occlusionTexture):void 0,emissiveTexture:n&&null!=a.emissiveTexture?await m(a.emissiveTexture):void 0,emissiveFactor:n&&null!=a.emissiveColor?e.toUnitRGB(a.emissiveColor):void 0,alphaMode:("auto"===a?.alphaMode?"blend":a?.alphaMode)??"opaque",alphaCutoff:a?.alphaCutoff??.1,doubleSided:a?.doubleSided??!0,cullFace:a?.doubleSided??1?"none":"back"};return{geometry:{position:d.vertexAttributes.position,faces:o,normal:"source"===t.shading?d.vertexAttributes.normal:void 0,uv:d.vertexAttributes.uv,color:d.vertexAttributes.color},material:i}});return Promise.all(w)}async function m(e){if(null==e)return;const{url:t,data:o}=e,r="image/png",a="string"==typeof e.wrap?"clamp"===e.wrap?"none":e.wrap:"repeat";if(null!=o){if(s(o))throw new Error("Cannot bake encoded textures");if(o instanceof HTMLVideoElement)throw new Error("Cannot bake video textures");if(o instanceof HTMLImageElement){const e=await d(await w(o),r),t=await e.arrayBuffer();return{type:r,width:o.width,wrap:a,data:t}}if(o instanceof HTMLCanvasElement){const e=await d(o,r),t=await e.arrayBuffer();return{type:r,width:o.width,wrap:a,data:t}}const e=await d(f(o),r),t=await e.arrayBuffer();return{type:r,width:o.width,wrap:a,data:t}}if(null!=t){const e=await h(t),o=await d(await w(e),r),n=await o.arrayBuffer();return{type:r,width:e.width,wrap:a,data:n}}}async function d(e,t){return new Promise((o,r)=>e.toBlob(e=>null==e?r(new Error("Failed to load image content")):o(e),t))}async function w(e){await e.decode();const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const o=t.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.drawImage(e,0,0),t}function f(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const o=t.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.putImageData(e,0,0),t}function h(e){const t=new Image;return t.src=e,n(t,t.src,!1,void 0)}export{c as extentFromGLB,u as nodeDataFromGLB};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import o from"../../../../core/Accessor.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{watch as r,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{throttle as l}from"../../../../core/throttle.js";import{property as a,subclass as p}from"../../../../core/accessorSupport/decorators.js";import n from"../../../../symbols/CIMSymbol.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{createLineGeometry as y}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let d=class extends o{constructor(t){super(t),this.index=0,this._graphic=new e,this._updateGeometryThrottled=l(t=>{t&&(this._graphic.geometry=y(t.samples,t.spatialReference))},c().profileLinesUpdateThrottleMillis)}initialize(){this._graphic.attributes={index:this.index},this.addGraphic(this._graphic),this.addHandles([r(()=>this._effectiveVisible,t=>{this._graphic.visible=t},s),r(()=>this._colorUpdateParameters,t=>this._updateColor(t),s),r(()=>this.analysisViewData.analysis.geometry,()=>{this._graphic.geometry=null},s),r(()=>this._geometryUpdateParameters,t=>this._updateGeometryThrottled(t),s),this._updateGeometryThrottled])}destroy(){this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.getResult()}get _effectiveVisible(){const{analysisViewData:t,_result:e}=this;return t.visible&&!!e?.available&&e.computation.profile.viewOptions.lineVisible}get _geometryUpdateParameters(){const t={samples:this._result?.samples,spatialReference:this.view.spatialReference};return t.samples&&this._effectiveVisible&&1!==this.analysisViewData.progress?null:t}get _colorUpdateParameters(){const t=this._result?.computation.profile.color;return t?{color:t.toArray(),contrastColor:i(t).toArray()}:null}_updateColor(t){t&&(this._graphic.symbol=new n({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",capStyle:"Butt",color:t.color,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],joinStyle:"Round",width:1.5},{type:"CIMSolidStroke",capStyle:"Butt",color:t.contrastColor,joinStyle:"Round",width:1.5}]}}}))}};t([a({constructOnly:!0})],d.prototype,"addGraphic",void 0),t([a({constructOnly:!0})],d.prototype,"analysisViewData",void 0),t([a({constructOnly:!0})],d.prototype,"getResult",void 0),t([a({constructOnly:!0})],d.prototype,"index",void 0),t([a({constructOnly:!0})],d.prototype,"view",void 0),t([a()],d.prototype,"updating",null),t([a()],d.prototype,"_result",null),t([a()],d.prototype,"_effectiveVisible",null),t([a()],d.prototype,"_geometryUpdateParameters",null),t([a()],d.prototype,"_colorUpdateParameters",null),d=t([p("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],d);export{d as ElevationProfileLineVisualization2D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{
|
|
5
|
+
import{__decorate as e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{F as o}from"../../../chunks/vec32.js";import{getEndpoint as s}from"../../../geometry/support/curves/curveUtils.js";import{SegmentLabels as n}from"../../interactive/SegmentLabels.js";let i=class extends n{getCameraOrExtent({view:e}){return e.extent}toScreenPointArray({view:e,editGeometryOperations:r},o,s=t()){const{coordinateHelper:n}=r.data,i=e.toScreen(n.arrayToPoint(o));return i&&(s[0]=i.x,s[1]=i.y),s}getRing(e,t,r,n,i){const a=[];for(const o of t.parts[i].iterateVertices())o.leftSegment?a.push(o.leftSegment.toCurveOrCoordinate()):a.push(o.pos);if(0===i&&null!=r&&a.push(n.vectorToArray(r)),a.length<2)return a;const c=a[0],p=a.at(-1),m=n.toXYZ(n.arrayToVector(s(c))),l=n.toXYZ(n.arrayToVector(s(p)));return"polygon"===e.type&&a.length>2&&!o(m,l)&&a.push(c),a}};i=e([r("esri.views.2d.interactive.SegmentLabels2D")],i);export{i as SegmentLabels2D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{
|
|
5
|
+
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);await this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{watch as a,initial as m}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as l,convertFromSpatialReferenceUnit as c}from"../../core/units.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{e as
|
|
5
|
+
import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{watch as a,initial as m}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as l,convertFromSpatialReferenceUnit as c}from"../../core/units.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{e as d}from"../../chunks/earcut.js";import{create as h}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../geometry/ellipsoidUtils.js";import y from"../../geometry/Point.js";import{project as w}from"../../geometry/projectionUtils.js";import{execute as v}from"../../geometry/operators/gx/operatorDensify.js";import{execute as j}from"../../geometry/operators/gx/operatorSimplify.js";import{fromSpatialReference as _,fromPolygon as A,toPolygon as x}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as R}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as b}from"../../geometry/support/DoubleArray.js";import{earth as N}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as M}from"../../geometry/support/Indices.js";import{t as C}from"../../chunks/vec3.js";import{ElevationContext as k}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as U}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as V}from"./layers/graphics/graphicUtils.js";import{polygonToRenderInfo as H}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as E}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaMaskNode as F}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as G}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const I=2e4;let P=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new k,this._outlineMap=new t}initialize(){this.addHandles([a(()=>({polygons:this.polygons,ready:this.view.groundView?.ready}),({polygons:e,ready:o})=>{o&&this._updateVolumes(e)},m)]),this._outlineMap=n(()=>this.areas?.areas,e=>new G({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,o)=>e.concat(o.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new y(e);return this.polygons.some(e=>e.contains(o))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=this.view.renderCoordsHelper,t=f(),n=1===o.viewingMode,a=h(),m=h(),p=this.view.spatialReference,u=_(p),y=g(p).radius/N.radius,k=l(5e5*y,"meters",p,!0);n||o.worldUpAtPosition([0,0,0],t);const E=new Map;for(const r of e){const e=this._volumes.get(r);if(e)E.set(r,e);else try{const e=p.equals(r.spatialReference)?r:w(r,p),s=Math.max(e.extent.width,e.extent.height),i=c(s,p,"meters",!0),l=Math.max(5*i,I*y),h=n?y/10:y,f=this._reduceGeometryHeight(e,l,h),g=V(f);if(null==g)continue;const _=A(f),N=j(_,u,!1)??_,F=v(N,k,0,0),G=x(F,p);if(null==G)continue;R(p,[g.x,g.y,0],a,o.spatialReference),m[12]=-a[12],m[13]=-a[13],m[14]=-a[14];const P=H(G,this.view.elevationProvider,o,this._elevationContext),{polygons:D,mapPositions:L,position:S}=P,q=new Array,T=new O(q,[a[12],a[13],a[14]]);for(const o of D){const e=o.count,r=d(o.mapPositions,o.holeIndices,3);if(0===r.length)continue;const s=r.length,i=6*e,a=i+s,c=b(3*i),p=M(a),u=M(s);U(S,L,r,o,c,null,null,null,p,u,l,t,n),C(c,c,m);const h=new z(c,u,p,l);q.push(h)}E.set(r,T)}catch(F){i.getLogger(this).error(new s("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:r,error:F}))}}this._volumes=E,0!==this.volumes.size&&this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){if(this.view.stage)if(0===this.volumes.size){const{_maskRenderNode:e,_colorRenderNode:o}=this;this._maskRenderNode=this._colorRenderNode=null,o?.fadeOut(()=>{e?.destroy(),o?.destroy()})}else this._maskRenderNode??=new F({focusAreasView:this}),this._colorRenderNode??=new E({focusAreasView:this}),this.view.stage.renderView.requestRender()}_reduceGeometryHeight(e,o,r){const t=-12e5*r,s=Math.max(-o/2,t),i=e.rings.map(e=>e.map(e=>[e[0],e[1],s])),n=e.clone();return n.rings=i,n.hasZ=!0,n}get volumes(){return this._volumes}};e([p()],P.prototype,"_volumes",void 0),e([p({constructOnly:!0})],P.prototype,"view",void 0),P=e([u("esri.views.3d.FocusAreasView")],P);class O{constructor(e,o){this.geometryVolumes=e,this.origin=o}}class z{constructor(e,o,r,t){this.positions=e,this.indicesBottom=o,this.indicesExtruded=r,this.height=t}}export{P as FocusAreasView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createLength as t,toUnit as s,createArea as i}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as o,areaUnitFromSpatialReference as n}from"../../../../../core/units.js";import{set as r,distance as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as l,d,f as g,q as c,e as p,g as m,j as u,i as _,n as f}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as M}from"../../../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as C}from"../../../../../geometry/projectionUtils.js";import{getSphericalPCPF as P}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as R}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as j}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as U}from"../../../../../geometry/projection/projectVectorToVector.js";import{compactIndices as A}from"../../../../../geometry/support/Indices.js";import{segmentIntersects as v}from"../../../../../geometry/support/intersectsBase.js";import{Sphere as I}from"../../../../../geometry/support/sphere.js";import{areaPoints2d as V}from"../../../../../geometry/support/triangle.js";import{bestFitPlane as w,fitHemisphere as W,triangleAreaGeodesic as F,planePointDistance as y,boundingSphere as G}from"../../support/measurementUtils.js";import{getElevationAtPoint as T}from"../../../support/ElevationProvider.js";import{midpoint3d as x,makeOrthonormal as q,tangentFrame as z}from"../../../support/mathUtils.js";import{triangulate as b}from"../../../../support/euclideanAreaMeasurementUtils.js";import{euclideanDistanceBetweenPoints as E}from"../../../../support/euclideanLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as D}from"../../../../support/geodesicMeasurementUtils.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";class H{get numVertices(){return this._length}get hasStagedVertex(){return null!=this._lastCursorPoint}constructor(e,t,s){this._sceneView=e,this._geodesicAreaMeasurementUtils=t,this._geodesicLengthMeasurementUtils=s,this.validMeasurement=!1,this.positionsWorld=[],this.positionsRender=[],this.positionsFittedWorld=[],this.positionsFittedRender=[],this.positionsGeodesic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=S(),this.areaCentroidRenderCoords=S(),this.geodesicAreaCentroidRenderCoords=S(),this.fittingMode=null,this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=S(),this._planeWorldCoords=L(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._lastPathVersion=-1,this._lastCursorPoint=null,this._mode=null,this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new I;const i=B(e.spatialReference);this._measurementSR=i,this._lengthMeasurementUnit=o(i)??"meters",this._areaMeasurementUnit=n(i)??"square-meters"}update(e,t,s,i,o,n){const r=this._lastPathVersion===e.version,h=t?t.equals(this._lastCursorPoint):null==this._lastCursorPoint,a=this._mode===o;return!(r&&!n&&a&&h)&&(this._lastPathVersion=e.version,this._lastCursorPoint=t,this._updateCursorSegmentLength(e,t),this._update(e,t,s,i,o),!0)}_update(e,s,i,o,n){const r=this._sceneView.renderSpatialReference,h=this._measurementSR,a=i.spatialReference;let l=e.numVertices;const d=!(null==s||s.equals(e.lastPoint)||l>2&&s.equals(e.firstPoint)||e.polygonIsClosed);d&&(l+=1);const g=!e.polygonIsClosed&&l>2,c=e.polygonIsClosed||g;this._resize(l);const p=P(a),m=null!=a&&D(a)?a:null,u=null!=m&&C(a,p),{positionsGeodesic:_,positionsWorld:S,positionsRender:L,positionsSpherical:M}=this,R=(e,t)=>{k(i.elevationProvider,e),j(e,S[t],h),j(e,L[t],r),u&&(j(e,_[t],m),j(e,M[t],p),f(M[t],M[t]))};e.forEachVertexPosition((e,t)=>R(e,t)),d&&R(s,l-1);const U=this._updatePathLengths(c);if(this.pathLength=this._length>1?t(U,this._lengthMeasurementUnit):null,u){const e=this._updateGeodesicPathLengths(c,m);this.geodesicPathLength=null!=e&&this._length>1?e:null}else this.geodesicPathLength=null;if(this._updateMode(n),!c)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,r,h,o),u&&this._updateGeodesicArea(i,m),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsRender:this.positionsRender,positionsFittedWorld:this.positionsFittedWorld,positionsFittedRender:this.positionsFittedRender,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e<this._length&&(this.positionsWorld.length=e,this.positionsRender.length=e,this.positionsFittedWorld.length=e,this.positionsFittedRender.length=e,this.positionsGeodesic.length=e,this.positionsSpherical.length=e,this.positionsStereographic.length=e,this.pathSegmentLengths.length=e,this.geodesicPathSegmentLengths.length=e,this.perimeterSegmentLengths.length=e,this._length=e);this._length<e;)this.positionsWorld.push(S()),this.positionsRender.push(S()),this.positionsFittedWorld.push(a()),this.positionsFittedRender.push(S()),this.positionsGeodesic.push(S()),this.positionsSpherical.push(S()),this.positionsStereographic.push(a()),this.pathSegmentLengths.push(0),this.geodesicPathSegmentLengths.push(0),this.perimeterSegmentLengths.push(0),++this._length}_updatePathLengths(e){const t=this.positionsWorld,s=this.pathSegmentLengths;let i=0;const o=this._length;for(let n=0;n<o;++n){const r=s[n]=l(t[n],t[(n+1)%o]);(n<o-1||e)&&(i+=r)}return i}_updateGeodesicPathLengths(e,i){const o=this.positionsGeodesic,n=this.geodesicPathSegmentLengths;let r=0;const h=this._length;for(let t=0;t<h;++t){const a=this._geodesicLengthMeasurementUtils.geodesicDistance(o[t],o[(t+1)%h],i);if(null==a)return null;const l=s(a,"meters").value,d=n[t]=l;(t<h-1||e)&&(r+=d)}return t(r,"meters")}_updateAreaAndPerimeterLength(e,t,s,i){const o=e.renderCoordsHelper,n=this.positionsWorld,h=this.positionsRender,a=this.positionsFittedWorld,l=this.positionsFittedRender,f=this._planeWorldCoords,S=this._centroidRenderCoords;x(h,S),o.worldUpAtPosition(S,this._worldUp),o.worldBasisAtPosition(S,0,this._worldTangent),R(S,this._worldUp,t,this._worldUp,s),R(S,this._worldTangent,t,this._worldTangent,s),n.length>2&&w(n,f),this.fittingMode=this._selectFittingMode(f,n,this._worldUp,i);let L=0;if("horizontal"===this.fittingMode){let e=-1/0;h.forEach((t,s)=>{const i=o.getAltitude(h[s]);i>e&&(e=i,L=s)})}const M=n[L];let C=f,P=this._worldTangent;"horizontal"===this.fittingMode?C=this._worldUp:"vertical"===this.fittingMode&&(C=this._tempVec3,P=this._worldUp,q(f,this._worldUp,C)),d(this._frame[2],C),q(P,C,this._frame[0]),g(this._frame[1],this._frame[0],this._frame[2]),c(this._frame[1],this._frame[1]);const j=this._tempVec3,A=this._tempU,v=this._tempV;for(let d=0;d<this._length;++d){const e=a[d],i=l[d];p(j,n[d],M),r(e,m(this._frame[0],j),m(this._frame[1],j)),u(A,this._frame[0],e[0]),u(v,this._frame[1],e[1]),_(j,A,v),_(j,j,M),U(j,s,i,t)}this.perimeterLength=this._length>0?this._updatePerimeterLengths():null,x(l,this.areaCentroidRenderCoords),U(this.areaCentroidRenderCoords,t,this.areaCentroidWorldCoords,s),this._updateIntersectingSegments(),this.area=0===this.intersectingSegments.size?this._computeArea():null}_updateGeodesicArea(e,t){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:o,positionsStereographic:n}=this,h=this._tempVec3,a=W(o,h);if(!a)return void(this.geodesicArea=null);const l=this._tempU,d=this._tempV;z(h,l,d);for(let g=0;g<this._length;++g){const e=m(o[g],l),t=m(o[g],d),s=m(o[g],h);r(n[g],e/s,t/s)}u(h,h,M(i).radius),s.toRenderCoords(h,P(i),this.geodesicAreaCentroidRenderCoords),this._updateGeodesicIntersectingSegments(),this.geodesicArea=a&&0===this.geodesicIntersectingSegments.size?this._computeGeodesicArea(t):null}_updatePerimeterLengths(){const e=this.positionsFittedWorld,s=this.perimeterSegmentLengths;let i=0;for(let t=0;t<this._length;++t){i+=s[t]=h(e[t],e[(t+1)%this._length])}return t(i,this._lengthMeasurementUnit)}_updateIntersectingSegments(){const e=this.positionsFittedWorld,t=this.intersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeArea(){const e=this.positionsFittedWorld,t=this.triangleIndices=A(b(e));let s=0;for(let i=0;i<t.length;i+=3)s+=V(e[t[i]],e[t[i+1]],e[t[i+2]]);return i(s,this._areaMeasurementUnit)}_updateGeodesicIntersectingSegments(){const e=this.positionsStereographic,t=this.geodesicIntersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeGeodesicArea(e){const t=this.positionsGeodesic,o=this.positionsStereographic,n=this.geodesicTriangleIndices=A(b(o));let r=0;for(let i=0;i<n.length;i+=3){const o=F(t[n[i]],t[n[i+1]],t[n[i+2]],e,this._geodesicAreaMeasurementUtils);if(null==o)return null;r+=s(o,"square-meters").value}return i(r,"square-meters")}_selectFittingMode(t,s,i,o){const n=s.map(e=>Math.abs(y(t,e))).reduce((e,t)=>Math.max(e,t),0);G(s,this._tempSphere);const r=n/(2*this._tempSphere.radius),h=r<o.maxRelativeErrorCoplanar,a=r<o.maxRelativeErrorAlmostCoplanar;let l="horizontal";if(h)l="oblique";else if(a){l=Math.abs(m(i,t))>Math.cos(e(o.verticalAngleThreshold))?"horizontal":"vertical"}return l}_updateCursorSegmentLength(e,t){const s=e.lastPoint;e.isValidPolygon||null==s||null==t?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=this._geodesicLengthMeasurementUtils.geodesicDistanceBetweenPoints(s,t),this.stagedSegmentLength=E(s,t)?.direct)}_updateMode(e){if(0===e){this.actualMeasurementMode="euclidean";let e=0;null!=this.geodesicPathLength&&(e+=this.geodesicPathLength.value),e>Z&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=1===e?"euclidean":"geodesic";null==this.geodesicPathLength&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function k(e,t){t.hasZ||(t.z=T(e,t,"ground")??0)}const Z=1e5;export{H as MeasurementDataManager};
|
|
5
|
+
import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createLength as t,toUnit as s,createArea as i}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as o,areaUnitFromSpatialReference as n}from"../../../../../core/units.js";import{set as r,distance as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{C as l,d,f as g,q as c,e as p,g as m,j as u,i as _,n as f}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as M}from"../../../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as C}from"../../../../../geometry/projectionUtils.js";import{getSphericalPCPF as P}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as R}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as j}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as U}from"../../../../../geometry/projection/projectVectorToVector.js";import{compactIndices as A}from"../../../../../geometry/support/Indices.js";import{segmentIntersects as v}from"../../../../../geometry/support/intersectsBase.js";import{Sphere as I}from"../../../../../geometry/support/sphere.js";import{areaPoints2d as V}from"../../../../../geometry/support/triangle.js";import{bestFitPlane as w,fitHemisphere as W,triangleAreaGeodesic as F,planePointDistance as y,boundingSphere as G}from"../../support/measurementUtils.js";import{getElevationAtPoint as T}from"../../../support/ElevationProvider.js";import{midpoint3d as x,makeOrthonormal as q,tangentFrame as z}from"../../../support/mathUtils.js";import{triangulate as b}from"../../../../support/euclideanAreaMeasurementUtils.js";import{euclideanDistanceBetweenPoints as E}from"../../../../support/euclideanLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as D}from"../../../../support/geodesicMeasurementUtils.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";class H{get numVertices(){return this._length}get hasStagedVertex(){return null!=this._lastCursorPoint}constructor(e,t,s){this._sceneView=e,this._geodesicAreaMeasurementUtils=t,this._geodesicLengthMeasurementUtils=s,this.validMeasurement=!1,this.positionsWorld=[],this.positionsRender=[],this.positionsFittedWorld=[],this.positionsFittedRender=[],this.positionsGeodesic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=S(),this.areaCentroidRenderCoords=S(),this.geodesicAreaCentroidRenderCoords=S(),this.fittingMode=null,this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=S(),this._planeWorldCoords=L(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._lastPathVersion=-1,this._lastCursorPoint=null,this._mode=null,this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new I;const i=B(e.spatialReference);this._measurementSR=i,this._lengthMeasurementUnit=o(i)??"meters",this._areaMeasurementUnit=n(i)??"square-meters"}update(e,t,s,i,o,n){const r=this._lastPathVersion===e.version,h=t?t.equals(this._lastCursorPoint):null==this._lastCursorPoint,a=this._mode===o;return!(r&&!n&&a&&h)&&(this._lastPathVersion=e.version,this._lastCursorPoint=t,this._updateCursorSegmentLength(e,t),this._update(e,t,s,i,o),!0)}_update(e,s,i,o,n){const r=this._sceneView.renderSpatialReference,h=this._measurementSR,a=i.spatialReference;let l=e.numVertices;const d=!(null==s||s.equals(e.lastPoint)||l>2&&s.equals(e.firstPoint)||e.polygonIsClosed);d&&(l+=1);const g=!e.polygonIsClosed&&l>2,c=e.polygonIsClosed||g;this._resize(l);const p=P(a),m=null!=a&&D(a)?a:null,u=null!=m&&C(a,p),{positionsGeodesic:_,positionsWorld:S,positionsRender:L,positionsSpherical:M}=this,R=(e,t)=>{k(i.elevationProvider,e),j(e,S[t],h),j(e,L[t],r),u&&(j(e,_[t],m),j(e,M[t],p),f(M[t],M[t]))};e.forEachVertexPosition((e,t)=>R(e,t)),d&&R(s,l-1);const U=this._updatePathLengths(c);if(this.pathLength=this._length>1?t(U,this._lengthMeasurementUnit):null,u){const e=this._updateGeodesicPathLengths(c,m);this.geodesicPathLength=null!=e&&this._length>1?e:null}else this.geodesicPathLength=null;if(this._updateMode(n),!c)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,r,h,o),u&&this._updateGeodesicArea(i,m),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsRender:this.positionsRender,positionsFittedWorld:this.positionsFittedWorld,positionsFittedRender:this.positionsFittedRender,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e<this._length&&(this.positionsWorld.length=e,this.positionsRender.length=e,this.positionsFittedWorld.length=e,this.positionsFittedRender.length=e,this.positionsGeodesic.length=e,this.positionsSpherical.length=e,this.positionsStereographic.length=e,this.pathSegmentLengths.length=e,this.geodesicPathSegmentLengths.length=e,this.perimeterSegmentLengths.length=e,this._length=e);this._length<e;)this.positionsWorld.push(S()),this.positionsRender.push(S()),this.positionsFittedWorld.push(a()),this.positionsFittedRender.push(S()),this.positionsGeodesic.push(S()),this.positionsSpherical.push(S()),this.positionsStereographic.push(a()),this.pathSegmentLengths.push(0),this.geodesicPathSegmentLengths.push(0),this.perimeterSegmentLengths.push(0),++this._length}_updatePathLengths(e){const t=this.positionsWorld,s=this.pathSegmentLengths;let i=0;const o=this._length;for(let n=0;n<o;++n){const r=s[n]=l(t[n],t[(n+1)%o]);(n<o-1||e)&&(i+=r)}return i}_updateGeodesicPathLengths(e,i){const o=this.positionsGeodesic,n=this.geodesicPathSegmentLengths;let r=0;const h=this._length;for(let t=0;t<h;++t){const a=this._geodesicLengthMeasurementUtils.geodesicDistance(o[t],o[(t+1)%h],i);if(null==a)return null;const l=s(a,"meters").value,d=n[t]=l;(t<h-1||e)&&(r+=d)}return t(r,"meters")}_updateAreaAndPerimeterLength(e,t,s,i){const o=e.renderCoordsHelper,n=this.positionsWorld,h=this.positionsRender,a=this.positionsFittedWorld,l=this.positionsFittedRender,f=this._planeWorldCoords,S=this._centroidRenderCoords;x(h,S),o.worldUpAtPosition(S,this._worldUp),o.worldBasisAtPosition(S,0,this._worldTangent),R(S,this._worldUp,t,this._worldUp,s),R(S,this._worldTangent,t,this._worldTangent,s),n.length>2&&w(n,f),this.fittingMode=this._selectFittingMode(f,n,this._worldUp,i);let L=0;if("horizontal"===this.fittingMode){let e=-1/0;h.forEach((t,s)=>{const i=o.getAltitude(h[s]);i>e&&(e=i,L=s)})}const M=n[L];let C=f,P=this._worldTangent;"horizontal"===this.fittingMode?C=this._worldUp:"vertical"===this.fittingMode&&(C=this._tempVec3,P=this._worldUp,q(f,this._worldUp,C)),d(this._frame[2],C),q(P,C,this._frame[0]),g(this._frame[1],this._frame[0],this._frame[2]),c(this._frame[1],this._frame[1]);const j=this._tempVec3,A=this._tempU,v=this._tempV;for(let d=0;d<this._length;++d){const e=a[d],i=l[d];p(j,n[d],M),r(e,m(this._frame[0],j),m(this._frame[1],j)),u(A,this._frame[0],e[0]),u(v,this._frame[1],e[1]),_(j,A,v),_(j,j,M),U(j,s,i,t)}this.perimeterLength=this._length>0?this._updatePerimeterLengths():null,x(l,this.areaCentroidRenderCoords),U(this.areaCentroidRenderCoords,t,this.areaCentroidWorldCoords,s),this._updateIntersectingSegments(),this.area=0===this.intersectingSegments.size?this._computeArea():null}_updateGeodesicArea(e,t){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:o,positionsStereographic:n}=this,h=this._tempVec3,a=W(o,h);if(!a)return void(this.geodesicArea=null);const l=this._tempU,d=this._tempV;z(h,l,d);for(let g=0;g<this._length;++g){const e=m(o[g],l),t=m(o[g],d),s=m(o[g],h);r(n[g],e/s,t/s)}u(h,h,M(i).radius),s.toRenderCoords(h,P(i),this.geodesicAreaCentroidRenderCoords),this._updateGeodesicIntersectingSegments(),this.geodesicArea=a&&0===this.geodesicIntersectingSegments.size?this._computeGeodesicArea(t):null}_updatePerimeterLengths(){const e=this.positionsFittedWorld,s=this.perimeterSegmentLengths;let i=0;for(let t=0;t<this._length;++t){i+=s[t]=h(e[t],e[(t+1)%this._length])}return t(i,this._lengthMeasurementUnit)}_updateIntersectingSegments(){const e=this.positionsFittedWorld,t=this.intersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeArea(){const e=this.positionsFittedWorld,t=this.triangleIndices=A(b(e));let s=0;for(let i=0;i<t.length;i+=3)s+=V(e[t[i]],e[t[i+1]],e[t[i+2]]);return i(s,this._areaMeasurementUnit)}_updateGeodesicIntersectingSegments(){const e=this.positionsStereographic,t=this.geodesicIntersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];v(o,n,r,h)&&(t.add(s),t.add(i))}}_computeGeodesicArea(e){const t=this.positionsGeodesic,o=this.positionsStereographic,n=this.geodesicTriangleIndices=A(b(o));let r=0;for(let i=0;i<n.length;i+=3){const o=F(t[n[i]],t[n[i+1]],t[n[i+2]],e,this._geodesicAreaMeasurementUtils);if(null==o)return null;r+=s(o,"square-meters").value}return i(r,"square-meters")}_selectFittingMode(t,s,i,o){const n=s.map(e=>Math.abs(y(t,e))).reduce((e,t)=>Math.max(e,t),0);G(s,this._tempSphere);const r=n/(2*this._tempSphere.radius),h=r<o.maxRelativeErrorCoplanar,a=r<o.maxRelativeErrorAlmostCoplanar;let l="horizontal";if(h)l="oblique";else if(a){l=Math.abs(m(i,t))>Math.cos(e(o.verticalAngleThreshold))?"horizontal":"vertical"}return l}_updateCursorSegmentLength(e,t){const s=e.lastPoint;e.isValidPolygon||null==s||null==t?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=this._geodesicLengthMeasurementUtils.geodesicDistanceBetweenPoints(s,t),this.stagedSegmentLength=E(s,t)?.direct)}_updateMode(e){if(0===e){this.actualMeasurementMode="euclidean";let e=0;null!=this.geodesicPathLength&&(e+=this.geodesicPathLength.value),e>Z&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=1===e?"euclidean":"geodesic";null==this.geodesicPathLength&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function k(e,t){t.hasZ||(t.z=T(e,t,"ground")??0)}const Z=1e5;export{H as MeasurementDataManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{when as n,watch as r,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as a,subclass as c}from"../../../../core/accessorSupport/decorators.js";import m from"../../../../geometry/Point.js";import{sv3d as p}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as h}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as u}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";let g=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._placementMode=D,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o(()=>this._clearPointerMoveTimeout()),n(()=>"created"===this.state,()=>this.finishToolCreation(),l),n(()=>this.firstGrabbedManipulator,e=>{this.selectedDimension=e.metadata},l),r(()=>this.selectedDimension,()=>this._resetPointerMoveTimeout(),l)])}get state(){return this.analysis.dimensions.some(e=>"length"===e.type)?null!=this._activeSubTool?"creating":"created":"ready"}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}place(e){this.selectedDimension=null,this._placementMode=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":this._keyDownHandler(e)}}onActivate(){this._placementMode=D,this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool?.onDeactivate(),this._activeSubTool=null}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),this.selectedDimension&&"single"===this._placementMode&&(this.view.activeTool=null),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_keyDownHandler(e){_.cancel===e.key?(this._activeSubTool?.removeStaged()&&"multiple"===this._placementMode&&e.stopPropagation(),this.active||(this.selectedDimension=null)):_.delete.includes(e.key)&&(this._activeSubTool?.removeStaged(),this._removeSelected())}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=p.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new m({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach(e=>e.manipulator.state|=h),this._prevPointerMoveTimeout=t.setTimeout(()=>{this.manipulators.forEach(e=>e.manipulator.state&=~h)},this._pointerMoveTimerMs)}get test(){}};e([a({constructOnly:!0})],g.prototype,"view",void 0),e([a({constructOnly:!0})],g.prototype,"analysis",void 0),e([a({readOnly:!0})],g.prototype,"state",null),e([a({readOnly:!0})],g.prototype,"updating",null),e([a({readOnly:!0})],g.prototype,"cursor",null),e([a({constructOnly:!0})],g.prototype,"analysisViewData",void 0),e([a()],g.prototype,"selectedDimension",null),e([a()],g.prototype,"automaticManipulatorSelection",void 0),e([a()],g.prototype,"_activeSubTool",void 0),e([a()],g.prototype,"_lengthDimensionSubTool",void 0),e([a()],g.prototype,"_placementMode",void 0),g=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],g);const D="multiple";export{g as DimensionTool};
|
|
5
|
+
import{__decorate as e}from"tslib";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{when as n,watch as r,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as a,subclass as c}from"../../../../core/accessorSupport/decorators.js";import m from"../../../../geometry/Point.js";import{sv3d as p}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as h}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as u}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";let g=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._placementMode=D,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o(()=>this._clearPointerMoveTimeout()),n(()=>"created"===this.state,()=>this.finishToolCreation(),l),n(()=>this.firstGrabbedManipulator,e=>{this.selectedDimension=e.metadata},l),r(()=>this.selectedDimension,()=>this._resetPointerMoveTimeout(),l)])}get state(){return this.analysis.dimensions.some(e=>"length"===e.type)?null!=this._activeSubTool?"creating":"created":"ready"}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}place(e){this.selectedDimension=null,this._placementMode=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":this._keyDownHandler(e)}}onActivate(){this._placementMode=D,this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool?.onDeactivate(),this._activeSubTool=null}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),this.selectedDimension&&"single"===this._placementMode&&(this.view.activeTool=null),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_keyDownHandler(e){_.cancel===e.key?(this._activeSubTool?.removeStaged()&&"multiple"===this._placementMode&&e.stopPropagation(),this.active||(this.selectedDimension=null)):_.delete.includes(e.key)&&(this._activeSubTool?.removeStaged(),this._removeSelected())}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=p.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new m({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach(e=>e.manipulator.state|=h),this._prevPointerMoveTimeout=t.setTimeout(()=>{this.manipulators.forEach(e=>e.manipulator.state&=~h)},this._pointerMoveTimerMs)}get test(){}};e([a({constructOnly:!0})],g.prototype,"view",void 0),e([a({constructOnly:!0})],g.prototype,"analysis",void 0),e([a({readOnly:!0})],g.prototype,"state",null),e([a({readOnly:!0})],g.prototype,"updating",null),e([a({readOnly:!0})],g.prototype,"cursor",null),e([a({constructOnly:!0})],g.prototype,"analysisViewData",void 0),e([a()],g.prototype,"selectedDimension",null),e([a()],g.prototype,"automaticManipulatorSelection",void 0),e([a()],g.prototype,"multiTouchEnabled",void 0),e([a()],g.prototype,"_activeSubTool",void 0),e([a()],g.prototype,"_lengthDimensionSubTool",void 0),e([a()],g.prototype,"_placementMode",void 0),g=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],g);const D="multiple";export{g as DimensionTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{m as e,j as n,g as t,e as i,
|
|
5
|
+
import"../../../../core/has.js";import{m as e,j as n,g as t,e as i,E as o}from"../../../../chunks/vec32.js";import r from"../../../../geometry/Point.js";import{sv3d as a}from"../../../../geometry/support/vectorStacks.js";import{automaticHeadingFromCamera as s}from"./lengthDimensionManipulatorUtils.js";import{isGeodesicDimension as l,directUp as d,directStartToEnd as c}from"./lengthDimensionUtils.js";import{constraintThresholdPx as u}from"./settings.js";function m(e,n){return{enabled:n.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function P(r,s){if(l(r))return 2;if(!r.enabled)return null;const{geometry:m}=r;if(null==m||e(m.directSegment.startRenderSpace,m.directSegment.endRenderSpace))return null;const{camera:P}=s.state,p=d(a.get(),m,s.renderCoordsHelper),f=c(a.get(),m),g=n(a.get(),p,t(f,p)),S=i(a.get(),f,g),v=o(S),y=o(g),{startRenderSpace:A,endRenderSpace:R}=m.directSegment,j=Math.max(P.computeScreenPixelSizeAt(A)*u,P.computeScreenPixelSizeAt(R)*u)**2;return v<j?1:y<j?0:null}function p(e,n,{constraint:t,view:i}){const{unconstrainedGeometry:o}=e;if(null==o)return;const{renderCoordsHelper:a,spatialReference:s}=i,{startRenderSpace:l,endRenderSpace:d}=o.directSegment,c=a.fromRenderCoords(l,new r({spatialReference:s})),u=a.fromRenderCoords(d,new r({spatialReference:s}));let m;m="start"===n?{startPoint:c}:{endPoint:u},f(e,m,{constraint:t,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,unconstrainedGeometry:o,view:i})}function f(e,n,t){const{constraint:i,elevationAlignedStartPoint:o,elevationAlignedEndPoint:r,unconstrainedGeometry:a,view:l}=t,{dimension:d,previousConstraint:c,preConstraintProperties:u}=e;if(null==o||null==r)return;const m=()=>{"startPoint"in n?d.startPoint=n.startPoint:"endPoint"in n&&(d.endPoint=n.endPoint)};if(null==i)m(),null!=c&&null!=u&&(d.measureType=u.measureType,d.orientation=u.orientation);else switch(d.measureType="direct",i){case 0:if(i!==c&&(d.orientation=0),"startPoint"in n){const e=n.startPoint;null!=e&&(e.z=r.z),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.z=o.z),d.endPoint=e}break;case 1:if(i!==c&&(d.orientation=s(a,l)),"startPoint"in n){const e=n.startPoint;null!=e&&(e.x=r.x,e.y=r.y),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.x=o.x,e.y=o.y),d.endPoint=e}break;case 2:i!==c&&null!=u&&(d.orientation=u.orientation),m()}e.previousConstraint=i,e.unconstrainedGeometry=a}export{f as applyConstraint,P as computeConstraint,m as constraintDependencies,p as reapplyConstraint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as e}from"../../../../core/mathUtils.js";import{toUnit as t}from"../../../../core/quantity.js";import{adaptiveVerticalLengthUnit as n,adaptiveLengthUnit as r}from"../../../../core/units.js";import{ensureType as i}from"../../../../core/accessorSupport/ensureType.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as s,
|
|
5
|
+
import{deg2rad as e}from"../../../../core/mathUtils.js";import{toUnit as t}from"../../../../core/quantity.js";import{adaptiveVerticalLengthUnit as n,adaptiveLengthUnit as r}from"../../../../core/units.js";import{ensureType as i}from"../../../../core/accessorSupport/ensureType.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as s,E as d,c,p as l,a as u,f as p,g as m,F as g,n as S,v as f}from"../../../../chunks/vec32.js";import{create as v,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import A from"../../../../geometry/Point.js";import{sv3d as P}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{clonePoint as h}from"../../../../layers/graphics/hydratedFeatures.js";import{EuclideanSegment as E}from"../../interactive/visualElements/support/Segment.js";import{euclideanDirectDistanceBetweenPoints as j,euclideanDirectDistance as w}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceThreshold as x}from"../../../support/geodesicMeasurementUtils.js";class z{constructor(e,t,n,r,i,o){this.elevationAlignedStartPoint=e,this.elevationAlignedEndPoint=t,this.directSegment=n,this.dimensionSegment=r,this.primaryOffsetAxis=i,this.spatialReference=o}}const T=i(A);function b(e,i,o,a){if(null==e)return null;let s;if("horizontal"===i)s=a.autoDistanceBetweenPoints2D(T(e.elevationAlignedStartPoint),T(e.elevationAlignedEndPoint));else{const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment;s=w(t,n,e.spatialReference)}if(null==s)return null;const d="vertical"===i?n(s.value,s.unit,o):r(s.value,s.unit,o);return t(s,d)}function C(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,dimension:{offset:r,measureType:i,orientation:o}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o}}function U({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,offset:n,measureType:r,orientation:i},o,a=null){if(null==e||null==t)return null;const d=O(a?.directSegment??new E,{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t},o),c=a?.primaryOffsetAxis??v();L(c,{measureType:r,elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,directSegment:d,orientation:i,renderCoordsHelper:o});const l=a?.dimensionSegment??new E;return J({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t})&&"vertical"===r?(s(l.startRenderSpace,d.startRenderSpace),s(l.endRenderSpace,d.endRenderSpace)):K(l,c,n,d,o),new z(e,t,d,l,c,o.spatialReference)}function k(e,t,n,r){return 0===t?(s(e.startRenderSpace,n.startRenderSpace),s(e.endRenderSpace,r.startRenderSpace)):(s(e.startRenderSpace,n.endRenderSpace),s(e.endRenderSpace,r.endRenderSpace)),e}function M(e,t,n,r){c(e.startRenderSpace,t.startRenderSpace,n,r),c(e.endRenderSpace,t.endRenderSpace,n,r)}function H(e,t,n,r){switch(t){case"direct":return O(e,n,r);case"horizontal":case"vertical":{const{elevationAlignedStartPoint:i,elevationAlignedEndPoint:o,dimension:a,geometry:s}=n;let d;if("direct"===a.measureType){d=B(s,r)===i.z>o.z,"horizontal"===t&&(d=!d)}else d=!D(s);const[c,l]=d?[i,o]:[o,i],u=h(l,F);return"horizontal"===t?u.z=c.z:(u.x=c.x,u.y=c.y),r.toRenderCoords(c,e.startRenderSpace),r.toRenderCoords(u,e.endRenderSpace),e}}}function O(e,t,n){return n.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),n.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function B(e,t){const n=e.directSegment.eval(.5,P.get()),r=t.worldUpAtPosition(n,P.get()),i=e.dimensionSegment.eval(.5,P.get()),o=u(P.get(),i,n);return!g(o,R)&&m(o,r)>0}function D(e){const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment,{startRenderSpace:r,endRenderSpace:i}=e.directSegment;return f(r,t)<f(i,n)}const F=y(0,0,0,null);function I(e,t,n,r){const{directSegment:i}=n,o=L(P.get(),{measureType:t,directSegment:i,renderCoordsHelper:r}),a=K(q,o,0,i,r).eval(.5,P.get()),s=u(P.get(),e,a);return m(s,o)*r.unitInMeters}const q=new E;function L(t,n){const{measureType:r,elevationAlignedStartPoint:i,elevationAlignedEndPoint:a,directSegment:{startRenderSpace:d,endRenderSpace:c},directSegment:f,renderCoordsHelper:v}=n,A=f.eval(.5,P.get()),y=v.worldUpAtPosition(A,P.get()),h=v.worldBasisAtPosition(A,1,P.get());switch(r){case"horizontal":s(t,y);break;case"vertical":m(d,y)<m(c,y)?u(t,c,d):u(t,d,c),p(t,t,y),p(t,t,y);break;case"direct":{const r=n.orientation??0;if(J({elevationAlignedStartPoint:i,elevationAlignedEndPoint:a}))o(G,-e(r),y),l(t,h,G);else{const n=u(P.get(),c,d),i=p(P.get(),n,y);p(i,i,n),o(G,e(r),n),l(t,i,G)}break}}return g(t,R)?s(t,h):S(t,t)}const G=a();function J({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}){return null!=e&&null!=t&&e.x===t.x&&e.y===t.y}function K(e,t,n,r,i){const{startRenderSpace:o,endRenderSpace:a}=r,s=n/i.unitInMeters,[d,l]=N(o,a,t,s);return c(e.startRenderSpace,r.startRenderSpace,t,d),c(e.endRenderSpace,r.endRenderSpace,t,l),e}function N(e,t,n,r=0){const i=m(t,n),o=m(e,n),a=Math.abs(i-o)+r;return i>o?[a,r]:[r,a]}function Q(e,t,n){const r=t.directSegment.eval(.5,P.get());return n.worldUpAtPosition(r,e)}function V(e,t){const{startRenderSpace:n,endRenderSpace:r}=t.directSegment;return u(e,r,n)}function W(e,t,n={invert:!1}){const{startRenderSpace:r,endRenderSpace:i}=t.dimensionSegment;return n.invert?u(e,r,i):u(e,i,r)}function X(e,t){const n=e.directSegment.eval(.5,P.get());return t.headingAtPosition(n,e.primaryOffsetAxis)}function Y(e,t){return d(W(Z,e))/t**2}const Z=v();function $(e){const{elevationAlignedStartPoint:n,elevationAlignedEndPoint:r}=e;if(null==n||null==r)return!1;const i=j(n,r);return null!=i&&t(i,"meters").value>x}function _(e){return null!=e.geometry}export{z as LengthDimensionGeometry,J as arePointsVerticallyAligned,C as computationToGeometryDependencies,U as computeGeometryFromDimension,b as computeLength,L as computeOffsetAxis,I as computeOffsetForPoint,H as computeSegmentForMeasureType,k as computeSpanningSegment,W as dimensionStartToEnd,V as directStartToEnd,Q as directUp,X as headingFromGeometry,$ as isGeodesicDimension,_ as isValidComputation,Y as maxScreenLengthSquaredFromGeometry,M as offsetSegment};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{absoluteHeightElevationInfo as m}from"../../../../support/elevationInfoUtils.js";import{OutlineVisualElement as u}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as f}from"../../../analysis/ElevationProfile/constants.js";import{createLineGeometry as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{absoluteHeightElevationInfo as m}from"../../../../support/elevationInfoUtils.js";import{OutlineVisualElement as u}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as f}from"../../../analysis/ElevationProfile/constants.js";import{createLineGeometry as v}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let c=class extends i{constructor(e){super(e),this._updateGeometryThrottled=r(e=>{e&&(this._visualElement.geometry=v(e.samples,e.spatialReference))},f().profileLinesUpdateThrottleMillis)}initialize(){this._visualElement=new u({view:this.view,elevationInfo:m,innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0}),this.addHandles([s(()=>this._effectiveVisible,e=>{this._visualElement.visible=e},o),s(()=>this._result?.computation.profile.color,e=>{e&&(this._visualElement.color=p(t.toUnitRGBA(e)))},o),s(()=>this.analysisViewData.analysis.geometry,()=>{this._visualElement.geometry=null},o),s(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),o),this._updateGeometryThrottled])}destroy(){this._visualElement.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.getResult()}get _effectiveVisible(){const{analysisViewData:e,_result:t}=this;return e.visible&&!!t?.available&&t.computation.profile.viewOptions.lineVisible}get _geometryUpdateParameters(){const e={samples:this._result?.samples,spatialReference:this.view.spatialReference};return e.samples&&this._effectiveVisible&&1!==this.analysisViewData.progress?null:e}get testData(){return{visualElement:this._visualElement}}};e([l()],c.prototype,"view",void 0),e([l()],c.prototype,"analysisViewData",void 0),e([l()],c.prototype,"getResult",void 0),e([l()],c.prototype,"updating",null),e([l()],c.prototype,"_result",null),e([l()],c.prototype,"_effectiveVisible",null),e([l()],c.prototype,"_geometryUpdateParameters",null),c=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineVisualization3D")],c);export{c as ElevationProfileLineVisualization3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{mapCollection as o}from"../../../../core/mapCollectionUtils.js";import{property as s,subclass as e}from"../../../../core/accessorSupport/decorators.js";import{ElevationProfileGeometryVisualization3D as a}from"./ElevationProfileGeometryVisualization3D.js";import{ElevationProfileLineVisualization3D as
|
|
5
|
+
import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{mapCollection as o}from"../../../../core/mapCollectionUtils.js";import{property as s,subclass as e}from"../../../../core/accessorSupport/decorators.js";import{ElevationProfileGeometryVisualization3D as a}from"./ElevationProfileGeometryVisualization3D.js";import{ElevationProfileLineVisualization3D as n}from"./ElevationProfileLineVisualization3D.js";import{ElevationProfileHoveredPointsVisualization as r}from"../../../analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js";let l=class extends t{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:t}=this;this._hoveredPointsVisualization=new r({view:i,analysisViewData:t}),this._geometryVisualization=new a({view:i,analysisViewData:t}),this._lineVisualizations=o(()=>this.analysisViewData.analysis.profiles,o=>new n({view:i,analysisViewData:t,getResult:()=>t.results.find(i=>i.computation.profile===o)}))}destroy(){this._geometryVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._lineVisualizations.destroy()}get updating(){return this._geometryVisualization.updating||this._lineVisualizations.some(i=>i.updating)}get testData(){return{hoveredPointsVisualization:this._hoveredPointsVisualization,geometryVisualization:this._geometryVisualization,lineVisualizations:this._lineVisualizations}}};i([s()],l.prototype,"view",void 0),i([s()],l.prototype,"analysisViewData",void 0),i([s()],l.prototype,"updating",null),l=i([e("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization3D")],l);export{l as ElevationProfileVisualization3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{property as e,subclass as
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as i}from"../../../core/accessorSupport/decorators.js";import{AnalysisView3D as o}from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as r}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as s}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as u}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let c=class extends o{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profile.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new r(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new u({view:e,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get hoveredPoints(){return this._controller?.hoveredPoints??[]}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickFeature(t){return this._sketchTool.pickFeature(t)}get testData(){return{visualization:this._visualization}}};t([e({readOnly:!0})],c.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([e({readOnly:!0})],c.prototype,"effectiveDisplayUnits",null),t([e({readOnly:!0})],c.prototype,"error",null),t([e()],c.prototype,"hoveredPosition",void 0),t([e()],c.prototype,"hoveredPoints",null),t([e({readOnly:!0})],c.prototype,"progress",null),t([e({readOnly:!0})],c.prototype,"results",null),t([e({readOnly:!0})],c.prototype,"statistics",null),t([e({readOnly:!0})],c.prototype,"updating",null),t([e()],c.prototype,"sketchGraphic",null),t([e()],c.prototype,"toolState",null),t([e()],c.prototype,"_controller",void 0),t([e()],c.prototype,"_visualization",void 0),t([e()],c.prototype,"_sketchTool",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const v=c;export{v 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{updatePointsFromFeatureReference as t,getFeatureId as n}from"../../../../analysis/featureReferenceUtils.js";import{createTask as o}from"../../../../core/asyncUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import r from"../../../../core/Handles.js";import{handlesGroup as s,makeHandle as a}from"../../../../core/handleUtils.js";import l from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as c,on as p}from"../../../../core/reactiveUtils.js";import{property as g,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{d as v,e as m,n as f,j as _,i as b,H as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import P from"../../../../geometry/Point.js";import{projectOrLoad as I}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as S}from"../../../../geometry/projection/projectBoundingRect.js";import{intersectsSegment as j}from"../../../../geometry/support/aaBoundingBox.js";import{empty as w,containsPointObject as R,intersectsSegment as A}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as H,create as E}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as L}from"../../../../support/elevationInfoUtils.js";import V from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as F}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as x}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as D}from"../support/projectionUtils.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as U,TaskPriority as z}from"../../../support/Scheduler.js";let N=class extends i{constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=U,this._computationHandles=new r,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):U,this._intersector=new x({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:n,computationResult:o}=t,{observerAdjusted:i,targetAdjusted:r}=n,{start:s,end:a}=o;v(s,i),v(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:n}=this,{inputPoints:o}=e,{observer:i,target:r,observerAdjusted:s,targetAdjusted:a}=o;v(s,i),v(a,r),t(n,this._intersector.intersector,o);const{observerSurfaceNormal:l,targetSurfaceNormal:u}=o,d=this._screenPixelSize,c=Z;null!=l?v(c,l):m(c,a,s);const p=d;f(c,c),_(c,c,Math.min(p,1)),b(s,s,c),null!=u?v(c,u):m(c,s,a);const g=n.state.camera.computeScreenPixelSizeAt(a);f(c,c),_(c,c,Math.min(g,1)),b(a,a,c)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:n}=this,{sceneIntersectionHelper:o,renderCoordsHelper:i}=n;if(null==o)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:u}=a,{start:d,end:c}=s,p=H(d,c,q);r.options.store=0,o.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,m=Z;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){v(t.originalIntersection,h),v(t.originalObserver,d),v(t.originalTarget,c),i.fromRenderCoords(h,m,n.spatialReference);const e=1-y(c,u)/y(d,u);f=y(l,h)>=e*y(l,u)}const _=new P(m,n.spatialReference);{const{result:t,target:o}=e;null!=t?(t.target=o,t.intersectedGraphic=f?null:G(g,n),t.intersectedLocation=f?null:_,t.visible=f):e.result=new V({target:o,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,n),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,n=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==n)return!1;const{observerAdjusted:o,targetAdjusted:i}=e.inputPoints,r=n.intersectsPoint(o),s=n.intersectsPoint(i);return r&&s}_onObserverPositionChange(e,t,o,i,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return D(this.analysis,e.spatialReference,l.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=k(t,o),{absoluteZ:a,elevation:u}=L(t.x,t.y,t.z,this.view.spatialReference,this.view,s),d=t.clone();d.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=d;const c=T();this.view.renderCoordsHelper.toRenderCoords(d,c),this._elevationAlignedObserverPositionRenderSpace=c,this._observerGroundOffsetRenderSpace=a-u,this._observerFeatureId=n(i),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i){const{inputPoints:r}=e;switch(v(r.observer,t),r.observerFeatureId=i,r.observerSurfaceNormal=null,o){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,n,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,o,i,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==o)return null!=t&&D(this.analysis,t.spatialReference,l.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const u=k(o,i),{absoluteZ:d,elevation:c}=L(o.x,o.y,o.z,this.view.spatialReference,this.view,u),p=o.clone();switch(p.z=d,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=n(r),a.targetSurfaceNormal=null,u.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,d-c,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return s([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:I(e.target.position,this.view.spatialReference)}),({computation:e,targetPosition:t,targetElevationInfo:n,targetFeatureInfo:o,projectedTargetPosition:i})=>{null==i.pending?this._onTargetPositionChange(e,t,i.geometry,n,o):this._updatingHandles.addPromise(i.pending)},c)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},c)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:t,observerGroundOffset:n,observerElevationMode:o,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i)},c)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slice.plane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){const t=(n,o)=>{const i=this.analysis.observer,r=e.target;let s=null,a=null,l=null,u=null,d=null,c=null;if(null!=i?.position){const e=I(i.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));s=e.geometry,a=i.elevationInfo,l=i.feature}if(null!=r.position){const e=I(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));u=e.geometry,d=r.elevationInfo,c=r.feature}null==s&&null==u||(S(n,o,J,this.view.spatialReference),null!=s&&R(J,s)&&this._onObserverPositionChange(null!=i?i.position:null,s,a,l,!1),null!=u&&R(J,u)&&this._onTargetPositionChange(e,r.position,u,d,c,!1),null!=s&&null!=u&&A(J,s,u)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:n})=>t(e,n))}_connectComputationToTask(e){let t=null;const n={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return s([this._updatingHandles.add(()=>e.inputPoints,()=>{t=u(t),t=o(async e=>{await d(this._frameTask.schedule(()=>this._computeResult(n),e))})},{initial:!0,equals:()=>!1}),a(()=>t=u(t))])}_connectComputationToContent(e){return p(()=>this.view.pointsOfInterest?.contentGeometryUpdates.events,"request-update",t=>{const n=t?.renderBounds,{observerAdjusted:o,targetAdjusted:i}=e.inputPoints;(null==n||j(n,o,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())})}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_onTargetCollectionChange({added:e,removed:t}){for(const n of t)this._removeTarget(n);for(const n of e)this._addTarget(n)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new F({target:e}))}_removeTarget(e){const t=this._computations.findIndex(t=>t.target===e);this._computations.removeAt(t)}_connectObserver(){return s([this._updatingHandles.add(()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:I(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null}),({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:n,observerFeatureInfo:o})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,n,o,!0):this._updatingHandles.addPromise(t.pending)},c)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return s([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:n}=t;if(null==e||null==n)return!1;const o=Z;n.toRenderCoords(e,o);const i=t.state.camera.computeScreenPixelSizeAt(o);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>B}};function k(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:n,inputPoints:o}=e,{start:i,end:r,intersection:s}=n,{originalIntersection:a,originalObserver:l,originalTarget:u}=t;if(v(s,a),o.isValid){const e=Z,t=y(l,a)/y(l,u);C(e,i,l),_(e,e,1-t),b(s,s,e),C(e,r,u),_(e,e,t),b(s,s,e),n.isValid=!0}else e.result=null,n.isValid=!1,n.isTargetVisible=!1}e([g({constructOnly:!0})],N.prototype,"analysis",void 0),e([g({constructOnly:!0})],N.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],N.prototype,"view",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"priority",null),e([g()],N.prototype,"updateOnCameraChange",void 0),e([g()],N.prototype,"_computations",null),e([g()],N.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],N.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],N.prototype,"_effectiveObserverElevationMode",void 0),e([g()],N.prototype,"_observerFeatureId",void 0),e([g()],N.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],N.prototype,"_updatingHandles",void 0),e([g()],N.prototype,"_frameTask",void 0),e([g()],N.prototype,"_isCameraDirty",null),N=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],N);const B=.1,Z=T(),q=E(),J=w();export{N as LineOfSightController};
|
|
5
|
+
import{__decorate as e}from"tslib";import{updatePointsFromFeatureReference as t,getFeatureId as n}from"../../../../analysis/featureReferenceUtils.js";import{createTask as o}from"../../../../core/asyncUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import r from"../../../../core/Handles.js";import{handlesGroup as s,makeHandle as a}from"../../../../core/handleUtils.js";import l from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as c,on as p}from"../../../../core/reactiveUtils.js";import{property as g,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{d as v,e as m,n as f,j as _,i as b,G as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import P from"../../../../geometry/Point.js";import{projectOrLoad as I}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as S}from"../../../../geometry/projection/projectBoundingRect.js";import{intersectsSegment as j}from"../../../../geometry/support/aaBoundingBox.js";import{empty as w,containsPointObject as R,intersectsSegment as A}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as H,create as E}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as L}from"../../../../support/elevationInfoUtils.js";import V from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as F}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as x}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as D}from"../support/projectionUtils.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as U,TaskPriority as z}from"../../../support/Scheduler.js";let N=class extends i{constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=U,this._computationHandles=new r,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):U,this._intersector=new x({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:n,computationResult:o}=t,{observerAdjusted:i,targetAdjusted:r}=n,{start:s,end:a}=o;v(s,i),v(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:n}=this,{inputPoints:o}=e,{observer:i,target:r,observerAdjusted:s,targetAdjusted:a}=o;v(s,i),v(a,r),t(n,this._intersector.intersector,o);const{observerSurfaceNormal:l,targetSurfaceNormal:u}=o,d=this._screenPixelSize,c=Z;null!=l?v(c,l):m(c,a,s);const p=d;f(c,c),_(c,c,Math.min(p,1)),b(s,s,c),null!=u?v(c,u):m(c,s,a);const g=n.state.camera.computeScreenPixelSizeAt(a);f(c,c),_(c,c,Math.min(g,1)),b(a,a,c)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:n}=this,{sceneIntersectionHelper:o,renderCoordsHelper:i}=n;if(null==o)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:u}=a,{start:d,end:c}=s,p=H(d,c,q);r.options.store=0,o.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,m=Z;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){v(t.originalIntersection,h),v(t.originalObserver,d),v(t.originalTarget,c),i.fromRenderCoords(h,m,n.spatialReference);const e=1-y(c,u)/y(d,u);f=y(l,h)>=e*y(l,u)}const _=new P(m,n.spatialReference);{const{result:t,target:o}=e;null!=t?(t.target=o,t.intersectedGraphic=f?null:G(g,n),t.intersectedLocation=f?null:_,t.visible=f):e.result=new V({target:o,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,n),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,n=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==n)return!1;const{observerAdjusted:o,targetAdjusted:i}=e.inputPoints,r=n.intersectsPoint(o),s=n.intersectsPoint(i);return r&&s}_onObserverPositionChange(e,t,o,i,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return D(this.analysis,e.spatialReference,l.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=k(t,o),{absoluteZ:a,elevation:u}=L(t.x,t.y,t.z,this.view.spatialReference,this.view,s),d=t.clone();d.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=d;const c=T();this.view.renderCoordsHelper.toRenderCoords(d,c),this._elevationAlignedObserverPositionRenderSpace=c,this._observerGroundOffsetRenderSpace=a-u,this._observerFeatureId=n(i),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i){const{inputPoints:r}=e;switch(v(r.observer,t),r.observerFeatureId=i,r.observerSurfaceNormal=null,o){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,n,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,o,i,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==o)return null!=t&&D(this.analysis,t.spatialReference,l.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const u=k(o,i),{absoluteZ:d,elevation:c}=L(o.x,o.y,o.z,this.view.spatialReference,this.view,u),p=o.clone();switch(p.z=d,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=n(r),a.targetSurfaceNormal=null,u.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,d-c,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return s([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:I(e.target.position,this.view.spatialReference)}),({computation:e,targetPosition:t,targetElevationInfo:n,targetFeatureInfo:o,projectedTargetPosition:i})=>{null==i.pending?this._onTargetPositionChange(e,t,i.geometry,n,o):this._updatingHandles.addPromise(i.pending)},c)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},c)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:t,observerGroundOffset:n,observerElevationMode:o,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,n,o,i)},c)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slice.plane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){const t=(n,o)=>{const i=this.analysis.observer,r=e.target;let s=null,a=null,l=null,u=null,d=null,c=null;if(null!=i?.position){const e=I(i.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));s=e.geometry,a=i.elevationInfo,l=i.feature}if(null!=r.position){const e=I(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally(()=>t(n,o));u=e.geometry,d=r.elevationInfo,c=r.feature}null==s&&null==u||(S(n,o,J,this.view.spatialReference),null!=s&&R(J,s)&&this._onObserverPositionChange(null!=i?i.position:null,s,a,l,!1),null!=u&&R(J,u)&&this._onTargetPositionChange(e,r.position,u,d,c,!1),null!=s&&null!=u&&A(J,s,u)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:n})=>t(e,n))}_connectComputationToTask(e){let t=null;const n={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return s([this._updatingHandles.add(()=>e.inputPoints,()=>{t=u(t),t=o(async e=>{await d(this._frameTask.schedule(()=>this._computeResult(n),e))})},{initial:!0,equals:()=>!1}),a(()=>t=u(t))])}_connectComputationToContent(e){return p(()=>this.view.pointsOfInterest?.contentGeometryUpdates.events,"request-update",t=>{const n=t?.renderBounds,{observerAdjusted:o,targetAdjusted:i}=e.inputPoints;(null==n||j(n,o,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())})}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_onTargetCollectionChange({added:e,removed:t}){for(const n of t)this._removeTarget(n);for(const n of e)this._addTarget(n)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new F({target:e}))}_removeTarget(e){const t=this._computations.findIndex(t=>t.target===e);this._computations.removeAt(t)}_connectObserver(){return s([this._updatingHandles.add(()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:I(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null}),({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:n,observerFeatureInfo:o})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,n,o,!0):this._updatingHandles.addPromise(t.pending)},c)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return s([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:n}=t;if(null==e||null==n)return!1;const o=Z;n.toRenderCoords(e,o);const i=t.state.camera.computeScreenPixelSizeAt(o);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>B}};function k(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:n,inputPoints:o}=e,{start:i,end:r,intersection:s}=n,{originalIntersection:a,originalObserver:l,originalTarget:u}=t;if(v(s,a),o.isValid){const e=Z,t=y(l,a)/y(l,u);C(e,i,l),_(e,e,1-t),b(s,s,e),C(e,r,u),_(e,e,t),b(s,s,e),n.isValid=!0}else e.result=null,n.isValid=!1,n.isTargetVisible=!1}e([g({constructOnly:!0})],N.prototype,"analysis",void 0),e([g({constructOnly:!0})],N.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],N.prototype,"view",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"priority",null),e([g()],N.prototype,"updateOnCameraChange",void 0),e([g()],N.prototype,"_computations",null),e([g()],N.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],N.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],N.prototype,"_effectiveObserverElevationMode",void 0),e([g()],N.prototype,"_observerFeatureId",void 0),e([g()],N.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],N.prototype,"_updatingHandles",void 0),e([g()],N.prototype,"_frameTask",void 0),e([g()],N.prototype,"_isCameraDirty",null),N=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],N);const B=.1,Z=T(),q=E(),J=w();export{N as LineOfSightController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{
|
|
5
|
+
import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{F as n}from"../../../../chunks/vec32.js";import{equals as c}from"../../../../geometry/support/ray.js";let p=class extends o{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&s(this.mapPoint,t.mapPoint)&&n(this.renderPoint,t.renderPoint)&&r(this.normal,t.normal)&&c(this.ray,t.ray)}};t([e({constructOnly:!0})],p.prototype,"context",void 0),t([e({constructOnly:!0})],p.prototype,"id",void 0),t([e({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([e({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([e({constructOnly:!0})],p.prototype,"normal",void 0),t([e({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const u=new y;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,u as lineOfSightIntersectionContextGround};
|