@arcgis/core 6.0.0-next.14 → 6.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/LineOfSightAnalysis.d.ts +49 -32
- package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
- package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
- package/analysis/Viewshed.d.ts +23 -3
- package/analysis/ViewshedAnalysis.d.ts +33 -13
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
- package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
- package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
- package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
- package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
- package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
- package/assets/esri/core/workers/chunks/23c43f09c4a4749516e1.js +1 -0
- package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
- package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
- package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 36cbd614454581aaf334.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
- package/assets/esri/core/workers/chunks/3baa4a9c52f41bfd6abb.js +1 -0
- package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
- package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
- package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
- package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
- package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
- package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
- package/assets/esri/core/workers/chunks/4bbe1f28f5f16a6bef05.js +1 -0
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
- package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
- package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
- package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
- package/assets/esri/core/workers/chunks/5acb422fe3cf693d9d4f.js +1 -0
- package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
- package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
- package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
- package/assets/esri/core/workers/chunks/6a8dd8b18b0b825b0c1b.js +1 -0
- package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
- package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
- package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
- package/assets/esri/core/workers/chunks/7b5f3c79e0605c32b267.js +1 -0
- package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
- package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
- package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
- package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
- package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
- package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
- package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
- package/assets/esri/core/workers/chunks/91dd65cf877c8f2e01a7.js +1 -0
- package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
- package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
- package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
- package/assets/esri/core/workers/chunks/9b051745d24d1f43480b.js +1 -0
- package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
- package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 9f06ec95bdf0d0b52b41.js} +1 -1
- package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
- package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → a7bd5ba4d7d97411fd33.js} +1 -1
- package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
- package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
- package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
- package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → bf35927979fc5e7e0478.js} +1 -1
- package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
- package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → c5a9e77977e867a75ff2.js} +1 -1
- package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → c79934cd6883307203f8.js} +1 -1
- package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
- package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
- package/assets/esri/core/workers/chunks/d311ff96a5a2791d8cfc.js +1 -0
- package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
- package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
- package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
- package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
- package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
- package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
- package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
- package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
- package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
- package/assets/esri/core/workers/chunks/{aadfe34a99c9ec7a0e11.js → f9c5aa0bbf23e780fecc.js} +1 -1
- package/assets/esri/core/workers/chunks/f9ff27cfcf0538ac5e26.js +1 -0
- package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
- package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
- package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/index.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/config.d.ts +2 -0
- package/config.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/PooledArray.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/MultiOriginStore.js +1 -1
- package/core/accessorSupport/Store.js +1 -1
- package/core/accessorSupport/decorators/reader.js +1 -1
- package/core/accessorSupport/decorators/writer.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +9 -0
- package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils.d.ts +5 -6
- package/geometry/support/polygonExtentClipping.js +1 -1
- package/identity/Credential.js +1 -1
- package/interfaces.d.ts +18 -9
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +4 -4
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +154 -4
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Layer.d.ts +2 -0
- package/layers/LineOfSightLayer.d.ts +10 -8
- package/layers/SceneLayer.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
- package/layers/mixins/ReloadableLayer.js +2 -0
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +2 -2
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +1 -1
- package/layers/raster/functions/stretchUtils.js +1 -1
- package/layers/raster/functions/vectorFieldUtils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/LabelClass.d.ts +3 -2
- package/layers/support/PortalItemData.d.ts +31 -8
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/featureReductionProperties.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/types.d.ts +4 -1
- package/layers/video/VideoController.js +10 -10
- package/libs/maquette/projection.js +1 -1
- package/networks/UtilityNetworkTraceAnalysis.js +1 -1
- package/package.json +5 -5
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/portal/Portal.js +1 -1
- package/request/process.js +1 -1
- package/request/types.d.ts +7 -0
- package/rest/knowledgeGraph/ObjectValue.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/smartMapping/raster/renderers/shadedRelief.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/clusterUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -3
- package/undoredo/support/Services.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.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 → LineOfSightPlacementRootPlugin.js} +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +7 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sphereExtentUtils.js +2 -0
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/options/TooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/constraintUtils.js +1 -1
- package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +35 -13
- package/views/layers/SketchLayerView.d.ts +1 -0
- package/views/layers/ViewshedLayerView.d.ts +36 -12
- package/views/webgl/Program.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +10 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor.d.ts +10 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
- package/widgets/FeatureTable/support/TableTemplate.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +2 -2
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Legend.d.ts +1 -0
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/types.d.ts +2 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
- package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
- package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
- package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
- package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
- package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
- package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
- package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
- package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
- package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
- package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
- package/assets/esri/core/workers/chunks/22e8c0aad2fe75943865.js +0 -1
- package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
- package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
- package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
- package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
- package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
- package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
- package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
- package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
- package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
- package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
- package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
- package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
- package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
- package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
- package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
- package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
- package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
- package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
- package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
- package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
- package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
- package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
- package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
- package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
- package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
- package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
- package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
- package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
- package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
- package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
- package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
- package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
- package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
- package/layers/mixins/FeatureLayerReload.js +0 -2
- /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{updatePointsFromFeatureReference as t,getFeatureId as n}from"../../../../analysis/featureReferenceUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import a from"../../../../core/Handles.js";import{handlesGroup as o,makeHandle as s}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as l}from"../../../../core/maybe.js";import{ignoreAbortErrors as u}from"../../../../core/promiseUtils.js";import{initial as d,on as f}from"../../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{copy as h,subtract as g,normalize as _,scale as v,add as y,dist as b,sub as x}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import w from"../../../../geometry/Point.js";import{projectOrLoad as T}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{intersectsSegment as D}from"../../../../geometry/support/aaBoundingBox.js";import{empty as O,containsPointObject as k,intersectsSegment as A}from"../../../../geometry/support/aaBoundingRect.js";import{create as j,fromPoints as M}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as N}from"../../../../support/elevationInfoUtils.js";import P from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as F}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as I}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as L}from"../support/projectionUtils.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as z,TaskPriority as B}from"../../../support/Scheduler.js";let V=class extends i{constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode=`absolute-height`,this._observerFeatureId=null,this._updatingHandles=new C,this._frameTask=z,this._computationHandles=new a,this._externalObserverUpdate=!0}initialize(){let e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(B.LINE_OF_SIGHT_TOOL):z,this._intersector=new I({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){let t=e.computation,{inputPoints:n,computationResult:r}=t,{observerAdjusted:i,targetAdjusted:a}=n,{start:o,end:s}=r;h(o,i),h(s,a),this._canCompute(t)?this._computeIntersection(e):W(e),t.notifyResultChanged(),this.emit(`result-changed`,{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){let{view:n}=this,{inputPoints:r}=e,{observer:i,target:a,observerAdjusted:o,targetAdjusted:s}=r;h(o,i),h(s,a),t(n,this._intersector.intersector,r);let{observerSurfaceNormal:c,targetSurfaceNormal:l}=r,u=this._screenPixelSize,d=K;c==null?g(d,s,o):h(d,c);let f=u;_(d,d),v(d,d,Math.min(f,1)),y(o,o,d),l==null?g(d,o,s):h(d,l);let p=n.state.camera.computeScreenPixelSizeAt(s);_(d,d),v(d,d,Math.min(p,1)),y(s,s,d)}_computeIntersection({computation:e,interpolationInfo:t}){let{view:n}=this,{sceneIntersectionHelper:r,renderCoordsHelper:i}=n;if(r==null)return;let a=this._intersector.intersector,{computationResult:o,inputPoints:s}=e,{observer:c,target:l}=s,{start:u,end:d}=o,f=M(u,d,q);a.options.store=0,r.intersectToolIntersectorRay(f,a);let p=a.results.min,m=o.intersection,g=K,_=p!=null&&p.getIntersectionPoint(m),v=!0;if(_){h(t.originalIntersection,m),h(t.originalObserver,u),h(t.originalTarget,d),i.fromRenderCoords(m,g,n.spatialReference);let e=1-b(d,l)/b(u,l);v=b(c,m)>=e*b(c,l)}let y=new w(g,n.spatialReference);{let{result:t,target:r}=e;t==null?e.result=new P({target:r,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:v?null:R(p,n),intersectedLocation:v?null:y,visible:v}):(t.target=r,t.intersectedGraphic=v?null:R(p,n),t.intersectedLocation=v?null:y,t.visible=v)}o.isValid=s.isValid=!0,o.isTargetVisible=v}_canCompute(e){let t=this.analysisViewData.elevationAlignedObserver,{frustum:n}=this.view;if(t==null||e.elevationAlignedTargetLocation==null||n==null)return!1;let{observerAdjusted:r,targetAdjusted:i}=e.inputPoints,a=n.intersectsPoint(r),o=n.intersectsPoint(i);return a&&o}_onObserverPositionChange(e,t,r,i,a){if(this._externalObserverUpdate=a,e==null){this.analysisViewData.elevationAlignedObserver=null,this._observerFeatureId=null;return}if(t==null){L(this.analysis,e.spatialReference,c.getLogger(this)),this.analysisViewData.elevationAlignedObserver=null;return}let o=H(t,r),{absoluteZ:s,elevation:l}=N(t.x,t.y,t.z,this.view.spatialReference,this.view,o),u=t.clone();u.z=s,this._effectiveObserverElevationMode=o.mode,this.analysisViewData.elevationAlignedObserver=u;let d=S();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=s-l,this._observerFeatureId=n(i),this.priority=B.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,n,r,i){let{inputPoints:a}=e;switch(h(a.observer,t),a.observerFeatureId=i,a.observerSurfaceNormal=null,r){case`on-the-ground`:case`relative-to-ground`:{let e=this._intersector.updateFromGroundIntersection(a.observer,n,a.observer);a.observerFeatureId??(a.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=B.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,r,i,a,o=!0){let s=e.inputPoints;if(o&&(s.isValid=!1),r==null){t!=null&&L(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,e.notifyInputPointsChanged();return}let l=H(r,i),{absoluteZ:u,elevation:d}=N(r.x,r.y,r.z,this.view.spatialReference,this.view,l),f=r.clone();switch(f.z=u,e.elevationAlignedTargetLocation=f,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,s.target),s.targetFeatureId=n(a),s.targetSurfaceNormal=null,l.mode){case`on-the-ground`:case`relative-to-ground`:{let e=this._intersector.updateFromGroundIntersection(s.target,u-d,s.target);s.targetFeatureId??(s.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=B.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return o([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfoDependency:U(e.target.elevationInfo),targetFeatureInfo:e.target.feature,projectedTargetPosition:T(e.target.position,this.view.spatialReference)}),({computation:e,targetPosition:t,targetFeatureInfo:n,projectedTargetPosition:r})=>{r.pending==null?this._onTargetPositionChange(e,t,r.geometry,e.target.elevationInfo,n):this._updatingHandles.consumePromise(r.pending)},d)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},d)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:t,observerGroundOffset:n,observerElevationMode:r,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,n,r,i)},d)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slice.plane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){let t=(n,r)=>{let i=this.analysis.observer,a=e.target,o=null,s=null,c=null,l=null,u=null,d=null;if(i?.position!=null){let e=T(i.position,this.view.spatialReference);if(e.pending!=null){this._updatingHandles.consumePromise(e.pending),e.pending.finally(()=>t(n,r));return}o=e.geometry,s=i.elevationInfo,c=i.feature}if(a.position!=null){let e=T(a.position,this.view.spatialReference);if(e.pending!=null){this._updatingHandles.consumePromise(e.pending),e.pending.finally(()=>t(n,r));return}l=e.geometry,u=a.elevationInfo,d=a.feature}(o!=null||l!=null)&&(E(n,r,J,this.view.spatialReference),o!=null&&k(J,o)&&this._onObserverPositionChange(i==null?null:i.position,o,s,c,!1),l!=null&&k(J,l)&&this._onTargetPositionChange(e,a.position,l,u,d,!1),o!=null&&l!=null&&A(J,o,l)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on(`elevation-change`,({extent:e,spatialReference:n})=>t(e,n))}_connectComputationToTask(e){let t=null,n={computation:e,interpolationInfo:{originalIntersection:S(),originalObserver:S(),originalTarget:S()}};return o([this._updatingHandles.add(()=>e.inputPoints,()=>{t=l(t),t=r(async e=>{await u(this._frameTask.schedule(()=>this._computeResult(n),e))})},{initial:!0,equals:()=>!1}),s(()=>t=l(t))])}_connectComputationToContent(e){return f(()=>this.view.pointsOfInterest?.contentGeometryUpdates.events,`request-update`,t=>{let n=t?.renderBounds,{observerAdjusted:r,targetAdjusted:i}=e.inputPoints;(n==null||D(n,r,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())})}_connectComputation(e){let t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(let e of t)this._disconnectComputation(e);for(let t of e)this._connectComputation(t)}_onTargetCollectionChange({added:e,removed:t}){for(let e of t)this._removeTarget(e);for(let t of e)this._addTarget(t)}_onCursorTargetChange(e,t){t!=null&&this._removeTarget(t),e!=null&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new F({target:e}))}_removeTarget(e){let t=this._computations.findIndex(t=>t.target===e);this._computations.removeAt(t)}_connectObserver(){return o([this._updatingHandles.add(()=>({observerPosition:this.analysis.observer==null?null:this.analysis.observer.position,projectedObserverPosition:T(this.analysis.observer==null?null:this.analysis.observer.position,this.view.spatialReference),observerElevationInfoDependency:U(this.analysis.observer?.elevationInfo),observerFeatureInfo:this.analysis.observer==null?null:this.analysis.observer.feature}),({observerPosition:e,projectedObserverPosition:t,observerFeatureInfo:n})=>{t.pending==null?this._onObserverPositionChange(e,t.geometry,this.analysis.observer?.elevationInfo,n,!0):this._updatingHandles.consumePromise(t.pending)},d)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return o([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){let e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:n}=t;if(e==null||n==null)return!1;let r=K;n.toRenderCoords(e,r);let i=t.state.camera.computeScreenPixelSizeAt(r);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>G}};e([p({constructOnly:!0})],V.prototype,`analysis`,void 0),e([p({constructOnly:!0})],V.prototype,`analysisViewData`,void 0),e([p({constructOnly:!0})],V.prototype,`view`,void 0),e([p()],V.prototype,`updating`,null),e([p()],V.prototype,`priority`,null),e([p()],V.prototype,`updateOnCameraChange`,void 0),e([p()],V.prototype,`_computations`,null),e([p()],V.prototype,`_elevationAlignedObserverPositionRenderSpace`,null),e([p()],V.prototype,`_observerGroundOffsetRenderSpace`,void 0),e([p()],V.prototype,`_effectiveObserverElevationMode`,void 0),e([p()],V.prototype,`_observerFeatureId`,void 0),e([p()],V.prototype,`_screenPixelSize`,null),e([p({readOnly:!0})],V.prototype,`_updatingHandles`,void 0),e([p()],V.prototype,`_frameTask`,void 0),e([p()],V.prototype,`_isCameraDirty`,null),V=e([m(`esri.views.3d.analysis.LineOfSight.LineOfSightController`)],V);function H(e,t){return e.hasZ?t??{mode:`absolute-height`,offset:0}:{mode:`on-the-ground`,offset:0}}function U(e){return{mode:e?.mode,offset:e?.offset,unit:e?.unit}}function W({computation:e,interpolationInfo:t}){let{computationResult:n,inputPoints:r}=e,{start:i,end:a,intersection:o}=n,{originalIntersection:s,originalObserver:c,originalTarget:l}=t;if(h(o,s),r.isValid){let e=K,t=b(c,s)/b(c,l);x(e,i,c),v(e,e,1-t),y(o,o,e),x(e,a,l),v(e,e,t),y(o,o,e),n.isValid=!0}else e.result=null,n.isValid=!1,n.isTargetVisible=!1}const G=.1,K=S(),q=j(),J=O();export{V as LineOfSightController};
|
|
2
|
+
import{__decorate as e}from"tslib";import{updatePointsFromFeatureReference as t,getFeatureId as n}from"../../../../analysis/featureReferenceUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import a from"../../../../core/Handles.js";import{handlesGroup as o,makeHandle as s}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as l}from"../../../../core/maybe.js";import{ignoreAbortErrors as u}from"../../../../core/promiseUtils.js";import{initial as d,on as f}from"../../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{copy as h,subtract as g,normalize as _,scale as v,add as y,dist as b,sub as x}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import w from"../../../../geometry/Point.js";import{projectOrLoad as T}from"../../../../geometry/projectionUtils.js";import{intersectsSegment as E}from"../../../../geometry/support/aaBoundingBox.js";import{empty as D,intersectsSegment as O}from"../../../../geometry/support/aaBoundingRect.js";import{create as k,fromPoints as A}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as j}from"../../../../support/elevationInfoUtils.js";import M from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as N}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as P}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as F}from"../support/projectionUtils.js";import{projectElevationUpdateExtent as I,containsElevationUpdatePoint as L}from"../../support/elevationUpdateExtentUtils.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as z,TaskPriority as B}from"../../../support/Scheduler.js";let V=class extends i{constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode=`absolute-height`,this._observerFeatureId=null,this._updatingHandles=new C,this._frameTask=z,this._computationHandles=new a,this._externalObserverUpdate=!0}initialize(){let e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(B.LINE_OF_SIGHT_TOOL):z,this._intersector=new P({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){let t=e.computation,{inputPoints:n,computationResult:r}=t,{observerAdjusted:i,targetAdjusted:a}=n,{start:o,end:s}=r;h(o,i),h(s,a),this._canCompute(t)?this._computeIntersection(e):W(e),t.notifyResultChanged(),this.emit(`result-changed`,{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){let{view:n}=this,{inputPoints:r}=e,{observer:i,target:a,observerAdjusted:o,targetAdjusted:s}=r;h(o,i),h(s,a),t(n,this._intersector.intersector,r);let{observerSurfaceNormal:c,targetSurfaceNormal:l}=r,u=this._screenPixelSize,d=K;c==null?g(d,s,o):h(d,c);let f=u;_(d,d),v(d,d,Math.min(f,1)),y(o,o,d),l==null?g(d,o,s):h(d,l);let p=n.state.camera.computeScreenPixelSizeAt(s);_(d,d),v(d,d,Math.min(p,1)),y(s,s,d)}_computeIntersection({computation:e,interpolationInfo:t}){let{view:n}=this,{sceneIntersectionHelper:r,renderCoordsHelper:i}=n;if(r==null)return;let a=this._intersector.intersector,{computationResult:o,inputPoints:s}=e,{observer:c,target:l}=s,{start:u,end:d}=o,f=A(u,d,q);a.options.store=0,r.intersectToolIntersectorRay(f,a);let p=a.results.min,m=o.intersection,g=K,_=p!=null&&p.getIntersectionPoint(m),v=!0;if(_){h(t.originalIntersection,m),h(t.originalObserver,u),h(t.originalTarget,d),i.fromRenderCoords(m,g,n.spatialReference);let e=1-b(d,l)/b(u,l);v=b(c,m)>=e*b(c,l)}let y=new w(g,n.spatialReference);{let{result:t,target:r}=e;t==null?e.result=new M({target:r,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:v?null:R(p,n),intersectedLocation:v?null:y,visible:v}):(t.target=r,t.intersectedGraphic=v?null:R(p,n),t.intersectedLocation=v?null:y,t.visible=v)}o.isValid=s.isValid=!0,o.isTargetVisible=v}_canCompute(e){let t=this.analysisViewData.elevationAlignedObserver,{frustum:n}=this.view;if(t==null||e.elevationAlignedTargetLocation==null||n==null)return!1;let{observerAdjusted:r,targetAdjusted:i}=e.inputPoints,a=n.intersectsPoint(r),o=n.intersectsPoint(i);return a&&o}_onObserverPositionChange(e,t,r,i,a){if(this._externalObserverUpdate=a,e==null){this.analysisViewData.elevationAlignedObserver=null,this._observerFeatureId=null;return}if(t==null){F(this.analysis,e.spatialReference,c.getLogger(this)),this.analysisViewData.elevationAlignedObserver=null;return}let o=H(t,r),{absoluteZ:s,elevation:l}=j(t.x,t.y,t.z,this.view.spatialReference,this.view,o),u=t.clone();u.z=s,this._effectiveObserverElevationMode=o.mode,this.analysisViewData.elevationAlignedObserver=u;let d=S();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=s-l,this._observerFeatureId=n(i),this.priority=B.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,n,r,i){let{inputPoints:a}=e;switch(h(a.observer,t),a.observerFeatureId=i,a.observerSurfaceNormal=null,r){case`on-the-ground`:case`relative-to-ground`:{let e=this._intersector.updateFromGroundIntersection(a.observer,n,a.observer);a.observerFeatureId??(a.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=B.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,r,i,a,o=!0){let s=e.inputPoints;if(o&&(s.isValid=!1),r==null){t!=null&&F(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,e.notifyInputPointsChanged();return}let l=H(r,i),{absoluteZ:u,elevation:d}=j(r.x,r.y,r.z,this.view.spatialReference,this.view,l),f=r.clone();switch(f.z=u,e.elevationAlignedTargetLocation=f,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,s.target),s.targetFeatureId=n(a),s.targetSurfaceNormal=null,l.mode){case`on-the-ground`:case`relative-to-ground`:{let e=this._intersector.updateFromGroundIntersection(s.target,u-d,s.target);s.targetFeatureId??(s.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=B.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return o([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfoDependency:U(e.target.elevationInfo),targetFeatureInfo:e.target.feature,projectedTargetPosition:T(e.target.position,this.view.spatialReference)}),({computation:e,targetPosition:t,targetFeatureInfo:n,projectedTargetPosition:r})=>{r.pending==null?this._onTargetPositionChange(e,t,r.geometry,e.target.elevationInfo,n):this._updatingHandles.consumePromise(r.pending)},d)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},d)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:t,observerGroundOffset:n,observerElevationMode:r,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,n,r,i)},d)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slice.plane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){let t=(n,r)=>{let i=this.analysis.observer,a=e.target,o=null,s=null,c=null,l=null,u=null,d=null;if(i?.position!=null){let e=T(i.position,this.view.spatialReference);if(e.pending!=null){this._updatingHandles.consumePromise(e.pending),e.pending.finally(()=>t(n,r));return}o=e.geometry,s=i.elevationInfo,c=i.feature}if(a.position!=null){let e=T(a.position,this.view.spatialReference);if(e.pending!=null){this._updatingHandles.consumePromise(e.pending),e.pending.finally(()=>t(n,r));return}l=e.geometry,u=a.elevationInfo,d=a.feature}(o!=null||l!=null)&&(I(n,r,J,this.view.spatialReference),o!=null&&L(J,o.x,o.y,this.view.spatialReference)&&this._onObserverPositionChange(i==null?null:i.position,o,s,c,!1),l!=null&&L(J,l.x,l.y,this.view.spatialReference)&&this._onTargetPositionChange(e,a.position,l,u,d,!1),o!=null&&l!=null&&O(J,o,l)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on(`elevation-change`,({extent:e,spatialReference:n})=>t(e,n))}_connectComputationToTask(e){let t=null,n={computation:e,interpolationInfo:{originalIntersection:S(),originalObserver:S(),originalTarget:S()}};return o([this._updatingHandles.add(()=>e.inputPoints,()=>{t=l(t),t=r(async e=>{await u(this._frameTask.schedule(()=>this._computeResult(n),e))})},{initial:!0,equals:()=>!1}),s(()=>t=l(t))])}_connectComputationToContent(e){return f(()=>this.view.pointsOfInterest?.contentGeometryUpdates.events,`request-update`,t=>{let n=t?.renderBounds,{observerAdjusted:r,targetAdjusted:i}=e.inputPoints;(n==null||E(n,r,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())})}_connectComputation(e){let t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(let e of t)this._disconnectComputation(e);for(let t of e)this._connectComputation(t)}_onTargetCollectionChange({added:e,removed:t}){for(let e of t)this._removeTarget(e);for(let t of e)this._addTarget(t)}_onCursorTargetChange(e,t){t!=null&&this._removeTarget(t),e!=null&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new N({target:e}))}_removeTarget(e){let t=this._computations.findIndex(t=>t.target===e);this._computations.removeAt(t)}_connectObserver(){return o([this._updatingHandles.add(()=>({observerPosition:this.analysis.observer==null?null:this.analysis.observer.position,projectedObserverPosition:T(this.analysis.observer==null?null:this.analysis.observer.position,this.view.spatialReference),observerElevationInfoDependency:U(this.analysis.observer?.elevationInfo),observerFeatureInfo:this.analysis.observer==null?null:this.analysis.observer.feature}),({observerPosition:e,projectedObserverPosition:t,observerFeatureInfo:n})=>{t.pending==null?this._onObserverPositionChange(e,t.geometry,this.analysis.observer?.elevationInfo,n,!0):this._updatingHandles.consumePromise(t.pending)},d)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return o([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){let e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:n}=t;if(e==null||n==null)return!1;let r=K;n.toRenderCoords(e,r);let i=t.state.camera.computeScreenPixelSizeAt(r);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>G}};e([p({constructOnly:!0})],V.prototype,`analysis`,void 0),e([p({constructOnly:!0})],V.prototype,`analysisViewData`,void 0),e([p({constructOnly:!0})],V.prototype,`view`,void 0),e([p()],V.prototype,`updating`,null),e([p()],V.prototype,`priority`,null),e([p()],V.prototype,`updateOnCameraChange`,void 0),e([p()],V.prototype,`_computations`,null),e([p()],V.prototype,`_elevationAlignedObserverPositionRenderSpace`,null),e([p()],V.prototype,`_observerGroundOffsetRenderSpace`,void 0),e([p()],V.prototype,`_effectiveObserverElevationMode`,void 0),e([p()],V.prototype,`_observerFeatureId`,void 0),e([p()],V.prototype,`_screenPixelSize`,null),e([p({readOnly:!0})],V.prototype,`_updatingHandles`,void 0),e([p()],V.prototype,`_frameTask`,void 0),e([p()],V.prototype,`_isCameraDirty`,null),V=e([m(`esri.views.3d.analysis.LineOfSight.LineOfSightController`)],V);function H(e,t){return e.hasZ?t??{mode:`absolute-height`,offset:0}:{mode:`on-the-ground`,offset:0}}function U(e){return{mode:e?.mode,offset:e?.offset,unit:e?.unit}}function W({computation:e,interpolationInfo:t}){let{computationResult:n,inputPoints:r}=e,{start:i,end:a,intersection:o}=n,{originalIntersection:s,originalObserver:c,originalTarget:l}=t;if(h(o,s),r.isValid){let e=K,t=b(c,s)/b(c,l);x(e,i,c),v(e,e,1-t),y(o,o,e),x(e,a,l),v(e,e,t),y(o,o,e),n.isValid=!0}else e.result=null,n.isValid=!1,n.isTargetVisible=!1}const G=.1,K=S(),q=k(),J=D();export{V as LineOfSightController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(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(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this.
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(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(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),O(e,this.tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=D({snappingContext:new E({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new v}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(y(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?g.undefined:r.computationResult.isTargetVisible?g.visible:g.occluded;t.state=this.interacting&&t.selected?_(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:f(r.renderLocation,t.renderLocation,k);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],j.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`tooltip`,void 0),e([c()],j.prototype,`automaticManipulatorSelection`,void 0),e([c()],j.prototype,`removeIncompleteOnCancel`,void 0),e([c()],j.prototype,`interacting`,void 0),e([c()],j.prototype,`manipulatorsInteractive`,void 0),e([c()],j.prototype,`_grabbedManipulator`,void 0),e([c()],j.prototype,`_manipulatorsToHide`,null),e([c()],j.prototype,`updating`,null),j=e([l(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],j);export{j as LineOfSightItemTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createLineOfSightPlacementRootPluginConfiguration as u}from"./LineOfSightPlacementRootPlugin.js";import{isLineOfSightTargetPlugin as d}from"./LineOfSightTargetPlugin.js";import{createDrawTool as f}from"./placementUtils.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{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(e){super(e),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([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;d(c)?c.changeElevationMode(e,i,s):s(),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;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([u({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 f({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
|
package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementRootPlugin`)],_);function v(e){return{uniqueId:Symbol(`line-of-sight-root-plugin`),kind:[`multipart`],geometryType:`multipoint`,hidden:!0,localizationKey:`line-of-sight-root`,icon:`point`,create:()=>new _(e)}}function y(e,t){let n=-1;for(let r=0;r<Math.min(e.length,t.length);r++)if(e.getItemAt(r)!==t[r]){n=r;break}if(n===-1){if(e.length===t.length)return;n=Math.min(e.length,t.length)}e.splice(n,e.length-n,...t.slice(n))}export{_ as LineOfSightPlacementRootPlugin,v as createLineOfSightPlacementRootPluginConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,
|
|
2
|
+
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,snappingManager:t,shouldPreventVertexAdd:(e,t)=>this._editTool.hasManipulatorAt(e,t)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get selectedItem(){return this._editTool.selectedItem}get state(){return this._placementController.active?_.creating:this.analysis.observer?.position==null?_.ready:_.created}get cursor(){return this._placementController.active?`crosshair`:null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on(`key-down`,e=>this._onKeyDown(e),d.WIDGET),n(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),r),n(()=>this.state===_.created,e=>{e?this.finishToolCreation():this._set(`created`,!1)},r),n(()=>this.analysisViewData.visible,e=>{this.visible=e},r),n(()=>this.editable,e=>{this.analysisViewData.editable=e},r)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(e){return this.analysisViewData.interactive=!0,this._operationManager.start(`place`,async(i,a)=>{let{elevationInfo:o}=e??{},s=o&&`observer`in o?o.observer:o,c=o&&`targets`in o?o.targets:o;this._placementController.observerPlacementElevationInfo=y(s),this._placementController.targetPlacementElevationInfo=y(c);let l=this.analysis.clone(),u=!1,d=!1,f=()=>{if(d)return;if(d=!0,this.stop(),!this.analysis.valid){this.analysis.clear(),i.reject();return}if(a.aborted||this.analysis.equals(l)){i.reject();return}let e=this.analysis.targets.at(-1);e!=null&&this._editTool.selectItem(e),i.resolve({})};i.handles.push(t(()=>this.stop()),n(()=>this._placementController.active,e=>{e?u=!0:u&&f()},r)),this.continue()},e)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),!this.analysis.valid&&!this._placementController.active&&this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(e){let t=e.key;t===m.undo&&this.canUndo?(e.stopPropagation(),this.undo()):t===m.redo&&this.canRedo?(e.stopPropagation(),this.redo()):m.delete.includes(t)&&!this.active?this._editTool.deleteSelectedItem()&&e.stopPropagation():t===m.cancel&&!this.active&&this._editTool.clearSelection()&&e.stopPropagation()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active?this._placementController:this._canActivateEditTool?this._editTool:null:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&this.analysis.observer?.position!=null}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{let e=this.analysisViewData.interactive,t=this._canActivateEditTool;if(this._placementController.visible=this.visible&&e,this._editTool.manipulatorsInteractive=e&&!this._placementController.active,!e){this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,p(this.view,this);return}if(!this.visible){this._editTool.stop(),this._editTool.visible=!0,p(this.view,this);return}if(this._placementController.active){this._editTool.stop(),this._editTool.visible=this.visible,p(this.view,this);return}if(!t){this._hideEditTool(),p(this.view,this);return}this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,p(this.view,this)}finally{this._syncingActiveTool=!1}}}};e([i({constructOnly:!0})],v.prototype,`view`,void 0),e([i({constructOnly:!0})],v.prototype,`analysis`,void 0),e([i({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([i()],v.prototype,`active`,null),e([i()],v.prototype,`canRedo`,null),e([i()],v.prototype,`canUndo`,null),e([i()],v.prototype,`selectedItem`,null),e([i()],v.prototype,`state`,null),e([i()],v.prototype,`cursor`,null),e([i()],v.prototype,`updating`,null),e([i()],v.prototype,`removeIncompleteOnCancel`,void 0),e([i()],v.prototype,`snappingOptions`,null),e([i()],v.prototype,`_canActivateEditTool`,null),v=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightTool`)],v);function y(e){if(e==null)return null;let{featureExpressionInfo:t,mode:n,offset:r,unit:i}=e;return new o({featureExpressionInfo:t,mode:n,offset:r,unit:i})}export{v as LineOfSightTool};
|
|
@@ -8,7 +8,11 @@ import type { AbortOptions } from "../../../../core/promiseUtils.js";
|
|
|
8
8
|
import type { ElevationInfoProperties } from "../../../../symbols/support/ElevationInfo.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Elevation information used when placing a line
|
|
11
|
+
* Elevation information used when placing a line of sight analysis interactively.
|
|
12
|
+
*
|
|
13
|
+
* > [!WARNING]
|
|
14
|
+
* >
|
|
15
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for observers and targets.
|
|
12
16
|
*
|
|
13
17
|
* @since 5.2
|
|
14
18
|
*/
|
|
@@ -25,8 +29,15 @@ export type LineOfSightPlacementElevationInfo = ElevationInfo | ElevationInfoPro
|
|
|
25
29
|
export interface LineOfSightPlacementOptions extends AbortOptions {
|
|
26
30
|
/**
|
|
27
31
|
* Specifies how placed items are positioned on the vertical axis (z). A single elevation information object applies
|
|
28
|
-
* to both the observer and targets. Alternatively, separate elevation information can be provided for each.
|
|
29
|
-
*
|
|
32
|
+
* to both the observer and targets. Alternatively, separate elevation information can be provided for each type.
|
|
33
|
+
*
|
|
34
|
+
* If no elevation info is provided and the [LineOfSightAnalysisObserver.position](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/#position) or the
|
|
35
|
+
* [LineOfSightAnalysisTarget.position](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/#position) has a [z-value](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#hasZ),
|
|
36
|
+
* it is treated as an absolute value.
|
|
37
|
+
*
|
|
38
|
+
* > [!WARNING]
|
|
39
|
+
* >
|
|
40
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for observers and targets.
|
|
30
41
|
*
|
|
31
42
|
* @since 5.2
|
|
32
43
|
*/
|
|
@@ -13,9 +13,10 @@ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "./
|
|
|
13
13
|
* The LineOfSightAnalysisView3D is responsible for rendering a [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
14
14
|
* using custom visualizations.
|
|
15
15
|
*
|
|
16
|
-
* It allows to create an observer and
|
|
16
|
+
* It allows to create an observer and targets interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#place) method, query analysis [results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#results),
|
|
17
17
|
* or make an existing analysis editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) property.
|
|
18
18
|
*
|
|
19
|
+
*
|
|
19
20
|
* The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView)
|
|
20
21
|
* similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
|
|
21
22
|
*
|
|
@@ -26,11 +27,22 @@ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "./
|
|
|
26
27
|
* const analysisView = await view.whenAnalysisView(analysis);
|
|
27
28
|
* ```
|
|
28
29
|
*
|
|
30
|
+
* > [!WARNING]
|
|
31
|
+
* >
|
|
32
|
+
* > **Things to consider:**
|
|
33
|
+
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
34
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
35
|
+
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
36
|
+
* > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
37
|
+
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
38
|
+
* > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
|
|
39
|
+
*
|
|
29
40
|
* @see [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
30
41
|
* @see [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
|
|
31
42
|
* @see [LineOfSightLayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/)
|
|
32
|
-
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
33
43
|
* @see [LineOfSightAnalysisObserver](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/)
|
|
44
|
+
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
45
|
+
* @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
|
|
34
46
|
* @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
|
|
35
47
|
* @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
|
|
36
48
|
* @see [Sample - Line of sight component](https://developers.arcgis.com/javascript/latest/sample-code/line-of-sight/)
|
|
@@ -44,10 +56,12 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
44
56
|
*/
|
|
45
57
|
get analysis(): LineOfSightAnalysis;
|
|
46
58
|
/**
|
|
47
|
-
* Enables interactivity for the
|
|
48
|
-
*
|
|
49
|
-
* [LineOfSightAnalysis.
|
|
50
|
-
*
|
|
59
|
+
* Enables interactivity for the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
60
|
+
* When set to `true`, and the analysis includes a valid [LineOfSightAnalysis.observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/#observer) and any
|
|
61
|
+
* [LineOfSightAnalysis.targets](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/#targets), they become selectable and editable.
|
|
62
|
+
*
|
|
63
|
+
* Targets can be removed by right-clicking on them or with the `Delete` key.
|
|
64
|
+
* The observer and the last target cannot be deleted interactively.
|
|
51
65
|
*
|
|
52
66
|
* This property is automatically set to `true` when the analysis is assigned to a
|
|
53
67
|
* [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/).
|
|
@@ -76,8 +90,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
76
90
|
*/
|
|
77
91
|
get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
|
|
78
92
|
/**
|
|
79
|
-
* The observer or target currently selected for interactive editing.
|
|
80
|
-
*
|
|
93
|
+
* The observer or target currently selected for interactive editing.
|
|
94
|
+
*
|
|
95
|
+
* When [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) is `true`, any observer or target in the
|
|
96
|
+
* [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis) can be selected
|
|
97
|
+
* and its properties can be edited by interacting with the manipulators in the view.
|
|
98
|
+
*
|
|
99
|
+
* Use the item's `type` property to determine whether it is an observer or a target.
|
|
81
100
|
*
|
|
82
101
|
* @since 5.2
|
|
83
102
|
* @example
|
|
@@ -111,7 +130,7 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
111
130
|
get visible(): boolean;
|
|
112
131
|
set visible(value: boolean | null | undefined);
|
|
113
132
|
/**
|
|
114
|
-
* Starts the interactive placement of an observer and
|
|
133
|
+
* Starts the interactive placement of an observer and targets on the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
115
134
|
*
|
|
116
135
|
* If the analysis does not have a valid observer yet, this method will allow placing an observer, which can be followed
|
|
117
136
|
* by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets. An observer
|
|
@@ -123,9 +142,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
123
142
|
* The promise resolves when the operation is productive, i.e. an observer or any targets were added.
|
|
124
143
|
* Otherwise, if nothing was added or signal was aborted, the promise is rejected.
|
|
125
144
|
*
|
|
145
|
+
* By default, the observer and targets are created at absolute height.
|
|
146
|
+
* Optionally, by specifying the options of the method,
|
|
147
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
148
|
+
*
|
|
126
149
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) to `true`.
|
|
127
150
|
*
|
|
128
|
-
* @param options - An object specifying additional options.
|
|
151
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
129
152
|
* @returns A promise
|
|
130
153
|
* which resolves when the operation is completed successfully - i.e. the user places an observer and/or target(s),
|
|
131
154
|
* leaving the analysis in a valid state. Otherwise, the promise is rejected.
|
|
@@ -135,11 +158,14 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
135
158
|
*
|
|
136
159
|
* try {
|
|
137
160
|
* await analysisView.place({
|
|
138
|
-
*
|
|
139
|
-
*
|
|
161
|
+
* signal: abortController.signal,
|
|
162
|
+
* // optional elevation info
|
|
163
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
140
164
|
* });
|
|
141
165
|
* } catch (error) {
|
|
142
|
-
*
|
|
166
|
+
* if (error.name === "AbortError") {
|
|
167
|
+
* console.log("Placement operation was cancelled.");
|
|
168
|
+
* }
|
|
143
169
|
* }
|
|
144
170
|
*
|
|
145
171
|
* // cancel the placement operation at some later point
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as n}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as f}from"./ViewshedSnappingController.js";import{ViewshedSubTool as p}from"./ViewshedSubTool.js";import{findSubTool as m}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as h}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{bindViewToolOptions as v}from"../../../interactive/options/bindViewToolOptions.js";import y from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as b,makeTooltip as x}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as S}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const C=Symbol(`inactiveManipulatorDisplay`);let w=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new y,this._observerTooltipConnectionHandle=null,this._updatingHandles=new u}initialize(){let{snappingManager:e,view:t}=this;this._interactionVisuals=new d({view:t}),this._snappingController=new f({snappingManager:e,view:t}),this._initializeObserverTooltip(t);let r=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=n(()=>r,({viewshedComputedData:e})=>{let t=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([v(this._observerToolOptions,()=>t.options),a(()=>this.firstGrabbedManipulator,e=>{if(e!=null){let t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},o),a(()=>({grabbedManipulator:this.firstGrabbedManipulator,subTools:this.subToolHandles.map(({subTool:e})=>e).toArray()}),({grabbedManipulator:e,subTools:t})=>{let n=e==null?[]:t.map(t=>t.hideInactiveManipulators(e));this.removeHandles(C),this.addHandles(n,C),t.forEach(t=>t.setInteractive(t=>e==null||t===e))},o),this._updatingHandles.add(()=>{let e=this.selectedViewshedComputedData;return e==null?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(e==null)return;let{subTool:t,observer:n,target:r}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(n,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(r,!1)},s),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),s),this._updatingHandles.add(()=>this.selectedViewshed,e=>{let t=this._selectedManipulator,n=this._selectedSubTool;this._connectObserverTooltip(n),e==null?this._selectManipulator(null):
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as n}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as f}from"./ViewshedSnappingController.js";import{ViewshedSubTool as p}from"./ViewshedSubTool.js";import{findSubTool as m}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as h}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{bindViewToolOptions as v}from"../../../interactive/options/bindViewToolOptions.js";import y from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as b,makeTooltip as x}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as S}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const C=Symbol(`inactiveManipulatorDisplay`);let w=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new y,this._observerTooltipConnectionHandle=null,this._updatingHandles=new u}initialize(){let{snappingManager:e,view:t}=this;this._interactionVisuals=new d({view:t}),this._snappingController=new f({snappingManager:e,view:t}),this._initializeObserverTooltip(t);let r=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=n(()=>r,({viewshedComputedData:e})=>{let t=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([v(this._observerToolOptions,()=>t.options),a(()=>this.firstGrabbedManipulator,e=>{if(e!=null){let t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},o),a(()=>({grabbedManipulator:this.firstGrabbedManipulator,subTools:this.subToolHandles.map(({subTool:e})=>e).toArray()}),({grabbedManipulator:e,subTools:t})=>{let n=e==null?[]:t.map(t=>t.hideInactiveManipulators(e));this.removeHandles(C),this.addHandles(n,C),t.forEach(t=>t.setInteractive(t=>e==null||t===e))},o),this._updatingHandles.add(()=>{let e=this.selectedViewshedComputedData;return e==null?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(e==null)return;let{subTool:t,observer:n,target:r}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(n,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(r,!1)},s),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),s),this._updatingHandles.add(()=>this.selectedViewshed,e=>{let t=this._selectedManipulator,n=this._selectedSubTool;this._connectObserverTooltip(n),e==null?this._selectManipulator(null):t!=null&&n.hasManipulator(t)||this._selectManipulator(n.observerManipulator)},s)])}destroy(){this.removeHandles(C),this._selectManipulator(null),this._disconnectObserverTooltip(),r(this.subToolHandles),r(this._interactionVisuals),r(this._snappingController),r(this._observerTooltip),this._updatingHandles.destroy()}get updating(){return!!this._snappingController?.updating||this._updatingHandles.updating||this.subToolHandles.some(({subTool:e})=>e.updating)}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){let t=this._selectedSubTool,n=this.selectedViewshedComputedData;if(t==null||n==null){this._interactionVisuals?.setVisibility(!1);return}let r=t.moveInteractionState,i=e?r.grabbing:r.dragging,a=t.scaleOrientInteractionState,o=e?a.grabbing:a.dragging;if(!(this.analysisViewData.visible&&(i||o))){this._interactionVisuals?.setVisibility(!1);return}let s=i?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:s,laserlineVisible:!0,verticalLineVisible:i,intersectsWorldUp:i})}createObserverMoveSnappingPipeline(e,t,n,r=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,n,r)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!b(e,this._observerTooltip))switch(e.type){case`key-down`:_.cancel===e.key?this._cancelKeyHandler(e):_.delete.includes(e.key)&&this._deleteKeyHandler(e);break;case`hold`:this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){let t=this._observerToolOptions;this._observerTooltip=x(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new S({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),e==null){this._observerTooltip.clear();return}let t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=h(this._observerTooltip,t,()=>({toolOptions:this._observerToolOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=i(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){let t=this.selectedViewshed;t!=null&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return m(this.subToolHandles,e)}_selectManipulator(e){let t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,t!=null&&(t.selected=!1),e!=null&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([c({constructOnly:!0})],w.prototype,`analysis`,void 0),e([c({constructOnly:!0})],w.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],w.prototype,`intersector`,void 0),e([c({constructOnly:!0})],w.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],w.prototype,`view`,void 0),e([c()],w.prototype,`subToolHandles`,void 0),e([c()],w.prototype,`removeIncompleteOnCancel`,void 0),e([c()],w.prototype,`automaticManipulatorSelection`,void 0),e([c()],w.prototype,`multiTouchEnabled`,void 0),e([c()],w.prototype,`_selectedManipulator`,void 0),e([c()],w.prototype,`_interactionVisuals`,void 0),e([c()],w.prototype,`_snappingController`,void 0),e([c()],w.prototype,`_observerTooltip`,void 0),e([c()],w.prototype,`_observerTooltipInfo`,void 0),e([c()],w.prototype,`updating`,null),e([c()],w.prototype,`grabbing`,null),e([c()],w.prototype,`cursor`,null),e([c()],w.prototype,`selectedViewshed`,null),e([c()],w.prototype,`selectedViewshedComputedData`,null),e([c()],w.prototype,`_selectedSubTool`,null),w=e([l(`esri.views.3d.analysis.Viewshed.ViewshedEditTool`)],w);export{w as ViewshedEditTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:n}=s;a=a.next(n),i=i.next(N(this.view,t)).next(...e)}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),p(this),this.addHandles([r(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:n,interactive:r})=>{r?n==null?this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e}),e.tools.add(this._editTool)):this._destroyEditTool():(this._placementController.cancelPlaceOperation(),this._destroyEditTool())},i),this._updatingHandles.add(()=>e.activeTool,e=>{e!=null&&e!==this._editTool&&this._placementController.creationState==null&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),n(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return this._placementController.creationState!=null}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),e===`single`)return{}}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){let e=this._editTool;this._editTool=null,e!=null&&(c(this.view,e),n(e))}get test(){}};e([a({constructOnly:!0})],m.prototype,`view`,void 0),e([a({constructOnly:!0})],m.prototype,`analysis`,void 0),e([a({constructOnly:!0})],m.prototype,`analysisViewData`,void 0),e([a()],m.prototype,`_placementController`,void 0),e([a()],m.prototype,`_editTool`,void 0),e([a()],m.prototype,`_snappingManagerResult`,void 0),e([a()],m.prototype,`selectedViewshedComputedData`,null),e([a()],m.prototype,`stagedViewshed`,null),e([a()],m.prototype,`active`,null),e([a()],m.prototype,`updating`,null),e([a()],m.prototype,`creating`,null),e([a()],m.prototype,`snappingOptions`,null),m=e([o(`esri.views.3d.analysis.Viewshed.ViewshedTool`)],m);const h=m;export{h as default};
|
|
@@ -12,6 +12,13 @@ export interface ViewshedPlacementOptions extends AbortOptions {
|
|
|
12
12
|
* Specifies how the placed viewshed observer is positioned on the vertical axis (z).
|
|
13
13
|
* Accepts an [ElevationInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/) instance or a plain object with elevation information properties.
|
|
14
14
|
*
|
|
15
|
+
* If no elevation info is provided and the [Viewshed.observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#observer) has a [z-value](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#hasZ),
|
|
16
|
+
* it is treated as an absolute value.
|
|
17
|
+
*
|
|
18
|
+
* > [!WARNING]
|
|
19
|
+
* >
|
|
20
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for viewsheds.
|
|
21
|
+
*
|
|
15
22
|
* @since 5.2
|
|
16
23
|
*/
|
|
17
24
|
elevationInfo?: ElevationInfo | ElevationInfoProperties | null;
|