@arcgis/core 5.2.0-next.126 → 5.2.0-next.128
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/WebScene.js +1 -1
- package/applications/Components/basemapToggleUtils.d.ts +53 -0
- package/applications/Components/basemapToggleUtils.js +2 -0
- package/applications/SceneViewer/sceneViewerUtils.d.ts +14 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/applications/WebEditor/sketchUtils.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
- package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e35eb93c0fb1f6de8db0.js → 00d9e41deecf5828975c.js} +1 -1
- package/assets/esri/core/workers/chunks/038d2b80d96237c25b6f.js +1 -0
- package/assets/esri/core/workers/chunks/{ab8a1140bf31f46f8ebf.js → 1262918b2161d79851c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3ef23923424ad8c5048.js → 1c2723f9630e7d597843.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ca98fffd43e63d5ade3.js → 1c33aa349beea9a3792f.js} +1 -1
- package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js → 2226c20c38e20713bcb5.js} +2 -2
- package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js.LICENSE.txt → 2226c20c38e20713bcb5.js.LICENSE.txt} +2 -2
- package/assets/esri/core/workers/chunks/{4d18451e0ea6ca54101a.js → 2ebad7e588b26e74cefe.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8258636096416c837a2.js → 3b7dff15a0058ea29886.js} +1 -1
- package/assets/esri/core/workers/chunks/{4716693eca44e8f89f5c.js → 3bf56c33876ba56c4b21.js} +1 -1
- package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +1 -0
- package/assets/esri/core/workers/chunks/3f045f09ac95e7f22a97.js +1 -0
- package/assets/esri/core/workers/chunks/500f6d6f0ffa235cae85.js +1 -0
- package/assets/esri/core/workers/chunks/{56acda1eed3a013430e2.js → 58fb92775d668cfd295c.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6637f9176566382ed3e.js → 606cca69eaea84bfcdc6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdbda3d2afea25142b86.js → 6267a1fe1603daa399b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 668ec0bdfb2095e90c9e.js} +1 -1
- package/assets/esri/core/workers/chunks/{806f96ad09e882be41af.js → 67fd2cdb2e6834bfa710.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fe5ef5ccf480634d159.js → 75294f515c7f8393181c.js} +1 -1
- package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +1 -0
- package/assets/esri/core/workers/chunks/761ea719ec1b4d562db2.js +1 -0
- package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 86d7a3ae672a51b75fcc.js} +1 -1
- package/assets/esri/core/workers/chunks/{30604a29df320d7a4c6b.js → 88e11b645a1361f1bdbe.js} +1 -1
- package/assets/esri/core/workers/chunks/89dad6c1bfd81e4d7f8e.js +1 -0
- package/assets/esri/core/workers/chunks/{8daed13400d9e63e65ae.js → 8a842cde240aef12e417.js} +1 -1
- package/assets/esri/core/workers/chunks/{c692e583e87af58f6d91.js → 8b0d6205ceeec1ab446f.js} +1 -1
- package/assets/esri/core/workers/chunks/{57ab87e70ef85b9405f9.js → 8cb216404a6254bc695c.js} +1 -0
- package/assets/esri/core/workers/chunks/92509dd25996c6390a31.js +1 -0
- package/assets/esri/core/workers/chunks/9ccc2c8f7416943cc373.js +29 -0
- package/assets/esri/core/workers/chunks/a0a9c41400ae98df1912.js +1 -0
- package/assets/esri/core/workers/chunks/{b96358d475dc98034aa4.js → a15ed056e7493ddf3b4c.js} +1 -1
- package/assets/esri/core/workers/chunks/{25e212fe9a2ea37c9e81.js → a3a33ffa34f4d645ddfe.js} +1 -1
- package/assets/esri/core/workers/chunks/af0704494398f33aa315.js +1 -0
- package/assets/esri/core/workers/chunks/{ce1ccf9ec90b786591e5.js → b396c4b4bb144200acc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{97602019a1ccad22a03a.js → bbfb80a6983574007ce5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d5f72670634e73c0b53a.js → bcf2e5cf6b9c6d0442bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{17218d714cb07b607c2f.js → c35e9dee87937f483a3d.js} +1 -1
- package/assets/esri/core/workers/chunks/{85739ed6af0f0a3cb302.js → c94bdfed831c775e04c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e3fd81653dc0d86456c.js → cfeba0ffb7fdc2a9af05.js} +1 -1
- package/assets/esri/core/workers/chunks/d1187ad6cc4959683819.js +1 -0
- package/assets/esri/core/workers/chunks/d94a2b3b2ef49af9c2e3.js +1 -0
- package/assets/esri/core/workers/chunks/{cb7cb7d57c4e7f76600f.js → dc92710a8fdfb9135e55.js} +1 -1
- package/assets/esri/core/workers/chunks/ec187933b42fe65594b7.js +1 -0
- package/assets/esri/core/workers/chunks/eec5a93dbc258a90b6de.js +1 -0
- package/assets/esri/core/workers/chunks/{e1ae83ff3e0225708d4d.js → f479b4a4cee4bb2e046c.js} +1 -1
- package/assets/esri/core/workers/chunks/{78abd6c42f39e6f6ffbb.js → f983296b6f4a62a911eb.js} +1 -1
- package/assets/esri/images/portal/gaussiansplatlayer16.png +0 -0
- package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
- package/assets/esri/images/portal/propresentation16.png +0 -0
- package/assets/esri/images/portal/urbanproject16.png +0 -0
- package/assets/esri/images/support/loading-throb.gif +0 -0
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/assets/esri/themes/base/icons/style.scss +0 -0
- package/assets/esri/themes/base/icons/variables.scss +0 -0
- package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
- package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
- package/assets/esri/themes/base/images/files/code-32.svg +0 -0
- package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
- package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
- package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
- package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
- package/assets/esri/themes/base/images/files/image-32.svg +0 -0
- package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
- package/assets/esri/themes/base/images/files/report-32.svg +0 -0
- package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
- package/assets/esri/themes/base/images/files/text-32.svg +0 -0
- package/assets/esri/themes/base/images/files/video-32.svg +0 -0
- package/assets/esri/themes/base/images/files/word-32.svg +0 -0
- package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
- package/assets/esri/themes/base/images/loading-throb.gif +0 -0
- package/assets/esri/themes/base/widgets/_Bookmarks.scss +0 -0
- package/assets/esri/themes/base/widgets/_Tooltip.scss +42 -3
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +1 -0
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/lang.js +1 -1
- package/core/units.js +1 -1
- package/geometry/HeightModelInfo.js +1 -1
- package/geometry/ellipsoidUtils.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/interfaces.d.ts +1 -0
- package/kernel.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +21 -13
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/dehydratedFeatures.js +1 -1
- package/layers/graphics/transferFeatures.js +2 -0
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/HeightModelInfoMixin.js +2 -0
- package/layers/mixins/SceneService.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/package.json +3 -3
- package/popup/FeatureContentCollection.d.ts +15 -25
- package/popup/FeatureContentCollection.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/callouts/calloutAnalysisUtils.js +2 -0
- package/symbols/cim/callouts/effects/BackgroundCallout.js +1 -1
- package/symbols/cim/callouts/effects/BalloonCallout.js +1 -1
- package/symbols/cim/callouts/effects/PointSymbolCallout.js +1 -1
- package/symbols/cim/callouts/effects/SimpleLineCallout.js +1 -1
- package/symbols/cim/callouts/effects/calloutUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/webgl/ClipMesh.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
- package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +5 -3
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +1 -1
- package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/interactive/editingTools/manipulatedObjectUtils.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/support/FeatureMemory.js +2 -0
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
- package/views/3d/state/Constraints.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/support/PBFDecoderWorker.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/DOMContainer.d.ts +2 -2
- package/views/DOMContainer.js +1 -1
- package/views/PopupView.d.ts +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/interactive/options/TooltipVisibleElements.d.ts +11 -1
- package/views/interactive/options/TooltipVisibleElements.js +1 -1
- package/views/interactive/tooltip/components/ElevationModeSelect.js +2 -0
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
- package/views/support/hitTestSelectUtils.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +1 -0
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +9 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +1 -0
- package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/Popup/types.d.ts +0 -7
- package/widgets/Popup.d.ts +7 -7
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +2 -0
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/assets/esri/core/workers/chunks/0a2b7c691a577cb3d189.js +0 -1
- package/assets/esri/core/workers/chunks/2146c25c01c9fc11b16c.js +0 -1
- package/assets/esri/core/workers/chunks/4678a8170d8a3ccd1a7b.js +0 -1
- package/assets/esri/core/workers/chunks/56e97b98dcb8a3f2bcb7.js +0 -1
- package/assets/esri/core/workers/chunks/6c3535aa7250c08b9e5b.js +0 -1
- package/assets/esri/core/workers/chunks/6e75f09fb9452bd5f9fb.js +0 -1
- package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +0 -1
- package/assets/esri/core/workers/chunks/76548469fe1b9c3b2051.js +0 -1
- package/assets/esri/core/workers/chunks/82ce034b5ba54de9b970.js +0 -29
- package/assets/esri/core/workers/chunks/ba435cc73956d9c64a11.js +0 -1
- package/assets/esri/core/workers/chunks/c77496c350004ee66eb2.js +0 -1
- package/assets/esri/core/workers/chunks/d371d9279b30548efa02.js +0 -1
- package/assets/esri/core/workers/chunks/dc52e036547612949d32.js +0 -1
- package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +0 -1
- package/views/2d/engine/webgl/mesh/bufcut.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as
|
|
2
|
+
import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as o,removeMaybe as n}from"../../../../core/maybe.js";import{initial as s,watch as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as c,fromPoints as u}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as d}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as h,LineOfSightTargetManipulator as m,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as v}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as g}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as y}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as f}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as j,dragAtLocation as M,sceneSnappingAtLocation as O,dragManipulatedObject as V}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as I}from"../../../interactive/InteractiveToolBase.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import S from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as T}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as R,enterInputModeIfAvailable as H}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as U}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const x=c();let D=class extends I{constructor(t){super(t),this.events=new i,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new p,this._toolOptions=new S,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null,this._tooltipHandle=null,this._tooltipObject=null,this._tooltipUndoRecord=null,this._tooltipInfo=new U({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=R(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new d({view:t}),this.addHandles([w(this._toolOptions,()=>t.options),this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),s),a(()=>this._tooltip.mode,t=>{"input"!==t&&null==this._grabbedManipulator&&this._disconnectTooltip()})]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=o(this._tooltip),this._interactionVisuals=o(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(t){this._visualsManipulator=this._manipulatorByObject.get(t),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new h(this.view,{deleting:!1,intersection:null,type:"observer"}):new m(this.view,{deleting:!1,target:t.item,type:"target"});i.cursor="move",this._objectByItem.set(t.item,t),this._manipulatorByObject.set(t,i),this.manipulators.add(i),this.addHandles(this._connectManipulator(t,i),t),this._syncManipulator(t,i)}removeObject(t){const i=this._manipulatorByObject.get(t);null!=i&&(this._grabbedManipulator===i&&(this._grabbedManipulator=null),this._tooltipObject===t&&this._disconnectTooltip(),this._visualsManipulator===i&&this.hideInteractionVisuals(),this.removeHandles(t),this.manipulators.remove(i),i.destroy(),this._objectByItem.delete(t.item),this._manipulatorByObject.delete(t))}getManipulator(t){const i=this._objectByItem.get(t);return null==i?null:this._manipulatorByObject.get(i)}hasManipulatorAt(t,i){for(const e of this._manipulatorByObject.values())if(e.consumesClicks&&null!=e.intersectionDistance(t,i))return!0;return!1}selectObject(t){null!=this._tooltipObject&&this._tooltipObject!==t&&this._disconnectTooltip();let i=!1;for(const[e,o]of this._manipulatorByObject){const n=e===t;o.selected=n,i||=n}return this._syncManipulators(),i}onInputEvent(t){"hold"===t.type&&null!=this._grabbedManipulator&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),H(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const o=()=>this._syncManipulator(t,i);return e([t.on("committed",o),t.on("modified-externally",o),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===f.Right&&"target"===i.metadata.type&&this.events.emit("delete-item",{target:i.metadata.target}),e.stopPropagation()}),i.events.on("grab-changed",({action:e})=>{"start"===e?(this.events.emit("select-item",{item:t.item}),this._grabbedManipulator=i,this._connectTooltip(t)):this._grabbedManipulator===i&&(this._grabbedManipulator=null,this.hideInteractionVisuals(),"input"!==this._tooltip.mode&&this._disconnectTooltip())}),i.events.on("drag",i=>{t.updateDragIntersection(i),"start"===i.action&&this.showInteractionVisuals(t)}),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return j(i,(e,o,n,s)=>{const a=t.operations;if(null==a)return;let l=null;const{cancelSnapping:r,snappingStep:p}=B({snappingContext:new T({editGeometryOperations:a,elevationInfo:t.elevationInfo,pointer:s,visualizer:new g}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});n.next(t=>(l?.undo(null),l=null,t)).next(r);const c=a.data.allVerticesUnordered.at(0);o.next(i=>("start"===i.action&&(l=t.createUndoRecord()),{...i,snapOrigin:c?.pos})).next(M(this.view,i.elevationAlignedLocation)).next(b(this.view,a.data.geometry,t.elevationInfo,a.data.spatialReference)).next(O(this.view,t.elevationInfo)).next(...p).next(V(t)).next(t=>("end"===t.action&&null!=l&&(this.events.emit("record-undo",{record:l}),l=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipObject=t,this._tooltipHandle=y(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,onRecordUndo:t=>this.events.emit("record-undo",{record:t}),callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=t.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{null!=this._tooltipUndoRecord&&(this.events.emit("record-undo",{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=n(this._tooltipHandle),this._tooltipObject=null,this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(const[t,i]of this._manipulatorByObject)this._syncManipulator(t,i);this._syncInteractionVisuals()}_syncManipulator(t,i){const e=t.origin;if(i.available=this.visible&&t.visible&&null!=e,i.interactive=this.manipulatorsInteractive&&(null==this._grabbedManipulator||this._grabbedManipulator===i),null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const o=this.analysisViewData.computations.find(i=>i.target===t.item),n=null!=o&&o.computationResult.isValid?o.computationResult.isTargetVisible?_.visible:_.occluded:_.undefined;i.state=this.interacting&&i.selected?v(n):n}_syncInteractionVisuals(){const t=this._interactionVisuals,i=this._visualsManipulator,e=this.visible&&this.analysisViewData.visible;if(null==t||null==i||!e)return void t?.hide();const o=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];if(null==o)return void t.hide();const n=i===o?null:u(o.renderLocation,i.renderLocation,x);t.update({target:i.renderLocation,lineVerticalPlaneSegment:n,visible:!0})}};t([l({constructOnly:!0})],D.prototype,"analysisViewData",void 0),t([l({constructOnly:!0})],D.prototype,"snappingManager",void 0),t([l({constructOnly:!0})],D.prototype,"view",void 0),t([l()],D.prototype,"automaticManipulatorSelection",void 0),t([l()],D.prototype,"removeIncompleteOnCancel",void 0),t([l()],D.prototype,"interacting",void 0),t([l()],D.prototype,"manipulatorsInteractive",void 0),t([l()],D.prototype,"_grabbedManipulator",void 0),t([l()],D.prototype,"updating",null),D=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],D);export{D as LineOfSightItemTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{isSome as o}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{isSome as o}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as i,syncAndInitial as n,watch as s}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as l}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as d}from"./LineOfSightAuthoringUtils.js";import{createDrawTool as v}from"./lineOfSightPlacementUtils.js";import{createLineOfSightRootPluginConfiguration as p}from"./LineOfSightRootPlugin.js";import{isLineOfSightTargetPlugin as h}from"./LineOfSightTargetPlugin.js";import{Manipulator3D as c}from"../../interactive/Manipulator3D.js";const u=Symbol("hiddenManipulatorHandle");let f=class extends e{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(t){super(t),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([i(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},n),s(()=>this.activeTooltipInfo,t=>{t&&(t.elevationModeContext=this._elevationModeContext)},n)])}destroy(){this._destroyDrawTool()}get _snapToSceneEnabled(){const t=this._effectiveElevationInfo.mode;return"relative-to-ground"!==t&&"on-the-ground"!==t&&null}get _placementElevationInfo(){return null==this.analysis.observer?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??l}get _elevationModeContext(){const t=this;return{get mode(){return t._effectiveElevationInfo.mode},get disabled(){return!t._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:t=>this.setElevationMode(t)}}setElevationMode(t){const e=this._drawTool,o=e?.interactiveHandleManager?.focusedHandle,i=o?.outputMapPosition;if(!e||!o||!i||t===this._effectiveElevationInfo.mode)return;const n=e.activeTooltipInfo?.getConstraintFieldByName(o,"elevation"),s=!0===n?.locked,{position:a,elevationInfo:r}=d({view:this.view,point:i,sourceElevationInfo:this._placementElevationInfo,mode:t,preserveZ:s}),l=()=>{e.defaultZ=a.z,null==this.analysis.observer?this._observerSessionElevationInfo=r:this._targetSessionElevationInfo=r,o.inputMapPosition=a.clone(),o.selectedSnappingResult=null,o.outputMapPosition=a},v=e.mostDownstreamPlugin;h(v)?v.changeElevationMode(t,s,l):l(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;const{drawTool:t,renderer:e}=this._createDrawTool();this._drawTool=t,this._renderer=e,this.view.addAndActivateTool(t),t.begin([p({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return v({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:t=>{t!==this._drawTool||this._sessionStartedWithValidAnalysis||null!=this.analysis.observer||(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(t)},onComplete:t=>this._destroyDrawTool(t),onManipulatorCountChange:t=>this._hideManipulatorOnAppearance(t),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(t=this._drawTool){if(null==t)return;const e=t===this._drawTool;this.view.activeTool===t&&(this.view.activeTool=null),this.view.tools.includes(t)&&this.view.tools.remove(t),t.destroy(),e&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(t){t.removeHandles(u),t.addHandles(t.manipulators.toArray().map(t=>t instanceof c?t.disableDisplay():null).filter(o),u)}};t([a({constructOnly:!0})],f.prototype,"view",void 0),t([a({constructOnly:!0})],f.prototype,"analysis",void 0),t([a({constructOnly:!0})],f.prototype,"analysisViewData",void 0),t([a({constructOnly:!0})],f.prototype,"parent",void 0),t([a({constructOnly:!0})],f.prototype,"shouldPreventVertexAdd",void 0),t([a({constructOnly:!0})],f.prototype,"snappingManager",void 0),t([a()],f.prototype,"visible",void 0),t([a()],f.prototype,"observerPlacementElevationInfo",void 0),t([a()],f.prototype,"targetPlacementElevationInfo",void 0),t([a()],f.prototype,"active",null),t([a()],f.prototype,"canRedo",null),t([a()],f.prototype,"canUndo",null),t([a()],f.prototype,"updating",null),t([a()],f.prototype,"activeTooltipInfo",null),t([a()],f.prototype,"tooltip",null),t([a()],f.prototype,"_drawTool",void 0),t([a()],f.prototype,"_renderer",void 0),t([a()],f.prototype,"_observerSessionElevationInfo",void 0),t([a()],f.prototype,"_targetSessionElevationInfo",void 0),t([a()],f.prototype,"_elevationModeContext",null),f=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController")],f);export{f as LineOfSightPlacementController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/LineOfSightAnalysisObserver.js";import i from"../../../../analysis/LineOfSightAnalysisTarget.js";import s from"../../../../core/Collection.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as a,isMultipoint as l}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as u}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/LineOfSightAnalysisObserver.js";import i from"../../../../analysis/LineOfSightAnalysisTarget.js";import s from"../../../../core/Collection.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as a,isMultipoint as l}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as u}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as g,createLineOfSightObserverPluginConfiguration as h}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as c}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as _}from"./LineOfSightTargetPlugin.js";import{PluginBase as y}from"../../../draw/plugins/PluginBase.js";let v=class extends y{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new s,this._operationTargets=new s}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=r(this._intersector)}start(t){super.start(t),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,f(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),t.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(t){return{geometryType:"point",useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:"cancel"}}attachPlugin(t){this._downstreamPlugin=t}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(t,s){if(this._downstreamPlugin===t&&(this._downstreamPlugin=null),m(t)&&this._clearCursorTarget(),"complete"!==s)return void this._syncAnalysisFromSession();const r=this._context?.getSession(t)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"point"});if(!r||!a(r))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._truncateItemsToSession();const n=c(t)?t.preservedIntersection:null;if(g(t)){const i=t.observer??this._operationObserver??new e;if(!this._intersector||!u(this.view,i,this._intersector,r,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:n}))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._operationObserver=i}else if(m(t)){const e=t.target??new i;if(!this._intersector||!u(this.view,e,this._intersector,r,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:n}))return this._syncAnalysisFromSession(),void this._restartDownstreamPlugin();this._operationTargets.add(e)}this._appendCommittedPoint(r),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(t){const e=this._session;e&&(e.appendOrReplacePoint(null,t),e.appendOrReplacePart(null,[]),e.automaticRestart=!1,e.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){const t=this._getCommittedPointCount();null==this._initialObserver&&0===t&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(t))}_restartDownstreamPlugin(){const t=null==this.analysis.observer,e=t?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();t&&g(this._downstreamPlugin)||!t&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(e,{cancelExisting:!0})}_createObserverPluginConfiguration(t=null){return h({observer:t,defaultCaptureMode:t?"grabbable-object":"capture-always",inputMapPosition:t?.position??null})}_createTargetPluginConfiguration(t=null){return _({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:t?"grabbable-object":"capture-always",getElevationInfo:this.getTargetElevationInfo,inputMapPosition:t?.position??null,target:t,view:this.view})}_syncAnalysisFromSession(){const t=this._getCommittedPointCount(),e=this._getCommittedOperationTargetCount(t);this.analysis.observer=this._getActiveObserver(t),f(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,e)))}_getActiveObserver(t){return null!=this._initialObserver?this._operationObserver??null:t>0?this._operationObserver:null}_getCommittedOperationTargetCount(t){return Math.max(0,t-(null!=this._initialObserver?0:Math.min(t,1)))}_getCommittedPointCount(){const t=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"multipoint"});return t&&l(t)?t.points.length:0}};function d(t){return{uniqueId:Symbol("line-of-sight-root-plugin"),kind:["multipart"],geometryType:"multipoint",hidden:!0,localizationKey:"line-of-sight-root",icon:"point",create:()=>new v(t)}}function f(t,e){let i=-1;for(let s=0;s<Math.min(t.length,e.length);s++)if(t.getItemAt(s)!==e[s]){i=s;break}if(-1===i){if(t.length===e.length)return;i=Math.min(t.length,e.length)}t.splice(i,t.length-i,...e.slice(i))}t([n({constructOnly:!0})],v.prototype,"analysis",void 0),t([n({constructOnly:!0})],v.prototype,"analysisViewData",void 0),t([n({constructOnly:!0})],v.prototype,"view",void 0),t([n({constructOnly:!0})],v.prototype,"getObserverElevationInfo",void 0),t([n({constructOnly:!0})],v.prototype,"getTargetElevationInfo",void 0),t([n()],v.prototype,"_intersector",void 0),t([n()],v.prototype,"_downstreamPlugin",void 0),v=t([o("esri.views.3d.analysis.LineOfSight.LineOfSightRootPlugin")],v);export{v as LineOfSightRootPlugin,d as createLineOfSightRootPluginConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,sync as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as a,updateLineOfSightItemFromAuthoredPoint as l,convertLineOfSightElevationMode as p}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as c}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as u}from"./LineOfSightRayIntersector.js";import{PluginBase as h}from"../../../draw/plugins/PluginBase.js";var d,v;const g=Symbol("line-of-sight-target-vertex"),y=Symbol("line-of-sight-target-plugin-marker");let f=class extends h{constructor(){super(...arguments),this[d]=!0,this[v]=!0,this.target=null,this.defaultCaptureMode="capture-always",this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{d=y,v=c}initialize(){this._intersector=new u({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(t){super.start(t),this.preservedIntersection=null;const{positionOfLastUserInput:n,session:r}=t,p="grabbable-object"===this.defaultCaptureMode?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??n:this.inputMapPosition??n;!p||"grabbable-object"!==this.defaultCaptureMode&&this._interactiveHandle||r.appendOrReplacePoint(g,p);let c="capture-always"===this.defaultCaptureMode&&null!=p;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=t.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:"grabbable-object"===this.defaultCaptureMode?p??void 0:void 0}),this.addHandles(s(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([t,s])=>{if(!t||this._isComplete||this._changingElevationMode)return;const o=this.analysisViewData.cursorTarget??new e,n={elevationInfo:s},r=this._interactiveHandle?.screenPosition,p=r&&this._intersector?this._intersector.getScreenPointIntersection(r):null;return this._session?.appendOrReplacePoint(g,t),c?(c=!1,void this._clearCursorTarget()):null!=p?(this.analysisViewData.cursorTarget=o,void a(this.view,o,p,{...n,snappedMapPoint:t})):null!=r&&null!=this.preservedIntersection?(this.analysisViewData.cursorTarget=o,void a(this.view,o,this.preservedIntersection,{...n,snappedMapPoint:t})):void(null==r&&this._intersector&&l(this.view,o,this._intersector,t,{...n,preservedIntersection:this.preservedIntersection})?this.analysisViewData.cursorTarget=o:this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget))},o),this._ownHandlesKey))}changeElevationMode(t,e,i){const s=this.analysisViewData.cursorTarget,o=s?.position,n=o?p({view:this.view,point:o,sourceElevationInfo:s.elevationInfo,mode:t,preserveZ:e}):null;this._changingElevationMode=!0;try{i();const t=this._interactiveHandle?.outputMapPosition;t&&this._session?.appendOrReplacePoint(g,t),s&&n&&(s.position=n.position,s.elevationInfo=n.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}};function _(t){return!!t&&y in t}function m(t){return{uniqueId:Symbol("line-of-sight-target-plugin"),kind:["vertex"],geometryType:"point",hidden:!0,localizationKey:"leaf-point-segment",icon:"point",create:()=>new f(t)}}t([n({constructOnly:!0})],f.prototype,"analysis",void 0),t([n({constructOnly:!0})],f.prototype,"analysisViewData",void 0),t([n({constructOnly:!0})],f.prototype,"view",void 0),t([n({constructOnly:!0})],f.prototype,"target",void 0),t([n({constructOnly:!0})],f.prototype,"getElevationInfo",void 0),t([n()],f.prototype,"defaultCaptureMode",void 0),t([n()],f.prototype,"inputMapPosition",void 0),t([n()],f.prototype,"preservedIntersection",void 0),t([n()],f.prototype,"_interactiveHandle",void 0),t([n()],f.prototype,"_intersector",void 0),f=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin")],f);export{f as LineOfSightTargetPlugin,m as createLineOfSightTargetPluginConfiguration,_ as isLineOfSightTargetPlugin,y as lineOfSightTargetPluginMarker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{LineOfSightDrawToolRenderer as t}from"./LineOfSightDrawToolRenderer.js";import{isLineOfSightPlacementLeafPlugin as i}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as r}from"./LineOfSightRayIntersector.js";import{DrawTool as a}from"../../../draw/DrawTool.js";import{bindViewToolOptions as s}from"../../../interactive/options/bindViewToolOptions.js";import l from"../../../interactive/options/InteractiveToolOptions.js";import{createScreenPointFromEvent as p}from"../../../support/screenUtils.js";function
|
|
2
|
+
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{LineOfSightDrawToolRenderer as t}from"./LineOfSightDrawToolRenderer.js";import{isLineOfSightPlacementLeafPlugin as i}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as r}from"./LineOfSightRayIntersector.js";import{DrawTool as a}from"../../../draw/DrawTool.js";import{bindViewToolOptions as s}from"../../../interactive/options/bindViewToolOptions.js";import l from"../../../interactive/options/InteractiveToolOptions.js";import{createScreenPointFromEvent as p}from"../../../support/screenUtils.js";function f(f){const{analysis:m,analysisViewData:c,snappingManager:d,view:v,getVisible:u,getSourceElevationInfo:g,getSnapToSceneEnabled:w,onCancel:b,onComplete:h,onManipulatorCountChange:j,shouldPreventVertexAdd:I}=f,y=g(),D=new t({analysis:m,analysisViewData:c,view:v}),S=new r({view:v}),T=new l,V=new a({elevationInfo:y,enableVertexVisuals:!1,hasZ:!0,renderer:D,toolOptions:T,snappingManager:d,view:v});return D.elevationInfo=y,V.addHandles([e(D),e(S),s(T,()=>v.options),V.on("cancel",()=>b(V)),V.on("complete",()=>h(V)),n(()=>[V.surfaceManager,w()],([e,n])=>{e&&(e.snapToSceneEnabled=n)},o),n(()=>[u(),c.visible,g()],([e,n,o])=>{V.visible=e&&n,D.analysisVisible=V.visible,V.elevationInfo=o,D.elevationInfo=o,D.refresh()},o),n(()=>V.manipulators.length,()=>j(V),o),n(()=>V.mostDownstreamPlugin,()=>{V.defaultZ=0},o),V.on(["before-vertex-add","before-vertex-add-at-point"],e=>{const n=e.detail.originalEvent;if("immediate-click"!==n?.type)return;const o=p(n);if(I(o,n.pointerType))return void e.preventDefault();const t=S.getScreenPointIntersection(o);if(null==t?.mapPoint)e.preventDefault();else{const e=V.mostDownstreamPlugin;i(e)&&(e.preservedIntersection=t)}})]),{drawTool:V,renderer:D}}export{f as createDrawTool};
|
|
@@ -90,11 +90,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
90
90
|
* Starts the interactive placement of an observer and/or targets on the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
91
91
|
*
|
|
92
92
|
* If the analysis does not have a valid observer yet, this method will allow placing an observer, which can be followed
|
|
93
|
-
* by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets.
|
|
93
|
+
* by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets. An observer
|
|
94
|
+
* is valid when it has a position. Placing an observer without any targets is a productive operation.
|
|
94
95
|
*
|
|
95
|
-
* The placement operation will finish when the user presses the escape key.
|
|
96
|
+
* The placement operation will finish when the user presses the escape key. Pressing escape after placing an observer
|
|
97
|
+
* or target finalizes a productive operation. Pressing escape before a valid observer is placed rejects the promise.
|
|
96
98
|
* To stop the placing programmatically, pass an abort signal as an argument when calling the method.
|
|
97
|
-
* The promise resolves when the operation is productive, i.e. an
|
|
99
|
+
* The promise resolves when the operation is productive, i.e. an observer or any targets were added.
|
|
98
100
|
* Otherwise, if nothing was added or signal was aborted, the promise is rejected.
|
|
99
101
|
*
|
|
100
102
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) to `true`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as n,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as r,sync as l}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as d}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as v,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import u from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as g}from"./viewshedToolUtils.js";import{vectorToRender as P}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as b}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as f}from"../../../input/InputManager.js";import{sketchKeys as y}from"../../../interactive/keybindings.js";import{bindViewToolOptions as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as n,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as r,sync as l}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as d}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as v,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import u from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as g}from"./viewshedToolUtils.js";import{vectorToRender as P}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as b}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as f}from"../../../input/InputManager.js";import{sketchKeys as y}from"../../../interactive/keybindings.js";import{bindViewToolOptions as S}from"../../../interactive/options/bindViewToolOptions.js";import O from"../../../interactive/options/InteractiveToolOptions.js";const T="multiple",D=Symbol("hiddenManipulatorHandle");let V=class extends o{constructor(e){super(e),this.placementMode=T,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new O,this._observerScenePoint=p(),this._targetScenePoint=p(),this._mapPointVector=p(),this.creationState=null}initialize(){this.addHandles([S(this._toolOptions,()=>this.view.options),s(()=>[this._drawTool?.tooltipManager,"placing-observer"===this.creationState],([e,t])=>{e&&(e.enabled=t)},r),this.view.on("key-down",e=>this._handleKeyDown(e),f.DEFAULT),s(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},l)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(i()),n(t);const{resolve:o,reject:s,promise:r}=Promise.withResolvers(),l=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new u({abortHandle:l,reject:s,resolve:o}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),r}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(y.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):y.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,o,i){const n=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:i});this.analysis.viewsheds.add(n),this.stagedViewshed=n,this.creationState="placing-target",this._updateStagedViewshed(o),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);const t=this.stagedViewshed;return!!t?.valid&&(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0)}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,renderer:t}=v({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>"placing-observer"===this.creationState});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([w({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(o){this._destroyDrawTool(e),this._rejectPlaceOperation(o instanceof Error?o:new Error(String(o)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){const{intersector:o,snappingManager:i,view:n}=this,a=e.clone(),s=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),r=_({intersector:o,snappingManager:i,screenPoint:t,view:n});this._renderer?.updatePlacementLocation(s),this._handleObserverPlacementComplete(a,s,r),this._setDrawToolElevationInfo(d)}_onTargetMapPointComplete(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t);return!!this._handleTargetPlacementComplete(t)&&("multiple"===this.placementMode&&(this.creationState="placing-observer",this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0)}_onObserverMapPointPreview(e){const t=e.clone(),o=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(o)}_onTargetMapPointPreview(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){const t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??d}get _snapToSceneEnabled(){const e=this.observerPlacementElevationInfo?.mode;return("placing-observer"!==this.creationState||null==e||"absolute-height"===e)&&null}_onManipulatorCountChange(e){e.removeHandles(D);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof b&&t.push(e.disableDisplay())}),e.addHandles(t,D)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&m(this.view,e)}_toScenePoint(e,t,o=d){const{x:i,y:n,z:a,spatialReference:s}=e,r=this._mapPointVector;return r[0]=i,r[1]=n,r[2]=a??0,P(r,s,o,this.view,t)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const o=this.callbacks.findViewshedComputedData(t);if(!o)return;const{heading:i,tilt:n,farDistance:a}=g(this.view,o,e);t.farDistance=a,t.tilt=n,t.heading=i}get test(){}};e([c({constructOnly:!0})],V.prototype,"analysis",void 0),e([c({constructOnly:!0})],V.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],V.prototype,"intersector",void 0),e([c({constructOnly:!0})],V.prototype,"snappingManager",void 0),e([c({constructOnly:!0})],V.prototype,"view",void 0),e([c({constructOnly:!0})],V.prototype,"callbacks",void 0),e([c()],V.prototype,"placementMode",void 0),e([c()],V.prototype,"observerPlacementElevationInfo",void 0),e([c()],V.prototype,"stagedViewshed",void 0),e([c()],V.prototype,"_placeOperation",void 0),e([c()],V.prototype,"_drawTool",void 0),e([c()],V.prototype,"_renderer",void 0),e([c()],V.prototype,"_toolOptions",void 0),e([c()],V.prototype,"updating",null),e([c()],V.prototype,"active",null),e([c()],V.prototype,"creationState",void 0),V=e([h("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],V);export{V as ViewshedPlacementController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import{watch as e,sync as o}from"../../../../core/reactiveUtils.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{createViewshedPlacementPointPluginConfiguration as i}from"./ViewshedPlacementPointPlugin.js";import{PluginBase as n}from"../../../draw/plugins/PluginBase.js";let l=class extends n{constructor(t){super(t),this._downstreamPlugin=null,this._step="observer"}start(t){super.start(t),t.session.appendOrReplacePart(null,[]),this._restartDownstreamPlugin()}beforeAttachPlugin(t){return{geometryType:"point",useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:"target"===this._step&&this._downstreamPlugin?.hasCommittedPoint?"complete":"cancel"}}attachPlugin(t){this._downstreamPlugin=t,this.addHandles([e(()=>t.outputMapPosition,e=>{null==e||this._isComplete||("observer"===t.step?this.onObserverPreview(e):this.onTargetPreview(e))},o)],this._downstreamHandlesKey)}detachPlugin(t,e){if(this._downstreamPlugin===t&&(this._downstreamPlugin=null),this.removeHandles(this._downstreamHandlesKey),"complete"!==e)return;const o=t.outputMapPosition,r=t.screenPosition;if(null==o||null==r)return;if("observer"===t.step)return this.onObserverComplete(o,r),this._step="target",void this._restartDownstreamPlugin();if(this.onTargetComplete(o,r))return"multiple"===this.mode?(this._step="observer",void this._restartDownstreamPlugin()):void this._context?.requestComplete();this._restartDownstreamPlugin()}_restartDownstreamPlugin(){const t=i(this._step);this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}};function a(t){return{uniqueId:Symbol("viewshed-placement-root-plugin"),kind:["multipart"],geometryType:"multipoint",hidden:!0,localizationKey:"viewshed-root",icon:"point",create:()=>new l(t)}}t([r({constructOnly:!0})],l.prototype,"mode",void 0),t([r({constructOnly:!0})],l.prototype,"onObserverComplete",void 0),t([r({constructOnly:!0})],l.prototype,"onTargetComplete",void 0),t([r({constructOnly:!0})],l.prototype,"onObserverPreview",void 0),t([r({constructOnly:!0})],l.prototype,"onTargetPreview",void 0),t([r()],l.prototype,"_downstreamPlugin",void 0),t([r()],l.prototype,"_step",void 0),l=t([s("esri.views.3d.analysis.Viewshed.ViewshedPlacementRootPlugin")],l);export{a as createViewshedPlacementRootPluginConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{length as e,subtract as t,add as r,scale as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as n}from"../intersectionUtils.js";function s(i,s,a,f=0){
|
|
2
|
+
import{length as e,subtract as t,add as r,scale as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as n}from"../intersectionUtils.js";function s(i,s,a,f=0){if(!i.state.constraints.collision.enabled)return!1;const m=s||a,y=n(i,m.eye),d=i.renderCoordsHelper.getAltitude(m.eye),p=y+i.state.constraints.elevationMargin;if(d>=p)return!(!s||a.equalsView(s))&&(a.copyViewFrom(s),!0);const u=e(m.eye);if(t(c,m.center,m.eye),a.eye=i.renderCoordsHelper.setAltitude(l,p,m.eye),1===f)a.center=r(c,a.eye,c);else if(2===f){const e=(u-d+p)/u;a.center=o(c,m.center,e)}return!0}const c=i(),l=i();export{s as applySurfaceCollisionConstraint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{copy as e,squaredDistance as r,scale as t,subtract as n,add as i,length as o,dot as s,distance as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function g(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,H,n)&&u(t,H)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c,l){const u=o.state.camera.clone();if(s&&a&&c&&(u.eye=s,u.center=a,u.up=c),l){const e=d(o,u,l);i(R,u.eye,t(R,u.viewForward,e))}else b(o,u.ray,R)||e(R,u.center);const f=o.state.constraints,g=f.minimumPoiDistance;if(r(u.eye,R)<g){const r=f.collision.enabled;e(C,u.viewForward),t(C,C,g),r?u.eye=n(H,R,C):i(R,u.eye,C);const s=o.renderCoordsHelper,a=s.getAltitude(u.eye),c=f.
|
|
2
|
+
import{copy as e,squaredDistance as r,scale as t,subtract as n,add as i,length as o,dot as s,distance as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function g(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,H,n)&&u(t,H)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c,l){const u=o.state.camera.clone();if(s&&a&&c&&(u.eye=s,u.center=a,u.up=c),l){const e=d(o,u,l);i(R,u.eye,t(R,u.viewForward,e))}else b(o,u.ray,R)||e(R,u.center);const f=o.state.constraints,g=f.minimumPoiDistance;if(r(u.eye,R)<g){const r=f.collision.enabled;e(C,u.viewForward),t(C,C,g),r?u.eye=n(H,R,C):i(R,u.eye,C);const s=o.renderCoordsHelper,a=s.getAltitude(u.eye),c=f.elevationMargin;r&&a<c&&(n(C,R,u.eye),u.eye=s.setAltitude(H,c,u.eye),i(R,u.eye,C))}return u.center=R,u}function y(e,r,t){const{origin:n,direction:i}=r;if(o(n)<e)return!0;const c=-s(i,n)/o(i);return c<0||c>=a(t,n)}function v(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(t,i,e.stage.renderer.sceneDepthRange.value.far),s=o*o;return r(t,n)>s}function b(e,r,t){let n=w[e.viewingMode];n||(n=new f(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,w[e.viewingMode]=n);const{isGlobal:i}=e.state,o=i?l(e.spatialReference).radius:0;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||v(e,r.origin,t)||i&&!y(o,n.ray,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||v(e,r.origin,t)||i&&!y(o,n.ray,t))||!!i&&M(r,t,o))}function M(e,r,n){const a=s(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/o(e.direction)),i(r,r,e.origin),!0}let w={};function j(){w={}}const H=c(),R=c(),C=c();export{p as cameraOnContentAlongViewDirection,j as cleanupIntersectionUtils,g as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function t(t){return t?.operations?.data.geometry}export{t as manipulatedObjectGeometry};
|
|
2
|
+
function t(t){return t?.operations?.data.geometry}function e(t){return null!=t.setElevationMode}export{t as manipulatedObjectGeometry,e as supportsElevationMode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as r}from"../../../../../core/quantity.js";import{initial as p,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{SnappingVisualizer3D as _}from"../../SnappingVisualizer3D.js";import{orientation as g}from"../geometryUtils.js";import{manipulatedObjectGeometry as M}from"../manipulatedObjectUtils.js";import{canMoveZOperations as y}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as b}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as j}from"../tooltipUtils3D.js";import{createVisualElements as T}from"../visualElementUtils.js";import{discRadius as w}from"../manipulations/config.js";import{MoveManipulation as I}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as H}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as S}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as D}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as E}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as x,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as A}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import R from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as z}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as X,enterInputModeIfAvailable as Y}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as B}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as F}from"../../../../support/GeometryWorkerHandle.js";class W{constructor(t){this.objects=t,this.type="move-start"}}class N{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class q{constructor(t){this.objects=t,this.type="move-stop"}}class L{constructor(t){this.objects=t,this.type="hold"}}const J=Symbol("manipulators"),K=Symbol("tooltips"),Q=Symbol("move-manipulator-display");let $=class extends U{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new R,this.type="move-3d",this._measurementWorker=new F({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=X(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(this.destroyed)return;if(Y(t,this.tooltip))return;const o=this.firstGrabbedManipulator;if("hold"===t.type&&null!=o){const t=this._getActiveObjectInfos(this._infos,o).map(({object:t})=>t);this.events.emit("hold",new L(t))}return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=M(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==O(e))continue;const t=new ot(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(b(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this.removeHandles(Q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new S({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],J)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),J)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(Q),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Q)}_createMoveManipulation(t){const o=new I({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(1===t.length?I.radiusForSymbol(t[0].object.graphic?.symbol):w)});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),J)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=r)})],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const r of t){this.addHandles([r.object.on("committed",i),this._updatingHandles.add(()=>r.object.visible,i)],J);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>r.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(E({view:this.view,geometry:r.object.graphic?.geometry,elevationInfo:r.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},p),J),this.addHandles(n(()=>this.removeHandles(o)),J)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),J);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){if(this.enableVisualElements)for(const o of t){const e=o.object,i=T({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof D&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=g(M(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&y(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof D&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>p?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new q(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of this._getActiveObjectInfos(t,e))a.push(o),l.push(o.object),o.dragging=!0;if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=x(l),p=P(l),this._emitRecordUndo(),this.events.emit("move-start",new W(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>r?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new N(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new q(l)),this.destroyed)return null;h()}return null}),cancel:n}}_getActiveObjectInfos(t,o){return t.filter(t=>!t.dragging&&(t.manipulationXY?.hasManipulator(o)||!t.manipulationXY?.grabbing))}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new B({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new W([o]))},onMove:()=>e.emit("move",new N(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new q([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=j(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new C({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new V({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(e)),H(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,G))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??r}else t.distance=r}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=M(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:A.fromGeometry(a,this.view.state.viewingMode),visualizer:new _,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:h}=z({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles,useZ:"on-the-ground"!==o.mode});return i=i.next(h),{steps:e=e.next(t=>({...t,snapOrigin:l.coordinateHelper.pointToVector(a)})).next(...p),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"view",void 0),t([c()],$.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableVisualElements",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableZ",void 0),t([c({constructOnly:!0})],$.prototype,"manipulatorRadius",void 0),t([c({constructOnly:!0,type:R})],$.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],$.prototype,"snappingManager",void 0),t([c()],$.prototype,"type",void 0),t([c()],$.prototype,"updating",null),t([c()],$.prototype,"_latestTooltipInfo",void 0),t([c()],$.prototype,"_shouldShowMovePointTooltip",null),t([c()],$.prototype,"activeTooltipInfo",null),$=t([d("esri.views.3d.interactive.editingTools.move.MoveTool3D")],$);const tt=u(v);class ot{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{L as HoldEvent,N as MoveEvent,W as MoveStartEvent,q as MoveStopEvent,$ as MoveTool3D};
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as r}from"../../../../../core/quantity.js";import{watch as p,initial as c,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as d,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as m}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as v}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Point.js";import{makeDehydratedPoint as _}from"../../../../../layers/graphics/dehydratedPoint.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as b,supportsElevationMode as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as j}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as T}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as w}from"../tooltipUtils3D.js";import{createVisualElements as I}from"../visualElementUtils.js";import{discRadius as H}from"../manipulations/config.js";import{MoveManipulation as S}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as O}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as D}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as E}from"./isSupportedObject.js";import{OutlineVisualElement as x}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as P}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as U,resetManipulatedObjectMany as R}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as k}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as X}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Y}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as B,enterInputModeIfAvailable as C}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as V}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as W}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as F}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as N}from"../../../../support/GeometryWorkerHandle.js";class q{constructor(t){this.objects=t,this.type="move-start"}}class L{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class J{constructor(t){this.objects=t,this.type="move-stop"}}class K{constructor(t){this.objects=t,this.type="hold"}}const Q=Symbol("manipulators"),$=Symbol("tooltips"),tt=Symbol("move-manipulator-display");let ot=class extends A{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new z,this.type="move-3d",this._measurementWorker=new N({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new v,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=B(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupObjectUpdateHandles(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupObjectUpdateHandles(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(this.destroyed)return;if(C(t,this.tooltip))return;const o=this.firstGrabbedManipulator;if("hold"===t.type&&null!=o){const t=this._getActiveObjectInfos(this._infos,o).map(({object:t})=>t);this.events.emit("hold",new K(t))}return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=b(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==E(e))continue;const t=new it(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupObjectUpdateHandles(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(T(t.object),o),y(o)&&this.addHandles(p(()=>{const{mode:t,unit:e,offset:i}=o.elevationInfo;return[t,e,i]},()=>this._refreshManipulators()),o)}}_refreshManipulators(){if(this.removeHandles(Q),this.removeHandles(tt),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new D({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],Q)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),Q)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(tt),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),tt)}_createMoveManipulation(t){const o=new S({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(1===t.length?S.radiusForSymbol(t[0].object.graphic?.symbol):H)});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),Q)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=r)})],Q)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const r of t){this.addHandles([r.object.on("committed",i),this._updatingHandles.add(()=>r.object.visible,i)],Q);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>r.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(P({view:this.view,geometry:r.object.graphic?.geometry,elevationInfo:r.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},c),Q),this.addHandles(n(()=>this.removeHandles(o)),Q)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),Q);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),Q)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){if(this.enableVisualElements)for(const o of t){const e=o.object,i=I({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof x&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],Q),this.addHandles(i,Q))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(b(t.object)))}_updateMoveManipulation(t){const o=_(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&j(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof x&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>p?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new J(l)),this.destroyed||c(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of this._getActiveObjectInfos(t,e))a.push(o),l.push(o.object),o.dragging=!0;if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=U(l),p=R(l),this._emitRecordUndo(),this.events.emit("move-start",new q(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>r?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new L(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new J(l)),this.destroyed)return null;c()}return null}),cancel:n}}_getActiveObjectInfos(t,o){return t.filter(t=>!t.dragging&&(t.manipulationXY?.hasManipulator(o)||!t.manipulationXY?.grabbing))}_connectTooltips(){let t;if(this.removeHandles($),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new V({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new q([o]))},onMove:()=>e.emit("move",new L(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new J([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=w(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i,onRecordUndo:t=>e.emit("record-undo",{updates:[t]})}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,$)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(et(t),et(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new G({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(et(t),et(e)),O(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new W({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,F))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??r}else t.distance=r}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=b(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new X({elevationInfo:o,pointer:n,editGeometryOperations:k.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=Y({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles,useZ:!1});return i=i.next(c),{steps:e=e.next(t=>({...t,snapOrigin:l.coordinateHelper.pointToVector(a)})).next(...p),cancel:i}}get test(){}};t([d({constructOnly:!0,nonNullable:!0})],ot.prototype,"view",void 0),t([d()],ot.prototype,"objects",void 0),t([d({constructOnly:!0,nonNullable:!0})],ot.prototype,"enableVisualElements",void 0),t([d({constructOnly:!0,nonNullable:!0})],ot.prototype,"enableZ",void 0),t([d({constructOnly:!0})],ot.prototype,"manipulatorRadius",void 0),t([d({constructOnly:!0,type:z})],ot.prototype,"toolOptions",void 0),t([d({constructOnly:!0})],ot.prototype,"snappingManager",void 0),t([d()],ot.prototype,"type",void 0),t([d()],ot.prototype,"updating",null),t([d()],ot.prototype,"_latestTooltipInfo",void 0),t([d()],ot.prototype,"_shouldShowMovePointTooltip",null),t([d()],ot.prototype,"activeTooltipInfo",null),ot=t([u("esri.views.3d.interactive.editingTools.move.MoveTool3D")],ot);const et=m(f);class it{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{K as HoldEvent,L as MoveEvent,q as MoveStartEvent,J as MoveStopEvent,ot as MoveTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as o}from"../../../../core/handleUtils.js";import{createAngle as
|
|
2
|
+
import{handlesGroup as t,makeHandle as o}from"../../../../core/handleUtils.js";import{createAngle as e,createLength as n}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as a,sync as r}from"../../../../core/reactiveUtils.js";import{manipulatedObjectGeometry as l,supportsElevationMode as s}from"./manipulatedObjectUtils.js";import{connectPasteEvent as c,updateMeshTransformFromTooltipInfo as u,getXYZDeltasFromTooltipInfo as p,updateTooltipInfoFromMeshTransform as f}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{elevationFromPoint as v}from"../../../support/euclideanLengthMeasurementUtils.js";function d(e,n,s){function u(){const t=s(),o=t.toolOptions.tooltips.effectiveEnabled?t.activeTooltipInfo:null;return{...t,activeTooltipInfo:o}}let p=!1,f=!0;function v(t){if(f&&!p){p=!0;try{t()}finally{p=!1}}}function d(t){const{activeTooltipInfo:o,toolOptions:i,scaleRotateTransform:a}=t;v(()=>{if(o){o.toolOptions=i,b(o,n),T(o,a);const e=m(n,o);e&&(e.elevationModeContext=g(t))}e.info=o})}function g({callbacks:t,onRecordUndo:o}){return o?{get mode(){return n.elevationInfo.mode},get disabled(){return!f||n.updating||null==l(n)},onChange:e=>{if(!f||n.updating)return;t.onBeforeUpdate();const i=n.setElevationMode?.(e);i&&(o(i),d(u()))}}:null}return t([o(()=>{f=!1;const t=m(n,s().activeTooltipInfo);t&&(t.elevationModeContext=null)}),i(u,d,a),i(()=>{const t=u(),{activeTooltipInfo:o}=t;if(o)return{context:t,activeTooltipInfo:o,key:o.key,geometry:l(n)}},(t,o)=>{t&&o&&o.key!==t.key&&v(()=>y(n,t.context))},r),n.on("committed",()=>{queueMicrotask(()=>d(u()))}),c(e,{onBeforePaste:()=>{p=!0},onAfterPaste:()=>{y(n,u()),p=!1}})])}function m(t,o){return s(t)&&"move-point"===o?.type?o:null}function y(t,{activeTooltipInfo:o,callbacks:e}){if(!o)return;e.onBeforeUpdate();const n=l(t);switch(n?.type){case"mesh":g(o,n.origin,t,e),"orientation"in o&&"scale"in o&&u(o,n,e);break;case"point":g(o,n,t,e)}}function g(t,o,e,n){const{dx:i,dy:a,dz:r}=p(t,o);0===i&&0===a&&0===r||(n.onMoveStart(),e.operations?.move(i,a,r,0),n.onMove(i,a,r),n.onMoveStop())}function b(t,o){const e=l(o),n=e?.type;if(!t||!e||"mesh"!==n&&"point"!==n)return;const i="mesh"===n,a=i?e.origin:e;t.setLocationFromPoint(a),h(t,a,o),"transform-mesh"===t.type&&i&&f(t,e),t.clearInputValues()}function h(t,o,e){t.elevation.actual=v(o),t.elevation.visible=!!e.operations?.data.coordinateHelper.hasZ(),t.elevation.readOnly=!1,t.elevation.showAsZ=!0}function T(t,o){if("transform-point"!==t?.type)return;if(!o)return t.orientation.actual=void 0,t.size.actual=void 0,t.orientation.visible=!1,void(t.size.visible=!1);const i=o.mode,{size:a,orientationClockwise:r}=o.adapter,{visualVariables:l}=t.toolOptions.tooltips,s=l?.rotation,c=null!=r&&(null==i||"rotate"===i),u="geographic";t.orientation.actual=c?e(r,"radians",u):void 0,t.orientation.precision=k(s?.valueType),t.orientation.visible=c;const p=l?.size,f=null!=a&&(null==i||"scale"===i);t.size.actual=f?n(a,p?.unit??"meters"):void 0,t.size.precision=k(p?.valueType),t.size.visible=f}function k(t){switch(t){case"integer":case"long":return 0;default:return null}}export{d as connectTooltipToManipulatedObject,h as updateElevationFromPoint,b as updateTooltipInfoFromManipulatedObject,g as updateXYZFromTooltipInfo};
|