@arcgis/core 5.2.0-next.117 → 5.2.0-next.118
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/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/analysis/featureReferenceUtils.js +1 -1
- package/arcade.d.ts +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03918a862455191a8910.js +1 -0
- package/assets/esri/core/workers/chunks/{9b9a60f1e0c48aa701f0.js → 066b7f6866d602f963e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bfd63f3cf9208eb839b.js → 0dc317d022807af92e3f.js} +41 -41
- package/assets/esri/core/workers/chunks/{564fdf0d663b773806cc.js → 114bc14c49176f64a2c5.js} +1 -1
- package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +1 -0
- package/assets/esri/core/workers/chunks/{db141122060d8d9b38da.js → 1742dbc6a827cfda471b.js} +1 -1
- package/assets/esri/core/workers/chunks/{045ff98313b06a2188b7.js → 1a39335aa2dce6d564d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{caf38cf4d8542fb11c46.js → 20e4277a4a6c57957202.js} +1 -1
- package/assets/esri/core/workers/chunks/{729d458e9e28641227cd.js → 21c0743b2f612e7e7de3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f42243c62dd0b6993816.js → 24014f3701c31ee74bc2.js} +1 -1
- package/assets/esri/core/workers/chunks/37cf4ca2083cd3b6002e.js +1 -0
- package/assets/esri/core/workers/chunks/{44d3fe10cb35d16f0b33.js → 4396ef5ab3eb9e9a7df2.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b499cfc89c8f87cdb20.js → 4925d0b29a166cc8fee1.js} +1 -1
- package/assets/esri/core/workers/chunks/{56989b48c0a5d7fe85e6.js → 4c4ba466e23159991322.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9023cc3298ee4fddea7.js → 54f3bc940cea15fce2c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e42be27ead91a4cc0f1.js → 581285e4d7bbe1b7c27a.js} +1 -1
- package/assets/esri/core/workers/chunks/{05584d8828ae7bca0fc5.js → 64ee22134fda2f09c094.js} +1 -1
- package/assets/esri/core/workers/chunks/6efc5873747b9cd44fb9.js +1 -0
- package/assets/esri/core/workers/chunks/{0463c807b37f01bbc35c.js → 70347d25968975126fa7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1eafb214519d8fc63ccb.js → 8465e2c7221125fd3cc4.js} +1 -1
- package/assets/esri/core/workers/chunks/862e1acd80c4e43831dc.js +1 -0
- package/assets/esri/core/workers/chunks/{fd808d38ae2d475ac442.js → 8675ab3c4dec2f13b9c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{925a0b29d3ed7165b8dd.js → 8984d02c0ce828fd223a.js} +1 -1
- package/assets/esri/core/workers/chunks/{57328c206f1e699ac06f.js → 89edaa1ffa566908ebca.js} +1 -1
- package/assets/esri/core/workers/chunks/{bb4cbf6b7c35e8c78cc7.js → a917a1df8270860dc514.js} +1 -1
- package/assets/esri/core/workers/chunks/{996438b3afec92c5c68e.js → b0058619e0363002ad86.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fb46ccd4be4c3b61c31.js → b5a102cf9f4377fb9842.js} +1 -1
- package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +1 -0
- package/assets/esri/core/workers/chunks/{2e0fd0536408053ac6f5.js → b961e0aaa6b3ea75315c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa869977ac2abb063925.js → b9c834e3c0701e9b14a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{32dd990a3bd93cbad309.js → c0ec87800faf99cbd8bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{20de0ea9fa08a6545978.js → cf1106eda10f3cccb1bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed988360264574cd8f6b.js → cf7c06702babd6fa88b4.js} +1 -1
- package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +1 -0
- package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +1 -0
- package/assets/esri/core/workers/chunks/{c5ceceb0683671f92efa.js → da6583e8d88441a1c02a.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1f2b07be33e33117313.js → dd02cc18ebebb90778c6.js} +1 -1
- package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +1 -0
- package/assets/esri/core/workers/chunks/{05b373a663cb5d4d722f.js → deb5b1d772ca407654d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{10fa8fbade8ae084c307.js → e22a013ec38989caf9de.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7e6b5594fed5bb16691.js → e4016ae9cb8f16e3efc3.js} +1 -1
- package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +1 -0
- package/assets/esri/core/workers/chunks/{a3f4818f4190fa92331d.js → edd36e98355f1655e5c8.js} +1 -1
- package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +1 -0
- package/assets/esri/core/workers/chunks/f0709c48daca93e759c8.js +1 -0
- package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +1 -0
- package/assets/esri/core/workers/chunks/{d926bffc3ff9f87e9081.js → f890359d972cce54459e.js} +1 -1
- package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +1 -0
- package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +1 -0
- package/assets/esri/core/workers/chunks/fe1787a8d499832996b3.js +1 -0
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +3 -3
- package/chunks/Compositing.glsl.js +4 -4
- package/chunks/DeepSky.glsl.js +3 -3
- package/chunks/EdgeShader.glsl.js +6 -6
- package/chunks/FocusArea.glsl.js +1 -1
- package/chunks/GlobalIllumination.glsl.js +7 -7
- package/chunks/HUDMaterial.glsl.js +5 -5
- package/chunks/LaserlinePath.glsl.js +5 -5
- package/chunks/LineCallout.glsl.js +2 -2
- package/chunks/LineMarker.glsl.js +30 -30
- package/chunks/NavigationDepth.glsl.js +1 -1
- package/chunks/OccludedGeometryDepth.glsl.js +2 -2
- package/chunks/Path.glsl.js +12 -12
- package/chunks/PointRenderer.glsl.js +5 -5
- package/chunks/Precipitation.glsl.js +7 -7
- package/chunks/RibbonLine.glsl.js +50 -50
- package/chunks/SimpleAtmosphere.glsl.js +9 -9
- package/chunks/Stars.glsl.js +5 -5
- package/chunks/Terrain.glsl.js +18 -16
- package/chunks/Viewshed.glsl.js +3 -3
- package/chunks/VolumeMask.glsl.js +2 -2
- package/chunks/Water.glsl.js +20 -19
- package/config.js +1 -1
- package/core/NestedMap.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -1
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +2 -30
- package/layers/FeatureLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/FeatureLayerReload.d.ts +26 -0
- package/layers/mixins/FeatureLayerReload.js +2 -0
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/support/TimeInfo.d.ts +2 -2
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/time/timeZoneUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -9
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +23 -23
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +2 -0
- package/views/3d/webgl-engine/effects/AmbientIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +4 -4
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ViewingModeConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +26 -26
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/OccludedGeometryDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/VolumeMask.glsl.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/ValuePicker.d.ts +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +4 -2
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/assets/esri/core/workers/chunks/0630e650abdfea1792e4.js +0 -1
- package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +0 -1
- package/assets/esri/core/workers/chunks/25c5e1b14b184b1228a3.js +0 -1
- package/assets/esri/core/workers/chunks/573e8fa0af8711ffec45.js +0 -1
- package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +0 -1
- package/assets/esri/core/workers/chunks/66c46c5a7147550ea3ed.js +0 -1
- package/assets/esri/core/workers/chunks/6c7cb7974969e3167f2b.js +0 -1
- package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +0 -1
- package/assets/esri/core/workers/chunks/7edf57e31ff07af9032b.js +0 -1
- package/assets/esri/core/workers/chunks/8bd187b48a4e4296e3d8.js +0 -1
- package/assets/esri/core/workers/chunks/9acaabe950319d031f2e.js +0 -1
- package/assets/esri/core/workers/chunks/ac02df176f9ea94278bb.js +0 -1
- package/assets/esri/core/workers/chunks/b4222152efaf73b37b53.js +0 -1
- package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +0 -1
- package/assets/esri/core/workers/chunks/e606be4ece4eac1e9bbe.js +0 -1
- package/assets/esri/core/workers/chunks/f05622413cadfd14553e.js +0 -1
package/time/timeZoneUtils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{UnknownTimeZone as e}from"../core/sql/UnknownTimeZone.js";import{system as n,unknown as o,utc as r}from"./constants.js";import{legacyTimeZoneMap as i}from"./legacyTimeZoneMap.js";import{FixedOffsetZone as s,IANAZone as c,DateTime as m}from"luxon";const u="shortOffset";function a(t){return"timeZoneIANA"in t}function f(t){return t.startsWith("UTC")}function l(t,e=!1){return{json:{read:{source:t,reader:(e,n)=>n[t]?p(n[t]):null},write:!!e&&{allowNull
|
|
2
|
+
import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{UnknownTimeZone as e}from"../core/sql/UnknownTimeZone.js";import{system as n,unknown as o,utc as r}from"./constants.js";import{legacyTimeZoneMap as i}from"./legacyTimeZoneMap.js";import{FixedOffsetZone as s,IANAZone as c,DateTime as m}from"luxon";const u="shortOffset";function a(t){return"timeZoneIANA"in t}function f(t){return t.startsWith("UTC")}function l(t,e=!1,n=!0){return{json:{read:{source:t,reader:(e,n)=>n[t]?p(n[t]):null},write:!!e&&{allowNull:n,writer(e,n){n[t]=e?Z(e):null}}}}}function p(t,e=n){return t?a(t)?t.timeZoneIANA:w(t,e):e}function Z(t){return{timeZoneIANA:t}}function w(t,e=n){if(!t||!i.has(t.timeZone))return e;const o=i.get(t.timeZone);return f(t.timeZone)||t.respectsDaylightSaving?o:h(o)}function h(t){const e=m.local().setZone(t),n=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);if(0===n)return"Etc/UTC";return`Etc/GMT${s.instance(-n).formatOffset(0,"narrow")}`}function d(t,e,n,i,s){if(e&&"date"===s)return{timeZone:r,timeZoneName:void 0};const c=i.hour,m=n===o;return{timeZone:m?"timestamp-offset"===s?void 0:t??r:n,timeZoneName:m&&c?u:void 0}}function g(t){const e=new Set(["etc/utc","etc/gmt","gmt"]),r=new Set(Intl.supportedValuesOf("timeZone").map(t=>t.toLowerCase()));return t===n||t===o||e.has(t.toLowerCase())||r.has(t.toLowerCase())}const A=new Map;function C(n){return n===o?e.instance:n===r||"Etc/UTC"===n?s.utcInstance:t(A,n,()=>c.create(n))}export{w as convertLegacyTimeZone,p as fromTimeReference,C as getLuxonTimeZone,d as getTimeZoneFormattingOptions,g as isTimeZoneValid,u as shortTimeZoneName,l as timeZoneProperty,Z as toTimeReference};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive,this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive;const t=t=>{const e=t.at(0);null!=e&&this._itemTool.showInteractionVisuals(e)},e=()=>this._itemTool.hideInteractionVisuals();this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("hold",({objects:e})=>t(e)),this._moveTool.events.on("move-start",({objects:e})=>t(e)),this._moveTool.events.on("move-stop",e),i(()=>this._moveTool.firstGrabbedManipulator,t=>{null==t&&e()})])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){return!!this.hasSelection&&(this._setSelectedItem(null),!0)}deleteSelectedItem(){const t=this._selectedItem;if(null==t)return!1;const e=this.analysis.targets.find(e=>e===t);return null!=e&&this._deleteTarget(e)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.hideInteractionVisuals(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return!1;const e=this.analysis.targets.indexOf(t);if(e<0)return!1;const i=l(t),s=this._selectedItem===t;return this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)}),!0}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}get testInfo(){return{moveTooltip:this._moveTool.tooltip}}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{initial as a,watch as s}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as
|
|
2
|
+
import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{initial as a,watch as s}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import c from"../../../../geometry/Point.js";import{create as u,fromPoints as d}from"../../../../geometry/support/lineSegment.js";import{clonePoint as m}from"../../../../layers/graphics/hydratedFeatures.js";import{LineOfSightInteractionVisuals as h}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as v,LineOfSightTargetManipulator as g,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as y}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as b}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as f}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as j}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as I}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as M,dragAtLocation as V,sceneSnappingAtLocation as O}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import S from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as T}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as R,enterInputModeIfAvailable as H}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as U}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const D=u();let x=class extends w{constructor(t){super(t),this.events=new i,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new p,this._toolOptions=new S({tooltips:{enabled:!0}}),this._interactionVisuals=null,this._grabbedManipulator=null,this._moveInteractionManipulator=null,this._tooltipHandle=null,this._tooltipUndoRecord=null,this._tooltipInfo=new U({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=R(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new h({view:t}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),s(()=>this._grabbedManipulator,t=>{null==t&&this._syncInteractionVisuals()},a)]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=n(this._tooltip),this._interactionVisuals=n(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(t){this._moveInteractionManipulator=this._manipulatorByObject.get(t),this._syncInteractionVisuals()}hideInteractionVisuals(){this._moveInteractionManipulator=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new v(this.view,{deleting:!1,intersection:null,type:"observer"}):new g(this.view,{deleting:!1,target:t.item,type:"target"});i.cursor="move",this._objectByItem.set(t.item,t),this._manipulatorByObject.set(t,i),this.manipulators.add(i),this.addHandles(this._connectManipulator(t,i),t),this._syncManipulator(t,i)}removeObject(t){const i=this._manipulatorByObject.get(t);null!=i&&(this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip()),this.removeHandles(t),this.manipulators.remove(i),i.destroy(),this._objectByItem.delete(t.item),this._manipulatorByObject.delete(t))}getManipulator(t){const i=this._objectByItem.get(t);return null==i?null:this._manipulatorByObject.get(i)}hasManipulatorAt(t,i){for(const e of this._manipulatorByObject.values())if(e.consumesClicks&&null!=e.intersectionDistance(t,i))return!0;return!1}selectObject(t){let i=!1;for(const[e,n]of this._manipulatorByObject){const o=e===t;n.selected=o,i||=o}return i}onInputEvent(t){"hold"===t.type&&this._syncInteractionVisuals(),H(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const n=()=>this._syncManipulator(t,i);return e([t.on("committed",n),t.on("modified-externally",n),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===I.Right&&"target"===i.metadata.type&&this.events.emit("delete-item",{target:i.metadata.target}),e.stopPropagation()}),i.events.on("grab-changed",({action:e})=>{"start"===e?(this.events.emit("select-item",{item:t.item}),this._grabbedManipulator=i,this._connectTooltip(t)):this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip())}),i.events.on("drag",i=>{t.updateDragIntersection(i),"start"===i.action&&this._syncInteractionVisuals()}),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return M(i,(e,n,o,a)=>{const s=t.operations;if(null==s)return;let r=null;const{cancelSnapping:l,snappingStep:p}=B({snappingContext:new T({editGeometryOperations:s,elevationInfo:t.elevationInfo,pointer:a,visualizer:new b}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});o.next(t=>(r?.undo(null),r=null,t)).next(l);const u=s.data.allVerticesUnordered.at(0);n.next(i=>("start"===i.action&&(r=t.createUndoRecord()),{...i,snapOrigin:u?.pos})).next(V(this.view,i.elevationAlignedLocation)).next(f(this.view,s.data.geometry,t.elevationInfo,s.data.spatialReference)).next(O(this.view,t.elevationInfo)).next(...p).next(t=>(s.trySetGeometry(m(t.mapEnd,new c),"start"===t.action?0:1),"end"===t.action&&null!=r&&(this.events.emit("record-undo",{record:r}),r=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipHandle=j(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=t.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{null!=this._tooltipUndoRecord&&(this.events.emit("record-undo",{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=o(this._tooltipHandle),this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(const[t,i]of this._manipulatorByObject)this._syncManipulator(t,i);this._syncInteractionVisuals()}_syncManipulator(t,i){const e=t.origin;if(i.available=this.visible&&t.visible&&null!=e,i.interactive=this.manipulatorsInteractive,null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const n=this.analysisViewData.computations.find(i=>i.target===t.item),o=null!=n&&n.computationResult.isValid?n.computationResult.isTargetVisible?_.visible:_.occluded:_.undefined;i.state=this.interacting?y(o):o}_syncInteractionVisuals(){const t=this._interactionVisuals,i=this._grabbedManipulator??this._moveInteractionManipulator,e=this.active||null!=this._moveInteractionManipulator,n=this.visible&&this.analysisViewData.visible;if(null==t||null==i||!e||!n)return void t?.hide();const o=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];if(null==o)return void t.hide();const a=i===o?null:d(o.renderLocation,i.renderLocation,D);t.update({target:i.renderLocation,lineVerticalPlaneSegment:a,visible:!0})}};t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r({constructOnly:!0})],x.prototype,"snappingManager",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r()],x.prototype,"automaticManipulatorSelection",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r()],x.prototype,"interacting",void 0),t([r()],x.prototype,"manipulatorsInteractive",void 0),t([r()],x.prototype,"_grabbedManipulator",void 0),t([r()],x.prototype,"updating",null),x=t([l("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],x);export{x as LineOfSightItemTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as p}from"../../../../../core/quantity.js";import{initial as r,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as _}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{MoveManipulation as H}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as D}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as x}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as P,resetManipulatedObjectMany as U}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as R}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as A}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Y,enterInputModeIfAvailable as B}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class N{constructor(t){this.objects=t,this.type="move-start"}}class q{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class L{constructor(t){this.objects=t,this.type="move-stop"}}const J=Symbol("manipulators"),K=Symbol("tooltips"),Q=Symbol("move-manipulator-display");let $=class extends R{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new z,this.type="move-3d",this._measurementWorker=new W({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=Y(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(!this.destroyed&&!B(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=y(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==D(e))continue;const t=new ot(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this.removeHandles(Q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],J)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),J)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(Q),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Q)}_createMoveManipulation(t){const o=new H({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(1===t.length?H.radiusForSymbol(t[0].object.graphic?.symbol):I)});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),J)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=p)})],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const p of t){this.addHandles([p.object.on("committed",i),this._updatingHandles.add(()=>p.object.visible,i)],J);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>p.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(x({view:this.view,geometry:p.object.graphic?.geometry,elevationInfo:p.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},r),J),this.addHandles(n(()=>this.removeHandles(o)),J)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),J);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){if(this.enableVisualElements)for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(y(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let p=null,r=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,p=null,r=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>r?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new L(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=P(l),r=U(l),this._emitRecordUndo(),this.events.emit("move-start",new N(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>p?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new q(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new L(l)),this.destroyed)return null;h()}return null}),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new N([o]))},onMove:()=>e.emit("move",new q(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new L([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new V({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(e)),S(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new F({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,G))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??p}else t.distance=p}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=y(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:A.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),p=this.snappingManager,{snappingStep:r,cancelSnapping:h}=X({snappingContext:l,snappingManager:p,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=_(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...r),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"view",void 0),t([c()],$.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableVisualElements",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableZ",void 0),t([c({constructOnly:!0})],$.prototype,"manipulatorRadius",void 0),t([c({constructOnly:!0,type:z})],$.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],$.prototype,"snappingManager",void 0),t([c()],$.prototype,"type",void 0),t([c()],$.prototype,"updating",null),t([c()],$.prototype,"_latestTooltipInfo",void 0),t([c()],$.prototype,"_shouldShowMovePointTooltip",null),t([c()],$.prototype,"activeTooltipInfo",null),$=t([d("esri.views.3d.interactive.editingTools.move.MoveTool3D")],$);const tt=u(v);class ot{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{q as MoveEvent,N as MoveStartEvent,L as MoveStopEvent,$ as MoveTool3D};
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as r}from"../../../../../core/quantity.js";import{initial as p,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as d}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as _}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{MoveManipulation as H}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as D}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as x}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as P,resetManipulatedObjectMany as U}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as R}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Y,enterInputModeIfAvailable as B}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as F}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class N{constructor(t){this.objects=t,this.type="move-start"}}class q{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class L{constructor(t){this.objects=t,this.type="move-stop"}}class J{constructor(t){this.objects=t,this.type="hold"}}const K=Symbol("manipulators"),Q=Symbol("tooltips"),$=Symbol("move-manipulator-display");let tt=class extends A{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new z,this.type="move-3d",this._measurementWorker=new W({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=Y(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(this.destroyed)return;if(B(t,this.tooltip))return;const o=this.firstGrabbedManipulator;if("hold"===t.type&&null!=o){const t=this._getActiveObjectInfos(this._infos,o).map(({object:t})=>t);this.events.emit("hold",new J(t))}return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=y(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==D(e))continue;const t=new et(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(K),this.removeHandles($),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],K)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),K)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles($),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),$)}_createMoveManipulation(t){const o=new H({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(1===t.length?H.radiusForSymbol(t[0].object.graphic?.symbol):I)});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),K)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=r)})],K)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const r of t){this.addHandles([r.object.on("committed",i),this._updatingHandles.add(()=>r.object.visible,i)],K);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>r.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(x({view:this.view,geometry:r.object.graphic?.geometry,elevationInfo:r.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},p),K),this.addHandles(n(()=>this.removeHandles(o)),K)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),K);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),K)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){if(this.enableVisualElements)for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],K),this.addHandles(i,K))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(y(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>p?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new L(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of this._getActiveObjectInfos(t,e))a.push(o),l.push(o.object),o.dragging=!0;if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=P(l),p=U(l),this._emitRecordUndo(),this.events.emit("move-start",new N(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>r?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new q(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new L(l)),this.destroyed)return null;h()}return null}),cancel:n}}_getActiveObjectInfos(t,o){return t.filter(t=>!t.dragging&&(t.manipulationXY?.hasManipulator(o)||!t.manipulationXY?.grabbing))}_connectTooltips(){let t;if(this.removeHandles(Q),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new N([o]))},onMove:()=>e.emit("move",new q(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new L([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,Q)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new V({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(ot(t),ot(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new G({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(ot(t),ot(e)),S(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,F))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??r}else t.distance=r}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=y(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:R.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:h}=X({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=_(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...p),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"view",void 0),t([c()],tt.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"enableVisualElements",void 0),t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"enableZ",void 0),t([c({constructOnly:!0})],tt.prototype,"manipulatorRadius",void 0),t([c({constructOnly:!0,type:z})],tt.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],tt.prototype,"snappingManager",void 0),t([c()],tt.prototype,"type",void 0),t([c()],tt.prototype,"updating",null),t([c()],tt.prototype,"_latestTooltipInfo",void 0),t([c()],tt.prototype,"_shouldShowMovePointTooltip",null),t([c()],tt.prototype,"activeTooltipInfo",null),tt=t([u("esri.views.3d.interactive.editingTools.move.MoveTool3D")],tt);const ot=d(v);class et{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{J as HoldEvent,q as MoveEvent,N as MoveStartEvent,L as MoveStopEvent,tt as MoveTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{colorVectorEquals as
|
|
2
|
+
import{colorVectorEquals as e}from"../../../../core/colorUtils.js";import r from"../../../../core/Handles.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as o,subtract as a,sub as n,cross as h,len as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as d}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as f}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class C extends p{constructor(e){super(e),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=i(),this._arrowCenter=c(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=_(),this._contrastColor=_(),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial?.setParameters({renderOccluded:e}))}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){this._transparentRenderOrder=e,this._arrowMaterial&&this._arrowMaterial.setParameters({testsTransparentRenderOrder:e})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(e){this._stripeLength=e,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(e){if(this._stripesEnabled=e,this.attached){const e=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:e})}}get color(){return this._color}set color(r){e(r,this._color)||(d(this._color,r),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(r){e(r,this._color)||(d(this._contrastColor,r),this._updateArrowColor())}createExternalResources(){const e=this._color,t=this._contrastColor,i=this._stripesEnabled?t:e;this._arrowMaterial=new f({outlineColor:e,stripeEvenColor:i,stripeOddColor:e,renderOccluded:this.renderOccluded,isDecoration:this.isDecoration,testsTransparentRenderOrder:this._transparentRenderOrder},this.view.state.isGlobal),this._handles=new r,this._handles.add(s(()=>this.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=t(this._handles)}forEachMaterial(e){e(this._arrowMaterial)}createGeometries(e){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const r=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);r.transformation=this._originTransform,e.addGeometry(r),this._viewChanged()}_createArrowGeometry(e,r,t,s){const i=this.view,n=i.renderCoordsHelper,h=[],l=[],c=(e,r)=>{const s=m.get();a(s,e,t),h.push(s),l.push(r)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const t=m.get();if(n.worldUpAtPosition(this._arrowCenter,t),y(e,r,t)){const{heading:r,tilt:s}=i.camera,{direction:a}=g(i,e,r,s,b);o(t,a)}c(e,t),c(r,t)}else{s.eval(.5,this._arrowCenter);const e=this._arrowSubdivisions+1&-2;for(let r=0;r<e;++r){const t=r/(e-1),i=m.get(),o=m.get();s.eval(t,i),n.worldUpAtPosition(i,o),c(i,o)}}return w(this._arrowMaterial,h,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const e=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*e})}}_updateArrowColor(){if(!this.attached)return;const e=this._color,r=this._contrastColor,t=this._stripesEnabled?r:e,s=e,i=e;this._arrowMaterial.setParameters({stripeEvenColor:t,outlineColor:s,stripeOddColor:i})}}function y(e,r,t){const s=n(v,r,e),i=h(v,s,t);return 0===l(i)}const v=c(),b=u();export{C as MeasurementArrowVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as c}from"../../layers/graphics/olidUtils.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";function m(t,e,r=null){const o=[],n=e.mapPositions,i=h(e,o),a=i.data,u=i.indices.length,s=l(u);return g(e,o,s),w(e,o,s),b(e,o,s),y(e,o,i.indices,s),d(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),j(e,o,a),null!=r&&c(o,r,s),new f(t,o,n)}function h(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=r.length/3,i=n>2&&A(r)&&o,a=n-(i?1:0),u=new Array(2*(a-1)),s=i?r.slice(0,-3):r;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;const c=new p(s,u,3,i);return e.push(["position",c]),c}function g(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new p(n??o,r,4)])}function b(t,e,r){t.attributeData.normal&&e.push(["normal",new p(t.attributeData.normal,r,3)])}function y(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new p([n],o,1,!0)]):e.push(["colorFeatureAttribute",new p(n,r,1,!0)]))}function w(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new p([t.attributeData.size??1],r,1,!0)])}function d(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new p([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new p(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new p(o,i,S,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new p([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new p(n,r,1,!0)]))}function j(r,o,s){if(null==r
|
|
2
|
+
import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as c}from"../../layers/graphics/olidUtils.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";function m(t,e,r=null){const o=[],n=e.mapPositions,i=h(e,o),a=i.data,u=i.indices.length,s=l(u);return g(e,o,s),w(e,o,s),b(e,o,s),y(e,o,i.indices,s),d(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),j(e,o,a),null!=r&&c(o,r,s),new f(t,o,n)}function h(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=r.length/3,i=n>2&&A(r)&&o,a=n-(i?1:0),u=new Array(2*(a-1)),s=i?r.slice(0,-3):r;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;const c=new p(s,u,3,i);return e.push(["position",c]),c}function g(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new p(n??o,r,4)])}function b(t,e,r){t.attributeData.normal&&e.push(["normal",new p(t.attributeData.normal,r,3)])}function y(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new p([n],o,1,!0)]):e.push(["colorFeatureAttribute",new p(n,r,1,!0)]))}function w(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new p([t.attributeData.size??1],r,1,!0)])}function d(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new p([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new p(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new p(o,i,S,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new p([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new p(n,r,1,!0)]))}function j({overlayInfo:r},o,s){if(null==r||1!==r.renderCoordsHelper.viewingMode||!r.spatialReference.isGeographic)return;const l=a(s.length),c=n(r.spatialReference);for(let t=0;t<l.length;t+=3)i(s,t,l,t,c);const f=s.length/3,m=u(f+1);let h=v,g=z,b=0,y=0;t(h,l[y++],l[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(g,l[y++],l[y++]),y++,b+=e(h,g),m[n]=b,[h,g]=[g,h];o.push(["distanceToStart",new p(m,o[0][1].indices,1,!0)])}function A(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const v=r(),z=r(),S=4;function E(t,e,r,o,n){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,u)=>{const s=t.length,l=a(3*s);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[u],opacityFeature:o?.[u],sizeFeature:n?.[u]},removeDuplicateStartEnd:!1};i.push(c)}),i}function x(t,e,r,o,n,i){if(null==t||0===t.length)return[];const a=E(t,e,o,n,i);return t.forEach((t,e)=>{const o=r?.[e],n=null!=o?H(o.timeStamps,o.stage):void 0;a[e].attributeData.timeStamps=n}),a}function G(t,e=0,r=.01){const o=s(t.length);o[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],n=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);o[i]=o[i-1]+n}const n=o.map(t=>t*r);if(0!==e&&e<n.length){const t=n[e];for(let e=0;e<n.length;e++)n[e]-=t}return n}function H(t,e){const r=s(t.length*S),o=t[0],n=t[t.length-1];for(let i=0;i<t.length;i++)r[i*S]=t[i],r[i*S+1]=o,r[i*S+2]=n,r[i*S+3]=e+.5;return r}export{x as animatedLineStripsToParameters,m as createGeometry,G as getLinearTimeStamps,E as lineStripsToParameters,S as numTimeStampValuesPerVertex,H as timeStampsToAttribute};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{ShaderOutputConfiguration as r}from"./ShaderOutputConfiguration.js";import{If as i,glsl as
|
|
2
|
+
import{__decorate as e}from"tslib";import{ShaderOutputConfiguration as r}from"./ShaderOutputConfiguration.js";import{If as i,glsl as t}from"../shaderModules/glsl.js";import{parameter as o}from"../shaderTechnique/ShaderTechniqueConfiguration.js";class a extends r{constructor(e){super(),this.spherical=e,this.receiveShadows=!0,this.draped=!1}}function n(e){e.varyings.add("linearDepth","float",{invariant:!0})}function s(e,r){r&&n(e),e.vertex.code.add(t`
|
|
3
3
|
void forwardLinearDepth(float _linearDepth) { ${i(r,"linearDepth = _linearDepth;")} }
|
|
4
|
-
`)}e([
|
|
4
|
+
`)}e([o()],a.prototype,"receiveShadows",void 0);export{s as ForwardLinearDepth,a as ForwardLinearDepthConfiguration,n as addLinearDepth};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ForwardLinearDepth as r}from"./ForwardLinearDepth.glsl.js";import{isShadowLike as e}from"./ShaderOutput.js";import{VertexPosition as a}from"./attributes/VertexPosition.glsl.js";import{
|
|
2
|
+
import{ForwardLinearDepth as r}from"./ForwardLinearDepth.glsl.js";import{isShadowLike as e}from"./ShaderOutput.js";import{VertexPosition as a}from"./attributes/VertexPosition.glsl.js";import{nearFar as t}from"./util/cameraUniforms.js";import{glsl as o,If as i}from"../shaderModules/glsl.js";function n(r){r.vertex.code.add(o`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
3
3
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
4
|
-
}`)}function
|
|
4
|
+
}`)}function d(d,s){const{vertex:l}=d,p=e(s.output);p&&(d.include(a,s),r(d,!0),l.uniforms.add(t),n(d)),l.code.add(o`
|
|
5
5
|
void forwardLinearDepthToWriteShadowMap() {
|
|
6
|
-
${
|
|
6
|
+
${i(p,"forwardLinearDepth(calculateLinearDepth(nearFar, vPosition_view.z));")}
|
|
7
7
|
}
|
|
8
|
-
`)}export{
|
|
8
|
+
`)}export{d as ForwardLinearDepthToWriteShadowMap,n as addCalculateLinearDepth};
|
package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{normalFromMat4 as e}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{IDENTITY as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import{normalFromMat4 as e}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{IDENTITY as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewNormal as i}from"../util/cameraUniforms.js";import{DoublePrecision as t}from"../util/DoublePrecision.glsl.js";import{Float3BindUniform as s}from"../../shaderModules/Float3BindUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{Matrix3PassUniform as m}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as c}from"../../shaderModules/Matrix4PassUniform.js";import{encodeDoubleHi as d,encodeDoubleLo as v}from"../../../../../webgl/doublePrecisionUtils.js";import{NoParameters as g}from"../../../../../webgl/NoParameters.js";class u extends g{constructor(){super(...arguments),this.modelTransformation=null}}const x=r();function p(r,n){const{hasModelTransformation:g,instancedDoublePrecision:u,instanced:p,output:f,hasVertexTangents:w}=n;g&&(r.vertex.uniforms.add(new c("model",e=>e.modelTransformation??o)),r.vertex.uniforms.add(new m("normalLocalOriginFromModel",r=>(e(x,r.modelTransformation??o),x)))),p&&u&&(r.attributes.add("instanceModelOriginHi","vec3"),r.attributes.add("instanceModelOriginLo","vec3"),r.attributes.add("instanceModel","mat3"),r.attributes.add("instanceModelNormal","mat3"));const _=r.vertex;u&&(_.include(t),_.uniforms.add(new s("viewOriginHi",e=>d(a(M,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),M)),new s("viewOriginLo",e=>v(a(M,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),M)))),_.code.add(l`
|
|
3
3
|
vec3 getVertexInLocalOriginSpace() {
|
|
4
|
-
return ${g?
|
|
4
|
+
return ${g?u?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":u?"instanceModel * localPosition().xyz":"localPosition().xyz"};
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
vec3 subtractOrigin(vec3 _pos) {
|
|
8
|
-
${
|
|
8
|
+
${u?l`
|
|
9
9
|
// Issue: (should be resolved now with invariant position) https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
|
|
10
10
|
vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
|
|
11
11
|
return _pos - originDelta;`:"return vpos;"}
|
|
12
12
|
}
|
|
13
13
|
`),_.code.add(l`
|
|
14
14
|
vec3 dpNormal(vec4 _normal) {
|
|
15
|
-
return normalize(${g?
|
|
15
|
+
return normalize(${g?u?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":u?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
|
|
16
16
|
}
|
|
17
|
-
`),4===f&&(
|
|
17
|
+
`),4===f&&_.uniforms.add(i).code.add(l`
|
|
18
18
|
vec3 dpNormalView(vec4 _normal) {
|
|
19
|
-
return normalize((viewNormal * ${g?
|
|
19
|
+
return normalize((viewNormal * ${g?u?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":u?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
|
|
20
20
|
}
|
|
21
|
-
`)
|
|
21
|
+
`),w&&_.code.add(l`
|
|
22
22
|
vec4 dpTransformVertexTangent(vec4 _tangent) {
|
|
23
|
-
${g?
|
|
24
|
-
}`)}const M=n();export{
|
|
23
|
+
${g?u?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":u?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
24
|
+
}`)}const M=n();export{u as InstancedDoublePassParameters,p as InstancedDoublePrecision};
|
package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{SliceDraw as o}from"../Slice.glsl.js";import{Transform as e}from"../Transform.glsl.js";import{NormalAttribute as r}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as t}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as i}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as a}from"../attributes/VertexNormal.glsl.js";import{DefaultMaterialExternalColor as l}from"./DefaultMaterialExternalColor.glsl.js";import{outputDepth as s}from"../output/OutputDepth.glsl.js";import{OutputHighlight as d}from"../output/OutputHighlight.glsl.js";import{VisualVariables as n}from"../shading/VisualVariables.glsl.js";import{nearFar as c}from"../util/cameraUniforms.js";import{DiscardOrAdjustAlphaPass as u}from"../util/DiscardOrAdjustAlpha.glsl.js";import{addProjViewLocalOrigin as p}from"../util/View.glsl.js";import{glsl as m,If as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as f}from"../../shaderModules/Texture2DPassUniform.js";function g(g,x){const{vertex:O,fragment:j,varyings:h}=g,{hasColorTexture:C,alphaDiscardMode:w}=x,V=C&&1!==w,{output:b,normalType:A,hasColorTextureTransform:y}=x;switch(b){case 3:p(O,x),g.include(e),j.include(o,x),g.include(i,x),V&&j.uniforms.add(new f("tex",o=>o.texture)),O.main.add(m`vpos = getVertexInLocalOriginSpace();
|
|
3
3
|
vpos = subtractOrigin(vpos);
|
|
4
4
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
5
5
|
gl_Position = transformPosition(proj, view, vpos);
|
|
6
|
-
forwardTextureCoordinates();`),g.include(u,x),j.main.add(
|
|
6
|
+
forwardTextureCoordinates();`),g.include(u,x),j.main.add(m`
|
|
7
7
|
discardBySlice(vpos);
|
|
8
|
-
${
|
|
9
|
-
discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:p(O,x),g.include(
|
|
8
|
+
${v(V,m`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
|
|
9
|
+
discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:p(O,x),g.include(e),g.include(i,x),g.include(n,x),g.include(s,x),j.include(o,x),g.include(t,x),h.add("depth","float",{invariant:!0}),V&&j.uniforms.add(new f("tex",o=>o.texture)),O.uniforms.add(c).main.add(m`vpos = getVertexInLocalOriginSpace();
|
|
10
10
|
vpos = subtractOrigin(vpos);
|
|
11
11
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
12
12
|
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
13
13
|
forwardTextureCoordinates();
|
|
14
|
-
forwardObjectAndLayerIdColor();`),g.include(u,x),j.main.add(
|
|
14
|
+
forwardObjectAndLayerIdColor();`),g.include(u,x),j.main.add(m`
|
|
15
15
|
discardBySlice(vpos);
|
|
16
|
-
${
|
|
16
|
+
${v(V,m`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
|
|
17
17
|
discardOrAdjustAlpha(texColor);`)}
|
|
18
|
-
${11===b?
|
|
18
|
+
${11===b?m`outputObjectAndLayerIdColor();`:m`outputDepth(depth);`}`);break;case 4:{p(O,x),g.include(e),g.include(r,x),g.include(a,x),g.include(i,x),g.include(n,x),g.include(l,x),V&&j.uniforms.add(new f("tex",o=>o.texture)),2===A&&h.add("vPositionView","vec3",{invariant:!0});const t=0===A||1===A;O.main.add(m`
|
|
19
19
|
forwardDefaultMaterialExternalColor();
|
|
20
20
|
|
|
21
21
|
if (shouldCullByOpacity()) {
|
|
@@ -24,26 +24,26 @@ forwardObjectAndLayerIdColor();`),g.include(u,x),j.main.add(v`
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
vpos = getVertexInLocalOriginSpace();
|
|
27
|
-
${
|
|
27
|
+
${t?m`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:m`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
|
|
28
28
|
vpos = subtractOrigin(vpos);
|
|
29
29
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
30
30
|
gl_Position = transformPosition(proj, view, vpos);
|
|
31
|
-
forwardTextureCoordinates();`),j.include(
|
|
31
|
+
forwardTextureCoordinates();`),j.include(o,x),g.include(u,x),j.main.add(m`
|
|
32
32
|
discardBySlice(vpos);
|
|
33
|
-
${
|
|
34
|
-
discardOrAdjustAlpha(texColor);`,
|
|
33
|
+
${v(V,m`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
|
|
34
|
+
discardOrAdjustAlpha(texColor);`,m`vec4 texColor = vec4(1.0);`)}
|
|
35
35
|
float opacity = getDefaultMaterialOpacity(texColor.a);
|
|
36
36
|
|
|
37
|
-
${2===A?
|
|
37
|
+
${2===A?m`vec3 normal = screenDerivativeNormal(vPositionView);`:m`vec3 normal = normalize(vNormalWorld);
|
|
38
38
|
if (gl_FrontFacing == false){
|
|
39
39
|
normal = -normal;
|
|
40
40
|
}`}
|
|
41
|
-
fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:p(O,x),g.include(
|
|
41
|
+
fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:p(O,x),g.include(e),g.include(i,x),g.include(n,x),V&&j.uniforms.add(new f("tex",o=>o.texture)),O.main.add(m`vpos = getVertexInLocalOriginSpace();
|
|
42
42
|
vpos = subtractOrigin(vpos);
|
|
43
43
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
44
44
|
gl_Position = transformPosition(proj, view, vpos);
|
|
45
|
-
forwardTextureCoordinates();`),j.include(
|
|
45
|
+
forwardTextureCoordinates();`),j.include(o,x),g.include(u,x),g.include(d,x),j.main.add(m`
|
|
46
46
|
discardBySlice(vpos);
|
|
47
|
-
${
|
|
47
|
+
${v(V,m`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
|
|
48
48
|
discardOrAdjustAlpha(texColor);`)}
|
|
49
49
|
calculateOcclusionAndOutputHighlight();`)}}export{g as DefaultMaterialAuxiliaryPasses};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{addVerticalOffset as e}from"../attributes/VerticalOffset.glsl.js";import{
|
|
2
|
+
import{addVerticalOffset as e}from"../attributes/VerticalOffset.glsl.js";import{viewport as t,viewNormal as o}from"../util/cameraUniforms.js";import{ScreenSizePerspective as a,addScreenSizePerspectiveAlignment as s}from"../util/ScreenSizePerspective.glsl.js";import{addProjViewLocalOrigin as i,addCameraPosition as n,addPixelRatio as r}from"../util/View.glsl.js";import{FloatBindUniform as f}from"../../shaderModules/FloatBindUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{glsl as c}from"../../shaderModules/glsl.js";const p=.5;function d(d,u){const v=d.vertex;d.include(a),d.attributes.add("position","vec3"),d.vertex.inputs.add("position",()=>"position"),d.attributes.add("normal","vec3"),u.hasVertexCenterOffset?d.attributes.add("centerOffset","vec3"):v.constants.add("centerOffset","vec3",[0,0,0]),d.attributes.add("groundDistance","float"),i(v,u),n(v,u),v.uniforms.add(t,new l("polygonOffset",e=>e.shaderPolygonOffset),new f("aboveGround",e=>e.camera.aboveGround?1:-1)),u.hasVerticalOffset&&e(v),v.code.add(c`struct ProjectHUDAux {
|
|
3
3
|
vec3 posModel;
|
|
4
4
|
vec3 posView;
|
|
5
5
|
vec3 vnormal;
|
|
@@ -23,7 +23,7 @@ posView /= factor;
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return groundRelative;
|
|
26
|
-
}`),u.draped&&!u.hasVerticalOffset||
|
|
26
|
+
}`),u.draped&&!u.hasVerticalOffset||v.uniforms.add(o),u.draped||(v.uniforms.add(new f("perDistancePixelRatio",e=>Math.tan(e.camera.fovY/2)/(e.camera.fullViewport[2]/2))),v.code.add(c`
|
|
27
27
|
void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) {
|
|
28
28
|
float distanceToCamera = length(posView);
|
|
29
29
|
|
|
@@ -39,7 +39,7 @@ return groundRelative;
|
|
|
39
39
|
posModel += modelOffset;
|
|
40
40
|
posView += viewOffset;
|
|
41
41
|
}
|
|
42
|
-
`)),u.screenCenterOffsetUnitsEnabled&&
|
|
42
|
+
`)),u.screenCenterOffsetUnitsEnabled&&r(v),u.hasScreenSizePerspective&&s(v),v.code.add(c`
|
|
43
43
|
vec4 projectPositionHUD(out ProjectHUDAux aux) {
|
|
44
44
|
float pointGroundDistance = groundDistance;
|
|
45
45
|
aux.posModel = position;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import{__decorate as e}from"tslib";import{markerSizePerLineWidth as r}from"../../../../support/engineContent/marker.js";import{addPixelRatio as o}from"../util/View.glsl.js";import{FloatBindUniform as t}from"../../shaderModules/FloatBindUniform.js";import{FloatPassUniform as i}from"../../shaderModules/FloatPassUniform.js";import{If as a,glsl as n}from"../../shaderModules/glsl.js";import{parameter as s}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{ViewingModeConfiguration as d}from"../../../materials/ViewingModeConfiguration.js";import{NoParameters as l}from"../../../../../webgl/NoParameters.js";class c extends d{constructor(){super(...arguments),this.hasScreenSizePerspective=!1,this.worldSized=!1}}e([s()],c.prototype,"hasScreenSizePerspective",void 0),e([s()],c.prototype,"worldSized",void 0);class m extends l{constructor(){super(...arguments),this.markerScale=1}}function p(e,s){const d=e.vertex,l=s.hasScreenSizePerspective,c=s.worldSized;o(d),d.constants.add("markerSizePerLineWidth","float",r).uniforms.add(new t("worldToScreenRatio",e=>1/e.screenToPCSRatio),new i("markerScale",({markerScale:e})=>e)).code.add(n`
|
|
3
|
+
float getLineWidth(${a(l,"vec3 pos")}) {
|
|
4
|
+
float size = max(getSize(${a(l,"pos")}), 1.0);
|
|
5
|
+
return ${a(c,"size * pixelRatio * worldToScreenRatio","size * pixelRatio")};
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
float getScreenMarkerSize(float lineWidth) {
|
|
9
|
+
return markerScale * markerSizePerLineWidth * lineWidth;
|
|
10
|
+
}
|
|
11
|
+
`),d.constants.add("maxSegmentLengthFraction","float",.45).uniforms.add(new t("perRenderPixelRatio",e=>e.camera.perRenderPixelRatio)).code.add(n`
|
|
12
|
+
bool areWorldMarkersHidden(vec3 pos, vec3 other) {
|
|
13
|
+
vec3 midPoint = mix(pos, other, 0.5);
|
|
14
|
+
float distanceToCamera = length(midPoint);
|
|
15
|
+
float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
|
|
16
|
+
float worldMarkerSize = getScreenMarkerSize(getLineWidth(${a(l,"pos")})) * screenToWorldRatio;
|
|
17
|
+
float segmentLen = length(pos - other);
|
|
18
|
+
return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
float getWorldMarkerSize(vec3 pos) {
|
|
22
|
+
float distanceToCamera = length(pos);
|
|
23
|
+
float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
|
|
24
|
+
return getScreenMarkerSize(getLineWidth(${a(l,"pos")})) * screenToWorldRatio;
|
|
25
|
+
}
|
|
26
|
+
`)}export{p as MarkerSizing,c as MarkerSizingConfiguration,m as MarkerSizingPassParameters};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{
|
|
2
|
+
import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{projMatrix as t,nearFar as o}from"../util/cameraUniforms.js";import{FloatBindUniform as r}from"../../shaderModules/FloatBindUniform.js";import{If as i,glsl as a}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as n}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as c}from"../../shaderModules/Texture2DBindUniform.js";function s(s,d){const p=s.fragment;p.include(e),p.uniforms.add(t,o,new c("depthMap",e=>e.depth?.attachment),new r("invResolutionHeight",e=>1/e.camera.height),new n("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(a`
|
|
3
3
|
vec2 reprojectionCoordinate(vec3 projectionCoordinate) {
|
|
4
4
|
vec4 clipDepthCoordinate = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
|
|
5
5
|
vec4 reprojectedCoordinate = reprojectionMatrix * vec4(
|
|
@@ -31,7 +31,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
|
|
|
31
31
|
vec2 projectedCoordEnd = applyProjectionMat(proj, startPosition + rayDirection * rayDistanceWorld).xy;
|
|
32
32
|
vec2 projectedCoordOffset = projectedCoordEnd - projectedCoordStart;
|
|
33
33
|
|
|
34
|
-
return ${
|
|
34
|
+
return ${d.useProjectedRayLength?"length(projectedCoordOffset)":"abs(projectedCoordOffset.y)"};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
vec3 screenSpaceIntersectionWithLimits(
|
|
@@ -64,7 +64,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
|
|
|
64
64
|
vec2 projectedCoordDirection = (projectedCoordEnd.xy - projectedCoordStart.xy);
|
|
65
65
|
vec2 vanishingPointScreenOffset = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);
|
|
66
66
|
|
|
67
|
-
float rayMarchDistance = ${
|
|
67
|
+
float rayMarchDistance = ${d.useProjectedRayLength?"length(vanishingPointScreenOffset.xy)":"abs(vanishingPointScreenOffset.y)"};
|
|
68
68
|
float clampedRayMarchDistance = min(rayMarchDistance, rayMarchMaxReach);
|
|
69
69
|
|
|
70
70
|
float projectedCoordDirectionLength = length(projectedCoordDirection);
|
|
@@ -154,7 +154,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
${
|
|
157
|
+
${i(!d.clampRayToScreen,"if (projectedPosition.x <= 0.0 || projectedPosition.x >= 1.0) {\n return firstSegmentHit;\n }")}
|
|
158
158
|
|
|
159
159
|
// Continue with ray marching
|
|
160
160
|
projectedPosition = projectedPosition + projectedStep;
|
|
@@ -162,7 +162,7 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
|
|
|
162
162
|
inverseW += inverseWStep;
|
|
163
163
|
previousEstimatedDepthDifference = estimatedDepthDifference;
|
|
164
164
|
|
|
165
|
-
${
|
|
165
|
+
${i(d.clampRayToScreen,"projectedPosition = clamp(projectedPosition, vec2(0.0), vec2(0.999));")}
|
|
166
166
|
}
|
|
167
167
|
return firstSegmentHit;
|
|
168
168
|
}
|
|
@@ -174,8 +174,8 @@ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform
|
|
|
174
174
|
viewDirection,
|
|
175
175
|
normal,
|
|
176
176
|
rayStepOffset,
|
|
177
|
-
${
|
|
178
|
-
${
|
|
177
|
+
${a.float(d.rayMarchMaxReach)},
|
|
178
|
+
${a.float(d.rayMarchMaxSteps)}
|
|
179
179
|
);
|
|
180
180
|
}
|
|
181
|
-
`)}export{
|
|
181
|
+
`)}export{s as ScreenSpaceRayMarching};
|