@arcgis/core 4.22.0-next.20211021 → 4.22.0-next.20211025
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00ac1ce56f9885a8be83.js +1 -0
- package/assets/esri/core/workers/chunks/01c9afe41ab4ccc597c9.js +1 -0
- package/assets/esri/core/workers/chunks/02a3d14adc504a51fa24.js +1 -0
- package/assets/esri/core/workers/chunks/035a9ab0202d5386b782.js +1 -0
- package/assets/esri/core/workers/chunks/062bace5505f13689c7d.js +1 -0
- package/assets/esri/core/workers/chunks/06c7745d813bcb540ce8.js +1 -0
- package/assets/esri/core/workers/chunks/0950b488a60b2abc21fc.js +1 -0
- package/assets/esri/core/workers/chunks/0af396f2e0de681113ef.js +1 -0
- package/assets/esri/core/workers/chunks/131838059f0f81d8eaee.js +1 -0
- package/assets/esri/core/workers/chunks/146cba0d172ec2f4eba2.js +1 -0
- package/assets/esri/core/workers/chunks/17e49c0dfa5a5a6213e2.js +1 -0
- package/assets/esri/core/workers/chunks/1a0b08190274725dc956.js +1 -0
- package/assets/esri/core/workers/chunks/1add7f0779accdf8d204.js +1 -0
- package/assets/esri/core/workers/chunks/20b81d11e6286d347bfc.js +1 -0
- package/assets/esri/core/workers/chunks/{e596bd3de960d1dc1c57.js → 2207580a78ee292ed9b8.js} +1 -1
- package/assets/esri/core/workers/chunks/2d3646a83465c75986f9.js +1 -0
- package/assets/esri/core/workers/chunks/2d38ee3ef3ebe32a1194.js +1 -0
- package/assets/esri/core/workers/chunks/3737dcc3c0dea3ca05d5.js +1 -0
- package/assets/esri/core/workers/chunks/3e2042e70647c1afa6aa.js +1 -0
- package/assets/esri/core/workers/chunks/3ebfaab2855a2236a95d.js +1 -0
- package/assets/esri/core/workers/chunks/{d6fe616192a8efbfbc3e.js → 440f8101402a4c0d7019.js} +1 -1
- package/assets/esri/core/workers/chunks/4587d770767966985e22.js +1 -0
- package/assets/esri/core/workers/chunks/487b8892fae85810a8c0.js +1 -0
- package/assets/esri/core/workers/chunks/4901a78f32c3ea6b823b.js +1 -0
- package/assets/esri/core/workers/chunks/496fe47fc4d28e1a716d.js +1 -0
- package/assets/esri/core/workers/chunks/{9f22f47d4b2e72d7bdcf.js → 4c010119c24510ea31bb.js} +2 -2
- package/assets/esri/core/workers/chunks/{9f22f47d4b2e72d7bdcf.js.LICENSE.txt → 4c010119c24510ea31bb.js.LICENSE.txt} +0 -0
- package/assets/esri/core/workers/chunks/4f5076e1f2b18ce8156d.js +1 -0
- package/assets/esri/core/workers/chunks/{f291ebc4b089bd1f0a3f.js → 50e86a6bb13042b1dbac.js} +1 -1
- package/assets/esri/core/workers/chunks/{64d9a062c1f1ac08a3ac.js → 565020b1c02a8cb33c2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d78c60a22f76df7c48c7.js → 59640d78295e2e363f18.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0356f320a1b2fbd03f0.js → 5ac2b2598245aa17cdbd.js} +1 -1
- package/assets/esri/core/workers/chunks/5b4a8cce5601cc92c8a3.js +1 -0
- package/assets/esri/core/workers/chunks/5b92d5d4049622531109.js +1 -0
- package/assets/esri/core/workers/chunks/{751c1a2838b54a74a9a6.js → 5f3caa0ddb215342c728.js} +2 -2
- package/assets/esri/core/workers/chunks/615e995d5ce8fa044b09.js +1 -0
- package/assets/esri/core/workers/chunks/62a2453699e0dd2393b9.js +1 -0
- package/assets/esri/core/workers/chunks/67013547be1a7ae1670a.js +1 -0
- package/assets/esri/core/workers/chunks/67eddf4808f8888faeb4.js +1 -0
- package/assets/esri/core/workers/chunks/695dbedff2340aa019ba.js +1 -0
- package/assets/esri/core/workers/chunks/6a7e388c94206d2f61ff.js +1 -0
- package/assets/esri/core/workers/chunks/6e22b69d55e791ab3d9a.js +1 -0
- package/assets/esri/core/workers/chunks/71e6c0c5ef0aa7eb1703.js +1 -0
- package/assets/esri/core/workers/chunks/7a74e230439c5111f852.js +1 -0
- package/assets/esri/core/workers/chunks/7e76a8e6fa67e607d09e.js +1 -0
- package/assets/esri/core/workers/chunks/7fe4985ca0cb3e6d35c6.js +1 -0
- package/assets/esri/core/workers/chunks/8027330714ff5ffb020e.js +1 -0
- package/assets/esri/core/workers/chunks/844b564d1a422a17f6ac.js +1 -0
- package/assets/esri/core/workers/chunks/856f9281a08cb032238e.js +1 -0
- package/assets/esri/core/workers/chunks/89b4983de872780e9aa1.js +1 -0
- package/assets/esri/core/workers/chunks/8f3bc0cd2c2b01ab80cd.js +1 -0
- package/assets/esri/core/workers/chunks/8fd912e325ccd48b98a9.js +1 -0
- package/assets/esri/core/workers/chunks/901907a5c01f0fd1478f.js +1 -0
- package/assets/esri/core/workers/chunks/92a0b88a14c92239df8a.js +1 -0
- package/assets/esri/core/workers/chunks/972e9aeb3c29c9bf441a.js +1 -0
- package/assets/esri/core/workers/chunks/9758c34ce61c3714515a.js +1 -0
- package/assets/esri/core/workers/chunks/{457ea4feaa006d60c6b1.js → 9a04d087a29f0f3937a3.js} +1 -1
- package/assets/esri/core/workers/chunks/9b0bb171224b35ce2031.js +1 -0
- package/assets/esri/core/workers/chunks/9cbe7afdaef8720dfc8d.js +1 -0
- package/assets/esri/core/workers/chunks/9ccde5b6562f0007fe45.js +1 -0
- package/assets/esri/core/workers/chunks/9d320bbeedeea15522ab.js +1 -0
- package/assets/esri/core/workers/chunks/a001b3b4527817548094.js +1 -0
- package/assets/esri/core/workers/chunks/{197b72bca45065e0eb4a.js → a0c580d4a1915ddd3fe4.js} +1 -1
- package/assets/esri/core/workers/chunks/a4a9c15929b43d83701f.js +1 -0
- package/assets/esri/core/workers/chunks/a54d11f44721f808b82f.js +1 -0
- package/assets/esri/core/workers/chunks/a646a11673d513c00e7a.js +1 -0
- package/assets/esri/core/workers/chunks/a792e2bc7cafdc29f05e.js +1 -0
- package/assets/esri/core/workers/chunks/acae1771697034f265b1.js +1 -0
- package/assets/esri/core/workers/chunks/af2ee804a9c63eea610c.js +1 -0
- package/assets/esri/core/workers/chunks/b28b487047da3aeef3fd.js +1 -0
- package/assets/esri/core/workers/chunks/b3e57824a5855cb37a96.js +1 -0
- package/assets/esri/core/workers/chunks/b89449ead32e4cd21edd.js +1 -0
- package/assets/esri/core/workers/chunks/b99891ed5a02cab02173.js +1 -0
- package/assets/esri/core/workers/chunks/bac84bc621be73a7a4bc.js +1 -0
- package/assets/esri/core/workers/chunks/{25037dcf8a0c72b7b647.js → bbe068388167e9dd0c11.js} +1 -1
- package/assets/esri/core/workers/chunks/c271a1857bcc4e9a36dd.js +1 -0
- package/assets/esri/core/workers/chunks/{eb3035e49a45ecc82575.js → c5030664720fcdc6d85e.js} +1 -1
- package/assets/esri/core/workers/chunks/c534ed122f8a1202d3a3.js +1 -0
- package/assets/esri/core/workers/chunks/c5ef2e28b0c539ddb6a7.js +1 -0
- package/assets/esri/core/workers/chunks/c65e5ccfae03d148d82b.js +1 -0
- package/assets/esri/core/workers/chunks/c91660f3982be4e03705.js +1 -0
- package/assets/esri/core/workers/chunks/ce93113b99bdbeddd07b.js +1 -0
- package/assets/esri/core/workers/chunks/cf2d408e669cfa2c65be.js +1 -0
- package/assets/esri/core/workers/chunks/d08f63ffeecefa02ad91.js +1 -0
- package/assets/esri/core/workers/chunks/{8d33644192c01e5416b4.js → d1a71b58ef62e71979c5.js} +1 -1
- package/assets/esri/core/workers/chunks/d30eade5afecd334f6cb.js +1 -0
- package/assets/esri/core/workers/chunks/d8782d0856b9d815cb6c.js +1 -0
- package/assets/esri/core/workers/chunks/db16c21b650001502e6c.js +1 -0
- package/assets/esri/core/workers/chunks/db18110c57253a31ac96.js +1 -0
- package/assets/esri/core/workers/chunks/dbaa5fb466d6c0214f24.js +1 -0
- package/assets/esri/core/workers/chunks/deae370788a7aacf4dd5.js +1 -0
- package/assets/esri/core/workers/chunks/e6ca132e1eeea3aa174e.js +1 -0
- package/assets/esri/core/workers/chunks/e878ccc431729ef3360f.js +1 -0
- package/assets/esri/core/workers/chunks/eb124f15ad4b9193f00a.js +1 -0
- package/assets/esri/core/workers/chunks/ebc71c06c1c22aaef54e.js +1 -0
- package/assets/esri/core/workers/chunks/f183da283af0836421ab.js +1 -0
- package/assets/esri/core/workers/chunks/f42bdc2a134833d33b4e.js +1 -0
- package/assets/esri/core/workers/chunks/{736d628cda4e02d40337.js → f8612c2fc5739e98be58.js} +1 -1
- package/assets/esri/core/workers/chunks/f965e3e5f6f4f9ba54ac.js +1 -0
- package/assets/esri/core/workers/chunks/fa4089640f480b69962e.js +1 -0
- package/assets/esri/core/workers/chunks/fb219563e5169ea67d68.js +1 -0
- package/assets/esri/libs/i3s/i3s.wasm +0 -0
- package/chunks/ChapmanAtmosphere.glsl.js +56 -77
- package/chunks/Clouds.glsl.js +1 -1
- package/chunks/Pattern.glsl.js +9 -11
- package/chunks/RibbonLine.glsl.js +60 -68
- package/chunks/i3s.js +1 -1
- package/chunks/mat4.js +1 -1
- package/chunks/vec3.js +1 -1
- package/core/Collection.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/support/OwningCollection.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workers.js +2 -2
- package/geometry/projection.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +205 -497
- package/layers/ElevationLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VoxelWasmPerScene.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/analyses/AreaMeasurement3D.js +1 -1
- package/layers/analyses/DirectLineMeasurement3D.js +1 -1
- package/layers/analyses/Slice.js +1 -1
- package/layers/effects/EffectList.js +1 -1
- package/layers/effects/effects.js +1 -1
- package/layers/effects/jsonUtils.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/effects/utils.js +5 -0
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/package.json +2 -2
- package/portal/support/portalLayers.js +1 -1
- package/request.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/statistics/support/WorkerClient.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/GraphicsCollection.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/patterns/LinePattern3D.js +5 -0
- package/symbols/patterns/LineStylePattern3D.d.ts +4 -0
- package/symbols/patterns/LineStylePattern3D.js +5 -0
- package/symbols/patterns/StylePattern3D.js +1 -1
- package/symbols/patterns/lineStyles.js +5 -0
- package/symbols/patterns/utils.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +5 -0
- package/symbols/support/Symbol3DMaterial.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/defaults3D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/symbolLayerUtils3D.js +1 -1
- package/views/2d/engine/vectorTiles/TileParser.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/EditsQueue.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/externalRenderers.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
- package/views/3d/interactive/analysisTools/slice/images/Factory.js +5 -0
- package/views/3d/interactive/analysisTools/slice/sliceToolConfig.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/graphics/Slice/SliceController.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/analyses/AreaMeasurement3D/AreaMeasurementView3D.js +1 -1
- package/views/3d/layers/analyses/AreaMeasurement3D/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/layers/analyses/AreaMeasurement3D/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/layers/analyses/DirectLineMeasurement3D/DirectLineMeasurementView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/ElevationQuery.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/Loadable.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/graphics/pointUtils.js +1 -1
- package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/GoToOperation.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/support/StreamDataLoader.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +5 -0
- package/views/3d/support/TextureCollection.js +1 -1
- package/views/3d/support/debugFlags.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +13 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +10 -3
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialTexture.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextTexture.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/support/AllocationTracer.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/QueueProcessor.js +1 -1
- package/views/webgl/capabilities/load.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/BuildingExplorer/support/layerUtils.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0283801d442984997abe.js +0 -1
- package/assets/esri/core/workers/chunks/0419e14a520b8fcf3e7a.js +0 -1
- package/assets/esri/core/workers/chunks/05318446b6a40caea361.js +0 -1
- package/assets/esri/core/workers/chunks/09e714d4381649348ac9.js +0 -1
- package/assets/esri/core/workers/chunks/0cecd668b9d5d3f83293.js +0 -1
- package/assets/esri/core/workers/chunks/13a73a88efd4f464173e.js +0 -1
- package/assets/esri/core/workers/chunks/1576727e8174d672555b.js +0 -1
- package/assets/esri/core/workers/chunks/1a3cbeb0a53d03a51dad.js +0 -1
- package/assets/esri/core/workers/chunks/1b8524b617bfc6fe422c.js +0 -1
- package/assets/esri/core/workers/chunks/1dc1d750046912ff6cef.js +0 -1
- package/assets/esri/core/workers/chunks/21fa174c114640be5e40.js +0 -1
- package/assets/esri/core/workers/chunks/2a3f6e56079620421a02.js +0 -1
- package/assets/esri/core/workers/chunks/2a5bcc73e55986ad93fe.js +0 -1
- package/assets/esri/core/workers/chunks/2a6f2e3d639aae491171.js +0 -1
- package/assets/esri/core/workers/chunks/2c17d1bad17bcee53f7d.js +0 -1
- package/assets/esri/core/workers/chunks/2cea27a0d07aa9a88ad4.js +0 -1
- package/assets/esri/core/workers/chunks/2e193d97d199b29b00c2.js +0 -1
- package/assets/esri/core/workers/chunks/2eb41fdf0d0a3b0c3232.js +0 -1
- package/assets/esri/core/workers/chunks/2f09ea639ca5d1d6ca7e.js +0 -1
- package/assets/esri/core/workers/chunks/2fb847ab1440bd1bdf15.js +0 -1
- package/assets/esri/core/workers/chunks/402d22ebbae608760b4f.js +0 -1
- package/assets/esri/core/workers/chunks/44daef7f0cbc6f6af09f.js +0 -1
- package/assets/esri/core/workers/chunks/46899156159e398c693f.js +0 -1
- package/assets/esri/core/workers/chunks/46bf8921db25845c63c0.js +0 -1
- package/assets/esri/core/workers/chunks/4eb23554e375350f73b5.js +0 -1
- package/assets/esri/core/workers/chunks/551917be63a513dfa4de.js +0 -1
- package/assets/esri/core/workers/chunks/564f6f5484bcb13ebb2b.js +0 -1
- package/assets/esri/core/workers/chunks/61df67ae47b7fb5875d9.js +0 -1
- package/assets/esri/core/workers/chunks/62642a8fc7bafe339984.js +0 -1
- package/assets/esri/core/workers/chunks/6304f4e53027df04eb8f.js +0 -1
- package/assets/esri/core/workers/chunks/6331987617ad166ea098.js +0 -1
- package/assets/esri/core/workers/chunks/6b13fcbc71c0088d317e.js +0 -1
- package/assets/esri/core/workers/chunks/6f7a6841e7269d2764ad.js +0 -1
- package/assets/esri/core/workers/chunks/70110efd2de23d9a5263.js +0 -1
- package/assets/esri/core/workers/chunks/7eae3f0588cde44fce39.js +0 -1
- package/assets/esri/core/workers/chunks/80d3c7a429c6412f1a8d.js +0 -1
- package/assets/esri/core/workers/chunks/80deebdf54bea04a0889.js +0 -1
- package/assets/esri/core/workers/chunks/81aa5fe7dcb4fdeb0974.js +0 -1
- package/assets/esri/core/workers/chunks/840d08b41913cad4df89.js +0 -1
- package/assets/esri/core/workers/chunks/85d154aeb511c5d70bb1.js +0 -1
- package/assets/esri/core/workers/chunks/8681e99e2bc9ece61c43.js +0 -1
- package/assets/esri/core/workers/chunks/8e5ef967f6518f4c93b1.js +0 -1
- package/assets/esri/core/workers/chunks/8edd7f70c8b95c34125c.js +0 -1
- package/assets/esri/core/workers/chunks/9044a7b90a53312b6392.js +0 -1
- package/assets/esri/core/workers/chunks/905b4dfc1ce57a225fa4.js +0 -1
- package/assets/esri/core/workers/chunks/945f90b31ebfae623ea0.js +0 -1
- package/assets/esri/core/workers/chunks/9943fd69b67cd1871d68.js +0 -1
- package/assets/esri/core/workers/chunks/9ad91c23480ffb656030.js +0 -1
- package/assets/esri/core/workers/chunks/9d103681372ab01a4147.js +0 -1
- package/assets/esri/core/workers/chunks/9d3230f59b4c4d1b2713.js +0 -1
- package/assets/esri/core/workers/chunks/9db75bc0980d16b730a1.js +0 -1
- package/assets/esri/core/workers/chunks/a0659b8bdc067da7badd.js +0 -1
- package/assets/esri/core/workers/chunks/a480ee9a994410177961.js +0 -1
- package/assets/esri/core/workers/chunks/a9b279975d7df0f295d7.js +0 -1
- package/assets/esri/core/workers/chunks/aa3abaa5ad4a5a3bcb84.js +0 -1
- package/assets/esri/core/workers/chunks/aa8e607f908297786675.js +0 -1
- package/assets/esri/core/workers/chunks/ab5a302b5f62d38293f9.js +0 -1
- package/assets/esri/core/workers/chunks/abd6a84396e0eb3f01ad.js +0 -1
- package/assets/esri/core/workers/chunks/abe9f8516b03a3fb0477.js +0 -1
- package/assets/esri/core/workers/chunks/aff6aa5c7f75f8e052d9.js +0 -1
- package/assets/esri/core/workers/chunks/b601cc5304b132536239.js +0 -1
- package/assets/esri/core/workers/chunks/b85f614ddbddd3c3007e.js +0 -1
- package/assets/esri/core/workers/chunks/b944f4ab25a691b3e611.js +0 -1
- package/assets/esri/core/workers/chunks/bbdacddb61e651ca0098.js +0 -1
- package/assets/esri/core/workers/chunks/c2fa728e805637a1783e.js +0 -1
- package/assets/esri/core/workers/chunks/c901f5f85d962254fc2c.js +0 -1
- package/assets/esri/core/workers/chunks/ca173b908d89a4e334f6.js +0 -1
- package/assets/esri/core/workers/chunks/cc2ef3bfa1f614d7452c.js +0 -1
- package/assets/esri/core/workers/chunks/cdb32a9ac9f5804c4212.js +0 -1
- package/assets/esri/core/workers/chunks/ce9a4997973da80141a5.js +0 -1
- package/assets/esri/core/workers/chunks/d0674b50a358d3bb9db2.js +0 -1
- package/assets/esri/core/workers/chunks/d18b7b4b3b9bea7204b0.js +0 -1
- package/assets/esri/core/workers/chunks/d2ce983f7babdf18a0ed.js +0 -1
- package/assets/esri/core/workers/chunks/d38a0d867dc6cecdc551.js +0 -1
- package/assets/esri/core/workers/chunks/e39ca33e9e463c1d6060.js +0 -1
- package/assets/esri/core/workers/chunks/e471d103205018a5cf7f.js +0 -1
- package/assets/esri/core/workers/chunks/e542fb044fc96f7e8af2.js +0 -1
- package/assets/esri/core/workers/chunks/e94e00a28591337b2def.js +0 -1
- package/assets/esri/core/workers/chunks/eb2709ccbc001f42ac1b.js +0 -1
- package/assets/esri/core/workers/chunks/f905511ca5f9b59fc17f.js +0 -1
- package/assets/esri/core/workers/chunks/f910e80dd87727af5184.js +0 -1
- package/assets/esri/core/workers/chunks/f9300a24305b0af1d227.js +0 -1
- package/assets/esri/core/workers/chunks/fa1e1ac5b3ef7bdf8a78.js +0 -1
- package/assets/esri/core/workers/chunks/fce76a84c7d25d8d47e8.js +0 -1
- package/assets/esri/core/workers/chunks/fef4f97fbe861a1b60e8.js +0 -1
- package/layers/AreaMeasurementLayer.d.ts +0 -4
- package/layers/DirectLineMeasurementLayer.d.ts +0 -4
- package/symbols/support/symbolPreview.d.ts +0 -4
- package/symbols/support/symbolPreview.js +0 -5
- package/views/3d/layers/AreaMeasurementLayerView3D.d.ts +0 -4
- package/views/3d/layers/DirectLineMeasurementLayerView3D.d.ts +0 -4
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../geometry.js";import{neverReached as e}from"../../../../../core/compilerUtils.js";import t from"../../../../../core/Logger.js";import{rad2deg as i,deg2rad as s}from"../../../../../core/mathUtils.js";import{isNone as o,isSome as r,unwrapOr as n}from"../../../../../core/maybe.js";import{castRenderScreenPointArray3 as a}from"../../../../../core/screenUtils.js";import{r as c,i as l,f as m,m as g,c as d,t as u,w as p}from"../../../../../chunks/mat4.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{r as b}from"../../../../../chunks/quat.js";import{a as h,g as w,d as y,c as j,n as M,b as k,l as v,f as P,p as O,s as T}from"../../../../../chunks/vec3.js";import{a as U,c as R,f as S}from"../../../../../chunks/vec3f64.js";import{r as L,f as A,i as E,a as C,n as F,u as G}from"../../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as I,fromVectorsAndPoint as x}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{angleAroundAxis as D}from"../../../../../geometry/support/vector.js";import{sv3d as B,sm4d as H,sq4d as V}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as q}from"../../Manipulator3D.js";import{calculateTranslateRotateFromBases as N}from"../../manipulatorUtils.js";import{SHIFT_RESTART_TIP_RADIUS as W,RESIZE_HANDLE_EDGE_PADDING_FRAC as Z,SMALL_ANGLE_DOT_THRESHOLD as $,PLANE_MIN_BASIS_SCREEN_LEN2 as J,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as K,SHIFT_RESTART_OFFSET_DISTANCE as Q,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as X,SHIFT_RESTART_ARROW_TIP_COLOR as Y,SHIFT_RESTART_ARROW_CAP_COLOR as _,SHIFT_RESTART_TUBE_COLOR as ee,SHIFT_RESTART_OUTLINE_COLOR as te,SHIFT_RESTART_CALLOUT_COLOR as ie,ROTATE_HEADING_OFFSET_DISTANCE as se,ROTATE_HEADING_DISC_RADIUS as oe,ROTATE_HEADING_CALLOUT_COLOR as re,PLANE_OUTLINE_COLOR as ne,PLANE_OUTLINE_WIDTH as ae,PLANE_BACKGROUND_COLOR as ce,GRID_COLOR as le,HANDLE_COLOR as me,RESIZE_HANDLE_CORNER_INPUT_RADIUS as ge,RESIZE_HANDLE_EDGE_INPUT_RADIUS as de,ROTATE_HEADING_TIP_LENGTH as ue,VERTICAL_DOT_THRESHOLD as pe,ROTATE_HEADING_DISC_RADIUS_FOCUS_MULTIPLIER as fe,DISPLAY_FOCUS_MULTIPLIER as be,RESIZE_HANDLE_EDGE_WIDTH as he,SHIFT_RESTART_ARROW_LENGTH as we,SHIFT_RESTART_TUBE_RADIUS as ye,SHIFT_RESTART_TIP_LENGTH as je,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as Me,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as ke,RESIZE_HANDLE_CORNER_WIDTH as ve}from"./sliceToolConfig.js";import{LineVisualElement as Pe}from"../../visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as Oe}from"../../visualElements/SlicePlaneVisualElement.js";import{getElevationAtPoint as Te}from"../../../support/ElevationProvider.js";import{fromRender as Ue}from"../../../support/geometryUtils/ray.js";import{Geometry as Re}from"../../../webgl-engine/lib/Geometry.js";import Se from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as Le}from"../../../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as Ae}from"../../../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as Ee}from"../../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Ce}from"../../../webgl-engine/materials/RibbonLineMaterial.js";import Fe from"../../../../../widgets/Slice/SlicePlane.js";import Ge from"../../../../../geometry/Point.js";const Ie=t.getLogger("esri.views.3d.interactive.analysisTools.slice.sliceToolUtils");function xe(e,t,i,s,o,r,n,a){return ze(t,n.worldUpAtPosition(e,B.get()),o,r,a.basis1,a.basis2),h(a.basis1,a.basis1,i),h(a.basis2,a.basis2,s),w(a.origin,e),x(a.basis2,a.basis1,a.origin,a.plane),a}function ze(e,t,i,s,o,r){const n=y(e,t),a=B.get(),c=B.get();switch(0===s?Math.abs(n)>pe?1:2:s){case 2:{const s=Math.abs(n)<=$?e:i.viewUp;j(a,s,t),w(c,t);break}case 1:j(a,i.viewUp,t),j(c,t,a);break;case 3:{const s=Math.abs(n)<=$?t:i.viewUp;j(a,s,e),j(c,e,a);break}}const l=j(B.get(),a,c);y(l,i.viewForward)>0&&h(c,c,-1),M(o,a),M(r,c)}function De(e,t,i){const s=t.worldUpAtPosition(e.origin,B.get()),o=e.basis1,r=mt(e,s),n=Math.round(r/yt)*yt;return L(e,n-r,o,i)}function Be(e,t,i,s,o,r){const n=w(B.get(),o.origin);k(n,n,h(B.get(),o.basis1,e.direction[0]<0?1:-1)),k(n,n,h(B.get(),o.basis2,e.direction[1]<0?1:-1));const a=v(o.basis1),c=v(o.basis2),l=P(B.get(),i,n),m=P(B.get(),t,n);let g=0,d=0;if(et(e)){const t=_e(o),i=_e(r);g=a-.5*e.direction[0]*y(o.basis1,m)/a,d=c-.5*e.direction[1]*y(o.basis2,m)/c;const s=i/t;g*=s,d*=s}const u=g+.5*e.direction[0]*y(o.basis1,l)/a,p=d+.5*e.direction[1]*y(o.basis2,l)/c,f=h(B.get(),o.basis1,u/a),b=h(B.get(),o.basis2,p/c);(u<=0||Xe(r.origin,f,s)<=J)&&w(f,r.basis1),(p<=0||Xe(r.origin,b,s)<=J)&&w(b,r.basis2);const j=w(B.get(),n);return k(j,j,h(B.get(),f,e.direction[0]<0?-1:1)),k(j,j,h(B.get(),b,e.direction[1]<0?-1:1)),A(j,f,b,r)}function He(e,t){return K*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Ve(e,t,i,s){const o=j(B.get(),t,i);return j(o,o,t),I(e,o,s)}function qe(e,t){return N(e.basis1,e.basis2,e.origin,t)}function Ne(e,t,i,s){const o=t.worldUpAtPosition(e.origin,B.get()),r=B.get();switch(i){case 1:w(r,o);break;case 2:w(r,e.basis1)}return I(e.origin,r,s)}function We(e,t,i,s){const o=Qe(i,2),r=H.get();c(r,t,o.edge*Math.PI/2);const n=M(B.get(),o.basis);let l=h(B.get(),n,o.direction*s.computeScreenPixelSizeAt(o.position)*Q);k(l,l,o.position);const m=s.projectToRenderScreen(l,a(B.get())),g=Ze(s,m);Ue(s,m,wt),M(wt.direction,wt.direction);const d=B.get();!g&&E(i,wt,d)&&(l=d),r[12]=0,r[13]=0,r[14]=0,e.modelTransform=r,e.renderLocation=U(l),g?e.state|=ht:e.state&=~ht}function Ze(e,t){const[i,s,o,r]=e.viewport,n=Math.min(o,r)/16;let a=!0;return t[0]<i+n?(t[0]=i+n,a=!1):t[0]>i+o-n&&(t[0]=i+o-n,a=!1),t[1]<s+n?(t[1]=s+n,a=!1):t[1]>s+r-n&&(t[1]=s+r-n,a=!1),a}function $e(e,t,i,s){const o=v(s.basis1),r=v(s.basis2),n=Ye(s),a=_e(s),d=T(B.get(),0,0,0);k(d,h(B.get(),s.basis1,t.direction[0]),h(B.get(),s.basis2,t.direction[1])),k(d,s.origin,d);let u=0,p=1;if(et(t))1===t.direction[0]&&-1===t.direction[1]?u=yt:1===t.direction[0]&&1===t.direction[1]?u=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(u=3*Math.PI/2),p=a;else{const e=0!==t.direction[0]?1:2;u=1===e?yt:0,p=(1===e?r:o)-n}const f=l(H.get());c(f,f,u),m(f,f,T(B.get(),p,p,p)),g(f,i,f),f[12]=0,f[13]=0,f[14]=0,e.modelTransform=f,e.renderLocation=d}function Je(e,t,i,s){const o=s.worldUpAtPosition(i.origin,B.get()),r=Qe(i,0),n=l(H.get());c(n,n,r.edge*Math.PI/2),d(n,n,-mt(i,o)),g(n,t,n),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=r.position}function Ke(e,t,i){const s=Qe(i,1),o=l(H.get());c(o,o,s.edge*Math.PI/2),d(o,o,yt),g(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=s.position}function Qe(e,t){switch(t){case 0:return{basis:e.basis1,direction:1,position:k(B.get(),e.origin,e.basis1),edge:t};case 1:return{basis:e.basis2,direction:1,position:k(B.get(),e.origin,e.basis2),edge:t};case 2:return{basis:e.basis1,direction:-1,position:P(B.get(),e.origin,e.basis1),edge:t};case 3:return{basis:e.basis2,direction:-1,position:P(B.get(),e.origin,e.basis2),edge:t}}}function Xe(e,t,i){const s=i.projectToRenderScreen(k(B.get(),e,t),a(B.get())),o=i.projectToRenderScreen(P(B.get(),e,t),a(B.get()));return O(P(s,s,o))}function Ye(e){const t=v(e.basis1),i=v(e.basis2);return Z*Math.min(t,i)}function _e(e){return Ye(e)}function et(e){return 0!==e.direction[0]&&0!==e.direction[1]}function tt(e,t=1){const i=0===t?Q:0,s=[S(i,0,-we/2),S(i,0,we/2)],o=ct(s,!0),r=(e,t)=>nt(s,s,{tubeRadius:ye,tipRadius:W,tipLength:je,tubeFocusMultiplier:Me,tipFocusMultiplier:ke,padding:e,bothEnds:!0,flat:null,focusTipLength:!0,addCap:t}),n=r(0,!1),a=r(X,!0),c=new Le({color:Y,cullFace:2,renderOccluded:16}),l=new Le({color:_,cullFace:2,renderOccluded:16}),m=new Le({color:ee,cullFace:2,renderOccluded:16}),g=new Le({color:te,transparent:!0,writeDepth:!1,cullFace:1,renderOccluded:2}),d=Se.createPolylineGeometry([[i,0,0],[i-Q,0,0]]),u=Se.createPolylineGeometry([[i,0,0],[i-Q,0,0]]),p=new Ee({color:ie,renderOccluded:4});return new q({view:e,renderObjects:[...n.normal.map((({part:e,geometry:t,transform:i})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:m,transform:i,stateMask:1|bt}))),...a.normal.map((({geometry:e,transform:t})=>({geometry:e,material:g,transform:t,stateMask:1|bt}))),{geometry:d,material:p,stateMask:1|bt|ht},...n.focused.map((({part:e,geometry:t,transform:i})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:m,transform:i,stateMask:2|bt}))),...a.focused.map((({geometry:e,transform:t})=>({geometry:e,material:g,transform:t,stateMask:2|bt}))),{geometry:u,material:p,stateMask:2|bt|ht}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[o]},collisionPriority:1,radius:W,state:bt})}function it(e,t){const i=new Ae({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:16}),s=se,o=oe,r=o*fe,n=e=>{const t=new Uint32Array([0,1,2,2,3,0]);return new Re([["position",{size:3,data:[s-e,-e,0,s+e,-e,0,s+e,e,0,s-e,e,0],exclusive:!0}],["uv0",{size:2,data:[0,0,1,0,1,1,0,1]}]],[["position",t],["uv0",t]])},a=Se.createPolylineGeometry([[0,0,0],[s-o,0,0]]),c=Se.createPolylineGeometry([[0,0,0],[s-r,0,0]]),l=new Ee({color:re,renderOccluded:4}),m=[{geometry:n(o),material:i,stateMask:1|bt},{geometry:a,material:l,stateMask:1|bt},{geometry:n(r),material:i,stateMask:2|bt},{geometry:c,material:l,stateMask:2|bt}];return new q({view:e,renderObjects:m,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[s,0,0]},collisionPriority:1,radius:o/2,state:bt})}function st(e){return new Pe({view:e,attached:!0,color:ne,width:ae,writeDepthEnabled:!1,renderOccluded:4,geometry:[[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]]]})}function ot(e){return new Oe({view:e,attached:!0,backgroundColor:[...ce],gridColor:le,gridWidth:4,renderOccluded:4})}function rt(e,t){const i=et(t),s=i?[S(1,0,0),S(0,0,0),S(0,1,0)]:[S(1,0,0),S(-1,0,0)],o=Se.createPolylineGeometry(s),r=[...me,1],n=e=>new Ce({color:r,width:e,renderOccluded:4}),a=()=>new Ee({color:r,renderOccluded:4}),c=i?ve:he,l=c*be,m=he,g=e=>e>1?n(e):a(),d=[{geometry:o,material:g(c),stateMask:1|jt},{geometry:o,material:g(l),stateMask:2|jt},{geometry:o,material:g(m),stateMask:Mt}],u=new q({view:e,renderObjects:d,collisionType:{type:"line",paths:[s]},autoScaleRenderObjects:!1,worldSized:!0,radius:i?ge:de,idHint:i?1:2});return u.state=jt,u}function nt(e,t,i){const s=s=>{const o=(s?t:e).slice(0),n=P(B.get(),o[0],o[1]);M(n,n);const a=P(B.get(),o[o.length-1],o[o.length-2]);if(M(a,a),i.padding>0){const e=h(R(),a,-i.padding);if(o[o.length-1]=k(e,e,o[o.length-1]),i.bothEnds){const e=h(R(),n,-i.padding);o[0]=k(e,e,o[0])}}const c=s?i.tipFocusMultiplier:1,d=i.tipLength*(i.focusTipLength?c:1),w=i.tipRadius*c,y=l(H.get());if(i.padding>0){const e=d/4,t=T(B.get(),0,e,0),s=1+i.padding/e;u(y,y,t),m(y,y,T(B.get(),s,s,s)),u(y,y,h(t,t,-1/s))}const j=l(f()),v=S(0,1,0),O=p(f(),b(V.get(),v,a));O[12]=o[o.length-1][0],O[13]=o[o.length-1][1],O[14]=o[o.length-1][2],g(O,O,y);const U=[{part:"tube",geometry:at(i.tubeRadius*(s?i.tubeFocusMultiplier:1)+i.padding,i.flat,o),transform:j}];let L,A;if(r(i.flat)?L=Se.createExtrudedTriangle(d,w,w,i.flat.thickness):(L=Se.createConeGeometry(d,w,24,!1,!1,!0),A=Se.createConeGeometry(d,w,24,!1,!0,!1)),U.push({part:"tip",geometry:L,transform:O}),A&&U.push({part:"cap",geometry:A,transform:O}),i.bothEnds){const e=p(f(),b(V.get(),v,n));e[12]=o[0][0],e[13]=o[0][1],e[14]=o[0][2],g(e,e,y),U.push({part:"tip",geometry:L,transform:e}),A&&U.push({part:"cap",geometry:A,transform:e})}return U};return{normal:s(!1),focused:s(!0)}}function at(e,t,i){const s=[];if(r(t))s.push([e,t.thickness/2],[-e,t.thickness/2],[-e,-t.thickness/2],[e,-t.thickness/2]);else{const t=12;for(let i=0;i<t;i++){const o=i/t*2*Math.PI;s.push([Math.cos(o)*e,Math.sin(o)*e])}}return Se.createPathExtrusionGeometry(s,i,[],[],!1)}function ct(e,t){const i=P(R(),e[e.length-1],e[e.length-2]);if(M(i,i),h(i,i,ue),k(i,i,e[e.length-1]),t){const t=P(R(),e[0],e[1]);return M(t,t),h(t,t,ue),k(t,t,e[0]),[t,...e,i]}return[...e,i]}function lt(e,t,s,n=new Fe){if(o(e))return null;const a=r(n.position)?n.position:new Ge;t.fromRenderCoords(e.origin,a,s),n.position=a;const c=t.worldUpAtPosition(e.origin,B.get()),l=t.worldBasisAtPosition(e.origin,1,B.get());return n.width=2*v(e.basis1),n.height=2*v(e.basis2),n.tilt=i(mt(e,c)),n.heading=i(gt(e,c,l)),n}function mt(e,t){return D(t,e.basis2,e.basis1)+yt}function gt(e,t,i){return D(e.basis1,i,t)-yt}function dt(e,t,i,o,r,n,a=C()){return n.toRenderCoords(e,a.origin)?(n.worldBasisAtPosition(a.origin,0,a.basis1),n.worldBasisAtPosition(a.origin,1,a.basis2),x(a.basis2,a.basis1,a.origin,a.plane),L(a,-s(t),F(a),a),L(a,s(i),a.basis1,a),h(a.basis1,a.basis1,o/2),h(a.basis2,a.basis2,r/2),G(a),a):(Ie.error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function ut(e,t,i=C()){return o(e)||o(e.position)?null:dt(e.position,e.heading,e.tilt,e.width,e.height,t,i)}function pt(e,t,i=C()){if(o(e)||o(e.position))return null;let s=e.position;return e.position.hasZ||(s=e.position.clone(),s.z=n(Te(t.elevationProvider,e.position),0)),dt(s,e.heading,e.tilt,e.width,e.height,t.renderCoordsHelper,i)}function ft(t){switch(t.type){case"analysis":case"building-scene":case"csv":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"line-of-sight":case"map-notes":case"ogc-feature":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"open-street-map":case"tile":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return e(t.type),!1}}const bt=16,ht=32,wt=z(),yt=Math.PI/2,jt=16,Mt=32;export{bt as DidPointerMoveRecentlyFlag,ht as IsShiftEdgeOnScreenFlag,ct as addArrowTips,qe as calculateBoundedPlaneTranslateRotate,_e as calculateDiagonalResizeHandleScale,He as calculatePlaneHalfSize,Ye as calculateResizeHandlePadding,Xe as calculateScreenSpaceBasisLength2,nt as createArrowGeometry,ot as createGridVisualElement,st as createOutlineVisualElement,xe as createPlane,rt as createResizeManipulator,it as createRotateManipulator,Ne as createRotatePlane,tt as createShiftManipulator,Ve as createShiftPlane,De as forceHorizontalOrVertical,ft as isAlwaysDrapedLayer,et as isDiagonalResizeHandle,ze as normalToBases,lt as planeToShape,jt as resizeNormal,Mt as resizeOutlineOnly,Be as resizePlane,pt as shapeToElevationAlignedPlane,ut as shapeToPlane,$e as updateResizeHandle,Je as updateRotateHeadingHandle,Ke as updateRotateTiltHandle,We as updateShiftRestartHandle};
|
|
5
|
+
import"../../../../../geometry.js";import{neverReached as e}from"../../../../../core/compilerUtils.js";import t from"../../../../../core/Logger.js";import{rad2deg as i,deg2rad as s}from"../../../../../core/mathUtils.js";import{isNone as o,isSome as r,unwrapOr as n}from"../../../../../core/maybe.js";import{castRenderScreenPointArray3 as a}from"../../../../../core/screenUtils.js";import{r as c,i as l,f as m,m as g,c as d,t as u,w as p}from"../../../../../chunks/mat4.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{r as b}from"../../../../../chunks/quat.js";import{a as h,g as w,d as y,c as j,n as M,b as k,l as v,f as P,p as O,s as T}from"../../../../../chunks/vec3.js";import{a as U,c as R,f as S}from"../../../../../chunks/vec3f64.js";import{r as L,f as A,i as E,a as C,n as F,u as G}from"../../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as I,fromVectorsAndPoint as x}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{angleAroundAxis as D}from"../../../../../geometry/support/vector.js";import{sv3d as B,sm4d as V,sq4d as q}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as H}from"../../Manipulator3D.js";import{calculateTranslateRotateFromBases as N}from"../../manipulatorUtils.js";import{SHIFT_RESTART_TIP_RADIUS as W,RESIZE_HANDLE_EDGE_PADDING_FRAC as Z,SMALL_ANGLE_DOT_THRESHOLD as $,PLANE_MIN_BASIS_SCREEN_LEN2 as J,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as K,SHIFT_RESTART_OFFSET_DISTANCE as Q,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as X,SHIFT_RESTART_ARROW_TIP_COLOR as Y,SHIFT_RESTART_ARROW_CAP_COLOR as _,SHIFT_RESTART_TUBE_COLOR as ee,SHIFT_RESTART_OUTLINE_COLOR as te,SHIFT_RESTART_CALLOUT_COLOR as ie,ROTATE_HEADING_OFFSET_DISTANCE as se,ROTATE_HEADING_DISC_RADIUS as oe,ROTATE_HEADING_CALLOUT_COLOR as re,PLANE_OUTLINE_COLOR as ne,PLANE_OUTLINE_WIDTH as ae,PLANE_BACKGROUND_COLOR as ce,GRID_COLOR as le,RESIZE_HANDLE_CORNER_INPUT_RADIUS as me,RESIZE_HANDLE_EDGE_INPUT_RADIUS as ge,ROTATE_HEADING_TIP_LENGTH as de,VERTICAL_DOT_THRESHOLD as ue,ROTATE_HEADING_DISC_RADIUS_FOCUS_MULTIPLIER as pe,RESIZE_HANDLE_COLOR as fe,DISPLAY_FOCUS_MULTIPLIER as be,RESIZE_HANDLE_EDGE_WIDTH as he,SHIFT_RESTART_ARROW_LENGTH as we,SHIFT_RESTART_TUBE_RADIUS as ye,SHIFT_RESTART_TIP_LENGTH as je,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as Me,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as ke,RESIZE_HANDLE_CORNER_WIDTH as ve}from"./sliceToolConfig.js";import{LineVisualElement as Pe}from"../../visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as Oe}from"../../visualElements/SlicePlaneVisualElement.js";import{getElevationAtPoint as Te}from"../../../support/ElevationProvider.js";import{fromRender as Ue}from"../../../support/geometryUtils/ray.js";import{Geometry as Re}from"../../../webgl-engine/lib/Geometry.js";import Se from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as Le}from"../../../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as Ae}from"../../../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as Ee}from"../../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Ce}from"../../../webgl-engine/materials/RibbonLineMaterial.js";import Fe from"../../../../../widgets/Slice/SlicePlane.js";import Ge from"../../../../../geometry/Point.js";const Ie=t.getLogger("esri.views.3d.interactive.analysisTools.slice.sliceToolUtils");function xe(e,t,i,s,o,r,n,a){return ze(t,n.worldUpAtPosition(e,B.get()),o,r,a.basis1,a.basis2),h(a.basis1,a.basis1,i),h(a.basis2,a.basis2,s),w(a.origin,e),x(a.basis2,a.basis1,a.origin,a.plane),a}function ze(e,t,i,s,o,r){const n=y(e,t),a=B.get(),c=B.get();switch(0===s?Math.abs(n)>ue?1:2:s){case 2:{const s=Math.abs(n)<=$?e:i.viewUp;j(a,s,t),w(c,t);break}case 1:j(a,i.viewUp,t),j(c,t,a);break;case 3:{const s=Math.abs(n)<=$?t:i.viewUp;j(a,s,e),j(c,e,a);break}}const l=j(B.get(),a,c);y(l,i.viewForward)>0&&h(c,c,-1),M(o,a),M(r,c)}function De(e,t,i){const s=t.worldUpAtPosition(e.origin,B.get()),o=e.basis1,r=mt(e,s),n=Math.round(r/yt)*yt;return L(e,n-r,o,i)}function Be(e,t,i,s,o,r){const n=w(B.get(),o.origin);k(n,n,h(B.get(),o.basis1,e.direction[0]<0?1:-1)),k(n,n,h(B.get(),o.basis2,e.direction[1]<0?1:-1));const a=v(o.basis1),c=v(o.basis2),l=P(B.get(),i,n),m=P(B.get(),t,n);let g=0,d=0;if(et(e)){const t=_e(o),i=_e(r);g=a-.5*e.direction[0]*y(o.basis1,m)/a,d=c-.5*e.direction[1]*y(o.basis2,m)/c;const s=i/t;g*=s,d*=s}const u=g+.5*e.direction[0]*y(o.basis1,l)/a,p=d+.5*e.direction[1]*y(o.basis2,l)/c,f=h(B.get(),o.basis1,u/a),b=h(B.get(),o.basis2,p/c);(u<=0||Xe(r.origin,f,s)<=J)&&w(f,r.basis1),(p<=0||Xe(r.origin,b,s)<=J)&&w(b,r.basis2);const j=w(B.get(),n);return k(j,j,h(B.get(),f,e.direction[0]<0?-1:1)),k(j,j,h(B.get(),b,e.direction[1]<0?-1:1)),A(j,f,b,r)}function Ve(e,t){return K*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function qe(e,t,i,s){const o=j(B.get(),t,i);return j(o,o,t),I(e,o,s)}function He(e,t){return N(e.basis1,e.basis2,e.origin,t)}function Ne(e,t,i,s){const o=t.worldUpAtPosition(e.origin,B.get()),r=B.get();switch(i){case 1:w(r,o);break;case 2:w(r,e.basis1)}return I(e.origin,r,s)}function We(e,t,i,s){const o=Qe(i,2),r=V.get();c(r,t,o.edge*Math.PI/2);const n=M(B.get(),o.basis);let l=h(B.get(),n,o.direction*s.computeScreenPixelSizeAt(o.position)*Q);k(l,l,o.position);const m=s.projectToRenderScreen(l,a(B.get())),g=Ze(s,m);Ue(s,m,wt),M(wt.direction,wt.direction);const d=B.get();!g&&E(i,wt,d)&&(l=d),r[12]=0,r[13]=0,r[14]=0,e.modelTransform=r,e.renderLocation=U(l),g?e.state|=ht:e.state&=~ht}function Ze(e,t){const[i,s,o,r]=e.viewport,n=Math.min(o,r)/16;let a=!0;return t[0]<i+n?(t[0]=i+n,a=!1):t[0]>i+o-n&&(t[0]=i+o-n,a=!1),t[1]<s+n?(t[1]=s+n,a=!1):t[1]>s+r-n&&(t[1]=s+r-n,a=!1),a}function $e(e,t,i,s){const o=v(s.basis1),r=v(s.basis2),n=Ye(s),a=_e(s),d=T(B.get(),0,0,0);k(d,h(B.get(),s.basis1,t.direction[0]),h(B.get(),s.basis2,t.direction[1])),k(d,s.origin,d);let u=0,p=1;if(et(t))1===t.direction[0]&&-1===t.direction[1]?u=yt:1===t.direction[0]&&1===t.direction[1]?u=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(u=3*Math.PI/2),p=a;else{const e=0!==t.direction[0]?1:2;u=1===e?yt:0,p=(1===e?r:o)-n}const f=l(V.get());c(f,f,u),m(f,f,T(B.get(),p,p,p)),g(f,i,f),f[12]=0,f[13]=0,f[14]=0,e.modelTransform=f,e.renderLocation=d}function Je(e,t,i,s){const o=s.worldUpAtPosition(i.origin,B.get()),r=Qe(i,0),n=l(V.get());c(n,n,r.edge*Math.PI/2),d(n,n,-mt(i,o)),g(n,t,n),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=r.position}function Ke(e,t,i){const s=Qe(i,1),o=l(V.get());c(o,o,s.edge*Math.PI/2),d(o,o,yt),g(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=s.position}function Qe(e,t){switch(t){case 0:return{basis:e.basis1,direction:1,position:k(B.get(),e.origin,e.basis1),edge:t};case 1:return{basis:e.basis2,direction:1,position:k(B.get(),e.origin,e.basis2),edge:t};case 2:return{basis:e.basis1,direction:-1,position:P(B.get(),e.origin,e.basis1),edge:t};case 3:return{basis:e.basis2,direction:-1,position:P(B.get(),e.origin,e.basis2),edge:t}}}function Xe(e,t,i){const s=i.projectToRenderScreen(k(B.get(),e,t),a(B.get())),o=i.projectToRenderScreen(P(B.get(),e,t),a(B.get()));return O(P(s,s,o))}function Ye(e){const t=v(e.basis1),i=v(e.basis2);return Z*Math.min(t,i)}function _e(e){return Ye(e)}function et(e){return 0!==e.direction[0]&&0!==e.direction[1]}function tt(e,t=1){const i=0===t?Q:0,s=[S(i,0,-we/2),S(i,0,we/2)],o=ct(s,!0),r=(e,t)=>nt(s,s,{tubeRadius:ye,tipRadius:W,tipLength:je,tubeFocusMultiplier:Me,tipFocusMultiplier:ke,padding:e,bothEnds:!0,flat:null,focusTipLength:!0,addCap:t}),n=r(0,!1),a=r(X,!0),c=new Le({color:Y,cullFace:2,renderOccluded:16}),l=new Le({color:_,cullFace:2,renderOccluded:16}),m=new Le({color:ee,cullFace:2,renderOccluded:16}),g=new Le({color:te,transparent:!0,writeDepth:!1,cullFace:1,renderOccluded:2}),d=Se.createPolylineGeometry([[i,0,0],[i-Q,0,0]]),u=Se.createPolylineGeometry([[i,0,0],[i-Q,0,0]]),p=new Ee({color:ie,renderOccluded:4});return new H({view:e,renderObjects:[...n.normal.map((({part:e,geometry:t,transform:i})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:m,transform:i,stateMask:1|bt}))),...a.normal.map((({geometry:e,transform:t})=>({geometry:e,material:g,transform:t,stateMask:1|bt}))),{geometry:d,material:p,stateMask:1|bt|ht},...n.focused.map((({part:e,geometry:t,transform:i})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:m,transform:i,stateMask:2|bt}))),...a.focused.map((({geometry:e,transform:t})=>({geometry:e,material:g,transform:t,stateMask:2|bt}))),{geometry:u,material:p,stateMask:2|bt|ht}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[o]},collisionPriority:1,radius:W,state:bt})}function it(e,t){const i=new Ae({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:16}),s=se,o=oe,r=o*pe,n=e=>{const t=new Uint32Array([0,1,2,2,3,0]);return new Re([["position",{size:3,data:[s-e,-e,0,s+e,-e,0,s+e,e,0,s-e,e,0],exclusive:!0}],["uv0",{size:2,data:[0,0,1,0,1,1,0,1]}]],[["position",t],["uv0",t]])},a=Se.createPolylineGeometry([[0,0,0],[s-o,0,0]]),c=Se.createPolylineGeometry([[0,0,0],[s-r,0,0]]),l=new Ee({color:re,renderOccluded:4}),m=[{geometry:n(o),material:i,stateMask:1|bt},{geometry:a,material:l,stateMask:1|bt},{geometry:n(r),material:i,stateMask:2|bt},{geometry:c,material:l,stateMask:2|bt}];return new H({view:e,renderObjects:m,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[s,0,0]},collisionPriority:1,radius:o/2,state:bt})}function st(e){return new Pe({view:e,attached:!0,color:ne,width:ae,writeDepthEnabled:!1,renderOccluded:4,geometry:[[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]]]})}function ot(e){return new Oe({view:e,attached:!0,backgroundColor:[...ce],gridColor:le,gridWidth:4,renderOccluded:4})}function rt(e,t){const i=et(t),s=i?[S(1,0,0),S(0,0,0),S(0,1,0)]:[S(1,0,0),S(-1,0,0)],o=Se.createPolylineGeometry(s),r=fe,n=e=>new Ce({color:r,width:e,renderOccluded:4}),a=()=>new Ee({color:r,renderOccluded:4}),c=i?ve:he,l=c*be,m=he,g=e=>e>1?n(e):a(),d=[{geometry:o,material:g(c),stateMask:1|jt},{geometry:o,material:g(l),stateMask:2|jt},{geometry:o,material:g(m),stateMask:Mt}],u=new H({view:e,renderObjects:d,collisionType:{type:"line",paths:[s]},autoScaleRenderObjects:!1,worldSized:!0,radius:i?me:ge});return u.state=jt,u}function nt(e,t,i){const s=s=>{const o=(s?t:e).slice(0),n=P(B.get(),o[0],o[1]);M(n,n);const a=P(B.get(),o[o.length-1],o[o.length-2]);if(M(a,a),i.padding>0){const e=h(R(),a,-i.padding);if(o[o.length-1]=k(e,e,o[o.length-1]),i.bothEnds){const e=h(R(),n,-i.padding);o[0]=k(e,e,o[0])}}const c=s?i.tipFocusMultiplier:1,d=i.tipLength*(i.focusTipLength?c:1),w=i.tipRadius*c,y=l(V.get());if(i.padding>0){const e=d/4,t=T(B.get(),0,e,0),s=1+i.padding/e;u(y,y,t),m(y,y,T(B.get(),s,s,s)),u(y,y,h(t,t,-1/s))}const j=l(f()),v=S(0,1,0),O=p(f(),b(q.get(),v,a));O[12]=o[o.length-1][0],O[13]=o[o.length-1][1],O[14]=o[o.length-1][2],g(O,O,y);const U=[{part:"tube",geometry:at(i.tubeRadius*(s?i.tubeFocusMultiplier:1)+i.padding,i.flat,o),transform:j}];let L,A;if(r(i.flat)?L=Se.createExtrudedTriangle(d,w,w,i.flat.thickness):(L=Se.createConeGeometry(d,w,24,!1,!1,!0),A=Se.createConeGeometry(d,w,24,!1,!0,!1)),U.push({part:"tip",geometry:L,transform:O}),A&&U.push({part:"cap",geometry:A,transform:O}),i.bothEnds){const e=p(f(),b(q.get(),v,n));e[12]=o[0][0],e[13]=o[0][1],e[14]=o[0][2],g(e,e,y),U.push({part:"tip",geometry:L,transform:e}),A&&U.push({part:"cap",geometry:A,transform:e})}return U};return{normal:s(!1),focused:s(!0)}}function at(e,t,i){const s=[];if(r(t))s.push([e,t.thickness/2],[-e,t.thickness/2],[-e,-t.thickness/2],[e,-t.thickness/2]);else{const t=12;for(let i=0;i<t;i++){const o=i/t*2*Math.PI;s.push([Math.cos(o)*e,Math.sin(o)*e])}}return Se.createPathExtrusionGeometry(s,i,[],[],!1)}function ct(e,t){const i=P(R(),e[e.length-1],e[e.length-2]);if(M(i,i),h(i,i,de),k(i,i,e[e.length-1]),t){const t=P(R(),e[0],e[1]);return M(t,t),h(t,t,de),k(t,t,e[0]),[t,...e,i]}return[...e,i]}function lt(e,t,s,n=new Fe){if(o(e))return null;const a=r(n.position)?n.position:new Ge;t.fromRenderCoords(e.origin,a,s),n.position=a;const c=t.worldUpAtPosition(e.origin,B.get()),l=t.worldBasisAtPosition(e.origin,1,B.get());return n.width=2*v(e.basis1),n.height=2*v(e.basis2),n.tilt=i(mt(e,c)),n.heading=i(gt(e,c,l)),n}function mt(e,t){return D(t,e.basis2,e.basis1)+yt}function gt(e,t,i){return D(e.basis1,i,t)-yt}function dt(e,t,i,o,r,n,a=C()){return n.toRenderCoords(e,a.origin)?(n.worldBasisAtPosition(a.origin,0,a.basis1),n.worldBasisAtPosition(a.origin,1,a.basis2),x(a.basis2,a.basis1,a.origin,a.plane),L(a,-s(t),F(a),a),L(a,s(i),a.basis1,a),h(a.basis1,a.basis1,o/2),h(a.basis2,a.basis2,r/2),G(a),a):(Ie.error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function ut(e,t,i=C()){return o(e)||o(e.position)?null:dt(e.position,e.heading,e.tilt,e.width,e.height,t,i)}function pt(e,t,i=C()){if(o(e)||o(e.position))return null;let s=e.position;return e.position.hasZ||(s=e.position.clone(),s.z=n(Te(t.elevationProvider,e.position),0)),dt(s,e.heading,e.tilt,e.width,e.height,t.renderCoordsHelper,i)}function ft(t){switch(t.type){case"analysis":case"building-scene":case"csv":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"line-of-sight":case"map-notes":case"ogc-feature":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"open-street-map":case"tile":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return e(t.type),!1}}const bt=16,ht=32,wt=z(),yt=Math.PI/2,jt=16,Mt=32;export{bt as DidPointerMoveRecentlyFlag,ht as IsShiftEdgeOnScreenFlag,ct as addArrowTips,He as calculateBoundedPlaneTranslateRotate,_e as calculateDiagonalResizeHandleScale,Ve as calculatePlaneHalfSize,Ye as calculateResizeHandlePadding,Xe as calculateScreenSpaceBasisLength2,nt as createArrowGeometry,ot as createGridVisualElement,st as createOutlineVisualElement,xe as createPlane,rt as createResizeManipulator,it as createRotateManipulator,Ne as createRotatePlane,tt as createShiftManipulator,qe as createShiftPlane,De as forceHorizontalOrVertical,ft as isAlwaysDrapedLayer,et as isDiagonalResizeHandle,ze as normalToBases,lt as planeToShape,jt as resizeNormal,Mt as resizeOutlineOnly,Be as resizePlane,pt as shapeToElevationAlignedPlane,ut as shapeToPlane,$e as updateResizeHandle,Je as updateRotateHeadingHandle,Ke as updateRotateTiltHandle,We as updateShiftRestartHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import{toHSV as e,toRGB as i}from"../../../../core/colorUtils.js";import{b as o}from"../../../../chunks/vec4f64.js";import{createStipplePatternSimple as l}from"../../webgl-engine/materials/lineStippleUtils.js";const s={main:new t([255,127,0]),selected:new t([255,255,255]),staged:new t([12,207,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255])},n=.3;function r(t,e){const i=t.clone();return i.a*=e,i}function h(t,o){const l=t.clone(),s=e(l);s.s*=o;const n=i(s);return l.r=n.r,l.g=n.g,l.b=n.b,l}function c(t,e){if(e)for(const i in e)t[i]=e[i]}class a{constructor(t){this.color=s.main,this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=16,c(this,t)}}class d{constructor(t){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=s.main,this.outlineColor=s.outline,this.renderOccluded=16,this.hoverOutlineColor=s.selectedOutline,c(this,t)}apply(t,e){const i=this[t];e.
|
|
5
|
+
import t from"../../../../Color.js";import{toHSV as e,toRGB as i}from"../../../../core/colorUtils.js";import{b as o}from"../../../../chunks/vec4f64.js";import{createStipplePatternSimple as l}from"../../webgl-engine/materials/lineStippleUtils.js";const s={main:new t([255,127,0]),selected:new t([255,255,255]),staged:new t([12,207,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255])},n=.3;function r(t,e){const i=t.clone();return i.a*=e,i}function h(t,o){const l=t.clone(),s=e(l);s.s*=o;const n=i(s);return l.r=n.r,l.g=n.g,l.b=n.b,l}function c(t,e){if(e)for(const i in e)t[i]=e[i]}class a{constructor(t){this.color=s.main,this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=16,c(this,t)}}class d{constructor(t){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=s.main,this.outlineColor=s.outline,this.renderOccluded=16,this.hoverOutlineColor=s.selectedOutline,c(this,t)}apply(t,e){const i=this[t];e.setParameters({color:z(i),transparent:"color"!==t||i.a<1,renderOccluded:this.renderOccluded})}}class u{constructor(t){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.color=r(s.main,.5),this.hoverColor=s.main,this.renderOccluded=2,this.minSquaredEdgeLength=900,c(this,t)}apply(t,e){const i=this[t];e.setParameters({color:z(i),transparent:i.a<1,renderOccluded:this.renderOccluded})}}class p{constructor(t){this.vertex=new d({color:s.main,outlineColor:s.outline}),this.edge=new d({color:h(r(s.main,2/3),.5),outlineColor:r(s.outline,.5),size:8,collisionPadding:8}),this.selected=new d({color:s.selected,outlineColor:s.outline}),this.edgeOffset=new u,c(this,t)}}class g{constructor(t){this.color=s.selected,this.width=1.5,this.stipplePattern=l(5),this.stippleOffColor=s.outline,this.falloff=0,this.innerWidth=1.5,this.innerColor=s.selected,this.renderOccluded=4,c(this,t)}apply(t){t.color=z(this.color),t.width=this.width,t.stipplePattern=this.stipplePattern,t.stippleOffColor=z(this.stippleOffColor),t.falloff=this.falloff,t.innerWidth=this.innerWidth,t.innerColor=z(this.innerColor),t.renderOccluded=this.renderOccluded}}class w{constructor(t){this.color=s.selected,this.size=4,this.outlineSize=1,this.outlineColor=s.outline,this.shape="square",c(this,t)}apply(t){t.color=z(this.color),t.size=this.size,t.outlineSize=this.outlineSize,t.outlineColor=z(this.outlineColor),t.primitive=this.shape}}class f{constructor(t){this.innerColor=s.selected,this.innerWidth=1,this.glowColor=s.main,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=n,this.globalAlphaContrastBoost=1.5,this.radius=3,this.heightFillColor=s.main,c(this,t)}apply(e,i=1){const o={glowColor:t.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:t.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*i,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=o:e.laserlineStyle=o}}class C{constructor(t){this.outline=new g({color:s.outline,renderOccluded:8,stippleOffColor:s.selected,stipplePattern:l(5),width:1.5,innerWidth:0}),this.staged=new g({color:s.selected,renderOccluded:8,innerColor:s.staged,stippleOffColor:s.outline,stipplePattern:l(5),width:1.5}),this.shadowStyle=new f({globalAlpha:n,glowColor:s.main,glowFalloff:8,glowWidth:8,innerColor:s.selected,innerWidth:1}),c(this,t)}}class m{constructor(t){this.outline=new w({color:s.selected,outlineColor:s.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new f({globalAlpha:n,glowColor:s.main,glowFalloff:1.5,glowWidth:6,innerColor:s.selected,innerWidth:1,radius:2}),c(this,t)}}class O extends g{constructor(t){super(),this.extensionType=2,c(this,t)}}class W{constructor(t){this.lineGraphics=new C,this.pointGraphics=new m,this.heightPlane=new f({globalAlpha:n,glowColor:s.main,glowFalloff:8,glowWidth:8,innerColor:s.selected,innerWidth:1}),this.heightBox=new f({globalAlpha:n,glowColor:s.main,glowFalloff:8,glowWidth:8,innerColor:s.selected,innerWidth:0,heightFillColor:s.main}),this.zVerticalLine=new O({color:r(s.main,5*n/3),falloff:2,innerColor:r(s.selected,0),renderOccluded:4,stipplePattern:null,width:5,extensionType:2}),this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,c(this,t)}}class b{constructor(t){this.visualElements=new W,this.reshapeManipulators=new p,this.zManipulator=new a,c(this,t)}colorToVec4(t){return z(t)}}function z(e){return o(t.toUnitRGBA(e))}const A=new b;export{d as VertexManipulatorStyle,s as colors,A as settings};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as r,unwrapOr as o,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{screenPointObjectToArray as h}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as l}from"../../../../../core/unitUtils.js";import{init as c}from"../../../../../core/watchUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{r as m}from"../../../../../chunks/mat4.js";import{a as g,f as y,s as v}from"../../../../../chunks/vec2.js";import{a as f}from"../../../../../chunks/vec2f64.js";import{g as M,F as S,f as b,n as B,l as w,d as x}from"../../../../../chunks/vec3.js";import{c as G,a as D}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{a as O,c as R}from"../../../../../chunks/boundedPlane.js";import{intersectRay as E,create as A,normal as P}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv2d as U,sv3d as k,sm4d as T}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as Z}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as V}from"../../Manipulator3D.js";import{getGraphicAttachmentOrigin as _,calculateInputRotationTransform as C}from"../../manipulatorUtils.js";import{createShiftManipulator as H,IsShiftEdgeOnScreenFlag as I,createResizeManipulator as X,createRotateManipulator as Y,resizeNormal as F,resizeOutlineOnly as N,isDiagonalResizeHandle as q,calculateDiagonalResizeHandleScale as L,createRotatePlane as J,calculateBoundedPlaneTranslateRotate as K,updateRotateHeadingHandle as Q,updateResizeHandle as W}from"../../analysisTools/slice/sliceToolUtils.js";import $ from"../../analysisTools/slice/images/heading-rotate-png.js";import{screenToZConstrained as tt,screenToRenderPlane as et}from"../dragEventPipeline3D.js";import{canMoveZ as it}from"../manipulatorUtils.js";import{createVisualElements as at}from"../visualElementUtils.js";import{MoveXYGraphicManipulation as st}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as rt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ot}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as nt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as pt}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as ht}from"../../../layers/graphics/GraphicState.js";import{fromScreen as lt}from"../../../support/geometryUtils/ray.js";import{Texture as ct}from"../../../webgl-engine/lib/Texture.js";import{createManipulatorDragEventPipeline as dt,addMapDelta as ut,addScreenDelta as mt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as gt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as yt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{calculateOrientedBounds as vt,mapPlaneToRenderPlane as ft,apply as Mt,unapply as St}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";let bt=class extends(e.EventedMixin(gt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this._preserveAspectRatio=new rt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this.handles=new i,this.moveZManipulator=null,this.resizeManipulators=null,this.rotateManipulator=null,this.attachmentOrigin=null,this.outlineVisualElement=null,this.mapBounds=O(),this.mapBoundsStart=O(),this.displayBounds=O(),this.displayBoundsStart=O(),this.displayBoundsMarginStart=0,this.resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}]}initialize(){this.graphicState=new ht({graphic:this.graphic});const t=this.graphic.geometry;this.editGeometryOperations=yt.fromGeometry(t,this.view.state.viewingMode),this.graphicMoveManipulation=new st({tool:this,view:this.view,graphicState:this.graphicState}),this.handles.add(this.createMoveXYGraphicDragPipeline()),this.moveZManipulator=H(this.view,0),this.moveZManipulator.state|=I,this.handles.add(this.watch("enableZ",(()=>this.updateManipulatorAvailability(this.moveZManipulator,0)))),this.handles.add(this.createMoveZDragPipeline()),this.manipulators.add(this.moveZManipulator),this.resizeManipulators=this.resizeHandles.map((t=>{const e=X(this.view,t);return this.handles.add(this.watch("enableScaling",(()=>this.updateManipulatorAvailability(e,2)))),e.events.on("grab-changed",(t=>this.onResizeGrab(t))),this.handles.add(this.createResizeDragPipeline(e,t)),e})),this.manipulators.addMany(this.resizeManipulators),this.rotateManipulatorTexture=new ct($,{width:64,height:64,mipmap:!0,preMultiplyAlpha:!0}),this.view._stage&&this.view._stage.add(this.rotateManipulatorTexture),this.rotateManipulator=Y(this.view,this.rotateManipulatorTexture),this.handles.add(this.watch("enableRotation",(()=>this.updateManipulatorAvailability(this.rotateManipulator,3)))),this.rotateManipulator.events.on("grab-changed",(t=>{this.onRotateGrab(t)})),this.handles.add(this.createRotateDragPipeline(this.rotateManipulator)),this.manipulators.add(this.rotateManipulator),this.calculateMapBounds(),this.updateDisplayBounds();const e=at({view:this.view,graphic:this.graphic,forEachManipulator:t=>this.forEachManipulator(t),onManipulatorsChanged:()=>a()});r(e)&&(this.outlineVisualElement=e.visualElement instanceof ot?e.visualElement:null),r(this.outlineVisualElement)&&this.handles.add(this.outlineVisualElement.events.on("attachment-origin-changed",(()=>this.updateDisplayBounds()))),this.handles.add(e),this.handles.add([this.graphicState.on("changed",(()=>this.onGeometryChanged())),this.graphicState.watch("displaying",(()=>this.updateAllManipulatorAvailability())),c(this.graphicState,"isDraped",(()=>this.graphicDrapedChanged())),this.view.trackGraphicState(this.graphicState)]);const i=this.view.pointsOfInterest;i&&this.handles.add(i.centerOnSurfaceFrequent.watch("location",(()=>this.updateDisplayBounds())));const s=t=>{this.handles.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this.updateAllManipulatorAvailability()})))};this.forEachManipulator(s);const o=(t,e)=>{this.handles.add(t.events.on("immediate-click",(t=>{1===e&&this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()})))};this.forEachManipulator(o),this.onGeometryChanged(),this.updateAllManipulatorAvailability(),this.complete()}graphicDrapedChanged(){this.handles.remove(Bt),this.updateDisplayBounds(),this.graphicState.isDraped&&this.handles.add(this.view.elevationProvider.on("elevation-change",(t=>{r(this.attachmentOrigin)&&j(t.extent,this.attachmentOrigin.x,this.attachmentOrigin.y)&&this.updateDisplayBounds()})),Bt)}updateAllManipulatorAvailability(){this.forEachManipulator(((t,e)=>this.updateManipulatorAvailability(t,e)))}updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof V){const a=this.graphicState.displaying,s=this.enableZ&&it(this.graphic);switch(e){case 3:t.available=a&&this.enableRotation;break;case 2:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?F:N;break;case 0:t.available=a&&s;break;default:t.available=a}}}forEachManipulator(t){this.graphicMoveManipulation.forEachManipulator(t),this.resizeManipulators.forEach((e=>t(e,2))),t(this.rotateManipulator,3),t(this.moveZManipulator,0)}destroy(){this.view._stage&&this.view._stage.remove(this.rotateManipulatorTexture),this.handles.destroy(),this.graphicMoveManipulation.destroy(),this.editGeometryOperations.destroy(),this._set("view",null),this._set("graphic",null)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}reset(){}onDetach(){this.mapBounds=null,this.displayBounds=null}onGeometryChanged(){this.updateDisplayBounds()}calculateMapBounds(){const t=this.graphic.geometry,e=this.editGeometryOperations.data,i=e.components[0].edges[0],a=g(U.get(),i.leftVertex.pos,i.rightVertex.pos);y(a,a);const s=o(_(this.view,this.graphic),t.extent.center);let r=xt*this.view.pixelSizeAt(s);const n=this.view.spatialReference;n!==t.spatialReference&&(r*=l(n)/l(t.spatialReference)),vt(a,e,r,this.mapBounds)}updateDisplayBounds(){const t=this.graphic.geometry,e=r(this.outlineVisualElement)&&!this.graphicState.isDraped&&r(this.outlineVisualElement.attachmentOrigin)?this.outlineVisualElement.attachmentOrigin:_(this.view,this.graphic);this.attachmentOrigin=o(e,t.extent.center);const i=r(e)?e.z:nt(this.mapBounds.origin,this.view.elevationProvider,pt.fromElevationInfo(Z(this.graphic)),this.view.renderCoordsHelper),a=R(this.mapBounds);a.origin[2]=i,ft(a,this.view.renderCoordsHelper,t.spatialReference,this.displayBoundsMargin,this.displayBounds),this.updateManipulators()}get displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this.editGeometryOperations.data.geometry.extent.center;return wt*this.view.pixelSizeAt(e)}createMoveXYGraphicDragPipeline(){return this.graphicMoveManipulation.createDragPipeline(((t,e,i)=>this.applyGraphicMoveSteps(e,i)))}createMoveZDragPipeline(){const t=this.view,e=this.editGeometryOperations.data.spatialReference;return dt(this.moveZManipulator,((i,a,s)=>{const r=D(i.renderLocation),o=a.next(tt(t,r,e)).next(mt());this.applyGraphicMoveSteps(o,s)}))}applyGraphicMoveSteps(t,e){const i=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},R(this.mapBounds,this.mapBoundsStart),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(ut()).next(this.moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t}));return e.next((()=>{r(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this.cancel()})),i}moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this.editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?0:1,a=this.editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Mt(a,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}onResizeGrab(t){if("start"!==t.action)return;const e=this.calculatePickRay(t.screenPoint);E(this.displayBounds.plane,e,k.get())&&(R(this.displayBounds,this.displayBoundsStart),R(this.mapBounds,this.mapBoundsStart),this.displayBoundsMarginStart=this.displayBoundsMargin,this.inputState={type:"resize"})}createResizeDragPipeline(t,e){return dt(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(et(this.view,this.displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this.resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this.resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{r(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this.cancel()})))}))}resizeDragRenderPlaneToFactors(){return t=>{const e=this.displayBoundsStart,i=t.handle.direction,a=this.displayBoundsMargin,s=this.displayBoundsMarginStart,r=M(k.get(),e.origin);S(r,r,e.basis1,-i[0]),S(r,r,e.basis2,-i[1]);const o=b(k.get(),t.renderEnd,r),n=b(k.get(),t.renderStart,r),p=q(t.handle),h=L(e),l=L(this.displayBounds)/h,c=(t,e)=>{if(0===t)return 1;let i=w(e),r=.5*t*x(e,o)/i;const h=r<0?-1:1;if(p){r+=(i-.5*t*x(e,n)/i)*h*l}const c=i<1.5*s?1:Gt;return i=Math.max(i-s,Gt),h>0&&(r-=a),h*Math.max(h*(r/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}resizeDragUpdateGeometry(){return t=>{const e=M(G(),this.mapBoundsStart.origin);S(e,e,this.mapBoundsStart.basis1,-t.handle.direction[0]),S(e,e,this.mapBoundsStart.basis2,-t.handle.direction[1]);const i=v(f(),this.mapBoundsStart.basis1[0],this.mapBoundsStart.basis1[1]);y(i,i);const a=[];for(const o of this.editGeometryOperations.data.components)a.push(...o.vertices);const s="start"===t.action?0:1,r=this.editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,1);return R(this.mapBoundsStart,this.mapBounds),Mt(r,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}onRotateGrab(t){if("start"!==t.action)return;const e=J(this.displayBounds,this.view.renderCoordsHelper,1,A()),i=this.calculatePickRay(t.screenPoint);E(e,i,k.get())&&(R(this.displayBounds,this.displayBoundsStart),R(this.mapBounds,this.mapBoundsStart),this.inputState={type:"rotate",rotatePlane:e})}createRotateDragPipeline(t){return dt(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(et(this.view,a.rotatePlane)).next(this.rotateDragRenderPlaneToRotate(a)).next(this.rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{r(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this.cancel()})))}))}rotateDragRenderPlaneToRotate(t){return e=>{const i=P(t.rotatePlane),a=C(e.renderStart,e.renderEnd,this.displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}rotateDragUpdateGeometry(){return t=>{const e=M(G(),this.mapBoundsStart.origin),i=[];for(const r of this.editGeometryOperations.data.components)i.push(...r.vertices);const a="start"===t.action?0:1,s=this.editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,1);return R(this.mapBoundsStart,this.mapBounds),Mt(s,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}calculatePickRay(t){const e=z(),i=h(t);return lt(this.view.state.camera,i,e),B(e.direction,e.direction),e}updateManipulators(){if(!this.visible)return;const t=K(this.displayBounds,T.get());Q(this.rotateManipulator,t,this.displayBounds,this.view.renderCoordsHelper),this.updateZMoveHandle(this.moveZManipulator,t),this.resizeManipulators.forEach(((e,i)=>{W(e,this.resizeHandles[i],t,this.displayBounds)}))}updateZMoveHandle(t,e){const i=this.displayBounds,a={basis:i.basis1,direction:-1,position:b(k.get(),i.origin,i.basis1),edge:2},s=T.get();m(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}cancel(){const t=this.editGeometryOperations.lastOperation;n(t)||(this.editGeometryOperations.undo(),this.graphic.geometry=this.editGeometryOperations.data.geometry,St(t,this.mapBounds),this.updateDisplayBounds(),this.inputState=null)}get canUndo(){return this.editGeometryOperations.canUndo}undo(){if(r(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this.editGeometryOperations.undo();this.graphic.geometry=this.editGeometryOperations.data.geometry,St(p(t),this.mapBounds),this.updateDisplayBounds()}}get canRedo(){return this.editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this.editGeometryOperations.redo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Mt(p(t),this.mapBounds),this.updateDisplayBounds()}}get test(){return{resizeManipulators:this.resizeManipulators,rotateManipulator:this.rotateManipulator,moveZManipulator:this.moveZManipulator}}};t([d({constructOnly:!0,nonNullable:!0})],bt.prototype,"view",void 0),t([d({constructOnly:!0,nonNullable:!0})],bt.prototype,"graphic",void 0),t([d({constructOnly:!0,nonNullable:!0})],bt.prototype,"enableZ",void 0),t([d()],bt.prototype,"enableRotation",void 0),t([d()],bt.prototype,"enableScaling",void 0),t([d()],bt.prototype,"preserveAspectRatio",null),t([d()],bt.prototype,"grabbing",void 0),t([d()],bt.prototype,"inputState",void 0),t([d({readOnly:!0})],bt.prototype,"type",void 0),bt=t([u("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],bt);const Bt="draped-elevation-changes",wt=10,xt=80,Gt=1e-6;export{Gt as EPSILON,bt as ExtentTransformTool};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as r,unwrapOr as o,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{screenPointObjectToArray as h}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as l}from"../../../../../core/unitUtils.js";import{init as c}from"../../../../../core/watchUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{r as m}from"../../../../../chunks/mat4.js";import{a as g,f as y,s as v}from"../../../../../chunks/vec2.js";import{a as f}from"../../../../../chunks/vec2f64.js";import{g as M,F as S,f as b,n as B,l as x,d as G}from"../../../../../chunks/vec3.js";import{c as w,a as D}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{a as O,c as R}from"../../../../../chunks/boundedPlane.js";import{intersectRay as E,create as P,normal as A}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv2d as U,sv3d as k,sm4d as Z}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as T}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as V}from"../../Manipulator3D.js";import{getGraphicAttachmentOrigin as C,calculateInputRotationTransform as H}from"../../manipulatorUtils.js";import{createShiftManipulator as _,IsShiftEdgeOnScreenFlag as F,createResizeManipulator as I,createRotateManipulator as X,resizeNormal as Y,resizeOutlineOnly as N,isDiagonalResizeHandle as q,calculateDiagonalResizeHandleScale as L,createRotatePlane as J,calculateBoundedPlaneTranslateRotate as K,updateRotateHeadingHandle as Q,updateResizeHandle as W}from"../../analysisTools/slice/sliceToolUtils.js";import{getRotateHeadingTexture as $}from"../../analysisTools/slice/images/Factory.js";import{screenToZConstrained as tt,screenToRenderPlane as et}from"../dragEventPipeline3D.js";import{canMoveZ as it}from"../manipulatorUtils.js";import{createVisualElements as at}from"../visualElementUtils.js";import{MoveXYGraphicManipulation as st}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as rt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ot}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as nt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as pt}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as ht}from"../../../layers/graphics/GraphicState.js";import{fromScreen as lt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as ct,addMapDelta as dt,addScreenDelta as ut}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as gt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{calculateOrientedBounds as yt,mapPlaneToRenderPlane as vt,apply as ft,unapply as Mt}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";let St=class extends(e.EventedMixin(mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this._preserveAspectRatio=new rt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this.handles=new i,this.moveZManipulator=null,this.resizeManipulators=null,this.rotateManipulator=null,this.attachmentOrigin=null,this.outlineVisualElement=null,this.mapBounds=O(),this.mapBoundsStart=O(),this.displayBounds=O(),this.displayBoundsStart=O(),this.displayBoundsMarginStart=0,this.resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}]}initialize(){this.graphicState=new ht({graphic:this.graphic});const t=this.graphic.geometry;this.editGeometryOperations=gt.fromGeometry(t,this.view.state.viewingMode),this.graphicMoveManipulation=new st({tool:this,view:this.view,graphicState:this.graphicState}),this.handles.add(this.createMoveXYGraphicDragPipeline()),this.moveZManipulator=_(this.view,0),this.moveZManipulator.state|=F,this.handles.add(this.watch("enableZ",(()=>this.updateManipulatorAvailability(this.moveZManipulator,0)))),this.handles.add(this.createMoveZDragPipeline()),this.manipulators.add(this.moveZManipulator),this.resizeManipulators=this.resizeHandles.map((t=>{const e=I(this.view,t);return this.handles.add(this.watch("enableScaling",(()=>this.updateManipulatorAvailability(e,2)))),e.events.on("grab-changed",(t=>this.onResizeGrab(t))),this.handles.add(this.createResizeDragPipeline(e,t)),e})),this.manipulators.addMany(this.resizeManipulators),this.rotateManipulatorTexture=$(this.view.toolViewManager.textures),this.rotateManipulator=X(this.view,this.rotateManipulatorTexture.texture),this.handles.add(this.watch("enableRotation",(()=>this.updateManipulatorAvailability(this.rotateManipulator,3)))),this.rotateManipulator.events.on("grab-changed",(t=>{this.onRotateGrab(t)})),this.handles.add(this.createRotateDragPipeline(this.rotateManipulator)),this.manipulators.add(this.rotateManipulator),this.calculateMapBounds(),this.updateDisplayBounds();const e=at({view:this.view,graphic:this.graphic,forEachManipulator:t=>this.forEachManipulator(t),onManipulatorsChanged:()=>a()});r(e)&&(this.outlineVisualElement=e.visualElement instanceof ot?e.visualElement:null),r(this.outlineVisualElement)&&this.handles.add(this.outlineVisualElement.events.on("attachment-origin-changed",(()=>this.updateDisplayBounds()))),this.handles.add(e),this.handles.add([this.graphicState.on("changed",(()=>this.onGeometryChanged())),this.graphicState.watch("displaying",(()=>this.updateAllManipulatorAvailability())),c(this.graphicState,"isDraped",(()=>this.graphicDrapedChanged())),this.view.trackGraphicState(this.graphicState)]);const i=this.view.pointsOfInterest;i&&this.handles.add(i.centerOnSurfaceFrequent.watch("location",(()=>this.updateDisplayBounds())));const s=t=>{this.handles.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this.updateAllManipulatorAvailability()})))};this.forEachManipulator(s);const o=(t,e)=>{this.handles.add(t.events.on("immediate-click",(t=>{1===e&&this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()})))};this.forEachManipulator(o),this.onGeometryChanged(),this.updateAllManipulatorAvailability(),this.complete()}graphicDrapedChanged(){this.handles.remove(bt),this.updateDisplayBounds(),this.graphicState.isDraped&&this.handles.add(this.view.elevationProvider.on("elevation-change",(t=>{r(this.attachmentOrigin)&&j(t.extent,this.attachmentOrigin.x,this.attachmentOrigin.y)&&this.updateDisplayBounds()})),bt)}updateAllManipulatorAvailability(){this.forEachManipulator(((t,e)=>this.updateManipulatorAvailability(t,e)))}updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof V){const a=this.graphicState.displaying,s=this.enableZ&&it(this.graphic);switch(e){case 3:t.available=a&&this.enableRotation;break;case 2:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?Y:N;break;case 0:t.available=a&&s;break;default:t.available=a}}}forEachManipulator(t){this.graphicMoveManipulation.forEachManipulator(t),this.resizeManipulators.forEach((e=>t(e,2))),t(this.rotateManipulator,3),t(this.moveZManipulator,0)}destroy(){this.rotateManipulatorTexture.release(),this.handles.destroy(),this.graphicMoveManipulation.destroy(),this.editGeometryOperations.destroy(),this._set("view",null),this._set("graphic",null)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}reset(){}onDetach(){this.mapBounds=null,this.displayBounds=null}onGeometryChanged(){this.updateDisplayBounds()}calculateMapBounds(){const t=this.graphic.geometry,e=this.editGeometryOperations.data,i=e.components[0].edges[0],a=g(U.get(),i.leftVertex.pos,i.rightVertex.pos);y(a,a);const s=o(C(this.view,this.graphic),t.extent.center);let r=xt*this.view.pixelSizeAt(s);const n=this.view.spatialReference;n!==t.spatialReference&&(r*=l(n)/l(t.spatialReference)),yt(a,e,r,this.mapBounds)}updateDisplayBounds(){const t=this.graphic.geometry;if(n(t))return;const e=r(this.outlineVisualElement)&&!this.graphicState.isDraped&&r(this.outlineVisualElement.attachmentOrigin)?this.outlineVisualElement.attachmentOrigin:C(this.view,this.graphic);this.attachmentOrigin=o(e,t.extent.center);const i=r(e)?e.z:nt(this.mapBounds.origin,this.view.elevationProvider,pt.fromElevationInfo(T(this.graphic)),this.view.renderCoordsHelper),a=R(this.mapBounds);a.origin[2]=i,vt(a,this.view.renderCoordsHelper,t.spatialReference,this.displayBoundsMargin,this.displayBounds),this.updateManipulators()}get displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this.editGeometryOperations.data.geometry.extent.center;return Bt*this.view.pixelSizeAt(e)}createMoveXYGraphicDragPipeline(){return this.graphicMoveManipulation.createDragPipeline(((t,e,i)=>this.applyGraphicMoveSteps(e,i)))}createMoveZDragPipeline(){const t=this.view,e=this.editGeometryOperations.data.spatialReference;return ct(this.moveZManipulator,((i,a,s)=>{const r=D(i.renderLocation),o=a.next(tt(t,r,e)).next(ut());this.applyGraphicMoveSteps(o,s)}))}applyGraphicMoveSteps(t,e){const i=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},R(this.mapBounds,this.mapBoundsStart),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(dt()).next(this.moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t}));return e.next((()=>{r(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this.cancel()})),i}moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this.editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?0:1,a=this.editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return ft(a,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}onResizeGrab(t){if("start"!==t.action)return;const e=this.calculatePickRay(t.screenPoint);E(this.displayBounds.plane,e,k.get())&&(R(this.displayBounds,this.displayBoundsStart),R(this.mapBounds,this.mapBoundsStart),this.displayBoundsMarginStart=this.displayBoundsMargin,this.inputState={type:"resize"})}createResizeDragPipeline(t,e){return ct(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(et(this.view,this.displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this.resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this.resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{r(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this.cancel()})))}))}resizeDragRenderPlaneToFactors(){return t=>{const e=this.displayBoundsStart,i=t.handle.direction,a=this.displayBoundsMargin,s=this.displayBoundsMarginStart,r=M(k.get(),e.origin);S(r,r,e.basis1,-i[0]),S(r,r,e.basis2,-i[1]);const o=b(k.get(),t.renderEnd,r),n=b(k.get(),t.renderStart,r),p=q(t.handle),h=L(e),l=L(this.displayBounds)/h,c=(t,e)=>{if(0===t)return 1;let i=x(e),r=.5*t*G(e,o)/i;const h=r<0?-1:1;if(p){r+=(i-.5*t*G(e,n)/i)*h*l}const c=i<1.5*s?1:Gt;return i=Math.max(i-s,Gt),h>0&&(r-=a),h*Math.max(h*(r/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}resizeDragUpdateGeometry(){return t=>{const e=M(w(),this.mapBoundsStart.origin);S(e,e,this.mapBoundsStart.basis1,-t.handle.direction[0]),S(e,e,this.mapBoundsStart.basis2,-t.handle.direction[1]);const i=v(f(),this.mapBoundsStart.basis1[0],this.mapBoundsStart.basis1[1]);y(i,i);const a=[];for(const o of this.editGeometryOperations.data.components)a.push(...o.vertices);const s="start"===t.action?0:1,r=this.editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,1);return R(this.mapBoundsStart,this.mapBounds),ft(r,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}onRotateGrab(t){if("start"!==t.action)return;const e=J(this.displayBounds,this.view.renderCoordsHelper,1,P()),i=this.calculatePickRay(t.screenPoint);E(e,i,k.get())&&(R(this.displayBounds,this.displayBoundsStart),R(this.mapBounds,this.mapBoundsStart),this.inputState={type:"rotate",rotatePlane:e})}createRotateDragPipeline(t){return ct(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(et(this.view,a.rotatePlane)).next(this.rotateDragRenderPlaneToRotate(a)).next(this.rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{r(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this.cancel()})))}))}rotateDragRenderPlaneToRotate(t){return e=>{const i=A(t.rotatePlane),a=H(e.renderStart,e.renderEnd,this.displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}rotateDragUpdateGeometry(){return t=>{const e=M(w(),this.mapBoundsStart.origin),i=[];for(const r of this.editGeometryOperations.data.components)i.push(...r.vertices);const a="start"===t.action?0:1,s=this.editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,1);return R(this.mapBoundsStart,this.mapBounds),ft(s,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}calculatePickRay(t){const e=z(),i=h(t);return lt(this.view.state.camera,i,e),B(e.direction,e.direction),e}updateManipulators(){if(!this.visible)return;const t=K(this.displayBounds,Z.get());Q(this.rotateManipulator,t,this.displayBounds,this.view.renderCoordsHelper),this.updateZMoveHandle(this.moveZManipulator,t),this.resizeManipulators.forEach(((e,i)=>{W(e,this.resizeHandles[i],t,this.displayBounds)}))}updateZMoveHandle(t,e){const i=this.displayBounds,a={basis:i.basis1,direction:-1,position:b(k.get(),i.origin,i.basis1),edge:2},s=Z.get();m(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}cancel(){const t=this.editGeometryOperations.lastOperation;n(t)||(this.editGeometryOperations.undo(),this.graphic.geometry=this.editGeometryOperations.data.geometry,Mt(t,this.mapBounds),this.updateDisplayBounds(),this.inputState=null)}get canUndo(){return this.editGeometryOperations.canUndo}undo(){if(r(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this.editGeometryOperations.undo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Mt(p(t),this.mapBounds),this.updateDisplayBounds()}}get canRedo(){return this.editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this.editGeometryOperations.redo();this.graphic.geometry=this.editGeometryOperations.data.geometry,ft(p(t),this.mapBounds),this.updateDisplayBounds()}}get test(){return{resizeManipulators:this.resizeManipulators,rotateManipulator:this.rotateManipulator,moveZManipulator:this.moveZManipulator}}};t([d({constructOnly:!0,nonNullable:!0})],St.prototype,"view",void 0),t([d({constructOnly:!0,nonNullable:!0})],St.prototype,"graphic",void 0),t([d({constructOnly:!0,nonNullable:!0})],St.prototype,"enableZ",void 0),t([d()],St.prototype,"enableRotation",void 0),t([d()],St.prototype,"enableScaling",void 0),t([d()],St.prototype,"preserveAspectRatio",null),t([d()],St.prototype,"grabbing",void 0),t([d()],St.prototype,"inputState",void 0),t([d({readOnly:!0})],St.prototype,"type",void 0),St=t([u("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],St);const bt="draped-elevation-changes",Bt=10,xt=80,Gt=1e-6;export{Gt as EPSILON,St as ExtentTransformTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Accessor.js";import a from"../../../../../core/Handles.js";import
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Accessor.js";import a from"../../../../../core/Handles.js";import s from"../../../../../core/Logger.js";import{isNone as t,isSome as l}from"../../../../../core/maybe.js";import{react as n}from"../../../../../core/reactiveUtils.js";import{whenOnce as r}from"../../../../../core/watchUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{a as h}from"../../../../../chunks/boundedPlane.js";import d from"../../../../../layers/Layer.js";import y from"../../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isAlwaysDrapedLayer as p,shapeToElevationAlignedPlane as u,forceHorizontalOrVertical as w,planeToShape as v}from"../../analysisTools/slice/sliceToolUtils.js";import V from"../../../../../widgets/Slice/SlicePlane.js";const f=s.getLogger("esri.views.3d.interactive.graphics.Slice.SliceController");let m=class extends i{constructor(e){super(e),this._handles=new a,this._internalChange=!1,this._currentSlicePlane=null,this.state="pending"}get ready(){return"ready"===this.state}initialize(){this._handles.add(this.analysisView.analysisViewData.excludedLayers.on("before-add",(e=>{const i=e.item;null!=i&&(i instanceof d||i instanceof y)?i instanceof d&&p(i)?(f.error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysisView.analysisViewData.excludedLayers.includes(i)&&e.preventDefault():(f.error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())}))),this._handles.add(r(this.view,"ready",(()=>this._initialize()),!0))}_initialize(){switch(this.state){case"pending":break;case"destroyed":return;case"ready":throw new Error("state error")}S(this.view,this),this._handles.add([n((()=>this.analysisView.analysisViewData.plane),(()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()}),{sync:!0}),n((()=>this.analysisView.analysisViewData.excludeGroundSurface),(()=>this._updateLayerViews()),{sync:!0}),this.analysisView.analysisViewData.excludedLayers.on("change",(()=>this._updateLayerViews())),n((()=>[this.analysisView.active,this.analysisView.visible]),(()=>{this._updateActiveController(),this._updateViewSlicePlane()}),{sync:!0}),this.view.allLayerViews.on("change",(()=>this._updateLayerViews()))]),this._handles.add([n((()=>this.analysis.shape),(()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())}),{sync:!0})],"analysis"),this._set("state","ready"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane()}destroy(){switch(this.state){case"destroyed":case"pending":return}this.analysisView.active=!1,b(this.view,this),this._handles.destroy(),this.view.slicePlane=null,this.set("view",null),this._set("state","destroyed")}async whenReady(){return await r(this,"ready"),this}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,i=this._currentSlicePlane;if(t(i)&&t(e)||l(i)&&l(e)&&e.equals(i))return;let a=null,s=null;l(e)&&(a=u(e,this.view,h()),l(a)?s={heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height}:console.warn("Failed slice plane conversion.")),this._currentSlicePlane=s,l(a)&&!this.analysis.tiltEnabled&&w(a,this.view.renderCoordsHelper,a),this._internalChange=!0,this.analysisView.analysisViewData.plane=a,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisView.analysisViewData.plane,i=v(e,this.view.renderCoordsHelper,this.view.spatialReference,new V);let a=null;l(i)&&(a={heading:i.heading,tilt:i.tilt,position:i.position,width:i.width,height:i.height}),this._currentSlicePlane=a,l(e)&&(this.analysis.tiltEnabled||w(e,this.view.renderCoordsHelper,e)),this._internalChange=!0,this.analysis.shape=i,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(g)return;const e=P(this.view);if(this.analysisView.active)l(e.activeController)&&e.activeController!==this?(g=!0,e.activeController.analysisView.active=!1,g=!1):l(e.activeController)&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(l(e.activeController)&&e.activeController!==this)return;l(e.activeController)&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){"ready"===this.state&&C(this.view)}_updateLayerViews(){const e=l(this.analysisView.analysisViewData.plane)&&this.analysisView.visible&&this.analysisView.active,i=[],a=e=>{"layers"in e?e.layers.forEach(a):i.push(e)};this.analysisView.analysisViewData.excludedLayers.forEach(a),this.view.allLayerViews.forEach((a=>{"slicePlaneEnabled"in a&&(a.slicePlaneEnabled=e&&i.indexOf(a.layer)<0),"sublayerViews"in a&&a.sublayerViews.forEach((a=>{a.slicePlaneEnabled=e&&i.indexOf(a.sublayer)<0}))})),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysisView.analysisViewData.excludeGroundSurface)}};e([o({readOnly:!0})],m.prototype,"state",void 0),e([o()],m.prototype,"view",void 0),e([o()],m.prototype,"analysis",void 0),e([o()],m.prototype,"analysisView",void 0),e([o()],m.prototype,"ready",null),m=e([c("esri.views.3d.interactive.graphics.Slice.SliceController")],m);const _=new Map;let g=!1;function C(e){const i=P(e).activeController;l(i)&&l(i.analysisView.analysisViewData.plane)&&i.analysisView.visible?e.slicePlane=i.analysisView.analysisViewData.plane:e.slicePlane=null}function S(e,i){_.has(e)||_.set(e,{all:[],activeController:null}),_.get(e).all.push(i)}function P(e){return _.get(e)}function b(e,i){if(!_.has(e))throw new Error("view expected in global slice register");const a=_.get(e),s=a.all.lastIndexOf(i);if(-1===s)throw new Error("controller expected in global slice register");a.all.splice(s,1),0===a.all.length&&_.delete(e)}export{m as SliceController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Handles.js";import i from"../../../../../core/Logger.js";import{destroyMaybe as s,isNone as r,unwrap as a}from"../../../../../core/maybe.js";import{react as o,sync as n}from"../../../../../core/reactiveUtils.js";import{property as m}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Handles.js";import i from"../../../../../core/Logger.js";import{destroyMaybe as s,isNone as r,unwrap as a}from"../../../../../core/maybe.js";import{react as o,sync as n}from"../../../../../core/reactiveUtils.js";import{property as m}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{clonePoint as h}from"../../../../../layers/graphics/hydratedFeatures.js";import{hideManipulatorWhileDragging as d}from"../../editingTools/dragEventPipeline3D.js";import{AreaMeasurement3DModel as u}from"./AreaMeasurement3DModel.js";import c from"./AreaMeasurement3DView.js";import p from"../support/measurementUtils.js";import{createManipulatorDragEventPipeline as w}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as V}from"../../../../interactive/InteractiveToolBase.js";import{createScreenPointFromEvent as y}from"../../../../support/screenUtils.js";const g=i.getLogger("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool");let v=class extends V{constructor(e){super(e),this._handles=new t,this._tempPickRequest=new c.PickRequest,this.model=new u({sceneView:e.view,analysis:e.analysis}),this.measurementView=new c({model:this.model,unit:e.unit,manipulators:this.manipulators})}initialize(){this.measurementView.when().then((()=>this._initialize()))}_initialize(){this.destroyed?g.error("Calling _initialized() on destroyed AreaMeasurement3DTool."):(this._setupManipulators(),this.visible&&this.measurementView.show(),this._handles.add(o((()=>this.state),(e=>{"measured"===e?this.complete():this.finishToolCreation()}),n)),"measured"===this.state?this.complete():this.startToolCreation())}destroy(){this.attached&&this.detach(),this.measurementView.destroy(),this._set("measurementView",null),this.model.destroy(),this._set("model",null),this._handles=s(this._handles)}get state(){var e,t;if(r(this.model))return"ready";switch(this.model.state){case"initial":return(null==(e=this.measurementView)||null==(t=e.path)?void 0:t.numVertices)>=1?"measuring":"ready";case"drawing":case"editing":return"measuring";case"measured":return"measured"}}get cursor(){return this.destroyed?(g.error("Can't query the cursor of a destroyed tool."),null):!this.model.active||"initial"!==this.model.state&&"drawing"!==this.model.state?null:"crosshair"}set unit(e){this._set("unit",e),"ready"===this.measurementView.state&&(this.measurementView.analysisView.analysis.unit=e)}onActivate(){this.model.active=!0}onDeactivate(){this.model.active=!1}onShow(){this.created&&this.measurementView.show()}onHide(){this.created&&this.measurementView.hide()}onDetach(){switch(this.toolState){case"created":case"creating":this.measurementView.path&&this.measurementView.path.clear(),this.measurementView.cursorPoint=null,this.model.state="initial"}}onInputEvent(e){switch(e.type){case"immediate-double-click":this._handleImmediateDoubleClick(e);break;case"immediate-click":this._handleImmediateClick(e);break;case"pointer-move":this._handlePointerMove(e);break;case"drag":this._handleDrag(e);break;case"key-down":this._handleKeyDown(e)}}_setupManipulators(){const e=e=>`manipulator-${e}`;let t=0;const i=e=>i=>("start"===i.action&&(t++,this.measurementView.lastDraggedVertex=a(this.measurementView.manipulatorToVertex(e)),"measured"===this.model.state&&(this.model.state="editing")),i),s=()=>e=>"end"===e.action?(t--,0===t&&"editing"===this.model.state&&(this.model.state="measured"),null):e,r=(t,r)=>{this._handles.add([w(r,((e,t,r)=>{const o=d(e),n=a(this.measurementView.manipulatorToVertex(e));t.next(i(e)).next(o).next(s()).next(this.measurementView.screenToMap3D()).next((t=>{e.location=t.mapEnd,this.measurementView.path.setVertexPosition(n,h(t.mapEnd))}));const m=h(this.measurementView.path.getVertexPositionAsPoint(n));r.next(o).next((()=>{this.measurementView.path.setVertexPosition(n,m),e.location=m}))}))],e(t))},o=t=>{this._handles.remove(e(t))};this.manipulators.forEach((({id:e,manipulator:t})=>{r(e,t)})),this._handles.add([this.manipulators.on("after-add",(({item:{id:e,manipulator:t}})=>{r(e,t)})),this.manipulators.on("after-remove",(({item:{id:e}})=>{o(e)}))])}_handleImmediateDoubleClick(e){p.isPrimaryPointerAction(e)&&("drawing"===this.model.state&&this.measurementView.finishMeasurement(),e.stopPropagation())}_handleDrag(e){"editing"===this.model.state&&e.stopPropagation()}_handleImmediateClick(e){if(!p.isPrimaryPointerAction(e))return;const t=y(e);if(this.model.active)switch(this.model.state){case"initial":if(this._addVertexAt(t))return this.measurementView.cursorPoint=null,this.model.state="drawing",void e.stopPropagation();break;case"drawing":{const i=this.measurementView.vertexHandleAt(t,e.pointerType);if(r(i)){if(this._addVertexAt(t))return this.measurementView.cursorPoint=null,void e.stopPropagation()}else 0===i.index&&(this.measurementView.finishMeasurement(),e.stopPropagation());break}}"mouse"===e.pointerType&&this._hoverAt(t)}_handlePointerMove(e){if("mouse"===e.pointerType){const t=y(e);this._hoverAt(t)}}_handleKeyDown(e){"Enter"===e.key&&"drawing"===this.model.state&&(this.measurementView.finishMeasurement(),e.stopPropagation())}_hoverAt(e){if(this.measurementView.requiresCursorPoint){const t=this._pick(e);t.mapPoint&&(this.measurementView.cursorPoint=t.mapPoint)}else this.measurementView.cursorPoint=null}_addVertexAt(e){const t=this._pick(e);return!!t.mapPoint&&(this.measurementView.path.add(t.mapPoint),!0)}_pick(e){const t=this._tempPickRequest;return t.screenPoint=e,this.measurementView.pick(t)}};e([m({readOnly:!0})],v.prototype,"state",null),e([m({readOnly:!0})],v.prototype,"cursor",null),e([m()],v.prototype,"unit",null),e([m({constructOnly:!0})],v.prototype,"model",void 0),e([m({constructOnly:!0})],v.prototype,"measurementView",void 0),e([m({constructOnly:!0})],v.prototype,"view",void 0),e([m()],v.prototype,"analysis",void 0),v=e([l("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],v);const _=v;export{_ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../core/Handles.js";import{isSome as i,isNone as e,unwrap as s,destroyMaybe as a}from"../../../../../core/maybe.js";import{reactTruthy as n}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as r}from"../../../../../core/screenUtils.js";import{c as l}from"../../../../../chunks/vec3f64.js";import{createSphereManipulator as o}from"../../manipulatorUtils.js";import{screenToMap3D as h}from"../../editingTools/dragEventPipeline3D.js";import{copyParameter as u,pointToPointScreenDistance as d,resizeArray as _}from"../support/viewUtils.js";import{LaserlineVisualElement as c}from"../../visualElements/LaserlineVisualElement.js";import p from"../../../webgl-engine/lib/GeometryUtil.js";import{Intersector as m}from"../../../webgl-engine/lib/Intersector.js";import{ManipulatorCollection as y}from"../../../../interactive/ManipulatorCollection.js";const w={laserLineGlowColor:[1,.5,0],laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:[1,1,1],laserLineInnerWidth:1,laserLineGlobalAlpha:.75,laserLineEnabled:!0,handleColor:[1,.5,0],handleOpacity:.5,handleRadius:5,handleRadiusHovered:10,handleRadiusMouse:10,handleRadiusTouch:25,pathLineColor:[1,.5,0,1],pathLineWidth:3,intersectingLineColor:[1,.2,0,1],perimeterLineColor:[1,.5,0,1],perimeterLineWidth:2,projectionLineColor:[1,.5,0,1],projectionLineWidth:2,projectionLineStippleSize:5,areaColor1:[1,.5,0,.5],areaColor2:[1,1,1,.5],fillColor:[1,.5,0,.5],lineSubdivisions:64,labelDistance:25};class g{constructor(t){var i,e,s,a;this.vertexManipulators=[],this._analysisView=null,this._analysisVisualization=null,this._state="pending",this._mode=0,this._cursorPoint=null,this._lastDraggedVertex=null,this._visible=!1,this._laserLine=null,this._cursorManipulator=null,this._listenerHandles=null,this._tempHandlePosition=l(),this._model=t.model,this._unit=null!=(i=t.unit)?i:"metric",this._manipulators=null!=(e=t.manipulators)?e:new y,this._view=this._model.sceneView,this._mode=null!=(s=t.mode)?s:0,this._cursorPoint=null!=(a=t.cursorPoint)?a:null,this._style=u(w,t.style),this._intersector=new m(this._view.state.viewingMode),this._intersector.options.store=0;const n=this._model.analysis;this._creationPromise=this._view.whenAnalysisView(n).then((t=>this._initialize(t)))}_initialize(t){switch(this._state){case"pending":break;case"destroyed":return}this._analysisView=t,this._analysisVisualization=t.analysisVisualization,this._analysisViewData=t.analysisViewData;const i=o(this._view,this._style.handleColor,this._style.handleOpacity);i.available=!1,i.radius=this._style.handleRadius,i.interactive=!1,this._manipulators.add(i),this._cursorManipulator=i,this._laserLine=new c({view:this._view,attached:!0,style:{glowColor:this._style.laserLineGlowColor,glowWidth:this._style.laserLineGlowWidth,glowFalloff:this._style.laserLineGlowFalloff,innerColor:this._style.laserLineInnerColor,innerWidth:this._style.laserLineInnerWidth,globalAlpha:this._style.laserLineGlobalAlpha}}),this._analysisVisualization.mode=this._mode,this._analysisView.unit=this._unit,this._analysisViewData.cursorPoint=this._cursorPoint,this._visible&&this._updateVisibility(this._visible),this._state="ready"}destroy(){switch(this._state){case"pending":return void(this._state="destroyed");case"ready":break;default:return}this.hide(),this._laserLine.destroy(),this._laserLine=null,this._state="destroyed"}when(){return this._creationPromise.then((()=>{}))}async whenMessages(){await this._creationPromise,await new Promise((t=>{n((()=>!this._analysisView.updating),t,{initial:!0,sync:!0,once:!0})}))}get state(){return this._state}get analysisVisualization(){return this._analysisVisualization}get analysisView(){return this._analysisView}get validMeasurement(){return"ready"===this.state&&this._analysisViewData.validMeasurement}get path(){return"ready"!==this.state?null:this._analysisViewData.path}set unit(t){this._unit=t,"ready"===this.state&&(this.analysisView.unit=t)}get requiresCursorPoint(){return("initial"===this._model.state||"drawing"===this._model.state)&&this._model.active}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get mode(){return this._mode}set mode(t){switch(this._state){case"pending":this._mode=t;break;case"ready":this._mode=t,this._analysisVisualization.mode=t}}get cursorPoint(){return this._cursorPoint}set cursorPoint(t){switch(this._state){case"pending":this._cursorPoint=t;break;case"ready":this._cursorPoint=t,this._analysisViewData.cursorPoint=t}}get lastDraggedVertex(){return this._lastDraggedVertex}set lastDraggedVertex(t){switch(this._state){case"pending":this._lastDraggedVertex=t;break;case"ready":this._lastDraggedVertex=t,this._analysisViewData.lastDraggedVertex=t}}get testData(){const t=this._laserLine.testData;return{labels:this._analysisVisualization.testData.labels,laserLineRenderer:i(t)?{heightManifoldEnabled:t.heightManifoldEnabled,heightManifoldTarget:t.heightManifoldTarget,pointDistanceEnabled:t.pointDistanceEnabled,pointDistanceOrigin:t.pointDistanceOrigin,pointDistanceTarget:t.pointDistanceTarget,lineVerticalPlaneEnabled:t.lineVerticalPlaneEnabled}:{heightManifoldEnabled:!1,heightManifoldTarget:null,pointDistanceEnabled:!1,pointDistanceOrigin:null,pointDistanceTarget:null,lineVerticalPlaneEnabled:!1}}}show(){this._setVisiblity(!0)}hide(){this._setVisiblity(!1)}_setVisiblity(t){switch(this._state){case"ready":this._visible!==t&&this._updateVisibility(t);break;case"pending":this._visible=t;break;default:return}}_updateVisibility(t){this._visible=t,this._model.analysis.visible=t,this._laserLine.visible=t,t?(this._initializeListeners(),this._updateAll(this._analysisVisualization.viewData)):(this._destroyListeners(),this.vertexManipulators.forEach((t=>{this._removeVertexManipulator(t.manipulator)})),this.vertexManipulators=[],this._view.cursor=null)}vertexHandleAt(t,e){const s=this._manipulators.intersect(t,e);return i(s)?s.manipulator.metadata:null}manipulatorToVertex(t){return t.metadata}pick(t){const i=this._view.spatialReference,s=r(t.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(s,this._intersector);const a=this._intersector.results.min,n=l();if(!a.getIntersectionPoint(n))return new g.PickResult;const o=this._view.renderCoordsHelper.fromRenderCoords(n,i);if(e(o))return new g.PickResult;const h="TerrainRenderer"===a.intersector?"surface":"feature";return new g.PickResult(h,n,o)}overlappingHandles(t,i){return d(t,i,this._view)<=this._style.handleRadius}screenToMap3D(){return h(this._view)}finishMeasurement(){switch(this._state){case"pending":return;case"ready":{const t=this._analysisViewData.path;return void(t.numVertices<3?(t.clear(),this.cursorPoint=null,this._model.state="initial"):(t.close(),this.cursorPoint=null,this._model.state="measured"))}}}_updateAll(t){this._visible&&(this._updateVertexManipulators(t),this._updateLaserLine())}_createVertexManipulator(){const t=o(this._view,this._style.handleColor,this._style.handleOpacity);t.radius=this._style.handleRadius;return{id:this._manipulators.add(t),manipulator:t}}_removeVertexManipulator(t){this._manipulators.remove(t)}_updateVertexManipulators(t){const e=this._analysisViewData.path?this._analysisViewData.path.vertices:[],s=this.vertexManipulators;_(s,e.length,(()=>this._createVertexManipulator()),(t=>this._removeVertexManipulator(t.manipulator))),s.forEach(((i,s)=>{i.manipulator.metadata=e[s],i.manipulator.renderLocation=t.positionsRenderCoords[s]})),"drawing"===this._model.state&&i(this.cursorPoint)?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this.cursorPoint):this._cursorManipulator.available=!1}_getFocusPoint(){const t=this._model,e=this.lastDraggedVertex;switch(t.state){case"drawing":return i(this.cursorPoint)?this.cursorPoint:i(e)?this._analysisViewData.path.getVertexPositionAsPoint(e):s(this._analysisViewData.path.lastPoint);case"editing":return i(e)?this._analysisViewData.path.getVertexPositionAsPoint(e):null;default:return this.cursorPoint}}_updateLaserLine(){const t=this._model,e=this._style.laserLineEnabled&&"measured"!==t.state&&t.active,s=this._getFocusPoint();if(e&&i(s)){const t=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(s,t),this._laserLine.heightManifoldTarget=t}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new t,this._listenerHandles.add([this._model.watch("state",(()=>this._updateLaserLine())),this._analysisVisualization.watch("viewData",(()=>this._updateAll(this._analysisVisualization.viewData)),!0),this._analysisViewData.watch(["lastDraggedVertex","cursorPoint"],(()=>this._updateLaserLine())),this._model.watch(["active"],(()=>this._updateAll(this._analysisVisualization.viewData)))])}_destroyListeners(){this._listenerHandles=a(this._listenerHandles)}}g._handleGeometry=p.createSphereGeometry(1,32,32),function(t){class i{}t.PickRequest=i;class e{constructor(t=null,i=null,e=null){this.type=t,this.scenePoint=i,this.mapPoint=e}}t.PickResult=e}(g||(g={}));const V=g;export{V as default};
|
|
5
|
+
import t from"../../../../../core/Handles.js";import{isSome as i,isNone as e,unwrap as s,destroyMaybe as a}from"../../../../../core/maybe.js";import{reactTruthy as n}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as r}from"../../../../../core/screenUtils.js";import{c as l}from"../../../../../chunks/vec3f64.js";import{createSphereManipulator as o}from"../../manipulatorUtils.js";import{screenToMap3D as h}from"../../editingTools/dragEventPipeline3D.js";import{copyParameter as u,pointToPointScreenDistance as d,resizeArray as _}from"../support/viewUtils.js";import{LaserlineVisualElement as c}from"../../visualElements/LaserlineVisualElement.js";import p from"../../../webgl-engine/lib/GeometryUtil.js";import{Intersector as m}from"../../../webgl-engine/lib/Intersector.js";import{ManipulatorCollection as y}from"../../../../interactive/ManipulatorCollection.js";const w={laserLineGlowColor:[1,.5,0],laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:[1,1,1],laserLineInnerWidth:1,laserLineGlobalAlpha:.75,laserLineEnabled:!0,handleColor:[1,.5,0],handleOpacity:.5,handleRadius:5,handleRadiusHovered:10,handleRadiusMouse:10,handleRadiusTouch:25,pathLineColor:[1,.5,0,1],pathLineWidth:3,intersectingLineColor:[1,.2,0,1],perimeterLineColor:[1,.5,0,1],perimeterLineWidth:2,projectionLineColor:[1,.5,0,1],projectionLineWidth:2,projectionLineStippleSize:5,areaColor1:[1,.5,0,.5],areaColor2:[1,1,1,.5],fillColor:[1,.5,0,.5],lineSubdivisions:64,labelDistance:25};class g{constructor(t){var i,e,s,a;this.vertexManipulators=[],this._analysisView=null,this._analysisVisualization=null,this._state="pending",this._mode=0,this._cursorPoint=null,this._lastDraggedVertex=null,this._visible=!1,this._laserLine=null,this._cursorManipulator=null,this._listenerHandles=null,this._tempHandlePosition=l(),this._model=t.model,this._unit=null!=(i=t.unit)?i:"metric",this._manipulators=null!=(e=t.manipulators)?e:new y,this._view=this._model.sceneView,this._mode=null!=(s=t.mode)?s:0,this._cursorPoint=null!=(a=t.cursorPoint)?a:null,this._style=u(w,t.style),this._intersector=new m(this._view.state.viewingMode),this._intersector.options.store=0;const n=this._model.analysis;this._creationPromise=this._view.whenAnalysisView(n).then((t=>this._initialize(t)))}_initialize(t){switch(this._state){case"pending":break;case"destroyed":return}this._analysisView=t,this._analysisVisualization=t.analysisVisualization,this._analysisViewData=t.analysisViewData;const i=o(this._view,this._style.handleColor,this._style.handleOpacity);i.available=!1,i.radius=this._style.handleRadius,i.interactive=!1,this._manipulators.add(i),this._cursorManipulator=i,this._laserLine=new c({view:this._view,attached:!0,style:{glowColor:this._style.laserLineGlowColor,glowWidth:this._style.laserLineGlowWidth,glowFalloff:this._style.laserLineGlowFalloff,innerColor:this._style.laserLineInnerColor,innerWidth:this._style.laserLineInnerWidth,globalAlpha:this._style.laserLineGlobalAlpha}}),this._analysisVisualization.mode=this._mode,this._analysisView.analysis.unit=this._unit,this._analysisViewData.cursorPoint=this._cursorPoint,this._visible&&this._updateVisibility(this._visible),this._state="ready"}destroy(){switch(this._state){case"pending":return void(this._state="destroyed");case"ready":break;default:return}this.hide(),this._laserLine.destroy(),this._laserLine=null,this._state="destroyed"}when(){return this._creationPromise.then((()=>{}))}async whenMessages(){await this._creationPromise,await new Promise((t=>{n((()=>!this._analysisView.updating),t,{initial:!0,sync:!0,once:!0})}))}get state(){return this._state}get analysisVisualization(){return this._analysisVisualization}get analysisView(){return this._analysisView}get validMeasurement(){return"ready"===this.state&&this._analysisViewData.validMeasurement}get path(){return"ready"!==this.state?null:this._analysisViewData.path}set unit(t){this._unit=t,"ready"===this.state&&(this.analysisView.analysis.unit=t)}get requiresCursorPoint(){return("initial"===this._model.state||"drawing"===this._model.state)&&this._model.active}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get mode(){return this._mode}set mode(t){switch(this._state){case"pending":this._mode=t;break;case"ready":this._mode=t,this._analysisVisualization.mode=t}}get cursorPoint(){return this._cursorPoint}set cursorPoint(t){switch(this._state){case"pending":this._cursorPoint=t;break;case"ready":this._cursorPoint=t,this._analysisViewData.cursorPoint=t}}get lastDraggedVertex(){return this._lastDraggedVertex}set lastDraggedVertex(t){switch(this._state){case"pending":this._lastDraggedVertex=t;break;case"ready":this._lastDraggedVertex=t,this._analysisViewData.lastDraggedVertex=t}}get testData(){const t=this._laserLine.testData;return{labels:this._analysisVisualization.testData.labels,laserLineRenderer:i(t)?{heightManifoldEnabled:t.heightManifoldEnabled,heightManifoldTarget:t.heightManifoldTarget,pointDistanceEnabled:t.pointDistanceEnabled,pointDistanceOrigin:t.pointDistanceOrigin,pointDistanceTarget:t.pointDistanceTarget,lineVerticalPlaneEnabled:t.lineVerticalPlaneEnabled}:{heightManifoldEnabled:!1,heightManifoldTarget:null,pointDistanceEnabled:!1,pointDistanceOrigin:null,pointDistanceTarget:null,lineVerticalPlaneEnabled:!1}}}show(){this._setVisiblity(!0)}hide(){this._setVisiblity(!1)}_setVisiblity(t){switch(this._state){case"ready":this._visible!==t&&this._updateVisibility(t);break;case"pending":this._visible=t;break;default:return}}_updateVisibility(t){this._visible=t,this._model.analysis.visible=t,this._laserLine.visible=t,t?(this._initializeListeners(),this._updateAll(this._analysisVisualization.viewData)):(this._destroyListeners(),this.vertexManipulators.forEach((t=>{this._removeVertexManipulator(t.manipulator)})),this.vertexManipulators=[],this._view.cursor=null)}vertexHandleAt(t,e){const s=this._manipulators.intersect(t,e);return i(s)?s.manipulator.metadata:null}manipulatorToVertex(t){return t.metadata}pick(t){const i=this._view.spatialReference,s=r(t.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(s,this._intersector);const a=this._intersector.results.min,n=l();if(!a.getIntersectionPoint(n))return new g.PickResult;const o=this._view.renderCoordsHelper.fromRenderCoords(n,i);if(e(o))return new g.PickResult;const h="TerrainRenderer"===a.intersector?"surface":"feature";return new g.PickResult(h,n,o)}overlappingHandles(t,i){return d(t,i,this._view)<=this._style.handleRadius}screenToMap3D(){return h(this._view)}finishMeasurement(){switch(this._state){case"pending":return;case"ready":{const t=this._analysisViewData.path;return void(t.numVertices<3?(t.clear(),this.cursorPoint=null,this._model.state="initial"):(t.close(),this.cursorPoint=null,this._model.state="measured"))}}}_updateAll(t){this._visible&&(this._updateVertexManipulators(t),this._updateLaserLine())}_createVertexManipulator(){const t=o(this._view,this._style.handleColor,this._style.handleOpacity);t.radius=this._style.handleRadius;return{id:this._manipulators.add(t),manipulator:t}}_removeVertexManipulator(t){this._manipulators.remove(t)}_updateVertexManipulators(t){const e=this._analysisViewData.path?this._analysisViewData.path.vertices:[],s=this.vertexManipulators;_(s,e.length,(()=>this._createVertexManipulator()),(t=>this._removeVertexManipulator(t.manipulator))),s.forEach(((i,s)=>{i.manipulator.metadata=e[s],i.manipulator.renderLocation=t.positionsRenderCoords[s]})),"drawing"===this._model.state&&i(this.cursorPoint)?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this.cursorPoint):this._cursorManipulator.available=!1}_getFocusPoint(){const t=this._model,e=this.lastDraggedVertex;switch(t.state){case"drawing":return i(this.cursorPoint)?this.cursorPoint:i(e)?this._analysisViewData.path.getVertexPositionAsPoint(e):s(this._analysisViewData.path.lastPoint);case"editing":return i(e)?this._analysisViewData.path.getVertexPositionAsPoint(e):null;default:return this.cursorPoint}}_updateLaserLine(){const t=this._model,e=this._style.laserLineEnabled&&"measured"!==t.state&&t.active,s=this._getFocusPoint();if(e&&i(s)){const t=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(s,t),this._laserLine.heightManifoldTarget=t}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new t,this._listenerHandles.add([this._model.watch("state",(()=>this._updateLaserLine())),this._analysisVisualization.watch("viewData",(()=>this._updateAll(this._analysisVisualization.viewData)),!0),this._analysisViewData.watch(["lastDraggedVertex","cursorPoint"],(()=>this._updateLaserLine())),this._model.watch(["active"],(()=>this._updateAll(this._analysisVisualization.viewData)))])}_destroyListeners(){this._listenerHandles=a(this._listenerHandles)}}g._handleGeometry=p.createSphereGeometry(1,32,32),function(t){class i{}t.PickRequest=i;class e{constructor(t=null,i=null,e=null){this.type=t,this.scenePoint=i,this.mapPoint=e}}t.PickResult=e}(g||(g={}));const V=g;export{V as default};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.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.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import i from"../../../../../core/Handles.js";import{destroyMaybe as s,isSome as n,unwrapOr as r,unwrap as a,applySome as o,isNone as l}from"../../../../../core/maybe.js";import{react as h,
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import i from"../../../../../core/Handles.js";import{destroyMaybe as s,isSome as n,unwrapOr as r,unwrap as a,applySome as o,isNone as l}from"../../../../../core/maybe.js";import{react as h,initial as d}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as p}from"../../../../../core/screenUtils.js";import{whenNotOnce as c}from"../../../../../core/watchUtils.js";import{property as u}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as y}from"../../../../../chunks/vec3f64.js";import{fromPoints as m}from"../../../../../geometry/support/lineSegment.js";import{defaultUnitPropertyMetadata as g}from"../../../../../properties/defaultUnit.js";import{createSphereManipulator as w}from"../../manipulatorUtils.js";import{PickResult as v}from"./PickResult.js";import{copyParameter as b,pointToPointScreenDistance as f}from"../support/viewUtils.js";import{LaserlineVisualElement as P}from"../../visualElements/LaserlineVisualElement.js";import{getElevationAtPoint as L}from"../../../support/ElevationProvider.js";import{Intersector as V}from"../../../webgl-engine/lib/Intersector.js";const D={laserLineGlowColor:[1,.5,0],laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:[1,1,1],laserLineInnerWidth:.75,laserLineGlobalAlpha:.75,laserLineEnabled:!0,handleColor:[1,.5,0],handleOpacity:.5,handleRadius:5};var M;!function(e){e.Manipulators="manipulators",e.AnalysisViewDestroyed="analysis-view-destroyed",e.AnalysisView="analysis-view"}(M||(M={}));let T=class extends t{constructor(e){super(e),this._state="pending",this.analysisView=null,this.cursorPoint=null,this._visible=!1,this._laserLine=null,this._handles=new i,this._lastDraggedHandle=null,this._view=e.view,this._analysis=e.analysis,this._intersector=new V(this._view.state.viewingMode),this._intersector.options.store=0}normalizeCtorArgs(e){return{...e,params:e.params?b(D,e.params):b(D,{})}}initialize(){this._promise=this._initialize()}async _initialize(){switch(this._state){case"pending":break;case"destroyed":return Promise.reject("DirectLineMeasurement3DView already destroyed")}const e=await this._view.whenAnalysisView(this._analysis);return await e.whenReady(),this._set("analysisView",e),this._laserLine=new P({view:this._view,attached:!0}),this._visible&&this._updateVisibility(this._visible),this._connectToAnalysisView(),this._state="ready",e}destroy(){switch(this._state){case"pending":return void(this._state="destroyed");case"ready":break;default:return}this.hide(),this._handles=s(this._handles),this._laserLine=s(this._laserLine),this._state="destroyed"}when(){return this._promise.then((()=>{}))}async whenMessages(){const e=await this._promise;await c(e,"updating")}get requiresCursorPoint(){return"initial"===this.model.state&&this.model.active}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get viewMode(){const e=this.analysisView;return n(e)&&!e.destroyed?e.viewMode:0}get measurementMode(){const e=this.analysisView;return n(e)&&!e.destroyed?e.actualVisualizedMeasurement:1}get unit(){return r(this._cachedUnit,this._defaultUnit)}set unit(e){this._cachedUnit=e}get testData(){const e=this._laserLine.testData,t=a(this.analysisView).testData;return{labels:null==t?void 0:t.labels,stripeLength:null==t?void 0:t.stripeLength,laserLineRenderer:{heightManifoldEnabled:!!n(e)&&e.heightManifoldEnabled,heightManifoldTarget:n(e)?e.heightManifoldTarget:null,pointDistanceEnabled:!!n(e)&&e.pointDistanceEnabled,pointDistanceOrigin:n(e)?e.pointDistanceOrigin:null,pointDistanceTarget:n(e)?e.pointDistanceTarget:null,lineVerticalPlaneEnabled:!!n(e)&&e.lineVerticalPlaneEnabled}}}get directLabelText(){const e=this.analysisView;return n(e)&&!e.destroyed?e.directLabelText:null}get horizontalLabelText(){const e=this.analysisView;return n(e)&&!e.destroyed?e.horizontalLabelText:null}get verticalLabelText(){const e=this.analysisView;return n(e)&&!e.destroyed?e.verticalLabelText:null}get _cursorPosition(){const e=y();return o(this.cursorPoint,(t=>this._view.renderCoordsHelper.toRenderCoords(t,e))),e}get _startPosition(){const e=y();return o(this._analysis.startPoint,(t=>this._view.renderCoordsHelper.toRenderCoords(t,e))),e}get _endPosition(){const e=y();return o(this._analysis.endPoint,(t=>this._view.renderCoordsHelper.toRenderCoords(t,e))),e}get _laserLineParams(){const e=this._focusPosition,{state:t,active:i}=this.model,s=this.viewMode,n=this.analysisView,r=this.params.laserLineEnabled&&!!e&&"measured"!==t&&i;if(!r||!this.visible||l(n)||n.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};const a=n.actualVisualizedMeasurement,o=r&&2===s;return{heightManifoldTarget:1===a?e:null,pointDistanceLine:"local"!==this._view.viewingMode&&r&&!!this._analysis.startPoint&&2===a?this._pointDistanceLine:null,lineVerticalPlaneSegment:o?m(this._startPosition,this._endPosition):null}}get _focusPosition(){const e=this.model,t=this.analysisView,i=n(t)&&!t.destroyed&&1===t.visualizedMeasurement,s=1===this.viewMode&&i;switch(e.state){case"drawing":return s?this._startPosition:this._analysis.endPoint?this._endPosition:this._startPosition;case"editing":return s?"start"===this._lastDraggedHandle?this._endPosition:this._startPosition:"start"===this._lastDraggedHandle?this._startPosition:this._endPosition;default:return n(this.cursorPoint)?this._cursorPosition:null}}get _pointDistanceLine(){return{origin:"drawing"===this.model.state||"end"===this._lastDraggedHandle?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){const e=()=>{const e=w(this._view,this.params.handleColor,this.params.handleOpacity);return e.available=!1,e.radius=this.params.handleRadius,e},t=e(),i=e();n(this._analysis.startPoint)&&(t.location=this._analysis.startPoint,t.available=!0),n(this._analysis.endPoint)&&(i.location=this._analysis.endPoint,i.available=!0);const s=()=>{let e=this._lastDraggedHandle;t.grabbing&&!i.grabbing&&(e="start"),i.grabbing&&!t.grabbing&&(e="end"),t.grabbing||i.grabbing||(e=null),this._lastDraggedHandle=e},r=t.events.on("grab-changed",s),a=i.events.on("grab-changed",s);return this._handles.add([r,a],M.Manipulators),{start:t,end:i}}show(){switch(this._state){case"ready":this._visible||this._updateVisibility(!0);break;case"pending":this._visible=!0;break;default:return}}hide(){switch(this._state){case"ready":this._visible&&this._updateVisibility(!1);break;case"pending":this._visible=!1;break;default:return}}finishMeasurement(){this.model.finishMeasurement()}_connectToAnalysisView(){this._handles.remove(M.AnalysisView),this._handles.add([h((()=>o(this.analysisView,(e=>e.destroyed))),(e=>{e&&this._handles.remove(M.AnalysisView)}),d),h((()=>["measured"===this.model.state,this.analysisView]),(([e,t])=>{n(t)&&!t.destroyed&&(t.allowVisualElementsOrientationChange=!e)}),d),h((()=>this._laserLineParams),(e=>{const t=this._laserLine;t.heightManifoldTarget=e.heightManifoldTarget,t.pointDistanceLine=e.pointDistanceLine,t.lineVerticalPlaneSegment=e.lineVerticalPlaneSegment}),d),h((()=>({unit:this.unit,analysisView:this.analysisView})),(({unit:e,analysisView:t})=>o(t,(t=>t.analysis.unit=e))),d)],M.AnalysisView)}_updateVisibility(e){this._visible=e,this._analysis.visible=e,e?this._laserLine.style={innerColor:this.params.laserLineInnerColor,innerWidth:this.params.laserLineInnerWidth,glowColor:this.params.laserLineGlowColor,glowWidth:this.params.laserLineGlowWidth,glowFalloff:this.params.laserLineGlowFalloff,globalAlpha:this.params.laserLineGlobalAlpha}:this._view.cursor=null,this._laserLine.visible=e}pick(e){const t=this._view.spatialReference,i=p(e.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=y();if(!s.getIntersectionPoint(n))return new v;const r=this._view.renderCoordsHelper.fromRenderCoords(n,t);if(l(r))return new v;const a="TerrainRenderer"===s.intersector?"ground":"feature";return new v(a,n,r)}getElevation(e){return this._view.basemapTerrain.ready?r(L(this._view.elevationProvider,e),0):0}overlappingHandles(e,t){return f(e,t,this._view)<=this.params.handleRadius}};e([u()],T.prototype,"params",void 0),e([u()],T.prototype,"model",void 0),e([u({readOnly:!0})],T.prototype,"analysisView",void 0),e([u()],T.prototype,"cursorPoint",void 0),e([u()],T.prototype,"requiresCursorPoint",null),e([u()],T.prototype,"visible",null),e([u()],T.prototype,"viewMode",null),e([u()],T.prototype,"measurementMode",null),e([u()],T.prototype,"unit",null),e([u()],T.prototype,"_cachedUnit",void 0),e([u(g)],T.prototype,"_defaultUnit",void 0),e([u()],T.prototype,"testData",null),e([u()],T.prototype,"directLabelText",null),e([u()],T.prototype,"horizontalLabelText",null),e([u()],T.prototype,"verticalLabelText",null),e([u()],T.prototype,"_view",void 0),e([u()],T.prototype,"_analysis",void 0),e([u()],T.prototype,"_visible",void 0),e([u()],T.prototype,"_laserLine",void 0),e([u()],T.prototype,"_cursorPosition",null),e([u()],T.prototype,"_startPosition",null),e([u()],T.prototype,"_endPosition",null),e([u()],T.prototype,"_lastDraggedHandle",void 0),e([u()],T.prototype,"_laserLineParams",null),e([u()],T.prototype,"_focusPosition",null),e([u()],T.prototype,"_pointDistanceLine",null),T=e([_("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView")],T);export{T as DirectLineMeasurement3DView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import e from"../../../../core/Handles.js";import{isSome as t,unwrap as s,isNone as i,unwrapOr as r}from"../../../../core/maybe.js";import{g as n,f as a,k as l,o}from"../../../../chunks/vec3.js";import{c as h,f as d}from"../../../../chunks/vec3f64.js";import{g as p,c as _}from"../../../../chunks/vec4.js";import{f as u,a as c}from"../../../../chunks/vec4f32.js";import{create as f,fromRay as m,getStart as y,getEnd as g}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as x}from"../../../../geometry/support/frustum.js";import{create as w,fromPoints as b,pointAt as R}from"../../../../geometry/support/lineSegment.js";import{create as E,fromPoints as O}from"../../../../geometry/support/ray.js";import{LaserlineVisualElement as
|
|
5
|
+
import"../../../../core/has.js";import e from"../../../../core/Handles.js";import{isSome as t,unwrap as s,isNone as i,unwrapOr as r}from"../../../../core/maybe.js";import{g as n,f as a,k as l,o}from"../../../../chunks/vec3.js";import{c as h,f as d}from"../../../../chunks/vec3f64.js";import{g as p,c as _}from"../../../../chunks/vec4.js";import{f as u,a as c}from"../../../../chunks/vec4f32.js";import{create as f,fromRay as m,getStart as y,getEnd as g}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as x}from"../../../../geometry/support/frustum.js";import{create as w,fromPoints as b,pointAt as R}from"../../../../geometry/support/lineSegment.js";import{create as E,fromPoints as O}from"../../../../geometry/support/ray.js";import{LaserlineVisualElement as C}from"./LaserlineVisualElement.js";import{Object3DVisualElement as j}from"./Object3DVisualElement.js";import v from"../../webgl-engine/lib/GeometryUtil.js";import{RibbonLineMaterial as M}from"../../webgl-engine/materials/RibbonLineMaterial.js";class P extends j{constructor(t){super(t),this._ray=E(),this._externalResources=null,this._handles=new e,this._isWorldDown=!1,this._start=h(),this._end=d(1,0,0),this._width=1,this._color=u(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=u(1,1,1,1),this._stippleIntegerRepeats=!0,this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._fadedExtensions=T,this.applyProps(t)}createExternalResources(){const e=new M(this.materialParameters);this._handles.add(this.view.state.watch("camera",(()=>{this.updateGeometry()})));const t=new C({view:this.view,attached:this._laserlineEnabled});this._externalResources={material:e,laserline:t}}destroyExternalResources(){t(this._externalResources)&&this._externalResources.laserline.destroy(),this._externalResources=null,this._handles.removeAll()}forEachExternalMaterial(e){t(this._externalResources)&&e(this._externalResources.material)}createGeometries(e){const t=[h(),h()],i=3===this.extensionType;i&&t.push(h(),h());const r=i?new Float32Array([1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]):null,n=v.createPolylineGeometry(t,null,r);e.addGeometry(n,s(this._externalResources).material),this.updateVertices(e)}updateVisibility(e){super.updateVisibility(e),t(this._externalResources)&&(this._externalResources.laserline.visible=e)}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,n(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),a(this._end,e,this._end),O(this._start,this._end,this._ray),this.updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,l(this._start,e)||(n(this._start,e),O(this._start,this._end,this._ray),this.updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,l(this._end,e)||(n(this._end,e),O(this._start,this._end,this._ray),this.updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this.updateMaterial())}get color(){return this._color}set color(e){p(e,this._color)||(_(this._color,e),this.updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this.updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this.updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this.updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){p(e,this._innerColor)||(_(this._innerColor,e),this.updateMaterial())}get stippleIntegerRepeats(){return this._stippleIntegerRepeats}set stippleIntegerRepeats(e){e!==this._stippleIntegerRepeats&&(this._stippleIntegerRepeats=e,this.updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const s=t(e)!==t(this._stipplePattern);this._stipplePattern=e,s?this.recreate():this.updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(i(e)||i(this._stippleOffColor)||!p(e,this._stippleOffColor))&&(this._stippleOffColor=t(e)?c(e):null,this.updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this.updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.updateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&t(this._laserlineStyle)}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached,t(e)&&(this._externalResources.laserline.style=e))}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached))}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this.updateMaterial())}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=r(e,T),this.recreateGeometry()}updateMaterial(){if(i(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stippleIntegerRepeats:this._stippleIntegerRepeats,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}}updateGeometry(){t(this.object)&&this.updateVertices(this.object)}updateVertices(e){const s=3===this._extensionType?this.updateLineSegmentFinite(S):this.updateLineSegmentInfinite(this._extensionType,S);this.updateVertexAttributes(e,s),t(this._externalResources)&&(this._externalResources.laserline.intersectsLine=s)}updateLineSegmentFinite(e){return b(this._start,this._end,e)}updateLineSegmentInfinite(e,t){const s=this.view.state.camera;switch(m(this._ray,D),e){case 0:D.c0=-Number.MAX_VALUE;break;case 1:case 2:{const e=this._ray.origin,t=r(this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground"),0),s=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&s<t&&o(D.ray.direction,D.ray.direction),2===this._extensionType&&null!=t&&(D.c1=Math.abs(s-t));break}}if(!x(s.frustum,D))return b(this._start,this._end,t);const i=y(D,A),n=g(D,W);return b(i,n,t)}updateVertexAttributes(e,t){const s=e.geometries[0].getMutableAttribute("position").data;if(3===this.extensionType){const e=R(t,-this.fadedExtensions.start,A);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=R(t,0,A);s[3]=i[0],s[4]=i[1],s[5]=i[2];const r=R(t,1,A);s[6]=r[0],s[7]=r[1],s[8]=r[2];const n=R(t,1+this.fadedExtensions.end,A);s[9]=n[0],s[10]=n[1],s[11]=n[2]}else{const e=R(t,0,A);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=R(t,1,A);s[3]=i[0],s[4]=i[1],s[5]=i[2]}e.geometryVertexAttrsUpdated(e.geometryRecords[0])}}const D=f(),A=h(),W=h(),S=w(),G=1/3,T={start:G,end:G};export{P as ExtendedLineVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as t}from"../../../../core/maybe.js";import{g as i}from"../../../../chunks/vec3.js";import{c as n,a as s}from"../../../../chunks/vec3f64.js";import{create as r,fromValues as h,copy as a}from"../../../../geometry/support/lineSegment.js";import{VisualElement as l}from"./VisualElement.js";import{LaserLineRenderer as c}from"../../support/LaserLineRenderer.js";import{d}from"../../../../chunks/Laserlines.glsl.js";class o extends l{constructor(e){super(e.view),this._angleCutoff=d,this._style={},this._heightManifoldTarget=n(),this._heightManifoldEnabled=!1,this._intersectsLine=r(),this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._lineVerticalPlaneSegment=null,this._pathVerticalPlaneBuffers=null,this._pointDistanceLine=null,this.applyProps(e)}get testData(){return this.renderer}createResources(){this.ensureRenderer()}destroyResources(){this.disposeRenderer()}updateVisibility(){this.syncHeightManifold(),this.syncIntersectsLine(),this.syncPathVerticalPlane(),this.syncLineVerticalPlane(),this.syncPointDistance()}get angleCutoff(){return this._angleCutoff}set angleCutoff(e){this._angleCutoff!==e&&(this._angleCutoff=e,this.syncAngleCutoff())}get style(){return this._style}set style(e){this._style=e,this.syncStyle()}get heightManifoldTarget(){return this._heightManifoldEnabled?this._heightManifoldTarget:null}set heightManifoldTarget(t){e(t)?(i(this._heightManifoldTarget,t),this._heightManifoldEnabled=!0):this._heightManifoldEnabled=!1,this.syncRenderer(),this.syncHeightManifold()}set intersectsWorldUpAtLocation(e){if(t(e))return void(this.intersectsLine=null);const i=this.view.renderCoordsHelper.worldUpAtPosition(e,f);this.intersectsLine=h(e,i),this.intersectsLineInfinite=!0}get intersectsLine(){return this._intersectsLineEnabled?this._intersectsLine:null}set intersectsLine(t){e(t)?(a(t,this._intersectsLine),this._intersectsLineEnabled=!0):this._intersectsLineEnabled=!1,this.syncIntersectsLine(),this.syncRenderer()}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){this._intersectsLineInfinite=e,this.syncIntersectsLineInfinite()}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(t){this._lineVerticalPlaneSegment=e(t)?a(t):null,this.syncLineVerticalPlane(),this.syncRenderer()}get pathVerticalPlane(){return this._pathVerticalPlaneBuffers}set pathVerticalPlane(e){this._pathVerticalPlaneBuffers=e,this.syncPathVerticalPlane(),this.syncLineVerticalPlane(),this.syncPointDistance(),this.syncRenderer()}get pointDistanceLine(){return this._pointDistanceLine}set pointDistanceLine(t){this._pointDistanceLine=e(t)?{origin:s(t.origin),target:s(t.target)}:null,this.syncPointDistance(),this.syncRenderer()}syncRenderer(){this.attached&&(this._intersectsLineEnabled||this._heightManifoldEnabled||e(this._pointDistanceLine)||e(this._pathVerticalPlaneBuffers))?this.ensureRenderer():this.disposeRenderer()}ensureRenderer(){e(this.renderer)||(this.renderer=new c(this.view.renderCoordsHelper,void 0,{contrastControlEnabled:!0}),this.syncStyle(),this.syncHeightManifold(),this.syncIntersectsLine(),this.syncIntersectsLineInfinite(),this.syncPathVerticalPlane(),this.syncLineVerticalPlane(),this.syncPointDistance(),this.syncAngleCutoff(),this.view._stage&&this.view._stage.addRenderPlugin(this.renderer.renderSlots,this.renderer))}syncStyle(){t(this.renderer)||(this.renderer.
|
|
5
|
+
import{isSome as e,isNone as t}from"../../../../core/maybe.js";import{g as i}from"../../../../chunks/vec3.js";import{c as n,a as s}from"../../../../chunks/vec3f64.js";import{create as r,fromValues as h,copy as a}from"../../../../geometry/support/lineSegment.js";import{VisualElement as l}from"./VisualElement.js";import{LaserLineRenderer as c}from"../../support/LaserLineRenderer.js";import{d}from"../../../../chunks/Laserlines.glsl.js";class o extends l{constructor(e){super(e.view),this._angleCutoff=d,this._style={},this._heightManifoldTarget=n(),this._heightManifoldEnabled=!1,this._intersectsLine=r(),this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._lineVerticalPlaneSegment=null,this._pathVerticalPlaneBuffers=null,this._pointDistanceLine=null,this.applyProps(e)}get testData(){return this.renderer}createResources(){this.ensureRenderer()}destroyResources(){this.disposeRenderer()}updateVisibility(){this.syncHeightManifold(),this.syncIntersectsLine(),this.syncPathVerticalPlane(),this.syncLineVerticalPlane(),this.syncPointDistance()}get angleCutoff(){return this._angleCutoff}set angleCutoff(e){this._angleCutoff!==e&&(this._angleCutoff=e,this.syncAngleCutoff())}get style(){return this._style}set style(e){this._style=e,this.syncStyle()}get heightManifoldTarget(){return this._heightManifoldEnabled?this._heightManifoldTarget:null}set heightManifoldTarget(t){e(t)?(i(this._heightManifoldTarget,t),this._heightManifoldEnabled=!0):this._heightManifoldEnabled=!1,this.syncRenderer(),this.syncHeightManifold()}set intersectsWorldUpAtLocation(e){if(t(e))return void(this.intersectsLine=null);const i=this.view.renderCoordsHelper.worldUpAtPosition(e,f);this.intersectsLine=h(e,i),this.intersectsLineInfinite=!0}get intersectsLine(){return this._intersectsLineEnabled?this._intersectsLine:null}set intersectsLine(t){e(t)?(a(t,this._intersectsLine),this._intersectsLineEnabled=!0):this._intersectsLineEnabled=!1,this.syncIntersectsLine(),this.syncRenderer()}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){this._intersectsLineInfinite=e,this.syncIntersectsLineInfinite()}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(t){this._lineVerticalPlaneSegment=e(t)?a(t):null,this.syncLineVerticalPlane(),this.syncRenderer()}get pathVerticalPlane(){return this._pathVerticalPlaneBuffers}set pathVerticalPlane(e){this._pathVerticalPlaneBuffers=e,this.syncPathVerticalPlane(),this.syncLineVerticalPlane(),this.syncPointDistance(),this.syncRenderer()}get pointDistanceLine(){return this._pointDistanceLine}set pointDistanceLine(t){this._pointDistanceLine=e(t)?{origin:s(t.origin),target:s(t.target)}:null,this.syncPointDistance(),this.syncRenderer()}syncRenderer(){this.attached&&(this._intersectsLineEnabled||this._heightManifoldEnabled||e(this._pointDistanceLine)||e(this._pathVerticalPlaneBuffers))?this.ensureRenderer():this.disposeRenderer()}ensureRenderer(){e(this.renderer)||(this.renderer=new c(this.view.renderCoordsHelper,void 0,{contrastControlEnabled:!0}),this.syncStyle(),this.syncHeightManifold(),this.syncIntersectsLine(),this.syncIntersectsLineInfinite(),this.syncPathVerticalPlane(),this.syncLineVerticalPlane(),this.syncPointDistance(),this.syncAngleCutoff(),this.view._stage&&this.view._stage.addRenderPlugin(this.renderer.renderSlots,this.renderer))}syncStyle(){t(this.renderer)||(this.renderer.setParameters(this._style),null!=this._style.intersectsLineRadius&&(this.renderer.intersectsLineRadius=this._style.intersectsLineRadius))}syncAngleCutoff(){t(this.renderer)||this.renderer.setParameters({angleCutoff:this._angleCutoff})}syncHeightManifold(){t(this.renderer)||(this.renderer.heightManifoldEnabled=this._heightManifoldEnabled&&this.visible,this._heightManifoldEnabled&&(this.renderer.heightManifoldTarget=this._heightManifoldTarget))}syncIntersectsLine(){t(this.renderer)||(this.renderer.intersectsLineEnabled=this._intersectsLineEnabled&&this.visible,this._intersectsLineEnabled&&(this.renderer.intersectsLineSegment=this._intersectsLine))}syncIntersectsLineInfinite(){t(this.renderer)||(this.renderer.intersectsLineInfinite=this._intersectsLineInfinite)}syncPathVerticalPlane(){t(this.renderer)||(this.renderer.pathVerticalPlaneEnabled=e(this._pathVerticalPlaneBuffers)&&this.visible,e(this._pathVerticalPlaneBuffers)&&(this.renderer.pathVerticalPlaneBuffers=this._pathVerticalPlaneBuffers))}syncLineVerticalPlane(){t(this.renderer)||(this.renderer.lineVerticalPlaneEnabled=e(this._lineVerticalPlaneSegment)&&this.visible,e(this._lineVerticalPlaneSegment)&&(this.renderer.lineVerticalPlaneSegment=this._lineVerticalPlaneSegment))}syncPointDistance(){t(this.renderer)||(this.renderer.pointDistanceEnabled=e(this._pointDistanceLine)&&this.visible,e(this._pointDistanceLine)&&(this.renderer.pointDistanceOrigin=this._pointDistanceLine.origin,this.renderer.pointDistanceTarget=this._pointDistanceLine.target))}disposeRenderer(){e(this.renderer)&&this.view._stage&&(this.view._stage.removeRenderPlugin(this.renderer),this.renderer=null)}}const f=n();export{o as LaserlineVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as t}from"../../../../core/maybe.js";import{i as r,t as s}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{Z as n,c as h}from"../../../../chunks/vec3f64.js";import{g as l,c as a}from"../../../../chunks/vec4.js";import{f as p,c as d,a as f}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as _}from"./Object3DVisualElement.js";import{createGeometry as c}from"../../layers/graphics/lineUtils.js";import{RibbonLineMaterial as u}from"../../webgl-engine/materials/RibbonLineMaterial.js";class m extends _{constructor(e){super(e),this._renderOccluded=4,this._width=1,this._color=p(1,0,1,1),this._innerWidth=1,this._innerColor=null,this._stipplePattern=null,this._stippleOffColor=null,this._stippleIntegerRepeats=!1,this._writeDepthEnabled=!0,this._falloff=0,this._polygonOffset=!1,this.applyProps(e)}setGeometryFromRenderSpacePoint(e){const t=1e3,r=[];r.push([[e[0]-t,e[1]+0,e[2]+0],[e[0]+t,e[1]+0,e[2]+0]]),r.push([[e[0]-0,e[1]-t,e[2]+0],[e[0]+0,e[1]+t,e[2]+0]]),r.push([[e[0]-0,e[1]+0,e[2]-t],[e[0]+0,e[1]+0,e[2]+t]]),this.geometry=r}setGeometryFromExtent(e){const t=this.view.spatialReference,r=h(),s=h(),i=100,n=[];o(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[2],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[2],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[0],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),this.geometry=[n]}setGeometryFromFrustum(e){const t=[];e.lines.forEach((e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])})),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,i=e.basis2,o=.5,n=h(),l=h(),a=h(),p=h();n[0]=r[0]-s[0]*o-i[0]*o,n[1]=r[1]-s[1]*o-i[1]*o,n[2]=r[2]-s[2]*o-i[2]*o,l[0]=r[0]-s[0]*o+i[0]*o,l[1]=r[1]-s[1]*o+i[1]*o,l[2]=r[2]-s[2]*o+i[2]*o,a[0]=r[0]+s[0]*o+i[0]*o,a[1]=r[1]+s[1]*o+i[1]*o,a[2]=r[2]+s[2]*o+i[2]*o,p[0]=r[0]+s[0]*o-i[0]*o,p[1]=r[1]+s[1]*o-i[1]*o,p[2]=r[2]+s[2]*o-i[2]*o,t.push([n[0],n[1],n[2]]),t.push([l[0],l[1],l[2]]),t.push([a[0],a[1],a[2]]),t.push([p[0],p[1],p[2]]),t.push([n[0],n[1],n[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;r(g),s(g,g,t),this.transform=g;const{points:i}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[i]}setGeometryFromSegments(e,t=n){r(g),s(g,g,t),this.transform=g,this.geometry=e.map((e=>e.createRenderGeometry(t,this.view.renderCoordsHelper).points))}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){l(e,this._color)||(a(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(r){e(r)?!t(this._innerColor)&&l(r,this._innerColor)||(this._innerColor=a(d(),r),this._updateMaterial()):e(this._innerColor)&&(this._innerColor=null,this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(t){const r=e(t)!==e(this._stipplePattern);this._stipplePattern=t,r?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(r){(t(r)||t(this._stippleOffColor)||!l(r,this._stippleOffColor))&&(this._stippleOffColor=e(r)?f(r):null,this._updateMaterial())}get stippleIntegerRepeats(){return this._stippleIntegerRepeats}set stippleIntegerRepeats(e){this._stippleIntegerRepeats!==e&&(this._stippleIntegerRepeats=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}createExternalResources(){this._material=new u(this.materialParameters)}destroyExternalResources(){this._material=null}createGeometries(e){const t=this._createLineGeometries();if(0!==t.length)for(let r=0;r<t.length;++r){const s=c(t[r]);e.addGeometry(s,this._material)}}forEachExternalMaterial(e){e(this._material)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,isClosed:!1,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,stippleIntegerRepeats:this._stippleIntegerRepeats,polygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}}_updateMaterial(){this.attached&&this._material.
|
|
5
|
+
import{isSome as e,isNone as t}from"../../../../core/maybe.js";import{i as r,t as s}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{Z as n,c as h}from"../../../../chunks/vec3f64.js";import{g as l,c as a}from"../../../../chunks/vec4.js";import{f as p,c as d,a as f}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as _}from"./Object3DVisualElement.js";import{createGeometry as c}from"../../layers/graphics/lineUtils.js";import{RibbonLineMaterial as u}from"../../webgl-engine/materials/RibbonLineMaterial.js";class m extends _{constructor(e){super(e),this._renderOccluded=4,this._width=1,this._color=p(1,0,1,1),this._innerWidth=1,this._innerColor=null,this._stipplePattern=null,this._stippleOffColor=null,this._stippleIntegerRepeats=!1,this._writeDepthEnabled=!0,this._falloff=0,this._polygonOffset=!1,this.applyProps(e)}setGeometryFromRenderSpacePoint(e){const t=1e3,r=[];r.push([[e[0]-t,e[1]+0,e[2]+0],[e[0]+t,e[1]+0,e[2]+0]]),r.push([[e[0]-0,e[1]-t,e[2]+0],[e[0]+0,e[1]+t,e[2]+0]]),r.push([[e[0]-0,e[1]+0,e[2]-t],[e[0]+0,e[1]+0,e[2]+t]]),this.geometry=r}setGeometryFromExtent(e){const t=this.view.spatialReference,r=h(),s=h(),i=100,n=[];o(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[2],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[2],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[0],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),o(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),n.push([s[0],s[1],s[2]]),this.geometry=[n]}setGeometryFromFrustum(e){const t=[];e.lines.forEach((e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])})),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,i=e.basis2,o=.5,n=h(),l=h(),a=h(),p=h();n[0]=r[0]-s[0]*o-i[0]*o,n[1]=r[1]-s[1]*o-i[1]*o,n[2]=r[2]-s[2]*o-i[2]*o,l[0]=r[0]-s[0]*o+i[0]*o,l[1]=r[1]-s[1]*o+i[1]*o,l[2]=r[2]-s[2]*o+i[2]*o,a[0]=r[0]+s[0]*o+i[0]*o,a[1]=r[1]+s[1]*o+i[1]*o,a[2]=r[2]+s[2]*o+i[2]*o,p[0]=r[0]+s[0]*o-i[0]*o,p[1]=r[1]+s[1]*o-i[1]*o,p[2]=r[2]+s[2]*o-i[2]*o,t.push([n[0],n[1],n[2]]),t.push([l[0],l[1],l[2]]),t.push([a[0],a[1],a[2]]),t.push([p[0],p[1],p[2]]),t.push([n[0],n[1],n[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;r(g),s(g,g,t),this.transform=g;const{points:i}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[i]}setGeometryFromSegments(e,t=n){r(g),s(g,g,t),this.transform=g,this.geometry=e.map((e=>e.createRenderGeometry(t,this.view.renderCoordsHelper).points))}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){l(e,this._color)||(a(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(r){e(r)?!t(this._innerColor)&&l(r,this._innerColor)||(this._innerColor=a(d(),r),this._updateMaterial()):e(this._innerColor)&&(this._innerColor=null,this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(t){const r=e(t)!==e(this._stipplePattern);this._stipplePattern=t,r?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(r){(t(r)||t(this._stippleOffColor)||!l(r,this._stippleOffColor))&&(this._stippleOffColor=e(r)?f(r):null,this._updateMaterial())}get stippleIntegerRepeats(){return this._stippleIntegerRepeats}set stippleIntegerRepeats(e){this._stippleIntegerRepeats!==e&&(this._stippleIntegerRepeats=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}createExternalResources(){this._material=new u(this.materialParameters)}destroyExternalResources(){this._material=null}createGeometries(e){const t=this._createLineGeometries();if(0!==t.length)for(let r=0;r<t.length;++r){const s=c(t[r]);e.addGeometry(s,this._material)}}forEachExternalMaterial(e){e(this._material)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,isClosed:!1,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,stippleIntegerRepeats:this._stippleIntegerRepeats,polygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}}_updateMaterial(){this.attached&&this._material.setParameters(this.materialParameters)}_createLineGeometries(){const e=this.geometry;if(t(e)||0===e.length)return[];const r=[];return e.forEach((e=>{const t=e.length,s=new Float64Array(3*t);e.forEach(((e,t)=>{s[3*t+0]=e[0],s[3*t+1]=e[1],s[3*t+2]=e[2]}));const i={attributeData:{position:s},removeDuplicateStartEnd:0};r.push(i)})),r}}const g=i();export{m as LineVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as r}from"../../../../core/maybe.js";import{z as t}from"../../../../chunks/mat4.js";import{f as s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as i,c}from"../../../../chunks/vec4.js";import{f as a}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as
|
|
5
|
+
import{isSome as e,isNone as r}from"../../../../core/maybe.js";import{z as t}from"../../../../chunks/mat4.js";import{f as s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as i,c}from"../../../../chunks/vec4.js";import{f as a}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as h}from"./Object3DVisualElement.js";import{Geometry as l}from"../../webgl-engine/lib/Geometry.js";import{CheckerBoardMaterial as n}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class d extends h{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=4,this._geometry=null,this._size=[1,1],this._color1=a(1,.5,0,.5),this._color2=a(1,1,1,.5),this.applyProps(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this.updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.geometryChanged()}get size(){return this._size}set size(e){this._size=e,this.updateMaterial()}get color1(){return this._color1}set color1(e){i(e,this._color1)||(c(this._color1,e),this.updateMaterial())}get color2(){return this._color2}set color2(e){i(e,this._color2)||(c(this._color2,e),this.updateMaterial())}updateMaterial(){e(this._checkerBoardMaterial)&&this._checkerBoardMaterial.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new n({size:this._size,color1:this._color1,color2:this._color2,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:4})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachExternalMaterial(r){e(this._checkerBoardMaterial)&&r(this._checkerBoardMaterial)}createGeometries(e){if(r(this._geometry)||r(this._checkerBoardMaterial))return;const i=u;t(i,this.transform);const c=this._geometry,a=[],h=o();c.position.forEach((e=>{s(h,e,i),a.push(h[0],h[1],h[2])}));const n=[];c.uv.forEach((e=>{n.push(e[0],e[1])}));const d=new l([["position",{size:3,data:a,exclusive:!0}],["uv0",{size:2,data:n,exclusive:!0}]],[["position",c.triangleIndices],["uv0",c.triangleIndices]]);e.addGeometry(d,this._checkerBoardMaterial)}geometryChanged(){this.recreateGeometry()}}const u=o();export{d as MeasurementAreaVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.22/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Handles.js";import{applyOpacity as r}from"../../../../core/mathUtils.js";import{isNone as t,isSome as s}from"../../../../core/maybe.js";import{c as i}from"../../../../chunks/mat4f64.js";import{f as o}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{c as n}from"../../../../chunks/vec4f64.js";import{sv3d as h}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import d from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as c}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class p extends l{constructor(e){super(e),this._parameters=m,this._handles=null,this._origin=a(),this._originTransform=i(),this._arrowCenter=a(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._opacity=1,this.applyProps(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial&&this._arrowMaterial.
|
|
5
|
+
import e from"../../../../core/Handles.js";import{applyOpacity as r}from"../../../../core/mathUtils.js";import{isNone as t,isSome as s}from"../../../../core/maybe.js";import{c as i}from"../../../../chunks/mat4f64.js";import{f as o}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{c as n}from"../../../../chunks/vec4f64.js";import{sv3d as h}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import d from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as c}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class p extends l{constructor(e){super(e),this._parameters=m,this._handles=null,this._origin=a(),this._originTransform=i(),this._arrowCenter=a(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._opacity=1,this.applyProps(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial&&this._arrowMaterial.setParameters({renderOccluded:e}))}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(e){this._stripeLength=e,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(e){if(this._stripesEnabled=e,this.attached){const e=this.opacity,{arrowStripeEvenColor:t,arrowStripeOddColor:s}=this._parameters,i=r(_,this._stripesEnabled?t:s,e);this._arrowMaterial.setParameters({stripeEvenColor:i})}}get opacity(){return this._opacity}set opacity(e){e!==this._opacity&&(this._opacity=e,this._updateArrowOpacity())}createExternalResources(){const{arrowStripeEvenColor:r,arrowStripeOddColor:t,arrowOutlineColor:s}=this._parameters,i=this._stripesEnabled?r:t;this._arrowMaterial=new c({outlineColor:s,stripeEvenColor:i,stripeOddColor:t,renderOccluded:this.renderOccluded,polygonOffset:!0}),this._handles=new e,this._handles.add(this.view.state.watch("camera",(()=>{this.viewChanged()})))}destroyExternalResources(){this._arrowMaterial=null,this._handles.destroy(),this._handles=null}forEachExternalMaterial(e){e(this._arrowMaterial)}createGeometries(e){if(t(this._geometry)||t(this._geometry.startRenderSpace)||t(this._geometry.endRenderSpace))return;const r=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);e.addGeometry(r,this._arrowMaterial,this._originTransform),this.viewChanged()}_createArrowGeometry(e,r,t,s){const i=this.view.renderCoordsHelper,a=[],n=[],l=(e,r)=>{const s=h.get();o(s,e,t),a.push(s),n.push(r)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const t=h.get();i.worldUpAtPosition(this._arrowCenter,t),l(e,t),l(r,t)}else{s.eval(.5,this._arrowCenter);const e=this._parameters.arrowSubdivisions+1&-2;for(let r=0;r<e;++r){const t=r/(e-1),o=h.get(),a=h.get();s.eval(t,o),i.worldUpAtPosition(o,a),l(o,a)}}return d.createPolylineGeometry(a,n)}geometryChanged(){this.recreateGeometry()}viewChanged(){if(this.view.ready&&this.attached&&s(this._geometry)){const e=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._parameters.arrowWidth*e})}}_updateArrowOpacity(){const e=this.opacity,{arrowStripeEvenColor:t,arrowStripeOddColor:s,arrowOutlineColor:i}=this._parameters,o=r(_,this._stripesEnabled?t:s,e),a=r(w,i,e),n=r(g,s,e);this._arrowMaterial.setParameters({stripeEvenColor:o,outlineColor:a,stripeOddColor:n})}}const m={arrowWidth:16,arrowOutlineColor:[1,.5,0,1],arrowOutlineWidth:.2,arrowStripeEvenColor:[1,1,1,1],arrowStripeOddColor:[1,.5,0,1],arrowStripeLength:16,arrowSubdivisions:128},_=n(),w=n(),g=n();export{p as MeasurementArrowVisualElement};
|