@arcgis/core 5.1.0-next.20 → 5.1.0-next.22
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/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -0
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
- package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +1 -0
- package/analysis/VolumeMeasurementAnalysis.d.ts +3 -2
- package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +45 -15
- package/applications/Components/QuantityFormatter.d.ts +11 -11
- package/applications/Components/SelectionOperation.d.ts +11 -11
- package/applications/Components/SketchTooltipControls.d.ts +9 -9
- package/applications/Components/actionUtils.d.ts +2 -1
- package/applications/Components/analysisUtils.d.ts +27 -26
- package/applications/Components/applySetUtils.d.ts +40 -40
- package/applications/Components/arcadeEditorUtils.d.ts +3 -3
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -12
- package/applications/Components/baUtils.d.ts +8 -8
- package/applications/Components/basemapUtils.d.ts +2 -2
- package/applications/Components/clipboard.d.ts +14 -14
- package/applications/Components/drawUtils.d.ts +3 -3
- package/applications/Components/editUtils.d.ts +14 -14
- package/applications/Components/featureUtils.d.ts +10 -10
- package/applications/Components/fieldFormatUtils.d.ts +2 -2
- package/applications/Components/fontUtils.d.ts +2 -2
- package/applications/Components/formatUtils.d.ts +2 -2
- package/applications/Components/getDefaultUnits.d.ts +2 -2
- package/applications/Components/gfxUtils.d.ts +5 -1
- package/applications/Components/imageryUtils.d.ts +35 -35
- package/applications/Components/layerOriginUtils.d.ts +5 -5
- package/applications/Components/layersEffectsJsonUtils.d.ts +2 -2
- package/applications/Components/previewSymbol2D.d.ts +2 -2
- package/applications/Components/rasterFunctionEditorUtils.d.ts +40 -40
- package/applications/Components/reactiveUtils.d.ts +14 -13
- package/applications/Components/sanitizerUtils.d.ts +2 -2
- package/applications/Components/stringUtils.d.ts +5 -5
- package/applications/Components/styleUtils.d.ts +2 -2
- package/applications/Components/svgUtils.d.ts +4 -4
- package/applications/Components/symbolUtils.d.ts +47 -11
- package/applications/Components/templateUtils.d.ts +73 -17
- package/applications/Components/templateUtils.js +1 -1
- package/applications/Components/testUtils.d.ts +3 -3
- package/applications/Components/unitUtils.d.ts +1 -1
- package/applications/Components/viewUtils.d.ts +2 -2
- package/applications/Components/webStyleSymbolUtils.d.ts +2 -2
- package/applications/Excalibur/imageryLayerUtils.d.ts +3 -3
- package/applications/Excalibur/videoViewUtils.d.ts +8 -8
- package/applications/Excalibur/widgetUtils.d.ts +2 -2
- package/applications/ExperienceBuilder/sketchUtils.d.ts +7 -7
- package/applications/KnowledgeStudio/dataModelVisualization.d.ts +20 -8
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +21 -21
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +35 -35
- package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +9 -9
- package/applications/KnowledgeStudio/reshape.d.ts +40 -40
- package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +11 -11
- package/applications/MapViewer/layerUtils.d.ts +2 -2
- package/applications/MapViewer/mediaUtils.d.ts +13 -13
- package/applications/MapViewer/templateUtils.d.ts +20 -20
- package/applications/PortalApp/layerUtils.d.ts +2 -2
- package/applications/SceneViewer/colorUtils.d.ts +2 -2
- package/applications/SceneViewer/devEnvironmentUtils.d.ts +4 -3
- package/applications/SceneViewer/layerUtils.d.ts +3 -3
- package/applications/SceneViewer/sceneViewerUtils.d.ts +34 -34
- package/applications/SceneViewer/symbolUtils.d.ts +2 -2
- package/applications/Urban/LineImagePattern3D.d.ts +3 -2
- package/applications/Urban/imagePatternUtils.d.ts +4 -4
- package/applications/Urban/meshUtils.d.ts +2 -2
- package/applications/WebEditor/sketchUtils.d.ts +8 -8
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03d11c7056fea763cbac.js +1 -0
- package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +1 -0
- package/assets/esri/core/workers/chunks/08445fcba84ed7c23b3f.js +1 -0
- package/assets/esri/core/workers/chunks/0c706cdff6eac940eaab.js +1 -0
- package/assets/esri/core/workers/chunks/10a8612e7b2c74a8ce9a.js +1 -0
- package/assets/esri/core/workers/chunks/{df321c37b61099f6e4c2.js → 11058e660139c427c3e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ddb8bb00b3af83ebd7c.js → 14792047c5519dd89828.js} +1 -1
- package/assets/esri/core/workers/chunks/1a1e57267306c07e5bdb.js +1 -0
- package/assets/esri/core/workers/chunks/1bb5aa1e3693e0c68b18.js +1 -0
- package/assets/esri/core/workers/chunks/1cd091fa567fc4026356.js +1 -0
- package/assets/esri/core/workers/chunks/1dcd057695f8db79eca2.js +1 -0
- package/assets/esri/core/workers/chunks/{3ed7f19f77a11fa4d047.js → 2063b49607a03f7718ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{74a6d840813ac29b0bda.js → 209acb3ad16c99bb506c.js} +1 -1
- package/assets/esri/core/workers/chunks/21decfc1e477fb769204.js +1 -0
- package/assets/esri/core/workers/chunks/21e04705cad9fef1b01b.js +1 -0
- package/assets/esri/core/workers/chunks/23cb0611abe1031c513c.js +1 -0
- package/assets/esri/core/workers/chunks/285f3b07de852bfc1604.js +1 -0
- package/assets/esri/core/workers/chunks/2c61a53962093a331225.js +1 -0
- package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +1 -0
- package/assets/esri/core/workers/chunks/2f23af31b1190754ce13.js +1 -0
- package/assets/esri/core/workers/chunks/31eb59eae4c89b76e302.js +1 -0
- package/assets/esri/core/workers/chunks/3e61e7805dc6ff284831.js +1 -0
- package/assets/esri/core/workers/chunks/4150774059d67a8def74.js +1 -0
- package/assets/esri/core/workers/chunks/416c57df61fbd193078b.js +1 -0
- package/assets/esri/core/workers/chunks/46d28a0c20263012faff.js +1 -0
- package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js → 4754610760f3f634adf9.js} +2 -2
- package/assets/esri/core/workers/chunks/{f5cebeaad3e7d87d7997.js → 4fc6dd1423075e145b29.js} +1 -1
- package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js → 527547fa10d52cb3a7b1.js} +2 -2
- package/assets/esri/core/workers/chunks/5480d4cc342a2669a8ab.js +1 -0
- package/assets/esri/core/workers/chunks/{e8495c655a0a4f534636.js → 551fee27bf3abf0c41fd.js} +1 -1
- package/assets/esri/core/workers/chunks/568d32ceee1409809e5a.js +1 -0
- package/assets/esri/core/workers/chunks/576995021660e8b34705.js +1 -0
- package/assets/esri/core/workers/chunks/57e375d8a8db9fa57193.js +1 -0
- package/assets/esri/core/workers/chunks/5cbc12545f42a32fb960.js +1 -0
- package/assets/esri/core/workers/chunks/61ebbae0773fccc1f2bf.js +1 -0
- package/assets/esri/core/workers/chunks/63c297b6b7438f49e7ee.js +1 -0
- package/assets/esri/core/workers/chunks/6b56c8ba978ec6edd6b8.js +1 -0
- package/assets/esri/core/workers/chunks/{53f8c1d56ef3b24d2226.js → 6c853fd89f0e9f102c6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{946698d9cefffdb63082.js → 6e32e7b2ea2ea1a1fc04.js} +1 -1
- package/assets/esri/core/workers/chunks/6f12854c5846edfe3239.js +1 -0
- package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js → 7189e03cc24f5c10865a.js} +2 -2
- package/assets/esri/core/workers/chunks/7b59ddad3c73f5f44b4d.js +1 -0
- package/assets/esri/core/workers/chunks/7c417d2bf432e4055b3d.js +30 -0
- package/assets/esri/core/workers/chunks/8021cb732f8136d87048.js +1 -0
- package/assets/esri/core/workers/chunks/84124c1a41a96192f81c.js +1 -0
- package/assets/esri/core/workers/chunks/845bbd82ddacbb62ad28.js +1 -0
- package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +1 -0
- package/assets/esri/core/workers/chunks/879ce85c50b0348056b2.js +1 -0
- package/assets/esri/core/workers/chunks/87a7d405a0b9a541d7f2.js +1 -0
- package/assets/esri/core/workers/chunks/9522430d34d29c1ffb1a.js +1 -0
- package/assets/esri/core/workers/chunks/9647f3983f955da21093.js +1 -0
- package/assets/esri/core/workers/chunks/9694b4b85168a38ca24b.js +1 -0
- package/assets/esri/core/workers/chunks/{83d913dab3c2b0d6a7cc.js → 9736299a4ac0e21f08a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7bee85f28d7ec03825a.js → 973e3743cb7fdaa27f80.js} +1 -1
- package/assets/esri/core/workers/chunks/9b2d0d36ee6c04c347df.js +1 -0
- package/assets/esri/core/workers/chunks/{2662750d5761ed2d0eb7.js → 9e7eea56e96f012f9ff4.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js → a35d1be700ebd3109397.js} +2 -2
- package/assets/esri/core/workers/chunks/a4919dd9963f853a0077.js +1 -0
- package/assets/esri/core/workers/chunks/a4a4ce33de6432ba4dc3.js +1 -0
- package/assets/esri/core/workers/chunks/{aece665144aed2065ffc.js → a78ac951c00f090d9024.js} +1 -1
- package/assets/esri/core/workers/chunks/a7dbd38bc216713044fc.js +1 -0
- package/assets/esri/core/workers/chunks/{0debabe324c873066885.js → aa3bdfd00f666c6cc521.js} +1 -1
- package/assets/esri/core/workers/chunks/{db5bbc240a1b8cd5af52.js → abc2471cfa9430ca5645.js} +1 -1
- package/assets/esri/core/workers/chunks/b2a67fe89f6505498bc3.js +1 -0
- package/assets/esri/core/workers/chunks/{b8b2f160518e3a225d99.js → b364ec104dd59faa41b6.js} +1 -1
- package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +1 -0
- package/assets/esri/core/workers/chunks/{a53fa34681efff8fc024.js → b859d98fa1c39f8e4099.js} +1 -1
- package/assets/esri/core/workers/chunks/c09bc36347e8eb9fff00.js +1 -0
- package/assets/esri/core/workers/chunks/c2cda93905f0a49a6931.js +1 -0
- package/assets/esri/core/workers/chunks/c3e4f8664988e50bda55.js +1 -0
- package/assets/esri/core/workers/chunks/{3d0aa5f2db79c022243e.js → c794f7be868e53ca4a8c.js} +1 -1
- package/assets/esri/core/workers/chunks/cada79c174027f7a0df8.js +1 -0
- package/assets/esri/core/workers/chunks/cf100c80b75ba74b479c.js +1 -0
- package/assets/esri/core/workers/chunks/d10c65cde3565d399275.js +1 -0
- package/assets/esri/core/workers/chunks/d44217de4c73475f9c66.js +1 -0
- package/assets/esri/core/workers/chunks/d587b7842091affdaac3.js +1 -0
- package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +1 -0
- package/assets/esri/core/workers/chunks/dad9c25f1b7cacf7b052.js +1 -0
- package/assets/esri/core/workers/chunks/{0facd2c143a04cc7c4ff.js → deee88e3f1641c6ef5db.js} +1 -1
- package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +1 -0
- package/assets/esri/core/workers/chunks/e37e7ae2de974cef9a90.js +1 -0
- package/assets/esri/core/workers/chunks/e44ed205f74df34adb8b.js +1 -0
- package/assets/esri/core/workers/chunks/e6220c1fa887e21ffbbd.js +1 -0
- package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js → eaeb95be8d4032513247.js} +2 -2
- package/assets/esri/core/workers/chunks/{93515f52d9b5fa12bd04.js → eb4934d3a3b82316c7c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{23c856265dd24ce54fdb.js → f1c1f7583fa13dff9b5c.js} +1 -1
- package/assets/esri/core/workers/chunks/f27bbb4e26297d3c68de.js +1 -0
- package/assets/esri/core/workers/chunks/f4480636a910eaa4c531.js +1 -0
- package/assets/esri/core/workers/chunks/{5b991b0d4ca257291cb0.js → f5c5a9e771074f780fc8.js} +1 -1
- package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +1 -0
- package/assets/esri/core/workers/chunks/fb3a42cdd0d3105ec551.js +1 -0
- package/chunks/Clouds.glsl.js +1 -1
- package/config.js +1 -1
- package/core/MultiOriginJSONSupport.d.ts +1 -1
- package/core/ReadOnlyMultiOriginJSONSupport.d.ts +5 -4
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/support/curves/curveUtils.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/graphic/graphicOriginUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -9
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/Sublayer.d.ts +3 -0
- package/package.json +2 -2
- package/renderers/VectorFieldRenderer.js +1 -1
- package/renderers/support/DictionaryControlString.js +1 -1
- package/renderers/support/DictionaryLoader.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/SDFHelper.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/rasterizingUtils.js +1 -1
- package/symbols/cim/types.d.ts +220 -117
- package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -0
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +1 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/IndexBufferCache.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/IndexLayout.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/SelectionManager.d.ts +9 -9
- package/views/SelectionManager.js +1 -1
- package/views/View.d.ts +13 -2
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/reshapeUtils.js +1 -1
- package/views/draw/support/types.d.ts +8 -1
- package/views/interactive/support/utils.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +24 -24
- package/views/webgl/BufferObject.js +1 -1
- package/widgets/Attribution/AttributionViewModel.d.ts +3 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/Attribution.d.ts +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -22
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.d.ts +10 -15
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +0 -15
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +0 -1
- package/widgets/FeatureTable.d.ts +1 -19
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.d.ts +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +4 -22
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/widgets/Sketch.d.ts +10 -17
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/026c00ee272c64e53daf.js +0 -1
- package/assets/esri/core/workers/chunks/0883c4e63424d6746ada.js +0 -1
- package/assets/esri/core/workers/chunks/0987cb20148f65222b44.js +0 -1
- package/assets/esri/core/workers/chunks/0a1f88cf16bcbb53b371.js +0 -1
- package/assets/esri/core/workers/chunks/0bb3beedae1b73beb1fc.js +0 -1
- package/assets/esri/core/workers/chunks/0ca405ca26676137a4be.js +0 -1
- package/assets/esri/core/workers/chunks/0ce968c89c35535da63e.js +0 -1
- package/assets/esri/core/workers/chunks/0d56e3b3265a4470aaa6.js +0 -1
- package/assets/esri/core/workers/chunks/144c719d5ba9e3a30961.js +0 -1
- package/assets/esri/core/workers/chunks/1503ca177e2466ec0e87.js +0 -1
- package/assets/esri/core/workers/chunks/1597d7b380d510ff5252.js +0 -1
- package/assets/esri/core/workers/chunks/1880c3b293cdfa804625.js +0 -1
- package/assets/esri/core/workers/chunks/1bea32b02d35ddb9b118.js +0 -1
- package/assets/esri/core/workers/chunks/1d78ec98eef7fef08f86.js +0 -1
- package/assets/esri/core/workers/chunks/1e6271524602e159dbad.js +0 -1
- package/assets/esri/core/workers/chunks/1f96d597ba736e088168.js +0 -1
- package/assets/esri/core/workers/chunks/26e41b08efe77d247409.js +0 -1
- package/assets/esri/core/workers/chunks/297b58f29c496923e1f3.js +0 -1
- package/assets/esri/core/workers/chunks/2a2a9fa62969644ea200.js +0 -1
- package/assets/esri/core/workers/chunks/2b296378d21e4e3c11d4.js +0 -1
- package/assets/esri/core/workers/chunks/2cbcf34cf896a438999b.js +0 -1
- package/assets/esri/core/workers/chunks/394b645d51e7bf799382.js +0 -1
- package/assets/esri/core/workers/chunks/50ab9a3f8bbb268fae59.js +0 -1
- package/assets/esri/core/workers/chunks/5a8b3e5977c233d5c9d0.js +0 -1
- package/assets/esri/core/workers/chunks/5b2dd164dd84fd1ca4f7.js +0 -1
- package/assets/esri/core/workers/chunks/62c228ca16fdc7a2c695.js +0 -1
- package/assets/esri/core/workers/chunks/639202a461b17840a13f.js +0 -1
- package/assets/esri/core/workers/chunks/693d269637135047a0c4.js +0 -1
- package/assets/esri/core/workers/chunks/6a14ec2d2de6778a4e7a.js +0 -1
- package/assets/esri/core/workers/chunks/6d3467997b5d01630b08.js +0 -1
- package/assets/esri/core/workers/chunks/6dfcb0c804e63e87e311.js +0 -1
- package/assets/esri/core/workers/chunks/778ab9e4c3928b0d7d74.js +0 -1
- package/assets/esri/core/workers/chunks/8012fdc49a7a10982f78.js +0 -1
- package/assets/esri/core/workers/chunks/85e0fd618625a639387f.js +0 -1
- package/assets/esri/core/workers/chunks/86465d4bb185d7460087.js +0 -1
- package/assets/esri/core/workers/chunks/87e7378b242debbfd575.js +0 -1
- package/assets/esri/core/workers/chunks/90b19e60c056f32623e7.js +0 -1
- package/assets/esri/core/workers/chunks/9461f7225c42cf15a114.js +0 -1
- package/assets/esri/core/workers/chunks/978649cb6df99ee728be.js +0 -1
- package/assets/esri/core/workers/chunks/9f5f4da954228d876219.js +0 -1
- package/assets/esri/core/workers/chunks/a2323c957c8b2fe225b4.js +0 -1
- package/assets/esri/core/workers/chunks/a36a33f43610c3cd985b.js +0 -1
- package/assets/esri/core/workers/chunks/a381932eef77f4d80292.js +0 -1
- package/assets/esri/core/workers/chunks/b089947c9a492c96ca27.js +0 -1
- package/assets/esri/core/workers/chunks/b6e4c35b76379088035c.js +0 -1
- package/assets/esri/core/workers/chunks/bbf2afa05314e267893f.js +0 -1
- package/assets/esri/core/workers/chunks/bd2f577cae61facdde4a.js +0 -1
- package/assets/esri/core/workers/chunks/bf2bfc0d78be8c185d58.js +0 -1
- package/assets/esri/core/workers/chunks/c4a78ab84186c7be599a.js +0 -1
- package/assets/esri/core/workers/chunks/c6e0ada6f2ad74fddfec.js +0 -1
- package/assets/esri/core/workers/chunks/c9d600dc6b6b5aafff1c.js +0 -1
- package/assets/esri/core/workers/chunks/ca33847a997ccfe8ddc2.js +0 -1
- package/assets/esri/core/workers/chunks/cca19c9564be2d02a277.js +0 -1
- package/assets/esri/core/workers/chunks/ccc2f2b3db008d8a495f.js +0 -1
- package/assets/esri/core/workers/chunks/d9f900975ac915a0f24f.js +0 -1
- package/assets/esri/core/workers/chunks/dcc8363faa22e6211351.js +0 -1
- package/assets/esri/core/workers/chunks/dd5d66f067e2386e0514.js +0 -1
- package/assets/esri/core/workers/chunks/e081d6f21a2c01ccaf61.js +0 -1
- package/assets/esri/core/workers/chunks/eb4ffb72c9360062141c.js +0 -1
- package/assets/esri/core/workers/chunks/ebae903845643d60b44a.js +0 -1
- package/assets/esri/core/workers/chunks/ebb0372e8da0f75c09dd.js +0 -1
- package/assets/esri/core/workers/chunks/f349f64f683620bdf9b5.js +0 -30
- package/assets/esri/core/workers/chunks/f6fb87092bdf6bbf0769.js +0 -1
- package/assets/esri/core/workers/chunks/f76c2b09e6ba9d107898.js +0 -1
- package/assets/esri/core/workers/chunks/fcf962f3dec6b5440983.js +0 -1
- /package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js.LICENSE.txt → 4754610760f3f634adf9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js.LICENSE.txt → 527547fa10d52cb3a7b1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js.LICENSE.txt → 7189e03cc24f5c10865a.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js.LICENSE.txt → a35d1be700ebd3109397.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js.LICENSE.txt → eaeb95be8d4032513247.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
class t{constructor(t,i,h){this.geometry=t,this.targetRanges=i,this._highlightName=null,this.updateHighlightOptions(
|
|
2
|
+
class t{constructor(t,i,e,h){this.geometry=t,this.targetRanges=i,this.drawRangeTarget=h,this._highlightName=null,this.updateHighlightOptions(e)}updateHighlightOptions(t){const{geometry:i}=this;if(!i.hasHighlights)return void(this._highlightName=null);let e=-1,h=null;i.foreachHighlightOptions(i=>{const g=t.get(i)??-1;g>e&&(e=g,h=i)}),this._highlightName=h}get highlightName(){return this._highlightName}get isVisible(){return this.geometry.visible}get hasHighlights(){return this.isVisible&&this.geometry.hasHighlights}get hasOccludees(){return null!=this.geometry.occludees}get drawRange(){return this.targetRanges[this.drawRangeTarget]}}export{t as Instance};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as s,filterInPlace as o}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{NestedMap as r}from"../../../../../core/NestedMap.js";import{nullUid as a}from"../../../../../core/uid.js";import{property as i,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as s,filterInPlace as o}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{NestedMap as r}from"../../../../../core/NestedMap.js";import{nullUid as a}from"../../../../../core/uid.js";import{property as i,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{assert as c}from"../../lib/Util.js";import{bufferRangePool as f,mergeAdjacentRanges as u}from"./BufferRange.js";import{PerBaseInstanceData as d}from"./PerBaseInstanceData.js";import{PerBufferData as h,hasVao as m}from"./PerBufferData.js";import{PerOriginData as p}from"./PerOriginData.js";import{VaoWriter as g}from"./VaoWriter.js";let y=class extends t{constructor(e){super(e),this._vaoWriter=null,this._useMetalWorkaround=!1,this._hasOccludees=!1}destroy(){for(const e of this.dataByBaseInstance.values()){for(const t of e.dataByOrigin.values())for(const e of t.buffers)this._vaoWriter?.deleteBuffer(e);e.dispose()}this.dataByBaseInstance.clear(),this.uninitializeRenderContext()}initializeRenderContext(e){this._useMetalWorkaround=e.renderContext.rctx.isAssumedMetalDriver,this._vaoWriter=new g(this.material,e.renderContext.rctx)}uninitializeRenderContext(){this._useMetalWorkaround=!1,this._vaoWriter=null}get hasOccludees(){return this._hasOccludees}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this.dataByBaseInstance.values())for(const t of e.dataByOrigin.values())if(t.buffers.some(e=>e.holes.geometry.length>1))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const o of this.dataByBaseInstance.values())for(const n of o.dataByOrigin.values()){const r=new Array;for(let t=0;t<n.buffers.length&&!e.done;){const o=n.buffers[t];o.holes.geometry.length<=1?++t:(o.instances.forEach(({geometry:e})=>r.push(e)),this._vaoWriter?.deleteBuffer(o),s(n.buffers,o,void 0,{last:t}),e.madeProgress())}if(r.length>0){const{baseInstanceData:e}=o;n.buffers.forEach(t=>this._applyAdds(e,t,r));const s=null!=e;for(;r.length>0;)n.buffers.push(this._applyAndRebuild(e,new h(s,this._vaoWriter.targetBuffers),r,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e;for(const t of this.dataByBaseInstance.values())for(const s of t.dataByOrigin.values())for(const t of s.buffers)t.updateHighlights(e)}_applyUpdates(e,t){const o=this._vaoWriter;if(null==o)return void e.clearUpdates();let n;const r=this._useMetalWorkaround?(e,t)=>{n??=new Map;let s=n.get(t);s||(s=[],n.set(t,s)),s.push(e)}:(e,t)=>o.updateInstance(e,t);for(const i of e.updates){if(t.done)return;const{renderGeometry:o,updateType:n}=i;s(e.pending.updates,i),t.madeProgress();const l=this.dataByBaseInstance.get(o.geometry.baseGeometry?.id??a),c=l?.dataByOrigin.get(o.localOrigin.id)?.findBuffer(o.id);if(null==c)return;const f=c.instances.get(o.id);6&n&&r(f,c),25&n&&(c.drawCommandsDirty=!0)}n&&o.updateInstancesMetal(n)}_computeDeltas(e,t){const s=new Map;for(const o of e){const e=o.localOrigin;if(null==e)continue;const t=o.geometry.baseGeometry,r=n(s,t??null,_);let a=r.get(e,null);null==a&&(a=new v(e.vec3,t),r.set(e,null,a)),a.changes.push(o)}for(const o of t){const e=o.localOrigin;if(null==e)continue;const t=o.geometry.baseGeometry,r=this.dataByBaseInstance.get(t?.id??a),i=r?.dataByOrigin.get(e.id)?.findBuffer(o.id);if(null==i)continue;const l=n(s,t??null,_);let c=l.get(e,i);null==c&&(c=new v(e.vec3,t),l.set(e,i,c)),c.changes.push(o)}return s}_applyAddsAndRemoves(e){const{_vaoWriter:t,dataByBaseInstance:o}=this;if(null==t)return void e.clearAddsAndRemoves();const r=this._computeDeltas(e.adds,e.removes);for(const[i,l]of r){const e=n(o,i?.id??a,()=>new d(t.createBaseInstanceData(i)));for(const[o,r]of l.outerMap()){const a=r.get(null),i=a?.changes??[];l.delete(o,null);const f=n(e.dataByOrigin,o.id,()=>new p(o.vec3));for(const[n,u]of r){if(l.delete(o,n),null==n&&c(!1,"No VAO for removed geometries"),n.instances.size===u.changes.length){t.deleteBuffer(n),s(f.buffers,n),0===f.buffers.length&&0===i.length&&e.dataByOrigin.delete(o.id);continue}switch(t.evaluateBufferAllocation(n.numElements.geometry,i,u.changes,n)){case 0:u.changes.forEach(({id:e})=>n.deleteInstance(e)),n.instances.forEach(({geometry:e})=>i.push(e)),t.deleteBuffer(n),s(f.buffers,n);break;case 1:this._applyAndRebuild(e.baseInstanceData,n,i,u);break;case 2:this._applyRemoves(n,u)}}if(i.length>0){const{baseInstanceData:s}=e,o=null!=s;for(const e of f.buffers)this._applyAdds(s,e,i);const{targetBuffers:n}=t;for(;i.length>0;)f.buffers.push(this._applyAndRebuild(s,new h(o,n),i,null))}}0===e.dataByOrigin.size&&(e.dispose(),o.delete(e.id))}e.clearAddsAndRemoves()}_updateDrawCommands(){this._hasOccludees=!1;for(const e of this.dataByBaseInstance.values())for(const t of e.dataByOrigin.values())for(const e of t.buffers)e.updateDirtyDrawCommands(this.highlightOrderMap),this._hasOccludees||=e.hasOccludees}_applyAndRebuild(e,t,s,o){if(o)for(const c of o.changes)t.deleteInstance(c.id);const n=this._vaoWriter,{targetBuffers:r}=n,a={},i={};for(const c of r)a[c]=n.maxElements(c),i[c]=t.numElements[c];for(;s.length>0;){const e=s.pop(),o={};for(const t of r)o[t]=n.elementCount(e.geometry,t);if(r.some(e=>i[e]+o[e]>a[e]&&i[e]>0)){s.push(e);break}for(const t of r)i[t]+=o[t];t.createInstance(e,this.highlightOrderMap)}t.resetInstanceSummary(),n.reallocateBuffer(e,t,i);const l=n.rebuildInstances(i,t.writeableInstances.values(),t);t.updateInstances(),t.clearHoles();for(const c of r)t.holes[c].push(f.acquire(l[c],t.endElements[c]));return t.updateDrawCommands(this.highlightOrderMap),t}_applyRemoves(e,t){const{_vaoWriter:s}=this;if(0===t.changes.length||null==s)return;const{targetBuffers:o}=s,n={},r={};for(const a of o)n[a]=[],r[a]=f.acquire(1/0,-1/0);for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(s){if(this._useMetalWorkaround)for(const e of o){const t=s.targetRanges[e],o=r[e];o.from=Math.min(o.from,t.from),o.to=Math.max(o.to,t.to)}for(const e of o){const t=s.targetRanges[e],o=n[e],r=o.at(-1);r?.to===t.from?r.to=t.to:r?.from===t.to?r.from=t.from:o.push(f.acquire(t.from,t.to))}e.deleteInstance(t)}}for(const a of o)u(n[a]);this._useMetalWorkaround?s.clearHolesMetal(e.instances.values(),r,e):s.clearHoles(n,e);for(const a of o)f.release(r[a]);for(const a of o){const t=e.holes[a];for(const e of n[a])t.push(e)}e.drawCommandsDirty=!0}_applyAdds(e,t,s){if(0===s.length||null==this._vaoWriter)return;if(!m(t))return void this._applyAndRebuild(e,t,s,null);const n=this._vaoWriter,{targetBuffers:r}=n,a={};for(const o of r){const e=t.numElements[o],r=s.reduce((e,{geometry:t})=>e+n.elementCount(t,o),0);a[o]=Math.min(e+r,n.maxElements(o))}if(n.canGrow(t,a))return void this._applyAndRebuild(e,t,s,null);t.mergeHoles();const i={},l={};for(const o of r)i[o]=[],l[o]=f.acquire(1/0,-1/0);for(const{geometry:o}of s){const e={},s={};for(const a of r)e[a]=n.elementCount(o,a),s[a]=B(t.holes[a],e[a]);if(r.every(e=>null!=s[e]))for(const t of r){const o=s[t];if(i[t].push(o),this._useMetalWorkaround){const s=l[t];s.from=Math.min(s.from,o),s.to=Math.max(s.to,o+e[t])}}else for(const t of r)i[t].push(null)}const c=this._addInstances(s,t,i);if(this._useMetalWorkaround){if(r.some(e=>!Number.isFinite(l[e].from)||!Number.isFinite(l[e].to)))return;for(const e of c);n.writeInstanceRangeMetal(l,t.instances.values(),t)}else n.writeRandomInstances(a,c,t);o(s,(e,t)=>r.some(e=>null==i[e][t]))}*_addInstances(e,t,s){const o=e.length,n=this._vaoWriter,{targetBuffers:r}=n;for(let a=0;a<o;++a){const o=e[a];if(r.some(e=>null==s[e][a]))continue;const i={};for(const e of r){const t=s[e][a];i[e]=f.acquire(t,t+n.elementCount(o.geometry,e))}const l=t.createInstance(o,this.highlightOrderMap,i);t.drawCommandsDirty=!0,yield l}}static prune(){g.prune()}get test(){}};e([i({constructOnly:!0})],y.prototype,"dataByBaseInstance",void 0),e([i({constructOnly:!0})],y.prototype,"material",void 0),e([i()],y.prototype,"highlightOrderMap",void 0),y=e([l("esri.views.3d.webgl-engine.materials.renderers.MergedBuffer")],y);class v{constructor(e,t){this.origin=e,this.baseInstance=t,this.changes=new Array}}function B(e,t){if(0===t)return 0;const o=e.find(e=>e.numElements>=t);if(null==o)return null;const n=o.from;return o.from+=t,o.numElements<=0&&(s(e,o),f.release(o)),n}function _(){return new r}export{y as MergedBuffer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as
|
|
2
|
+
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{Instance as r}from"./Instance.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as h}from"./InstancedCommandVAOs.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.endElements={geometry:0,texture:0,index:0},this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=l(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=l(),this.drawCommandsShadowHighlightRest=l(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n,this.useIndexing=s.includes("index"),this._drawRangesTarget=this.useIndexing?"index":"geometry"}getTargetBuffer(t){return"geometry"===t?this.vao?.buffer("geometry"):"texture"===t?this.textureBuffer:this.vao?.indexBuffer}get numElements(){return this._numElements}get instances(){return this._instances}get writeableInstances(){return this._instances}get indexType(){return this.vao?.indexBuffer?.indexType}clearHoles(){for(const t of this.targetBuffers){const s=this._holes[t];for(const t of s)n.release(t);s.length=0}}get holes(){return this._holes}get hasHighlights(){return this.highlightNames.size>0}get instancedCommandVAOs(){return this._instancedCommandVAOs}get _drawTargetHoles(){return this._holes[this._drawRangesTarget]}get _drawTargetEndElement(){return this.endElements[this._drawRangesTarget]}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateDirtyDrawCommands(t){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t)}}createInstance(t,s,e=this._makeEmptyRanges()){const n=new r(t,e,s,this._drawRangesTarget);return this.addInstance(t.id,n),n}addInstance(t,s){e(!this._instances.has(t)),this._instances.set(t,s);for(const e of this.targetBuffers)this._numElements[e]+=s.targetRanges[e].numElements}deleteInstance(t){const s=this._instances.get(t);if(s){for(const t of this.targetBuffers){const e=s.targetRanges[t];this._numElements[t]-=e.numElements,n.release(e)}this._instances.delete(t)}}updateInstances(){const{targetBuffers:t}=this,s={};for(const e of t)s[e]=0;for(const e of this._instances.values()){for(const n of t)s[n]+=e.targetRanges[n].numElements;this.updateDrawState(e)}this._numElements=s}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t){this._updateDrawCommands(t),this._updateInstancedCommandVAOs()}_updateDrawCommands(t){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:s}=this;if(this._updateHighlightDrawCommands(t,s),!this.needsMultipleCommands){const t=this.drawCommandsDefault.pushNew(),s=this._drawTargetHoles,e=s.at(0);return this.vao&&1===s.length&&e.to===this._drawTargetEndElement?(t.first=0,void(t.count=e.from)):(t.first=1/0,t.count=0,this._instances.forEach(s=>{t.first=Math.min(t.first,s.drawRange.from),t.count=Math.max(t.count,s.drawRange.to)}),void(t.count-=t.first))}for(const e of s)e.isVisible&&this.addOrMerge(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e)}get sortedInstances(){return Array.from(this._instances.values()).sort(({drawRange:t},{drawRange:s})=>t.from===s.from?t.to-s.to:t.from-s.from)}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t,s),this._updateInstancedCommandVAOs()}mergeHoles(){const t=this._holes;for(const s of this.targetBuffers)a(t[s])}_updateHighlightDrawCommands(s,e){const{drawCommandsHighlights:n,drawCommandsShadowHighlightRest:a}=this;n.clear(),a.clear();for(const i of e){if(i.updateHighlightOptions(s),!i.isVisible)continue;const{highlightName:e}=i;if(e){this.highlightNames.add(e);const s=t(n,e,l);this.addOrMerge(s,i)}e&&e===d||this.addOrMerge(a,i)}}_updateInstancedCommandVAOs(){const t=this.vao;if(!this.isInstanced||null==t)return;this._instancedCommandVAOs??=new h;const s=this._instancedCommandVAOs,e=s.commandVAOs.copy();s.clear();const n=s.commandVAOs,a=(s,a)=>{for(const i of s){const{first:s,count:r}=i,h=n.get(s,r)??e.pop(s,r)??new o(t.shallowCloneWithBaseInstances(new Map([["geometry",i.first]])),i.count);n.set(s,r,h),a.push(h)}};a(this.drawCommandsDefault,s.drawCommandsDefault);for(const[i,r]of this.drawCommandsHighlights){const t=new Array;a(r,t),s.drawCommandsHighlights.set(i,t)}a(this.drawCommandsOccludees,s.drawCommandsOccludees),a(this.drawCommandsShadowHighlightRest,s.drawCommandsShadowHighlightRest);for(const i of e.values())i.dispose();e.clear()}get needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}addOrMerge(t,{drawRange:s}){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(u(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}_makeEmptyRanges(){const t={};for(const s of this.targetBuffers)t[s]=n.acquire(0,0);return t}}function c(t){return null!=t.vao}function l(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function u(t,s){return t.first+t.count>=s.from}export{m as PerBufferData,c as hasVao};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{property as s,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{GLMaterials as n}from"../../lib/GLMaterials.js";import{assert as a}from"../../lib/Util.js";import{DrawParameters as o}from"../DrawParameters.js";import{getStrideForDataType as l}from"./IndexLayout.js";import{defaultHighlightName as h}from"../../../../support/HighlightDefaults.js";let d=class extends e{constructor(t){super(t),this._glMaterials=null,this._drawParameters=new o,this._highlightNames=new Set,this._produces=new Map}initialize(){this._updateProduces()}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(t){return this._highlightNames.has(t)}get produces(){return this._produces}_updateProduces(){this.material.produces.forEach((t,e)=>{this._produces.set(e,e=>!(0===this.dataByBaseInstance.size||!(8!==e&&4!==e||this._hasHighlights))&&t(e))})}initializeRenderContext(t){this._glMaterials=new n(this.material,t.materials)}uninitializeRenderContext(){this._glMaterials=i(this._glMaterials)}acquireTechniques(t){if(!this.material.shouldRender(t))return null;const{output:e,bind:i}=t,s=this.material.produces.get(i.slot);if(!s?.(e))return null;const{highlight:r,slot:n}=i,a=4===e,o=8===e,l=o||a,d=r?.name;if(l&&(0===this._highlightNames.size||o&&d&&!this._highlightNames.has(d)))return null;const u=t=>o&&!!d&&!t.has(d),c=5===e,m=!(l||c);for(const g of this.dataByBaseInstance.values())for(const s of g.dataByOrigin.values())for(const r of s.buffers){if(u(r.highlightNames))continue;const s=a?r.drawCommandsHighlights.get(h):l?d?r.drawCommandsHighlights.get(d):r.drawCommandsHighlights.size>0:((c&&r.needsMultipleCommands?r.drawCommandsShadowHighlightRest:r.drawCommandsDefault)||null)?.length??!1,o=m&&r.drawCommandsOccludees||null;if(s||o?.length){const s=this._glMaterials.load(t.rctx,n,e),r=s?.beginSlot(i);if(r)return r}}return null}render(t,e){const{output:i,bind:s}=t,{highlight:r}=s,n=8===i,o=r?.name??"";if(n&&!r)return;const l=4===i,d=n||l,p=5===i,w=!(d||p),{rctx:_}=t;_.runAppleAmdDriverHelper();const C=_.bindTechnique(e,s,this.material.parameters),x=this.material.useIndexing;for(const B of this.dataByBaseInstance.values()){const{baseInstanceData:t}=B,i=null!=t;a(!(i&&x),"Instanced indexed rendering is not supported");const r=i?f:x?g:m,H=i?c:u;for(const a of B.dataByOrigin.values()){this._drawParameters.origin=a.origin;for(const i of a.buffers){if(n&&(!i.hasHighlights||!i.drawCommandsHighlights.has(o)))continue;if(l&&(!i.hasHighlights||!i.drawCommandsHighlights.has(h)))continue;this._drawParameters.textureBuffer=i.textureBuffer?.texture;const a=H(i),u=y(a,i.needsMultipleCommands,o,l,d,p),c=b(a,w);(u?.length||c?.length)&&(C.bindDraw(s,this.material.parameters,this._drawParameters),r(_,i,t,e,u,c,s)),this._drawParameters.textureBuffer=null}}}}updateHighlights(){const{_highlightNames:t}=this;t.clear();for(const e of this.dataByBaseInstance.values())for(const i of e.dataByOrigin.values())for(const e of i.buffers)for(const i of e.highlightNames)t.add(i);this._updateProduces()}get test(){}};t([s({constructOnly:!0})],d.prototype,"material",void 0),t([s({constructOnly:!0})],d.prototype,"dataByBaseInstance",void 0),d=t([r("esri.views.3d.webgl-engine.materials.renderers.VaoRenderer")],d);const u=t=>t,c=t=>t.instancedCommandVAOs,m=(t,{vao:e},i,s,r,n,a)=>{s.ensureAttributeLocations(e),t.bindVAO(e),p(t,s,r,a,!1),p(t,s,n,a,!0)},g=(t,{vao:e},i,s,r,n,o)=>{s.ensureAttributeLocations(e),t.bindVAO(e);const l=e.indexBuffer?.indexType;a(null!=l,"Missing index array"),w(t,s,r,o,!1,l),w(t,s,n,o,!0,l)},f=(t,e,{baseCommand:i},s,r,n,a)=>{_(t,s,i,r,a,!1),_(t,s,i,n,a,!0)};function p(t,e,i,s,r){if(i?.length){t.setPipelineState(e.getPipeline(s,r));for(const s of i)t.drawArrays(e.primitiveType,s.first,s.count)}}function w(t,e,i,s,r,n){if(!i?.length)return;const a=l(n);t.setPipelineState(e.getPipeline(s,r));for(const o of i)t.drawElements(e.primitiveType,o.count,n,o.first*a)}function _(t,e,{first:i,count:s},r,n,a){if(r?.length){t.setPipelineState(e.getPipeline(n,a));for(const{vao:n,instanceCount:a}of r)e.ensureAttributeLocations(n),t.bindVAO(n),t.drawArraysInstanced(e.primitiveType,i,s,a)}}function y(t,e,i,s,r,n){const a=r&&!s?t.drawCommandsHighlights.get(i)??null:null;return s?t.drawCommandsHighlights.get(h):r?a:n&&e?t.drawCommandsShadowHighlightRest:t.drawCommandsDefault}function b(t,e){return e&&t.drawCommandsOccludees||null}export{d as VaoRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{copy as e,invert as r,transpose as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as a}from"../../../support/buffer/glUtil.js";import{VertexArrayObject as n}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as f,getMaxByteSize as u}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{bufferRangePool as i}from"./BufferRange.js";import{DrawCommand as c}from"./DrawCommand.js";import{BaseInstanceData as l}from"./PerBaseInstanceData.js";import{VertexBuffer as m}from"../../../../webgl/VertexBuffer.js";class g{constructor(t,e){this._rctx=e,this._vaoCacheValue=null,this._instanceVboCacheValue=null,this._textureBufferCacheValue=null;const r=t.createBufferWriter();this._bufferWriter=r;const o=["geometry"],s="textureBufferLayout"in r&&null!=r.textureBufferLayout;this.useTextureBuffer=s,s&&o.push("texture"),this.targetBuffers=o}get _vaoCache(){return this._vaoCacheValue??=this._rctx.getVaoCache(a(this._bufferWriter.layout)),this._vaoCacheValue}get _instanceVboCache(){return this._instanceVboCacheValue??=this._rctx.getVboCache(a(this._bufferWriter.layout,1)),this._instanceVboCacheValue}get _textureBufferCache(){return this.useTextureBuffer?(this._textureBufferCacheValue??=this._rctx.getTextureBufferCache(this._bufferWriter.textureBufferLayout),this._textureBufferCacheValue):null}maxElements(t){if("texture"===t){const t=this._targetLayout("texture");return null==t?0:f(this._rctx,t)}return Math.floor(b/this._targetStrideBytes(t))}_targetStrideBytes(t){return this._targetLayout(t)?.stride??0}_targetLayout(t){return"geometry"===t?this._bufferWriter.layout:"baseInstance"===t?this._bufferWriter.baseInstanceLayout:this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(t,e,r,o){const s=this._targetStrideBytes("geometry"),a=e.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),n=r.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),f=Math.min((t+a-n)*s,b),u=o.vao?.buffer("geometry"),i=u?.sizeBytes??0;return f>_&&f<i/2?0:f>i?1:2}deleteBuffer(t){t.isInstanced?(t.instancedCommandVAOs?.dispose(),this._instanceVboCache.deleteVbo(t.vao?.mutableBuffer("geometry")),t.vao?.disposeVAOOnly()):this._vaoCache.deleteVao(t.vao),this._textureBufferCache?.deleteTextureBuffer(t.textureBuffer),t.vao=null,t.textureBuffer=null,t.vaoEndElement=0,t.textureEndElement=0}createBaseInstanceData(t){const{_bufferWriter:e}=this;if(null==t||null==e.baseInstanceLayout||null==e.writeBaseInstance||null==e.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),o=e.elementCountBaseInstance(t.attributes),s=o*r.stride,n=new m(this._rctx,a(r));n.setSize(Math.ceil(s));const f=d(s),u=r.createView(f.buffer);e.writeBaseInstance(t.attributes,u),n.setSubData(f,0,0,s);const i=new c;return i.first=0,i.count=o,new l(t,n,i)}reallocateBuffer(t,e,r){if(this.deleteBuffer(e),null!=t){const o=t.baseInstanceBuffer,s=r.geometry*this._targetStrideBytes("geometry"),a=this._instanceVboCache.newVbo(C(s));e.vao=new n(this._rctx,new Map([["baseInstance",o],["geometry",a]]))}else{const t=r.geometry*this._targetStrideBytes("geometry");e.vao=this._vaoCache.newVao(C(t))}const o=this._targetLayout("texture"),s=this._textureBufferCache;if(null!=o&&null!=s){const t=C(r.texture*o.stride),a=Math.ceil(t/o.stride);e.textureBuffer=s.newTextureBuffer(a)}e.vaoEndElement=Math.floor((e.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),e.textureEndElement=e.textureBuffer?.itemCount??0}elementCount(t,e){const{attributes:r}=t;return"geometry"===e?this._bufferWriter.elementCount(r):"baseInstance"===e?this._bufferWriter.elementCountBaseInstance?.(r)??0:this._bufferWriter.elementCountTextureBuffer?.(r)??0}vertexElementCount(t){return this._bufferWriter.elementCount(t.attributes)}textureElementCount(t){return this._bufferWriter.elementCountTextureBuffer?.(t.attributes)??0}canGrow(t,e){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,t,e));return r.every(({canGrow:t})=>t)&&r.some(({needsToGrow:t})=>t)}_evaluateTargetBufferGrowth(t,e,r){const o=this._targetLayout(t),s=e.getTargetBuffer(t);if(null==o||null==s)return{needsToGrow:null!=o,canGrow:!0};return{needsToGrow:r[t]*o.stride>s.sizeBytes,canGrow:"geometry"===t?s.sizeBytes<C(b-_):s.sizeBytes<u(this._rctx,o)}}clearHoles(t,e){for(const r of this.targetBuffers){const o=this._targetStrideBytes(r),s=t[r],a=s.reduce((t,e)=>Math.max(t,e.numElements),0)*o,n=d(a);n.fill(0,0,a);for(const t of s)this._setTargetSubData(r,e,o,t,n)}}clearHolesMetal(t,e,r){const{targetBuffers:o}=this,s={};let a=0;for(const u of o){const t=e[u].numElements*this._targetStrideBytes(u);s[u]=a,a+=w(t)}const n=d(a);n.fill(0,0,a);const f={};for(const u of o)f[u]=this._targetLayout(u)?.createView(n.buffer,s[u]);for(const u of t){const t=u.targetRanges.geometry;if(!(t.from>=e.geometry.from&&t.to<=e.geometry.to))continue;const r={};for(const s of o)r[s]=u.targetRanges[s].from-e[s].from;this._writeGeometry(u.geometry,f,r,u.targetRanges)}for(const u of o)this._setTargetSubData(u,r,this._targetStrideBytes(u),e[u],n,s[u])}writeRandomInstances(t,e,r){const{targetBuffers:o}=this,s={},a={},n={},f={};let u=0;for(const m of o)s[m]=t[m]*this._targetStrideBytes(m),a[m]=u,n[m]=0,f[m]=i.acquire(0,0),u+=w(s[m]);const c=d(u),l={};for(const i of o)l[i]=this._targetLayout(i)?.createView(c.buffer,a[i]);for(const i of e){for(const t of o){const e=i.targetRanges[t],o=f[t];o.to===e.from||(o.numElements>0&&this._setTargetSubData(t,r,this._targetStrideBytes(t),f[t],c,a[t]),o.from=e.from,n[t]=0)}this._writeGeometry(i.geometry,l,n,i.targetRanges);for(const t of o){const e=i.targetRanges[t];n[t]+=e.numElements,f[t].to=e.to}}for(const m of o){const t=f[m];t.numElements>0&&this._setTargetSubData(m,r,this._targetStrideBytes(m),t,c,a[m]),i.release(f[m])}}writeInstanceRangeMetal(t,e,r){const{targetBuffers:o}=this,s={},a={};let n=0;for(const i of o)s[i]=t[i].numElements*this._targetStrideBytes(i),a[i]=n,n+=w(s[i]);const f=d(n),u={};for(const i of o)u[i]=this._targetLayout(i)?.createView(f.buffer,a[i]);f.fill(0,0,n);for(const i of e){const e=i.targetRanges.geometry;if(!(e.from>=t.geometry.from&&e.to<=t.geometry.to))continue;const r={},s={};for(const a of o){const e=i.targetRanges[a];r[a]=e.from-t[a].from,s[a]=e}this._writeGeometry(i.geometry,u,r,s)}for(const i of o)t[i].numElements>0&&this._setTargetSubData(i,r,this._targetStrideBytes(i),t[i],f,a[i])}rebuildInstances(t,e,r){const{targetBuffers:o}=this,s={},a={},n={};let f=0;for(const i of o)s[i]=t[i]*this._targetStrideBytes(i),a[i]=f,f+=w(s[i]),n[i]=0;const u=d(f),c={};for(const i of o)c[i]=this._targetLayout(i)?.createView(u.buffer,a[i]);for(const i of e){const t={},e={};for(const r of o){t[r]=n[r],n[r]+=this.elementCount(i.geometry.geometry,r);const o=i.targetRanges[r];o.from=t[r],o.to=n[r],e[r]=o}this._writeGeometry(i.geometry,c,t,e)}for(const l of o){const t=i.acquire(0,n[l]);this._setTargetSubData(l,r,this._targetStrideBytes(l),t,u,a[l]),i.release(t)}return n}updateInstance(t,e){const{targetBuffers:r}=this,o={},s={};let a=0;for(const i of r){const e=this._targetStrideBytes(i);o[i]=this.elementCount(t.geometry.geometry,i)*e,s[i]=a,a+=w(o[i])}const n=d(a),f={},u={};for(const i of r)u[i]=0,f[i]=this._targetLayout(i)?.createView(n.buffer,s[i]);this._writeGeometry(t.geometry,f,u,t.targetRanges);for(const i of r)this._setTargetSubData(i,e,this._targetStrideBytes(i),t.targetRanges[i],n,s[i])}updateInstancesMetal(t){const{targetBuffers:e}=this;for(const[r,o]of t){const t={};for(const r of e)t[r]=i.acquire(1/0,-1/0);for(const r of o)for(const o of e){const e=t[o],s=r.targetRanges[o];e.from=Math.min(e.from,s.from),e.to=Math.max(e.to,s.to)}this.writeInstanceRangeMetal(t,r.instances.values(),r);for(const r of e)i.release(t[r])}}_writeGeometry(t,s,a,n){const{_bufferWriter:f}=this;null!=f&&(e(h,t.transformation),h[12]-=t.localOrigin.vec3[0],h[13]-=t.localOrigin.vec3[1],h[14]-=t.localOrigin.vec3[2],r(y,h),o(y,y),f.write(h,y,t.geometry.attributes,t.geometry.olidColor,s.geometry,a.geometry,n.texture),null!=s.texture&&f.writeTextureBuffer&&f.writeTextureBuffer(h,y,t.geometry.attributes,s.texture,a.texture))}_setTargetSubData(t,e,r,o,s,a=0){if("geometry"===t){const n=e.getTargetBuffer(t);n?.setSubData(s,o.from*r,a,o.numElements*r)}else if("texture"===t){const r=e.getTargetBuffer(t);r?.setSubData(s.buffer,o.from,a,o.numElements)}}static prune(){x=new Uint8Array(_)}}const h=s(),y=s(),_=262144,B=1024,b=16777216;let x=new Uint8Array(_);function d(t){return x.byteLength<t&&(x=new Uint8Array(t)),x}function w(t){return 4*Math.ceil(t/4)}function C(e){return e<=B?B:e<_?t(e):Math.max(Math.min(Math.ceil(1.5*e/_)*_,b),e)}export{g as VaoWriter};
|
|
2
|
+
import{nextHighestPowerOfTwo as e}from"../../../../../core/mathUtils.js";import{copy as t,invert as r,transpose as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as n}from"../../../support/buffer/glUtil.js";import{assert as a}from"../../lib/Util.js";import{VertexArrayObject as i}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as f,getMaxByteSize as u}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{bufferRangePool as c}from"./BufferRange.js";import{DrawCommand as l}from"./DrawCommand.js";import{getIndexLayoutForMaxIndex as h,getIndexLayoutForDataType as g}from"./IndexLayout.js";import{BaseInstanceData as m}from"./PerBaseInstanceData.js";import{VertexBuffer as y}from"../../../../webgl/VertexBuffer.js";class d{constructor(e,t){this._rctx=t,this._vaoCacheValue=null,this._instanceVboCacheValue=null,this._textureBufferCacheValue=null,this._vboCacheValue=null;const r=e.createBufferWriter();this._bufferWriter=r;const s=["geometry"],o="textureBufferLayout"in r&&null!=r.textureBufferLayout;this.useTextureBuffer=o,o&&s.push("texture"),this.useIndexing=e.useIndexing,this.useIndexing&&s.push("index"),this.targetBuffers=s}get _vaoCache(){return this._vaoCacheValue??=this._rctx.getVaoCache(n(this._bufferWriter.layout)),this._vaoCacheValue}get _instanceVboCache(){return this._instanceVboCacheValue??=this._rctx.getVboCache(n(this._bufferWriter.layout,1)),this._instanceVboCacheValue}get _textureBufferCache(){return this.useTextureBuffer?(this._textureBufferCacheValue??=this._rctx.getTextureBufferCache(this._bufferWriter.textureBufferLayout),this._textureBufferCacheValue):null}get _vboCache(){return this._vboCacheValue??=this._rctx.getVboCache(n(this._bufferWriter.layout)),this._vboCacheValue}maxElements(e){if("texture"===e){const e=this._targetLayout("texture");return null==e?0:f(this._rctx,e)}const t=Math.floor(w/this._targetStrideBytes("geometry"));if("index"===e){const e=h(t-1).dataType;return Math.floor(w/this._targetStrideBytes("index",e))}return t}_targetStrideBytes(e,t){return this._targetLayout(e,t)?.stride??0}_targetLayout(e,t){return"geometry"===e?this._bufferWriter.layout:"baseInstance"===e?this._bufferWriter.baseInstanceLayout:"index"===e?g(t):this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(e,t,r,s){const o=this._targetStrideBytes("geometry"),n=t.reduce((e,{geometry:t})=>e+this.vertexElementCount(t),0),a=r.reduce((e,{geometry:t})=>e+this.vertexElementCount(t),0),i=Math.min((e+n-a)*o,w),f=s.vao?.buffer("geometry"),u=f?.sizeBytes??0;return i>B&&i<u/2?0:i>u?1:2}deleteBuffer(e){e.isInstanced?(e.instancedCommandVAOs?.dispose(),this._instanceVboCache.deleteVbo(e.vao?.mutableBuffer("geometry")),e.vao?.disposeVAOOnly()):this.useIndexing?(this._vboCache.deleteVbo(e.vao?.mutableBuffer("geometry")),this._rctx.indexBufferCache.deleteIndexBuffer(e.vao?.indexBuffer),e.vao?.disposeVAOOnly()):this._vaoCache.deleteVao(e.vao),this._textureBufferCache?.deleteTextureBuffer(e.textureBuffer),e.vao=null,e.textureBuffer=null,e.endElements.geometry=0,e.endElements.texture=0,e.endElements.index=0}createBaseInstanceData(e){const{_bufferWriter:t}=this;if(null==e||null==t.baseInstanceLayout||null==t.writeBaseInstance||null==t.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),s=t.elementCountBaseInstance(e.attributes),o=s*r.stride,a=new y(this._rctx,n(r));a.setSize(Math.ceil(o));const i=v(o),f=r.createView(i.buffer);t.writeBaseInstance(e.attributes,f),a.setSubData(i,0,0,o);const u=new l;return u.first=0,u.count=s,new m(e,a,u)}reallocateBuffer(e,t,r){if(this.deleteBuffer(t),null!=e){a(!this.useIndexing,"Instanced indexed rendering is not supported");const s=e.baseInstanceBuffer,o=r.geometry*this._targetStrideBytes("geometry"),n=this._instanceVboCache.newVbo(p(o));t.vao=new i(this._rctx,new Map([["baseInstance",s],["geometry",n]]))}else if(this.useIndexing){const e=r.geometry*this._targetStrideBytes("geometry"),s=this._vboCache.newVbo(p(e)),o=Math.floor(s.sizeBytes/this._bufferWriter.layout.stride)-1,n=h(o),a=r.index*n.stride,f=Math.ceil(p(a)/n.stride),u=this._rctx.indexBufferCache.newIndexBuffer(f,n.dataType);t.vao=new i(this._rctx,s,u)}else{const e=r.geometry*this._targetStrideBytes("geometry");t.vao=this._vaoCache.newVao(p(e))}const s=this._targetLayout("texture"),o=this._textureBufferCache;if(null!=s&&null!=o){const e=p(r.texture*s.stride),n=Math.ceil(e/s.stride);t.textureBuffer=o.newTextureBuffer(n)}t.endElements.geometry=Math.floor((t.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),t.endElements.texture=t.textureBuffer?.itemCount??0,t.endElements.index=t.vao?.indexBuffer?.size??0}elementCount(e,t){const{attributes:r}=e;return"geometry"===t?this._bufferWriter.elementCount(r):"baseInstance"===t?this._bufferWriter.elementCountBaseInstance?.(r)??0:"index"===t?e.drawIndices?.length??0:this._bufferWriter.elementCountTextureBuffer?.(r)??0}vertexElementCount(e){return this._bufferWriter.elementCount(e.attributes)}canGrow(e,t){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,e,t));return r.every(({canGrow:e})=>e)&&r.some(({needsToGrow:e})=>e)}_evaluateTargetBufferGrowth(e,t,r){const s=this._targetLayout(e,t.indexType),o=t.getTargetBuffer(e);if(null==s||null==o)return{needsToGrow:null!=s,canGrow:!0};return{needsToGrow:r[e]*s.stride>o.sizeBytes,canGrow:"geometry"===e||"index"===e?o.sizeBytes<p(w-B):o.sizeBytes<u(this._rctx,s)}}clearHoles(e,t){const{indexType:r}=t;for(const s of this.targetBuffers){const o=this._targetStrideBytes(s,r),n=e[s],a=n.reduce((e,t)=>Math.max(e,t.numElements),0)*o,i=v(a);i.fill(0,0,a);for(const e of n)this._setTargetSubData(s,t,o,e,i)}}clearHolesMetal(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={};let a=0;for(const u of o){const e=t[u].numElements*this._targetStrideBytes(u,s);n[u]=a,a+=V(e)}const i=v(a);i.fill(0,0,a);const f={};for(const u of o)f[u]=this._targetLayout(u,s)?.createView(i.buffer,n[u]);for(const u of e){const e=u.targetRanges.geometry;if(!(e.from>=t.geometry.from&&e.to<=t.geometry.to))continue;const r={};for(const s of o)r[s]=u.targetRanges[s].from-t[s].from;this._writeGeometry(u.geometry,f,r,u.targetRanges)}for(const u of o)this._setTargetSubData(u,r,this._targetStrideBytes(u,s),t[u],i,n[u])}writeRandomInstances(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={},i={},f={};let u=0;for(const g of o)n[g]=e[g]*this._targetStrideBytes(g,s),a[g]=u,i[g]=0,f[g]=c.acquire(0,0),u+=V(n[g]);const l=v(u),h={};for(const c of o)h[c]=this._targetLayout(c,s)?.createView(l.buffer,a[c]);for(const c of t){for(const e of o){const t=c.targetRanges[e],o=f[e];o.to===t.from||(o.numElements>0&&this._setTargetSubData(e,r,this._targetStrideBytes(e,s),f[e],l,a[e]),o.from=t.from,i[e]=0)}this._writeGeometry(c.geometry,h,i,c.targetRanges);for(const e of o){const t=c.targetRanges[e];i[e]+=t.numElements,f[e].to=t.to}}for(const g of o){const e=f[g];e.numElements>0&&this._setTargetSubData(g,r,this._targetStrideBytes(g,s),e,l,a[g]),c.release(f[g])}}writeInstanceRangeMetal(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={};let i=0;for(const c of o)n[c]=e[c].numElements*this._targetStrideBytes(c,s),a[c]=i,i+=V(n[c]);const f=v(i),u={};for(const c of o)u[c]=this._targetLayout(c,s)?.createView(f.buffer,a[c]);f.fill(0,0,i);for(const c of t){const t=c.targetRanges.geometry;if(!(t.from>=e.geometry.from&&t.to<=e.geometry.to))continue;const r={},s={};for(const n of o){const t=c.targetRanges[n];r[n]=t.from-e[n].from,s[n]=t}this._writeGeometry(c.geometry,u,r,s)}for(const c of o)e[c].numElements>0&&this._setTargetSubData(c,r,this._targetStrideBytes(c,s),e[c],f,a[c])}rebuildInstances(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={},i={};let f=0;for(const c of o)n[c]=e[c]*this._targetStrideBytes(c,s),a[c]=f,f+=V(n[c]),i[c]=0;const u=v(f),l={};for(const c of o)l[c]=this._targetLayout(c,s)?.createView(u.buffer,a[c]);for(const c of t){const e={},t={};for(const r of o){e[r]=i[r],i[r]+=this.elementCount(c.geometry.geometry,r);const s=c.targetRanges[r];s.from=e[r],s.to=i[r],t[r]=s}this._writeGeometry(c.geometry,l,e,t)}for(const h of o){const e=c.acquire(0,i[h]);this._setTargetSubData(h,r,this._targetStrideBytes(h,s),e,u,a[h]),c.release(e)}return i}updateInstance(e,t){const{indexType:r}=t,{targetBuffers:s}=this,o={},n={};let a=0;for(const c of s){const t=this._targetStrideBytes(c,r);o[c]=this.elementCount(e.geometry.geometry,c)*t,n[c]=a,a+=V(o[c])}const i=v(a),f={},u={};for(const c of s)u[c]=0,f[c]=this._targetLayout(c,r)?.createView(i.buffer,n[c]);this._writeGeometry(e.geometry,f,u,e.targetRanges);for(const c of s)this._setTargetSubData(c,t,this._targetStrideBytes(c,r),e.targetRanges[c],i,n[c])}updateInstancesMetal(e){const{targetBuffers:t}=this;for(const[r,s]of e){const e={};for(const r of t)e[r]=c.acquire(1/0,-1/0);for(const r of s)for(const s of t){const t=e[s],o=r.targetRanges[s];t.from=Math.min(t.from,o.from),t.to=Math.max(t.to,o.to)}this.writeInstanceRangeMetal(e,r.instances.values(),r);for(const r of t)c.release(e[r])}}_writeGeometry(e,o,n,i){const{_bufferWriter:f}=this;if(null!=f&&(t(x,e.transformation),x[12]-=e.localOrigin.vec3[0],x[13]-=e.localOrigin.vec3[1],x[14]-=e.localOrigin.vec3[2],r(_,x),s(_,_),f.write(x,_,e.geometry.attributes,e.geometry.olidColor,o.geometry,n.geometry,i.texture),null!=o.texture&&f.writeTextureBuffer&&f.writeTextureBuffer(x,_,e.geometry.attributes,o.texture,n.texture),this.useIndexing)){const t=e.geometry.drawIndices;a(null!=o.index,"Should have an indexed view when using indexing"),a(null!=t,"Material requires vertex indices"),this._writeIndexBuffer(i.geometry,o.index,n,t)}}_writeIndexBuffer(e,t,r,s){const o=e.from,n=t,a=r.index;for(let i=0;i<s.length;++i)n[a+i]=s[i]+o}_setTargetSubData(e,t,r,s,o,n=0){if("geometry"===e){const a=t.getTargetBuffer(e);a?.setSubData(o,s.from*r,n,n+s.numElements*r)}else if("texture"===e){const r=t.getTargetBuffer(e);r?.setSubData(o.buffer,s.from,n,s.numElements)}else if("index"===e){const a=t.getTargetBuffer(e);a?.setSubData(o,s.from*r,n,n+s.numElements*r)}}static prune(){C=new Uint8Array(B)}}const x=o(),_=o(),B=262144,b=1024,w=16777216;let C=new Uint8Array(B);function v(e){return C.byteLength<e&&(C=new Uint8Array(e)),C}function V(e){return 4*Math.ceil(e/4)}function p(t){return t<=b?b:t<B?e(t):Math.max(Math.min(Math.ceil(1.5*t/B)*B,w),t)}export{d as VaoWriter};
|
|
@@ -132,7 +132,7 @@ export default class SelectionManager extends EventedAccessor {
|
|
|
132
132
|
* @param layer - The selectable layer to which to add the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
133
133
|
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to add to the current selection.
|
|
134
134
|
*/
|
|
135
|
-
add(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
135
|
+
add(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
|
|
136
136
|
/**
|
|
137
137
|
* Adds features to the current selection. It does not replace the existing selection.
|
|
138
138
|
*
|
|
@@ -174,20 +174,20 @@ export default class SelectionManager extends EventedAccessor {
|
|
|
174
174
|
/**
|
|
175
175
|
* Removes the provided features from the current selection for the provided layer.
|
|
176
176
|
*
|
|
177
|
-
* @param
|
|
177
|
+
* @param layer - The selectable layer from which to remove the selection. This must be a layer with graphics in the [sources](#sources).
|
|
178
178
|
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) to remove from the current selection.
|
|
179
179
|
*/
|
|
180
|
-
remove(
|
|
180
|
+
remove(layer: GraphicsLayer, selection: Graphic[]): void;
|
|
181
181
|
/**
|
|
182
|
-
* @param
|
|
182
|
+
* @param layer - The selectable layer from which to remove the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
183
183
|
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to remove from the current selection.
|
|
184
184
|
*/
|
|
185
|
-
remove(
|
|
185
|
+
remove(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
|
|
186
186
|
/**
|
|
187
|
-
* @param
|
|
187
|
+
* @param layer - The selectable layer from which to remove the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
188
188
|
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to remove from the current selection.
|
|
189
189
|
*/
|
|
190
|
-
remove(
|
|
190
|
+
remove(layer: SelectableLayer, selection: SelectionIdentifier[]): void;
|
|
191
191
|
/**
|
|
192
192
|
* Replaces the current selection for the provided layer with the provided features.
|
|
193
193
|
*
|
|
@@ -199,7 +199,7 @@ export default class SelectionManager extends EventedAccessor {
|
|
|
199
199
|
* @param layer - The selectable layer for which to replace the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
200
200
|
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to set as the current selection.
|
|
201
201
|
*/
|
|
202
|
-
replace(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
202
|
+
replace(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
|
|
203
203
|
/**
|
|
204
204
|
* @param layer - The selectable layer for which to replace the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
205
205
|
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to set as the current selection.
|
|
@@ -233,7 +233,7 @@ export default class SelectionManager extends EventedAccessor {
|
|
|
233
233
|
* @param layer - The selectable layer for which to toggle the selection. This must be a layer with object IDs in the [sources](#sources).
|
|
234
234
|
* @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to toggle within the current selection.
|
|
235
235
|
*/
|
|
236
|
-
toggle(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
|
|
236
|
+
toggle(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
|
|
237
237
|
/**
|
|
238
238
|
* @param layer - The selectable layer for which to toggle the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
|
|
239
239
|
* @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to toggle within the current selection.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as a}from"../core/Evented.js";import{makeHandle as l}from"../core/handleUtils.js";import c from"../core/Logger.js";import{getOrCreateMapValue as h}from"../core/MapUtils.js";import{destroyMaybe as d}from"../core/maybe.js";import p from"../core/ReactiveMap.js";import{watch as u,initial as g,on as f}from"../core/reactiveUtils.js";import{addMany as m,symmetricDifference as y}from"../core/SetUtils.js";import{property as _,subclass as w}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../core/support/UpdatingHandles.js";import{getGraphicLayer as S}from"../graphic/graphicOriginUtils.js";import{isSubtypeSublayer as M,isSubtypeGroupLayer as E,isKnowledgeGraphLayer as b,isMapImageLayer as j}from"../layers/support/layerUtils.js";import H from"../rest/support/Query.js";import{isGraphic as L}from"../support/graphicInstanceUtils.js";import{isISelectableLayerWithObjectIds as V,isISelectableLayerViewWithObjectIds as U,isISelectableLayer as C,isISelectableLayerView as I,isTableLayer as F,isISelectableLayerViewWithHighlights as z,isISelectableLayerWithGraphics as O,isISelectableLayerBaseWithEditing as T}from"./support/selectionUtils.js";let A=class extends a{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new p,this._sources=new i,this._trashCan=[],this._updatingHandles=new v,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([u(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),u(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},g),f(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),d(this._layerEditHandles),d(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(c.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}add(e,t){const s=new Set;m(s,this._selectionMap.get(e)?.selection);for(const i of t)s.add(N(e,i));this._setSelection(e,Array.from(s))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{b(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):j(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):E(t)?t.sublayers?.forEach(s):C(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return c.getLogger(this).warn("Cannot query layer views without a view."),[];const r=n.map(async t=>{const{layer:n,selection:r}=t;if(r.length&&V(n)&&(!e||e.includes(n))){if(o&&"layerView"===i&&!n.isTable){const e=await this._findLayerView(n);if(U(e))return P(e,r,s)}return P(n,r,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,new Set(n.selection));let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=h(t,e,()=>new Set),n=N(e,s);null!=n&&(o.add(n),i=!0)}}for(const s of e.removed){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=t.get(e),n=N(e,s);n&&o&&(o.delete(n),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n),a=Array.from(r);void 0!==t&&i.push(t),e.set(n,{selection:a}),o.push({layer:n,selection:a,...s(void 0!==t?t.selection:[],a)})}this._onSelectionChange(o)}}setSelection(e,t){r(c.getLogger(this),"SelectionManager.setSelection is deprecated. Use SelectionManager.replace instead.",{replacement:"SelectionManager.replace",warnOnce:!0}),this.replace(e,t)}appendToSelection(e,t){r(c.getLogger(this),"SelectionManager.appendToSelection is deprecated. Use SelectionManager.add instead.",{replacement:"SelectionManager.add",warnOnce:!0}),this.add(e,t)}remove(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[],o=new Set(t.map(t=>N(e,t)));for(const n of s.selection)o.has(n)||i.push(n);this._setSelection(e,i)}replace(e,t){this._setSelection(e,t.map(t=>N(e,t)))}removeFromSelection(e,t){r(c.getLogger(this),"SelectionManager.removeFromSelection is deprecated. Use SelectionManager.remove instead.",{replacement:"SelectionManager.remove",warnOnce:!0}),this.remove(e,t)}toggle(e,t){const s=this._selectionMap.get(e),i=t.map(t=>N(e,t));if(!s||0===s.selection.length)return void this._setSelection(e,i);const o=new Set(s.selection),n=new Set(i),r=y(o,n);this._setSelection(e,Array.from(r))}toggleInSelection(e,t){r(c.getLogger(this),"SelectionManager.toggleInSelection is deprecated. Use SelectionManager.toggle instead.",{replacement:"SelectionManager.toggle",warnOnce:!0}),this.toggle(e,t)}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=M(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return I(i)?(this.layerViewMap.set(e,i),i.addHandles(l(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!F(n)){const e=await this._findLayerView(n);if(z(e)&&o===this._vizTaskId){const i=s.selection;s.highlightHandle=e.highlight(i,{name:t})}}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>M(e)?e.parent:e));for(const t of e)C(t)&&(O(t)?this._layerEditHandles.push(t.graphics.on("change",e=>this._onGraphicsLayerEdit(t,e))):T(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(t,e))))}_onLayerEdit(e,t){if(E(e))this._onParentLayerEdit(e,t);else if(t.deletedFeatures.length&&this._selectionMap.has(e)){const s=[];t.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.remove(e,s)}}_onGraphicsLayerEdit(e,t){const{removed:s}=t;s.length&&this._selectionMap.has(e)&&this.remove(e,s)}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=t;if(i?.updateFeatures?.forEach(t=>{const s=t.getObjectId()??t.attributes[e.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=e.findSublayerForFeature(t);if(!C(i))return;const n=e.sublayers.find(e=>!(!C(e)||!this.getSelection(e)?.includes(s)));C(n)&&n!==i&&(this.remove(n,[s]),this.add(i,[s]))}),s.length){const t=[];s.forEach(({error:e,objectId:s})=>{null!=s&&null==e&&t.push(s)}),e.sublayers.forEach(e=>{C(e)&&this._selectionMap.has(e)&&this.remove(e,t)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(!i||!k(i,{selection:t})){i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o=i?s(i.selection,t):{};this._onSelectionChange([{layer:e,selection:[...t],...o}])}}};e([_()],A.prototype,"_layerEditHandles",void 0),e([_()],A.prototype,"_selectionMap",void 0),e([_()],A.prototype,"_sources",void 0),e([_()],A.prototype,"_updatingHandles",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"count",null),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"hasSelection",null),e([_()],A.prototype,"highlightEnabled",void 0),e([_()],A.prototype,"highlightName",void 0),e([_()],A.prototype,"layerViewMap",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"selections",null),e([_()],A.prototype,"showHighlight",null),e([_()],A.prototype,"sources",null),e([_()],A.prototype,"updating",null),e([_()],A.prototype,"view",void 0),A=e([w("esri.views.SelectionManager")],A);const N=(e,t)=>{if(V(e)&&L(t)){const e=t.getObjectId();if(null!=e)return e}return t},k=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},P=async(e,t,s={})=>e.queryFeatures(new H({...s,objectIds:t})).then(t=>({data:t,layer:I(e)?e.layer:e})),q=A;export{q as default};
|
package/views/View.d.ts
CHANGED
|
@@ -318,11 +318,22 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
|
|
|
318
318
|
*/
|
|
319
319
|
accessor animationsEnabled: boolean;
|
|
320
320
|
/**
|
|
321
|
-
* The array of attribution items to be displayed in the view's attribution.
|
|
321
|
+
* The array of attribution items to be displayed in the view's attribution. This property is populated once the view has finished updating. Items are ordered based on descending [score](https://developers.arcgis.com/javascript/latest/references/core/views/support/AttributionItem/#score) with higher scored items appearing first in the attribution.
|
|
322
322
|
*
|
|
323
323
|
* 
|
|
324
324
|
*
|
|
325
325
|
* @since 5.0
|
|
326
|
+
* @example
|
|
327
|
+
* // Access the attributionItems property after the view is finished updating to get the array of attribution items to be displayed in the view's attribution
|
|
328
|
+
* reactiveUtils.when(
|
|
329
|
+
* () => !view.updating,
|
|
330
|
+
* () => {
|
|
331
|
+
* const attributionText = view.attributionItems
|
|
332
|
+
* .map((item) => item.text)
|
|
333
|
+
* .join(" | ");
|
|
334
|
+
* console.log(attributionText);
|
|
335
|
+
* }
|
|
336
|
+
* );
|
|
326
337
|
*/
|
|
327
338
|
get attributionItems(): ReadonlyArray<AttributionItem>;
|
|
328
339
|
/**
|
|
@@ -646,7 +657,7 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
|
|
|
646
657
|
*/
|
|
647
658
|
get resolution(): number;
|
|
648
659
|
/**
|
|
649
|
-
*
|
|
660
|
+
* The default [SelectionManager](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/) for this view. Used to manage selections of features across layers.
|
|
650
661
|
*
|
|
651
662
|
* @since 5.0
|
|
652
663
|
* @beta
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{pausable as c,when as d,watch as m,initial as u,sync as v}from"../../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import f from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{isPoint as S}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as E}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as w,toEllipticArc7 as O}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as k,isCircularArc as H,isEllipticArc4 as I,isBezierCurve as L,isCoordinate as V,isEllipticArc7 as P}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as j}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as U}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as F,cloneMove as D}from"./drawUtils.js";import z from"./GraphicMover.js";import K from"./HighlightHelper.js";import{addUniqueLayer as N,isConnectedReshapeSupportedLayer as W}from"./layerUtils.js";import{createTooltipInfos as q,connectTooltip as Z,updateTranslateTooltipInfo as $,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as X,createCurveControlPointGraphics as Y,createCurveConstructionLineGraphics as tt,attributeKeys as et,getMidpoint as it,controlPointKinds as st,saveUpdatedCurveOrCoordinate as ot,toolIdAttribute as rt,splitCurve as nt,isSingleSegmentCircle as at,isSingleSegmentEllipse as ht}from"./reshapeUtils.js";import{ViewEventPriorities as pt}from"../../input/InputManager.js";import{createCoordinateHelper as lt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as dt}from"../../interactive/editGeometry/EditGeometryOperations.js";import mt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as ut}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as yt}from"../../interactive/tooltip/tooltipCommonUtils.js";import{MeasurementWorkerHandle as _t}from"../../support/MeasurementWorkerHandle.js";const gt=Symbol(),ft={mode:"on-the-ground",offset:0};let bt=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._updatingHandles=new g,this._measurementWorker=new _t({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new mt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new K({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=c(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(Ht));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(Ht(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},v),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=q(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;N(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),pt.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Z(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),m(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??lt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:t,activeTooltipInfo:e,graphic:i}=this;return{sketchOptions:t,activeTooltipInfo:e,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=dt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new ut({editGeometryOperations:i,elevationInfo:ft,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new j(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(gt)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=Gt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=Q(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=X(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=Y(t,this.symbols,this._coordinateHelper),i=tt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await e.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:ft,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[et.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new z({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new U({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Lt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,Vt(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=Gt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=F(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(et.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(k(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=it(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=kt(s);null!=t&&null!=e&&s.getAttribute(et.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=kt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(H(r)||I(r)){const i=k(t[e][o-1]),n=H(r)?w(i,r):R(i,r),[a,h]=E(n,.25);s.geometry=new f({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(L(r)){const t=s.getAttribute(et.controlPointKind),[e,i]=t===st.bezier.cp1?r.b[1]:r.b[2];s.geometry=new f({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(et.controlPointKind),[o,r]=kt(s),n=t[o],a=k(n[r-1]),h=k(n[r]),p=t[o][r];i===st.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=kt(t);s===e&&o>=i&&t.setAttribute(et.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(et.pathIndex)!==e)continue;const t=o.getAttribute(et.pointIndexStart);t>=i&&(o.setAttribute(et.pointIndexStart,t+1),o.setAttribute(et.pointIndexEnd,o.getAttribute(et.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=kt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&S(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new f(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new f(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new f(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry.clone();if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=kt(t);let p=xt(r);const l=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,l,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,l),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),ot(r,p)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=kt(s);Ot(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=kt(n),h=n.getAttribute(et.relatedGraphicIndices),p=D(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=kt(e);Ot(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?Ct(e,i,s,[o[0],o[1]],t.getAttribute(et.controlPointKind)):(Ot(e,i,s,o,r),n&&(0===s?Ot(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(gt),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[et.pathIndex]:r,[et.pointIndexStart]:n,[et.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[et.tool]:rt,[et.pathIndex]:r,[et.pointIndex]:p,[et.relatedGraphicIndices]:[]};const l=xt(s),c=l[r][a];if(V(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=k(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(et.controlPointKind,st.circle.interior),e.setAttribute(et.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),ot(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=k(l[r][n]),e=nt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:k(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=It(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&yt(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=xt(o);const n=[],a=It(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=k(s[o]);if(t===a&&e===h){n.push({coordinates:k(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!V(t)&&(r[i][o]=k(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=k(t[0]),[s,o]=k(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);ot(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),gt)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,$(i,o,this._tooltipsContext,this._updatingHandles,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,this._updatingHandles,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function Gt(t){const e=xt(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!V(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function xt(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Mt(t,e,i,s){const o=t[e][i];if(H(o))o.c[1]=s;else if(I(o)){const o=k(t[e][i]);t[e][i]={c:[o,s]}}}function Ct(t,e,i,s,o){switch(o){case st.circle.interior:Mt(t,e,i,s);break;case st.bezier.cp1:t[e][i].b[1]=s;break;case st.bezier.cp2:t[e][i].b[2]=s}}function St(t,e){return t<1e-8*e}function Et(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const u=a?o>r:o<r,[v,y]=s?[e,i]:u?[-i,e]:[i,-e],[_,g]=[d,m],[f,b]=[v,y],G=_*b-g*f,x=(d**2+m**2)/2;if(St(Math.abs(G),x))return[(h+l)/2,(p+c)/2];const[M,C]=[b/G*x,-f/G*x],S=M**2+C**2,[E,w]=[d/2-M,m/2-C];if(St(E**2+w**2,S)){const[t,e]=u?[-C,M]:[C,-M];return[t+M+h,e+C+p]}const O=Math.sqrt((M**2+C**2)/(E**2+w**2))*Math.sign(d*v+m*y);return[E*O+M+h,w*O+C+p]}function wt(t,e,i){const s=G(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return P(r)?r:O(t,r)}function Ot(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(at(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(ht(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=T(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=k(r);if(V(r))r.splice(0,r.length,...s);else if(L(r))r.b[0].splice(0,r.b[0].length,...s);else if(H(r)||I(r)){const o=k(t[e][i-1]),n=H(r)?w(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],Et(o,n,s,!0)]})}else if(P(r)){r.a[0].splice(0,r.a[0].length,...s);const n=k(t[e][i-1]);r.a=wt(n,r,o).a}if(n&&!V(n)&&!L(r))if(H(n)||I(n)){const o=k(n),r=H(n)?w(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,Et(o,r,s,!1)]})}else if(P(n)){const t=k(r);n.a=wt(t,n,o).a}}function kt({attributes:t}){return[t?.[et.pathIndex]||0,t?.[et.pointIndex]||0]}function Ht({attributes:t}){return`${t?.[et.pathIndex]}-${t?.[et.pointIndex]}`}function It(t){return t instanceof e?[t]:[...t]}function Lt(t){const e=t.sourceLayer??t.layer;return W(e)?{graphic:t,layer:e}:null}function Vt(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[et.pathIndex],vertexIndex:t[et.pointIndex]}))}t([y()],bt.prototype,"_activeOperationInfo",void 0),t([y()],bt.prototype,"_connectedReshapeManager",void 0),t([y()],bt.prototype,"_coordinateHelper",null),t([y()],bt.prototype,"_editGeometryOperations",void 0),t([y()],bt.prototype,"_segmentLabels",void 0),t([y()],bt.prototype,"test",null),t([y()],bt.prototype,"_segmentLabelsImportTask",void 0),t([y()],bt.prototype,"_updatingHandles",void 0),t([y()],bt.prototype,"_selectedManipulator",null),t([y()],bt.prototype,"_tooltipsContext",null),t([y()],bt.prototype,"callbacks",void 0),t([y()],bt.prototype,"connectedReshapeProviders",void 0),t([y()],bt.prototype,"enableMidpoints",void 0),t([y()],bt.prototype,"enableCurveOnMidpoint",void 0),t([y()],bt.prototype,"enableMovement",void 0),t([y()],bt.prototype,"enableVertices",void 0),t([y()],bt.prototype,"graphic",void 0),t([y()],bt.prototype,"highlightName",void 0),t([y()],bt.prototype,"highlightsEnabled",void 0),t([y()],bt.prototype,"layer",void 0),t([y()],bt.prototype,"snappingManager",void 0),t([y({readOnly:!0})],bt.prototype,"state",null),t([y()],bt.prototype,"symbols",void 0),t([y()],bt.prototype,"tooltip",void 0),t([y()],bt.prototype,"tooltipInfos",void 0),t([y()],bt.prototype,"activeTooltipInfo",void 0),t([y()],bt.prototype,"updating",null),t([y({type:mt})],bt.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],bt.prototype,"type",void 0),t([y({readOnly:!0})],bt.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],bt.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],bt.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],bt.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],bt.prototype,"selectedManipulators",void 0),t([y()],bt.prototype,"view",void 0),bt=t([_("esri.views.draw.support.Reshape")],bt);const Pt=bt;export{Pt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{pausable as c,when as d,watch as m,initial as v,sync as u}from"../../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import f from"../../../geometry/Point.js";import G from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as b,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{isPoint as S}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as E}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as w,toEllipticArc7 as I}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as V,getEndpoint as H,isCircularArc as O,isEllipticArc4 as k,isBezierCurve as L,isCoordinate as P,cloneCurve as T,isEllipticArc7 as R}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as A}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as j}from"../../../geometry/support/curves/mathUtils.js";import U from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as F}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as D}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as K,cloneMove as z}from"./drawUtils.js";import N from"./GraphicMover.js";import W from"./HighlightHelper.js";import{addUniqueLayer as $,isConnectedReshapeSupportedLayer as q}from"./layerUtils.js";import{createTooltipInfos as X,connectTooltip as Y,updateTranslateTooltipInfo as Z,updateTranslateVertexTooltipInfo as B}from"./reshapeTooltipUtils.js";import{defaultSymbols as J,createMidpointGraphics as Q,createVertexGraphics as ee,createCurveControlPointGraphics as te,createCurveConstructionLineGraphics as ie,attributeKeys as se,getMidpoint as oe,controlPointKinds as re,fastCloneGeometry as ne,saveUpdatedCurveOrCoordinate as ae,toolIdAttribute as he,splitCurve as pe,isSingleSegmentCircle as le,isSingleSegmentEllipse as ce}from"./reshapeUtils.js";import{ViewEventPriorities as de}from"../../input/InputManager.js";import{createCoordinateHelper as me}from"../../interactive/coordinateHelper.js";import{sketchKeys as ve}from"../../interactive/keybindings.js";import{EditGeometryOperations as ue}from"../../interactive/editGeometry/EditGeometryOperations.js";import ye from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as _e}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as ge,enterInputModeIfAvailable as fe}from"../../interactive/tooltip/tooltipCommonUtils.js";import{MeasurementWorkerHandle as Ge}from"../../support/MeasurementWorkerHandle.js";const be=Symbol(),xe={mode:"on-the-ground",offset:0};let Me=class extends r{constructor(e){super(e),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new g,this._measurementWorker=new Ge({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=J,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new ye,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new W({view:e}),this._setup(),this._updateHandlesOnExternalGeometryChange=c(()=>this.graphic?.geometry,e=>{if(!e||!0===this._primaryGraphicMoving)return;const t=new Set(this.selectedManipulators.map(Le));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(e=>t.has(Le(e))).forEach(e=>this._addToSelection(e)),this.curveControlPointGraphics.filter(e=>t.has(Le(e))).forEach(e=>this._addToSelection(e));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},u),this.tooltip=ge(()=>({view:e,options:this.sketchOptions.tooltips})),this.tooltipInfos=X(this.sketchOptions),this.addHandles([d(()=>e?.ready,()=>{const{layer:e,view:t}=this;$(t,e),this.addHandles(t.on("key-down",e=>this._keyDownHandler(e),de.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[m(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],m(()=>this.layer,(e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),Y(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),m(()=>this.sketchOptions.labels.enabled,e=>{this._segmentLabels?this._segmentLabels.visible=e:this._setUpGeometryHelper()}),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),v),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??me(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:e,activeTooltipInfo:t,graphic:i}=this;return{sketchOptions:e,activeTooltipInfo:t,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(e,t,i,s,o)=>{this._setUpGeometryHelper();const r=e===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(e);const n=!0;if(this._syncGeometryAfterVertexMove(e,t,s,o,n),r){const{view:e}=this,s=e.toScreen(i),o=e.toScreen(t),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(e),this._emitReshapeStopEvent(e)}}}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}isUIGraphic(e){return e===this.graphic||this._isMidpoint(e)||this._isCurveControlPoint(e)||this._isVertex(e)||this._isConstructionLine(e)}refresh(e){if(this._reset(),this._setup(),e){for(const t of this.vertexGraphics)e.has(Le(t))&&this._addToSelection(t);for(const t of this.curveControlPointGraphics)e.has(Le(t))&&this._addToSelection(t)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:e}=this;e.length&&this._removeVertices(e)}_setup(){const{graphic:e,layer:t}=this;if(!t||null==e?.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(e):this._editGeometryOperations=ue.fromGeometry(e,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new U({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new _e({editGeometryOperations:i,elevationInfo:xe,pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new F(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(be)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._removeCurveGraphics(e),this._updateTooltip()}_removeMidpointGraphics(e=this.layer){const{midpointGraphics:t}=this;e?.removeMany(t.items),t.drain(h)}_removeVertexGraphics(e=this.layer){const{vertexGraphics:t}=this;this._relatedGraphicIndex=null,e?.removeMany(t.items),t.drain(h)}_removeCurveGraphics(e=this.layer){const{curveControlPointGraphics:t,constructionLineGraphics:i}=this;e?.removeMany(t.items),e?.removeMany(i.items),t.drain(h),i.drain(h)}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type||"multipoint"===e.type)){const t=Ce(e);this.enableMidpoints&&"multipoint"!==e.type&&this._setUpMidpointGraphics(t),this.enableVertices&&(this._setUpVertexGraphics(t),this._setupCurveGraphics(t))}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=Q(e,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const t=ee(e,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=t.graphicIndex,this.vertexGraphics.addMany(t.graphics),this.layer.addMany(t.graphics)}else{const t=ee(e,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}}_setupCurveGraphics(e){this._removeCurveGraphics();const t=te(e,this.symbols,this._coordinateHelper),i=ie(e,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(t),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(t)}async _setupSegmentLabels(){const e=this._editGeometryOperations,t=this.sketchOptions.labels.enabled;if(e&&this._segmentLabels?.context?.editGeometryOperations===e&&t||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&e&&t){const t=this._segmentLabelsImportTask??=i(async e=>{const t=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(t);return e.aborted?null:i}),s=await t.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:e,elevationInfo:xe,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const e=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",e),hover:this.symbols.vertices.hover?.clone().set("color",e)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",e),hover:this.symbols.controlPoints.hover?.clone().set("color",e)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",e)};for(const t of this.vertexGraphics)this._isSelected(t)?t.symbol=this.symbols.vertices.selected:this._hoverGraphic===t?t.symbol=this.symbols.vertices.hover:t.symbol=this.symbols.vertices.default;for(const t of this.curveControlPointGraphics)this._isSelected(t)?t.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===t?t.symbol=this.symbols.controlPoints.hover:t.symbol=this.symbols.controlPoints.default;for(const t of this.constructionLineGraphics)t.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map(({geometry:e})=>({x:e.x,y:e.y}));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes[se.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();e&&"multipoint"!==t.geometry?.type&&r.push(t),this._mover=new N({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:e}=this;null!=e&&0!==e.length&&(this._connectedReshapeManager=new D({providerFactories:e,view:this.view}))}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic,i=this._isCurveControlPoint(t);if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick?.(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(e);this.refresh(),s.length&&this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t)||i){if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)return void(i||this._removeVertices(t));e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e,o=this._connectedReshapeManager,r=o?Te(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(e),this._emitMoveStartEvent(t,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,t,i,e,()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const t=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(e);i.length&&(this._emitVertexAddEvent([s],t,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(e),r){const e=n.filter(e=>this._isVertex(e));o?.startVertexMove(r,Re(e))}this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,e,()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:t,dyMap:o}=K(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const e=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const t of e){if("point"===t.geometry?.type){const{pathIndex:e,pointIndex:i}=t.attributes,s=V(n)[e][i];if(s){const e=H(s);t.geometry=this._coordinateHelper.arrayToPoint(e)}}this._addToSelection(t.clone())}}}else{const e=Ce(n);this._updateVertexGraphicLocations(e)}this._connectedReshapeManager?.translate(t,o,0),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!t)return;const{dx:i,dy:s,graphic:o}=e,{operationType:r}=t;if(t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._effectiveFilterVerticesEnabled&&"move"===r){const e=new Set;for(const t of this.selectedManipulators)e.add(Le(t));return this.refresh(e),void this._updateTooltip()}if(this._isMidpoint(o)||o.getAttribute(se.curveFromStraightEdgeFlag))return this.refresh(),void this._connectedReshapeManager?.finish();this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null}_updateVertexGraphicLocations(e){const{_coordinateHelper:t}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=t.arrayToPoint(H(e[s][o]))}this._updateMidpointGraphicLocations(e),this._updateCurveGraphicLocations(e)}_updateMidpointGraphicLocations(e,t){const{_coordinateHelper:i}=this;if(t)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!t.has(o))continue;const a=t.get(o);if(!a.has(r)&&!a.has(n))continue;const h=e[o];s.geometry=new f(oe(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:t,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=e[t];s.geometry=new f(oe(n[o],n[r],i))}}_updateCurveGraphicLocations(e){const{spatialReference:t}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[e,t]=ke(s);null!=e&&null!=t&&s.getAttribute(se.controlPointKind)&&a(i,e,()=>new Set)?.add(t)}for(const s of this.curveControlPointGraphics){const[t,o]=ke(s);if(i.get(t)?.has(o))continue;const r=e[t][o];if(O(r)||k(r)){const i=H(e[t][o-1]),n=O(r)?w(i,r):A(i,r),[a,h]=E(n,.25);s.geometry=new f({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(L(r)){const e=s.getAttribute(se.controlPointKind),[t,i]=e===re.bezier.cp1?r.b[1]:r.b[2];s.geometry=new f({x:t,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(se.controlPointKind),[o,r]=ke(s),n=e[o],a=H(n[r-1]),h=H(n[r]),p=e[o][r];i===re.bezier.line1?s.geometry=new G({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:t}):s.geometry=new G({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:t})}}_refreshGraphicIndicesAttributes(e){const{componentIndex:t,vertexIndex:i}=e,s=e=>{const[s,o]=ke(e);s===t&&o>=i&&e.setAttribute(se.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(se.pathIndex)!==t)continue;const e=o.getAttribute(se.pointIndexStart);e>=i&&(o.setAttribute(se.pointIndexStart,e+1),o.setAttribute(se.pointIndexEnd,o.getAttribute(se.pointIndexEnd)+1))}}_getVertexFromEditGeometry(e){const[t,i]=ke(e);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[t].vertices[i]}_onHandleMove(e,t,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,h="graphic-move-stop"===o.type;if(a&&S(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new f(this._stagedVertex),t,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(e,new f(this._stagedVertex),t,s,h),r())})}else{const i=null!=this._stagedVertex?new f(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,h),r()}else r()}_syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=ne(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(t),h=this._getVertexFromEditGeometry(e);let p=null;if(h){const e=n.getZ(a);p=[h.pos[0],h.pos[1]];const t=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=e?e-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],t,i,s),this._connectedReshapeManager?.translate(t,i,s)}if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t);else{if(e!==this.graphic){p&&!this._isVertex(e)&&(p=null);const o=n.spatialReference,[a,h]=ke(e);let l=Se(r);const c=n.pointToArray(t);if(this._updateGeometryFromGraphic(e,l,a,h,c,o,"polygon"===r.type),this._isVertex(e)||this._isCurveControlPoint(e)){const t=new Map;t.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,e,c,t,p),l=this._moveSelectedHandleCoordinates(l,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,t),this._updateCurveGraphicLocations(l)}else this._isMidpoint(e)&&this._updateCurveGraphicLocations(l);ae(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_syncEditGeometryOperations(e){const t=this._editGeometryOperations?.trySetGeometry(e);t||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(e,t,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Oe(e,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=t.geometry.x,n.coordinate[1]=t.geometry.y,n.graphic.geometry=t.geometry,this._relatedGraphicIndex.insert(n));return e}const{relatedGraphicIndices:r}=t.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return e;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=ke(o);s&&a(s,r,()=>new Set).add(p),Oe(e,r,p,i,n),o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==t){const[t,a]=ke(n),h=n.getAttribute(se.relatedGraphicIndices),p=z(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,e,t,a,l,r,o),h?.length)for(const i of h){const t=this.vertexGraphics.at(i),[s,o]=ke(t);Oe(e,s,o,l,r),t.geometry=p}}return e}_updateGeometryFromGraphic(e,t,i,s,o,r,n){const a=t[i].length-1;this._isCurveControlPoint(e)?we(t,i,s,[o[0],o[1]],e.getAttribute(se.controlPointKind)):(Oe(t,i,s,o,r),n&&(0===s?Oe(t,i,a,o,r):s===a&&(t[i][0]=o)))}_onGraphicPointerOverCallback(e){const t=e.graphic;this._hoverGraphic=t;const i=this._isVertex(t);i&&!this._isSelected(t)?t.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._hoverGraphic=null,this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this._isCurveControlPoint(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.controlPoints.default),this.removeHandles(be),this._updateTooltip()}_handleMidpointClickOrStartMove(e){const{graphic:t}=e,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=ne(i),o=[],{[se.pathIndex]:r,[se.pointIndexStart]:n,[se.pointIndexEnd]:a}=t.attributes,h=C(t.geometry),p=0===a?n+1:a;t.attributes={[se.tool]:he,[se.pathIndex]:r,[se.pointIndex]:p,[se.relatedGraphicIndices]:[]};const l=Se(s),c=l[r][a];if(P(c)){if(this.enableCurveOnMidpoint&&e.viewEvent.native.shiftKey){const e=H(l[r][p]);l[r].splice(p,1,{c:[e,[h[0],h[1]]]}),t.setAttribute(se.controlPointKind,re.circle.interior),t.setAttribute(se.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(t),this.curveControlPointGraphics.push(t),ae(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const e=H(l[r][n]),t=pe(e,c,.5,this._coordinateHelper);l[r].splice(a,1,...t),o.push({coordinates:H(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(e){const t=Pe(e);for(const i of t)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(t)}_removeFromSelection(e,t){if(this._isVertex(e)){const{vertices:i}=this.symbols;e.symbol=t?i.hover:i.default}else if(this._isCurveControlPoint(e)){const{controlPoints:i}=this.symbols;e.symbol=t?i.hover:i.default}this.selectedManipulators.remove(e),this._emitDeselectEvent([e]),this._updateTooltip()}_clearSelection(){const e=this.selectedManipulators.toArray(),{controlPoints:t,vertices:i}=this.symbols;if(e.length>0){for(const s of e)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=t.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(e),this._updateTooltip()}}_keyDownHandler(e){null==this._activeOperationInfo&&fe(e,this.tooltip)||ve.delete.includes(e.key)&&!e.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),e.stopPropagation())}_removeVertices(e){const t=this.graphic.geometry,i=this.vertexGraphics.length;if(null==t||"polygon"!==t.type&&"polyline"!==t.type&&"multipoint"!==t.type)return;if("polygon"===t.type&&i<4||"multipoint"===t.type&&i<2||"polyline"===t.type&&i<3)return;const s=this.graphic.clone(),o=ne(t);let r=Se(o);const n=[],a=Pe(e);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:e,y:t}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=H(s[o]);if(e===a&&t===h){n.push({coordinates:H(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const e=r[i][o];e&&!P(e)&&(r[i][o]=H(e))}}}}if("polygon"===o.type)r=r.filter(e=>{if(e.length<2)return!1;const[t,i]=H(e[0]),[s,o]=H(e[e.length-1]);return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);ae(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isCurveControlPoint(e){return this.curveControlPointGraphics.includes(e)}_isConstructionLine(e){return this.constructionLineGraphics.includes(e)}_isSelected(e){return(this._isVertex(e)||this.curveControlPointGraphics.includes(e))&&this.selectedManipulators.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){const t=this._isMidpoint(e)?"copy":"move";this.addHandles(this.view.acquireCursor(t,"high"),be)}_updateTooltip(e,t){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:e===this.graphic?(i=r.translateGraphic,Z(i,o,this._tooltipsContext,this._updatingHandles,t)):e&&this.selectedManipulators.length>1&&(i=r.translateVertices,B(i,o,n,this._tooltipsContext,this._updatingHandles,t)),this.activeTooltipInfo=i}_updateGraphicGeometry(e){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=e,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(e,t){const i={type:"move-start",mover:this.graphic,dx:e,dy:t};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(e,t){const i={type:"move",mover:this.graphic,dx:e,dy:t};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(e,t){if(null==e||null==t){const i=this._activeOperationInfo;if(!i)return;e=i.totalDx,t=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:e,dy:t};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(e){const t={type:"reshape-start",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",t),this.callbacks.onReshapeStart?.(t)}_emitReshapeEvent(e){const t={type:"reshape",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape",t),this.callbacks.onReshape?.(t)}_emitReshapeStopEvent(e){const t={type:"reshape-stop",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",t),this.callbacks.onReshapeStop?.(t)}_emitSelectEvent(e){const t={type:"vertex-select",added:e};this.emit("select",t),this.callbacks.onVertexSelect?.(t)}_emitDeselectEvent(e){const t={type:"vertex-deselect",removed:e};this.emit("deselect",t),this.callbacks.onVertexDeselect?.(t)}_emitVertexAddEvent(e,t,i){const s={type:"vertex-add",added:e,graphic:this.graphic,oldGraphic:t,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(e,t,i){const s={type:"vertex-remove",removed:e,graphic:this.graphic,oldGraphic:t,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function Ce(e){let t=Se(e);t=t.map(e=>e.slice());for(const i of t)for(let e=0;e<i.length;e++)i[e]=T(i[e]);if("polygon"===e.type)for(const i of t){const e=i[i.length-1];if(!P(e))continue;const t=i[0];t[0]===e[0]&&t[1]===e[1]&&i.length>2&&i.pop()}return t}function Se(e){return"polygon"===e.type?e.curveRings?.slice()??e.rings.slice():"polyline"===e.type?e.curvePaths?.slice()??e.paths.slice():e.points.map(e=>[e])}function Ee(e,t,i,s){const o=e[t][i];if(O(o))o.c[1]=s;else if(k(o)){const o=H(e[t][i]);e[t][i]={c:[o,s]}}}function we(e,t,i,s,o){switch(o){case re.circle.interior:Ee(e,t,i,s);break;case re.bezier.cp1:e[t][i].b[1]=s;break;case re.bezier.cp2:e[t][i].b[2]=s}}function Ie(e,t){return e<1e-8*t}function Ve(e,{cx:t,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=e,[l,c]=n,d=l-h,m=c-p;t-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[t,i]:v?[-i,t]:[i,-t],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(Ie(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,C]=[G/b*x,-f/b*x],S=M**2+C**2,[E,w]=[d/2-M,m/2-C];if(Ie(E**2+w**2,S)){const[e,t]=v?[-C,M]:[C,-M];return[e+M+h,t+C+p]}const I=Math.sqrt((M**2+C**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+C+p]}function He(e,t,i){const s=b(new G({curvePaths:[[e,t]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return R(r)?r:I(e,r)}function Oe(e,t,i,s,o){const r=e[t][i],n=e[t].at(i+1);if(le(e,t)){const i=e[t][1];return e[t][0]=[...s],void(e[t][1]={a:[[...s],[...i.a[1]],0,0]})}if(ce(e,t)){const i=e[t][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=j(l,p);return e[t][0]=[...s],void(e[t][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=H(r);if(P(r))r.splice(0,r.length,...s);else if(L(r))r.b[0].splice(0,r.b[0].length,...s);else if(O(r)||k(r)){const o=H(e[t][i-1]),n=O(r)?w(o,r):A(o,r);e[t].splice(i,1,{c:[[...s],Ve(o,n,s,!0)]})}else if(R(r)){r.a[0].splice(0,r.a[0].length,...s);const n=H(e[t][i-1]);r.a=He(n,r,o).a}if(n&&!P(n)&&!L(r))if(O(n)||k(n)){const o=H(n),r=O(n)?w(a,n):A(a,n);e[t].splice(i+1,1,{c:[o,Ve(o,r,s,!1)]})}else if(R(n)){const e=H(r);n.a=He(e,n,o).a}}function ke({attributes:e}){return[e?.[se.pathIndex]||0,e?.[se.pointIndex]||0]}function Le({attributes:e}){return`${e?.[se.pathIndex]}-${e?.[se.pointIndex]}-${e?.[se.controlPointKind]??"vertex"}`}function Pe(e){return e instanceof t?[e]:[...e]}function Te(e){const t=e.sourceLayer??e.layer;return q(t)?{graphic:e,layer:t}:null}function Re(e){return e.toArray().map(({attributes:e})=>({pathIndex:e[se.pathIndex],vertexIndex:e[se.pointIndex]}))}e([y()],Me.prototype,"_activeOperationInfo",void 0),e([y()],Me.prototype,"_connectedReshapeManager",void 0),e([y()],Me.prototype,"_coordinateHelper",null),e([y()],Me.prototype,"_editGeometryOperations",void 0),e([y()],Me.prototype,"_effectiveFilterVerticesEnabled",null),e([y()],Me.prototype,"_primaryGraphicMoving",void 0),e([y()],Me.prototype,"_segmentLabels",void 0),e([y()],Me.prototype,"test",null),e([y()],Me.prototype,"_segmentLabelsImportTask",void 0),e([y()],Me.prototype,"_updatingHandles",void 0),e([y()],Me.prototype,"_selectedManipulator",null),e([y()],Me.prototype,"_tooltipsContext",null),e([y()],Me.prototype,"callbacks",void 0),e([y()],Me.prototype,"connectedReshapeProviders",void 0),e([y()],Me.prototype,"enableMidpoints",void 0),e([y()],Me.prototype,"enableCurveOnMidpoint",void 0),e([y()],Me.prototype,"enableMovement",void 0),e([y()],Me.prototype,"enableVertices",void 0),e([y()],Me.prototype,"filterVerticesEnabled",void 0),e([y()],Me.prototype,"graphic",void 0),e([y()],Me.prototype,"highlightName",void 0),e([y()],Me.prototype,"highlightsEnabled",void 0),e([y()],Me.prototype,"layer",void 0),e([y()],Me.prototype,"snappingManager",void 0),e([y({readOnly:!0})],Me.prototype,"state",null),e([y()],Me.prototype,"symbols",void 0),e([y()],Me.prototype,"tooltip",void 0),e([y()],Me.prototype,"tooltipInfos",void 0),e([y()],Me.prototype,"activeTooltipInfo",void 0),e([y()],Me.prototype,"updating",null),e([y({type:ye})],Me.prototype,"sketchOptions",void 0),e([y({readOnly:!0})],Me.prototype,"type",void 0),e([y({readOnly:!0})],Me.prototype,"vertexGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"curveControlPointGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"constructionLineGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"midpointGraphics",void 0),e([y({readOnly:!0})],Me.prototype,"selectedManipulators",void 0),e([y()],Me.prototype,"view",void 0),Me=e([_("esri.views.draw.support.Reshape")],Me);const Ae=Me;export{Ae as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../Graphic.js";import{equals as t}from"../../../core/arrayUtils.js";import o from"../../../geometry/Point.js";import
|
|
2
|
+
import e from"../../../Graphic.js";import{equals as t}from"../../../core/arrayUtils.js";import{r as o}from"../../../chunks/rbush.js";import r from"../../../geometry/Multipoint.js";import n from"../../../geometry/Point.js";import i from"../../../geometry/Polygon.js";import s from"../../../geometry/Polyline.js";import{extentContainsCoords2D as c}from"../../../geometry/support/contains.js";import{getMidpoint as l}from"../../../geometry/support/coordsUtils.js";import{isMultipoint as a,isPolygon as p,isPolyline as m}from"../../../geometry/support/typeUtils.js";import{interpolateBezierCurve as u,splitBezierCurve as d}from"../../../geometry/support/curves/bezierCurveUtils.js";import{interpolateCircle as h}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as f,splitCircularArc as y}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as g,isCoordinate as x,isBezierCurve as v,isEllipticArc4 as b,isCircularArc as w,cloneCurve as z,isEllipticArc as I,isEllipticArc7 as R}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as j,splitEllipticArc4 as P}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{deriveEllipse as S,interpolateEllipse as C,splitEllipticArc7 as M}from"../../../geometry/support/curves/ellipticArc7Utils.js";import Z from"../../../symbols/SimpleLineSymbol.js";import U from"../../../symbols/SimpleMarkerSymbol.js";import{settings as k}from"./settings.js";const T={pathIndex:"pathIndex",pointIndex:"pointIndex",pointIndexStart:"pointIndexStart",pointIndexEnd:"pointIndexEnd",controlPointKind:"kind",relatedGraphicIndices:"relatedGraphicIndices",curveFromStraightEdgeFlag:"curveFromStraightEdgeFlag",tool:"esriSketchTool"},E={bezier:{cp1:"bezier-cp-1",cp2:"bezier-cp-2",line1:"bezier-line-1",line2:"bezier-line-2"},circle:{interior:"circle-interior"}},K="box",A=k.reshapeGraphics,F={vertices:{default:new U({style:"circle",size:A.vertex.size,color:A.vertex.color,outline:{color:A.vertex.outlineColor,width:1}}),hover:new U({style:"circle",size:A.vertex.hoverSize,color:A.vertex.hoverColor,outline:{color:A.vertex.hoverOutlineColor,width:1}}),selected:new U({style:"circle",size:A.selected.size,color:A.selected.color,outline:{color:A.selected.outlineColor,width:1}})},controlPoints:{default:new U({style:"diamond",size:A.vertex.size,color:A.vertex.color,outline:{color:A.vertex.outlineColor,width:1}}),hover:new U({style:"diamond",size:A.vertex.hoverSize,color:A.vertex.hoverColor,outline:{color:A.vertex.hoverOutlineColor,width:1}}),selected:new U({style:"diamond",size:A.selected.size,color:A.selected.color,outline:{color:A.selected.outlineColor,width:1}})},midpoints:{default:new U({style:"circle",size:A.midpoint.size,color:A.midpoint.color,outline:{color:A.midpoint.outlineColor,width:1}}),hover:new U({style:"circle",size:A.midpoint.size,color:A.midpoint.color,outline:{color:A.midpoint.outlineColor,width:1}})},constructionLines:new Z({style:"solid",width:1,color:A.vertex.color})};function G(t,r,n,i,s){const l=[],a=[];for(let e=0;e<t.length;e++){const o=t[e];for(let t=0;t<o.length;t++){const r=g(o[t]);i&&!c(i,r)||a.push({coordinate:r,pathIndex:e,pointIndex:t})}}let p=null;i&&(p=o(a.length,e=>({minX:e.coordinate[0],minY:e.coordinate[1],maxX:e.coordinate[0],maxY:e.coordinate[1]})),p.load(a));let m=null;const u=s*s;for(const o of a){if(m&&s>0){const e=m[0]-o.coordinate[0],t=m[1]-o.coordinate[1];if(e*e+t*t<u)continue}m=o.coordinate,o.graphic=new e({geometry:n.arrayToPoint(o.coordinate),symbol:r?.vertices?.default,attributes:{[T.tool]:K,[T.pathIndex]:o.pathIndex,[T.pointIndex]:o.pointIndex}}),l.push(o.graphic)}return{graphics:l,graphicIndex:p}}function L(t,o,r){const n=[];for(let i=0;i<t.length;i++){const s=t[i];if(!V(t,i))for(let t=1;t<s.length;t++){const c=s[t];if(x(c))continue;const l=g(s[t-1]),a={[T.tool]:K,[T.pathIndex]:i,[T.pointIndex]:t};if(v(c)){const t=c.b.slice(1);n.push(...t.map((t,n)=>new e({geometry:r.arrayToPoint(t),symbol:o?.controlPoints?.default,attributes:{...a,[T.controlPointKind]:0===n?E.bezier.cp1:E.bezier.cp2}})))}const p=w(c),m=b(c);if(p||m){const t=p?f(l,c):j(l,c),i=h(t,.25);n.push(new e({geometry:r.arrayToPoint(i),symbol:o?.controlPoints?.default,attributes:{...a,[T.controlPointKind]:E.circle.interior}}))}}}return n}function X(t,o,r){const n=[],{spatialReference:i}=r;for(let c=0;c<t.length;c++){const r=t[c];for(let t=1;t<r.length;t++){const l=r[t];if(!v(l))continue;const[a,p,m]=l.b,u=g(r[t-1]),d={[T.tool]:K,[T.pathIndex]:c,[T.pointIndex]:t};n.push(new e({geometry:new s({paths:[[[u[0],u[1]],p]],spatialReference:i}),symbol:o?.constructionLines,attributes:{...d,[T.controlPointKind]:E.bezier.line1}}),new e({geometry:new s({paths:[[[a[0],a[1]],m]],spatialReference:i}),symbol:o?.constructionLines,attributes:{...d,[T.controlPointKind]:E.bezier.line2}}))}}return n}function Y(t,o,r,i,s,l){const a=[],p=[];for(let e=0;e<t.length;e++){const o=t[e],n=B(t,e);for(let t=0;t<o.length;t++){const s=(t+1)%o.length;if((!i||n)&&0===s)continue;const c=O(o[t],o[s],r);p.push({geometry:c,partIndex:e,fromIndex:t,toIndex:s})}}let m=null;const u=l*l;for(const d of p)if(!s||c(s,r.pointToArray(d.geometry))){if(m&&l>0){const e=m.x-d.geometry.x,t=m.y-d.geometry.y;if(e*e+t*t<u)continue}m=d.geometry,a.push(new e({geometry:new n(d.geometry),symbol:o.midpoints.default,attributes:{[T.tool]:K,[T.pathIndex]:d.partIndex,[T.pointIndexStart]:d.fromIndex,[T.pointIndexEnd]:d.toIndex}}))}return a}function O(e,t,o){const r=g(e),n=g(t),{spatialReference:i}=o,s=o.arrayToVector(r),c=o.arrayToVector(n),a=o.toXYZ(s),p=o.toXYZ(c),[m,d,y]=l(a,p),z=o.hasM()?0:void 0;if(x(t))return{x:m,y:d,z:y,m:z,spatialReference:i};if(v(t)){const[e,o]=u(r,t,.5);return{x:e,y:o,z:y,m:z,spatialReference:i}}if(w(t)){const e=f(r,t),[o,n]=h(e,.5);return{x:o,y:n,z:y,m:z,spatialReference:i}}if(b(t)){const e=j(r,t),[o,n]=h(e,.5);return{x:o,y:n,z:y,m:z,spatialReference:i}}const I=S(r,t),[R,P]=C(I,.5);return{x:R,y:P,z:y,m:z,spatialReference:i}}function V(e,o){const r=e.at(o);return 2===r?.length&&t(g(r[1]),g(r[0]))&&b(r[1])}function q(e,o){const r=e.at(o);return 2===r?.length&&t(g(r[1]),g(r[0]))&&R(r[1])}function B(e,o){const r=e.at(o);return 2===r?.length&&t(g(r[1]),g(r[0]))&&I(r[1])}function D(e){if(void 0===e)return e;switch(e.type){case"mesh":case"point":return e.clone();case"polygon":return new i({rings:e.rings.map(e=>e.map(e=>e.slice())),spatialReference:e.spatialReference,...e.curveRings?{curveRings:e.curveRings.map(e=>e.map(e=>z(e)))}:{},hasZ:e.hasZ,hasM:e.hasM});case"polyline":return new s({paths:e.paths.map(e=>e.map(e=>e.slice())),spatialReference:e.spatialReference,hasZ:e.hasZ,...e.curvePaths?{curvePaths:e.curvePaths.map(e=>e.map(e=>z(e)))}:{},hasM:e.hasM});case"multipoint":return new r({points:e.points.map(e=>e.slice()),spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM})}}function H(e,t){if(a(e))return void(e.points=t.flat());const o=t.some(e=>e.some(e=>!x(e)));p(e)?o?(e.curveRings=t,e.rings=[]):(e.rings=t,e.curveRings=void 0):m(e)&&(o?(e.curvePaths=t,e.paths=[]):(e.curvePaths=void 0,e.paths=t))}function J(e,t,o,r){const n=g(t);let i=[];switch(!0){case v(t):i=d(e,t,o);break;case w(t):{const r=f(e,t);i=y(r,t,o);break}case b(t):{const r=j(e,t);i=P(r,t,o);break}default:{const r=S(e,t);i=M(r,t,o);break}}if(i.length<2)return i;if(r.hasZ()){const t=e.at(2)??0,r=n.at(2)??0,s=t+(r-t)*o;g(i[0])[2]=s,g(i[1])[2]=r}if(r.hasM()){const e=r.hasZ()?3:2;g(i[0])[e]=0,g(i[1])[e]=n.at(-1)??0}return i}export{T as attributeKeys,E as controlPointKinds,X as createCurveConstructionLineGraphics,L as createCurveControlPointGraphics,Y as createMidpointGraphics,G as createVertexGraphics,F as defaultSymbols,D as fastCloneGeometry,O as getMidpoint,V as isSingleSegmentCircle,q as isSingleSegmentEllipse,B as isSingleSegmentPolygon,H as saveUpdatedCurveOrCoordinate,J as splitCurve,K as toolIdAttribute};
|
|
@@ -9,7 +9,7 @@ import type { Angle, Area, Length, ScalarQuantity } from "../../../core/quantity
|
|
|
9
9
|
import type { ReactiveWatchExpression } from "../../../core/reactiveUtils.js";
|
|
10
10
|
import type { ScreenPoint } from "../../../core/types.js";
|
|
11
11
|
import type { AreaUnit, LengthUnit } from "../../../core/units.js";
|
|
12
|
-
import type { GeometryUnion } from "../../../geometry/types.js";
|
|
12
|
+
import type { CurveType, GeometryUnion } from "../../../geometry/types.js";
|
|
13
13
|
import type { BezierCurve, CircularArc, Curve, EllipticArc4, EllipticArc7 } from "../../../portal/jsonTypes.js";
|
|
14
14
|
import type { SymbolUnion } from "../../../symbols/types.js";
|
|
15
15
|
import type { MapViewOrSceneView } from "../../MapViewOrSceneView.js";
|
|
@@ -50,6 +50,13 @@ export interface PluginConfiguration {
|
|
|
50
50
|
* @internal
|
|
51
51
|
*/
|
|
52
52
|
geometryType: "multipoint" | "point" | "polyline" | "polygon";
|
|
53
|
+
/**
|
|
54
|
+
* Indicates the types of curves the plugin is capable of contributing to the
|
|
55
|
+
* shared geometry, if any.
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
curveTypes?: CurveType[];
|
|
53
60
|
/**
|
|
54
61
|
* If true, the plugin will be hidden from UI components that list available plugins.
|
|
55
62
|
* The plugin will be treated as an internal implementation detail of the parent plugin.
|