@arcgis/core 5.2.0-next.73 → 5.2.0-next.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/ViewshedAnalysis.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d3be4d914fc99a1d686c.js → 075e65cc4275ac886f08.js} +1 -1
- package/assets/esri/core/workers/chunks/087bd698b80ca0cea71e.js +1 -0
- package/assets/esri/core/workers/chunks/{b6c7b7b7f87dce5de811.js → 0bf644f93c180a2bc2f8.js} +1 -1
- package/assets/esri/core/workers/chunks/0e81c6d4f1c81f9b0a1b.js +1 -0
- package/assets/esri/core/workers/chunks/193aed69de2dec4f36b6.js +1 -0
- package/assets/esri/core/workers/chunks/1a3afee3ecd806b4aa81.js +1 -0
- package/assets/esri/core/workers/chunks/{014f9fd2818e2c9d9a3b.js → 264fd750691d517ab1f3.js} +1 -1
- package/assets/esri/core/workers/chunks/28f87daaba1ae3441364.js +1 -0
- package/assets/esri/core/workers/chunks/2baa16ec8559e77c226f.js +1 -0
- package/assets/esri/core/workers/chunks/2c31648a4b95275516ee.js +1 -0
- package/assets/esri/core/workers/chunks/2f81047790c4890ae625.js +1 -0
- package/assets/esri/core/workers/chunks/305eea9c1fc4aee3309e.js +1 -0
- package/assets/esri/core/workers/chunks/31d19bb72a9e79b30070.js +1 -0
- package/assets/esri/core/workers/chunks/45ccca01db0027b9dc16.js +1 -0
- package/assets/esri/core/workers/chunks/495f90fe3d0ad32bb82d.js +1 -0
- package/assets/esri/core/workers/chunks/4b5bd0c9a55ea2998601.js +1 -0
- package/assets/esri/core/workers/chunks/509aecafbc629bee1c15.js +1 -0
- package/assets/esri/core/workers/chunks/{d901f8503a73277cfa58.js → 553be2bd69bd311477ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{31669511cfddf116d991.js → 66e60351aacbd162775f.js} +1 -1
- package/assets/esri/core/workers/chunks/762be5d3e6aeaea33f74.js +29 -0
- package/assets/esri/core/workers/chunks/76b573143d1a65fdbcb6.js +1 -0
- package/assets/esri/core/workers/chunks/7aaa051b51a8e34bbfb0.js +1 -0
- package/assets/esri/core/workers/chunks/{44b50d4716a2567ab6f1.js → 7b5b66ae79e0287e3ade.js} +1 -1
- package/assets/esri/core/workers/chunks/81130dbcb738d40f723b.js +1 -0
- package/assets/esri/core/workers/chunks/835af7b4fd92cb4e7af0.js +1 -0
- package/assets/esri/core/workers/chunks/859dd86c921053bf03a1.js +1 -0
- package/assets/esri/core/workers/chunks/877594b6db08da98acd7.js +1 -0
- package/assets/esri/core/workers/chunks/{96d861265566854760cd.js → 88fd698b940dadcc6dc5.js} +1 -1
- package/assets/esri/core/workers/chunks/8f0d4aec8bd3cbfefc40.js +1 -0
- package/assets/esri/core/workers/chunks/{7f208ef75ef2ce0d7cf9.js → 910c93bbbf8113a4a51f.js} +1 -1
- package/assets/esri/core/workers/chunks/92c4464b67fce6cea134.js +1 -0
- package/assets/esri/core/workers/chunks/{509cfac9e5d86a8ee449.js → 936d44c7bc3a181e64a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9953277d0cd4a01bdc6.js → 94368a097e6190ce3c7a.js} +1 -1
- package/assets/esri/core/workers/chunks/947f1ea4dbc3e3419ecc.js +1 -0
- package/assets/esri/core/workers/chunks/9b76c8974424a1908e86.js +1 -0
- package/assets/esri/core/workers/chunks/{c203df41f9d2e4b80889.js → 9ca59077712e45ef4d56.js} +1 -1
- package/assets/esri/core/workers/chunks/9e25f715cda59c686a4c.js +1 -0
- package/assets/esri/core/workers/chunks/{36171c72a3c04b0d13ef.js → a0a1f0bd3648738354a6.js} +1 -1
- package/assets/esri/core/workers/chunks/a101152066dd56259619.js +1 -0
- package/assets/esri/core/workers/chunks/a2a2c7e274fb32fecffa.js +1 -0
- package/assets/esri/core/workers/chunks/a50421fe79f264ae3619.js +1 -0
- package/assets/esri/core/workers/chunks/a9053ad0f4e8c4705665.js +1 -0
- package/assets/esri/core/workers/chunks/aca5c524bd3c955e9243.js +1 -0
- package/assets/esri/core/workers/chunks/b1a175b3b2d1a7ddde8e.js +1 -0
- package/assets/esri/core/workers/chunks/b3b53cf0a3a30164d337.js +1 -0
- package/assets/esri/core/workers/chunks/b6d26d9738c0787acc38.js +1 -0
- package/assets/esri/core/workers/chunks/b9c61b20bbc91cb63036.js +1 -0
- package/assets/esri/core/workers/chunks/bf3dc3ad8df8488da3f0.js +1 -0
- package/assets/esri/core/workers/chunks/bff75cc7413bf0d319db.js +1 -0
- package/assets/esri/core/workers/chunks/c1568bcd3f04014152e1.js +1 -0
- package/assets/esri/core/workers/chunks/c1a4d499a30f3d80567b.js +1 -0
- package/assets/esri/core/workers/chunks/c374e5d5980db74c4aca.js +1 -0
- package/assets/esri/core/workers/chunks/{8c76f31a363dd0c3354d.js → c46f79d5b7712adbbd1c.js} +1 -1
- package/assets/esri/core/workers/chunks/c67e4a848d41038367b8.js +1 -0
- package/assets/esri/core/workers/chunks/de5013f89f0eae93978f.js +1 -0
- package/assets/esri/core/workers/chunks/e557043f90c051e93925.js +1 -0
- package/assets/esri/core/workers/chunks/{bee5e738ecf8680909c4.js → eaf26c1cc938789d5336.js} +1 -1
- package/assets/esri/core/workers/chunks/ebfb3cdc0df15eb05d75.js +1 -0
- package/assets/esri/core/workers/chunks/f1727b4a32cb6f36a5e6.js +1 -0
- package/assets/esri/core/workers/chunks/f4bc563c71c478d3912f.js +1 -0
- package/assets/esri/core/workers/chunks/fb0b89bbb4f8607d5f20.js +1 -0
- package/assets/esri/core/workers/chunks/fdca9873914b9dbd9244.js +1 -0
- package/assets/esri/core/workers/chunks/ff890167ff2baabfc4ce.js +1 -0
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +22 -0
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/layersMapping.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/PolylinePlugin.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawToolUtils.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/draw/support/tooltipUtils.js +1 -1
- package/views/interactive/options/InteractiveToolOptions.d.ts +36 -0
- package/views/interactive/options/InteractiveToolOptions.js +2 -0
- package/views/interactive/sketch/SketchOptions.d.ts +4 -3
- package/views/interactive/sketch/SketchOptions.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDynamic.js +1 -1
- package/views/interactive/tooltip/fields/fields.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/00cbff0b785e24e87d97.js +0 -1
- package/assets/esri/core/workers/chunks/0623acb2bd14a61b65c9.js +0 -29
- package/assets/esri/core/workers/chunks/06c9aac75a01d3af6d54.js +0 -1
- package/assets/esri/core/workers/chunks/089f8c60e96d920a2cb2.js +0 -1
- package/assets/esri/core/workers/chunks/0c3c311400ee352187ea.js +0 -1
- package/assets/esri/core/workers/chunks/158d2ac0333d53556e33.js +0 -1
- package/assets/esri/core/workers/chunks/16cade1c2ddf44e336ee.js +0 -1
- package/assets/esri/core/workers/chunks/1b130af7d14eaae69d96.js +0 -1
- package/assets/esri/core/workers/chunks/1e0140556c2e3fa72545.js +0 -1
- package/assets/esri/core/workers/chunks/1e5cb72830c7f32f2961.js +0 -1
- package/assets/esri/core/workers/chunks/259bdacfb7b0f866a8d0.js +0 -1
- package/assets/esri/core/workers/chunks/2f58e1f64df2da8259a2.js +0 -1
- package/assets/esri/core/workers/chunks/383304d33b496c5d8baa.js +0 -1
- package/assets/esri/core/workers/chunks/3aacb935d632834d4154.js +0 -1
- package/assets/esri/core/workers/chunks/3c8e98cf23ad8ef12fcb.js +0 -1
- package/assets/esri/core/workers/chunks/3dc71e03a630dd50b28e.js +0 -1
- package/assets/esri/core/workers/chunks/3fd022df127af32782ce.js +0 -1
- package/assets/esri/core/workers/chunks/4344ab1250a1c550bf8b.js +0 -1
- package/assets/esri/core/workers/chunks/43de723f765ec8f268ac.js +0 -1
- package/assets/esri/core/workers/chunks/4695cd6120f60b234d5c.js +0 -1
- package/assets/esri/core/workers/chunks/582a1d468089b9986416.js +0 -1
- package/assets/esri/core/workers/chunks/5f201c77a09ae0df29d6.js +0 -1
- package/assets/esri/core/workers/chunks/6080e46fc79127500283.js +0 -1
- package/assets/esri/core/workers/chunks/67d3ff7fcefaa7d5d27f.js +0 -1
- package/assets/esri/core/workers/chunks/6a9002fcba11e2cf3f2e.js +0 -1
- package/assets/esri/core/workers/chunks/72dcd4bd1a28bf8605c5.js +0 -1
- package/assets/esri/core/workers/chunks/73f228d966b89c73c9e9.js +0 -1
- package/assets/esri/core/workers/chunks/77df0bb35d2688729479.js +0 -1
- package/assets/esri/core/workers/chunks/7a143ca61c0a70306185.js +0 -1
- package/assets/esri/core/workers/chunks/869d292a60747c93dc84.js +0 -1
- package/assets/esri/core/workers/chunks/9c57161ad48d8d546dc7.js +0 -1
- package/assets/esri/core/workers/chunks/a7f42ada0aa69873a938.js +0 -1
- package/assets/esri/core/workers/chunks/a988fd54912969b812ce.js +0 -1
- package/assets/esri/core/workers/chunks/aff0e7761276036e029d.js +0 -1
- package/assets/esri/core/workers/chunks/b7d8817018b3d277c454.js +0 -1
- package/assets/esri/core/workers/chunks/ba4f419f46be09a9a55c.js +0 -1
- package/assets/esri/core/workers/chunks/bfb6566c27c09deb0929.js +0 -1
- package/assets/esri/core/workers/chunks/c715c585c42d8c2b86f5.js +0 -1
- package/assets/esri/core/workers/chunks/c7e9513f75b8ec205562.js +0 -1
- package/assets/esri/core/workers/chunks/c838cc1c786368b78598.js +0 -1
- package/assets/esri/core/workers/chunks/cd4e5c948d1bfa9b9a2d.js +0 -1
- package/assets/esri/core/workers/chunks/cfe31b7d1c6c05fbd268.js +0 -1
- package/assets/esri/core/workers/chunks/d0c1bc90e474f706211c.js +0 -1
- package/assets/esri/core/workers/chunks/da484787bd9fd3b13d15.js +0 -1
- package/assets/esri/core/workers/chunks/e21b3490bfce75405e55.js +0 -1
- package/assets/esri/core/workers/chunks/e4353f0792f45aa6a62f.js +0 -1
- package/assets/esri/core/workers/chunks/e702abaeccef20b64a81.js +0 -1
- package/assets/esri/core/workers/chunks/ebd619533be077059494.js +0 -1
- package/assets/esri/core/workers/chunks/f475672ff4c2ec9367c2.js +0 -1
- package/assets/esri/core/workers/chunks/f69329b85b362b349a8c.js +0 -1
- package/assets/esri/core/workers/chunks/fba8065a3a6fbd877e23.js +0 -1
- package/assets/esri/core/workers/chunks/fec07a16b72cdcafc641.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../core/has.js";const e={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},r={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",get ParquetLayer(){return has("parquetlayer-persistence-enabled")?"ParquetLayer":"UnsupportedLayer"},SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},a={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},y={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},
|
|
2
|
+
import has from"../../core/has.js";const e={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},r={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",get ParquetLayer(){return has("parquetlayer-persistence-enabled")?"ParquetLayer":"UnsupportedLayer"},SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},a={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},y={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},i={IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer"},L={ArcGISTiledElevationServiceLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},n={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GaussianSplatLayer:"GaussianSplatLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},t={ArcGISFeatureLayer:"FeatureLayer"},c={...r,LinkChartLayer:"LinkChartLayer"},s=e,S=a,l={ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",BuildingSceneLayer:"BuildingSceneLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",MediaLayer:"MediaLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",SubtypeGroupLayer:"SubtypeGroupLayer",WCS:"WCSLayer"},o=a;function u(l){switch(l.origin){case"web-scene":switch(l.layerContainerType){case"basemap-base-layers":return y;case"basemap-ground-layers":return i;case"ground":return L;case"tables":return t;default:return n}case"link-chart":switch(l.layerContainerType){case"basemap-base-layers":return s;case"tables":return S;default:return c}default:switch(l.layerContainerType){case"basemap-base-layers":return e;case"tables":return a;case"ground":case"basemap-ground-layers":return;default:return r}}}function p(e,r){if(!r)return"UnknownLayer";if("DefaultTileLayer"===r){let r="UnknownLayer";if("web-scene"===e.origin)switch(e.layerContainerType){case"operational-layers":case"basemap-base-layers":r="TileLayer";break;case"ground":r="ElevationLayer"}else switch(e.layerContainerType){case"basemap-base-layers":case"operational-layers":r="TileLayer"}return r}return u(e)?.[r]??"UnknownLayer"}function I(e){if("portal-item"===e.origin)switch(e.layerContainerType){case"basemap-base-layers":case"ground":case"basemap-ground-layers":return;case"tables":return o;default:return l}return u(e)}function d(e,r,a){if(!e?.origin)return!1;switch(e.origin){case"web-map":case"link-chart":if("operational-layers"===e.layerContainerType)if("ArcGISDimensionLayer"===r)if("dimension-feature"!==a)return!1;break;case"web-scene":if("operational-layers"===e.layerContainerType)if("ArcGISTiledElevationServiceLayer"===r)return!1;break;case"portal-item":if("ArcGISDimensionLayer"===r)if("dimension-feature"!==a)return!1}const y=I(e)?.[r];return null!=y&&"UnknownLayer"!==y&&"UnsupportedLayer"!==y}export{p as getLayerModuleForContextAndType,d as isLayerSupportedForWriteContext,u as layerTypeMapForReadContext};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const e="20260812",d="1f6dbc75630e90d12e65101502e5d51909984274";export{e as buildDate,d as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../Graphic.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as s,initial as a}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import o from"../../../../../geometry/Multipoint.js";import c from"../../../../../geometry/Point.js";import{SegmentLabels2D as h}from"../../SegmentLabels2D.js";import{SnappingVisualizer2D as m}from"../../SnappingVisualizer2D.js";import{activeVertex as p,regularVertices as u,outline as v}from"./symbols.js";import{DrawGraphicTool as y,geometryTypeToDrawOperationGeometryType as d}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as g}from"../../../../draw/DrawOperation.js";import{MapDrawSurface as E}from"../../../../draw/drawSurfaces.js";let G=class extends y{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??v,regularVertices:e.regularVerticesSymbol??u,activeVertex:e.activeVertexSymbol??p,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(s(()=>this.view?.effectiveTheme?.accentColor,e=>{if(!e)return;const t=this._visualElementSymbols.activeVertex.clone().set({color:e});this._visualElementGraphics.activeVertex?.set("symbol",t),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:t}},a))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return null!=this._visualElementSymbols.fill&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(b),i()}makeDrawOperation(){const{defaultZ:e,geometryType:t,hasZ:i,view:r}=this;this._createOrUpdateGraphic(null);const s="circle"!==t&&"rectangle"!==t;return new g({view:r,manipulators:this.manipulators,geometryType:d(this.geometryType),drawingMode:this.mode,hasZ:i,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new E(r,i,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new m(this.internalGraphicsLayer),segmentLabels:s?new h:null,labelOptions:this.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../Graphic.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as s,initial as a}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import o from"../../../../../geometry/Multipoint.js";import c from"../../../../../geometry/Point.js";import{SegmentLabels2D as h}from"../../SegmentLabels2D.js";import{SnappingVisualizer2D as m}from"../../SnappingVisualizer2D.js";import{activeVertex as p,regularVertices as u,outline as v}from"./symbols.js";import{DrawGraphicTool as y,geometryTypeToDrawOperationGeometryType as d}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as g}from"../../../../draw/DrawOperation.js";import{MapDrawSurface as E}from"../../../../draw/drawSurfaces.js";let G=class extends y{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??v,regularVertices:e.regularVerticesSymbol??u,activeVertex:e.activeVertexSymbol??p,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(s(()=>this.view?.effectiveTheme?.accentColor,e=>{if(!e)return;const t=this._visualElementSymbols.activeVertex.clone().set({color:e});this._visualElementGraphics.activeVertex?.set("symbol",t),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:t}},a))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return null!=this._visualElementSymbols.fill&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(b),i()}makeDrawOperation(){const{defaultZ:e,geometryType:t,hasZ:i,view:r}=this;this._createOrUpdateGraphic(null);const s="circle"!==t&&"rectangle"!==t;return new g({view:r,manipulators:this.manipulators,geometryType:d(this.geometryType),drawingMode:this.mode,hasZ:i,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new E(r,i,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new m(this.internalGraphicsLayer),segmentLabels:s?new h:null,labelOptions:this.toolOptions.labels,graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if("point"===this.geometryType)return i();const[s,a]=e,l=new c({x:s,y:a,spatialReference:this.view.spatialReference});return null!=this._visualElementGraphics.activeVertex?(this._visualElementGraphics.activeVertex.geometry=l,i()):(this._visualElementGraphics.activeVertex=new t({geometry:l,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(b),i(()=>{null!=this._visualElementGraphics.activeVertex&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=r(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return null!=this._visualElementGraphics.activeEdge?(this._visualElementGraphics.activeEdge.geometry=e,i()):(this._visualElementGraphics.activeEdge=new t({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(b),i(()=>{null!=this._visualElementGraphics.activeEdge&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=r(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const s=new o({points:e,spatialReference:this.view.spatialReference});return null!=this._visualElementGraphics.regularVertices?(this._visualElementGraphics.regularVertices.geometry=s,i()):(this._visualElementGraphics.regularVertices=new t({geometry:s,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(b),i(()=>{null!=this._visualElementGraphics.regularVertices&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=r(this._visualElementGraphics.regularVertices))}))}};function b(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}e([l()],G.prototype,"activeFillSymbol",void 0),e([l({readOnly:!0})],G.prototype,"type",void 0),e([l({constructOnly:!0,nonNullable:!0})],G.prototype,"view",void 0),G=e([n("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],G);export{G as DrawGraphicTool2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{handlesGroup as i}from"../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{handlesGroup as i}from"../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import o from"../../../../core/ReactiveSet.js";import{watch as a,initial as s,when as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h,fromPoints as p}from"../../../../geometry/support/lineSegment.js";import{LineOfSightAggregateManipulatedObject3D as u}from"./LineOfSightAggregateManipulatedObject3D.js";import{LineOfSightInteractionVisuals as d}from"./LineOfSightInteractionVisuals.js";import{ReshapeTool3D as _}from"../../interactive/editingTools/reshape/ReshapeTool3D.js";import v from"../../../interactive/options/InteractiveToolOptions.js";const g=Symbol("line-of-sight-reshape-line-of-sight-manipulators"),b=Symbol("line-of-sight-reshape-tool-operations"),M=h();let m=class extends t{get visible(){return this._get("visible")??!0}set visible(e){this._set("visible",e),null!=this._reshapeTool&&(this._reshapeTool.visible=e)}constructor(e){super(e),this.isParentToolInteracting=!1,this.manipulatorsInteractive=!0,this._selectedManipulators=new o,this._grabbedManipulator=null,this._interactionVisuals=null,this._object=new u({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:e.intersector,view:e.view}),this._reshapeTool=new _({autoHideManipulators:!1,enableDeleteVertices:!0,enableEdgeOffset:!1,enableMidpoints:!1,enableMoveObject:!1,object:this._object,snapToScene:!0,toolOptions:new v({tooltips:{enabled:!0}}),snappingManager:e.snappingManager,view:e.view})}initialize(){this.view.tools.add(this._reshapeTool),this._interactionVisuals=new d({view:this.view}),this.addHandles([this._connectReshapeEvents(),this._connectActiveState(),this._connectManipulators(),this._connectGrabbedManipulator(),this._connectObjectInteracting(),this._connectOperations()])}destroy(){this.stop(),this.removeHandles(g),this.view.tools.remove(this._reshapeTool),this._reshapeTool.destroy(),this._object.destroy(),this._interactionVisuals=n(this._interactionVisuals),this._selectedManipulators.clear()}get active(){return this._reshapeTool.active}get canRedo(){return this._reshapeTool.canRedo}get canUndo(){return this._reshapeTool.canUndo}get updating(){return this._reshapeTool.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}activate(){this.view.activeTool!==this._reshapeTool&&(this.view.activeTool=this._reshapeTool),this._reshapeTool.activate()}getTargetManipulator(e){return this._object.getTargetManipulator(e)}getObserverManipulator(){return this._object.observerManipulator}hasManipulatorAt(e,t){for(const i of this._object.lineOfSightManipulators)if(y(i,e,t))return!0;return!1}redo(){this._reshapeTool.redo()}clearSelection(){this._reshapeTool.clearSelection(),this._selectedManipulators.clear(),this._grabbedManipulator=null}get hasSelection(){return this._selectedManipulators.size>0}get _objectInteracting(){return this.analysisViewData.visible&&(this.isParentToolInteracting||this.hasSelection)}applySelection(e){const t="observer"===e.type?this._object.observerManipulator:this._object.getTargetManipulator(e.target);return null!=t&&this._reshapeTool.selectManipulator(t)}setEditableFlag(e,t){this._reshapeTool.setEditableFlag(e,t)}stop(){this.view.activeTool===this._reshapeTool&&(this.view.activeTool=null),this.clearSelection()}undo(){this._reshapeTool.undo()}_connectReshapeEvents(){return i([this._reshapeTool.events.on("reshape",e=>{if(1===this._selectedManipulators.size){if("reshape-start"===e.type){const e=this._selectedManipulators.values().next().value;this._grabbedManipulator??=e}"reshape-stop"===e.type&&(this._grabbedManipulator=null)}}),this._reshapeTool.on("cancel",()=>this.clearSelection()),this._reshapeTool.events.on("before-vertex-remove",e=>{let t=this.analysis.targets.length;for(const i of e.vertices){if(0===i.componentIndex)return void e.preventDefault();if(t-=1,0===t)return void e.preventDefault()}})])}_connectActiveState(){return a(()=>this.active,e=>{e||this.snappingManager.doneSnapping()},s)}_connectManipulators(){return a(()=>({manipulators:this._object.lineOfSightManipulators,interactive:this.manipulatorsInteractive}),({manipulators:e,interactive:t})=>{this.removeHandles(g),this._selectedManipulators.batch(()=>{this._selectedManipulators.clear();for(const i of e)i.interactive=t,i.selected&&this._selectedManipulators.add(i)}),this.addHandles(e.map(e=>this._connectManipulator(e)),g)},s)}_connectManipulator(e){return i([e.events.on("grab-changed",t=>{if("start"===t.action){this._selectedManipulators.add(e),this._grabbedManipulator??=e;const t=this.active,i=this.analysisViewData.visible,n=this._object.observerManipulator,o=this.visible,a=this._grabbedManipulator;if(a!==e)return;if(null==this._interactionVisuals||!t||!o||!i||null==n)return void this._hideLaserLine();this._interactionVisuals.update({target:a.renderLocation,lineVerticalPlaneSegment:a===n?null:p(n.renderLocation,a.renderLocation,M),visible:!0})}"end"===t.action&&(this._grabbedManipulator=null)}),e.events.on("select-changed",({action:t})=>{"select"===t?this._selectedManipulators.add(e):this._selectedManipulators.delete(e)}),e.events.on("location-update",()=>{const t=this.active,i=this.analysisViewData.visible,n=this._object.observerManipulator,o=this.visible,a=this._grabbedManipulator;a===e&&(null!=this._interactionVisuals&&t&&o&&i&&null!=n?this._interactionVisuals.update({target:a.renderLocation,lineVerticalPlaneSegment:a===n?null:p(n.renderLocation,a.renderLocation,M),visible:!0}):this._hideLaserLine())})])}_connectGrabbedManipulator(){return r(()=>null==this._grabbedManipulator,()=>{this._hideLaserLine()})}_connectObjectInteracting(){return a(()=>this._objectInteracting,e=>{this._object.interacting=e},s)}_connectOperations(){return a(()=>this._object.operations,e=>{this.removeHandles(b),null!=e&&this.addHandles([e.on("can-redo-change",()=>this.notifyChange("canRedo")),e.on("can-undo-change",()=>this.notifyChange("canUndo"))],b),this.notifyChange("canUndo"),this.notifyChange("canRedo")},s)}_hideLaserLine(){this._interactionVisuals?.hide()}};function y(e,t,i){return null!=e&&e.consumesClicks&&null!=e.intersectionDistance(t,i)}e([l({constructOnly:!0})],m.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],m.prototype,"analysis",void 0),e([l({constructOnly:!0})],m.prototype,"intersector",void 0),e([l({constructOnly:!0})],m.prototype,"view",void 0),e([l({constructOnly:!0})],m.prototype,"snappingManager",void 0),e([l()],m.prototype,"visible",null),e([l()],m.prototype,"isParentToolInteracting",void 0),e([l()],m.prototype,"manipulatorsInteractive",void 0),e([l()],m.prototype,"_grabbedManipulator",void 0),e([l()],m.prototype,"active",null),e([l()],m.prototype,"canRedo",null),e([l()],m.prototype,"canUndo",null),e([l()],m.prototype,"updating",null),e([l()],m.prototype,"hasSelection",null),e([l()],m.prototype,"_objectInteracting",null),m=e([c("esri.views.3d.analysis.LineOfSight.LineOfSightReshapeTool3D")],m);export{m as LineOfSightReshapeTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as
|
|
2
|
+
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{LineOfSightDrawToolRenderer as t}from"./LineOfSightDrawToolRenderer.js";import{isLineOfSightPlacementLeafPlugin as i}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as r}from"./LineOfSightRayIntersector.js";import{DrawTool as a}from"../../../draw/DrawTool.js";import s from"../../../interactive/options/InteractiveToolOptions.js";import{createScreenPointFromEvent as l}from"../../../support/screenUtils.js";function p(p){const{analysis:c,analysisViewData:f,snappingManager:m,view:d,getVisible:v,getSourceElevationInfo:g,getSnapToSceneEnabled:u,onCancel:w,onComplete:b,onManipulatorCountChange:h,shouldPreventVertexAdd:I}=p,j=g(),y=new t({analysis:c,analysisViewData:f,view:d}),S=new r({view:d}),D=new a({elevationInfo:j,enableVertexVisuals:!1,hasZ:!0,renderer:y,toolOptions:new s({tooltips:{enabled:!0}}),snappingManager:m,view:d});return y.elevationInfo=j,D.addHandles([e(y),e(S),D.on("cancel",()=>w(D)),D.on("complete",()=>b(D)),n(()=>[D.surfaceManager,u()],([e,n])=>{e&&(e.snapToSceneEnabled=n)},o),n(()=>[v(),f.visible,g()],([e,n,o])=>{D.visible=e&&n,y.analysisVisible=D.visible,D.elevationInfo=o,y.elevationInfo=o,y.refresh()},o),n(()=>D.manipulators.length,()=>h(D),o),D.on(["before-vertex-add","before-vertex-add-at-point"],e=>{const n=e.detail.originalEvent;if("immediate-click"!==n?.type)return;const o=l(n);if(I(o,n.pointerType))return void e.preventDefault();const t=S.getScreenPointIntersection(o);if(null==t?.mapPoint)e.preventDefault();else{const e=D.mostDownstreamPlugin;i(e)&&(e.preservedIntersection=t)}})]),{drawTool:D,renderer:y}}export{p as createDrawTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as o,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as l,initial as a}from"../../../../core/reactiveUtils.js";import{property as r,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as c}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as u}from"./ViewshedSnappingController.js";import{ViewshedSubTool as h}from"./ViewshedSubTool.js";import{findSubTool as v}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as b}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import T from"../../../interactive/
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as o,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as l,initial as a}from"../../../../core/reactiveUtils.js";import{property as r,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as c}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as u}from"./ViewshedSnappingController.js";import{ViewshedSubTool as h}from"./ViewshedSubTool.js";import{findSubTool as v}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as b}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import T from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as m,makeTooltip as y}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as V}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";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 T({tooltips:{enabled:!0}}),this._observerTooltipConnectionHandle=null,this._updatingHandles=new d}initialize(){const{snappingManager:e,view:t}=this;this._interactionVisuals=new c({view:t}),this._snappingController=new u({snappingManager:e,view:t}),this._initializeObserverTooltip(t);const o=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>o,({viewshedComputedData:e})=>{const t=new h({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([n(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},l),this._updatingHandles.add(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:o}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(o,!1)},a),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),a),this._updatingHandles.add(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;this._connectObserverTooltip(i),null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.observerManipulator)},a)])}destroy(){this._selectManipulator(null),this._disconnectObserverTooltip(),o(this.subToolHandles),o(this._interactionVisuals),o(this._snappingController),o(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){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const o=t.moveInteractionState,s=e?o.grabbing:o.dragging,n=t.scaleOrientInteractionState,l=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(s||l)))return void this._interactionVisuals?.setVisibility(!1);const a=s?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:a,laserlineVisible:!0,verticalLineVisible:s,intersectsWorldUp:s})}createObserverMoveSnappingPipeline(e,t,i,o=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i,o)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!m(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){const t=this._observerToolOptions;this._observerTooltip=y(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new V({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),null==e)return void this._observerTooltip.clear();const t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=b(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=s(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){const t=this.selectedViewshed;null!=t&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return v(this.subToolHandles,e)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([r({constructOnly:!0})],w.prototype,"analysis",void 0),e([r({constructOnly:!0})],w.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],w.prototype,"snappingManager",void 0),e([r({constructOnly:!0})],w.prototype,"view",void 0),e([r()],w.prototype,"subToolHandles",void 0),e([r()],w.prototype,"removeIncompleteOnCancel",void 0),e([r()],w.prototype,"automaticManipulatorSelection",void 0),e([r()],w.prototype,"multiTouchEnabled",void 0),e([r()],w.prototype,"_selectedManipulator",void 0),e([r()],w.prototype,"_interactionVisuals",void 0),e([r()],w.prototype,"_snappingController",void 0),e([r()],w.prototype,"_observerTooltip",void 0),e([r()],w.prototype,"_observerTooltipInfo",void 0),e([r()],w.prototype,"updating",null),e([r()],w.prototype,"grabbing",null),e([r()],w.prototype,"cursor",null),e([r()],w.prototype,"selectedViewshed",null),e([r()],w.prototype,"selectedViewshedComputedData",null),e([r()],w.prototype,"_selectedSubTool",null),w=e([p("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],w);export{w as ViewshedEditTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as n,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as s,sync as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as d,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as v}from"./toolLifecycleUtils.js";import m from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as u}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{vectorToRender as g}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as P}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";import{sketchKeys as f}from"../../../interactive/keybindings.js";import S from"../../../interactive/
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as n,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as s,sync as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as d,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as v}from"./toolLifecycleUtils.js";import m from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as u}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{vectorToRender as g}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as P}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";import{sketchKeys as f}from"../../../interactive/keybindings.js";import S from"../../../interactive/options/InteractiveToolOptions.js";const y="multiple",O=Symbol("hiddenManipulatorHandle");let T=class extends o{constructor(e){super(e),this.placementMode=y,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new S({tooltips:{enabled:!1}}),this._observerScenePoint=h(),this._targetScenePoint=h(),this._mapPointVector=h()}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),b.DEFAULT),s(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get creationState(){return this._get("creationState")}set creationState(e){this._set("creationState",e),this._toolOptions.tooltips.enabled="placing-observer"===e}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(i()),n(t);const{resolve:o,reject:s,promise:r}=Promise.withResolvers(),l=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new m({abortHandle:l,reject:s,resolve:o}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),r}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(f.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):f.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,o,i){const n=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:i});this.analysis.viewsheds.add(n),this.stagedViewshed=n,this.creationState="placing-target",this._updateStagedViewshed(o),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:o,snappingManager:i}=d({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>"placing-observer"===this.creationState});this._drawTool=e,this._renderer=o;try{this.view.addAndActivateTool(e),e.begin([u({mode:this.placementMode,onObserverComplete:(e,o)=>this._onObserverMapPointComplete(t,i,e,o),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(n){this._destroyDrawTool(e),this._rejectPlaceOperation(n instanceof Error?n:new Error(String(n)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,o,i){const n=o.clone(),a=this._toScenePoint(o,this._targetScenePoint,this._observerDrawToolElevationInfo),s=_({intersector:e,snappingManager:t,screenPoint:i,view:this.view});this._renderer?.updatePlacementLocation(a),this._handleObserverPlacementComplete(n,a,s),this._setDrawToolElevationInfo(p)}_onTargetMapPointComplete(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t),"multiple"===this.placementMode&&(this.creationState="placing-observer",this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e))}_onObserverMapPointPreview(e){const t=e.clone(),o=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(o)}_onTargetMapPointPreview(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){const t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??p}get _snapToSceneEnabled(){const e=this.observerPlacementElevationInfo?.mode;return("placing-observer"!==this.creationState||null==e||"absolute-height"===e)&&null}_onManipulatorCountChange(e){e.removeHandles(O);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,O)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&v(this.view,e)}_toScenePoint(e,t,o=p){const{x:i,y:n,z:a,spatialReference:s}=e,r=this._mapPointVector;return r[0]=i,r[1]=n,r[2]=a??0,g(r,s,o,this.view,t)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const o=this.callbacks.findViewshedComputedData(t);if(!o)return;const{heading:i,tilt:n,farDistance:a}=w(this.view,o,e);t.farDistance=a,t.tilt=n,t.heading=i}get test(){}};e([l({constructOnly:!0})],T.prototype,"analysis",void 0),e([l({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],T.prototype,"snappingManager",void 0),e([l({constructOnly:!0})],T.prototype,"view",void 0),e([l({constructOnly:!0})],T.prototype,"callbacks",void 0),e([l()],T.prototype,"placementMode",void 0),e([l()],T.prototype,"observerPlacementElevationInfo",void 0),e([l()],T.prototype,"stagedViewshed",void 0),e([l()],T.prototype,"_placeOperation",void 0),e([l()],T.prototype,"_drawTool",void 0),e([l()],T.prototype,"_renderer",void 0),e([l()],T.prototype,"_toolOptions",void 0),e([l()],T.prototype,"updating",null),e([l()],T.prototype,"active",null),e([l({value:null})],T.prototype,"creationState",null),T=e([c("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],T);export{T as ViewshedPlacementController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as r,sync as
|
|
2
|
+
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as r,sync as o,initial as t}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{ViewshedDrawToolRenderer as a}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as s}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as l}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as c}from"../../../draw/DrawTool.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";function p(i){const{analysisViewData:s,snappingManager:l,view:p,toolOptions:u,elevationInfo:b,getSnapToSceneEnabled:g,onCancel:m,onComplete:j,onManipulatorCountChange:f,isPlacingObserver:w}=i,v=new a({view:p,isPlacingObserver:w}),I=d(p.state.viewingMode),M=new c({elevationInfo:b,enableVertexVisuals:!1,hasZ:!0,renderer:v,toolOptions:u,snappingManager:l,view:p});return M.addHandles([e(v),M.on("cancel",()=>m(M)),M.on("complete",()=>j(M)),n(()=>[M.surfaceManager,g()],([e,n])=>{e&&(e.snapToSceneEnabled=n)},r),n(()=>M.manipulators.length,()=>f(M),o),n(()=>s.visible,e=>v.analysisVisible=e,t)]),{drawTool:M,intersector:I,renderer:v,snappingManager:l}}function u({intersector:e,snappingManager:n,screenPoint:r,view:o}){const t=n.getMainFeatureCandidate();return t?g(t):r?b(r,o,e):null}function b(e,n,r){n.sceneIntersectionHelper.intersectToolIntersectorScreen(i(e.x,e.y),r);const o=r.results.min;return s(o)?l(o,n):null}function g(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{p as createDrawTool,u as getFeatureReference};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{mapCollection as r}from"../../../core/mapCollectionUtils.js";import{abortMaybe as o,destroyMaybe as a}from"../../../core/maybe.js";import{watch as d,initial as l,when as n,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as p,subclass as c}from"../../../core/accessorSupport/decorators.js";import{copy as u,exactEquals as v}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as m,isLoaded as V}from"../../../geometry/projectionUtils.js";import g from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as _}from"./support/projectionUtils.js";import{registerAnalysisView as y,unselectViewshedInOtherAnalysisViews as f}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as b}from"./Viewshed/ViewshedComputedData.js";import j from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as R}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as D}from"../support/elevationUpdateUtils.js";import{Intersector as C}from"../webgl-engine/lib/Intersector.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";let F=class extends g{constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get toolActive(){return this._tool?.active??!1}get toolCreating(){return this._tool?.creating??!1}get stagedViewshed(){return this._tool?.stagedViewshed}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){const t=null!=e&&this.analysis.viewsheds.includes(e)?e:null;this._unselectOtherViewsheds(t),this._selectedViewshed=t}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData}get updating(){return!!this._tool?.updating}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this.addHandles(y(e,this)),this._viewshedRenderNode=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new C(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=r(()=>this.analysis.viewsheds,t=>{const s=new b({view:e,viewshed:t}),r=Symbol();return this.addHandles([d(()=>({valid:s.valid,canProject:m(s.observer?.spatialReference,this.view.spatialReference)||V()}),({valid:e,canProject:t},r)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):r?.valid&&r?.canProject&&this._removeViewshedsFromRenderer(s),t||_(this.analysis,s.observer.spatialReference,i.getLogger(this)))},l),D({view:e,geometry:s.observer,onElevationChanges:()=>s.onElevationChange()}),d(()=>[e.state.camera,e.slice.plane,s.elevationAlignedObserverRenderSpace,s.elevationAlignedTargetRenderSpace,s.verticalFieldOfView,s.horizontalFieldOfView,s.feature],()=>{this._updateObserverFromFeature(e,s)},l)],r),{viewshedComputedData:s,remove:()=>{this.selectedViewshed===s.viewshed&&(this.selectedViewshed=null),this.removeHandles(r),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new R({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._tool=new j({analysis:this.analysis,analysisViewData:this,view:e}),this.addHandles([d(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),n(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),h)])}destroy(){this.userOperation=o(this.userOperation),this._tool=a(this._tool),this._visualization=a(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData)
|
|
2
|
+
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{mapCollection as r}from"../../../core/mapCollectionUtils.js";import{abortMaybe as o,destroyMaybe as a}from"../../../core/maybe.js";import{watch as d,initial as l,when as n,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as p,subclass as c}from"../../../core/accessorSupport/decorators.js";import{copy as u,exactEquals as v}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as m,isLoaded as V}from"../../../geometry/projectionUtils.js";import g from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as _}from"./support/projectionUtils.js";import{registerAnalysisView as y,unselectViewshedInOtherAnalysisViews as f}from"./Viewshed/analysisViewRegister.js";import{ViewshedComputedData as b}from"./Viewshed/ViewshedComputedData.js";import j from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as R}from"./Viewshed/ViewshedVisualization.js";import{createElevationUpdateHandle as D}from"../support/elevationUpdateUtils.js";import{Intersector as C}from"../webgl-engine/lib/Intersector.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";let F=class extends g{constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this._tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get toolActive(){return this._tool?.active??!1}get toolCreating(){return this._tool?.creating??!1}get stagedViewshed(){return this._tool?.stagedViewshed}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){const t=null!=e&&this.analysis.viewsheds.includes(e)?e:null;this._unselectOtherViewsheds(t),this._selectedViewshed=t}get selectedViewshedComputedData(){return this._tool?.selectedViewshedComputedData}get updating(){return!!this._tool?.updating}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this.addHandles(y(e,this)),this._viewshedRenderNode=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new C(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=r(()=>this.analysis.viewsheds,t=>{const s=new b({view:e,viewshed:t}),r=Symbol();return this.addHandles([d(()=>({valid:s.valid,canProject:m(s.observer?.spatialReference,this.view.spatialReference)||V()}),({valid:e,canProject:t},r)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):r?.valid&&r?.canProject&&this._removeViewshedsFromRenderer(s),t||_(this.analysis,s.observer.spatialReference,i.getLogger(this)))},l),D({view:e,geometry:s.observer,onElevationChanges:()=>s.onElevationChange()}),d(()=>[e.state.camera,e.slice.plane,s.elevationAlignedObserverRenderSpace,s.elevationAlignedTargetRenderSpace,s.verticalFieldOfView,s.horizontalFieldOfView,s.feature],()=>{this._updateObserverFromFeature(e,s)},l)],r),{viewshedComputedData:s,remove:()=>{this.selectedViewshed===s.viewshed&&(this.selectedViewshed=null),this.removeHandles(r),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new R({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this._tool=new j({analysis:this.analysis,analysisViewData:this,view:e}),this.addHandles([d(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.items.values().map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),n(()=>this.interactive,()=>this._unselectOtherViewsheds(this.selectedViewshed),h)])}destroy(){this.userOperation=o(this.userOperation),this._tool=a(this._tool),this._visualization=a(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.items.map(e=>e.viewshedComputedData))}async createViewsheds(e){return this._tool.place("multiple",e)}place(e){return this._tool.place("single",e)}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.elevationAlignedObserverRenderSpace,o=i.elevationAlignedTargetRenderSpace,a=u(w(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(w(),o),targetFeatureId:null};s(e,this._intersector,d,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=v(a,r)?null:a}_unselectOtherViewsheds(e){null!=e&&f(this.view,this)}get test(){}};e([p({readOnly:!0})],F.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],F.prototype,"analysis",void 0),e([p()],F.prototype,"_tool",void 0),e([p()],F.prototype,"toolActive",null),e([p()],F.prototype,"toolCreating",null),e([p()],F.prototype,"stagedViewshed",null),e([p()],F.prototype,"_selectedViewshed",void 0),e([p()],F.prototype,"selectedViewshed",null),e([p()],F.prototype,"selectedViewshedComputedData",null),e([p()],F.prototype,"viewshedComputedDataHandles",void 0),e([p()],F.prototype,"userOperation",void 0),e([p()],F.prototype,"updating",null),e([p()],F.prototype,"_visualization",void 0),e([p()],F.prototype,"_viewshedRenderNode",void 0),F=e([c("esri.views.3d.analysis.ViewshedAnalysisView3D")],F);const A=F;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{valueInUnit as o}from"../../../../core/quantity.js";import{watch as e,sync as s,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as a,convertUnit as
|
|
2
|
+
import{__decorate as t}from"tslib";import{deg2rad as i}from"../../../../core/mathUtils.js";import{valueInUnit as o}from"../../../../core/quantity.js";import{watch as e,sync as s,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as a,convertUnit as l}from"../../../../core/units.js";import{property as r,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as u,lerp as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as c,fromArray as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{sv3d as v,sm4d as _}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as y}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as g}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as w}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as T}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as M,addMapTranslation as U}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as j}from"../../../interactive/InteractiveToolBase.js";import O from"../../../interactive/options/InteractiveToolOptions.js";import E from"../../../interactive/support/Units.js";import{makeTooltip as I,enterInputModeIfAvailable as V}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as b}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as P}from"../../../support/euclideanLengthMeasurementUtils.js";let x=class extends j{constructor(t){super(t),this.multiTouchEnabled=!1,this._updatingHandles=new f,this.toolOptions=new O}initialize(){const{view:t}=this;this._shiftManipulator=new T(t,0,8),this._shiftManipulator.state|=y,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),e(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),s),e(()=>this._showManipulator,t=>this._updateManipulatorVisibility(t),n)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){const{view:t}=this;this.tooltip=I(()=>({view:t,options:this.toolOptions.tooltips})),this._tooltipInfo=new b({toolOptions:this.toolOptions}),this.toolOptions.tooltips.placement="trailing",this._updateToolOptions(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),this._updatingHandles.add(()=>this._shouldShowTooltip,t=>{t?this._showTooltip():this._hideTooltip()}),this.tooltip.on("commit",()=>{const t=this._tooltipInfo.elevation.actual,i=a(this.view.spatialReference);if(null==t||null==i)return;const e=o(t,i);this._updateValue(e,{recordUndo:this.analysis.cutFillOptions.targetElevation})}),e(()=>[this.analysis.displayUnits.elevation,this.analysis.inputUnits.elevation],()=>this._updateToolOptions(),n)])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}onInputEvent(t){if(!this.destroyed&&!V(t,this.tooltip))return super.onInputEvent(t)}onHide(){this._hideTooltip()}onEditableChange(){this.internallyEditable||this._hideTooltip()}get _shouldShowTooltip(){return this._showManipulator&&(this.hasFocusedManipulators||"input"===this.tooltip.mode)}get _showManipulator(){const{interactive:t,targetGeometry:i,visible:o}=this.analysisViewData,{measureType:e}=this.analysis;return o&&t&&null!=i&&"cut-fill"===e}_createDragPipeline(){return M(this._shiftManipulator,(t,i,o)=>{const e=c(t.renderLocation),s=this.analysis.inputUnits.elevation??"meters",n=a(this.view.spatialReference);let r;i.next(w(this.view,e,this.view.spatialReference)).next(U()).next(t=>{if("start"===t.action){const{targetElevation:t}=this.analysis.cutFillOptions;r=t&&n?l(t,s,n):void 0}return this._updateValue(null!=r?r+t.translationZ:t.mapEnd.z,"end"===t.action?{recordUndo:r}:void 0),t}),o.next(()=>{this._updateValue(r)})})}_updateManipulatorPosition(){const{targetGeometry:t}=this.analysisViewData,{renderCoordsHelper:o}=this.view;if(!t)return;const e=.5,s=t.rings[0],n=m(s[0]),a=m(s[1]);o.toRenderCoords(n,t.spatialReference,n),o.toRenderCoords(a,t.spatialReference,a);const l=v.get();u(l,a,n);const r=v.get();d(r,n,a,e);const p=o.worldBasisAtPosition(r,1,v.get()),f=o.worldBasisAtPosition(r,0,v.get()),y=g(p,f,r,_.get()),w=o.headingAtPosition(r,l),T=t.isClockwise(t.rings[0])?-Math.PI/2:Math.PI/2;h(y,y,i(w)+T),y[12]=0,y[13]=0,y[14]=0,this._shiftManipulator.renderLocation=c(r),this._shiftManipulator.modelTransform=y}_updateManipulatorVisibility(t){this._shiftManipulator.available=t}_updateValue(t,i){const o=P(t,this.view.spatialReference);if(null==o)return;const e=this.analysis.inputUnits.elevation??"meters",s=l(o.value,o.unit,e),n=t=>{this.analysis.cutFillOptions.targetElevation=t};if(n(s),i&&"recordUndo"in i){const t=i.recordUndo;this.emit("record-undo",{apply:()=>n(s),undo:()=>n(t)})}}_getUpdatedTooltipInfo(){const{effectiveTargetElevation:t}=this.analysisViewData;return t?(this._tooltipInfo.elevation.actual=P(t,this.view.spatialReference),this._tooltipInfo):this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear(),this.tooltip?.exitInputMode({focusOnView:!1})}_updateToolOptions(){const{analysis:t}=this,{displayUnits:i,inputUnits:o}=t;this.toolOptions.values.inputUnits=new E({verticalLength:o.elevation}),this.toolOptions.values.displayUnits=new E({verticalLength:i.elevation})}};t([r()],x.prototype,"multiTouchEnabled",void 0),t([r()],x.prototype,"updating",null),t([r({constructOnly:!0})],x.prototype,"analysis",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r({constructOnly:!0,type:O})],x.prototype,"toolOptions",void 0),t([r()],x.prototype,"_shouldShowTooltip",null),t([r()],x.prototype,"_showManipulator",null),x=t([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool")],x);export{x as VolumeMeasurementShiftTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as s,removeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as
|
|
2
|
+
import{__decorate as e}from"tslib";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as s,removeMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as o,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as E}from"../meshFastUpdateUtils.js";import{Settings as y}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as w}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as I}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as j}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as G}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as x,geometryTypeToDrawOperationGeometryType as S}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as D}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as L,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends x{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new y({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i,featureExpressionInfo:s}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i,featureExpressionInfo:s})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:i}=this,s=this._createGraphicState=new G({graphic:e});return t([i.maskOccludee(e),i.trackGraphicState(s),r(()=>({element:this._outlineVisualElement,isDraped:s.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},o),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(s),...E(s)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new D({view:this.view,manipulators:this.manipulators,geometryType:S(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new L(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.toolOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),i();const r=this._settings,o=r.manipulators.vertex,l=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=l;const c=r.visualElements.zVerticalLine,h=new V({view:n,extensionType:c.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const p=t([this._updatingHandles.add(()=>r.visualElements.zVerticalLine,e=>e.apply(h),a),this._updatingHandles.add(()=>({selectedColor:r.colors.selected.toUnitRGBA(),outlineColor:r.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{l.color=e,l.outlineColor=t},a),i(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return l.attached=!0,this._updateVerticalLineVisualElement(e),p}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:s}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=I(U,s,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,i();const n=this.internalGraphicsLayer.elevationInfo,{view:r}=this,o=this._settings,l=new w({view:r,geometry:e,elevationInfo:n,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,n),attached:!1,isDecoration:!0});this._outlineVisualElement=l;const c=t([this._updatingHandles.add(()=>o.visualElements.lineObjects.outline,e=>e.apply(l),a),this._updatingHandles.add(()=>o.visualElements.lineObjects.shadowStyle,e=>e.apply(l),a),i(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return l.attached=!0,l.laserlineEnabled=!0,c}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,i();const{view:n}=this,r=this._settings,o=r.manipulators.vertex,l=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,attached:!1,isDecoration:!0}),c=t([this._updatingHandles.add(()=>({color:r.manipulators.vertex.color.toUnitRGBA(),outlineColor:r.manipulators.vertex.outlineColor.toUnitRGBA()}),({color:e,outlineColor:t})=>{l.color=e,l.outlineColor=t},a),i(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return l.attached=!0,this._verticesVisualElement=l,c}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:s}=this;if(!this.geometryToPlace||e.displaying)return s.loading=!1,null;s.loading=!0;const r=i(()=>{s.loading=!1});let a;const c=()=>{a&&cancelAnimationFrame(a)},h=()=>{c(),a=requestAnimationFrame(()=>r.remove())};let p=null;return p=e.on("changed",()=>{p=n(p),h()}),t([p,l(()=>e.displaying,h,{...o,once:!0}),i(c),r])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([h("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new j,U=m();export{b as DrawGraphicTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as p}from"../../../../../core/quantity.js";import{initial as r,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as _}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{MoveManipulation as S}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as H}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as D}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as x}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as P}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as k,resetManipulatedObjectMany as E}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as A}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import R from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Y,enterInputModeIfAvailable as B}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as V}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class N{constructor(t){this.objects=t,this.type="move-start"}}class q{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class L{constructor(t){this.objects=t,this.type="move-stop"}}const J=Symbol("manipulators"),K=Symbol("tooltips"),Q=Symbol("move-manipulator-display");let $=class extends U{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new R,this.type="move-3d",this._measurementWorker=new W({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=Y(()=>({view:t,options:this.sketchOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(!this.destroyed&&!B(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=y(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==O(e))continue;const t=new ot(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this.removeHandles(Q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new D({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],J)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),J)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(Q),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Q)}_createMoveManipulation(t){const o=new S({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?S.radiusForSymbol(t[0].object.graphic?.symbol):I});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),J)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=p)})],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const p of t){this.addHandles([p.object.on("committed",i),this._updatingHandles.add(()=>p.object.visible,i)],J);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>p.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(P({view:this.view,geometry:p.object.graphic?.geometry,elevationInfo:p.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},r),J),this.addHandles(n(()=>this.removeHandles(o)),J)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),J);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof x&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(y(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof x&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let p=null,r=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,p=null,r=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>r?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new L(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=k(l),r=E(l),this._emitRecordUndo(),this.events.emit("move-start",new N(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>p?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new q(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new L(l)),this.destroyed)return null;h()}return null}),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new N([o]))},onMove:()=>e.emit("move",new q(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new L([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({sketchOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new F({sketchOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(e)),H(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new G({sketchOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,V))}this._latestTooltipInfo.sketchOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??p}else t.distance=p}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=y(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new z({elevationInfo:o,pointer:n,editGeometryOperations:A.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),p=this.snappingManager,{snappingStep:r,cancelSnapping:h}=X({snappingContext:l,snappingManager:p,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=_(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...r),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"view",void 0),t([c()],$.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:R})],$.prototype,"sketchOptions",void 0),t([c({constructOnly:!0})],$.prototype,"snappingManager",void 0),t([c()],$.prototype,"type",void 0),t([c()],$.prototype,"updating",null),t([c()],$.prototype,"_latestTooltipInfo",void 0),t([c()],$.prototype,"_shouldShowMovePointTooltip",null),t([c()],$.prototype,"activeTooltipInfo",null),$=t([d("esri.views.3d.interactive.editingTools.move.MoveTool3D")],$);const tt=u(v);class ot{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{q as MoveEvent,N as MoveStartEvent,L as MoveStopEvent,$ as MoveTool3D};
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as p}from"../../../../../core/quantity.js";import{initial as r,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as _}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{MoveManipulation as H}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as D}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as x}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as P}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as E,resetManipulatedObjectMany as U}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as R}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Y,enterInputModeIfAvailable as B}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as V}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class N{constructor(t){this.objects=t,this.type="move-start"}}class q{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class L{constructor(t){this.objects=t,this.type="move-stop"}}const J=Symbol("manipulators"),K=Symbol("tooltips"),Q=Symbol("move-manipulator-display");let $=class extends A{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.toolOptions=new z,this.type="move-3d",this._measurementWorker=new W({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=Y(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(!this.destroyed&&!B(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=y(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==O(e))continue;const t=new ot(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this.removeHandles(Q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new D({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],J)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),J)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(Q),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Q)}_createMoveManipulation(t){const o=new H({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?H.radiusForSymbol(t[0].object.graphic?.symbol):I});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),J)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=p)})],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const p of t){this.addHandles([p.object.on("committed",i),this._updatingHandles.add(()=>p.object.visible,i)],J);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>p.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(P({view:this.view,geometry:p.object.graphic?.geometry,elevationInfo:p.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},r),J),this.addHandles(n(()=>this.removeHandles(o)),J)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),J);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof x&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(y(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof x&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let p=null,r=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,p=null,r=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>r?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new L(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=E(l),r=U(l),this._emitRecordUndo(),this.events.emit("move-start",new N(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>p?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new q(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new L(l)),this.destroyed)return null;h()}return null}),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new N([o]))},onMove:()=>e.emit("move",new q(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new L([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new F({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(e)),S(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new G({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,V))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??p}else t.distance=p}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=y(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:R.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),p=this.snappingManager,{snappingStep:r,cancelSnapping:h}=X({snappingContext:l,snappingManager:p,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=_(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...r),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"view",void 0),t([c()],$.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:z})],$.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],$.prototype,"snappingManager",void 0),t([c()],$.prototype,"type",void 0),t([c()],$.prototype,"updating",null),t([c()],$.prototype,"_latestTooltipInfo",void 0),t([c()],$.prototype,"_shouldShowMovePointTooltip",null),t([c()],$.prototype,"activeTooltipInfo",null),$=t([d("esri.views.3d.interactive.editingTools.move.MoveTool3D")],$);const tt=u(v);class ot{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{q as MoveEvent,N as MoveStartEvent,L as MoveStopEvent,$ as MoveTool3D};
|