@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230323
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/LineOfSightAnalysisObserver.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
- package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a27951dbe83c63f9d01a.js → 26bc91a9d9d7345a3eba.js} +1 -1
- package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
- package/assets/esri/core/workers/chunks/{a09cc8e2ff43fe4afa04.js → 375628de4cfc71cb41c1.js} +1 -1
- package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
- package/assets/esri/core/workers/chunks/4cb62855bb1ae608bfde.js +1 -0
- package/assets/esri/core/workers/chunks/4f0c2b6b200bf8222fd7.js +1 -0
- package/assets/esri/core/workers/chunks/5252f3cc244204edc299.js +1 -0
- package/assets/esri/core/workers/chunks/6f952a6464cf9e62dbac.js +1098 -0
- package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
- package/assets/esri/core/workers/chunks/{d6ec7682de8fad9718e9.js → 77dccfaf1f9e778973b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
- package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
- package/assets/esri/core/workers/chunks/9bac27976e7a71268b7b.js +1 -0
- package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{81a6f4b43e047c3395c0.js → aebc5091bd4159197ce0.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
- package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
- package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
- package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
- package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
- package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
- package/assets/esri/core/workers/chunks/f6e7948075b3742b4ef9.js +1 -0
- package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
- package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_en.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_en.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +4 -4
- package/chunks/vec42.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/core/analysisThemeUtils.js +1 -1
- package/core/maybe.js +1 -1
- package/geometry/support/buffer/math/vec4.js +1 -1
- package/interfaces.d.ts +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/LineOfSightLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/RefreshableLayer.js +1 -1
- package/layers/support/SceneFilter.js +1 -1
- package/layers/support/SceneModifications.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItemResource.js +1 -1
- package/portal/support/resourceUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/settings.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/Slice/images/Factory.js +1 -1
- package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
- package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
- package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
- package/views/3d/analysis/Slice/settings.js +5 -0
- package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/i3s/PointGraphic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/PatchGeometry.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +5 -0
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/colorUtils.js +1 -1
- package/views/webgl/ShaderTranspiler.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
- package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
- package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
- package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
- package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
- package/assets/esri/core/workers/chunks/87edeb09a948122fa030.js +0 -1
- package/assets/esri/core/workers/chunks/92951b85676df776961f.js +0 -1100
- package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
- package/assets/esri/core/workers/chunks/ad5c61daaed286c74982.js +0 -1
- package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
- package/assets/esri/core/workers/chunks/ef2d3e84cd58df5f80af.js +0 -1
- package/assets/esri/core/workers/chunks/fec5e55e0fbf1710e22d.js +0 -1
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
- package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t
|
|
5
|
+
import{generateStyledTexture as t}from"./generateTextures.js";import o from"./heading-rotate-svg.js";import r from"./tilt-rotate-svg.js";import{Texture as e}from"../../../webgl-engine/lib/Texture.js";const a=64;function n(r,n){const{accentColor:l,contrastColor:c,preMultiplyAlpha:i}=n;return r.fromData(`heading-rotate:[accent:${l},contrast:${c},size:${a}]`,(()=>new e(t(o,{accentColor:l,contrastColor:c,size:a}),{mipmap:!0,preMultiplyAlpha:i})))}function l(o,n){const{accentColor:l,contrastColor:c,preMultiplyAlpha:i}=n;return o.fromData(`tilt-rotate:[accent:${l},contrast:${c},size:${a}]`,(()=>new e(t(r,{accentColor:l,contrastColor:c,size:a}),{mipmap:!0,preMultiplyAlpha:i})))}export{n as getRotateHeadingTexture,l as getTiltRotateTexture};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
const t="theme-style";function e(t,e){return a(r(n(o(t),e)),e.size)}function n(e,{accentColor:n,contrastColor:o}){const r=n.toHex(),a=n.a,s=o.toHex(),i=o.a,c=e.getElementsByTagNameNS("http://www.w3.org/2000/svg","style").namedItem(t);return c&&(c.innerHTML=`\n .contrast-fill { fill: ${s}; fill-opacity: ${i}; }\n .contrast-stroke { stroke: ${s}; stroke-opacity: ${i}; }\n .accent-fill { fill: ${r}; fill-opacity: ${a}; }\n .accent-stroke { stroke: ${r}; stroke-opacity: ${a}; }`),e}function o(t){const e=t.split(",")[1],n=atob(e);return(new DOMParser).parseFromString(n,"image/svg+xml")}function r(t){const e=(new XMLSerializer).serializeToString(t);return`data:image/svg+xml;base64,${btoa(e)}`}function a(t,e){const n=new Image(e,e);return n.src=t,n}export{e as generateStyledTexture};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const I="data:image/svg+xml;base64,
|
|
5
|
+
const I="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxwYXRoIGQ9Ik0yOCAwYTI4IDI4IDAgMSAxIDAgNTYgMjggMjggMCAwIDEgMC01NnoiIGNsYXNzPSJhY2NlbnQtZmlsbCIvPjxwYXRoIHN0cm9rZS13aWR0aD0iNC45OSIgZD0iTTIwLjA1IDQwLjg2YTE1LjA1IDE1LjA1IDAgMCAwIDE3LjE0LTEuNSAxNS4wNSAxNS4wNSAwIDAgMCA0LjQ3LTE2LjY1IDE1LjA1IDE1LjA1IDAgMCAwLTIyLjcyLTcuMTUgMTUuMDUgMTUuMDUgMCAwIDAtNS41IDcuMTUiIGNsYXNzPSJjb250cmFzdC1zdHJva2UiLz48cGF0aCBkPSJtMTAuOTcgMzUuNTcgNS4zOCAxMi4wNyA3Ljc5LTEzLjQ3LTEzLjE3IDEuNHoiIGNsYXNzPSJjb250cmFzdC1maWxsIi8+PC9zdmc+";export{I as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
const I="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxjaXJjbGUgY3g9IjM5LjQ3OCIgY3k9IjMuMDc4IiByPSIyOCIgY2xhc3M9ImFjY2VudC1maWxsIiB0cmFuc2Zvcm09InJvdGF0ZSg0MC41NDIpIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSI1IiBkPSJtNy4wNzQgMzAuMDUzIDI5LjM5NyAxMS45ODUtMy42NzMtMzMuNDkzIiBjbGFzcz0iY29udHJhc3Qtc3Ryb2tlIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSIyLjk5NiIgZD0iTTI0LjUwNCAyMy4yMDdhMTEuOTgyIDExLjk4MiAwIDAgMC05LjggNy41MDciIGNsYXNzPSJjb250cmFzdC1zdHJva2UgY29udHJhc3QtZmlsbCIvPjxwYXRoIGQ9Im0yOS44MTggMjIuODA4LTYuMTg0IDQuNi0uNTQxLTguMzY0eiIgY2xhc3M9ImNvbnRyYXN0LWZpbGwiLz48L3N2Zz4=";export{I as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import o from"../../../../Color.js";import{getAccentColor as s,getOpaqueAccentColor as t,getTransparentAccentColor as r,getOpaqueContrastColor as c}from"../../../../core/analysisThemeUtils.js";class i{constructor(){this.color=s()}}class l{constructor(){this.color=new o([0,0,0,.04]),this.gridColor=s(.5),this.outlineColor=s(.7)}}class n{constructor(){this.color=t()}}class e{constructor(){this.color=r(),this.contrastColor=c()}}class a{constructor(){this.color=c(),this.outlineColor=t()}}class h{constructor(){this.callouts=new i,this.plane=new l,this.resizeManipulators=new n,this.rotateManipulators=new e,this.shiftManipulator=new a}}let u=new h;function w(){u=new h}export{w as reloadSettings,u as settings};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{deg2rad as o}from"../../../../core/mathUtils.js";
|
|
5
|
+
import has from"../../../../core/has.js";import{deg2rad as o}from"../../../../core/mathUtils.js";const t=has("mac")?"Meta":"Control",r="Shift",s=2,a=1.15,c=1.15,m=2500,h=.02,e=Math.cos(o(45)),i=Math.cos(o(5)),f=.95,p=.3,M=2,j=1,l=3,n=11,x=22.5,C=40,S=48,U=2.25,b=4,d=1,g=.3,k=6,q=4,u=1600,v=.4;export{s as DISPLAY_FOCUS_MULTIPLIER,h as INITIAL_DEPTH_OFFSET_FRAC,v as INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION,u as PLANE_MIN_BASIS_SCREEN_LEN2,j as PLANE_OUTLINE_WIDTH,M as PLANE_PREVIEW_OUTLINE_WIDTH,m as POINTER_MOVE_TIMER_MS,f as PREVIEW_FADE_DOT_THRESHOLD,p as PREVIEW_FADE_DURATION_SECONDS,k as RESIZE_HANDLE_CORNER_INPUT_RADIUS,b as RESIZE_HANDLE_CORNER_WIDTH,q as RESIZE_HANDLE_EDGE_INPUT_RADIUS,g as RESIZE_HANDLE_EDGE_PADDING_FRAC,d as RESIZE_HANDLE_EDGE_WIDTH,S as SHIFT_RESTART_ARROW_LENGTH,U as SHIFT_RESTART_ARROW_OUTLINE_WIDTH,C as SHIFT_RESTART_OFFSET_DISTANCE,c as SHIFT_RESTART_TIP_FOCUS_MULTIPLIER,x as SHIFT_RESTART_TIP_LENGTH,n as SHIFT_RESTART_TIP_RADIUS,a as SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER,l as SHIFT_RESTART_TUBE_RADIUS,i as SMALL_ANGLE_DOT_THRESHOLD,e as VERTICAL_DOT_THRESHOLD,t as forceHorizontalModifier,r as forceVerticalModifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../geometry.js";import e from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{rad2deg as n,deg2rad as i}from"../../../../core/mathUtils.js";import{castRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import{q as r,b as s,k as a,m as c,r as l,i as u,w as d,F as m}from"../../../../chunks/mat4.js";import{c as g}from"../../../../chunks/mat4f64.js";import{r as p}from"../../../../chunks/quat.js";import{g as f,c as b,e as h,f as T,n as w,a as O,l as E,b as I,s as R,p as j,w as A}from"../../../../chunks/vec3.js";import{a as L,c as _,f as C}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as N}from"../../../../geometry/projection.js";import{Axis as P}from"../../../../geometry/support/Axis.js";import{r as M,f as v,i as U,a as V,n as y,u as S}from"../../../../chunks/boundedPlane.js";import{fromVectorsAndPoint as k,fromPositionAndNormal as H}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{angleAroundAxis as F}from"../../../../geometry/support/vector.js";import{sv3d as G,sm4d as D,sq4d as X}from"../../../../geometry/support/vectorStacks.js";import{VERTICAL_DOT_THRESHOLD as Y,SMALL_ANGLE_DOT_THRESHOLD as Z,PLANE_MIN_BASIS_SCREEN_LEN2 as W,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as q,SHIFT_RESTART_OFFSET_DISTANCE as B,RESIZE_HANDLE_EDGE_PADDING_FRAC as z,SHIFT_RESTART_CALLOUT_COLOR as $,SHIFT_RESTART_TIP_RADIUS as J,PLANE_OUTLINE_COLOR as K,PLANE_OUTLINE_WIDTH as Q,PLANE_BACKGROUND_COLOR as ee,GRID_COLOR as te,RESIZE_HANDLE_CORNER_INPUT_RADIUS as ne,RESIZE_HANDLE_EDGE_INPUT_RADIUS as ie,SHIFT_RESTART_ARROW_TIP_COLOR as oe,SHIFT_RESTART_ARROW_CAP_COLOR as re,SHIFT_RESTART_TUBE_COLOR as se,SHIFT_RESTART_OUTLINE_COLOR as ae,SHIFT_RESTART_TIP_LENGTH as ce,SHIFT_RESTART_ARROW_LENGTH as le,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as ue,RESIZE_HANDLE_CORNER_WIDTH as de,RESIZE_HANDLE_EDGE_WIDTH as me,DISPLAY_FOCUS_MULTIPLIER as ge,SHIFT_RESTART_TUBE_RADIUS as pe,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as fe,RESIZE_HANDLE_COLOR as be,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as he}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as Te}from"../support/projectionUtils.js";import{Manipulator3D as we}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as Oe,createRotateManipulator as Ee,worldScaledManipulatorSettings as Ie}from"../../interactive/manipulatorUtils.js";import{RenderObject as Re}from"../../interactive/RenderObject.js";import{LineVisualElement as je}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as Ae}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as Le}from"../../support/RenderCoordsHelper.js";import{fromRender as _e}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as Ce}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as Ne,createConeGeometry as Pe,createPathExtrusionGeometry as Me}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ve}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as Ue}from"../../webgl-engine/materials/ColorMaterial.js";import{NativeLineMaterial as Ve}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as ye}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as Se,ManipulatorStateFlags as ke}from"../../../interactive/interfaces.js";import He from"../../../../geometry/Extent.js";function xe(e,t,n,i,o,r,s,a){return Fe(t,s.worldUpAtPosition(e,G.get()),o,r,a.basis1,a.basis2),f(a.basis1,a.basis1,n),f(a.basis2,a.basis2,i),b(a.origin,e),k(a.basis2,a.basis1,a.origin,a.plane),a}function Fe(e,t,n,i,o,r){const s=h(e,t),a=G.get(),c=G.get();switch(i===Et.HORIZONTAL_OR_VERTICAL?Math.abs(s)>Y?Et.HORIZONTAL:Et.VERTICAL:i){case Et.VERTICAL:{const i=Math.abs(s)<=Z?e:n.viewUp;T(a,i,t),b(c,t);break}case Et.HORIZONTAL:T(a,n.viewUp,t),T(c,t,a);break;case Et.TILTED:{const i=Math.abs(s)<=Z?t:n.viewUp;T(a,i,e),T(c,e,a);break}}const l=T(G.get(),a,c);h(l,n.viewForward)>0&&f(c,c,-1),w(o,a),w(r,c)}function Ge(e,t,n){const i=t.worldUpAtPosition(e.origin,G.get()),o=e.basis1,r=pt(e,i),s=Math.round(r/jt)*jt;return M(e,s-r,o,n)}function De(e,t,n,i,o,r){const s=b(G.get(),o.origin);O(s,s,f(G.get(),o.basis1,e.direction[0]<0?1:-1)),O(s,s,f(G.get(),o.basis2,e.direction[1]<0?1:-1));const a=E(o.basis1),c=E(o.basis2),l=I(G.get(),n,s),u=I(G.get(),t,s);let d=0,m=0;if(it(e)){const t=nt(o),n=nt(r);d=a-.5*e.direction[0]*h(o.basis1,u)/a,m=c-.5*e.direction[1]*h(o.basis2,u)/c;const i=n/t;d*=i,m*=i}const g=d+.5*e.direction[0]*h(o.basis1,l)/a,p=m+.5*e.direction[1]*h(o.basis2,l)/c,T=f(G.get(),o.basis1,g/a),w=f(G.get(),o.basis2,p/c);(g<=0||et(r.origin,T,i)<=W)&&b(T,r.basis1),(p<=0||et(r.origin,w,i)<=W)&&b(w,r.basis2);const R=b(G.get(),s);return O(R,R,f(G.get(),T,e.direction[0]<0?-1:1)),O(R,R,f(G.get(),w,e.direction[1]<0?-1:1)),v(R,T,w,r)}function Xe(e,t){return q*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Ye(e,t,n,i){const o=T(G.get(),t,n);return T(o,o,t),H(e,o,i)}function Ze(e,t){return Oe(e.basis1,e.basis2,e.origin,t)}function We(e,t,n,i){const o=t.worldUpAtPosition(e.origin,G.get()),r=G.get();switch(n){case Ot.HEADING:b(r,o);break;case Ot.TILT:b(r,e.basis1)}return H(e.origin,r,i)}function qe(e,t,n,i){const s=Qe(n,Ke.NEGATIVE_X),a=D.get();r(a,t,s.edge*Math.PI/2);const c=w(G.get(),s.basis);let l=f(G.get(),c,s.direction*i.computeScreenPixelSizeAt(s.position)*B);O(l,l,s.position);const u=i.projectToRenderScreen(l,o(G.get())),d=Be(i,u);_e(i,u,Rt),w(Rt.direction,Rt.direction);const m=G.get();!d&&U(n,Rt,m)&&(l=m),a[12]=0,a[13]=0,a[14]=0,e.modelTransform=a,e.renderLocation=L(l),d?e.state|=It:e.state&=~It}function Be(e,t){const[n,i,o,r]=e.viewport,s=Math.min(o,r)/16;let a=!0;return t[0]<n+s?(t[0]=n+s,a=!1):t[0]>n+o-s&&(t[0]=n+o-s,a=!1),t[1]<i+s?(t[1]=i+s,a=!1):t[1]>i+r-s&&(t[1]=i+r-s,a=!1),a}function ze(e,t,n,i){const o=E(i.basis1),r=E(i.basis2),l=tt(i),u=nt(i),d=R(G.get(),0,0,0);O(d,f(G.get(),i.basis1,t.direction[0]),f(G.get(),i.basis2,t.direction[1])),O(d,i.origin,d);let m=0,g=1;if(it(t))1===t.direction[0]&&-1===t.direction[1]?m=jt:1===t.direction[0]&&1===t.direction[1]?m=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(m=3*Math.PI/2),g=u;else{const e=0!==t.direction[0]?1:2;m=1===e?jt:0,g=(1===e?r:o)-l}const p=s(D.get(),m);a(p,p,R(G.get(),g,g,g)),c(p,n,p),p[12]=0,p[13]=0,p[14]=0,e.modelTransform=p,e.renderLocation=d}function $e(e,t,n,i){const o=i.worldUpAtPosition(n.origin,G.get()),r=Qe(n,Ke.POSITIVE_X),a=s(D.get(),r.edge*Math.PI/2);l(a,a,-pt(n,o)),c(a,t,a),a[12]=0,a[13]=0,a[14]=0,e.modelTransform=a,e.renderLocation=r.position}function Je(e,t,n){const i=Qe(n,Ke.POSITIVE_Y),o=s(D.get(),i.edge*Math.PI/2);l(o,o,jt),c(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=i.position}var Ke;function Qe(e,t){switch(t){case Ke.POSITIVE_X:return{basis:e.basis1,direction:1,position:O(G.get(),e.origin,e.basis1),edge:t};case Ke.POSITIVE_Y:return{basis:e.basis2,direction:1,position:O(G.get(),e.origin,e.basis2),edge:t};case Ke.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:I(G.get(),e.origin,e.basis1),edge:t};case Ke.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:I(G.get(),e.origin,e.basis2),edge:t}}}function et(e,t,n){const i=n.projectToRenderScreen(O(G.get(),e,t),o(G.get())),r=n.projectToRenderScreen(I(G.get(),e,t),o(G.get()));return j(I(i,i,r))}function tt(e){const t=E(e.basis1),n=E(e.basis2);return z*Math.min(t,n)}function nt(e){return tt(e)}function it(e){return 0!==e.direction[0]&&0!==e.direction[1]}function ot(e,t=_t.CENTER_ON_ARROW){const n=t===_t.CENTER_ON_CALLOUT?B:0,i=[C(n,0,-le/2),C(n,0,le/2)],o=dt(i,!0),r=(e,t)=>lt(i,e,t),s=r(0,!1),a=r(ue,!0),c=new Ve({color:$,renderOccluded:ve.OccludeAndTransparent}),l=Ne(c,[[n,0,0],[n-B,0,0]]),u=Ne(c,[[n,0,0],[n-B,0,0]]);return new we({view:e,renderObjects:[...s.normal.map((e=>new Re(e,ke.Unfocused|wt))),...a.normal.map((e=>new Re(e,ke.Unfocused|wt))),new Re(l,ke.Unfocused|wt|It),...s.focused.map((e=>new Re(e,ke.Focused|wt))),...a.focused.map((e=>new Re(e,ke.Focused|wt))),new Re(u,ke.Focused|wt|It)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[o]},collisionPriority:1,radius:J,state:wt})}function rt(e,t){const n=Ee(e,{customStateMask:wt,texture:t});return n.state=wt,n}function st(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new je({view:e,attached:!1,color:K,width:Q,writeDepthEnabled:!1,renderOccluded:ve.OccludeAndTransparent,geometry:[t]})}function at(e){return new Ae({view:e,attached:!1,backgroundColor:[...ee],gridColor:te,gridWidth:4,renderOccluded:ve.OccludeAndTransparent})}function ct(e,t){const n=it(t),i=n?[C(1,0,0),C(0,0,0),C(0,1,0)]:[C(1,0,0),C(-1,0,0)],o=be,r=e=>new ye({color:o,width:e,renderOccluded:ve.OccludeAndTransparent}),s=()=>new Ve({color:o,renderOccluded:ve.OccludeAndTransparent}),a=n?de:me,c=a*ge,l=me,u=e=>e>1?r(e):s(),d=[new Re(Ne(u(a),i),ke.Unfocused|At),new Re(Ne(u(c),i),ke.Focused|At),new Re(Ne(u(l),i),Lt)],m=new we({view:e,renderObjects:d,collisionType:{type:"line",paths:[i]},radius:n?ne:ie,...Ie});return m.state=At,m}function lt(e,t,n){const i=new Ue({color:oe,cullFace:Ce.Back,renderOccluded:ve.Opaque}),o=new Ue({color:re,cullFace:Ce.Back,renderOccluded:ve.Opaque}),r=new Ue({color:se,cullFace:Ce.Back,renderOccluded:ve.Opaque}),s=new Ue({color:ae,transparent:!0,writeDepth:!1,cullFace:Ce.Front,renderOccluded:ve.Transparent}),l=l=>{const b=e.slice(0),h=I(G.get(),b[0],b[1]);w(h,h);const T=I(G.get(),b[b.length-1],b[b.length-2]);if(w(T,T),t>0){const e=f(_(),T,-t);b[b.length-1]=O(e,e,b[b.length-1]);const n=f(_(),h,-t);b[0]=O(n,n,b[0])}const E=l?he:1,j=ce*E,A=J*E,L=u(D.get());if(t>0){const e=j/4,n=R(G.get(),0,e,0),i=1+t/e;d(L,L,n),a(L,L,R(G.get(),i,i,i)),d(L,L,f(n,n,-1/i))}const N=u(g()),P=C(0,1,0),M=m(g(),p(X.get(),P,T));M[12]=b[b.length-1][0],M[13]=b[b.length-1][1],M[14]=b[b.length-1][2],c(M,M,L);const v=ut(pe*(l?fe:1)+t,b,n?s:r);v.transformation=N;const U=[v],V=Pe(n?s:i,j,A,24,!1,!1,!0);V.transformation=M,U.push(V);const y=Pe(n?s:o,j,A,24,!1,!0,!1);y.transformation=M,U.push(y);const S=m(g(),p(X.get(),P,h));return S[12]=b[0][0],S[13]=b[0][1],S[14]=b[0][2],c(S,S,L),U.push(V.instantiate({transformation:S})),U.push(y.instantiate({transformation:S})),U};return{normal:l(!1),focused:l(!0)}}function ut(e,t,n){const i=[],o=12;for(let r=0;r<o;r++){const t=r/o*2*Math.PI;i.push([Math.cos(t)*e,Math.sin(t)*e])}return Me(n,i,t,[],[],!1)}function dt(e,t){const n=I(_(),e[e.length-1],e[e.length-2]);if(w(n,n),f(n,n,ce),O(n,n,e[e.length-1]),t){const t=I(_(),e[0],e[1]);return w(t,t),f(t,t,ce),O(t,t,e[0]),[t,...e,n]}return[...e,n]}function mt(t,i,o,r=new e){if(null==t)return null;const{renderCoordsHelper:s}=i,a=s.fromRenderCoords(t.origin,i.spatialReference);if(null==a)return null;const c=N(a,o);if(null==c)return null;r.position=c;const l=2*E(t.basis1),u=2*E(t.basis2),d=Le.renderUnitScaleFactor(i.spatialReference,o);r.width=l*d,r.height=u*d;const m=s.worldUpAtPosition(t.origin,G.get());return r.tilt=n(pt(t,m)),r.heading=s.headingAtPosition(t.origin,t.basis1)-90,r}function gt(e,t,n){if(null==e)return null;const i=e.origin,o=G.get(),r=G.get(),s=G.get(),a=G.get();let c,l,u,d,m,g;O(o,i,e.basis1),O(o,o,e.basis2),O(r,i,e.basis1),A(r,r,e.basis2),A(s,i,e.basis1),A(s,s,e.basis2),A(a,i,e.basis1),O(a,a,e.basis2);for(const p of[o,r,s,a]){const e=t.fromRenderCoords(p,p,n);if(null==e)return null;c=null==c?e[0]:Math.min(c,e[0]),l=null==l?e[0]:Math.max(l,e[0]),u=null==u?e[1]:Math.min(u,e[1]),d=null==d?e[1]:Math.max(d,e[1]),m=null==m?e[2]:Math.min(m,e[2]),g=null==g?e[2]:Math.max(g,e[2])}return new He({xmin:c,xmax:l,ymin:u,ymax:d,zmin:m,zmax:g,spatialReference:n})}function pt(e,t){return F(t,e.basis2,e.basis1)+jt}function ft(e,n,o,r,s,a,c=V()){return a.toRenderCoords(e,c.origin)?(a.worldBasisAtPosition(c.origin,P.X,c.basis1),a.worldBasisAtPosition(c.origin,P.Y,c.basis2),k(c.basis2,c.basis1,c.origin,c.plane),M(c,-i(n),y(c),c),M(c,i(o),c.basis1,c),f(c.basis1,c.basis1,r/2),f(c.basis2,c.basis2,s/2),S(c),c):(t.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function bt(e,t){if(null==e||null==e.position)return null;const n=Te(e.position,t.spatialReference,t.elevationProvider);if(null==n)return null;const i=Le.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),o=e.width*i,r=e.height*i;return{position:n,heading:e.heading,tilt:e.tilt,renderWidth:o,renderHeight:r}}function ht(e,t,n,i=V()){const o=bt(e,t);return null==o?null:Tt(o,t,n,i)}function Tt(e,t,n,i=V()){if(null==e)return null;const o=ft(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,i);return n.tiltEnabled||null==o||Ge(o,t.renderCoordsHelper,o),o}!function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"}(Ke||(Ke={}));const wt=Se.Custom1;var Ot,Et;!function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"}(Ot||(Ot={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(Et||(Et={}));const It=Se.Custom2,Rt=x(),jt=Math.PI/2,At=Se.Custom1,Lt=Se.Custom2;var _t;function Ct(e){return null!=("building-scene-3d"===e.type?e:null)}!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(_t||(_t={}));export{wt as DidPointerMoveRecentlyFlag,It as IsShiftEdgeOnScreenFlag,_t as OffsetMode,Ot as RotationAxis,Et as SliceOrientation,dt as addArrowTips,Ze as calculateBoundedPlaneTranslateRotate,nt as calculateDiagonalResizeHandleScale,Xe as calculatePlaneHalfSize,tt as calculateResizeHandlePadding,et as calculateScreenSpaceBasisLength2,lt as createArrowGeometry,at as createGridVisualElement,st as createOutlineVisualElement,xe as createPlane,ct as createResizeManipulator,rt as createRotateManipulator,We as createRotatePlane,ot as createShiftManipulator,Ye as createShiftPlane,Ge as forceHorizontalOrVertical,it as isDiagonalResizeHandle,Ct as isIBuildingSceneLayerView3D,Fe as normalToBases,gt as planeToExtent,mt as planeToShape,bt as projectAndElevationAlignShape,Tt as projectedShapeToPlane,At as resizeNormal,Lt as resizeOutlineOnly,De as resizePlane,ht as shapeToPlane,ze as updateResizeHandle,$e as updateRotateHeadingHandle,Je as updateRotateTiltHandle,qe as updateShiftRestartHandle};
|
|
5
|
+
import t from"../../../../Color.js";import"../../../../geometry.js";import e from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import n from"../../../../core/Logger.js";import{rad2deg as o,deg2rad as i}from"../../../../core/mathUtils.js";import{castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{q as s,b as a,k as c,m as l,r as u,i as d,w as m,F as p}from"../../../../chunks/mat4.js";import{c as g}from"../../../../chunks/mat4f64.js";import{r as f}from"../../../../chunks/quat.js";import{g as b,c as h,e as T,f as w,n as O,a as A,l as R,b as I,s as E,p as j,w as C}from"../../../../chunks/vec3.js";import{a as L,c as U,f as _}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as M}from"../../../../geometry/projection.js";import{Axis as P}from"../../../../geometry/support/Axis.js";import{r as v,f as N,i as V,a as y,n as S,u as G}from"../../../../chunks/boundedPlane.js";import{fromVectorsAndPoint as k,fromPositionAndNormal as H}from"../../../../geometry/support/plane.js";import{create as B}from"../../../../geometry/support/ray.js";import{angleAroundAxis as x}from"../../../../geometry/support/vector.js";import{sv3d as F,sm4d as D,sq4d as X}from"../../../../geometry/support/vectorStacks.js";import{settings as Y}from"./settings.js";import{VERTICAL_DOT_THRESHOLD as Z,SMALL_ANGLE_DOT_THRESHOLD as q,PLANE_MIN_BASIS_SCREEN_LEN2 as W,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as z,SHIFT_RESTART_OFFSET_DISTANCE as $,RESIZE_HANDLE_EDGE_PADDING_FRAC as J,SHIFT_RESTART_TIP_RADIUS as K,PLANE_OUTLINE_WIDTH as Q,RESIZE_HANDLE_CORNER_INPUT_RADIUS as tt,RESIZE_HANDLE_EDGE_INPUT_RADIUS as et,SHIFT_RESTART_TIP_LENGTH as nt,SHIFT_RESTART_ARROW_LENGTH as ot,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as it,RESIZE_HANDLE_CORNER_WIDTH as rt,RESIZE_HANDLE_EDGE_WIDTH as st,DISPLAY_FOCUS_MULTIPLIER as at,SHIFT_RESTART_TUBE_RADIUS as ct,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as lt,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as ut}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as dt}from"../support/projectionUtils.js";import{Manipulator3D as mt}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as pt,createRotateManipulator as gt,worldScaledManipulatorSettings as ft}from"../../interactive/manipulatorUtils.js";import{RenderObject as bt}from"../../interactive/RenderObject.js";import{LineVisualElement as ht}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as Tt}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as wt}from"../../support/RenderCoordsHelper.js";import{fromRender as Ot}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as At}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as Rt,createConeGeometry as It,createPathExtrusionGeometry as Et}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as jt}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as Ct}from"../../webgl-engine/materials/ColorMaterial.js";import{NativeLineMaterial as Lt}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Ut}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as _t,ManipulatorStateFlags as Mt}from"../../../interactive/interfaces.js";import Pt from"../../../../geometry/Extent.js";function vt(t,e,n,o,i,r,s,a){return Nt(e,s.worldUpAtPosition(t,F.get()),i,r,a.basis1,a.basis2),b(a.basis1,a.basis1,n),b(a.basis2,a.basis2,o),h(a.origin,t),k(a.basis2,a.basis1,a.origin,a.plane),a}function Nt(t,e,n,o,i,r){const s=T(t,e),a=F.get(),c=F.get();switch(o===ge.HORIZONTAL_OR_VERTICAL?Math.abs(s)>Z?ge.HORIZONTAL:ge.VERTICAL:o){case ge.VERTICAL:{const o=Math.abs(s)<=q?t:n.viewUp;w(a,o,e),h(c,e);break}case ge.HORIZONTAL:w(a,n.viewUp,e),w(c,e,a);break;case ge.TILTED:{const o=Math.abs(s)<=q?e:n.viewUp;w(a,o,t),w(c,t,a);break}}const l=w(F.get(),a,c);T(l,n.viewForward)>0&&b(c,c,-1),O(i,a),O(r,c)}function Vt(t,e,n){const o=e.worldUpAtPosition(t.origin,F.get()),i=t.basis1,r=ae(t,o),s=Math.round(r/he)*he;return v(t,s-r,i,n)}function yt(t,e,n,o,i,r){const s=h(F.get(),i.origin);A(s,s,b(F.get(),i.basis1,t.direction[0]<0?1:-1)),A(s,s,b(F.get(),i.basis2,t.direction[1]<0?1:-1));const a=R(i.basis1),c=R(i.basis2),l=I(F.get(),n,s),u=I(F.get(),e,s);let d=0,m=0;if($t(t)){const e=zt(i),n=zt(r);d=a-.5*t.direction[0]*T(i.basis1,u)/a,m=c-.5*t.direction[1]*T(i.basis2,u)/c;const o=n/e;d*=o,m*=o}const p=d+.5*t.direction[0]*T(i.basis1,l)/a,g=m+.5*t.direction[1]*T(i.basis2,l)/c,f=b(F.get(),i.basis1,p/a),w=b(F.get(),i.basis2,g/c);(p<=0||qt(r.origin,f,o)<=W)&&h(f,r.basis1),(g<=0||qt(r.origin,w,o)<=W)&&h(w,r.basis2);const O=h(F.get(),s);return A(O,O,b(F.get(),f,t.direction[0]<0?-1:1)),A(O,O,b(F.get(),w,t.direction[1]<0?-1:1)),N(O,f,w,r)}function St(t,e){return z*Math.min(e.width,e.height)*e.computeRenderPixelSizeAt(t)}function Gt(t,e,n,o){const i=w(F.get(),e,n);return w(i,i,e),H(t,i,o)}function kt(t,e){return pt(t.basis1,t.basis2,t.origin,e)}function Ht(t,e,n,o){const i=e.worldUpAtPosition(t.origin,F.get()),r=F.get();switch(n){case pe.HEADING:h(r,i);break;case pe.TILT:h(r,t.basis1)}return H(t.origin,r,o)}function Bt(t,e,n,o){const i=Zt(n,Yt.NEGATIVE_X),a=D.get();s(a,e,i.edge*Math.PI/2);const c=O(F.get(),i.basis);let l=b(F.get(),c,i.direction*o.computeScreenPixelSizeAt(i.position)*$);A(l,l,i.position);const u=o.projectToRenderScreen(l,r(F.get())),d=xt(o,u);Ot(o,u,be),O(be.direction,be.direction);const m=F.get();!d&&V(n,be,m)&&(l=m),a[12]=0,a[13]=0,a[14]=0,t.modelTransform=a,t.renderLocation=L(l),d?t.state|=fe:t.state&=~fe}function xt(t,e){const[n,o,i,r]=t.viewport,s=Math.min(i,r)/16;let a=!0;return e[0]<n+s?(e[0]=n+s,a=!1):e[0]>n+i-s&&(e[0]=n+i-s,a=!1),e[1]<o+s?(e[1]=o+s,a=!1):e[1]>o+r-s&&(e[1]=o+r-s,a=!1),a}function Ft(t,e,n,o){const i=R(o.basis1),r=R(o.basis2),s=Wt(o),u=zt(o),d=E(F.get(),0,0,0);A(d,b(F.get(),o.basis1,e.direction[0]),b(F.get(),o.basis2,e.direction[1])),A(d,o.origin,d);let m=0,p=1;if($t(e))1===e.direction[0]&&-1===e.direction[1]?m=he:1===e.direction[0]&&1===e.direction[1]?m=Math.PI:-1===e.direction[0]&&1===e.direction[1]&&(m=3*Math.PI/2),p=u;else{const t=0!==e.direction[0]?1:2;m=1===t?he:0,p=(1===t?r:i)-s}const g=a(D.get(),m);c(g,g,E(F.get(),p,p,p)),l(g,n,g),g[12]=0,g[13]=0,g[14]=0,t.modelTransform=g,t.renderLocation=d}function Dt(t,e,n,o){const i=o.worldUpAtPosition(n.origin,F.get()),r=Zt(n,Yt.POSITIVE_X),s=a(D.get(),r.edge*Math.PI/2);u(s,s,-ae(n,i)),l(s,e,s),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=r.position}function Xt(t,e,n){const o=Zt(n,Yt.POSITIVE_Y),i=a(D.get(),o.edge*Math.PI/2);u(i,i,he),l(i,e,i),i[12]=0,i[13]=0,i[14]=0,t.modelTransform=i,t.renderLocation=o.position}var Yt;function Zt(t,e){switch(e){case Yt.POSITIVE_X:return{basis:t.basis1,direction:1,position:A(F.get(),t.origin,t.basis1),edge:e};case Yt.POSITIVE_Y:return{basis:t.basis2,direction:1,position:A(F.get(),t.origin,t.basis2),edge:e};case Yt.NEGATIVE_X:return{basis:t.basis1,direction:-1,position:I(F.get(),t.origin,t.basis1),edge:e};case Yt.NEGATIVE_Y:return{basis:t.basis2,direction:-1,position:I(F.get(),t.origin,t.basis2),edge:e}}}function qt(t,e,n){const o=n.projectToRenderScreen(A(F.get(),t,e),r(F.get())),i=n.projectToRenderScreen(I(F.get(),t,e),r(F.get()));return j(I(o,o,i))}function Wt(t){const e=R(t.basis1),n=R(t.basis2);return J*Math.min(e,n)}function zt(t){return Wt(t)}function $t(t){return 0!==t.direction[0]&&0!==t.direction[1]}function Jt(e,n){const o=n.offsetMode===Oe.CENTER_ON_CALLOUT?$:0,i=[_(o,0,-ot/2),_(o,0,ot/2)],r=ie(i,!0),s=(t,e)=>ne(i,t,e,n),a=s(0,!1),c=s(it,!0),l=new Lt({color:t.toUnitRGBA(n.calloutColor),renderOccluded:jt.OccludeAndTransparent}),u=Rt(l,[[o,0,0],[o-$,0,0]]),d=Rt(l,[[o,0,0],[o-$,0,0]]);return new mt({view:e,renderObjects:[...a.normal.map((t=>new bt(t,Mt.Unfocused|me))),...c.normal.map((t=>new bt(t,Mt.Unfocused|me))),new bt(u,Mt.Unfocused|me|fe),...a.focused.map((t=>new bt(t,Mt.Focused|me))),...c.focused.map((t=>new bt(t,Mt.Focused|me))),new bt(d,Mt.Focused|me|fe)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[r]},collisionPriority:1,radius:K,state:me})}function Kt(e,n){const o=gt(e,{calloutColor:t.toUnitRGBA(Y.callouts.color),customStateMask:me,texture:n});return o.state=me,o}function Qt(e){const n=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new ht({view:e,attached:!1,color:t.toUnitRGBA(Y.plane.outlineColor),width:Q,writeDepthEnabled:!1,renderOccluded:jt.OccludeAndTransparent,geometry:[n]})}function te(e){return new Tt({view:e,attached:!1,backgroundColor:t.toUnitRGBA(Y.plane.color),gridColor:t.toUnitRGBA(Y.plane.gridColor),gridWidth:4,renderOccluded:jt.OccludeAndTransparent})}function ee(e,n,o){const i=$t(n),r=i?[_(1,0,0),_(0,0,0),_(0,1,0)]:[_(1,0,0),_(-1,0,0)],s=t.toUnitRGBA(o.color),a=t=>new Ut({color:s,width:t,renderOccluded:jt.OccludeAndTransparent}),c=()=>new Lt({color:s,renderOccluded:jt.OccludeAndTransparent}),l=i?rt:st,u=l*at,d=st,m=t=>t>1?a(t):c(),p=[new bt(Rt(m(l),r),Mt.Unfocused|Te),new bt(Rt(m(u),r),Mt.Focused|Te),new bt(Rt(m(d),r),we)],g=new mt({view:e,renderObjects:p,collisionType:{type:"line",paths:[r]},radius:i?tt:et,...ft});return g.state=Te,g}function ne(e,n,o,i){const r=t.blendColors(i.color,i.outlineColor,.4),s=t.blendColors(i.color,i.outlineColor,.14),a=new Ct({color:t.toUnitRGBA(i.color),cullFace:At.Back,renderOccluded:jt.Opaque}),u=new Ct({color:t.toUnitRGBA(r),cullFace:At.Back,renderOccluded:jt.Opaque}),h=new Ct({color:t.toUnitRGBA(s),cullFace:At.Back,renderOccluded:jt.Opaque}),T=new Ct({color:t.toUnitRGBA(i.outlineColor),transparent:!0,writeDepth:!1,cullFace:At.Front,renderOccluded:jt.Transparent}),w=t=>{const i=e.slice(0),r=I(F.get(),i[0],i[1]);O(r,r);const s=I(F.get(),i[i.length-1],i[i.length-2]);if(O(s,s),n>0){const t=b(U(),s,-n);i[i.length-1]=A(t,t,i[i.length-1]);const e=b(U(),r,-n);i[0]=A(e,e,i[0])}const w=t?ut:1,R=nt*w,j=K*w,C=d(D.get());if(n>0){const t=R/4,e=E(F.get(),0,t,0),o=1+n/t;m(C,C,e),c(C,C,E(F.get(),o,o,o)),m(C,C,b(e,e,-1/o))}const L=d(g()),M=_(0,1,0),P=p(g(),f(X.get(),M,s));P[12]=i[i.length-1][0],P[13]=i[i.length-1][1],P[14]=i[i.length-1][2],l(P,P,C);const v=oe(ct*(t?lt:1)+n,i,o?T:h);v.transformation=L;const N=[v],V=It(o?T:a,R,j,24,!1,!1,!0);V.transformation=P,N.push(V);const y=It(o?T:u,R,j,24,!1,!0,!1);y.transformation=P,N.push(y);const S=p(g(),f(X.get(),M,r));return S[12]=i[0][0],S[13]=i[0][1],S[14]=i[0][2],l(S,S,C),N.push(V.instantiate({transformation:S})),N.push(y.instantiate({transformation:S})),N};return{normal:w(!1),focused:w(!0)}}function oe(t,e,n){const o=[],i=12;for(let r=0;r<i;r++){const e=r/i*2*Math.PI;o.push([Math.cos(e)*t,Math.sin(e)*t])}return Et(n,o,e,[],[],!1)}function ie(t,e){const n=I(U(),t[t.length-1],t[t.length-2]);if(O(n,n),b(n,n,nt),A(n,n,t[t.length-1]),e){const e=I(U(),t[0],t[1]);return O(e,e),b(e,e,nt),A(e,e,t[0]),[e,...t,n]}return[...t,n]}function re(t,n,i,r=new e){if(null==t)return null;const{renderCoordsHelper:s}=n,a=s.fromRenderCoords(t.origin,n.spatialReference);if(null==a)return null;const c=M(a,i);if(null==c)return null;r.position=c;const l=2*R(t.basis1),u=2*R(t.basis2),d=wt.renderUnitScaleFactor(n.spatialReference,i);r.width=l*d,r.height=u*d;const m=s.worldUpAtPosition(t.origin,F.get());return r.tilt=o(ae(t,m)),r.heading=s.headingAtPosition(t.origin,t.basis1)-90,r}function se(t,e,n){if(null==t)return null;const o=t.origin,i=F.get(),r=F.get(),s=F.get(),a=F.get();let c,l,u,d,m,p;A(i,o,t.basis1),A(i,i,t.basis2),A(r,o,t.basis1),C(r,r,t.basis2),C(s,o,t.basis1),C(s,s,t.basis2),C(a,o,t.basis1),A(a,a,t.basis2);for(const g of[i,r,s,a]){const t=e.fromRenderCoords(g,g,n);if(null==t)return null;c=null==c?t[0]:Math.min(c,t[0]),l=null==l?t[0]:Math.max(l,t[0]),u=null==u?t[1]:Math.min(u,t[1]),d=null==d?t[1]:Math.max(d,t[1]),m=null==m?t[2]:Math.min(m,t[2]),p=null==p?t[2]:Math.max(p,t[2])}return new Pt({xmin:c,xmax:l,ymin:u,ymax:d,zmin:m,zmax:p,spatialReference:n})}function ae(t,e){return x(e,t.basis2,t.basis1)+he}function ce(t,e,o,r,s,a,c=y()){return a.toRenderCoords(t,c.origin)?(a.worldBasisAtPosition(c.origin,P.X,c.basis1),a.worldBasisAtPosition(c.origin,P.Y,c.basis2),k(c.basis2,c.basis1,c.origin,c.plane),v(c,-i(e),S(c),c),v(c,i(o),c.basis1,c),b(c.basis1,c.basis1,r/2),b(c.basis2,c.basis2,s/2),G(c),c):(n.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${t.spatialReference.wkid} is not supported`),null)}function le(t,e){if(null==t||null==t.position)return null;const n=dt(t.position,e.spatialReference,e.elevationProvider);if(null==n)return null;const o=wt.renderUnitScaleFactor(t.position.spatialReference,e.spatialReference),i=t.width*o,r=t.height*o;return{position:n,heading:t.heading,tilt:t.tilt,renderWidth:i,renderHeight:r}}function ue(t,e,n,o=y()){const i=le(t,e);return null==i?null:de(i,e,n,o)}function de(t,e,n,o=y()){if(null==t)return null;const i=ce(t.position,t.heading,t.tilt,t.renderWidth,t.renderHeight,e.renderCoordsHelper,o);return n.tiltEnabled||null==i||Vt(i,e.renderCoordsHelper,i),i}!function(t){t[t.POSITIVE_X=0]="POSITIVE_X",t[t.POSITIVE_Y=1]="POSITIVE_Y",t[t.NEGATIVE_X=2]="NEGATIVE_X",t[t.NEGATIVE_Y=3]="NEGATIVE_Y"}(Yt||(Yt={}));const me=_t.Custom1;var pe,ge;!function(t){t[t.HEADING=1]="HEADING",t[t.TILT=2]="TILT"}(pe||(pe={})),function(t){t[t.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",t[t.HORIZONTAL=1]="HORIZONTAL",t[t.VERTICAL=2]="VERTICAL",t[t.TILTED=3]="TILTED"}(ge||(ge={}));const fe=_t.Custom2,be=B(),he=Math.PI/2,Te=_t.Custom1,we=_t.Custom2;var Oe;function Ae(t){return null!=("building-scene-3d"===t.type?t:null)}!function(t){t[t.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",t[t.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(Oe||(Oe={}));export{me as DidPointerMoveRecentlyFlag,fe as IsShiftEdgeOnScreenFlag,Oe as OffsetMode,pe as RotationAxis,ge as SliceOrientation,ie as addArrowTips,kt as calculateBoundedPlaneTranslateRotate,zt as calculateDiagonalResizeHandleScale,St as calculatePlaneHalfSize,Wt as calculateResizeHandlePadding,qt as calculateScreenSpaceBasisLength2,te as createGridVisualElement,Qt as createOutlineVisualElement,vt as createPlane,ee as createResizeManipulator,Kt as createRotateManipulator,Ht as createRotatePlane,Jt as createShiftManipulator,Gt as createShiftPlane,Vt as forceHorizontalOrVertical,$t as isDiagonalResizeHandle,Ae as isIBuildingSceneLayerView3D,Nt as normalToBases,se as planeToExtent,re as planeToShape,le as projectAndElevationAlignShape,de as projectedShapeToPlane,Te as resizeNormal,we as resizeOutlineOnly,yt as resizePlane,ue as shapeToPlane,Ft as updateResizeHandle,Dt as updateRotateHeadingHandle,Xt as updateRotateTiltHandle,Bt as updateShiftRestartHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{fetchAsset as e}from"../../../assets.js";import r from"../../../core/Accessor.js";import{createTask as s}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import a from"../../../core/Logger.js";import{abortMaybe as o,releaseMaybe as n,disposeMaybe as c}from"../../../core/maybe.js";import{isAbortError as f}from"../../../core/promiseUtils.js";import{initial as u}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{c as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{fetchAsset as e}from"../../../assets.js";import r from"../../../core/Accessor.js";import{createTask as s}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import a from"../../../core/Logger.js";import{abortMaybe as o,releaseMaybe as n,disposeMaybe as c}from"../../../core/maybe.js";import{isAbortError as f}from"../../../core/promiseUtils.js";import{initial as u}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{c as l,q as p,m}from"../../../chunks/mat4.js";import{f as g}from"../../../chunks/mat4f64.js";import{WatchUpdatingTracking as _}from"../../../core/support/WatchUpdatingTracking.js";import{StarPassParameters as b,StarsTechnique as y}from"./StarsTechnique.js";import{glLayout as v}from"../support/buffer/glUtil.js";import{newLayout as j}from"../support/buffer/InterleavedLayout.js";import{Default3D as w}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as k}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as D}from"../../webgl/BufferObject.js";import{PrimitiveType as P,Usage as A}from"../../webgl/enums.js";let q=class extends r{get updating(){return this._updatingTracking.updating||this.loading}get loading(){return null!=this._loadDataTask&&!this._loadDataTask.finished}constructor(t){super(t),this._loadDataTask=null,this._numPoints=0,this._renderParameter=new b,this._updatingTracking=new _}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=o(this._loadDataTask),this._updatingTracking.destroy(),this._numPoints=0,this._technique=n(this._technique),this._vao=c(this._vao),L=null}render(t){const{rctx:e}=t;if(this._ensureResources(e),null==this._technique||null==this._vao)return;if(!this._technique.compiled)return void this.requestRender();const r=e.bindTechnique(this._technique,this._renderParameter,t.bindParameters);e.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),e.drawArrays(P.POINTS,0,this._numPoints)}_ensureResources(t){if(null!=this._technique||null==L)return;this._technique=new y({rctx:t,viewingMode:this.view.state.viewingMode}),this._numPoints=L.byteLength/I;const e=new Float32Array(L,0,2*this._numPoints),r=new Uint8Array(L,2*this._numPoints*4,this._numPoints);this._vao=this._createVertexArrayObject(t,e,r,this._numPoints),this._updatingTracking.add((()=>"virtual"!==this.view.environment.lighting.type?this.view.environment.lighting.date:null),(t=>this._update(t)),u)}_computeDayDuration(t){const e=t,r=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+r)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+r)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,r=2*this._computeDayDuration(t),s=l(this._renderParameter.modelMatrix,S);p(s,s,-r*Math.PI),m(s,O,s),p(s,s,-e*Math.PI),this.requestRender()}_hexToRGB(t){return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}_unpackUint8Attributes(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}_createVertexArrayObject(t,e,r,s){const i=M.createBuffer(s),a=i.position,o=i.color,n=i.size;for(let c=0;c<s;c++){const t=e[2*c],s=e[2*c+1];a.set(c,0,-Math.cos(t)*Math.sin(s)),a.set(c,1,-Math.sin(t)*Math.sin(s)),a.set(c,2,-Math.cos(s));const i=this._unpackUint8Attributes(r[c]),f=this._hexToRGB(x[i[1]]);o.set(c,0,255*f[0]),o.set(c,1,255*f[1]),o.set(c,2,255*f[2]),o.set(c,3,255),n.set(c,i[0])}return new T(t,w,{geometry:v(M)},{geometry:D.createVertex(t,A.STATIC_DRAW,i.buffer)})}_createLoadDataTask(){if(null!=L)return null;const t=s((async t=>{const{data:r}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});this._verifyStarData(r),L=r}));return t.promise.catch((t=>{f(t)||a.getLogger(this.declaredClass).error(t)})).then((()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))})),t}_verifyStarData(t){if(!t)throw new i("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/I;if(e%1!=0||e>5e4||e<5e3)throw new i("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}};t([h({constructOnly:!0})],q.prototype,"view",void 0),t([h({constructOnly:!0})],q.prototype,"requestRender",void 0),t([h({readOnly:!0})],q.prototype,"updating",null),t([h()],q.prototype,"_loadDataTask",void 0),t([h()],q.prototype,"_updatingTracking",void 0),q=t([d("esri.views.3d.environment.Stars")],q);const x=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],O=g(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),S=g(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),I=9,M=j().vec3f(k.POSITION).vec4u8(k.COLOR).f32(k.SIZE);let L=null;export{q as Stars};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as o,screenPointObjectToArray as r,castRenderScreenPointArray as a}from"../../../core/screenUtils.js";import{once as c}from"../../../core/accessorSupport/utils.js";import{f as l}from"../../../chunks/mat3.js";import{c as h}from"../../../chunks/mat3f64.js";import{c as d,s as _,m as u,i as g}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{k as f}from"../../../chunks/vec2.js";import{a as p,t as b,m as v,g as y,c as j,d as L,s as S,b as R}from"../../../chunks/vec3.js";import{c as O,Z as w}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as A,projectPoint as E,sphericalPCPFtoLonLatElevation as D,computeENUToSphericalPCPFLocalRotation as F}from"../../../geometry/projection.js";import{containsPointObject as k}from"../../../geometry/support/aaBoundingRect.js";import{create as z,distance2 as P,fromPoints as C,closestRayDistance2 as I}from"../../../geometry/support/lineSegment.js";import{create as M,fromPositionAndNormal as x,intersectRay as U}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as W}from"../../../geometry/support/vectorStacks.js";import{clonePoint as N,hydratedSpatialReference as H}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as G}from"../support/geometryUtils/ray.js";import{Camera as Y}from"../webgl-engine/lib/Camera.js";import{Object3D as Z}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as J}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as K,ManipulatorStateFlags as Q}from"../../interactive/interfaces.js";import X from"../../../geometry/Point.js";class ${constructor(e){this.metadata=void 0,this._camera=new Y,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new X({x:0,y:0,z:0}),this._elevationAlignedLocation=new X,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=K.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:o(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference;for(const t in e)this[t]=e[t];const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=fe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),{remove:c((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){ee(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),te(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){N(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){N(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=H(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(ee(this._modelTransform)){const t=this._calculateModelTransformOffset(ge);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=r(t,ie),n=this._getCollisionRadius(i),o=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<n*n)return this.screenLocation.renderScreenPointArray[2]+o;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae),r=n*this.screenLocation.pixelSize,c=G(this._camera,s,ne);if(null==c)return null;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],i);for(let t=1;t<s.length;t++){const n=v(he,s[t],i),l=I(C(e,n,se),c);if(null!=l&&l<r*r){const t=p(W.get(),e,n);y(t,t,.5);const i=a(W.get());return this._camera.projectToRenderScreen(t,i),i[2]+o}j(e,n)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),a=n*this.screenLocation.pixelSize,c=G(this._camera,s,ne);if(null==c)return null;const h=l(oe,r),d=b(_e,e,h),_=v(ue,t,r);x(_,d,ce);const u=de;if(U(ce,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+o;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),c=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=G(this._camera,s,ne);if(null==h)return null;const d=l(oe,r),_=b(_e,t,d),u=this._calculateModelTransformPosition(ue);x(u,_,ce);const g=de;if(!U(ce,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],r);for(let t=1;t<s.length;t++){const i=v(he,s[t],r),n=P(C(e,i,se),g);if(null!=n&&n<c*c){const t=p(W.get(),e,i);y(t,t,.5);const s=a(W.get());return this._camera.projectToRenderScreen(t,s),s[2]+o}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;i.engineLayerId?t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)):(this._engineLayer=new J(t,{pickable:!1,updatePolicy:q.SYNC}),i.engineLayerId=this._engineLayer.id),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new X({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,s(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,me,e.spatialReference)&&k(e.extent,me)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=this.elevationInfo.offset??0;switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ae;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?Q.Focused:Q.Unfocused)|(this.selected?Q.Selected:Q.Unselected),n=this._noDisplayCount>0;for(const{stateMask:o,objects:r}of i){if(n){for(const e of r)e.visible=!1;continue}const e=(o&Q.All)!==Q.None,i=(o&K.All)!==K.None,a=!e||(s&o)==(o&Q.All),c=!i||(this.state&o)==(o&K.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new Z({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const n=[];s.forEach(((e,t)=>n.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,re);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){let e=!1;if(null!=this._engineResources)for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.visible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function ee(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function te(e,t,s){switch(e.viewingMode){case"local":return g(s),!0;case"global":{const n=T(e.renderCoordsHelper.spatialReference);return D(t,0,le,0,n.radius),F(i(le[0]),i(le[1]),s),!0}}}const ie=n(),se=z(),ne=B(),oe=h(),re=m(),ae=m(),ce=M(),le=O(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=new X({x:0,y:0,z:0,spatialReference:null}),fe=()=>{};export{$ as Manipulator3D};
|
|
5
|
+
import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as o,screenPointObjectToArray as r,castRenderScreenPointArray as a}from"../../../core/screenUtils.js";import{once as c}from"../../../core/accessorSupport/utils.js";import{f as l}from"../../../chunks/mat3.js";import{c as h}from"../../../chunks/mat3f64.js";import{c as d,s as _,m as u,i as g}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{k as f}from"../../../chunks/vec2.js";import{a as p,t as b,m as v,g as y,c as j,d as L,s as S,b as R}from"../../../chunks/vec3.js";import{c as O,Z as w}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as A,projectPoint as E,sphericalPCPFtoLonLatElevation as D,computeENUToSphericalPCPFLocalRotation as F}from"../../../geometry/projection.js";import{containsPointObject as k}from"../../../geometry/support/aaBoundingRect.js";import{create as z,distance2 as P,fromPoints as C,closestRayDistance2 as I}from"../../../geometry/support/lineSegment.js";import{create as M,fromPositionAndNormal as x,intersectRay as U}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as W}from"../../../geometry/support/vectorStacks.js";import{clonePoint as N,hydratedSpatialReference as H}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as G}from"../support/geometryUtils/ray.js";import{Camera as Y}from"../webgl-engine/lib/Camera.js";import{Object3D as Z}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as J}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as K,ManipulatorStateFlags as Q}from"../../interactive/interfaces.js";import X from"../../../geometry/Point.js";class ${constructor(e){this.metadata=void 0,this._camera=new Y,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new X({x:0,y:0,z:0}),this._elevationAlignedLocation=new X,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=K.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:o(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference;for(const t in e)this[t]=e[t];const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=fe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),{remove:c((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){ee(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),te(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){N(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){N(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=H(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(ee(this._modelTransform)){const t=this._calculateModelTransformOffset(ge);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=r(t,ie),n=this._getCollisionRadius(i),o=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<n*n)return this.screenLocation.renderScreenPointArray[2]+o;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae),r=n*this.screenLocation.pixelSize,c=G(this._camera,s,ne);if(null==c)return null;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],i);for(let t=1;t<s.length;t++){const n=v(he,s[t],i),l=I(C(e,n,se),c);if(null!=l&&l<r*r){const t=p(W.get(),e,n);y(t,t,.5);const i=a(W.get());return this._camera.projectToRenderScreen(t,i),i[2]+o}j(e,n)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),a=n*this.screenLocation.pixelSize,c=G(this._camera,s,ne);if(null==c)return null;const h=l(oe,r),d=b(_e,e,h),_=v(ue,t,r);x(_,d,ce);const u=de;if(U(ce,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+o;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),c=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=G(this._camera,s,ne);if(null==h)return null;const d=l(oe,r),_=b(_e,t,d),u=this._calculateModelTransformPosition(ue);x(u,_,ce);const g=de;if(!U(ce,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],r);for(let t=1;t<s.length;t++){const i=v(he,s[t],r),n=P(C(e,i,se),g);if(null!=n&&n<c*c){const t=p(W.get(),e,i);y(t,t,.5);const s=a(W.get());return this._camera.projectToRenderScreen(t,s),s[2]+o}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new J(t,{pickable:!1,updatePolicy:q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new X({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,s(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,me,e.spatialReference)&&k(e.extent,me)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=this.elevationInfo.offset??0;switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ae;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?Q.Focused:Q.Unfocused)|(this.selected?Q.Selected:Q.Unselected),n=this._noDisplayCount>0;for(const{stateMask:o,objects:r}of i){if(n){for(const e of r)e.visible=!1;continue}const e=(o&Q.All)!==Q.None,i=(o&K.All)!==K.None,a=!e||(s&o)==(o&Q.All),c=!i||(this.state&o)==(o&K.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new Z({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const n=[];s.forEach(((e,t)=>n.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,re);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){let e=!1;if(null!=this._engineResources)for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.visible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function ee(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function te(e,t,s){switch(e.viewingMode){case"local":return g(s),!0;case"global":{const n=T(e.renderCoordsHelper.spatialReference);return D(t,0,le,0,n.radius),F(i(le[0]),i(le[1]),s),!0}}}const ie=n(),se=z(),ne=B(),oe=h(),re=m(),ae=m(),ce=M(),le=O(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=new X({x:0,y:0,z:0,spatialReference:null}),fe=()=>{};export{$ as Manipulator3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{createLength as o}from"../../../../../core/quantityUtils.js";import{watch as r,initial as n}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as p}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as l,getMetersPerUnitForSR as h}from"../../../../../core/unitUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{q as d}from"../../../../../chunks/mat4.js";import{s as m,a as _,f as g}from"../../../../../chunks/vec2.js";import{a as v}from"../../../../../chunks/vec2f64.js";import{c as y,A as f,b as S,n as M,l as T,e as b}from"../../../../../chunks/vec3.js";import{c as x,a as E}from"../../../../../chunks/vec3f64.js";import{containsXY as A}from"../../../../../geometry/support/aaBoundingRect.js";import{a as B,c as O}from"../../../../../chunks/boundedPlane.js";import{intersectRay as R,create as j,normal as G}from"../../../../../geometry/support/plane.js";import{create as D}from"../../../../../geometry/support/ray.js";import{sv2d as w,sv3d as P,sm4d as z}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as I}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as U,OffsetMode as Z,IsShiftEdgeOnScreenFlag as C,createResizeManipulator as k,resizeNormal as X,resizeOutlineOnly as Y,isDiagonalResizeHandle as L,calculateDiagonalResizeHandleScale as N,createRotatePlane as V,RotationAxis as H,calculateBoundedPlaneTranslateRotate as F,updateRotateHeadingHandle as q,updateResizeHandle as W}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as J}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as K}from"../../Manipulator3D.js";import{createRotateManipulator as Q,getGraphicAttachmentOrigin as $,calculateInputRotationTransform as tt}from"../../manipulatorUtils.js";import{screenToZConstrained as et,screenToRenderPlane as it}from"../dragEventPipeline3D.js";import{ManipulatorType as at}from"../ManipulatorType.js";import{canMoveZ as st}from"../manipulatorUtils.js";import{createVisualElements as ot}from"../visualElementUtils.js";import{ManipulationType as rt}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as nt}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as pt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as lt}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as ht}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as ct}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as ut}from"../../../layers/graphics/GraphicState.js";import{fromScreen as dt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as mt,addMapDelta as _t,addScreenDelta as gt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as vt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as yt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as ft}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as St}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{mapPlaneAutoHorizontalSizeByElevationMode as Mt,calculateOrientedBounds as Tt,mapPlaneToRenderPlane as bt,apply as xt,unapply as Et}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import At from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Bt,ExtentScaleTooltipInfo as Ot}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as Rt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as jt,TranslateGraphicZTooltipInfo as Gt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as Dt}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistance as wt}from"../../../../support/euclideanLengthMeasurementUtils.js";let Pt=class extends(e.EventedMixin(vt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new At,this._preserveAspectRatio=new pt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this._handles=new i,this._attachmentOrigin=null,this._outlineVisualElement=null,this._mapBounds=B(),this._mapBoundsStart=B(),this._zmax=0,this._sizeStart=null,this._displayBounds=B(),this._displayBoundsStart=B(),this._displayBoundsMarginStart=0,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=v(),this._endScale=v()}initialize(){const{view:t,graphic:e,manipulators:i,_handles:s}=this,o=this._graphicState=new ut({graphic:e}),p=e.geometry;this._editGeometryOperations=yt.fromGeometry(p,t.state.viewingMode),this._graphicMoveManipulation=new nt({tool:this,view:t,graphicState:o}),this._moveZManipulator=U(t,Z.CENTER_ON_CALLOUT),this._moveZManipulator.state|=C,s.add([this._createMoveXYGraphicDragPipeline(),r((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this._moveZManipulator,at.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this._moveZManipulator),this._resizeManipulators=this._resizeHandles.map((e=>{const i=k(t,e);return s.add([r((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,at.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this._resizeManipulators);const l=!this.view._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._rotateManipulatorTexture=J(t.toolViewManager.textures,{premultiplyAlpha:l}),this._rotateManipulator=Q(t,{texture:this._rotateManipulatorTexture.texture}),s.add([r((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this._rotateManipulator,at.ROTATE))),this._rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this._rotateManipulator)]),i.add(this._rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const h=ot({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});null!=h&&(this._outlineVisualElement=h.visualElement instanceof lt?h.visualElement:null),null!=this._outlineVisualElement&&s.add(this._outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(h),s.add([o.on("changed",(()=>this._onGeometryChanged())),r((()=>o.displaying),(()=>this._updateAllManipulatorAvailability())),r((()=>o.isDraped),(()=>this._graphicDrapedChanged()),n),t.trackGraphicState(o)]);const c=t.pointsOfInterest;s.add(r((()=>c?.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const u=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(u);const d=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===at.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(d),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._mapBounds=null,this._displayBounds=null,this._rotateManipulatorTexture.release(),this._handles.destroy(),this._graphicMoveManipulation.destroy(),this._editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{_handles:t,view:e}=this,i=this._tooltip=new Rt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",(()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._tooltip.clear()})),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{m(this._startScale,t.xScale,t.yScale),m(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{m(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{m(this._startScale,0,0),m(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",(t=>{"cancel"===t.action?this._tooltip.clear():a()}))])}))}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this._graphicMoveManipulation.grabbing||this._graphicMoveManipulation.dragging?this._computeMoveXYTooltipInfo():this._moveZManipulator.focused?this._computeMoveZTooltipInfo():this._rotateManipulator.focused?this._computeRotateTooltipInfo():this._resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null:null}_computeMoveXYTooltipInfo(){return this._moveXYTooltipInfo??(this._moveXYTooltipInfo=new jt({tooltipOptions:this.tooltipOptions}))}_computeMoveZTooltipInfo(){const t=this._moveZTooltipInfo??(this._moveZTooltipInfo=new Gt({tooltipOptions:this.tooltipOptions})),e=this._moveUnit;if(this._moveZManipulator.dragging){const e=this._mapBoundsStart.origin,i=this._mapBounds.origin,a=wt(e,i,this.view.spatialReference);if(null==a)return null;t.distance=a}else t.distance=o(0,e);return t}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo??(this._rotateTooltipInfo=new Bt({tooltipOptions:this.tooltipOptions}));return t.angle=this._startAngle-this._endAngle,t}_computeScaleTooltipInfo(){const t=this.graphic.geometry;if(null==t)return null;const e=this._scaleTooltipInfo??(this._scaleTooltipInfo=new Ot({tooltipOptions:this.tooltipOptions})),i=Mt(this._mapBounds,this._zmax,t.spatialReference,this._graphicState.isDraped);return null==i?null:(e.xSize=i[0],e.ySize=i[1],null!=this._sizeStart&&this._resizeManipulators.some((t=>t.dragging))?(e.xScale=i[0].value/this._sizeStart[0].value,e.yScale=i[1].value/this._sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_graphicDrapedChanged(){this._handles.remove(zt),this._updateDisplayBounds(),this._graphicState.isDraped&&this._handles.add(this.view.elevationProvider.on("elevation-change",(t=>{null!=this._attachmentOrigin&&A(t.extent,this._attachmentOrigin.x,this._attachmentOrigin.y)&&this._updateDisplayBounds()})),zt)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof K){const a=this._graphicState.displaying,s=this.enableZ&&st(this.graphic);switch(e){case at.ROTATE:t.available=a&&this.enableRotation;break;case at.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?X:Y;break;case at.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this._graphicMoveManipulation.forEachManipulator(t),this._resizeManipulators.forEach((e=>t(e,at.SCALE))),t(this._rotateManipulator,at.ROTATE),t(this._moveZManipulator,at.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return l(this.view.spatialReference)??"meters"}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this._editGeometryOperations.data,i=e.components[0].edges[0],a=_(w.get(),i.leftVertex.pos,i.rightVertex.pos);g(a,a);const s=$(this.view,this.graphic)??t.extent?.center;let o=s?Ut*this.view.pixelSizeAt(s):0;const r=this.view.spatialReference,n=t.spatialReference;r.equals(n)||(o*=h(r)/h(n)),Tt(a,e,o,this._mapBounds),this._updateZMax()}_updateZMax(){const t=this._editGeometryOperations.data;if(!t.geometry.hasZ)return void(this._zmax=0);const e=t.coordinateHelper;let i=Number.NEGATIVE_INFINITY;for(const a of t.components)for(const t of a.vertices){const a=e.getZ(t.pos)??0;i=Math.max(a,i)}this._zmax=i}_updateDisplayBounds(){const{geometry:t}=this.graphic;if(null==t)return;const{extent:e}=t;if(!e)return;const i=null==this._outlineVisualElement||this._graphicState.isDraped||null==this._outlineVisualElement.attachmentOrigin?$(this.view,this.graphic):this._outlineVisualElement.attachmentOrigin;this._attachmentOrigin=i??e.center;const a=null!=i?i.z:ht(this._mapBounds.origin,this.view.elevationProvider,ct.fromElevationInfo(I(this.graphic)),this.view.renderCoordsHelper),s=O(this._mapBounds);s.origin[2]=a??0,bt(s,this.view.renderCoordsHelper,t.spatialReference,this._displayBoundsMargin,this._displayBounds),this._updateManipulators()}get _displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this._editGeometryOperations.data.geometry.extent?.center;return e?It*this.view.pixelSizeAt(e):0}_createMoveXYGraphicDragPipeline(){return this._graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,rt.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this._editGeometryOperations.data.spatialReference;return mt(this._moveZManipulator,((i,a,s)=>{const o=E(i.renderLocation),r=a.next(et(t,o,e)).next(gt());this._applyGraphicMoveSteps(r,s,rt.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},this._updateOperationStartProperties(),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(_t()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||(t.mapEnd.z??0)-(t.mapStart.z??0))&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{null!=this.inputState&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_updateOperationStartProperties(){O(this._displayBounds,this._displayBoundsStart),O(this._mapBounds,this._mapBoundsStart),null!=this.graphic.geometry?this._sizeStart=Mt(this._mapBoundsStart,this._zmax,this.graphic.geometry.spatialReference,this._graphicState.isDraped):this._sizeStart=null}_moveDragUpdateGeometry(){return t=>{if(null==this.inputState||"move"!==this.inputState.type)return t;const e=[];for(const s of this._editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?ft.NEW_STEP:ft.ACCUMULATE_STEPS,a=this._editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return xt(a,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===rt.XY||e===rt.XY_AXIS){const e=Dt(t.mapStart,t.mapEnd,this._graphicState.isDraped?"on-the-ground":"absolute-height");null!=e&&null!=this._moveXYTooltipInfo&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab({action:t,screenPoint:e}){if("start"!==t||!e)return;const i=this._calculatePickRay(e);R(this._displayBounds.plane,i,P.get())&&(this._updateOperationStartProperties(),this._displayBoundsMarginStart=this._displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return mt(t,((t,i,a)=>{null!=this.inputState&&(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(it(this.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(...this._preserveAspectRatio.createDragEventPipelineStep()).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{null!=this.inputState&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this._displayBoundsStart,i=t.handle.direction,a=this._displayBoundsMargin,s=this._displayBoundsMarginStart,o=y(P.get(),e.origin);f(o,o,e.basis1,-i[0]),f(o,o,e.basis2,-i[1]);const r=S(P.get(),t.renderEnd,o),n=S(P.get(),t.renderStart,o),p=L(t.handle),l=N(e),h=N(this._displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=T(e),o=.5*t*b(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*b(e,n)/i)*l*h}const c=i<1.5*s?1:Zt;return i=Math.max(i-s,Zt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=y(x(),this._mapBoundsStart.origin);f(e,e,this._mapBoundsStart.basis1,-t.handle.direction[0]),f(e,e,this._mapBoundsStart.basis2,-t.handle.direction[1]);const i=m(v(),this._mapBoundsStart.basis1[0],this._mapBoundsStart.basis1[1]);g(i,i);const a=[];for(const r of this._editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?ft.NEW_STEP:ft.ACCUMULATE_STEPS,o=this._editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,St.REPLACE);return O(this._mapBoundsStart,this._mapBounds),xt(o,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_onRotateGrab({action:t,screenPoint:e}){if("start"!==t||!e)return;const i=V(this._displayBounds,this.view.renderCoordsHelper,H.HEADING,j()),a=this._calculatePickRay(e);R(i,a,P.get())&&(this._updateOperationStartProperties(),this.inputState={type:"rotate",rotatePlane:i})}_createRotateDragPipeline(t){return mt(t,((t,e,i)=>{const a=this.inputState;null!=a&&(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(it(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{null!=this.inputState&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=G(t.rotatePlane),a=tt(e.renderStart,e.renderEnd,this._displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=y(x(),this._mapBoundsStart.origin),i=[];for(const o of this._editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?ft.NEW_STEP:ft.ACCUMULATE_STEPS,s=this._editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,St.REPLACE);return O(this._mapBoundsStart,this._mapBounds),xt(s,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=D(),i=p(t);return dt(this.view.state.camera,i,e),M(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=F(this._displayBounds,z.get());q(this._rotateManipulator,t,this._displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this._moveZManipulator,t),this._resizeManipulators.forEach(((e,i)=>{W(e,this._resizeHandles[i],t,this._displayBounds)}))}_updateZMoveHandle(t,e){const i=this._displayBounds,a={basis:i.basis1,direction:-1,position:S(P.get(),i.origin,i.basis1),edge:2},s=z.get();d(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this._editGeometryOperations.lastOperation;null!=t&&(this._editGeometryOperations.undo(),this.graphic.geometry=this._editGeometryOperations.data.geometry,Et(t,this._mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this._editGeometryOperations.canUndo}undo(){if(null!=this.inputState)this.view.activeTool=null;else if(this.canUndo){const t=this._editGeometryOperations.undo();this.graphic.geometry=this._editGeometryOperations.data.geometry,Et(t,this._mapBounds),this._updateDisplayBounds()}}get canRedo(){return this._editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this._editGeometryOperations.redo();this.graphic.geometry=this._editGeometryOperations.data.geometry,xt(t,this._mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this._resizeManipulators,rotateManipulator:this._rotateManipulator,moveZManipulator:this._moveZManipulator,tooltip:this._tooltip}}};t([c({constructOnly:!0,nonNullable:!0})],Pt.prototype,"view",void 0),t([c({constructOnly:!0,nonNullable:!0})],Pt.prototype,"graphic",void 0),t([c({constructOnly:!0,nonNullable:!0})],Pt.prototype,"enableZ",void 0),t([c()],Pt.prototype,"enableRotation",void 0),t([c()],Pt.prototype,"enableScaling",void 0),t([c({constructOnly:!0,type:At})],Pt.prototype,"tooltipOptions",void 0),t([c()],Pt.prototype,"preserveAspectRatio",null),t([c()],Pt.prototype,"grabbing",void 0),t([c()],Pt.prototype,"inputState",void 0),t([c({readOnly:!0})],Pt.prototype,"type",void 0),t([c()],Pt.prototype,"_moveUnit",null),Pt=t([u("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],Pt);const zt="draped-elevation-changes",It=10,Ut=80,Zt=1e-6;export{Zt as EPSILON,Pt as ExtentTransformTool};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../Color.js";import i from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{makeHandle as s}from"../../../../../core/handleUtils.js";import{rad2deg as o}from"../../../../../core/mathUtils.js";import{createLength as r}from"../../../../../core/quantityUtils.js";import{watch as n,initial as p}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as l}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as h,getMetersPerUnitForSR as c}from"../../../../../core/unitUtils.js";import{property as u}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as d}from"../../../../../core/accessorSupport/decorators/subclass.js";import{q as m}from"../../../../../chunks/mat4.js";import{s as _,a as g,f as v}from"../../../../../chunks/vec2.js";import{a as y}from"../../../../../chunks/vec2f64.js";import{c as f,A as S,b as M,n as T,l as b,e as x}from"../../../../../chunks/vec3.js";import{c as E,a as A}from"../../../../../chunks/vec3f64.js";import{containsXY as B}from"../../../../../geometry/support/aaBoundingRect.js";import{a as O,c as R}from"../../../../../chunks/boundedPlane.js";import{intersectRay as j,create as G,normal as w}from"../../../../../geometry/support/plane.js";import{create as D}from"../../../../../geometry/support/ray.js";import{sv2d as P,sv3d as z,sm4d as I}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as U}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as Z,OffsetMode as C,IsShiftEdgeOnScreenFlag as k,createResizeManipulator as X,resizeNormal as Y,resizeOutlineOnly as L,isDiagonalResizeHandle as N,calculateDiagonalResizeHandleScale as V,createRotatePlane as H,RotationAxis as F,calculateBoundedPlaneTranslateRotate as q,updateRotateHeadingHandle as W,updateResizeHandle as J}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as K}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as Q}from"../../Manipulator3D.js";import{createRotateManipulator as $,getGraphicAttachmentOrigin as tt,calculateInputRotationTransform as et}from"../../manipulatorUtils.js";import{screenToZConstrained as it,screenToRenderPlane as at}from"../dragEventPipeline3D.js";import{ManipulatorType as st}from"../ManipulatorType.js";import{canMoveZ as ot}from"../manipulatorUtils.js";import{createVisualElements as rt}from"../visualElementUtils.js";import{ManipulationType as nt}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as pt}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as lt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ht}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as ct}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as ut}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as dt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as mt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as _t,addMapDelta as gt,addScreenDelta as vt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as yt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as ft}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as St}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Mt}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{mapPlaneAutoHorizontalSizeByElevationMode as Tt,calculateOrientedBounds as bt,mapPlaneToRenderPlane as xt,apply as Et,unapply as At}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import Bt from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Ot,ExtentScaleTooltipInfo as Rt}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as jt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as Gt,TranslateGraphicZTooltipInfo as wt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as Dt}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistance as Pt}from"../../../../support/euclideanLengthMeasurementUtils.js";const zt={accent:new e([255,127,0]),contrast:new e([255,255,255])};let It=class extends(i.EventedMixin(yt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new Bt,this._preserveAspectRatio=new lt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this._handles=new a,this._attachmentOrigin=null,this._outlineVisualElement=null,this._mapBounds=O(),this._mapBoundsStart=O(),this._zmax=0,this._sizeStart=null,this._displayBounds=O(),this._displayBoundsStart=O(),this._displayBoundsMarginStart=0,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=y(),this._endScale=y()}initialize(){const{view:t,graphic:i,manipulators:a,_handles:o}=this,r=this._graphicState=new dt({graphic:i}),l=i.geometry;this._editGeometryOperations=ft.fromGeometry(l,t.state.viewingMode),this._graphicMoveManipulation=new pt({tool:this,view:t,graphicState:r}),this._moveZManipulator=Z(t,{offsetMode:C.CENTER_ON_CALLOUT,calloutColor:zt.accent,color:zt.contrast,outlineColor:zt.accent}),this._moveZManipulator.state|=k,o.add([this._createMoveXYGraphicDragPipeline(),n((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this._moveZManipulator,st.TRANSLATE_Z))),this._createMoveZDragPipeline()]),a.add(this._moveZManipulator),this._resizeManipulators=this._resizeHandles.map((e=>{const i=X(t,e,{color:zt.accent});return o.add([n((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,st.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),a.addMany(this._resizeManipulators);const h=!this.view._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._rotateManipulatorTexture=K(t.toolViewManager.textures,{accentColor:new e([255,127,0,.5]),contrastColor:new e([255,255,255,1]),preMultiplyAlpha:h}),this._rotateManipulator=$(t,{calloutColor:[1,.5,0,1],texture:this._rotateManipulatorTexture.texture}),o.add([n((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this._rotateManipulator,st.ROTATE))),this._rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this._rotateManipulator)]),a.add(this._rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const c=rt({view:t,graphic:i,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>s()});null!=c&&(this._outlineVisualElement=c.visualElement instanceof ht?c.visualElement:null),null!=this._outlineVisualElement&&o.add(this._outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),o.add(c),o.add([r.on("changed",(()=>this._onGeometryChanged())),n((()=>r.displaying),(()=>this._updateAllManipulatorAvailability())),n((()=>r.isDraped),(()=>this._graphicDrapedChanged()),p),t.trackGraphicState(r)]);const u=t.pointsOfInterest;o.add(n((()=>u?.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{o.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const m=(t,e)=>{o.add(t.events.on("immediate-click",(t=>{e===st.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:i}),t.stopPropagation()})))};this._forEachManipulator(m),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._mapBounds=null,this._displayBounds=null,this._rotateManipulatorTexture.release(),this._handles.destroy(),this._graphicMoveManipulation.destroy(),this._editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{_handles:t,view:e}=this,i=this._tooltip=new jt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",(()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._tooltip.clear()})),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{_(this._startScale,t.xScale,t.yScale),_(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{_(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{_(this._startScale,0,0),_(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",(t=>{"cancel"===t.action?this._tooltip.clear():a()}))])}))}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this._graphicMoveManipulation.grabbing||this._graphicMoveManipulation.dragging?this._computeMoveXYTooltipInfo():this._moveZManipulator.focused?this._computeMoveZTooltipInfo():this._rotateManipulator.focused?this._computeRotateTooltipInfo():this._resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null:null}_computeMoveXYTooltipInfo(){return this._moveXYTooltipInfo??(this._moveXYTooltipInfo=new Gt({tooltipOptions:this.tooltipOptions}))}_computeMoveZTooltipInfo(){const t=this._moveZTooltipInfo??(this._moveZTooltipInfo=new wt({tooltipOptions:this.tooltipOptions})),e=this._moveUnit;if(this._moveZManipulator.dragging){const e=this._mapBoundsStart.origin,i=this._mapBounds.origin,a=Pt(e,i,this.view.spatialReference);if(null==a)return null;t.distance=a}else t.distance=r(0,e);return t}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo??(this._rotateTooltipInfo=new Ot({tooltipOptions:this.tooltipOptions}));return t.angle=this._startAngle-this._endAngle,t}_computeScaleTooltipInfo(){const t=this.graphic.geometry;if(null==t)return null;const e=this._scaleTooltipInfo??(this._scaleTooltipInfo=new Rt({tooltipOptions:this.tooltipOptions})),i=Tt(this._mapBounds,this._zmax,t.spatialReference,this._graphicState.isDraped);return null==i?null:(e.xSize=i[0],e.ySize=i[1],null!=this._sizeStart&&this._resizeManipulators.some((t=>t.dragging))?(e.xScale=i[0].value/this._sizeStart[0].value,e.yScale=i[1].value/this._sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_graphicDrapedChanged(){this._handles.remove(Ut),this._updateDisplayBounds(),this._graphicState.isDraped&&this._handles.add(this.view.elevationProvider.on("elevation-change",(t=>{null!=this._attachmentOrigin&&B(t.extent,this._attachmentOrigin.x,this._attachmentOrigin.y)&&this._updateDisplayBounds()})),Ut)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof Q){const a=this._graphicState.displaying,s=this.enableZ&&ot(this.graphic);switch(e){case st.ROTATE:t.available=a&&this.enableRotation;break;case st.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?Y:L;break;case st.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this._graphicMoveManipulation.forEachManipulator(t),this._resizeManipulators.forEach((e=>t(e,st.SCALE))),t(this._rotateManipulator,st.ROTATE),t(this._moveZManipulator,st.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return h(this.view.spatialReference)??"meters"}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this._editGeometryOperations.data,i=e.components[0].edges[0],a=g(P.get(),i.leftVertex.pos,i.rightVertex.pos);v(a,a);const s=tt(this.view,this.graphic)??t.extent?.center;let o=s?Ct*this.view.pixelSizeAt(s):0;const r=this.view.spatialReference,n=t.spatialReference;r.equals(n)||(o*=c(r)/c(n)),bt(a,e,o,this._mapBounds),this._updateZMax()}_updateZMax(){const t=this._editGeometryOperations.data;if(!t.geometry.hasZ)return void(this._zmax=0);const e=t.coordinateHelper;let i=Number.NEGATIVE_INFINITY;for(const a of t.components)for(const t of a.vertices){const a=e.getZ(t.pos)??0;i=Math.max(a,i)}this._zmax=i}_updateDisplayBounds(){const{geometry:t}=this.graphic;if(null==t)return;const{extent:e}=t;if(!e)return;const i=null==this._outlineVisualElement||this._graphicState.isDraped||null==this._outlineVisualElement.attachmentOrigin?tt(this.view,this.graphic):this._outlineVisualElement.attachmentOrigin;this._attachmentOrigin=i??e.center;const a=null!=i?i.z:ct(this._mapBounds.origin,this.view.elevationProvider,ut.fromElevationInfo(U(this.graphic)),this.view.renderCoordsHelper),s=R(this._mapBounds);s.origin[2]=a??0,xt(s,this.view.renderCoordsHelper,t.spatialReference,this._displayBoundsMargin,this._displayBounds),this._updateManipulators()}get _displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this._editGeometryOperations.data.geometry.extent?.center;return e?Zt*this.view.pixelSizeAt(e):0}_createMoveXYGraphicDragPipeline(){return this._graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,nt.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this._editGeometryOperations.data.spatialReference;return _t(this._moveZManipulator,((i,a,s)=>{const o=A(i.renderLocation),r=a.next(it(t,o,e)).next(vt());this._applyGraphicMoveSteps(r,s,nt.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},this._updateOperationStartProperties(),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(gt()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||(t.mapEnd.z??0)-(t.mapStart.z??0))&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{null!=this.inputState&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_updateOperationStartProperties(){R(this._displayBounds,this._displayBoundsStart),R(this._mapBounds,this._mapBoundsStart),null!=this.graphic.geometry?this._sizeStart=Tt(this._mapBoundsStart,this._zmax,this.graphic.geometry.spatialReference,this._graphicState.isDraped):this._sizeStart=null}_moveDragUpdateGeometry(){return t=>{if(null==this.inputState||"move"!==this.inputState.type)return t;const e=[];for(const s of this._editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?St.NEW_STEP:St.ACCUMULATE_STEPS,a=this._editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Et(a,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===nt.XY||e===nt.XY_AXIS){const e=Dt(t.mapStart,t.mapEnd,this._graphicState.isDraped?"on-the-ground":"absolute-height");null!=e&&null!=this._moveXYTooltipInfo&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab({action:t,screenPoint:e}){if("start"!==t||!e)return;const i=this._calculatePickRay(e);j(this._displayBounds.plane,i,z.get())&&(this._updateOperationStartProperties(),this._displayBoundsMarginStart=this._displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return _t(t,((t,i,a)=>{null!=this.inputState&&(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(at(this.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(...this._preserveAspectRatio.createDragEventPipelineStep()).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{null!=this.inputState&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this._displayBoundsStart,i=t.handle.direction,a=this._displayBoundsMargin,s=this._displayBoundsMarginStart,o=f(z.get(),e.origin);S(o,o,e.basis1,-i[0]),S(o,o,e.basis2,-i[1]);const r=M(z.get(),t.renderEnd,o),n=M(z.get(),t.renderStart,o),p=N(t.handle),l=V(e),h=V(this._displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=b(e),o=.5*t*x(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*x(e,n)/i)*l*h}const c=i<1.5*s?1:kt;return i=Math.max(i-s,kt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=f(E(),this._mapBoundsStart.origin);S(e,e,this._mapBoundsStart.basis1,-t.handle.direction[0]),S(e,e,this._mapBoundsStart.basis2,-t.handle.direction[1]);const i=_(y(),this._mapBoundsStart.basis1[0],this._mapBoundsStart.basis1[1]);v(i,i);const a=[];for(const r of this._editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?St.NEW_STEP:St.ACCUMULATE_STEPS,o=this._editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Mt.REPLACE);return R(this._mapBoundsStart,this._mapBounds),Et(o,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_onRotateGrab({action:t,screenPoint:e}){if("start"!==t||!e)return;const i=H(this._displayBounds,this.view.renderCoordsHelper,F.HEADING,G()),a=this._calculatePickRay(e);j(i,a,z.get())&&(this._updateOperationStartProperties(),this.inputState={type:"rotate",rotatePlane:i})}_createRotateDragPipeline(t){return _t(t,((t,e,i)=>{const a=this.inputState;null!=a&&(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(at(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:o(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{null!=this.inputState&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=w(t.rotatePlane),a=et(e.renderStart,e.renderEnd,this._displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=f(E(),this._mapBoundsStart.origin),i=[];for(const o of this._editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?St.NEW_STEP:St.ACCUMULATE_STEPS,s=this._editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Mt.REPLACE);return R(this._mapBoundsStart,this._mapBounds),Et(s,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=D(),i=l(t);return mt(this.view.state.camera,i,e),T(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=q(this._displayBounds,I.get());W(this._rotateManipulator,t,this._displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this._moveZManipulator,t),this._resizeManipulators.forEach(((e,i)=>{J(e,this._resizeHandles[i],t,this._displayBounds)}))}_updateZMoveHandle(t,e){const i=this._displayBounds,a={basis:i.basis1,direction:-1,position:M(z.get(),i.origin,i.basis1),edge:2},s=I.get();m(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this._editGeometryOperations.lastOperation;null!=t&&(this._editGeometryOperations.undo(),this.graphic.geometry=this._editGeometryOperations.data.geometry,At(t,this._mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this._editGeometryOperations.canUndo}undo(){if(null!=this.inputState)this.view.activeTool=null;else if(this.canUndo){const t=this._editGeometryOperations.undo();this.graphic.geometry=this._editGeometryOperations.data.geometry,At(t,this._mapBounds),this._updateDisplayBounds()}}get canRedo(){return this._editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this._editGeometryOperations.redo();this.graphic.geometry=this._editGeometryOperations.data.geometry,Et(t,this._mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this._resizeManipulators,rotateManipulator:this._rotateManipulator,moveZManipulator:this._moveZManipulator,tooltip:this._tooltip}}};t([u({constructOnly:!0,nonNullable:!0})],It.prototype,"view",void 0),t([u({constructOnly:!0,nonNullable:!0})],It.prototype,"graphic",void 0),t([u({constructOnly:!0,nonNullable:!0})],It.prototype,"enableZ",void 0),t([u()],It.prototype,"enableRotation",void 0),t([u()],It.prototype,"enableScaling",void 0),t([u({constructOnly:!0,type:Bt})],It.prototype,"tooltipOptions",void 0),t([u()],It.prototype,"preserveAspectRatio",null),t([u()],It.prototype,"grabbing",void 0),t([u()],It.prototype,"inputState",void 0),t([u({readOnly:!0})],It.prototype,"type",void 0),t([u()],It.prototype,"_moveUnit",null),It=t([d("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],It);const Ut="draped-elevation-changes",Zt=10,Ct=80,kt=1e-6;export{kt as EPSILON,It as ExtentTransformTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{a as e}from"../../../chunks/mat4.js";import{b as t,f as r,m as n,n as o}from"../../../chunks/vec3.js";import{f as i}from"../../../chunks/
|
|
5
|
+
import{a as e}from"../../../chunks/mat4.js";import{b as t,f as r,m as n,n as o}from"../../../chunks/vec3.js";import{f as i}from"../../../chunks/vec4f64.js";import{sv3d as a,sm4d as c}from"../../../geometry/support/vectorStacks.js";import{hydrateGeometry as l}from"../../../layers/graphics/hydratedFeatures.js";import{Manipulator3D as s}from"./Manipulator3D.js";import{RenderObject as u}from"./RenderObject.js";import{computeCentroid as m}from"../layers/graphics/graphicUtils.js";import{Attribute as d}from"../webgl-engine/lib/Attribute.js";import{CullFaceOptions as p}from"../webgl-engine/lib/basicInterfaces.js";import{Geometry as f}from"../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as g,createSphereGeometry as w}from"../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as b}from"../webgl-engine/lib/Material.js";import{VertexAttribute as h}from"../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as j}from"../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as O}from"../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as M}from"../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as y}from"../webgl-engine/materials/RibbonLineMaterial.js";import{ShadedColorMaterial as S}from"../webgl-engine/materials/ShadedColorMaterial.js";import{ManipulatorStateCustomFlags as v,ManipulatorStateFlags as A}from"../../interactive/interfaces.js";function F(e,t=b.OccludeAndTransparent,r=!0){const n=i(e[0],e[1],e[2],e.length>3?e[3]:1),o=e[3]<1;return r?new S({color:n,transparent:o,writeDepth:!0,cullFace:p.Back,renderOccluded:t}):new j({color:n,transparent:o,writeDepth:!0,cullFace:p.Back,renderOccluded:t})}function k(e,t=b.OccludeAndTransparent){const r=i(e[0],e[1],e[2],4===e.length?e[3]:1);return new j({color:r,transparent:!0,writeDepth:!0,cullFace:p.Front,renderOccluded:t})}const I=Object.freeze({calloutLength:40,calloutWidth:1,discRadius:27,focusMultiplier:1.1});function R(e,t){const r=new s({view:e,autoScaleRenderObjects:!1,collisionPriority:1,metadata:t.metadata});return L(r,t),r}function L(e,t){const r=t.material??new O({transparent:!0,writeDepth:!1,textureId:t.texture?.id,renderOccluded:b.Opaque}),n=t.focusMultiplier??I.focusMultiplier,o=t.calloutLength??I.calloutLength,i=I.discRadius*(t.discScale??1),a=i*n,c=(e,t)=>{const r=[0,1,2,2,3,0];return new f(t,[[h.POSITION,new d([o-e,-e,0,o+e,-e,0,o+e,e,0,o-e,e,0],3,!0)],[h.UV0,new d([0,0,1,0,1,1,0,1],2,!0)]],[[h.POSITION,r],[h.UV0,r]])},l=t.calloutWidth??I.calloutWidth,s=new(l>1?y:M)({width:l,color:t.calloutColor,renderOccluded:b.OccludeAndTransparent}),m=g(s,[[0,0,0],[o-i,0,0]]),p=g(s,[[0,0,0],[o-a,0,0]]),w=t.customStateMask??v.None;e.collisionType={type:"disc",direction:[0,0,1],offset:[o,0,0]},e.focusMultiplier=n,e.metadata=t.metadata,e.radius=i,e.renderObjects=[new u(c(i,r),A.Unfocused|w),new u(m,A.Unfocused|w),new u(c(a,r),A.Focused|w),new u(p,A.Focused|w)]}function T(e,t,r=1,n=v.None){const o=F(i(t[0],t[1],t[2],null!=r?r:1)),a=[new u(w(o,1,32,32),n)];return new s({view:e,renderObjects:a})}const U=Object.freeze({autoScaleRenderObjects:!1,worldSized:!0});function D(o,i,l,s){const u=t(a.get(),o,l),m=N(u,r(a.get(),s,u),l,c.get());e(m,m);const d=n(a.get(),i,m);return Math.atan2(d[1],d[0])}function N(e,t,n,i){const c=o(a.get(),e),l=o(a.get(),t),s=r(a.get(),c,l);return i[0]=c[0],i[1]=c[1],i[2]=c[2],i[3]=0,i[4]=l[0],i[5]=l[1],i[6]=l[2],i[7]=0,i[8]=s[0],i[9]=s[1],i[10]=s[2],i[11]=0,i[12]=n[0],i[13]=n[1],i[14]=n[2],i[15]=1,i}function x(e,t){const r=e.getViewForGraphic(t);return null!=r&&"computeAttachmentOrigin"in r?r.computeAttachmentOrigin(t,e.spatialReference):null}function V(e,t,r){const n=x(e,r);null==n?z(t,r.geometry):t.elevationAlignedLocation=n}function z(e,t){if(null==t)return;const r="mesh"===t.type?t.anchor:m(t);null!=r&&(e.location=l(r))}export{D as calculateInputRotationTransform,N as calculateTranslateRotateFromBases,F as createManipulatorMaterial,k as createManipulatorOutlineMaterial,R as createRotateManipulator,T as createSphereManipulator,x as getGraphicAttachmentOrigin,V as placeAtGraphic,L as updateRotateManipulator,U as worldScaledManipulatorSettings};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{initial as s,whenOnce as o}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as l}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import p from"../../../rest/support/Query.js";import{symbolHasExtrudeSymbolLayer as u}from"../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as c}from"./graphics/elevationAlignPointsInFeatures.js";import h from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as d}from"./graphics/QueryEngine.js";import{queryForSymbologySnapping as y}from"./graphics/queryForSymbologySnapping.js";import{HeatmapFeatureProcessor as g}from"./support/HeatmapFeatureProcessor.js";import{toViewIfLocal as m}from"./support/projectExtentUtils.js";import{UpdatePolicy as f}from"../webgl-engine/lib/UpdatePolicy.js";import{TaskPriority as b}from"../../support/Scheduler.js";const E=E=>{let v=class extends E{constructor(){super(...arguments),this.controller=null,this.updatePolicy=f.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.supportsHeightUnitConversion=!0,this._pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType()),this.updatingHandles.add((()=>this.layer.renderer),(e=>this._recreateProcessor(e)),s),this.addResolvingPromise((async()=>{const e=await m(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e));const t=()=>this.processor.featureStore;this.queryEngine=new d({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return t()},hasZ:this.hasZ,hasM:this.hasM},priority:b.FEATURE_QUERY_ENGINE}),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=t(this.controller),this._set("processor",t(this.processor)),this.queryEngine=t(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=t(this._pendingController)}get legendEnabled(){return this.canResume()&&this.processor?.legendEnabled}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get symbologySnappingSupported(){const e=this.layer?.renderer?.getSymbols();return e?.some(u)??!1}getHit(e){let r;return this.loadedGraphics?.forEach((t=>{t.uid===e&&(r=a(t,this.layer))})),r?{type:"graphic",graphic:r,layer:r.layer}:null}whenGraphicBounds(e,r){return this.processor?.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}async elevationAlignPointsInFeatures(e,t){const s=this.graphics3DProcessor;if(null==s)throw new r("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return c(this.view,this.layer,(e=>s.getGraphics3DGraphicByObjectId(e)),e,t)}async queryForSymbologySnapping(e,r){return this.symbologySnappingSupported?y(this.graphics3DProcessor,e,r):{candidates:[],sourceCandidateIndices:[]}}queryFeatures(e,r){return this.queryEngine.executeQuery(this._ensureQuery(e),r?.signal)}queryObjectIds(e,r){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),r?.signal)}queryFeatureCount(e,r){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),r?.signal)}queryExtent(e,r){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),r?.signal)}_ensureQuery(e){return null==e?this.createQuery():p.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){return super.canResume()&&!this.processor?.scaleVisibilitySuspended}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&!this.controller?.updating&&this.view?.basemapTerrain?.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this._pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(r){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await o((()=>this.view?.basemapTerrain?.ready)),this.beforeSetController(e),this._pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}_recreateProcessor(e){const r="heatmap"===e?.type,t="heatmap"===this.processor?.type,s=this.processor;if(s&&r===t)return;const o=r?new g({owner:this}):new h({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",o),s?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(o.initializePromise)}_getResourceInfo(){const e=this.controller instanceof l?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:e?.maximumNumberOfFeatures??-1,totalNumberOfFeatures:e?.serviceDataCount??-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([i()],v.prototype,"loadedGraphics",void 0),e([i()],v.prototype,"suspended",void 0),e([i({readOnly:!0})],v.prototype,"legendEnabled",null),e([i()],v.prototype,"updating",void 0),e([i()],v.prototype,"controller",void 0),e([i()],v.prototype,"processor",void 0),e([i({readOnly:!0})],v.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],v.prototype,"suspendResumeExtentMode",void 0),e([i({type:Boolean})],v.prototype,"slicePlaneEnabled",void 0),e([i({readOnly:!0})],v.prototype,"suspendInfo",void 0),e([i()],v.prototype,"graphics3DProcessor",null),e([i()],v.prototype,"heatmapProcessor",null),e([i()],v.prototype,"symbologySnappingSupported",null),v=e([n("esri.views.3d.layers.FeatureLikeLayerView3D")],v),v};export{E as FeatureLikeLayerView3D};
|