@arcgis/core 6.0.0-next.15 → 6.0.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/LineOfSightAnalysis.d.ts +49 -32
- package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
- package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
- package/analysis/Viewshed.d.ts +23 -3
- package/analysis/ViewshedAnalysis.d.ts +33 -13
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
- package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
- package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
- package/assets/esri/core/workers/chunks/164c8eeefa8232b2b191.js +2 -0
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
- package/assets/esri/core/workers/chunks/1967b9c96045a5802d08.js +1 -0
- package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
- package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
- package/assets/esri/core/workers/chunks/{261fea092ee7d27608a0.js → 20a2124cbe43e5527c40.js} +1 -1
- package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
- package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
- package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
- package/assets/esri/core/workers/chunks/2853606099602f73d379.js +1 -0
- package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +2 -0
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
- package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +2 -0
- package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 34e0a8a3a2beea50f4f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
- package/assets/esri/core/workers/chunks/3e30b96a8c75bd5b9ae2.js +1 -0
- package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → 42753cf4965a94bc91ca.js} +1 -1
- package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
- package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
- package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
- package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
- package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
- package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
- package/assets/esri/core/workers/chunks/{b564ec4e03478f5659db.js → 4c240ca50f70bf30813f.js} +1 -1
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
- package/assets/esri/core/workers/chunks/{70d3055f15d8b0cf4074.js → 532e9cda8ac3601d8892.js} +1 -1
- package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
- package/assets/esri/core/workers/chunks/{953ba13299e7aa92c1a0.js → 564565246dae080f5e6c.js} +1 -1
- package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
- package/assets/esri/core/workers/chunks/{2145a512d269d64036b0.js → 58c3ae6030def2ed5f31.js} +1 -1
- package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +1 -0
- package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +1 -0
- package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 5b91e2dffdc84c006539.js} +1 -1
- package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/603fdbbe9534c614928f.js +1 -0
- package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → 60f92eb03c6e17ab4747.js} +1 -1
- package/assets/esri/core/workers/chunks/{67ebc5a3d46b254b725c.js → 612345f17f5eeb99ea8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b077c92345ffb5916c2.js → 65c98f3449044fa4fd79.js} +1 -1
- package/assets/esri/core/workers/chunks/{2bd4ee083ca4ad221f8b.js → 65cb5e39c467a35621ca.js} +1 -1
- package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
- package/assets/esri/core/workers/chunks/67a35155b8b4d36f171e.js +1 -0
- package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
- package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae31fd416bbb41a81392.js → 6ad309154fe84210d23c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
- package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
- package/assets/esri/core/workers/chunks/784d6c6949284ed6e10b.js +1 -0
- package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
- package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{e2190361247f35b02b32.js → 7b5cd150a4d0139850be.js} +1 -1
- package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +1 -0
- package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
- package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js → 844eedda8f749972f707.js} +2 -2
- package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
- package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
- package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
- package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
- package/assets/esri/core/workers/chunks/9503eedfdda55fc5adab.js +1 -0
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
- package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
- package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
- package/assets/esri/core/workers/chunks/999c23da883eb11cb29e.js +1 -0
- package/assets/esri/core/workers/chunks/9b6929faf649e81265fb.js +1 -0
- package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
- package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
- package/assets/esri/core/workers/chunks/a35c69a4751d28c39907.js +1 -0
- package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec8b7476eac4718eb0ac.js → a504a5e06cb89a620799.js} +1 -1
- package/assets/esri/core/workers/chunks/a596779eaeec7310671d.js +1 -0
- package/assets/esri/core/workers/chunks/{d5d0fe8e198ff5a902ee.js → a5c8f9f5be4ef5063b42.js} +1 -1
- package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
- package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → ab1660f5f8a5268c2fac.js} +1 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
- package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
- package/assets/esri/core/workers/chunks/ae0563d573baf91e01f7.js +1 -0
- package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
- package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
- package/assets/esri/core/workers/chunks/b686cd74975da09b9c91.js +2 -0
- package/assets/esri/core/workers/chunks/{aa36c3a9bbaa086e3757.js → b8fd7c3b36981261378b.js} +1 -1
- package/assets/esri/core/workers/chunks/bd046399e05e759e0bc2.js +1 -0
- package/assets/esri/core/workers/chunks/bd46a04a9ee4ea9e6ef1.js +2 -0
- package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
- package/assets/esri/core/workers/chunks/bfb39590c548188f5052.js +1 -0
- package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
- package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
- package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
- package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
- package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → dd0310184fe4832755a8.js} +1 -1
- package/assets/esri/core/workers/chunks/dfa5f1311806473e473f.js +1 -0
- package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
- package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
- package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
- package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
- package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
- package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
- package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
- package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
- package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
- package/assets/esri/core/workers/chunks/{634523cc7757da9020e4.js → fb70ab267a08e24b710f.js} +1 -1
- package/assets/esri/core/workers/chunks/fc139f251dc0523074e7.js +1 -0
- package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/index.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/lerc-wasm.js +1 -1
- package/config.d.ts +2 -0
- package/config.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/MultiOriginStore.js +1 -1
- package/core/accessorSupport/Store.js +1 -1
- package/core/accessorSupport/decorators/reader.js +1 -1
- package/core/accessorSupport/decorators/writer.js +1 -1
- package/core/sql/WhereGrammar.js +2 -2
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +9 -0
- package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/polygonExtentClipping.js +1 -1
- package/identity/Credential.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +4 -4
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/LineOfSightLayer.d.ts +10 -8
- package/layers/SceneLayer.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/effects/parser.js +3 -3
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
- package/layers/mixins/ReloadableLayer.js +2 -0
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +2 -2
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/raster/formats/ElevationCodec.js +2 -0
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/Lerc.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +1 -1
- package/layers/raster/functions/stretchUtils.js +1 -1
- package/layers/raster/functions/vectorFieldUtils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/LercWorker.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/TileInfo.d.ts +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureReductionProperties.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/layerOriginUtils.js +1 -1
- package/layers/video/VideoController.js +10 -10
- package/libs/maquette/projection.js +1 -1
- package/networks/UtilityNetworkTraceAnalysis.js +1 -1
- package/package.json +6 -6
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/portal/Portal.js +1 -1
- package/request/process.js +1 -1
- package/request/types.d.ts +7 -0
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/smartMapping/raster/renderers/shadedRelief.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/smartMapping/support/clusterUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -3
- package/time/TimeExtent.d.ts +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +7 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sphereExtentUtils.js +2 -0
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/options/TooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/constraintUtils.js +1 -1
- package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/snapping/allLayerSnapping.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +35 -13
- package/views/layers/SketchLayerView.d.ts +1 -0
- package/views/layers/ViewshedLayerView.d.ts +36 -12
- package/views/webgl/Program.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +2 -0
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/Expand/ExpandViewModel.d.ts +2 -0
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
- package/widgets/FeatureTable/support/TableTemplate.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -1
- package/widgets/Home/HomeViewModel.d.ts +2 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Swipe/SwipeViewModel.d.ts +2 -0
- package/widgets/Swipe/types.d.ts +9 -2
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +9 -5
- package/widgets/TimeSlider/types.d.ts +7 -0
- package/widgets/TimeSlider.d.ts +2 -3
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Track/TrackViewModel.d.ts +4 -0
- package/widgets/Track/types.d.ts +1 -0
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/Selector3D/selectorUtils.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0050916e462e3c9e0627.js +0 -1
- package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
- package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
- package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
- package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
- package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
- package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
- package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
- package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
- package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
- package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
- package/assets/esri/core/workers/chunks/34cbaf844730ac2d92c2.js +0 -2
- package/assets/esri/core/workers/chunks/3c301a689c7853c9fa67.js +0 -2
- package/assets/esri/core/workers/chunks/3f946c13ad97fbed867b.js +0 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
- package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
- package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
- package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
- package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
- package/assets/esri/core/workers/chunks/604f0f4150fb79ee54c8.js +0 -1
- package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +0 -1
- package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
- package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
- package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
- package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
- package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
- package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
- package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
- package/assets/esri/core/workers/chunks/745a153d0cd34faa124e.js +0 -1
- package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +0 -1
- package/assets/esri/core/workers/chunks/76ab353d80d786777161.js +0 -2
- package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
- package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
- package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
- package/assets/esri/core/workers/chunks/8483c50ed8f280fd74bb.js +0 -1
- package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
- package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +0 -1
- package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
- package/assets/esri/core/workers/chunks/94e427040edb469d58ad.js +0 -1
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
- package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
- package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
- package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
- package/assets/esri/core/workers/chunks/b49df4ebd4be1181b0f9.js +0 -2
- package/assets/esri/core/workers/chunks/b557824bc1fa163d72a3.js +0 -2
- package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
- package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
- package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
- package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
- package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
- package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
- package/assets/esri/core/workers/chunks/ed8786fed345718ed684.js +0 -1
- package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
- package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
- package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +0 -1
- package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
- package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
- package/layers/mixins/FeatureLayerReload.js +0 -2
- /package/assets/esri/core/workers/chunks/{b557824bc1fa163d72a3.js.LICENSE.txt → 164c8eeefa8232b2b191.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b49df4ebd4be1181b0f9.js.LICENSE.txt → 2981e904ab62f3ed80d0.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{34cbaf844730ac2d92c2.js.LICENSE.txt → 32cc59e126df8c96a0cf.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js.LICENSE.txt → 844eedda8f749972f707.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{3c301a689c7853c9fa67.js.LICENSE.txt → b686cd74975da09b9c91.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{76ab353d80d786777161.js.LICENSE.txt → bd46a04a9ee4ea9e6ef1.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as ge}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as E,screenToRenderPlaneFromEvent as _e,convertToMapCoordinates as ve}from"../dragEventPipeline3D.js";import{orientation as ye}from"../geometryUtils.js";import{canMoveZOperations as D}from"../manipulatorUtils.js";import{Settings as be}from"../settings.js";import{createVisualElements as xe}from"../visualElementUtils.js";import{discRadiusSmall as Se}from"../manipulations/config.js";import{MoveManipulation as O}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Ce}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as k,createEdgeOffsetIntersectionPlane as A,createEdgeOffsetOperation as j,edgeOffsetRotationMatrix as we,screenEdgeLengthSquared as Te,getDistanceInGeometrySR as Ee}from"./edgeOffsetUtils.js";import{createTooltipInfos as De,connectTooltipToManipulatedObject as Oe,getUpdatedTranslateObjectTooltipInfo as ke,getUpdatedEdgeOffsetTooltipInfo as M}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as Ae}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as P}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as F}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as I,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Me}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Ne,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Pe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),Fe=Symbol(),G=Symbol();let K=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(G)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new be({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Pe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=De(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Ne(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),Oe(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Me.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(G),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),(!this._operations||this._segmentLabels?.context?.editGeometryOperations!==this._operations)&&(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(!e.manipulator.grabbing&&(!i||e.manipulator.selected)&&r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],G)}_showReshapeControls(){this.removeHandles(G)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Ce({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new O({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&D(t.operations,t.elevationInfo),snapToScene:!1,radius:O.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(I(this.view,e,t.graphic??void 0)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Fe),e&&this.addHandles(Ae({view:this.view,geometry:t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Fe)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=xe({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof N?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=P(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=P(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?k(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Te(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=A(this.view,e.manipulator.elevationAlignedLocation,j(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:we(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(E(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(_e(this.view)).next(ve(this.view,n.data.spatialReference)).next(L()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,s=j(n.data.coordinateHelper,e.handle,t),c=n.createUndoGroup(),u=A(i,e.manipulator.elevationAlignedLocation,s);this._splitEdgesBeforeEdgeOffset(e,s),this._selectEdgeOffsetArrow(e,s);let d,f=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),d=l(d)},p=this.events.on(`undo`,f);return d=o([this._initializeEdgeOffsetVisualElement(e,a,t,n),c,p,this._connectEdgeOffsetTooltip(e,s,n,()=>{r.execute({action:`cancel`})})]),{initializeStep:e=>s==null||u==null?(f(),null):{...e,operation:s,plane:u},cleanup:f}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new N({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Le){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Le){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=j(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(i),this._exitEdgeOffsetInputMode()})],i)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??k(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Ee(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):E(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(I(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),!this.destroyed&&this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&D(this._operations,a.elevationInfo),this._moveManipulation.angle=ye(o),this._moveManipulation.radius=O.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&D(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=q(t,e):a&&(n=q(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=Se}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===F.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===F.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=ke(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=M(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?M(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],K.prototype,`_numGrabbing`,void 0),e([g()],K.prototype,`_numDragging`,void 0),e([g()],K.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],K.prototype,`_operations`,null),e([g()],K.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],K.prototype,`tool`,void 0),e([g()],K.prototype,`tooltip`,void 0),e([g()],K.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],K.prototype,`updating`,null),e([g()],K.prototype,`manipulators`,null),e([g()],K.prototype,`view`,null),e([g()],K.prototype,`object`,null),e([g()],K.prototype,`enableZShape`,null),e([g()],K.prototype,`enableDeleteVertices`,null),e([g()],K.prototype,`enableZVertex`,null),e([g()],K.prototype,`autoHideManipulators`,null),e([g()],K.prototype,`enableMoveObject`,null),e([g()],K.prototype,`enableMidpoints`,null),e([g()],K.prototype,`enableEdgeOffset`,null),e([g()],K.prototype,`_toolOptions`,null),e([g()],K.prototype,`_accentColor`,null),e([g()],K.prototype,`_tooltipsContext`,null),K=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],K);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function q(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Le=1e-6,Q=16,$=32;export{K as ReshapeOperation};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as ge}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as E,screenToRenderPlaneFromEvent as _e,convertToMapCoordinates as ve}from"../dragEventPipeline3D.js";import{orientation as ye}from"../geometryUtils.js";import{canMoveZOperations as D}from"../manipulatorUtils.js";import{Settings as be}from"../settings.js";import{createVisualElements as xe}from"../visualElementUtils.js";import{discRadiusSmall as Se}from"../manipulations/config.js";import{MoveManipulation as O}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Ce}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as k,createEdgeOffsetIntersectionPlane as A,createEdgeOffsetOperation as j,edgeOffsetRotationMatrix as we,screenEdgeLengthSquared as Te,getDistanceInGeometrySR as Ee}from"./edgeOffsetUtils.js";import{createTooltipInfos as De,connectTooltipToManipulatedObject as Oe,getUpdatedTranslateObjectTooltipInfo as ke,getUpdatedEdgeOffsetTooltipInfo as M}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as Ae}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as P}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as F}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as I,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Me}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Ne,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Pe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),Fe=Symbol(),G=Symbol();let K=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(G)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new be({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Pe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=De(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Ne(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),Oe(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Me.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(G),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],G)}_showReshapeControls(){this.removeHandles(G)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Ce({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new O({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&D(t.operations,t.elevationInfo),snapToScene:!1,radius:O.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(I(this.view,e,t.graphic??void 0)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Fe),e&&this.addHandles(Ae({view:this.view,geometry:t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Fe)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=xe({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof N?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=P(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=P(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?k(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Te(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=A(this.view,e.manipulator.elevationAlignedLocation,j(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:we(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(E(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(_e(this.view)).next(ve(this.view,n.data.spatialReference)).next(L()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,s=j(n.data.coordinateHelper,e.handle,t),c=n.createUndoGroup(),u=A(i,e.manipulator.elevationAlignedLocation,s);this._splitEdgesBeforeEdgeOffset(e,s),this._selectEdgeOffsetArrow(e,s);let d,f=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),d=l(d)},p=this.events.on(`undo`,f);return d=o([this._initializeEdgeOffsetVisualElement(e,a,t,n),c,p,this._connectEdgeOffsetTooltip(e,s,n,()=>{r.execute({action:`cancel`})})]),{initializeStep:e=>s==null||u==null?(f(),null):{...e,operation:s,plane:u},cleanup:f}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new N({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Le){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Le){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=j(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(i),this._exitEdgeOffsetInputMode()})],i)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??k(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Ee(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):E(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(I(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),!this.destroyed&&this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&D(this._operations,a.elevationInfo),this._moveManipulation.angle=ye(o),this._moveManipulation.radius=O.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&D(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=q(t,e):a&&(n=q(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=Se}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===F.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===F.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=ke(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=M(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?M(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],K.prototype,`_numGrabbing`,void 0),e([g()],K.prototype,`_numDragging`,void 0),e([g()],K.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],K.prototype,`_operations`,null),e([g()],K.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],K.prototype,`tool`,void 0),e([g()],K.prototype,`tooltip`,void 0),e([g()],K.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],K.prototype,`updating`,null),e([g()],K.prototype,`manipulators`,null),e([g()],K.prototype,`view`,null),e([g()],K.prototype,`object`,null),e([g()],K.prototype,`enableZShape`,null),e([g()],K.prototype,`enableDeleteVertices`,null),e([g()],K.prototype,`enableZVertex`,null),e([g()],K.prototype,`autoHideManipulators`,null),e([g()],K.prototype,`enableMoveObject`,null),e([g()],K.prototype,`enableMidpoints`,null),e([g()],K.prototype,`enableEdgeOffset`,null),e([g()],K.prototype,`_toolOptions`,null),e([g()],K.prototype,`_accentColor`,null),e([g()],K.prototype,`_tooltipsContext`,null),K=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],K);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function q(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Le=1e-6,Q=16,$=32;export{K as ReshapeOperation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import{EventEmitter as n}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{initial as i}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import{EventEmitter as n}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{initial as i}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import{projectPointToVector as l}from"../../../../../geometry/projection/projectPointToVector.js";import{sm4d as u}from"../../../../../geometry/support/vectorStacks.js";import{calculateBoundedPlaneTranslateRotate as d,resizeNormal as f,resizeOutlineOnly as p}from"../../../analysis/Slice/sliceToolUtils.js";import{Manipulator3D as m}from"../../Manipulator3D.js";import{manipulatedObjectGeometry as h}from"../manipulatedObjectUtils.js";import{canMoveZOperations as g}from"../manipulatorUtils.js";import{createVisualElements as _}from"../visualElementUtils.js";import{ExtentMove as v}from"./extentTransform/ExtentMove.js";import{ExtentRotate as y}from"./extentTransform/ExtentRotate.js";import{ExtentScale as b}from"./extentTransform/ExtentScale.js";import{TransformBounds as x}from"./extentTransform/extentUtils.js";import{PreserveAspectRatio as S}from"./extentTransform/PreserveAspectRatio.js";import{SnapRotation as C}from"./extentTransform/SnapRotation.js";import{OutlineVisualElement as w}from"../../visualElements/OutlineVisualElement.js";import{containsElevationUpdatePoint as T}from"../../../support/elevationUpdateExtentUtils.js";import{InteractiveToolBase as E}from"../../../../interactive/InteractiveToolBase.js";import D from"../../../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";let k=class extends E{get updating(){return this.destroying||this.destroyed?!1:!!this.object.updating||this._extentMove.updating||this._extentScale.updating||this._updatingHandles.updating}constructor(e){super(e),this.events=new n,this._updatingHandles=new c,this.enableZ=!0,this.enableScaling=!0,this.enableRotation=!0,this.toolOptions=new D,this._preserveAspectRatio=new S,this._snapRotation=new C,this.grabbing=!1,this.inputState=null,this._attachmentOrigin=null,this.type=`transform-3d`,this._outlineVisualElement=null}initialize(){let{view:e,object:t}=this,n=this._bounds=new x(this,()=>this._updateManipulators());this._extentMove=new v(this,n),this._extentScale=new b(this,n,()=>this._preserveAspectRatio.createDragEventPipelineStep()),this._extentRotate=new y(this,n,()=>this._snapRotation.createDragEventPipelineStep()),this.addHandles([this._updatingHandles.add(()=>this.enableZ,()=>this._updateManipulatorAvailability(this._extentMove.moveZManipulator,0)),this._updatingHandles.add(()=>this.enableScaling,()=>this._extentScale.forEachManipulator(e=>this._updateManipulatorAvailability(e,2))),this._updatingHandles.add(()=>this.enableRotation,()=>this._updateManipulatorAvailability(this._extentRotate.rotateManipulator,3))]),this._updateManipulators(),this._updateAllManipulatorAvailability();let a=_({view:e,object:t,forEachManipulator:e=>this._forEachManipulator(e),onManipulatorsChanged:()=>r()});if(a!=null){let{visualElement:e}=a;e instanceof w&&(this._outlineVisualElement=e,this.addHandles(e.events.on(`attachment-origin-changed`,()=>this._bounds.updateDisplayBounds()))),this.addHandles(a)}this.addHandles([t.on(`committed`,()=>this._onGeometryChanged()),this._updatingHandles.add(()=>this.object.visible,()=>this._updateAllManipulatorAvailability()),this._updatingHandles.add(()=>this.object.isDraped,()=>this._graphicDrapedChanged(),i),this._updatingHandles.add(()=>e.pointsOfInterest?.centerOnSurfaceFrequent.location,()=>n.updateDisplayBounds())]),this._forEachManipulator(e=>{this.addHandles(e.events.on(`grab-changed`,()=>{this._updateAllManipulatorAvailability()}))}),this._forEachManipulator((e,n)=>{this.addHandles(e.events.on(`immediate-click`,e=>{n===1&&this.events.emit(`immediate-click`,{...e,object:t}),e.stopPropagation()}))}),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._extentMove.destroy(),this._extentScale.destroy(),this._extentRotate.destroy(),this.tooltip.destroy(),this._updatingHandles.destroy(),this._set(`view`,null),this._set(`object`,null)}_initializeTooltip(){let{view:e}=this;this.tooltip=O(()=>({view:e,options:this.toolOptions.tooltips}));let t=()=>{this.tooltip.info=this._getUpdatedTooltipInfo()};this.addHandles([this._updatingHandles.add(()=>[this.toolOptions.tooltips.effectiveEnabled,this.preserveAspectRatio],t)]),this._forEachManipulator(e=>{this.addHandles([e.events.on([`focus-changed`,`grab-changed`],t),e.events.on(`drag`,e=>{e.action===`cancel`?this.tooltip.clear():t()})])})}_getUpdatedTooltipInfo(){return this.toolOptions.tooltips.effectiveEnabled?this._extentMove.getUpdatedTooltipInfo()??this._extentScale.getUpdatedTooltipInfo()??this._extentRotate.getUpdatedTooltipInfo():null}_onGeometryChanged(){this._bounds.updateDisplayBounds()}_graphicDrapedChanged(){this.removeHandles(A),this._bounds.updateDisplayBounds(),this.object.isDraped&&this.addHandles(this.view.elevationProvider.on(`elevation-change`,e=>{this._attachmentOrigin!=null&&(!l(this._attachmentOrigin,M,e.spatialReference)||T(e.extent,M[0],M[1],e.spatialReference))&&this._bounds.updateDisplayBounds()}),A)}_updateManipulators(){if(!this.visible)return;let e=this._bounds.displayBounds,t=d(e,u.get());this._extentMove.updateManipulators(t,e),this._extentScale.updateManipulators(t,e),this._extentRotate.updateManipulators(t,e)}_updateAllManipulatorAvailability(){this.grabbing=this._activeManipulatorType()!=null,this._forEachManipulator((e,t)=>this._updateManipulatorAvailability(e,t)),this._updateManipulatorDisplay()}_updateManipulatorAvailability(e,t){let n=this.grabbing&&!e.grabbing;if(e.interactive=!n,e instanceof m){let r=this.object.visible,i=this.enableZ&&g(this.object.operations,this.object.elevationInfo);switch(t){case 3:e.available=r&&this.enableRotation;break;case 2:e.available=r&&(this.enableScaling||this.enableRotation||i),e.interactive=!n&&this.enableScaling,e.state=this.enableScaling&&(!this.grabbing||this._activeManipulatorType()===2)?f:p;break;case 0:e.available=r&&i;break;default:e.available=r}}}_activeManipulatorType(){let e=null;return this._forEachManipulator(({grabbing:t},n)=>{e==null&&t&&(e=n)}),e}_updateManipulatorDisplay(){if(this.removeHandles(j),this._activeManipulatorType()==null)return;let e=[];this._forEachManipulator((t,n)=>{t.grabbing||n!==3&&n!==0||e.push(t.disableDisplay?.())}),this.addHandles(e.filter(t),j)}_forEachManipulator(e){this._extentMove.forEachManipulator(e),this._extentScale.forEachManipulator(e),this._extentRotate.forEachManipulator(e)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(e){this._preserveAspectRatio.enabled=e,this._set(`preserveAspectRatio`,e)}get snapRotation(){return this._snapRotation.enabled}set snapRotation(e){this._snapRotation.enabled=e,this._set(`snapRotation`,e)}get attachmentOrigin(){let e=this.object.isDraped?null:this._outlineVisualElement?.attachmentOrigin;return this._attachmentOrigin=e??this.object.origin??h(this.object)?.extent?.center,this._attachmentOrigin}reset(){}cancelDrag(){if(this.canUndo){let e=this.object.operations?.undo();e&&this._bounds.updateMapBoundsFromOperationInverse(e)}this.inputState=null}get canUndo(){return!!this.object.operations?.canUndo}undo(){if(this.inputState!=null)this.view.activeTool=null;else if(this.canUndo){let e=this.object.operations?.undo();e&&this._bounds.updateMapBoundsFromOperationInverse(e)}}get canRedo(){return!!this.object.operations?.canRedo}redo(){if(this.canRedo){let e=this.object.operations?.redo();e&&this._bounds.updateMapBoundsFromOperation(e)}}get test(){}};e([a()],k.prototype,`updating`,null),e([a({constructOnly:!0,nonNullable:!0})],k.prototype,`view`,void 0),e([a({constructOnly:!0,nonNullable:!0})],k.prototype,`object`,void 0),e([a()],k.prototype,`enableZ`,void 0),e([a()],k.prototype,`enableScaling`,void 0),e([a()],k.prototype,`enableRotation`,void 0),e([a({constructOnly:!0,type:D})],k.prototype,`toolOptions`,void 0),e([a()],k.prototype,`preserveAspectRatio`,null),e([a()],k.prototype,`snapRotation`,null),e([a()],k.prototype,`grabbing`,void 0),e([a()],k.prototype,`inputState`,void 0),e([a({readOnly:!0})],k.prototype,`type`,void 0),e([a()],k.prototype,`tooltip`,void 0),k=e([o(`esri.views.3d.interactive.editingTools.transform.ExtentTransformTool`)],k);const A=`draped-elevation-changes`,j=Symbol(),M=s();export{k as ExtentTransformTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as n}from"../../../../../core/colorUtils.js";import{cyclicalPI as r}from"../../../../../core/Cyclical.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as a,rad2deg as o}from"../../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as c,initial as l}from"../../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../../core/scheduling.js";import{createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../../core/accessorSupport/decorators.js";import{fromRotation as m,fromScaling as h,multiply as g,scale as _,rotate as v}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as ee}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as y,subtract as b,length as x,squaredDistance as S,cross as C,add as w}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as T,clone as E}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as D,create as te,getNormal as O}from"../../../../../geometry/support/plane.js";import{wrap as k,distance2 as A}from"../../../../../geometry/support/ray.js";import{sm4d as j,sv3d as M}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as N}from"../../Manipulator3D.js";import{calculateInputRotationTransform as P}from"../../manipulatorUtils.js";import{RenderObject as F}from"../../RenderObject.js";import{screenToRenderPlane as ne}from"../dragEventPipeline3D.js";import{ringIndicatorDelayMs as re,rotateIndicatorArrowPlacementPercentage as I,ringThickness as L,ringRadius as R,innerIndicatorRadius as ie,outerIndicatorRadius as z,rotateIndicatorArrowTipRadius as ae,rotateIndicatorArrowTipLength as oe,scaleIndicatorOffset1 as B,scaleIndicatorOffset2 as V,indicatorThickness as H,geometrySegments as U,rotateIndicatorArcLength as W,scaleIndicatorArcLength as G,rotateIndicatorDirectionBuffer as K,scaleIndicatorDirectionBuffer as se,ringHeight as q,dragThresholdPx as J,ringResetAnimationSpeedFactor as ce}from"../manipulations/config.js";import{createExtrudedTriangle as le,transformInPlace as ue,createPathExtrusionGeometry as de}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as fe}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as pe}from"../../../../interactive/dragEventPipeline.js";const Y={ScaleIn:32,ScaleOut:64,RotateLeft:128,RotateRight:256,Unlocked:1024,DelayedFocused:2048};let X=class extends t{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(e){this._ringManipulator.location=e}set elevationAlignedLocation(e){this._ringManipulator.elevationAlignedLocation=e}get grabbing(){return this._ringManipulator.grabbing}set interactive(e){this._ringManipulator.interactive=e}get updating(){return!!this._activeAnimation}constructor(e){super(e),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=re,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>this._scaleRotateDragData?.mode===`scale`?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([c(()=>{let{adapter:e}=this;return[e.angle,e.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(e){this.cancelActiveAnimation(),e.start();let t=u({update:({deltaTime:t})=>{e.update(t)&&this.cancelActiveAnimation()}});this._activeAnimation={...e,frameTask:t}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=s(this._activeAnimation)}forEachManipulator(e){e(this._ringManipulator,4)}disableDisplay(){return this._ringManipulator.disableDisplay()}_createManipulator(){let e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);let t=this.tool.object,n=pe(e,(e,n,i)=>{this._scaleRotateDragData=null;let s=this.adapter.startInteraction(),c={mode:`none`,origin:E(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();let l=M.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,l),n.next(ne(this.tool.view,D(e.renderLocation,l,te()))).next(e=>{let n=O(e.plane),i=P(e.renderStart,e.renderEnd,c.origin,n),l=r.shortestSignedDiff(c.angle,i);c.angleDir=a(c.angleDir+l,-.3,K),c.angle=i;let u=me(c,e),d=u-this.adapter.scale;if(c.scaleDir=a(c.scaleDir+d,-.2,se),this._onScaleChanged(),c.mode===`none`){let n=this.mode||he(e,e.plane,c.origin,this.tool.view.state.camera);if(n!=null){switch(n){case`rotate`:this.tool.events.emit(`rotate-start`,{object:t,angle:0}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]});break;case`scale`:this.tool.events.emit(`scale-start`,{object:t,xScale:1,yScale:1}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]})}c.mode=n}}switch(c.mode){case`rotate`:s.state.angle=c.initialAngle+i;break;case`scale`:s.state.scale=u,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case`start`:case`update`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale`,{object:t,xScale:u,yScale:u})}break;case`end`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:u,yScale:u})}}return e.action===`end`&&(this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),s.done()),e}),i.next(()=>{if(s.cancel(),this._scaleRotateDragData!=null){switch(this._scaleRotateDragData.mode){case`none`:break;case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:0});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:1,yScale:1})}this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([n,e.events.on(`focus-changed`,e=>{e.action===`focus`?this.startAnimation(ge(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),e.events.on(`immediate-click`,e=>{e.stopPropagation()}),c(()=>this.tool.object.visible,e=>this._ringManipulator.available=e,l)])}_onScaleChanged(){this.events.emit(`scale-changed`),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Y.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Y.Unlocked,this._scaleRotateDragData==null||this._scaleRotateDragData?.mode===`none`),this._scaleRotateDragData!=null)switch(this._scaleRotateDragData.mode){case`rotate`:this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Y.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Y.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case`scale`:this._ringManipulator.updateStateEnabled(Y.RotateLeft|Y.RotateRight,!1),this._ringManipulator.updateStateEnabled(Y.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Y.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut|Y.RotateLeft|Y.RotateRight,!1)}_updateManipulatorTransform(){let e=m(j.get(),this.adapter.angle,T(0,0,1));if(e==null)return;let t=this.getScale(),n=h(j.get(),y(M.get(),t,t,t));this._ringManipulator.modelTransform=g(j.get(),n,e)}_createRingManipulator(){let e=(e,t,n)=>{let r=[],i=Math.ceil(U*(t-e)/(2*Math.PI));for(let a=0;a<i+1;a++){let o=e+a*(t-e)/i;r.push(T(n*Math.cos(o),n*Math.sin(o),0))}return r},t=t=>e(0,Math.PI*2,t),n=e=>[[-e/2,0],[e/2,0],[e/2,q/2],[-e/2,q/2]],r=this._createMaterial(1),i=(e,t,i=r)=>de(i,n(t),e,[],[],!1),a=t(R),o=i(a,L),s={left:[],right:[]},c=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,a=Math.PI/2-W,o=n+a,l=n+Math.PI/2-a,u=e(o,l,ie),d=i(u,H);c.push(u),c.push(e(o,l,z-L/2)),s.left.push(d),s.right.push(d.instantiate());for(let e=0;e<2;e++){let t=e===0,n=ee();if(t){_(n,n,[1,-1,1]),v(n,n,-o,[0,0,1]);let e=Math.round(I*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}else{v(n,n,l,[0,0,1]);let e=Math.round((1-I)*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}let i=le(r,oe,0,ae,q);ue(i,n),(t?s.left:s.right).push(i)}}let l=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,r=Math.PI/2-G,a=e(n+r,n+Math.PI/2-r,z);l.push(i(a,H))}let u=this._createMaterial(.66),d=this._createMaterial(.5),f=this._createMaterial(.33),p=t(R+B),m=t(R+V),h=i(p,H,u),g=i(m,H,f),y=t(R-B),b=t(R-V),x=i(y,H,u),S=i(b,H,f),C=[new F(o,Y.DelayedFocused),new F(o.instantiate({material:d}),0)];(!this.mode||this.mode===`scale`)&&(C=C.concat([...l.map(e=>new F(e,Y.DelayedFocused|Y.Unlocked)),new F(h,Y.DelayedFocused|Y.ScaleIn),new F(g,Y.DelayedFocused|Y.ScaleIn),new F(x,Y.DelayedFocused|Y.ScaleOut),new F(S,Y.DelayedFocused|Y.ScaleOut)])),(!this.mode||this.mode===`rotate`)&&(C=C.concat([...s.right.map(e=>new F(e.instantiate(),Y.DelayedFocused|Y.Unlocked)),...s.left.map(e=>new F(e,Y.DelayedFocused|Y.RotateLeft)),...s.right.map(e=>new F(e,Y.DelayedFocused|Y.RotateRight))]));let w=[a,...c];return new N({view:this.tool.view,renderObjects:C,autoScaleRenderObjects:!1,worldOriented:!0,radius:L,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:`ribbon`,paths:w,direction:T(0,0,1)}})}_createMaterial(e){let t=new fe({cullFace:2,renderOccluded:2,isDecoration:!0});return this.addHandles(c(()=>n(this.tool.view.effectiveTheme.accentColor,e),e=>t.setParameters({color:e}),l)),t}get test(){}};e([f({constructOnly:!0})],X.prototype,`tool`,void 0),e([f({constructOnly:!0})],X.prototype,`adapter`,void 0),e([f({constructOnly:!0})],X.prototype,`toolOptions`,void 0),e([f()],X.prototype,`mode`,void 0),e([f()],X.prototype,`_activeAnimation`,void 0),e([f()],X.prototype,`updating`,null),X=e([p(`esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform`)],X);function me(e,t){let n=b(M.get(),t.renderStart,e.origin),r=b(M.get(),t.renderEnd,e.origin),i=x(n),a=x(r);return i===0?0:a/i}function he(e,t,n,r){let{renderStart:i,renderEnd:a}=e,o=Z(i,r,M.get()),s=Z(a,r,M.get());if(S(o,s)<J*J)return null;let c=b(M.get(),i,n),l=C(M.get(),c,O(t)),u=i,d=w(M.get(),u,l),f=Z(n,r,M.get()),p=o,m=Z(d,r,M.get()),h=b(M.get(),m,p),g=b(M.get(),o,f),_=k(p,h),v=k(f,g);return A(_,s)<A(v,s)?`rotate`:`scale`}function Z(e,t,n){return t.projectToScreen(e,$),y(n,$[0],$[1],0)}function Q(e,t){let n=null,r=1,i=()=>r;return{start:()=>{r=e.getScale(),n=e.getScale,e.getScale=i,t()},update:e=>{let n=(r+1)/2-r;return r+=n*Math.min(e*ce,1),t(),+(Math.abs(r-1)<.01)},destroy:()=>{n&&(e.getScale=n),t()}}}function ge(e,t,n){let r=0,i=null,a=()=>!1;return{start:()=>{i=e.getFocused,e.getFocused=a,r=0,t()},update:e=>(r+=e,+(!i?.()||r>=n.delayMs)),destroy:()=>{i&&(e.getFocused=i),t()}}}const $=d();export{X as ScaleRotateTransform};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as n}from"../../../../../core/colorUtils.js";import{cyclicalPI as r}from"../../../../../core/Cyclical.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as a,rad2deg as o}from"../../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as c,initial as l}from"../../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../../core/scheduling.js";import{createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../../core/accessorSupport/decorators.js";import{fromRotation as m,fromScaling as h,multiply as g,scale as _,rotate as v}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as ee}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as y,subtract as b,length as x,squaredDistance as S,cross as C,add as w}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as T,clone as E}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as D,create as te,getNormal as O}from"../../../../../geometry/support/plane.js";import{wrap as k,distance2 as A}from"../../../../../geometry/support/ray.js";import{sm4d as j,sv3d as M}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as N}from"../../Manipulator3D.js";import{calculateInputRotationTransform as P}from"../../manipulatorUtils.js";import{RenderObject as F}from"../../RenderObject.js";import{screenToRenderPlane as ne}from"../dragEventPipeline3D.js";import{ringIndicatorDelayMs as re,rotateIndicatorArrowPlacementPercentage as I,ringThickness as L,ringRadius as R,innerIndicatorRadius as ie,outerIndicatorRadius as z,rotateIndicatorArrowTipRadius as ae,rotateIndicatorArrowTipLength as oe,scaleIndicatorOffset1 as B,scaleIndicatorOffset2 as V,indicatorThickness as H,geometrySegments as U,rotateIndicatorArcLength as W,scaleIndicatorArcLength as G,rotateIndicatorDirectionBuffer as K,scaleIndicatorDirectionBuffer as se,ringHeight as q,dragThresholdPx as J,ringResetAnimationSpeedFactor as ce}from"../manipulations/config.js";import{createExtrudedTriangle as le,transformInPlace as ue,createPathExtrusionGeometry as de}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as fe}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as pe}from"../../../../interactive/dragEventPipeline.js";const Y={ScaleIn:32,ScaleOut:64,RotateLeft:128,RotateRight:256,Unlocked:1024,DelayedFocused:2048};let X=class extends t{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(e){this._ringManipulator.location=e}set elevationAlignedLocation(e){this._ringManipulator.elevationAlignedLocation=e}get grabbing(){return this._ringManipulator.grabbing}set interactive(e){this._ringManipulator.interactive=e}get updating(){return!!this._activeAnimation}constructor(e){super(e),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=re,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>this._scaleRotateDragData?.mode===`scale`?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([c(()=>{let{adapter:e}=this;return[e.angle,e.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(e){this.cancelActiveAnimation(),e.start();let t=u({update:({deltaTime:t})=>{e.update(t)&&this.cancelActiveAnimation()}});this._activeAnimation={...e,frameTask:t}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=s(this._activeAnimation)}forEachManipulator(e){e(this._ringManipulator,4)}disableDisplay(){return this._ringManipulator.disableDisplay()}_createManipulator(){let e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);let t=this.tool.object,n=pe(e,(e,n,i)=>{this._scaleRotateDragData=null;let s=this.adapter.startInteraction(),c={mode:`none`,origin:E(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();let l=M.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,l),n.next(ne(this.tool.view,D(e.renderLocation,l,te()))).next(e=>{let n=O(e.plane),i=P(e.renderStart,e.renderEnd,c.origin,n),l=r.shortestSignedDiff(c.angle,i);c.angleDir=a(c.angleDir+l,-.3,K),c.angle=i;let u=me(c,e),d=u-this.adapter.scale;if(c.scaleDir=a(c.scaleDir+d,-.2,se),this._onScaleChanged(),c.mode===`none`){let n=this.mode||he(e,e.plane,c.origin,this.tool.view.state.camera);if(n!=null){switch(n){case`rotate`:this.tool.events.emit(`rotate-start`,{object:t,angle:0}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]});break;case`scale`:this.tool.events.emit(`scale-start`,{object:t,xScale:1,yScale:1}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]})}c.mode=n}}switch(c.mode){case`rotate`:s.state.angle=c.initialAngle+i;break;case`scale`:s.state.scale=u,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case`start`:case`update`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale`,{object:t,xScale:u,yScale:u})}break;case`end`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:u,yScale:u})}}return e.action===`end`&&(this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),s.done()),e}),i.next(()=>{if(s.cancel(),this._scaleRotateDragData!=null){switch(this._scaleRotateDragData.mode){case`none`:break;case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:0});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:1,yScale:1})}this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([n,e.events.on(`focus-changed`,e=>{e.action===`focus`?this.startAnimation(ge(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),e.events.on(`immediate-click`,e=>{e.stopPropagation()}),c(()=>this.tool.object.visible,e=>this._ringManipulator.available=e,l)])}_onScaleChanged(){this.events.emit(`scale-changed`),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Y.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Y.Unlocked,this._scaleRotateDragData==null||this._scaleRotateDragData?.mode===`none`),this._scaleRotateDragData!=null)switch(this._scaleRotateDragData.mode){case`rotate`:this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Y.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Y.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case`scale`:this._ringManipulator.updateStateEnabled(Y.RotateLeft|Y.RotateRight,!1),this._ringManipulator.updateStateEnabled(Y.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Y.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut|Y.RotateLeft|Y.RotateRight,!1)}_updateManipulatorTransform(){let e=m(j.get(),this.adapter.angle,T(0,0,1));if(e==null)return;let t=this.getScale(),n=h(j.get(),y(M.get(),t,t,t));this._ringManipulator.modelTransform=g(j.get(),n,e)}_createRingManipulator(){let e=(e,t,n)=>{let r=[],i=Math.ceil(U*(t-e)/(2*Math.PI));for(let a=0;a<i+1;a++){let o=e+a*(t-e)/i;r.push(T(n*Math.cos(o),n*Math.sin(o),0))}return r},t=t=>e(0,Math.PI*2,t),n=e=>[[-e/2,0],[e/2,0],[e/2,q/2],[-e/2,q/2]],r=this._createMaterial(1),i=(e,t,i=r)=>de(i,n(t),e,[],[],!1),a=t(R),o=i(a,L),s={left:[],right:[]},c=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,a=Math.PI/2-W,o=n+a,l=n+Math.PI/2-a,u=e(o,l,ie),d=i(u,H);c.push(u),c.push(e(o,l,z-L/2)),s.left.push(d),s.right.push(d.instantiate());for(let e=0;e<2;e++){let t=e===0,n=ee();if(t){_(n,n,[1,-1,1]),v(n,n,-o,[0,0,1]);let e=Math.round(I*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}else{v(n,n,l,[0,0,1]);let e=Math.round((1-I)*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}let i=le(r,oe,0,ae,q);ue(i,n),(t?s.left:s.right).push(i)}}let l=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,r=Math.PI/2-G,a=e(n+r,n+Math.PI/2-r,z);l.push(i(a,H))}let u=this._createMaterial(.66),d=this._createMaterial(.5),f=this._createMaterial(.33),p=t(R+B),m=t(R+V),h=i(p,H,u),g=i(m,H,f),y=t(R-B),b=t(R-V),x=i(y,H,u),S=i(b,H,f),C=[new F(o,Y.DelayedFocused),new F(o.instantiate({material:d}),0)];this.mode&&this.mode!==`scale`||(C=C.concat([...l.map(e=>new F(e,Y.DelayedFocused|Y.Unlocked)),new F(h,Y.DelayedFocused|Y.ScaleIn),new F(g,Y.DelayedFocused|Y.ScaleIn),new F(x,Y.DelayedFocused|Y.ScaleOut),new F(S,Y.DelayedFocused|Y.ScaleOut)])),this.mode&&this.mode!==`rotate`||(C=C.concat([...s.right.map(e=>new F(e.instantiate(),Y.DelayedFocused|Y.Unlocked)),...s.left.map(e=>new F(e,Y.DelayedFocused|Y.RotateLeft)),...s.right.map(e=>new F(e,Y.DelayedFocused|Y.RotateRight))]));let w=[a,...c];return new N({view:this.tool.view,renderObjects:C,autoScaleRenderObjects:!1,worldOriented:!0,radius:L,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:`ribbon`,paths:w,direction:T(0,0,1)}})}_createMaterial(e){let t=new fe({cullFace:2,renderOccluded:2,isDecoration:!0});return this.addHandles(c(()=>n(this.tool.view.effectiveTheme.accentColor,e),e=>t.setParameters({color:e}),l)),t}get test(){}};e([f({constructOnly:!0})],X.prototype,`tool`,void 0),e([f({constructOnly:!0})],X.prototype,`adapter`,void 0),e([f({constructOnly:!0})],X.prototype,`toolOptions`,void 0),e([f()],X.prototype,`mode`,void 0),e([f()],X.prototype,`_activeAnimation`,void 0),e([f()],X.prototype,`updating`,null),X=e([p(`esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform`)],X);function me(e,t){let n=b(M.get(),t.renderStart,e.origin),r=b(M.get(),t.renderEnd,e.origin),i=x(n),a=x(r);return i===0?0:a/i}function he(e,t,n,r){let{renderStart:i,renderEnd:a}=e,o=Z(i,r,M.get()),s=Z(a,r,M.get());if(S(o,s)<J*J)return null;let c=b(M.get(),i,n),l=C(M.get(),c,O(t)),u=i,d=w(M.get(),u,l),f=Z(n,r,M.get()),p=o,m=Z(d,r,M.get()),h=b(M.get(),m,p),g=b(M.get(),o,f),_=k(p,h),v=k(f,g);return A(_,s)<A(v,s)?`rotate`:`scale`}function Z(e,t,n){return t.projectToScreen(e,$),y(n,$[0],$[1],0)}function Q(e,t){let n=null,r=1,i=()=>r;return{start:()=>{r=e.getScale(),n=e.getScale,e.getScale=i,t()},update:e=>{let n=(r+1)/2-r;return r+=n*Math.min(e*ce,1),t(),+(Math.abs(r-1)<.01)},destroy:()=>{n&&(e.getScale=n),t()}}}function ge(e,t,n){let r=0,i=null,a=()=>!1;return{start:()=>{i=e.getFocused,e.getFocused=a,r=0,t()},update:e=>(r+=e,+(!i?.()||r>=n.delayMs)),destroy:()=>{i&&(e.getFocused=i),t()}}}const $=d();export{X as ScaleRotateTransform};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{ignoreAbortErrors as r}from"../../../../../core/promiseUtils.js";import{syncAndInitial as i,when as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import h from"./AreaMeasurement3DView.js";import{PickRequest as g}from"../support/PickRequest.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as b}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as x}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as S}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as w}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as T}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{ignoreAbortErrors as r}from"../../../../../core/promiseUtils.js";import{syncAndInitial as i,when as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import h from"./AreaMeasurement3DView.js";import{PickRequest as g}from"../support/PickRequest.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as b}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as x}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as S}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as C}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as w}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as T}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as E}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as D}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as O}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as k}from"../../../../support/screenUtils.js";let A=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this.polygonState=`initial`,this.removeIncompleteOnCancel=!1,this.manipulators=new x,this._getSnappingContext=n(e=>new w({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new C(new S(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysisViewData:t,manipulators:n,visible:o}=this;this.measurementView=new h({view:e,analysisViewData:t,toolState:this,manipulators:n,visible:o}),this._snappingOperation=new D({view:e}),this._updatingHandles.add(()=>this.stagedPoint,e=>{this.analysisViewData.stagedPoint=e==null?null:u(e,new l)},i),O(this,()=>{let e=this.view.inputManager.latestPointerInfo?.type??`mouse`,t=this._getSnappingContext(e);this._updatingHandles.consumePromise(r(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this._setupManipulators(),this.addHandles([a(()=>this.state===`measured`,()=>this.finishToolCreation(),i),this.analysisViewData.path.on(`change`,()=>{let e=this.analysisViewData.path;this.polygonState===`initial`&&!e.isEmptyPolygon&&(this.polygonState=e.isValidPolygon?`measured`:`drawing`)})])}destroy(){this.measurementView.destroy(),this._set(`measurementView`,null),this._updatingHandles=t(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=E(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){return this.analysisViewData.path.numVertices===0?`ready`:this.analysisViewData.path.isValidPolygon&&this.polygonState!==`editing`?`measured`:`measuring`}get cursor(){return this.active?`crosshair`:null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(e){this._snappingOperation.stagedPoint=e}get snappingOptions(){return this._snappingManager?.options}finishMeasurement(){let{path:e}=this.analysisViewData;e.numVertices<=2||(e.close(),this.polygonState=`measured`,this._resetSnappingState(),this.active&&(this.view.activeTool=null))}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState=`initial`,this.state===`measured`&&(this.polygonState=`measured`,this.finishToolCreation())}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(e){switch(e.type){case`immediate-double-click`:this._handleImmediateDoubleClick(e);break;case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e);break;case`drag`:this._handleDrag(e);break;case`key-down`:this._handleKeyDown(e)}}_setupManipulators(){let e=e=>e.events.on(`grab-changed`,()=>{if(this.analysisViewData.path.isValidPolygon){let e=this.manipulators.some(e=>e.manipulator.grabbing);this.polygonState=e?`editing`:`measured`}}),t=t=>{this.addHandles([y(t,(e,t,n,r)=>{let i=m(e),a=e.metadata,o=this._snappingManager,s=this._getSnappingContext(r),c=this._updatingHandles,{snappingStep:l,cancelSnapping:d}=T({snappingManager:o,snappingContext:s,updatingHandles:c});n.next(i).next(t=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(a,f),e.location=f,t)).next(d),t.next(i).next(p(this.view)).next(...l).next(t=>{e.location=t.mapEnd,this.analysisViewData.lastDraggedVertex=t.action===`end`?null:a,this.analysisViewData.path.setVertexPosition(a,u(t.mapEnd))});let f=u(this.analysisViewData.path.getVertexPositionAsPoint(a))}),e(t)],t)};this.manipulators.forEach(({manipulator:e})=>{t(e)}),this.addHandles([this.manipulators.on(`after-add`,({item:{manipulator:e}})=>{t(e)}),this.manipulators.on(`after-remove`,({item:{manipulator:e}})=>this.removeHandles(e))])}_handleImmediateDoubleClick(e){d(e)&&(this.polygonState===`drawing`&&this.finishMeasurement(),e.stopPropagation())}_handleDrag(e){this.polygonState===`editing`&&e.stopPropagation()}_handleImmediateClick(e){if(!d(e))return;let t=k(e),{pointerType:n}=e;if(this.active)switch(this.polygonState){case`initial`:case`measured`:if(this._addVertexAt(t,n)){this.stagedPoint=null,this.polygonState=`drawing`,e.stopPropagation();return}break;case`drawing`:{let r=this.measurementView.vertexHandleAt(t,n);if(r==null){if(this._addVertexAt(t,n)){this.stagedPoint=null,e.stopPropagation();return}}else r.index===0&&(this.finishMeasurement(),e.stopPropagation());break}}e.pointerType===`mouse`&&this._hoverAt(t)}_handlePointerMove(e){if(e.pointerType===`mouse`){let t=k(e);this._hoverAt(t)}}_handleKeyDown(e){let{path:t}=this.analysisViewData;(e.key===b.cancel||e.key===b.complete)&&this.polygonState===`drawing`&&t.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),e.stopPropagation())}_hoverAt(e){let{polygonState:t}=this;if(this.active&&j.has(t)){let t=this._pick(e);if(t?.mapPoint!=null){let e=this._getSnappingContext(`mouse`);this._updatingHandles.consumePromise(r(this._snappingOperation.snap({point:t.mapPoint},this._ensureSnappingManager(),e)))}}else this.stagedPoint=null}_addVertexAt(e,t){let n=this._pick(e)?.mapPoint;if(n==null)return!1;this.analysis.valid&&this.polygonState===`measured`&&(this.analysis.clear(),this._set(`created`,!1),this.polygonState=`initial`);let r=this._getSnappingContext(t),i=this._snappingOperation.update({point:n},this._ensureSnappingManager(),r),a=u(i,new l);return this.analysisViewData.path.add(a),!0}_pick(e){let t=new g(e);return this.measurementView.pick(t)}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};e([o()],A.prototype,`_snappingManagerResult`,void 0),e([o()],A.prototype,`_snappingManager`,null),e([o({readOnly:!0})],A.prototype,`state`,null),e([o()],A.prototype,`polygonState`,void 0),e([o({readOnly:!0})],A.prototype,`cursor`,null),e([o()],A.prototype,`measurementView`,void 0),e([o()],A.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],A.prototype,`view`,void 0),e([o({constructOnly:!0})],A.prototype,`analysis`,void 0),e([o({constructOnly:!0})],A.prototype,`analysisViewData`,void 0),e([o({readOnly:!0})],A.prototype,`manipulators`,void 0),e([o()],A.prototype,`updating`,null),e([o()],A.prototype,`stagedPoint`,null),e([o()],A.prototype,`snappingOptions`,null),A=e([s(`esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool`)],A);const j=new Set([`initial`,`drawing`,`measured`]),M=A;export{M as default};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,r,i,a)=>{let o=m(e),s=this._ensureSnappingManager(),c=this._getSnappingContext(a),d=this._updatingHandles,{lineState:f}=this;i=i.next(o).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let n=this.analysis[t];n!=null&&(e.location=n)}return n});let h=p(this.view),g=r.next(o).next(e=>{let r=h(e);return r||this.lineState!==`drawing`&&this.lineState!==`initial`||(this[t]=null,this[n]=null),r});if(a!==`touch`||f===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:s,snappingContext:c,updatingHandles:d});i.next(t),g=g.next(...e)}g.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[r]:[r,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(()=>this.analysis[t],t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.startPoint!=null,endPointAvailable:this.endPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";class E extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._transparentRenderOrder=0,this._fadedExtensions=N,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){
|
|
2
|
+
import{copy as e,subtract as t,exactEquals as n,negate as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as u,getStart as d,getEnd as f,create as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as m}from"../../../../geometry/support/frustumPlanes.js";import{fromPoints as h,pointAt as g,create as _}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as y}from"../../../../geometry/support/ray.js";import{EngineVisualElement as b}from"./EngineVisualElement.js";import{LaserlineVisualElement as x}from"./LaserlineVisualElement.js";import{drapedZ as S}from"../../terrain/DrapedZ.js";import{createPolylineGeometry as C}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";class E extends b{constructor(e){super(e),this._ray=v(),this._isWorldDown=!1,this._start=i(),this._end=a(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._transparentRenderOrder=0,this._fadedExtensions=N,this._laserline=new x({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(n){this._isWorldDown=!0,e(this._start,n),this.view.renderCoordsHelper.worldUpAtPosition(n,this._end),t(this._end,n,this._end),y(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,n(this._start,t)||(e(this._start,t),y(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,n(this._end,t)||(e(this._end,t),y(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){o(e,this._color)||(s(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){o(e,this._innerColor)||(s(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e!=null&&this._stippleOffColor!=null&&o(e,this._stippleOffColor)||(this._stippleOffColor=e==null?null:l(e),this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??N,this.recreateGeometry()}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset?3:0,renderOccluded:this._normalizedRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){let t=new T(this.materialParameters,this.view.state.isGlobal),n=[];return this._createObject3DGeometry(t,e,n),{material:t,geometries:n}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){let r=this._createGeometry(e);n.push(r),t.addGeometry(r),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new T(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){let t=this._createGeometry(e);return this._updateVerticesDraped(t),new w(t)}_createGeometry(e){let t=this.extensionType===3,n=t?[i(),i(),i(),i()]:[i(),i()];return C(e,n,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===3?this._updateLineSegmentFinite(j):this._updateLineSegmentInfinite(this._extensionType,j)}_updateLineSegmentFinite(e){return h(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){let n=this.view.state.camera;switch(u(this._ray,O),e){case 0:O.c0=-Number.MAX_VALUE;break;case 1:case 2:{let e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,`ground`)??0,n=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&n<t&&r(O.ray.direction,O.ray.direction),this._extensionType===2&&t!=null&&(O.c1=Math.abs(n-t));break}}if(!m(n.frustum,O))return this._updateLineSegmentFinite(t);let i=d(O,k),a=f(O,A);return h(i,a,t)}_updateVertexAttributesObject3D(e,t){let n=e.geometries[0].getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=e[2];e.geometryVertexAttributeUpdated(e.geometries[0],`position`)}_updateVertexAttributesDraped(e,t){let n=e.getMutableAttribute(`position`)?.data;if(!n)return;let r=0;for(let e of this._lineVertices(t))n[r++]=e[0],n[r++]=e[1],n[r++]=S;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===3?(yield g(e,-this.fadedExtensions.start,k),yield g(e,0,k),yield g(e,1,k),yield g(e,1+this.fadedExtensions.end,k)):(yield g(e,0,k),yield g(e,1,k))}}function D(e){e.geometries=[]}const O=p(),k=i(),A=i(),j=_(),M=1/3,N={start:M,end:M};export{E as ExtendedLineVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EventEmitter as e}from"../../../../core/Evented.js";import{set as t,add as n,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as s,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as l}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as h}from"./EngineVisualElement.js";import{LaserlineVisualElement as g}from"./LaserlineVisualElement.js";import{ElevationContext as _}from"../../layers/graphics/ElevationContext.js";import{createGeometry as v}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as y,geometryToRenderInfo as b}from"../../support/renderInfoUtils/line.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as S}from"../../webgl-engine/materials/RibbonLineMaterial.js";class C extends h{constructor(t){super(t),this._attachmentOrigin=f(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=s(1,0,1,1),this._innerWidth=0,this._innerColor=s(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new g({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:w,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:w,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&this._laserlineStyle!=null&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){let t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){
|
|
2
|
+
import{EventEmitter as e}from"../../../../core/Evented.js";import{set as t,add as n,scale as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as s,clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as l}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as h}from"./EngineVisualElement.js";import{LaserlineVisualElement as g}from"./LaserlineVisualElement.js";import{ElevationContext as _}from"../../layers/graphics/ElevationContext.js";import{createGeometry as v}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as y,geometryToRenderInfo as b}from"../../support/renderInfoUtils/line.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as S}from"../../webgl-engine/materials/RibbonLineMaterial.js";class C extends h{constructor(t){super(t),this._attachmentOrigin=f(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=s(1,0,1,1),this._innerWidth=0,this._innerColor=s(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new g({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:w,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:w,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&this._laserlineStyle!=null&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){let t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=e?c(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;let e=this.object3dResources.resources?.geometries;if(!e||e.length===0)return null;t(E,0,0,0);let i=0;for(let t of e)t.computeAttachmentOrigin(T)&&(n(E,E,T),i++);return i===0?null:(r(E,E,1/i),this.view.renderCoordsHelper.fromRenderCoords(E,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return this.geometry!=null&&this.geometry.type===`polygon`}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:`round`,polygonOffset:3,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===8?4:this._renderOccluded}_recreateGeometry(e,t,n){this._createRenderGeometries(t,n);for(let t of n)e.addGeometry(t);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit(`attachment-origin-changed`)}_createObject3DResources(e){let t=new S(this._materialParameters,this.view.state.isGlobal),n=[];return this._recreateGeometry(e,t,n),{material:t,geometries:n}}_createDrapedResources(){let e=new S(this._materialParameters,this.view.state.isGlobal);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){let{geometry:t,view:n}=this,r=n.groundView.spatialReference;return t==null||r==null?[]:y(t,r).lines.map(({position:t})=>{let i={overlayInfo:{spatialReference:r,renderCoordsHelper:n.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new x(v(e,i))})}calculateMapBounds(e){if(this.object3dResources.resources==null)return!1;let t=this.view.renderCoordsHelper;for(let n of this.object3dResources.resources.geometries){let r=n.attributes.get(`position`),i=d(r.data.length);l(r.data,t.spatialReference,0,i,this.view.spatialReference,0),u(e,i)}return!0}_createRenderGeometries(e,t){let n=this.geometry;if(n==null)return;let r=b(n,this.view.elevationProvider,this.view.renderCoordsHelper,_.fromElevationInfo(this.elevationInfo??new m({mode:p(n,null)}))),i=[];for(let{position:n,mapPositions:a}of r.lines){let r={mapPositions:a,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(v(e,r)),i.push(n)}this._laserline.pathVerticalPlane=i}}function w(e){e.geometries=[]}const T=i(),E=i();export{C as OutlineVisualElement};
|