@arcgis/core 5.2.0-next.72 → 5.2.0-next.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/ViewshedAnalysis.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d3be4d914fc99a1d686c.js → 075e65cc4275ac886f08.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b3a8a6167f2e1eeb828.js → 0823961e5d0bdedbf8cf.js} +2 -2
- package/assets/esri/core/workers/chunks/087bd698b80ca0cea71e.js +1 -0
- package/assets/esri/core/workers/chunks/{b6c7b7b7f87dce5de811.js → 0bf644f93c180a2bc2f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{a62f1b8ed065b2a38f1a.js → 0dbf31a663b5220a3136.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe10a95ebe1da2322af6.js → 0df660dfd941cff3ea1d.js} +1 -1
- package/assets/esri/core/workers/chunks/0e81c6d4f1c81f9b0a1b.js +1 -0
- package/assets/esri/core/workers/chunks/{d93d0cb69f3a9a722510.js → 1418c03c4ab87f7ab5f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{c03da138651ac53cadcb.js → 186bedc377cc97731ca2.js} +2 -2
- package/assets/esri/core/workers/chunks/193aed69de2dec4f36b6.js +1 -0
- package/assets/esri/core/workers/chunks/1a3afee3ecd806b4aa81.js +1 -0
- package/assets/esri/core/workers/chunks/{359584a8fb5687a7d098.js → 264fd750691d517ab1f3.js} +1 -1
- package/assets/esri/core/workers/chunks/28f87daaba1ae3441364.js +1 -0
- package/assets/esri/core/workers/chunks/{fff23b2682590c4b21e3.js → 2a2ed7bd44010f24c2dd.js} +1 -1
- package/assets/esri/core/workers/chunks/2baa16ec8559e77c226f.js +1 -0
- package/assets/esri/core/workers/chunks/2c31648a4b95275516ee.js +1 -0
- package/assets/esri/core/workers/chunks/2e44978ee677aa23163d.js +256 -0
- package/assets/esri/core/workers/chunks/2f81047790c4890ae625.js +1 -0
- package/assets/esri/core/workers/chunks/305eea9c1fc4aee3309e.js +1 -0
- package/assets/esri/core/workers/chunks/31d19bb72a9e79b30070.js +1 -0
- package/assets/esri/core/workers/chunks/{fc2cae359d571690d754.js → 35fd2f765d2cb3f59a22.js} +4 -4
- package/assets/esri/core/workers/chunks/{6b208bac120bcfecd9e4.js → 3e2b4e734aa20a308f3e.js} +1 -1
- package/assets/esri/core/workers/chunks/45ccca01db0027b9dc16.js +1 -0
- package/assets/esri/core/workers/chunks/495f90fe3d0ad32bb82d.js +1 -0
- package/assets/esri/core/workers/chunks/4b5bd0c9a55ea2998601.js +1 -0
- package/assets/esri/core/workers/chunks/{50e0dd74795978468625.js → 4cf2b0558a4acc141429.js} +1 -1
- package/assets/esri/core/workers/chunks/509aecafbc629bee1c15.js +1 -0
- package/assets/esri/core/workers/chunks/{d901f8503a73277cfa58.js → 553be2bd69bd311477ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d3a18d56e2e5669c562.js → 64176f7ae719289a2f79.js} +1 -1
- package/assets/esri/core/workers/chunks/{31669511cfddf116d991.js → 66e60351aacbd162775f.js} +1 -1
- package/assets/esri/core/workers/chunks/{9684ab5e8254fdfcb7bb.js → 67f54586156d1ab80257.js} +1 -1
- package/assets/esri/core/workers/chunks/762be5d3e6aeaea33f74.js +29 -0
- package/assets/esri/core/workers/chunks/76b573143d1a65fdbcb6.js +1 -0
- package/assets/esri/core/workers/chunks/7aaa051b51a8e34bbfb0.js +1 -0
- package/assets/esri/core/workers/chunks/{fa19d5923276418096da.js → 7b5b66ae79e0287e3ade.js} +1 -1
- package/assets/esri/core/workers/chunks/{2cfe6f41865ffb3a4645.js → 7e373d9c98ce910db9d2.js} +1 -1
- package/assets/esri/core/workers/chunks/81130dbcb738d40f723b.js +1 -0
- package/assets/esri/core/workers/chunks/{4da993c79b373b9d304e.js → 8302bffd28cc6720e0fe.js} +2 -2
- package/assets/esri/core/workers/chunks/835af7b4fd92cb4e7af0.js +1 -0
- package/assets/esri/core/workers/chunks/859dd86c921053bf03a1.js +1 -0
- package/assets/esri/core/workers/chunks/877594b6db08da98acd7.js +1 -0
- package/assets/esri/core/workers/chunks/{96d861265566854760cd.js → 88fd698b940dadcc6dc5.js} +1 -1
- package/assets/esri/core/workers/chunks/8f0d4aec8bd3cbfefc40.js +1 -0
- package/assets/esri/core/workers/chunks/{7f208ef75ef2ce0d7cf9.js → 910c93bbbf8113a4a51f.js} +1 -1
- package/assets/esri/core/workers/chunks/92c4464b67fce6cea134.js +1 -0
- package/assets/esri/core/workers/chunks/{509cfac9e5d86a8ee449.js → 936d44c7bc3a181e64a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9953277d0cd4a01bdc6.js → 94368a097e6190ce3c7a.js} +1 -1
- package/assets/esri/core/workers/chunks/947f1ea4dbc3e3419ecc.js +1 -0
- package/assets/esri/core/workers/chunks/9b76c8974424a1908e86.js +1 -0
- package/assets/esri/core/workers/chunks/{c203df41f9d2e4b80889.js → 9ca59077712e45ef4d56.js} +1 -1
- package/assets/esri/core/workers/chunks/9e25f715cda59c686a4c.js +1 -0
- package/assets/esri/core/workers/chunks/{36171c72a3c04b0d13ef.js → a0a1f0bd3648738354a6.js} +1 -1
- package/assets/esri/core/workers/chunks/a101152066dd56259619.js +1 -0
- package/assets/esri/core/workers/chunks/a2a2c7e274fb32fecffa.js +1 -0
- package/assets/esri/core/workers/chunks/a50421fe79f264ae3619.js +1 -0
- package/assets/esri/core/workers/chunks/a9053ad0f4e8c4705665.js +1 -0
- package/assets/esri/core/workers/chunks/aca5c524bd3c955e9243.js +1 -0
- package/assets/esri/core/workers/chunks/{9dda9414104f585560a4.js → ad1d06a91121ebfe9162.js} +2 -2
- package/assets/esri/core/workers/chunks/b1a175b3b2d1a7ddde8e.js +1 -0
- package/assets/esri/core/workers/chunks/{065e3353124fc5ac44ce.js → b33d870cbfa238762c5e.js} +1 -1
- package/assets/esri/core/workers/chunks/b3b53cf0a3a30164d337.js +1 -0
- package/assets/esri/core/workers/chunks/b6d26d9738c0787acc38.js +1 -0
- package/assets/esri/core/workers/chunks/b9c61b20bbc91cb63036.js +1 -0
- package/assets/esri/core/workers/chunks/bf3dc3ad8df8488da3f0.js +1 -0
- package/assets/esri/core/workers/chunks/bff75cc7413bf0d319db.js +1 -0
- package/assets/esri/core/workers/chunks/c1568bcd3f04014152e1.js +1 -0
- package/assets/esri/core/workers/chunks/c1a4d499a30f3d80567b.js +1 -0
- package/assets/esri/core/workers/chunks/c374e5d5980db74c4aca.js +1 -0
- package/assets/esri/core/workers/chunks/{8c76f31a363dd0c3354d.js → c46f79d5b7712adbbd1c.js} +1 -1
- package/assets/esri/core/workers/chunks/c67e4a848d41038367b8.js +1 -0
- package/assets/esri/core/workers/chunks/{684d3cb4fb233180b2d0.js → cd892c9603710d6130a9.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa5d27e47d47ff8fcb96.js → d03e7be74c57c3dbf003.js} +2 -2
- package/assets/esri/core/workers/chunks/de5013f89f0eae93978f.js +1 -0
- package/assets/esri/core/workers/chunks/e557043f90c051e93925.js +1 -0
- package/assets/esri/core/workers/chunks/{bee5e738ecf8680909c4.js → eaf26c1cc938789d5336.js} +1 -1
- package/assets/esri/core/workers/chunks/ebfb3cdc0df15eb05d75.js +1 -0
- package/assets/esri/core/workers/chunks/f1727b4a32cb6f36a5e6.js +1 -0
- package/assets/esri/core/workers/chunks/f4bc563c71c478d3912f.js +1 -0
- package/assets/esri/core/workers/chunks/fb0b89bbb4f8607d5f20.js +1 -0
- package/assets/esri/core/workers/chunks/fdca9873914b9dbd9244.js +1 -0
- package/assets/esri/core/workers/chunks/ff890167ff2baabfc4ce.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/Component.glsl.js +3 -3
- package/chunks/HUDMaterial.glsl.js +8 -8
- package/chunks/lyr3DMain.js +1 -1
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +22 -0
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/ILyr3DWasmPerSceneView.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/layersMapping.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/BitmapTile.js +1 -1
- package/views/2d/engine/BitmapTileContainer.js +1 -1
- package/views/2d/engine/flow/FlowContainer.js +1 -1
- package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/imagery/RasterBitmap.js +1 -1
- package/views/2d/engine/imagery/RasterTile.js +1 -1
- package/views/2d/engine/imagery/RasterTileContainer.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/imagery/RasterVFTile.js +1 -1
- package/views/2d/engine/imagery/RasterVFTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/OverlayContainer.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TileContainer.js +1 -1
- package/views/2d/engine/webgl/normalizedTileUtils.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/rasterVFUtils.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ClipShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DebugOverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/Tile.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowParticlesShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterVFTransform.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAggregateManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/DepthConversion.glsl.js +14 -0
- package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js +3 -15
- package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.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/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/PolylinePlugin.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawToolUtils.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/draw/support/tooltipUtils.js +1 -1
- package/views/interactive/options/InteractiveToolOptions.d.ts +36 -0
- package/views/interactive/options/InteractiveToolOptions.js +2 -0
- package/views/interactive/sketch/SketchOptions.d.ts +4 -3
- package/views/interactive/sketch/SketchOptions.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDynamic.js +1 -1
- package/views/interactive/tooltip/fields/fields.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0623acb2bd14a61b65c9.js +0 -29
- package/assets/esri/core/workers/chunks/06c9aac75a01d3af6d54.js +0 -1
- package/assets/esri/core/workers/chunks/089f8c60e96d920a2cb2.js +0 -1
- package/assets/esri/core/workers/chunks/0c3c311400ee352187ea.js +0 -1
- package/assets/esri/core/workers/chunks/158d2ac0333d53556e33.js +0 -1
- package/assets/esri/core/workers/chunks/16cade1c2ddf44e336ee.js +0 -1
- package/assets/esri/core/workers/chunks/1b130af7d14eaae69d96.js +0 -1
- package/assets/esri/core/workers/chunks/1e0140556c2e3fa72545.js +0 -1
- package/assets/esri/core/workers/chunks/1e5cb72830c7f32f2961.js +0 -1
- package/assets/esri/core/workers/chunks/259bdacfb7b0f866a8d0.js +0 -1
- package/assets/esri/core/workers/chunks/2f58e1f64df2da8259a2.js +0 -1
- package/assets/esri/core/workers/chunks/383304d33b496c5d8baa.js +0 -1
- package/assets/esri/core/workers/chunks/3aacb935d632834d4154.js +0 -1
- package/assets/esri/core/workers/chunks/3c8e98cf23ad8ef12fcb.js +0 -1
- package/assets/esri/core/workers/chunks/3dc71e03a630dd50b28e.js +0 -1
- package/assets/esri/core/workers/chunks/3fd022df127af32782ce.js +0 -1
- package/assets/esri/core/workers/chunks/4344ab1250a1c550bf8b.js +0 -1
- package/assets/esri/core/workers/chunks/43de723f765ec8f268ac.js +0 -1
- package/assets/esri/core/workers/chunks/4695cd6120f60b234d5c.js +0 -1
- package/assets/esri/core/workers/chunks/582a1d468089b9986416.js +0 -1
- package/assets/esri/core/workers/chunks/5f201c77a09ae0df29d6.js +0 -1
- package/assets/esri/core/workers/chunks/6080e46fc79127500283.js +0 -1
- package/assets/esri/core/workers/chunks/6357c7cac401aee9fe77.js +0 -1
- package/assets/esri/core/workers/chunks/67d3ff7fcefaa7d5d27f.js +0 -1
- package/assets/esri/core/workers/chunks/6a9002fcba11e2cf3f2e.js +0 -1
- package/assets/esri/core/workers/chunks/72dcd4bd1a28bf8605c5.js +0 -1
- package/assets/esri/core/workers/chunks/73f228d966b89c73c9e9.js +0 -1
- package/assets/esri/core/workers/chunks/77df0bb35d2688729479.js +0 -1
- package/assets/esri/core/workers/chunks/7a143ca61c0a70306185.js +0 -1
- package/assets/esri/core/workers/chunks/869d292a60747c93dc84.js +0 -1
- package/assets/esri/core/workers/chunks/9c57161ad48d8d546dc7.js +0 -1
- package/assets/esri/core/workers/chunks/a7f42ada0aa69873a938.js +0 -1
- package/assets/esri/core/workers/chunks/a988fd54912969b812ce.js +0 -1
- package/assets/esri/core/workers/chunks/aff0e7761276036e029d.js +0 -1
- package/assets/esri/core/workers/chunks/b7d8817018b3d277c454.js +0 -1
- package/assets/esri/core/workers/chunks/bfb6566c27c09deb0929.js +0 -1
- package/assets/esri/core/workers/chunks/c715c585c42d8c2b86f5.js +0 -1
- package/assets/esri/core/workers/chunks/c7e9513f75b8ec205562.js +0 -1
- package/assets/esri/core/workers/chunks/c838cc1c786368b78598.js +0 -1
- package/assets/esri/core/workers/chunks/cd4e5c948d1bfa9b9a2d.js +0 -1
- package/assets/esri/core/workers/chunks/cfe31b7d1c6c05fbd268.js +0 -1
- package/assets/esri/core/workers/chunks/d0c1bc90e474f706211c.js +0 -1
- package/assets/esri/core/workers/chunks/d2faac81142586cf7509.js +0 -1
- package/assets/esri/core/workers/chunks/da484787bd9fd3b13d15.js +0 -1
- package/assets/esri/core/workers/chunks/e21b3490bfce75405e55.js +0 -1
- package/assets/esri/core/workers/chunks/e4353f0792f45aa6a62f.js +0 -1
- package/assets/esri/core/workers/chunks/e702abaeccef20b64a81.js +0 -1
- package/assets/esri/core/workers/chunks/ebd619533be077059494.js +0 -1
- package/assets/esri/core/workers/chunks/f475672ff4c2ec9367c2.js +0 -1
- package/assets/esri/core/workers/chunks/f69329b85b362b349a8c.js +0 -1
- package/assets/esri/core/workers/chunks/fba8065a3a6fbd877e23.js +0 -1
- package/assets/esri/core/workers/chunks/fd6107f95082e05f016a.js +0 -256
- package/assets/esri/core/workers/chunks/fec07a16b72cdcafc641.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/utils.js +0 -2
- /package/assets/esri/core/workers/chunks/{3b3a8a6167f2e1eeb828.js.LICENSE.txt → 0823961e5d0bdedbf8cf.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c03da138651ac53cadcb.js.LICENSE.txt → 186bedc377cc97731ca2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4da993c79b373b9d304e.js.LICENSE.txt → 8302bffd28cc6720e0fe.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9dda9414104f585560a4.js.LICENSE.txt → ad1d06a91121ebfe9162.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fa5d27e47d47ff8fcb96.js.LICENSE.txt → d03e7be74c57c3dbf003.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import l from"../../../../core/Accessor.js";import{equals as n}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{isPromiseLike as c}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as u,formatDecimal as m}from"../../../../core/quantityFormatUtils.js";import{watch as d,initial as h}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as p}from"../../../../core/units.js";import{property as g,subclass as y}from"../../../../core/accessorSupport/decorators.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as V,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as L,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{angleAroundAxis as P}from"../../../../geometry/support/vector.js";import{t as F}from"../../../../chunks/vec3.js";import x from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as O}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as D}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as M}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as A}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as U}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfoElevationAligned as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillVisualization as S,VolumeGeometry as z}from"../../webgl-engine/lib/CutFillVisualization.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";let B=class extends l{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get inView(){return this.analysisViewData.analysisObb?.intersectsFrustum(this.view.frustum)??!1}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{depthExtremaPositions:t,targetGeometry:i}=this.analysisViewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let l=-1/0;for(const o of i.rings)for(const e of o)l=Math.max(l,e[2]);const n=1,r=e.getAltitude(t.fill);return{cut:s,fill:Math.min(r-l,0)-n}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new C,this._elevationContext=A.fromElevationInfo(new x({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,l={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new D({...l,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new D(l);const n={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:3},r={...n,stipplePattern:H(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new R({...n,color:a}),this._occludedCutProjectionLines=new R({...r,color:a}),this._fillProjectionLines=new R({...n,color:c,renderOccluded:8}),this._occludedFillProjectionLines=new R({...r,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new O({...u,distance:s.labelDistance}),this._fillVolumeLabel=new O({...u,distance:-s.labelDistance}),this._cutFillVisualization=new S({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([d(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},h),d(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillVisualization.measureType=i},h),d(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),h),d(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},h),d(()=>[this.analysisViewData.targetGeometry,this.inView,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),h),d(()=>this.visible&&this.inView&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),h),d(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{depthExtremaPositions:s.depthExtremaPositions,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),d(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),h),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillVisualization.destroy(),this._updatingHandles.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],l=[],r=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&n(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],l=f(L(),o[0],o[1],o[2]);s.toRenderCoords(l,u,l);const n=t.rings[m][e],r=f(L(),n[0],n[1],n[2]);s.toRenderCoords(r,u,r);const a=new M(l,r);p.push(a)}const g=this.view.state.camera;for(let e=0;e<p.length;++e){const s=p[e],n=p[0===e?p.length-1:e-1],u=p[e===p.length-1?0:e+1],d=i[e],h=t.rings[m][e],y=d[2]>h[2],_=new T(s,n,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?r:l).push(s):(f?c:a).push(s)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(l),this._occludedCutProjectionLines.setGeometryFromSegments(r),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let l=!1,n=!1;for(const r of this._projectionLines){r.updateOccluded(e)&&(l||=r.isCut,n||=!r.isCut);const a=r.isOccluded;(r.isCut?a?i:t:a?o:s).push(r.segment)}n&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),l&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:l,fillColor:n,cutColorMuted:r,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillVisualization.cutColor=i?l:r,this._cutFillVisualization.fillColor=i?n:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillVisualization.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:r).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillVisualization.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,depthExtremaPositions:s,messages:o,unitsMessages:l,result:n,visible:r}=e;if(this._cutVolumeLabel.visible=r,this._fillVolumeLabel.visible=r,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==n||null==o||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(l,n.cutVolume,a)}),u=i(o.labels.fill,{volume:I(l,n.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillVisualization.enable():this._cutFillVisualization.disable()}get _polygonRenderInfo(){const{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:i}=this.analysisViewData;if(null==i)return null;const s=E(i,t,e,this._elevationContext,{outlineOutput:"tessellated-indices"});return c(s)?(this._updatingHandles.consumePromise(s),null):s}_updateCutFillGeometry(){const{view:e,analysisViewData:t,inView:i}=this,{renderCoordsHelper:s}=e,{targetGeometry:o}=t,{cut:l,fill:n}=this._extrusionHeights;if(!o?.extent||!i)return;const{center:r}=o.extent,a=w(r.x,r.y,0),c=L();s.toRenderCoords(a,o.spatialReference,c);const u=this._getExtrudedVolume(l,a,c),m=this._getExtrudedVolume(n,a,c);null!=u&&null!=m&&this._cutFillVisualization.updateGeometries(u,m,c)}_getExtrudedVolume(e,t,i){const{renderCoordsHelper:s,spatialReference:o}=this.view,l=L(),n=1===s.viewingMode;s.worldUpAtPosition(i,l);const{_polygonRenderInfo:r}=this;if(null==r)return null;const a=U(r,{height:e,worldUp:l,spherical:n,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(null==a)return null;const c=_(),u=_();if(G(o,t,c,s.spatialReference),u[12]=-c[12],u[13]=-c[13],u[14]=-c[14],F(a.vertices,a.vertices,u),"stockpile"===this.analysis.measureType)for(let m=0;m<a.normals.length;m+=3)a.normals[m]=l[0],a.normals[m+1]=l[1],a.normals[m+2]=l[2];return new z(a.vertices,a.bottomIndices,a.indices,a.normals)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=p(t.value,t.unit,i),o=u(s);return m(e,t,s,o)}e([g({constructOnly:!0})],B.prototype,"view",void 0),e([g({constructOnly:!0})],B.prototype,"analysis",void 0),e([g({constructOnly:!0})],B.prototype,"analysisViewData",void 0),e([g()],B.prototype,"unitsMessages",void 0),e([g()],B.prototype,"messages",void 0),e([g()],B.prototype,"loadingMessages",void 0),e([g({readOnly:!0})],B.prototype,"_updatingHandles",void 0),e([g({readOnly:!0})],B.prototype,"visible",null),e([g()],B.prototype,"inView",null),e([g()],B.prototype,"updating",null),e([g()],B.prototype,"hasUnsupportedError",null),e([g()],B.prototype,"_extrusionHeights",null),e([g()],B.prototype,"_polygonRenderInfo",null),B=e([y("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],B);class T{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=L(),this._n2=L();const o=v(q,j(q,e.endRenderSpace,e.startRenderSpace));v(this._n1,V(this._n1,o,v(k,j(k,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,V(this._n2,o,v(k,j(k,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(P(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(q,this.segment.startRenderSpace,e.eye);const t=b(this._n1,q)<0,i=b(this._n2,q)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const q=L(),k=L();export{B as VolumeMeasurementCutFillVisualization};
|
|
2
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import{equals as l}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{isPromiseLike as u}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as c,formatDecimal as d}from"../../../../core/quantityFormatUtils.js";import{initial as m}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as h}from"../../../../core/units.js";import{property as p,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as _,normalize as f,subtract as v,cross as j,dot as V}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b,fromValues as L}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../../core/support/UpdatingHandles.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{angleAroundAxis as G}from"../../../../geometry/support/vector.js";import{t as P}from"../../../../chunks/vec3.js";import F from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as x}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as O}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as R}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as D}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as M}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as A}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfoElevationAligned as H}from"../../support/renderInfoUtils/polygon.js";import{CutFillVisualization as U,VolumeGeometry as E}from"../../webgl-engine/lib/CutFillVisualization.js";import{createStipplePatternSimple as S}from"../../webgl-engine/materials/lineStippleUtils.js";let z=class extends n{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get inView(){return this.analysisViewData.analysisObb?.intersectsFrustum(this.view.frustum)??!1}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{depthExtremaPositions:t,targetGeometry:i}=this.analysisViewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let n=-1/0;for(const o of i.rings)for(const e of o)n=Math.max(n,e[2]);const l=1,r=e.getAltitude(t.fill);return{cut:s,fill:Math.min(r-n,0)-l}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new w,this._elevationContext=M.fromElevationInfo(new F({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,n={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new R({...n,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new R(n);const l={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:3},r={...l,stipplePattern:S(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),u=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new O({...l,color:a}),this._occludedCutProjectionLines=new O({...r,color:a}),this._fillProjectionLines=new O({...l,color:u,renderOccluded:8}),this._occludedFillProjectionLines=new O({...r,color:u});const c={...i,attached:!0};this._cutVolumeLabel=new x({...c,distance:s.labelDistance}),this._fillVolumeLabel=new x({...c,distance:-s.labelDistance}),this._cutFillVisualization=new U({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([this._updatingHandles.add(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},m),this._updatingHandles.add(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillVisualization.measureType=i},m),this._updatingHandles.add(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),m),this._updatingHandles.add(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},m),this._updatingHandles.add(()=>[this.analysisViewData.targetGeometry,this.inView,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),m),this._updatingHandles.add(()=>this.visible&&this.inView&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),m),this._updatingHandles.add(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{depthExtremaPositions:s.depthExtremaPositions,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),this._updatingHandles.add(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),m),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillVisualization.destroy(),this._updatingHandles.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],n=[],r=[],a=[],u=[],c=e.spatialReference;for(let d=0;d<e.rings.length;d++){const i=e.rings[d],m=i.length>1&&l(i[0],i[i.length-1]),h=i.length-(m?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],n=_(b(),o[0],o[1],o[2]);s.toRenderCoords(n,c,n);const l=t.rings[d][e],r=_(b(),l[0],l[1],l[2]);s.toRenderCoords(r,c,r);const a=new D(n,r);p.push(a)}const g=this.view.state.camera;for(let e=0;e<p.length;++e){const s=p[e],l=p[0===e?p.length-1:e-1],c=p[e===p.length-1?0:e+1],m=i[e],h=t.rings[d][e],y=m[2]>h[2],_=new I(s,l,c,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?r:n).push(s):(f?u:a).push(s)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(n),this._occludedCutProjectionLines.setGeometryFromSegments(r),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(u)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let n=!1,l=!1;for(const r of this._projectionLines){r.updateOccluded(e)&&(n||=r.isCut,l||=!r.isCut);const a=r.isOccluded;(r.isCut?a?i:t:a?o:s).push(r.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),n&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:n,fillColor:l,cutColorMuted:r,fillColorMuted:a,cutProjectionLineColor:u,fillProjectionLineColor:c}=o;if(this._cutFillVisualization.cutColor=i?n:r,this._cutFillVisualization.fillColor=i?l:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillVisualization.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?u:r).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?c:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillVisualization.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,depthExtremaPositions:s,messages:o,unitsMessages:n,result:l,visible:r}=e;if(this._cutVolumeLabel.visible=r,this._fillVolumeLabel.visible=r,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==l||null==o||null==n)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,u=i(o.labels.cut,{volume:B(n,l.cutVolume,a)}),c=i(o.labels.fill,{volume:B(n,l.fillVolume,a)});this._cutVolumeLabel.text=u,this._fillVolumeLabel.text=c}_updateCutFillVisibility(e){e?this._cutFillVisualization.enable():this._cutFillVisualization.disable()}get _polygonRenderInfo(){const{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:i}=this.analysisViewData;if(null==i)return null;const s=H(i,t,e,this._elevationContext,{outlineOutput:"tessellated-indices"});return u(s)?(this._updatingHandles.consumePromise(s),null):s}_updateCutFillGeometry(){const{view:e,analysisViewData:t,inView:i}=this,{renderCoordsHelper:s}=e,{targetGeometry:o}=t,{cut:n,fill:l}=this._extrusionHeights;if(!o?.extent||!i)return;const{center:r}=o.extent,a=L(r.x,r.y,0),u=b();s.toRenderCoords(a,o.spatialReference,u);const c=this._getExtrudedVolume(n,a,u),d=this._getExtrudedVolume(l,a,u);null!=c&&null!=d&&this._cutFillVisualization.updateGeometries(c,d,u)}_getExtrudedVolume(e,t,i){const{renderCoordsHelper:s,spatialReference:o}=this.view,n=b(),l=1===s.viewingMode;s.worldUpAtPosition(i,n);const{_polygonRenderInfo:r}=this;if(null==r)return null;const a=A(r,{height:e,worldUp:n,spherical:l,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(null==a)return null;const u=y(),c=y();if(C(o,t,u,s.spatialReference),c[12]=-u[12],c[13]=-u[13],c[14]=-u[14],P(a.vertices,a.vertices,c),"stockpile"===this.analysis.measureType)for(let d=0;d<a.normals.length;d+=3)a.normals[d]=n[0],a.normals[d+1]=n[1],a.normals[d+2]=n[2];return new E(a.vertices,a.bottomIndices,a.indices,a.normals)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function B(e,t,i){if(!t||!e)return null;const s=h(t.value,t.unit,i),o=c(s);return d(e,t,s,o)}e([p({constructOnly:!0})],z.prototype,"view",void 0),e([p({constructOnly:!0})],z.prototype,"analysis",void 0),e([p({constructOnly:!0})],z.prototype,"analysisViewData",void 0),e([p()],z.prototype,"unitsMessages",void 0),e([p()],z.prototype,"messages",void 0),e([p()],z.prototype,"loadingMessages",void 0),e([p({readOnly:!0})],z.prototype,"_updatingHandles",void 0),e([p({readOnly:!0})],z.prototype,"visible",null),e([p()],z.prototype,"inView",null),e([p()],z.prototype,"updating",null),e([p()],z.prototype,"hasUnsupportedError",null),e([p()],z.prototype,"_extrusionHeights",null),e([p()],z.prototype,"_polygonRenderInfo",null),z=e([g("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],z);class I{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=b(),this._n2=b();const o=f(T,v(T,e.endRenderSpace,e.startRenderSpace));f(this._n1,j(this._n1,o,f(q,v(q,t.startRenderSpace,e.startRenderSpace)))),f(this._n2,j(this._n2,o,f(q,v(q,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(G(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){v(T,this.segment.startRenderSpace,e.eye);const t=V(this._n1,T)<0,i=V(this._n2,T)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const T=b(),q=b();export{z as VolumeMeasurementCutFillVisualization};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{valueInUnit as o}from"../../../../core/quantity.js";import{watch as e,sync as s,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as a,convertUnit as
|
|
2
|
+
import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{valueInUnit as o}from"../../../../core/quantity.js";import{watch as e,sync as s,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as a,convertUnit as l}from"../../../../core/units.js";import{property as r,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as u,lerp as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as c,fromArray as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{sv3d as v,sm4d as _}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as y}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as g}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as w}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as T}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as M,addMapTranslation as U}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as j}from"../../../interactive/InteractiveToolBase.js";import O from"../../../interactive/options/InteractiveToolOptions.js";import E from"../../../interactive/support/Units.js";import{makeTooltip as I,enterInputModeIfAvailable as V}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as b}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as P}from"../../../support/euclideanLengthMeasurementUtils.js";let x=class extends j{constructor(t){super(t),this.multiTouchEnabled=!1,this._updatingHandles=new f,this.toolOptions=new O}initialize(){const{view:t}=this;this._shiftManipulator=new T(t,0,8),this._shiftManipulator.state|=y,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),e(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),s),e(()=>this._showManipulator,t=>this._updateManipulatorVisibility(t),n)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){const{view:t}=this;this.tooltip=I(()=>({view:t,options:this.toolOptions.tooltips})),this._tooltipInfo=new b({toolOptions:this.toolOptions}),this.toolOptions.tooltips.placement="trailing",this._updateToolOptions(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),this._updatingHandles.add(()=>this._shouldShowTooltip,t=>{t?this._showTooltip():this._hideTooltip()}),this.tooltip.on("commit",()=>{const t=this._tooltipInfo.elevation.actual,i=a(this.view.spatialReference);if(null==t||null==i)return;const e=o(t,i);this._updateValue(e,{recordUndo:this.analysis.cutFillOptions.targetElevation})}),e(()=>[this.analysis.displayUnits.elevation,this.analysis.inputUnits.elevation],()=>this._updateToolOptions(),n)])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}onInputEvent(t){if(!this.destroyed&&!V(t,this.tooltip))return super.onInputEvent(t)}onHide(){this._hideTooltip()}onEditableChange(){this.internallyEditable||this._hideTooltip()}get _shouldShowTooltip(){return this._showManipulator&&(this.hasFocusedManipulators||"input"===this.tooltip.mode)}get _showManipulator(){const{interactive:t,targetGeometry:i,visible:o}=this.analysisViewData,{measureType:e}=this.analysis;return o&&t&&null!=i&&"cut-fill"===e}_createDragPipeline(){return M(this._shiftManipulator,(t,i,o)=>{const e=c(t.renderLocation),s=this.analysis.inputUnits.elevation??"meters",n=a(this.view.spatialReference);let r;i.next(w(this.view,e,this.view.spatialReference)).next(U()).next(t=>{if("start"===t.action){const{targetElevation:t}=this.analysis.cutFillOptions;r=t&&n?l(t,s,n):void 0}return this._updateValue(null!=r?r+t.translationZ:t.mapEnd.z,"end"===t.action?{recordUndo:r}:void 0),t}),o.next(()=>{this._updateValue(r)})})}_updateManipulatorPosition(){const{targetGeometry:t}=this.analysisViewData,{renderCoordsHelper:o}=this.view;if(!t)return;const e=.5,s=t.rings[0],n=m(s[0]),a=m(s[1]);o.toRenderCoords(n,t.spatialReference,n),o.toRenderCoords(a,t.spatialReference,a);const l=v.get();u(l,a,n);const r=v.get();d(r,n,a,e);const p=o.worldBasisAtPosition(r,1,v.get()),f=o.worldBasisAtPosition(r,0,v.get()),y=g(p,f,r,_.get()),w=o.headingAtPosition(r,l),T=t.isClockwise(t.rings[0])?-Math.PI/2:Math.PI/2;h(y,y,i(w)+T),y[12]=0,y[13]=0,y[14]=0,this._shiftManipulator.renderLocation=c(r),this._shiftManipulator.modelTransform=y}_updateManipulatorVisibility(t){this._shiftManipulator.available=t}_updateValue(t,i){const o=P(t,this.view.spatialReference);if(null==o)return;const e=this.analysis.inputUnits.elevation??"meters",s=l(o.value,o.unit,e),n=t=>{this.analysis.cutFillOptions.targetElevation=t};if(n(s),i&&"recordUndo"in i){const t=i.recordUndo;this.emit("record-undo",{apply:()=>n(s),undo:()=>n(t)})}}_getUpdatedTooltipInfo(){const{effectiveTargetElevation:t}=this.analysisViewData;return t?(this._tooltipInfo.elevation.actual=P(t,this.view.spatialReference),this._tooltipInfo):this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear(),this.tooltip?.exitInputMode({focusOnView:!1})}_updateToolOptions(){const{analysis:t}=this,{displayUnits:i,inputUnits:o}=t;this.toolOptions.values.inputUnits=new E({verticalLength:o.elevation}),this.toolOptions.values.displayUnits=new E({verticalLength:i.elevation})}};t([r()],x.prototype,"multiTouchEnabled",void 0),t([r()],x.prototype,"updating",null),t([r({constructOnly:!0})],x.prototype,"analysis",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r({constructOnly:!0,type:O})],x.prototype,"toolOptions",void 0),t([r()],x.prototype,"_shouldShowTooltip",null),t([r()],x.prototype,"_showManipulator",null),x=t([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool")],x);export{x as VolumeMeasurementShiftTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{ignoreAbortErrors as i,isAborted as r}from"../../../../core/promiseUtils.js";import{pausable as o,sync as h,watch as n,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as c,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../layers/GraphicsLayer.js";import y from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as u,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as _}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as k}from"../../../analysis/ExclusiveOperationManager.js";import{makeAllLayerSnappingOptions as G}from"../../../interactive/snapping/allLayerSnapping.js";import w from"../../../../widgets/Sketch/SketchViewModel.js";let v=class extends s{constructor(e){super(e),this._updatingHandles=new d,this._operationManager=new k,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new m({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const a=G(s,{selfEnabled:!0,excludeInternal:!0});this._externalGeometryChangeHandle=o(()=>this.analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),h),this._sketchViewModel=new w({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"move"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:a.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),n(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{ignoreAbortErrors as i,isAborted as r}from"../../../../core/promiseUtils.js";import{pausable as o,sync as h,watch as n,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as c,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../layers/GraphicsLayer.js";import y from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as u,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as _}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as k}from"../../../analysis/ExclusiveOperationManager.js";import{makeAllLayerSnappingOptions as G}from"../../../interactive/snapping/allLayerSnapping.js";import w from"../../../../widgets/Sketch/SketchViewModel.js";let v=class extends s{constructor(e){super(e),this._updatingHandles=new d,this._operationManager=new k,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new m({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const a=G(s,{selfEnabled:!0,excludeInternal:!0});this._externalGeometryChangeHandle=o(()=>this.analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),h),this._sketchViewModel=new w({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"move"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:a.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),n(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(S(e,t),s){case"idle":case"reshaping-disabled":this._operationManager.stop(),this._graphicsLayer.removeAll(),this._ensureUpdatedSketchGraphic();break;case"reshaping":i(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},l),a,this._externalGeometryChangeHandle]),this._shiftTool=new _({analysis:e,view:s,analysisViewData:t}),this.addHandles(this._shiftTool.on("record-undo",e=>{const t=this._sketchViewModel.activeComponent;"reshape-3d"===t?.type&&t.recordUndo(e.apply,e.undo)})),s.tools.add(this._shiftTool),this.addHandles({remove:()=>s.tools.remove(this._shiftTool)})}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._shiftTool.updating||this._updatingHandles.updating}get _polygonSymbol(){return new y({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._operationManager.start("place",async t=>{const s=this.analysis.clone();this._ensureUpdatedSketchGraphic();const i=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic;break;case"active":this._updateGeometryFromSketchGraphic();break;case"complete":this._updateGeometryFromSketchGraphic(),t.stop();break;case"cancel":t.stop()}});t.handles.push(i,a(()=>(i.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?r(e)||s.equals(this.analysis)?t.reject():void t.resolve({}):(this._clearGeometry(),t.reject())))),await this._updatingHandles.addPromise(this._sketchViewModel.create("polygon"))},e)}_startReshape(){return this._operationManager.start("reshape",async e=>{const t=()=>{const e=this._ensureUpdatedSketchGraphic();return e?(this._graphicsLayer.removeAll(),this._graphicsLayer.add(e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:"reshape"}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const s=this._sketchViewModel.on("update",s=>{this._updateGeometryFromSketchGraphic(),"complete"===s.state&&("reshaping"===this.state?i(t()):e.resolve())});e.handles.push(s,a(()=>{s.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return u(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){this._externalGeometryChangeHandle.pause();const e=this.sketchGraphic;this.analysis.geometry=g(e)?e.geometry:null,this._externalGeometryChangeHandle.resume()}get test(){}};e([c({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],v.prototype,"view",void 0),e([c({constructOnly:!0})],v.prototype,"analysis",void 0),e([c()],v.prototype,"sketchGraphic",null),e([c({nonNullable:!0})],v.prototype,"state",null),e([c()],v.prototype,"updating",null),e([c()],v.prototype,"_polygonSymbol",null),v=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],v);const f=v;function S(e,t){t&&(t.removeFromParent(),e?.add(t))}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as
|
|
2
|
+
import{__decorate as e}from"tslib";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as s,removeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as o,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as E}from"../meshFastUpdateUtils.js";import{Settings as y}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as w}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as I}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as j}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as G}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as x,geometryTypeToDrawOperationGeometryType as S}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as D}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as L,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends x{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new y({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i,featureExpressionInfo:s}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i,featureExpressionInfo:s})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:i}=this,s=this._createGraphicState=new G({graphic:e});return t([i.maskOccludee(e),i.trackGraphicState(s),r(()=>({element:this._outlineVisualElement,isDraped:s.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},o),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(s),...E(s)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new D({view:this.view,manipulators:this.manipulators,geometryType:S(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new L(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.toolOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),i();const r=this._settings,o=r.manipulators.vertex,l=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=l;const c=r.visualElements.zVerticalLine,h=new V({view:n,extensionType:c.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const p=t([this._updatingHandles.add(()=>r.visualElements.zVerticalLine,e=>e.apply(h),a),this._updatingHandles.add(()=>({selectedColor:r.colors.selected.toUnitRGBA(),outlineColor:r.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{l.color=e,l.outlineColor=t},a),i(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return l.attached=!0,this._updateVerticalLineVisualElement(e),p}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:s}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=I(U,s,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,i();const n=this.internalGraphicsLayer.elevationInfo,{view:r}=this,o=this._settings,l=new w({view:r,geometry:e,elevationInfo:n,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,n),attached:!1,isDecoration:!0});this._outlineVisualElement=l;const c=t([this._updatingHandles.add(()=>o.visualElements.lineObjects.outline,e=>e.apply(l),a),this._updatingHandles.add(()=>o.visualElements.lineObjects.shadowStyle,e=>e.apply(l),a),i(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return l.attached=!0,l.laserlineEnabled=!0,c}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,i();const{view:n}=this,r=this._settings,o=r.manipulators.vertex,l=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0}),c=t([this._updatingHandles.add(()=>({color:r.manipulators.vertex.color.toUnitRGBA(),outlineColor:r.manipulators.vertex.outlineColor.toUnitRGBA()}),({color:e,outlineColor:t})=>{l.color=e,l.outlineColor=t},a),i(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return l.attached=!0,this._verticesVisualElement=l,c}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:s}=this;if(!this.geometryToPlace||e.displaying)return s.loading=!1,null;s.loading=!0;const r=i(()=>{s.loading=!1});let a;const c=()=>{a&&cancelAnimationFrame(a)},h=()=>{c(),a=requestAnimationFrame(()=>r.remove())};let p=null;return p=e.on("changed",()=>{p=n(p),h()}),t([p,l(()=>e.displaying,h,{...o,once:!0}),i(c),r])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([h("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new j,U=m();export{b as DrawGraphicTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as r}from"../../../../../core/quantity.js";import{watch as p,initial as h,syncAndInitial as c}from"../../../../../core/reactiveUtils.js";import{property as u,subclass as m}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as d}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as v}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Point.js";import{makeDehydratedPoint as _}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as g}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as M}from"../../SnappingVisualizer3D.js";import{orientation as y}from"../geometryUtils.js";import{manipulatedObjectGeometry as b}from"../manipulatedObjectUtils.js";import{canMoveZOperations as j}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as T}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as w}from"../tooltipUtils3D.js";import{createVisualElements as I}from"../visualElementUtils.js";import{discRadius as S}from"../manipulations/config.js";import{MoveManipulation as H}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as D}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as x}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as P}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as k}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as E,resetManipulatedObjectMany as U}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as R}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as X}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Y}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as B,enterInputModeIfAvailable as C}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as Z}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as W}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as N}from"../../../../support/GeometryWorkerHandle.js";class q{constructor(t){this.objects=t,this.type="move-start"}}class L{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class J{constructor(t){this.objects=t,this.type="move-stop"}}const K=Symbol("manipulators"),Q=Symbol("tooltips"),$=Symbol("move-manipulator-display");let tt=class extends A{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new z,this.type="move-3d",this._measurementWorker=new N({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new v,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=B(()=>({view:t,options:this.sketchOptions.tooltips})),this.addHandles([this.objects.on("change",t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()}),this.objects.on("change",()=>this._connectTooltips())]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(!this.destroyed&&!C(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=b(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==O(e))continue;const t=new et(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(T(t.object),o)}}_refreshManipulators(){if(this.removeHandles(K),this.removeHandles($),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new x({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],K)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),K)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles($),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),$)}_createMoveManipulation(t){const o=new H({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?H.radiusForSymbol(t[0].object.graphic?.symbol):S});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),K)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=r)})],K)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const r of t){this.addHandles([r.object.on("committed",i),p(()=>r.object.visible,i)],K);const o=Symbol();this.addHandles(p(()=>r.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(k({view:this.view,geometry:r.object.graphic?.geometry,elevationInfo:r.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},h),K),this.addHandles(n(()=>this.removeHandles(o)),K)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),K);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),K)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){for(const o of t){const e=o.object,i=I({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof P&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),p(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],K),this.addHandles(i,K))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=y(b(t.object)))}_updateMoveManipulation(t){const o=_(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&j(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof P&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>p?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new J(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=E(l),p=U(l),this._emitRecordUndo(),this.events.emit("move-start",new q(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>r?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new L(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new J(l)),this.destroyed)return null;h()}return null}),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(Q),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new Z({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new q([o]))},onMove:()=>e.emit("move",new L(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new J([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=w(this.tooltip,o,()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=p(()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},c);this.addHandles(t,Q)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new F({sketchOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(ot(t),ot(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new G({sketchOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(ot(t),ot(e)),D(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new V({sketchOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,W))}this._latestTooltipInfo.sketchOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??r}else t.distance=r}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=b(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new X({elevationInfo:o,pointer:n,editGeometryOperations:R.fromGeometry(a,this.view.state.viewingMode),visualizer:new M,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:h}=Y({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=g(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...p),cancel:i}}get test(){}};t([u({constructOnly:!0,nonNullable:!0})],tt.prototype,"view",void 0),t([u()],tt.prototype,"objects",void 0),t([u({constructOnly:!0,nonNullable:!0})],tt.prototype,"enableZ",void 0),t([u({constructOnly:!0,type:z})],tt.prototype,"sketchOptions",void 0),t([u({constructOnly:!0})],tt.prototype,"snappingManager",void 0),t([u()],tt.prototype,"type",void 0),t([u()],tt.prototype,"updating",null),t([u()],tt.prototype,"_latestTooltipInfo",void 0),t([u()],tt.prototype,"_shouldShowMovePointTooltip",null),t([u()],tt.prototype,"activeTooltipInfo",null),tt=t([m("esri.views.3d.interactive.editingTools.move.MoveTool3D")],tt);const ot=d(f);class et{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{L as MoveEvent,q as MoveStartEvent,J as MoveStopEvent,tt as MoveTool3D};
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as p}from"../../../../../core/quantity.js";import{initial as r,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as _}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{MoveManipulation as H}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as D}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as x}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as P}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as E,resetManipulatedObjectMany as U}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as R}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Y,enterInputModeIfAvailable as B}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as V}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class N{constructor(t){this.objects=t,this.type="move-start"}}class q{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class L{constructor(t){this.objects=t,this.type="move-stop"}}const J=Symbol("manipulators"),K=Symbol("tooltips"),Q=Symbol("move-manipulator-display");let $=class extends A{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.toolOptions=new z,this.type="move-3d",this._measurementWorker=new W({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=Y(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(!this.destroyed&&!B(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=y(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==O(e))continue;const t=new ot(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this.removeHandles(Q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new D({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],J)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),J)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(Q),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Q)}_createMoveManipulation(t){const o=new H({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?H.radiusForSymbol(t[0].object.graphic?.symbol):I});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),J)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=p)})],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const p of t){this.addHandles([p.object.on("committed",i),this._updatingHandles.add(()=>p.object.visible,i)],J);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>p.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(P({view:this.view,geometry:p.object.graphic?.geometry,elevationInfo:p.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},r),J),this.addHandles(n(()=>this.removeHandles(o)),J)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),J);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof x&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(y(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof x&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let p=null,r=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,p=null,r=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>r?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new L(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=E(l),r=U(l),this._emitRecordUndo(),this.events.emit("move-start",new N(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>p?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new q(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new L(l)),this.destroyed)return null;h()}return null}),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new N([o]))},onMove:()=>e.emit("move",new q(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new L([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new F({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(e)),S(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new G({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,V))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??p}else t.distance=p}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=y(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:R.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),p=this.snappingManager,{snappingStep:r,cancelSnapping:h}=X({snappingContext:l,snappingManager:p,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=_(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...r),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"view",void 0),t([c()],$.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:z})],$.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],$.prototype,"snappingManager",void 0),t([c()],$.prototype,"type",void 0),t([c()],$.prototype,"updating",null),t([c()],$.prototype,"_latestTooltipInfo",void 0),t([c()],$.prototype,"_shouldShowMovePointTooltip",null),t([c()],$.prototype,"activeTooltipInfo",null),$=t([d("esri.views.3d.interactive.editingTools.move.MoveTool3D")],$);const tt=u(v);class ot{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{q as MoveEvent,N as MoveStartEvent,L as MoveStopEvent,$ as MoveTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{EventEmitter as n}from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{makeHandle as o,handlesGroup as s,destroyHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as l,removeMaybe as p}from"../../../../../core/maybe.js";import{watch as h,initial as d,on as u,syncAndInitial as c,when as m,sync as f}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as M,subtract as b,lerp as x,set as y,add as O,scale as E}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as j,create as I}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as S}from"../../../../../core/support/UpdatingHandles.js";import H from"../../../../../geometry/Point.js";import w from"../../../../../geometry/Polyline.js";import{projectPoint as V}from"../../../../../geometry/projectionUtils.js";import D from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as A}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as G}from"../../../../../symbols/support/utils.js";import{Manipulator3D as C}from"../../Manipulator3D.js";import{createManipulatorMaterial as R,createManipulatorOutlineMaterial as P,placeAtObject as k}from"../../manipulatorUtils.js";import{RenderObject as U}from"../../RenderObject.js";import{SegmentLabels3D as L}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as z}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as F,screenToRenderPlaneFromEvent as B,convertToMapCoordinates as Z}from"../dragEventPipeline3D.js";import{orientation as W}from"../geometryUtils.js";import{canMoveZOperations as N}from"../manipulatorUtils.js";import{Settings as q}from"../settings.js";import{createVisualElements as X}from"../visualElementUtils.js";import{discRadiusSmall as Y}from"../manipulations/config.js";import{MoveManipulation as K}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as J}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as Q,createEdgeOffsetIntersectionPlane as $,createEdgeOffsetOperation as ee,edgeOffsetRotationMatrix as te,screenEdgeLengthSquared as ie,getDistanceInGeometrySR as ne}from"./edgeOffsetUtils.js";import{createTooltipInfos as ae,connectTooltipToManipulatedObject as oe,getUpdatedTranslateObjectTooltipInfo as se,getUpdatedEdgeOffsetTooltipInfo as re}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as le}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as pe}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as he,createSphereGeometry as de}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as ue}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as ce,addMapDelta as me,createManipulatorDragEventPipeline as fe,dragAtLocation as ge,addScreenDelta as _e}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as ve}from"../../../../interactive/keybindings.js";import{SnappingContext as Me}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as be}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as xe,enterInputModeIfAvailable as ye}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Oe}from"../../../../support/GeometryWorkerHandle.js";const Ee=Symbol(),je=Symbol(),Ie=Symbol(),Se=Symbol();let He=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(Se)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new S,this._recreatingManipulators=!1,this._settings=new q({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._measurementWorker=new Oe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ae(this._sketchOptions,e),this._vertexManipulatorMaterial=R(i.color.toUnitRGBA(),i.renderOccluded),this._vertexManipulatorOutlineMaterial=P(i.outlineColor.toUnitRGBA(),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=P(i.hoverOutlineColor.toUnitRGBA(),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=R(n.color.toUnitRGBA(),n.renderOccluded),this._edgeManipulatorOutlineMaterial=P(n.outlineColor.toUnitRGBA(),n.renderOccluded);const a=t.edgeOffset;this._edgeOffsetManipulatorMaterial=R(a.color.toUnitRGBA(),a.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=R(a.hoverColor.toUnitRGBA(),a.renderOccluded,!1);const o=t.selected;this._selectedManipulatorMaterial=R(o.color.toUnitRGBA(),o.renderOccluded),this._selectedManipulatorOutlineMaterial=P(o.outlineColor.toUnitRGBA(),o.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=P(o.hoverOutlineColor.toUnitRGBA(),o.renderOccluded),this.tooltip=xe(()=>({view:e,options:this._sketchOptions.tooltips})),this.addHandles([h(()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:n})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),n.applyColor(this._selectedManipulatorMaterial),n.applyOutline(this._selectedManipulatorOutlineMaterial),n.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)}),h(()=>this.object.visible,e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Ae(t)&&(t.edgeManipulator.available=e)}),h(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),h(()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")},d),oe(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),h(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),u(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),u(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=l(this._segmentLabels),this.tooltip=l(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===ve.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!ye(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&"vertex"===e.type);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}clearSelection(){let e=!1;for(const t of this._manipulatorInfos)if(t.manipulator.selected){e=!0;break}e&&(this._clearSelection(),this._updateMoveManipulationPosition(),this.events.emit("manipulators-changed"))}selectManipulator(e){if(null==this._manipulatorInfos.find(t=>t.manipulator===e)||!e.selectable)return!1;let t=e.selected;for(const i of this._manipulatorInfos)if(i.manipulator!==e&&i.manipulator.selected){t=!1;break}return t||(this._clearSelection(),e.selected=!0,this._updateMoveManipulationPosition(),this.events.emit("manipulators-changed")),!0}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(je),this.removeHandles(Se),this._moveManipulation=l(this._moveManipulation),this._objectMoveManipulation=l(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const{vertices:i,segments:n,index:a}of this._operations.data.parts){const o=e?.byPartIndex.get(a);for(const e of i){const i=o?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of n)"line"===e.type&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=l(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new L({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const n=[],a=1===e&&this._someVerticesSelected;for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.grabbing||a&&!o.manipulator.selected||n.push(o),i++);if(n.length===i){if(a||this._hideReshapeControls(),this._moveVertices(n,t),this._updateEventState(1),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(n,t),this._updateEventState(2),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),o(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],Se)}_showReshapeControls(){this.removeHandles(Se)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){const t=this._manipulatorInfos.filter(Ae).find(t=>t.manipulator===e||t.edgeManipulator===e);null!=t&&(this.removeHandles(je),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],je))}_hideReshapeManipulators(e){return s(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Ae(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Ee):this.tool.manipulators.forEach(({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Ee)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:n}=e;if(!t&&!i&&!n)return;const a=[];this._forEachVertex(t=>{const{selected:i,grabbing:n}=t.manipulator;(i&&!n||t===e.info)&&a.push(t)}),this._moveVertices(a,e,1),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case 1:this._showReshapeControls(),this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:n}=this;if(n){if(this._objectMoveManipulation=new J({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,i,a)=>{i.next(e=>this._trackNumDragging(e)).next(t=>("start"===t.action&&(e=n.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{"end"===t.action&&(this._showReshapeControls(),this._resetTooltip(),e=p(e))}),a.next(()=>this._onDragCancel(!0,()=>e=p(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on("immediate-click",e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){const{object:t,tool:i,view:n,_operations:a}=this;if(!a)return;this._moveManipulation=new K({tool:i,view:n,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&N(t.operations,t.elevationInfo),snapToScene:!1,radius:K.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on("immediate-click",t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some(e=>e.manipulator.selected)||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(o(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(1)),this._moveManipulation.zManipulation.forEachManipulator(o(2)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=a.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((n,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:h}=be({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new Me({editGeometryOperations:a,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(e=>(this._onDragCancel(),e)).next(h),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{const t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.manipulatorType&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(ce(this.view,e,t.graphic??void 0)).next(...p).next(me()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>("end"===e.action&&this._showReshapeControls(),this._updateTranslateTooltip(n,e),e)),cancel:r}},e,s,t.graphic),h(()=>t.visible,()=>this._updateMoveManipulationPosition(),d),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),h(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Ie),e&&this.addHandles(pe({view:this.view,geometry:t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Ie)},d)])}_createVisualElements(){const{object:e,view:t}=this,i=X({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof le?i.visualElement:null);const n=this._outlineVisualElement;if(null!=n){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(u(()=>n.events,"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,n=this._operations;if(e.part.vertices.length<=2||!n)return null;const a=n.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,h=p/2,d=p*Math.sqrt(3)/2,{height:u,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=he(m,d,h,h,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=he(m,-d,h,h,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const f=[new U(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new U(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2),new U(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new U(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2)],g=new C({view:i,renderObjects:f,elevationInfo:"on-the-ground"!==t.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:j(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Te(a)}),_=new C({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Te(a)}),v={manipulator:g,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map(e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)}));const b=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(g,!0),this._watchAndUpdateGrabState(_,!0),fe(g,this._createEdgeOffsetPipeline(v,t,n)),fe(_,this._createEdgePipeline(v,t,n)),_.events.on("immediate-click",b),g.events.on("immediate-click",b),g.events.on("focus-changed",()=>this._resetTooltip()),g.events.on("grab-changed",({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?Q(e,this.view,this.object,v):null})],g),this._manipulatorInfos.push(v),this.manipulators.addMany([g,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,n=e.edgeManipulator,a=()=>{e.visibilityHandle=p(e.visibilityHandle);const a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=a&&null!=r&&ie(a.manipulator.renderLocation,r.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!n.focused||l)&&(i.grabbable=!l,n.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),o(()=>{i.grabbable=!0,n.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([i.events.on("focus-changed",a),n.events.on("focus-changed",a),o(()=>{p(e.visibilityHandle),n.metadata.deleting=!0,this.manipulators.remove(n)})],i),a()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=$(this.view,e.manipulator.elevationAlignedLocation,ee(t,e.handle,e.manipulator.elevationInfo)),n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==n||null==a)return;const o=n.manipulator.renderLocation,s=a.manipulator.renderLocation,r=null!=i?te(i,o,s):v;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=M(b(Ce,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(n,a,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(n,a,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=n;a.next(e=>this._trackNumDragging(e)).next(ge(this.view,r)).next(F(this.view,r,t,s,e)).next(_e()).next(me()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{"end"===e.action&&(this._showReshapeControls(),this._resetTooltip())}),o.next(()=>this._onDragCancel(!n.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(n,a,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);a.next(e=>this._trackNumDragging(e)).next(ge(this.view,n.elevationAlignedLocation)).next(r).next(B(this.view)).next(Z(this.view,i.data.spatialReference)).next(me()).next(we()).next(e=>this._pendingEdgeOffsetInfo?e:p(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),o.next(()=>{this._exitEdgeOffsetInputMode(),n.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,n){const{view:a,object:o}=this,r=ee(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),h=$(a,e.manipulator.elevationAlignedLocation,r);let d;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),d=p(d)},c=this.events.on("undo",u);return d=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,()=>{n.execute({action:"cancel"})})]),{initializeStep:e=>null==r||null==h?(u(),null):{...e,operation:r,plane:h},cleanup:u}}_initializeEdgeOffsetVisualElement(e,t,i,n){const a=()=>new w({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),o=new le({view:this.view,isDraped:t.isDraped,geometry:a(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),l=s([h(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{o.color=e.toUnitRGBA(),o.isDraped=t},c),t.on("committed",()=>{o.geometry=a()}),r(o)]);return o.attached=!0,l}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(2),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftSegment?.leftVertex,n=e.handle.leftVertex,a=e.handle.rightVertex.rightSegment?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(n.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,n.pos)<Re){const e=this._getManipulatorInfoFromHandle(n);null!=e&&l.push(e)}if(s.distance(n.pos,o.pos)<r||a&&s.distance(a.pos,o.pos)<Re){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!ye(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Ae).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:n}=i,a=ee(t.data.coordinateHelper,e.handle,n);this._selectEdgeOffsetArrow(e,a),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,n,t),this._connectEdgeOffsetTooltip(e,a,t,()=>{this.removeHandles(a),this._exitEdgeOffsetInputMode()})],a)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??Q(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,n){const a=()=>this.tooltipInfos.edgeOffset.distance.actual,o=a=>{n(),queueMicrotask(()=>{this.view.focus();const n=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ne(a,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),n.remove()})},r=()=>{const e=a();null!=e?o(e):n()};return s([m(()=>this.tooltip&&!this.tooltip.focused,()=>r(),f),this.tooltip.on("discard",n),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&r()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const n=this.view,a=this._operations,o=this._settings;if(!a)return null;const r=a.data.type,l=a.data.spatialReference;if("line"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ve(o.manipulators.vertex);this._vertexManipulatorGeometry=de(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=de(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ve(o.manipulators.edge);this._edgeManipulatorGeometry=de(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=de(this._edgeManipulatorOutlineMaterial,t,16,16)}const h="point"===r||"mesh"===r?[]:[new U(this._vertexManipulatorGeometry.instantiate(),4|Pe),new U(this._vertexManipulatorOutlineGeometry.instantiate(),5|Pe),new U(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|Pe),new U(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),8),new U(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),9),new U(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),10)];this.enableMidpoints&&h.push(new U(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),6|ke),new U(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|ke),new U(this._edgeManipulatorGeometry.instantiate(),5|ke),new U(this._edgeManipulatorOutlineGeometry.instantiate(),5|ke));const d="vertex"===e.type,u=()=>new C({view:n,renderObjects:h,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:"point"===r||"mesh"===r,available:this.object.visible,metadata:{deleting:!1},location:Te(l)});let c=null;d&&(c=this.object.createReshapeManipulator?.({vertex:e,defaultCreate:u,elevationInfo:t,selected:i})??null),c??=u(),c.selected=i,this._setTypeSpecificManipulatorSettings(c,e,t);const m=d?{manipulator:c,handle:e,type:"vertex",selectedIndex:0}:{manipulator:c,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(c),this._updateManipulatorPosition(m),"edge"===m.type){const e=[];for(const t of[m.handle.leftVertex,m.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=s(e),this._manipulatorHandles.add(m.locationUpdateHandle,c)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(c,!0),c);const f=fe(c,(e,i,o,s)=>{let r=null;const{snappingStep:h,cancelSnapping:d}=be({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new Me({editGeometryOperations:a,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});o.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>r=p(r)),t)).next(d);const{elevationAlignedLocation:u}=e,c=this.object.graphic??void 0,f=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,a,c):F(n,u,t,l,c);i.next(e=>this._trackNumDragging(e)).next(e=>{if("start"===e.action&&a&&(r=a.createUndoGroup()),"edge"===m.type){const t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(ge(n,u)).next(f).next(ce(n,t,c)).next(...h).next(me()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=p(r)),this._resetTooltip()})});return this._manipulatorHandles.add([f,c.events.on("immediate-click",e=>this._manipulatorClickCallback(e,m)),c.events.on("select-changed",()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),c.events.on("focus-changed",()=>{this._resetTooltip()})],c),this.events.emit("manipulators-changed"),m}_screenToSceneMapForVertexDrag(e,t,i){const{view:n}=this,{coordinateHelper:a,spatialReference:o}=t.data;let s=null;return t=>{if("start"===t.action&&(s=a.vectorToPoint(t.snapOrigin)),null==s)return null;const r=n.toMap(t.screenEnd,{exclude:i,excludeLabels:!0});return null==r?null:(r.z=A(r,n,e),V(r,r,o)?{...t,mapStart:s,mapEnd:r}:null)}}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,i){const n=this._settings;switch(t.type){case"vertex":{e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.elevationInfo=i;const t=this._operations?.data.type;if(e.interactive=null!=t&&"point"!==t&&"mesh"!==t,null==this.object.createReshapeManipulator){const{size:t,collisionPadding:i}=n.manipulators.vertex;e.radius=t/2+i,e.state=Pe}break}case"line":{e.state=ke,e.selectable=!1,e.cursor="copy",e.collisionPriority=2;const{size:t,collisionPadding:a}=n.manipulators.edge;e.radius=t/2+a,e.elevationInfo="on-the-ground"!==i.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)})}_onGrabStateChanged(e,t,i,n="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(je),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==n||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Ae(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Ge),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==n)return;const a=i.manipulator,o=n.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=a.location,n=o.location,s=.5,r=i.x+s*(n.x-i.x),l=i.y+s*(n.y-i.y),p=i.hasZ&&n.hasZ?0:void 0;e.manipulator.location=T(r,l,p,t.data.spatialReference)}else x(Ce,a.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=Ce}}_splitEdgeManipulator(e,t=.5){const i=this._operations,n=i.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=p(e.locationUpdateHandle);const a=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(n)):(o=e,o.handle=n,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,a)),"line"===n.leftSegment?.type&&this._createVertexOrEdgeManipulator(n.leftSegment),"line"===n.rightSegment?.type&&this._createVertexOrEdgeManipulator(n.rightSegment),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(2),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.parts.indexOf(n.part);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:n.index}],added:r}),s&&this._updateEventState(0),o}_updateMoveManipulationPosition(){const e=y(Ce,0,0,0);let t=0,i=!1,n=null,a=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,O(e,e,r.manipulator.renderLocation),null==n||r.selectedIndex>n.selectedIndex?(a=n,n=r):(null==a||r.selectedIndex>a.selectedIndex)&&(a=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&N(this._operations,o.elevationInfo),this._moveManipulation.angle=W(s),this._moveManipulation.radius=K.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&N(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=n){const e=n.handle.pos,t=null!=a?a.handle.pos:n.handle.leftSegment?.leftVertex?n.handle.leftSegment.leftVertex.pos:null,o=null==a&&n.handle.rightSegment?.rightVertex?n.handle.rightSegment.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=De(t,e):o&&(i=De(e,o))}const s=n?.handle,r=s?o.getReshapeMoveConfig?.({vertex:s,numSelected:t})??null:null;switch(r?.xyAxisMode){case"all":this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e;break;case"hidden":this._moveManipulation.xyAxisManipulation.available=!1,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=!1}this._moveManipulation.angle=r?.angle??i,this._moveManipulation.radius=Y}0!==t&&i?(E(e,e,1/t),Ge.spatialReference=this._operations.data.spatialReference,Ge.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Ge),this._moveManipulation.elevationAlignedLocation=Ge):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?k(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(!i)return;const n=e.filter(e=>"vertex"===e.type&&i.canRemoveVertex(e.handle.part));if(n.length>0){const e=this._createBeforeVertexRemoveEvent(n);if(this.events.emit("before-vertex-remove",e),e.defaultPrevented)return}for(const a of n){const e=a.handle.part;if(i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightSegment));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdSegment;o&&"line"===o.type?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.segments[0]))}}if(t.length>0){const e=t.map(e=>{const t=i.data.parts.indexOf(e.part);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),n=this._updateEventState(2);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)return;if(n&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){const t=this._operations,i=e.map(e=>{const i=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:i,vertexIndex:e.handle.index}});let n=!1;return{type:"before-vertex-remove",object:this.object,removed:i.map(e=>e.coordinates),vertices:i,get defaultPrevented(){return n},preventDefault(){n=!0}}}_moveVertices(e,t,i=("start"===t.action?0:1)){const n=this._operations;if(n&&(e.length>0&&n.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),!this._movingManipulatorsHidden))for(const a of e)this._updateManipulatorPosition(a)}_offsetEdge(e,t,i){if(!this._operations)return;const n=t.clone();n.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],n),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===ue.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===ue.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=se(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=re(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?re(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"multipoint":case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.length?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>"vertex"===e.type&&e.manipulator.selected)}_forEachVertex(e){for(const t of this._manipulatorInfos)"vertex"===t.type&&e(t)}get _tooltipsContext(){const{tooltipInfos:e,activeTooltipInfo:t}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};function we(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function Ve(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function De(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Te(e){return new H({x:0,y:0,z:0,spatialReference:e})}function Ae(e){return"edge"===e.type&&"edgeManipulator"in e}e([g()],He.prototype,"_numGrabbing",void 0),e([g()],He.prototype,"_numDragging",void 0),e([g()],He.prototype,"_pendingEdgeOffsetInfo",void 0),e([g()],He.prototype,"_operations",null),e([g()],He.prototype,"_segmentLabels",void 0),e([g({constructOnly:!0})],He.prototype,"tool",void 0),e([g()],He.prototype,"tooltip",void 0),e([g()],He.prototype,"activeTooltipInfo",void 0),e([g({readOnly:!0})],He.prototype,"updating",null),e([g()],He.prototype,"manipulators",null),e([g()],He.prototype,"view",null),e([g()],He.prototype,"object",null),e([g()],He.prototype,"enableZShape",null),e([g()],He.prototype,"enableDeleteVertices",null),e([g()],He.prototype,"enableZVertex",null),e([g()],He.prototype,"autoHideManipulators",null),e([g()],He.prototype,"enableMoveObject",null),e([g()],He.prototype,"enableMidpoints",null),e([g()],He.prototype,"enableEdgeOffset",null),e([g()],He.prototype,"_sketchOptions",null),e([g()],He.prototype,"_accentColor",null),e([g()],He.prototype,"_tooltipsContext",null),He=e([_("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],He);const Ge=T(0,0,void 0,D.WGS84),Ce=I(),Re=1e-6,Pe=16,ke=32;export{He as ReshapeOperation};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{EventEmitter as a}from"../../../../../core/Evented.js";import n from"../../../../../core/Handles.js";import{makeHandle as o,handlesGroup as s,destroyHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as l,removeMaybe as p}from"../../../../../core/maybe.js";import{initial as d,on as h,watch as u,syncAndInitial as c,when as m,sync as f}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as M,subtract as b,lerp as x,set as y,add as O,scale as E}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as j,create as I}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as S}from"../../../../../core/support/UpdatingHandles.js";import w from"../../../../../geometry/Point.js";import H from"../../../../../geometry/Polyline.js";import{projectPoint as V}from"../../../../../geometry/projectionUtils.js";import D from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as A}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as C}from"../../../../../symbols/support/utils.js";import{Manipulator3D as G}from"../../Manipulator3D.js";import{createManipulatorMaterials as R,placeAtObject as P}from"../../manipulatorUtils.js";import{RenderObject as U}from"../../RenderObject.js";import{SegmentLabels3D as k}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as L}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as z,screenToRenderPlaneFromEvent as F,convertToMapCoordinates as B}from"../dragEventPipeline3D.js";import{orientation as Z}from"../geometryUtils.js";import{canMoveZOperations as W}from"../manipulatorUtils.js";import{Settings as N}from"../settings.js";import{createVisualElements as q}from"../visualElementUtils.js";import{discRadiusSmall as X}from"../manipulations/config.js";import{MoveManipulation as Y}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as K}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as J,createEdgeOffsetIntersectionPlane as Q,createEdgeOffsetOperation as $,edgeOffsetRotationMatrix as ee,screenEdgeLengthSquared as te,getDistanceInGeometrySR as ie}from"./edgeOffsetUtils.js";import{createTooltipInfos as ae,connectTooltipToManipulatedObject as ne,getUpdatedTranslateObjectTooltipInfo as oe,getUpdatedEdgeOffsetTooltipInfo as se}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as re}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as le}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as pe,createSphereGeometry as de}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as he}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as ue,addMapDelta as ce,createManipulatorDragEventPipeline as me,dragAtLocation as fe,addScreenDelta as ge}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as _e}from"../../../../interactive/keybindings.js";import{SnappingContext as ve}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Me}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as be,enterInputModeIfAvailable as xe}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as ye}from"../../../../support/GeometryWorkerHandle.js";const Oe=Symbol(),Ee=Symbol(),je=Symbol(),Ie=Symbol();let Se=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(Ie)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new n,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new S,this._recreatingManipulators=!1,this._settings=new N({getTheme:()=>this.view.effectiveTheme}),this.events=new a,this.activeTooltipInfo=null,this._measurementWorker=new ye({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ae(this._toolOptions,e),this._vertexManipulatorMaterials=R({color:i.color.toUnitRGBA(),outlineColor:i.outlineColor.toUnitRGBA(),focusedOutlineColor:i.focusedOutlineColor.toUnitRGBA(),renderOccluded:i.renderOccluded});const a=t.edge;this._edgeManipulatorMaterials=R({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),renderOccluded:a.renderOccluded});const n=t.edgeOffset;this._edgeOffsetManipulatorMaterials=R({color:n.color.toUnitRGBA(),focusedColor:n.focusedColor.toUnitRGBA(),renderOccluded:n.renderOccluded,shaded:!1});const o=t.selected;this._selectedManipulatorMaterials=R({color:o.color.toUnitRGBA(),outlineColor:o.outlineColor.toUnitRGBA(),focusedOutlineColor:o.focusedOutlineColor.toUnitRGBA(),renderOccluded:o.renderOccluded}),this.tooltip=be(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:a})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterials.material),i.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),a.applyColor(this._selectedManipulatorMaterials.material),a.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),a.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Te(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")},d),ne(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),h(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),h(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=l(this._segmentLabels),this.tooltip=l(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===_e.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!xe(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&"vertex"===e.type);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}clearSelection(){let e=!1;for(const t of this._manipulatorInfos)if(t.manipulator.selected){e=!0;break}e&&(this._clearSelection(),this._updateMoveManipulationPosition(),this.events.emit("manipulators-changed"))}selectManipulator(e){if(null==this._manipulatorInfos.find(t=>t.manipulator===e)||!e.selectable)return!1;let t=e.selected;for(const i of this._manipulatorInfos)if(i.manipulator!==e&&i.manipulator.selected){t=!1;break}return t||(this._clearSelection(),e.selected=!0,this._updateMoveManipulationPosition(),this.events.emit("manipulators-changed")),!0}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(Ee),this.removeHandles(Ie),this._moveManipulation=l(this._moveManipulation),this._objectMoveManipulation=l(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const{vertices:i,segments:a,index:n}of this._operations.data.parts){const o=e?.byPartIndex.get(n);for(const e of i){const i=o?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of a)"line"===e.type&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=l(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._toolOptions.labels;this._segmentLabels=new k({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],n=1===e&&this._someVerticesSelected;for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.grabbing||n&&!o.manipulator.selected||a.push(o),i++);if(a.length===i){if(n||this._hideReshapeControls(),this._moveVertices(a,t),this._updateEventState(1),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(a,t),this._updateEventState(2),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),o(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],Ie)}_showReshapeControls(){this.removeHandles(Ie)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){const t=this._manipulatorInfos.filter(Te).find(t=>t.manipulator===e||t.edgeManipulator===e);null!=t&&(this.removeHandles(Ee),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],Ee))}_hideReshapeManipulators(e){return s(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Te(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Oe):this.tool.manipulators.forEach(({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Oe)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];this._forEachVertex(t=>{const{selected:i,grabbing:a}=t.manipulator;(i&&!a||t===e.info)&&n.push(t)}),this._moveVertices(n,e,1),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case 1:this._showReshapeControls(),this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:a}=this;if(a){if(this._objectMoveManipulation=new K({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,i,n)=>{i.next(e=>this._trackNumDragging(e)).next(t=>("start"===t.action&&(e=a.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{"end"===t.action&&(this._showReshapeControls(),this._resetTooltip(),e=p(e))}),n.next(()=>this._onDragCancel(!0,()=>e=p(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on("immediate-click",e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){const{object:t,tool:i,view:a,_operations:n}=this;if(!n)return;this._moveManipulation=new Y({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&W(t.operations,t.elevationInfo),snapToScene:!1,radius:Y.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on("immediate-click",t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some(e=>e.manipulator.selected)||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(o(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(1)),this._moveManipulation.zManipulation.forEachManipulator(o(2)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=n.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((a,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:d}=Me({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new ve({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new L}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(e=>(this._onDragCancel(),e)).next(d),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{const t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.manipulatorType&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(ue(this.view,e,t.graphic??void 0)).next(...p).next(ce()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>("end"===e.action&&this._showReshapeControls(),this._updateTranslateTooltip(a,e),e)),cancel:r}},e,s,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),d),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(je),e&&this.addHandles(le({view:this.view,geometry:t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),je)},d)])}_createVisualElements(){const{object:e,view:t}=this,i=q({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof re?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(h(()=>a.events,"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,a=this._operations;if(e.part.vertices.length<=2||!a)return null;const n=a.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,d=p/2,h=p*Math.sqrt(3)/2,{height:u,offset:c}=o,{material:m,focusedMaterial:f}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){const e=pe(m,h,d,d,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=pe(m,-h,d,d,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new U(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new U(this._edgeOffsetManipulatorGeometryInside.instantiate({material:f}),2),new U(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new U(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:f}),2)],_=new G({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||C(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:j(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:De(n)}),v=new G({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:De(n)}),M={manipulator:_,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(M,o.minSquaredEdgeLength);const b=()=>this._updateEdgeOffsetManipulator(M);b(),M.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map(e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",b)}));const x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([M.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),me(_,this._createEdgeOffsetPipeline(M,t,a)),me(v,this._createEdgePipeline(M,t,a)),v.events.on("immediate-click",x),_.events.on("immediate-click",x),_.events.on("focus-changed",()=>this._resetTooltip()),_.events.on("grab-changed",({screenPoint:e,action:t})=>{M.grabMapPoint="start"===t?J(e,this.view,this.object,M):null})],_),this._manipulatorInfos.push(M),this.manipulators.addMany([_,v]),this.events.emit("manipulators-changed"),M}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=p(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=r&&te(n.manipulator.renderLocation,r.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),o(()=>{i.grabbable=!0,a.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),o(()=>{p(e.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)})],i),n()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=Q(this.view,e.manipulator.elevationAlignedLocation,$(t,e.handle,e.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?ee(i,o,s):v;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=M(b(Ce,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(a,n,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(a,n,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=a;n.next(e=>this._trackNumDragging(e)).next(fe(this.view,r)).next(z(this.view,r,t,s,e)).next(ge()).next(ce()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{"end"===e.action&&(this._showReshapeControls(),this._resetTooltip())}),o.next(()=>this._onDragCancel(!a.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(a,n,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);n.next(e=>this._trackNumDragging(e)).next(fe(this.view,a.elevationAlignedLocation)).next(r).next(F(this.view)).next(B(this.view,i.data.spatialReference)).next(ce()).next(we()).next(e=>this._pendingEdgeOffsetInfo?e:p(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),o.next(()=>{this._exitEdgeOffsetInputMode(),a.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,a){const{view:n,object:o}=this,r=$(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),d=Q(n,e.manipulator.elevationAlignedLocation,r);let h;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),h=p(h)},c=this.events.on("undo",u);return h=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,()=>{a.execute({action:"cancel"})})]),{initializeStep:e=>null==r||null==d?(u(),null):{...e,operation:r,plane:d},cleanup:u}}_initializeEdgeOffsetVisualElement(e,t,i,a){const n=()=>new H({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:a.data.spatialReference}),o=new re({view:this.view,isDraped:t.isDraped,geometry:n(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),l=s([u(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{o.color=e.toUnitRGBA(),o.isDraped=t},c),t.on("committed",()=>{o.geometry=n()}),r(o)]);return o.attached=!0,l}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(2),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftSegment?.leftVertex,a=e.handle.leftVertex,n=e.handle.rightVertex.rightSegment?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(a.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,a.pos)<Ge){const e=this._getManipulatorInfoFromHandle(a);null!=e&&l.push(e)}if(s.distance(a.pos,o.pos)<r||n&&s.distance(n.pos,o.pos)<Ge){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!xe(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Te).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:a}=i,n=$(t.data.coordinateHelper,e.handle,a);this._selectEdgeOffsetArrow(e,n),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,a,t),this._connectEdgeOffsetTooltip(e,n,t,()=>{this.removeHandles(n),this._exitEdgeOffsetInputMode()})],n)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??J(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,a){const n=()=>this.tooltipInfos.edgeOffset.distance.actual,o=n=>{a(),queueMicrotask(()=>{this.view.focus();const a=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ie(n,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),a.remove()})},r=()=>{const e=n();null!=e?o(e):a()};return s([m(()=>this.tooltip&&!this.tooltip.focused,()=>r(),f),this.tooltip.on("discard",a),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&r()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const a=this.view,n=this._operations,o=this._settings;if(!n)return null;const r=n.data.type,l=n.data.spatialReference;if("line"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=He(o.manipulators.vertex),{material:i,outlineMaterial:a}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=de(i,e,16,16),this._vertexManipulatorOutlineGeometry=de(a,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=He(o.manipulators.edge),{material:i,outlineMaterial:a}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=de(i,e,16,16),this._edgeManipulatorOutlineGeometry=de(a,t,16,16)}const d=this._vertexManipulatorGeometry,h=this._vertexManipulatorOutlineGeometry,u=[];if("point"!==r&&"mesh"!==r){u.push(new U(d.instantiate(),4|Re),new U(h.instantiate(),5|Re),new U(h.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),6|Re));{const{material:e,outlineMaterial:t,focusedMaterial:i}=this._selectedManipulatorMaterials;u.push(new U(d.instantiate({material:e}),8),new U(h.instantiate({material:t}),9),new U(h.instantiate({material:i}),10))}}if(this.enableMidpoints){const{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,i=this._edgeManipulatorGeometry,a=this._edgeManipulatorOutlineGeometry,n=6|Pe,o=5|Pe;u.push(new U(i.instantiate({material:e}),n),new U(a.instantiate({material:t}),n),new U(i.instantiate(),o),new U(a.instantiate(),o))}const c="vertex"===e.type,m=()=>new G({view:a,renderObjects:u,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:"point"===r||"mesh"===r,available:this.object.visible,metadata:{deleting:!1},location:De(l)});let f=null;c&&(f=this.object.createReshapeManipulator?.({vertex:e,defaultCreate:m,elevationInfo:t,selected:i})??null),f??=m(),f.selected=i,this._setTypeSpecificManipulatorSettings(f,e,t);const g=c?{manipulator:f,handle:e,type:"vertex",selectedIndex:0}:{manipulator:f,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0};if(this._manipulatorInfos.push(g),this.manipulators.add(f),this._updateManipulatorPosition(g),"edge"===g.type){const e=[];for(const t of[g.handle.leftVertex,g.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",()=>this._updateManipulatorPosition(g)))}g.locationUpdateHandle=s(e),this._manipulatorHandles.add(g.locationUpdateHandle,f)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(f,!0),f);const _=me(f,(e,i,o,s)=>{let r=null;const{snappingStep:d,cancelSnapping:h}=Me({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new ve({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new L}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});o.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>r=p(r)),t)).next(h);const{elevationAlignedLocation:u}=e,c=this.object.graphic??void 0,m=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,n,c):z(a,u,t,l,c);i.next(e=>this._trackNumDragging(e)).next(e=>{if("start"===e.action&&n&&(r=n.createUndoGroup()),"edge"===g.type){const t=this._splitEdgeManipulator(g);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:g,snapOrigin:g.handle.pos}}).next(fe(a,u)).next(m).next(ue(a,t,c)).next(...d).next(ce()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=p(r)),this._resetTooltip()})});return this._manipulatorHandles.add([_,f.events.on("immediate-click",e=>this._manipulatorClickCallback(e,g)),f.events.on("select-changed",()=>{g.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),f.events.on("focus-changed",()=>{this._resetTooltip()})],f),this.events.emit("manipulators-changed"),g}_screenToSceneMapForVertexDrag(e,t,i){const{view:a}=this,{coordinateHelper:n,spatialReference:o}=t.data;let s=null;return t=>{if("start"===t.action&&(s=n.vectorToPoint(t.snapOrigin)),null==s)return null;const r=a.toMap(t.screenEnd,{exclude:i,excludeLabels:!0});return null==r?null:(r.z=A(r,a,e),V(r,r,o)?{...t,mapStart:s,mapEnd:r}:null)}}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.elevationInfo=i;const t=this._operations?.data.type;if(e.interactive=null!=t&&"point"!==t&&"mesh"!==t,null==this.object.createReshapeManipulator){const{size:t,collisionPadding:i}=a.manipulators.vertex;e.radius=t/2+i,e.state=Re}break}case"line":{e.state=Pe,e.selectable=!1,e.cursor="copy",e.collisionPriority=2;const{size:t,collisionPadding:n}=a.manipulators.edge;e.radius=t/2+n,e.elevationInfo="on-the-ground"!==i.mode||C(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)})}_onGrabStateChanged(e,t,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(Ee),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Te(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Ae),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=T(r,l,p,t.data.spatialReference)}else x(Ce,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=Ce}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=p(e.locationUpdateHandle);const n=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(a)):(o=e,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),"line"===a.leftSegment?.type&&this._createVertexOrEdgeManipulator(a.leftSegment),"line"===a.rightSegment?.type&&this._createVertexOrEdgeManipulator(a.rightSegment),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(2),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.parts.indexOf(a.part);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(0),o}_updateMoveManipulationPosition(){const e=y(Ce,0,0,0);let t=0,i=!1,a=null,n=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,O(e,e,r.manipulator.renderLocation),null==a||r.selectedIndex>a.selectedIndex?(n=a,a=r):(null==n||r.selectedIndex>n.selectedIndex)&&(n=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&W(this._operations,o.elevationInfo),this._moveManipulation.angle=Z(s),this._moveManipulation.radius=Y.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&W(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=a){const e=a.handle.pos,t=null!=n?n.handle.pos:a.handle.leftSegment?.leftVertex?a.handle.leftSegment.leftVertex.pos:null,o=null==n&&a.handle.rightSegment?.rightVertex?a.handle.rightSegment.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Ve(t,e):o&&(i=Ve(e,o))}const s=a?.handle,r=s?o.getReshapeMoveConfig?.({vertex:s,numSelected:t})??null:null;switch(r?.xyAxisMode){case"all":this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e;break;case"hidden":this._moveManipulation.xyAxisManipulation.available=!1,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=!1}this._moveManipulation.angle=r?.angle??i,this._moveManipulation.radius=X}0!==t&&i?(E(e,e,1/t),Ae.spatialReference=this._operations.data.spatialReference,Ae.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Ae),this._moveManipulation.elevationAlignedLocation=Ae):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?P(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(!i)return;const a=e.filter(e=>"vertex"===e.type&&i.canRemoveVertex(e.handle.part));if(a.length>0){const e=this._createBeforeVertexRemoveEvent(a);if(this.events.emit("before-vertex-remove",e),e.defaultPrevented)return}for(const n of a){const e=n.handle.part;if(i.canRemoveVertex(e)){t.push(n.handle),this._removeManipulator(n),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.rightSegment));const a=i.removeVertices([n.handle]),o=a.removedVertices?.[0].createdSegment;o&&"line"===o.type?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.segments[0]))}}if(t.length>0){const e=t.map(e=>{const t=i.data.parts.indexOf(e.part);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),a=this._updateEventState(2);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){const t=this._operations,i=e.map(e=>{const i=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:i,vertexIndex:e.handle.index}});let a=!1;return{type:"before-vertex-remove",object:this.object,removed:i.map(e=>e.coordinates),vertices:i,get defaultPrevented(){return a},preventDefault(){a=!0}}}_moveVertices(e,t,i=("start"===t.action?0:1)){const a=this._operations;if(a&&(e.length>0&&a.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),!this._movingManipulatorsHidden))for(const n of e)this._updateManipulatorPosition(n)}_offsetEdge(e,t,i){if(!this._operations)return;const a=t.clone();a.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===he.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===he.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=oe(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=se(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?se(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"multipoint":case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.length?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>"vertex"===e.type&&e.manipulator.selected)}_forEachVertex(e){for(const t of this._manipulatorInfos)"vertex"===t.type&&e(t)}get _tooltipsContext(){const{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};function we(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function He(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Ve(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function De(e){return new w({x:0,y:0,z:0,spatialReference:e})}function Te(e){return"edge"===e.type&&"edgeManipulator"in e}e([g()],Se.prototype,"_numGrabbing",void 0),e([g()],Se.prototype,"_numDragging",void 0),e([g()],Se.prototype,"_pendingEdgeOffsetInfo",void 0),e([g()],Se.prototype,"_operations",null),e([g()],Se.prototype,"_segmentLabels",void 0),e([g({constructOnly:!0})],Se.prototype,"tool",void 0),e([g()],Se.prototype,"tooltip",void 0),e([g()],Se.prototype,"activeTooltipInfo",void 0),e([g({readOnly:!0})],Se.prototype,"updating",null),e([g()],Se.prototype,"manipulators",null),e([g()],Se.prototype,"view",null),e([g()],Se.prototype,"object",null),e([g()],Se.prototype,"enableZShape",null),e([g()],Se.prototype,"enableDeleteVertices",null),e([g()],Se.prototype,"enableZVertex",null),e([g()],Se.prototype,"autoHideManipulators",null),e([g()],Se.prototype,"enableMoveObject",null),e([g()],Se.prototype,"enableMidpoints",null),e([g()],Se.prototype,"enableEdgeOffset",null),e([g()],Se.prototype,"_toolOptions",null),e([g()],Se.prototype,"_accentColor",null),e([g()],Se.prototype,"_tooltipsContext",null),Se=e([_("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],Se);const Ae=T(0,0,void 0,D.WGS84),Ce=I(),Ge=1e-6,Re=16,Pe=32;export{Se as ReshapeOperation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{property as i,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ReshapeOperation as r}from"./ReshapeOperation.js";import{InteractiveToolBase as p}from"../../../../interactive/InteractiveToolBase.js";import{sketchKeys as
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{property as i,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ReshapeOperation as r}from"./ReshapeOperation.js";import{InteractiveToolBase as p}from"../../../../interactive/InteractiveToolBase.js";import{sketchKeys as a}from"../../../../interactive/keybindings.js";import s from"../../../../interactive/options/InteractiveToolOptions.js";let l=class extends p{constructor(e){super(e),this._reshapeOperation=null,this.events=new t,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveObject=!0,this.enableDeleteVertices=!0,this.autoHideManipulators=!1,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.toolOptions=new s,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){const e=this._reshapeOperation=new r({tool:this});this.addHandles([e.events.on("reshape",e=>this.events.emit("reshape",e)),e.events.on("move",e=>this.events.emit("move",e)),e.events.on("vertex-add",e=>this.events.emit("vertex-add",e)),e.events.on("before-vertex-remove",e=>this.events.emit("before-vertex-remove",e)),e.events.on("vertex-remove",e=>this.events.emit("vertex-remove",e)),e.events.on("immediate-click",e=>this.events.emit("immediate-click",{...e,object:this.object})),this.view.on("pointer-down",["Shift"],e=>e.stopPropagation())]),this.finishToolCreation()}destroy(){this._reshapeOperation=o(this._reshapeOperation)}set snapToScene(e){this._set("snapToScene",e)}get updating(){return((this.object.updating??!1)||this._reshapeOperation?.updating||this.snappingManager?.updating)??!1}get activeTooltipInfo(){return this._reshapeOperation?.activeTooltipInfo??null}get tooltip(){return this._reshapeOperation?.tooltip??null}onManipulatorSelectionChanged(){this._reshapeOperation?.onManipulatorSelectionChanged()}clearSelection(){this._reshapeOperation?.clearSelection()}selectManipulator(e){return this._reshapeOperation?.selectManipulator(e)??!1}recordUndo(e,t){this._reshapeOperation?.recordUndo({apply:e,undo:t,accumulate:()=>!1})}get canUndo(){return this._reshapeOperation?.canUndo??!1}undo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.undo()}get canRedo(){return this._reshapeOperation?.canRedo??!1}redo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.redo()}onInputEvent(e){const t=this._reshapeOperation;if(t&&!t.enterInputModeIfAvailable(e)&&this.enableDeleteVertices&&"key-down"===e.type&&a.delete.includes(e.key)){t.removeSelectedVertices()>0&&e.stopPropagation()}}reset(){}get test(){}};e([i()],l.prototype,"_reshapeOperation",void 0),e([i({constructOnly:!0})],l.prototype,"view",void 0),e([i({constructOnly:!0})],l.prototype,"object",void 0),e([i()],l.prototype,"enableZShape",void 0),e([i()],l.prototype,"enableZVertex",void 0),e([i()],l.prototype,"enableMoveObject",void 0),e([i()],l.prototype,"enableDeleteVertices",void 0),e([i()],l.prototype,"autoHideManipulators",void 0),e([i()],l.prototype,"enableMidpoints",void 0),e([i()],l.prototype,"enableEdgeOffset",void 0),e([i()],l.prototype,"type",void 0),e([i({type:s})],l.prototype,"toolOptions",void 0),e([i()],l.prototype,"snappingManager",void 0),e([i({value:!1})],l.prototype,"snapToScene",null),e([i()],l.prototype,"updating",null),e([i()],l.prototype,"activeTooltipInfo",null),e([i()],l.prototype,"tooltip",null),e([i()],l.prototype,"automaticManipulatorSelection",void 0),l=e([n("esri.views.3d.interactive.editingTools.reshape.ReshapeTool3D")],l);export{l as ReshapeTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as t}from"../../../../../core/handleUtils.js";import{debounce as e}from"../../../../../core/promiseUtils.js";import{scale as o,zeroMeters as n}from"../../../../../core/quantity.js";import{watch as i,syncAndInitial as a,sync as s}from"../../../../../core/reactiveUtils.js";import{ensureType as r}from"../../../../../core/accessorSupport/ensureType.js";import
|
|
2
|
+
import{handlesGroup as t}from"../../../../../core/handleUtils.js";import{debounce as e}from"../../../../../core/promiseUtils.js";import{scale as o,zeroMeters as n}from"../../../../../core/quantity.js";import{watch as i,syncAndInitial as a,sync as s}from"../../../../../core/reactiveUtils.js";import{ensureType as r}from"../../../../../core/accessorSupport/ensureType.js";import l from"../../../../../geometry/Point.js";import{manipulatedObjectGeometry as c}from"../manipulatedObjectUtils.js";import{updateXYZFromTooltipInfo as p,updateTooltipInfoFromManipulatedObject as f,updateElevationFromPoint as m}from"../tooltipUtils3D.js";import{axisConstrainedDragSign as u}from"../manipulations/moveUtils.js";import{connectPasteEvent as y,getXYZDeltasFromTooltipInfo as d}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as v}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{ReshapeEdgeOffsetTooltipInfo as w}from"../../../../interactive/tooltip/infos/ReshapeEdgeOffsetTooltipInfo.js";import{SelectedVertexTooltipInfo as T}from"../../../../interactive/tooltip/infos/SelectedVertexTooltipInfo.js";import{TranslateTooltipInfo as g}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as h}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as j}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as I}from"../../../../support/euclideanLengthMeasurementUtils.js";function O(t,e){const o=e?.type;return{edgeOffset:new w({toolOptions:t,viewType:o}),movePoint:new v({toolOptions:t,viewType:o}),selectedVertex:new T({toolOptions:t,viewType:o}),translate:new g({toolOptions:t,viewType:o}),translateXY:new h({toolOptions:t,viewType:o}),translateZ:new j({toolOptions:t,viewType:o})}}function b(o,n,r,l){function p(){const t=r(),e=t.toolOptions.tooltips.effectiveEnabled?t.activeTooltipInfo:null;return{...t,activeTooltipInfo:e}}let f=!1;function m(t){f||(f=!0,t(),f=!1)}const u=e(t=>U(n,t)),d=t=>{m(()=>{x(n,t),o.info=t.activeTooltipInfo,l.consumePromise(u(t))})};return t([i(p,t=>d(t),a),i(()=>{const t=p(),{activeTooltipInfo:e}=t;if(e&&"key"in e)return{context:t,activeTooltipInfo:e,key:e.key,geometry:c(n)}},(t,e)=>{t&&e&&e.key!==t.key&&m(()=>k(n,t.context))},s),n.on("committed",()=>d(p())),y(o,{onBeforePaste:()=>{f=!0},onAfterPaste:()=>{k(n,p()),f=!1}})])}function k(t,{activeTooltipInfo:e,selectedVertexManipulatorInfo:o,callbacks:n}){if(!e)return;n.onBeforeReshape();const i=c(t);switch(i?.type){case"mesh":"move-point"===e.type&&p(e,i.origin,t,n);break;case"point":"move-point"===e.type&&p(e,i,t,n);break;case"multipoint":case"polyline":case"polygon":"selected-vertex"===e.type&&P(e,o,t,n)}}function P(t,e,o,n){if(!e)return;const{dx:i,dy:a,dz:s}=d(t,e.manipulator.location);0===i&&0===a&&0===s||(n.onReshapeStart(),o.operations?.moveVertices([e.handle],i,a,s,0),n.onReshape(),n.onReshapeStop())}function x(t,e){const{activeTooltipInfo:o,selectedVertexManipulatorInfo:n,toolOptions:i}=e;if(o)switch(o.toolOptions=i,o?.type){case"move-point":f(o,t);break;case"selected-vertex":D(o,n,t);break;case"reshape-edge-offset":L(o,t)}}function D(t,e,o){if(!t||"selected-vertex"!==t.type)return;const n=e?.manipulator.location;t.setLocationFromPoint(n),m(t,n,o);const i=o.operations?.data.geometry,a=i?.type;"polygon"!==a&&"polyline"!==a||(t.geometryType=a),t.totalLength.visible="polyline"===a,t.area.visible="polygon"===a}function L(t,e){const o=e.operations?.data.geometry,n=o?.type;t.totalLength.visible="polyline"===n,t.totalLength.visible||(t.totalLength.actual=null),t.area.visible="polygon"===n,t.area.visible||(t.area.actual=null)}async function U(t,e){const{activeTooltipInfo:o}=e;if(o)switch(o?.type){case"selected-vertex":case"reshape-edge-offset":return await M(o,t,e)}}async function M(t,e,{measurementWorker:o}){const n=e.operations?.data.geometry;switch(n?.type){case"polygon":t.area.actual=(await o.autoArea2D(n)).area;break;case"polyline":t.totalLength.actual=await o.autoLength2D(n)}}const S=r(l);function B(t,e,o,n){let i=null;const{tooltipInfos:a,toolOptions:s}=o;switch(t){case 0:i=a.translate;break;case 1:i=a.translateXY;break;case 2:i=a.translateZ}return i.toolOptions=s,n.consumePromise(E(i,e,o)),i}const E=e(R);async function R(t,e,n){switch(t.type){case"translate":return V(t,e,(t,e)=>n.measurementWorker.autoDistance2DBetweenPoints(S(t),S(e)));case"translate-xy":return V(t,e,async(t,i)=>{const a=await n.measurementWorker.autoDistance2DBetweenPoints(S(t),S(i));return o(a,u(e))});case"translate-z":return V(t,e,I)}}async function V(t,e,o){if(null!=e&&"end"!==e.action){const{mapStart:i,mapEnd:a}=e,s=await o(i,a);t.distance=s??n}else t.distance=n}function A(t,e,o,n){const{toolOptions:i,tooltipInfos:a}=o,s=a.edgeOffset;return s.toolOptions=i,n.consumePromise(W(s,t,e,o)),s}const W=e(X);async function X(t,e,i,{measurementWorker:a}){const s=e.operations,r=i?.signedDistance;if(null!=i&&null!=r&&"end"!==i.action&&null!=s){const e=s.data.coordinateHelper,{start:n,end:l}=i.operation.clampedStartAndEnd(i.mapEnd),c=await a.autoDistance2DBetweenPoints(e.arrayToPoint(n),e.arrayToPoint(l)),p=Math.sign(r*i.operation.selectedArrow);t.distance.committed=null,t.distance.actual=null!=c?o(c,p):null}else t.distance.committed=null,t.distance.actual=n}export{b as connectTooltipToManipulatedObject,O as createTooltipInfos,A as getUpdatedEdgeOffsetTooltipInfo,B as getUpdatedTranslateObjectTooltipInfo};
|