@arcgis/core 4.33.0-next.20250429 → 4.33.0-next.20250501
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/analysis/AreaMeasurementAnalysis.js +1 -1
- package/applications/Components/baUtils.js +5 -0
- package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -1
- package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02b38423276536596aba.js +1 -0
- package/assets/esri/core/workers/chunks/{9a1c058d3ecd1db0e996.js → 0c338364cb55afdbd580.js} +1 -1
- package/assets/esri/core/workers/chunks/{4351b3e54b309935faed.js → 173737c60fa54f7d82bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{90dc783a617ff053e862.js → 181ad3cee0b30a72e7c7.js} +1 -1
- package/assets/esri/core/workers/chunks/210e057fe5e66abea984.js +1 -0
- package/assets/esri/core/workers/chunks/{9850ff14bd9c7da81c65.js → 23c76963481e38f39653.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1473d15c75fc560ea4a.js → 2ad47c0ba1680f7d5e03.js} +1 -1
- package/assets/esri/core/workers/chunks/2c3920ad82b9d86c3f05.js +1 -0
- package/assets/esri/core/workers/chunks/{12c9dd3932218238033b.js → 3a205f87f100832ef9f5.js} +1 -1
- package/assets/esri/core/workers/chunks/3cee3ff926f47aae476f.js +1 -0
- package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{2fd5b48976cefe7cc0ab.js → 581180668e0229dcdc14.js} +1 -1
- package/assets/esri/core/workers/chunks/5c2299f22a69e58cc4dd.js +1 -0
- package/assets/esri/core/workers/chunks/60eb6dd09080da5653a1.js +1 -0
- package/assets/esri/core/workers/chunks/6210346dc9d064ac90af.js +1 -0
- package/assets/esri/core/workers/chunks/{c3033f148213c960b906.js → 653ff3e631fea8ad393a.js} +290 -291
- package/assets/esri/core/workers/chunks/{3cf001abca8ad933bccf.js → 670a66617249f2d15a62.js} +2 -2
- package/assets/esri/core/workers/chunks/{3cf001abca8ad933bccf.js.LICENSE.txt → 670a66617249f2d15a62.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/6d89d42bcba213be2d9d.js +1 -0
- package/assets/esri/core/workers/chunks/6ecc3a3737ae8622dfa4.js +1 -0
- package/assets/esri/core/workers/chunks/6fef5a07f75b2a5736ad.js +1 -0
- package/assets/esri/core/workers/chunks/6ff46126c82354e6c78e.js +1 -0
- package/assets/esri/core/workers/chunks/710e03feaa25e357f17a.js +1 -0
- package/assets/esri/core/workers/chunks/71dc9d78dec981078a1a.js +1 -0
- package/assets/esri/core/workers/chunks/{ab6ecd8eeec5ff761b34.js → 73bca519c93920bc8c9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6de903f22f76d875005.js → 7496c4c33c2d8f60a434.js} +1 -1
- package/assets/esri/core/workers/chunks/7a282674d77875c58acd.js +1 -0
- package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +2 -0
- package/assets/esri/core/workers/chunks/{30551c1d3e4fa7be86c1.js.LICENSE.txt → 7b4523ab392966624d97.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{50ffb2620cdbcfd75723.js → 81b3351ea9627bb631d4.js} +1 -1
- package/assets/esri/core/workers/chunks/84d7ed2cf5fe23a0888f.js +1 -0
- package/assets/esri/core/workers/chunks/84f972d7851d982701a0.js +319 -0
- package/assets/esri/core/workers/chunks/{f52e597dca4b32a81881.js → 867c6c5b2ee1db977c99.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5d786166a5609b85276.js → 8a87c181b85d0b86b9bb.js} +2 -2
- package/assets/esri/core/workers/chunks/{c5d786166a5609b85276.js.LICENSE.txt → 8a87c181b85d0b86b9bb.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{a0c51c4c30a5f749dfc6.js → 8bf2e2fe5e3e8b4a1fa0.js} +1 -1
- package/assets/esri/core/workers/chunks/{213adc87c843d627c5d6.js → 8f2e0277c66247bd40b4.js} +1 -1
- package/assets/esri/core/workers/chunks/9652cfd4668b95036c87.js +39 -0
- package/assets/esri/core/workers/chunks/{a600194cfe26aedc21dd.js → 9d32f41f8f69b8a507c3.js} +1 -1
- package/assets/esri/core/workers/chunks/9f07919ade6707b103da.js +1 -0
- package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{899f197556b6ced6eddf.js → ad9b4e0164706c53b872.js} +2 -2
- package/assets/esri/core/workers/chunks/{72097a8247101018dcdf.js → ba4aafa8dfa76006c3e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3174ff4dd5acd16485a.js → c041f4a1d18d42e27ad7.js} +1 -1
- package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +2 -0
- package/assets/esri/core/workers/chunks/{e524462c63834fae7e01.js.LICENSE.txt → c2594024d72133d3ed7b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{5a821b7bf58eebb9062c.js → c607d618b64d3accecc4.js} +1 -1
- package/assets/esri/core/workers/chunks/c9a2c4fd169b943db4b4.js +1 -0
- package/assets/esri/core/workers/chunks/{577f24923fa4d08360e4.js → ce9de24cb96b56d20562.js} +2 -2
- package/assets/esri/core/workers/chunks/{577f24923fa4d08360e4.js.LICENSE.txt → ce9de24cb96b56d20562.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d30fae6233d3426615ed.js +1 -0
- package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{28317c8d7fa2eeeaf997.js → d92ea6b0674f34206ab6.js} +1 -1
- package/assets/esri/core/workers/chunks/{345993291540433d3d92.js → e93222c65bd28203ddf7.js} +1 -1
- package/assets/esri/themes/base/widgets/_SelectionList.scss +5 -17
- 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/chunks/BloomBlur.glsl.js +1 -1
- package/chunks/BloomComposition.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +1 -1
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +33 -33
- package/chunks/DefaultMaterial.glsl.js +22 -22
- package/chunks/Fog.glsl.js +3 -3
- package/chunks/Haze.glsl.js +1 -1
- package/chunks/Path.glsl.js +22 -18
- package/chunks/RealisticTree.glsl.js +9 -9
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/SSAO.glsl.js +43 -42
- package/chunks/ShadowCastAccumulate.glsl.js +5 -5
- package/chunks/ShadowHighlight.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/Viewshed.glsl.js +1 -1
- package/core/NestedMap.js +1 -1
- package/core/deprecate.js +1 -1
- package/geometry/support/PolylineBuilder.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +5 -0
- package/geometry/support/curves/circleUtils.js +5 -0
- package/geometry/support/curves/circularArcUtils.js +5 -0
- package/geometry/support/curves/closestPointOnCurve.js +5 -0
- package/geometry/support/curves/curveUtils.js +5 -0
- package/geometry/support/curves/densifyCurvedGeometry.js +5 -0
- package/geometry/support/curves/ellipticArc4Utils.js +5 -0
- package/geometry/support/curves/ellipticArc7Utils.js +5 -0
- package/geometry/support/curves/mathUtils.js +5 -0
- package/geometry/support/curves/splitCurveAtPoint.js +5 -0
- package/interfaces.d.ts +650 -22
- package/layers/MapImageLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/save/mapImageLayerUtils.js +5 -0
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/support/portalItemUtils.js +1 -1
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/wasmUtils.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +5 -0
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/DeconflictAABR.js +5 -0
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/ObjectSymbolLayerRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/Point3DSymbolRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/factoryUtils.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/FoamRendering.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +27 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +28 -0
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +12 -0
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/ContentObjectType.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +5 -0
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RendererBase.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +9 -9
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +2 -20
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/ui/DefaultUI.js +1 -1
- package/views/webgl/Sync.js +5 -0
- package/webscene/support/FeatureReference.d.ts +4 -0
- package/webscene/support/FeatureReference.js +5 -0
- package/webscene/support/FeatureReferenceGlobalId.d.ts +4 -0
- package/webscene/support/FeatureReferenceGlobalId.js +5 -0
- package/webscene/support/FeatureReferenceId.d.ts +4 -0
- package/webscene/support/FeatureReferenceId.js +5 -0
- package/webscene/support/FeatureReferenceObjectId.d.ts +4 -0
- package/webscene/support/FeatureReferenceObjectId.js +5 -0
- package/webscene/support/LayerReference.d.ts +4 -0
- package/webscene/support/LayerReference.js +5 -0
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlidePopupInfo.d.ts +4 -0
- package/webscene/support/SlidePopupInfo.js +5 -0
- package/webscene/support/featureReferenceUtils.js +5 -0
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/AttachmentsViewOptions.d.ts +4 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/1a6d2d090b643a87408a.js +0 -1
- package/assets/esri/core/workers/chunks/25142d431dd1e5e82234.js +0 -1
- package/assets/esri/core/workers/chunks/2e3019ce49e972a815ca.js +0 -1
- package/assets/esri/core/workers/chunks/30551c1d3e4fa7be86c1.js +0 -2
- package/assets/esri/core/workers/chunks/3293b4041c222299428f.js +0 -1
- package/assets/esri/core/workers/chunks/4da99f058cca83937e9b.js +0 -1
- package/assets/esri/core/workers/chunks/626ba3a7dee952308566.js +0 -1
- package/assets/esri/core/workers/chunks/7fce62ef3f0b011e0d35.js +0 -1
- package/assets/esri/core/workers/chunks/8c8d812a7f2d29c29676.js +0 -1
- package/assets/esri/core/workers/chunks/97eedd6b90c6a9c67947.js +0 -1
- package/assets/esri/core/workers/chunks/b1e420cb425a3625170e.js +0 -319
- package/assets/esri/core/workers/chunks/b8248939373e25a8d6db.js +0 -1
- package/assets/esri/core/workers/chunks/baa9fd23414f03ef90bc.js +0 -1
- package/assets/esri/core/workers/chunks/bf4947fe446dcb477031.js +0 -1
- package/assets/esri/core/workers/chunks/cd2927b922444880566d.js +0 -1
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +0 -1
- package/assets/esri/core/workers/chunks/def182fff5a0244b1c2c.js +0 -1
- package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +0 -1
- package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +0 -2
- package/assets/esri/core/workers/chunks/e64e0c3240f8e577a61c.js +0 -39
- package/assets/esri/core/workers/chunks/f2bc75a718a10065011d.js +0 -1
- package/geometry/support/curveUtils.js +0 -5
- package/geometry/support/densifyUtils.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.js +0 -38
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.js +0 -35
- package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +0 -5
- package/widgets/support/InteractiveAnalysisViewModel.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{destroyMaybe as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{abortMaybe as a,destroyMaybe as s}from"../../../core/maybe.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as o}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{MeasurementMode as u}from"./interfaces.js";import{DirectLineMeasurementController as p}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as y}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import h from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as m,removeAnalysisViewTool as d,startExclusiveInteractiveOperation as c}from"../../analysis/analysisViewUtils.js";let v=class extends(r(e)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.tool=null,this.result=null,this.measurementMode=u.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){const{analysis:t,view:e}=this;this._analysisVisualization=new y({view:e,analysis:t,analysisView:this}),this._analysisController=new p({view:e,analysis:t,viewData:this}),this.addHandles(m(this,h))}destroy(){d(this),this.userOperation=a(this.userOperation),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct?.text??""}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??""}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??""}get unit(){return this.analysis.unit??o(this.view)}get testData(){}place(t){if(this.analysis.valid)throw new i("DirectLineMeasurementAnalysisView3D:place","Cannot place a direct line measurement when the analysis already has a start and end point.");return this.userOperation=c(this,t),this.userOperation.promise}};t([l()],v.prototype,"_analysisVisualization",void 0),t([l()],v.prototype,"_analysisController",void 0),t([l()],v.prototype,"updating",null),t([l({readOnly:!0})],v.prototype,"type",void 0),t([l({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",void 0),t([l()],v.prototype,"tool",void 0),t([l()],v.prototype,"result",void 0),t([l()],v.prototype,"measurementMode",void 0),t([l()],v.prototype,"elevationAlignedStartPoint",void 0),t([l()],v.prototype,"elevationAlignedEndPoint",void 0),t([l({readOnly:!0})],v.prototype,"viewMode",null),t([l({readOnly:!0})],v.prototype,"actualVisualizedMeasurement",null),t([l()],v.prototype,"visualElementOrientation",null),t([l()],v.prototype,"allowVisualElementsOrientationChange",null),t([l()],v.prototype,"triangleCollapseRatioThreshold",null),t([l({readOnly:!0})],v.prototype,"directLabelText",null),t([l({readOnly:!0})],v.prototype,"horizontalLabelText",null),t([l({readOnly:!0})],v.prototype,"verticalLabelText",null),t([l()],v.prototype,"unit",null),t([l()],v.prototype,"userOperation",void 0),v=t([n("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],v);const g=v;export{g 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as r,parameter as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as r,parameter as o}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends r{constructor(){super(...arguments),this.reduced=!1}}e([o()],s.prototype,"reduced",void 0);export{s as ChapmanAtmosphereTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{G as l,c,h as g,m}from"../../../chunks/vec32.js";import{clone as p,fromValues as d,create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as _}from"../../../geometry/projection.js";import v from"../../../geometry/SpatialReference.js";import{projectPointToVector as f}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as w}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as y}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as b}from"../../ViewingMode.js";import{EnvironmentRenderer as P}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as T}from"../support/earthUtils.js";import{ColorAndIntensity as j,computeColorAndIntensity as L,computeVirtualLightDirection as G,computeShadowsEnabled as S}from"../support/sunUtils.js";import{Update as U}from"../webgl-engine/lib/Update.js";import{MainLight as C,AmbientLight as E,FillLight as H}from"../webgl-engine/lighting/Lightsources.js";let R=class extends t.EventedAccessor{constructor(){super(),this._tmpLightParameters=new j,this._defaultLightParameters=new j,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new C,this._ambientLight=new E,this._moonLight=new H,this._disableWeather=!1,this._renderer=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===b.Global&&y(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??v.WGS84,t=w(e);return _(e,t)}connectView(e){if(this._renderer)return;this._renderer=new P({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),o),n((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),o),n((()=>e.environment.lighting.directShadowsEnabled),t,o),n((()=>e.qualitySettings.ambientOcclusion),t,o),n((()=>e.qualitySettings.reflections),t,o),n((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),o),n((()=>[e.environment.weather.type,this.weatherEnabled]),(()=>this._updateLighting(null,U.FadeWithWeather)),o),n((()=>"snowy"===e.environment.weather.type&&e.environment.weather.snowCover),t,o),n((()=>e.environment),(e=>e.setComputeWeatherAvailable((()=>this._weatherAvailable))),s),n((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),s),n((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),s),n((()=>e.state.camera),i,s),r((()=>this._canProjectCameraPosition),i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=T(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??v.WGS84,o=w(r);if(!f(n,z,o)){if(null==this._referencePositionGeographic)return;return this._referencePositionGeographic=null,void this._updateLighting()}this._referencePositionGeographic?l(this._referencePositionGeographic,z)||(c(this._referencePositionGeographic,z),this.notifyChange("referencePositionGeographic")):this._referencePositionGeographic=p(z),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e)}_updateLighting(e,t=U.Immediate){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,s=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";L(e,o,i.state.viewingMode,t,i.state.camera,s)}else r&&G(i.state.camera,i.state.viewingMode,s.direct.directionToLightSource);const a=this._mainLight,h=s.direct;g(a.intensity,h.color,h.intensity*Math.PI),c(a.direction,h.directionToLightSource),a.specularStrength=s.specularStrength,a.environmentStrength=s.environmentStrength;const l=this._ambientLight;g(l.intensity,s.ambient.color,s.ambient.intensity);const p=this._moonLight;m(p.intensity,k,M,s.globalFactor);const d=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));g(p.intensity,p.intensity,d),c(p.direction,h.directionToLightSource),this._view.stage?.renderer.updateLighting([a,l,p],s.noonFactor,s.globalFactor,this._weatherAvailable?t:U.Immediate),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=T(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),s=i.getUTCMinutes()-(n.minutes-r.minutes),a=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(s),i.setUTCSeconds(a),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view.stage;if(!e)return;const t=null==this._referencePositionGeographic||S(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([a({type:Boolean,readOnly:!0})],R.prototype,"updating",null),e([a()],R.prototype,"_disableWeather",void 0),e([a()],R.prototype,"weatherEnabled",null),e([a()],R.prototype,"_weatherAvailable",null),e([a()],R.prototype,"referencePositionGeographic",null),e([a()],R.prototype,"_referencePositionGeographic",void 0),e([a()],R.prototype,"_renderer",void 0),e([a()],R.prototype,"_canProjectCameraPosition",null),R=e([h("esri.views.3d.environment.EnvironmentManager")],R);const k=d(.22,.22,.33),M=d(.22,.22,.22),z=u();export{R as EnvironmentManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{TextureWrapMode as e}from"../../webgl/enums.js";function r(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,
|
|
5
|
+
import{TextureWrapMode as e}from"../../webgl/enums.js";function r(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclusion:!0,colorTexture:null,normalTexture:null,occlusionTexture:null,emissiveTexture:null,metallicRoughnessTexture:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}function l(r,l={}){return{data:r,parameters:{wrap:{s:e.REPEAT,t:e.REPEAT,...l.wrap},noUnpackFlip:!0,mipmap:!1,...l}}}export{r as makeMaterialParameters,l as makeTextureSource};
|
package/views/3d/glTF/loader.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Logger.js";import{clone as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{makeMaterialParameters as t,makeTextureSource as r}from"./LoaderResult.js";import{GLTFResource as s}from"./internal/Resource.js";import{TextureSamplingMode as a,PrimitiveType as n}from"../../webgl/enums.js";let i=0;async function l(t,r,a={},l=!0){const m=await s.load(t,r,a),T="gltf_"+i++,p={lods:[],materials:new Map,textures:new Map,meta:u(m)},f=!(!m.json.asset.extras||"symbolResource"!==m.json.asset.extras.ESRI_type),x=m.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,g=new Map;await c(m,(async(t,r,s,i)=>{const u=g.get(s)??0;g.set(s,u+1);const c=void 0!==t.mode?t.mode:n.TRIANGLES,f=c===n.TRIANGLES||c===n.TRIANGLE_STRIP||c===n.TRIANGLE_FAN?c:null;if(null==f)return void e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+n[c]+"). Skipping primitive.");if(!m.hasPositions(t))return void e.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const x=m.getPositionData(t,a),h=m.getMaterial(t,a,l),w=m.hasNormals(t)?m.getNormalData(t,a):null,v=m.hasTangents(t)?m.getTangentData(t,a):null,S=m.hasTextureCoordinates(t)?m.getTextureCoordinates(t,a):null,R=m.hasVertexColors(t)?m.getVertexColors(t,a):null,_=m.getIndexData(t,a),E={name:i,transform:o(r),attributes:{position:await x,normal:w?await w:null,texCoord0:S?await S:null,color:R?await R:null,tangent:v?await v:null},indices:await _,primitiveType:f,material:d(p,await h,T)};let I=null;null!=p.meta?.ESRI_lod&&"screenSpaceRadius"===p.meta.ESRI_lod.metric&&(I=p.meta.ESRI_lod.thresholds[s]),p.lods[s]=p.lods[s]||{parts:[],name:i,lodThreshold:I},p.lods[s].parts[u]=E}));for(const e of p.lods)e.parts=e.parts.filter((e=>!!e));const h=await m.getLoadedBuffersSize();return{model:p,meta:{isEsriSymbolResource:f,uri:m.uri,ESRI_webstyle:x},customMeta:{},cachedMemory:h}}function u(e){const o=e.json;let t=null;return o.nodes.forEach((e=>{const o=e.extras;null!=o&&(o.ESRI_proxyEllipsoid||o.ESRI_lod)&&(t=o)})),t}async function c(o,t){const r=o.json,s=r.scenes[r.scene||0].nodes,a=s.length>1,n=[];for(const e of s){const o=r.nodes[e];if(n.push(i(e,0)),m(o)&&!a){o.extensions.MSFT_lod.ids.forEach(((e,o)=>i(e,o+1)))}}async function i(s,a){const l=r.nodes[s],u=o.getNodeTransform(s);if(null!=l.weights&&e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=l.mesh){const e=r.meshes[l.mesh];for(const o of e.primitives)n.push(t(o,u,a,e.name))}for(const e of l.children||[])n.push(i(e,a))}await Promise.all(n)}function m(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function d(e,o,s){const a=o=>{const t=`${s}_tex_${o&&o.id}${o?.name?"_"+o.name:""}`;if(o&&!e.textures.has(t)){const s=r(o.data,{wrap:{s:o.wrapS,t:o.wrapT},mipmap:T.has(o.minFilter),noUnpackFlip:!0});e.textures.set(t,s)}return t},n=`${s}_mat_${o.id}_${o.name}`;if(!e.materials.has(n)){const r=t({color:[o.color[0],o.color[1],o.color[2]],opacity:o.color[3],alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,doubleSided:o.doubleSided,colorMixMode:o.ESRI_externalColorMixMode,colorTexture:o.colorTexture?a(o.colorTexture):void 0,normalTexture:o.normalTexture?a(o.normalTexture):void 0,occlusionTexture:o.occlusionTexture?a(o.occlusionTexture):void 0,emissiveTexture:o.emissiveTexture?a(o.emissiveTexture):void 0,metallicRoughnessTexture:o.metallicRoughnessTexture?a(o.metallicRoughnessTexture):void 0,emissiveFactor:[o.emissiveFactor[0],o.emissiveFactor[1],o.emissiveFactor[2]],colorTextureTransform:o.colorTextureTransform,normalTextureTransform:o.normalTextureTransform,occlusionTextureTransform:o.occlusionTextureTransform,emissiveTextureTransform:o.emissiveTextureTransform,metallicRoughnessTextureTransform:o.metallicRoughnessTextureTransform,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,receiveShadows:o.receiveShadows,
|
|
5
|
+
import e from"../../../core/Logger.js";import{clone as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{makeMaterialParameters as t,makeTextureSource as r}from"./LoaderResult.js";import{GLTFResource as s}from"./internal/Resource.js";import{TextureSamplingMode as a,PrimitiveType as n}from"../../webgl/enums.js";let i=0;async function l(t,r,a={},l=!0){const m=await s.load(t,r,a),T="gltf_"+i++,p={lods:[],materials:new Map,textures:new Map,meta:u(m)},f=!(!m.json.asset.extras||"symbolResource"!==m.json.asset.extras.ESRI_type),x=m.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,g=new Map;await c(m,(async(t,r,s,i)=>{const u=g.get(s)??0;g.set(s,u+1);const c=void 0!==t.mode?t.mode:n.TRIANGLES,f=c===n.TRIANGLES||c===n.TRIANGLE_STRIP||c===n.TRIANGLE_FAN?c:null;if(null==f)return void e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+n[c]+"). Skipping primitive.");if(!m.hasPositions(t))return void e.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const x=m.getPositionData(t,a),h=m.getMaterial(t,a,l),w=m.hasNormals(t)?m.getNormalData(t,a):null,v=m.hasTangents(t)?m.getTangentData(t,a):null,S=m.hasTextureCoordinates(t)?m.getTextureCoordinates(t,a):null,R=m.hasVertexColors(t)?m.getVertexColors(t,a):null,_=m.getIndexData(t,a),E={name:i,transform:o(r),attributes:{position:await x,normal:w?await w:null,texCoord0:S?await S:null,color:R?await R:null,tangent:v?await v:null},indices:await _,primitiveType:f,material:d(p,await h,T)};let I=null;null!=p.meta?.ESRI_lod&&"screenSpaceRadius"===p.meta.ESRI_lod.metric&&(I=p.meta.ESRI_lod.thresholds[s]),p.lods[s]=p.lods[s]||{parts:[],name:i,lodThreshold:I},p.lods[s].parts[u]=E}));for(const e of p.lods)e.parts=e.parts.filter((e=>!!e));const h=await m.getLoadedBuffersSize();return{model:p,meta:{isEsriSymbolResource:f,uri:m.uri,ESRI_webstyle:x},customMeta:{},cachedMemory:h}}function u(e){const o=e.json;let t=null;return o.nodes.forEach((e=>{const o=e.extras;null!=o&&(o.ESRI_proxyEllipsoid||o.ESRI_lod)&&(t=o)})),t}async function c(o,t){const r=o.json,s=r.scenes[r.scene||0].nodes,a=s.length>1,n=[];for(const e of s){const o=r.nodes[e];if(n.push(i(e,0)),m(o)&&!a){o.extensions.MSFT_lod.ids.forEach(((e,o)=>i(e,o+1)))}}async function i(s,a){const l=r.nodes[s],u=o.getNodeTransform(s);if(null!=l.weights&&e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=l.mesh){const e=r.meshes[l.mesh];for(const o of e.primitives)n.push(t(o,u,a,e.name))}for(const e of l.children||[])n.push(i(e,a))}await Promise.all(n)}function m(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function d(e,o,s){const a=o=>{const t=`${s}_tex_${o&&o.id}${o?.name?"_"+o.name:""}`;if(o&&!e.textures.has(t)){const s=r(o.data,{wrap:{s:o.wrapS,t:o.wrapT},mipmap:T.has(o.minFilter),noUnpackFlip:!0});e.textures.set(t,s)}return t},n=`${s}_mat_${o.id}_${o.name}`;if(!e.materials.has(n)){const r=t({color:[o.color[0],o.color[1],o.color[2]],opacity:o.color[3],alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,doubleSided:o.doubleSided,colorMixMode:o.ESRI_externalColorMixMode,colorTexture:o.colorTexture?a(o.colorTexture):void 0,normalTexture:o.normalTexture?a(o.normalTexture):void 0,occlusionTexture:o.occlusionTexture?a(o.occlusionTexture):void 0,emissiveTexture:o.emissiveTexture?a(o.emissiveTexture):void 0,metallicRoughnessTexture:o.metallicRoughnessTexture?a(o.metallicRoughnessTexture):void 0,emissiveFactor:[o.emissiveFactor[0],o.emissiveFactor[1],o.emissiveFactor[2]],colorTextureTransform:o.colorTextureTransform,normalTextureTransform:o.normalTextureTransform,occlusionTextureTransform:o.occlusionTextureTransform,emissiveTextureTransform:o.emissiveTextureTransform,metallicRoughnessTextureTransform:o.metallicRoughnessTextureTransform,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,receiveShadows:o.receiveShadows,receiveAmbientOcclusion:o.receiveAmbientOcclusion});e.materials.set(n,r)}return n}const T=new Set([a.LINEAR_MIPMAP_LINEAR,a.LINEAR_MIPMAP_NEAREST]);export{l as loadGLTF};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as r,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{g as p,q as b,t as v,h as y,c as j,s as L,i as S,d as O}from"../../../chunks/vec32.js";import{create as w,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projection.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as C,distance2 as x,fromPoints as M,closestRayDistance2 as k}from"../../../geometry/support/lineSegment.js";import{create as I,fromPositionAndNormal as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as N}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as Y}from"../support/geometryUtils/ray.js";import J from"../webgl/RenderCamera.js";import{Object3D as K}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as Q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as Z,ManipulatorStateFlags as $}from"../../interactive/interfaces.js";class ee{constructor(e){this.metadata=void 0,this._camera=new J,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=w(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=Z.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),n=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+n;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),r=o*this.screenLocation.pixelSize,a=Y(this._camera,s,ne);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=k(M(e,o,oe),a);if(null!=l&&l<r*r){const t=p(N.get(),e,o);y(t,t,.5);const i=c(N.get());return this._camera.projectToRenderScreen(t,i),i[2]+n}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??R,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=Y(this._camera,s,ne);if(null==c)return null;const h=l(re,r),d=b(ue,e,h),_=v(ge,t,r);U(_,d,le);const u=_e;if(W(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+n;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=Y(this._camera,s,ne);if(null==h)return null;const d=l(re,r),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);U(u,_,le);const g=_e;if(!W(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],r);for(let t=1;t<s.length;t++){const i=v(de,s[t],r),o=x(M(e,i,oe),g);if(null!=o&&o<a*a){const t=p(N.get(),e,i);y(t,t,.5);const s=c(N.get());return this._camera.projectToRenderScreen(t,s),s[2]+n}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:Q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,fe,e.spatialReference)&&P(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?$.Focused:$.Unfocused)|(this.selected?$.Selected:$.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.visible=!1;continue}const e=(n&$.All)!==$.None,i=(n&Z.All)!==Z.None,a=!e||(s&n)==(n&$.All),c=!i||(this.state&n)==(n&Z.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new K({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return O(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,he,0,o.radius),F(s(he[0]),s(he[1]),i),!0}}}const se=n(),oe=C(),ne=B(),re=h(),ae=m(),ce=m(),le=I(),he=w(),de=w(),_e=w(),ue=w(),ge=w(),me=w(),fe=new A({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
|
|
5
|
+
import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as r,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{g as p,q as b,t as v,h as y,c as j,s as L,i as S,d as O}from"../../../chunks/vec32.js";import{create as w,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projection.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as C,distance2 as x,fromPoints as M,closestRayDistance2 as k}from"../../../geometry/support/lineSegment.js";import{create as I,fromPositionAndNormal as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as N}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as Y}from"../support/geometryUtils/ray.js";import J from"../webgl/RenderCamera.js";import{Object3D as K}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as Q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as Z,ManipulatorStateFlags as $}from"../../interactive/interfaces.js";class ee{constructor(e){this.metadata=void 0,this._camera=new J,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=w(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=Z.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),n=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+n;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),r=o*this.screenLocation.pixelSize,a=Y(this._camera,s,ne);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=k(M(e,o,oe),a);if(null!=l&&l<r*r){const t=p(N.get(),e,o);y(t,t,.5);const i=c(N.get());return this._camera.projectToRenderScreen(t,i),i[2]+n}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??R,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=Y(this._camera,s,ne);if(null==c)return null;const h=l(re,r),d=b(ue,e,h),_=v(ge,t,r);U(_,d,le);const u=_e;if(W(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+n;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=Y(this._camera,s,ne);if(null==h)return null;const d=l(re,r),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);U(u,_,le);const g=_e;if(!W(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],r);for(let t=1;t<s.length;t++){const i=v(de,s[t],r),o=x(M(e,i,oe),g);if(null!=o&&o<a*a){const t=p(N.get(),e,i);y(t,t,.5);const s=c(N.get());return this._camera.projectToRenderScreen(t,s),s[2]+n}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:Q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,fe,e.spatialReference)&&P(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?$.Focused:$.Unfocused)|(this.selected?$.Selected:$.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.visible=!1;continue}const e=(n&$.All)!==$.None,i=(n&Z.All)!==Z.None,a=!e||(s&n)==(n&$.All),c=!i||(this.state&n)==(n&Z.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new K({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:e})=>i.addMany(e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:e})=>i.removeMany(e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return O(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,he,0,o.radius),F(s(he[0]),s(he[1]),i),!0}}}const se=n(),oe=C(),ne=B(),re=h(),ae=m(),ce=m(),le=I(),he=w(),de=w(),_e=w(),ue=w(),ge=w(),me=w(),fe=new A({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,when as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as g}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as h}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{screenToMap3D as d,hideManipulatorWhileDragging as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as w}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as _}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorCollection as f}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as P}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as V}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as j}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as M}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as x}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as k}from"../../../../support/screenUtils.js";let O=class extends w{constructor(t){super(t),this._updatingHandles=new p,this.polygonState="initial",this.removeIncompleteOnCancel=!1,this.manipulators=new f,this._getSnappingContext=i((t=>new V({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new S(new P("point",v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new m})))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o});const r=j(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new M({view:t}),this._updatingHandles.add((()=>this.stagedPoint),(t=>{this.analysisViewData.stagedPoint=null!=t?g(t,new l):null}),n),x(this,(()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))})),this._setupManipulators(),this.addHandles([s((()=>"measured"===this.state),(()=>{this.finishToolCreation(),queueMicrotask((()=>{this.active&&(this.view.activeTool=null)}))}),n),this.analysisViewData.path.on("change",(()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")}))])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return!this.active||"ready"!==this.state&&"drawing"!==this.polygonState?null:"crosshair"}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices>2&&(t.close(),this.polygonState="measured",this._resetSnappingState())}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState="initial"}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",(()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some((t=>t.manipulator.grabbing));this.polygonState=t?"editing":"measured"}})),e=e=>{this.addHandles([_(e,((t,e,i,a)=>{const n=u(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:h}=D({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next((e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,m),t.location=m,e))).next(h),e.next(n).next(d(this.view)).next(...l).next((e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,g(e.mapEnd))}));const m=g(this.analysisViewData.path.getVertexPositionAsPoint(s))})),t(e)],e)};this.manipulators.forEach((({manipulator:t})=>{e(t)})),this.addHandles([this.manipulators.on("after-add",(({item:{manipulator:t}})=>{e(t)})),this.manipulators.on("after-remove",(({item:{manipulator:t}})=>this.removeHandles(t)))])}_handleImmediateDoubleClick(t){h(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!h(t))return;const e=k(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=k(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;"Enter"===t.key&&"drawing"===this.polygonState&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&("initial"===e||"drawing"===e)){const e=this._pick(t);if(null!=e?.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._snappingManager,t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t);if(null!=i?.mapPoint){const{mapPoint:t}=i,a=this._getSnappingContext(e),n=this._snappingOperation.update({point:t},this._snappingManager,a),s=g(n,new l);return this.analysisViewData.path.add(s),!0}return!1}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};t([o({readOnly:!0})],O.prototype,"state",null),t([o()],O.prototype,"polygonState",void 0),t([o({readOnly:!0})],O.prototype,"cursor",null),t([o()],O.prototype,"measurementView",void 0),t([o()],O.prototype,"removeIncompleteOnCancel",void 0),t([o({constructOnly:!0})],O.prototype,"view",void 0),t([o({constructOnly:!0})],O.prototype,"analysis",void 0),t([o({constructOnly:!0})],O.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],O.prototype,"manipulators",void 0),t([o()],O.prototype,"updating",null),t([o()],O.prototype,"stagedPoint",null),t([o()],O.prototype,"snappingOptions",null),O=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],O);const b=O;export{b as default};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{when as n,syncAndInitial as a,watch as s}from"../../../../../core/reactiveUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import u from"../../../../../geometry/Point.js";import{clonePoint as p}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as c}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{SurfaceType as m,screenToMap3D as h,hideManipulatorWhileDragging as g}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as v}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as P}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as y}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as f}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as w,resetProperties as S}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as _}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as M}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as b}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as L}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as x}from"../../../../support/screenUtils.js";let V=class extends y{constructor(t){super(t),this._updatingHandles=new l,this._emulatedDrag=null,this.lineState="initial",this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=i((t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new M(new _("point",f(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new d})))}initialize(){const{view:t,analysis:e,analysisViewData:i,visible:r}=this;this.measurementView=new v({toolState:this,view:t,analysis:e,analysisViewData:i,visible:r});const o=b(t);this._snappingManagerResult=o,this.addHandles(o);const{start:l,end:c,cursor:d}=this.measurementView.createManipulators(),m=(t,e,i)=>w(t,((t,n,a,s)=>{const r=g(t),o=this._snappingManager,l=this._getSnappingContext(s),c=this._updatingHandles,{lineState:d}=this;a=a.next(r).next(S(this,[i,e])).next((i=>{if("cursorPoint"!==e){const i=this.analysis[e];null!=i&&(t.location=i)}return i}));const m=h(this.view),v=t=>{const n=m(t);return n||"drawing"!==this.lineState&&"initial"!==this.lineState||(this[e]=null,this[i]=null),n};let P=n.next(r).next(v);if("touch"!==s||"editing"===d){const{snappingStep:t,cancelSnapping:e}=j({snappingManager:o,snappingContext:l,updatingHandles:c});a=a.next(e),P=P.next(...t)}P.next((t=>"start"!==t.action?t:null)).next((n=>{const a=p(n.mapEnd,new u);this[e]=a,t.location=a,this[i]=this._surfaceLocation(a,n.surfaceType)}))})),P=t=>t.events.on("grab-changed",(()=>{const t=l.grabbing||c.grabbing;this.lineState=t?"editing":"measured"}));this.addHandles([m(l,"startPoint","startPointSurfaceLocation"),m(c,"endPoint","endPointSurfaceLocation"),m(d,"cursorPoint","cursorPointSurfaceLocation"),P(l),P(c)]),this.manipulators.add(l),this.manipulators.add(c),this.manipulators.add(d),this.startManipulator=l,this.endManipulator=c,this.cursorManipulator=d,this.addHandles([n((()=>"measured"===this.state),(()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)}),a),s((()=>({startPointAvailable:null!=this.startPoint,endPointAvailable:null!=this.endPoint})),(({startPointAvailable:t,endPointAvailable:e})=>{this.startManipulator.available=t,this.endManipulator.available=e}),a)]),L(this)}destroy(){this._updatingHandles=e(this._updatingHandles),this.measurementView=e(this.measurementView)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(null==t.startPoint&&null==t.endPoint)return"ready";const{lineState:e}=this;return this.validMeasurement&&"editing"!==e&&"drawing"!==e?"measured":"measuring"}get cursor(){return
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{when as n,syncAndInitial as a,watch as s}from"../../../../../core/reactiveUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import u from"../../../../../geometry/Point.js";import{clonePoint as p}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as c}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{SurfaceType as m,screenToMap3D as h,hideManipulatorWhileDragging as g}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as v}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as P}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as y}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as f}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as w,resetProperties as S}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as _}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as M}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as b}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as L}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as x}from"../../../../support/screenUtils.js";let V=class extends y{constructor(t){super(t),this._updatingHandles=new l,this._emulatedDrag=null,this.lineState="initial",this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=i((t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new M(new _("point",f(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new d})))}initialize(){const{view:t,analysis:e,analysisViewData:i,visible:r}=this;this.measurementView=new v({toolState:this,view:t,analysis:e,analysisViewData:i,visible:r});const o=b(t);this._snappingManagerResult=o,this.addHandles(o);const{start:l,end:c,cursor:d}=this.measurementView.createManipulators(),m=(t,e,i)=>w(t,((t,n,a,s)=>{const r=g(t),o=this._snappingManager,l=this._getSnappingContext(s),c=this._updatingHandles,{lineState:d}=this;a=a.next(r).next(S(this,[i,e])).next((i=>{if("cursorPoint"!==e){const i=this.analysis[e];null!=i&&(t.location=i)}return i}));const m=h(this.view),v=t=>{const n=m(t);return n||"drawing"!==this.lineState&&"initial"!==this.lineState||(this[e]=null,this[i]=null),n};let P=n.next(r).next(v);if("touch"!==s||"editing"===d){const{snappingStep:t,cancelSnapping:e}=j({snappingManager:o,snappingContext:l,updatingHandles:c});a=a.next(e),P=P.next(...t)}P.next((t=>"start"!==t.action?t:null)).next((n=>{const a=p(n.mapEnd,new u);this[e]=a,t.location=a,this[i]=this._surfaceLocation(a,n.surfaceType)}))})),P=t=>t.events.on("grab-changed",(()=>{const t=l.grabbing||c.grabbing;this.lineState=t?"editing":"measured"}));this.addHandles([m(l,"startPoint","startPointSurfaceLocation"),m(c,"endPoint","endPointSurfaceLocation"),m(d,"cursorPoint","cursorPointSurfaceLocation"),P(l),P(c)]),this.manipulators.add(l),this.manipulators.add(c),this.manipulators.add(d),this.startManipulator=l,this.endManipulator=c,this.cursorManipulator=d,this.addHandles([n((()=>"measured"===this.state),(()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)}),a),s((()=>({startPointAvailable:null!=this.startPoint,endPointAvailable:null!=this.endPoint})),(({startPointAvailable:t,endPointAvailable:e})=>{this.startManipulator.available=t,this.endManipulator.available=e}),a)]),L(this)}destroy(){this._updatingHandles=e(this._updatingHandles),this.measurementView=e(this.measurementView)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(null==t.startPoint&&null==t.endPoint)return"ready";const{lineState:e}=this;return this.validMeasurement&&"editing"!==e&&"drawing"!==e?"measured":"measuring"}get cursor(){return!this.active||"ready"!==this.state&&"drawing"!==this.lineState?null:"crosshair"}get startPoint(){return this.analysis.startPoint}set startPoint(t){this.analysis.startPoint=t}get endPoint(){return this.analysis.endPoint}set endPoint(t){this.analysis.endPoint=t}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(t){this.measurementView.cursorPoint=t}get snappingOptions(){return this._snappingManager.options}get validMeasurement(){return null!=this.analysis.startPoint&&null!=this.analysis.endPoint}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}resetCreated(){super.resetCreated(),this.lineState="initial",this.measurementView.cursorPoint=null}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t)}}_handlePointerMove(t){if(!this.active||this.view.navigating)return;const{pointerType:e}=t;if("mouse"!==e)return;const i=x(t),{lineState:n,cursorManipulator:a,endManipulator:s}=this;let r=!1;null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=C(a,e,i),r=!0),"initial"===n&&(this._emulatedDrag?.update(i),r=!0),"drawing"===n&&(s.events.emit("drag",{action:"update",start:i,screenPoint:i}),r=!0),r&&t.stopPropagation()}_handleImmediateClick(t){if(!this.active)return;if(!c(t))return;const e=x(t),{pointerType:i}=t,{cursorManipulator:n,startManipulator:a,endManipulator:s,lineState:r}=this;let o=!1;switch(null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=C(n,i,e)),r){case"initial":if(this._emulatedDrag?.update(e),null!=this.cursorPoint){this._emulatedDrag?.end(e),this._emulatedDrag=null;const{cursorPoint:t}=this;this.startPoint=t,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,a.location=t,a.interactive=!1,s.interactive=!1,this.lineState="drawing",this._emulatedDrag=C(s,i,e),o=!0}break;case"drawing":this._emulatedDrag?.update(e),null!=this.endPoint&&(this._emulatedDrag?.end(e),this._emulatedDrag=null,a.interactive=!0,s.interactive=!0,this.lineState="measured",o=!0)}o&&t.stopPropagation()}_surfaceLocation(t,e){return e===m.GROUND?"on-the-surface":(t.z??0)>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_getElevation(t){return this.view.basemapTerrain.ready?P(this.view.elevationProvider,t)??0:0}get test(){}};function C(t,e,i){return t.events.emit("drag",{action:"start",pointerType:e,start:i,screenPoint:i}),{update:e=>t.events.emit("drag",{action:"update",start:e,screenPoint:e}),end:e=>t.events.emit("drag",{action:"end",start:e,screenPoint:e}),cancel:()=>t.events.emit("drag",{action:"cancel"})}}t([r({readOnly:!0})],V.prototype,"state",null),t([r()],V.prototype,"lineState",void 0),t([r({readOnly:!0})],V.prototype,"cursor",null),t([r()],V.prototype,"startPoint",null),t([r()],V.prototype,"endPoint",null),t([r()],V.prototype,"cursorPoint",null),t([r({constructOnly:!0})],V.prototype,"analysis",void 0),t([r({constructOnly:!0})],V.prototype,"analysisViewData",void 0),t([r()],V.prototype,"measurementView",void 0),t([r()],V.prototype,"removeIncompleteOnCancel",void 0),t([r({constructOnly:!0})],V.prototype,"view",void 0),t([r({readOnly:!0})],V.prototype,"validMeasurement",null),t([r({value:null})],V.prototype,"startPointSurfaceLocation",void 0),t([r({value:null})],V.prototype,"endPointSurfaceLocation",void 0),t([r({value:null})],V.prototype,"cursorPointSurfaceLocation",void 0),t([r()],V.prototype,"updating",null),V=t([o("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],V);const H=V;export{H 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{VisualElement as r}from"./VisualElement.js";import{Object3D as t}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as i}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as o}from"../../webgl-engine/lib/WebGLLayer.js";class c extends r{constructor(e){super(e),this._resources=null,this._transform=s()}get object(){return null!=this._resources?this._resources.object:null}get transform(){return this._transform}set transform(s){e(this._transform,s),null!=this._resources&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(null==this._resources)return;const e=this._resources.object;e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible}createResources(){this.destroyResources();const e=this.view.stage;if(!e)return;const s=new o(e,{pickable:!1,updatePolicy:i.SYNC}),r=new t({castShadow:!1});r.transformation=this._transform,this.createExternalResources(),this.createGeometries(r),
|
|
5
|
+
import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{VisualElement as r}from"./VisualElement.js";import{Object3D as t}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as i}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as o}from"../../webgl-engine/lib/WebGLLayer.js";class c extends r{constructor(e){super(e),this._resources=null,this._transform=s()}get object(){return null!=this._resources?this._resources.object:null}get transform(){return this._transform}set transform(s){e(this._transform,s),null!=this._resources&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(null==this._resources)return;const e=this._resources.object;e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible}createResources(){this.destroyResources();const e=this.view.stage;if(!e)return;const s=new o(e,{pickable:!1,updatePolicy:i.SYNC}),r=new t({castShadow:!1});r.transformation=this._transform,this.createExternalResources(),this.createGeometries(r),s.add(r),r.visible=this.visible,this._resources={layer:s,object:r}}destroyResources(){const e=this.view.stage;null!=this._resources&&e&&(this._resources.layer.destroy(),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){null!=this._resources&&(this._resources.object.visible=e)}}export{c as Object3DVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{watch as e,initial as s}from"../../../../core/reactiveUtils.js";import{Object3D as r}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as t}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as c}from"../../webgl-engine/lib/WebGLLayer.js";class i{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return null!=this._resources?this._resources.object:null}get resources(){return null!=this._resources?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();const e=this._resourceFactory.view.stage;if(null==this._resources||!e)return;const s=this._resources.object;s.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,s,this._resources.layer)}forEachMaterial(e){this._resources&&this._resourceFactory.forEachMaterial(this._resources.external,e)}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const i=this._resourceFactory,o=i.view,a=o.stage;if(!a)return;const h=new c(a,{pickable:!1,updatePolicy:t.SYNC}),u=new r({castShadow:!1}),l=i.createResources(u,h);
|
|
5
|
+
import{watch as e,initial as s}from"../../../../core/reactiveUtils.js";import{Object3D as r}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as t}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as c}from"../../webgl-engine/lib/WebGLLayer.js";class i{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return null!=this._resources?this._resources.object:null}get resources(){return null!=this._resources?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();const e=this._resourceFactory.view.stage;if(null==this._resources||!e)return;const s=this._resources.object;s.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,s,this._resources.layer)}forEachMaterial(e){this._resources&&this._resourceFactory.forEachMaterial(this._resources.external,e)}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const i=this._resourceFactory,o=i.view,a=o.stage;if(!a)return;const h=new c(a,{pickable:!1,updatePolicy:t.SYNC}),u=new r({castShadow:!1}),l=i.createResources(u,h);h.add(u);const _=i.cameraChanged,n=_?e((()=>o.state.camera),(e=>_(e)),s):null;this._resources={layer:h,object:u,external:l,cameraHandle:n},this._syncVisible()}_destroyResources(){null!=this._resources&&(this._resources.layer.destroy(),this._resources.object.dispose(),this._resources.cameraHandle?.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null)}_syncVisible(){null!=this._resources&&(this._resources.object.visible=this._visible)}}export{i as VisualElementResources};
|