@arcgis/core 4.34.0-next.30 → 4.34.0-next.31
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/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0ca8d6516323fc28dd58.js +1 -0
- package/assets/esri/core/workers/chunks/{031c4b4bf78079d0002d.js → 36024406932b0a44a74a.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e267a813e8b10d10b3b.js → 37bfc1a771792b6697fd.js} +121 -140
- package/assets/esri/core/workers/chunks/42c5d957813080143e5a.js +1 -0
- package/assets/esri/core/workers/chunks/6269c4bbf0f224a954e9.js +1 -0
- package/assets/esri/core/workers/chunks/871da12fb3029177df6f.js +1 -0
- package/assets/esri/core/workers/chunks/8abcf9d3343dd8d45103.js +1 -0
- package/assets/esri/core/workers/chunks/ac88e0aabbd6c1f1ec98.js +1 -0
- package/assets/esri/core/workers/chunks/{e7209654ecdfde926272.js → eec36628e638e244f452.js} +1 -1
- package/chunks/ComponentShader.glsl.js +34 -33
- package/chunks/DefaultMaterial.glsl.js +25 -25
- package/chunks/Path.glsl.js +20 -24
- package/chunks/RealisticTree.glsl.js +18 -20
- package/chunks/Terrain.glsl.js +32 -33
- package/chunks/WaterSurface.glsl.js +16 -16
- package/config.js +1 -1
- package/core/workers/registry.js +1 -1
- package/interfaces.d.ts +22 -25
- package/kernel.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +5 -0
- package/views/3d/support/flow/FlowWorkerHandle.js +5 -0
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -5
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +7 -0
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +11 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -2
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/TextureUpdater.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/checkWebGLError.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/278df50f2c557be81808.js +0 -1
- package/assets/esri/core/workers/chunks/2931fd6bb123200622c2.js +0 -1
- package/assets/esri/core/workers/chunks/4cf2894bda9e38af8790.js +0 -1
- package/assets/esri/core/workers/chunks/6a0777cf1270fcab4574.js +0 -1
- package/assets/esri/core/workers/chunks/9723512bc9db4a301c72.js +0 -1
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const b="20250705",d="792c5a52a6bdb664162932d1b870e0256f9f9e7d";export{b as buildDate,d as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyHandle as o,makeHandle as s,abortHandle as i}from"../../../../core/handleUtils.js";import{debounce as n}from"../../../../core/promiseUtils.js";import{initial as r}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{ViewEventPriorities as c}from"../../../input/InputManager.js";const h={redo:"r",undo:"z"},p=Symbol(),m=Symbol(),_=Symbol();let u=class extends t{constructor(e){super(e),this._tool=null,this._updatingHandles=new d,this.enabled=!1,this._onPointerMove=n(async e=>{const t=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(m),t&&t!==this.selectedElement&&this.addHandles(this.view.acquireCursor("pointer","high"),m))})}initialize(){this.addHandles(o(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,e=>this._setEnabled(e),r),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const e=this.selectedElement;if(!e)return null;const{layer:{source:t}}=this;return t?"hasElement"in t?t.hasElement(e)?e:null:t===e?e:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(e){if(this.removeHandles(p),!e)return;const{view:t}=this;this.addHandles([t.on("immediate-click",e=>this._onClick(e),c.TOOL),t.on("pointer-move",e=>this._onPointerMove(e).catch(()=>{}),c.TOOL),t.on("key-down",e=>{e.key===h.undo&&this._tool?.canUndo()&&(this._tool.undo(),e.stopPropagation()),e.key===h.redo&&this._tool?.canRedo()&&(this._tool.redo(),e.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,e=>this._selectedElementChanged(e),r),s(()=>{this.removeHandles(m),this._removeTool()})],p)}async _findElementAtScreenPoint(e){const t=(await this.view.hitTest(e,{include:[this.layer]})).results[0];return"media"===t?.type?t.element:null}async _onClick(e){await this._updatingHandles.addPromise(e.defer(async()=>{const t=await this._findElementAtScreenPoint(e);this.destroyed||(t&&e.stopPropagation(),this.selectedElement=t,this.selectedElement&&this.removeHandles(m))}))}_preferredInteractionToolChanged(){const{_tool:e}=this;e&&(this._preferredInteractionTool===e.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(_),this._removeTool();const e=this._validatedSelectedElement;if(!e)return;const t=new AbortController;this.addHandles(i(t),_);const{TransformTool:o,ControlPointsTransformTool:n}=await import("../../interactive/editingTools.js");if(t.signal.aborted)return;const{view:r}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:e,view:r});break;case"reshape":this._tool=new n({mediaElement:e,view:r})}this.addHandles(s(()=>{this._tool&&(r.tools.remove(this._tool),this._tool=null)}),this._tool),r.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(e){e?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};e([a()],u.prototype,"_validatedSelectedElement",null),e([a()],u.prototype,"_preferredInteractionTool",null),e([a({constructOnly:!0})],u.prototype,"view",void 0),e([a({constructOnly:!0})],u.prototype,"layer",void 0),e([a()],u.prototype,"selectedElement",void 0),e([a()],u.prototype,"enabled",void 0),e([a()],u.prototype,"options",void 0),e([a()],u.prototype,"updating",null),u=e([l("esri.views.2d.layers.support.MediaLayerInteraction")],u);export{u as MediaLayerInteraction};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as
|
|
5
|
+
import{__decorate as e}from"tslib";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as n}from"../../../core/time.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as d}from"../../../geometry/support/Indices.js";import{InternalRenderCategory as m}from"../webgl.js";import{PrecipitationPassParameters as h,PrecipitationTechnique as f}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as u}from"./PrecipitationTechniqueConfiguration.js";import{glLayout as l}from"../support/buffer/glUtil.js";import{newLayout as _}from"../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as b}from"../webgl-engine/effects/TransparentEnvironment.js";import{VertexArrayObject as y}from"../webgl-engine/lib/VertexArrayObject.js";import{BufferObject as g}from"../../webgl/BufferObject.js";import{PrimitiveType as j}from"../../webgl/enums.js";import{bindVertexBufferLayout as w}from"../../webgl/Util.js";let P=class extends b{constructor(e){super(e),this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new h,this._configuration=new u;const{view:t,type:r}=e;this._configuration.type="rainy"===r?0:1,t.stage.renderView.techniques.precompile(f,this._configuration),this._passParameters.time=0,this._passParameters.radius=p(t.spatialReference).radius,this.addHandles([s(()=>t.environment.weather,e=>{e.type===r&&this.addHandles(s(()=>e.precipitation,e=>this._adjustParticles(e),i))},i)]),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,i),"opacity"))},o),"opacity")}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}_adjustParticles(e){const r=.35,s=e<.5?t(0,r,2*e):t(r,1,2*(e-.5));this._numParticles=I*s}destroy(){this._numParticles=0,this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(s(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*n(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=this.renderingContext,r=Math.round(this._numParticles*this._passParameters.opacity),s=e.find(({name:e})=>e===m.TRANSPARENT_ENVIRONMENT);if(r<1)return s;const i=this.techniques.get(f,this._configuration);if(!i.compiled)return this.requestRender(1),s;const o=t.bindTechnique(i,this.bindParameters,this._passParameters);return this._vao??=v(t,i.locations),t.bindVAO(this._vao),this._bindInstanceIdBuffer(i.locations),o.assertCompatibleVertexAttributeLocations(this._vao),t.drawArraysInstanced(j.TRIANGLES,0,3,r),t.unbindBuffer(34962),s}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const r=d(I);this._instanceIdBuffer=g.createVertex(t,35044,new Float32Array(r)),w(t,e,this._instanceIdBuffer,x,0)}};function v(e,t){const r=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,t,new Map([["geometry",l(A)]]),new Map([["geometry",g.createVertex(e,35044,r)]]))}e([a({constructOnly:!0})],P.prototype,"type",void 0),P=e([c("esri.views.3d.environment.Precipitation")],P);const I=25e4,A=_().vec3f("position"),x=l(_().f32("instanceFeatureAttribute"),1);export{P as Precipitation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../Color.js";import{multiplyOpacityToUnitRGBA as e,colorEquals as i,getContrast as s}from"../../../../../core/colorUtils.js";import a from"../../../../../core/Handles.js";import"../../../../../core/has.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as l}from"../../../../../core/screenUtils.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../../geometry/Point.js";import{Manipulator3D as u}from"../../Manipulator3D.js";import{createManipulatorMaterial as p}from"../../manipulatorUtils.js";import{RenderObject as c}from"../../RenderObject.js";import{PickResult as d}from"../support/PickRequest.js";import{LaserlineVisualElement as m}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as w}from"../../../webgl-engine/lib/GeometryUtil.js";import{ManipulatorCollection as v}from"../../../../interactive/ManipulatorCollection.js";import{newToolIntersector as g}from"../../../../interactive/ToolIntersector.js";class y{constructor(t){this.vertexManipulators=[],this._destroyed=!1,this._isManipulatorsOwner=!0,this._visible=!0,this._listenerHandles=null,this._tempHandlePosition=h();const{analysisViewData:e,manipulators:i,toolState:s,view:a,visible:r}=t;this._analysisViewData=e,this._toolState=s,null!=i?(this._manipulators=i,this._isManipulatorsOwner=!1):this._manipulators=new v,this._view=a,this._intersector=g(a.state.viewingMode);const o=p(this._handleColor),n=[new c(w(o,1,32,32))],l=new u({view:a,renderObjects:n});l.available=!1,l.radius=D,l.interactive=!1,this._manipulators.add(l),this._cursorManipulator=l,this._cursorManipulatorMaterial=o,this._laserLine=new m({view:a,attached:!0,style:{glowWidth:V,glowFalloff:M,innerWidth:b},isDecoration:!0}),this._updateVisibility(r??!0)}destroy(){this._listenerHandles=r(this._listenerHandles),this._isManipulatorsOwner?this._manipulators=r(this._manipulators):this._manipulators=null,this._laserLine=r(this._laserLine),this._destroyed=!0}get destroyed(){return this._destroyed}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){}show(){this._setVisibility(!0)}hide(){this._setVisibility(!1)}_setVisibility(t){this._destroyed||this._visible===t||this._updateVisibility(t)}_updateVisibility(t){this._visible=t,this._laserLine.visible=t,t?(this._initializeListeners(),this._updateAll()):(this._destroyListeners(),this.vertexManipulators.forEach(({manipulator:t})=>this._removeVertexManipulator(t)),this.vertexManipulators=[]
|
|
5
|
+
import t from"../../../../../Color.js";import{multiplyOpacityToUnitRGBA as e,colorEquals as i,getContrast as s}from"../../../../../core/colorUtils.js";import a from"../../../../../core/Handles.js";import"../../../../../core/has.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as l}from"../../../../../core/screenUtils.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../../geometry/Point.js";import{Manipulator3D as u}from"../../Manipulator3D.js";import{createManipulatorMaterial as p}from"../../manipulatorUtils.js";import{RenderObject as c}from"../../RenderObject.js";import{PickResult as d}from"../support/PickRequest.js";import{LaserlineVisualElement as m}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as w}from"../../../webgl-engine/lib/GeometryUtil.js";import{ManipulatorCollection as v}from"../../../../interactive/ManipulatorCollection.js";import{newToolIntersector as g}from"../../../../interactive/ToolIntersector.js";class y{constructor(t){this.vertexManipulators=[],this._destroyed=!1,this._isManipulatorsOwner=!0,this._visible=!0,this._listenerHandles=null,this._tempHandlePosition=h();const{analysisViewData:e,manipulators:i,toolState:s,view:a,visible:r}=t;this._analysisViewData=e,this._toolState=s,null!=i?(this._manipulators=i,this._isManipulatorsOwner=!1):this._manipulators=new v,this._view=a,this._intersector=g(a.state.viewingMode);const o=p(this._handleColor),n=[new c(w(o,1,32,32))],l=new u({view:a,renderObjects:n});l.available=!1,l.radius=D,l.interactive=!1,this._manipulators.add(l),this._cursorManipulator=l,this._cursorManipulatorMaterial=o,this._laserLine=new m({view:a,attached:!0,style:{glowWidth:V,glowFalloff:M,innerWidth:b},isDecoration:!0}),this._updateVisibility(r??!0)}destroy(){this._listenerHandles=r(this._listenerHandles),this._isManipulatorsOwner?this._manipulators=r(this._manipulators):this._manipulators=null,this._laserLine=r(this._laserLine),this._destroyed=!0}get destroyed(){return this._destroyed}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){}show(){this._setVisibility(!0)}hide(){this._setVisibility(!1)}_setVisibility(t){this._destroyed||this._visible===t||this._updateVisibility(t)}_updateVisibility(t){this._visible=t,this._laserLine.visible=t,t?(this._initializeListeners(),this._updateAll()):(this._destroyListeners(),this.vertexManipulators.forEach(({manipulator:t})=>this._removeVertexManipulator(t)),this.vertexManipulators=[])}vertexHandleAt(t,e){const i=this._manipulators.intersect(t,e);return i?.metadata}pick(t){const e=this._view.spatialReference,i=l(t.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=h();if(!s.getIntersectionPoint(a))return null;const r=this._view.renderCoordsHelper.fromRenderCoords(a,new _({spatialReference:e}));return null==r?null:new d(a,r)}_updateAll(){this._visible&&(this._updateVertexManipulators(),this._updateLaserLine())}_createVertexManipulator(){const t=p(this._handleColor),e=[new c(w(t,1,32,32))],i=new u({view:this._view,renderObjects:e});return i.radius=D,this._manipulators.add(i),{manipulator:i,material:t}}_removeVertexManipulator(t){this._manipulators.remove(t)}_updateVertexManipulators(){const{viewData:t}=this._analysisViewData,e=this._analysisViewData.path?this._analysisViewData.path.vertices:[],i=this.vertexManipulators;f(i,e.length,()=>this._createVertexManipulator(),({manipulator:t})=>this._removeVertexManipulator(t)),i.forEach(({manipulator:i},s)=>{i.metadata=e[s],i.renderLocation=t.positionsRender[s],i.cursor=0===s&&"drawing"===this._toolState.polygonState?"crosshair":null}),"drawing"===this._toolState.polygonState&&null!=this._analysisViewData.stagedPoint?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this._analysisViewData.stagedPoint):this._cursorManipulator.available=!1}get _handleColor(){return e(this._view.effectiveTheme.accentColor,.5)}_getFocusPoint(){const{lastDraggedVertex:t}=this._analysisViewData;switch(this._toolState.polygonState){case"drawing":return null!=this._analysisViewData.stagedPoint?this._analysisViewData.stagedPoint:null!=t?this._analysisViewData.path.getVertexPositionAsPoint(t):this._analysisViewData.path.lastPoint;case"editing":return null!=t?this._analysisViewData.path.getVertexPositionAsPoint(t):null;default:return this._analysisViewData.stagedPoint}}_updateLaserLine(){const t="measured"!==this._toolState.polygonState&&this._toolState.active,e=this._getFocusPoint();if(t&&null!=e){const t=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(e,t),this._laserLine.heightManifoldTarget=t}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new a,this._listenerHandles.add([o(()=>this._toolState.polygonState,()=>this._updateLaserLine()),o(()=>this._analysisViewData.viewData,()=>this._updateAll(),n),o(()=>({lastDraggedVertex:this._analysisViewData.lastDraggedVertex,cursorPoint:this._analysisViewData.stagedPoint}),()=>this._updateLaserLine()),o(()=>this._toolState.active,()=>this._updateAll()),o(()=>this._view.effectiveTheme.accentColor,i=>{const a=e(i,.5);for(const{material:t}of this.vertexManipulators)t.setParameters({color:a});this._cursorManipulatorMaterial.setParameters({color:a});const r=t.toUnitRGB(i),o=t.toUnitRGB(s(i)),n=.75*i.a,l=this._laserLine,h=l.style;l.style={...h,glowColor:r,innerColor:o,globalAlpha:n}},{initial:!0,equals:i})])}_destroyListeners(){this._listenerHandles=r(this._listenerHandles)}}function f(t,e,i,s){for(;t.length<e;)t.push(i());if(s)for(;t.length>e;){s(t.pop())}else t.length=e}const V=8,M=8,b=1,D=5;export{y as default};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../../Color.js";import i from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as s,getContrast as o,colorVectorEquals as n,colorVectorToColorAndOpacity as
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../../Color.js";import i from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as s,getContrast as o,colorVectorEquals as n,colorVectorToColorAndOpacity as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as l,initial as d}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPoints as u}from"../../../../../geometry/support/lineSegment.js";import{Manipulator3D as m}from"../../Manipulator3D.js";import{createManipulatorMaterial as g}from"../../manipulatorUtils.js";import{RenderObject as _}from"../../RenderObject.js";import{LaserlineVisualElement as y}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as v}from"../../../webgl-engine/lib/GeometryUtil.js";let b=class extends i{constructor(t){super(t),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new y({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(l(()=>this._params,({laserLineGlowColor:t,laserLineInnerColor:e,laserLineGlobalAlpha:i})=>{const s=this._laserLine,o=s.style;s.style={...o,innerColor:e,glowColor:t,globalAlpha:i}}))}destroy(){this._laserLine=r(this._laserLine)}get _params(){const{accentColor:t}=this.view.effectiveTheme;return{laserLineGlowColor:e.toUnitRGB(t),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:e.toUnitRGB(o(t)),laserLineInnerWidth:.75,laserLineGlobalAlpha:.75*t.a,handleColor:s(t,.5),handleRadius:5}}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){}get _cursorPosition(){const t=p(),e=this.cursorPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _startPosition(){const t=p(),e=this.analysis.startPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _endPosition(){const t=p(),e=this.analysis.endPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _laserLineParams(){const t=this._focusPosition,{active:e,lineState:i}=this.toolState,s=this.analysisViewData,o=this.laserLineEnabled&&!!t&&"measured"!==i&&e;if(!o||!this.visible||null==s||s.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};const n=s.actualVisualizedMeasurement,a="local"!==this.view.viewingMode&&o&&!!this.analysis.startPoint&&"geodesic"===n,r=o&&2===s.viewMode;return{heightManifoldTarget:"euclidean"===n?t:null,pointDistanceLine:a?this._pointDistanceLine:null,lineVerticalPlaneSegment:r?u(this._startPosition,this._endPosition):null}}get _focusPosition(){const{lineState:t}=this.toolState,e=this.analysisViewData,i=null!=e&&!e.destroyed&&1===e.measurementMode&&1===e.viewMode;switch(t){case"drawing":return i?this._startPosition:this.analysis.endPoint?this._endPosition:this._startPosition;case"editing":return i?"start"===this._lastDraggedHandle?this._endPosition:this._startPosition:"start"===this._lastDraggedHandle?this._startPosition:this._endPosition;default:return null!=this.cursorPoint?this._cursorPosition:null}}get _pointDistanceLine(){return{origin:"drawing"===this.toolState.lineState||"end"===this._lastDraggedHandle?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){const t=this._params,{view:e}=this,i=()=>{const i=g(t.handleColor),s=[new _(v(i,1,32,32))],o=new m({view:e,renderObjects:s});return o.available=!1,o.radius=t.handleRadius,[o,i]},[s,o]=i(),[r,d]=i(),h=new m({view:this.view,available:!1,interactive:!1});null!=this.analysis.startPoint&&(s.location=this.analysis.startPoint,s.available=!0),null!=this.analysis.endPoint&&(r.location=this.analysis.endPoint,r.available=!0);const c=()=>{let t=this._lastDraggedHandle;s.grabbing&&!r.grabbing&&(t="start"),r.grabbing&&!s.grabbing&&(t="end"),s.grabbing||r.grabbing||(t=null),this._lastDraggedHandle=t},p=s.events.on("grab-changed",c),u=r.events.on("grab-changed",c);return this.addHandles([p,u,l(()=>a(this._params.handleColor),t=>{o.setParameters({color:t}),d.setParameters({color:t})},{equals:n})],"manipulators"),{start:s,end:r,cursor:h}}show(){this.destroyed||this._visible||this._updateVisibility(!0)}hide(){!this.destroyed&&this._visible&&this._updateVisibility(!1)}_connectToAnalysisView(){this.removeHandles("analysis-view"),this.addHandles([l(()=>this.analysisViewData?.destroyed,t=>{t&&this.removeHandles("analysis-view")},d),l(()=>["measured"===this.toolState.lineState,this.analysisViewData],([t,e])=>{null==e||e.destroyed||(e.allowVisualElementsOrientationChange=!t)},d),l(()=>this._laserLineParams,t=>{const e=this._laserLine;e.heightManifoldTarget=t.heightManifoldTarget,e.pointDistanceLine=t.pointDistanceLine,e.lineVerticalPlaneSegment=t.lineVerticalPlaneSegment},d)],"analysis-view")}_updateVisibility(t){this.initialized&&(this._visible=t,t&&(this._laserLine.style={innerColor:this._params.laserLineInnerColor,innerWidth:this._params.laserLineInnerWidth,glowColor:this._params.laserLineGlowColor,glowWidth:this._params.laserLineGlowWidth,glowFalloff:this._params.laserLineGlowFalloff,globalAlpha:this._params.laserLineGlobalAlpha}),this._laserLine.visible=t)}};t([h({constructOnly:!0})],b.prototype,"view",void 0),t([h()],b.prototype,"_params",null),t([h({constructOnly:!0})],b.prototype,"analysis",void 0),t([h({constructOnly:!0})],b.prototype,"analysisViewData",void 0),t([h()],b.prototype,"cursorPoint",void 0),t([h()],b.prototype,"toolState",void 0),t([h()],b.prototype,"visible",null),t([h()],b.prototype,"testData",null),t([h()],b.prototype,"_visible",void 0),t([h()],b.prototype,"_laserLine",void 0),t([h({constructOnly:!0})],b.prototype,"laserLineEnabled",void 0),t([h()],b.prototype,"_cursorPosition",null),t([h()],b.prototype,"_startPosition",null),t([h()],b.prototype,"_endPosition",null),t([h()],b.prototype,"_lastDraggedHandle",void 0),t([h()],b.prototype,"_laserLineParams",null),t([h()],b.prototype,"_focusPosition",null),t([h()],b.prototype,"_pointDistanceLine",null),b=t([c("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView")],b);export{b as DirectLineMeasurement3DView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t}from"../../../core/maybe.js";import{debounce as r,throwIfAborted as o,ignoreAbortErrors as s}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as a}from"../../../geometry/projectionUtils.js";import{fromExtent as u,toExtent as d}from"../../../geometry/support/aaBoundingRect.js";import p from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as c,getFlowSimulationSettings as
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t}from"../../../core/maybe.js";import{debounce as r,throwIfAborted as o,ignoreAbortErrors as s}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as a}from"../../../geometry/projectionUtils.js";import{fromExtent as u,toExtent as d}from"../../../geometry/support/aaBoundingRect.js";import p from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as c,getFlowSimulationSettings as m}from"../../2d/engine/flow/utils.js";import h from"./SubView3D.js";import{makeScheduleFunction as f}from"./support/makeScheduleFunction.js";import{FlowWorkerHandle as g}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as y,createFlowGeometry as w}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as _}from"../support/flow/loadUtils.js";import{StreamlinesResources3D as b}from"../support/flow/StreamlinesResources3D.js";import v from"../support/flow/VisualQuery3D.js";import{RibbonLineMaterial as S}from"../webgl-engine/materials/RibbonLineMaterial.js";let j=class extends h{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this._abortController=null,this.workerHandle=null,this._overrideSimulationSettings=null,this._debouncedLoad=r(async e=>{const{view:t}=this;if(0===e.size)return;const r=this._computeExtent(e);if(null==r)return;const s=new v(r,this.layer.timeExtent,this._viewSizeWithEqualRatio(r),t.state.contentPixelRatio);null==this._abortController&&(this._abortController=new AbortController);const i=this._abortController,l=await this._load(s,i.signal);o(i.signal),null!=l&&(this._resources?.detach(),l.attach(t.stage),this._resources=l)}),this._debugStopLoading=!1}initialize(){const{surface:e}=this;this.workerHandle=new g(f(this.view.resourceController)),this.addHandles([i(()=>this.simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&c(e,t)}),i(()=>y(this._flowRenderer),e=>this._resources?.setMaterialParameters(e)),e.on("tiles-changed",({allTiles:e})=>{this._updateRenderedTiles(e)})]),this._updateRenderedTiles(e.allTiles)}destroy(){this.abort(),this.clear()}abort(){this._abortController=t(this._abortController)}get _dataBounds(){const e=a(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:u(e)}get elevationInfo(){return this.layer.elevationInfo??R}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get layer(){return this.layerView.layer}get simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let r=m(e);return null!=t&&(r={...r,...t}),r}get surface(){return this.view.basemapTerrain}doRefresh(){return this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null}async triggerLoad(){const{renderedTiles:e}=this;if(null==e||0===e.size||this._debugStopLoading)return;const t=this._debouncedLoad(e);return this.updatingHandles.addPromise(s(t))}async _load(e,t){const r=await this.fetchDataAndGenerateStreamlines(e,t);if(null==r||0===r.length)return null;const o=await this._createGeometry(e,r);return new b(r,o)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const r=new S(y(this._flowRenderer));return w(this.view,e,t,this.elevationInfo,r)}_computeExtent(e){const{_dataBounds:t,surface:{spatialReference:r}}=this;if(null==r||null==t)return null;const o=_(e,t);return null==o?null:d(o,r)}_updateRenderedTiles(e){this.renderedTiles=new Set(e.filter(e=>e.rendered&&e.visible))}_viewSizeWithEqualRatio(e){const t=(e.xmax-e.xmin)/(e.ymax-e.ymin),[r,o]=this.view.size;return r<o?[r,Math.floor(r/t)]:[Math.floor(o*t),o]}get test(){}};e([l()],j.prototype,"type",void 0),e([l()],j.prototype,"renderedTiles",void 0),e([l()],j.prototype,"_dataBounds",null),e([l()],j.prototype,"elevationInfo",null),e([l()],j.prototype,"_flowRenderer",null),e([l()],j.prototype,"layer",null),e([l()],j.prototype,"_overrideSimulationSettings",void 0),e([l()],j.prototype,"simulationSettings",null),e([l()],j.prototype,"surface",null),j=e([n("esri.views.3d.layers.FlowSubView3D")],j);const R=new p({mode:"relative-to-ground",offset:100});export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{destroyHandle as t}from"../../../core/handleUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import r from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as s}from"./support/SublayerPopupHighlightHelper3D.js";import o from"../../layers/MapImageLayerView.js";let p=class extends(o(r)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new s({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(t(this._popupHighlightHelper))}fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t)}highlight(e,t){return this._popupHighlightHelper.highlight(e,t)}getFetchOptions(){return{timeExtent:this.timeExtent}}};p=e([i("esri.views.3d.layers.MapImageLayerView3D")],p);const a=p;export{a as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{destroyHandle as t}from"../../../core/handleUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import r from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as s}from"./support/SublayerPopupHighlightHelper3D.js";import o from"../../layers/MapImageLayerView.js";let p=class extends(o(r)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new s({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(t(this._popupHighlightHelper))}fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t)}highlight(e,t){return this._popupHighlightHelper.highlight(e,t)}getFetchOptions(){return{timeExtent:this.timeExtent,scale:this.view.scale}}};p=e([i("esri.views.3d.layers.MapImageLayerView3D")],p);const a=p;export{a as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import{isIterable as s}from"../../../core/iteratorUtils.js";import{getProjectiveTransform as a}from"../../../core/perspectiveUtils.js";import{debounce as o,isPromiseLike as d}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as h,on as m}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toExtent as u}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as y}from"../../../layers/support/MediaElementView.js";import{LayerView3D as _}from"./LayerView3D.js";import{MediaLayerInteraction as f}from"./support/MediaLayerInteraction.js";import{drapedZ as v}from"../terrain/OverlayRenderer.js";import{Attribute as w}from"../webgl-engine/lib/Attribute.js";import{Geometry as E}from"../webgl-engine/lib/Geometry.js";import{Object3DHighlightStateID as D}from"../webgl-engine/lib/Object3DStateID.js";import{RenderGeometry as R}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as b}from"../webgl-engine/lib/Texture.js";import{ImageMaterial as j}from"../webgl-engine/materials/ImageMaterial.js";import H from"../../layers/LayerView.js";import x from"../../layers/MediaLayerView.js";import{defaultHighlightName as A}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as G}from"../../support/layerViewUtils.js";let M=class extends(_(x(H))){get interactive(){return this._interaction.enabled}set interactive(e){this._interaction&&(this._interaction.enabled=e)}get selectedElement(){return this._interaction.selectedElement}set selectedElement(e){this._interaction&&(this._interaction.selectedElement=e)}get visibleAtCurrentScale(){return G(this.layer.effectiveScaleRange,this.view.scale)}get usedMemory(){return Array.from(this._renderElements.values()).reduce((e,t)=>e+(t.getRenderData()?.texture.usedMemory??0),0)}constructor(e){super(e),this.type="media-3d",this.drapeSourceType=1,this.updatePolicy=1,this.ignoresMemoryFactor=!0,this.unloadedMemory=0,this._uidToElement=new Map,this._highlightedElements=new Map,this._elementsInHighlightedId=new Map,this._renderElements=new Map,this._lastDrapingExtent=null,this._update=o(async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)},0);const{view:t,layer:r}=e;this._interaction=new f({view:t,layer:r}),this.addHandles(l(()=>this.interactionOptions,e=>this._interaction.options=e,h))}initialize(){const{view:e,layer:t}=this;this._renderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const i=()=>this._updateWithLastDrapingExtent();this.addHandles([r(()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(this)),m(()=>t.effectiveSource,"change",i),m(()=>t.effectiveSource,"refresh",i)]),this._updatingHandles.add(()=>this.suspended,i)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}highlight(e,t){const i=new D(t?.name??A),n=s(e)?Array.from(e):[e];this._elementsInHighlightedId.set(i,n);for(const r of n){const e=this._highlightedElements.get(r);e?e.add(i):this._highlightedElements.set(r,new Set([i]));const t=this._renderElements.get(r)?.getRenderData();t&&(t.renderGeometry.geometry.addHighlight(i),this._renderer.modifyGeometries([t.renderGeometry],8))}return r(()=>{const e=this._elementsInHighlightedId.get(i);if(e){for(const t of e){const e=this._highlightedElements.get(t);if(!e)continue;e.delete(i);const r=this._renderElements.get(t)?.getRenderData();r&&(r.renderGeometry.geometry.removeHighlight(i),this._renderer.modifyGeometries([r.renderGeometry],8)),0===e.size&&this._highlightedElements.delete(t)}this._elementsInHighlightedId.delete(i)}})}isUpdating(){return super.isUpdating()||this._interaction.updating}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch(()=>{}))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map(e=>i.queryElements(u(e.extent,t),{signal:r})))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){this._renderElements.forEach((t,r)=>{e.has(r)||(this._removeElement(r,t),this.emit("element-render-changed",{element:r}))})}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderElements.has(t)||this._createRenderElement(t)}_removeElement(e,t){this._destroyRenderData(e,t),this._renderElements.delete(e),this._uidToElement.delete(e.uid),t.handle.remove()}_createRenderElement(e){const t=new y({spatialReference:this.view.spatialReference,element:e}),r=new I(i([this._updatingHandles.add(()=>e.opacity,e=>r.getRenderData()?.material.setParameters({opacity:e})),this._updatingHandles.add(()=>t.coords,()=>{r.data?this._updateGeometry(t,r):this._initializeRenderData(t,r)}),this._updatingHandles.add(()=>e.content,()=>this._initializeRenderData(t,r)),n(t)]));this._renderElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch(()=>{})),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e,{contentWidth:n,contentHeight:s}=i;if(null==r||null==i.content)return void this._destroyRenderData(i,t);if(t.data)return;const a=this._createTexture(i.content),o=a.load(this.view.stage.renderView.renderingContext),l=()=>{if(!a.loaded)return;this.view.stage.addTexture(a);const e=new j({draped:!0,texture:a,opacity:i.opacity,perspectiveInterpolation:!0}),o=this._getPositionAttributeArray(r),d=[0,0,1,0,1,1,0,1],l=this._getPerspectiveDivideAttributeArray(o,n,s),h=[0,1,2,0,2,3],m=new E(e,[["position",new w(o,h,3,!0)],["uv0",new w(d,h,2,!0)],["perspectiveDivide",new w(l,h,1,!0)]]),c=new R(m,{layerViewUid:this.uid,graphicUid:i.uid}),p=this._highlightedElements.get(i);p?.forEach(e=>c.geometry.addHighlight(e)),this._renderer.addGeometries([c],0),t.data=new T(c,a,e),this.emit("element-render-changed",{element:i})};d(o)?(t.data=a,this._updatingHandles.addPromise(o),o.then(l).catch(()=>a.dispose())):l()}_updateGeometry(e,t){const{coords:r,element:i}=e;if(null==r||null==i.content)return void this._destroyRenderData(i,t);const n=t.getRenderData();if(!n)return;const s=this._getPositionAttributeArray(r);n.renderGeometry.geometry.setAttributeData("position",s);const a=this._getPerspectiveDivideAttributeArray(s,i.contentWidth,i.contentHeight);n.renderGeometry.geometry.setAttributeData("perspectiveDivide",a),n.renderGeometry.geometry.invalidateBoundingInfo(),this._renderer.modifyGeometries([n.renderGeometry],2),this.emit("element-render-changed",{element:i})}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],v,n[0],n[1],v,i[0],i[1],v,r[0],r[1],v]}_getPerspectiveDivideAttributeArray(e,t,r){a(S,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=S[6]/S[8]*t,n=S[7]/S[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e,t){const r=t.data;if(null==r)return;if(t.data=null,"dispose"in r)return void r.dispose();const i=r.texture;i.unload(),this.view.stage.removeTexture(i),this._renderer.removeGeometries([r.renderGeometry],2),this.emit("element-render-changed",{element:e})}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new b(e,{wrap:{s:33071,t:33071},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.requestRender()})}get test(){}};e([c({readOnly:!0})],M.prototype,"type",void 0),e([c()],M.prototype,"layer",void 0),e([c()],M.prototype,"interactive",null),e([c()],M.prototype,"selectedElement",null),e([c({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),M=e([p("esri.views.3d.layers.MediaLayerView3D")],M);const S=g();class I{constructor(e){this.handle=e}getRenderData(){return this.data&&"type"in this.data&&"RenderData"===this.data.type?this.data:null}}class T{constructor(e,t,r){this.renderGeometry=e,this.texture=t,this.material=r,this.type="RenderData"}}const z=M;export{z as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import{isIterable as s}from"../../../core/iteratorUtils.js";import{getProjectiveTransform as a}from"../../../core/perspectiveUtils.js";import{debounce as o,isPromiseLike as d}from"../../../core/promiseUtils.js";import{watch as l,syncAndInitial as h,on as m}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toExtent as u}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as y}from"../../../layers/support/MediaElementView.js";import{LayerView3D as _}from"./LayerView3D.js";import{MediaLayerInteraction as f}from"./support/MediaLayerInteraction.js";import{drapedZ as v}from"../terrain/OverlayRenderer.js";import{Attribute as w}from"../webgl-engine/lib/Attribute.js";import{Geometry as E}from"../webgl-engine/lib/Geometry.js";import{Object3DHighlightStateID as D}from"../webgl-engine/lib/Object3DStateID.js";import{RenderGeometry as R}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as b}from"../webgl-engine/lib/Texture.js";import{ImageMaterial as j}from"../webgl-engine/materials/ImageMaterial.js";import H from"../../layers/LayerView.js";import x from"../../layers/MediaLayerView.js";import{defaultHighlightName as A}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as G}from"../../support/layerViewUtils.js";let M=class extends(_(x(H))){get interactive(){return this._interaction.enabled}set interactive(e){this._interaction&&(this._interaction.enabled=e)}get selectedElement(){return this._interaction.selectedElement}set selectedElement(e){this._interaction&&(this._interaction.selectedElement=e)}get visibleAtCurrentScale(){return G(this.layer.effectiveScaleRange,this.view.scale)}get usedMemory(){return Array.from(this._renderElements.values()).reduce((e,t)=>e+(t.getRenderData()?.texture.usedMemory??0),0)}constructor(e){super(e),this.type="media-3d",this.drapeSourceType=1,this.updatePolicy=1,this.ignoresMemoryFactor=!0,this.unloadedMemory=0,this._uidToElement=new Map,this._highlightedElements=new Map,this._elementsInHighlightedId=new Map,this._renderElements=new Map,this._lastDrapingExtent=null,this._update=o(async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)},0);const{view:t,layer:r}=e;this._interaction=new f({view:t,layer:r}),this.addHandles(l(()=>this.interactionOptions,e=>this._interaction.options=e,h))}initialize(){const{view:e,layer:t}=this;this._renderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const i=()=>this._updateWithLastDrapingExtent();this.addHandles([r(()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(this)),m(()=>t.effectiveSource,"change",i),m(()=>t.effectiveSource,"refresh",i)]),this._updatingHandles.add(()=>this.suspended,i)}destroy(){this._synchronizeRenderElements(new Set)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}highlight(e,t){const i=new D(t?.name??A),n=s(e)?Array.from(e):[e];this._elementsInHighlightedId.set(i,n);for(const r of n){const e=this._highlightedElements.get(r);e?e.add(i):this._highlightedElements.set(r,new Set([i]));const t=this._renderElements.get(r)?.getRenderData();t&&(t.renderGeometry.geometry.addHighlight(i),this._renderer.modifyGeometries([t.renderGeometry],8))}return r(()=>{const e=this._elementsInHighlightedId.get(i);if(e){for(const t of e){const e=this._highlightedElements.get(t);if(!e)continue;e.delete(i);const r=this._renderElements.get(t)?.getRenderData();r&&(r.renderGeometry.geometry.removeHighlight(i),this._renderer.modifyGeometries([r.renderGeometry],8)),0===e.size&&this._highlightedElements.delete(t)}this._elementsInHighlightedId.delete(i)}})}isUpdating(){return super.isUpdating()||this._interaction.updating}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch(()=>{}))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map(e=>i.queryElements(u(e.extent,t),{signal:r})))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){this._renderElements.forEach((t,r)=>{e.has(r)||(this._removeElement(r,t),this.emit("element-render-changed",{element:r}))})}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderElements.has(t)||this._createRenderElement(t)}_removeElement(e,t){this._destroyRenderData(e,t),this._renderElements.delete(e),this._uidToElement.delete(e.uid),t.handle.remove()}_createRenderElement(e){const t=new y({spatialReference:this.view.spatialReference,element:e}),r=new I(i([this._updatingHandles.add(()=>e.opacity,e=>r.getRenderData()?.material.setParameters({opacity:e})),this._updatingHandles.add(()=>t.coords,()=>{r.data?this._updateGeometry(t,r):this._initializeRenderData(t,r)}),this._updatingHandles.add(()=>e.content,()=>this._initializeRenderData(t,r)),n(t)]));this._renderElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch(()=>{})),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e,{contentWidth:n,contentHeight:s}=i;if(null==r||null==i.content)return void this._destroyRenderData(i,t);if(t.data)return;const a=this._createTexture(i.content),o=a.load(this.view.stage.renderView.renderingContext),l=()=>{if(!a.loaded)return;this.view.stage.addTexture(a);const e=new j({draped:!0,texture:a,opacity:i.opacity,perspectiveInterpolation:!0}),o=this._getPositionAttributeArray(r),d=[0,0,1,0,1,1,0,1],l=this._getPerspectiveDivideAttributeArray(o,n,s),h=[0,1,2,0,2,3],m=new E(e,[["position",new w(o,h,3,!0)],["uv0",new w(d,h,2,!0)],["perspectiveDivide",new w(l,h,1,!0)]]),c=new R(m,{layerViewUid:this.uid,graphicUid:i.uid}),p=this._highlightedElements.get(i);p?.forEach(e=>c.geometry.addHighlight(e)),this._renderer.addGeometries([c],0),t.data=new T(c,a,e),this.emit("element-render-changed",{element:i})};d(o)?(t.data=a,this._updatingHandles.addPromise(o),o.then(l).catch(()=>a.dispose())):l()}_updateGeometry(e,t){const{coords:r,element:i}=e;if(null==r||null==i.content)return void this._destroyRenderData(i,t);const n=t.getRenderData();if(!n)return;const s=this._getPositionAttributeArray(r);n.renderGeometry.geometry.setAttributeData("position",s);const a=this._getPerspectiveDivideAttributeArray(s,i.contentWidth,i.contentHeight);n.renderGeometry.geometry.setAttributeData("perspectiveDivide",a),n.renderGeometry.geometry.invalidateBoundingInfo(),this._renderer.modifyGeometries([n.renderGeometry],2),this.emit("element-render-changed",{element:i})}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],v,n[0],n[1],v,i[0],i[1],v,r[0],r[1],v]}_getPerspectiveDivideAttributeArray(e,t,r){a(S,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=S[6]/S[8]*t,n=S[7]/S[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e,t){const r=t.data;if(null==r)return;if(t.data=null,"dispose"in r)return void r.dispose();const i=r.texture;i.unload(),this.view.stage.removeTexture(i),this._renderer.removeGeometries([r.renderGeometry],2),this.emit("element-render-changed",{element:e})}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new b(e,{wrap:{s:33071,t:33071},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.requestRender()})}get test(){}};e([c({readOnly:!0})],M.prototype,"type",void 0),e([c()],M.prototype,"layer",void 0),e([c()],M.prototype,"interactive",null),e([c()],M.prototype,"selectedElement",null),e([c({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),M=e([p("esri.views.3d.layers.MediaLayerView3D")],M);const S=g();class I{constructor(e){this.handle=e}getRenderData(){return this.data&&"type"in this.data&&"RenderData"===this.data.type?this.data:null}}class T{constructor(e,t,r){this.renderGeometry=e,this.texture=t,this.material=r,this.type="RenderData"}}const z=M;export{z as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{destroyHandle as o,makeHandle as i}from"../../../../core/handleUtils.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{abortMaybe as r,destroyMaybe as a}from"../../../../core/maybe.js";import{debounce as n}from"../../../../core/promiseUtils.js";import{initial as l,watch as d,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as p}from"../../../../core/unitUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as g,transformMat2d as y}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{ControlPointOperations as T}from"../../interactive/editingTools/media/ControlPointOperations.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";import{KeyBindings as j,mediaKeys as w}from"../../../interactive/keybindings.js";import{acquire as M}from"../../../interactive/snapping/SnappingManagerPool.js";import{loadAutomaticAreaMeasurementUtils as E}from"../../../support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as O}from"../../../support/automaticLengthMeasurementUtils.js";const P=Symbol(),S=Symbol(),H=1,A=10;let U=class extends e{get editSourcePoints(){return!!this.options?.reshapeOptions.editSourcePoints!==this._isEditSourcePointsToggled}get updating(){return this._updatingHandles.updating}get _preferredInteractionTool(){return this.options?.tool??"transform"}get _toolType(){switch(this._preferredInteractionTool){case"transform":return"transform-3d";case"reshape":return"reshape-3d"}}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}constructor(t){super(t),this.enabled=!1,this._isEditSourcePointsToggled=!1,this._updatingHandles=new v,this._isOpacityToggled=!1,this._factor=H,this._tool=null,this._object=null,this._createToolAbortController=null,this._onPointerMove=n(async t=>{const e=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(t));this.destroyed||(this.removeHandles(S),e&&e!==this.selectedElement&&this.addHandles(this.view.acquireCursor("pointer","high"),S))}),this._tmpMat2=u(),this._tmpVec2=f()}destroy(){this._createToolAbortController=r(this._createToolAbortController)}initialize(){this.addHandles([o(this._updatingHandles),this._updatingHandles.add(()=>this.enabled,t=>this._enableDisable(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,t=>this._preferredInteractionToolChanged(t))])}_enableDisable(t){if(!t)return void this.removeHandles(P);this._dynamicImports();const{view:e}=this,o=new j;o.add(w.undo,()=>{this._object?.operations?.undo(),this._object?.emit("modified-externally")}),o.add(w.redo,()=>{this._object?.operations?.redo(),this._object?.emit("modified-externally")}),o.addToggle(w.preserveAspectRatio,t=>{"transform-3d"===this._tool?.type&&(this._tool.preserveAspectRatio="key-down"===t.type)}),o.addToggle(w.editSourcePoints,t=>{"reshape-3d"===this._tool?.type&&(this._isEditSourcePointsToggled="key-down"===t.type)}),o.addToggle(w.rotateIncrements,t=>{"transform-3d"===this._tool?.type&&(this._tool.snapRotation="key-down"===t.type)}),o.add(w.toggleOpacity,()=>{const t=this._object?.element;t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),o.add(w.moveUp,()=>this._move(0,this._factor)),o.add(w.moveDown,()=>this._move(0,-this._factor)),o.add(w.moveRight,()=>this._move(this._factor,0)),o.add(w.moveLeft,()=>this._move(-this._factor,0)),o.addToggle(w.factorModifier,t=>this._factor="key-down"===t.type?A:H),this._isOpacityToggled=!1,this.addHandles([o.register(e,b.TOOL),i(()=>{this._isOpacityToggled&&this.selectedElement&&(this.selectedElement.opacity*=2,this._isOpacityToggled=!1)}),e.on("immediate-click",t=>this._onClick(t),b.TOOL),e.on("pointer-move",t=>this._onPointerMove(t).catch(()=>{}),b.TOOL),this._updatingHandles.add(()=>this._validatedSelectedElement,(t,e)=>{e&&t!==e&&this._isOpacityToggled&&(e.opacity*=2,this._isOpacityToggled=!1),this._selectedElementChanged(t)},l),i(()=>{this.removeHandles(S),this._removeTool()})],P)}async _onClick(t){await this._updatingHandles.addPromise(t.defer(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&this.removeHandles(S))}))}async _selectedElementChanged(t){t?.georeference?this._object?.element!==t&&await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}async _recreateTool(){this._createToolAbortController=r(this._createToolAbortController),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this._createToolAbortController=e;const{ManipulatedObject3DMediaElement:o,ExtentTransformTool:s,ReshapeTool3D:n,automaticAreaMeasurementUtils:l,automaticLengthMeasurementUtils:p}=await this._dynamicImports();if(e.signal.aborted)return;const{view:m,layer:h,_toolType:_}=this;switch(this._object=new o({view:m,layer:h,element:t,tool:this._preferredInteractionTool}),_){case"transform-3d":{this._tool=new s({view:m,object:this._object,automaticLengthMeasurementUtils:p});const t=m.inputManager;t.isModifierKeyDown(w.rotateIncrements.key)&&(this._tool.snapRotation=!0),t.isModifierKeyDown(w.preserveAspectRatio.key)&&(this._tool.preserveAspectRatio=!0)}break;case"reshape-3d":{const t=M(m),{snappingManager:e}=t;this._tool=new n({view:m,object:this._object,enableMidpoints:!1,enableZShape:!1,snappingManager:e,enableMoveObject:!1,autoHideManipulators:!0,enableDeleteVertices:!1,sketchOptions:{tooltips:{enabled:!0,inputEnabled:!0,visibleElements:{area:!1}}},automaticAreaMeasurementUtils:l,automaticLengthMeasurementUtils:p}),this.addHandles([t,d(()=>({editSourcePoints:this.editSourcePoints,operations:this._object?.operations}),t=>{t.operations instanceof T&&(t.operations.editSourcePoints=t.editSourcePoints)},c)],this._tool)}}this.addHandles([i(()=>{this._object=a(this._object),this._tool&&(m.tools.remove(this._tool),this._tool=null)})],this._tool),m.addAndActivateTool(this._tool)}_preferredInteractionToolChanged(t){const{_tool:e}=this;if(!e)return;if(this._toolType!==e.type)return void this._updatingHandles.addPromise(this._recreateTool());const{_object:o}=this;o&&(o.tool=t)}async _dynamicImports(){const[{ManipulatedObject3DMediaElement:t},{ExtentTransformTool:e,ReshapeTool3D:o},i,s]=await Promise.all([import("../../interactive/editingTools/ManipulatedObject3DMediaElement.js"),import("../../interactive/editingTools.js"),await E(),await O()]);return{ManipulatedObject3DMediaElement:t,ExtentTransformTool:e,ReshapeTool3D:o,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:s}}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return"media"===e?.type?e.element:null}_removeTool(){this._tool&&this.removeHandles(this._tool)}_move(t,e){const{view:o,_object:i}=this,r=i?.operations;if(!r)return;const a=o.overlayPixelSizeInMapUnits(o.pointsOfInterest.focus.location)*p(o.spatialReference)/p(r.data.spatialReference),{_tmpMat2:n,_tmpVec2:l}=this,d=_(n,s(360-this.view.camera.heading)),c=g(l,a*t,a*e);y(c,c,d),r.move(c[0],c[1],0),i.emit("modified-externally")}};t([m({constructOnly:!0})],U.prototype,"view",void 0),t([m({constructOnly:!0})],U.prototype,"layer",void 0),t([m()],U.prototype,"selectedElement",void 0),t([m()],U.prototype,"enabled",void 0),t([m()],U.prototype,"options",void 0),t([m()],U.prototype,"editSourcePoints",null),t([m()],U.prototype,"_isEditSourcePointsToggled",void 0),t([m()],U.prototype,"updating",null),t([m()],U.prototype,"_preferredInteractionTool",null),t([m()],U.prototype,"_validatedSelectedElement",null),U=t([h("esri.views.3d.layers.support.MediaLayerInteraction")],U);export{U as MediaLayerInteraction};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{createRenderScreenPointArray3 as t,castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as
|
|
5
|
+
import"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{createRenderScreenPointArray3 as t,castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{f as i,n as s,e as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u,width as h,height as p,expandPointInPlace as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{computeMapPointFromVec3d as g}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as w}from"../../support/geometryUtils/ray.js";import{defaultTolerance as R,Intersector as b}from"../../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as v}from"../../webgl-engine/lib/IntersectorResult.js";import{sliceFilterPredicate as I}from"../../webgl-engine/lib/intersectorUtils.js";import{HUDMaterial as P}from"../../webgl-engine/materials/HUDMaterial.js";class j{constructor(t,r,n){this.viewingMode=t,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new e,this._tolerance=R,this._tmpRay=m(),this._tmpRegion=a(),this._validateHUDIntersector=new b(this.viewingMode),this._validateHUDIntersector.options.hud=!1}destroy(){this._externalIntersectionHandlers.prune()}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),L(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,L(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(F,r,n),F[0]+=.0466,F[1]-=.0123,_(e,F,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const n=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||v(n)&&2!==n.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=R){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>2===e.type?1:2===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>2===e.type?1:2===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return w(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||i(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,t,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,h=n(c.spatialReference),p=null!=t?t.mode:"absolute-height",d=f(t)/h,m=("on-the-ground"!==p?d+l:0)*h/u.unitInMeters,{camera:_}=c.state;if("absolute-height"===p){const t=u?.getAltitude(_.eye),r=o(s(E,e.direction),u.worldUpAtPosition(_.eye,V));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,E)){const e=g(c,E);return e.z??=0,e.z-=d,e}return null}const w=r(y.get());_.projectToRenderScreen(e.origin,w);const R=new k(null,this._forEachLayer),{slice:{plane:v}}=c,P=null!=v?I(v):null,j=new b(this.viewingMode);j.options.store=0,j.options.verticalOffset=m,j.options.normalRequired=!1;const U=e.origin,x=i(y.get(),U,e.direction);j.reset(U,x,_),j.point=w;let M=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find(e=>e.layer===a)?.uid;M=e?t=>t.layerViewUid===e:null}else a&&(M=e=>e.graphicUid!==a.uid);switch(p){case"relative-to-scene":{const e=e=>(!M||M(e))&&!!e.lastValidElevationBB;j.intersect(R.layers,w,this._tolerance,null,e),this._externalIntersectionHandlers.forAll(e=>{if(4===e.type||2===e.type||8===e.type){const t=e.slicePlaneEnabled?P:null;e.intersect(j,t,j.rayBegin,j.rayEnd,w,!1)}});break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll(e=>{if(e.isGround){const t=e.slicePlaneEnabled?P:null;e.intersect(j,t,j.rayBegin,j.rayEnd,w,!1)}})}if(j.results.min.getIntersectionPoint(E)){const e=g(c,E);return e.z=l,e}return null}computeIntersection(e,t,n,s){if(null==e)return;const o=this._view.state.camera,l=r(y.get());o.projectToRenderScreen(e.origin,l);const a=new k(s,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!s||!("include"in s||"exclude"in s);const c=e.origin,u=i(y.get(),e.origin,e.direction);t.reset(c,u,o),t.intersect(a.layers,l,this._tolerance);const h=this._view.slice.plane,p=null!=h?I(h):null;t.intersect(a.sliceableLayers,l,this._tolerance,p);const d=s&&(s.requiresGroundFeedback||s.enableDraped);this._externalIntersectionHandlers.forAll(e=>{const r=e.layerViewUid,i=e.sublayerId,s=Array.isArray(r),o=s?r:[r];s&&(t.options.filteredLayerViewUids=[]);let h=!1;for(const n of o)a.filterLayerViewUid(n,i)?h=!0:s&&t.options.filteredLayerViewUids.push(n);if(t.options.isFiltered=!h,e.isGround&&d||!t.options.isFiltered){const r=e.slicePlaneEnabled?p:null;e.intersect(t,r,c,u,l,n)}});const m=y.get(),f=this._view.basemapTerrain;if(s&&s.enableDraped&&null!=f.spatialReference&&t.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,r=this._view.renderCoordsHelper.spatialReference,n=y.get();this._view.renderCoordsHelper.fromRenderCoords(m,n,f.spatialReference),n[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],r,"ground")??0,e.intersect(t,n,t.results.ground,e=>a.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=this._view.state.camera,n=[],i=this._tmpRegion,s=e=>{const t=new M(e),s=t.result.target.object.geometries.every(e=>e.material instanceof P&&e.material.parameters.occlusionTest);n.push({item:t,occlusionTest:s}),s&&(r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),d(i,t.screenPoint))};e.sortResults(t.all),null!=t.min.distance&&s(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&s(c);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&s(t.max),!n.length)return;i[0]===i[2]&&(i[2]+=1),i[1]===i[3]&&(i[3]+=1);const o=r.fullWidth,l=r.fullHeight,a=Math.max(0,i[0]-U),m=Math.max(0,i[1]-U),y=Math.min(h(i)+2*U,o-a),f=Math.min(p(i)+2*U,l-m),g=y>0&&f>0?new Uint8Array(y*f*4):null;g&&this._view.stage.renderer.readHUDVisibility(a,m,y,f,g);let _=!0;const w=null==e.results.max.distance;let R=0;for(const{item:c,occlusionTest:u}of n){let t=!u;if(u&&g)for(const e of x){const r=4*(Math.min(c.screenPoint[0]+e[0],o)-i[0]+(Math.min(c.screenPoint[1]+e[1],l)-i[1])*y);if(r>=0&&r<g.length&&g[r]){t=!0;break}}t&&(_&&(e.results.min.copy(c.result),_=!1),w&&e.results.max.copy(c.result),2===e.options.store&&e.results.all.splice(R++,0,c.result))}}}const U=1,x=(()=>{const e=[],t=U;for(let r=-t;r<=t;r++)for(let n=-t;n<=t;n++)e.push([n+t,r+t]);return e})();class M{constructor(e){this.result=e,this.screenPoint=t()}}let H;function L(e){return H&&H.viewingMode===e||(H=new b(e)),H}class k{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:n}=this;if(null==e)return null==r&&null==n;const i=r instanceof Map?r.get(e)??!1:r?.has(e),s=n instanceof Map?n.get(e)??!1:n?.has(e);return(null==i||("boolean"==typeof i?i:null!=t&&i.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function T(e){return"object"==typeof e&&"intersect"in e}const E=l(),V=l(),F=t();export{j as SceneIntersectionHelper,T as isIntersectionHandler};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
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 l}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as u}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as s}from"../../../../geometry/support/Indices.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as p}from"../../webgl-engine/lib/Geometry.js";function f(t,e,r=null){const o=[],n=e.mapPositions;m(e,o);const i=o[0][1].data,a=o[0][1].indices.length,l=s(a);return
|
|
5
|
+
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 l}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as u}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as s}from"../../../../geometry/support/Indices.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as p}from"../../webgl-engine/lib/Geometry.js";function f(t,e,r=null){const o=[],n=e.mapPositions;m(e,o);const i=o[0][1].data,a=o[0][1].indices.length,l=s(a);return g(e,o,l),y(e,o,l),h(e,o,l),b(e,o,l),D(e,o,l),w(e,o),j(e,o,l),F(e,o,i),new p(t,o,n,2,r)}function m(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=d(r)&&o,i=r.length/3-(n?1:0),a=new Array(2*(i-1)),l=n?r.slice(0,-3):r;let u=0;for(let s=0;s<i-1;s++)a[u++]=s,a[u++]=s+1;e.push(["position",new c(l,a,3,n)])}function g(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new c(n??o,r,4)])}function h(t,e,r){t.attributeData.normal&&e.push(["normal",new c(t.attributeData.normal,r,3)])}function b(t,e,r){null!=t.attributeData.colorFeature&&e.push(["colorFeatureAttribute",new c([t.attributeData.colorFeature],r,1,!0)])}function y(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new c([t.attributeData.size??1],r,1,!0)])}function D(t,e,r){null!=t.attributeData.sizeFeature&&e.push(["sizeFeatureAttribute",new c([t.attributeData.sizeFeature],r,1,!0)])}function w(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 l=0;l<n-1;l++)i[a++]=l,i[a++]=l+1;e.push(["timeStamps",new c(o,i,3)])}function j(t,e,r){null!=t.attributeData.opacityFeature&&e.push(["opacityFeatureAttribute",new c([t.attributeData.opacityFeature],r,1,!0)])}function F(r,o,u){if(null==r.overlayInfo||1!==r.overlayInfo.renderCoordsHelper.viewingMode||!r.overlayInfo.spatialReference.isGeographic)return;const s=a(u.length),p=n(r.overlayInfo.spatialReference);for(let t=0;t<s.length;t+=3)i(u,t,s,t,p);const f=u.length/3,m=l(f+1);let g=v,h=A,b=0,y=0;t(g,s[y++],s[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(h,s[y++],s[y++]),y++,b+=e(g,h),m[n]=b,[g,h]=[h,g];o.push(["distanceToStart",new c(m,o[0][1].indices,1,!0)])}function d(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const v=r(),A=r();function z(t,e,r){if(null==t||0===t.length)return[];const o=[];return t.forEach((t,n)=>{const i=t.length,l=a(3*i);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const u=null!=r?I(r[n]):void 0,s={attributeData:{position:l,normal:e,timeStamps:u},removeDuplicateStartEnd:!1};o.push(s)}),o}function S(t,e=0,r=.01){const o=u(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 I(t){const e=u(3*t.length),r=t[0],o=t[t.length-1];for(let n=0;n<t.length;n++)e[3*n]=t[n],e[3*n+1]=r,e[3*n+2]=o;return e}export{f as createGeometry,S as getLinearTimeStamps,z as lineStripsToParameters,I as timeStampsToAttribute};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as
|
|
5
|
+
import{__decorate as t}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{loadImagery as r}from"../../../2d/engine/flow/dataUtils.js";import s from"../../layers/FlowSubView3D.js";let i=class extends s{constructor(t){super(t)}initialize(){this.updatingHandles.add(()=>this.renderedTiles,()=>this.triggerLoad())}async fetchDataAndGenerateStreamlines(t,e){const{simulationSettings:s,workerHandle:i}=this,{size:o,extent:a,timeExtent:n}=t;if(null==s||null==i)return;const l=await r(this.layer,a,o[0],o[1],n,e);if(null==l)return null;const m={simulationSettings:s,size:o,flowData:l},{streamlines:u}=await i.generateStreamlines(m,e);return u}};i=t([e("esri.views.3d.support.flow.FlowSubViewExtent3D")],i);export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromExtent as s,clone as i}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as a}from"../../../2d/engine/flow/dataUtils.js";import r from"../../layers/FlowSubView3D.js";import{FlowDataTile as l}from"./loadUtils.js";import{isRasterTile as o}from"../../terrain/TerrainData.js";let n=class extends r{constructor(e){super(e),this._flowDataTiles=d(),this._resetTileData=!0}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:e,layerIndex:t,layerClass:s})=>{const{renderedTiles:i}=this;null!=i&&t===this._layerIndex&&1===s&&this._updateFlowDataTile(e)})]),this.updatingHandles.add(()=>this.renderedTiles,e=>{const t=d();e?.forEach(e=>{const s=this._flowDataTiles.get(h(e))??this._getFlowDataCopy(e);null!=s&&t.set(h(e),s)}),this._flowDataTiles=t,this._resetTileData=!0,this.triggerLoad()})}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}async fetchDataAndGenerateStreamlines(e,t){const{simulationSettings:i,_flowDataTiles:a,workerHandle:r}=this,{size:l}=e;if(null==i||null==r)return;const o=s(e.extent),n=this._resetTileData;this._resetTileData=!1;const h=d();a.forEach((e,t)=>{"delete"===e?(h.set(t,"delete"),a.delete(t)):(n||"on-worker"!==e)&&(h.set(t,e),a.set(t,"on-worker"))});const c={simulationSettings:i,size:l,flowDataTiles:h,reset:n,extent:o,pixelSize:this.surface.tilingScheme.pixelSize},{streamlines:u}=await r.generateTiledStreamlines(c,t);return u}_getFlowDataCopy(e){const{_layerIndex:t}=this;if(null==t)return null;const s=e.getLayerInfo(t,1);if(s.dataMissing||!e.hasLayerData(t,1))return null;const{data:r}=s;if(!o(r))return null;const n=a(this.layer.serviceRasterInfo.dataType,r.source),d=new Uint8Array(n.width*n.height);for(let i=0;i<d.length;i++)d[i]=n.mask[i];return new l(n.data,d,n.width,n.height,e.lij,i(e.extent))}async _updateFlowDataTile(e){if(this.renderedTiles?.has(e)){const t=this._getFlowDataCopy(e)??"delete";this._setTileData(e,t)}else this._setTileData(e,"delete");await this.triggerLoad()}_setTileData(e,t){this._flowDataTiles.set(h(e),t)}};function d(){return new Map}function h(e){return e.lij.join("-")}n=e([t("esri.views.3d.support.flow.FlowSubViewTiles3D")],n);export{n as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as t}from"tslib";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{createFlowFieldFromData as r,getStreamlines as s}from"../../../2d/engine/flow/dataUtils.js";import{createFlowFieldFromDataTiled as o}from"./loadUtils.js";let a=class{constructor(){this._tileData=new Map}async generateStreamlines(t){const{flowData:e,simulationSettings:s,size:o}=t,a=l(r(s,e),s,o);return{result:{streamlines:a},transferList:a?.map(t=>t.buffer)}}async generateTiledStreamlines(t){const{simulationSettings:e,size:r,reset:s,flowDataTiles:a,extent:i,pixelSize:n}=t;this._updateTileData(a,s);const c=l(o(e,this._tileData,r,i,n),e,r);return{result:{streamlines:c},transferList:c?.map(t=>t.buffer)??[]}}_updateTileData(t,e){e&&this._tileData.forEach((e,r)=>{null==t.get(r)&&this._tileData.delete(r)}),t.forEach((t,e)=>{"delete"===t?this._tileData.delete(e):"on-worker"!==t&&this._tileData.set(e,t)})}};a=t([e("esri.views.3d.support.flow.FlowWorker")],a);const i=a;function l(t,e,r){if(null==t)return;const o=s(e,t,r[0],r[1]),a=[];for(const s of o){const t=new Float32Array(3*s.length);for(let e=0;e<s.length;e++)t[3*e]=s[e].x,t[3*e+1]=s[e].y,t[3*e+2]=s[e].t;a.push(t)}return a}export{i as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{WorkerHandle as e}from"../../../../core/workers/WorkerHandle.js";class r extends e{constructor(e){super("FlowWorker","generateStreamlines",{generateStreamlines:e=>[e.flowData.data.buffer,e.flowData.mask.buffer],generateTiledStreamlines:e=>{const r=[];return e.flowDataTiles.forEach(e=>{"string"!=typeof e&&r.push(e.data.buffer,e.mask.buffer)}),r}},e,{strategy:"dedicated"})}generateStreamlines(e,r){return this.invokeMethod("generateStreamlines",e,r)}generateTiledStreamlines(e,r){return this.invokeMethod("generateTiledStreamlines",e,r)}}export{r as FlowWorkerHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import
|
|
5
|
+
import t from"../../../../Color.js";import o from"../../../../core/RandomLCG.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newHalfFloatArray as r}from"../../../../geometry/support/HalfFloatArray.js";import{zValueInAbsoluteHeightMode as n}from"../../../../support/elevationInfoUtils.js";import{lineStripsToParameters as i,createGeometry as l}from"../engineContent/line.js";function a(t,a,s,p,c){const{spatialReference:h}=t,u=s.map(o=>{const r=[];for(let i=0;i<o.length;i+=3){const l=[o[i],o[i+1]],[s,m]=f(l,a),{absoluteZ:c}=n(s,m,0,h,t,p),u=e(s,m,c);t.renderCoordsHelper.toRenderCoords(u,h,u),r.push(u)}return r}),g=new o,d=s.map(t=>{const o=Math.floor(t.length/3),e=r(o);for(let r=0;r<o;r++)e[r]=t[3*r+2];return m(e,Math.floor(g.getIntRange(0,e.length))),e});return i(u,void 0,d).map(t=>l(c,t))}function s(o){return null==o?{}:{color:t.toUnitRGBA(o.color),width:o.trailWidth,cap:2,animationSpeed:o.flowSpeed,trailLength:o.trailLength,animation:3}}function f([t,o],e){const{extent:r,size:[n,i]}=e;return[t/n*r.width+r.xmin,(i-o)/i*r.height+r.ymin]}function m(t,o){if(0===t.length||o<0||o>=t.length)return;const e=t[o];for(let r=0;r<t.length;r++)t[r]-=e}export{a as createFlowGeometry,s as materialParametersFromRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{width as t,height as n,containsXY as l,intersects as u,create as o}from"../../../../geometry/support/aaBoundingRect.js";import{createFlowFieldFromData as r}from"../../../2d/engine/flow/dataUtils.js";class e{constructor(t,n,l,u,o,r){this.data=t,this.mask=n,this.width=l,this.height=u,this.lij=o,this.extent=r}}function i(t,n){let[l,r,e,i]=[null,null,null,null];for(const o of t){const t=o.extent;u(t,n)&&(l=c(t[0],l),r=c(t[1],r),e=s(t[2],e),i=s(t[3],i))}return null==l||null==r||null==e||null==i?null:o([l,r,e,i])}function s(t,n){return null==n?t:Math.max(t,n)}function c(t,n){return null==n?t:Math.min(t,n)}function a(u,o,e,i,s){const[c,a]=e;let f=null;const h=new Map;o.forEach(t=>{h.set(t.lij,r(u,t))});const d=(t,n,u)=>l(t.extent,n,u);return(l,u)=>{const r=Math.round(l),e=Math.round(u);if(r<0||r>=c||e<0||e>=a)return[0,0];const m=l/c*t(i)+i[0],p=(a-u)/a*n(i)+i[1];if(null==f||!d(f,m,p)){f=null;for(const[t,n]of o)if(d(n,m,p)){f=n;break}}if(null==f?.data)return[0,0];const x=h.get(f.lij);if(null==x)return[0,0];const g=f.extent;return x((m-g[0])/t(g)*s,s-(p-g[1])/n(g)*s)}}export{e as FlowDataTile,i as boundingRectOfTiles,a as createFlowFieldFromDataTiled};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import
|
|
5
|
+
import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as f}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as m,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,m=g(d,e),y=null!=m&&"type"in m&&a(m.type)?m:null,h={screenPoint:n,results:c,ground:{mapPoint:j(e,d),distance:f(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=m(n,e);if(null==i)return j(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return j(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return j(e,n)}return null}return j(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=m(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=U(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=j(e,c),f=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:f,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:f})}return t}function j(e,n,i){return n.getIntersectionPoint(F)?(i=V(e,F,i),2===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function U(e){const n=e.sourceLayer,i=e.layer,t=n&&"objectIdField"in n?n:i&&"objectIdField"in i?i:n;if(t){const n=t.objectIdField??c,i=e.attributes?.[n];if(i)return`o-${t.id}-${i}`}return`u-${e.uid}`}function E(e,n){return S(e,U(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,F,t)?n=F:(t=l.WGS84,o(n,e.renderSpatialReference,F,t)&&(n=F)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)L(s,U(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)M(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function L(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function M(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const F=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,U as getGraphicFilterUid,h as hitTest,j as intersectResultToMapPoint,w as toMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../../../geometry/support/Ellipsoid.js";import"./ComponentData.glsl.js";import"../../../../core/shaderLibrary/
|
|
5
|
+
import"../../../../../../../geometry/support/Ellipsoid.js";import"./ComponentData.glsl.js";import"../../../../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../../../../core/shaderLibrary/ShaderOutput.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../../../../core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../../../../core/shaderModules/glsl.js";import"../../../../core/shaderModules/Texture2DBindUniform.js";import"../../../../effects/weather/SnowCover.glsl.js";import"../../../../shaders/OutputColorHighlightOID.glsl.js";import"../../../../../../webgl/ShaderBuilder.js";import"../../../../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../../../../chunks/ComponentShader.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{releaseMaybe as e}from"../../../../../core/maybe.js";import{isPromiseLike as t}from"../../../../../core/promiseUtils.js";class s{constructor(s,r){this._textures=s,this.loadPromise=null,this._disposed=!1;const i=this._textures.acquire(r);t(i)?(i.then(t=>{this._disposed?e(t):this._textureRef=t}),this.loadPromise=i):this._textureRef=i}dispose(){this._textureRef=e(this._textureRef),this._disposed=!0}get glTexture(){return
|
|
5
|
+
import{releaseMaybe as e}from"../../../../../core/maybe.js";import{isPromiseLike as t}from"../../../../../core/promiseUtils.js";class s{constructor(s,r){this._textures=s,this.loadPromise=null,this._disposed=!1;const i=this._textures.acquire(r);t(i)?(i.then(t=>{this._disposed?e(t):this._textureRef=t}),this.loadPromise=i):this._textureRef=i}dispose(){this._textureRef=e(this._textureRef),this._disposed=!0}get glTexture(){return this._textureRef?.glTexture}}export{s as RenderTexture};
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
9
|
-
}`)}d.code.add(r`void forwardLinearDepth() {}`)}export{n as ForwardLinearDepth,i as addCalculateLinearDepth,o as addLinearDepth,t as addNearFar};
|
|
5
|
+
import{If as e,glsl as a}from"../shaderModules/glsl.js";function r(e){e.varyings.add("linearDepth","float",{invariant:!0})}function t(t,i){i&&r(t),t.vertex.code.add(a`
|
|
6
|
+
void forwardLinearDepth(float _linearDepth) { ${e(i,"linearDepth = _linearDepth;")} }
|
|
7
|
+
`)}export{t as ForwardLinearDepth,r as addLinearDepth};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ForwardLinearDepth as o}from"./ForwardLinearDepth.glsl.js";import{isColorOrColorEmission as r}from"./ShaderOutput.js";import{If as e,glsl as t}from"../shaderModules/glsl.js";function a(a,d){const i=r(d.output)&&d.receiveShadows;i&&o(a,!0),a.vertex.code.add(t`
|
|
6
|
+
void forwardLinearDepthToReadShadowMap() { ${e(i,"forwardLinearDepth(gl_Position.w);")} }
|
|
7
|
+
`)}export{a as ForwardLinearDepthToReadShadowMap};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ForwardLinearDepth as r}from"./ForwardLinearDepth.glsl.js";import{isShadowRelatedOutput as e}from"./ShaderOutput.js";import{VertexPosition as a}from"./attributes/VertexPosition.glsl.js";import{Float2BindUniform as o}from"../shaderModules/Float2BindUniform.js";import{glsl as t,If as n}from"../shaderModules/glsl.js";function i(r){r.vertex.uniforms.add(new o("nearFar",r=>r.camera.nearFar))}function d(r){r.vertex.code.add(t`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
6
|
+
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
7
|
+
}`)}function s(o,s){const{vertex:l}=o,u=e(s.output);u&&(o.include(a,s),r(o,!0),i(o),d(o)),l.code.add(t`
|
|
8
|
+
void forwardLinearDepthToWriteShadowMap() {
|
|
9
|
+
${n(u,"forwardLinearDepth(calculateLinearDepth(nearFar, vPosition_view.z));")}
|
|
10
|
+
}
|
|
11
|
+
`)}export{s as ForwardLinearDepthToWriteShadowMap,d as addCalculateLinearDepth,i as addNearFar};
|