@arcgis/core 4.31.0-next.20240821 → 4.31.0-next.20240823
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{24e38b7d1e9984a1472e.js → 033032715c3b04e0fc7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfc93bbd35cc4bfde7c0.js → 045336db17aae6eef68f.js} +1 -1
- package/assets/esri/core/workers/chunks/04de7b2937d5ca7c23e2.js +1 -0
- package/assets/esri/core/workers/chunks/12a4b3706162872c2b41.js +769 -0
- package/assets/esri/core/workers/chunks/142b1336533fa2ac470b.js +47 -0
- package/assets/esri/core/workers/chunks/185e596f86767c22f951.js +1 -0
- package/assets/esri/core/workers/chunks/{cd8d595d577b74817623.js → 1a4b3820136fb615b730.js} +1 -1
- package/assets/esri/core/workers/chunks/29b157b41dfa16da886b.js +1 -0
- package/assets/esri/core/workers/chunks/300b57846114fedd12be.js +1 -0
- package/assets/esri/core/workers/chunks/{3f75b7ed24b440b4508a.js → 3d5f37c2f355260e6dc6.js} +1 -1
- package/assets/esri/core/workers/chunks/{a9eba26d62b62592cee1.js → 42861d54a336146753d8.js} +1 -1
- package/assets/esri/core/workers/chunks/4c8deac4bf72a5e2597a.js +1 -0
- package/assets/esri/core/workers/chunks/52107d450c55450f5c04.js +274 -0
- package/assets/esri/core/workers/chunks/6d54222301b6d819c904.js +1 -0
- package/assets/esri/core/workers/chunks/{eb0f180ed20af220a82e.js → 6ddece9cd94b60efe3d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{566844774388a031fd74.js → 7125cff7fd288ff7bd5f.js} +1 -1
- package/assets/esri/core/workers/chunks/74de734a20b4cd2d7efb.js +1 -0
- package/assets/esri/core/workers/chunks/7712a23dc68220edaa64.js +1 -0
- package/assets/esri/core/workers/chunks/{ea561b2460e634a643fc.js → 7f35380809e7de99c302.js} +1 -1
- package/assets/esri/core/workers/chunks/7f3d49b667e9b46449e7.js +1 -0
- package/assets/esri/core/workers/chunks/8a2faf12938e811a9fc9.js +1 -0
- package/assets/esri/core/workers/chunks/{796c64b9caa1303e26ed.js → 8af503fa88c1668872eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{e2a6f77c05d0818e3f74.js → 8e42ce8305cefba5debc.js} +1 -1
- package/assets/esri/core/workers/chunks/93169e55e472fec4bc50.js +1 -0
- package/assets/esri/core/workers/chunks/985c1f42aab564008c0d.js +1 -0
- package/assets/esri/core/workers/chunks/9a32d9d720cb81abfba2.js +1 -0
- package/assets/esri/core/workers/chunks/b171d57b4d0142f687d0.js +1 -0
- package/assets/esri/core/workers/chunks/d5e376893cd47605a438.js +1 -0
- package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +1 -0
- package/assets/esri/core/workers/chunks/f11ae249cc8e995bbccc.js +1 -0
- package/assets/esri/core/workers/chunks/{65d8011cf756b066cade.js → f218316de8b4635653b2.js} +1 -1
- package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
- package/assets/esri/themes/base/widgets/_GridControls.scss +86 -0
- package/assets/esri/themes/base/widgets/_Print.scss +13 -15
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Print/t9n/Print.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_ar.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_bg.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_bs.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_ca.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_cs.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_da.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_de.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_el.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_es.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_et.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_fi.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_fr.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_he.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_hr.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_hu.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_id.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_it.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_ja.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_ko.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_lt.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_lv.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_nb.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_nl.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_pl.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_pt-BR.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_pt-PT.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_ro.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_ru.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_sk.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_sl.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_sr.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_sv.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_th.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_tr.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_uk.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_vi.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_zh-CN.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_zh-HK.json +1 -1
- package/assets/esri/widgets/Print/t9n/Print_zh-TW.json +1 -1
- package/assets/esri/widgets/support/GridControls/t9n/GridControls.json +1 -0
- package/assets/esri/widgets/support/GridControls/t9n/GridControls_en.json +1 -0
- package/chunks/CloudsComposition.glsl.js +3 -3
- package/chunks/ComponentShader.glsl.js +53 -61
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/FocusAreaColor.glsl.js +12 -0
- package/chunks/FocusAreaMask.glsl.js +5 -0
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/Path.glsl.js +22 -17
- package/chunks/PointRenderer.glsl.js +3 -3
- package/chunks/Precipitation.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/WaterSurface.glsl.js +18 -18
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/terrainUtilsPlanar.js +1 -1
- package/chunks/vec32.js +1 -1
- package/chunks/vxlLayer.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/core/mathUtils.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/exports/csv.js +1 -1
- package/geometry/operators/support/converterAPI.js +1 -1
- package/geometry/projection/localLinearScaleFactors.js +1 -1
- package/geometry/support/buffer/internals/Vec3.js +1 -1
- package/geometry/support/clipRay.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/polygonUtils.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/geometry/support/sphereUtils.js +5 -0
- package/geometry/support/triangle.js +1 -1
- package/geometry/support/vector.js +1 -1
- package/interfaces.d.ts +68 -9
- package/layers/FocusAreaLayer.js +5 -0
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DMaterial.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/grid/constants.js +5 -0
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/support/highlightGroupUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/support/measurementUtils.js +1 -1
- package/views/3d/animation/pointToPoint/Animation.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/FocusAreaLayerView3D.js +5 -0
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VoxelGraphic.js +5 -0
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/i3s/LoDUtil.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/state/utils/viewUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtilsInternal.js +1 -1
- package/views/3d/support/geometryUtils/ray.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/mathUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.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/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -6
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +13 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +11 -13
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +1 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorRenderNodeTechnique.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskRenderNodeTechnique.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaParameters.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaRenderNode.js +5 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/Path.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/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/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.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/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/draw/support/helpMessageUtils3d.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/input/gamepad/GamepadSource.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/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/GridSnappingEngine.js +5 -0
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/GridControls/GridControlsViewModel.d.ts +4 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/Print/CustomTemplate.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print/TemplateOptions.js +1 -1
- package/widgets/Print/utils.js +5 -0
- package/widgets/Print.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.d.ts +4 -0
- package/widgets/support/GridControls/GridControlsViewModel.js +5 -0
- package/widgets/support/GridControls/VisibleElements.js +5 -0
- package/widgets/support/GridControls/gridUtils.js +5 -0
- package/widgets/support/GridControls.d.ts +4 -0
- package/widgets/support/GridControls.js +5 -0
- package/widgets/support/exportUtils.js +1 -1
- package/assets/esri/core/workers/chunks/14dc47896456e3c66b24.js +0 -1
- package/assets/esri/core/workers/chunks/2e88af8ab1e2713e7655.js +0 -1
- package/assets/esri/core/workers/chunks/3b204e75b613bcfbc8b9.js +0 -1
- package/assets/esri/core/workers/chunks/3e57f493d5a9d7aa7a48.js +0 -1
- package/assets/esri/core/workers/chunks/4e5ae81c612543130d9a.js +0 -1
- package/assets/esri/core/workers/chunks/4e746f8fca1d932dd684.js +0 -1
- package/assets/esri/core/workers/chunks/544eec13338b2d71680f.js +0 -1
- package/assets/esri/core/workers/chunks/5e7e12863cbed07451d0.js +0 -1
- package/assets/esri/core/workers/chunks/6c129767cda74aa672e0.js +0 -1
- package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +0 -1
- package/assets/esri/core/workers/chunks/7802e70422f4151b95bc.js +0 -1
- package/assets/esri/core/workers/chunks/920557db2bd107a3c579.js +0 -1
- package/assets/esri/core/workers/chunks/9443b9ec03f25c723c2c.js +0 -47
- package/assets/esri/core/workers/chunks/991295637f51e8207efe.js +0 -1
- package/assets/esri/core/workers/chunks/ace8b6351ed35b03499b.js +0 -1
- package/assets/esri/core/workers/chunks/b1e4896acfae0bf9a9a8.js +0 -1
- package/assets/esri/core/workers/chunks/ca12b1c470e67ca7b30e.js +0 -1
- package/assets/esri/core/workers/chunks/cd9f48dcee2a1fc261ed.js +0 -774
- package/assets/esri/core/workers/chunks/d3626c01d2569d84e01e.js +0 -1
- package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +0 -31
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../core/has.js";import e from"../../core/Error.js";import t from"../HeightModelInfo.js";import{parse as n}from"../../layers/support/arcgisLayerUrl.js";function i(n,i){if(!n)return null;if(!s(n))return new e("webscene:unsupported-height-model-info","The vertical coordinate system of the scene is not supported",{heightModelInfo:n});const a=n.heightUnit,o=t.deriveUnitFromSR(n,i).heightUnit;return a!==o?new e("webscene:incompatible-height-unit",`The vertical units of the scene (${a}) must match the horizontal units of the scene (${o})`,{verticalUnit:a,horizontalUnit:o}):null}function a(n,i,a){const s=l(n),h=i,u=o(s,h,a);if(s){const i=t.deriveUnitFromSR(s,n.spatialReference).heightUnit;if(!a&&i!==s.heightUnit){const t=new e("layerview:unmatched-height-unit",`The vertical units of the layer must match the horizontal units (${i})`,{horizontalUnit:i});return new e("layerview:unsupported-height-model-info","The vertical coordinate system of the layer is not supported",{heightModelInfo:s,error:t})}}if(!c(n)||u===r.Unsupported)return new e("layerview:unsupported-height-model-info","The vertical coordinate system of the layer is not supported",{heightModelInfo:s});switch(u){case r.Units:{const t=s?.heightUnit||"unknown",n=h?.heightUnit||"unknown",i=new e("layerview:incompatible-height-unit",`The vertical units of the layer (${t}) must match the vertical units of the scene (${n})`,{layerUnit:t,sceneUnit:n});return new e("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:s,sceneHeightModelInfo:h,error:i})}case r.HeightModel:{const t=s?.heightModel||"unknown",n=h?.heightModel||"unknown",i=new e("layerview:incompatible-height-model",`The height model of the layer (${t}) must match the height model of the scene (${n})`,{layerHeightModel:t,sceneHeightModel:n});return new e("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:s,sceneHeightModelInfo:h,error:i})}case r.CRS:{const t=s?.vertCRS||"unknown",n=h?.vertCRS||"unknown",i=new e("layerview:incompatible-vertical-datum",`The vertical datum of the layer (${t}) must match the vertical datum of the scene (${n})`,{layerDatum:t,sceneDatum:n});return new e("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:s,sceneHeightModelInfo:h,error:i})}}return null}function o(e,t,n){if(!s(e)||!s(t))return r.Unsupported;if(null==e||null==t)return r.Ok;if(!n&&e.heightUnit!==t.heightUnit)return r.Units;if(e.heightModel!==t.heightModel)return r.HeightModel;switch(e.heightModel){case"gravity-related-height":return r.Ok;case"ellipsoidal":return e.vertCRS===t.vertCRS?r.Ok:r.CRS;default:return r.Unsupported}}var r;function s(e){return null==e||null!=e.heightModel&&null!=e.heightUnit}function c(e){return"heightModelInfo"in e&&null!=e.heightModelInfo||null!=e.spatialReference||!d(e)}function l(e){if("integrated-mesh-3dtiles"===e.type)return null;const i=e.url?n(e.url):void 0,a=e.spatialReference?.vcsWkid;return!(null==a&&null!=i&&"ImageServer"===i.serverType)&&h(e)&&e.heightModelInfo?e.heightModelInfo:d(e)?t.deriveUnitFromSR(p,e.spatialReference):null}function h(e){return"heightModelInfo"in e}function u(e){if("unknown"===e.type||!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function d(e){return u(e)?!!(e.capabilities&&e.capabilities.data&&e.capabilities.data.supportsZ):f(e)}function g(e){return null!=e.layers||f(e)||u(e)||h(e)}function f(e){switch(e.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}!function(e){e[e.Ok=0]="Ok",e[e.Units=1]="Units",e[e.HeightModel=2]="HeightModel",e[e.CRS=3]="CRS",e[e.Unsupported=4]="Unsupported"}(r||(r={}));const p=new t({heightModel:"gravity-related-height"});export{l as deriveHeightModelInfoFromLayer,a as rejectLayerError,g as supportsHeightModelInfo,i as validateWebSceneError};
|
|
5
|
+
import"../../core/has.js";import e from"../../core/Error.js";import t from"../HeightModelInfo.js";import{parse as n}from"../../layers/support/arcgisLayerUrl.js";function i(n,i){if(!n)return null;if(!s(n))return new e("webscene:unsupported-height-model-info","The vertical coordinate system of the scene is not supported",{heightModelInfo:n});const a=n.heightUnit,o=t.deriveUnitFromSR(n,i).heightUnit;return a!==o?new e("webscene:incompatible-height-unit",`The vertical units of the scene (${a}) must match the horizontal units of the scene (${o})`,{verticalUnit:a,horizontalUnit:o}):null}function a(n,i,a){const s=l(n),h=i,u=o(s,h,a);if(s){const i=t.deriveUnitFromSR(s,n.spatialReference).heightUnit;if(!a&&i!==s.heightUnit){const t=new e("layerview:unmatched-height-unit",`The vertical units of the layer must match the horizontal units (${i})`,{horizontalUnit:i});return new e("layerview:unsupported-height-model-info","The vertical coordinate system of the layer is not supported",{heightModelInfo:s,error:t})}}if(!c(n)||u===r.Unsupported)return new e("layerview:unsupported-height-model-info","The vertical coordinate system of the layer is not supported",{heightModelInfo:s});switch(u){case r.Units:{const t=s?.heightUnit||"unknown",n=h?.heightUnit||"unknown",i=new e("layerview:incompatible-height-unit",`The vertical units of the layer (${t}) must match the vertical units of the scene (${n})`,{layerUnit:t,sceneUnit:n});return new e("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:s,sceneHeightModelInfo:h,error:i})}case r.HeightModel:{const t=s?.heightModel||"unknown",n=h?.heightModel||"unknown",i=new e("layerview:incompatible-height-model",`The height model of the layer (${t}) must match the height model of the scene (${n})`,{layerHeightModel:t,sceneHeightModel:n});return new e("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:s,sceneHeightModelInfo:h,error:i})}case r.CRS:{const t=s?.vertCRS||"unknown",n=h?.vertCRS||"unknown",i=new e("layerview:incompatible-vertical-datum",`The vertical datum of the layer (${t}) must match the vertical datum of the scene (${n})`,{layerDatum:t,sceneDatum:n});return new e("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:s,sceneHeightModelInfo:h,error:i})}}return null}function o(e,t,n){if(!s(e)||!s(t))return r.Unsupported;if(null==e||null==t)return r.Ok;if(!n&&e.heightUnit!==t.heightUnit)return r.Units;if(e.heightModel!==t.heightModel)return r.HeightModel;switch(e.heightModel){case"gravity-related-height":return r.Ok;case"ellipsoidal":return e.vertCRS===t.vertCRS?r.Ok:r.CRS;default:return r.Unsupported}}var r;function s(e){return null==e||null!=e.heightModel&&null!=e.heightUnit}function c(e){return"heightModelInfo"in e&&null!=e.heightModelInfo||null!=e.spatialReference||!d(e)}function l(e){if("integrated-mesh-3dtiles"===e.type)return null;const i=e.url?n(e.url):void 0,a=e.spatialReference?.vcsWkid;return!(null==a&&null!=i&&"ImageServer"===i.serverType)&&h(e)&&e.heightModelInfo?e.heightModelInfo:d(e)?t.deriveUnitFromSR(p,e.spatialReference):null}function h(e){return"heightModelInfo"in e}function u(e){if("unknown"===e.type||!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function d(e){return u(e)?!!(e.capabilities&&e.capabilities.data&&e.capabilities.data.supportsZ):f(e)}function g(e){return null!=e.layers||f(e)||u(e)||h(e)}function f(e){switch(e.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}!function(e){e[e.Ok=0]="Ok",e[e.Units=1]="Units",e[e.HeightModel=2]="HeightModel",e[e.CRS=3]="CRS",e[e.Unsupported=4]="Unsupported"}(r||(r={}));const p=new t({heightModel:"gravity-related-height"});export{l as deriveHeightModelInfoFromLayer,a as rejectLayerError,g as supportsHeightModelInfo,i as validateWebSceneError};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as t}from"../../core/mathUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{c as n,f as o,
|
|
5
|
+
import{clamp as t}from"../../core/mathUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{c as n,f as o,l as e,j as i,g as c,q as s,s as u}from"../../chunks/vec32.js";import{clone as a,create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f}from"./vectorStacks.js";function v(t){return t?{origin:a(t.origin),vector:a(t.vector)}:{origin:g(),vector:g()}}function m(t,r){const n=S.get();return n.origin=t,n.vector=r,n}function p(t,r=v()){return b(t.origin,t.vector,r)}function b(t,r,o=v()){return n(o.origin,t),n(o.vector,r),o}function h(t,r,e=v()){return n(e.origin,t),o(e.vector,r,t),e}function j(r,n){const c=o(f.get(),n,r.origin),s=e(r.vector,c),u=e(r.vector,r.vector),a=t(s/u,0,1),g=o(f.get(),i(f.get(),r.vector,a),c);return e(g,g)}function l(t,r,n){return A(t,r,0,1,n)}function M(t,r,n){return c(n,t.origin,i(n,t.vector,r))}function A(r,n,u,a,g){const{vector:v,origin:m}=r,p=o(f.get(),n,m),b=e(v,p)/s(v);return i(g,v,t(b,u,a)),c(g,g,r.origin)}function B(t,r){if(k(t,m(r.origin,r.direction),!1,x)){const{tA:r,pB:n,distance2:o}=x;if(r>=0&&r<=1)return o;if(r<0)return u(t.origin,n);if(r>1)return u(c(f.get(),t.origin,t.vector),n)}return null}function d(t,r,o){return!!k(t,r,!0,x)&&(n(o,x.pA),!0)}function k(r,n,o,e){const i=1e-6,s=r.origin,a=c(f.get(),s,r.vector),g=n.origin,v=c(f.get(),g,n.vector),m=f.get(),p=f.get();if(m[0]=s[0]-g[0],m[1]=s[1]-g[1],m[2]=s[2]-g[2],p[0]=v[0]-g[0],p[1]=v[1]-g[1],p[2]=v[2]-g[2],Math.abs(p[0])<i&&Math.abs(p[1])<i&&Math.abs(p[2])<i)return!1;const b=f.get();if(b[0]=a[0]-s[0],b[1]=a[1]-s[1],b[2]=a[2]-s[2],Math.abs(b[0])<i&&Math.abs(b[1])<i&&Math.abs(b[2])<i)return!1;const h=m[0]*p[0]+m[1]*p[1]+m[2]*p[2],j=p[0]*b[0]+p[1]*b[1]+p[2]*b[2],l=m[0]*b[0]+m[1]*b[1]+m[2]*b[2],M=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],A=(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])*M-j*j;if(Math.abs(A)<i)return!1;let B=(h*j-l*M)/A,d=(h+j*B)/M;o&&(B=t(B,0,1),d=t(d,0,1));const k=f.get(),x=f.get();return k[0]=s[0]+B*b[0],k[1]=s[1]+B*b[1],k[2]=s[2]+B*b[2],x[0]=g[0]+d*p[0],x[1]=g[1]+d*p[1],x[2]=g[2]+d*p[2],e.tA=B,e.tB=d,e.pA=k,e.pB=x,e.distance2=u(k,x),!0}const x={tA:0,tB:0,pA:g(),pB:g(),distance2:0},S=new r((()=>v()));export{d as closestLineSegmentPoint,B as closestRayDistance2,p as copy,v as create,j as distance2,h as fromPoints,b as fromValues,M as pointAt,l as projectPoint,A as projectPointClamp,m as wrap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{a as o,f as n,b as t,n as s}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function a(o,n){if(o.components)for(const t of o.components)t.faces&&"smooth"===t.shading&&c(t,n)}function c(r,a){null==a.normal&&(a.normal=new Float32Array(a.position.length));const c=r.faces,{position:m,normal:p}=a,h=c.length/3;for(let s=0;s<h;++s){const r=3*c[3*s],a=3*c[3*s+1],l=3*c[3*s+2],h=o(e,m[r],m[r+1],m[r+2]),g=o(f,m[a],m[a+1],m[a+2]),u=o(i,m[l],m[l+1],m[l+2]),b=n(g,g,h),j=n(u,u,h),v=t(b,b,j);p[r]+=v[0],p[r+1]+=v[1],p[r+2]+=v[2],p[a]+=v[0],p[a+1]+=v[1],p[a+2]+=v[2],p[l]+=v[0],p[l+1]+=v[1],p[l+2]+=v[2]}for(let n=0;n<p.length;n+=3)o(l,p[n],p[n+1],p[n+2]),s(l,l),p[n]=l[0],p[n+1]=l[1],p[n+2]=l[2]}const e=r(),f=r(),i=r(),l=r();export{a as smoothNormals};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/Logger.js";import{fromMat4 as e}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromRotationTranslationScaleOrigin as o,multiply as i,getScaling as n,scale as s,getTranslation as a,fromRotation as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as m}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{
|
|
5
|
+
import t from"../../../core/Logger.js";import{fromMat4 as e}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromRotationTranslationScaleOrigin as o,multiply as i,getScaling as n,scale as s,getTranslation as a,fromRotation as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as m}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{a as p,i as g,t as u,h as x}from"../../../chunks/vec32.js";import{ONES as j,ZEROS as v,create as b}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../Point.js";import{getSphericalPCPF as A}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as d}from"../../projection/projectPointToVector.js";import{create as y,angleRad as w,axis as F,fromMatrix as S}from"../axisAngleDegrees.js";import T from"../MeshTransform.js";import{isMeshWithRelativeVertexSpace as U}from"../meshVertexSpaceUtils.js";import{performGlobalOperation as q}from"./geographicUtils.js";import{logProjectionError as C,loadProjectErrorMessage as k,projectToPCPF as z,projectNormalToPCPF as L,projectTangentToPCPF as M,projectFromPCPF as P,projectNormalFromPCPF as V,projectTangentFromPCPF as D}from"./projection.js";import{projectPointToVertexSpace as E}from"./vertexSpaceConversion.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.rotate");function B(t,e,r){if(!t.vertexAttributes?.position||0===e[3])return;const{spatialReference:o,vertexSpace:i}=t,n=r?.origin??t.origin,s=r?.geographic,a=q(O,i,o,s);U(t)?G(t,e,n):a?H(t,e,n):I(t,e,n)}function G(t,e,r){t.transform??=new T;const{vertexSpace:l,transform:c,spatialReference:f}=t,[u,x,A]=l.origin,R=new h({x:u,y:x,z:A,spatialReference:f}),d=K;if(R.equals(r))p(d,0,0,0);else if(!E(d,r,t))return void C(O(),r.spatialReference,f,k);m(Z,F(e),w(e));const y=o(N,Z,v,j,d),{localMatrix:U}=c,q=i(N,y,U);c.scale=n(b(),q),s(q,q,g(K,c.scale));const z=c.rotationAxis;c.rotation=S(q),0===c.rotationAngle&&(c.rotationAxis=z),c.translation=a(b(),q)}function H(t,r,o){const i=t.spatialReference,n=A(i),s=Y;if(!d(o,s,n)&&(C(O(),o.spatialReference,n,"Falling back to mesh origin"),!d(t.origin,s,n)))return void C(O(),t.origin.spatialReference,n);const a=t.vertexAttributes.position,l=t.vertexAttributes.normal,c=t.vertexAttributes.tangent,m=new Float64Array(a.length),f=null!=l?new Float32Array(l.length):null,p=null!=c?new Float32Array(c.length):null;R(n,s,W,n),e(X,W);const g=Q;u(F(Q),F(r),X),g[3]=r[3],z(a,i,m)&&(null==l||null==f||L(l,a,m,i,f))&&(null==c||null==p||M(c,a,m,i,p))?(J(m,g,3,s),P(m,a,i)&&(null==l||null==f||(J(f,g,3),V(f,a,m,i,l)))&&(null==c||null==p||(J(p,g,4),D(p,a,m,i,c)))?t.vertexAttributesChanged():C(O(),n,i)):C(O(),i,n)}function I(t,e,r){const o=Y;if(!d(r,o,t.spatialReference)){const e=t.origin;return o[0]=e.x,o[1]=e.y,o[2]=e.z,void C(O(),r.spatialReference,t.spatialReference,k)}J(t.vertexAttributes.position,e,3,o),J(t.vertexAttributes.normal,e,3),J(t.vertexAttributes.tangent,e,4),t.vertexAttributesChanged()}function J(t,e,r,o=v){if(null!=t){l(W,w(e),F(e));for(let e=0;e<t.length;e+=r){for(let r=0;r<3;r++)K[r]=t[e+r]-o[r];x(K,K,W);for(let r=0;r<3;r++)t[e+r]=K[r]+o[r]}}}const K=b(),N=c(),Q=y(),W=c(),X=r(),Y=b(),Z=f();export{B as rotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Logger.js";import{fromRotationTranslationScaleOrigin as t,multiply as r,getScaling as o,scale as i,getTranslation as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{IDENTITY as a}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{
|
|
5
|
+
import e from"../../../core/Logger.js";import{fromRotationTranslationScaleOrigin as t,multiply as r,getScaling as o,scale as i,getTranslation as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{IDENTITY as a}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{a as l,i as c,j as f}from"../../../chunks/vec32.js";import{ZEROS as m,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import g from"../../Point.js";import{getSphericalPCPF as u}from"../../spatialReferenceEllipsoidUtils.js";import{projectPointToVector as x}from"../../projection/projectPointToVector.js";import{fromMatrix as j}from"../axisAngleDegrees.js";import v from"../MeshTransform.js";import{isMeshWithRelativeVertexSpace as h}from"../meshVertexSpaceUtils.js";import{performGlobalOperation as A}from"./geographicUtils.js";import{logProjectionError as b,loadProjectErrorMessage as R,projectToPCPF as d,projectNormalToPCPF as y,projectTangentToPCPF as w,projectFromPCPF as F,projectNormalFromPCPF as S,projectTangentFromPCPF as U}from"./projection.js";import{projectPointToVertexSpace as C}from"./vertexSpaceConversion.js";const k=()=>e.getLogger("esri.geometry.support.meshUtils.scale");function q(e,t,r){if(!e.vertexAttributes?.position)return;const{vertexSpace:o,spatialReference:i}=e,n=r?.origin??e.origin,s=r?.geographic,a=A(k,o,i,s);h(e)?z(e,t,n):a?L(e,t,n):M(e,t,n)}function z(e,s,f){e.transform??=new v;const{vertexSpace:u,transform:x,spatialReference:h}=e,[A,d,y]=u.origin,w=new g({x:A,y:d,z:y,spatialReference:h}),F=T;if(w.equals(f))l(F,0,0,0);else if(!C(F,f,e))return void b(k(),f.spatialReference,h,R);const S=l(V,s,s,s),U=t(D,a,m,S,F),{localMatrix:q}=x,z=r(D,U,q);x.scale=o(p(),z),i(z,z,c(T,x.scale));const L=x.rotationAxis;x.rotation=j(z),0===x.rotationAngle&&(x.rotationAxis=L),x.translation=n(p(),z)}function L(e,t,r){const o=e.spatialReference,i=u(o),n=E;if(!x(r,n,i)&&(b(k(),r.spatialReference,i,"Falling back to mesh origin"),!x(e.origin,n,i)))return void b(k(),e.origin.spatialReference,i);const s=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(s.length),f=null!=a?new Float32Array(a.length):null,m=null!=l?new Float32Array(l.length):null;d(s,o,c)&&(null==a||null==f||y(a,s,c,o,f))&&(null==l||null==m||w(l,s,c,o,m))?(P(c,t,n),F(c,s,o)&&(null==a||null==f||S(f,s,c,o,a))&&(null==l||null==m||U(m,s,c,o,l))?e.vertexAttributesChanged():b(k(),i,o)):b(k(),o,i)}function M(e,t,r){const o=E;if(!x(r,o,e.spatialReference)){const t=e.origin;return o[0]=t.x,o[1]=t.y,o[2]=t.z,void b(k(),r.spatialReference,e.spatialReference,R)}P(e.vertexAttributes.position,t,o),e.vertexAttributesChanged()}function P(e,t,r=m){if(e)for(let o=0;o<e.length;o+=3){for(let t=0;t<3;t++)T[t]=e[o+t]-r[t];f(T,T,t);for(let t=0;t<3;t++)e[o+t]=T[t]+r[t]}}const T=p(),V=p(),D=s(),E=p();export{q as scale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as t}from"../../core/mathUtils.js";import{c as n,e as r,f as o,n as c,
|
|
5
|
+
import{clamp as t}from"../../core/mathUtils.js";import{c as n,e as r,f as o,n as c,l as e,a as u,b as I,j as i,g as f}from"../../chunks/vec32.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as N,e as E}from"../../chunks/vec42.js";import{projectPointSignedLength as a}from"./vector.js";import{sv4d as T,sv3d as S}from"./vectorStacks.js";import{tangentFrame as _}from"../../views/3d/support/mathUtils.js";function M(t=$){return[t[0],t[1],t[2],t[3]]}const m=N,g=E;function D(t=$[0],n=$[1],r=$[2],o=$[3]){return U(t,n,r,o,T.get())}function O(t,n){return U(n[0],n[1],n[2],n[3],t)}function h(t){return t}function U(t,n,r,o,c=M()){return c[0]=t,c[1]=n,c[2]=r,c[3]=o,c}function l(t,r,o){return n(o,t),o[3]=r,o}function C(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],c=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function p(t,n,r,o=M()){const c=r[0]-n[0],e=r[1]-n[1],u=r[2]-n[2],I=t[0]-n[0],i=t[1]-n[1],f=t[2]-n[2],s=e*f-u*i,N=u*I-c*f,E=c*i-e*I,a=s*s+N*N+E*E,T=Math.abs(a-1)>1e-5&&a>1e-12?1/Math.sqrt(a):1;return o[0]=s*T,o[1]=N*T,o[2]=E*T,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function v(t,n,u,I=0,i=Math.floor(u*(1/3)),f=Math.floor(u*(2/3))){if(u<3)return!1;n(j,I);let s=i,N=!1;for(;s<u-1&&!N;)n(R,s),s++,N=!r(j,R);if(!N)return!1;for(s=Math.max(s,f),N=!1;s<u&&!N;)n(b,s),s++,o(X,j,R),c(X,X),o(d,R,b),c(d,d),N=!r(j,b)&&!r(R,b)&&Math.abs(e(X,d))<F;return N?(p(j,R,b,t),!0):(0!==I||1!==i||2!==f)&&v(t,n,u,0,1,2)}function A(t,n,r=!0){const o=n.length/3;return v(t,((t,r)=>u(t,n[3*r+0],n[3*r+1],n[3*r+2])),r?o-1:o)}const F=.99619469809,j=s(),R=s(),b=s(),X=s(),d=s();function y(t,n,r){return n!==t&&O(t,n),t[3]=-e(h(t),r),t}function L(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function P(t,n,r,o){return I(b,n,t),C(r,b,o)}function k(t,n,r,c){return Y(Z(t,n,o(S.get(),r,n),nt,c))}function x(t,n,r){return null!=n&&Y(Z(t,n.origin,n.direction,rt,r))}function q(t,n,r){return Y(Z(t,n.origin,n.vector,tt.NONE,r))}function w(t,n,r){return Y(Z(t,n.origin,n.vector,tt.CLAMP,r))}function z(t,n){return V(t,n)>=0}function B(t,n){const r=e(h(t),n.ray.direction),o=-V(t,n.ray.origin);if(o<0&&r>=0)return!1;if(r>-1e-6&&r<1e-6)return o>0;if((o<0||r<0)&&!(o<0&&r<0))return!0;const c=o/r;return r>0?c<n.c1&&(n.c1=c):c>n.c0&&(n.c0=c),n.c0<=n.c1}function G(t,n){const r=e(h(t),n.ray.direction),o=-V(t,n.ray.origin);if(r>-1e-6&&r<1e-6)return o>0;const c=o/r;return r>0?c<n.c1&&(n.c1=c):c>n.c0&&(n.c0=c),n.c0<=n.c1}function H(t,n,r){const c=i(S.get(),h(t),-t[3]),e=K(t,o(S.get(),n,c),S.get());return f(r,e,c),r}function J(t,n,r,c){const e=h(t),I=S.get(),i=S.get();_(e,I,i);const f=o(S.get(),r,n),s=a(I,f),N=a(i,f),E=a(e,f);return u(c,s,N,E)}function K(t,n,r){const c=i(S.get(),h(t),e(h(t),n));return o(r,n,c),r}function Q(t,n){return Math.abs(V(t,n))}function V(t,n){return e(h(t),n)+t[3]}var W;function Y(t){return t===W.INTERSECTS_INSIDE_OUT||t===W.INTERSECTS_OUTSIDE_IN}function Z(n,r,o,c,u){const I=e(h(n),o),s=V(n,r);if(0===I)return s>=0?W.INSIDE:W.OUTSIDE;let N=-s/I;return c&tt.CLAMP&&(N=t(N,0,1)),!(c&tt.INFINITE_MIN)&&N<0||!(c&tt.INFINITE_MAX)&&N>1?s>=0?W.INSIDE:W.OUTSIDE:(f(u,r,i(u,o,N)),s>=0?W.INTERSECTS_INSIDE_OUT:W.INTERSECTS_OUTSIDE_IN)}!function(t){t[t.INTERSECTS_INSIDE_OUT=0]="INTERSECTS_INSIDE_OUT",t[t.INTERSECTS_OUTSIDE_IN=1]="INTERSECTS_OUTSIDE_IN",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE"}(W||(W={}));const $=[0,0,1,0];var tt;!function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"}(tt||(tt={}));const nt=tt.INFINITE_MIN|tt.INFINITE_MAX,rt=tt.INFINITE_MAX;export{tt as IntersectFlags,W as IntersectResult,B as clip,G as clipInfinite,O as copy,M as create,Q as distance,g as equals,m as exactEquals,A as fromArray,v as fromManyPoints,l as fromNormalAndOffset,p as fromPoints,C as fromPositionAndNormal,U as fromValues,P as fromVectorsAndPoint,h as getNormal,k as intersectLine,Z as intersectLineOrRay,q as intersectLineSegment,w as intersectLineSegmentClamp,x as intersectRay,z as isPointInside,L as negate,H as projectPoint,J as projectPointLocal,K as projectVector,y as setOffsetFromPoint,V as signedDistance,$ as up,D as wrap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as r}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerVerticalUnitForSR as o}from"../../core/unitUtils.js";import{s}from"../../chunks/vec32.js";import{Axis as a}from"./Axis.js";import{create as i,getNormal as n,fromManyPoints as m}from"./plane.js";function c(t,o,s){const i=e(f,t,o,s)?n(f):[0,0,1];return Math.abs(i[2])>Math.cos(r(80))?a.Z:Math.abs(i[1])>Math.abs(i[0])?a.Y:a.X}function e(r,a,i,n){const c=(r=>!Array.isArray(r[0]))(a)?(r,t)=>a[3*r+t]:(r,t)=>a[r][t],e=n?t(n)/o(n):1;return m(r,((r,t)=>s(r,c(t,0)*e,c(t,1)*e,c(t,2))),i)}const f=i();export{e as fitPlane,c as leastSignificantAxis};
|
|
5
|
+
import{deg2rad as r}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerVerticalUnitForSR as o}from"../../core/unitUtils.js";import{a as s}from"../../chunks/vec32.js";import{Axis as a}from"./Axis.js";import{create as i,getNormal as n,fromManyPoints as m}from"./plane.js";function c(t,o,s){const i=e(f,t,o,s)?n(f):[0,0,1];return Math.abs(i[2])>Math.cos(r(80))?a.Z:Math.abs(i[1])>Math.abs(i[0])?a.Y:a.X}function e(r,a,i,n){const c=(r=>!Array.isArray(r[0]))(a)?(r,t)=>a[3*r+t]:(r,t)=>a[r][t],e=n?t(n)/o(n):1;return m(r,((r,t)=>s(r,c(t,0)*e,c(t,1)*e,c(t,2))),i)}const f=i();export{e as fitPlane,c as leastSignificantAxis};
|
package/geometry/support/ray.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/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{equals as i}from"../../core/arrayUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{c as n,f as o,b as t,n as c,
|
|
5
|
+
import{equals as i}from"../../core/arrayUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{c as n,f as o,b as t,n as c,l as e,g as s,j as u,z as g}from"../../chunks/vec32.js";import{clone as a,create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as d}from"./vectorStacks.js";function m(i){return i?j(a(i.origin),a(i.direction)):j(f(),f())}function j(i,r){return{origin:i,direction:r}}function p(r,n){return i(r.origin,n.origin)&&i(r.direction,n.direction)}function l(i,r){const n=q.get();return n.origin=i,n.direction=r,n}function b(i,r=m()){return v(i.origin,i.direction,r)}function k(i,r,t=m()){return n(t.origin,i),o(t.direction,r,i),t}function v(i,r,o=m()){return n(o.origin,i),n(o.direction,r),o}function x(i,r){const n=t(d.get(),c(d.get(),i.direction),o(d.get(),r,i.origin));return e(n,n)}function S(i,r,n){const t=e(i.direction,o(n,r,i.origin));return s(n,i.origin,u(n,i.direction,t)),n}function h(i,r,n,o){const t=i.direction,c=r.direction,a=g(w,r.origin,i.origin),f=e(t,c),d=e(c,a),m=e(t,a),j=e(t,t),p=e(c,c),l=(f*d+m*p)/(j*p-f*f),b=(f*m-d*j)/(j*p-f*f);return s(n,i.origin,u(w,t,l)),s(o,r.origin,u(w,c,b)),[n,o]}const q=new r((()=>m())),w=f();export{S as closestPoint,h as closestPoints,b as copy,m as create,x as distance2,p as equals,k as fromPoints,v as fromValues,l as wrap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,D as altitudeAt,B as angleToSilhouette,C as axisAt,b as cameraFrustumCoverage,r as clear,A as closestPoint,j as closestPointOnSilhouette,o as containsPoint,d as copy,c as create,e as distanceToSilhouette,v as elevate,q as equals,m as exactEquals,l as fromCenterAndRadius,a as fromRadius,f as fromValues,g as getCenter,y as getExtent,h as getRadius,n as intersectLine,i as intersectRay,z as intersectRayClosestSilhouette,k as intersectsRay,p as projectPoint,E as setAltitudeAt,x as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";
|
|
5
|
+
import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./sphereUtils.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,D as altitudeAt,B as angleToSilhouette,C as axisAt,b as cameraFrustumCoverage,r as clear,A as closestPoint,j as closestPointOnSilhouette,o as containsPoint,d as copy,c as create,e as distanceToSilhouette,v as elevate,q as equals,m as exactEquals,l as fromCenterAndRadius,a as fromRadius,f as fromValues,g as getCenter,y as getExtent,h as getRadius,n as intersectLine,i as intersectRay,z as intersectRayClosestSilhouette,k as intersectsRay,p as projectPoint,E as setAltitudeAt,x as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{asinClamped as t}from"../../core/mathUtils.js";import{m as o,a as s}from"../../chunks/vec32.js";function a(a,n){const c=o(a),r=t(a[2]/c),h=Math.atan2(a[1]/c,a[0]/c);return s(n,c,r,h),n}function n(t,o){const a=t[0],n=t[1],c=t[2],r=Math.cos(n);s(o,a*r*Math.cos(c),a*r*Math.sin(c),a*Math.sin(n))}export{a as cartesianToSpherical,n as sphericalToCartesian};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ObjectStack as t}from"../../core/ObjectStack.js";import{c as e,f as n,b as r,
|
|
5
|
+
import{ObjectStack as t}from"../../core/ObjectStack.js";import{c as e,f as n,b as r,l as o,j as c,g as s,m as p}from"../../chunks/vec32.js";import{clone as i,create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f,distance2 as u,fromValues as g}from"./lineSegment.js";import{sv3d as m}from"./vectorStacks.js";function j(t){return t?{p0:i(t.p0),p1:i(t.p1),p2:i(t.p2)}:{p0:a(),p1:a(),p2:a()}}function l(t,e,n){const r=x.get();return r.p0=t,r.p1=e,r.p2=n,r}function b(t,e=j()){return h(t.p0,t.p1,t.p2,e)}function h(t,n,r,o=j()){return e(o.p0,t),e(o.p1,n),e(o.p2,r),o}function k(t,e){const c=t.p0,s=t.p1,p=t.p2,i=n(m.get(),s,c),a=n(m.get(),p,s),f=n(m.get(),c,p),j=n(m.get(),e,c),l=n(m.get(),e,s),b=n(m.get(),e,p),h=r(i,i,f),k=o(r(m.get(),i,h),j),v=o(r(m.get(),a,h),l),S=o(r(m.get(),f,h),b);if(k>0&&v>0&&S>0){const t=o(h,j);return t*t/o(h,h)}const d=u(g(c,i,w.get()),e),x=u(g(s,a,w.get()),e),M=u(g(p,f,w.get()),e);return Math.min(d,x,M)}function v(t,e,n){const r=1e-5,{direction:o,origin:p}=e,{p0:i,p1:a,p2:f}=t,u=a[0]-i[0],g=a[1]-i[1],m=a[2]-i[2],j=f[0]-i[0],l=f[1]-i[1],b=f[2]-i[2],h=o[1]*b-l*o[2],k=o[2]*j-b*o[0],v=o[0]*l-j*o[1],S=u*h+g*k+m*v;if(S>-r&&S<r)return!1;const d=1/S,w=p[0]-i[0],x=p[1]-i[1],M=p[2]-i[2],O=d*(w*h+x*k+M*v);if(O<0||O>1)return!1;const V=x*m-g*M,q=M*u-m*w,y=w*g-u*x,z=d*(o[0]*V+o[1]*q+o[2]*y);if(z<0||O+z>1)return!1;if(n){c(n,o,d*(j*V+l*q+b*y)),s(n,p,n)}return!0}function S(t,e,n){const r=e[0]-t[0],o=e[1]-t[1],c=n[0]-t[0],s=n[1]-t[1];return.5*Math.abs(r*s-o*c)}function d(t,e,o){return n(M,e,t),n(O,o,t),.5*p(r(M,M,O))}const w=new t(f),x=new t((()=>j())),M=a(),O=a();export{S as areaPoints2d,d as areaPoints3d,b as copy,j as create,k as distance2,h as fromValues,v as intersectRay,l as wrap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{acosClamped as t}from"../../core/mathUtils.js";import{
|
|
5
|
+
import{acosClamped as t}from"../../core/mathUtils.js";import{l as r,j as n,m as o,n as s,b as c}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";function e(t,o,s){const c=r(t,o)/r(t,t);return n(s,t,c)}function a(t,n){return r(t,n)/o(t)}function f(n,s){const c=r(n,s)/(o(n)*o(s));return-t(c)}function m(n,o,i){s(u,n),s(j,o);const e=r(u,j),a=t(e),f=c(u,u,j);return r(f,i)<0?2*Math.PI-a:a}const u=i(),j=i();export{f as angle,m as angleAroundAxis,e as projectPoint,a as projectPointSignedLength};
|
package/interfaces.d.ts
CHANGED
|
@@ -106701,7 +106701,7 @@ declare namespace __esri {
|
|
|
106701
106701
|
*
|
|
106702
106702
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#maxSize)
|
|
106703
106703
|
*/
|
|
106704
|
-
|
|
106704
|
+
maxSize: number;
|
|
106705
106705
|
/**
|
|
106706
106706
|
* Set this object to customize the feature table's menu content.
|
|
106707
106707
|
*
|
|
@@ -106881,11 +106881,11 @@ declare namespace __esri {
|
|
|
106881
106881
|
*/
|
|
106882
106882
|
deleteSelection(showWarningPrompt?: boolean): Promise<void>;
|
|
106883
106883
|
/**
|
|
106884
|
-
*
|
|
106884
|
+
* Exports features associated with currently selected rows to a CSV file and displays a download prompt.
|
|
106885
106885
|
*
|
|
106886
106886
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#exportSelectionToCSV)
|
|
106887
106887
|
*/
|
|
106888
|
-
exportSelectionToCSV(): void
|
|
106888
|
+
exportSelectionToCSV(includeGeometry?: boolean): Promise<void>;
|
|
106889
106889
|
/**
|
|
106890
106890
|
* Filters the table by the current selection.
|
|
106891
106891
|
*
|
|
@@ -107106,6 +107106,12 @@ declare namespace __esri {
|
|
|
107106
107106
|
| (KnowledgeGraphSublayerProperties & { type: "knowledge-graph-sublayer" })
|
|
107107
107107
|
| (SceneLayerProperties & { type: "scene" })
|
|
107108
107108
|
| (WFSLayerProperties & { type: "wfs" });
|
|
107109
|
+
/**
|
|
107110
|
+
* Applies a limit to the total number of features displayed in the table.
|
|
107111
|
+
*
|
|
107112
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#maxSize)
|
|
107113
|
+
*/
|
|
107114
|
+
maxSize?: number;
|
|
107109
107115
|
/**
|
|
107110
107116
|
* Set this object to customize the feature table's menu content.
|
|
107111
107117
|
*
|
|
@@ -107488,7 +107494,7 @@ declare namespace __esri {
|
|
|
107488
107494
|
*
|
|
107489
107495
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#maxSize)
|
|
107490
107496
|
*/
|
|
107491
|
-
|
|
107497
|
+
maxSize: number;
|
|
107492
107498
|
/**
|
|
107493
107499
|
* Controls whether the table allows multiple selected rows.
|
|
107494
107500
|
*
|
|
@@ -107528,7 +107534,7 @@ declare namespace __esri {
|
|
|
107528
107534
|
*
|
|
107529
107535
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#pageIndex)
|
|
107530
107536
|
*/
|
|
107531
|
-
|
|
107537
|
+
pageIndex: number;
|
|
107532
107538
|
/**
|
|
107533
107539
|
* The default page size used when displaying features within the table.
|
|
107534
107540
|
*
|
|
@@ -107642,7 +107648,13 @@ declare namespace __esri {
|
|
|
107642
107648
|
*
|
|
107643
107649
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#deleteSelection)
|
|
107644
107650
|
*/
|
|
107645
|
-
deleteSelection(
|
|
107651
|
+
deleteSelection(): Promise<void>;
|
|
107652
|
+
/**
|
|
107653
|
+
* Exports features associated with currently selected rows to a CSV file and displays a download prompt.
|
|
107654
|
+
*
|
|
107655
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#exportSelectionToCSV)
|
|
107656
|
+
*/
|
|
107657
|
+
exportSelectionToCSV(includeGeometry?: boolean): Promise<void>;
|
|
107646
107658
|
/**
|
|
107647
107659
|
* Filters the table using the current row selection and displays only those selected table rows.
|
|
107648
107660
|
*
|
|
@@ -107830,6 +107842,12 @@ declare namespace __esri {
|
|
|
107830
107842
|
| (KnowledgeGraphSublayerProperties & { type: "knowledge-graph-sublayer" })
|
|
107831
107843
|
| (SceneLayerProperties & { type: "scene" })
|
|
107832
107844
|
| (WFSLayerProperties & { type: "wfs" });
|
|
107845
|
+
/**
|
|
107846
|
+
* Applies a limit to the total number of features displayed in the table.
|
|
107847
|
+
*
|
|
107848
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#maxSize)
|
|
107849
|
+
*/
|
|
107850
|
+
maxSize?: number;
|
|
107833
107851
|
/**
|
|
107834
107852
|
* Controls whether the table allows multiple selected rows.
|
|
107835
107853
|
*
|
|
@@ -107858,6 +107876,12 @@ declare namespace __esri {
|
|
|
107858
107876
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#outFields)
|
|
107859
107877
|
*/
|
|
107860
107878
|
outFields?: string[];
|
|
107879
|
+
/**
|
|
107880
|
+
* Represents the index of the page of feature currently being displayed.
|
|
107881
|
+
*
|
|
107882
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#pageIndex)
|
|
107883
|
+
*/
|
|
107884
|
+
pageIndex?: number;
|
|
107861
107885
|
/**
|
|
107862
107886
|
* The default page size used when displaying features within the table.
|
|
107863
107887
|
*
|
|
@@ -110371,6 +110395,16 @@ declare namespace __esri {
|
|
|
110371
110395
|
view?: (MapViewProperties & { type: "2d" }) | (SceneViewProperties & { type: "3d" });
|
|
110372
110396
|
}
|
|
110373
110397
|
|
|
110398
|
+
export interface GridControlsGridControlsViewModel extends Accessor, Evented {
|
|
110399
|
+
}
|
|
110400
|
+
|
|
110401
|
+
export class GridControlsGridControlsViewModel {
|
|
110402
|
+
constructor(properties?: GridControlsGridControlsViewModelProperties);
|
|
110403
|
+
}
|
|
110404
|
+
|
|
110405
|
+
interface GridControlsGridControlsViewModelProperties {
|
|
110406
|
+
}
|
|
110407
|
+
|
|
110374
110408
|
export class Histogram extends Widget {
|
|
110375
110409
|
/**
|
|
110376
110410
|
* The statistical average of the data in the histogram.
|
|
@@ -115026,7 +115060,7 @@ declare namespace __esri {
|
|
|
115026
115060
|
*
|
|
115027
115061
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#exportedLinks)
|
|
115028
115062
|
*/
|
|
115029
|
-
|
|
115063
|
+
exportedLinks: Collection<FileLink>;
|
|
115030
115064
|
/**
|
|
115031
115065
|
* This option allows passing extra parameters (in addition to [templateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions)) to the print (export webmap) requests.
|
|
115032
115066
|
*
|
|
@@ -115120,6 +115154,12 @@ declare namespace __esri {
|
|
|
115120
115154
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#allowedLayouts)
|
|
115121
115155
|
*/
|
|
115122
115156
|
allowedLayouts?: string | string[];
|
|
115157
|
+
/**
|
|
115158
|
+
* The collection of links exported from the Print widget.
|
|
115159
|
+
*
|
|
115160
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#exportedLinks)
|
|
115161
|
+
*/
|
|
115162
|
+
exportedLinks?: CollectionProperties<FileLink>;
|
|
115123
115163
|
/**
|
|
115124
115164
|
* This option allows passing extra parameters (in addition to [templateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions)) to the print (export webmap) requests.
|
|
115125
115165
|
*
|
|
@@ -115308,8 +115348,6 @@ declare namespace __esri {
|
|
|
115308
115348
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#includeDefaultTemplates)
|
|
115309
115349
|
*/
|
|
115310
115350
|
includeDefaultTemplates: boolean;
|
|
115311
|
-
readonly layoutTemplateInfo: any;
|
|
115312
|
-
readonly layoutTemplateNorthArrowInfo: any;
|
|
115313
115351
|
/**
|
|
115314
115352
|
* It is possible to search a specified portal instance's [locator services](https://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm).
|
|
115315
115353
|
*
|
|
@@ -122807,6 +122845,27 @@ declare namespace __esri {
|
|
|
122807
122845
|
goToOverride?: GoToOverride;
|
|
122808
122846
|
}
|
|
122809
122847
|
|
|
122848
|
+
interface GridControls {
|
|
122849
|
+
}
|
|
122850
|
+
|
|
122851
|
+
export const GridControls: GridControls;
|
|
122852
|
+
|
|
122853
|
+
/**
|
|
122854
|
+
* Provides the logic for the GridControls widget and map component.
|
|
122855
|
+
*
|
|
122856
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GridControls-GridControlsViewModel.html)
|
|
122857
|
+
*/
|
|
122858
|
+
interface GridControlsViewModel {
|
|
122859
|
+
/**
|
|
122860
|
+
* The view from which the widget will operate.
|
|
122861
|
+
*
|
|
122862
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GridControls-GridControlsViewModel.html#view)
|
|
122863
|
+
*/
|
|
122864
|
+
view: MapView;
|
|
122865
|
+
}
|
|
122866
|
+
|
|
122867
|
+
export const GridControlsViewModel: GridControlsViewModel;
|
|
122868
|
+
|
|
122810
122869
|
export class SnappingControls extends Widget {
|
|
122811
122870
|
/**
|
|
122812
122871
|
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-interactive-snapping-SnappingOptions.html) for sketching.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as o}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import{MultiOriginJSONMixin as e}from"../core/MultiOriginJSONSupport.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import p from"./Layer.js";import{OperationalLayer as i}from"./mixins/OperationalLayer.js";let a=class extends(i(e(p))){constructor(o){super(o),this.type="focusArea",this.operationalLayerType="FocusAreaLayer",this.geometries=new r}initialize(){}};o([t({json:{read:!1},readOnly:!0})],a.prototype,"type",void 0),o([t({type:["FocusAreaLayer"]})],a.prototype,"operationalLayerType",void 0),o([t()],a.prototype,"geometries",void 0),o([t()],a.prototype,"tmpEffect",void 0),o([t({type:["show","hide"]})],a.prototype,"listMode",void 0),a=o([s("esri.layers.FocusAreaLayer")],a);const c=a;export{c as default};
|
package/layers/VoxelLayer.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/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import i from"../core/Collection.js";import o from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as n}from"../core/promiseUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as a}from"../core/accessorSupport/ensureType.js";import"../core/RandomLCG.js";import"../core/has.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{n as m}from"../chunks/vec32.js";import{fromValues as c}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import y from"../geometry/Extent.js";import d from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as g}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{SceneService as V}from"./mixins/SceneService.js";import{sanitizeUrl as x}from"./support/arcgisLayerUrl.js";import{legendEnabled as j,url as w}from"./support/commonProperties.js";import I from"./support/Field.js";import T from"./support/TimeInfo.js";import D from"./voxel/VoxelSection.js";import L from"./voxel/VoxelSimpleShading.js";import F from"./voxel/VoxelVariable.js";import N from"./voxel/VoxelVariableStyle.js";import P from"./voxel/VoxelVolume.js";import E from"./voxel/VoxelVolumeIndex.js";import O from"./voxel/VoxelVolumeStyle.js";import{createPopupTemplate as A}from"../support/popupUtils.js";import R from"../time/TimeExtent.js";import M from"../time/TimeInterval.js";let z=class extends(V(v(b(g(S(s(h(f(d))))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new L,this.opacity=1,this.variables=new i,this.volumes=new i,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(i.ofType(O)),this.variableStyles=new(i.ofType(N)),this.sections=new(i.ofType(D))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",x(e,r.getLogger(this)))}load(e){const t=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(n).then((()=>this._fetchService(t))).then((()=>this.serviceRoot=this.url));return this.addResolvingPromise(i),Promise.resolve(this)}read(e,t){super.read(e,t);for(const i of this.volumes)i.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new o("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,i){if(null!=e&&"object"==typeof e){const o=y.fromJSON(e,i);if(0===o.zmin&&0===o.zmax&&Array.isArray(t.volumes)){const e=P.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,i=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>i){const t=e;e=i,i=t}o.zmin=e,o.zmax=i}}}return o}return null}get voxelFields(){const e=[new I({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new I({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new I({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],t=this.getVolume(null);if(null!=t){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new I({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});e.push(t);const i=new I({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});e.push(i)}if("xyt"!==t.volumeType){const t=new I({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});e.push(t)}}return e}get popupTemplate(){return this.loaded?this.createPopupTemplate():null}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.voxelFields,i=this.title;return A({fields:t,title:i},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;t=null!=e?e:this.currentVariableId;if(!this.variableStyles||-1===t)return null;const i=this.variableStyles.findIndex((e=>e.variableId===t));return i<0?null:this.variableStyles.at(i)}getVariable(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variables||-1===t)return null;const i=this.variables.findIndex((e=>e.id===t));return i<0?null:this.variables.at(i)}getVolume(e){const t=this.getVariable(e);return null!=t?this.volumes.find((({id:e})=>e===t.volumeId)):null}get timeInfo(){const e=this.getVolume(null);if("xyzt"!==e?.volumeType)return null;const t=e.timeStops;if(!t?.length)return null;const i=new R({start:t[0],end:t.at(-1)});return new T({fullTimeExtent:i,stops:t})}getVolumeStyle(e){const t=this.getVariable(e);return null!=t?this.volumeStyles.find((({volumeId:e})=>e===t.volumeId)):null}getColorForContinuousDataValue(e,t,i){const o=this.getVariable(e);if(null==o||"continuous"!==o.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const r=this.variableStyles.findIndex((t=>t.variableId===e));if(r<0)return null;const s=this.variableStyles.at(r);return s?.transferFunction?s.transferFunction.getColorForContinuousDataValue(t,i):null}getSections(){const e=[];for(const t of this.sections)e.push(new D({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const i=this._getVariable(t);if(null!=i){const o=t.clone();o.isosurfaces.length>4&&(o.isosurfaces=o.isosurfaces.slice(0,3),r.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of o.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(o.variableId,e.value,!1);null===t||t.equals(e.color)||(e.color=t)}if("continuous"===i.renderingFormat.continuity)(null===o.transferFunction||o.transferFunction.colorStops.length<2)&&r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==o.transferFunction&&(Array.isArray(o.transferFunction.stretchRange)&&2===o.transferFunction.stretchRange.length||(r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),o.transferFunction.stretchRange=[0,1],o.transferFunction.colorStops.removeAll()));else if("discrete"===i.renderingFormat.continuity)if(0===t.uniqueValues.length)r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(o)}else r.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const i=this._getVolumeFromVolumeId(t.volumeId);if(null!=i){const o=t.clone();for(const e of o.slices)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of o.dynamicSections)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label="invalid");e.push(o)}else r.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const i of this.variables)if(i.id===t)return i;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,i){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;const o=c(e.normal[0],e.normal[1],e.normal[2]);m(o,o);const r=1e-6;return!(Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])<r)&&(e.normal[0]=o[0],e.normal[1]=o[1],e.normal[2]=o[2],!0)}};e([l({type:["Voxel"]})],z.prototype,"operationalLayerType",void 0),e([l(j)],z.prototype,"legendEnabled",void 0),e([l({json:{write:!0}})],z.prototype,"title",void 0),e([l(w)],z.prototype,"url",null),e([l({type:i.ofType(D),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],z.prototype,"sections",void 0),e([l({type:a,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],z.prototype,"currentVariableId",void 0),e([l({type:i.ofType(O),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],z.prototype,"volumeStyles",void 0),e([l({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],z.prototype,"renderMode",void 0),e([l({type:i.ofType(N),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],z.prototype,"variableStyles",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],z.prototype,"enableSlices",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],z.prototype,"enableSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],z.prototype,"enableDynamicSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],z.prototype,"enableIsosurfaces",void 0),e([l({type:L,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],z.prototype,"shading",void 0),e([l({type:["show","hide"]})],z.prototype,"listMode",void 0),e([l({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],z.prototype,"opacity",void 0),e([l({type:i.ofType(F)})],z.prototype,"variables",void 0),e([l({type:i.ofType(P)})],z.prototype,"volumes",void 0),e([l({type:E})],z.prototype,"index",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,"maxScale",void 0),e([l({json:{read:!1},readOnly:!0})],z.prototype,"type",void 0),e([l({readOnly:!0,json:{name:"serviceVersion"}})],z.prototype,"version",void 0),e([u("service","version")],z.prototype,"readVersion",null),e([l({type:y})],z.prototype,"fullExtent",void 0),e([u("service","fullExtent",["fullExtent"])],z.prototype,"readFullExtent",null),e([l({readOnly:!0,clonable:!1,json:{read:!1}})],z.prototype,"voxelFields",null),e([l({type:Boolean,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,i){t[i]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],z.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:!1}})],z.prototype,"popupTemplate",null),e([l({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),e([l({type:T,readOnly:!0,json:{read:!1}})],z.prototype,"timeInfo",null),e([l({type:R,json:{read:!1}})],z.prototype,"timeExtent",void 0),e([l({type:M,json:{read:!1}})],z.prototype,"timeOffset",void 0),e([l({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],z.prototype,"useViewTime",void 0),z=e([p("esri.layers.VoxelLayer")],z);const C=z;export{C as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import o from"../core/Collection.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as a}from"../core/accessorSupport/ensureType.js";import"../core/RandomLCG.js";import"../core/has.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{n as m}from"../chunks/vec32.js";import{fromValues as c}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../geometry/Extent.js";import y from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as g}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{sanitizeUrl as V}from"./support/arcgisLayerUrl.js";import{legendEnabled as j,url as w}from"./support/commonProperties.js";import I from"./support/Field.js";import T from"./support/FieldsIndex.js";import F from"./support/TimeInfo.js";import D from"./voxel/VoxelSection.js";import L from"./voxel/VoxelSimpleShading.js";import N from"./voxel/VoxelVariable.js";import P from"./voxel/VoxelVariableStyle.js";import O from"./voxel/VoxelVolume.js";import E from"./voxel/VoxelVolumeIndex.js";import A from"./voxel/VoxelVolumeStyle.js";import{createPopupTemplate as R}from"../support/popupUtils.js";import C from"../time/TimeExtent.js";import M from"../time/TimeInterval.js";let z=class extends(S(v(b(g(x(n(h(f(y))))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new L,this.opacity=1,this.variables=new o,this.volumes=new o,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(o.ofType(A)),this.variableStyles=new(o.ofType(P)),this.sections=new(o.ofType(D))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",V(e,r.getLogger(this)))}load(e){const t=null!=e?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(s).then((()=>this._fetchService(t))).then((()=>this.serviceRoot=this.url));return this.addResolvingPromise(o),Promise.resolve(this)}read(e,t){super.read(e,t);for(const o of this.volumes)o.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new i("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,o){if(null!=e&&"object"==typeof e){const i=d.fromJSON(e,o);if(0===i.zmin&&0===i.zmax&&Array.isArray(t.volumes)){const e=O.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,o=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>o){const t=e;e=o,o=t}i.zmin=e,i.zmax=o}}}return i}return null}get voxelFields(){const e=[new I({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new I({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const o of this.variables){const t=new I({name:o.name,alias:o.description,domain:null,editable:!1,length:128,type:"discrete"===o.renderingFormat.continuity?"string":"double"});e.push(t)}const t=this.getVolume(null);if(null!=t){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new I({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"string"});e.push(t);const o=new I({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(o)}if("xyt"!==t.volumeType){const t=new I({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});e.push(t)}}return e}get fieldsIndex(){return this.loaded?new T(this.voxelFields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.voxelFields;return R({fields:t,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;t=null!=e?e:this.currentVariableId;if(!this.variableStyles||-1===t)return null;const o=this.variableStyles.findIndex((e=>e.variableId===t));return o<0?null:this.variableStyles.at(o)}getVariable(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variables||-1===t)return null;const o=this.variables.findIndex((e=>e.id===t));return o<0?null:this.variables.at(o)}getVolume(e){const t=this.getVariable(e);return null!=t?this.volumes.find((({id:e})=>e===t.volumeId)):null}get timeInfo(){const e=this.getVolume(null);if("xyzt"!==e?.volumeType)return null;const t=e.timeStops;if(!t?.length)return null;const o=new C({start:t[0],end:t.at(-1)});return new F({fullTimeExtent:o,stops:t})}getVolumeStyle(e){const t=this.getVariable(e);return null!=t?this.volumeStyles.find((({volumeId:e})=>e===t.volumeId)):null}getColorForContinuousDataValue(e,t,o){const i=this.getVariable(e);if(null==i||"continuous"!==i.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const r=this.variableStyles.findIndex((t=>t.variableId===e));if(r<0)return null;const n=this.variableStyles.at(r);return n?.transferFunction?n.transferFunction.getColorForContinuousDataValue(t,o):null}getSections(){const e=[];for(const t of this.sections)e.push(new D({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const o=this._getVariable(t);if(null!=o){const i=t.clone();i.isosurfaces.length>4&&(i.isosurfaces=i.isosurfaces.slice(0,3),r.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of i.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(i.variableId,e.value,!1);null===t||t.equals(e.color)||(e.color=t)}if("continuous"===o.renderingFormat.continuity)(null===i.transferFunction||i.transferFunction.colorStops.length<2)&&r.getLogger(this).error(`VoxelVariableStyle for variable ${o.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==i.transferFunction&&(Array.isArray(i.transferFunction.stretchRange)&&2===i.transferFunction.stretchRange.length||(r.getLogger(this).error(`VoxelVariableStyle for variable ${o.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),i.transferFunction.stretchRange=[0,1],i.transferFunction.colorStops.removeAll()));else if("discrete"===o.renderingFormat.continuity)if(0===t.uniqueValues.length)r.getLogger(this).error(`VoxelVariableStyle for variable ${o.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(i)}else r.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const o=this._getVolumeFromVolumeId(t.volumeId);if(null!=o){const i=t.clone();for(const e of i.slices)this._isPlaneValid(e,[0,1,o.zDimension],o.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of i.dynamicSections)this._isPlaneValid(e,[0,1,o.zDimension],o.dimensions)||(e.enabled=!1,e.label="invalid");e.push(i)}else r.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const o of this.variables)if(o.id===t)return o;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,o){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;const i=c(e.normal[0],e.normal[1],e.normal[2]);m(i,i);const r=1e-6;return!(Math.abs(i[0])+Math.abs(i[1])+Math.abs(i[2])<r)&&(e.normal[0]=i[0],e.normal[1]=i[1],e.normal[2]=i[2],!0)}};e([l({type:["Voxel"]})],z.prototype,"operationalLayerType",void 0),e([l(j)],z.prototype,"legendEnabled",void 0),e([l({json:{write:!0}})],z.prototype,"title",void 0),e([l(w)],z.prototype,"url",null),e([l({type:o.ofType(D),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],z.prototype,"sections",void 0),e([l({type:a,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],z.prototype,"currentVariableId",void 0),e([l({type:o.ofType(A),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],z.prototype,"volumeStyles",void 0),e([l({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],z.prototype,"renderMode",void 0),e([l({type:o.ofType(P),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],z.prototype,"variableStyles",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],z.prototype,"enableSlices",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],z.prototype,"enableSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],z.prototype,"enableDynamicSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],z.prototype,"enableIsosurfaces",void 0),e([l({type:L,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],z.prototype,"shading",void 0),e([l({type:["show","hide"]})],z.prototype,"listMode",void 0),e([l({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],z.prototype,"opacity",void 0),e([l({type:o.ofType(N)})],z.prototype,"variables",void 0),e([l({type:o.ofType(O)})],z.prototype,"volumes",void 0),e([l({type:E})],z.prototype,"index",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,"maxScale",void 0),e([l({json:{read:!1},readOnly:!0})],z.prototype,"type",void 0),e([l({readOnly:!0,json:{name:"serviceVersion"}})],z.prototype,"version",void 0),e([u("service","version")],z.prototype,"readVersion",null),e([l({type:d})],z.prototype,"fullExtent",void 0),e([u("service","fullExtent",["fullExtent"])],z.prototype,"readFullExtent",null),e([l({readOnly:!0,clonable:!1,json:{read:!1}})],z.prototype,"voxelFields",null),e([l({readOnly:!0})],z.prototype,"fieldsIndex",null),e([l({type:Boolean,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,o){t[o]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],z.prototype,"popupEnabled",void 0),e([l({type:t,json:{name:"popupInfo"}})],z.prototype,"popupTemplate",void 0),e([l({readOnly:!0,json:{read:!1}})],z.prototype,"defaultPopupTemplate",null),e([l({type:F,readOnly:!0,json:{read:!1}})],z.prototype,"timeInfo",null),e([l({type:C,json:{read:!1}})],z.prototype,"timeExtent",void 0),e([l({type:M,json:{read:!1}})],z.prototype,"timeOffset",void 0),e([l({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],z.prototype,"useViewTime",void 0),z=e([p("esri.layers.VoxelLayer")],z);const _=z;export{_ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import s from"../request.js";import has from"../core/has.js";import r from"../core/Logger.js";import{isAbortError as i}from"../core/promiseUtils.js";import{watch as a,initial as n}from"../core/reactiveUtils.js";import{convertTime as o}from"../core/timeUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{p as d}from"../chunks/vec32.js";import{create as u}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as _}from"../geometry/support/coordinateSystem.js";import{PointIndex as c,PlaneIndex as m}from"../geometry/support/frustum.js";import{WasmCullMode as g,VoxelRequestType as f,UpdateFlags as p,ContainerType as x}from"../libs/vxl/enums.js";import{loadVoxelWASM as y}from"../libs/vxl/VxlModule.js";import{ViewingMode as v}from"../views/ViewingMode.js";import{VoxelTarget as b}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as w}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as T}from"../views/3d/support/RenderCoordsHelper.js";import{SyncRenderPlugin as R}from"../views/3d/webgl-engine/effects/RenderPlugin.js";import{newIntersectorResult as L}from"../views/3d/webgl-engine/lib/Intersector.js";import{IntersectorType as V,StoreResults as E}from"../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{RenderFeature as C}from"../views/3d/webgl-engine/lib/RenderFeature.js";import{RenderSlot as F}from"../views/3d/webgl-engine/lib/RenderSlot.js";import{CompareFunction as S,Face as P,StencilOperation as I}from"../views/webgl/enums.js";var U;!function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"}(U||(U={}));let k=class extends R{constructor(e){super(e),this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.produces=new Map([[F.VOXEL,()=>!!this._vxl&&"local"===this.view.viewingMode]]),this.type=V.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===U.Error?r.getLogger(this).error(t):r.getLogger(this).warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this.view._stage&&(this._dbg(U.Lifetime,"--removeRenderPlugin--"),this.view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}initialize(){this._dbg(U.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([a((()=>this.view.ready),(e=>{e&&"local"===this.view.viewingMode?(this._dbg(U.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this.view._stage.addRenderPlugin(this),this._pluginIsActive=!0):(this._dbg(U.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())}),n),a((()=>this.view?.qualityProfile),(e=>{this._dbg(U.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))}),n),a((()=>this.view?.timeExtent),(()=>{if(this._vxl){const e=this._getTimeArgs(this.view?.timeExtent);this._dbg(U.Rendering,"sceneView timeExtent changed to useTime="+e.hasTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this._renderPluginContext.requestRender()}}),n),a((()=>this.view?.stationary),(e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()}))])}initializeRenderContext(e){this._dbg(U.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(U.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(U.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const s=!!this._rctx,r=!!this._renderTargetToRestore;if(!s||!r)return 0;const i=this._renderTargetToRestore.fbo.depthStencilTexture;return i?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(i,e,!0),1):(this._dbg(U.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,s){if(!this._rctx)return void this._dbg(U.Error,"modifyAllocation callback has no rendering context!");const r=e;1===s?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,s,r){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,s),this._rctx.setBlendEquation(r)):this._dbg(U.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(U.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,s){this._rctx?(this._rctx.setDepthFunction(s),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(S.ALWAYS,0,255),this._rctx.setStencilOpSeparate(P.FRONT,I.KEEP,I.INCR,I.KEEP),this._rctx.setStencilOpSeparate(P.BACK,I.KEEP,I.DECR,I.KEEP)):this._dbg(U.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case g.None:this._rctx.setFaceCullingEnabled(!1);break;case g.Back:this._rctx.setCullFace(P.BACK),this._rctx.setFaceCullingEnabled(!0);break;case g.Front:this._rctx.setCullFace(P.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(U.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,s,r){this._rctx?this._rctx.setViewport(e,t,s,r):this._dbg(U.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach(((e,t)=>{if(e.needMemoryUsageUpdate){const s=this._vxl.estimate_memory_usage(t);s>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(s))}}))}_syncRequestsResponses(){this._layers.forEach(((e,t)=>{const r=[];e.responses.forEach(((s,i)=>{r.push(i),this._dbg(U.RequestResponse,"responding for requestID:"+i+" size:"+s.size),this._vxl.respond(t,i,s),s.requestType!==f.TreeIndex&&s.requestType!==f.Section||(e.needMemoryUsageUpdate=!0)}));const a=e.responses;for(const s of r)a.delete(s);const n=this._vxl.get_new_requests(t),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const t=n[l],r={responseType:"array-buffer",signal:o,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(U.RequestResponse,"making requestID:"+l+" url:"+t.url),s(t.url,r).then((s=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(U.RequestResponse,"have response for requestID:"+l);let r=0;if(s.data.byteLength>0){r=this._vxl._malloc(s.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,r,s.data.byteLength),t=new Uint8Array(s.data);for(let r=0;r<s.data.byteLength;++r)e[r]=t[r]}a.set(+l,{responseType:t.responseType,ptr:r,size:s.data.byteLength,success:!0,requestType:t.requestType})})).catch((s=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),i(s)||(this._dbg(U.Error,`requestID:${l} failed, error=${s.toString()}`),a.set(+l,{responseType:t.responseType,ptr:0,size:0,success:!1,requestType:t.requestType}))}))}}))}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const s=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<s.length;++e)t.push(s[e])}})),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(r))})),t}setEnabled(e,t){this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(r,t),s.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())}))}setIsInScaleRange(e,t){const s=this._layers.get(e.wasmLayerId);s&&t!==s.isInScaleRange&&(s.isInScaleRange=t,this._vxl.set_is_in_scale_range(e.wasmLayerId,t),s.needMemoryUsageUpdate=!t,this._renderPluginContext.requestRender())}setStaticSections(e,t){const s={mask:p.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,s,!0)}setCurrentVariable(e,t){const s={mask:p.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,s,!0)}setRenderMode(e,t){const s={mask:p.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,s,!0)}setVerticalExaggerationAndOffset(e,t,s,r){const i={mask:p.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:s,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){const s={mask:p.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setVolumeStyles(e,t){const s={mask:p.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setEnableDynamicSections(e,t){const s={mask:p.ContainerVisibility,containerIsVisible:t,container:x.DynamicSections};return this._doMaskedUIUpdate(e,s,!0)}setEnableIsosurfaces(e,t){const s={mask:p.ContainerVisibility,containerIsVisible:t,container:x.Isosurfaces};return this._doMaskedUIUpdate(e,s,!0)}setEnableSections(e,t){const s={mask:p.ContainerVisibility,containerIsVisible:t,container:x.StaticSections};return this._doMaskedUIUpdate(e,s,!0)}setAnalysisSlice(e,t,s,r){const i={mask:p.AnalysisSlice,analysisSlice:{point:s,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;const t=this._layers.get(e.wasmLayerId);if(t){const s=t.layerView.layer;let r=0;s.timeOffset&&(r=o(s.timeOffset.value,s.timeOffset.unit,"seconds"));const i=this._getTimeArgs(s.timeExtent);this._vxl.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,s.useViewTime,r),this._renderPluginContext.requestRender()}}_doMaskedUIUpdate(e,t,s){if(!this._vxl)return!1;let r=!1;return this._layers.forEach(((s,i)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=1===this._vxl.handle_masked_ui_update(i,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}})),r&&s&&this._renderPluginContext.requestRender(),r}_addTriangleToWasmBuffer(e,t,s,r,i){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_addNormalToWasmBuffer(e,t,s){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,s=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,s,3*e),i=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,i,e),n=this._frustum.points[c.NEAR_BOTTOM_LEFT],o=this._frustum.points[c.NEAR_BOTTOM_RIGHT],l=this._frustum.points[c.NEAR_TOP_RIGHT],h=this._frustum.points[c.NEAR_TOP_LEFT],d=this._frustum.points[c.FAR_BOTTOM_LEFT],u=this._frustum.points[c.FAR_BOTTOM_RIGHT],_=this._frustum.points[c.FAR_TOP_RIGHT],g=this._frustum.points[c.FAR_TOP_LEFT];let f=0,p=0;const x=this._frustum.planes[m.NEAR];f=this._addTriangleToWasmBuffer(r,f,l,o,n),p=this._addNormalToWasmBuffer(a,p,x),f=this._addTriangleToWasmBuffer(r,f,n,h,l),p=this._addNormalToWasmBuffer(a,p,x);const y=this._frustum.planes[m.FAR];f=this._addTriangleToWasmBuffer(r,f,d,u,_),p=this._addNormalToWasmBuffer(a,p,y),f=this._addTriangleToWasmBuffer(r,f,_,g,d),p=this._addNormalToWasmBuffer(a,p,y);const v=this._frustum.planes[m.TOP];f=this._addTriangleToWasmBuffer(r,f,_,l,h),p=this._addNormalToWasmBuffer(a,p,v),f=this._addTriangleToWasmBuffer(r,f,h,g,_),p=this._addNormalToWasmBuffer(a,p,v);const b=this._frustum.planes[m.BOTTOM];f=this._addTriangleToWasmBuffer(r,f,n,o,u),p=this._addNormalToWasmBuffer(a,p,b),f=this._addTriangleToWasmBuffer(r,f,u,d,n),p=this._addNormalToWasmBuffer(a,p,b);const w=this._frustum.planes[m.LEFT];f=this._addTriangleToWasmBuffer(r,f,h,n,d),p=this._addNormalToWasmBuffer(a,p,w),f=this._addTriangleToWasmBuffer(r,f,d,g,h),p=this._addNormalToWasmBuffer(a,p,w);const T=this._frustum.planes[m.RIGHT];f=this._addTriangleToWasmBuffer(r,f,l,_,u),p=this._addNormalToWasmBuffer(a,p,T),f=this._addTriangleToWasmBuffer(r,f,u,o,l),p=this._addNormalToWasmBuffer(a,p,T),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(s,3*e,i,e,255,0,0,64),this._vxl._free(s),this._vxl._free(i),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=T.create(v.Local,_(!1,this.view.spatialReference))),null===this._frustum&&(this._frustum=new w(this._renderCoordsHelper)),this._captureFrustum=!0,null!==this._renderPluginContext&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach(((t,s)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(s),this._renderPluginContext.requestRender())}))}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise(((e,s)=>{t.resolveCallback=e,t.rejectCallback=s}));return this._newLayers.push(t),s}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex((t=>e.uid===t.layerView.uid));t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const s=this._newLayers.length;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}let t=-1;this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=r,s.abortController.abort(),this._vxl.remove_layer(t);const i=this.layerUid.indexOf(e.layer.uid);-1!==i&&this.layerUid.splice(i,1)}})),t>=0&&this._layers.delete(t);const s=this._layers.size;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=!1;return null!=e&&(e.isAllTime?r=!0:(null!=e.start&&(r=!0,t=e.start.getTime()/1e3),null!=e.end&&(r=!0,s=e.end.getTime()/1e3))),{startTime:t,endTime:s,hasTime:r}}_addVoxelLayer(e){const t=e.layer;let s=-1;const i=t.getConfiguration();if(i.length<1)return-1;const a={str:i,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(a))return-1;const n=this._getTimeArgs(t.timeExtent),l=this.view.spatialReference.isWGS84&&t.spatialReference.isWGS84?111319.49079327357:1;let h=0;if(t.timeOffset&&(h=o(t.timeOffset.value,t.timeOffset.unit,"seconds")),s=this._vxl.add_layer(t.serviceRoot,a.ptr,a.byteCount,l,l,n.startTime,n.endTime,n.hasTime,t.useViewTime,h,this._toWasmQuality(this.view.qualityProfile)),a.isReusable||this._vxl._free(a.ptr),s>=0){t.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const i=new AbortController;if(this._layers.set(s,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:i,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let s="";for(const r of e.layer.variables)"Int16"!==r.renderingFormat.type&&"UInt16"!==r.renderingFormat.type||(t.push(r.name),r.id===e.layer.currentVariableId&&(s=r.name));""!==s&&r.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${s}' in this browser`),t.length>0&&r.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let s="";for(const r of e.layer.variables)"Float32"===r.renderingFormat.type&&(t.push(r.name),r.id===e.layer.currentVariableId&&(s=r.name));""!==s&&r.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${s}' in this browser`),t.length>0&&r.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&r.getLogger(this).warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),s}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bindParameters.camera.viewForward,s=e.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(s[0],s[1],s[2],t[0],t[1],t[2]);const r=this._vxl.cull();this._dbg(U.RequestResponse,"missingResourceCount="+r),this._moreToLoad=r>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}renderNode(e){if(!this._vxl)return;for(const s of this._newLayers){const e=this._addVoxelLayer(s.layerView);-1===e?s.rejectCallback(-1):s.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return void this._dbg(U.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this.view._stage.renderer.isFeatureEnabled(C.HighResolutionVoxel),e.bindParameters.lighting.mainLight.direction[0],e.bindParameters.lighting.mainLight.direction[1],e.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach((e=>{e.needMemoryUsageUpdate=!0}))),0===t.x&&0===t.y||this._dbg(U.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bindParameters.camera),this._captureFrustum&&(this._frustum.update(e.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(U.Lifetime,"--destroy--"),this._removeRenderPlugin(),this._vxl&&(this._layers.forEach((e=>{e.abortController.abort()})),this._wasmMemBlocks.forEach((e=>{0!==e&&this._vxl._free(e)})),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=y(e).then((e=>{if(this._vxl=e,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(U.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const t=this._getTimeArgs(this.view?.timeExtent),s=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),r=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),i=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),n=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),o=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),l=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),h=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!has("mac"),u=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(s,r,i,a,n,o,l,h,t.startTime,t.endTime,t.hasTime,d,u),this._renderPluginContext&&this._renderPluginContext.requestRender()})).catch((()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(U.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()}))),this._vxlPromise)}pickDepth(e,t,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=s.viewport[3]-t;if(e<0||e>s.viewport[2]||t<0||t>s.viewport[3])return this._dbg(U.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw();const i=s.viewForward,a=s.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(s),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,r);if(this._afterDraw(),n.success){return n.distanceToCamera}return null}pickObject(e,t,s,r){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const i=Math.round(e),a=Math.round(t);if(i<0||i>s.viewport[2]||a<0||a>s.viewport[3])return this._dbg(U.Error,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${s.viewport.toString()}]`),null;this._beforeDraw();const n=s.viewForward,o=s.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(s),this._vxl.begin_frame();let l=null;if(0===r.length)l=this._vxl.pick_object(i,a,0,0);else{const e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(),l}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,s,r,i){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered)return;if(null==i||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(U.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`),null;const a=[];this._layers.forEach((t=>{e.options.filteredLayerUids.includes(t.layerView.layer.uid)&&a.push(t.layerView.wasmLayerId)}));const n=this.pickObject(i[0],i[1],e.camera,a);if(null==n||-1===n.layerId)return;const o=this._layers.get(n.layerId);if(o){const t=o.layerView.layer.uid,i=n.distanceToCamera/d(s,r),a=u();a[0]=n.worldX,a[1]=n.worldY,a[2]=n.worldZ;const l={};if(null!=n.continuousValue&&null!=n.continuousValueUnits?l["Voxel.ServiceValue"]=`${n.continuousValue.toLocaleString()} ${n.continuousValueUnits}`:null!=n.uniqueValueLabel&&null!=n.uniqueValue?l["Voxel.ServiceValue"]=`${n.uniqueValueLabel} (${n.uniqueValue})`:null!=n.uniqueValue&&(l["Voxel.ServiceValue"]=`${n.uniqueValue}`),l["Voxel.ServiceVariableLabel"]=n.variableLabel,l["Voxel.Position"]=n.voxelSpacePosition,null!=n.epochTime&&null!=n.nativeTime&&null!=n.nativeTimeUnits){const e=new Date(n.epochTime);l["Voxel.ServiceLocalTime"]=e.toString(),l["Voxel.ServiceNativeTime"]=`${n.nativeTime.toLocaleString()} ${n.nativeTimeUnits}`}null!=n.depth&&null!=n.depthUnits&&(l["Voxel.ServiceDepth"]=`${n.depth.toLocaleString()} ${n.depthUnits}`);const h=n.faceNormal;l["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const _=e=>{const s=new b(a,t,(()=>this._createVoxelGraphic(o.layerView.layer,l)));e.set(this.type,s,i,h)},c=e.results,m=e.options.store===E.ALL;if((null==c.min.dist||i<c.min.dist)&&_(c.min),(null==c.max.dist||i>c.max.dist)&&_(c.max),m){const t=L(e.ray);_(t),e.results.all.push(t)}}}_createVoxelGraphic(e,s){return new t({layer:e,sourceLayer:e,attributes:s})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,s){this._vxl&&this._vxl.set_upscaling_limits(e,t,s)}};e([l({constructOnly:!0})],k.prototype,"view",void 0),k=e([h("esri.layers.VoxelWasmPerSceneView")],k);const B=k;export{B as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import has from"../core/has.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{p as h}from"../chunks/vec32.js";import{create as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderSRFromViewSR as u}from"../geometry/support/coordinateSystem.js";import{PointIndex as _,PlaneIndex as c}from"../geometry/support/frustum.js";import{WasmCullMode as m,VoxelRequestType as g,UpdateFlags as f,ContainerType as p}from"../libs/vxl/enums.js";import{loadVoxelWASM as y}from"../libs/vxl/VxlModule.js";import{ViewingMode as x}from"../views/ViewingMode.js";import{VoxelGraphic as v}from"../views/3d/layers/VoxelGraphic.js";import{VoxelTarget as b}from"../views/3d/layers/i3s/Intersector.js";import{Frustum as w}from"../views/3d/state/Frustum.js";import{RenderCoordsHelper as T}from"../views/3d/support/RenderCoordsHelper.js";import{SyncRenderPlugin as R}from"../views/3d/webgl-engine/effects/RenderPlugin.js";import{newIntersectorResult as L}from"../views/3d/webgl-engine/lib/Intersector.js";import{IntersectorType as V,StoreResults as C}from"../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{RenderFeature as E}from"../views/3d/webgl-engine/lib/RenderFeature.js";import{RenderSlot as F}from"../views/3d/webgl-engine/lib/RenderSlot.js";import{CompareFunction as I,Face as P,StencilOperation as S}from"../views/webgl/enums.js";var U;!function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"}(U||(U={}));let k=class extends R{constructor(e){super(e),this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.produces=new Map([[F.VOXEL,()=>!!this._vxl&&"local"===this.view.viewingMode]]),this.type=V.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===U.Error?s.getLogger(this).error(t):s.getLogger(this).warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this.view._stage&&(this._dbg(U.Lifetime,"--removeRenderPlugin--"),this.view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}initialize(){this._dbg(U.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([i((()=>this.view.ready),(e=>{e&&"local"===this.view.viewingMode?(this._dbg(U.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this.view._stage.addRenderPlugin(this),this._pluginIsActive=!0):(this._dbg(U.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())}),a),i((()=>this.view?.qualityProfile),(e=>{this._dbg(U.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))}),a),i((()=>this.view?.timeExtent),(()=>{if(this._vxl){const e=this._getTimeArgs(this.view?.timeExtent);this._dbg(U.Rendering,"sceneView timeExtent changed to useTime="+e.hasTime+" st="+e.startTime+" et="+e.endTime),this._vxl.set_scene_time_extent(e.startTime,e.endTime,e.hasTime),this._renderPluginContext.requestRender()}}),a),i((()=>this.view?.stationary),(e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()}))])}initializeRenderContext(e){this._dbg(U.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(U.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!!!this._rctx)return void this._dbg(U.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const s=!!this._rctx,r=!!this._renderTargetToRestore;if(!s||!r)return 0;const i=this._renderTargetToRestore.fbo.depthStencilTexture;return i?(0===t?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(i,e,!0),1):(this._dbg(U.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,s){if(!this._rctx)return void this._dbg(U.Error,"modifyAllocation callback has no rendering context!");const r=e;1===s?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,s,r){this._rctx?(this._rctx.setBlendingEnabled(1===e),this._rctx.setBlendFunction(t,s),this._rctx.setBlendEquation(r)):this._dbg(U.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(U.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,s){this._rctx?(this._rctx.setDepthFunction(s),this._rctx.setDepthTestEnabled(1===e),this._rctx.setDepthWriteEnabled(1===t),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(I.ALWAYS,0,255),this._rctx.setStencilOpSeparate(P.FRONT,S.KEEP,S.INCR,S.KEEP),this._rctx.setStencilOpSeparate(P.BACK,S.KEEP,S.DECR,S.KEEP)):this._dbg(U.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case m.None:this._rctx.setFaceCullingEnabled(!1);break;case m.Back:this._rctx.setCullFace(P.BACK),this._rctx.setFaceCullingEnabled(!0);break;case m.Front:this._rctx.setCullFace(P.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(U.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,s,r){this._rctx?this._rctx.setViewport(e,t,s,r):this._dbg(U.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach(((e,t)=>{if(e.needMemoryUsageUpdate){const s=this._vxl.estimate_memory_usage(t);s>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(s))}}))}_syncRequestsResponses(){this._layers.forEach(((e,s)=>{const i=[];e.responses.forEach(((t,r)=>{i.push(r),this._dbg(U.RequestResponse,"responding for requestID:"+r+" size:"+t.size),this._vxl.respond(s,r,t),t.requestType!==g.TreeIndex&&t.requestType!==g.Section||(e.needMemoryUsageUpdate=!0)}));const a=e.responses;for(const t of i)a.delete(t);const n=this._vxl.get_new_requests(s),o=e.abortController.signal;for(const l in n){e.outstandingRequestCount+=1,1===e.outstandingRequestCount&&e.layerView.updatingFlagChanged();const s=n[l],i={responseType:"array-buffer",signal:o,query:{...e.layerView.layer.customParameters,token:e.layerView.layer.apiKey}};this._dbg(U.RequestResponse,"making requestID:"+l+" url:"+s.url),t(s.url,i).then((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),this._dbg(U.RequestResponse,"have response for requestID:"+l);let r=0;if(t.data.byteLength>0){r=this._vxl._malloc(t.data.byteLength);const e=new Uint8Array(this._vxl.HEAPU8.buffer,r,t.data.byteLength),s=new Uint8Array(t.data);for(let r=0;r<t.data.byteLength;++r)e[r]=s[r]}a.set(+l,{responseType:s.responseType,ptr:r,size:t.data.byteLength,success:!0,requestType:s.requestType})})).catch((t=>{e.outstandingRequestCount-=1,0===e.outstandingRequestCount&&e.layerView.updatingFlagChanged(),r(t)||(this._dbg(U.Error,`requestID:${l} failed, error=${t.toString()}`),a.set(+l,{responseType:s.responseType,ptr:0,size:0,success:!1,requestType:s.requestType}))}))}}))}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const s=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let e=0;e<s.length;++e)t.push(s[e])}})),t}getCurrentLayerTimeIndex(e){let t=0;return this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(r))})),t}setEnabled(e,t){this._layers.forEach(((s,r)=>{s.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(r,t),s.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())}))}setIsInScaleRange(e,t){const s=this._layers.get(e.wasmLayerId);s&&t!==s.isInScaleRange&&(s.isInScaleRange=t,this._vxl.set_is_in_scale_range(e.wasmLayerId,t),s.needMemoryUsageUpdate=!t,this._renderPluginContext.requestRender())}setStaticSections(e,t){const s={mask:f.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,s,!0)}setCurrentVariable(e,t){const s={mask:f.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,s,!0)}setRenderMode(e,t){const s={mask:f.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,s,!0)}setVerticalExaggerationAndOffset(e,t,s,r){const i={mask:f.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:s,verticalOffset:r}};return this._doMaskedUIUpdate(e,i,!0)}setVariableStyles(e,t){const s={mask:f.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setVolumeStyles(e,t){const s={mask:f.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,s,!0)}setEnableDynamicSections(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.DynamicSections};return this._doMaskedUIUpdate(e,s,!0)}setEnableIsosurfaces(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.Isosurfaces};return this._doMaskedUIUpdate(e,s,!0)}setEnableSections(e,t){const s={mask:f.ContainerVisibility,containerIsVisible:t,container:p.StaticSections};return this._doMaskedUIUpdate(e,s,!0)}setAnalysisSlice(e,t,s,r){const i={mask:f.AnalysisSlice,analysisSlice:{point:s,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,i,!0)}updateLayerTimeProperties(e){if(!this._vxl)return;const t=this._layers.get(e.wasmLayerId);if(t){const s=t.layerView.layer;let r=0;s.timeOffset&&(r=n(s.timeOffset.value,s.timeOffset.unit,"seconds"));const i=this._getTimeArgs(s.timeExtent);this._vxl.set_layer_time_properties(e.wasmLayerId,i.startTime,i.endTime,i.hasTime,s.useViewTime,r),this._renderPluginContext.requestRender()}}_doMaskedUIUpdate(e,t,s){if(!this._vxl)return!1;let r=!1;return this._layers.forEach(((s,i)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){const e={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(r=1===this._vxl.handle_masked_ui_update(i,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}})),r&&s&&this._renderPluginContext.requestRender(),r}_addTriangleToWasmBuffer(e,t,s,r,i){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_addNormalToWasmBuffer(e,t,s){return e[3*t]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,s=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,s,3*e),i=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(this._vxl.HEAPF32.buffer,i,e),n=this._frustum.points[_.NEAR_BOTTOM_LEFT],o=this._frustum.points[_.NEAR_BOTTOM_RIGHT],l=this._frustum.points[_.NEAR_TOP_RIGHT],h=this._frustum.points[_.NEAR_TOP_LEFT],d=this._frustum.points[_.FAR_BOTTOM_LEFT],u=this._frustum.points[_.FAR_BOTTOM_RIGHT],m=this._frustum.points[_.FAR_TOP_RIGHT],g=this._frustum.points[_.FAR_TOP_LEFT];let f=0,p=0;const y=this._frustum.planes[c.NEAR];f=this._addTriangleToWasmBuffer(r,f,l,o,n),p=this._addNormalToWasmBuffer(a,p,y),f=this._addTriangleToWasmBuffer(r,f,n,h,l),p=this._addNormalToWasmBuffer(a,p,y);const x=this._frustum.planes[c.FAR];f=this._addTriangleToWasmBuffer(r,f,d,u,m),p=this._addNormalToWasmBuffer(a,p,x),f=this._addTriangleToWasmBuffer(r,f,m,g,d),p=this._addNormalToWasmBuffer(a,p,x);const v=this._frustum.planes[c.TOP];f=this._addTriangleToWasmBuffer(r,f,m,l,h),p=this._addNormalToWasmBuffer(a,p,v),f=this._addTriangleToWasmBuffer(r,f,h,g,m),p=this._addNormalToWasmBuffer(a,p,v);const b=this._frustum.planes[c.BOTTOM];f=this._addTriangleToWasmBuffer(r,f,n,o,u),p=this._addNormalToWasmBuffer(a,p,b),f=this._addTriangleToWasmBuffer(r,f,u,d,n),p=this._addNormalToWasmBuffer(a,p,b);const w=this._frustum.planes[c.LEFT];f=this._addTriangleToWasmBuffer(r,f,h,n,d),p=this._addNormalToWasmBuffer(a,p,w),f=this._addTriangleToWasmBuffer(r,f,d,g,h),p=this._addNormalToWasmBuffer(a,p,w);const T=this._frustum.planes[c.RIGHT];f=this._addTriangleToWasmBuffer(r,f,l,m,u),p=this._addNormalToWasmBuffer(a,p,T),f=this._addTriangleToWasmBuffer(r,f,u,o,l),p=this._addNormalToWasmBuffer(a,p,T),-1!==this._frustumRenderableId&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(s,3*e,i,e,255,0,0,64),this._vxl._free(s),this._vxl._free(i),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){null===this._renderCoordsHelper&&(this._renderCoordsHelper=T.create(x.Local,u(!1,this.view.spatialReference))),null===this._frustum&&(this._frustum=new w(this._renderCoordsHelper)),this._captureFrustum=!0,null!==this._renderPluginContext&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach(((t,s)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(s),this._renderPluginContext.requestRender())}))}dropQueryRenderTarget(){this._vxl&&this._vxl.drop_query_rt()}addVoxelLayer(e){if(!this._vxl){const t={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise(((e,s)=>{t.resolveCallback=e,t.rejectCallback=s}));return this._newLayers.push(t),s}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const t=this._newLayers.findIndex((t=>e.uid===t.layerView.uid));t>=0&&(this._newLayers[t].resolveCallback(-1),this._newLayers.splice(t,1));const s=this._newLayers.length;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}let t=-1;this._layers.forEach(((s,r)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=r,s.abortController.abort(),this._vxl.remove_layer(t);const i=this.layerUid.indexOf(e.layer.uid);-1!==i&&this.layerUid.splice(i,1)}})),t>=0&&this._layers.delete(t);const s=this._layers.size;return 0===s&&(this._dbg(U.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),s}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e<t)return t;return-1}_allocateBlock(e){e.byteCount=this._vxl.lengthBytesUTF8(e.str)+1;const t=this._getBlockSize(e.byteCount);return t<0?(e.isReusable=!1,e.ptr=this._vxl._malloc(e.byteCount)):(e.isReusable=!0,e.ptr=this._wasmMemBlocks.get(t),0===e.ptr&&(e.ptr=this._vxl._malloc(t),this._wasmMemBlocks.set(t,e.ptr))),0!==e.ptr&&(this._vxl.stringToUTF8(e.str,e.ptr,e.byteCount),!0)}_getTimeArgs(e){let t=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=!1;return null!=e&&(e.isAllTime?r=!0:(null!=e.start&&(r=!0,t=e.start.getTime()/1e3),null!=e.end&&(r=!0,s=e.end.getTime()/1e3))),{startTime:t,endTime:s,hasTime:r}}_addVoxelLayer(e){const t=e.layer;let r=-1;const i=t.getConfiguration();if(i.length<1)return-1;const a={str:i,byteCount:0,ptr:0,isReusable:!1};if(!this._allocateBlock(a))return-1;const o=this._getTimeArgs(t.timeExtent),l=this.view.spatialReference.isWGS84&&t.spatialReference.isWGS84?111319.49079327357:1;let h=0;if(t.timeOffset&&(h=n(t.timeOffset.value,t.timeOffset.unit,"seconds")),r=this._vxl.add_layer(t.serviceRoot,a.ptr,a.byteCount,l,l,o.startTime,o.endTime,o.hasTime,t.useViewTime,h,this._toWasmQuality(this.view.qualityProfile)),a.isReusable||this._vxl._free(a.ptr),r>=0){t.test?.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const i=new AbortController;if(this._layers.set(r,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:i,needMemoryUsageUpdate:!1,isInScaleRange:!0}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||has("mac")){const t=[];let r="";for(const s of e.layer.variables)"Int16"!==s.renderingFormat.type&&"UInt16"!==s.renderingFormat.type||(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const t=[];let r="";for(const s of e.layer.variables)"Float32"===s.renderingFormat.type&&(t.push(s.name),s.id===e.layer.currentVariableId&&(r=s.name));""!==r&&s.getLogger(this).error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${r}' in this browser`),t.length>0&&s.getLogger(this).warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${t.toString()}' in this browser`)}return has("esri-mobile")&&s.getLogger(this).warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),r}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bindParameters.camera.viewForward,s=e.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(s[0],s[1],s[2],t[0],t[1],t[2]);const r=this._vxl.cull();this._dbg(U.RequestResponse,"missingResourceCount="+r),this._moreToLoad=r>0,this._havePreparedWithAllLayers=0===this._newLayers.length,this._updateMemoryUsage()}renderNode(e){if(!this._vxl)return;for(const s of this._newLayers){const e=this._addVoxelLayer(s.layerView);-1===e?s.rejectCallback(-1):s.resolveCallback(e)}if(this._newLayers=[],0===this._layers.size)return void this._dbg(U.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this.view._stage.renderer.isFeatureEnabled(E.HighResolutionVoxel),e.bindParameters.lighting.mainLight.direction[0],e.bindParameters.lighting.mainLight.direction[1],e.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach((e=>{e.needMemoryUsageUpdate=!0}))),0===t.x&&0===t.y||this._dbg(U.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bindParameters.camera),this._captureFrustum&&(this._frustum.update(e.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(U.Lifetime,"--destroy--"),this._vxl&&(this._layers.forEach((e=>{e.abortController.abort()})),this._wasmMemBlocks.forEach((e=>{0!==e&&this._vxl._free(e)})),this._vxl.uninitialize_voxel_wasm(),this._removeRenderPlugin(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=y(e).then((e=>{if(this._vxl=e,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(U.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const t=this._getTimeArgs(this.view?.timeExtent),s=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),r=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),i=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),n=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),o=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),l=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),h=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!has("mac"),u=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(s,r,i,a,n,o,l,h,t.startTime,t.endTime,t.hasTime,d,u),this._renderPluginContext&&this._renderPluginContext.requestRender()})).catch((()=>{for(const e of this._newLayers)e.rejectCallback(-2);this._dbg(U.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()}))),this._vxlPromise)}pickDepth(e,t,s){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const r=s.viewport[3]-t;if(e<0||e>s.viewport[2]||t<0||t>s.viewport[3])return this._dbg(U.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw();const i=s.viewForward,a=s.eye;this._vxl.update_camera_pos_and_direction(a[0],a[1],a[2],i[0],i[1],i[2]),this.updateWasmCamera(s),this._vxl.begin_frame();const n=this._vxl.pick_depth(e,r);if(this._afterDraw(),n.success){return n.distanceToCamera}return null}pickObject(e,t,s,r){if(!this._vxl||!this._rctx||0===this._layers.size)return null;const i=Math.round(e),a=Math.round(t);if(i<0||i>s.viewport[2]||a<0||a>s.viewport[3])return this._dbg(U.Error,`[js] pickObject: outOfRange, screenXY=[${i}, ${a}], vp=[${s.viewport.toString()}]`),null;this._beforeDraw();const n=s.viewForward,o=s.eye;this._vxl.update_camera_pos_and_direction(o[0],o[1],o[2],n[0],n[1],n[2]),this.updateWasmCamera(s),this._vxl.begin_frame();let l=null;if(0===r.length)l=this._vxl.pick_object(i,a,0,0);else{const e={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(e)&&(l=this._vxl.pick_object(i,a,e.ptr,e.byteCount),e.isReusable||this._vxl._free(e.ptr))}return this._afterDraw(),l}async getOtherFieldPopupValues(e,s){for(const r of e){const e=r.gpuResult;if(!e)continue;const i=this._layers.get(e.layerId);if(!i||!i.layerView.layer.url)continue;const a=i.layerView.layer,n={responseType:"array-buffer",signal:i.abortController.signal,query:{...i.layerView.layer.customParameters,token:i.layerView.layer.apiKey}},o=e.voxelSpacePosition,l=[Math.floor(o[0]/32),Math.floor(o[1]/32),Math.floor(o[2]/32)],h=[-4&l[0],-4&l[1],-4&l[2]];let d=0;if(e.epochTime){const t=this._vxl.get_layer_epoch_times(i.layerView.wasmLayerId,a.currentVariableId);for(let s=0;s<t.length;++s)if(t[s]===e.epochTime/1e3){d=s;break}}const u=[],_={varIds:[],ptrs:[],sizes:[]};for(const r of s){const e=a.variables.findIndex((e=>e.name===r));if(-1!==e){const s=a.variables.getItemAt(e).id,r=`${a.url}/variables/${s}/${d}/bundles/0/${h[0]}-${h[1]}-${h[2]}`;u.push(t(r,n).then((e=>e.data))),_.varIds.push(s)}}const c=await Promise.allSettled(u),m=c.length;for(let t=0;t<m;++t){const e=c[t];if("fulfilled"===e.status){const t=e.value,s=this._vxl._malloc(t.byteLength);new Uint8Array(this._vxl.HEAPU8.buffer,s,t.byteLength).set(new Uint8Array(t)),_.ptrs.push(s),_.sizes.push(t.byteLength)}else _.varIds.splice(t,1)}const g=this._vxl.get_other_field_popup_values(e,_);for(let t=0;t<_.ptrs.length;++t)this._vxl._free(_.ptrs[t]);if(g.continuousValues)for(const t in g.continuousValues)r.attributes[t]=g.continuousValues[t];if(g.uniqueValues)for(const t in g.uniqueValues)r.attributes[t]=g.uniqueValues[t]}return e}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,s,r,i){if(!this._vxl||!this._rctx||0===this._layers.size||!e.options.selectionMode||e.options.isFiltered)return;if(null==i||i[0]<0||i[0]>e.camera.viewport[2]||i[1]<0||i[1]>e.camera.viewport[3])return this._dbg(U.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${i[0].toFixed(0)}, ${i[1].toFixed(0)}]`),null;const a=[];this._layers.forEach((t=>{e.options.filteredLayerUids.includes(t.layerView.layer.uid)&&a.push(t.layerView.wasmLayerId)}));const n=this.pickObject(i[0],i[1],e.camera,a);if(null==n||-1===n.layerId)return;const o=this._layers.get(n.layerId);if(o){const t=o.layerView.layer.uid,i=n.distanceToCamera/h(s,r),a=d();a[0]=n.worldX,a[1]=n.worldY,a[2]=n.worldZ;const l={},u=o.layerView.layer,_=u.variables.findIndex((e=>e.id===u.currentVariableId));if(_>=0){const e=u.variables.getItemAt(_);null!=n.continuousValue?l[e.name]=n.continuousValue:null!=n.uniqueValueLabel&&null!=n.uniqueValue?l[e.name]=`${n.uniqueValueLabel} (${n.uniqueValue})`:null!=n.uniqueValue&&(l[e.name]=`${n.uniqueValue}`)}if(l["Voxel.Position"]=`[${n.voxelSpacePosition.toString()}]`,l["Voxel.CurrentVariable"]=n.variableLabel,null!=n.epochTime&&null!=n.nativeTime&&null!=n.nativeTimeUnits){const e=new Date(n.epochTime);l["Voxel.LocalTime"]=e.toString(),l["Voxel.SourceTime"]=`${n.nativeTime.toLocaleString()} ${n.nativeTimeUnits}`}null!=n.depth&&null!=n.depthUnits&&(l["Voxel.Depth"]=`${n.depth.toLocaleString()} ${n.depthUnits}`);const c=n.faceNormal;l["Voxel.WorldPosition"]=`[${a[0]}, ${a[1]}, ${a[2]}]`;const m=e=>{const s=new b(a,t,(()=>this._createVoxelGraphic(o.layerView.layer,l,n)));e.set(this.type,s,i,c)},g=e.results,f=e.options.store===C.ALL;if((null==g.min.dist||i<g.min.dist)&&m(g.min),(null==g.max.dist||i>g.max.dist)&&m(g.max),f){const t=L(e.ray);m(t),e.results.all.push(t)}}}_createVoxelGraphic(e,t,s){return new v({layer:e,sourceLayer:e,attributes:t,gpuResult:s})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,s){this._vxl&&this._vxl.set_upscaling_limits(e,t,s)}};e([o({constructOnly:!0})],k.prototype,"view",void 0),k=e([l("esri.layers.VoxelWasmPerSceneView")],k);const A=k;export{A as default};
|