@arcgis/core 4.29.0 → 4.29.1
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/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b43fde3e25d0c3b020b5.js → 039a872509872ce67ba4.js} +1 -1
- package/assets/esri/core/workers/chunks/{5243f9ff21e768c620c2.js → 23a5d750d93a7829174f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47e6119be4a4a5ed640d.js → 2447a4d5886aeb0ff72a.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f45a9e9bdbcffc2d6e0.js → 348bcc57b99a975902a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c9fb2601488998013ba.js → 3523789a2948a4ab8cc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{24649b410b757599a549.js → 48db6e0bbb1a9c043193.js} +1 -1
- package/assets/esri/core/workers/chunks/{752082be991f1cc8558f.js → 4984e2b79d862114d6a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d9736fd15cdb54d9855.js → 5227f9eea6988aadad7f.js} +1 -1
- package/assets/esri/core/workers/chunks/58723274ef657fe212eb.js +1 -0
- package/assets/esri/core/workers/chunks/60ab18c6a04d4b2f1d4c.js +1 -0
- package/assets/esri/core/workers/chunks/647515801d94180b8402.js +1 -0
- package/assets/esri/core/workers/chunks/6c3ae96ec90e9ed7dd50.js +1 -0
- package/assets/esri/core/workers/chunks/7a8bba91769ee18cc39f.js +1 -0
- package/assets/esri/core/workers/chunks/7a98d2e026f63a581b1e.js +1 -0
- package/assets/esri/core/workers/chunks/8c360923cd1850767d3e.js +1 -0
- package/assets/esri/core/workers/chunks/{1a25ba411b89e050fbb7.js → a61f337802ae963d7f65.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0c5318d7ef2e923aad0.js → a8ac511280f873960d46.js} +1 -1
- package/assets/esri/core/workers/chunks/b125ab84b7761e761734.js +1 -0
- package/assets/esri/core/workers/chunks/{b34d6e58b125fe111f91.js → b42a83db83851cb57d44.js} +1 -1
- package/assets/esri/core/workers/chunks/{1497dd943df7eede0704.js → b9c55ff1f21db198ce03.js} +1 -1
- package/assets/esri/core/workers/chunks/bb3322ddb89c0bd444f0.js +1 -0
- package/assets/esri/core/workers/chunks/becfdaeeb07f089d8be7.js +1 -0
- package/assets/esri/core/workers/chunks/{b26e39a399963c176d33.js → c527692694688a5b3b07.js} +2 -2
- package/assets/esri/core/workers/chunks/{210a93e0b96c5bff44a3.js → c556644bb0cf88770939.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5e7b4acae17f88e2208.js → ce93027b6b81428ce9b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8ece275abac93f3dccf.js → d14f16bfa6c12909929c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1594f06a2d7d9439c62e.js → e2147c99cc5839654be1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33ed3a2a0d4b640bd4a.js → e4c7d8c69e4957c9d27c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7709248f59520aee6f51.js → eceaa46f622f6fa31128.js} +1 -1
- package/assets/esri/core/workers/chunks/{2286db4c83ff1b6fb088.js → ef3e6209e6ac6a56960b.js} +1 -1
- package/assets/esri/core/workers/chunks/f59b5ea05caca8a1a398.js +1 -0
- package/chunks/Laserlines.glsl.js +3 -3
- package/chunks/Precipitation.glsl.js +1 -1
- package/chunks/SSAOBlur.glsl.js +2 -2
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/terrainUtilsPlanar.js +1 -1
- package/chunks/vec32.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/vec3.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +5 -0
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/geometry/support/triangle.js +1 -1
- package/geometry/support/vector.js +1 -1
- package/interfaces.d.ts +6 -6
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/FeatureReductionLayer.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/layers/voxel/voxelPlaneUtils.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/arcade/callExpressionWithCursor.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/DrillDownTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/PagedTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/features/support/Tile.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/support/measurementUtils.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LoDUtil.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.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/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/state/utils/viewUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsInternal.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/mathUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0e83f3718a0b45652b5e.js +0 -1
- package/assets/esri/core/workers/chunks/1fa5c8af69a09a3730b3.js +0 -1
- package/assets/esri/core/workers/chunks/4736f79b5c94ce103d43.js +0 -1
- package/assets/esri/core/workers/chunks/65f7adaaf1f535310c11.js +0 -1
- package/assets/esri/core/workers/chunks/79c041b292648c5eaecc.js +0 -1
- package/assets/esri/core/workers/chunks/7c4c2c0beddabac672b6.js +0 -1
- package/assets/esri/core/workers/chunks/9307d485a9e5f9fa77d1.js +0 -1
- package/assets/esri/core/workers/chunks/9a758de08dfa57735879.js +0 -1
- package/assets/esri/core/workers/chunks/a4c3da057ec2a07bbbe8.js +0 -1
- package/assets/esri/core/workers/chunks/b252270b100351779f1f.js +0 -1
- package/assets/esri/core/workers/chunks/dc57aa9f2fc69e654559.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../Color.js";import{darken as t}from"../../../../../core/colorUtils.js";import r from"../../../../../core/Evented.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{removeMaybe as a}from"../../../../../core/maybe.js";import{watch as o}from"../../../../../core/reactiveUtils.js";import{translate as s,rotateX as n,scale as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m,f as d,n as u,
|
|
5
|
+
import e from"../../../../../Color.js";import{darken as t}from"../../../../../core/colorUtils.js";import r from"../../../../../core/Evented.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{removeMaybe as a}from"../../../../../core/maybe.js";import{watch as o}from"../../../../../core/reactiveUtils.js";import{translate as s,rotateX as n,scale as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{o as m,f as d,n as u,k as p,b as h,h as f}from"../../../../../chunks/vec32.js";import{create as _,fromValues as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as g}from"../../Manipulator3D.js";import{createManipulatorMaterial as w}from"../../manipulatorUtils.js";import{RenderObject as v}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{ManipulatorType as U}from"../ManipulatorType.js";import{Settings as b}from"../settings.js";import{discRadius as O}from"./config.js";import{Manipulation as C}from"./Manipulation.js";import{createGraphicMoveDragPipeline as D}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as P}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as T}from"../../../webgl-engine/lib/Material.js";import{createManipulatorDragEventPipeline as k,addScreenDelta as z}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as F}from"../../../../interactive/interfaces.js";class x extends C{constructor(e){super(),this._radius=O,this.events=new r,this._tool=e.tool,this._view=e.view;const t=new b({getTheme:()=>this._view.effectiveTheme});this._settings=t,null!=e.radius&&(this._radius=e.radius);const i=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:w(this._createDarkenedColor(i,1,.25),T.Occlude),materialFocused:w(this._createDarkenedColor(i,1,0),T.Occlude),materialOccludedUnfocused:w(this._createDarkenedColor(i,.7,0),t.zManipulator.renderOccluded),materialOccludedFocused:w(this._createDarkenedColor(i,.85,0),t.zManipulator.renderOccluded)},this._themeHandle=o((()=>this._view.effectiveTheme.accentColor),(e=>{const t=this._createDarkenedColor(e,1,.25),r=this._createDarkenedColor(e,1,0),i=this._createDarkenedColor(e,.7,0),a=this._createDarkenedColor(e,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:t}),s.setParameters({color:r}),n.setParameters({color:i}),l.setParameters({color:a})})),this._createManipulator(),this.forEachManipulator((e=>this._tool.manipulators.add(e)))}destroy(){this._themeHandle=a(this._themeHandle),this._manipulator.applyObjectTransform=H,this.forEachManipulator((e=>{this._tool.manipulators.remove(e),e.destroy()}))}forEachManipulator(e){e(this._manipulator,U.TRANSLATE_Z)}createGraphicDragPipeline(e,t,r){const i=t.graphic.geometry.spatialReference;return D(t.graphic,r,(t=>this.createDragPipeline(((r,i,a,o,s)=>(({steps:i,cancel:a}=e(r,i,a,o,s)),t(r,i,a))),i)))}createDragPipeline(e,t){const r=this._view;return k(this._manipulator,((i,a,o,s,n)=>{const l=a.next((e=>({...e,manipulatorType:U.TRANSLATE_Z}))).next(M(r,i.renderLocation,t)).next(z());e(i,l,o,s,n)}))}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}_updateManipulator(){const e=this._settings,t=this._radius/O,r=e.zManipulator.height*t,i=e.zManipulator.coneHeight*t,a=e.zManipulator.coneWidth*t,o=e.zManipulator.width*t,m=[j(0,0,0),j(0,0,r)],d=[j(0,0,0),j(0,0,r+i)],u=e=>{const t=c();if(s(t,t,[0,0,r]),n(t,t,Math.PI/2),e){const r=1+2*e/a;l(t,t,[r,r,r])}return t},p=u(0),{materialUnfocused:h,materialFocused:f,materialOccludedUnfocused:_,materialOccludedFocused:g}=this._materials,w=y(h,m,o/2,16,!1),M=P(h,i,a/2,16,!1);M.transformation=p,this._manipulator.renderObjects=[new v(M,F.Unfocused),new v(w,F.Unfocused),new v(M.instantiate({material:f}),F.Focused),new v(w.instantiate({material:f}),F.Focused),new v(M.instantiate({material:_}),F.Unfocused),new v(w.instantiate({material:_}),F.Unfocused),new v(M.instantiate({material:g}),F.Focused),new v(w.instantiate({material:g}),F.Focused)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[d]}}_createManipulator(){const e=this._view,t=new g({view:e,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});t.applyObjectTransform=t=>{const r=e.state.camera,a=A;e.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,a);const o=m(r.eye,a),s=r.computeRenderPixelSizeAtDist(o),n=d(E,a,r.eye);u(n,n);const l=R;e.renderCoordsHelper.worldUpAtPosition(A,l);const c=Math.abs(p(n,l)),_=h(E,n,l),j=h(E,_,l),g=i(c,.01,1),w=1-Math.sqrt(1-g*g)/g/r.fullWidth,v=this._settings,M=this._radius/O,U=v.zManipulator.width*M;f(j,u(j,j),(1/w-1)*o+s*U),t[12]-=E[0],t[13]-=E[1],t[14]-=E[2]},this._manipulator=t,this._updateManipulator()}_createDarkenedColor(r,i,a){const o=t(r,a);return o.a*=i,e.toUnitRGBA(o)}get test(){return{manipulator:this._manipulator}}}const A=_(),E=_(),R=_(),H=()=>{};export{x as MoveZManipulation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../geometry.js";import e from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as h}from"../../../../../core/maybe.js";import{zeroMeters as d,scale as u,createLength as c}from"../../../../../core/quantityUtils.js";import{watch as m,initial as g}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as _}from"../../../../../core/unitUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as y,f as x,k as O,s as b,g as E,h as G}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as T}from"../../../../../core/support/UpdatingHandles.js";import w from"../../../../../geometry/Polyline.js";import{hasCompatibleTopology as H}from"../../../../../geometry/support/coordsUtils.js";import{projectPoint as V}from"../../../../../geometry/support/plane.js";import{sv3d as A}from"../../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as L}from"../../../../../layers/graphics/dehydratedPoint.js";import{getGraphicEffectiveElevationInfo as D}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as j}from"../../../../../symbols/support/utils.js";import{Manipulator3D as k}from"../../Manipulator3D.js";import{createManipulatorMaterial as P,createManipulatorOutlineMaterial as U,placeAtGraphic as C}from"../../manipulatorUtils.js";import{RenderObject as N}from"../../RenderObject.js";import{SegmentLabels3D as R}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as F}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as z,convertToMapCoordinates as X,screenToMapXYAtLocation as Z,screenToMapXYForGraphicAtLocation as Y}from"../dragEventPipeline3D.js";import{orientation as q}from"../geometryUtils.js";import{ManipulatorType as W}from"../ManipulatorType.js";import{canMoveZ as K}from"../manipulatorUtils.js";import{Settings as B}from"../settings.js";import{createVisualElements as J}from"../visualElementUtils.js";import{discRadiusSmall as Q}from"../manipulations/config.js";import{ManipulationType as $,MoveManipulation as tt}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as et}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as it}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as at,createEdgeOffsetOperation as nt,edgeOffsetRotationMatrix as ot,screenEdgeLengthSquared as st}from"./edgeOffsetUtils.js";import{OutlineVisualElement as rt}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as lt}from"../../../layers/graphics/GraphicState.js";import{createExtrudedTriangle as pt,createSphereGeometry as ht}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as dt}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as ut,addMapDelta as ct,createManipulatorDragEventPipeline as mt,dragAtLocation as gt,addScreenDelta as _t}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ft,ManipulatorStateCustomFlags as vt}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as Mt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as yt}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as xt}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Ot}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{ReshapeEdgeOffsetTooltipInfo as bt}from"../../../../interactive/tooltip/ReshapeTooltipInfos.js";import{Tooltip as Et}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as Gt,TranslateGraphicXYTooltipInfo as It,TranslateGraphicTooltipInfo as St,TranslateVertexZTooltipInfo as Tt,TranslateVertexXYTooltipInfo as wt,TranslateVertexTooltipInfo as Ht}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{makeElevationField as Vt}from"../../../../interactive/tooltip/fields/fields.js";import{autoArea2D as At}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoDistanceBetweenPoints2D as Lt,autoLength2D as Dt}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as jt,elevationFromPoint as kt}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as Pt}from"../../../../support/geodesicLengthMeasurementUtils.js";import Ut from"../../../../../geometry/SpatialReference.js";let Ct=class extends(n.EventedMixin(e)){constructor(t){super(t),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Yt.NONE,this._updatingHandles=new T,this._recreatingManipulators=!1,this._settings=new B({getTheme:()=>this.view.effectiveTheme}),this._latestTooltipInfo=null,this._translateGraphicTooltipInfo=null,this._translateGraphicXYTooltipInfo=null,this._translateGraphicZTooltipInfo=null,this._translateVertexTooltipInfo=null,this._translateVertexXYTooltipInfo=null,this._translateVertexZTooltipInfo=null,this._edgeOffsetTooltipInfo=null,this.outputGeometry=null,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:t,view:e}=this,i=this._settings.manipulators,n=i.vertex;this._vertexManipulatorMaterial=P(a(n.color),n.renderOccluded),this._vertexManipulatorOutlineMaterial=U(a(n.outlineColor),n.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=U(a(n.hoverOutlineColor),n.renderOccluded);const o=i.edge;this._edgeManipulatorMaterial=P(a(o.color),o.renderOccluded),this._edgeManipulatorOutlineMaterial=U(a(o.outlineColor),o.renderOccluded);const s=i.edgeOffset;this._edgeOffsetManipulatorMaterial=P(a(s.color),s.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=P(a(s.hoverColor),s.renderOccluded,!1);const r=i.selected;this._selectedManipulatorMaterial=P(a(r.color),r.renderOccluded),this._selectedManipulatorOutlineMaterial=U(a(r.outlineColor),r.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=U(a(r.hoverOutlineColor),r.renderOccluded);const l=this._graphicState=new lt({graphic:t});this.tooltip=new Et({view:e}),this.addHandles([m((()=>{const t=this._settings.manipulators;return{vertexSettings:t.vertex,edgeSettings:t.edge,edgeOffsetSettings:t.edgeOffset,selectedSettings:t.selected}}),(({vertexSettings:t,edgeSettings:e,edgeOffsetSettings:i,selectedSettings:a})=>{t.applyColor(this._vertexManipulatorMaterial),t.applyOutline(this._vertexManipulatorOutlineMaterial),t.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),e.applyColor(this._edgeManipulatorMaterial),e.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),a.applyColor(this._selectedManipulatorMaterial),a.applyOutline(this._selectedManipulatorOutlineMaterial),a.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),m((()=>l.displaying),(t=>{for(const e of this._manipulatorInfos)e.manipulator.available=t})),m((()=>({labels:this._segmentLabels,enabled:this.sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:t,enabled:e,edgeOffsetEnabled:i})=>{null!=t&&(t.visible=e,t.edgeDistance=i?"far":"default")}),g),m((()=>this.sketchOptions.tooltips.effectiveEnabled),(t=>{this.tooltip.info=t?this._latestTooltipInfo:null}),g),this.view.trackGraphicState(l)])}destroy(){this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip),this._removeManipulators(),this._updatingHandles.destroy()}get inputGeometry(){return null!=this._editGeometryOperations?this._editGeometryOperations.data.geometry:null}set inputGeometry(t){this._recreateEditGeometryAndManipulators(t)}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}get sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}removeSelectedVertices(){const t=this._manipulatorInfos.filter((t=>t.manipulator.selected&&"vertex"===t.type));this._removeVertices(t)}onManipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._graphicMoveManipulation=p(this._graphicMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(t){if(null==this._editGeometryOperations)return;const e=D(this.graphic);for(const i of this._editGeometryOperations.data.components){const a=t?.byComponentIndex.get(i.index);for(const t of i.vertices){const i=a?.has(t.index);this._createVertexOrEdgeManipulator(t,e,i)}for(const t of i.edges)this._createVertexOrEdgeManipulator(t,e)}this._createGraphicMoveManipulation(),this._createMoveManipulation(e),this._createVisualElements()}get canRedo(){return null!=this._editGeometryOperations&&this._editGeometryOperations.canRedo}get canUndo(){return null!=this._editGeometryOperations&&this._editGeometryOperations.canUndo}redo(){if(null==this._editGeometryOperations)return null;const t=this._editGeometryOperations.redo();return null!=t&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),t}undo(){if(null==this._editGeometryOperations)return null;this.emit("undo");const t=this._editGeometryOperations.undo();return null!=t&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),t}_recreateManipulators(){this._recreatingManipulators||(this._recreatingManipulators=!0,this._removeManipulators(),this._hideTooltip(),this._createManipulators(),this._recreatingManipulators=!1)}_recreateEditGeometryAndManipulators(t){const e={byComponentIndex:new Map};if(null!=t&&null!=this.inputGeometry&&H(t,this.inputGeometry))for(const n of this._manipulatorInfos)if("vertex"===n.type&&n.manipulator.selected){const{index:t,component:{index:i}}=n.handle,{byComponentIndex:a}=e,o=a.get(i)||new Set;o.add(t),a.set(i,o)}if(this._recreatingManipulators=!0,this._removeManipulators(),this._hideTooltip(),this._editGeometryOperations=p(this._editGeometryOperations),this._segmentLabels=p(this._segmentLabels),null==t)return void(this._recreatingManipulators=!1);const i="mesh"===t.type?t.anchor:t;this._editGeometryOperations=Mt.fromGeometry(i,this.view.state.viewingMode),this._createManipulators(e);const a=this.sketchOptions.labels;this._segmentLabels=new R({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:D(this.graphic),labelOptions:a,graphic:this.graphic,graphicState:this._graphicState},visible:a.enabled}),this._recreatingManipulators=!1}_perGraphicManipulatorDragAction(t,e){if("end"===e.action)return e;let i=0;const a=[],n=this._manipulatorInfos.some((t=>"vertex"===t.type&&t.manipulator.selected)),o=t===qt.SELECTED_OR_ALL&&n;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||a.push(s),i++);if(0===a.length)return e;this._moveVertices(a,e);if(a.length===i){if(this._updateEventState(Yt.MOVING),this.destroyed)return e;this.emit("move",{type:"move",dx:e.screenDeltaX,dy:e.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(Yt.RESHAPING),this.destroyed)return e;this.emit("reshape",{type:"reshape",mover:this.graphic})}return e}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((t,e)=>"vertex"===e.type&&e.manipulator.selected?t+1:t),0)>1}_perVertexManipulatorDragAction(t){if(this._updateEventState(Yt.RESHAPING),this.destroyed)return;const{mapDeltaX:e,mapDeltaY:i,mapDeltaZ:a}=t;if(!e&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===t.info)&&n.push(o);this._moveVertices(n,t,yt.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(t){if(t===this._reshapeEventState)return!1;switch(t){case Yt.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Yt.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case Yt.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case Yt.MOVING:switch(this._reshapeEventState){case Yt.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case Yt.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 Yt.RESHAPING:switch(this._reshapeEventState){case Yt.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case Yt.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 e=this._reshapeEventState!==t;return this._reshapeEventState=t,e}_createGraphicMoveManipulation(){const{tool:t,view:e}=this,i=this._graphicState;if(this._graphicMoveManipulation=new it({tool:t,view:e,graphicState:i}),this.enableMoveGraphic){let t=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((e,i,a)=>{i.next((t=>this._trackNumDragging(t))).next((e=>("start"===e.action&&(t=this._editGeometryOperations.createUndoGroup()),e))).next((t=>this._perGraphicManipulatorDragAction(qt.ALL,t))).next((t=>(this._updateTranslateGraphicTooltip($.XY,t),t))).next((e=>{"end"===e.action&&(this._hideTooltip(),t=h(t))})),a.next((()=>this._onDragCancel(!0,(()=>t=h(t)))))}))),this._graphicMoveManipulation.forEachManipulator((t=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(t,!1))))}else this._graphicMoveManipulation.forEachManipulator((t=>{t.grabbable=!1,t.cursor=null}));this._graphicMoveManipulation.forEachManipulator((t=>this._manipulatorHandles.add(t.events.on("immediate-click",(t=>{this._manipulatorInfos.some((t=>t.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()})))))}_createMoveManipulation(t){const{graphic:e,tool:i,view:a}=this,n=this._graphicState;this._moveManipulation=new tt({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&K(e),snapToScene:!1,radius:tt.radiusForSymbol(e.symbol)}),this._moveManipulation.forEachManipulator((t=>this.addHandles([t.events.on("immediate-click",(i=>{this._moveManipulation.zManipulation.hasManipulator(t)||this._manipulatorInfos.some((t=>t.manipulator.selected))||this.emit("immediate-click",{...i,graphic:e}),i.stopPropagation()})),this._watchAndUpdateGrabState(t,!1)])));const o=t=>e=>{this.addHandles(e.events.on("focus-changed",(({action:e})=>{"focus"===e?this._updateTranslateTooltip(t):this._hideTooltip()})))};this._moveManipulation.xyManipulation.forEachManipulator(o($.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o($.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o($.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=e.geometry.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((a,n,o,s,r)=>{const{snappingStep:l,cancelSnapping:p}=Ot({predicate:t=>!!t.info,snappingManager:i.snappingManager,snappingContext:new xt({editGeometryOperations:this._editGeometryOperations,elevationInfo:t,pointer:r,excludeFeature:e,visualizer:new F}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next((t=>(this._onDragCancel(),t))).next(p),{steps:o=o.next((t=>this._trackNumDragging(t))).next((t=>{const e=this._manipulatorInfos.filter((t=>"vertex"===t.type&&t.manipulator.selected));return t.manipulatorType===W.TRANSLATE_XY&&1===e.length?{...t,info:e[0],snapOrigin:e[0].handle.pos}:t})).next(ut(this.view,t,e)).next(...l).next(ct()).next((t=>this._perGraphicManipulatorDragAction(qt.SELECTED_OR_ALL,t))).next((t=>(this._updateTranslateTooltip(a,t),t))),cancel:s}}),t,s,e),m((()=>n.displaying),(()=>this._updateMoveManipulationPosition()),g),n.on("changed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),m((()=>n.isDraped),(t=>{this._updateMoveManipulationPosition();const e="align-move-manipulation";t?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),e):this.removeHandles(e)}),g)])}_createVisualElements(){const{graphic:t,view:e}=this,i=J({view:e,graphic:t,forEachManipulator:t=>{if(!this.destroyed&&!this._recreatingManipulators){this._graphicMoveManipulation.forEachManipulator(t),this._moveManipulation.forEachManipulator(t);for(const e of this._manipulatorInfos)t(e.manipulator,W.TRANSLATE_XY)}},onManipulatorsChanged:t=>this.on("manipulators-changed",t)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof rt?i.visualElement:null),null!=this._outlineVisualElement&&this._manipulatorHandles.add(this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{this._graphicState.isDraped||this._updateMoveManipulationPosition()}))),this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(t,e=D(this.graphic)){if(t.component.vertices.length<=2)return null;const i=this._settings.manipulators.edgeOffset,a=i.size/2,n=a+i.collisionPadding,o=a/n,r=o*Math.sqrt(3)/2;null==this._edgeOffsetManipulatorGeometryInside&&(this._edgeOffsetManipulatorGeometryInside=pt(this._edgeOffsetManipulatorMaterial,r,o/2,o/2,i.height,i.offset)),null==this._edgeOffsetManipulatorGeometryOutside&&(this._edgeOffsetManipulatorGeometryOutside=pt(this._edgeOffsetManipulatorMaterial,-r,o/2,o/2,i.height,-i.offset));const l=[new N(this._edgeOffsetManipulatorGeometryInside.instantiate(),ft.Unfocused),new N(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ft.Focused),new N(this._edgeOffsetManipulatorGeometryOutside.instantiate(),ft.Unfocused),new N(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ft.Focused)],p=new k({view:this.view,renderObjects:l,elevationInfo:"on-the-ground"!==e.mode||j(this.graphic.symbol)?{mode:"absolute-height",offset:0}:e,worldOriented:!1,focusMultiplier:1,radius:n,available:!(!this.graphic.visible||!this.graphic.layer?.visible),collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1}}),h=new k({view:this.view,worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer?.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default",metadata:{deleting:!1}}),u={manipulator:p,handle:t,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:e,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(u,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(u);const c=[];for(const s of[t.leftVertex,t.rightVertex]){const t=this._getManipulatorInfoFromHandle(s);null!=t&&c.push(t.manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(u))))}u.locationUpdateHandle=s(c),this._manipulatorHandles.add(u.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(mt(p,this._createEdgeOffsetPipeline(u,e)),p),this._manipulatorHandles.add(mt(h,((t,i,a,n)=>{if("touch"===n){this._createEdgeOffsetPipeline(u,e)(t,i,a)}else if(this.enableMoveGraphic){const n=this.graphic,o=null!=n.geometry?n.geometry.spatialReference:null;i.next((t=>this._trackNumDragging(t))).next(gt(this.view,t.elevationAlignedLocation)).next(Z(this.view,t.elevationAlignedLocation,e,o,n)).next(_t()).next(ct()).next((t=>this._perGraphicManipulatorDragAction(qt.ALL,t))).next((t=>(this._updateTranslateGraphicTooltip($.XY,t),t))).next((t=>{"end"===t.action&&this._hideTooltip()})),a.next((()=>this._onDragCancel(!t.metadata.deleting)))}})),p);const m=t=>{this._manipulatorInfos.some((t=>t.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",m),h.events.on("immediate-click",m),p.events.on("focus-changed",(({action:t})=>{const{sketchOptions:e,tooltip:i}=this;if("focus"===t){const t=this._edgeOffsetTooltipInfo??=new bt({sketchOptions:e});t.distance=d,t.sketchOptions=e,this._updateTooltipAreaOrTotalLength(t),this._latestTooltipInfo=t,i.info=e.tooltips.effectiveEnabled?this._latestTooltipInfo:null}else this._hideTooltip()}))],p),this._manipulatorInfos.push(u),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),u}_autoHideEdgeOffsetManipulator(t,e){const i=t.manipulator,a=t.edgeManipulator,n=()=>{t.visibilityHandle=h(t.visibilityHandle);const n=this._getManipulatorInfoFromHandle(t.handle.leftVertex),o=this._getManipulatorInfoFromHandle(t.handle.rightVertex),l=null!=n&&null!=o&&st(n.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<e;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,t.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),r((()=>{h(t.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)}))],i),n()}_updateEdgeOffsetManipulator(t){this._updateManipulatorPosition(t);const{coordinateHelper:e}=this._editGeometryOperations.data,i=at(this.view,t.manipulator.elevationAlignedLocation,nt(e,t.handle,t.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(t.handle.leftVertex),n=this._getManipulatorInfoFromHandle(t.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?ot(i,o,s):M;t.manipulator.modelTransform=r,t.edgeManipulator.elevationAlignedLocation=t.manipulator.elevationAlignedLocation,t.edgeManipulator.modelTransform=r;const l=y(x(zt,o,s))/2;t.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgeOffsetPipeline(t,e){return(i,a,n)=>{this._clearSelection();const{step:o,cleanup:s}=this._initializeEdgeOffset(t,e);a.next((t=>this._trackNumDragging(t))).next(gt(this.view,i.elevationAlignedLocation)).next(o).next(z(this.view)).next(X(this.view,this._editGeometryOperations.data.spatialReference)).next(ct()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(t)).next(this._showEdgeOffsetTooltip()).next((t=>{"end"===t.action&&s()})),n.next((()=>{i.metadata.deleting||(s(),this._onDragCancel())}))}}_initializeEdgeOffset(t,e){const{view:i}=this,n=this._editGeometryOperations,o=nt(n.data.coordinateHelper,t.handle,e),r=n.createUndoGroup(),p=at(i,t.manipulator.elevationAlignedLocation,o);if(o.requiresSplitEdgeLeft){const e=this._getManipulatorInfoFromHandle(t.handle.leftVertex.leftEdge);null!=e&&this._splitEdgeManipulator(e,1)}if(o.requiresSplitEdgeRight){const e=this._getManipulatorInfoFromHandle(t.handle.rightVertex.rightEdge);null!=e&&this._splitEdgeManipulator(e,0)}const d=()=>new w({paths:[[t.handle.leftVertex.pos,t.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),u=this._settings,c=new rt({view:i,isDraped:this._graphicState.isDraped,geometry:d(),elevationInfo:t.elevationInfo,width:u.visualElements.lineGraphics.outline.width,attached:!1,isDecoration:!0});let _;const f=()=>{this._cleanEdgeOffsetCollapsedEdges(t),_=h(_)},v=this.on("undo",f);return _=s([m((()=>a(this._accentColor)),(t=>c.color=t),g),l(c),m((()=>this._graphicState.isDraped),(t=>c.isDraped=t)),this._graphicState.on("changed",(()=>c.geometry=d())),r,v]),c.attached=!0,{step:t=>null==o||null==p?(f(),null):{...t,operation:o,plane:p},cleanup:f}}_applyEdgeOffsetStep(t){return e=>{if(this.destroyed||null==e.operation)return e;this._updateEventState(Yt.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:n}=e;return(i||a||n)&&(this._offsetEdge(t,e),this.emit("reshape",{type:"reshape",mover:this.graphic})),e}}_applyComputeEdgeOffsetDistanceStep(){return t=>{const{operation:e,mapEnd:i}=t;return null==e||null==i?t:("start"===t.action&&e.selectArrowFromStartPoint(i),{...t,signedDistance:e.signedDistanceToPoint(i)})}}_showEdgeOffsetTooltip(){return t=>{const{mapEnd:e,signedDistance:i,operation:a}=t,{tooltip:n,sketchOptions:o}=this;if(null!=i){const n=this._edgeOffsetTooltipInfo??=new bt({sketchOptions:o});n.sketchOptions=o,n.distance="end"===t.action?d:Rt(this._graphicState.isDraped,i*a.selectedArrow,e,a.plane,this._editGeometryOperations.data.coordinateHelper),this._updateTooltipAreaOrTotalLength(n),this._latestTooltipInfo=n}else this._latestTooltipInfo=null;return n.info=o.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t}}_cleanEdgeOffsetCollapsedEdges(t){const e=t.handle.leftVertex.leftEdge?.leftVertex,i=t.handle.leftVertex,a=t.handle.rightVertex.rightEdge?.rightVertex,n=t.handle.rightVertex,o=this._editGeometryOperations.data.coordinateHelper,s=[];if(e&&o.distance(e.pos,i.pos)<Xt){const t=this._getManipulatorInfoFromHandle(i);null!=t&&s.push(t)}if(o.distance(i.pos,n.pos)<Xt||a&&o.distance(a.pos,n.pos)<Xt){const t=this._getManipulatorInfoFromHandle(n);null!=t&&s.push(t)}s.length&&this._removeVertices(s)}_computeVertexManipulatorSizeAndOutline(t){const e=t.size/2,i=e+t.collisionPadding;return{size:e/i,outlineSize:(e+t.outlineSize)/i}}_createVertexOrEdgeManipulator(t,e=D(this.graphic),i=!1){const{view:a}=this,n=this._settings;if("edge"===t.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(t,e);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:t,outlineSize:e}=this._computeVertexManipulatorSizeAndOutline(n.manipulators.vertex);this._vertexManipulatorGeometry=ht(this._vertexManipulatorMaterial,t,16,16),this._vertexManipulatorOutlineGeometry=ht(this._vertexManipulatorOutlineMaterial,e,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:t,outlineSize:e}=this._computeVertexManipulatorSizeAndOutline(n.manipulators.edge);this._edgeManipulatorGeometry=ht(this._edgeManipulatorMaterial,t,16,16),this._edgeManipulatorOutlineGeometry=ht(this._edgeManipulatorOutlineMaterial,e,16,16)}const{geometry:o}=this.graphic,r=o?.type,l="point"===r||"mesh"===r?[]:[new N(this._vertexManipulatorGeometry.instantiate(),Zt.Vertex|ft.Unselected),new N(this._vertexManipulatorOutlineGeometry.instantiate(),Zt.Vertex|ft.Unfocused|ft.Unselected),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Zt.Vertex|ft.Focused|ft.Unselected),new N(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),ft.Selected),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),ft.Selected|ft.Unfocused),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),ft.Selected|ft.Focused)];this.enableMidpoints&&l.push(new N(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),Zt.Edge|ft.Focused|ft.Unselected),new N(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Zt.Edge|ft.Focused|ft.Unselected),new N(this._edgeManipulatorGeometry.instantiate(),Zt.Edge|ft.Unfocused|ft.Unselected),new N(this._edgeManipulatorOutlineGeometry.instantiate(),Zt.Edge|ft.Unfocused|ft.Unselected));const p=new k({view:a,renderObjects:l,elevationInfo:e,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer?.visible),metadata:{deleting:!1}});p.selected=i,this._setTypeSpecificManipulatorSettings(p,t,e);const d="edge"===t.type?{manipulator:p,handle:t,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:p,handle:t,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(d),this.manipulators.add(p),this._updateManipulatorPosition(d),"edge"===d.type){const t=[];for(const e of[d.handle.leftVertex,d.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(e);null!=i&&t.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(d))))}d.locationUpdateHandle=s(t),this._manipulatorHandles.add(d.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);const u=mt(p,((t,i,a,n)=>{let o=null;const{snappingStep:s,cancelSnapping:r}=Ot({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new xt({editGeometryOperations:this._editGeometryOperations,elevationInfo:e,pointer:n,excludeFeature:this.graphic,visualizer:new F}),updatingHandles:this._updatingHandles,useZ:!1});a=a.next((e=>(this._onDragCancel(!t.metadata.deleting,(()=>o=h(o))),e))).next(r),i.next((t=>this._trackNumDragging(t))).next((t=>{if("start"===t.action&&(o=this._editGeometryOperations.createUndoGroup()),"edge"===d.type){const e=this._splitEdgeManipulator(d);return{...t,info:e,snapOrigin:e.handle.pos}}return{...t,info:d,snapOrigin:d.handle.pos}})).next(gt(this.view,t.elevationAlignedLocation)).next(Y(this.view,this.graphic,t.elevationAlignedLocation,t.location.spatialReference,this.graphic)).next(ut(this.view,e,this.graphic)).next(...s).next(ct()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(o=h(o)),this._updateTranslateVertexTooltip(t,$.XY,e)}))}));return this._manipulatorHandles.add([u,p.events.on("immediate-click",(t=>this._manipulatorClickCallback(t,d))),p.events.on("select-changed",(()=>{d.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()})),p.events.on("focus-changed",(({action:t})=>{"focus"===t&&"edge"!==d.type?this._updateTranslateVertexTooltip(p,$.XY):this._hideTooltip()}))],p),this.emit("manipulators-changed"),d}_trackNumDragging(t){switch(t.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return t}_onDragCancel(t=!0,e){switch(this._numDragging--,t&&(this.undo(),this.outputGeometry=null!=this._editGeometryOperations?this._editGeometryOperations.data.geometry:null),null!=this.tool.snappingManager&&this.tool.snappingManager.doneSnapping(),this._hideTooltip(),this._reshapeEventState){case Yt.NONE:break;case Yt.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case Yt.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(Yt.NONE)}_setTypeSpecificManipulatorSettings(t,e,i){const{graphic:a}=this,n=this._settings;switch(e.type){case"vertex":{t.state=Zt.Vertex,t.selectable=!0,t.cursor="move",t.collisionPriority=2;const{size:e,collisionPadding:o}=n.manipulators.vertex;t.radius=e/2+o,t.elevationInfo=i;const{geometry:s}=a,r=s?.type;t.interactive=null!=r&&"point"!==r&&"mesh"!==r;break}case"edge":{t.state=Zt.Edge,t.selectable=!1,t.cursor="copy",t.collisionPriority=-1;const{size:e,collisionPadding:o}=n.manipulators.edge;t.radius=e/2+o,t.elevationInfo="on-the-ground"!==i.mode||j(a.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(t,e){return t.events.on("grab-changed",(i=>this._onGrabStateChanged(t,e,i.action,i.pointerType)))}_onGrabStateChanged(t,e,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)e&&this._updateSelection(t),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Yt.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((t=>{const{manipulator:e}=t,{geometry:i}=this.graphic,a=i?.type;e.interactive=e.grabbing||!this._numGrabbing&&null!=a&&"point"!==a&&"mesh"!==a,"edgeManipulator"in t&&(t.edgeManipulator.interactive=t.edgeManipulator.grabbing||!this._numGrabbing)})),this._graphicMoveManipulation.forEachManipulator((t=>{t.interactive=t.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const t of this._manipulatorInfos)t.manipulator.grabbing||(t.manipulator.selected=!1)}_updateSelection(t){t.grabbing&&!t.selected&&t.selectable&&(this._clearSelection(),t.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(t){null!=t&&(t.manipulator.metadata.deleting=!0,this.manipulators.remove(t.manipulator),this._manipulatorHandles.remove(t.manipulator),i(this._manipulatorInfos,t),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(t){if(t)for(const e of this._manipulatorInfos)if(t===e.handle)return e;return null}_updateManipulatorPosition(t){if(null==t)return;const e=this._editGeometryOperations;if("vertex"===t.type)t.manipulator.location=e.data.coordinateHelper.vectorToDehydratedPoint(t.handle.pos,Ft),t.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=t.manipulator.renderLocation);else if("edge"===t.type){const i=this._getManipulatorInfoFromHandle(t.handle.leftVertex),a=this._getManipulatorInfoFromHandle(t.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if(null!=t.manipulator.elevationInfo&&"on-the-ground"===t.manipulator.elevationInfo.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;t.manipulator.location=L(r,l,p,e.data.spatialReference)}else O(zt,n.renderLocation,o.renderLocation,.5),t.manipulator.renderLocation=zt}}_splitEdgeManipulator(t,e=.5){const i=this._editGeometryOperations,a=i.splitEdge(t.handle,e).createdVertex;t.locationUpdateHandle=h(t.locationUpdateHandle);const n=D(this.graphic);let o;this.enableEdgeOffset?(this._removeManipulator(t),o=this._createVertexOrEdgeManipulator(a)):(o=t,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(t.manipulator,t.handle,n)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(o),this.enableEdgeOffset||this._updateTranslateVertexTooltip(o.manipulator,$.XY),this._updateSelection(t.manipulator);const s=this._updateEventState(Yt.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(Yt.NONE),o}_updateMoveManipulationPosition(){const t=b(zt,0,0,0);let e=0,i=!1,a=null,n=null;for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected?(e++,E(t,t,o.manipulator.renderLocation),null==a||o.selectedIndex>a.selectedIndex?(n=a,a=o):(null==n||o.selectedIndex>n.selectedIndex)&&(n=o)):i=!0);if(0===e){const t=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=t,this._moveManipulation.xyAxisManipulation.available=t,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=t,this._moveManipulation.zManipulation.available=t&&this.enableZShape&&K(this.graphic),this._moveManipulation.angle=q(this.graphic.geometry),this._moveManipulation.radius=tt.radiusForSymbol(this.graphic.symbol)}else{const t=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=t,this._moveManipulation.xyAxisManipulation.available=t,this._moveManipulation.zManipulation.available=t&&this.enableZVertex&&K(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=t&&1!==e;let i=0;if(null!=a){const t=a.handle.pos,e=null!=n?n.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,o=null==n&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;e&&o?this._moveManipulation.xyAxisManipulation.available=!1:e?i=Nt(e,t):o&&(i=Nt(t,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=Q}0!==e&&i?(G(t,t,1/e),Ft.spatialReference=this._editGeometryOperations.data.spatialReference,Ft.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(t,Ft),this._moveManipulation.elevationAlignedLocation=Ft):null==this._outlineVisualElement||this._graphicState.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(this.view,this._moveManipulation,this.graphic):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(t){const e=new Array,i=this._editGeometryOperations;for(const a of t){const t=a.handle.component;if("vertex"===a.type&&i.canRemoveVertex(t)){e.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&t.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(t.edges[0]))}}if(e.length>0){const t=e.map((t=>{const e=i.data.components.indexOf(t.component);return{coordinates:i.data.coordinateHelper.vectorToArray(t.pos),componentIndex:e,vertexIndex:t.index}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(Yt.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:t.map((t=>t.coordinates)),vertices:t}),this.destroyed)return;if(a&&(this._updateEventState(Yt.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(t,e,i=("start"===e.action?yt.NEW_STEP:yt.ACCUMULATE_STEPS)){const a=this._editGeometryOperations;a.moveVertices(t.map((t=>t.handle)),e.mapDeltaX,e.mapDeltaY,e.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const n of t)this._updateManipulatorPosition(n)}_offsetEdge(t,e){if(null==e.operation||null==e.signedDistance)return;const i=this._editGeometryOperations,a=e.operation.clone();a.distance=e.signedDistance,i.updateVertices([t.handle.leftVertex,t.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t.handle.rightVertex))}_manipulatorClickCallback(t,e){t.shiftKey||this._clearSelection(),"vertex"===e.type&&(e.manipulator.selected=!e.manipulator.selected,t.button===dt.Right&&this._removeVertices([e])),"edge"===e.type&&t.button===dt.Left&&this._splitEdgeManipulator(e),t.stopPropagation()}_updateTranslateTooltip(t,e){const i=this._manipulatorInfos.filter((t=>"vertex"===t.type&&t.manipulator.selected));1===i.length?this._updateTranslateVertexTooltip(i[0].manipulator,t,e):this._updateTranslateGraphicTooltip(t,e)}_updateTranslateGraphicTooltip(t,e){const{sketchOptions:i,tooltip:a}=this;switch(t){case $.XY:this._latestTooltipInfo=this._translateGraphicTooltipInfo??=new St({sketchOptions:i}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,e,((t,e)=>Lt(t,e)));break;case $.XY_AXIS:this._latestTooltipInfo=this._translateGraphicXYTooltipInfo??=new It({sketchOptions:i}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,e,((t,i)=>u(Lt(t,i),et(e))));break;case $.Z:this._latestTooltipInfo=this._translateGraphicZTooltipInfo??=new Gt({sketchOptions:i}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,e,jt)}this._latestTooltipInfo.sketchOptions=i,a.info=i.tooltips.effectiveEnabled?this._latestTooltipInfo:null}_updateTranslateVertexTooltip(t,e,i){const{sketchOptions:a,tooltip:n}=this;switch(e){case $.XY:this._latestTooltipInfo=this._translateVertexTooltipInfo??=new Ht({sketchOptions:a}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,i,((t,e)=>Lt(t,e))),this._updateTooltipAreaOrTotalLength(this._latestTooltipInfo);break;case $.XY_AXIS:this._latestTooltipInfo=this._translateVertexXYTooltipInfo??=new wt({sketchOptions:a}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,i,((t,e)=>u(Lt(t,e),et(i)))),this._updateTooltipAreaOrTotalLength(this._latestTooltipInfo);break;case $.Z:this._latestTooltipInfo=this._translateVertexZTooltipInfo??=new Tt({sketchOptions:a}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,i,jt)}const o=kt(t.location);this._latestTooltipInfo.elevation=null!=o?Vt({actual:o}):null,this._latestTooltipInfo.sketchOptions=a,n.info=a.tooltips.effectiveEnabled?this._latestTooltipInfo:null}_updateTranslateTooltipDistance(t,e,i){if(null!=e&&"end"!==e.action){const{mapStart:a,mapEnd:n}=e,o=i(a,n);t.distance=null!=o?o:d}else t.distance=d}_updateTooltipAreaOrTotalLength(t){const{geometry:e}=this.graphic;if(null==e)return t.area=null,void(t.totalLength=null);t.area="polygon"===e.type?At(e):null,t.totalLength="polyline"===e.type?Dt(e):null}_hideTooltip(){this.tooltip.clear(),this._latestTooltipInfo=null}get test(){return{segmentLabels:this._segmentLabels,manipulatorInfos:this._manipulatorInfos}}};function Nt(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])+Math.PI/2}function Rt(t,e,i,a,n){if(t){const t=n.toXYZ(n.pointToVector(i)),o=V(a,t,A.get()),s=Pt(o,t,n.spatialReference);if(null!=s)return c(s.value*Math.sign(e),s.unit)}return c(e*_(i.spatialReference),"meters")}t([f()],Ct.prototype,"_editGeometryOperations",void 0),t([f()],Ct.prototype,"_segmentLabels",void 0),t([f({constructOnly:!0})],Ct.prototype,"tool",void 0),t([f()],Ct.prototype,"tooltip",void 0),t([f()],Ct.prototype,"inputGeometry",null),t([f()],Ct.prototype,"outputGeometry",void 0),t([f({readOnly:!0})],Ct.prototype,"updating",null),t([f()],Ct.prototype,"manipulators",null),t([f()],Ct.prototype,"view",null),t([f()],Ct.prototype,"graphic",null),t([f()],Ct.prototype,"enableZShape",null),t([f()],Ct.prototype,"enableZVertex",null),t([f()],Ct.prototype,"enableMoveGraphic",null),t([f()],Ct.prototype,"enableMidpoints",null),t([f()],Ct.prototype,"enableEdgeOffset",null),t([f()],Ct.prototype,"sketchOptions",null),t([f()],Ct.prototype,"_accentColor",null),Ct=t([v("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],Ct);const Ft=L(0,0,void 0,Ut.WGS84),zt=S(),Xt=1e-6;var Zt,Yt,qt;!function(t){t.Vertex=vt.Custom1,t.Edge=vt.Custom2}(Zt||(Zt={})),function(t){t[t.NONE=0]="NONE",t[t.MOVING=1]="MOVING",t[t.RESHAPING=2]="RESHAPING"}(Yt||(Yt={})),function(t){t[t.ALL=0]="ALL",t[t.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(qt||(qt={}));export{Ct as ReshapeOperation};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../geometry.js";import e from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as h}from"../../../../../core/maybe.js";import{zeroMeters as d,scale as u,createLength as c}from"../../../../../core/quantityUtils.js";import{watch as m,initial as g}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as _}from"../../../../../core/unitUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as y,f as x,m as O,s as b,g as E,h as G}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as T}from"../../../../../core/support/UpdatingHandles.js";import w from"../../../../../geometry/Polyline.js";import{hasCompatibleTopology as H}from"../../../../../geometry/support/coordsUtils.js";import{projectPoint as V}from"../../../../../geometry/support/plane.js";import{sv3d as A}from"../../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as L}from"../../../../../layers/graphics/dehydratedPoint.js";import{getGraphicEffectiveElevationInfo as D}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as j}from"../../../../../symbols/support/utils.js";import{Manipulator3D as k}from"../../Manipulator3D.js";import{createManipulatorMaterial as P,createManipulatorOutlineMaterial as U,placeAtGraphic as C}from"../../manipulatorUtils.js";import{RenderObject as N}from"../../RenderObject.js";import{SegmentLabels3D as R}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as F}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as z,convertToMapCoordinates as X,screenToMapXYAtLocation as Z,screenToMapXYForGraphicAtLocation as Y}from"../dragEventPipeline3D.js";import{orientation as q}from"../geometryUtils.js";import{ManipulatorType as W}from"../ManipulatorType.js";import{canMoveZ as K}from"../manipulatorUtils.js";import{Settings as B}from"../settings.js";import{createVisualElements as J}from"../visualElementUtils.js";import{discRadiusSmall as Q}from"../manipulations/config.js";import{ManipulationType as $,MoveManipulation as tt}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as et}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as it}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as at,createEdgeOffsetOperation as nt,edgeOffsetRotationMatrix as ot,screenEdgeLengthSquared as st}from"./edgeOffsetUtils.js";import{OutlineVisualElement as rt}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as lt}from"../../../layers/graphics/GraphicState.js";import{createExtrudedTriangle as pt,createSphereGeometry as ht}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as dt}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as ut,addMapDelta as ct,createManipulatorDragEventPipeline as mt,dragAtLocation as gt,addScreenDelta as _t}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ft,ManipulatorStateCustomFlags as vt}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as Mt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as yt}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as xt}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Ot}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{ReshapeEdgeOffsetTooltipInfo as bt}from"../../../../interactive/tooltip/ReshapeTooltipInfos.js";import{Tooltip as Et}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as Gt,TranslateGraphicXYTooltipInfo as It,TranslateGraphicTooltipInfo as St,TranslateVertexZTooltipInfo as Tt,TranslateVertexXYTooltipInfo as wt,TranslateVertexTooltipInfo as Ht}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{makeElevationField as Vt}from"../../../../interactive/tooltip/fields/fields.js";import{autoArea2D as At}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoDistanceBetweenPoints2D as Lt,autoLength2D as Dt}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as jt,elevationFromPoint as kt}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as Pt}from"../../../../support/geodesicLengthMeasurementUtils.js";import Ut from"../../../../../geometry/SpatialReference.js";let Ct=class extends(n.EventedMixin(e)){constructor(t){super(t),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Yt.NONE,this._updatingHandles=new T,this._recreatingManipulators=!1,this._settings=new B({getTheme:()=>this.view.effectiveTheme}),this._latestTooltipInfo=null,this._translateGraphicTooltipInfo=null,this._translateGraphicXYTooltipInfo=null,this._translateGraphicZTooltipInfo=null,this._translateVertexTooltipInfo=null,this._translateVertexXYTooltipInfo=null,this._translateVertexZTooltipInfo=null,this._edgeOffsetTooltipInfo=null,this.outputGeometry=null,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:t,view:e}=this,i=this._settings.manipulators,n=i.vertex;this._vertexManipulatorMaterial=P(a(n.color),n.renderOccluded),this._vertexManipulatorOutlineMaterial=U(a(n.outlineColor),n.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=U(a(n.hoverOutlineColor),n.renderOccluded);const o=i.edge;this._edgeManipulatorMaterial=P(a(o.color),o.renderOccluded),this._edgeManipulatorOutlineMaterial=U(a(o.outlineColor),o.renderOccluded);const s=i.edgeOffset;this._edgeOffsetManipulatorMaterial=P(a(s.color),s.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=P(a(s.hoverColor),s.renderOccluded,!1);const r=i.selected;this._selectedManipulatorMaterial=P(a(r.color),r.renderOccluded),this._selectedManipulatorOutlineMaterial=U(a(r.outlineColor),r.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=U(a(r.hoverOutlineColor),r.renderOccluded);const l=this._graphicState=new lt({graphic:t});this.tooltip=new Et({view:e}),this.addHandles([m((()=>{const t=this._settings.manipulators;return{vertexSettings:t.vertex,edgeSettings:t.edge,edgeOffsetSettings:t.edgeOffset,selectedSettings:t.selected}}),(({vertexSettings:t,edgeSettings:e,edgeOffsetSettings:i,selectedSettings:a})=>{t.applyColor(this._vertexManipulatorMaterial),t.applyOutline(this._vertexManipulatorOutlineMaterial),t.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),e.applyColor(this._edgeManipulatorMaterial),e.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),a.applyColor(this._selectedManipulatorMaterial),a.applyOutline(this._selectedManipulatorOutlineMaterial),a.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),m((()=>l.displaying),(t=>{for(const e of this._manipulatorInfos)e.manipulator.available=t})),m((()=>({labels:this._segmentLabels,enabled:this.sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:t,enabled:e,edgeOffsetEnabled:i})=>{null!=t&&(t.visible=e,t.edgeDistance=i?"far":"default")}),g),m((()=>this.sketchOptions.tooltips.effectiveEnabled),(t=>{this.tooltip.info=t?this._latestTooltipInfo:null}),g),this.view.trackGraphicState(l)])}destroy(){this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip),this._removeManipulators(),this._updatingHandles.destroy()}get inputGeometry(){return null!=this._editGeometryOperations?this._editGeometryOperations.data.geometry:null}set inputGeometry(t){this._recreateEditGeometryAndManipulators(t)}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}get sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}removeSelectedVertices(){const t=this._manipulatorInfos.filter((t=>t.manipulator.selected&&"vertex"===t.type));this._removeVertices(t)}onManipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._graphicMoveManipulation=p(this._graphicMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(t){if(null==this._editGeometryOperations)return;const e=D(this.graphic);for(const i of this._editGeometryOperations.data.components){const a=t?.byComponentIndex.get(i.index);for(const t of i.vertices){const i=a?.has(t.index);this._createVertexOrEdgeManipulator(t,e,i)}for(const t of i.edges)this._createVertexOrEdgeManipulator(t,e)}this._createGraphicMoveManipulation(),this._createMoveManipulation(e),this._createVisualElements()}get canRedo(){return null!=this._editGeometryOperations&&this._editGeometryOperations.canRedo}get canUndo(){return null!=this._editGeometryOperations&&this._editGeometryOperations.canUndo}redo(){if(null==this._editGeometryOperations)return null;const t=this._editGeometryOperations.redo();return null!=t&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),t}undo(){if(null==this._editGeometryOperations)return null;this.emit("undo");const t=this._editGeometryOperations.undo();return null!=t&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),t}_recreateManipulators(){this._recreatingManipulators||(this._recreatingManipulators=!0,this._removeManipulators(),this._hideTooltip(),this._createManipulators(),this._recreatingManipulators=!1)}_recreateEditGeometryAndManipulators(t){const e={byComponentIndex:new Map};if(null!=t&&null!=this.inputGeometry&&H(t,this.inputGeometry))for(const n of this._manipulatorInfos)if("vertex"===n.type&&n.manipulator.selected){const{index:t,component:{index:i}}=n.handle,{byComponentIndex:a}=e,o=a.get(i)||new Set;o.add(t),a.set(i,o)}if(this._recreatingManipulators=!0,this._removeManipulators(),this._hideTooltip(),this._editGeometryOperations=p(this._editGeometryOperations),this._segmentLabels=p(this._segmentLabels),null==t)return void(this._recreatingManipulators=!1);const i="mesh"===t.type?t.anchor:t;this._editGeometryOperations=Mt.fromGeometry(i,this.view.state.viewingMode),this._createManipulators(e);const a=this.sketchOptions.labels;this._segmentLabels=new R({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:D(this.graphic),labelOptions:a,graphic:this.graphic,graphicState:this._graphicState},visible:a.enabled}),this._recreatingManipulators=!1}_perGraphicManipulatorDragAction(t,e){if("end"===e.action)return e;let i=0;const a=[],n=this._manipulatorInfos.some((t=>"vertex"===t.type&&t.manipulator.selected)),o=t===qt.SELECTED_OR_ALL&&n;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||a.push(s),i++);if(0===a.length)return e;this._moveVertices(a,e);if(a.length===i){if(this._updateEventState(Yt.MOVING),this.destroyed)return e;this.emit("move",{type:"move",dx:e.screenDeltaX,dy:e.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(Yt.RESHAPING),this.destroyed)return e;this.emit("reshape",{type:"reshape",mover:this.graphic})}return e}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((t,e)=>"vertex"===e.type&&e.manipulator.selected?t+1:t),0)>1}_perVertexManipulatorDragAction(t){if(this._updateEventState(Yt.RESHAPING),this.destroyed)return;const{mapDeltaX:e,mapDeltaY:i,mapDeltaZ:a}=t;if(!e&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===t.info)&&n.push(o);this._moveVertices(n,t,yt.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(t){if(t===this._reshapeEventState)return!1;switch(t){case Yt.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Yt.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case Yt.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case Yt.MOVING:switch(this._reshapeEventState){case Yt.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case Yt.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 Yt.RESHAPING:switch(this._reshapeEventState){case Yt.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case Yt.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 e=this._reshapeEventState!==t;return this._reshapeEventState=t,e}_createGraphicMoveManipulation(){const{tool:t,view:e}=this,i=this._graphicState;if(this._graphicMoveManipulation=new it({tool:t,view:e,graphicState:i}),this.enableMoveGraphic){let t=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((e,i,a)=>{i.next((t=>this._trackNumDragging(t))).next((e=>("start"===e.action&&(t=this._editGeometryOperations.createUndoGroup()),e))).next((t=>this._perGraphicManipulatorDragAction(qt.ALL,t))).next((t=>(this._updateTranslateGraphicTooltip($.XY,t),t))).next((e=>{"end"===e.action&&(this._hideTooltip(),t=h(t))})),a.next((()=>this._onDragCancel(!0,(()=>t=h(t)))))}))),this._graphicMoveManipulation.forEachManipulator((t=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(t,!1))))}else this._graphicMoveManipulation.forEachManipulator((t=>{t.grabbable=!1,t.cursor=null}));this._graphicMoveManipulation.forEachManipulator((t=>this._manipulatorHandles.add(t.events.on("immediate-click",(t=>{this._manipulatorInfos.some((t=>t.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()})))))}_createMoveManipulation(t){const{graphic:e,tool:i,view:a}=this,n=this._graphicState;this._moveManipulation=new tt({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&K(e),snapToScene:!1,radius:tt.radiusForSymbol(e.symbol)}),this._moveManipulation.forEachManipulator((t=>this.addHandles([t.events.on("immediate-click",(i=>{this._moveManipulation.zManipulation.hasManipulator(t)||this._manipulatorInfos.some((t=>t.manipulator.selected))||this.emit("immediate-click",{...i,graphic:e}),i.stopPropagation()})),this._watchAndUpdateGrabState(t,!1)])));const o=t=>e=>{this.addHandles(e.events.on("focus-changed",(({action:e})=>{"focus"===e?this._updateTranslateTooltip(t):this._hideTooltip()})))};this._moveManipulation.xyManipulation.forEachManipulator(o($.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o($.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o($.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=e.geometry.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((a,n,o,s,r)=>{const{snappingStep:l,cancelSnapping:p}=Ot({predicate:t=>!!t.info,snappingManager:i.snappingManager,snappingContext:new xt({editGeometryOperations:this._editGeometryOperations,elevationInfo:t,pointer:r,excludeFeature:e,visualizer:new F}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next((t=>(this._onDragCancel(),t))).next(p),{steps:o=o.next((t=>this._trackNumDragging(t))).next((t=>{const e=this._manipulatorInfos.filter((t=>"vertex"===t.type&&t.manipulator.selected));return t.manipulatorType===W.TRANSLATE_XY&&1===e.length?{...t,info:e[0],snapOrigin:e[0].handle.pos}:t})).next(ut(this.view,t,e)).next(...l).next(ct()).next((t=>this._perGraphicManipulatorDragAction(qt.SELECTED_OR_ALL,t))).next((t=>(this._updateTranslateTooltip(a,t),t))),cancel:s}}),t,s,e),m((()=>n.displaying),(()=>this._updateMoveManipulationPosition()),g),n.on("changed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),m((()=>n.isDraped),(t=>{this._updateMoveManipulationPosition();const e="align-move-manipulation";t?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),e):this.removeHandles(e)}),g)])}_createVisualElements(){const{graphic:t,view:e}=this,i=J({view:e,graphic:t,forEachManipulator:t=>{if(!this.destroyed&&!this._recreatingManipulators){this._graphicMoveManipulation.forEachManipulator(t),this._moveManipulation.forEachManipulator(t);for(const e of this._manipulatorInfos)t(e.manipulator,W.TRANSLATE_XY)}},onManipulatorsChanged:t=>this.on("manipulators-changed",t)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof rt?i.visualElement:null),null!=this._outlineVisualElement&&this._manipulatorHandles.add(this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{this._graphicState.isDraped||this._updateMoveManipulationPosition()}))),this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(t,e=D(this.graphic)){if(t.component.vertices.length<=2)return null;const i=this._settings.manipulators.edgeOffset,a=i.size/2,n=a+i.collisionPadding,o=a/n,r=o*Math.sqrt(3)/2;null==this._edgeOffsetManipulatorGeometryInside&&(this._edgeOffsetManipulatorGeometryInside=pt(this._edgeOffsetManipulatorMaterial,r,o/2,o/2,i.height,i.offset)),null==this._edgeOffsetManipulatorGeometryOutside&&(this._edgeOffsetManipulatorGeometryOutside=pt(this._edgeOffsetManipulatorMaterial,-r,o/2,o/2,i.height,-i.offset));const l=[new N(this._edgeOffsetManipulatorGeometryInside.instantiate(),ft.Unfocused),new N(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ft.Focused),new N(this._edgeOffsetManipulatorGeometryOutside.instantiate(),ft.Unfocused),new N(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ft.Focused)],p=new k({view:this.view,renderObjects:l,elevationInfo:"on-the-ground"!==e.mode||j(this.graphic.symbol)?{mode:"absolute-height",offset:0}:e,worldOriented:!1,focusMultiplier:1,radius:n,available:!(!this.graphic.visible||!this.graphic.layer?.visible),collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1}}),h=new k({view:this.view,worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer?.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default",metadata:{deleting:!1}}),u={manipulator:p,handle:t,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:e,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(u,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(u);const c=[];for(const s of[t.leftVertex,t.rightVertex]){const t=this._getManipulatorInfoFromHandle(s);null!=t&&c.push(t.manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(u))))}u.locationUpdateHandle=s(c),this._manipulatorHandles.add(u.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(mt(p,this._createEdgeOffsetPipeline(u,e)),p),this._manipulatorHandles.add(mt(h,((t,i,a,n)=>{if("touch"===n){this._createEdgeOffsetPipeline(u,e)(t,i,a)}else if(this.enableMoveGraphic){const n=this.graphic,o=null!=n.geometry?n.geometry.spatialReference:null;i.next((t=>this._trackNumDragging(t))).next(gt(this.view,t.elevationAlignedLocation)).next(Z(this.view,t.elevationAlignedLocation,e,o,n)).next(_t()).next(ct()).next((t=>this._perGraphicManipulatorDragAction(qt.ALL,t))).next((t=>(this._updateTranslateGraphicTooltip($.XY,t),t))).next((t=>{"end"===t.action&&this._hideTooltip()})),a.next((()=>this._onDragCancel(!t.metadata.deleting)))}})),p);const m=t=>{this._manipulatorInfos.some((t=>t.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...t,graphic:this.graphic}),t.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",m),h.events.on("immediate-click",m),p.events.on("focus-changed",(({action:t})=>{const{sketchOptions:e,tooltip:i}=this;if("focus"===t){const t=this._edgeOffsetTooltipInfo??=new bt({sketchOptions:e});t.distance=d,t.sketchOptions=e,this._updateTooltipAreaOrTotalLength(t),this._latestTooltipInfo=t,i.info=e.tooltips.effectiveEnabled?this._latestTooltipInfo:null}else this._hideTooltip()}))],p),this._manipulatorInfos.push(u),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),u}_autoHideEdgeOffsetManipulator(t,e){const i=t.manipulator,a=t.edgeManipulator,n=()=>{t.visibilityHandle=h(t.visibilityHandle);const n=this._getManipulatorInfoFromHandle(t.handle.leftVertex),o=this._getManipulatorInfoFromHandle(t.handle.rightVertex),l=null!=n&&null!=o&&st(n.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<e;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,t.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),r((()=>{h(t.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)}))],i),n()}_updateEdgeOffsetManipulator(t){this._updateManipulatorPosition(t);const{coordinateHelper:e}=this._editGeometryOperations.data,i=at(this.view,t.manipulator.elevationAlignedLocation,nt(e,t.handle,t.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(t.handle.leftVertex),n=this._getManipulatorInfoFromHandle(t.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?ot(i,o,s):M;t.manipulator.modelTransform=r,t.edgeManipulator.elevationAlignedLocation=t.manipulator.elevationAlignedLocation,t.edgeManipulator.modelTransform=r;const l=y(x(zt,o,s))/2;t.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgeOffsetPipeline(t,e){return(i,a,n)=>{this._clearSelection();const{step:o,cleanup:s}=this._initializeEdgeOffset(t,e);a.next((t=>this._trackNumDragging(t))).next(gt(this.view,i.elevationAlignedLocation)).next(o).next(z(this.view)).next(X(this.view,this._editGeometryOperations.data.spatialReference)).next(ct()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(t)).next(this._showEdgeOffsetTooltip()).next((t=>{"end"===t.action&&s()})),n.next((()=>{i.metadata.deleting||(s(),this._onDragCancel())}))}}_initializeEdgeOffset(t,e){const{view:i}=this,n=this._editGeometryOperations,o=nt(n.data.coordinateHelper,t.handle,e),r=n.createUndoGroup(),p=at(i,t.manipulator.elevationAlignedLocation,o);if(o.requiresSplitEdgeLeft){const e=this._getManipulatorInfoFromHandle(t.handle.leftVertex.leftEdge);null!=e&&this._splitEdgeManipulator(e,1)}if(o.requiresSplitEdgeRight){const e=this._getManipulatorInfoFromHandle(t.handle.rightVertex.rightEdge);null!=e&&this._splitEdgeManipulator(e,0)}const d=()=>new w({paths:[[t.handle.leftVertex.pos,t.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),u=this._settings,c=new rt({view:i,isDraped:this._graphicState.isDraped,geometry:d(),elevationInfo:t.elevationInfo,width:u.visualElements.lineGraphics.outline.width,attached:!1,isDecoration:!0});let _;const f=()=>{this._cleanEdgeOffsetCollapsedEdges(t),_=h(_)},v=this.on("undo",f);return _=s([m((()=>a(this._accentColor)),(t=>c.color=t),g),l(c),m((()=>this._graphicState.isDraped),(t=>c.isDraped=t)),this._graphicState.on("changed",(()=>c.geometry=d())),r,v]),c.attached=!0,{step:t=>null==o||null==p?(f(),null):{...t,operation:o,plane:p},cleanup:f}}_applyEdgeOffsetStep(t){return e=>{if(this.destroyed||null==e.operation)return e;this._updateEventState(Yt.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:n}=e;return(i||a||n)&&(this._offsetEdge(t,e),this.emit("reshape",{type:"reshape",mover:this.graphic})),e}}_applyComputeEdgeOffsetDistanceStep(){return t=>{const{operation:e,mapEnd:i}=t;return null==e||null==i?t:("start"===t.action&&e.selectArrowFromStartPoint(i),{...t,signedDistance:e.signedDistanceToPoint(i)})}}_showEdgeOffsetTooltip(){return t=>{const{mapEnd:e,signedDistance:i,operation:a}=t,{tooltip:n,sketchOptions:o}=this;if(null!=i){const n=this._edgeOffsetTooltipInfo??=new bt({sketchOptions:o});n.sketchOptions=o,n.distance="end"===t.action?d:Rt(this._graphicState.isDraped,i*a.selectedArrow,e,a.plane,this._editGeometryOperations.data.coordinateHelper),this._updateTooltipAreaOrTotalLength(n),this._latestTooltipInfo=n}else this._latestTooltipInfo=null;return n.info=o.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t}}_cleanEdgeOffsetCollapsedEdges(t){const e=t.handle.leftVertex.leftEdge?.leftVertex,i=t.handle.leftVertex,a=t.handle.rightVertex.rightEdge?.rightVertex,n=t.handle.rightVertex,o=this._editGeometryOperations.data.coordinateHelper,s=[];if(e&&o.distance(e.pos,i.pos)<Xt){const t=this._getManipulatorInfoFromHandle(i);null!=t&&s.push(t)}if(o.distance(i.pos,n.pos)<Xt||a&&o.distance(a.pos,n.pos)<Xt){const t=this._getManipulatorInfoFromHandle(n);null!=t&&s.push(t)}s.length&&this._removeVertices(s)}_computeVertexManipulatorSizeAndOutline(t){const e=t.size/2,i=e+t.collisionPadding;return{size:e/i,outlineSize:(e+t.outlineSize)/i}}_createVertexOrEdgeManipulator(t,e=D(this.graphic),i=!1){const{view:a}=this,n=this._settings;if("edge"===t.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(t,e);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:t,outlineSize:e}=this._computeVertexManipulatorSizeAndOutline(n.manipulators.vertex);this._vertexManipulatorGeometry=ht(this._vertexManipulatorMaterial,t,16,16),this._vertexManipulatorOutlineGeometry=ht(this._vertexManipulatorOutlineMaterial,e,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:t,outlineSize:e}=this._computeVertexManipulatorSizeAndOutline(n.manipulators.edge);this._edgeManipulatorGeometry=ht(this._edgeManipulatorMaterial,t,16,16),this._edgeManipulatorOutlineGeometry=ht(this._edgeManipulatorOutlineMaterial,e,16,16)}const{geometry:o}=this.graphic,r=o?.type,l="point"===r||"mesh"===r?[]:[new N(this._vertexManipulatorGeometry.instantiate(),Zt.Vertex|ft.Unselected),new N(this._vertexManipulatorOutlineGeometry.instantiate(),Zt.Vertex|ft.Unfocused|ft.Unselected),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Zt.Vertex|ft.Focused|ft.Unselected),new N(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),ft.Selected),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),ft.Selected|ft.Unfocused),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),ft.Selected|ft.Focused)];this.enableMidpoints&&l.push(new N(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),Zt.Edge|ft.Focused|ft.Unselected),new N(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Zt.Edge|ft.Focused|ft.Unselected),new N(this._edgeManipulatorGeometry.instantiate(),Zt.Edge|ft.Unfocused|ft.Unselected),new N(this._edgeManipulatorOutlineGeometry.instantiate(),Zt.Edge|ft.Unfocused|ft.Unselected));const p=new k({view:a,renderObjects:l,elevationInfo:e,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer?.visible),metadata:{deleting:!1}});p.selected=i,this._setTypeSpecificManipulatorSettings(p,t,e);const d="edge"===t.type?{manipulator:p,handle:t,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:p,handle:t,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(d),this.manipulators.add(p),this._updateManipulatorPosition(d),"edge"===d.type){const t=[];for(const e of[d.handle.leftVertex,d.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(e);null!=i&&t.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(d))))}d.locationUpdateHandle=s(t),this._manipulatorHandles.add(d.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);const u=mt(p,((t,i,a,n)=>{let o=null;const{snappingStep:s,cancelSnapping:r}=Ot({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new xt({editGeometryOperations:this._editGeometryOperations,elevationInfo:e,pointer:n,excludeFeature:this.graphic,visualizer:new F}),updatingHandles:this._updatingHandles,useZ:!1});a=a.next((e=>(this._onDragCancel(!t.metadata.deleting,(()=>o=h(o))),e))).next(r),i.next((t=>this._trackNumDragging(t))).next((t=>{if("start"===t.action&&(o=this._editGeometryOperations.createUndoGroup()),"edge"===d.type){const e=this._splitEdgeManipulator(d);return{...t,info:e,snapOrigin:e.handle.pos}}return{...t,info:d,snapOrigin:d.handle.pos}})).next(gt(this.view,t.elevationAlignedLocation)).next(Y(this.view,this.graphic,t.elevationAlignedLocation,t.location.spatialReference,this.graphic)).next(ut(this.view,e,this.graphic)).next(...s).next(ct()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(o=h(o)),this._updateTranslateVertexTooltip(t,$.XY,e)}))}));return this._manipulatorHandles.add([u,p.events.on("immediate-click",(t=>this._manipulatorClickCallback(t,d))),p.events.on("select-changed",(()=>{d.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()})),p.events.on("focus-changed",(({action:t})=>{"focus"===t&&"edge"!==d.type?this._updateTranslateVertexTooltip(p,$.XY):this._hideTooltip()}))],p),this.emit("manipulators-changed"),d}_trackNumDragging(t){switch(t.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return t}_onDragCancel(t=!0,e){switch(this._numDragging--,t&&(this.undo(),this.outputGeometry=null!=this._editGeometryOperations?this._editGeometryOperations.data.geometry:null),null!=this.tool.snappingManager&&this.tool.snappingManager.doneSnapping(),this._hideTooltip(),this._reshapeEventState){case Yt.NONE:break;case Yt.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case Yt.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(Yt.NONE)}_setTypeSpecificManipulatorSettings(t,e,i){const{graphic:a}=this,n=this._settings;switch(e.type){case"vertex":{t.state=Zt.Vertex,t.selectable=!0,t.cursor="move",t.collisionPriority=2;const{size:e,collisionPadding:o}=n.manipulators.vertex;t.radius=e/2+o,t.elevationInfo=i;const{geometry:s}=a,r=s?.type;t.interactive=null!=r&&"point"!==r&&"mesh"!==r;break}case"edge":{t.state=Zt.Edge,t.selectable=!1,t.cursor="copy",t.collisionPriority=-1;const{size:e,collisionPadding:o}=n.manipulators.edge;t.radius=e/2+o,t.elevationInfo="on-the-ground"!==i.mode||j(a.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(t,e){return t.events.on("grab-changed",(i=>this._onGrabStateChanged(t,e,i.action,i.pointerType)))}_onGrabStateChanged(t,e,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)e&&this._updateSelection(t),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Yt.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((t=>{const{manipulator:e}=t,{geometry:i}=this.graphic,a=i?.type;e.interactive=e.grabbing||!this._numGrabbing&&null!=a&&"point"!==a&&"mesh"!==a,"edgeManipulator"in t&&(t.edgeManipulator.interactive=t.edgeManipulator.grabbing||!this._numGrabbing)})),this._graphicMoveManipulation.forEachManipulator((t=>{t.interactive=t.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const t of this._manipulatorInfos)t.manipulator.grabbing||(t.manipulator.selected=!1)}_updateSelection(t){t.grabbing&&!t.selected&&t.selectable&&(this._clearSelection(),t.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(t){null!=t&&(t.manipulator.metadata.deleting=!0,this.manipulators.remove(t.manipulator),this._manipulatorHandles.remove(t.manipulator),i(this._manipulatorInfos,t),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(t){if(t)for(const e of this._manipulatorInfos)if(t===e.handle)return e;return null}_updateManipulatorPosition(t){if(null==t)return;const e=this._editGeometryOperations;if("vertex"===t.type)t.manipulator.location=e.data.coordinateHelper.vectorToDehydratedPoint(t.handle.pos,Ft),t.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=t.manipulator.renderLocation);else if("edge"===t.type){const i=this._getManipulatorInfoFromHandle(t.handle.leftVertex),a=this._getManipulatorInfoFromHandle(t.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if(null!=t.manipulator.elevationInfo&&"on-the-ground"===t.manipulator.elevationInfo.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;t.manipulator.location=L(r,l,p,e.data.spatialReference)}else O(zt,n.renderLocation,o.renderLocation,.5),t.manipulator.renderLocation=zt}}_splitEdgeManipulator(t,e=.5){const i=this._editGeometryOperations,a=i.splitEdge(t.handle,e).createdVertex;t.locationUpdateHandle=h(t.locationUpdateHandle);const n=D(this.graphic);let o;this.enableEdgeOffset?(this._removeManipulator(t),o=this._createVertexOrEdgeManipulator(a)):(o=t,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(t.manipulator,t.handle,n)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(o),this.enableEdgeOffset||this._updateTranslateVertexTooltip(o.manipulator,$.XY),this._updateSelection(t.manipulator);const s=this._updateEventState(Yt.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(Yt.NONE),o}_updateMoveManipulationPosition(){const t=b(zt,0,0,0);let e=0,i=!1,a=null,n=null;for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected?(e++,E(t,t,o.manipulator.renderLocation),null==a||o.selectedIndex>a.selectedIndex?(n=a,a=o):(null==n||o.selectedIndex>n.selectedIndex)&&(n=o)):i=!0);if(0===e){const t=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=t,this._moveManipulation.xyAxisManipulation.available=t,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=t,this._moveManipulation.zManipulation.available=t&&this.enableZShape&&K(this.graphic),this._moveManipulation.angle=q(this.graphic.geometry),this._moveManipulation.radius=tt.radiusForSymbol(this.graphic.symbol)}else{const t=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=t,this._moveManipulation.xyAxisManipulation.available=t,this._moveManipulation.zManipulation.available=t&&this.enableZVertex&&K(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=t&&1!==e;let i=0;if(null!=a){const t=a.handle.pos,e=null!=n?n.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,o=null==n&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;e&&o?this._moveManipulation.xyAxisManipulation.available=!1:e?i=Nt(e,t):o&&(i=Nt(t,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=Q}0!==e&&i?(G(t,t,1/e),Ft.spatialReference=this._editGeometryOperations.data.spatialReference,Ft.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(t,Ft),this._moveManipulation.elevationAlignedLocation=Ft):null==this._outlineVisualElement||this._graphicState.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(this.view,this._moveManipulation,this.graphic):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(t){const e=new Array,i=this._editGeometryOperations;for(const a of t){const t=a.handle.component;if("vertex"===a.type&&i.canRemoveVertex(t)){e.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&t.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(t.edges[0]))}}if(e.length>0){const t=e.map((t=>{const e=i.data.components.indexOf(t.component);return{coordinates:i.data.coordinateHelper.vectorToArray(t.pos),componentIndex:e,vertexIndex:t.index}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(Yt.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:t.map((t=>t.coordinates)),vertices:t}),this.destroyed)return;if(a&&(this._updateEventState(Yt.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(t,e,i=("start"===e.action?yt.NEW_STEP:yt.ACCUMULATE_STEPS)){const a=this._editGeometryOperations;a.moveVertices(t.map((t=>t.handle)),e.mapDeltaX,e.mapDeltaY,e.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const n of t)this._updateManipulatorPosition(n)}_offsetEdge(t,e){if(null==e.operation||null==e.signedDistance)return;const i=this._editGeometryOperations,a=e.operation.clone();a.distance=e.signedDistance,i.updateVertices([t.handle.leftVertex,t.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t.handle.rightVertex))}_manipulatorClickCallback(t,e){t.shiftKey||this._clearSelection(),"vertex"===e.type&&(e.manipulator.selected=!e.manipulator.selected,t.button===dt.Right&&this._removeVertices([e])),"edge"===e.type&&t.button===dt.Left&&this._splitEdgeManipulator(e),t.stopPropagation()}_updateTranslateTooltip(t,e){const i=this._manipulatorInfos.filter((t=>"vertex"===t.type&&t.manipulator.selected));1===i.length?this._updateTranslateVertexTooltip(i[0].manipulator,t,e):this._updateTranslateGraphicTooltip(t,e)}_updateTranslateGraphicTooltip(t,e){const{sketchOptions:i,tooltip:a}=this;switch(t){case $.XY:this._latestTooltipInfo=this._translateGraphicTooltipInfo??=new St({sketchOptions:i}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,e,((t,e)=>Lt(t,e)));break;case $.XY_AXIS:this._latestTooltipInfo=this._translateGraphicXYTooltipInfo??=new It({sketchOptions:i}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,e,((t,i)=>u(Lt(t,i),et(e))));break;case $.Z:this._latestTooltipInfo=this._translateGraphicZTooltipInfo??=new Gt({sketchOptions:i}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,e,jt)}this._latestTooltipInfo.sketchOptions=i,a.info=i.tooltips.effectiveEnabled?this._latestTooltipInfo:null}_updateTranslateVertexTooltip(t,e,i){const{sketchOptions:a,tooltip:n}=this;switch(e){case $.XY:this._latestTooltipInfo=this._translateVertexTooltipInfo??=new Ht({sketchOptions:a}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,i,((t,e)=>Lt(t,e))),this._updateTooltipAreaOrTotalLength(this._latestTooltipInfo);break;case $.XY_AXIS:this._latestTooltipInfo=this._translateVertexXYTooltipInfo??=new wt({sketchOptions:a}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,i,((t,e)=>u(Lt(t,e),et(i)))),this._updateTooltipAreaOrTotalLength(this._latestTooltipInfo);break;case $.Z:this._latestTooltipInfo=this._translateVertexZTooltipInfo??=new Tt({sketchOptions:a}),this._updateTranslateTooltipDistance(this._latestTooltipInfo,i,jt)}const o=kt(t.location);this._latestTooltipInfo.elevation=null!=o?Vt({actual:o}):null,this._latestTooltipInfo.sketchOptions=a,n.info=a.tooltips.effectiveEnabled?this._latestTooltipInfo:null}_updateTranslateTooltipDistance(t,e,i){if(null!=e&&"end"!==e.action){const{mapStart:a,mapEnd:n}=e,o=i(a,n);t.distance=null!=o?o:d}else t.distance=d}_updateTooltipAreaOrTotalLength(t){const{geometry:e}=this.graphic;if(null==e)return t.area=null,void(t.totalLength=null);t.area="polygon"===e.type?At(e):null,t.totalLength="polyline"===e.type?Dt(e):null}_hideTooltip(){this.tooltip.clear(),this._latestTooltipInfo=null}get test(){return{segmentLabels:this._segmentLabels,manipulatorInfos:this._manipulatorInfos}}};function Nt(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])+Math.PI/2}function Rt(t,e,i,a,n){if(t){const t=n.toXYZ(n.pointToVector(i)),o=V(a,t,A.get()),s=Pt(o,t,n.spatialReference);if(null!=s)return c(s.value*Math.sign(e),s.unit)}return c(e*_(i.spatialReference),"meters")}t([f()],Ct.prototype,"_editGeometryOperations",void 0),t([f()],Ct.prototype,"_segmentLabels",void 0),t([f({constructOnly:!0})],Ct.prototype,"tool",void 0),t([f()],Ct.prototype,"tooltip",void 0),t([f()],Ct.prototype,"inputGeometry",null),t([f()],Ct.prototype,"outputGeometry",void 0),t([f({readOnly:!0})],Ct.prototype,"updating",null),t([f()],Ct.prototype,"manipulators",null),t([f()],Ct.prototype,"view",null),t([f()],Ct.prototype,"graphic",null),t([f()],Ct.prototype,"enableZShape",null),t([f()],Ct.prototype,"enableZVertex",null),t([f()],Ct.prototype,"enableMoveGraphic",null),t([f()],Ct.prototype,"enableMidpoints",null),t([f()],Ct.prototype,"enableEdgeOffset",null),t([f()],Ct.prototype,"sketchOptions",null),t([f()],Ct.prototype,"_accentColor",null),Ct=t([v("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],Ct);const Ft=L(0,0,void 0,Ut.WGS84),zt=S(),Xt=1e-6;var Zt,Yt,qt;!function(t){t.Vertex=vt.Custom1,t.Edge=vt.Custom2}(Zt||(Zt={})),function(t){t[t.NONE=0]="NONE",t[t.MOVING=1]="MOVING",t[t.RESHAPING=2]="RESHAPING"}(Yt||(Yt={})),function(t){t[t.ALL=0]="ALL",t[t.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(qt||(qt={}));export{Ct 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.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createRenderScreenPointArray3 as e}from"../../../../../core/screenUtils.js";import{fromValues as r}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{b as o,
|
|
5
|
+
import{createRenderScreenPointArray3 as e}from"../../../../../core/screenUtils.js";import{fromValues as r}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{b as o,E as n,p as t,f as s}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getNormal as i,fromPositionAndNormal as l,create as d}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{PlaneType as u,OffsetEdgeVertex as p}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function a(e,r,o){const n="on-the-ground"===o.mode?u.XY:u.XYZ;return new p(e,n,r,0)}function m(e,r,n){const t=c();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const s=j(e,r,i(n.plane)),f=j(e,r,n.edgeDirection);if(null==s||null==f)return null;const u=o(c(),s,f);return l(t,u,d())}function j(e,r,o){const t=f(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),s=c(),i=c();return e.renderCoordsHelper.toRenderCoords(r,s)&&e.renderCoordsHelper.toRenderCoords(t,i)?n(i,s,i):null}function g(e,t,s){const l=i(e),d=n(c(),t,s),f=o(c(),d,l),u=o(c(),d,f);return r(d[0],d[1],d[2],0,f[0],f[1],f[2],0,u[0],u[1],u[2],0,0,0,0,1)}function C(r,o,n){const c=n.projectToRenderScreen(r,e()),i=n.projectToRenderScreen(o,e());return null!=c&&null!=i?t(s(c,c,i)):0}export{m as createEdgeOffsetIntersectionPlane,a as createEdgeOffsetOperation,g as edgeOffsetRotationMatrix,C as screenEdgeLengthSquared};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as t,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as i,
|
|
5
|
+
import{set as t,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as i,r as a,f as r,l as o,k as n}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as l,c as p}from"../../../../../chunks/boundedPlane.js";import{intersectRay as h}from"../../../../../geometry/support/plane.js";import{sv3d as d}from"../../../../../geometry/support/vectorStacks.js";import{ResizeManipulator as u}from"../../../analysis/Slice/ResizeManipulator.js";import{updateResizeHandle as m,isDiagonalResizeHandle as S,calculateDiagonalResizeHandleScale as _}from"../../../analysis/Slice/sliceToolUtils.js";import{screenToRenderPlane as g}from"../dragEventPipeline3D.js";import{ManipulatorType as y}from"../ManipulatorType.js";import{mapPlaneAutoSize2D as f}from"./extentUtils.js";import{fromScreenNormalized as z}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as x}from"../../../../interactive/dragEventPipeline.js";import{AccumulationBehavior as M}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as v}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as b}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{ExtentScaleTooltipInfo as B}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";class j{get zMax(){if(!this._zMaxDirty)return this._zMax;const t=this._editGeometryOperations.data;if(t.geometry.hasZ){const e=t.coordinateHelper;this._zMax=Number.NEGATIVE_INFINITY;for(const s of t.components)for(const t of s.vertices){const s=e.getZ(t.pos)??0;this._zMax=Math.max(s,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(e,i,a,r,o){this._tool=e,this._graphicState=i,this._editGeometryOperations=a,this._bounds=r,this._preserveAspectRatioStep=o,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._scaleTooltipInfo=null,this._displayBoundsStart=l(),this._displayBoundsMarginStart=0,this._startScale=s(),this._endScale=s(),this._sizeStart=null,this._zMax=0,this._zMaxDirty=!0;const n=this._tool,c=n.view;this.resizeManipulators=this._resizeHandles.map((t=>{const e=new u(c,t);return n.addHandles([e.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(e,t)]),e})),n.manipulators.addMany(this.resizeManipulators),n.addHandles([n.on("graphic-scale-start",(e=>{t(this._startScale,e.xScale,e.yScale),t(this._endScale,e.xScale,e.yScale)})),n.on("graphic-scale",(e=>{t(this._endScale,e.xScale,e.yScale)})),n.on("graphic-scale-stop",(()=>{t(this._startScale,0,0),t(this._endScale,0,0)})),this._graphicState.on("changed",(()=>{"resize"!==n.inputState?.type&&(this._zMaxDirty=!0)}))])}destroy(){this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()}))}forEachManipulator(t){this.resizeManipulators.forEach((e=>t(e,y.SCALE)))}updateManipulators(t,e){this.resizeManipulators.forEach(((s,i)=>{m(s,this._resizeHandles[i],t,e)}))}getUpdatedTooltipInfo(){return this.resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null}_computeScaleTooltipInfo(){const t=this._tool,e=this._scaleTooltipInfo??=new B({sketchOptions:t.sketchOptions}),s=t.graphic.geometry;if(null==s)return null;const i=f(this._bounds.mapBounds,this.zMax,s.spatialReference);return null==i?null:(e.xSize=i.xSize,e.ySize=i.ySize,null!=this._sizeStart&&this.resizeManipulators.some((t=>t.dragging))?(e.xScale=i.xSize.value/this._sizeStart.xSize.value,e.yScale=i.ySize.value/this._sizeStart.ySize.value):(e.xScale=1,e.yScale=1),e)}_onResizeGrab({action:t,screenPoint:e}){const s=this._tool,i=this._bounds;if("start"!==t||!e||!s.graphic.geometry)return;const a=z(s.view.state.camera,e);h(i.displayBounds.plane,a,d.get())&&(i.backupMapBounds(),p(i.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=i.displayBoundsMargin,this._sizeStart=f(i.mapBoundsStart,this.zMax,s.graphic.geometry.spatialReference),s.inputState={type:"resize"})}_createResizeDragPipeline(t,e){const s=this._tool,i=s.graphic;return x(t,((t,a,r)=>{null!=s.inputState&&(a.next((t=>("start"===t.action&&s.emit("graphic-scale-start",{graphic:i,xScale:1,yScale:1}),t))).next(g(s.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:i,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":s.emit("graphic-scale",e);break;case"end":s.inputState=null,s.emit("graphic-scale-stop",e)}return t})),r.next((()=>{null!=s.inputState&&s.emit("graphic-scale-stop",{graphic:i,xScale:1,yScale:1}),s.cancel()})))}))}_resizeDragRenderPlaneToFactors(){const t=this._bounds;return e=>{const s=this._displayBoundsStart,c=e.handle.direction,l=t.displayBoundsMargin,p=this._displayBoundsMarginStart,h=i(d.get(),s.origin);a(h,h,s.basis1,-c[0]),a(h,h,s.basis2,-c[1]);const u=r(d.get(),e.renderEnd,h),m=r(d.get(),e.renderStart,h),g=S(e.handle),y=_(s),f=_(t.displayBounds)/y,z=(t,e)=>{if(0===t)return 1;let s=o(e),i=.5*t*n(e,u)/s;const a=i<0?-1:1;if(g){i+=(s-.5*t*n(e,m)/s)*a*f}const r=s<1.5*p?1:E;return s=Math.max(s-p,E),a>0&&(i-=l),a*Math.max(a*(i/s),r)};return{...e,factor1:z(c[0],s.basis1),factor2:z(c[1],s.basis2)}}}_resizeDragUpdateGeometry(){const r=this._tool,o=this._bounds;return n=>{const l=i(c(),o.mapBoundsStart.origin);a(l,l,o.mapBoundsStart.basis1,-n.handle.direction[0]),a(l,l,o.mapBoundsStart.basis2,-n.handle.direction[1]);const h=t(s(),o.mapBoundsStart.basis1[0],o.mapBoundsStart.basis1[1]);e(h,h);const d=[];for(const t of this._editGeometryOperations.data.components)d.push(...t.vertices);const u="start"===n.action?M.NEW_STEP:M.ACCUMULATE_STEPS,m=this._editGeometryOperations.scaleVertices(d,l,h,n.factor1,n.factor2,u,v.REPLACE);return p(o.mapBoundsStart,o.mapBounds),b(m,o.mapBounds),r.graphic.geometry=this._editGeometryOperations.data.geometry,n}}}const E=1e-6;export{j as ExtentScale,E as scaleEpsilon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getMetersPerCartesianUnitForSR as s,getMetersPerUnitForSR as t}from"../../../../../core/unitUtils.js";import{scale as i}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as o,f as e,
|
|
5
|
+
import{getMetersPerCartesianUnitForSR as s,getMetersPerUnitForSR as t}from"../../../../../core/unitUtils.js";import{scale as i}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as o,f as e,m as r,b as a,n,h as c,k as p,l,r as m}from"../../../../../chunks/vec32.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as g,c as u,u as b}from"../../../../../chunks/boundedPlane.js";import{sv3d as h}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as f}from"../../../../../support/elevationInfoUtils.js";import{mainAxis as B}from"../geometryUtils.js";import{evaluateElevationAlignmentAtPoint as y}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as v}from"../../../layers/graphics/ElevationContext.js";import{calculateOrientedBounds as j}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoSize2D as R}from"../../../../support/extentUtils.js";class C{constructor(s,t,i){this._tool=s,this._onDisplayBoundsChanged=t,this.mapBounds=g(),this.mapBoundsStart=g(),this.displayBounds=g(),this._calculateMapBounds(i)}get displayBoundsMargin(){const{view:s,graphic:t}=this._tool,i=s.pointsOfInterest?.centerOnSurfaceFrequent.location??t.geometry?.extent?.center;return i?_*s.pixelSizeAt(i):0}backupMapBounds(){u(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged()}_calculateMapBounds(o){const{view:e,attachmentOrigin:r}=this._tool,a=o.geometry,n=B(a);i(n,n,-1);const c=e.spatialReference,p=a.spatialReference,l=r?e.pixelSizeAt(r)*s(c)/t(p):0;j(n,o,x*l,this.mapBounds)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t,graphic:i}=this._tool;if(!i.geometry)return;const o=t?.z??y(this.mapBounds.origin,s.elevationProvider,v.fromElevationInfo(f(i)),s.renderCoordsHelper),e=u(this.mapBounds);e.origin[2]=o??0,S(e,s.renderCoordsHelper,i.geometry.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const _=10,x=80;function S(s,t,i,m=0,d){d||(d=g()),t.toRenderCoords(s.origin,i,d.origin);const u=h.get();o(u,s.origin,s.basis1),o(u,u,s.basis2),t.toRenderCoords(u,i,u);const f=h.get();o(f,s.origin,s.basis1),e(f,f,s.basis2),t.toRenderCoords(f,i,f);const B=h.get();e(B,s.origin,s.basis1),e(B,B,s.basis2),t.toRenderCoords(B,i,B);const y=h.get();e(y,s.origin,s.basis1),o(y,y,s.basis2),t.toRenderCoords(y,i,y);const v=r(h.get(),u,f,.5);e(v,v,d.origin);const j=r(h.get(),B,y,.5);e(j,d.origin,j),r(d.basis1,v,j,.5);const R=r(h.get(),y,u,.5);e(R,R,d.origin);const C=r(h.get(),f,B,.5);e(C,d.origin,C),r(d.basis2,R,C,.5);const _=a(h.get(),d.basis1,d.basis2),x=a(_,_,d.basis1);return n(x,x),c(d.basis2,x,p(d.basis2,x)),c(d.basis1,d.basis1,1+m/l(d.basis1)),c(d.basis2,d.basis2,1+m/l(d.basis2)),b(d),d}function U(s,t,i){return e(O,e(O,s.origin,s.basis1),s.basis2),m(M,O,s.basis1,2),m(D,M,s.basis2,2),m(k,O,s.basis2,2),O[2]=M[2]=D[2]=k[2]=t,R({topLeft:k,topRight:D,bottomRight:M,bottomLeft:O,spatialReference:i})}const k=d(),D=d(),M=d(),O=d();export{C as TransformBounds,U as mapPlaneAutoSize2D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{c as e,f as t,
|
|
5
|
+
import"../../../../core/has.js";import{c as e,f as t,j as r,F as s}from"../../../../chunks/vec32.js";import{create as i,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,c as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{create as d,fromRay as _,getStart as c,getEnd as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as f,fromPoints as m,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as O}from"./LaserlineVisualElement.js";import{drapedZ as w}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as j}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as A}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as x}from"../../webgl-engine/materials/RibbonLineMaterial.js";class C extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=i(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=V.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=R.OccludeAndTransparent,this._fadedExtensions=T,this._laserline=new O({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:e=>this._destroyExternalResources(e),recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyExternalResources(e),recreateGeometry:e=>this._recreateDrapedGeometry(e)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===R.OccludeAndTransparentStencil?R.OccludeAndTransparent:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??T,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new x(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_destroyExternalResources(e){e.geometries=[]}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const s=this._createGeometry(e);r.push(s),t.addGeometry(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new x(this.materialParameters);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new j(t)}_createGeometry(e){const t=this.extensionType===V.FADED,r=t?[i(),i(),i(),i()]:[i(),i()];return E(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===V.FADED?this._updateLineSegmentFinite(S):this._updateLineSegmentInfinite(this._extensionType,S)}_updateLineSegmentFinite(e){return m(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(_(this._ray,G),e){case V.LINE:G.c0=-Number.MAX_VALUE;break;case V.RAY:case V.GROUND_RAY:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&s(G.ray.direction,G.ray.direction),this._extensionType===V.GROUND_RAY&&null!=t&&(G.c1=Math.abs(r-t));break}}if(!u(r.frustum,G))return this._updateLineSegmentFinite(t);const i=c(G,P),n=p(G,v);return m(i,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute(A.POSITION)?.data;if(!r)return;let s=0;for(const i of this._lineVertices(t))r[s++]=i[0],r[s++]=i[1],r[s++]=i[2];e.geometryVertexAttributeUpdated(e.geometries[0],A.POSITION)}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute(A.POSITION)?.data;if(!r)return;let s=0;for(const i of this._lineVertices(t))r[s++]=i[0],r[s++]=i[1],r[s++]=w;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===V.FADED?(yield y(e,-this.fadedExtensions.start,P),yield y(e,0,P),yield y(e,1,P),yield y(e,1+this.fadedExtensions.end,P)):(yield y(e,0,P),yield y(e,1,P))}}const G=d(),P=i(),v=i(),S=f();var V;!function(e){e[e.LINE=0]="LINE",e[e.RAY=1]="RAY",e[e.GROUND_RAY=2]="GROUND_RAY",e[e.FADED=3]="FADED"}(V||(V={}));const M=1/3,T={start:M,end:M};export{C as ExtendedLineVisualElement,V as ExtensionType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{castScreenPointArray as t,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{normalize as s,subtract as i,scale as o,set as a,add as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
5
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{castScreenPointArray as t,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{normalize as s,subtract as i,scale as o,set as a,add as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{j as d,c as h,n as m,f as l,g as u}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as g,c as b}from"../../../../chunks/vec42.js";import{fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as j}from"./EngineVisualElement.js";import{drapedZ as D}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as G}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as R}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as w}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as x}from"../../webgl-engine/materials/RibbonLineMaterial.js";class v extends j{constructor(e){super(e),this._location=p(),this._direction=_(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=f(1,0,1,1),this._renderOccluded=G.OccludeAndTransparent,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:e=>this._destroyObject3DResources(e),recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyDrapedResources(e),recreateGeometry:e=>this._recreateDrapedGeometry(e)}}get location(){return this._location}set location(e){d(this._location,e)||(h(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(h(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){m(this._direction,l(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){g(e,this._color)||(b(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}_createObject3DResources(e){const t=new x(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_destroyObject3DResources(e){e.geometries.length=0}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const[s,i]=this._createGeometries(e);t.addGeometry(s),t.addGeometry(i),r.push(s),r.push(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const t=new x(this.materialParameters),r=e((()=>this.view.state.contentPixelRatio),(()=>{this.drapedResources.recreateGeometry()}));return{material:t,geometries:this._createDrapedGeometry(t),pixelRatioHandle:r}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[]}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=this._createGeometries(e);return this._updateVerticesDraped(t),t.map((e=>new R(e)))}_createGeometries(e){return[O(e,[p(),p()]),O(e,[p(),p()])]}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,M),u(P,this.location,this.direction),t.projectToScreen(P,I),s(I,i(I,I,M)),this._updateVertexAttributesObject3D(t,e,0,M,I,1),this._updateVertexAttributesObject3D(t,e,1,M,I,-1)}_updateVertexAttributesObject3D(e,r,s,i,o,a){const c=r.geometries[s],n=c.getMutableAttribute(w.POSITION)?.data;if(!n)return;const{start:d,end:h}=this._computeStartEnd(o,i,a,this.offset,this.width,this.length);e.unprojectFromScreen(t(d),P),n[0]=P[0],n[1]=P[1],n[2]=P[2],e.unprojectFromScreen(t(h),P),n[3]=P[0],n[4]=P[1],n[5]=P[2],r.geometryVertexAttributeUpdated(c,w.POSITION)}_updateVerticesDraped(e){const{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:r}}}=this,{location:s,width:i,length:o,offset:a}=this,c=E;c.spatialReference=t.renderer.spatialReference,c.x=s[0],c.y=s[1];const n=this.view.overlayPixelSizeInMapUnits(c)*r,d=i*n,h=o*n,m=a*n;this._updateVertexAttributesDraped(e[0],d,h,m,-1),this._updateVertexAttributesDraped(e[1],d,h,m,1)}_updateVertexAttributesDraped(e,t,r,s,i){const o=e.getMutableAttribute(w.POSITION)?.data;if(!o)return;const{location:a,direction:c}=this,{start:n,end:d}=this._computeStartEnd(c,a,i,s,t,r);o[0]=n[0],o[1]=n[1],o[2]=D,o[3]=d[0],o[4]=d[1],o[5]=D,e.invalidateBoundingInfo()}_computeStartEnd(e,t,r,s,i,n){const d=o(V,a(V,e[1]*r,e[0]*-r),s+i/2),h=c(A,c(A,c(A,t,o(A,e,n/2)),d),d);return{start:h,end:c(S,h,o(S,e,-n))}}}const P=p(),V=n(),A=n(),S=n(),M=r(),I=r(),E=y(0,0,void 0,null);export{v as ParallelLineVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{
|
|
5
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{q as s,n as a,f as o,c as n,j as c,g as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as h}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as f}from"../../terrain/OverlayRenderer.js";import{Attribute as b}from"../../webgl-engine/lib/Attribute.js";import{Geometry as M}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as j}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as y}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as D}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";class z extends g{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=R.OccludeAndTransparent,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=R.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyDrapedResources(e)}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){h(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){h(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new D(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new w(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r,forEach:e=>{e(t),r&&e(r)}}}_createObject3DGeometries(e,t,r){if(c(this._up,d)&&c(this._right,d))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new D(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new w(this._outlineMaterialParameters),i=this._createGeometries(t,r).map((e=>new j(e)));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e((()=>this.view.state.contentPixelRatio),(()=>{this.drapedResources.recreateGeometry()}))}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[]}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=this._quadGeometryData(r,i,s,e);if(!t)return[a];return[a,O(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(P,this._position),r(P,P,[a,a,a]),e.transformation=P}_setTransformDraped(e){if(0===e.length)return;const{view:{basemapTerrain:{overlayManager:i},state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=f;const l=v;l.spatialReference=i.renderer.spatialReference,l.x=c[0],l.y=c[1];const u=o*(this.view.overlayPixelSizeInMapUnits(l)*s),d=Math.min(this._maxSize,u);t(P,c),r(P,P,[d,d,1]);for(const t of e)t.transformation=P}_quadGeometryData(e,t,r,i){return new M(i,[[y.POSITION,new b([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}const P=i(),v=p(0,0,void 0,null);export{z as RightAngleQuadVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{m as t,f as e,n as s,h as r,g as i,c as o}from"../../../../../chunks/vec32.js";import{create as n,clone as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as p}from"../../../../../geometry/projection.js";import{getSphericalPCPF as a}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectVectorToVector as h}from"../../../../../geometry/projection/projectVectorToVector.js";import{sv3d as d}from"../../../../../geometry/support/vectorStacks.js";import{slerpTangent as f,slerp as l}from"../../../support/mathUtils.js";class m{constructor(t=n(),e=n()){this.startRenderSpace=t,this.endRenderSpace=e,this.type="euclidean"}eval(r,i,o){return t(i,this.startRenderSpace,this.endRenderSpace,r),o&&(e(o,this.endRenderSpace,this.startRenderSpace),s(o,o)),i}createRenderGeometry(t,s){const r=[],i=[],o=(s,o)=>{const n=j;e(n,s,t),r.push([n[0],n[1],n[2]]),i.push([o[0],o[1],o[2]])},n=s.worldUpAtPosition(this.eval(.5,R),d.get());return o(this.startRenderSpace,n),o(this.endRenderSpace,n),{points:r,normals:i}}static fromPositionAndVector(t,e,s=1){return r(R,e,s),i(R,t,R),new m(c(t),c(R))}}class _{_projectIn(t,e){this._project?h(t,this.renderSpatialReference,e,this._pcpf):o(e,t)}constructor(t,e,s){this.startRenderSpace=t,this.endRenderSpace=e,this.renderSpatialReference=s,this.type="geodesic",this._start=n(),this._end=n(),this._pcpf=a(s),this._project=p(s,this._pcpf),this._projectIn(t,this._start),this._projectIn(e,this._end)}eval(r,o,n){if(this._project)if(n){const t=j;f(this._start,this._end,r,o,t),i(S,o,t),h(o,this._pcpf,o,this.renderSpatialReference),h(S,this._pcpf,S,this.renderSpatialReference),e(n,S,o),s(n,n)}else l(this._start,this._end,r,o),h(o,this._pcpf,o,this.renderSpatialReference);else t(o,this._start,this._end,r),n&&(e(n,this._end,this._start),s(n,n));return o}createRenderGeometry(t,s){const r=[],i=[],o=(s,o)=>{const n=S;e(n,s,t),r.push([n[0],n[1],n[2]]),i.push([o[0],o[1],o[2]])},n=128+1&-2;for(let e=0;e<n;++e){const t=e/(n-1),r=R,i=j;this.eval(t,r),s.worldUpAtPosition(r,i),o(r,i)}return{points:r,normals:i}}}const R=n(),j=n(),S=n();export{m as EuclideanSegment,_ as GeodesicSegment};
|