@arcgis/core 4.24.0-next.20220508 → 4.24.0-next.20220511
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/AggregateGraphic.js +1 -1
- package/analysis/Analysis.js +1 -1
- package/analysis/DimensioningAnalysis.js +1 -1
- package/analysis/LengthDimension.d.ts +4 -0
- package/analysis/LengthDimension.js +5 -0
- package/analysis/dimensionUtils.js +5 -0
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcade.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/credentials.js +1 -1
- package/arcade/featureSetCollection.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/Empty.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/stats.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/request.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0564f1cfa3d17ff1aad3.js +1 -0
- package/assets/esri/core/workers/chunks/0806d5d706a864542bfb.js +1 -0
- package/assets/esri/core/workers/chunks/0a6977144ea1abf96fbf.js +1 -0
- package/assets/esri/core/workers/chunks/13387f56acbc3291561a.js +1 -0
- package/assets/esri/core/workers/chunks/16c4e0a32d50d4db984d.js +1 -0
- package/assets/esri/core/workers/chunks/{076d1b1101b59af0d389.js → 1c010202b4c7e1d15f23.js} +1 -1
- package/assets/esri/core/workers/chunks/26827ec144676e6385f8.js +1 -0
- package/assets/esri/core/workers/chunks/287c484fd40eee643f3a.js +1 -0
- package/assets/esri/core/workers/chunks/5210f0b42dba27945226.js +1 -0
- package/assets/esri/core/workers/chunks/{db6c5b3b4efe8d804f9c.js → 52478ee2d2a1354b6900.js} +1 -1
- package/assets/esri/core/workers/chunks/5759af97f96f24c40105.js +1 -0
- package/assets/esri/core/workers/chunks/{b85218d44c6094b7e5e6.js → 6d7e2a23a0a5dd9ded1d.js} +1 -1
- package/assets/esri/core/workers/chunks/70b6356357e7640c4e8b.js +1 -0
- package/assets/esri/core/workers/chunks/7574316b3af61c389e8f.js +1 -0
- package/assets/esri/core/workers/chunks/7bc828fbdd54c0b28aac.js +1 -0
- package/assets/esri/core/workers/chunks/7e5c22b5a32ac74b1b6e.js +1 -0
- package/assets/esri/core/workers/chunks/8102bb78fe96e6197e4e.js +1 -0
- package/assets/esri/core/workers/chunks/88384e7cafbfd2348598.js +1 -0
- package/assets/esri/core/workers/chunks/9d7533aaeac3b8d145c4.js +1 -0
- package/assets/esri/core/workers/chunks/{1eecae5227318f491263.js → 9f4d892abf55e8625bc9.js} +3 -3
- package/assets/esri/core/workers/chunks/{98607a0da63626cc4614.js → a054a52712a118c6d505.js} +1 -1
- package/assets/esri/core/workers/chunks/{69a20e4d9e28c3e599fc.js → a3bb600bfcb0282622f1.js} +1 -1
- package/assets/esri/core/workers/chunks/aa49841b14c6e6df2a07.js +1 -0
- package/assets/esri/core/workers/chunks/b089058b64db3912478f.js +1 -0
- package/assets/esri/core/workers/chunks/b28539c5a6bedb71b038.js +1 -0
- package/assets/esri/core/workers/chunks/b4f171db73355c6f766e.js +1 -0
- package/assets/esri/core/workers/chunks/b7572b0921b23aef8b9d.js +1 -0
- package/assets/esri/core/workers/chunks/b758f3c419edc2306784.js +1 -0
- package/assets/esri/core/workers/chunks/c3e7290fb128d4fefd44.js +1 -0
- package/assets/esri/core/workers/chunks/c51c9b5da855f84b9a48.js +1 -0
- package/assets/esri/core/workers/chunks/c66ac36da6392b6bf331.js +1 -0
- package/assets/esri/core/workers/chunks/d16b328d32a6ddc2fdb9.js +1 -0
- package/assets/esri/core/workers/chunks/d94c5f36d52cf71f0bb9.js +1 -0
- package/assets/esri/core/workers/chunks/db937849b2c1af87b481.js +1 -0
- package/assets/esri/core/workers/chunks/{66cd99e91dad60c5274c.js → dc3ed59f450283d97a19.js} +1 -1
- package/assets/esri/core/workers/chunks/dcd0653191cd4a1ccaae.js +2 -0
- package/assets/esri/core/workers/chunks/{31df729c17470245288c.js.LICENSE.txt → dcd0653191cd4a1ccaae.js.LICENSE.txt} +2 -2
- package/assets/esri/core/workers/chunks/e4fdd1eaf987977d0a51.js +1 -0
- package/assets/esri/core/workers/chunks/e51f0e71f2a55af604d3.js +1 -0
- package/assets/esri/core/workers/chunks/eb3855d3753d6b8334bd.js +1 -0
- package/assets/esri/core/workers/chunks/{7c290763920f52a1f504.js → eeed138930a4a805691d.js} +1 -1
- package/assets/esri/core/workers/chunks/f435dc615fdc8917f6ca.js +1 -0
- package/assets/esri/core/workers/chunks/{d5c5b9f7f5401f36a3a5.js → f7f3dde4c8f9c687cc1e.js} +1 -1
- package/assets/esri/core/workers/chunks/fc6beaf9466ea3898549.js +1 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -0
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/BlendLayers.glsl.js +6 -6
- package/chunks/arcade.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/sql/StandardizedFunctions.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/geometry/support/normalizeUtilsCommon.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/interfaces.d.ts +685 -37
- package/layers/MediaLayer.d.ts +4 -0
- package/layers/MediaLayer.js +5 -0
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +5 -0
- package/layers/graphics/OptimizedGeometry.js +1 -1
- package/layers/graphics/data/BoundsStore.js +1 -1
- package/layers/support/CornersGeoreference.d.ts +4 -0
- package/layers/support/CornersGeoreference.js +5 -0
- package/layers/support/ExtentAndRotationGeoreference.d.ts +4 -0
- package/layers/support/ExtentAndRotationGeoreference.js +5 -0
- package/layers/support/FeatureReduction.js +1 -1
- package/layers/support/FeatureReductionBinning.js +5 -0
- package/layers/support/GeoreferenceBase.js +5 -0
- package/layers/support/ImageElement.d.ts +4 -0
- package/layers/support/ImageElement.js +5 -0
- package/layers/support/LocalMediaElementSource.d.ts +4 -0
- package/layers/support/LocalMediaElementSource.js +5 -0
- package/layers/support/MediaElementBase.d.ts +4 -0
- package/layers/support/MediaElementBase.js +5 -0
- package/layers/support/RouteStopSymbols.d.ts +4 -0
- package/layers/support/RouteSymbols.d.ts +4 -0
- package/layers/support/VoxelFormat.d.ts +4 -0
- package/layers/support/VoxelStyle.d.ts +4 -0
- package/layers/support/VoxelVariable.d.ts +4 -0
- package/layers/support/VoxelVolume.d.ts +4 -0
- package/layers/support/VoxelVolumeStyle.d.ts +4 -0
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterFormats/Lerc.js +1 -1
- package/package.json +3 -3
- package/request.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/Font.js +1 -1
- package/symbols/support/textUtils.js +1 -1
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +5 -0
- package/views/2d/engine/webgl/OverlayContainer.js +5 -0
- package/views/2d/engine/webgl/brushes/BrushOverlay.js +5 -0
- package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
- package/views/2d/engine/webgl/shaders/OverlayPrograms.js +5 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +5 -0
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureStore2D.js +1 -1
- package/views/2d/layers/features/Pipeline.js +1 -1
- package/views/2d/layers/features/Store2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/BinStore.js +5 -0
- package/views/2d/layers/features/support/ClusterStore.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/clusterUtils.js +1 -1
- package/views/2d/magnifier/MagnifierView2D.js +1 -1
- package/views/2d/navigation/actions/Pinch.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/AnalysisView3D.js +1 -1
- package/views/3d/analysis/Dimensioning/DimensioningTool.js +5 -0
- package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +5 -0
- package/views/3d/analysis/Dimensioning/{LinearDimensionVisualization.js → LengthDimensionVisualization.js} +1 -1
- package/views/3d/analysis/Dimensioning/settings.js +5 -0
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +5 -0
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +5 -0
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/i3s/IDBCache.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/SegmentLabels.js +5 -0
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/support/viewUtils.js +5 -0
- package/views/interactive/tooltip/DrawPointTooltipInfo.js +5 -0
- package/views/interactive/tooltip/DrawPolygonTooltipInfo.js +5 -0
- package/views/interactive/tooltip/DrawPolylineTooltipInfo.js +5 -0
- package/views/interactive/tooltip/Tooltip.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/support/measurements.js +5 -0
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/overlay/TextOverlayItem.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/screenUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent/FeatureContentViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/InputFieldGroup.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +11 -11
- package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates/TemplateItem.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/ListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print/FileLink.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/TableList/ListItem.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather/VisibleElements.js +5 -0
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/analysis/LinearDimension.d.ts +0 -4
- package/analysis/LinearDimension.js +0 -5
- package/assets/esri/core/workers/chunks/0018053ac16a09feba70.js +0 -1
- package/assets/esri/core/workers/chunks/042938ca73f0b9e5a7e2.js +0 -1
- package/assets/esri/core/workers/chunks/048645611caa28dca7cd.js +0 -1
- package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +0 -1
- package/assets/esri/core/workers/chunks/13b04d5bf348ab5054c2.js +0 -1
- package/assets/esri/core/workers/chunks/215007e7c44811d90777.js +0 -1
- package/assets/esri/core/workers/chunks/31df729c17470245288c.js +0 -2
- package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +0 -1
- package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +0 -1
- package/assets/esri/core/workers/chunks/37c428489c59df4b597b.js +0 -1
- package/assets/esri/core/workers/chunks/493169fd978fd543ef3b.js +0 -1
- package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +0 -1
- package/assets/esri/core/workers/chunks/58e4c6ce1580427e7b55.js +0 -1
- package/assets/esri/core/workers/chunks/6c5441da675a8af35be2.js +0 -1
- package/assets/esri/core/workers/chunks/6ea16f6a0df946de480b.js +0 -1
- package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +0 -1
- package/assets/esri/core/workers/chunks/88193e61072d7bf957f5.js +0 -1
- package/assets/esri/core/workers/chunks/8ccbde593c86c872e525.js +0 -1
- package/assets/esri/core/workers/chunks/9c6be39f1f21ab8b1c2d.js +0 -1
- package/assets/esri/core/workers/chunks/a73795cce722ba15b3da.js +0 -1
- package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +0 -1
- package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +0 -1
- package/assets/esri/core/workers/chunks/adcc5bce6c0971c1b592.js +0 -1
- package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +0 -1
- package/assets/esri/core/workers/chunks/b340c9bdabdb37995c8f.js +0 -1
- package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +0 -1
- package/assets/esri/core/workers/chunks/c180c40838246985479d.js +0 -1
- package/assets/esri/core/workers/chunks/caed2365bd296fcc8a75.js +0 -1
- package/assets/esri/core/workers/chunks/d85b5b73a151c6fbb658.js +0 -1
- package/assets/esri/core/workers/chunks/da6261673c3e1537b6a6.js +0 -1
- package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +0 -1
- package/assets/esri/core/workers/chunks/ec6d138e8183e193f977.js +0 -1
- package/assets/esri/core/workers/chunks/ed4519ac9533a4d340f1.js +0 -1
- package/assets/esri/core/workers/chunks/f206300eef4560611728.js +0 -1
- package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +0 -1
- package/layers/GeoreferencedImageLayer.d.ts +0 -4
- package/layers/GeoreferencedImageLayer.js +0 -5
- package/layers/VoxelWasmManager.js +0 -5
- package/layers/VoxelWasmPerScene.js +0 -5
- package/views/3d/interactive/measurementTools/support/viewUtils.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../geometry.js";import e from"../../../../analysis/SlicePlane.js";import{neverReached as t}from"../../../../core/compilerUtils.js";import r from"../../../../core/Logger.js";import{rad2deg as i,deg2rad as s}from"../../../../core/mathUtils.js";import{isNone as n,isSome as o}from"../../../../core/maybe.js";import{castRenderScreenPointArray3 as a}from"../../../../core/screenUtils.js";import{g as c,b as l,h as u,m as d,r as m,i as p,j as g,k as f}from"../../../../chunks/mat4.js";import{c as b}from"../../../../chunks/mat4f64.js";import{r as h}from"../../../../chunks/quat.js";import{g as T,c as y,e as O,f as w,n as I,a as E,l as R,b as j,p as A,s as M,v as L}from"../../../../chunks/vec3.js";import{a as P,c as k,f as v}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as C}from"../../../../geometry/projection.js";import{Axis as _}from"../../../../geometry/support/Axis.js";import{r as N,f as U,i as V,c as S,n as x,u as G}from"../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as F,fromVectorsAndPoint as H}from"../../../../geometry/support/plane.js";import{create as D}from"../../../../geometry/support/ray.js";import{angleAroundAxis as z}from"../../../../geometry/support/vector.js";import{sv3d as X,sm4d as Y,sq4d as Z}from"../../../../geometry/support/vectorStacks.js";import{SHIFT_RESTART_TIP_RADIUS as B,RESIZE_HANDLE_EDGE_PADDING_FRAC as W,VERTICAL_DOT_THRESHOLD as q,SMALL_ANGLE_DOT_THRESHOLD as $,PLANE_MIN_BASIS_SCREEN_LEN2 as J,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as K,SHIFT_RESTART_OFFSET_DISTANCE as Q,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as ee,SHIFT_RESTART_ARROW_TIP_COLOR as te,SHIFT_RESTART_ARROW_CAP_COLOR as re,SHIFT_RESTART_TUBE_COLOR as ie,SHIFT_RESTART_OUTLINE_COLOR as se,SHIFT_RESTART_CALLOUT_COLOR as ne,ROTATE_HEADING_OFFSET_DISTANCE as oe,ROTATE_HEADING_DISC_RADIUS as ae,ROTATE_HEADING_CALLOUT_COLOR as ce,PLANE_OUTLINE_COLOR as le,PLANE_OUTLINE_WIDTH as ue,PLANE_BACKGROUND_COLOR as de,GRID_COLOR as me,RESIZE_HANDLE_CORNER_INPUT_RADIUS as pe,RESIZE_HANDLE_EDGE_INPUT_RADIUS as ge,ROTATE_HEADING_TIP_LENGTH as fe,ROTATE_HEADING_DISC_RADIUS_FOCUS_MULTIPLIER as be,RESIZE_HANDLE_COLOR as he,DISPLAY_FOCUS_MULTIPLIER as Te,RESIZE_HANDLE_EDGE_WIDTH as ye,SHIFT_RESTART_ARROW_LENGTH as Oe,SHIFT_RESTART_TUBE_RADIUS as we,SHIFT_RESTART_TIP_LENGTH as Ie,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as Ee,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as Re,RESIZE_HANDLE_CORNER_WIDTH as je}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as Ae}from"../support/projectionUtils.js";import{Manipulator3D as Me}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as Le}from"../../interactive/manipulatorUtils.js";import{LineVisualElement as Pe}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as ke}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as ve}from"../../support/RenderCoordsHelper.js";import{fromRender as Ce}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as _e}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as Ne}from"../../webgl-engine/lib/Geometry.js";import Ue from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Ve}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as Se}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as xe}from"../../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as Ge}from"../../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as Fe}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as He}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as De,ManipulatorStateFlags as ze}from"../../../interactive/interfaces.js";import Xe from"../../../../geometry/Extent.js";const Ye=r.getLogger("esri.views.3d.interactive.analysisTools.slice.sliceToolUtils");function Ze(e,t,r,i,s,n,o,a){return Be(t,o.worldUpAtPosition(e,X.get()),s,n,a.basis1,a.basis2),T(a.basis1,a.basis1,r),T(a.basis2,a.basis2,i),y(a.origin,e),H(a.basis2,a.basis1,a.origin,a.plane),a}function Be(e,t,r,i,s,n){const o=O(e,t),a=X.get(),c=X.get();switch(i===vt.HORIZONTAL_OR_VERTICAL?Math.abs(o)>q?vt.HORIZONTAL:vt.VERTICAL:i){case vt.VERTICAL:{const i=Math.abs(o)<=$?e:r.viewUp;w(a,i,t),y(c,t);break}case vt.HORIZONTAL:w(a,r.viewUp,t),w(c,t,a);break;case vt.TILTED:{const i=Math.abs(o)<=$?t:r.viewUp;w(a,i,e),w(c,e,a);break}}const l=w(X.get(),a,c);O(l,r.viewForward)>0&&T(c,c,-1),I(s,a),I(n,c)}function We(e,t,r){const i=t.worldUpAtPosition(e.origin,X.get()),s=e.basis1,n=It(e,i),o=Math.round(n/Nt)*Nt;return N(e,o-n,s,r)}function qe(e,t,r,i,s,n){const o=y(X.get(),s.origin);E(o,o,T(X.get(),s.basis1,e.direction[0]<0?1:-1)),E(o,o,T(X.get(),s.basis2,e.direction[1]<0?1:-1));const a=R(s.basis1),c=R(s.basis2),l=j(X.get(),r,o),u=j(X.get(),t,o);let d=0,m=0;if(ut(e)){const t=lt(s),r=lt(n);d=a-.5*e.direction[0]*O(s.basis1,u)/a,m=c-.5*e.direction[1]*O(s.basis2,u)/c;const i=r/t;d*=i,m*=i}const p=d+.5*e.direction[0]*O(s.basis1,l)/a,g=m+.5*e.direction[1]*O(s.basis2,l)/c,f=T(X.get(),s.basis1,p/a),b=T(X.get(),s.basis2,g/c);(p<=0||at(n.origin,f,i)<=J)&&y(f,n.basis1),(g<=0||at(n.origin,b,i)<=J)&&y(b,n.basis2);const h=y(X.get(),o);return E(h,h,T(X.get(),f,e.direction[0]<0?-1:1)),E(h,h,T(X.get(),b,e.direction[1]<0?-1:1)),U(h,f,b,n)}function $e(e,t){return K*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Je(e,t,r,i){const s=w(X.get(),t,r);return w(s,s,t),F(e,s,i)}function Ke(e,t){return Le(e.basis1,e.basis2,e.origin,t)}function Qe(e,t,r,i){const s=t.worldUpAtPosition(e.origin,X.get()),n=X.get();switch(r){case kt.HEADING:y(n,s);break;case kt.TILT:y(n,e.basis1)}return F(e.origin,n,i)}function et(e,t,r,i){const s=ot(r,nt.NEGATIVE_X),n=Y.get();c(n,t,s.edge*Math.PI/2);const o=I(X.get(),s.basis);let l=T(X.get(),o,s.direction*i.computeScreenPixelSizeAt(s.position)*Q);E(l,l,s.position);const u=i.projectToRenderScreen(l,a(X.get())),d=tt(i,u);Ce(i,u,_t),I(_t.direction,_t.direction);const m=X.get();!d&&V(r,_t,m)&&(l=m),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=P(l),d?e.state|=Ct:e.state&=~Ct}function tt(e,t){const[r,i,s,n]=e.viewport,o=Math.min(s,n)/16;let a=!0;return t[0]<r+o?(t[0]=r+o,a=!1):t[0]>r+s-o&&(t[0]=r+s-o,a=!1),t[1]<i+o?(t[1]=i+o,a=!1):t[1]>i+n-o&&(t[1]=i+n-o,a=!1),a}function rt(e,t,r,i){const s=R(i.basis1),n=R(i.basis2),o=ct(i),a=lt(i),c=M(X.get(),0,0,0);E(c,T(X.get(),i.basis1,t.direction[0]),T(X.get(),i.basis2,t.direction[1])),E(c,i.origin,c);let m=0,p=1;if(ut(t))1===t.direction[0]&&-1===t.direction[1]?m=Nt:1===t.direction[0]&&1===t.direction[1]?m=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(m=3*Math.PI/2),p=a;else{const e=0!==t.direction[0]?1:2;m=1===e?Nt:0,p=(1===e?n:s)-o}const g=l(Y.get(),m);u(g,g,M(X.get(),p,p,p)),d(g,r,g),g[12]=0,g[13]=0,g[14]=0,e.modelTransform=g,e.renderLocation=c}function it(e,t,r,i){const s=i.worldUpAtPosition(r.origin,X.get()),n=ot(r,nt.POSITIVE_X),o=l(Y.get(),n.edge*Math.PI/2);m(o,o,-It(r,s)),d(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=n.position}function st(e,t,r){const i=ot(r,nt.POSITIVE_Y),s=l(Y.get(),i.edge*Math.PI/2);m(s,s,Nt),d(s,t,s),s[12]=0,s[13]=0,s[14]=0,e.modelTransform=s,e.renderLocation=i.position}var nt;function ot(e,t){switch(t){case nt.POSITIVE_X:return{basis:e.basis1,direction:1,position:E(X.get(),e.origin,e.basis1),edge:t};case nt.POSITIVE_Y:return{basis:e.basis2,direction:1,position:E(X.get(),e.origin,e.basis2),edge:t};case nt.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:j(X.get(),e.origin,e.basis1),edge:t};case nt.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:j(X.get(),e.origin,e.basis2),edge:t}}}function at(e,t,r){const i=r.projectToRenderScreen(E(X.get(),e,t),a(X.get())),s=r.projectToRenderScreen(j(X.get(),e,t),a(X.get()));return A(j(i,i,s))}function ct(e){const t=R(e.basis1),r=R(e.basis2);return W*Math.min(t,r)}function lt(e){return ct(e)}function ut(e){return 0!==e.direction[0]&&0!==e.direction[1]}function dt(e,t=St.CENTER_ON_ARROW){const r=t===St.CENTER_ON_CALLOUT?Q:0,i=[v(r,0,-Oe/2),v(r,0,Oe/2)],s=Tt(i,!0),n=(e,t)=>bt(i,i,{tubeRadius:we,tipRadius:B,tipLength:Ie,tubeFocusMultiplier:Ee,tipFocusMultiplier:Re,padding:e,bothEnds:!0,flat:null,focusTipLength:!0,addCap:t}),o=n(0,!1),a=n(ee,!0),c=new xe({color:te,cullFace:_e.Back,renderOccluded:Ve.Opaque}),l=new xe({color:re,cullFace:_e.Back,renderOccluded:Ve.Opaque}),u=new xe({color:ie,cullFace:_e.Back,renderOccluded:Ve.Opaque}),d=new xe({color:se,transparent:!0,writeDepth:!1,cullFace:_e.Front,renderOccluded:Ve.Transparent}),m=Ue.createPolylineGeometry([[r,0,0],[r-Q,0,0]]),p=Ue.createPolylineGeometry([[r,0,0],[r-Q,0,0]]),g=new Fe({color:ne,renderOccluded:Ve.OccludeAndTransparent});return new Me({view:e,renderObjects:[...o.normal.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:ze.Unfocused|Pt}))),...a.normal.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:ze.Unfocused|Pt}))),{geometry:m,material:g,stateMask:ze.Unfocused|Pt|Ct},...o.focused.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:ze.Focused|Pt}))),...a.focused.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:ze.Focused|Pt}))),{geometry:p,material:g,stateMask:ze.Focused|Pt|Ct}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[s]},collisionPriority:1,radius:B,state:Pt})}function mt(e,t){const r=new Ge({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:Ve.Opaque}),i=oe,s=ae,n=s*be,o=e=>{const t=new Uint32Array([0,1,2,2,3,0]);return new Ne([[Se.POSITION,{size:3,data:[i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],exclusive:!0}],[Se.UV0,{size:2,data:[0,0,1,0,1,1,0,1]}]],[[Se.POSITION,t],[Se.UV0,t]])},a=Ue.createPolylineGeometry([[0,0,0],[i-s,0,0]]),c=Ue.createPolylineGeometry([[0,0,0],[i-n,0,0]]),l=new Fe({color:ce,renderOccluded:Ve.OccludeAndTransparent}),u=[{geometry:o(s),material:r,stateMask:ze.Unfocused|Pt},{geometry:a,material:l,stateMask:ze.Unfocused|Pt},{geometry:o(n),material:r,stateMask:ze.Focused|Pt},{geometry:c,material:l,stateMask:ze.Focused|Pt}];return new Me({view:e,renderObjects:u,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},collisionPriority:1,radius:s/2,state:Pt})}function pt(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new Pe({view:e,attached:!0,color:le,width:ue,writeDepthEnabled:!1,renderOccluded:Ve.OccludeAndTransparent,geometry:[t]})}function gt(e){return new ke({view:e,attached:!0,backgroundColor:[...de],gridColor:me,gridWidth:4,renderOccluded:Ve.OccludeAndTransparent})}function ft(e,t){const r=ut(t),i=r?[v(1,0,0),v(0,0,0),v(0,1,0)]:[v(1,0,0),v(-1,0,0)],s=Ue.createPolylineGeometry(i),n=he,o=e=>new He({color:n,width:e,renderOccluded:Ve.OccludeAndTransparent}),a=()=>new Fe({color:n,renderOccluded:Ve.OccludeAndTransparent}),c=r?je:ye,l=c*Te,u=ye,d=e=>e>1?o(e):a(),m=[{geometry:s,material:d(c),stateMask:ze.Unfocused|Ut},{geometry:s,material:d(l),stateMask:ze.Focused|Ut},{geometry:s,material:d(u),stateMask:Vt}],p=new Me({view:e,renderObjects:m,collisionType:{type:"line",paths:[i]},autoScaleRenderObjects:!1,worldSized:!0,radius:r?pe:ge});return p.state=Ut,p}function bt(e,t,r){const i=i=>{const s=(i?t:e).slice(0),n=j(X.get(),s[0],s[1]);I(n,n);const a=j(X.get(),s[s.length-1],s[s.length-2]);if(I(a,a),r.padding>0){const e=T(k(),a,-r.padding);if(s[s.length-1]=E(e,e,s[s.length-1]),r.bothEnds){const e=T(k(),n,-r.padding);s[0]=E(e,e,s[0])}}const c=i?r.tipFocusMultiplier:1,l=r.tipLength*(r.focusTipLength?c:1),m=r.tipRadius*c,y=p(Y.get());if(r.padding>0){const e=l/4,t=M(X.get(),0,e,0),i=1+r.padding/e;g(y,y,t),u(y,y,M(X.get(),i,i,i)),g(y,y,T(t,t,-1/i))}const O=p(b()),w=v(0,1,0),R=f(b(),h(Z.get(),w,a));R[12]=s[s.length-1][0],R[13]=s[s.length-1][1],R[14]=s[s.length-1][2],d(R,R,y);const A=[{part:"tube",geometry:ht(r.tubeRadius*(i?r.tubeFocusMultiplier:1)+r.padding,r.flat,s),transform:O}];let L,P;if(o(r.flat)?L=Ue.createExtrudedTriangle(l,m,m,r.flat.thickness):(L=Ue.createConeGeometry(l,m,24,!1,!1,!0),P=Ue.createConeGeometry(l,m,24,!1,!0,!1)),A.push({part:"tip",geometry:L,transform:R}),P&&A.push({part:"cap",geometry:P,transform:R}),r.bothEnds){const e=f(b(),h(Z.get(),w,n));e[12]=s[0][0],e[13]=s[0][1],e[14]=s[0][2],d(e,e,y),A.push({part:"tip",geometry:L,transform:e}),P&&A.push({part:"cap",geometry:P,transform:e})}return A};return{normal:i(!1),focused:i(!0)}}function ht(e,t,r){const i=[];if(o(t))i.push([e,t.thickness/2],[-e,t.thickness/2],[-e,-t.thickness/2],[e,-t.thickness/2]);else{const t=12;for(let r=0;r<t;r++){const s=r/t*2*Math.PI;i.push([Math.cos(s)*e,Math.sin(s)*e])}}return Ue.createPathExtrusionGeometry(i,r,[],[],!1)}function Tt(e,t){const r=j(k(),e[e.length-1],e[e.length-2]);if(I(r,r),T(r,r,fe),E(r,r,e[e.length-1]),t){const t=j(k(),e[0],e[1]);return I(t,t),T(t,t,fe),E(t,t,e[0]),[t,...e,r]}return[...e,r]}function yt(t,r,s,o=new e){if(n(t))return null;const{renderCoordsHelper:a}=r,c=a.fromRenderCoords(t.origin,r.spatialReference);if(n(c))return null;const l=C(c,s);if(n(l))return null;o.position=l;const u=a.worldUpAtPosition(t.origin,X.get()),d=a.worldBasisAtPosition(t.origin,_.Y,X.get()),m=2*R(t.basis1),p=2*R(t.basis2),g=ve.renderUnitScaleFactor(r.spatialReference,s);return o.width=m*g,o.height=p*g,o.tilt=i(It(t,u)),o.heading=i(Et(t,u,d)),o}function Ot(e,t,r){if(n(e)||n(e.position))return null;const{spatialReference:i}=e.position,s=wt(At(e,{renderCoordsHelper:t,spatialReference:i},r),t,i);return!e.position.hasZ&&o(s)&&(s.zmin=null,s.zmax=null),s}function wt(e,t,r){if(n(e))return null;const i=e.origin,s=X.get(),o=X.get(),a=X.get(),c=X.get();let l,u,d,m,p,g;E(s,i,e.basis1),E(s,s,e.basis2),E(o,i,e.basis1),L(o,o,e.basis2),L(a,i,e.basis1),L(a,a,e.basis2),L(c,i,e.basis1),E(c,c,e.basis2);for(const f of[s,o,a,c]){const e=t.fromRenderCoords(f,f,r);if(n(e))return null;l=null==l?e[0]:Math.min(l,e[0]),u=null==u?e[0]:Math.max(u,e[0]),d=null==d?e[1]:Math.min(d,e[1]),m=null==m?e[1]:Math.max(m,e[1]),p=null==p?e[2]:Math.min(p,e[2]),g=null==g?e[2]:Math.max(g,e[2])}return new Xe({xmin:l,xmax:u,ymin:d,ymax:m,zmin:p,zmax:g,spatialReference:r})}function It(e,t){return z(t,e.basis2,e.basis1)+Nt}function Et(e,t,r){return z(e.basis1,r,t)-Nt}function Rt(e,t,r,i,n,o,a=S()){return o.toRenderCoords(e,a.origin)?(o.worldBasisAtPosition(a.origin,_.X,a.basis1),o.worldBasisAtPosition(a.origin,_.Y,a.basis2),H(a.basis2,a.basis1,a.origin,a.plane),N(a,-s(t),x(a),a),N(a,s(r),a.basis1,a),T(a.basis1,a.basis1,i/2),T(a.basis2,a.basis2,n/2),G(a),a):(Ye.error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function jt(e,t){if(n(e)||n(e.position))return null;const r=Ae(e.position,t.spatialReference,t.elevationProvider);if(n(r))return null;const i=ve.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),s=e.width*i,o=e.height*i;return{position:r,heading:e.heading,tilt:e.tilt,renderWidth:s,renderHeight:o}}function At(e,t,r,i=S()){const s=jt(e,t);return n(s)?null:Mt(s,t,r,i)}function Mt(e,t,r,i=S()){if(n(e))return null;const s=Rt(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,i);return!r.tiltEnabled&&o(s)&&We(s,t.renderCoordsHelper,s),s}function Lt(e){switch(e.type){case"analysis":case"building-scene":case"csv":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"map-notes":case"ogc-feature":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"georeferenced-image":case"imagery":case"imagery-tile":case"map-image":case"open-street-map":case"tile":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return t(e.type),!1}}!function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"}(nt||(nt={}));const Pt=De.Custom1;var kt,vt;!function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"}(kt||(kt={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(vt||(vt={}));const Ct=De.Custom2,_t=D(),Nt=Math.PI/2,Ut=De.Custom1,Vt=De.Custom2;var St;function xt(e){const t="building-scene-3d"===e.type?e:null;return o(t)}!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(St||(St={}));export{Pt as DidPointerMoveRecentlyFlag,Ct as IsShiftEdgeOnScreenFlag,St as OffsetMode,kt as RotationAxis,vt as SliceOrientation,Tt as addArrowTips,Ke as calculateBoundedPlaneTranslateRotate,lt as calculateDiagonalResizeHandleScale,$e as calculatePlaneHalfSize,ct as calculateResizeHandlePadding,at as calculateScreenSpaceBasisLength2,bt as createArrowGeometry,gt as createGridVisualElement,pt as createOutlineVisualElement,Ze as createPlane,ft as createResizeManipulator,mt as createRotateManipulator,Qe as createRotatePlane,dt as createShiftManipulator,Je as createShiftPlane,We as forceHorizontalOrVertical,Lt as isAlwaysDrapedLayer,ut as isDiagonalResizeHandle,xt as isIBuildingSceneLayerView3D,Be as normalToBases,wt as planeToExtent,yt as planeToShape,jt as projectAndElevationAlignShape,Mt as projectedShapeToPlane,Ut as resizeNormal,Vt as resizeOutlineOnly,qe as resizePlane,Ot as shapeToExtent,At as shapeToPlane,rt as updateResizeHandle,it as updateRotateHeadingHandle,st as updateRotateTiltHandle,et as updateShiftRestartHandle};
|
|
5
|
+
import"../../../../geometry.js";import e from"../../../../analysis/SlicePlane.js";import{neverReached as t}from"../../../../core/compilerUtils.js";import r from"../../../../core/Logger.js";import{rad2deg as i,deg2rad as s}from"../../../../core/mathUtils.js";import{isNone as n,isSome as o}from"../../../../core/maybe.js";import{castRenderScreenPointArray3 as a}from"../../../../core/screenUtils.js";import{g as c,b as l,h as u,m as d,r as m,i as p,j as g,k as f}from"../../../../chunks/mat4.js";import{c as b}from"../../../../chunks/mat4f64.js";import{r as h}from"../../../../chunks/quat.js";import{g as T,c as y,e as O,f as w,n as I,a as E,l as R,b as j,p as A,s as M,v as L}from"../../../../chunks/vec3.js";import{a as P,c as k,f as v}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as C}from"../../../../geometry/projection.js";import{Axis as _}from"../../../../geometry/support/Axis.js";import{r as N,f as U,i as V,c as S,n as x,u as G}from"../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as F,fromVectorsAndPoint as H}from"../../../../geometry/support/plane.js";import{create as D}from"../../../../geometry/support/ray.js";import{angleAroundAxis as z}from"../../../../geometry/support/vector.js";import{sv3d as X,sm4d as Y,sq4d as Z}from"../../../../geometry/support/vectorStacks.js";import{SHIFT_RESTART_TIP_RADIUS as B,RESIZE_HANDLE_EDGE_PADDING_FRAC as W,VERTICAL_DOT_THRESHOLD as q,SMALL_ANGLE_DOT_THRESHOLD as $,PLANE_MIN_BASIS_SCREEN_LEN2 as J,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as K,SHIFT_RESTART_OFFSET_DISTANCE as Q,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as ee,SHIFT_RESTART_ARROW_TIP_COLOR as te,SHIFT_RESTART_ARROW_CAP_COLOR as re,SHIFT_RESTART_TUBE_COLOR as ie,SHIFT_RESTART_OUTLINE_COLOR as se,SHIFT_RESTART_CALLOUT_COLOR as ne,ROTATE_HEADING_OFFSET_DISTANCE as oe,ROTATE_HEADING_DISC_RADIUS as ae,ROTATE_HEADING_CALLOUT_COLOR as ce,PLANE_OUTLINE_COLOR as le,PLANE_OUTLINE_WIDTH as ue,PLANE_BACKGROUND_COLOR as de,GRID_COLOR as me,RESIZE_HANDLE_CORNER_INPUT_RADIUS as pe,RESIZE_HANDLE_EDGE_INPUT_RADIUS as ge,ROTATE_HEADING_TIP_LENGTH as fe,ROTATE_HEADING_DISC_RADIUS_FOCUS_MULTIPLIER as be,RESIZE_HANDLE_COLOR as he,DISPLAY_FOCUS_MULTIPLIER as Te,RESIZE_HANDLE_EDGE_WIDTH as ye,SHIFT_RESTART_ARROW_LENGTH as Oe,SHIFT_RESTART_TUBE_RADIUS as we,SHIFT_RESTART_TIP_LENGTH as Ie,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as Ee,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as Re,RESIZE_HANDLE_CORNER_WIDTH as je}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as Ae}from"../support/projectionUtils.js";import{Manipulator3D as Me}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as Le}from"../../interactive/manipulatorUtils.js";import{LineVisualElement as Pe}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as ke}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as ve}from"../../support/RenderCoordsHelper.js";import{fromRender as Ce}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as _e}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as Ne}from"../../webgl-engine/lib/Geometry.js";import Ue from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Ve}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as Se}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as xe}from"../../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as Ge}from"../../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as Fe}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as He}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as De,ManipulatorStateFlags as ze}from"../../../interactive/interfaces.js";import Xe from"../../../../geometry/Extent.js";const Ye=r.getLogger("esri.views.3d.interactive.analysisTools.slice.sliceToolUtils");function Ze(e,t,r,i,s,n,o,a){return Be(t,o.worldUpAtPosition(e,X.get()),s,n,a.basis1,a.basis2),T(a.basis1,a.basis1,r),T(a.basis2,a.basis2,i),y(a.origin,e),H(a.basis2,a.basis1,a.origin,a.plane),a}function Be(e,t,r,i,s,n){const o=O(e,t),a=X.get(),c=X.get();switch(i===vt.HORIZONTAL_OR_VERTICAL?Math.abs(o)>q?vt.HORIZONTAL:vt.VERTICAL:i){case vt.VERTICAL:{const i=Math.abs(o)<=$?e:r.viewUp;w(a,i,t),y(c,t);break}case vt.HORIZONTAL:w(a,r.viewUp,t),w(c,t,a);break;case vt.TILTED:{const i=Math.abs(o)<=$?t:r.viewUp;w(a,i,e),w(c,e,a);break}}const l=w(X.get(),a,c);O(l,r.viewForward)>0&&T(c,c,-1),I(s,a),I(n,c)}function We(e,t,r){const i=t.worldUpAtPosition(e.origin,X.get()),s=e.basis1,n=It(e,i),o=Math.round(n/Nt)*Nt;return N(e,o-n,s,r)}function qe(e,t,r,i,s,n){const o=y(X.get(),s.origin);E(o,o,T(X.get(),s.basis1,e.direction[0]<0?1:-1)),E(o,o,T(X.get(),s.basis2,e.direction[1]<0?1:-1));const a=R(s.basis1),c=R(s.basis2),l=j(X.get(),r,o),u=j(X.get(),t,o);let d=0,m=0;if(ut(e)){const t=lt(s),r=lt(n);d=a-.5*e.direction[0]*O(s.basis1,u)/a,m=c-.5*e.direction[1]*O(s.basis2,u)/c;const i=r/t;d*=i,m*=i}const p=d+.5*e.direction[0]*O(s.basis1,l)/a,g=m+.5*e.direction[1]*O(s.basis2,l)/c,f=T(X.get(),s.basis1,p/a),b=T(X.get(),s.basis2,g/c);(p<=0||at(n.origin,f,i)<=J)&&y(f,n.basis1),(g<=0||at(n.origin,b,i)<=J)&&y(b,n.basis2);const h=y(X.get(),o);return E(h,h,T(X.get(),f,e.direction[0]<0?-1:1)),E(h,h,T(X.get(),b,e.direction[1]<0?-1:1)),U(h,f,b,n)}function $e(e,t){return K*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Je(e,t,r,i){const s=w(X.get(),t,r);return w(s,s,t),F(e,s,i)}function Ke(e,t){return Le(e.basis1,e.basis2,e.origin,t)}function Qe(e,t,r,i){const s=t.worldUpAtPosition(e.origin,X.get()),n=X.get();switch(r){case kt.HEADING:y(n,s);break;case kt.TILT:y(n,e.basis1)}return F(e.origin,n,i)}function et(e,t,r,i){const s=ot(r,nt.NEGATIVE_X),n=Y.get();c(n,t,s.edge*Math.PI/2);const o=I(X.get(),s.basis);let l=T(X.get(),o,s.direction*i.computeScreenPixelSizeAt(s.position)*Q);E(l,l,s.position);const u=i.projectToRenderScreen(l,a(X.get())),d=tt(i,u);Ce(i,u,_t),I(_t.direction,_t.direction);const m=X.get();!d&&V(r,_t,m)&&(l=m),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=P(l),d?e.state|=Ct:e.state&=~Ct}function tt(e,t){const[r,i,s,n]=e.viewport,o=Math.min(s,n)/16;let a=!0;return t[0]<r+o?(t[0]=r+o,a=!1):t[0]>r+s-o&&(t[0]=r+s-o,a=!1),t[1]<i+o?(t[1]=i+o,a=!1):t[1]>i+n-o&&(t[1]=i+n-o,a=!1),a}function rt(e,t,r,i){const s=R(i.basis1),n=R(i.basis2),o=ct(i),a=lt(i),c=M(X.get(),0,0,0);E(c,T(X.get(),i.basis1,t.direction[0]),T(X.get(),i.basis2,t.direction[1])),E(c,i.origin,c);let m=0,p=1;if(ut(t))1===t.direction[0]&&-1===t.direction[1]?m=Nt:1===t.direction[0]&&1===t.direction[1]?m=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(m=3*Math.PI/2),p=a;else{const e=0!==t.direction[0]?1:2;m=1===e?Nt:0,p=(1===e?n:s)-o}const g=l(Y.get(),m);u(g,g,M(X.get(),p,p,p)),d(g,r,g),g[12]=0,g[13]=0,g[14]=0,e.modelTransform=g,e.renderLocation=c}function it(e,t,r,i){const s=i.worldUpAtPosition(r.origin,X.get()),n=ot(r,nt.POSITIVE_X),o=l(Y.get(),n.edge*Math.PI/2);m(o,o,-It(r,s)),d(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=n.position}function st(e,t,r){const i=ot(r,nt.POSITIVE_Y),s=l(Y.get(),i.edge*Math.PI/2);m(s,s,Nt),d(s,t,s),s[12]=0,s[13]=0,s[14]=0,e.modelTransform=s,e.renderLocation=i.position}var nt;function ot(e,t){switch(t){case nt.POSITIVE_X:return{basis:e.basis1,direction:1,position:E(X.get(),e.origin,e.basis1),edge:t};case nt.POSITIVE_Y:return{basis:e.basis2,direction:1,position:E(X.get(),e.origin,e.basis2),edge:t};case nt.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:j(X.get(),e.origin,e.basis1),edge:t};case nt.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:j(X.get(),e.origin,e.basis2),edge:t}}}function at(e,t,r){const i=r.projectToRenderScreen(E(X.get(),e,t),a(X.get())),s=r.projectToRenderScreen(j(X.get(),e,t),a(X.get()));return A(j(i,i,s))}function ct(e){const t=R(e.basis1),r=R(e.basis2);return W*Math.min(t,r)}function lt(e){return ct(e)}function ut(e){return 0!==e.direction[0]&&0!==e.direction[1]}function dt(e,t=St.CENTER_ON_ARROW){const r=t===St.CENTER_ON_CALLOUT?Q:0,i=[v(r,0,-Oe/2),v(r,0,Oe/2)],s=Tt(i,!0),n=(e,t)=>bt(i,i,{tubeRadius:we,tipRadius:B,tipLength:Ie,tubeFocusMultiplier:Ee,tipFocusMultiplier:Re,padding:e,bothEnds:!0,flat:null,focusTipLength:!0,addCap:t}),o=n(0,!1),a=n(ee,!0),c=new xe({color:te,cullFace:_e.Back,renderOccluded:Ve.Opaque}),l=new xe({color:re,cullFace:_e.Back,renderOccluded:Ve.Opaque}),u=new xe({color:ie,cullFace:_e.Back,renderOccluded:Ve.Opaque}),d=new xe({color:se,transparent:!0,writeDepth:!1,cullFace:_e.Front,renderOccluded:Ve.Transparent}),m=Ue.createPolylineGeometry([[r,0,0],[r-Q,0,0]]),p=Ue.createPolylineGeometry([[r,0,0],[r-Q,0,0]]),g=new Fe({color:ne,renderOccluded:Ve.OccludeAndTransparent});return new Me({view:e,renderObjects:[...o.normal.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:ze.Unfocused|Pt}))),...a.normal.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:ze.Unfocused|Pt}))),{geometry:m,material:g,stateMask:ze.Unfocused|Pt|Ct},...o.focused.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:ze.Focused|Pt}))),...a.focused.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:ze.Focused|Pt}))),{geometry:p,material:g,stateMask:ze.Focused|Pt|Ct}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[s]},collisionPriority:1,radius:B,state:Pt})}function mt(e,t){const r=new Ge({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:Ve.Opaque}),i=oe,s=ae,n=s*be,o=e=>{const t=new Uint32Array([0,1,2,2,3,0]);return new Ne([[Se.POSITION,{size:3,data:[i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],exclusive:!0}],[Se.UV0,{size:2,data:[0,0,1,0,1,1,0,1]}]],[[Se.POSITION,t],[Se.UV0,t]])},a=Ue.createPolylineGeometry([[0,0,0],[i-s,0,0]]),c=Ue.createPolylineGeometry([[0,0,0],[i-n,0,0]]),l=new Fe({color:ce,renderOccluded:Ve.OccludeAndTransparent}),u=[{geometry:o(s),material:r,stateMask:ze.Unfocused|Pt},{geometry:a,material:l,stateMask:ze.Unfocused|Pt},{geometry:o(n),material:r,stateMask:ze.Focused|Pt},{geometry:c,material:l,stateMask:ze.Focused|Pt}];return new Me({view:e,renderObjects:u,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},collisionPriority:1,radius:s/2,state:Pt})}function pt(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new Pe({view:e,attached:!0,color:le,width:ue,writeDepthEnabled:!1,renderOccluded:Ve.OccludeAndTransparent,geometry:[t]})}function gt(e){return new ke({view:e,attached:!0,backgroundColor:[...de],gridColor:me,gridWidth:4,renderOccluded:Ve.OccludeAndTransparent})}function ft(e,t){const r=ut(t),i=r?[v(1,0,0),v(0,0,0),v(0,1,0)]:[v(1,0,0),v(-1,0,0)],s=Ue.createPolylineGeometry(i),n=he,o=e=>new He({color:n,width:e,renderOccluded:Ve.OccludeAndTransparent}),a=()=>new Fe({color:n,renderOccluded:Ve.OccludeAndTransparent}),c=r?je:ye,l=c*Te,u=ye,d=e=>e>1?o(e):a(),m=[{geometry:s,material:d(c),stateMask:ze.Unfocused|Ut},{geometry:s,material:d(l),stateMask:ze.Focused|Ut},{geometry:s,material:d(u),stateMask:Vt}],p=new Me({view:e,renderObjects:m,collisionType:{type:"line",paths:[i]},autoScaleRenderObjects:!1,worldSized:!0,radius:r?pe:ge});return p.state=Ut,p}function bt(e,t,r){const i=i=>{const s=(i?t:e).slice(0),n=j(X.get(),s[0],s[1]);I(n,n);const a=j(X.get(),s[s.length-1],s[s.length-2]);if(I(a,a),r.padding>0){const e=T(k(),a,-r.padding);if(s[s.length-1]=E(e,e,s[s.length-1]),r.bothEnds){const e=T(k(),n,-r.padding);s[0]=E(e,e,s[0])}}const c=i?r.tipFocusMultiplier:1,l=r.tipLength*(r.focusTipLength?c:1),m=r.tipRadius*c,y=p(Y.get());if(r.padding>0){const e=l/4,t=M(X.get(),0,e,0),i=1+r.padding/e;g(y,y,t),u(y,y,M(X.get(),i,i,i)),g(y,y,T(t,t,-1/i))}const O=p(b()),w=v(0,1,0),R=f(b(),h(Z.get(),w,a));R[12]=s[s.length-1][0],R[13]=s[s.length-1][1],R[14]=s[s.length-1][2],d(R,R,y);const A=[{part:"tube",geometry:ht(r.tubeRadius*(i?r.tubeFocusMultiplier:1)+r.padding,r.flat,s),transform:O}];let L,P;if(o(r.flat)?L=Ue.createExtrudedTriangle(l,m,m,r.flat.thickness):(L=Ue.createConeGeometry(l,m,24,!1,!1,!0),P=Ue.createConeGeometry(l,m,24,!1,!0,!1)),A.push({part:"tip",geometry:L,transform:R}),P&&A.push({part:"cap",geometry:P,transform:R}),r.bothEnds){const e=f(b(),h(Z.get(),w,n));e[12]=s[0][0],e[13]=s[0][1],e[14]=s[0][2],d(e,e,y),A.push({part:"tip",geometry:L,transform:e}),P&&A.push({part:"cap",geometry:P,transform:e})}return A};return{normal:i(!1),focused:i(!0)}}function ht(e,t,r){const i=[];if(o(t))i.push([e,t.thickness/2],[-e,t.thickness/2],[-e,-t.thickness/2],[e,-t.thickness/2]);else{const t=12;for(let r=0;r<t;r++){const s=r/t*2*Math.PI;i.push([Math.cos(s)*e,Math.sin(s)*e])}}return Ue.createPathExtrusionGeometry(i,r,[],[],!1)}function Tt(e,t){const r=j(k(),e[e.length-1],e[e.length-2]);if(I(r,r),T(r,r,fe),E(r,r,e[e.length-1]),t){const t=j(k(),e[0],e[1]);return I(t,t),T(t,t,fe),E(t,t,e[0]),[t,...e,r]}return[...e,r]}function yt(t,r,s,o=new e){if(n(t))return null;const{renderCoordsHelper:a}=r,c=a.fromRenderCoords(t.origin,r.spatialReference);if(n(c))return null;const l=C(c,s);if(n(l))return null;o.position=l;const u=a.worldUpAtPosition(t.origin,X.get()),d=a.worldBasisAtPosition(t.origin,_.Y,X.get()),m=2*R(t.basis1),p=2*R(t.basis2),g=ve.renderUnitScaleFactor(r.spatialReference,s);return o.width=m*g,o.height=p*g,o.tilt=i(It(t,u)),o.heading=i(Et(t,u,d)),o}function Ot(e,t,r){if(n(e)||n(e.position))return null;const{spatialReference:i}=e.position,s=wt(At(e,{renderCoordsHelper:t,spatialReference:i},r),t,i);return!e.position.hasZ&&o(s)&&(s.zmin=null,s.zmax=null),s}function wt(e,t,r){if(n(e))return null;const i=e.origin,s=X.get(),o=X.get(),a=X.get(),c=X.get();let l,u,d,m,p,g;E(s,i,e.basis1),E(s,s,e.basis2),E(o,i,e.basis1),L(o,o,e.basis2),L(a,i,e.basis1),L(a,a,e.basis2),L(c,i,e.basis1),E(c,c,e.basis2);for(const f of[s,o,a,c]){const e=t.fromRenderCoords(f,f,r);if(n(e))return null;l=null==l?e[0]:Math.min(l,e[0]),u=null==u?e[0]:Math.max(u,e[0]),d=null==d?e[1]:Math.min(d,e[1]),m=null==m?e[1]:Math.max(m,e[1]),p=null==p?e[2]:Math.min(p,e[2]),g=null==g?e[2]:Math.max(g,e[2])}return new Xe({xmin:l,xmax:u,ymin:d,ymax:m,zmin:p,zmax:g,spatialReference:r})}function It(e,t){return z(t,e.basis2,e.basis1)+Nt}function Et(e,t,r){return z(e.basis1,r,t)-Nt}function Rt(e,t,r,i,n,o,a=S()){return o.toRenderCoords(e,a.origin)?(o.worldBasisAtPosition(a.origin,_.X,a.basis1),o.worldBasisAtPosition(a.origin,_.Y,a.basis2),H(a.basis2,a.basis1,a.origin,a.plane),N(a,-s(t),x(a),a),N(a,s(r),a.basis1,a),T(a.basis1,a.basis1,i/2),T(a.basis2,a.basis2,n/2),G(a),a):(Ye.error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function jt(e,t){if(n(e)||n(e.position))return null;const r=Ae(e.position,t.spatialReference,t.elevationProvider);if(n(r))return null;const i=ve.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),s=e.width*i,o=e.height*i;return{position:r,heading:e.heading,tilt:e.tilt,renderWidth:s,renderHeight:o}}function At(e,t,r,i=S()){const s=jt(e,t);return n(s)?null:Mt(s,t,r,i)}function Mt(e,t,r,i=S()){if(n(e))return null;const s=Rt(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,i);return!r.tiltEnabled&&o(s)&&We(s,t.renderCoordsHelper,s),s}function Lt(e){switch(e.type){case"analysis":case"building-scene":case"csv":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"map-notes":case"ogc-feature":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"media":case"open-street-map":case"tile":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return t(e.type),!1}}!function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"}(nt||(nt={}));const Pt=De.Custom1;var kt,vt;!function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"}(kt||(kt={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(vt||(vt={}));const Ct=De.Custom2,_t=D(),Nt=Math.PI/2,Ut=De.Custom1,Vt=De.Custom2;var St;function xt(e){const t="building-scene-3d"===e.type?e:null;return o(t)}!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(St||(St={}));export{Pt as DidPointerMoveRecentlyFlag,Ct as IsShiftEdgeOnScreenFlag,St as OffsetMode,kt as RotationAxis,vt as SliceOrientation,Tt as addArrowTips,Ke as calculateBoundedPlaneTranslateRotate,lt as calculateDiagonalResizeHandleScale,$e as calculatePlaneHalfSize,ct as calculateResizeHandlePadding,at as calculateScreenSpaceBasisLength2,bt as createArrowGeometry,gt as createGridVisualElement,pt as createOutlineVisualElement,Ze as createPlane,ft as createResizeManipulator,mt as createRotateManipulator,Qe as createRotatePlane,dt as createShiftManipulator,Je as createShiftPlane,We as forceHorizontalOrVertical,Lt as isAlwaysDrapedLayer,ut as isDiagonalResizeHandle,xt as isIBuildingSceneLayerView3D,Be as normalToBases,wt as planeToExtent,yt as planeToShape,jt as projectAndElevationAlignShape,Mt as projectedShapeToPlane,Ut as resizeNormal,Vt as resizeOutlineOnly,qe as resizePlane,Ot as shapeToExtent,At as shapeToPlane,rt as updateResizeHandle,it as updateRotateHeadingHandle,st as updateRotateTiltHandle,et as updateShiftRestartHandle};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{c as r}from"../../../chunks/vec3f64.js";import{LabelVisualElement as s}from"./visualElements/LabelVisualElement.js";import{EuclideanSegment as o}from"./visualElements/support/Segment.js";import{SegmentLabels as i}from"../../interactive/SegmentLabels.js";import{anyMapPointToRender as n,screenDistanceSquared as a}from"../../interactive/support/viewUtils.js";let c=class extends i{createLabel({view:e}){return new s({view:e,attached:!0,fontSize:12,distance:10})}positionLabel(e,t,r,s){const i=m(e,r),n=m(e,s);t.geometry={type:"segment",segment:new o(i,n),sampleLocation:"center",callout:!1}}screenDistanceSquared(e,t,r){const s=m(e,t,p),o=m(e,r,l);return a(s,o,e.view)}};function m(e,t,s=r()){const o=e.editGeometryOperations.data.coordinateHelper;return n(t,o,e.elevationInfo,e.view,s)}c=e([t("esri.views.3d.interactive.SegmentLabels3D")],c);const p=r(),l=r();export{c as SegmentLabels3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Color.js";import"../../../core/has.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{unwrapOr as t}from"../../../core/maybe.js";import{h as i}from"../../../chunks/vec3.js";import{c as o}from"../../../chunks/vec3f64.js";import{ExtendedLineVisualElement as r,ExtensionType as a}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as l}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as s}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as c}from"./visualElements/RightAngleQuadVisualElement.js";import{RenderOccludedFlag as d}from"../webgl-engine/lib/Material.js";import{defaults as p}from"../../interactive/snapping/Settings.js";import{
|
|
5
|
+
import e from"../../../Color.js";import"../../../core/has.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{unwrapOr as t}from"../../../core/maybe.js";import{h as i}from"../../../chunks/vec3.js";import{c as o}from"../../../chunks/vec3f64.js";import{ExtendedLineVisualElement as r,ExtensionType as a}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as l}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as s}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as c}from"./visualElements/RightAngleQuadVisualElement.js";import{RenderOccludedFlag as d}from"../webgl-engine/lib/Material.js";import{defaults as p}from"../../interactive/snapping/Settings.js";import{LineSegmentHintType as m}from"../../interactive/snapping/snappingUtils.js";import{SnappingVisualizer as v}from"../../interactive/snapping/SnappingVisualizer.js";import{anyMapPointToRender as u,anyMapPointsToRenderWithEqualRelativeZ as f}from"../../interactive/support/viewUtils.js";class g extends v{visualizeIntersectionPoint(i,o){const{coordinateHelper:r,view:a}=o;return n(new s({view:a,primitive:"circle",geometry:r.vectorToPoint(i.intersectionPoint),elevationInfo:t(i.elevationInfo,o.elevationInfo),size:20,outlineSize:2,color:[0,0,0,0],outlineColor:e.toUnitRGBA(p.orange),pixelSnappingEnabled:!1}))}visualizePoint(i,o){const{coordinateHelper:r,view:a}=o;return n(new s({view:a,primitive:"circle",geometry:r.vectorToPoint(i.point),elevationInfo:t(i.elevationInfo,o.elevationInfo),size:20,outlineSize:2,color:[0,0,0,0],outlineColor:e.toUnitRGBA(p.orange),pixelSnappingEnabled:!1}))}visualizeLine(e,i){const{coordinateHelper:o,view:r}=i;return n(this._createLineSegmentHintFromMap(e.type,e.lineStart,e.lineEnd,o,t(e.elevationInfo,i.elevationInfo),r,e.fadeLeft,e.fadeRight))}visualizeParallelSign(o,r){const{coordinateHelper:a,view:s}=r,c=t(o.elevationInfo,r.elevationInfo),m=u(o.lineStart,a,c,r.view),v=u(o.lineEnd,a,c,r.view),f=i(v,m,v,.5),g=new l({view:s,attached:!1,offset:p.parallelLineHintOffset,length:p.parallelLineHintLength,width:p.parallelLineHintWidth,color:e.toUnitRGBA(p.orange),location:f,renderOccluded:d.Opaque});return g.setDirectionFromPoints(m,f),g.attached=!0,n(g)}visualizeRightAngleQuad(i,o){const{coordinateHelper:r,view:a}=o,l=t(i.elevationInfo,o.elevationInfo);return n(new c({view:a,attached:!0,color:e.toUnitRGBA(p.orange),renderOccluded:d.Transparent,outlineRenderOccluded:d.Opaque,outlineColor:e.toUnitRGBA(p.orange),outlineSize:p.rightAngleHintOutlineSize,size:p.rightAngleHintSize,geometry:{previous:u(i.previousVertex,r,l,a),center:u(i.centerVertex,r,l,a),next:u(i.nextVertex,r,l,a)}}))}_createLineSegmentHintFromMap(e,n,t,i,r,a,l=!0,s=!0){const c=o(),d=o();return f(n,t,i,r,a,c,d),this._createLineSegmentHint(e,a,c,d,l,s)}_createLineSegmentHint(n,t,i,o,l=!0,s=!0){const c=new r({view:t,extensionType:a.FADED,start:i,end:o,color:e.toUnitRGBA(p.orange),renderOccluded:d.Opaque});switch(n){case m.TARGET:c.width=p.lineHintWidthTarget,c.fadedExtensions={start:0,end:p.lineHintFadedExtensions};break;case m.REFERENCE_EXTENSION:c.width=p.lineHintWidthReference,c.fadedExtensions={start:0,end:0};break;case m.REFERENCE:c.width=p.lineHintWidthReference,c.fadedExtensions={start:l?p.lineHintFadedExtensions:0,end:s?p.lineHintFadedExtensions:0}}return c.attached=!0,c}}export{g as SnappingVisualizer3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{isSome as s,destroyMaybe as r,applySome as a}from"../../../../../core/maybe.js";import{watch as n,initial as
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{isSome as s,destroyMaybe as r,applySome as a}from"../../../../../core/maybe.js";import{watch as n,initial as o}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{getEffectiveElevationMode as p}from"../../../../../support/elevationInfoUtils.js";import h from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as u}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{settings as v}from"../settings.js";import{OutlineVisualElement as d}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as f}from"../../visualElements/VerticesVisualElement.js";import{GraphicState as V}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as w,geometryTypeToDrawOperationGeometryType as y}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as E}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as _,ElevationDrawSurface as g}from"../../../../draw/drawSurfaces.js";let j=class extends w{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new h({mode:e,offset:t})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:{mode:t?"absolute-height":"on-the-ground",offset:0}}}return e}initializeGraphic(e){const i=this._createGraphicState=new V({graphic:e});return t([this.view.maskOccludee(e),this.view.trackGraphicState(i),n((()=>({element:this._outlineVisualElement,isDraped:i.isDraped})),(({element:e,isDraped:t})=>{a(e,(e=>e.isDraped=t))}),o)])}makeDrawOperation(){return new E({view:this.view,manipulators:this.manipulators,geometryType:y(this.geometryType),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new _(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new g(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new m,segmentLabels:new u,tooltipOptions:this.tooltipOptions})}onActiveVertexChanged(e){return s(this._activeVertexVisualElement)?(this._activeVertexVisualElement.vertices=[e],null):(this._activeVertexVisualElement=new f({view:this.view,spatialReference:this.view.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,renderOccluded:v.reshapeManipulators.vertex.renderOccluded,attached:!1}),this._activeVertexVisualElement.color=v.colorToVec4(v.reshapeManipulators.selected.color),this._activeVertexVisualElement.attached=!0,i((()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement)})))}onOutlineChanged(e){if(s(this._outlineVisualElement))return this._outlineVisualElement.geometry=e,null;const t=this.internalGraphicsLayer.elevationInfo;return this._outlineVisualElement=new d({view:this.view,geometry:e,elevationInfo:t,isDraped:s(this._createGraphicState)?this._createGraphicState.isDraped:"on-the-ground"===p(this.hasZ,t),attached:!1}),v.visualElements.lineGraphics.outline.apply(this._outlineVisualElement),v.visualElements.lineGraphics.shadowStyle.apply(this._outlineVisualElement),this._outlineVisualElement.attached=!0,this._outlineVisualElement.laserlineEnabled=!0,i((()=>{this._outlineVisualElement=r(this._outlineVisualElement)}))}onRegularVerticesChanged(e){return s(this._verticesVisualElement)?(this._verticesVisualElement.vertices=e,null):(this._verticesVisualElement=new f({view:this.view,spatialReference:this.view.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,renderOccluded:v.reshapeManipulators.vertex.renderOccluded,attached:!1}),this._verticesVisualElement.attached=!0,i((()=>{this._verticesVisualElement=r(this._verticesVisualElement)})))}};e([l({constructOnly:!0})],j.prototype,"elevationInfo",void 0),e([l({constructOnly:!0})],j.prototype,"geometryType",void 0),e([l({constructOnly:!0})],j.prototype,"tooltipOptions",void 0),e([l()],j.prototype,"type",void 0),e([l({constructOnly:!0})],j.prototype,"view",void 0),j=e([c("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],j);export{j as DrawGraphicTool3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{destroyMaybe as r,isSome as i,isNone as a}from"../../../../../core/maybe.js";import{watch as n,sync as p,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{SupportedGraphicResult as c}from"../isSupportedGraphicUtils.js";import{geometryOfSupportedGraphic as d,isSupportedGraphic as m}from"./isSupportedGraphic.js";import{ReshapeOperation as u}from"./ReshapeOperation.js";import{InteractiveToolBase as y}from"../../../../interactive/InteractiveToolBase.js";let _=class extends(t.EventedMixin(y)){constructor(e){super(e),this._handles=new o,this._reshapeOperation=null,this._internalGeometryUpdate=!1,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveGraphic=!0,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.snappingManager=null,this.tooltipOptions=null,this.automaticManipulatorSelection=!1}destroy(){this._handles=r(this._handles),this._reshapeOperation=r(this._reshapeOperation),this._set("view",null),this._set("graphic",null)}get updating(){return this._reshapeOperation?.updating??!1}_updateGeometry(){const e=d(this.graphic);this._reshapeOperation.inputGeometry=i(e)?e.clone():null}_updateGraphic(){if(this._handles.remove("onGraphicGeometryChange"),this._updateGeometry(),m(this.graphic)!==c.SUPPORTED)return;const e=n((()=>this.graphic?.geometry),(()=>{!1===this._internalGeometryUpdate&&this._updateGeometry()}),p);this._handles.add(e,"onGraphicGeometryChange")}manipulatorSelectionChanged(){this._reshapeOperation&&this._reshapeOperation.manipulatorSelectionChanged()}_updateGeometryInternally(e){this._internalGeometryUpdate=!0,this.graphic.geometry=e,this._internalGeometryUpdate=!1}_onReshapeGeometryChanged(){a(this.graphic)||this._updateGeometryInternally(this._reshapeOperation.outputGeometry.clone())}initialize(){this._reshapeOperation=new u({tool:this,tooltipOptions:this.tooltipOptions}),this._handles.add([this._reshapeOperation.on("reshape",(e=>{"reshape"===e.type&&this._onReshapeGeometryChanged(),this.emit("reshape",e)})),this._reshapeOperation.on("move",(e=>{"move"===e.type&&this._onReshapeGeometryChanged(),this.emit("move",e)})),this._reshapeOperation.on("vertex-add",(e=>{this._onReshapeGeometryChanged(),this.emit("vertex-add",e)})),this._reshapeOperation.on("vertex-remove",(e=>{this._onReshapeGeometryChanged(),this.emit("vertex-remove",e)})),this._reshapeOperation.on("immediate-click",(e=>this.emit("immediate-click",e))),this.view.on("pointer-down",["Shift"],(e=>{e.stopPropagation()})),n((()=>this.graphic),(()=>this._updateGraphic()),s)]),this.finishToolCreation()}get canUndo(){return this._reshapeOperation?.canUndo??!1}undo(){i(this.snappingManager)&&this.snappingManager.doneSnapping(),i(this._reshapeOperation.undo())&&this._updateGeometryInternally(this._reshapeOperation.outputGeometry.clone())}get canRedo(){return this._reshapeOperation?.canRedo??!1}redo(){i(this.snappingManager)&&this.snappingManager.doneSnapping(),i(this._reshapeOperation.redo())&&this._updateGeometryInternally(this._reshapeOperation.outputGeometry.clone())}onInputEvent(e){"key-down"!==e.type||"Delete"!==e.key&&"Backspace"!==e.key||this._reshapeOperation.removeSelectedVertices()}reset(){}get test(){return{snappingManager:this.snappingManager,reshapeOperation:this._reshapeOperation}}};e([h()],_.prototype,"_reshapeOperation",void 0),e([h({constructOnly:!0,nonNullable:!0})],_.prototype,"view",void 0),e([h({constructOnly:!0})],_.prototype,"graphic",void 0),e([h({constructOnly:!0,nonNullable:!0})],_.prototype,"enableZShape",void 0),e([h({constructOnly:!0,nonNullable:!0})],_.prototype,"enableZVertex",void 0),e([h({constructOnly:!0,nonNullable:!0})],_.prototype,"enableMoveGraphic",void 0),e([h({constructOnly:!0,nonNullable:!0})],_.prototype,"enableMidpoints",void 0),e([h({constructOnly:!0,nonNullable:!0})],_.prototype,"enableEdgeOffset",void 0),e([h({readOnly:!0})],_.prototype,"type",void 0),e([h({constructOnly:!0})],_.prototype,"snappingManager",void 0),e([h({constructOnly:!0})],_.prototype,"tooltipOptions",void 0),e([h({readOnly:!0})],_.prototype,"updating",null),e([h()],_.prototype,"automaticManipulatorSelection",void 0),_=e([l("esri.views.3d.interactive.editingTools.graphicReshape3D.GraphicReshapeTool")],_);export{_ as GraphicReshapeTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import t from"../../../../../core/Evented.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import a from"../../../../../core/Handles.js";import{handlesGroup as n,destroyHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as o,isSome as s,isNone as l,unwrap as p,removeMaybe as h}from"../../../../../core/maybe.js";import{watch as d,initial as u}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{I as g}from"../../../../../chunks/mat4f64.js";import{l as _,b as f,h as v,s as M,a as y,g as x}from"../../../../../chunks/vec3.js";import{f as O,c as E}from"../../../../../chunks/vec3f64.js";import G from"../../../../../geometry/Polyline.js";import{makeDehydratedPoint as b}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as S}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as I}from"../../../../../symbols/support/utils.js";import{Manipulator3D as V}from"../../Manipulator3D.js";import{createManipulatorMaterial as H,createManipulatorOutlineMaterial as A,placeAtGraphic as w}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as P}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as D,convertToMapCoordinates as L,screenToMapXYAtLocation as N,screenToMapXYForGraphicAtLocation as U}from"../dragEventPipeline3D.js";import{ManipulatorType as k}from"../ManipulatorType.js";import{canMoveZ as j}from"../manipulatorUtils.js";import{settings as T,colors as R}from"../settings.js";import{createVisualElements as F}from"../visualElementUtils.js";import{DISC_RADIUS_SMALL as C}from"../manipulations/config.js";import{MoveManipulation as z}from"../manipulations/MoveManipulation.js";import{shapeOrientation as Z}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as X}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as Y,createEdgeOffsetOperation as q,edgeOffsetRotationMatrix as W,screenEdgeLengthSquared as K}from"./edgeOffsetUtils.js";import{OutlineVisualElement as B}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as J}from"../../../layers/graphics/GraphicState.js";import Q from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as $}from"../../../../input/IViewEvents.js";import{addMapDelta as ee,createManipulatorDragEventPipeline as te,dragAtLocation as ie,addScreenDelta as ae}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ne,ManipulatorStateCustomFlags as re}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as oe}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as se}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as le}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as pe}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";let he=class extends(t.EventedMixin(i)){constructor(e){super(e),this._vertexManipulatorMaterial=H(T.colorToVec4(T.reshapeManipulators.vertex.color),T.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorOutlineMaterial=A(T.colorToVec4(T.reshapeManipulators.vertex.outlineColor),T.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=A(T.colorToVec4(T.reshapeManipulators.vertex.hoverOutlineColor),T.reshapeManipulators.vertex.renderOccluded),this._edgeManipulatorMaterial=H(T.colorToVec4(T.reshapeManipulators.edge.color),T.reshapeManipulators.edge.renderOccluded),this._edgeManipulatorOutlineMaterial=A(T.colorToVec4(T.reshapeManipulators.edge.outlineColor),T.reshapeManipulators.edge.renderOccluded),this._edgeOffsetManipulatorMaterial=H(T.colorToVec4(T.reshapeManipulators.edgeOffset.color),T.reshapeManipulators.edgeOffset.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=H(T.colorToVec4(T.reshapeManipulators.edgeOffset.hoverColor),T.reshapeManipulators.edgeOffset.renderOccluded,!1),this._selectedManipulatorMaterial=H(T.colorToVec4(T.reshapeManipulators.selected.color),T.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorOutlineMaterial=A(T.colorToVec4(T.reshapeManipulators.selected.outlineColor),T.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=A(T.colorToVec4(T.reshapeManipulators.selected.hoverOutlineColor),T.reshapeManipulators.selected.renderOccluded),this._selectedIndex=0,this._vertexManipulatorGeometry=null,this._vertexManipulatorOutlineGeometry=null,this._edgeManipulatorGeometry=null,this._edgeManipulatorOutlineGeometry=null,this._edgeOffsetManipulatorGeometryInside=null,this._edgeOffsetManipulatorGeometryOutside=null,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._editGeometryOperations=null,this._graphicMoveManipulation=null,this._moveManipulation=null,this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=fe.NONE,this._outlineVisualElement=null,this.tool=null,this.outputGeometry=null,this._snappingPipeline=new pe,this._snappingPipelineHandle=new pe,this._vertexLaserLineVisualElement=null}initialize(){const e=new J({graphic:this.graphic});this._graphicState=e,this.handles.add([d((()=>e.displaying),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e})),this.view.trackGraphicState(e)])}destroy(){this._editGeometryOperations=o(this._editGeometryOperations),this._moveManipulation=o(this._moveManipulation),this._graphicMoveManipulation=o(this._graphicMoveManipulation),this._manipulatorHandles=o(this._manipulatorHandles),this.manipulators.removeAll(),this._manipulatorInfos=[],this._resetGrabbingDragging()}get inputGeometry(){return s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null}set inputGeometry(e){this._recreateEditGeometryAndManipulators(e)}get updating(){return this.updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.handle.type));this._removeVertices(e)}manipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._moveManipulation=o(this._moveManipulation),this._graphicMoveManipulation=o(this._graphicMoveManipulation),this._manipulatorHandles.removeAll(),this.manipulators.removeAll(),this._manipulatorInfos=[]}_resetGrabbingDragging(){this._numGrabbing=0,this._numDragging=0}_createManipulators(){if(l(this._editGeometryOperations))return;const e=S(this.graphic);for(const t of this._editGeometryOperations.data.components){for(const i of t.vertices)this._createVertexOrEdgeManipulator(i,e);for(const i of t.edges)this._createVertexOrEdgeManipulator(i,e)}this._createGraphicMoveManipulators(e)}get canRedo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canRedo}get canUndo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canUndo}redo(){if(l(this._editGeometryOperations))return null;const e=this._editGeometryOperations.redo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}undo(){if(l(this._editGeometryOperations))return null;this.emit("undo");const e=this._editGeometryOperations.undo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}_recreateManipulators(){this._removeManipulators(),this._resetGrabbingDragging(),this._createManipulators()}_recreateEditGeometryAndManipulators(e=this.inputGeometry){this._removeManipulators(),this._resetGrabbingDragging(),l(e)||(o(this._editGeometryOperations),this._editGeometryOperations=oe.fromGeometry(e,this.view.state.viewingMode),this._createManipulators())}_perGraphicManipulatorDragAction(e,t){if("end"===t.action)return;let i=0;const a=[],n=this._manipulatorInfos.some((e=>"vertex"===e.handle.type&&e.manipulator.selected)),r=e===ve.SELECTED_OR_ALL&&n;for(const o of this._manipulatorInfos)ue(o)&&(o.manipulator.grabbing||r&&!o.manipulator.selected||a.push(o),i++);if(0===a.length)return;this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(fe.MOVING),this.destroyed)return;this.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(fe.RESHAPING),this.destroyed)return;this.emit("reshape",{type:"reshape",mover:this.graphic})}}_isMultiVertexSelection(){let e=0;for(const t of this._manipulatorInfos)ue(t)&&t.manipulator.selected&&e++;return e>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(fe.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const r of this._manipulatorInfos)ue(r)&&(r.manipulator.selected&&!r.manipulator.grabbing||r===e.info)&&n.push(r);this._moveVertices(n,e,se.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case fe.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case fe.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case fe.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case fe.MOVING:switch(this._reshapeEventState){case fe.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case fe.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case fe.RESHAPING:switch(this._reshapeEventState){case fe.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case fe.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createGraphicMoveManipulators(e){if(this._graphicMoveManipulation=new X({tool:this.tool,view:this.view,graphicState:this._graphicState}),this.enableMoveGraphic){let e=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=p(this._editGeometryOperations).createUndoGroup()),t))).next((t=>{this._perGraphicManipulatorDragAction(ve.ALL,t),"end"===t.action&&(e=h(e))})),a.next(this._cancelDragOperation((()=>e=h(e))))})))}else this._graphicMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._graphicMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()}))]))),this._moveManipulation=new z({tool:this.tool,view:this.view,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&j(this.graphic),snapToScene:!1,radius:z.radiusForSymbol(this.graphic.symbol)}),this._moveManipulation.forEachManipulator((e=>{this.handles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()}))])})),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const t=p(this.graphic.geometry).spatialReference,i=this.handles;i.add([this._moveManipulation.createDragPipeline(((t,i,a,n,r)=>{const o=a.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>ue(e)&&e.manipulator.selected));return e.manipulatorType===k.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:{...e,info:null}})).next(this._snappingPipelineHandle.createSnapDragEventPipelineStep({predicate:e=>!!e.info,cancel:n,snappingManager:this.tool.snappingManager,snappingContext:new le({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:e,pointer:r,excludeFeature:this.graphic,visualizer:new P}),updatingHandles:this.updatingHandles}),this._snappingPipelineHandle.next).next(ee()).next((e=>(this._perGraphicManipulatorDragAction(ve.SELECTED_OR_ALL,e),e)));return n.next(this._cancelDragOperation()),o}),e,t,this.graphic),d((()=>this._graphicState?.displaying),(()=>{this._updateMoveManipulationPosition()}),u),this._graphicState.on("changed",(()=>this._updateMoveManipulationPosition())),d((()=>this._graphicState?.isDraped),(e=>{const t="align-move-manipulation";e?i.add(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):i.remove(t)}),u)]),this._updateMoveManipulationPosition();const a=F({view:this.view,graphic:this.graphic,forEachManipulator:e=>{if(!this.destroyed){s(this._graphicMoveManipulation)&&this._graphicMoveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,k.TRANSLATE_XY);this._moveManipulation.forEachManipulator(e)}},onManipulatorsChanged:e=>this.on("manipulators-changed",e)});s(a)&&(this._outlineVisualElement=a.visualElement instanceof B?a.visualElement:null),s(this._outlineVisualElement)&&this._manipulatorHandles.add([this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{this._graphicState.isDraped||this._updateMoveManipulationPosition()})),d((()=>this._graphicState.isDraped),(()=>this._updateMoveManipulationPosition()))]),this._manipulatorHandles.add(a)}_createEdgeOffsetManipulator(e,t=S(this.graphic)){const i=T.reshapeManipulators.edgeOffset,a=i.size/2,r=a+i.collisionPadding;if(l(this._edgeOffsetManipulatorGeometryInside)||l(this._edgeOffsetManipulatorGeometryOutside)){const e=a/r,t=e*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside=Q.createExtrudedTriangle(t,e/2,e/2,i.height,i.offset),this._edgeOffsetManipulatorGeometryOutside=Q.createExtrudedTriangle(-t,e/2,e/2,i.height,-i.offset)}const o=[{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorMaterial,stateMask:ne.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:ne.Focused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorMaterial,stateMask:ne.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:ne.Focused}],p=new V({view:this.view,renderObjects:o,elevationInfo:"on-the-ground"!==t.mode||I(this.graphic.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:r,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionType:{type:"disc",direction:O(0,0,1)},collisionPriority:1}),h=new V({view:this.view,renderObjects:[],worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default"}),d={manipulator:p,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const u=this._getManipulatorInfoFromHandle(d.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d))),c=this._getManipulatorInfoFromHandle(d.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d)));d.locationUpdateHandle=n([u,c]),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(te(p,this._createEdgeOffsetPipeline(d,t)),p),this._manipulatorHandles.add(te(h,((e,i,a,n)=>{if("touch"===n){this._createEdgeOffsetPipeline(d,t)(e,i,a)}else if(this.enableMoveGraphic){const n=this.graphic,r=s(n.geometry)?n.geometry.spatialReference:null;i.next((e=>this._trackNumDragging(e))).next(ie(this.view,e.elevationAlignedLocation)).next(N(this.view,e.elevationAlignedLocation,t,r,n)).next(ae()).next(ee()).next((e=>this._perGraphicManipulatorDragAction(ve.ALL,e))),a.next(this._cancelDragOperation())}})),p);const m=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",m),h.events.on("immediate-click",m)],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,r=()=>{h(e.visibilityHandle);const r=K(this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||r)&&(i.grabbable=!r,a.grabbable=!r,e.visibilityHandle=n([i.disableDisplay(),{remove:()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}}]))};this._manipulatorHandles.add([i.events.on("focus-changed",r),a.events.on("focus-changed",r),{remove:()=>{h(e.visibilityHandle),this.manipulators.remove(a)}}],i),r()}_updateEdgeOffsetManipulator(e){this._updateManipulatorPosition(e);const t=p(this._editGeometryOperations).data.coordinateHelper,i=Y(this.view,e.manipulator.elevationAlignedLocation,q(t,e.handle,p(e.manipulator.elevationInfo))),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,n=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,r=s(i)?W(i,a,n):g;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const o=_(f(ge,a,n))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-o,0,0],[o,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,n)=>{this._clearSelection();const{step:r,cleanup:o}=this._initializeEdgeOffset(e,t);a.next((e=>this._trackNumDragging(e))).next(ie(this.view,i.elevationAlignedLocation)).next(r).next(D(this.view)).next(L(this.view,p(this._editGeometryOperations).data.spatialReference)).next(ee()).next(this._applyEdgeOffsetStep(e)).next((e=>{"end"===e.action&&o()})),n.next((e=>(o(),e))).next(this._cancelDragOperation())}}_initializeEdgeOffset(e,t){const i=p(this._editGeometryOperations),a=q(i.data.coordinateHelper,e.handle,t),o=i.createUndoGroup(),s=Y(this.view,e.manipulator.elevationAlignedLocation,a);a.requiresSplitEdgeLeft&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge),1),a.requiresSplitEdgeRight&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge),0);const u=()=>new G({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:p(this._editGeometryOperations).data.spatialReference}),c=new B({view:this.view,isDraped:this._graphicState.isDraped,geometry:u(),elevationInfo:e.elevationInfo,width:T.visualElements.lineGraphics.outline.width,color:T.colorToVec4(R.main),attached:!0});let m;const g=()=>{this._cleanEdgeOffsetCollapsedEdges(e),m=h(m)},_=this.on("undo",g);return m=n([r(c),d((()=>this._graphicState.isDraped),(e=>c.isDraped=e)),this._graphicState.on("changed",(()=>c.geometry=u())),o,_]),{step:e=>l(a)||l(s)?(g(),null):{...e,operation:a,plane:s},cleanup:g}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||l(t.operation))return t;this._updateEventState(fe.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:n}=t;return(i||a||n)&&(this._offsetEdge(e,t),this.emit("reshape",{type:"reshape",mover:this.graphic})),t}}_cleanEdgeOffsetCollapsedEdges(e){const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,n=e.handle.rightVertex,r=p(this._editGeometryOperations).data.coordinateHelper,o=1e-6,s=[];t&&r.distance(t.pos,i.pos)<o&&s.push(this._getManipulatorInfoFromHandle(i)),(r.distance(i.pos,n.pos)<o||a&&r.distance(a.pos,n.pos)<o)&&s.push(this._getManipulatorInfoFromHandle(n)),s.length&&this._removeVertices(s)}_computeVertexManipulatorSizeAndOutline(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}_createVertexOrEdgeManipulator(e,t=S(this.graphic)){if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(l(this._vertexManipulatorGeometry)||l(this._vertexManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(T.reshapeManipulators.vertex);this._vertexManipulatorGeometry=Q.createSphereGeometry(e,16,16),this._vertexManipulatorOutlineGeometry=Q.createSphereGeometry(t,16,16)}if(l(this._edgeManipulatorGeometry)||l(this._edgeManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(T.reshapeManipulators.edge);this._edgeManipulatorGeometry=Q.createSphereGeometry(e,16,16),this._edgeManipulatorOutlineGeometry=Q.createSphereGeometry(t,16,16)}const i=s(this.graphic.geometry)&&"point"===this.graphic.geometry.type?[]:[{geometry:this._vertexManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:_e.Vertex|ne.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorOutlineMaterial,stateMask:_e.Vertex|ne.Unfocused|ne.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:_e.Vertex|ne.Focused|ne.Unselected},{geometry:this._vertexManipulatorGeometry,material:this._selectedManipulatorMaterial,stateMask:ne.Selected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorOutlineMaterial,stateMask:ne.Selected|ne.Unfocused},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorHoverOutlineMaterial,stateMask:ne.Selected|ne.Focused}];this.enableMidpoints&&i.push({geometry:this._edgeManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:_e.Edge|ne.Focused|ne.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:_e.Edge|ne.Focused|ne.Unselected},{geometry:this._edgeManipulatorGeometry,material:this._edgeManipulatorMaterial,stateMask:_e.Edge|ne.Unfocused|ne.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._edgeManipulatorOutlineMaterial,stateMask:_e.Edge|ne.Unfocused|ne.Unselected});const a=new V({view:this.view,renderObjects:i,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer.visible)});this._setTypeSpecificManipulatorSettings(a,e,t);const r="edge"===e.type?{manipulator:a,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:a,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(r),this.manipulators.add(a),this._updateManipulatorPosition(r),"edge"===r.type){const e=this._getManipulatorInfoFromHandle(r.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(r))),t=this._getManipulatorInfoFromHandle(r.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(r)));r.locationUpdateHandle=n([e,t]),this._manipulatorHandles.add(r.locationUpdateHandle,a)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(a,!0),a);const o=te(a,((e,i,a,n)=>{let o=null;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&(o=p(this._editGeometryOperations).createUndoGroup()),ce(r)){const t=this._splitEdgeManipulator(r);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:r,snapOrigin:r.handle.pos}})).next(ie(this.view,e.elevationAlignedLocation)).next(U(this.view,this.graphic,e.elevationAlignedLocation,e.location.spatialReference,this.graphic)).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>!this._isMultiVertexSelection(),cancel:a,snappingManager:this.tool.snappingManager,snappingContext:new le({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:t,pointer:n,excludeFeature:this.graphic,visualizer:new P}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next(ee()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(o=h(o))})),a.next(this._cancelDragOperation((()=>o=h(o))))}));return this._manipulatorHandles.add(o,a),this._manipulatorHandles.add([a.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,r))),a.events.on("select-changed",(()=>{r.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()}))],a),this.emit("manipulators-changed"),r}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_cancelDragOperation(e){return()=>{switch(this._numDragging--,this.undo(),this.outputGeometry=s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null,s(this.tool.snappingManager)&&this.tool.snappingManager.doneSnapping(),this._reshapeEventState){case fe.NONE:break;case fe.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case fe.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(fe.NONE)}}_setTypeSpecificManipulatorSettings(e,t,i){switch(t.type){case"vertex":e.state=_e.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.radius=T.reshapeManipulators.vertex.size/2+T.reshapeManipulators.vertex.collisionPadding,e.elevationInfo=i,e.interactive=s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type;break;case"edge":e.state=_e.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1,e.radius=T.reshapeManipulators.edge.size/2+T.reshapeManipulators.edge.collisionPadding,e.elevationInfo="on-the-ground"!==i.mode||I(this.graphic.symbol)?{mode:"absolute-height",offset:0}:i}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{if("start"===i.action)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(fe.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==i.pointerType||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{e.manipulator.interactive=!this._numGrabbing&&s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type,"edgeManipulator"in e&&(e.edgeManipulator.interactive=!this._numGrabbing)})),p(this._graphicMoveManipulation).forEachManipulator((e=>e.interactive=!this._numGrabbing)))}))}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(e){e&&(this._manipulatorHandles.remove(e.manipulator),this._manipulatorInfos.splice(this._manipulatorInfos.indexOf(e),1),this.manipulators.remove(e.manipulator),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPosition(e){if(!e)return;const t=p(this._editGeometryOperations);if("vertex"===e.handle.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,me),e.manipulator.grabbing&&s(this._vertexLaserLineVisualElement)&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.handle.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator,a=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator;if(s(e.manipulator.elevationInfo)&&"on-the-ground"===e.manipulator.elevationInfo.mode){const n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),l=n.y+o*(r.y-n.y),p=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=b(s,l,p,t.data.spatialReference)}else v(ge,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=ge}}_splitEdgeManipulator(e,t=.5){const i=p(this._editGeometryOperations),a=p(i.splitEdge(e.handle,t).createdVertex);e.locationUpdateHandle.remove(),e.locationUpdateHandle=void 0;const n=S(this.graphic);let r;this.enableEdgeOffset?(this._removeManipulator(e),r=this._createVertexOrEdgeManipulator(a)):(r=e,r.handle=a,r.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(r),this._updateSelection(e.manipulator);const o=this._updateEventState(fe.RESHAPING),s=i.data.coordinateHelper.vectorToArray(r.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:s,componentIndex:l,vertexIndex:p(a.index)}],added:s}),o&&this._updateEventState(fe.NONE),r}_updateMoveManipulationPosition(){const e=M(ge,0,0,0);let t=0,i=!1,a=null,n=null;for(const r of this._manipulatorInfos)ue(r)&&(r.manipulator.selected?(t++,y(e,e,r.manipulator.renderLocation),l(a)||r.selectedIndex>a.selectedIndex?(n=a,a=r):(l(n)||r.selectedIndex>n.selectedIndex)&&(n=r)):i=!0);if(0!==t){const e=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&j(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t}else{const e=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&j(this.graphic)}if(0!==t){let e=0;if(s(a)){const t=a.handle.pos,i=s(n)?n.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,r=l(n)&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;i&&r?this._moveManipulation.xyAxisManipulation.available=!1:i?e=de(i,t):r&&(e=de(t,r))}this._moveManipulation.angle=e,this._moveManipulation.radius=C}else this._moveManipulation.angleDeferred=()=>Z(p(this.graphic.geometry)),this._moveManipulation.radius=z.radiusForSymbol(this.graphic.symbol);0!==t&&i?(x(e,e,1/t),me.spatialReference=p(this._editGeometryOperations).data.spatialReference,me.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,me),this._moveManipulation.elevationAlignedLocation=me):s(this._outlineVisualElement)&&!this._graphicState.isDraped&&s(this._outlineVisualElement.attachmentOrigin)?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:w(this.view,this._moveManipulation,this.graphic)}_removeVertices(e){const t=[],i=p(this._editGeometryOperations);for(const a of e)if("vertex"===a.handle.type&&i.canRemoveVertex()){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const e=p(i.removeVertices([a.handle]).removedVertices[0].createdEdge);e&&this._createVertexOrEdgeManipulator(e)}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:p(e.index)}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(fe.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(fe.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(e,t,i=("start"===t.action?se.NEW_STEP:se.ACCUMULATE_STEPS)){const a=p(this._editGeometryOperations);a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const n of e)this._updateManipulatorPosition(n)}_offsetEdge(e,t){if(l(t.operation))return;const i=p(this._editGeometryOperations),a=t.operation.clone();a.distance=t.operation.signedDistanceToPoint(t.mapEnd),i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.handle.type&&(t.manipulator.selected=!t.manipulator.selected),"vertex"===t.handle.type&&e.button===$.Right&&this._removeVertices([t]),ce(t)&&e.button===$.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}};function de(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function ue(e){return"vertex"===e.handle.type}function ce(e){return"edge"===e.handle.type}e([c({constructOnly:!0})],he.prototype,"tool",void 0),e([c()],he.prototype,"inputGeometry",null),e([c()],he.prototype,"outputGeometry",void 0),e([c({readOnly:!0})],he.prototype,"updating",null),he=e([m("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],he);const me=b(0,0,null,null),ge=E();var _e,fe,ve;!function(e){e.Vertex=re.Custom1,e.Edge=re.Custom2}(_e||(_e={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(fe||(fe={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(ve||(ve={}));export{he as ReshapeOperation};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import t from"../../../../../core/Evented.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import a from"../../../../../core/Handles.js";import{handlesGroup as n,destroyHandle as o}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,isSome as s,isNone as l,unwrap as p,removeMaybe as h,applySome as d}from"../../../../../core/maybe.js";import{watch as u,syncAndInitial as c,initial as m}from"../../../../../core/reactiveUtils.js";import{property as g}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../../../core/accessorSupport/decorators/subclass.js";import{I as f}from"../../../../../chunks/mat4f64.js";import{l as v,b as M,h as y,s as x,a as O,g as E}from"../../../../../chunks/vec3.js";import{f as b,c as G}from"../../../../../chunks/vec3f64.js";import S from"../../../../../geometry/Polyline.js";import{makeDehydratedPoint as I}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as V}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as H}from"../../../../../symbols/support/utils.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as A,createManipulatorOutlineMaterial as P,placeAtGraphic as D}from"../../manipulatorUtils.js";import{SegmentLabels3D as L}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as N}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as U,convertToMapCoordinates as j,screenToMapXYAtLocation as k,screenToMapXYForGraphicAtLocation as T}from"../dragEventPipeline3D.js";import{ManipulatorType as R}from"../ManipulatorType.js";import{canMoveZ as F}from"../manipulatorUtils.js";import{settings as C,colors as z}from"../settings.js";import{createVisualElements as Z}from"../visualElementUtils.js";import{DISC_RADIUS_SMALL as X}from"../manipulations/config.js";import{MoveManipulation as Y}from"../manipulations/MoveManipulation.js";import{shapeOrientation as q}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as W}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as K,createEdgeOffsetOperation as B,edgeOffsetRotationMatrix as J,screenEdgeLengthSquared as Q}from"./edgeOffsetUtils.js";import{OutlineVisualElement as $}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as ee}from"../../../layers/graphics/GraphicState.js";import te from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as ie}from"../../../../input/IViewEvents.js";import{addMapDelta as ae,createManipulatorDragEventPipeline as ne,dragAtLocation as oe,addScreenDelta as re}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as se,ManipulatorStateCustomFlags as le}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as pe}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as he}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as de}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as ue}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";let ce=class extends(t.EventedMixin(i)){constructor(e){super(e),this._vertexManipulatorMaterial=A(C.colorToVec4(C.reshapeManipulators.vertex.color),C.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorOutlineMaterial=P(C.colorToVec4(C.reshapeManipulators.vertex.outlineColor),C.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=P(C.colorToVec4(C.reshapeManipulators.vertex.hoverOutlineColor),C.reshapeManipulators.vertex.renderOccluded),this._edgeManipulatorMaterial=A(C.colorToVec4(C.reshapeManipulators.edge.color),C.reshapeManipulators.edge.renderOccluded),this._edgeManipulatorOutlineMaterial=P(C.colorToVec4(C.reshapeManipulators.edge.outlineColor),C.reshapeManipulators.edge.renderOccluded),this._edgeOffsetManipulatorMaterial=A(C.colorToVec4(C.reshapeManipulators.edgeOffset.color),C.reshapeManipulators.edgeOffset.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=A(C.colorToVec4(C.reshapeManipulators.edgeOffset.hoverColor),C.reshapeManipulators.edgeOffset.renderOccluded,!1),this._selectedManipulatorMaterial=A(C.colorToVec4(C.reshapeManipulators.selected.color),C.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorOutlineMaterial=P(C.colorToVec4(C.reshapeManipulators.selected.outlineColor),C.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=P(C.colorToVec4(C.reshapeManipulators.selected.hoverOutlineColor),C.reshapeManipulators.selected.renderOccluded),this._selectedIndex=0,this._vertexManipulatorGeometry=null,this._vertexManipulatorOutlineGeometry=null,this._edgeManipulatorGeometry=null,this._edgeManipulatorOutlineGeometry=null,this._edgeOffsetManipulatorGeometryInside=null,this._edgeOffsetManipulatorGeometryOutside=null,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._editGeometryOperations=null,this._graphicMoveManipulation=null,this._moveManipulation=null,this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=ye.NONE,this._outlineVisualElement=null,this.segmentLabels=null,this.tool=null,this.tooltipOptions=null,this.outputGeometry=null,this._snappingPipeline=new ue,this._snappingPipelineHandle=new ue,this._vertexLaserLineVisualElement=null}initialize(){const e=new ee({graphic:this.graphic});this._graphicState=e,this.handles.add([u((()=>e.displaying),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e})),u((()=>({labels:this.segmentLabels,show:!0===d(this.tooltipOptions,(e=>e.show))})),(({labels:e,show:t})=>{s(e)&&(e.visible=t)}),c),this.view.trackGraphicState(e)])}destroy(){this.segmentLabels=r(this.segmentLabels),this._editGeometryOperations=r(this._editGeometryOperations),this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles=r(this._manipulatorHandles),this.manipulators.removeAll(),this._manipulatorInfos=[],this._resetGrabbingDragging()}get inputGeometry(){return s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null}set inputGeometry(e){this._recreateEditGeometryAndManipulators(e)}get updating(){return this.updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.handle.type));this._removeVertices(e)}manipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles.removeAll(),this.manipulators.removeAll(),this._manipulatorInfos=[]}_resetGrabbingDragging(){this._numGrabbing=0,this._numDragging=0}_createManipulators(){if(l(this._editGeometryOperations))return;const e=V(this.graphic);for(const t of this._editGeometryOperations.data.components){for(const i of t.vertices)this._createVertexOrEdgeManipulator(i,e);for(const i of t.edges)this._createVertexOrEdgeManipulator(i,e)}this._createGraphicMoveManipulators(e)}get canRedo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canRedo}get canUndo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canUndo}redo(){if(l(this._editGeometryOperations))return null;const e=this._editGeometryOperations.redo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}undo(){if(l(this._editGeometryOperations))return null;this.emit("undo");const e=this._editGeometryOperations.undo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}_recreateManipulators(){this._removeManipulators(),this._resetGrabbingDragging(),this._createManipulators()}_recreateEditGeometryAndManipulators(e=this.inputGeometry){this._removeManipulators(),this._resetGrabbingDragging(),l(e)||(r(this._editGeometryOperations),this._editGeometryOperations=pe.fromGeometry(e,this.view.state.viewingMode),this._createManipulators(),r(this.segmentLabels),this.segmentLabels=new L({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:V(this.graphic)}}))}_perGraphicManipulatorDragAction(e,t){if("end"===t.action)return;let i=0;const a=[],n=this._manipulatorInfos.some((e=>"vertex"===e.handle.type&&e.manipulator.selected)),o=e===xe.SELECTED_OR_ALL&&n;for(const r of this._manipulatorInfos)ge(r)&&(r.manipulator.grabbing||o&&!r.manipulator.selected||a.push(r),i++);if(0===a.length)return;this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(ye.MOVING),this.destroyed)return;this.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(ye.RESHAPING),this.destroyed)return;this.emit("reshape",{type:"reshape",mover:this.graphic})}}_isMultiVertexSelection(){let e=0;for(const t of this._manipulatorInfos)ge(t)&&t.manipulator.selected&&e++;return e>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(ye.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)ge(o)&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&n.push(o);this._moveVertices(n,e,he.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case ye.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case ye.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case ye.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case ye.MOVING:switch(this._reshapeEventState){case ye.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case ye.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case ye.RESHAPING:switch(this._reshapeEventState){case ye.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case ye.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createGraphicMoveManipulators(e){if(this._graphicMoveManipulation=new W({tool:this.tool,view:this.view,graphicState:this._graphicState}),this.enableMoveGraphic){let e=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=p(this._editGeometryOperations).createUndoGroup()),t))).next((t=>{this._perGraphicManipulatorDragAction(xe.ALL,t),"end"===t.action&&(e=h(e))})),a.next(this._cancelDragOperation((()=>e=h(e))))})))}else this._graphicMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._graphicMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()}))]))),this._moveManipulation=new Y({tool:this.tool,view:this.view,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&F(this.graphic),snapToScene:!1,radius:Y.radiusForSymbol(this.graphic.symbol)}),this._moveManipulation.forEachManipulator((e=>{this.handles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()}))])})),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const t=p(this.graphic.geometry).spatialReference,i=this.handles;i.add([this._moveManipulation.createDragPipeline(((t,i,a,n,o)=>{const r=a.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>ge(e)&&e.manipulator.selected));return e.manipulatorType===R.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:{...e,info:null}})).next(this._snappingPipelineHandle.createSnapDragEventPipelineStep({predicate:e=>!!e.info,cancel:n,snappingManager:this.tool.snappingManager,snappingContext:new de({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:e,pointer:o,excludeFeature:this.graphic,visualizer:new N}),updatingHandles:this.updatingHandles}),this._snappingPipelineHandle.next).next(ae()).next((e=>(this._perGraphicManipulatorDragAction(xe.SELECTED_OR_ALL,e),e)));return n.next(this._cancelDragOperation()),r}),e,t,this.graphic),u((()=>this._graphicState?.displaying),(()=>{this._updateMoveManipulationPosition()}),m),this._graphicState.on("changed",(()=>this._updateMoveManipulationPosition())),u((()=>this._graphicState?.isDraped),(e=>{const t="align-move-manipulation";e?i.add(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):i.remove(t)}),m)]),this._updateMoveManipulationPosition();const a=Z({view:this.view,graphic:this.graphic,forEachManipulator:e=>{if(!this.destroyed){s(this._graphicMoveManipulation)&&this._graphicMoveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,R.TRANSLATE_XY);this._moveManipulation.forEachManipulator(e)}},onManipulatorsChanged:e=>this.on("manipulators-changed",e)});s(a)&&(this._outlineVisualElement=a.visualElement instanceof $?a.visualElement:null),s(this._outlineVisualElement)&&this._manipulatorHandles.add([this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{this._graphicState.isDraped||this._updateMoveManipulationPosition()})),u((()=>this._graphicState.isDraped),(()=>this._updateMoveManipulationPosition()))]),this._manipulatorHandles.add(a)}_createEdgeOffsetManipulator(e,t=V(this.graphic)){const i=C.reshapeManipulators.edgeOffset,a=i.size/2,o=a+i.collisionPadding;if(l(this._edgeOffsetManipulatorGeometryInside)||l(this._edgeOffsetManipulatorGeometryOutside)){const e=a/o,t=e*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside=te.createExtrudedTriangle(t,e/2,e/2,i.height,i.offset),this._edgeOffsetManipulatorGeometryOutside=te.createExtrudedTriangle(-t,e/2,e/2,i.height,-i.offset)}const r=[{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorMaterial,stateMask:se.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:se.Focused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorMaterial,stateMask:se.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:se.Focused}],p=new w({view:this.view,renderObjects:r,elevationInfo:"on-the-ground"!==t.mode||H(this.graphic.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:o,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionType:{type:"disc",direction:b(0,0,1)},collisionPriority:1}),h=new w({view:this.view,renderObjects:[],worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default"}),d={manipulator:p,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const u=this._getManipulatorInfoFromHandle(d.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d))),c=this._getManipulatorInfoFromHandle(d.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d)));d.locationUpdateHandle=n([u,c]),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(ne(p,this._createEdgeOffsetPipeline(d,t)),p),this._manipulatorHandles.add(ne(h,((e,i,a,n)=>{if("touch"===n){this._createEdgeOffsetPipeline(d,t)(e,i,a)}else if(this.enableMoveGraphic){const n=this.graphic,o=s(n.geometry)?n.geometry.spatialReference:null;i.next((e=>this._trackNumDragging(e))).next(oe(this.view,e.elevationAlignedLocation)).next(k(this.view,e.elevationAlignedLocation,t,o,n)).next(re()).next(ae()).next((e=>this._perGraphicManipulatorDragAction(xe.ALL,e))),a.next(this._cancelDragOperation())}})),p);const m=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",m),h.events.on("immediate-click",m)],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,o=()=>{h(e.visibilityHandle);const o=Q(this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||o)&&(i.grabbable=!o,a.grabbable=!o,e.visibilityHandle=n([i.disableDisplay(),{remove:()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}}]))};this._manipulatorHandles.add([i.events.on("focus-changed",o),a.events.on("focus-changed",o),{remove:()=>{h(e.visibilityHandle),this.manipulators.remove(a)}}],i),o()}_updateEdgeOffsetManipulator(e){this._updateManipulatorPosition(e);const t=p(this._editGeometryOperations).data.coordinateHelper,i=K(this.view,e.manipulator.elevationAlignedLocation,B(t,e.handle,p(e.manipulator.elevationInfo))),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator.renderLocation,n=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator.renderLocation,o=s(i)?J(i,a,n):f;e.manipulator.modelTransform=o,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=o;const r=v(M(ve,a,n))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-r,0,0],[r,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,n)=>{this._clearSelection();const{step:o,cleanup:r}=this._initializeEdgeOffset(e,t);a.next((e=>this._trackNumDragging(e))).next(oe(this.view,i.elevationAlignedLocation)).next(o).next(U(this.view)).next(j(this.view,p(this._editGeometryOperations).data.spatialReference)).next(ae()).next(this._applyEdgeOffsetStep(e)).next((e=>{"end"===e.action&&r()})),n.next((e=>(r(),e))).next(this._cancelDragOperation())}}_initializeEdgeOffset(e,t){const i=p(this._editGeometryOperations),a=B(i.data.coordinateHelper,e.handle,t),r=i.createUndoGroup(),s=K(this.view,e.manipulator.elevationAlignedLocation,a);a.requiresSplitEdgeLeft&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge),1),a.requiresSplitEdgeRight&&this._splitEdgeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge),0);const d=()=>new S({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:p(this._editGeometryOperations).data.spatialReference}),c=new $({view:this.view,isDraped:this._graphicState.isDraped,geometry:d(),elevationInfo:e.elevationInfo,width:C.visualElements.lineGraphics.outline.width,color:C.colorToVec4(z.main),attached:!0});let m;const g=()=>{this._cleanEdgeOffsetCollapsedEdges(e),m=h(m)},_=this.on("undo",g);return m=n([o(c),u((()=>this._graphicState.isDraped),(e=>c.isDraped=e)),this._graphicState.on("changed",(()=>c.geometry=d())),r,_]),{step:e=>l(a)||l(s)?(g(),null):{...e,operation:a,plane:s},cleanup:g}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||l(t.operation))return t;this._updateEventState(ye.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:n}=t;return(i||a||n)&&(this._offsetEdge(e,t),this.emit("reshape",{type:"reshape",mover:this.graphic})),t}}_cleanEdgeOffsetCollapsedEdges(e){const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,n=e.handle.rightVertex,o=p(this._editGeometryOperations).data.coordinateHelper,r=1e-6,s=[];t&&o.distance(t.pos,i.pos)<r&&s.push(this._getManipulatorInfoFromHandle(i)),(o.distance(i.pos,n.pos)<r||a&&o.distance(a.pos,n.pos)<r)&&s.push(this._getManipulatorInfoFromHandle(n)),s.length&&this._removeVertices(s)}_computeVertexManipulatorSizeAndOutline(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}_createVertexOrEdgeManipulator(e,t=V(this.graphic)){if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(l(this._vertexManipulatorGeometry)||l(this._vertexManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(C.reshapeManipulators.vertex);this._vertexManipulatorGeometry=te.createSphereGeometry(e,16,16),this._vertexManipulatorOutlineGeometry=te.createSphereGeometry(t,16,16)}if(l(this._edgeManipulatorGeometry)||l(this._edgeManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(C.reshapeManipulators.edge);this._edgeManipulatorGeometry=te.createSphereGeometry(e,16,16),this._edgeManipulatorOutlineGeometry=te.createSphereGeometry(t,16,16)}const i=s(this.graphic.geometry)&&"point"===this.graphic.geometry.type?[]:[{geometry:this._vertexManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Me.Vertex|se.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorOutlineMaterial,stateMask:Me.Vertex|se.Unfocused|se.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Me.Vertex|se.Focused|se.Unselected},{geometry:this._vertexManipulatorGeometry,material:this._selectedManipulatorMaterial,stateMask:se.Selected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorOutlineMaterial,stateMask:se.Selected|se.Unfocused},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorHoverOutlineMaterial,stateMask:se.Selected|se.Focused}];this.enableMidpoints&&i.push({geometry:this._edgeManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Me.Edge|se.Focused|se.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Me.Edge|se.Focused|se.Unselected},{geometry:this._edgeManipulatorGeometry,material:this._edgeManipulatorMaterial,stateMask:Me.Edge|se.Unfocused|se.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._edgeManipulatorOutlineMaterial,stateMask:Me.Edge|se.Unfocused|se.Unselected});const a=new w({view:this.view,renderObjects:i,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer.visible)});this._setTypeSpecificManipulatorSettings(a,e,t);const o="edge"===e.type?{manipulator:a,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:a,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(o),this.manipulators.add(a),this._updateManipulatorPosition(o),"edge"===o.type){const e=this._getManipulatorInfoFromHandle(o.handle.leftVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(o))),t=this._getManipulatorInfoFromHandle(o.handle.rightVertex).manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(o)));o.locationUpdateHandle=n([e,t]),this._manipulatorHandles.add(o.locationUpdateHandle,a)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(a,!0),a);const r=ne(a,((e,i,a,n)=>{let r=null;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&(r=p(this._editGeometryOperations).createUndoGroup()),_e(o)){const t=this._splitEdgeManipulator(o);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:o,snapOrigin:o.handle.pos}})).next(oe(this.view,e.elevationAlignedLocation)).next(T(this.view,this.graphic,e.elevationAlignedLocation,e.location.spatialReference,this.graphic)).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>!this._isMultiVertexSelection(),cancel:a,snappingManager:this.tool.snappingManager,snappingContext:new de({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:t,pointer:n,excludeFeature:this.graphic,visualizer:new N}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next(ae()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r))})),a.next(this._cancelDragOperation((()=>r=h(r))))}));return this._manipulatorHandles.add(r,a),this._manipulatorHandles.add([a.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,o))),a.events.on("select-changed",(()=>{o.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()}))],a),this.emit("manipulators-changed"),o}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_cancelDragOperation(e){return()=>{switch(this._numDragging--,this.undo(),this.outputGeometry=s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null,s(this.tool.snappingManager)&&this.tool.snappingManager.doneSnapping(),this._reshapeEventState){case ye.NONE:break;case ye.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case ye.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(ye.NONE)}}_setTypeSpecificManipulatorSettings(e,t,i){switch(t.type){case"vertex":e.state=Me.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.radius=C.reshapeManipulators.vertex.size/2+C.reshapeManipulators.vertex.collisionPadding,e.elevationInfo=i,e.interactive=s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type;break;case"edge":e.state=Me.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1,e.radius=C.reshapeManipulators.edge.size/2+C.reshapeManipulators.edge.collisionPadding,e.elevationInfo="on-the-ground"!==i.mode||H(this.graphic.symbol)?{mode:"absolute-height",offset:0}:i}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{if("start"===i.action)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(ye.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==i.pointerType||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{e.manipulator.interactive=!this._numGrabbing&&s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type,"edgeManipulator"in e&&(e.edgeManipulator.interactive=!this._numGrabbing)})),p(this._graphicMoveManipulation).forEachManipulator((e=>e.interactive=!this._numGrabbing)))}))}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(e){e&&(this._manipulatorHandles.remove(e.manipulator),this._manipulatorInfos.splice(this._manipulatorInfos.indexOf(e),1),this.manipulators.remove(e.manipulator),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPosition(e){if(!e)return;const t=p(this._editGeometryOperations);if("vertex"===e.handle.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,fe),e.manipulator.grabbing&&s(this._vertexLaserLineVisualElement)&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.handle.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex).manipulator,a=this._getManipulatorInfoFromHandle(e.handle.rightVertex).manipulator;if(s(e.manipulator.elevationInfo)&&"on-the-ground"===e.manipulator.elevationInfo.mode){const n=i.location,o=a.location,r=.5,s=n.x+r*(o.x-n.x),l=n.y+r*(o.y-n.y),p=n.hasZ&&o.hasZ?0:void 0;e.manipulator.location=I(s,l,p,t.data.spatialReference)}else y(ve,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=ve}}_splitEdgeManipulator(e,t=.5){const i=p(this._editGeometryOperations),a=p(i.splitEdge(e.handle,t).createdVertex);e.locationUpdateHandle.remove(),e.locationUpdateHandle=void 0;const n=V(this.graphic);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)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(o),this._updateSelection(e.manipulator);const r=this._updateEventState(ye.RESHAPING),s=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:s,componentIndex:l,vertexIndex:p(a.index)}],added:s}),r&&this._updateEventState(ye.NONE),o}_updateMoveManipulationPosition(){const e=x(ve,0,0,0);let t=0,i=!1,a=null,n=null;for(const o of this._manipulatorInfos)ge(o)&&(o.manipulator.selected?(t++,O(e,e,o.manipulator.renderLocation),l(a)||o.selectedIndex>a.selectedIndex?(n=a,a=o):(l(n)||o.selectedIndex>n.selectedIndex)&&(n=o)):i=!0);if(0!==t){const e=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&F(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t}else{const e=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&F(this.graphic)}if(0!==t){let e=0;if(s(a)){const t=a.handle.pos,i=s(n)?n.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,o=l(n)&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;i&&o?this._moveManipulation.xyAxisManipulation.available=!1:i?e=me(i,t):o&&(e=me(t,o))}this._moveManipulation.angle=e,this._moveManipulation.radius=X}else this._moveManipulation.angleDeferred=()=>q(p(this.graphic.geometry)),this._moveManipulation.radius=Y.radiusForSymbol(this.graphic.symbol);0!==t&&i?(E(e,e,1/t),fe.spatialReference=p(this._editGeometryOperations).data.spatialReference,fe.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,fe),this._moveManipulation.elevationAlignedLocation=fe):s(this._outlineVisualElement)&&!this._graphicState.isDraped&&s(this._outlineVisualElement.attachmentOrigin)?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:D(this.view,this._moveManipulation,this.graphic)}_removeVertices(e){const t=[],i=p(this._editGeometryOperations);for(const a of e)if("vertex"===a.handle.type&&i.canRemoveVertex()){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const e=p(i.removeVertices([a.handle]).removedVertices[0].createdEdge);e&&this._createVertexOrEdgeManipulator(e)}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:p(e.index)}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(ye.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(ye.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(e,t,i=("start"===t.action?he.NEW_STEP:he.ACCUMULATE_STEPS)){const a=p(this._editGeometryOperations);a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const n of e)this._updateManipulatorPosition(n)}_offsetEdge(e,t){if(l(t.operation))return;const i=p(this._editGeometryOperations),a=t.operation.clone();a.distance=t.operation.signedDistanceToPoint(t.mapEnd),i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.handle.type&&(t.manipulator.selected=!t.manipulator.selected),"vertex"===t.handle.type&&e.button===ie.Right&&this._removeVertices([t]),_e(t)&&e.button===ie.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}};function me(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function ge(e){return"vertex"===e.handle.type}function _e(e){return"edge"===e.handle.type}e([g()],ce.prototype,"segmentLabels",void 0),e([g({constructOnly:!0})],ce.prototype,"tool",void 0),e([g({constructOnly:!0})],ce.prototype,"tooltipOptions",void 0),e([g()],ce.prototype,"inputGeometry",null),e([g()],ce.prototype,"outputGeometry",void 0),e([g({readOnly:!0})],ce.prototype,"updating",null),ce=e([_("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],ce);const fe=I(0,0,null,null),ve=G();var Me,ye,xe;!function(e){e.Vertex=le.Custom1,e.Edge=le.Custom2}(Me||(Me={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(ye||(ye={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(xe||(xe={}));export{ce as ReshapeOperation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isSome as o,isNone as n,destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as r}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import h from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as c}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{Manipulator3D as d}from"../../Manipulator3D.js";import{placeAtGraphic as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as u}from"../../SnappingVisualizer3D.js";import{canMoveZ as v}from"../manipulatorUtils.js";import{createVisualElements as M}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as y}from"../manipulations/config.js";import{MoveManipulation as f,ManipulationType as S}from"../manipulations/MoveManipulation.js";import{GraphicScaleRotateTransform as R}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as w}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as b}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as j}from"./undoRecords.js";import{GraphicState as
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isSome as o,isNone as n,destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as r}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import h from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as c}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{Manipulator3D as d}from"../../Manipulator3D.js";import{placeAtGraphic as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as u}from"../../SnappingVisualizer3D.js";import{canMoveZ as v}from"../manipulatorUtils.js";import{createVisualElements as M}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as y}from"../manipulations/config.js";import{MoveManipulation as f,ManipulationType as S}from"../manipulations/MoveManipulation.js";import{GraphicScaleRotateTransform as R}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as w}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as b}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as j}from"./undoRecords.js";import{GraphicState as A}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as _}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as x}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as G}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as T}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";let E=class extends(i(e.EventedMixin(_))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.type="transform-3d",this.scaleRotate=null,this.snappingPipeline=new T}initialize(){this.graphicState=new A({graphic:this.graphic}),this.moveManipulation=new f({tool:this,view:this.view,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&v(this.graphic),radius:f.radiusForSymbol(this.graphic.symbol)}),this.moveManipulation.forEachManipulator((t=>this.handles.add(t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:this.graphicState.graphic}),t.stopPropagation()}))))),this.moveManipulation.elevationInfo=c(this.graphic);const t=this.graphic.geometry;if(this.moveManipulation.createGraphicDragPipeline(((e,i,a,n,s)=>(o(t)&&e===S.XY&&(a=a.next(this.snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new G({elevationInfo:c(this.graphic),pointer:s,editGeometryOperations:x.fromGeometry(new h({spatialReference:t.spatialReference}),this.view.state.viewingMode),visualizer:new u,excludeFeature:this.graphic}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:n}),this.snappingPipeline.next)),a)),this.graphicState,(t=>{const{action:e,graphic:i,dxScreen:a,dyScreen:o}=t,n={graphic:i,dxScreen:a,dyScreen:o};switch(e){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this.moveManipulation.angle=o(this.scaleRotate)?this.scaleRotate.angle:0,this.scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(r((()=>this.scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this.scaleRotate=new R({tool:this,mode:t,adapter:this.scaleRotateAdapter}),this.handles.add(this.scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([M({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),r((()=>this.view.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof d&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}_updateManipulatorsInteractive(){n(this.scaleRotate)||(this.scaleRotate.interactive=!this.moveManipulation.grabbing,this.moveManipulation.interactive=!this.scaleRotate.grabbing)}_createScaleRotateAdapter(){return o(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new w({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new b({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer))})}_forEachManipulator(t){this.moveManipulation.forEachManipulator(t),o(this.scaleRotate)&&this.scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return r((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((e=>e.available=t)),this.moveManipulation.zManipulation.available=t&&this.enableZ&&v(this.graphic)}))}_createGeometryUndoRecord(){return j(this.graphic)}destroy(){this.moveManipulation.destroy(),this.scaleRotate=s(this.scaleRotate),this.scaleRotateAdapter=s(this.scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}set snapToScene(t){this.moveManipulation&&(this.moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this.moveManipulation.location=t,o(this.scaleRotate)&&(this.scaleRotate.location=t)}set elevationAlignedLocation(t){this.moveManipulation.elevationAlignedLocation=t,o(this.scaleRotate)&&(this.scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){o(this.scaleRotate)&&this.scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(n(this.scaleRotate))return;const t=this.scaleRotate.getScale();this.moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===m.Local||this.view.scale<y?this.moveManipulation.angle=this.scaleRotateAdapter.angle:this.moveManipulation.angle=0}_onGeometryChanged(){g(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this.moveManipulation.renderLocation)}get test(){return{discManipulator:this.moveManipulation.xyManipulation.test.discManipulator,zManipulator:this.moveManipulation.zManipulation.test.manipulator,ringManipulator:o(this.scaleRotate)?this.scaleRotate.test.ringManipulator:null,arrowManipulators:this.moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this.scaleRotateAdapter}}};t([l({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),t([l({constructOnly:!0,nonNullable:!0})],E.prototype,"graphic",void 0),t([l({constructOnly:!0,nonNullable:!0})],E.prototype,"enableZ",void 0),t([l()],E.prototype,"enableRotation",void 0),t([l()],E.prototype,"enableScaling",void 0),t([l({value:!1})],E.prototype,"snapToScene",null),t([l({constructOnly:!0})],E.prototype,"snappingManager",void 0),t([l({readOnly:!0})],E.prototype,"type",void 0),t([l({readOnly:!0})],E.prototype,"updating",null),E=t([p("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],E);export{E as GraphicTransformTool};
|
package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import{deg2rad as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isNone as s,isSome as r,unwrapOr as l}from"../../../../../core/maybe.js";import{watch as n,sync as h}from"../../../../../core/reactiveUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";let y=class extends t{constructor(e){super(e),this.angle=0,this.scale=1,this.symbol=null,this.initialAngle=0}initialize(){this.restart()}get relativeAngle(){return this.angle-this.initialAngle}get size(){const e=this._sizeReferenceSymbolLayer;if(s(e))return null;const t=this.findLayerView(),i=this._graphicSymbol;if(s(t)||s(i)||"point-3d"!==i.type)return null;const o=t.getSymbolLayerSize(i,e);return"size"in o&&r(o.size)?o.size:"width"in o&&r(o.width)?o.width:"depth"in o&&r(e.depth)?o.depth:"height"in o&&r(e.height)?o.height:null}get _sizeReferenceSymbolLayer(){const e=this._graphicSymbol;return s(e)||0===e.symbolLayers.length?null:e.symbolLayers.find((e=>"object"===e.type))}get _orientationReferenceSymbolLayer(){const e=this._graphicSymbol;return s(e)||0===e.symbolLayers.length?null:e.symbolLayers.find((e=>"object"===e.type&&r(e.heading)))}get _graphicSymbol(){return r(this.graphic)&&r(this.graphic.symbol)&&"point-3d"===this.graphic.symbol.type?this.graphic.symbol:null}set _graphicSymbol(e){this.graphic.symbol=e}restart(){this.handles.remove(m);const e=this._graphicSymbol;if(this.symbol=r(e)?e.clone():null,this.initialSizes=[],r(e)){const t=this.findLayerView();r(t)&&(this.initialSizes=e.symbolLayers.map((i=>"object"===i.type?t.getSymbolLayerSize(e,i):null)).toArray())}this.angle=r(this._orientationReferenceSymbolLayer)?p(this._orientationReferenceSymbolLayer.heading):0,this.initialAngle=this.angle,this.scale=1,this.handles.add(n((()=>({angle:this.angle,scale:this.scale})),(e=>this._updateSymbol(e)),h),m)}cancel(){this._graphicSymbol=this.symbol}createUndoRecord(){let e=this.graphic.symbol,t=null;return{undo:i=>{t=i.symbol,i.symbol=e,this.restart()},redo:i=>{e=i.symbol,i.symbol=t,this.restart()}}}_updateSymbol({scale:e,angle:t}){const i=this._graphicSymbol;if(s(this.symbol)||s(i)||"point-3d"!==i.type)return;const n=i.clone(),h=-o(t-this.initialAngle);let a=!1;this._forEachObjectSymbolLayerPair(this.symbol,n,((t,i,o)=>{const s=l(t.heading,0)+h;i.heading!==s&&(i.heading=s,a=!0);const n=this.initialSizes[o];if(r(n)&&"width"in n){n.width=this.sizeFilter(n.width),n.height=this.sizeFilter(n.height),n.depth=this.sizeFilter(n.depth);const t=n.width*e;i.width!==t&&(i.width=t,a=!0);const o=n.depth*e;i.depth!==o&&(i.depth=o,a=!0);const s=n.height*e;i.height!==s&&(i.height=s,a=!0)}})),a&&(this._graphicSymbol=n)}_forEachObjectSymbolLayerPair(e,t,i){e.symbolLayers.forEach(((e,o)=>{const s=t.symbolLayers.getItemAt(o);"object"===e.type&&"object"===s.type&&i(e,s,o)}))}};function p(e){return-i(e)}e([a()],y.prototype,"angle",void 0),e([a()],y.prototype,"scale",void 0),e([a()],y.prototype,"relativeAngle",null),e([a()],y.prototype,"size",null),e([a({constructOnly:!0})],y.prototype,"graphic",void 0),e([a()],y.prototype,"symbol",void 0),e([a({constructOnly:!0})],y.prototype,"findLayerView",void 0),e([a({constructOnly:!0})],y.prototype,"sizeFilter",void 0),e([a()],y.prototype,"_sizeReferenceSymbolLayer",null),e([a()],y.prototype,"_orientationReferenceSymbolLayer",null),e([a()],y.prototype,"_graphicSymbol",null),y=e([c("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateObjectSymbol3DAdapter")],y);const m="scale-heading-update-key";export{y as ScaleRotateObjectSymbol3DAdapter,p as headingToAngle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import i from"../../../../../core/Handles.js";import{destroyMaybe as
|
|
5
|
+
import i from"../../../../../core/Handles.js";import{clone as e}from"../../../../../core/lang.js";import{destroyMaybe as t,isSome as s,isNone as a,unwrap as n}from"../../../../../core/maybe.js";import{watch as l,sync as r}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as o}from"../../../../../core/screenUtils.js";import{c as h}from"../../../../../chunks/vec3f64.js";import{createSphereManipulator as _}from"../../manipulatorUtils.js";import{PickResult as d}from"../support/PickRequest.js";import{LaserlineVisualElement as u}from"../../visualElements/LaserlineVisualElement.js";import p from"../../../webgl-engine/lib/GeometryUtil.js";import{newIntersector as c}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as y}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{ManipulatorCollection as m}from"../../../../interactive/ManipulatorCollection.js";const w={laserLineGlowColor:[1,.5,0],laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:[1,1,1],laserLineInnerWidth:1,laserLineGlobalAlpha:.75,laserLineEnabled:!0,handleColor:[1,.5,0],handleOpacity:.5,handleRadius:5,handleRadiusHovered:10,handleRadiusMouse:10,handleRadiusTouch:25,pathLineColor:[1,.5,0,1],pathLineWidth:3,intersectingLineColor:[1,.2,0,1],perimeterLineColor:[1,.5,0,1],perimeterLineWidth:2,projectionLineColor:[1,.5,0,1],projectionLineWidth:2,projectionLineStippleSize:5,areaColor1:[1,.5,0,.5],areaColor2:[1,1,1,.5],fillColor:[1,.5,0,.5],lineSubdivisions:64,labelDistance:25};class g{constructor(i){this.vertexManipulators=[],this._analysisView=null,this._destroyed=!1,this._isManipulatorsOwner=!0,this._visible=!0,this._laserLine=null,this._cursorManipulator=null,this._listenerHandles=null,this._tempHandlePosition=h(),this._analysisView=i.analysisView,this._toolState=i.toolState,null!=i.manipulators?(this._manipulators=i.manipulators,this._isManipulatorsOwner=!1):this._manipulators=new m,this._view=i.view,this._style=v(w,i.style),this._intersector=c(this._view.state.viewingMode),this._intersector.options.store=y.MIN;const e=_(this._view,this._style.handleColor,this._style.handleOpacity);e.available=!1,e.radius=this._style.handleRadius,e.interactive=!1,this._manipulators.add(e),this._cursorManipulator=e,this._laserLine=new u({view:this._view,attached:!0,style:{glowColor:this._style.laserLineGlowColor,glowWidth:this._style.laserLineGlowWidth,glowFalloff:this._style.laserLineGlowFalloff,innerColor:this._style.laserLineInnerColor,innerWidth:this._style.laserLineInnerWidth,globalAlpha:this._style.laserLineGlobalAlpha}}),this._updateVisibility(i.visible||!0)}destroy(){this._listenerHandles=t(this._listenerHandles),this._isManipulatorsOwner?this._manipulators=t(this._manipulators):this._manipulators=null,this._laserLine=t(this._laserLine),this._destroyed=!0}get destroyed(){return this._destroyed}get visible(){return this._visible}set visible(i){i?this.show():this.hide()}get testData(){const i=this._laserLine.testData;return{labels:this._analysisView.analysisVisualization.testData.labels,laserLineRenderer:s(i)?{heightManifoldEnabled:i.heightManifoldEnabled,heightManifoldTarget:i.heightManifoldTarget,pointDistanceEnabled:i.pointDistanceEnabled,pointDistanceOrigin:i.pointDistanceOrigin,pointDistanceTarget:i.pointDistanceTarget,lineVerticalPlaneEnabled:i.lineVerticalPlaneEnabled}:{heightManifoldEnabled:!1,heightManifoldTarget:null,pointDistanceEnabled:!1,pointDistanceOrigin:null,pointDistanceTarget:null,lineVerticalPlaneEnabled:!1}}}show(){this._setVisibility(!0)}hide(){this._setVisibility(!1)}_setVisibility(i){this._destroyed||this._visible===i||this._updateVisibility(i)}_updateVisibility(i){this._visible=i,this._laserLine.visible=i,i?(this._initializeListeners(),this._updateAll()):(this._destroyListeners(),this.vertexManipulators.forEach((i=>{this._removeVertexManipulator(i.manipulator)})),this.vertexManipulators=[],this._view.cursor=null)}vertexHandleAt(i,e){const t=this._manipulators.intersect(i,e);return s(t)?t.manipulator.metadata:null}pick(i){const e=this._view.spatialReference,t=o(i.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const s=this._intersector.results.min,n=h();if(!s.getIntersectionPoint(n))return null;const l=this._view.renderCoordsHelper.fromRenderCoords(n,e);return a(l)?null:new d(n,l)}_updateAll(){this._visible&&this._analysisView.analysisVisualization&&(this._updateVertexManipulators(),this._updateLaserLine())}_createVertexManipulator(){const i=_(this._view,this._style.handleColor,this._style.handleOpacity);i.radius=this._style.handleRadius;return{id:this._manipulators.add(i),manipulator:i}}_removeVertexManipulator(i){this._manipulators.remove(i)}_updateVertexManipulators(){const i=this._analysisView.analysisVisualization.viewData,e=this._analysisView.path?this._analysisView.path.vertices:[],t=this.vertexManipulators;V(t,e.length,(()=>this._createVertexManipulator()),(i=>this._removeVertexManipulator(i.manipulator))),t.forEach(((t,s)=>{t.manipulator.metadata=e[s],t.manipulator.renderLocation=i.positionsRenderCoords[s]})),"drawing"===this._toolState.polygonState&&s(this._analysisView.cursorPoint)?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this._analysisView.cursorPoint):this._cursorManipulator.available=!1}_getFocusPoint(){const i=this._analysisView.lastDraggedVertex;switch(this._toolState.polygonState){case"drawing":return s(this._analysisView.cursorPoint)?this._analysisView.cursorPoint:s(i)?this._analysisView.path.getVertexPositionAsPoint(i):n(this._analysisView.path.lastPoint);case"editing":return s(i)?this._analysisView.path.getVertexPositionAsPoint(i):null;default:return this._analysisView.cursorPoint}}_updateLaserLine(){const i=this._style.laserLineEnabled&&"measured"!==this._toolState.polygonState&&this._toolState.active,e=this._getFocusPoint();if(i&&s(e)){const i=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(e,i),this._laserLine.heightManifoldTarget=i}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new i,this._listenerHandles.add([l((()=>this._toolState.polygonState),(()=>this._updateLaserLine())),l((()=>this._analysisView.analysisVisualization?.viewData),(()=>this._updateAll()),r),l((()=>({lastDraggedVertex:this._analysisView.lastDraggedVertex,cursorPoint:this._analysisView.cursorPoint})),(()=>this._updateLaserLine())),l((()=>this._toolState.active),(()=>this._updateAll()))])}_destroyListeners(){this._listenerHandles=t(this._listenerHandles)}}function v(i,t){return{...i,...e(t)}}function V(i,e,t,s){for(;i.length<e;)i.push(t());if(s)for(;i.length>e;){s(i.pop())}else i.length=e}g._handleGeometry=p.createSphereGeometry(1,32,32);export{v as copyParameter,g as default,V as resizeArray};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Handles.js";import{isSome as e}from"../../../../core/maybe.js";import{watch as
|
|
5
|
+
import t from"../../../../core/Handles.js";import{isSome as e}from"../../../../core/maybe.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray as s,createRenderScreenPointArray3 as o,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{b as a,a as n,f as h,n as c,i as l,o as m,g as _}from"../../../../chunks/vec2.js";import{a as u}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{VisualElement as d}from"./VisualElement.js";import{renderScreenSpaceTangent as f}from"../../../interactive/support/viewUtils.js";import x from"../../../overlay/LineOverlayItem.js";import v from"../../../overlay/TextOverlayItem.js";class b extends d{constructor(e){super(e.view),this._handles=new t,this._textItem=null,this._calloutItem=null,this._showCallout=!0,this._showText=!0,this._geometry=null,this._text="-",this._fontSize=14,this._distance=25,this._anchor="right",this.applyProps(e)}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this._updateLabelPosition()}get textItem(){return this._textItem}get text(){return this._text}set text(t){this._text=t,this.attached&&(this._textItem.text=this._text)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.attached&&(this._textItem.fontSize=this._fontSize)}get distance(){return this._distance}set distance(t){this._distance!==t&&(this._distance=t,this._updateLabelPosition())}get anchor(){return this._anchor}set anchor(t){this._anchor!==t&&(this._anchor=t,this._updateLabelPosition())}overlaps(t){return!!this.attached&&(this.textItem.visible&&t.textItem.visible&&this.view.overlay.overlaps(this._textItem,t.textItem))}_updateLabelPosition(){if(!this.attached)return;this._showText=!1,this._showCallout=!1;const{geometry:t,view:i,visible:s}=this;if(e(t)&&i._stage)switch(t.type){case"point":if(this._computeLabelPositionFromPoint(t.point,k)){if(t.callout){const e=i.state.camera,s=t.callout.distance;a(R,R,[0,t.callout.offset]),e.renderToScreen(R,k),n(j,0,1),h(j,j,s*e.pixelRatio),a(j,j,R),e.renderToScreen(j,z),this._showCallout=this._updatePosition(k,z)}else this._textItem.position=[k[0],k[1]],this._textItem.anchor="center";this._showText=!0}break;case"corner":this._computeLabelPositionFromCorner(t,this._distance,k,z)&&(this._showCallout=this._updatePosition(k,z),this._showText=!0);break;case"segment":if(this._computeLabelPositionFromSegment(t,this._distance,this._anchor,k,z)){this._showText=!0;const e=this._updatePosition(k,z);this._showCallout=!1!==t.callout&&e}}this.updateVisibility(s)}_computeLabelPositionFromPoint(t,e){const i=this.view.state.camera;return i.projectToRenderScreen(t,R),!(R[2]<0||R[2]>1)&&(i.renderToScreen(R,e),!0)}_computeLabelPositionFromCorner(t,e,i,s){if(!t)return!1;const o=this.view.state.camera;return w(t.left,1,o,P),c(P,P),w(t.right,0,o,T),a(j,P,T),c(j,j),l(j,j),o.projectToRenderScreen(t.left.endRenderSpace,R),!(R[2]<0||R[2]>1)&&(o.renderToScreen(R,i),h(j,j,e*o.pixelRatio),a(j,j,R),o.renderToScreen(j,s),!0)}_computeLabelPositionFromSegment(t,e,i,s,o){if(!t)return!1;const r=t.segment,l=this.view.state.camera;f(r.startRenderSpace,r.endRenderSpace,l,P),n(j,-P[1],P[0]);let _=!1;switch(i){case"top":_=j[1]<0;break;case"bottom":_=j[1]>0;break;case"left":_=j[0]>0;break;case"right":_=j[0]<0}if(_&&c(j,j),0===m(j))switch(i){case"top":j[1]=1;break;case"bottom":j[1]=-1;break;case"left":j[0]=-1;break;case"right":j[0]=1}return r.eval(V[t.sampleLocation],L),l.projectToRenderScreen(L,R),!(R[2]<0||R[2]>1)&&(l.renderToScreen(R,s),h(j,j,e*l.pixelRatio),a(j,j,R),l.renderToScreen(j,o),!0)}_updatePosition(t,e){if(e){const i=e[0]-t[0],s=e[1]-t[1];return this._textItem.position=[e[0],e[1]],this._textItem.anchor=Math.abs(i)>Math.abs(s)?i>0?"left":"right":s>0?"top":"bottom",this._calloutItem.startPosition=[t[0],t[1]],this._calloutItem.endPosition=[e[0],e[1]],!0}return this._textItem.position=[t[0],t[1]],this._textItem.anchor="center",!1}createResources(){this._textItem=new v({visible:!0,text:this._text,fontSize:this._fontSize}),this._calloutItem=new x({visible:!0,width:2}),this._updateLabelPosition(),this.view.overlay.items.addMany([this._textItem,this._calloutItem]),this._handles.add(i((()=>this.view.state.camera),(()=>this._updateLabelPosition())))}destroyResources(){this.view.overlay&&!this.view.overlay.destroyed&&this.view.overlay.items.removeMany([this._textItem,this._calloutItem]),this._handles.removeAll()}updateVisibility(t){this._textItem.visible=this._showText&&t,this._calloutItem.visible=this._showCallout&&t}}function w(t,e,i,s){t.eval(e,S,y),u(g,S,y),i.projectToRenderScreen(S,C),i.projectToRenderScreen(g,M),_(s,U,F),l(s,s)}function I(t){switch(t){case"top":return"bottom";case"right":return"left";case"bottom":return"top";case"left":return"right"}}const S=p(),g=p(),y=p(),P=s(),T=s(),j=s(),L=p(),R=o(),k=r(),z=r(),C=o(),F=C,M=o(),U=M,V={start:0,center:.5,end:1};export{b as LabelVisualElement,I as mirrorPosition,w as screenSpaceTangent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{isSome as r,isNone as a}from"../../core/maybe.js";const s=()=>import("./layers/TileLayerView3D.js"),i=()=>import("./layers/ElevationLayerView3D.js"),o={analysis:()=>import("./layers/AnalysisLayerView3D.js"),"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":i,"base-tile":s,"bing-maps":s,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),elevation:i,feature:()=>import("./layers/FeatureLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("../layers/GroupLayerView.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":s,"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:s,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":s,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),"geo-rss":null,kml:null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null
|
|
5
|
+
import e from"../../core/Error.js";import{isSome as r,isNone as a}from"../../core/maybe.js";const s=()=>import("./layers/TileLayerView3D.js"),i=()=>import("./layers/ElevationLayerView3D.js"),o={analysis:()=>import("./layers/AnalysisLayerView3D.js"),"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":i,"base-tile":s,"bing-maps":s,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),elevation:i,feature:()=>import("./layers/FeatureLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("../layers/GroupLayerView.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":s,"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:s,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":s,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),"geo-rss":null,kml:null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null};function t(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",s=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${s}:view-not-supported`,`${a} is not supported in 3D`)}const l={hasLayerViewModule:e=>r(o[e.type]),importLayerView:e=>{const r=o[e.type];if(a(r))throw t(e);return r(e)}};export{l as layerView3DImporter};
|